This commit is contained in:
@@ -55,9 +55,15 @@
|
||||
return types[status] || 'info'
|
||||
}
|
||||
|
||||
// 详情页配置
|
||||
const detailSections: DetailSection[] = [
|
||||
{
|
||||
// 根据流程类型动态生成详情页配置
|
||||
const detailSections = computed<DetailSection[]>(() => {
|
||||
if (!exchangeDetail.value) return []
|
||||
|
||||
const flowType = exchangeDetail.value.flow_type || 'shipping' // 历史数据兼容
|
||||
const sections: DetailSection[] = []
|
||||
|
||||
// 基本信息
|
||||
sections.push({
|
||||
title: '基本信息',
|
||||
fields: [
|
||||
{ label: '换货单号', prop: 'exchange_no' },
|
||||
@@ -65,6 +71,10 @@
|
||||
label: '状态',
|
||||
render: (data) => h(ElTag, { type: getStatusType(data.status) }, () => data.status_text)
|
||||
},
|
||||
{
|
||||
label: '流程类型',
|
||||
formatter: (_, data) => data.flow_type_name || (flowType === 'direct' ? '直接换货' : '物流换货')
|
||||
},
|
||||
{
|
||||
label: '换货原因',
|
||||
prop: 'exchange_reason',
|
||||
@@ -86,44 +96,57 @@
|
||||
prop: 'new_asset_identifier'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '收货信息',
|
||||
fields: [
|
||||
{
|
||||
label: '收货人姓名',
|
||||
formatter: (value) => value || '--',
|
||||
prop: 'recipient_name'
|
||||
},
|
||||
{
|
||||
label: '收货人电话',
|
||||
formatter: (value) => value || '--',
|
||||
prop: 'recipient_phone'
|
||||
},
|
||||
{
|
||||
label: '收货地址',
|
||||
formatter: (value) => value || '--',
|
||||
prop: 'recipient_address',
|
||||
fullWidth: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '物流信息',
|
||||
fields: [
|
||||
{
|
||||
label: '快递公司',
|
||||
formatter: (value) => value || '--',
|
||||
prop: 'express_company'
|
||||
},
|
||||
{
|
||||
label: '快递单号',
|
||||
formatter: (value) => value || '--',
|
||||
prop: 'express_no'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
})
|
||||
|
||||
// 收货信息(仅物流换货显示)
|
||||
if (flowType === 'shipping') {
|
||||
sections.push({
|
||||
title: '收货信息',
|
||||
fields: [
|
||||
{
|
||||
label: '收货人姓名',
|
||||
formatter: (value) => value || '--',
|
||||
prop: 'recipient_name'
|
||||
},
|
||||
{
|
||||
label: '收货人电话',
|
||||
formatter: (value) => value || '--',
|
||||
prop: 'recipient_phone'
|
||||
},
|
||||
{
|
||||
label: '收货地址',
|
||||
formatter: (value) => value || '--',
|
||||
prop: 'recipient_address',
|
||||
fullWidth: true
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
// 物流信息(仅物流换货显示)
|
||||
sections.push({
|
||||
title: '物流信息',
|
||||
fields: [
|
||||
{
|
||||
label: '快递公司',
|
||||
formatter: (value) => value || '--',
|
||||
prop: 'express_company'
|
||||
},
|
||||
{
|
||||
label: '快递单号',
|
||||
formatter: (value) => value || '--',
|
||||
prop: 'express_no'
|
||||
},
|
||||
{
|
||||
label: '发货时间',
|
||||
formatter: (value) => (value ? formatDateTime(value) : '--'),
|
||||
prop: 'shipped_at'
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
// 其他信息
|
||||
sections.push({
|
||||
title: '其他信息',
|
||||
fields: [
|
||||
{
|
||||
@@ -132,6 +155,11 @@
|
||||
prop: 'remark',
|
||||
fullWidth: true
|
||||
},
|
||||
{
|
||||
label: '完成时间',
|
||||
formatter: (value) => (value ? formatDateTime(value) : '--'),
|
||||
prop: 'completed_at'
|
||||
},
|
||||
{
|
||||
label: '创建时间',
|
||||
formatter: (value) => formatDateTime(value),
|
||||
@@ -143,8 +171,10 @@
|
||||
prop: 'updated_at'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
return sections
|
||||
})
|
||||
|
||||
// 加载换货单详情
|
||||
const loadExchangeDetail = async () => {
|
||||
|
||||
Reference in New Issue
Block a user