优化
This commit is contained in:
@@ -1436,6 +1436,24 @@ describe('LastMileOrdersView pending order and container conversion', () => {
|
||||
await dialog.findAll('button').find(item => item.text() === '保存')!.trigger('click'); await flushPromises()
|
||||
expect(updateLastMileOrderHold).toHaveBeenCalledWith(row.id, { held: !detained, chargeable: false, reason: '原因', expectedVersion: 0 }, expect.stringContaining('last-mile-hold-'))
|
||||
})
|
||||
it.each(['RELABEL_APPLICATION', 'WAREHOUSE_TRANSFER', 'LOCAL_LOOSEBOARD', 'RETURN_RELABEL', 'CARGO_DISCARD'])('does not offer manual transport nodes for %s', async orderType => {
|
||||
vi.mocked(listLastMileOrders).mockResolvedValue({ records: [{ id: 'business-tail', customerId, orderNo: 'BUSINESS-1', orderType, currentStatus: 'PENDING_ASSIGNMENT' }], page: 1, size: 10, total: 1, pages: 1 })
|
||||
const wrapper = await mountView()
|
||||
expect(wrapper.get('.el-table__body-wrapper .row-actions').text()).not.toContain('修改节点')
|
||||
await (wrapper.vm as unknown as { openManualNodes(row: object): Promise<void> }).openManualNodes(selectedRow({ orderTypeCode: orderType }))
|
||||
expect(getLastMileOrderManualNodes).not.toHaveBeenCalled()
|
||||
})
|
||||
it('provides the same return receipt statuses as the list labels and submits their exact codes', async () => {
|
||||
const wrapper = await mountView()
|
||||
const toolbar = wrapper.findComponent(QueryToolbar)
|
||||
const status = (toolbar.props('fields') as Array<{ key: string; options?: Array<{ label: string; value: string }> }>).find(field => field.key === 'status')!
|
||||
for (const [value, label] of [['PENDING_REVIEW', '待审核'], ['PENDING_RECEIPT', '待签收入库'], ['PARTIALLY_RECEIVED', '部分入库'], ['INBOUND_COMPLETED', '全部入库']]) {
|
||||
expect(status.options).toContainEqual({ value, label })
|
||||
toolbar.vm.$emit('search', { ...toolbar.props('modelValue'), status: value })
|
||||
await flushPromises()
|
||||
expect(listLastMileOrders).toHaveBeenLastCalledWith(expect.objectContaining({ currentStatus: value }))
|
||||
}
|
||||
})
|
||||
it('edits only customs nodes while preserving hidden node facts and zero version', async () => {
|
||||
vi.mocked(getLastMileOrderManualNodes).mockResolvedValue({ orderId: '2092873463568596994', manualOverrideEnabled: true, nodes: [{ nodeCode: 'ACTUAL_DEPARTURE', nodeAt: '2026-10-19T08:00:00' }], version: 0 })
|
||||
const wrapper = await mountView()
|
||||
|
||||
Reference in New Issue
Block a user