695593266@qq.com 2 месяцев назад
Родитель
Сommit
8d0c356f16

+ 12 - 6
src/views/produce/components/prenatalExamination/index.vue

@@ -4,6 +4,7 @@
     :visible.sync="dialogVisible"
     width="60%"
     :before-close="handleClose"
+    append-to-body
   >
     <div>
       <!-- <el-button type="primary" plain round @click="openMaintenancePlan">
@@ -260,7 +261,10 @@
         console.log('item~~~', item);
         // itemType 事项类型
         if (item.itemType == 1) {
-          if((!item.planOrders || item.planOrders.length == 0) && item.executeMethod == 1) {
+          if (
+            (!item.planOrders || item.planOrders.length == 0) &&
+            item.executeMethod == 1
+          ) {
             this.$message.error('未生成设备计划');
             return;
           }
@@ -268,23 +272,25 @@
           this.$refs.planRulesDialogRef.open(item);
         } else if (item.itemType == 2) {
           // 事件驱动
-          if(item.executeMethod == 1) {
+          if (item.executeMethod == 1) {
             // planRulesEventDialogRef
 
             // // 是否有计划
-            if(!item.plans || item.plans.length == 0) {
+            if (!item.plans || item.plans.length == 0) {
               this.$message.error('未生成记录计划');
               return;
             }
 
-            item.plans.forEach(plan => {
+            item.plans.forEach((plan) => {
               // 找到records数组中planid与当前plan.id匹配的记录
-              plan.matchedRecords = item.records.filter(record => record.planId == plan.id);
+              plan.matchedRecords = item.records.filter(
+                (record) => record.planId == plan.id
+              );
             });
             console.log('匹配后的plans数组:', item);
             this.$refs.planRulesEventDialogRef.open(item);
 
-            return
+            return;
 
             // // 有计划无工单  派单
             // if(item.plans && item.plans.length > 0 && (!item.records || item.records.length == 0)) {

+ 50 - 1
src/views/produceOrder/workReport.vue

@@ -244,6 +244,11 @@
       <!-- <workes ref="jobRefs"> </workes> -->
 
       <!-- :workListIds="workListIds" :taskId="taskObj.id" -->
+      <!-- 产前准备 、 过程控制 、产后检测 -->
+      <prenatalExamination
+        ref="prenatalExaminationRef"
+        @close="closePrenatalExamination"
+      />
       <!-- 工步 -->
       <workStep ref="workStepRef" />
       <!--  任务  -->
@@ -264,6 +269,7 @@
   import TaskDialog from '@/views/produce/components/taskDialog/index.vue';
   import Search from '@/views/produce/components/search.vue';
   import footBtn from '@/views/produce/components/footBtn.vue';
+  import prenatalExamination from '@/views/produce/components/prenatalExamination/index.vue';
   import produceOrder from '@/views/produce/components/new_produceOrder.vue';
   import productionResource from '@/views/produce/components/productionResource/index.vue';
   import outsourcing from '@/views/produce/components/outsourcing/index.vue';
@@ -333,7 +339,8 @@
       outsourcingDetails,
       pleaseEntrust,
       addPlease,
-      qualityInspection
+      qualityInspection,
+      prenatalExamination
     },
     data() {
       return {
@@ -954,6 +961,48 @@
           );
         }
 
+        // this.$refs.prenatalExaminationRef.open(
+        //   this.workData.list[0],
+        //   this.produceTaskInfo,
+        //   type
+        // );
+
+        if (t == 'prenatalExamination') {
+          if (this.workListIds.length > 1) {
+            return this.$message.warning('产前准备只能选择一个工单!');
+          }
+
+          this.$refs.prenatalExaminationRef.open(
+            this.workOrderInfo,
+            this.taskObj,
+            1
+          );
+        }
+
+        if (t == 'postpartumExamination') {
+          if (this.workListIds.length > 1) {
+            return this.$message.warning('产后检查只能选择一个工单!');
+          }
+
+          this.$refs.prenatalExaminationRef.open(
+            this.workOrderInfo,
+            this.taskObj,
+            3
+          );
+        }
+
+        if (t == 'processDetection') {
+          if (this.workListIds.length > 1) {
+            return this.$message.warning('过程控制只能选择一个工单!');
+          }
+
+          this.$refs.prenatalExaminationRef.open(
+            this.workOrderInfo,
+            this.taskObj,
+            2
+          );
+        }
+
         if (t === 'error') {
           if (this.workListIds.length > 1) {
             return this.$message.warning('异常只能选择一个工单!');