Selaa lähdekoodia

部位台账,计算相关

MaiXinRong 4 vuotta sitten
vanhempi
commit
9cf9bade57
2 muutettua tiedostoa jossa 5 lisäystä ja 3 poistoa
  1. 4 3
      app/lib/bills_pos_convert.js
  2. 1 0
      app/public/js/stage_bwtz.js

+ 4 - 3
app/lib/bills_pos_convert.js

@@ -97,9 +97,6 @@ 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)
-            ? this.ctx.helper.sub(this.ctx.helper.sub(node.real_qty, node.quantity), node.end_qc_qty)
-            : null;
     }
     _loadBillsCalcFields(node, data) {
         node.quantity = this.ctx.helper.add(node.quantity, data.quantity);
@@ -197,6 +194,10 @@ class BillsPosConvert {
         child.end_qc_qty = this.ctx.helper.add(child.qc_qty, child.pre_qc_qty);
         child.end_gather_qty = this.ctx.helper.add(child.gather_qty, child.pre_gather_qty);
 
+        child.estimate_qty = !this.ctx.helper.checkZero(child.real_qty)
+            ? this.ctx.helper.sub(this.ctx.helper.sub(child.real_qty, child.quantity), child.end_qc_qty)
+            : null;
+
         // v1
         // child.total_price = this.ctx.helper.mul(child.unit_price, child.quantity, tpDecimal);
         // child.contract_tp = this.ctx.helper.mul(child.unit_price, child.contract_qty, tpDecimal);

+ 1 - 0
app/public/js/stage_bwtz.js

@@ -34,6 +34,7 @@ $(document).ready(() => {
             } else {
                 SpreadJsObj.initSheet(unitSheet, unitSpreadSetting);
             }
+            SpreadJsObj.resetTopAndSelect(unitSheet);
         }
     };
     xmjSpread.bind(spreadNS.Events.SelectionChanged, function (e, info) {