恢复账单明细入口并完善采购状态展示
This commit is contained in:
@@ -126,7 +126,7 @@ function transportHarness(kind = 'trucking', failFirst = false, budgetCheck = as
|
||||
const script = view.match(/<script setup lang="ts">([\s\S]*?)<\/script>/)[1]
|
||||
const compiled = ts.transpileModule(script, { compilerOptions: { target: ts.ScriptTarget.ES2022, module: ts.ModuleKind.ESNext } }).outputText
|
||||
.replace(/^import .*?;$/gm, '').replace(/^export \{\};$/gm, '')
|
||||
const harness = runInNewContext(`${compiled}\n({ form, formRef, submit, detail, detailFields })`, {
|
||||
const harness = runInNewContext(`${compiled}\n({ form, formRef, submit, detail, detailFields, configuration })`, {
|
||||
defineProps: () => ({ kind, createPage: true, detailPage: false }),
|
||||
withDefaults: props => props,
|
||||
computed: getter => ({ get value() { return typeof getter === 'function' ? getter() : getter.get() } }),
|
||||
@@ -176,13 +176,18 @@ test('truck retry submits the complete new contract with identical local times a
|
||||
|
||||
test('truck details render saved minute times and unknown pool demand without timezone conversion', () => {
|
||||
const current = transportHarness()
|
||||
current.detail.value = { summary: { vehicleType: null, pickupAt: '2026-10-20T09:30:00', deliveryAt: null }, originAddress: null, destinationAddress: null, remark: null }
|
||||
current.detail.value = { summary: { vehicleType: null, palletCount: 3, packageCount: 0, pickupAt: '2026-10-20T09:30:00', deliveryAt: null }, originAddress: null, destinationAddress: null, remark: null }
|
||||
const fields = new Map(current.detailFields.value)
|
||||
assert.equal(fields.get('车辆类型'), '—')
|
||||
assert.equal(fields.get('取货时间'), '2026-10-20 09:30')
|
||||
assert.equal(fields.get('送达时间'), '—')
|
||||
assert.equal(fields.has('柜型'), false)
|
||||
assert.equal(fields.has('托盘数'), false)
|
||||
assert.equal(fields.get('托数'), 3)
|
||||
assert.equal(fields.has('件数'), false)
|
||||
const columns = current.configuration.value.columns
|
||||
assert.equal(columns.find(column => column.label === '托数').key, 'palletCount')
|
||||
assert.equal(columns.some(column => column.key === 'packageCount'), false)
|
||||
})
|
||||
|
||||
|
||||
@@ -199,6 +204,12 @@ test('looseboard saves split contacts and both local minute times without obsole
|
||||
assert.equal(payload.destinationContactPhone, '2')
|
||||
assert.equal(payload.deliveryAt, '2026-10-20T15:30:00')
|
||||
assert.equal(payload.idempotencyKey, current.calls[0].payload.idempotencyKey)
|
||||
current.detail.value = { summary: { ...payload }, originAddress: null, destinationAddress: null, remark: null }
|
||||
const fields = new Map(current.detailFields.value)
|
||||
assert.equal(fields.get('件数'), 8)
|
||||
assert.equal(fields.get('预计托数'), 3)
|
||||
assert.equal(fields.has('托数'), false)
|
||||
assert.equal(current.configuration.value.columns.some(column => column.key === 'palletCount'), false)
|
||||
for (const field of ['palletRequired', 'transportType', 'transportMode', 'containerType', 'contactName', 'contactInfo', 'requestedDate']) assert.equal(Object.hasOwn(payload, field), false)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user