Sfoglia il codice sorgente

修复调差审批bug

ellisran 6 mesi fa
parent
commit
e3e52bec83
1 ha cambiato i file con 7 aggiunte e 7 eliminazioni
  1. 7 7
      app/controller/material_controller.js

+ 7 - 7
app/controller/material_controller.js

@@ -1306,10 +1306,10 @@ module.exports = app => {
          */
         async checkAudit(ctx) {
             try {
-                if (!this.ctx.material || this.ctx.material.status !== auditConst.status.checking) {
+                if (!ctx.material || (ctx.material.status !== auditConst.status.checking || ctx.stage.status !== auditConst.status.checkNoPre)) {
                     throw '当前材料调差期数据有误';
                 }
-                if (!this.ctx.material.curAuditor || this.ctx.material.curAuditor.aid !== ctx.session.sessionUser.accountId) {
+                if (ctx.material.curAuditorIds.indexOf(ctx.session.sessionUser.accountId) < 0) {
                     throw '您无权进行该操作';
                 }
                 const data = {
@@ -1319,11 +1319,11 @@ module.exports = app => {
                 if (!data.checkType || isNaN(data.checkType)) {
                     throw '提交数据错误';
                 }
-                if (data.checkType === auditConst.status.checkNo) {
-                    if (!data.checkType || isNaN(data.checkType)) {
-                        throw '提交数据错误';
-                    }
-                }
+                // if (data.checkType === auditConst.status.checkNo) {
+                //     if (!data.checkType || isNaN(data.checkType)) {
+                //         throw '提交数据错误';
+                //     }
+                // }
 
                 await ctx.service.materialAudit.check(ctx.material.id, data, ctx.material.times);