فهرست منبع

期计量,部位台账,调整

MaiXinRong 4 سال پیش
والد
کامیت
0c8088e69b
2فایلهای تغییر یافته به همراه11 افزوده شده و 4 حذف شده
  1. 7 2
      app/lib/bills_pos_convert.js
  2. 4 2
      app/view/stage/bwtz.ejs

+ 7 - 2
app/lib/bills_pos_convert.js

@@ -97,7 +97,7 @@ class BillsPosConvert {
         node.pre_gather_qty = this.ctx.helper.add(node.pre_gather_qty, data.pre_gather_qty);
 
         node.real_qty = this.ctx.helper.add(node.real_qty, data.real_qty);
-        node.estimate_qty = this.ctx.helper.checkZero(node.real_qty)
+        node.estimate_qty = !this.ctx.helper.checkZero(node.real_qty)
             ? this.ctx.helper.sub(this.ctx.helper.sub(node.real_qty, node.quantity), node.end_qc_qty)
             : null;
     }
@@ -189,7 +189,7 @@ class BillsPosConvert {
     }
 
     _calculateChild(child) {
-        //const tpDecimal = this.ctx.tender.info.decimal.tp;
+        const tpDecimal = this.ctx.tender.info.decimal.tp;
 
         child.gather_qty = this.ctx.helper.add(child.contract_qty, child.qc_qty);
         child.pre_gather_qty = this.ctx.helper.add(child.pre_contract_qty, child.pre_qc_qty);
@@ -219,6 +219,9 @@ class BillsPosConvert {
         child.final_tp = this.ctx.helper.add(child.total_price, child.end_qc_tp);
         child.end_gather_percent = this.ctx.helper.mul(this.ctx.helper.div(child.end_gather_tp, child.final_tp, 4), 100);
 
+        child.real_tp = this.ctx.helper.mul(child.real_qty, child.unit_price, tpDecimal);
+        child.estimate_tp = this.ctx.helper.mul(child.estimate_qty, child.unit_price, tpDecimal);
+
         child.bgl_code = this.ctx.helper._.uniq(this.ctx.helper._.map(child.changes, 'c_code')).join(';');
     }
     _calculateNode(node, children) {
@@ -233,6 +236,8 @@ class BillsPosConvert {
             node.end_contract_tp = this.ctx.helper.add(node.end_contract_tp, child.end_contract_tp);
             node.end_qc_tp = this.ctx.helper.add(node.end_qc_tp, child.end_qc_tp);
             node.end_gather_tp = this.ctx.helper.add(node.end_gather_tp, child.end_gather_tp);
+            node.real_tp = this.ctx.helper.add(node.real_tp, child.real_tp);
+            node.estimate_tp = this.ctx.helper.add(node.estimate_tp, child.estimate_tp);
         }
         node.final_tp = this.ctx.helper.add(node.total_price, node.end_qc_tp);
         node.end_gather_percent = this.ctx.helper.mul(this.ctx.helper.div(node.end_gather_tp, node.final_tp, 4), 100);

+ 4 - 2
app/view/stage/bwtz.ejs

@@ -128,8 +128,10 @@
             {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: 60, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 60, type: 'Number'},
-            {title: '现场实际数量', colSpan: '1', rowSpan: '2', field: 'real_qty', hAlign: 2, width: 60, type: 'Number'},
-            {title: '预计变更数量', colSpan: '1', rowSpan: '2', field: 'estimate_qty', hAlign: 2, width: 60, type: 'Number', readOnly: true},
+            {title: '现场实际|数量', colSpan: '2|1', rowSpan: '1|1', field: 'real_qty', hAlign: 2, width: 60, type: 'Number'},
+            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'real_tp', hAlign: 2, width: 60, type: 'Number'},
+            {title: '预计变更|数量', colSpan: '2|1', rowSpan: '1|1', field: 'estimate_qty', hAlign: 2, width: 60, type: 'Number', readOnly: true},
+            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'estimate_tp', hAlign: 2, width: 60, type: 'Number'},
             {title: '本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'contract_qty', hAlign: 2, width: 60, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'contract_tp', hAlign: 2, width: 60, type: 'Number'},
             {title: '本期数量变更|数量', colSpan: '3|1', rowSpan: '1|1', field: 'qc_qty', hAlign: 2, width: 60, type: 'Number'},