compare.ejs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <% include ./sub_menu.ejs %>
  2. <div class="panel-content">
  3. <div class="panel-title">
  4. <div class="title-main d-flex">
  5. <% include ./sub_mini_menu.ejs %>
  6. <div class="d-inline-block">
  7. <div class="dropdown">
  8. <button class="btn btn-sm btn-light dropdown-toggle text-primary" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  9. <i class="fa fa-list-ol"></i> 显示层级
  10. </button>
  11. <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
  12. <a class="dropdown-item" name="showLevel" tag="1" href="javascirpt: void(0);">第一层</a>
  13. <a class="dropdown-item" name="showLevel" tag="2" href="javascirpt: void(0);">第二层</a>
  14. <a class="dropdown-item" name="showLevel" tag="3" href="javascirpt: void(0);">第三层</a>
  15. <a class="dropdown-item" name="showLevel" tag="4" href="javascirpt: void(0);">第四层</a>
  16. <a class="dropdown-item" name="showLevel" tag="5" href="javascirpt: void(0);">第五层</a>
  17. <a class="dropdown-item" name="showLevel" tag="last" href="javascirpt: void(0);">最底层</a>
  18. <a class="dropdown-item" name="showLevel" tag="leafXmj" href="javascirpt: void(0);">只显示项目节</a>
  19. </div>
  20. </div>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="content-wrap row pr-46">
  25. <div class="c-header p-0 col-12"></div>
  26. <!--核心内容(两栏)-->
  27. <div class="row w-100 sub-content">
  28. <!--左栏-->
  29. <div class="c-body" id="left-view" style="width: 100%">
  30. <!--0号台账模式-->
  31. <div class="sjs-height-1" style="overflow: hidden" id="bills-spread">
  32. </div>
  33. <% if (ctx.tender.data.measure_type === measureType.tz.value) { %>
  34. <div class="bcontent-wrap">
  35. <div id="revise-resize" class="resize-y" id="top-spr" r-Type="height" div1=".sjs-height-1" div2=".bcontent-wrap" title="调整大小"><!--调整上下高度条--></div>
  36. <div class="bc-bar mb-1">
  37. <ul class="nav nav-tabs">
  38. <li class="nav-item">
  39. <a class="nav-link active" href="javascript:void(0)">计量单元</a>
  40. </li>
  41. <li class="nav-item" id="pos-search">
  42. </li>
  43. </ul>
  44. </div>
  45. <div class="sp-wrap" id="pos-spread">
  46. </div>
  47. </div>
  48. <% } %>
  49. </div>
  50. <!--右栏-->
  51. <div class="c-body" id="right-view" style="display: none; width: 33%;">
  52. <div class="resize-x" id="revise-right-spr" r-Type="width" div1="#left-view" div2="#right-view" title="调整大小" a-type="percent"><!--调整左右高度条--></div>
  53. <div class="tab-content">
  54. <div id="search" class="tab-pane">
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. <!--右侧菜单-->
  60. <div class="side-menu">
  61. <!--右侧菜单-->
  62. <ul class="nav flex-column right-nav" id="side-menu">
  63. <li class="nav-item">
  64. <a class="nav-link" content="#search" href="javascript: void(0);">查找定位</a>
  65. </li>
  66. </ul>
  67. </div>
  68. </div>
  69. </div>
  70. <script src="/public/js/moment/moment.min.js"></script>
  71. <script>
  72. const isTz = <%- ctx.tender.data.measure_type === measureType.tz.value %>;
  73. const thousandth = <%- ctx.tender.info.display.thousandth %>;
  74. const decimal = JSON.parse('<%- JSON.stringify(ctx.tender.info.decimal) %>');
  75. const compareFields = {
  76. info: ['code', 'b_code', 'name', 'unit'],
  77. leafCalc: ['unit_price', 'sgfh_qty', 'sgfh_tp', 'qtcl_qty', 'qtcl_tp', 'sjcl_qty', 'sjcl_tp', 'deal_qty', 'deal_tp', 'quantity', 'total_price'],
  78. parentCalc: ['dgn_qty1', 'dgn_qty2',],
  79. }
  80. const getCompare = function (node, field, prefix, defaultValue) {
  81. const result = {};
  82. for (const f of field) {
  83. result[f] = node[prefix + f] || defaultValue;
  84. }
  85. return result;
  86. };
  87. const billsSpreadSetting = {
  88. cols: [
  89. {title: '', colSpan: '1', rowSpan: '3', field: 'differ_str', hAlign: 1, width: 20, formatter: '@'},
  90. {title: '修订台账|项目节编号', colSpan: '16|1', rowSpan: '1|2', field: 'new_code', hAlign: 0, width: 145, formatter: '@', cellType: 'tree'},
  91. {title: '|清单编号', colSpan: '|1', rowSpan: '|2', field: 'new_b_code', hAlign: 0, width: 70, formatter: '@'},
  92. {title: '|名称', colSpan: '|1', rowSpan: '|2', field: 'new_name', hAlign: 0, width: 185, formatter: '@'},
  93. {title: '|单位', colSpan: '|1', rowSpan: '|2', field: 'new_unit', hAlign: 1, width: 50, formatter: '@'},
  94. {title: '|单价', colSpan: '|1', rowSpan: '|2', field: 'new_unit_price', hAlign: 2, width: 60, type: 'Number'},
  95. {title: '|项目节数量|数量1', colSpan: '|2|1', rowSpan: '|1|1', field: 'new_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
  96. {title: '||数量2', colSpan: '||1', rowSpan: '||1', field: 'new_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
  97. {title: '|经济指标', colSpan: '|1', rowSpan: '|2', field: 'new_dgn_price', hAlign: 2, width: 60, type: 'Number'},
  98. {title: '|设计量|数量', colSpan: '|2|1', rowSpan: '|1|1', field: 'new_sgfh_qty', hAlign: 2, width: 60, type: 'Number'},
  99. {title: '||金额', colSpan: '||1', rowSpan: '||1', field: 'new_sgfh_tp', hAlign: 2, width: 60, type: 'Number'},
  100. {title: '|设计错漏增减|数量', colSpan: '|2|1', rowSpan: '|1|1', field: 'new_sjcl_qty', hAlign: 2, width: 60, type: 'Number'},
  101. {title: '||金额', colSpan: '||1', rowSpan: '||1', field: 'new_sjcl_tp', hAlign: 2, width: 60, type: 'Number'},
  102. {title: '|其他错漏增减|数量', colSpan: '|2|1', rowSpan: '|1|1', field: 'new_qtcl_qty', hAlign: 2, width: 60, type: 'Number'},
  103. {title: '||金额', colSpan: '||1', rowSpan: '||1', field: 'new_qtcl_tp', hAlign: 2, width: 60, type: 'Number'},
  104. {title: '|台账小计|数量', colSpan: '|2|1', rowSpan: '|1|1', field: 'new_quantity', hAlign: 2, width: 60, type: 'Number'},
  105. {title: '||金额', colSpan: '||1', rowSpan: '||1', field: 'new_total_price', hAlign: 2, width: 60, type: 'Number'},
  106. {title: '原台账|项目节编号', colSpan: '16|1', rowSpan: '1|2', field: 'org_code', hAlign: 0, width: 145, formatter: '@', cellType: 'tree'},
  107. {title: '|清单编号', colSpan: '|1', rowSpan: '|2', field: 'org_b_code', hAlign: 0, width: 70, formatter: '@'},
  108. {title: '|名称', colSpan: '|1', rowSpan: '|2', field: 'org_name', hAlign: 0, width: 185, formatter: '@'},
  109. {title: '|单位', colSpan: '|1', rowSpan: '|2', field: 'org_unit', hAlign: 1, width: 50, formatter: '@', cellType: 'unit'},
  110. {title: '|单价', colSpan: '|1', rowSpan: '|2', field: 'org_unit_price', hAlign: 2, width: 60, type: 'Number'},
  111. {title: '|项目节数量|数量1', colSpan: '|2|1', rowSpan: '|1|1', field: 'org_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
  112. {title: '||数量2', colSpan: '||1', rowSpan: '||1', field: 'org_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
  113. {title: '|经济指标', colSpan: '|1', rowSpan: '|2', field: 'org_dgn_price', hAlign: 2, width: 60, type: 'Number'},
  114. {title: '|设计量|数量', colSpan: '|2|1', rowSpan: '|1|1', field: 'org_sgfh_qty', hAlign: 2, width: 60, type: 'Number'},
  115. {title: '||金额', colSpan: '||1', rowSpan: '||1', field: 'org_sgfh_tp', hAlign: 2, width: 60, type: 'Number'},
  116. {title: '|设计错漏增减|数量', colSpan: '|2|1', rowSpan: '|1|1', field: 'org_sjcl_qty', hAlign: 2, width: 60, type: 'Number'},
  117. {title: '||金额', colSpan: '||1', rowSpan: '||1', field: 'org_sjcl_tp', hAlign: 2, width: 60, type: 'Number'},
  118. {title: '|其他错漏增减|数量', colSpan: '|2|1', rowSpan: '|1|1', field: 'org_qtcl_qty', hAlign: 2, width: 60, type: 'Number'},
  119. {title: '||金额', colSpan: '||1', rowSpan: '||1', field: 'org_qtcl_tp', hAlign: 2, width: 60, type: 'Number'},
  120. {title: '|台账小计|数量', colSpan: '|2|1', rowSpan: '|1|1', field: 'org_quantity', hAlign: 2, width: 60, type: 'Number'},
  121. {title: '||金额', colSpan: '||1', rowSpan: '||1', field: 'org_total_price', hAlign: 2, width: 60, type: 'Number'},
  122. ],
  123. emptyRows: 3,
  124. headRows: 3,
  125. headRowHeight: [25, 25, 25],
  126. defaultRowHeight: 21,
  127. headerFont: '12px 微软雅黑',
  128. font: '12px 微软雅黑',
  129. readOnly: true,
  130. };
  131. const posSpreadSetting = {
  132. cols: [
  133. {title: '修订台账|计量单元', colSpan: '6|1', rowSpan: '1|2', field: 'org_name', hAlign: 0, width: 230, formatter: '@'},
  134. {title: '|位置', colSpan: '|1', rowSpan: '|2', field: 'org_position', hAlign: 0, width: 60, formatter: '@'},
  135. {title: '|台账数量|设计量', colSpan: '|4|1', rowSpan: '|1|1', field: 'org_sgfh_qty', hAlign: 2, width: 100, type: 'Number'},
  136. {title: '||设计错漏增减', colSpan: '||1', rowSpan: '||1', field: 'org_sjcl_qty', hAlign: 2, width: 100, type: 'Number'},
  137. {title: '||其他错漏增减', colSpan: '||1', rowSpan: '||1', field: 'org_qtcl_qty', hAlign: 2, width: 100, type: 'Number'},
  138. {title: '||小计', colSpan: '||1', rowSpan: '||1', field: 'org_quantity', hAlign: 2, width: 60, type: 'Number'},
  139. {title: '原台账|计量单元', colSpan: '6|1', rowSpan: '1|2', field: 'new_name', hAlign: 0, width: 230, formatter: '@'},
  140. {title: '|位置', colSpan: '|1', rowSpan: '|2', field: 'new_position', hAlign: 0, width: 60, formatter: '@'},
  141. {title: '|台账数量|设计量', colSpan: '|4|1', rowSpan: '|1|1', field: 'new_sgfh_qty', hAlign: 2, width: 100, type: 'Number'},
  142. {title: '||设计错漏增减', colSpan: '||1', rowSpan: '||1', field: 'new_sjcl_qty', hAlign: 2, width: 100, type: 'Number'},
  143. {title: '||其他错漏增减', colSpan: '||1', rowSpan: '||1', field: 'new_qtcl_qty', hAlign: 2, width: 100, type: 'Number'},
  144. {title: '||小计', colSpan: '||1', rowSpan: '||1', field: 'new_quantity', hAlign: 2, width: 60, type: 'Number'},
  145. ],
  146. emptyRows: 3,
  147. headRows: 3,
  148. headRowHeight: [25, 25, 25],
  149. headColWidth: [30],
  150. defaultRowHeight: 21,
  151. headerFont: '12px 微软雅黑',
  152. font: '12px 微软雅黑',
  153. readOnly: true,
  154. }
  155. </script>