Browse Source

feat(programRulesDialog): 添加默认执行人列表并优化执行人选择逻辑

liujt 3 months ago
parent
commit
bfdb8bf52c
1 changed files with 10 additions and 2 deletions
  1. 10 2
      src/views/batchRecord/components/programRulesDialog.vue

+ 10 - 2
src/views/batchRecord/components/programRulesDialog.vue

@@ -654,6 +654,7 @@
           ]
         },
         executorList: [],
+        defaultExecuteUsers: [],
         uerList: [],
         // 执行方式列表
         executeMethodList: [],
@@ -673,7 +674,7 @@
     },
     computed: {
       dispatchStatus() {
-        return (this.addForm.autoOrder && (this.type == 'add' || this.type == 'edit' || this.type == 'detail')) || (!this.addForm.autoOrder && this.type == 'dispatch')
+        return (this.addForm.autoOrder && (this.type == 'add' || this.type == 'edit' || this.type == 'detail' || this.type == 'dispatch')) || (!this.addForm.autoOrder && this.type == 'dispatch')
       },
       // 当前用户信息
       loginUser() {
@@ -837,6 +838,7 @@
       }
     },
     created() {
+      this.getDefaultExecuteUsers();
       // 获取审核人列表、巡点检人员
       this.getUserList();
       // 获取所有班组
@@ -969,6 +971,12 @@
           this.addForm.groupId = null;
         }
       },
+      getDefaultExecuteUsers() {
+        let data = { pageNum: 1, size: -1 };
+        getUserPage(data).then(res => {
+          this.defaultExecuteUsers = res.list;
+        });
+      },
       // 获取审核人列表、巡点检人员
       async getUserList(params) {
         try {
@@ -1217,7 +1225,7 @@
       // 负责人变更 同步执行人列表
       executeIdListChange() {
         this.addForm.executeUsers = this.addForm.executeIdList.map((userId) => {
-          const user = this.executorList.find((u) => u.id === userId);
+          const user = this.defaultExecuteUsers.find((u) => u.id === userId);
           return {
             userId: user.id,
             userName: user.name,