From 3a7ffef12fb117477b57eb9456e7a5171b0eac77 Mon Sep 17 00:00:00 2001 From: shaoleiliu-netizen123 <480188199@qq.com> Date: Wed, 3 Jun 2026 09:57:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A8=E6=A3=80=E8=AF=A6=E6=83=85=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/biz/qualityTesting/index.vue | 59 ++++++++++++++++++++------ 1 file changed, 45 insertions(+), 14 deletions(-) diff --git a/src/views/biz/qualityTesting/index.vue b/src/views/biz/qualityTesting/index.vue index c19fcbc..3d3c68d 100644 --- a/src/views/biz/qualityTesting/index.vue +++ b/src/views/biz/qualityTesting/index.vue @@ -392,20 +392,41 @@ const detailIsCollapse = ref(true) const submitDetailModalVisible = ref(false) const traceCodeShow = ref(false) +const customOrderKeys = [ + 'materialCode', + 'materialName', + 'materialQty', + 'processCode', + 'processName', + 'processQty', + 'assingCode', + 'workerName', + 'assingQty', + 'qcNo', + 'sourceType', + 'totalQty', + 'status', + 'inspector', + 'inspectTime', + 'traceType' +] const infoDataMapping = { - id: '质检单编号', - qcNo: '质检单编号', + materialCode: '物料编码', materialName: '物料名称', materialQty: '物料数量', + processCode:'工序编号', + processName:'工序名称', + processQty:'生产总数', + assingCode:'派工编号', + workerName:'派工人', + assingQty:'派工数量', + qcNo: '质检单编号', sourceType: '来源类型', - sourceId: '来源编号', - orderId: '订单编号', - processId: '工序编号', totalQty: '报检总数', status: '质检状态', - inspectorId: '质检员编号', + inspector: '质检员', inspectTime: '质检时间', traceType: '追溯类型' } @@ -851,18 +872,28 @@ async function handleDetail(row: QualityTesting) { detailVisible.value = true const data = await qualityTestingApi.detail(row.id!) - // 映射后的数据 - mappedInfoList.value = Object.entries(data.info) - .filter(([key]) => infoDataMap.has(key)) // 只保留配置里有的字段 - .map(([key, value]) => ({ - label: infoDataMap.get(key) || key, // 中文标签 - key, // 原字段名 - value // 原始值 - })) + // // 映射后的数据 + // mappedInfoList.value = Object.entries(data.info) + // .filter(([key]) => infoDataMap.has(key)) // 只保留配置里有的字段 + // .map(([key, value]) => ({ + // label: infoDataMap.get(key) || key, // 中文标签 + // key, // 原字段名 + // value // 原始值 + // })) + setMappedInfoList(data.info) detailTableData.value = data.detail } +// 组装列表时按上面自定义顺序循环 +function setMappedInfoList(rawData: Record) { + mappedInfoList.value = customOrderKeys.map(key => ({ + key, + label: infoDataMapping[key as keyof typeof infoDataMapping], + value: rawData[key] + })) +} + function formatDisplayValue(key: string, value: any): string { if (value === null || value === undefined) return '-'