Explorar o código

多期比较,显示调整

MaiXinRong %!s(int64=2) %!d(string=hai) anos
pai
achega
53556b645f
Modificáronse 2 ficheiros con 18 adicións e 10 borrados
  1. 14 6
      app/public/js/measure_compare.js
  2. 4 4
      app/view/measure/compare.ejs

+ 14 - 6
app/public/js/measure_compare.js

@@ -9,7 +9,7 @@
  */
 
 const billsSpreadSetting = {
-    baseCols: [
+    preCols: [
         {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 150, formatter: '@', cellType: 'tree'},
         {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
         {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@'},
@@ -18,6 +18,7 @@ const billsSpreadSetting = {
         {title: '台账|数量', colSpan: '2|1', rowSpan: '1|1', field: 'quantity', hAlign: 2, width: 60, type: 'Number', },
         {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 60, type: 'Number', },
     ],
+    endCols: [],
     extraCols: [
         {title: '%s|数量', colSpan: '2|1', rowSpan: '1|1', field: '{%s}_qty{%d}', hAlign: 2, width: 60, type: 'Number', },
         {title: '|金额', colSpan: '|1', rowSpan: '|1', field: '{%s}_tp{%d}', hAlign: 2, width: 60, type: 'Number', },
@@ -32,10 +33,11 @@ const billsSpreadSetting = {
     selectedBackColor: '#fffacd',
 };
 const posSpreadSetting = {
-    baseCols: [
+    preCols: [
         {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 230, formatter: '@'},
         {title: '台账数量', colSpan: '1', rowSpan: '1', field: 'quantity', hAlign: 2, width: 60},
     ],
+    endCols: [],
     extraCols: [
         {title: '%s数量', colSpan: '1', rowSpan: '1', field: '{%s}_qty{%d}', hAlign: 2, width: 60},
     ],
@@ -51,7 +53,7 @@ const posSpreadSetting = {
 };
 
 const gclSpreadSetting = {
-    baseCols: [
+    preCols: [
         {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
         {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@'},
         {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, formatter: '@', cellType: 'unit'},
@@ -61,6 +63,7 @@ const gclSpreadSetting = {
         {title: '台账|数量', colSpan: '2|1', rowSpan: '1|1', field: 'quantity', hAlign: 2, width: 60, type: 'Number'},
         {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 60, type: 'Number'},
     ],
+    endCols: [],
     extraCols: [
         {title: '%s|数量', colSpan: '2|1', rowSpan: '1|1', field: '{%s}_qty{%d}', hAlign: 2, width: 60, type: 'Number', },
         {title: '|金额', colSpan: '|1', rowSpan: '|1', field: '{%s}_tp{%d}', hAlign: 2, width: 60, type: 'Number', },
@@ -75,9 +78,11 @@ const gclSpreadSetting = {
     readOnly: true,
 };
 const leafXmjSpreadSetting = {
-    baseCols: [
+    preCols: [
         {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 100, formatter: '@'},
         {title: '台账数量', colSpan: '1', rowSpan: '2', field: 'quantity', hAlign: 2, width: 60, type: 'Number'},
+    ],
+    endCols: [
         {title: '单位工程', colSpan: '1', rowSpan: '2', field: 'dwgc', hAlign: 0, width: 80, formatter: '@'},
         {title: '分部工程', colSpan: '1', rowSpan: '2', field: 'fbgc', hAlign: 0, width: 80, formatter: '@'},
         {title: '分项工程', colSpan: '1', rowSpan: '2', field: 'fxgc', hAlign: 0, width: 80, formatter: '@'},
@@ -110,12 +115,15 @@ function initSpreadSettingWithRoles(compareRoles) {
             }
         }
         setting.cols = [];
-        for (const col of setting.baseCols) {
+        for (const col of setting.preCols) {
             setting.cols.push(col);
         }
         for (const index in fieldSufs) {
             addExtraCols(fieldSufs[index], Roles[index]);
         }
+        for (const col of setting.endCols) {
+            setting.cols.push(col);
+        }
     }
     const fieldSufs = [], roles = [], trs = $('tr[stage-id]');
     for (let r of compareRoles) {
@@ -191,7 +199,7 @@ $(document).ready(() => {
         select: '#main-resize',
         callback: function () {
             billsSpread.refresh();
-            let bcontent = $("#xmujie").length > 0 ? $("#xmujie").height() : 0;
+            let bcontent = $("#main-bottom").length > 0 ? $("#main-bottom").height() : 0;
             $("#pos-spread").height(bcontent-30);
             posSpread.refresh();
         }

+ 4 - 4
app/view/measure/compare.ejs

@@ -7,10 +7,10 @@
                 <div class="bc-bar mb-1">
                     <ul class="nav nav-tabs">
                         <li class="nav-item">
-                            <a class="nav-link active" data-toggle="tab" href="#tz" role="tab">台账</a>
+                            <a class="nav-link" data-toggle="tab" href="#tz" role="tab">台账</a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" data-toggle="tab" href="#gcl" role="tab">工程量清单</a>
+                            <a class="nav-link active" data-toggle="tab" href="#gcl" role="tab">工程量清单</a>
                         </li>
                         <li class="nav-item">
                             <div>
@@ -64,7 +64,7 @@
         <div class="c-header p-0"></div>
         <div class="c-body">
             <div class="tab-content">
-                <div class="tab-pane active" id="tz">
+                <div class="tab-pane" id="tz">
                     <div class="sjs-height-1" id="bills-spread">
                     </div>
                     <div class="bcontent-wrap" id="main-bottom">
@@ -97,7 +97,7 @@
                             </ul>
                         </div>
                         <div class="tab-content">
-                            <div class="tab-pane active" id="xmujie">
+                            <div class="tab-pane active">
                                 <div class="sp-wrap" id="leaf-xmj-spread">
                                 </div>
                             </div>