Sfoglia il codice sorgente

预计变更数量,调整计算

MaiXinRong 5 anni fa
parent
commit
e29925b1b1
2 ha cambiato i file con 6 aggiunte e 2 eliminazioni
  1. 3 1
      app/lib/bills_pos_convert.js
  2. 3 1
      app/public/js/stage.js

+ 3 - 1
app/lib/bills_pos_convert.js

@@ -97,7 +97,9 @@ 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.sub(this.ctx.helper.sub(node.real_qty, node.quantity), node.end_qc_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);

+ 3 - 1
app/public/js/stage.js

@@ -179,7 +179,9 @@ $(document).ready(() => {
         pos.end_gather_qty = ZhCalc.add(pos.pre_gather_qty, pos.gather_qty);
         pos.sum = ZhCalc.add(pos.end_qc_qty, pos.quantity);
         pos.end_gather_percent = ZhCalc.mul(ZhCalc.div(pos.end_gather_qty, pos.sum), 100, 2);
-        pos.estimate_qty = ZhCalc.sub(ZhCalc.sub(pos.real_qty, pos.quantity), pos.end_qc_qty);
+        pos.estimate_qty = !checkZero(pos.real_qty)
+            ? ZhCalc.sub(ZhCalc.sub(pos.real_qty, pos.quantity), pos.end_qc_qty)
+            : null;
     };
     const stagePos = new StagePosData(stagePosSetting);