Browse Source

期删除本次代码优化

laiguoran 5 years ago
parent
commit
da23f2fe56
2 changed files with 19 additions and 2 deletions
  1. 1 2
      app/service/stage_audit.js
  2. 18 0
      app/view/stage/manager_modal.ejs

+ 1 - 2
app/service/stage_audit.js

@@ -993,8 +993,7 @@ module.exports = app => {
         async timesDelete() {
             const transaction = await this.db.beginTransaction();
             try {
-                // 当前审批人2次添加至流程中
-                // 判断当前期是否是重新上报状态,决定删除times数并获取times个数
+                // 判断当前期是否是重新上报状态,决定删除times数并获取最新的times
                 await transaction.delete(this.tableName, { sid: this.ctx.stage.id, times: this.ctx.stage.times });
                 const isCheckNo = this.ctx.stage.status === auditConst.status.checkNo;
                 const nowTimes = isCheckNo ? this.ctx.stage.times - 1 : this.ctx.stage.times;

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

@@ -1,4 +1,21 @@
 <% if (lastStage) { %>
+<% if (ctx.stage.hadMaterial) { %>
+    <div class="modal fade" id="del" 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="del" data-backdrop="static">
     <div class="modal-dialog" role="document">
@@ -20,6 +37,7 @@
         </form>
     </div>
 </div>
+<% } %>
 <% if (ctx.stage.hadMaterial) { %>
     <div class="modal fade" id="del-qi" data-backdrop="static">
         <div class="modal-dialog" role="document">