Jelajahi Sumber

计量台账,计算1相关

MaiXinRong 2 bulan lalu
induk
melakukan
bf93e037cd
2 mengubah file dengan 5 tambahan dan 3 penghapusan
  1. 1 1
      app/public/js/stage.js
  2. 4 2
      app/service/stage_pos.js

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

@@ -365,7 +365,7 @@ $(document).ready(() => {
         pos.final_1_qty = ZhCalc.add(pos.end_qc_minus_qty, pos.quantity);
         pos.deal_final_1_qty = ZhCalc.add(pos.end_qc_minus_qty, pos.deal_qty);
         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_qty_1)
+        pos.end_ex_stage_qty1 = ZhCalc.add(pos.pre_ex_stage_qty1, pos.ex_stage_qty1);
     };
     const stagePos = new StagePosData(stagePosSetting);
 

+ 4 - 2
app/service/stage_pos.js

@@ -316,12 +316,14 @@ module.exports = app => {
                     updateBills.sjcl_qty = this.ctx.helper.add(updateBills.sjcl_qty, calcData.sjcl_qty);
                     updateBills.qtcl_qty = this.ctx.helper.add(updateBills.qtcl_qty, calcData.qtcl_qty);
                     updateBills.quantity = this.ctx.helper.add(updateBills.quantity, calcData.quantity);
+                    updateBills.ex_qty1 = this.ctx.helper.add(updateBills.ex_qty1, calcData.ex_qty1);
                 }
                 const info = this.ctx.tender.info;
                 updateBills.sgfh_tp = this.ctx.helper.mul(updateBills.sgfh_qty, bills.unit_price, info.decimal.tp);
                 updateBills.sjcl_tp = this.ctx.helper.mul(updateBills.sjcl_qty, bills.unit_price, info.decimal.tp);
                 updateBills.qtcl_tp = this.ctx.helper.mul(updateBills.qtcl_qty, bills.unit_price, info.decimal.tp);
                 updateBills.total_price = this.ctx.helper.mul(updateBills.quantity, bills.unit_price, info.decimal.tp);
+                updateBills.ex_tp1 = this.ctx.helper.mul(updateBills.ex_qty1, bills.unit_price, info.decimal.tp);
             }
 
             const transaction = await this.db.beginTransaction();
@@ -579,8 +581,8 @@ module.exports = app => {
          * @returns {Promise<*>}
          */
         async getPosGather(tid, sid, lid, transaction) {
-            const calcQtySql = 'SELECT SUM(`contract_qty`) As `contract_qty`, SUM(`qc_qty`) As `qc_qty`, SUM(`qc_minus_qty`) AS `qc_minus_qty`, SUM(`positive_qc_qty`) As `positive_qc_qty`, SUM(`negative_qc_qty`) As `negative_qc_qty` FROM (' +
-                '  SELECT `contract_qty`, `qc_qty`, `qc_minus_qty`, `positive_qc_qty`, `negative_qc_qty` FROM ' + this.ctx.service.stagePos.tableName + ' As Pos ' +
+            const calcQtySql = 'SELECT SUM(`contract_qty`) As `contract_qty`, SUM(`qc_qty`) As `qc_qty`, SUM(`qc_minus_qty`) AS `qc_minus_qty`, SUM(`positive_qc_qty`) As `positive_qc_qty`, SUM(`negative_qc_qty`) As `negative_qc_qty`, SUM(`ex_stage_qty1`) As ex_stage_qty1 FROM (' +
+                '  SELECT `contract_qty`, `qc_qty`, `qc_minus_qty`, `positive_qc_qty`, `negative_qc_qty`, ex_stage_qty1 FROM ' + this.ctx.service.stagePos.tableName + ' As Pos ' +
                 '    INNER JOIN (' +
                 '      SELECT MAX(`times` * ' + timesLen + ' + `order`) As `flow`, `pid` ' +
                 '        FROM ' + this.ctx.service.stagePos.tableName +