Browse Source

标段管理修改

zhongxiaoyu 2 years ago
parent
commit
256c0c00eb
1 changed files with 44 additions and 10 deletions
  1. 44 10
      src/views/lotAuthorization/components/home.vue

+ 44 - 10
src/views/lotAuthorization/components/home.vue

@@ -186,20 +186,54 @@ export default {
         return
       }
       const mixedDatas = []
-      this.checkedUsers.forEach(user => {
-        this.checkedSections.forEach(section => {
+      // this.checkedUsers.forEach(user => {
+      //   this.checkedSections.forEach(section => {
+      //     this.checkedRegulators.forEach(regulator => {
+      //       this.checkedOrgs.forEach(org => {
+      //         mixedDatas.push({
+      //           OfficerId: user.OfficerId,
+      //           OrganId: org.OrganId,
+      //           OthOrganId: regulator.OrganId,
+      //           SessionId: section.SessionId
+      //         })
+      //       })
+      //     })
+      //   })
+      // })
+      if (this.checkedSections.length) {
+        this.checkedUsers.forEach(user => {
+          this.checkedSections.forEach(section => {
+            mixedDatas.push({
+              OfficerId: user.OfficerId,
+              SessionId: section.SessionId,
+              OthOrganId: null,
+              OrganId: null
+            })
+          })
+        })
+      } else if (this.checkedRegulators.length) {
+        this.checkedUsers.forEach(user => {
           this.checkedRegulators.forEach(regulator => {
-            this.checkedOrgs.forEach(org => {
-              mixedDatas.push({
-                OfficerId: user.OfficerId,
-                OrganId: org.OrganId,
-                OthOrganId: regulator.OrganId,
-                SessionId: section.SessionId
-              })
+            mixedDatas.push({
+              OfficerId: user.OfficerId,
+              SessionId: null,
+              OthOrganId: regulator.OrganId,
+              OrganId: null
             })
           })
         })
-      })
+      } else if (this.checkedOrgs.length) {
+        this.checkedUsers.forEach(user => {
+          this.checkedOrgs.forEach(org => {
+            mixedDatas.push({
+              OfficerId: user.OfficerId,
+              SessionId: null,
+              OthOrganId: null,
+              OrganId: org.OrganId
+            })
+          })
+        })
+      }
       // console.log(mixedDatas)
       this.saveSection(mixedDatas)
     },