Przeglądaj źródła

添加执行人字段

lucw 6 miesięcy temu
rodzic
commit
902c69a2a8
1 zmienionych plików z 35 dodań i 1 usunięć
  1. 35 1
      src/views/entrust/components/create.vue

+ 35 - 1
src/views/entrust/components/create.vue

@@ -113,6 +113,26 @@
           </el-form-item>
         </el-col>
 
+        <el-col :span="6">
+          <el-form-item label="执行人:">
+            <el-select
+              style="width: 100%"
+              v-model="form.executeUserId"
+              placeholder="请选择"
+              clearable
+              :disabled="type == 'detail'"
+            >
+              <el-option
+                v-for="item in userList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+
         <el-col :span="6">
           <el-form-item label="是否尾工序:" prop="isLast">
             <el-radio-group v-model="form.isLast" :disabled="type == 'detail'">
@@ -273,6 +293,7 @@
   import deptSelect from '@/components/CommomSelect/dept-select.vue';
   import { getProduceTaskList } from '@/api/aps';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+  import { getUserPage } from '@/api/system/organization';
 
   const defaultForm = function () {
     return {
@@ -300,6 +321,8 @@
       priority: '',
       beEntrustedFactoriesId: '', //受托工厂id
       beEntrustedFactoriesName: '', //受托工厂名称
+      executeUserId: '', // 执行人id
+      executeUserName: '', // 执行人名称
       id: '',
       isLast: 0
     };
@@ -562,7 +585,8 @@
           //   align: 'center',
           //   minWidth: 120
           // }
-        ]
+        ],
+        userList: []
       };
     },
 
@@ -647,6 +671,10 @@
             priority,
             id: dataId
           });
+          // 获取受托部门用户列表
+          if (beEntrustedDeptId) {
+            this.getUserList(beEntrustedDeptId);
+          }
 
           // 深拷贝时添加 taskList
           const newData = {
@@ -678,7 +706,9 @@
       },
 
       beEntrustedDeptIdChange(val, row) {
+        console.log('row 部门', row);
         this.form.beEntrustedDeptName = row.name;
+        this.getUserList(row.id);
       },
       factoryListChange(row) {
         this.form.beEntrustedFactoriesName = row.name;
@@ -867,6 +897,10 @@
               this.loading.close();
             });
         });
+      },
+      async getUserList(groupId) {
+        const { list } = await getUserPage({ pageNum: 1, size: -1, groupId });
+        this.userList = list || [];
       }
     }
   };