浏览代码

漏计判断调整

MaiXinRong 1 年之前
父节点
当前提交
fc14a59701
共有 3 个文件被更改,包括 6 次插入2 次删除
  1. 1 1
      app/middleware/stage_check.js
  2. 4 1
      app/public/js/stage.js
  3. 1 0
      app/service/stage_audit.js

+ 1 - 1
app/middleware/stage_check.js

@@ -134,7 +134,7 @@ module.exports = options => {
             // 根据状态判断是否需要更新审批人列表
             yield this.service.stage.doCheckStageCanCancel(stage);
             this.stage = stage;
-
+            // 根据状态判断是否需要更新审批人列表
             if ((stage.status === status.uncheck || stage.status === status.checkNo) && this.tender.info.shenpi.stage !== shenpiConst.sp_status.sqspr) {
                 const shenpi_status = this.tender.info.shenpi.stage;
                 // 进一步比较审批流是否与审批流程设置的相同,不同则替换为固定审批流或固定的终审

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

@@ -4177,7 +4177,10 @@ $(document).ready(() => {
                             key: 'less', title: '漏计', valid: true,
                             check: function (node) {
                                 if (node.quantity) {
-                                    return ZhCalc.sub(ZhCalc.add(node.quantity, node.end_qc_qty), node.end_gather_qty) > 0;
+                                    if (node.b_code === '204-1-g') {
+                                        console.log(ZhCalc.sub(ZhCalc.sum([node.quantity, node.end_qc_qty, node.end_qc_minus_qty]), node.end_gather_qty));
+                                    }
+                                    return ZhCalc.sub(ZhCalc.sum([node.quantity, node.end_qc_qty, node.end_qc_minus_qty]), node.end_gather_qty) > 0;
                                 } else if (node.total_price) {
                                     return ZhCalc.sub(ZhCalc.add(node.total_price, node.end_qc_tp), node.end_gather_tp) > 0;
                                 }

+ 1 - 0
app/service/stage_audit.js

@@ -514,6 +514,7 @@ module.exports = app => {
                         };
                         await this.ctx.helper.sendWechat(users, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), wxConst.template.stage, wechatData);
                     } else {
+                        await this.ctx.service.revisePrice.doPriceUsed(this.ctx.stage, transaction);
                         await this.ctx.service.tenderTag.saveTenderTag(this.ctx.tender.id, {stage_time: new Date()}, transaction);
                         const his_id = await this.ctx.service.ledgerHistory.checkBackupLedgerHistory(this.ctx.stage.tid, this.ctx.stage.id);
                         // 本期结束