This commit is contained in:
2026-08-31 16:44:38 +08:00
parent 83374ba6cc
commit 11f8b7856e
2 changed files with 10 additions and 10 deletions
@@ -61,11 +61,11 @@ describe('UnifiedOrdersView co-load group behavior', () => {
const wrapper = mountView()
await flushPromises()
await wrapper.get('[data-testid="select"]').trigger('click')
await wrapper.findAll('button').find((button) => button.text().includes('设为同柜不可拆组'))!.trigger('click')
await wrapper.findAll('button').find((button) => button.text().includes('合柜报关'))!.trigger('click')
await wrapper.get('[data-testid="dialog-confirm"]').trigger('click')
await flushPromises()
expect(createPlatformCoLoadGroup).toHaveBeenCalledWith(['5001', '5002'])
expect(wrapper.text()).toContain('设为同柜不可拆组(2)')
expect(wrapper.text()).toContain('合柜报关(2)')
expect(wrapper.text()).toContain('成员路线不一致')
expect(wrapper.text()).toContain('A0409 request-coload trace-coload')
expect(wrapper.text()).not.toContain('5001')
@@ -82,7 +82,7 @@ describe('UnifiedOrdersView co-load group behavior', () => {
const wrapper = mountView()
await flushPromises()
await wrapper.get('[data-testid="select"]').trigger('click')
const createButton = wrapper.findAll('button').find((button) => button.text().includes('设为同柜不可拆组'))!
const createButton = wrapper.findAll('button').find((button) => button.text().includes('合柜报关'))!
expect(createButton.attributes('disabled')).toBeDefined()
expect(wrapper.text()).not.toContain(reason)
await createButton.trigger('click')
@@ -93,12 +93,12 @@ describe('UnifiedOrdersView co-load group behavior', () => {
const wrapper = mountView()
await flushPromises()
expect(wrapper.text()).not.toContain('请至少勾选 2 票订单后再设为同柜组')
expect(wrapper.findAll('button').find((button) => button.text().includes('设为同柜不可拆组'))!.attributes('disabled')).toBeDefined()
expect(wrapper.findAll('button').find((button) => button.text().includes('合柜报关'))!.attributes('disabled')).toBeDefined()
;(wrapper.vm as unknown as { handleOrderSelectionChange: (selected: typeof rows) => void }).handleOrderSelectionChange([rows[0]])
await wrapper.vm.$nextTick()
expect(wrapper.text()).not.toContain('当前仅选择 1 票')
expect(wrapper.findAll('button').find((button) => button.text().includes('设为同柜不可拆组'))!.attributes('disabled')).toBeDefined()
expect(wrapper.findAll('button').find((button) => button.text().includes('合柜报关'))!.attributes('disabled')).toBeDefined()
expect(wrapper.text()).not.toContain('5001')
expect(wrapper.text()).not.toContain('7000')
})
@@ -121,7 +121,7 @@ describe('UnifiedOrdersView co-load group behavior', () => {
const wrapper = mountView()
await flushPromises()
await wrapper.get('[data-testid="select"]').trigger('click')
await wrapper.findAll('button').find((button) => button.text().includes('设为同柜不可拆组'))!.trigger('click')
await wrapper.findAll('button').find((button) => button.text().includes('合柜报关'))!.trigger('click')
await wrapper.get('[data-testid="dialog-confirm"]').trigger('click')
await flushPromises()
expect(createPlatformCoLoadGroup).toHaveBeenCalledWith(['5001', '5002'])
@@ -132,7 +132,7 @@ describe('UnifiedOrdersView co-load group behavior', () => {
const wrapper = mountView()
await flushPromises()
await wrapper.get('[data-testid="select"]').trigger('click')
expect(wrapper.findAll('button').find((button) => button.text().includes('设为同柜不可拆组'))!.attributes('disabled')).toBeDefined()
expect(wrapper.findAll('button').find((button) => button.text().includes('合柜报关'))!.attributes('disabled')).toBeDefined()
expect(wrapper.text()).not.toContain('所选订单的渠道不同')
expect(createPlatformCoLoadGroup).not.toHaveBeenCalled()
})
@@ -158,7 +158,7 @@ describe('UnifiedOrdersView co-load group behavior', () => {
await flushPromises()
expect(wrapper.findAll('button').find((button) => button.text().includes('批量审核通过'))!.attributes('disabled')).toBeUndefined()
expect(wrapper.findAll('button').find((button) => button.text().includes('批量审核通过'))!.text()).toContain('(3)')
expect(wrapper.findAll('button').find((button) => button.text().includes('设为同柜不可拆组'))!.attributes('disabled')).toBeDefined()
expect(wrapper.findAll('button').find((button) => button.text().includes('合柜报关'))!.attributes('disabled')).toBeDefined()
expect(wrapper.text()).not.toContain('平台收货仓不同')
expect(wrapper.text()).not.toContain('渠道不同')
})
@@ -1430,7 +1430,7 @@ onBeforeUnmount(() => {
<template #toolbar-actions>
<el-button v-if="can('platform:order:approve')" type="success" :loading="batchApprovalSaving" :disabled="loading || !selectedApprovalOrders.length" @click="batchApproveOrders"><CircleCheck :size="16" />批量审核通过<span v-if="selectedApprovalOrders.length">({{ selectedApprovalOrders.length }})</span></el-button>
<div v-if="can('platform:firstleg:smart-loading:assign')" class="coload-toolbar-action">
<el-button type="primary" plain :loading="coLoadSaving" :disabled="loading || !canCreateCoLoadGroup" aria-label="设为同柜不可拆组" @click="openCoLoadCreate"><Link2 :size="16" />设为同柜不可拆组<span v-if="selectedOrders.length">({{ selectedOrders.length }})</span></el-button>
<el-button type="primary" plain :loading="coLoadSaving" :disabled="loading || !canCreateCoLoadGroup" aria-label="合柜报关" @click="openCoLoadCreate"><Link2 :size="16" />合柜报关<span v-if="selectedOrders.length">({{ selectedOrders.length }})</span></el-button>
</div>
<el-button v-if="can('platform:firstleg:smart-loading:list')" type="primary" @click="smartLoadingOpen = true"><PackageOpen :size="16" />智能装柜</el-button>
</template>
@@ -1479,7 +1479,7 @@ onBeforeUnmount(() => {
</template>
</ListPageLayout>
<SmartLoadingDialog v-model="smartLoadingOpen" />
<AppDialog v-model="coLoadCreateOpen" title="设为同柜不可拆组" confirm-text="确认建组" :confirm-loading="coLoadSaving" :confirm-disabled="!canCreateCoLoadGroup" @confirm="createCoLoadGroup">
<AppDialog v-model="coLoadCreateOpen" title="合柜报关" confirm-text="确认建组" :confirm-loading="coLoadSaving" :confirm-disabled="!canCreateCoLoadGroup" @confirm="createCoLoadGroup">
<el-alert type="warning" :closable="false" show-icon :title="`所选 ${selectedOrders.length} 票须属于同一国内仓、同一渠道,并全量进入同一柜;目的仓或目的港可以不同。资格由服务端按完整入仓片段校验。`" />
<div class="coload-selection"><span v-for="row in selectedOrders" :key="String(row.orderId)">{{ row.inboundCode || '待生成入仓码' }}</span></div>
<div v-if="coLoadError" class="coload-error" role="alert"><span>{{ coLoadError.message }}</span><ApiErrorMeta :details="coLoadError" /></div>