Эх сурвалжийг харах

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-mes into dengfei

695593266@qq.com 7 сар өмнө
parent
commit
d8b68f07cf

+ 3 - 3
src/api/producetaskrulerecord/index.js

@@ -24,10 +24,10 @@ export async function saveRuleRecord(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-// 产前准备是否完成,工序配置事项的产前准备部分,事项里每一项都有已执行记录 /mes/producetaskrulerecord/isPreProductionResult
-export async function isPreProductionResult(body) {
+// 产前准备是否完成,工序配置事项的产前准备部分,事项里每一项都有已执行记录 /mes/producetaskrulerecord/checkProductionResult
+export async function checkProductionResult(body) {
   const res = await request.post(
-    '/mes/producetaskrulerecord/isPreProductionResult',
+    '/mes/producetaskrulerecord/checkProductionResult',
     body
   );
   if (res.data.code == 0) {

+ 7 - 0
src/components/selectReleaseRules/select-release-rules.vue

@@ -106,6 +106,13 @@
               return this.getDictValue('记录规则报工类型', row.reportWorkType);
             }
           },
+          {
+            prop: 'executeMethodName',
+            label: '执行方式',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             prop: 'version',
             label: '版本号',

+ 4 - 4
src/store/getters.js

@@ -20,7 +20,7 @@ export default {
       return item.dictCode === dictCode + '';
     });
 
-    if (!obj) {
+    if (!state.dict[dictEnum[enumName]]) {
       // 提交dict模块下的actions的requestDict
       store.dispatch('dict/requestDict', enumName);
       return '';
@@ -29,10 +29,10 @@ export default {
     return obj && obj.dictValue;
   },
   // 根据字典enumName 获取字典列表 label value 格式
-  getDictListByName: (sate) => (enumName) => {
-    const dList = sate.dict[dictEnum[enumName]] || [];
+  getDictListByName: (state) => (enumName) => {
+    const dList = state.dict[dictEnum[enumName]] || [];
 
-    if (!dList.length) {
+    if (!state.dict[dictEnum[enumName]]) {
       // 提交dict模块下的actions的requestDict
       store.dispatch('dict/requestDict', enumName);
       return '';

+ 218 - 18
src/views/batchRecord/components/editModal.vue

@@ -275,6 +275,70 @@
           </el-col>
         </el-row>
 
+        <header-title
+          v-if="
+            form.reportWorkType == '2' && form.produceTaskId && form.pickDetails
+          "
+          title="物品清单"
+          style="margin-top: 20px"
+        ></header-title>
+
+        <ele-pro-table
+          v-if="
+            form.reportWorkType == '2' && form.produceTaskId && form.pickDetails
+          "
+          ref="table"
+          row-key="id"
+          :columns="materialColumns"
+          :datasource="form.pickDetails"
+          cache-key="prenatal-examination-material-list-table-2510231107"
+          autoAmendPage
+          :needPage="false"
+          @refresh="getListByWorkOrderId"
+        >
+          <!-- <template v-slot:toolbar>
+            <el-button type="primary" @click="openMaterialModal"
+              >添加物料</el-button
+            >
+          </template> -->
+
+          <!-- <template v-slot:reportQuantity="{ row }">
+            <el-input-number
+              size="small"
+              v-model.number="row.reportQuantity"
+              controls-position="right"
+              :min="0"
+              :max="row.feedQuantity"
+            ></el-input-number>
+          </template>
+          <template v-slot:qualifiedQuantity="{ row }">
+            <el-input-number
+              size="small"
+              v-model.number="row.qualifiedQuantity"
+              controls-position="right"
+              :min="0"
+              :max="qualifiedQuantityMax(row)"
+            ></el-input-number>
+          </template>
+          <template v-slot:noQualifiedQuantity="{ row }">
+            <el-input-number
+              size="small"
+              v-model.number="row.noQualifiedQuantity"
+              controls-position="right"
+              :min="0"
+              :max="noQualifiedQuantityMax(row)"
+            ></el-input-number>
+          </template>
+          <template v-slot:msg="{ row }">
+            <el-input
+              v-model="row.msg"
+              type="textarea"
+              rows="1"
+              autosize
+            ></el-input>
+          </template> -->
+        </ele-pro-table>
+
         <header-title
           v-if="form.executeMethod == 2"
           title="检查项目"
@@ -375,19 +439,6 @@
             </el-table-column>
           </el-table>
         </div>
-
-        <!-- 底部审批 -->
-        <!-- <el-row
-          v-if="details && details.processInstanceId"
-          style="margin-top: 40px"
-        >
-          <bpmTask
-            v-if="details.processInstanceId"
-            :id="details.processInstanceId"
-            :businessId="details.id"
-            :gutter="20"
-          ></bpmTask>
-        </el-row> -->
       </el-form>
 
       <bpmDetail
@@ -525,13 +576,15 @@
   import programRulesDialog from '@/views/produce/components/prenatalExamination/programRulesDialog.vue';
   import releaseRulesDialog from '@/views/produce/components/prenatalExamination/releaseRulesDialog.vue';
   import taskDialog from '@/views/produce/components/prenatalExamination/taskDialog.vue';
-  import { saveOrUpdate } from '@/api/producetaskrecordrulesrecord/index';
   import { getById } from '@/api/produceOrder/index.js';
   import EquipmentDialog from './EquipmentDialog.vue';
   import { recordRulesDetailPage } from '@/api/recordRules/index.js';
   import SelectUser from '@/components/select/SelectUser/index.vue';
   import toolModal from './toolModal.vue';
-  import { getById as producetaskrulerecordGetById } from '@/api/producetaskrecordrulesrecord/index.js';
+  import {
+    getById as producetaskrulerecordGetById,
+    queryListByWorkOrderId
+  } from '@/api/producetaskrecordrulesrecord/index.js';
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
   import bpmTask from '@/components/bpmTask/bpmTask.vue';
 
@@ -609,7 +662,9 @@
         // 是否临时执行
         isTempRecord: 1,
         // 记录规则详情
-        details: []
+        details: [],
+        // 物品清单
+        pickDetails: []
       };
 
       return {
@@ -695,7 +750,138 @@
           { key: 'main', name: '事项信息' },
           { key: 'bpm', name: '流程详情' }
         ],
-        activeComp: 'main'
+        activeComp: 'main',
+        // 物料清单表头
+        materialColumns: [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center'
+          },
+          {
+            label: '领料类型',
+            prop: 'categoryLevelNamePath',
+            minWidth: 120
+          },
+          {
+            label: '物料编码',
+            prop: 'categoryCode',
+            minWidth: 120
+          },
+          {
+            label: '物料名称',
+            prop: 'categoryName',
+            minWidth: 120
+          },
+          {
+            label: '工序名称',
+            prop: 'produceTaskName',
+            minWidth: 120
+          },
+          {
+            label: '领料数量',
+            prop: 'pickQuantity',
+            minWidth: 120,
+            formatter: (row) => {
+              return (row.pickQuantity || 0) + (row.pickUnit || '');
+            }
+          },
+          {
+            label: '出库数量',
+            prop: 'outStorageQuantity',
+            minWidth: 120,
+            formatter: (row) => {
+              return (row.outStorageQuantity || 0) + (row.outStorageUnit || '');
+            }
+          },
+          {
+            label: '投料数量',
+            prop: 'feedQuantity',
+            minWidth: 120,
+            formatter: (row) => {
+              return (row.feedQuantity || 0) + (row.feedUnit || '');
+            }
+          },
+          {
+            label: '当次报工数量',
+            prop: 'reportQuantity',
+            minWidth: 160,
+            slot: 'reportQuantity',
+            formatter: (row) => {
+              return (
+                (row.reportQuantity == null ? '' : row.reportQuantity) +
+                (row.feedUnit || '')
+              );
+            }
+          },
+          {
+            label: '当次合格数量',
+            prop: 'qualifiedQuantity',
+            minWidth: 160,
+            slot: 'qualifiedQuantity',
+            formatter: (row) => {
+              return (
+                (row.qualifiedQuantity == null ? '' : row.qualifiedQuantity) +
+                (row.feedUnit || '')
+              );
+            }
+          },
+          {
+            label: '当次不合格数量',
+            prop: 'noQualifiedQuantity',
+            minWidth: 160,
+            slot: 'noQualifiedQuantity',
+            formatter: (row) => {
+              return (
+                (row.noQualifiedQuantity == null
+                  ? ''
+                  : row.noQualifiedQuantity) + (row.feedUnit || '')
+              );
+            }
+          },
+          {
+            label: '不合格原因',
+            prop: 'msg',
+            minWidth: 160,
+            slot: 'msg'
+          },
+          {
+            label: '已报工数量',
+            prop: 'sumReportQuantity',
+            minWidth: 120,
+            formatter(row) {
+              return (row.sumReportQuantity || 0) + row.feedUnit;
+            }
+          },
+          {
+            label: '未报工数量',
+            prop: 'noReportQuantity',
+            minWidth: 120,
+            formatter(row) {
+              if (row.sumReportQuantity != null) {
+                return row.feedQuantity - row.sumReportQuantity + row.feedUnit;
+              }
+              return `${row.feedQuantity}${row.feedUnit || ''}`;
+            }
+          },
+          {
+            label: '合格总数',
+            prop: 'sumQualifiedQuantity',
+            minWidth: 120,
+            formatter(row) {
+              return (row.sumQualifiedQuantity || 0) + (row.feedUnit || '');
+            }
+          },
+          {
+            label: '不合格总数',
+            prop: 'sumNoQualifiedQuantity',
+            minWidth: 120,
+            formatter(row) {
+              return (row.sumNoQualifiedQuantity || 0) + (row.feedUnit || '');
+            }
+          }
+        ]
       };
     },
     computed: {
@@ -762,6 +948,7 @@
           };
         });
         console.log('this.form', this.form);
+        this.getListByWorkOrderId();
       },
       // 查询规则详情
       async getRulesDetias() {
@@ -803,7 +990,7 @@
         this.form.ruleName = '';
         this.form.details = [];
         this.$nextTick(() => {
-          this.$refs.formRef.clearValidate()
+          this.$refs.formRef.clearValidate();
         });
       },
       // 去选择设备
@@ -1036,6 +1223,19 @@
       clearTool(row) {
         row.tools = [];
         row.toolNames = '';
+      },
+      async getListByWorkOrderId() {
+        if (!this.form.produceTaskId) return;
+        // 查询物料信息
+        const materialList = await queryListByWorkOrderId({
+          workOrderId: this.form.workOrderId,
+          recordId: this.form.id,
+          produceTaskId: this.form.produceTaskId,
+          ruleId: this.form.ruleId
+        });
+
+        console.log('materialList 物料信息', materialList);
+        this.form.pickDetails = materialList;
       }
     }
   };

+ 6 - 1
src/views/batchRecord/components/list.vue

@@ -198,7 +198,7 @@
             }
           },
           {
-            label: '执行方式',
+            label: '配置执行方式',
             prop: 'executeMethod',
             minWidth: 150,
             formatter: (row) => {
@@ -213,6 +213,11 @@
               return row.ruleName || row.itemTaskName;
             }
           },
+          {
+            label: '记录执行方式',
+            prop: 'recordRulesExecuteMethodName',
+            minWidth: 180
+          },
           {
             label: '状态',
             minWidth: 80,

+ 11 - 1
src/views/checklistManagement/checklist.vue

@@ -143,7 +143,7 @@
           },
           {
             prop: 'formingNum',
-            label: '数量',
+            label: '要求生产数量',
             align: 'center',
             minWidth: 110,
             showOverflowTooltip: true,
@@ -151,6 +151,16 @@
               return row.orders.map((i) => i.formingNum).join(', ');
             }
           },
+          {
+            prop: 'formedNum',
+            label: '实际生产数量',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              return row.orders.map((i) => i.formedNum).join(', ');
+            }
+          },
           {
             prop: 'specification',
             label: '规格',

+ 3 - 0
src/views/produce/components/feeding/index.vue

@@ -825,6 +825,9 @@
           }
         }
 
+        // 点击了缓存或者投料
+        this.$emit('reload');
+
         const isCache = await this.checkCache(type);
 
         if (!isCache) {

+ 42 - 23
src/views/produce/components/footBtn.vue

@@ -26,8 +26,10 @@
       singleReportInspection: {},
       // 是否完成产前准备
       isPreProductionResult: {
-        type: Boolean,
-        default: true
+        type: Object,
+        default: () => {
+          return null;
+        }
       }
     },
     data() {
@@ -263,18 +265,24 @@
           }
         ],
         btnList: [],
-        // 未完成产前准备 需要禁用的按钮
-        disable: [
-          '领料',
-          '投料',
-          '过程监测',
-          '报工',
-          '委外请托',
-          '暂停启动',
-          '产后检查',
-          '工单交接',
-          '异常'
-        ]
+        disableObj: {
+          preResult: {
+            buts: ['投料', '过程监测', '产后检查', '报工'],
+            msg: '请先完成产前准备'
+          },
+          feedResult: {
+            buts: ['过程监测', '产后检查', '报工'],
+            msg: '请先完成投料'
+          },
+          processResult: {
+            buts: ['产后检查', '报工'],
+            msg: '请先完成过程监测'
+          },
+          postResult: {
+            buts: ['报工'],
+            msg: '请先完成产后检查'
+          }
+        }
       };
     },
     computed: {
@@ -286,14 +294,24 @@
         return this.$store.state.user.info.clientEnvironmentId;
       },
       btnListData() {
-        if (this.isPreProductionResult) {
-          return this.btnList;
-        }
+        // 根据是否完成产前准备等前置条件 来禁用按钮
         return this.btnList.map((i) => {
-          return {
-            ...i,
-            disable: this.disable.includes(i.name)
-          };
+          if (this.isPreProductionResult) {
+            for (let key in this.isPreProductionResult) {
+              let obj = this.disableObj[key];
+              if (!this.isPreProductionResult[key] && obj) {
+                // 未完成
+                if (obj.buts.includes(i.name) && !i.disable) {
+                  return {
+                    ...i,
+                    disable: true,
+                    msg: obj.msg
+                  };
+                }
+              }
+            }
+          }
+          return i;
         });
       }
     },
@@ -365,8 +383,9 @@
     },
     methods: {
       footClick(item) {
-        if (item.disable && !this.isPreProductionResult) {
-          return this.$message.warning(`请先完成产前准备!`);
+        if (item.disable) {
+          this.$message.warning(item.msg);
+          return;
         }
         this.$emit('footBtn', item.type);
       }

+ 0 - 17
src/views/produce/components/new_produceOrder.vue

@@ -93,7 +93,6 @@
     removeItem,
     updateCertificateNumber
   } from '@/api/inspectionWork';
-  import { isPreProductionResult } from '@/api/producetaskrulerecord/index.js';
 
   export default {
     components: { routings },
@@ -473,28 +472,12 @@
           return this.$message.warning('请选择报工类型相同的工单');
         }
 
-        if (
-          this.produceTaskInfo &&
-          this.produceTaskInfo.isPrenatalPreProduction &&
-          val.length > 0
-        ) {
-          // 判断是否要求先完成 产前准备
-          const result = await isPreProductionResult({
-            produceTaskId: this.produceTaskInfo.id,
-            workOrderIds: val.map((i) => i.id)
-          });
-          this.$emit('changeIsPreProductionResult', result);
-        } else {
-          this.$emit('changeIsPreProductionResult', true);
-        }
-
         let ids = [];
         ids = val.map((item) => {
           return item.id;
         });
         this.$emit('workSelect', { ids: ids, list: val });
       },
-
       rowClick(e) {
         this.$emit('rowClick', e, this.taskObj.id);
       },

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

@@ -2,7 +2,7 @@
   <el-dialog
     title="报工"
     :visible.sync="dialogVisible"
-    width="500px"
+    width="600px"
     :before-close="handleClose"
   >
     <div>
@@ -22,6 +22,8 @@
         >
           <div class="circle">{{ index + 1 }}</div>
           <div class="desc">{{ item.ruleName || item.itemTaskName }}</div>
+          <div class="methods">{{ item.recordRulesExecuteMethodName }}</div>
+
           <el-button
             :type="item.executeStatus == 0 ? 'primary' : 'default'"
             class="status-btn"
@@ -114,6 +116,7 @@
         this.loading = false;
       },
       handleClose() {
+        this.$emit('close');
         this.dialogVisible = false;
       },
       async handleUpdate() {
@@ -193,6 +196,15 @@
       flex: 1;
       font-size: 14px;
       color: #333;
+      max-width: 300px;
+      white-space: pre-line;
+      word-break: break-all;
+    }
+
+    .methods {
+      max-width: 90px;
+      white-space: pre-line;
+      word-break: break-all;
     }
 
     .status-btn {

+ 29 - 60
src/views/produce/components/prenatalExamination/releaseRulesDialog.vue

@@ -174,7 +174,7 @@
                 <div style="width: 40px; box-sizing: border-box">
                   <el-form-item>
                     <DictSelection
-                      dictName="单位"
+                      dictName="检查有效期单位"
                       clearable
                       v-model="addForm.checkValidityUnit"
                       placeholder="单位"
@@ -189,6 +189,15 @@
         </el-col>
       </el-row>
       <el-row>
+        <el-col v-if="addForm.recordRulesExecuteMethodName" :span="8">
+          <el-form-item label="执行方式" required>
+            <el-input
+              v-model="addForm.recordRulesExecuteMethodName"
+              placeholder="自动带出"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
         <el-col :span="8">
           <el-form-item label="结论" required prop="conclution">
             <el-radio-group
@@ -269,26 +278,12 @@
       }`"
     ></header-title>
 
-    <el-tabs
-      v-if="executeMethodTitleList.length"
-      v-model="activeExecuteMethodTitle"
-      type="card"
-    >
-      <el-tab-pane
-        v-for="i in executeMethodTitleList"
-        :label="i"
-        :name="i"
-        :key="i"
-      >
-      </el-tab-pane>
-    </el-tabs>
-
     <ele-pro-table
       v-loading="loading"
       ref="table"
       row-key="id"
       :columns="detailsColumns"
-      :datasource="rulesDetails"
+      :datasource="addForm.details"
       cacheKey="mes-releaseRulesDialong-2510281408"
       :needPage="false"
     >
@@ -372,9 +367,7 @@
       >
       <template v-slot:checkResult="{ row }">
         <div>
-          <el-radio-group
-            v-model="row.checkResult"
-          >
+          <el-radio-group v-model="row.checkResult">
             <el-radio :label="1">合格</el-radio>
             <el-radio :label="0">不合格</el-radio>
           </el-radio-group>
@@ -456,9 +449,12 @@
   import { getTeam } from '@/api/produce/job.js';
   import materialModal from './materialModal.vue';
   import { getFactoryarea } from '@/api/aps/index';
+  import dictMixins from '@/mixins/dictMixins';
+  import tableColumnsMixin from '@/mixins/tableColumnsMixin';
 
   export default {
     components: { SelectUser, toolModal, materialModal },
+    mixins: [dictMixins, tableColumnsMixin],
     emits: ['reload'],
     props: {
       isTempRecord: {
@@ -528,7 +524,9 @@
         // 班组id
         teamId: '',
         // 物料字段name
-        pickDetails: []
+        pickDetails: [],
+        recordRulesExecuteMethodId: null,
+        recordRulesExecuteMethodName: ''
       };
 
       return {
@@ -730,25 +728,19 @@
             }
           }
         ],
-        activeExecuteMethodTitle: '',
-        executeMethodTitleList: [],
         workshopAreaList: []
       };
     },
     computed: {
       title() {
-        if (this.ruleInfo) {
-          switch (this.ruleInfo.classify) {
-            case 1:
-              return '清场清洁类记录表';
-            case 2:
-              return '车间环境类记录表';
-
-            default:
-              return '设备检测类记录表';
-          }
+        if (this.addForm.recordRulesClassify) {
+          const dictValue = this.getDictValue(
+            '记录规则类型',
+            this.addForm.recordRulesClassify
+          );
+          return dictValue + '记录表';
         }
-        return '记录表';
+        return '记录表';
       },
       activeTeamUserList() {
         return this.teamUserList.filter((user) =>
@@ -815,14 +807,6 @@
           });
         }
         return list;
-      },
-      rulesDetails() {
-        if (this.executeMethodTitleList.length) {
-          return this.addForm.details.filter(
-            (item) => item.executeMethodTitle == this.activeExecuteMethodTitle
-          );
-        }
-        return this.addForm.details;
       }
     },
     mounted() {
@@ -868,6 +852,10 @@
           this.addForm.workOrderCode = workOrderInfo.code;
           this.addForm.workOrderId = workOrderInfo.id;
           this.addForm.brandNo = productionInfo.brandNo;
+          this.addForm.recordRulesExecuteMethodId =
+            productionInfo.recordRulesExecuteMethodId;
+          this.addForm.recordRulesExecuteMethodName =
+            productionInfo.recordRulesExecuteMethodName;
 
           // 临时添加存在规则详情
 
@@ -908,16 +896,6 @@
           this.addForm.recordRulesClassify += '';
           if (this.addForm.details?.length == 0) {
             this.getRuleList();
-          } else {
-            // 分组
-            let executeMethodTitleList = this.addForm.details
-              .map((i) => i.executeMethodTitle)
-              .filter((i) => i);
-
-            this.executeMethodTitleList = [...new Set(executeMethodTitleList)];
-
-            this.activeExecuteMethodTitle =
-              this.executeMethodTitleList[0] || '';
           }
 
           this.addForm.executeUsersIds = this.addForm.executeUsers.map(
@@ -994,21 +972,12 @@
             toolNames: i.tools.map((i) => i.toolName).join(',')
           };
         });
-        let executeMethodTitleList = this.addForm.details
-          .map((i) => i.executeMethodTitle)
-          .filter((i) => i);
-
-        this.executeMethodTitleList = [...new Set(executeMethodTitleList)];
-
-        this.activeExecuteMethodTitle = this.executeMethodTitleList[0] || '';
 
         console.log('this.addForm 添加规则', this.addForm, list);
       },
       handleBeforeClose() {
         this.addForm = JSON.parse(JSON.stringify(this.formDate));
         console.log('this.$refs.ruleFormRef', this.addForm);
-        this.activeExecuteMethodTitle = '';
-        this.executeMethodTitleList = [];
         this.$nextTick(() => {
           this.$refs.ruleFormRef.clearValidate();
           this.visible = false;

+ 28 - 10
src/views/produce/index.vue

@@ -164,7 +164,6 @@
                 ref="produceOrder"
                 @getTaskName="getTaskName"
                 :produceTaskInfo="produceTaskInfo"
-                @changeIsPreProductionResult="changeIsPreProductionResult"
               >
               </produceOrder>
             </div>
@@ -191,6 +190,7 @@
                 <feeding
                   :workListIds="workListIds"
                   :feedNeedEquipment="feedNeedEquipment"
+                  @reload="reloadFeeding"
                 ></feeding>
               </div>
 
@@ -345,7 +345,10 @@
     <BomDetailsPop ref="bomDrawer"></BomDetailsPop>
 
     <!-- 产前准备 、 过程监测 、产后检测 -->
-    <prenatalExamination ref="prenatalExaminationRef" />
+    <prenatalExamination
+      ref="prenatalExaminationRef"
+      @close="closePrenatalExamination"
+    />
   </div>
 </template>
 
@@ -394,6 +397,7 @@
   } from '@/api/produce/index';
   import prenatalExamination from './components/prenatalExamination/index.vue';
   import { workorderPage2 } from '@/api/produce/workOrder.js';
+  import { checkProductionResult } from '@/api/producetaskrulerecord/index.js';
 
   export default {
     components: {
@@ -487,7 +491,7 @@
           { label: '过程检测', action: 'Edit' },
           { label: '产后检查', action: 'Favorite' }
         ],
-        isPreProductionResult: true,
+        isPreProductionResult: null,
         chooseType: '1',
         isUpdataTask: false,
         treeKey: '1'
@@ -617,7 +621,7 @@
 
         // 重置按钮 禁用
         if (this.produceTaskInfo && this.produceTaskInfo.id != data.id) {
-          this.isPreProductionResult = true;
+          this.isPreProductionResult = null;
         }
 
         console.log(data, 'handleNodeClick');
@@ -663,7 +667,7 @@
             if (this.produceTaskList?.length) {
               this.$store.commit('user/setTaskObj', this.produceTaskList[0]);
               this.$nextTick(() => {
-                this.$refs.taskListRef.setCurrentKey(
+                this.$refs.taskListRef?.setCurrentKey(
                   this.produceTaskList[0].id
                 );
               });
@@ -682,7 +686,7 @@
             if (this.produceTaskList?.length) {
               this.$store.commit('user/setTaskObj', this.produceTaskList[0]);
               this.$nextTick(() => {
-                this.$refs.taskListRef.setCurrentKey(
+                this.$refs.taskListRef?.setCurrentKey(
                   this.produceTaskList[0].id
                 );
               });
@@ -835,6 +839,7 @@
         this.operationType = null;
         this.workListIds = data.ids;
         this.workData = data;
+        this.checkProductionResult();
       },
 
       pickingWokeClose() {
@@ -1202,10 +1207,23 @@
           });
         }
       },
-      // 是否完成 产前准备 限制按钮
-      changeIsPreProductionResult(isPreProductionResult) {
-        console.log('isPreProductionResult', isPreProductionResult);
-        this.isPreProductionResult = isPreProductionResult;
+      closePrenatalExamination() {
+        this.checkProductionResult();
+      },
+      //是否完成 产前准备 限制按钮
+      async checkProductionResult() {
+        if (this.produceTaskInfo && this.workListIds.length > 0) {
+          // 判断是否要求先完成 产前准备等事项
+          const result = await checkProductionResult({
+            produceTaskId: this.produceTaskInfo.id,
+            workOrderIds: this.workListIds
+          });
+          this.isPreProductionResult = result;
+        }
+      },
+      // 投料后 重新检测按钮状态
+      reloadFeeding() {
+        this.checkProductionResult();
       }
     },