Jelajahi Sumber

合同支付,新增计算基数

MaiXinRong 5 tahun lalu
induk
melakukan
58b787c61c
3 mengubah file dengan 18 tambahan dan 4 penghapusan
  1. 2 0
      app/const/deal_pay.js
  2. 2 2
      app/public/js/stage_pay.js
  3. 14 2
      app/service/stage.js

+ 2 - 0
app/const/deal_pay.js

@@ -30,6 +30,8 @@ const calcBase = [
     {name: '签约开工预付款', code: 'kgyfk', sort: 2},
     {name: '签约材料预付款', code: 'clyfk', sort: 2},
     {name: '本期完成计量', code: 'bqwc', limit: true, sort: 10},
+    {name: '本期合同计量', code: 'bqht', limit: true, sort: 10},
+    {name: '本期变更计量', code: 'bqbg', limit: true, sort: 10},
     {name: '100章本期完成计量', code: 'ybbqwc', limit: true, sort: 1},
 ];
 

+ 2 - 2
app/public/js/stage_pay.js

@@ -399,7 +399,7 @@ $(document).ready(() => {
             const num = text ? _.toNumber(text) : null;
             let expr = text ? (num ? null : text) : null;
             expr = expr ? $.trim(expr).replace('\t', '').replace('=', '').toLowerCase(): null;
-            const [valid, msg] = this._checkExprValid(expr, ['bqwc', 'ybbqwc']);
+            const [valid, msg] = this._checkExprValid(expr, ['bqwc', 'ybbqwc', 'bqht', 'bqbg']);
             if (!valid) return [valid, msg];
 
             if (payBase.isStarted(payNode)) {
@@ -425,7 +425,7 @@ $(document).ready(() => {
             const num = text ? _.toNumber(text) : null;
             let expr = text ? (num ? null : text) : null;
             expr = expr ? $.trim(expr).replace('\t', '').replace('=', '').toLowerCase(): null;
-            const [valid, msg] = this._checkExprValid(expr, ['bqwc', 'ybbqwc']);
+            const [valid, msg] = this._checkExprValid(expr, ['bqwc', 'ybbqwc', 'bqht', 'bqbg']);
             if (!valid) return [valid, msg];
 
             if (payBase.isStarted(payNode)) {

+ 14 - 2
app/service/stage.js

@@ -360,6 +360,7 @@ module.exports = app => {
             const calcBase = JSON.parse(JSON.stringify(payConst.calcBase));
             const param = tenderInfo.deal_param;
             for (const cb of calcBase) {
+                const sum = await this.ctx.service.stageBills.getSumTotalPrice(stage);
                 switch (cb.code) {
                     case 'htj':
                         cb.value = param.contractPrice;
@@ -377,9 +378,14 @@ module.exports = app => {
                         cb.value = param.materialAdvance;
                         break;
                     case 'bqwc':
-                        const sum = await this.ctx.service.stageBills.getSumTotalPrice(stage);
                         cb.value = this.ctx.helper.add(sum.contract_tp, sum.qc_tp);
                         break;
+                    case 'bqht':
+                        cb.value = sum.contract_tp;
+                        break;
+                    case 'bqbg':
+                        cb.value = sum.qc_tp;
+                        break;
                     case 'ybbqwc':
                         const sumGcl = await this.ctx.service.stageBills.getSumTotalPriceGcl(stage, '^1[0-9]{2}-');
                         cb.value = this.ctx.helper.add(sumGcl.contract_tp, sumGcl.qc_tp);
@@ -473,6 +479,7 @@ module.exports = app => {
         async getMaterialCalcBase(stage_list, tenderInfo) {
             const calcBase = JSON.parse(JSON.stringify(payConst.calcBase));
             const param = tenderInfo.deal_param;
+            const sum = await this.ctx.service.stageBills.getSumTotalPriceByMaterial(stage_list);
             for (const cb of calcBase) {
                 switch (cb.code) {
                     case 'htj':
@@ -491,9 +498,14 @@ module.exports = app => {
                         cb.value = param.materialAdvance;
                         break;
                     case 'bqwc':
-                        const sum = await this.ctx.service.stageBills.getSumTotalPriceByMaterial(stage_list);
                         cb.value = this.ctx.helper.add(sum.contract_tp, sum.qc_tp);
                         break;
+                    case 'bqht':
+                        cb.value = sum.contract_tp;
+                        break;
+                    case 'bqbg':
+                        cb.value = sum.contract_tp;
+                        break;
                     case 'ybbqwc':
                         const sumGcl = await this.ctx.service.stageBills.getSumTotalPriceGclByMaterial(stage_list, '^1[0-9]{2}-');
                         cb.value = this.ctx.helper.add(sumGcl.contract_tp, sumGcl.qc_tp);