Przeglądaj źródła

fix(工单报告): 修复班组ID处理逻辑和用户查询参数格式

liujt 3 miesięcy temu
rodzic
commit
18b7ba07c0

+ 6 - 5
src/views/batchRecord/components/programRulesDialog.vue

@@ -881,8 +881,9 @@
           this.addForm.executeIdList = this.addForm.executeUsers.map(
             (item) => item.userId
           );
-          this.addForm.groupId = this.addForm.executeUsers?.map((i) => i.groupId).join(',') || '';
-          this.searchDeptNodeClick(this.addForm.groupId);
+          this.addForm.groupId = this.addForm.executeUsers[0]?.groupId || '';
+          const groupIds = this.addForm.executeUsers?.map((i) => i.groupId).join(',');
+          this.searchDeptNodeClick(groupIds);
         } else {
           // 班组
           this.addForm.teamId = this.addForm.executeUsers[0]?.teamId || '';
@@ -985,11 +986,11 @@
           if (params) {
             data = Object.assign(data, params);
           }
-          const res = await getUserByGroupIds([params.groupId]);
+          const res = await getUserByGroupIds(params.groupId.split(','));
           if (params) {
-            this.executorList = res.list;
+            this.executorList = res;
           } else {
-            this.uerList = res.list;
+            this.uerList = res;
           }
         } catch (error) {}
       },

+ 3 - 3
src/views/batchRecord/components/workOrderReport.vue

@@ -688,11 +688,11 @@
               this.addForm.groupId = '1';
             } else {
               this.addForm.groupId =
-                this.addForm.executeUsers?.map((i) => i.groupId).join(',') || '1';
+                this.addForm.executeUsers[0].groupId || '1';
             }
 
             if (this.addForm.groupId) {
-              this.searchDeptNodeClick(this.addForm.groupId);
+              this.searchDeptNodeClick(groupIds.join(','));
             }
           }
 
@@ -962,7 +962,7 @@
           if (params) {
             data = Object.assign(data, params);
           }
-          const res = await getUserByGroupIds([params.groupId]);
+          const res = await getUserByGroupIds(params.groupId.split(','));
           if (params) {
             this.executorList = res;
           } else {