Ver código fonte

班组人员信息补充

lucw 7 meses atrás
pai
commit
dad83f6eb8

+ 10 - 28
src/views/bpm/handleTask/components/mesBatchRecordManage/detailDialog.vue

@@ -833,7 +833,8 @@
     getTaskInstanceList,
     getTeam,
     getWorkOrderById,
-    queryListByWorkOrderId
+    queryListByWorkOrderId,
+    listUserByIds
   } from '@/api/producetaskrecordrulesrecord/index.js';
   import { getById as maintenanceGetById } from '@/api/maintenance/patrol_maintenance.js';
   import { getUserPage } from '@/api/system/organization';
@@ -1048,17 +1049,6 @@
       console.log('this.businessId', this.businessId);
       this.getDatails(this.businessId);
       this.getWorkshopArea();
-
-      if (localStorage.getItem('singleUserInfo') == '1') {
-        const data = JSON.parse(localStorage.getItem('chooseUserInfo'));
-        this.getTeamList(data.teamId);
-      } else {
-        console.log(
-          'this.$store.state.user.info.teamId',
-          this.$store.state.user.info.teamId
-        );
-        this.getTeamList(this.$store.state.user.info.teamId);
-      }
     },
     methods: {
       // 关闭时清理表单
@@ -1102,16 +1092,10 @@
             this.details.executeUsers.length > 0
               ? this.details.executeUsers[0].teamId
               : '';
-          // 加载班组人员列表
-          if (this.details.teamId) {
-            const index = this.teamList.findIndex(
-              (item) => item.id == this.details.teamId
-            );
-            this.teamUserList = this.teamAllList[index];
-          }
 
           this.getProductTaskList(this.details.workOrderId);
           this.getListByWorkOrderId();
+          this.getTeamList(this.details.teamId);
 
           this.loading = false;
         } catch (error) {
@@ -1175,18 +1159,10 @@
         this.workshopAreaList = data.list;
       },
       async getTeamList(id) {
-        console.log('id', id);
-        if (id == '') return;
         const ids = id.split(',');
-        console.log('ids', ids, id);
         this.teamList = [];
         this.teamUserList = [];
-        const list = ids.map((item) => {
-          if (item) {
-            return getTeam(item);
-          }
-          return [];
-        });
+        const list = ids.map((item) => getTeam(item));
 
         const dataList = await Promise.all(list);
 
@@ -1198,6 +1174,12 @@
 
           this.teamAllList.push(item.userVOList);
         });
+
+        // 加载班组人员列表
+        const index = this.teamList.findIndex(
+          (item) => item.id == this.details.teamId
+        );
+        this.teamUserList = this.teamAllList[index];
       },
       // 获取工序列表
       async getProductTaskList(id) {