lucw před 6 měsíci
rodič
revize
ed8e2d631b

+ 2 - 2
src/views/batchRecord/components/editModal.vue

@@ -1424,10 +1424,10 @@
           }
           console.log('this.form', this.form);
 
-          if (this.form.executeMethod == 1) {
+          if (this.form.itemType == 1) {
             // 设备保养计划相关逻辑
             this.planRulesSaveOrSubmit();
-          } else if (this.form.executeMethod == 2) {
+          } else if (this.form.itemType == 2) {
             this.releaseRulesSaveOrSubmit(type);
           } else {
             // 任务确认

+ 2 - 2
src/views/batchRecord/components/list.vue

@@ -456,14 +456,14 @@
 
         const currentItem = { ...row, recordId: row.id };
 
-        if (row.executeMethod == 1) {
+        if (row.itemType == 1) {
           // 设备保养计划相关逻辑
           this.$refs.programRulesDialogRef.init(currentItem, currentItem, {
             name: row.produceTaskName
           });
           return;
         }
-        if (row.executeMethod == 2) {
+        if (row.itemType == 2) {
           return this.releaseRulesSaveOrSubmit(row);
         }
 

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

@@ -41,7 +41,7 @@
             type="primary"
             :underline="false"
             @click="openEdit('edit', row)"
-            v-if="row.status == 0 || row.status == 4"
+            v-if="row.status != 2"
           >
             修改
           </el-link>
@@ -49,7 +49,7 @@
           <el-link
             type="primary"
             :underline="false"
-            v-if="row.status == 0 || row.status == 4"
+            v-if="row.status != 2"
             @click="openEdit('dispatch', row)"
           >
             派单
@@ -70,7 +70,7 @@
             class="ele-action"
             title="确定要删除此条数据吗?"
             @confirm="deleteRow(row.id)"
-            v-if="row.status == 0 || row.status == 4"
+            v-if="row.status != 2"
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false"> 删除 </el-link>

+ 1 - 13
src/views/batchRecord/components/programRulesDialog.vue

@@ -156,18 +156,6 @@
             </DictSelection>
           </el-form-item>
         </el-col>
-        <el-col :span="8">
-          <el-form-item label="状态" prop="status">
-            <el-switch
-              v-model="addForm.status"
-              active-text="开"
-              inactive-text="关"
-              :active-value="1"
-              :inactive-value="0"
-              :disabled="type === 'dispatch'"
-            />
-          </el-form-item>
-        </el-col>
 
         <el-col :span="8">
           <el-form-item label="关联记录规则" required prop="ruleName">
@@ -602,7 +590,7 @@
         remark: '',
         ruleId: null,
         ruleName: '',
-        status: 1,
+        status: 0,
         type: 0,
         updateUserName: '',
         urgent: '1',

+ 1 - 1
src/views/batchRecord/components/redeployOther.vue

@@ -329,7 +329,7 @@
 
         let params = {
           executeUser,
-          id: this.row.id
+          id: this.row.planId
         };
         recordrulesplanReManualDispatchOrder(params)
           .then(() => {

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

@@ -73,7 +73,7 @@
           </el-form-item>
         </el-col>
         <el-col :span="8">
-          <el-form-item label="执行人" required prop="teamId">
+          <!-- <el-form-item label="执行人" required prop="teamId">
             <el-select
               v-model="addForm.teamId"
               placeholder="请选择班组"
@@ -109,6 +109,33 @@
               >
               </el-option>
             </el-select>
+          </el-form-item> -->
+
+          <el-form-item label="部门">
+            <deptSelect
+              v-model="addForm.groupId"
+              @changeGroup="searchDeptNodeClick"
+            />
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="8">
+          <el-form-item label="报工人" prop="executeUsersIds">
+            <el-select
+              v-model="addForm.executeUsersIds"
+              size="small"
+              style="width: 100%"
+              multiple
+              filterable
+              @change="executeIdListChange"
+            >
+              <el-option
+                v-for="item in executorList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              ></el-option>
+            </el-select>
           </el-form-item>
         </el-col>
 
@@ -286,11 +313,14 @@
   import { getTeam } from '@/api/produce/job.js';
   import toolModal from '@/views/batchRecord/components/toolModal.vue';
   import { producetaskrulerecordSaveOrUpdateAndSubmit } from '@/api/recordRules/index.js';
+  import deptSelect from '@/components/CommomSelect/dept-select.vue';
+  import { getUserPage } from '@/api/system/organization';
 
   export default {
     mixins: [dictMixins],
     components: {
-      toolModal
+      toolModal,
+      deptSelect
     },
     watch: {
       'addForm.details': {
@@ -354,6 +384,7 @@
         executeUsers: [],
         // 班组id
         teamId: '',
+        groupId: null,
         // 物料字段name
         pickDetails: [],
         // 本次产出明细
@@ -455,7 +486,8 @@
           { label: '成品统计', value: '1' },
           { label: '物料统计', value: '2' },
           { label: '工序统计', value: '3' }
-        ]
+        ],
+        executorList: []
       };
     },
     computed: {
@@ -543,6 +575,8 @@
       } else {
         this.getTeamList(this.$store.state.user.info.teamId);
       }
+      // 获取审核人列表、巡点检人员
+      this.getUserList();
     },
     methods: {
       // 外部调用,打开弹窗
@@ -593,6 +627,11 @@
               ? this.addForm.executeUsers[0].teamId
               : '';
 
+          if (this.addForm.executeUsers.length > 0) {
+            this.addForm.groupId = this.addForm.executeUsers[0]?.groupId || '';
+            this.searchDeptNodeClick(this.addForm.groupId);
+          }
+
           if (!this.addForm.teamId && this.teamList.length > 0) {
             this.addForm.teamId = this.teamList[0].id;
           }
@@ -850,6 +889,52 @@
           i.checkResult = 1;
           return i;
         });
+      },
+      // 获取审核人列表、巡点检人员
+      async getUserList(params) {
+        try {
+          let data = { pageNum: 1, size: -1 };
+          // 如果传了参数就是获取部门人员数据
+          if (params) {
+            data = Object.assign(data, params);
+          }
+          const res = await getUserPage(data);
+          if (params) {
+            this.executorList = res.list;
+          } else {
+            this.uerList = res.list;
+          }
+        } catch (error) {}
+      },
+      //选择部门(搜索)
+      async searchDeptNodeClick(groupId, data) {
+        if (groupId) {
+          // 根据部门获取人员
+          const params = { groupId: groupId };
+          await this.getUserList(params);
+        } else {
+          this.addForm.groupId = null;
+        }
+      },
+      // 负责人变更 同步执行人列表
+      executeIdListChange() {
+        this.addForm.executeUsers = this.addForm.executeUsersIds.map(
+          (userId) => {
+            const user = this.executorList.find((u) => u.id === userId);
+            return {
+              userId: user.id,
+              userName: user.name,
+              groupId: user.groupId,
+              groupName: user.groupName
+            };
+          }
+        );
+        // 同步详情执行人
+        this.addForm.details.forEach((detail) => {
+          detail.checkUsersIds = this.addForm.executeUsersIds;
+          detail.checkUsers = this.addForm.executeUsers;
+        });
+        console.log('this.addForm.executeUsers', this.addForm.executeUsers);
       }
     }
   };

+ 2 - 2
src/views/produce/components/prenatalExamination/index.vue

@@ -232,10 +232,10 @@
       openMaintenancePlan(item) {
         console.log('item', item);
 
-        if (item.executeMethod == 1) {
+        if (item.itemType == 1) {
           // 计划规则 巡点检 设备保养
           this.$refs.planRulesDialogRef.open(item);
-        } else if (item.executeMethod == 2) {
+        } else if (item.itemType == 2) {
           this.$refs.releaseRulesDialogRef.open(
             item,
             this.workOrderInfo,

+ 3 - 3
src/views/produceOrder/components/recordRules/recordRules.vue

@@ -186,11 +186,11 @@
         console.log('this.workOrderInfo', this.workOrderInfo);
         console.log('item', item);
 
-        if (item.executeMethod == 1) {
+        if (item.itemType == 1) {
           // 设备保养计划相关逻辑
-          this.dialogTitle = '新增设备保养计划';
+          this.dialogTitle = '设备保养计划';
           this.$refs.programRulesDialogRef.init(item, this.workOrderInfo);
-        } else if (item.executeMethod == 2) {
+        } else if (item.itemType == 2) {
           this.$refs.releaseRulesDialogRef.openView(item, this.workOrderInfo);
         } else {
           // 任务确认