Browse Source

修复因新增部位无法新增修订bug

ellisran 1 year ago
parent
commit
fa141b54c7
1 changed files with 11 additions and 1 deletions
  1. 11 1
      app/controller/revise_controller.js

+ 11 - 1
app/controller/revise_controller.js

@@ -68,7 +68,17 @@ module.exports = app => {
                         const caList = await ctx.service.changeAuditList.getList(c.cid, 0);
                         const gclIdList = ctx.helper._.uniq(ctx.helper._.map(caList, 'gcl_id'));
                         for (const gcl of gclIdList) {
-                            if (gcl && (ctx.helper._.findIndex(changeLedgerList, { id: gcl }) !== -1 || ctx.helper._.findIndex(changePosList, { lid: gcl }) !== -1)) {
+                            if (gcl && (ctx.helper._.findIndex(changeLedgerList, { id: gcl }) !== -1)) {
+                                changeValid = false;
+                                break;
+                            }
+                        }
+                        if (!changeValid) {
+                            break;
+                        }
+                        const posIdList = ctx.helper._.uniq(ctx.helper._.map(caList, 'mx_id'));
+                        for (const pos of posIdList) {
+                            if (pos && (ctx.helper._.findIndex(changePosList, { id: pos }) !== -1)) {
                                 changeValid = false;
                                 break;
                             }