质检详情优化

This commit is contained in:
shaoleiliu-netizen123 2026-06-03 09:57:32 +08:00
parent 4fa317f7a4
commit 3a7ffef12f

View File

@ -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<string, any>) {
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 '-'