Browse Source

合同支付,bqht计算相关

MaiXinRong 5 years ago
parent
commit
38132ff87e
3 changed files with 13 additions and 5 deletions
  1. 9 2
      app/lib/pay_calc.js
  2. 1 1
      app/public/js/stage.js
  3. 3 2
      app/public/js/stage_im.js

+ 9 - 2
app/lib/pay_calc.js

@@ -51,8 +51,15 @@ class PayCalculate {
     _calculateTpExpr(pay) {
         let formula = pay.expr;
         for (const b of this.bases) {
-            if ((b.code === 'bqwc') && (!pay.pre_used && pay.sprice)) {
-                formula = formula.replace(b.reg, this.ctx.helper.sub(this.add.gather_tp, pay.sprice));
+            if ((b.code === 'bqwc' || b.code === 'bqht') && (!pay.pre_used && pay.sprice)) {
+                switch (b.code) {
+                    case 'bqwc':
+                        formula = formula.replace(b.reg, this.ctx.helper.sub(this.add.gather_tp, pay.sprice));
+                        break;
+                    case 'bqht':
+                        formula = formula.replace(b.reg, this.ctx.helper.sub(this.add.contract_tp, pay.sprice));
+                        break;
+                }
             } else {
                 formula = formula.replace(b.reg, b.value);
             }

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

@@ -2284,7 +2284,7 @@ $(document).ready(() => {
                 }
                 check('bw', $('#bw-name'), data, updateData);
                 check('peg', $('#peg'), data, updateData);
-                check('xm', $('#xm'), data, updateData);
+                check('xm', $('#xm-name'), data, updateData);
                 check('position', $('#position'), data, updateData);
                 check('jldy', $('#jldy'), data, updateData);
                 check('drawing_code', $('#drawing-code'), data, updateData);

+ 3 - 2
app/public/js/stage_im.js

@@ -544,8 +544,8 @@ const stageIm = (function () {
                         }
                     }
 
-                    imDefault.contract_jl = ZhCalc.add(imDefault.contract_jl, p.contract_qty);
-                    imDefault.qc_jl = ZhCalc.add(imDefault.qc_jl, p.qc_qty);
+                    imDefault.contract_jl = ZhCalc.add(imDefault.contract_jl, p.contract_tp);
+                    imDefault.qc_jl = ZhCalc.add(imDefault.qc_jl, p.qc_tp);
 
                     addBwBillsGclBills(imDefault, {
                         b_code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price,
@@ -812,6 +812,7 @@ const stageIm = (function () {
                 _.assignInWith(detail, d, function (oV, sV, key) {
                     return imFields.indexOf(key) > -1 && !_.isUndefined(sV) && !_.isNull(sV) ? sV : oV;
                 });
+                detail.custom_define = d.custom_define;
             } else {
                 details.push(d);
             }