Browse Source

合同支付,新增期限制

MaiXinRong 5 months ago
parent
commit
cc4c70380a
2 changed files with 2 additions and 1 deletions
  1. 1 0
      app/controller/pay_controller.js
  2. 1 1
      app/view/phase_pay/index.ejs

+ 1 - 0
app/controller/pay_controller.js

@@ -36,6 +36,7 @@ module.exports = app => {
                 }
                 const stages = await this.ctx.service.stage.getAllDataByCondition({ where: { tid: ctx.tender.id }, orders: [['order', 'AEC']] });
                 const validStages = stages.filter(s => {
+                    if (s.status !== audit.stage.status.checked) return false;
                     return !relaStage.find(r => { return s.id === r.stage_id; });
                 });
                 this.ctx.service.phasePay.calculatePhasePay(phasePays);

+ 1 - 1
app/view/phase_pay/index.ejs

@@ -6,7 +6,7 @@
             <h2>
                 合同支付列表
             </h2>
-            <% if (ctx.session.sessionUser.accountId === ctx.tender.data.user_id && (phasePays.length === 0 || phasePays[0].audit_status === auditConst.status.checked)) { %>
+            <% if (ctx.session.sessionUser.accountId === ctx.tender.data.user_id && (phasePays.length === 0 || phasePays[0].audit_status === auditConst.status.checked) && validStages.length > 0) { %>
             <div class="ml-auto">
                 <a href="#add-qi" data-toggle="modal" data-target="#add-qi" class="btn btn-primary btn-sm">开始新一期</a>
             </div>