fix(pl): 按车辆类型统一派车日历卡片配色以区分自有三方和待派车。
This commit is contained in:
1 parent
cb0344498a
commit
043e2ef661
11 files changed
+268
-27
No files matched your search
@@ -4,6 +4,7 @@ import {
|
||||
loadCalendarPages,
|
||||
manualCalendarDays,
|
||||
manualCopyText,
|
||||
manualVehicleType,
|
||||
validateManualDraft
|
||||
} from '../src/views/pl/dispatch-calendar/manual-model'
|
||||
|
||||
@@ -257,3 +258,20 @@ test('现场同车重复记录逐条计车,同名不同产品ID保持独立且
|
||||
].join('\n')
|
||||
)
|
||||
})
|
||||
|
||||
test('车辆分类以待派车ID优先,其余仅接受类型白名单,不从车牌或产品推断', () => {
|
||||
for (const vehicleType of ['self', 'carrier', 'pending', 'unknown'] as const) {
|
||||
assert.equal(manualVehicleType({ ...row('1'), vehicleType }), vehicleType)
|
||||
assert.equal(
|
||||
manualVehicleType({ ...row('1'), vehicleId: '__pending_vehicle__', vehicleType }),
|
||||
'pending'
|
||||
)
|
||||
}
|
||||
for (const vehicleType of [undefined, null, '', 'legacy', 'SELF']) {
|
||||
assert.equal(manualVehicleType({ vehicleId: 'v1', vehicleType }), 'unknown')
|
||||
}
|
||||
const misleadingPlate = { ...row('1'), licensePlate: '待派车' }
|
||||
const otherProduct = { ...row('1'), productName: '盐酸' }
|
||||
assert.equal(manualVehicleType(misleadingPlate), 'unknown')
|
||||
assert.equal(manualVehicleType(otherProduct), 'unknown')
|
||||
})
|
||||
Reference in new issue
Block a user