Browse Source

重新审批权限修改

laiguoran 4 years ago
parent
commit
e5206451d9
2 changed files with 19 additions and 1 deletions
  1. 1 1
      app/middleware/stage_check.js
  2. 18 0
      app/view/stage/audit_modal.ejs

+ 1 - 1
app/middleware/stage_check.js

@@ -55,7 +55,7 @@ module.exports = options => {
             });
             const materials = yield this.service.material.getAllDataByCondition({ columns: ['stage_id', 's_order'], where: { tid: this.tender.id } });
             stage.hadMaterial = materials.find(function(item) {
-                return item.s_order.indexOf(stage.highOrder.toString()) !== -1;
+                return item.s_order.split(',').indexOf(stage.highOrder.toString()) !== -1;
             });
             // 权限相关
             // todo 校验权限 (标段参与人、分享)

+ 18 - 0
app/view/stage/audit_modal.ejs

@@ -1436,6 +1436,23 @@
     <% } %>
 <% } %>
 <% if (ctx.stage.auditors !== undefined && ctx.stage.auditors.length !== 0 && ctx.stage.auditors[ctx.stage.auditors.length-1].aid === ctx.session.sessionUser.accountId && ctx.stage.status === auditConst.status.checked && ctx.stage.order === ctx.stage.highOrder) { %>
+    <% if (ctx.stage.hadMaterial) { %>
+        <div class="modal fade" id="sp-down-back" data-backdrop="static">
+            <div class="modal-dialog" role="document">
+                <div class="modal-content">
+                    <div class="modal-header">
+                        <h5 class="modal-title">重新审批</h5>
+                    </div>
+                    <div class="modal-body">
+                        <h5>材料调差已使用当前期,如需重新审批,请先删除材料调差相关期</h5>
+                    </div>
+                    <div class="modal-footer">
+                        <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">取消</button>
+                    </div>
+                </div>
+            </div>
+        </div>
+    <% } else { %>
     <div class="modal fade" id="sp-down-back" data-backdrop="static">
         <div class="modal-dialog" role="document">
             <div class="modal-content">
@@ -1452,6 +1469,7 @@
             </div>
         </div>
     </div>
+    <% } %>
 <% } %>
 <% if (ctx.stage.user_id === ctx.session.sessionUser.accountId && ctx.stage.order === ctx.stage.highOrder && (ctx.stage.status === auditConst.status.checkNo || ctx.stage.status === auditConst.status.uncheck)) { %>
     <!--删除期-->