Merge remote-tracking branch 'origin/release/test' into dev
# Conflicts: # src/modules/container-loading/pages/GlobalSmartLoadingView.vue # src/modules/container-loading/pages/SmartLoadingWorkbenchView.vue # src/modules/domestic-containers/pages/DomesticContainersView.vue
This commit is contained in:
@@ -117,6 +117,27 @@ describe('InboundFeePanel', () => {
|
||||
expect(wrapper.find('.surface-panel').exists()).toBe(false)
|
||||
})
|
||||
|
||||
it('supports a display-only fee snapshot without calculation or transition actions', async () => {
|
||||
vi.mocked(getLatestInboundFee).mockResolvedValue({ ...snapshot, feeStatus: 'CALCULATED', confirmedAt: null, sentAt: null })
|
||||
const pinia = setupPermissions([
|
||||
'firstleg:fba-pricing:view', 'firstleg:fba-pricing:calculate', 'firstleg:fba-pricing:adjust',
|
||||
'firstleg:fba-pricing:confirm', 'firstleg:inbound:send-fee',
|
||||
])
|
||||
const wrapper = mount(InboundFeePanel, {
|
||||
props: { customerId: '10001', inboundId: '88', displayOnly: true },
|
||||
global: { plugins: [pinia, ElementPlus] },
|
||||
})
|
||||
await flushPromises()
|
||||
|
||||
expect(wrapper.find('button[aria-label="刷新费用快照"]').exists()).toBe(true)
|
||||
expect(wrapper.text()).not.toContain('费用试算')
|
||||
expect(wrapper.text()).not.toContain('确认费用')
|
||||
expect(wrapper.text()).not.toContain('确认推送费用')
|
||||
expect(wrapper.find('[data-testid="adjust-fee-button"]').exists()).toBe(false)
|
||||
expect(wrapper.find('[data-testid="confirm-fee-button"]').exists()).toBe(false)
|
||||
expect(wrapper.find('[data-testid="send-fee-button"]').exists()).toBe(false)
|
||||
})
|
||||
|
||||
it('keeps the legacy integration prop compatible while the page layer uses customer context', async () => {
|
||||
const pinia = setupPermissions(['firstleg:fba-pricing:view'])
|
||||
mount(InboundFeePanel, {
|
||||
|
||||
@@ -30,6 +30,7 @@ const props = defineProps<{
|
||||
tenantId?: string
|
||||
inboundId: string
|
||||
compact?: boolean
|
||||
displayOnly?: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -352,20 +353,20 @@ defineExpose({ reload: loadFee })
|
||||
><RefreshCw :size="16" /></el-button>
|
||||
</el-tooltip>
|
||||
<el-button
|
||||
v-if="canCalculate"
|
||||
v-if="!displayOnly && canCalculate"
|
||||
type="primary"
|
||||
plain
|
||||
:loading="trialLoading"
|
||||
@click="openTrial"
|
||||
><CircleDollarSign :size="16" />费用试算</el-button>
|
||||
<el-button
|
||||
v-if="canAdjust && adjustmentEligible"
|
||||
v-if="!displayOnly && canAdjust && adjustmentEligible"
|
||||
data-testid="adjust-fee-button"
|
||||
type="primary"
|
||||
@click="openAdjustment"
|
||||
><PencilLine :size="16" />调整初算费用</el-button>
|
||||
<el-button
|
||||
v-if="canConfirm && snapshot?.feeStatus === 'CALCULATED'"
|
||||
v-if="!displayOnly && canConfirm && snapshot?.feeStatus === 'CALCULATED'"
|
||||
data-testid="confirm-fee-button"
|
||||
type="primary"
|
||||
:loading="feeAction === 'confirm'"
|
||||
@@ -373,14 +374,14 @@ defineExpose({ reload: loadFee })
|
||||
@click="transitionFee('confirm')"
|
||||
><Check :size="16" />确认费用</el-button>
|
||||
<el-button
|
||||
v-if="canConfirm && canSend && snapshot?.feeStatus === 'CALCULATED'"
|
||||
v-if="!displayOnly && canConfirm && canSend && snapshot?.feeStatus === 'CALCULATED'"
|
||||
type="primary"
|
||||
:loading="Boolean(feeAction)"
|
||||
:disabled="Boolean(feeAction)"
|
||||
@click="confirmAndPush"
|
||||
><Send :size="16" />确认推送费用</el-button>
|
||||
<el-button
|
||||
v-if="canSend && snapshot?.feeStatus === 'CONFIRMED'"
|
||||
v-if="!displayOnly && canSend && snapshot?.feeStatus === 'CONFIRMED'"
|
||||
data-testid="send-fee-button"
|
||||
type="primary"
|
||||
:loading="feeAction === 'send'"
|
||||
|
||||
Reference in New Issue
Block a user