Просмотр исходного кода

1. 0号台账,计量单元,图册号、备注
2. 计量期,计量单元,图册号、备注、本期批注

MaiXinRong 5 лет назад
Родитель
Сommit
f729819c08
4 измененных файлов с 35 добавлено и 8 удалено
  1. 27 3
      app/lib/bills_pos_convert.js
  2. 3 0
      app/lib/ledger.js
  3. 2 2
      app/view/ledger/bwtz.ejs
  4. 3 3
      app/view/stage/bwtz.ejs

+ 27 - 3
app/lib/bills_pos_convert.js

@@ -10,6 +10,7 @@
 
 const Ledger = require('./ledger');
 const splitChar = '-';
+const mergeChar = ';';
 
 class BillsPosConvert {
 
@@ -122,9 +123,19 @@ class BillsPosConvert {
             for (const p of pos) {
                 const posUnit = xmj.unitTree.addNode({pos_name: p.name,
                     b_code: null, name: '', unit: null, unit_price: null});
+                if (p.drawing_code && posUnit.drawing_code.indexOf(p.drawing_code) <= 0)
+                    posUnit.drawing_code.push(p.drawing_code);
+                if (p.memo) posUnit.memo.push(p.memo);
+                if (node.postil) posUnit.postil.push(node.postil);
+
                 const gclUnit = xmj.unitTree.addNode({pos_name: '',
                     b_code: node.b_code, name: node.name, unit: node.unit, unit_price: node.unit_price
                 }, posUnit);
+                if (node.drawing_code && gclUnit.drawing_code.indexOf(node.drawing_code) <= 0)
+                    gclUnit.drawing_code.push(node.drawing_code);
+                if (node.memo) gclUnit.memo.push(node.memo);
+                if (node.postil) gclUnit.postil.push(node.postil);
+
                 //loadField(gclUnit, p, baseCalcFields);
                 this._loadPosCalcFields(gclUnit, p);
                 if (!gclUnit.changes) gclUnit.changes = [];
@@ -135,9 +146,15 @@ class BillsPosConvert {
                 }
             }
         } else {
-            const unit = xmj.unitTree.addNode({pos_name: '',
-                b_code: node.b_code, name: node.name, unit: node.unit, unit_price: node.unit_price});
-            //loadField(unit, node, baseCalcFields);
+            const unit = xmj.unitTree.addNode({
+                pos_name: '',
+                b_code: node.b_code, name: node.name, unit: node.unit, unit_price: node.unit_price,
+            });
+            if (node.drawing_code && unit.drawing_code.indexOf(node.drawing_code) <= 0)
+                unit.drawing_code.push(node.drawing_code);
+            if (node.memo) unit.memo.push(node.memo);
+            if (node.postil) unit.postil.push(node.postil);
+
             this._loadBillsCalcFields(unit, node);
             if (!unit.changes) unit.changes = [];
             for (const c of this.bpcChange) {
@@ -226,6 +243,13 @@ class BillsPosConvert {
             } else {
                 this._calculateChild(node);
             }
+
+            if (node.drawing_code && node.drawing_code.length > 0)
+                node.drawing_code_merge = node.drawing_code.join(mergeChar);
+            if (node.memo && node.memo.length > 0)
+                node.memo_merge = node.memo.join(mergeChar);
+            if (node.postil && node.postil.length > 0)
+                node.postil_merge = node.postil.join(mergeChar);
         }
     }
     _recursiveCalculateAndSort(nodes) {

+ 3 - 0
app/lib/ledger.js

@@ -355,6 +355,9 @@ class filterGatherTree extends baseTree {
         if (item) return item;
 
         item = data;
+        item.drawing_code = [];
+        item.memo = [];
+        item.postil = [];
         item[this.setting.id] = this.newId;
         const keyName = itemsPre + item[this.setting.id];
         item.children = [];

+ 2 - 2
app/view/ledger/bwtz.ejs

@@ -69,8 +69,8 @@
             {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
             {title: '台账|数量', colSpan: '2|1', rowSpan: '1|1', field: 'quantity', hAlign: 2, width: 80, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 80, type: 'Number'},
-            {title: '图(册)号', colSpan: '1', rowSpan: '2', field: 'drawing_code', hAlign: 0, width: 100, formatter: '@'},
-            {title: '备注', colSpan: '1', rowSpan: '2', field: 'memo', hAlign: 0, width: 120, formatter: '@', cellType: 'ellipsisAutoTip'},
+            {title: '图(册)号', colSpan: '1', rowSpan: '2', field: 'drawing_code_merge', hAlign: 0, width: 100, formatter: '@'},
+            {title: '备注', colSpan: '1', rowSpan: '2', field: 'memo_merge', hAlign: 0, width: 120, formatter: '@', cellType: 'ellipsisAutoTip'},
         ],
         emptyRows: 0,
         headRows: 2,

+ 3 - 3
app/view/stage/bwtz.ejs

@@ -91,9 +91,9 @@
             {title: '截止本期完成计量|数量', colSpan: '3|1', rowSpan: '1|1', field: 'end_gather_qty', hAlign: 2, width: 60, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_gather_tp', hAlign: 2, width: 60, type: 'Number'},
             {title: '|完成率(%)', colSpan: '1', rowSpan: '|1', field: 'end_gather_percent', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
-            {title: '图(册)号', colSpan: '1', rowSpan: '2', field: 'drawing_code', hAlign: 0, width: 80, formatter: '@'},
-            {title: '本期批注', colSpan: '1', rowSpan: '2', field: 'postil', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'},
-            {title: '备注', colSpan: '1', rowSpan: '2', field: 'memo', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'},
+            {title: '图(册)号', colSpan: '1', rowSpan: '2', field: 'drawing_code_merge', hAlign: 0, width: 80, formatter: '@'},
+            {title: '本期批注', colSpan: '1', rowSpan: '2', field: 'postil_merge', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'},
+            {title: '备注', colSpan: '1', rowSpan: '2', field: 'memo_merge', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'},
         ],
         emptyRows: 0,
         headRows: 2,