Author SHA1 Message Date
liuyihe d409094226 优化 2026-11-06 10:42:45 +08:00
3 changed files with 15 additions and 1 deletions
@@ -70,6 +70,7 @@ export interface TransportDetail {
destinationAddress: string | null
remark: string | null
histories?: Array<{ operationType: string; toStatus: string; remark: string | null }>
dispatchNos?: string[]
}
export interface TransportCreate {
@@ -237,6 +237,17 @@ test('looseboard saves split contacts and both local minute times without obsole
for (const field of ['palletRequired', 'transportType', 'transportMode', 'containerType', 'contactName', 'contactInfo', 'requestedDate']) assert.equal(Object.hasOwn(payload, field), false)
})
test('looseboard details show every dispatch without a fleet booking and retain the unassigned state', () => {
const looseboard = transportHarness('looseboard')
looseboard.detail.value = { summary: { fleetArrangement: null }, dispatchNos: ['PC-1', 'PC-2'] }
assert.equal(new Map(looseboard.detailFields.value).get('排车单号'), 'PC-1、PC-2')
looseboard.detail.value.dispatchNos = []
assert.equal(new Map(looseboard.detailFields.value).get('排车单号'), '暂未排车')
const truck = transportHarness('trucking')
truck.detail.value = { summary: {} }
assert.equal(new Map(truck.detailFields.value).has('排车单号'), false)
})
test('looseboard requires both times and rejects backwards schedule', () => {
const current = transportHarness('looseboard')
assert.equal(current.rules.value.pickupAt[0].required, true)
@@ -145,6 +145,7 @@ const detailFields = computed(() => {
const current = detail.value as TransportDetail
return [
...(props.kind === 'looseboard' ? [
['排车单号', current.dispatchNos?.length ? current.dispatchNos.join('、') : '暂未排车'],
['商品名称', summary.productName], ['预计托数', summary.estimatedPalletCount],
] : [['车辆类型', vehicleTypeLabel(summary.vehicleType)]]),
[props.kind === 'trucking' ? '取货地' : '起运地', read(summary, 'origin')], [props.kind === 'trucking' ? '取货地址' : '起运地址', current.originAddress],
@@ -253,8 +254,9 @@ function getRowActions(candidate: object): TableAction[] {
return [{ key: 'detail', label: '详情', run: () => openDetail(candidate) }]
}
/** 长地址和多张排车单保留完整单号,按详情已有网格换行展示。 */
function detailFieldClass(label: unknown) {
if (label === '备注') return 'is-full'
if (label === '备注' || label === '排车单号') return 'is-full'
return [props.kind === 'trucking' ? '取货地址' : '起运地址', props.kind === 'trucking' ? '送达地址' : '目的地址'].includes(String(label)) ? 'is-wide' : ''
}