From 6be7c40bccc170217e8ff3db0762b43416b66c24 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 22 九月 2026 14:51:05 +0800
Subject: [PATCH] refactor(qc): 重构质检模块数据表格字段配置
---
src/views/mes/qc/components/qc-report-print.vue | 32 ++++++++++++++++++++++++--------
1 files changed, 24 insertions(+), 8 deletions(-)
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 || '-' }}
--
Gitblit v1.9.3