瀏覽代碼

计量期,重新审批检查合同支付期

MaiXinRong 4 月之前
父節點
當前提交
380d819c93
共有 2 個文件被更改,包括 11 次插入1 次删除
  1. 5 0
      app/middleware/stage_check.js
  2. 6 1
      app/view/stage/audit_modal.ejs

+ 5 - 0
app/middleware/stage_check.js

@@ -64,6 +64,11 @@ module.exports = options => {
             stage.hadMaterial = materials.find(function(item) {
                 return item.s_order.split(',').indexOf(stage.highOrder.toString()) !== -1;
             });
+            const phasePays = yield this.service.phasePay.getAllDataByCondition({ columns: ['rela_stage'], where: { tid: this.tender.id } });
+            stage.hadPhasePay = phasePays.find(function(pp) {
+                pp.rela_stage = pp.rela_stage ? JSON.parse(pp.rela_stage) : [];
+                return pp.rela_stage.find(x => { return x.stage_id === stage.id; });
+            });
 
             // 权限相关
             // todo 校验权限 (标段参与人、分享、游客)

+ 6 - 1
app/view/stage/audit_modal.ejs

@@ -642,7 +642,7 @@
     <% } %>
 <% } %>
 <% if (ctx.stage && ctx.stage.finalAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0 && ctx.stage.status === auditConst.status.checked && ctx.stage.order === ctx.stage.highOrder) { %>
-<% if (ctx.stage.hadMaterial) { %>
+<% if (ctx.stage.hadMaterial || ctx.stage.hadPhasePay) { %>
 <div class="modal fade" id="sp-down-back" data-backdrop="static">
     <div class="modal-dialog" role="document">
         <div class="modal-content">
@@ -650,7 +650,12 @@
                 <h5 class="modal-title">重新审批</h5>
             </div>
             <div class="modal-body">
+                <% if (ctx.stage.hadMaterial) { %>
                 <h5>材料调差已使用当前期,如需重新审批,请先删除材料调差相关期</h5>
+                <% } %>
+                <% if (ctx.stage.hadPhasePay) { %>
+                <h5>合同支付已使用当前期,如需重新审批,请先删除合同支付相关期</h5>
+                <% } %>
             </div>
             <div class="modal-footer">
                 <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">取消</button>