费用优化
This commit is contained in:
@@ -5,9 +5,10 @@ import { downloadPlatformProductImage, getPlatformUnifiedOrder, listPlatformUnif
|
||||
import { downloadPlatformInboundHoldEvidence, getPlatformInboundHold, holdPlatformInbound, releasePlatformInbound, uploadPlatformInboundHoldEvidence } from '@/modules/inbounds'
|
||||
import UnifiedOrdersView from './UnifiedOrdersView.vue'
|
||||
|
||||
const { routeQuery, routerPush } = vi.hoisted(() => ({ routeQuery: { tenantId: '6001', from: '' }, routerPush: vi.fn() }))
|
||||
vi.mock('vue-router', () => ({
|
||||
useRoute: () => ({ params: { orderId: '5001' }, query: { tenantId: '6001' } }),
|
||||
useRouter: () => ({ push: vi.fn() }),
|
||||
useRoute: () => ({ params: { orderId: '5001' }, query: routeQuery }),
|
||||
useRouter: () => ({ push: routerPush }),
|
||||
}))
|
||||
const { canPermission } = vi.hoisted(() => ({ canPermission: vi.fn((..._permissions: string[]) => true) }))
|
||||
vi.mock('@/core/access/accessPreview', () => ({ useAccessPreviewStore: () => ({ can: canPermission }) }))
|
||||
@@ -75,6 +76,7 @@ function mountDetail() {
|
||||
describe('UnifiedOrdersView downstream fulfillment detail', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
routeQuery.from = ''
|
||||
canPermission.mockImplementation(() => true)
|
||||
vi.mocked(getPlatformUnifiedOrder).mockResolvedValue(detail as never)
|
||||
vi.mocked(downloadPlatformProductImage).mockResolvedValue(new Blob(['image'], { type: 'image/png' }))
|
||||
@@ -107,6 +109,15 @@ describe('UnifiedOrdersView downstream fulfillment detail', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it.each(['last-mile-orders', ''])('returns to the originating list from detail: %s', async (from) => {
|
||||
routeQuery.from = from
|
||||
const wrapper = mountDetail()
|
||||
await flushPromises()
|
||||
await wrapper.findAll('button').find(button => button.text() === '返回列表')!.trigger('click')
|
||||
expect(routerPush).toHaveBeenCalledWith({ name: from ? 'overseas-last-mile-orders' : 'unified-orders' })
|
||||
wrapper.unmount()
|
||||
})
|
||||
|
||||
it('keeps unchanged actual and outer volumes on the same server snapshot with three decimal places', async () => {
|
||||
const wrapper = mountDetail()
|
||||
await flushPromises()
|
||||
|
||||
@@ -2224,11 +2224,12 @@ async function printSelectedCartonLabels() {
|
||||
}
|
||||
}
|
||||
|
||||
/** 关闭详情时返回实际业务来源列表。 */
|
||||
function closeDetail() {
|
||||
releaseCargoImagePreviews()
|
||||
detail.value = null
|
||||
detailError.value = null
|
||||
void router.push({ name: 'unified-orders' })
|
||||
void router.push({ name: route.query.from === 'last-mile-orders' ? 'overseas-last-mile-orders' : 'unified-orders' })
|
||||
}
|
||||
|
||||
function returnToMeasurementReviews() {
|
||||
|
||||
Reference in New Issue
Block a user