This commit is contained in:
2026-08-12 17:34:06 +08:00
parent d2a246b122
commit 5b441626e9
8 changed files with 34 additions and 4 deletions
@@ -112,4 +112,11 @@ describe('TruckAppointmentsView', () => {
await flushPromises()
expect(wrapper.find('button[aria-label="查看 TA-9001"]').exists()).toBe(false)
})
it('prioritizes outbound business fields and keeps finance amounts out of the list', () => {
expect(source).toContain("key: 'customerName'")
expect(source).toContain("key: 'updatedAt'")
expect(source).not.toContain("key: 'payableAmount'")
expect(source).not.toContain("key: 'receivableAmount'")
})
})
@@ -28,15 +28,15 @@ const columns: DataTableColumn[] = [
{ key: 'actions', label: '操作', width: 150, fixed: 'left', slotName: 'actions' },
{ key: 'appointmentNo', prop: 'appointmentNo', label: '派车单号', minWidth: 170 },
{ key: 'containerNo', prop: 'containerNo', label: '集装箱号', minWidth: 145, formatter: (row: TruckAppointmentResource) => row.containerNo || (row.containerBookingId ? '已关联柜次' : '—') },
{ key: 'customerName', prop: 'customerName', label: '客户', minWidth: 150, formatter: (row: TruckAppointmentResource) => row.customerName || '客户信息缺失' },
{ key: 'company', label: '运输公司', minWidth: 160, slotName: 'company' },
{ key: 'driver', label: '司机', minWidth: 130, slotName: 'driver' },
{ key: 'vehicleNo', prop: 'vehicleNo', label: '车头号', minWidth: 120, formatter: (row: TruckAppointmentResource) => row.vehicleNo || '—' },
{ key: 'store', label: '门店', minWidth: 140, slotName: 'store' },
{ key: 'payableAmount', label: '应付拖车费', minWidth: 130, formatter: (row: TruckAppointmentResource) => row.payableAmount ? `¥${row.payableAmount}` : '—' },
{ key: 'receivableAmount', label: '应收拖车费', minWidth: 130, formatter: (row: TruckAppointmentResource) => row.receivableAmount ? `¥${row.receivableAmount}` : '—' },
{ key: 'plannedLoadingAt', label: '预计装箱日期', minWidth: 170, formatter: (row: TruckAppointmentResource) => formatDateTime(row.plannedLoadingAt) },
{ key: 'status', label: '状态', width: 130, slotName: 'status' },
{ key: 'attachments', label: '附件', width: 90, formatter: (row: TruckAppointmentResource) => String(row.attachments?.length || 0) },
{ key: 'updatedAt', label: '更新时间', minWidth: 160, formatter: (row: TruckAppointmentResource) => formatDateTime(row.updatedAt) },
]
function formatDateTime(value?: string | null) { return value ? value.replace('T', ' ').slice(0, 16) : '—' }
function appointmentActionLabel(action: '查看' | '编辑', row: TruckAppointmentResource) {