浏览代码

Merge branch 'master' of http://192.168.1.41:3000/maixinrong/Calculation

laiguoran 4 年之前
父节点
当前提交
7ddafe5bb4
共有 2 个文件被更改,包括 5 次插入3 次删除
  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) {