Browse Source

变更后计算相关

MaiXinRong 2 months ago
parent
commit
ada75c4454
2 changed files with 13 additions and 13 deletions
  1. 4 4
      app/const/spread.js
  2. 9 9
      app/public/js/stage.js

+ 4 - 4
app/const/spread.js

@@ -144,7 +144,7 @@ const BaseSetCol = {
         { key: 'unit_price', name: '单价', fixed: ['alias'], bills: 1, pos: 0 },
         { key: 'deal_calc', name: '签约', fixed: [], bills: 1, pos: 0 },
         { key: 'tz_calc', name: '台账', fixed: [], bills: 1, pos: 1},
-        { key: 'tz2_calc', name: '变更后台账', fixed: [], bills: 1, pos: 1},
+        { key: 'tz2_calc', name: '变更后', fixed: [], bills: 1, pos: 1},
         { key: 'real_qty', name: '现场实际数量', fixed: ['valid', 'alias'], bills: 0, pos: 1},
         { key: 'estimate_qty', name: '预计变更数量', fixed: ['valid', 'alias'], bills: 0, pos: 1},
         { key: 'cur_calc', name: '本期计量', fixed: ['alias'], bills: 1, pos: 1, },
@@ -195,7 +195,7 @@ const BaseSetCol = {
         { key: 'unit_price', name: '单价', fixed: ['alias'], bills: 1, pos: 0 },
         { key: 'deal_calc', name: '签约', fixed: [], bills: 1, pos: 0 },
         { key: 'tz_calc', name: '台账', fixed: [], bills: 1, pos: 1},
-        { key: 'tz2_calc', name: '变更后台账', fixed: [], bills: 1, pos: 1},
+        { key: 'tz2_calc', name: '变更后', fixed: [], bills: 1, pos: 1},
         { key: 'real_qty', name: '现场实际数量', fixed: ['valid', 'alias'], bills: 0, pos: 1},
         { key: 'estimate_qty', name: '预计变更数量', fixed: ['valid', 'alias'], bills: 0, pos: 1},
         { key: 'cur_calc', name: '本期计量', fixed: ['alias'], bills: 1, pos: 1, },
@@ -610,7 +610,7 @@ const BaseSpreadColSetting = {
                 {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             ],
             tz2_calc: [
-                {title: '变更后台账|数量', colSpan: '2|1', rowSpan: '1|1', field: 'tz2_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number', aliasFormat: '{%s}|数量'},
+                {title: '变更后|数量', colSpan: '2|1', rowSpan: '1|1', field: 'tz2_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number', aliasFormat: '{%s}|数量'},
                 {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'tz2_tp', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             ],
             deal_calc: [
@@ -774,7 +774,7 @@ const BaseSpreadColSetting = {
                 {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             ],
             tz2_calc: [
-                {title: '变更后台账|数量', colSpan: '2|1', rowSpan: '1|1', field: 'tz2_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number', aliasFormat: '{%s}|数量'},
+                {title: '变更后|数量', colSpan: '2|1', rowSpan: '1|1', field: 'tz2_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number', aliasFormat: '{%s}|数量'},
                 {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'tz2_tp', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             ],
             deal_calc: [

+ 9 - 9
app/public/js/stage.js

@@ -321,7 +321,7 @@ $(document).ready(() => {
             node.end_final_1_qty = ZhCalc.add(node.end_qc_qty, node.final_1_qty);
             node.due_final_qty = ZhCalc.add(node.quantity, node.due_qc_qty);
             node.end_ex_stage_qty1 = ZhCalc.add(node.ex_stage_qty1, node.pre_ex_stage_qty1);
-            node.tz2_qty = ZhCalc.add(node.quantity, node.tz2_qc_qty);
+            node.tz2_qty = ZhCalc.sum([node.quantity, node.tz_qc_qty, node.tz_qc_minus_qty]);
         }
         node.pre_gather_tp = ZhCalc.add(node.pre_contract_tp, node.pre_qc_tp);
         node.gather_tp = ZhCalc.sum([node.contract_tp, node.qc_tp, node.pc_tp]);
@@ -339,7 +339,7 @@ $(document).ready(() => {
                 node.end_correct_tp = node.end_gather_tp;
             }
         }
-        node.tz2_tp = ZhCalc.add(node.total_price, node.tz2_qc_tp);
+        node.tz2_tp = ZhCalc.sum([node.total_price, node.tz_qc_tp, node.tz_qc_minus_tp]);
         node.end_gather_percent = ZhCalc.mul(ZhCalc.div(node.end_gather_tp, node.end_final_tp), 100, 2);
         node.end_correct_percent = ZhCalc.mul(ZhCalc.div(node.end_correct_tp, node.end_final_tp), 100, 2);
         node.final_dgn_price = ZhCalc.round(ZhCalc.div(node.end_gather_tp, ZhCalc.add(node.deal_dgn_qty1, node.c_dgn_qty1)), tenderInfo.decimal.up);
@@ -370,7 +370,7 @@ $(document).ready(() => {
         pos.end_final_1_qty = ZhCalc.add(pos.end_qc_qty, pos.final_1_qty);
         pos.end_ex_stage_qty1 = ZhCalc.add(pos.pre_ex_stage_qty1, pos.ex_stage_qty1);
         pos.due_final_qty = ZhCalc.add(pos.quantity, pos.due_qc_qty);
-        pos.tz2_qty = ZhCalc.add(pos.quantity, pos.tz2_qc_qty);
+        pos.tz2_qty = ZhCalc.sum([pos.quantity, pos.tz_qc_qty, pos.tz_qc_minus_qty]);
     };
     const stagePos = new StagePosData(stagePosSetting);
 
@@ -1559,11 +1559,11 @@ $(document).ready(() => {
 
                     if (!node) continue;
                     if (changeBills.is_valuation) {
-                        node.tz2_qc_qty = ZhCalc.add(node.tz2_qc_qty, changeBills.checked_amount);
-                        node.tz2_qc_tp = ZhCalc.add(node.tz2_qc_tp, changeBills.checked_price);
+                        node.tz_qc_qty = ZhCalc.add(node.tz_qc_qty, changeBills.checked_amount);
+                        node.tz_qc_tp = ZhCalc.add(node.tz_qc_tp, changeBills.checked_price);
                     } else {
-                        node.tz2_qc_qty = ZhCalc.sub(node.tz2_qc_qty, changeBills.checked_amount);
-                        node.tz2_qc_tp = ZhCalc.sub(node.tz2_qc_tp, changeBills.checked_price);
+                        node.tz_qc_minus_qty = ZhCalc.add(node.tz_qc_minus_qty, changeBills.checked_amount);
+                        node.tz_qc_minus_tp = ZhCalc.add(node.tz_qc_minus_tp, changeBills.checked_price);
                     }
 
                     const posData = pos.getLedgerPos(node.id);
@@ -1573,9 +1573,9 @@ $(document).ready(() => {
                             : posData[0];
                         if (changePos) {
                             if (changeBills.is_valuation) {
-                                pos.tz2_qc_qty = ZhCalc.add(pos.tz2_qc_qty, changeBills.checked_amount);
+                                pos.tz_qc_qty = ZhCalc.add(pos.tz_qc_qty, changeBills.checked_amount);
                             } else {
-                                pos.tz2_qc_qty = ZhCalc.sub(pos.tz2_qc_qty, changeBills.checked_amount);
+                                pos.tz_qc_minus_qty = ZhCalc.add(pos.tz_qc_minus_qty, changeBills.checked_amount);
                             }
                         }
                     }