From ddc35c1d91e28509ceb86a50d8b10874936976aa Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 22 九月 2026 12:58:27 +0800
Subject: [PATCH] feat(mes): 优化质检模块功能并新增出货检验检测结果枚举

---
 src/views/mes/qc/components/qc-report-print.vue |   32 ++++-
 src/views/mes/qc/batchtrace/data.ts             |    2 
 src/views/mes/qc/iqc/index.vue                  |   18 +++
 src/views/mes/qc/ipqc/data.ts                   |  101 ++++++-------------
 src/packages/constants/src/biz-mes-enum.ts      |    7 +
 src/views/mes/qc/iqc/data.ts                    |    2 
 src/api/mes/qc/ipqc/index.ts                    |   11 -
 src/views/mes/qc/pendinginspect/index.vue       |    4 
 src/views/mes/qc/oqc/data.ts                    |   11 +-
 src/views/mes/qc/ipqc/index.vue                 |   18 +++
 src/views/mes/qc/oqc/index.vue                  |   18 +++
 src/views/mes/qc/oqc/modules/form.vue           |   14 +-
 src/views/mes/qc/rqc/index.vue                  |   18 +++
 src/api/mes/qc/pendinginspect/index.ts          |    1 
 src/api/mes/qc/indicatorresult/index.ts         |    8 +
 src/packages/constants/src/dict-enum.ts         |    1 
 src/views/mes/qc/rqc/data.ts                    |    2 
 17 files changed, 165 insertions(+), 103 deletions(-)

diff --git a/src/api/mes/qc/indicatorresult/index.ts b/src/api/mes/qc/indicatorresult/index.ts
index 6cc37f8..fce2910 100644
--- a/src/api/mes/qc/indicatorresult/index.ts
+++ b/src/api/mes/qc/indicatorresult/index.ts
@@ -132,6 +132,7 @@
     samplingTime?: Date;
     batchQuantity?: number;
     checkResult?: number;
+    checkResultText?: string; // 妫�娴嬬粨鏋滄枃妗堬紙鍚庣鎸夎川妫�绫诲瀷瀛楀吀瑙f瀽锛岀敤浜庡垽瀹氱粨璁猴級
     inspectorUserId?: number;
     inspectorName?: string;
     auditUserId?: number;
@@ -150,3 +151,10 @@
     params: { qcId, qcType, resultId },
   });
 }
+
+/** 瀵煎嚭浜у搧妫�楠屽崟 Word锛堢焊璐ㄦ楠屽崟鐗堝紡锛岃繑鍥� Blob锛� */
+export function exportProductWord(qcId: number, qcType: number, resultId?: number) {
+  return requestClient.download('/mes/qc/indicator-result/export-product-word', {
+    params: { qcId, qcType, resultId },
+  });
+}
diff --git a/src/api/mes/qc/ipqc/index.ts b/src/api/mes/qc/ipqc/index.ts
index e25a440..a30f108 100644
--- a/src/api/mes/qc/ipqc/index.ts
+++ b/src/api/mes/qc/ipqc/index.ts
@@ -14,15 +14,8 @@
     sourceDocId?: number; // 鏉ユ簮鍗曟嵁 ID
     sourceLineId?: number; // 鏉ユ簮鍗曟嵁琛� ID
     sourceDocCode?: string; // 鏉ユ簮鍗曟嵁缂栧彿锛堝叧鑱旀煡璇級
-    workOrderId?: number; // 鐢熶骇璁㈠崟 ID
-    workOrderCode?: string; // 璁㈠崟缂栧彿锛堝叧鑱旀煡璇級
-    workOrderName?: string; // 璁㈠崟鍚嶇О锛堝叧鑱旀煡璇級
-    taskId?: number; // 鐢熶骇浠诲姟 ID
-    workstationId?: number; // 宸ヤ綅 ID
-    workstationName?: string; // 宸ヤ綅鍚嶇О锛堝叧鑱旀煡璇級
-    processId?: number; // 宸ュ簭 ID
-    processName?: string; // 宸ュ簭鍚嶇О锛堝叧鑱旀煡璇級
-    itemId?: number; // 浜у搧鐗╂枡 ID
+    batchCode?: string; // 鎵瑰彿
+    itemId?: number; // 浜у搧鐗╂枡 ID锛圡DM 鐗╂枡 ID锛�
     itemCode?: string; // 浜у搧鐗╂枡缂栫爜锛堝叧鑱旀煡璇級
     itemName?: string; // 浜у搧鐗╂枡鍚嶇О锛堝叧鑱旀煡璇級
     itemSpecification?: string; // 瑙勬牸鍨嬪彿锛堝叧鑱旀煡璇級
diff --git a/src/api/mes/qc/pendinginspect/index.ts b/src/api/mes/qc/pendinginspect/index.ts
index cbfbe7f..4e52e21 100644
--- a/src/api/mes/qc/pendinginspect/index.ts
+++ b/src/api/mes/qc/pendinginspect/index.ts
@@ -15,6 +15,7 @@
     itemName?: string; // 鐗╂枡鍚嶇О
     specification?: string; // 瑙勬牸鍨嬪彿
     unitName?: string; // 鍗曚綅鍚嶇О
+    batchCode?: string; // 鎵瑰彿锛堜粎 IPQC 鏉ユ簮鎻愪緵锛�
     quantity?: number; // 寰呮鏁伴噺
     // 渚涘簲鍟嗭紙IQC 鍦烘櫙锛�
     vendorId?: number; // 渚涘簲鍟� ID
diff --git a/src/packages/constants/src/biz-mes-enum.ts b/src/packages/constants/src/biz-mes-enum.ts
index 3ad002f..de96522 100644
--- a/src/packages/constants/src/biz-mes-enum.ts
+++ b/src/packages/constants/src/biz-mes-enum.ts
@@ -523,6 +523,13 @@
   FAIL: 2, // 鏍¢獙涓嶉�氳繃
 } as const;
 
+/** MES 鍑鸿揣妫�楠屾娴嬬粨鏋滄灇涓撅紙浠� OQC 浣跨敤锛屾寜浜у搧绛夌骇鍒ゅ畾锛� */
+export const MesQcOqcCheckResultEnum = {
+  TYPE_1: 1, // 1鍨�
+  TYPE_2: 2, // 2鍨�
+  SCRAP: 3, // 搴熷搧
+} as const;
+
 /** MES 璐ㄦ鍗曠姸鎬佹灇涓� */
 export const MesQcStatusEnum = {
   DRAFT: MesOrderStatusConstants.DRAFT,
diff --git a/src/packages/constants/src/dict-enum.ts b/src/packages/constants/src/dict-enum.ts
index 2a62e5a..32489fb 100644
--- a/src/packages/constants/src/dict-enum.ts
+++ b/src/packages/constants/src/dict-enum.ts
@@ -262,6 +262,7 @@
   MES_QC_RESULT_TYPE: 'mes_qc_result_type', // MES 璐ㄦ缁撴灉鍊肩被鍨�
   MES_QC_TYPE: 'mes_qc_type', // MES 璐ㄦ鏂规绫诲瀷
   MES_QC_CHECK_RESULT: 'mes_qc_check_result', // MES 妫�娴嬬粨鏋�
+  MES_OQC_CHECK_RESULT: 'mes_oqc_check_result', // MES 鍑鸿揣妫�楠屾娴嬬粨鏋�
   MES_QC_SOURCE_DOC_TYPE: 'mes_qc_source_doc_type', // MES 鏉ユ簮鍗曟嵁绫诲瀷
   MES_IPQC_TYPE: 'mes_ipqc_type', // MES IPQC 妫�楠岀被鍨�
   MES_RQC_TYPE: 'mes_rqc_type', // MES 閫�璐ф楠岀被鍨�
diff --git a/src/views/mes/qc/batchtrace/data.ts b/src/views/mes/qc/batchtrace/data.ts
index 3013c2e..6fcb698 100644
--- a/src/views/mes/qc/batchtrace/data.ts
+++ b/src/views/mes/qc/batchtrace/data.ts
@@ -336,7 +336,7 @@
       width: 110,
       cellRender: {
         name: 'CellDict',
-        props: { type: DICT_TYPE.MES_QC_CHECK_RESULT },
+        props: { type: DICT_TYPE.MES_OQC_CHECK_RESULT },
       },
     },
     {
diff --git a/src/views/mes/qc/components/qc-report-print.vue b/src/views/mes/qc/components/qc-report-print.vue
index a3cfb4a..59611b6 100644
--- a/src/views/mes/qc/components/qc-report-print.vue
+++ b/src/views/mes/qc/components/qc-report-print.vue
@@ -3,7 +3,7 @@
 
 import { computed, nextTick, ref } from 'vue';
 
-import { DICT_TYPE } from '@vben/constants';
+import { DICT_TYPE, MesQcTypeEnum } from '@vben/constants';
 import { getDictLabel } from '@vben/hooks';
 import { useUserStore } from '@vben/stores';
 import { formatDateTime } from '@vben/utils';
@@ -11,7 +11,8 @@
 import { getQcReport } from '#/api/mes/qc/indicatorresult';
 
 /**
- * MES 妫�楠屾姤鍛婂崟鎵撳嵃缁勪欢锛堝寲宸ユ楠岃褰曠増寮忥細琛ㄥご + 妫�楠岄」鐭╅樀 + 骞宠娴嬮噺鍒� + 绛惧瓧鍖猴級
+ * MES 妫�楠屾姤鍛婂崟鎵撳嵃缁勪欢锛堝寲宸ユ楠岃褰曠増寮忥細琛ㄥご + 妫�楠岄」鐭╅樀 + 骞宠娴嬮噺鍒� +
+ * 鍒ゅ畾缁撹/璐ㄦ涓撶敤绔� + 澶囨敞 + 绛惧瓧鍖猴級
  *
  * 鎵撳嵃鏍峰紡鍙傝�� erp/sale/order/modules/print.vue锛圱eleport + body class + @media print锛夈��
  */
@@ -91,15 +92,25 @@
   return rows;
 });
 
-/** 妫�娴嬬粨鏋滄枃妗堬紙瀛楀吀 mes_qc_check_result锛� */
+/** 妫�娴嬬粨鏋滄枃妗堬細浼樺厛鐢ㄥ悗绔寜璐ㄦ绫诲瀷瑙f瀽鐨勬枃妗堬紝缂哄け鏃舵寜璐ㄦ绫诲瀷閫夊瓧鍏稿厹搴� */
 const checkResultText = computed(() => {
+  if (report.value.checkResultText) {
+    return report.value.checkResultText;
+  }
   if (report.value.checkResult == null) {
     return '-';
   }
-  return (
-    getDictLabel(DICT_TYPE.MES_QC_CHECK_RESULT, report.value.checkResult) || '-'
-  );
+  const dictType =
+    report.value.qcType === MesQcTypeEnum.OQC
+      ? DICT_TYPE.MES_OQC_CHECK_RESULT
+      : DICT_TYPE.MES_QC_CHECK_RESULT;
+  return getDictLabel(dictType, report.value.checkResult) || '-';
 });
+
+/** 娴嬮噺鍒楀ご锛氭棤骞宠娴嬮噺鏃跺彨銆屾祴閲忓�笺�嶏紝澶氭壒娆℃椂鎸夈�屾祴閲�1銆嶃�屾祴閲�2銆嶅尯鍒� */
+function measureHeader(no: number) {
+  return measureNos.value.length > 1 ? `娴嬮噺${no}` : '娴嬮噺鍊�';
+}
 
 function waitForPaint() {
   return new Promise<void>((resolve) => {
@@ -155,7 +166,6 @@
         <div>
           閲囨牱/妫�楠屾椂闂达細{{ formatDateTime(report.samplingTime) || '-' }}
         </div>
-        <div>妫�娴嬬粨璁猴細{{ checkResultText }}</div>
         <div>鎵撳嵃鏃堕棿锛歿{ printTime || '-' }}</div>
       </div>
 
@@ -168,7 +178,7 @@
             <th class="cell bg">鏂规硶/鍏紡</th>
             <th class="cell w-24 bg">鏍囧噯鍊�</th>
             <th v-for="no in measureNos" :key="`h-${no}`" class="cell w-20 bg">
-              娴嬮噺{{ no }}
+              {{ measureHeader(no) }}
             </th>
             <th class="cell bg">澶囨敞</th>
           </tr>
@@ -213,6 +223,12 @@
         </tbody>
       </table>
 
+      <!-- 鍒ゅ畾缁撹 + 璐ㄦ涓撶敤绔狅紙鍒ゅ畾缁撹甯﹀嚭妫�楠岀粨鏋滐紝鐩栫珷鍖虹暀绌烘墦鍗板悗浜哄伐鐩栫珷锛� -->
+      <div class="mt-3 grid grid-cols-2 text-sm leading-[1.6]">
+        <div class="cell min-h-[90px]">鍒ゅ畾缁撹锛歿{ checkResultText }}</div>
+        <div class="cell min-h-[90px]">璐ㄦ涓撶敤绔狅細</div>
+      </div>
+
       <!-- 澶囨敞 + 绛惧瓧鍖� -->
       <div class="mt-3 border border-solid border-[#dcdfe6] p-3 text-sm leading-[1.6]">
         澶囨敞锛歿{ report.remark || '-' }}
diff --git a/src/views/mes/qc/ipqc/data.ts b/src/views/mes/qc/ipqc/data.ts
index 78363f1..0a6c7a9 100644
--- a/src/views/mes/qc/ipqc/data.ts
+++ b/src/views/mes/qc/ipqc/data.ts
@@ -5,12 +5,7 @@
 
 import { h, markRaw } from 'vue';
 
-import {
-  DICT_TYPE,
-  MesAutoCodeRuleCode,
-  MesProTaskStatusEnum,
-  MesProWorkOrderStatusEnum,
-} from '@vben/constants';
+import { DICT_TYPE, MesAutoCodeRuleCode } from '@vben/constants';
 import { getDictOptions } from '@vben/hooks';
 
 import { Button } from 'ant-design-vue';
@@ -19,10 +14,7 @@
 import { getTemplateItemOptionList } from '#/api/mes/qc/template/item';
 import { getSimpleUserList } from '#/api/system/user';
 import { getRangePickerDefaultProps } from '#/utils';
-import { MdItemSelect } from '#/views/mes/md/item/components';
-import { MdWorkstationSelect } from '#/views/mes/md/workstation/components';
-import { ProTaskSelect } from '#/views/mes/pro/task/components';
-import { ProWorkOrderSelect } from '#/views/mes/pro/workorder/components';
+import { MdmItemSelect } from '#/views/basicData/mdm/components';
 
 /** 琛ㄥ崟绫诲瀷 */
 export type FormType = 'create' | 'detail' | 'update';
@@ -152,60 +144,31 @@
       },
     },
     {
-      fieldName: 'workOrderId',
-      label: '鐢熶骇璁㈠崟',
-      component: markRaw(ProWorkOrderSelect),
+      fieldName: 'itemId',
+      label: '浜у搧鐗╂枡',
+      component: markRaw(MdmItemSelect),
       componentProps: {
-        placeholder: '璇烽�夋嫨鐢熶骇璁㈠崟',
-        status: MesProWorkOrderStatusEnum.CONFIRMED,
-        // 璁㈠崟鍙樻洿鏃舵竻绌虹敓浜т换鍔�
-        onChange: () => formApi?.setFieldValue('taskId', undefined),
+        placeholder: '璇烽�夋嫨浜у搧鐗╂枡',
       },
       rules: 'selectRequired',
       dependencies: {
         triggerFields: ['sourceDocId'],
         componentProps: (values) => ({
           disabled: !!values.sourceDocId,
-          placeholder: '璇烽�夋嫨鐢熶骇璁㈠崟',
-          status: MesProWorkOrderStatusEnum.CONFIRMED,
-          onChange: () => formApi?.setFieldValue('taskId', undefined),
+          placeholder: '璇烽�夋嫨浜у搧鐗╂枡',
         }),
       },
     },
     {
-      fieldName: 'workstationId',
-      label: '宸ヤ綅',
-      component: markRaw(MdWorkstationSelect),
+      fieldName: 'batchCode',
+      label: '鎵瑰彿',
+      component: 'Input',
       componentProps: {
-        placeholder: '璇烽�夋嫨宸ヤ綅',
+        allowClear: true,
+        maxlength: 100,
+        placeholder: '璇疯緭鍏ユ壒鍙�',
       },
-      rules: 'selectRequired',
-      dependencies: {
-        triggerFields: ['sourceDocId'],
-        componentProps: (values) => ({
-          disabled: !!values.sourceDocId,
-          placeholder: '璇烽�夋嫨宸ヤ綅',
-        }),
-      },
-    },
-    {
-      fieldName: 'taskId',
-      label: '鐢熶骇浠诲姟',
-      component: markRaw(ProTaskSelect),
-      componentProps: {
-        placeholder: '璇烽�夋嫨鐢熶骇浠诲姟',
-        statuses: [MesProTaskStatusEnum.PREPARE],
-      },
-      dependencies: {
-        triggerFields: ['sourceDocId', 'workOrderId', 'workstationId'],
-        componentProps: (values) => ({
-          disabled: !!values.sourceDocId || !values.workOrderId,
-          placeholder: '璇烽�夋嫨鐢熶骇浠诲姟',
-          statuses: [MesProTaskStatusEnum.PREPARE],
-          workOrderId: values.workOrderId,
-          workstationId: values.workstationId,
-        }),
-      },
+      rules: 'required',
     },
     {
       fieldName: 'templateId',
@@ -220,23 +183,22 @@
       },
       rules: 'selectRequired',
       dependencies: {
-        triggerFields: ['workOrderId', 'taskId'],
+        triggerFields: ['itemId'],
         componentProps: (values) => ({
           api: getTemplateItemOptionList,
           autoSelect: 'first',
           labelField: 'templateName',
           valueField: 'templateId',
-          disabled: formType !== 'create' || !values.workOrderId,
-          params: values.workOrderId
+          disabled: formType !== 'create' || !values.itemId,
+          params: values.itemId
             ? {
                 qcType: 2,
-                workOrderId: values.workOrderId,
-                taskId: values.taskId,
+                itemId: values.itemId,
               }
             : {},
-          placeholder: values.workOrderId
+          placeholder: values.itemId
             ? '璇烽�夋嫨璐ㄦ鏂规'
-            : '璇峰厛閫夋嫨鐢熶骇璁㈠崟',
+            : '璇峰厛閫夋嫨浜у搧鐗╂枡',
         }),
       },
     },
@@ -465,17 +427,18 @@
       },
     },
     {
-      fieldName: 'workOrderId',
-      label: '鐢熶骇璁㈠崟',
-      component: markRaw(ProWorkOrderSelect),
+      fieldName: 'batchCode',
+      label: '鎵瑰彿',
+      component: 'Input',
       componentProps: {
-        placeholder: '璇烽�夋嫨鐢熶骇璁㈠崟',
+        allowClear: true,
+        placeholder: '璇疯緭鍏ユ壒鍙�',
       },
     },
     {
       fieldName: 'itemId',
       label: '浜у搧鐗╂枡',
-      component: markRaw(MdItemSelect),
+      component: markRaw(MdmItemSelect),
       componentProps: {
         placeholder: '璇烽�夋嫨浜у搧鐗╂枡',
       },
@@ -525,11 +488,6 @@
       },
     },
     {
-      field: 'workOrderCode',
-      title: '鐢熶骇璁㈠崟缂栧彿',
-      width: 140,
-    },
-    {
       field: 'itemCode',
       title: '浜у搧鐗╂枡缂栫爜',
       width: 130,
@@ -543,6 +501,11 @@
       field: 'itemSpecification',
       title: '瑙勬牸鍨嬪彿',
       width: 130,
+    },
+    {
+      field: 'batchCode',
+      title: '鎵瑰彿',
+      width: 140,
     },
     {
       field: 'unitName',
@@ -585,7 +548,7 @@
     },
     {
       title: '鎿嶄綔',
-      width: 180,
+      width: 420,
       fixed: 'right',
       slots: { default: 'actions' },
     },
diff --git a/src/views/mes/qc/ipqc/index.vue b/src/views/mes/qc/ipqc/index.vue
index 58eda85..2dd9949 100644
--- a/src/views/mes/qc/ipqc/index.vue
+++ b/src/views/mes/qc/ipqc/index.vue
@@ -6,10 +6,12 @@
 
 import { Page, useVbenModal } from '@vben/common-ui';
 import { MesQcStatusEnum, MesQcTypeEnum } from '@vben/constants';
+import { downloadFileFromBlobPart } from '@vben/utils';
 
 import { Button, message } from 'ant-design-vue';
 
 import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
+import { exportProductWord } from '#/api/mes/qc/indicatorresult';
 import { deleteIpqc, exportIpqc, getIpqcPage } from '#/api/mes/qc/ipqc';
 import { $t } from '#/locales';
 import QcExportRangeModal from '#/views/mes/qc/components/export-range-modal.vue';
@@ -38,6 +40,15 @@
 /** 鎵撳嵃妫�楠屾姤鍛� */
 async function handlePrint(row: MesQcIpqcApi.Ipqc) {
   await printRef.value?.print(row.id!, MesQcTypeEnum.IPQC);
+}
+
+/** 瀵煎嚭浜у搧妫�楠屽崟 Word锛堢焊璐ㄦ楠屽崟鐗堝紡锛屽垽瀹氱粨璁哄甫鍑烘楠岀粨鏋滐級 */
+async function handleExportProductWord(row: MesQcIpqcApi.Ipqc) {
+  const blob = await exportProductWord(row.id!, MesQcTypeEnum.IPQC);
+  downloadFileFromBlobPart({
+    fileName: `浜у搧妫�楠屽崟-${row.code ?? row.id}.docx`,
+    source: blob,
+  });
 }
 
 /** 鍒涘缓杩囩▼妫�楠屽崟 */
@@ -174,6 +185,13 @@
               onClick: handlePrint.bind(null, row),
             },
             {
+              label: '瀵煎嚭浜у搧妫�楠屽崟',
+              type: 'link',
+              icon: 'ant-design:file-word-outlined',
+              auth: ['mes:qc-ipqc:query'],
+              onClick: handleExportProductWord.bind(null, row),
+            },
+            {
               label: $t('common.detail'),
               type: 'link',
               icon: ACTION_ICON.VIEW,
diff --git a/src/views/mes/qc/iqc/data.ts b/src/views/mes/qc/iqc/data.ts
index 4b85dab..631757d 100644
--- a/src/views/mes/qc/iqc/data.ts
+++ b/src/views/mes/qc/iqc/data.ts
@@ -515,7 +515,7 @@
     },
     {
       title: '鎿嶄綔',
-      width: 180,
+      width: 420,
       fixed: 'right',
       slots: { default: 'actions' },
     },
diff --git a/src/views/mes/qc/iqc/index.vue b/src/views/mes/qc/iqc/index.vue
index 6a42897..303129b 100644
--- a/src/views/mes/qc/iqc/index.vue
+++ b/src/views/mes/qc/iqc/index.vue
@@ -7,10 +7,12 @@
 
 import { Page, useVbenModal } from '@vben/common-ui';
 import { MesQcStatusEnum, MesQcTypeEnum } from '@vben/constants';
+import { downloadFileFromBlobPart } from '@vben/utils';
 
 import { Button, message } from 'ant-design-vue';
 
 import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
+import { exportProductWord } from '#/api/mes/qc/indicatorresult';
 import { deleteIqc, exportIqc, getIqcPage } from '#/api/mes/qc/iqc';
 import { $t } from '#/locales';
 import QcExportRangeModal from '#/views/mes/qc/components/export-range-modal.vue';
@@ -72,6 +74,15 @@
 /** 鎵撳嵃妫�楠屾姤鍛� */
 async function handlePrint(row: MesQcIqcApi.Iqc) {
   await printRef.value?.print(row.id!, MesQcTypeEnum.IQC);
+}
+
+/** 瀵煎嚭浜у搧妫�楠屽崟 Word锛堢焊璐ㄦ楠屽崟鐗堝紡锛屽垽瀹氱粨璁哄甫鍑烘楠岀粨鏋滐級 */
+async function handleExportProductWord(row: MesQcIqcApi.Iqc) {
+  const blob = await exportProductWord(row.id!, MesQcTypeEnum.IQC);
+  downloadFileFromBlobPart({
+    fileName: `浜у搧妫�楠屽崟-${row.code ?? row.id}.docx`,
+    source: blob,
+  });
 }
 
 /** 瀵煎嚭琛ㄦ牸锛堝脊绐楅�夋楠屾椂闂磋寖鍥达級 */
@@ -185,6 +196,13 @@
               onClick: handlePrint.bind(null, row),
             },
             {
+              label: '瀵煎嚭浜у搧妫�楠屽崟',
+              type: 'link',
+              icon: 'ant-design:file-word-outlined',
+              auth: ['mes:qc-iqc:query'],
+              onClick: handleExportProductWord.bind(null, row),
+            },
+            {
               label: $t('common.detail'),
               type: 'link',
               icon: ACTION_ICON.VIEW,
diff --git a/src/views/mes/qc/oqc/data.ts b/src/views/mes/qc/oqc/data.ts
index 9a840db..721f2d9 100644
--- a/src/views/mes/qc/oqc/data.ts
+++ b/src/views/mes/qc/oqc/data.ts
@@ -202,7 +202,6 @@
           }
         },
       },
-      rules: 'required',
       dependencies: {
         triggerFields: ['sourceDocId'],
         componentProps: (values) => ({
@@ -285,7 +284,6 @@
         placeholder: '璇烽�夋嫨鍑鸿揣鏃ユ湡',
         valueFormat: 'YYYY-MM-DD',
       },
-      rules: 'required',
     },
     {
       fieldName: 'inspectDate',
@@ -355,9 +353,10 @@
       component: 'Select',
       componentProps: {
         allowClear: true,
-        options: getDictOptions(DICT_TYPE.MES_QC_CHECK_RESULT, 'number'),
+        options: getDictOptions(DICT_TYPE.MES_OQC_CHECK_RESULT, 'number'),
         placeholder: '璇烽�夋嫨妫�娴嬬粨鏋�',
       },
+      rules: 'selectRequired',
     },
     {
       fieldName: 'remark',
@@ -415,7 +414,7 @@
       component: 'Select',
       componentProps: {
         allowClear: true,
-        options: getDictOptions(DICT_TYPE.MES_QC_CHECK_RESULT, 'number'),
+        options: getDictOptions(DICT_TYPE.MES_OQC_CHECK_RESULT, 'number'),
         placeholder: '璇烽�夋嫨妫�娴嬬粨鏋�',
       },
     },
@@ -495,7 +494,7 @@
       width: 110,
       cellRender: {
         name: 'CellDict',
-        props: { type: DICT_TYPE.MES_QC_CHECK_RESULT },
+        props: { type: DICT_TYPE.MES_OQC_CHECK_RESULT },
       },
     },
     {
@@ -526,7 +525,7 @@
     },
     {
       title: '鎿嶄綔',
-      width: 220,
+      width: 420,
       fixed: 'right',
       slots: { default: 'actions' },
     },
diff --git a/src/views/mes/qc/oqc/index.vue b/src/views/mes/qc/oqc/index.vue
index c687183..a551bfb 100644
--- a/src/views/mes/qc/oqc/index.vue
+++ b/src/views/mes/qc/oqc/index.vue
@@ -6,10 +6,12 @@
 
 import { Page, useVbenModal } from '@vben/common-ui';
 import { MesQcStatusEnum, MesQcTypeEnum } from '@vben/constants';
+import { downloadFileFromBlobPart } from '@vben/utils';
 
 import { Button, message } from 'ant-design-vue';
 
 import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
+import { exportProductWord } from '#/api/mes/qc/indicatorresult';
 import { deleteOqc, exportOqc, getOqcPage } from '#/api/mes/qc/oqc';
 import { $t } from '#/locales';
 import QcExportRangeModal from '#/views/mes/qc/components/export-range-modal.vue';
@@ -38,6 +40,15 @@
 /** 鎵撳嵃妫�楠屾姤鍛� */
 async function handlePrint(row: MesQcOqcApi.Oqc) {
   await printRef.value?.print(row.id!, MesQcTypeEnum.OQC);
+}
+
+/** 瀵煎嚭浜у搧妫�楠屽崟 Word锛堢焊璐ㄦ楠屽崟鐗堝紡锛屽垽瀹氱粨璁哄甫鍑烘楠岀粨鏋滐級 */
+async function handleExportProductWord(row: MesQcOqcApi.Oqc) {
+  const blob = await exportProductWord(row.id!, MesQcTypeEnum.OQC);
+  downloadFileFromBlobPart({
+    fileName: `浜у搧妫�楠屽崟-${row.code ?? row.id}.docx`,
+    source: blob,
+  });
 }
 
 /** 鍒涘缓鍑鸿揣妫�楠屽崟 */
@@ -174,6 +185,13 @@
               onClick: handlePrint.bind(null, row),
             },
             {
+              label: '瀵煎嚭浜у搧妫�楠屽崟',
+              type: 'link',
+              icon: 'ant-design:file-word-outlined',
+              auth: ['mes:qc-oqc:query'],
+              onClick: handleExportProductWord.bind(null, row),
+            },
+            {
               label: $t('common.detail'),
               type: 'link',
               icon: ACTION_ICON.VIEW,
diff --git a/src/views/mes/qc/oqc/modules/form.vue b/src/views/mes/qc/oqc/modules/form.vue
index e9e7258..36f64dc 100644
--- a/src/views/mes/qc/oqc/modules/form.vue
+++ b/src/views/mes/qc/oqc/modules/form.vue
@@ -6,7 +6,11 @@
 import { computed, ref } from 'vue';
 
 import { confirm, useVbenModal } from '@vben/common-ui';
-import { MesQcCheckResultEnum, MesQcStatusEnum, MesQcTypeEnum } from '@vben/constants';
+import {
+  MesQcOqcCheckResultEnum,
+  MesQcStatusEnum,
+  MesQcTypeEnum,
+} from '@vben/constants';
 
 import { Button, Descriptions, message, Tabs } from 'ant-design-vue';
 
@@ -71,9 +75,9 @@
   const data = (await formApi.getValues()) as MesQcOqcApi.Oqc;
   if (
     (data.unqualifiedQuantity == null || data.unqualifiedQuantity === 0) &&
-    data.checkResult === MesQcCheckResultEnum.FAIL
+    data.checkResult === MesQcOqcCheckResultEnum.SCRAP
   ) {
-    message.warning('涓嶅悎鏍煎搧鏁伴噺涓�0鏃讹紝妫�娴嬬粨鏋滀笉鑳戒负"鏍¢獙涓嶉�氳繃"');
+    message.warning('涓嶅悎鏍煎搧鏁伴噺涓�0鏃讹紝妫�娴嬬粨鏋滀笉鑳戒负"搴熷搧"');
     return false;
   }
   if (formData.value?.id) {
@@ -116,9 +120,9 @@
       const data = (await formApi.getValues()) as MesQcOqcApi.Oqc;
       if (
         (data.unqualifiedQuantity == null || data.unqualifiedQuantity === 0) &&
-        data.checkResult === MesQcCheckResultEnum.FAIL
+        data.checkResult === MesQcOqcCheckResultEnum.SCRAP
       ) {
-        message.warning('涓嶅悎鏍煎搧鏁伴噺涓�0鏃讹紝妫�娴嬬粨鏋滀笉鑳戒负"鏍¢獙涓嶉�氳繃"');
+        message.warning('涓嶅悎鏍煎搧鏁伴噺涓�0鏃讹紝妫�娴嬬粨鏋滀笉鑳戒负"搴熷搧"');
         return;
       }
       await updateOqc({ ...data, id });
diff --git a/src/views/mes/qc/pendinginspect/index.vue b/src/views/mes/qc/pendinginspect/index.vue
index 486e3ad..6d15628 100644
--- a/src/views/mes/qc/pendinginspect/index.vue
+++ b/src/views/mes/qc/pendinginspect/index.vue
@@ -59,6 +59,7 @@
 /** 鍒涘缓杩囩▼妫�楠屽崟锛圛PQC锛� */
 function handleCreateIpqc(row: MesQcPendingInspectApi.PendingInspect) {
   const prefill: MesQcIpqcApi.Ipqc = {
+    batchCode: row.batchCode,
     checkQuantity: row.quantity,
     inspectDate: row.recordTime,
     itemId: row.itemId,
@@ -67,9 +68,6 @@
     sourceDocId: row.sourceDocId,
     sourceDocType: row.sourceDocType,
     sourceLineId: row.sourceLineId,
-    taskId: row.taskId,
-    workOrderId: row.workOrderId,
-    workstationId: row.workstationId,
   };
   ipqcFormModalApi.setData({ formType: 'create', prefill }).open();
 }
diff --git a/src/views/mes/qc/rqc/data.ts b/src/views/mes/qc/rqc/data.ts
index be672b5..394c342 100644
--- a/src/views/mes/qc/rqc/data.ts
+++ b/src/views/mes/qc/rqc/data.ts
@@ -505,7 +505,7 @@
     },
     {
       title: '鎿嶄綔',
-      width: 180,
+      width: 420,
       fixed: 'right',
       slots: { default: 'actions' },
     },
diff --git a/src/views/mes/qc/rqc/index.vue b/src/views/mes/qc/rqc/index.vue
index bc1ea4e..d086822 100644
--- a/src/views/mes/qc/rqc/index.vue
+++ b/src/views/mes/qc/rqc/index.vue
@@ -6,10 +6,12 @@
 
 import { Page, useVbenModal } from '@vben/common-ui';
 import { MesQcStatusEnum, MesQcTypeEnum } from '@vben/constants';
+import { downloadFileFromBlobPart } from '@vben/utils';
 
 import { Button, message } from 'ant-design-vue';
 
 import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
+import { exportProductWord } from '#/api/mes/qc/indicatorresult';
 import { deleteRqc, exportRqc, getRqcPage } from '#/api/mes/qc/rqc';
 import { $t } from '#/locales';
 import QcExportRangeModal from '#/views/mes/qc/components/export-range-modal.vue';
@@ -38,6 +40,15 @@
 /** 鎵撳嵃妫�楠屾姤鍛� */
 async function handlePrint(row: MesQcRqcApi.Rqc) {
   await printRef.value?.print(row.id!, MesQcTypeEnum.RQC);
+}
+
+/** 瀵煎嚭浜у搧妫�楠屽崟 Word锛堢焊璐ㄦ楠屽崟鐗堝紡锛屽垽瀹氱粨璁哄甫鍑烘楠岀粨鏋滐級 */
+async function handleExportProductWord(row: MesQcRqcApi.Rqc) {
+  const blob = await exportProductWord(row.id!, MesQcTypeEnum.RQC);
+  downloadFileFromBlobPart({
+    fileName: `浜у搧妫�楠屽崟-${row.code ?? row.id}.docx`,
+    source: blob,
+  });
 }
 
 /** 鍒涘缓閫�璐ф楠屽崟 */
@@ -174,6 +185,13 @@
               onClick: handlePrint.bind(null, row),
             },
             {
+              label: '瀵煎嚭浜у搧妫�楠屽崟',
+              type: 'link',
+              icon: 'ant-design:file-word-outlined',
+              auth: ['mes:qc-rqc:query'],
+              onClick: handleExportProductWord.bind(null, row),
+            },
+            {
               label: $t('common.detail'),
               type: 'link',
               icon: ACTION_ICON.VIEW,

--
Gitblit v1.9.3