This commit is contained in:
2026-10-21 17:28:04 +08:00
parent 5e8daad5a0
commit fde16235ea
12 changed files with 233 additions and 62 deletions
@@ -51,7 +51,7 @@ it('confirms cancelling pickup and linked transfers using the transport version'
expect(listDispatches).toHaveBeenCalledTimes(2)
wrapper.unmount(); confirm.mockRestore()
})
it.each([['LOADING', '上传取货照片'], ['DELIVERING', '上传到仓照片'], ['DELIVERED', '结束资源任务']] as const)('opens pickup %s work from the list while detail stays separate', async (stage, label) => {
it.each([['LOADING', '上传装货照片'], ['DELIVERING', '上传到仓照片'], ['DELIVERED', '结束资源任务']] as const)('opens pickup %s work from the list while detail stays separate', async (stage, label) => {
vi.mocked(listDispatches).mockResolvedValue(page([listRow({ taskType: 'PICKUP', stage, reviewState: 'APPROVED', actions: {} })]))
const wrapper = mount(DispatchesView, options); await flushPromises()
const row = wrapper.findAllComponents(RowActions).find(entry => entry.props('moreLabel') === '更多操作 · PC/1')!
@@ -108,7 +108,7 @@ function pickupExecutionLabel(row: DispatchListRow) {
if (row.taskType !== 'PICKUP' || row.status !== 'ACTIVE' || !access.can(dispatchActionPermissions.EDIT)) return ''
if (row.stage === 'DELIVERED') return '结束资源任务'
if (row.reviewState !== 'APPROVED') return ''
return row.stage === 'LOADING' ? '上传取货照片' : row.stage === 'DELIVERING' ? '上传到仓照片' : ''
return row.stage === 'LOADING' ? '上传装货照片' : row.stage === 'DELIVERING' ? '上传到仓照片' : ''
}
function openTransport(row: DispatchListRow, resources = false) {
transportResourceMode.value = resources; transportEditNo.value = row.dispatchNo