Răsfoiți Sursa

计划规则报工修改

lucw 7 luni în urmă
părinte
comite
0114c293f3

+ 31 - 9
src/views/batchRecord/components/editModal.vue

@@ -717,6 +717,11 @@
       ref="selectPlanRulesRef"
       ref="selectPlanRulesRef"
       @chooseRules="chooseRules"
       @chooseRules="chooseRules"
     ></selectPlanRules>
     ></selectPlanRules>
+
+    <PlanRulesDialog
+      ref="planRulesDialogRef"
+      @reload="reload"
+    ></PlanRulesDialog>
   </ele-modal>
   </ele-modal>
 </template>
 </template>
 
 
@@ -755,6 +760,7 @@
   import selectWorkOrder from '@/views/checklistManagement/components/selectWorkOrder.vue';
   import selectWorkOrder from '@/views/checklistManagement/components/selectWorkOrder.vue';
   import selectPlanRules from '@/components/selectPlanRules/selectPlanRules.vue';
   import selectPlanRules from '@/components/selectPlanRules/selectPlanRules.vue';
   import { getEamInfoByMesWorkOrderIdAndPlanConfigId } from '@/api/ruleManagement/plan';
   import { getEamInfoByMesWorkOrderIdAndPlanConfigId } from '@/api/ruleManagement/plan';
+  import PlanRulesDialog from '@/views/produce/components/prenatalExamination/PlanRulesDialog.vue';
 
 
   export default {
   export default {
     name: 'editModal',
     name: 'editModal',
@@ -775,7 +781,8 @@
       material,
       material,
       statistics,
       statistics,
       selectWorkOrder,
       selectWorkOrder,
-      selectPlanRules
+      selectPlanRules,
+      PlanRulesDialog
     },
     },
     props: {
     props: {
       // 1-产前准备,2-过程控制,3-产后检查 4-生产统计
       // 1-产前准备,2-过程控制,3-产后检查 4-生产统计
@@ -1412,14 +1419,7 @@
 
 
           if (this.form.executeMethod == 1) {
           if (this.form.executeMethod == 1) {
             // 设备保养计划相关逻辑
             // 设备保养计划相关逻辑
-            this.dialogTitle = '新增设备保养计划';
-            this.$refs.programRulesDialogRef.init(
-              this.form,
-              this.workOrderInfo ? this.workOrderInfo : this.form,
-              {
-                name: this.form.produceTaskName
-              }
-            );
+            this.planRulesSaveOrSubmit();
           } else if (this.form.executeMethod == 2) {
           } else if (this.form.executeMethod == 2) {
             this.releaseRulesSaveOrSubmit(type);
             this.releaseRulesSaveOrSubmit(type);
           } else {
           } else {
@@ -1965,6 +1965,28 @@
             this.$refs.statisticsRef.rebuildMaterialAndProcessData();
             this.$refs.statisticsRef.rebuildMaterialAndProcessData();
           }
           }
         });
         });
+      },
+      // 计划规则 去执行
+      async planRulesSaveOrSubmit() {
+        if (!this.form.planConfigId) {
+          this.$message.warning('请选择事项规则!');
+          return;
+        }
+        if (!this.form.workOrderId) {
+          this.$message.warning('请选择生产工单!');
+          return;
+        }
+        const data = await getEamInfoByMesWorkOrderIdAndPlanConfigId(
+          this.form.workOrderId,
+          this.form.planConfigId
+        );
+        if (!data || JSON.stringify(data) == '{}') {
+          this.$message.warning('未查询到对应的设备计划信息!');
+          return;
+        }
+        console.log('data', data);
+        // 计划规则 巡点检 设备保养
+        this.$refs.planRulesDialogRef.open(data);
       }
       }
     }
     }
   };
   };

+ 11 - 6
src/views/produce/components/prenatalExamination/PlanRulesDialog.vue

@@ -15,12 +15,11 @@
       <!-- 0 派单, 4为撤回的计划 -->
       <!-- 0 派单, 4为撤回的计划 -->
       <programRulesDialog
       <programRulesDialog
         v-if="
         v-if="
-          currentPlanOrders.planStatus == 0 ||
-          currentPlanOrders.planStatus == 4
+          currentPlanOrders.planStatus == 0 || currentPlanOrders.planStatus == 4
         "
         "
         :planId="currentPlanOrders.planId"
         :planId="currentPlanOrders.planId"
         :info="currentPlanOrders"
         :info="currentPlanOrders"
-        @done="setPlanStatus(1)"
+        @done="setWorkOrderIdAndStatus"
       />
       />
       <!-- 1 报工 -->
       <!-- 1 报工 -->
       <signingUpWork
       <signingUpWork
@@ -32,8 +31,7 @@
       <!-- 2 执行中 3 完成展示详情-->
       <!-- 2 执行中 3 完成展示详情-->
       <workOrderDetails
       <workOrderDetails
         v-if="
         v-if="
-          currentPlanOrders.planStatus == 3 ||
-          currentPlanOrders.planStatus == 2
+          currentPlanOrders.planStatus == 3 || currentPlanOrders.planStatus == 2
         "
         "
         :workOrderId="currentPlanOrders.eamWorkOrderId"
         :workOrderId="currentPlanOrders.eamWorkOrderId"
       ></workOrderDetails>
       ></workOrderDetails>
@@ -93,7 +91,7 @@
     data() {
     data() {
       return {
       return {
         visible: false,
         visible: false,
-        title: '巡点检',
+        title: '计划规则',
         // 规则信息
         // 规则信息
         rulesInfo: null,
         rulesInfo: null,
         // 当前项
         // 当前项
@@ -114,6 +112,7 @@
       open(data) {
       open(data) {
         this.rulesInfo = data;
         this.rulesInfo = data;
         console.log('this.rulesInfo', this.rulesInfo);
         console.log('this.rulesInfo', this.rulesInfo);
+        this.title = data.planConfigName;
         this.visible = true;
         this.visible = true;
       },
       },
       // 关闭时清理表单
       // 关闭时清理表单
@@ -129,6 +128,12 @@
       // 报工成功后刷新当前项状态
       // 报工成功后刷新当前项状态
       setPlanStatus(status) {
       setPlanStatus(status) {
         this.rulesInfo.planOrders[this.activeIndex].planStatus = status;
         this.rulesInfo.planOrders[this.activeIndex].planStatus = status;
+      },
+      setWorkOrderIdAndStatus(workOrderId) {
+        console.log('workOrderId', workOrderId);
+        this.rulesInfo.planOrders[this.activeIndex].eamWorkOrderId =
+          workOrderId;
+        this.setPlanStatus(1);
       }
       }
     }
     }
   };
   };

+ 1 - 1
src/views/produce/components/prenatalExamination/components/workOrder/programRulesDialog.vue

@@ -764,7 +764,7 @@
                 let res = await saveOrUpdate(sendMsg);
                 let res = await saveOrUpdate(sendMsg);
                 if (res) {
                 if (res) {
                   this.$message.success(type + '成功!');
                   this.$message.success(type + '成功!');
-                  this.$emit('done');
+                  this.$emit('done', res.data[0]);
                   this.loading = false;
                   this.loading = false;
                   this.visible = false;
                   this.visible = false;
                 }
                 }

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

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