This commit is contained in:
2026-08-13 14:55:59 +08:00
parent da20613aa0
commit 33b47f4d2e
14 changed files with 22 additions and 22 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ describe('finance five-page delivery contract', () => {
'`${basePath}/fee-sources/${feeSourceId}/settlement-inclusion`',
]) expect(api).toContain(marker)
for (const operation of ['getFinanceFeeSource', 'reviewFinanceFeeSource', 'updateFinanceFeeSourceSettlementInclusion']) expect(page).toContain(operation)
for (const permission of ['platform:finance:fee-source:view', 'platform:finance:fee-source:review', 'platform:finance:fee-source:settlement']) expect(page).toContain(permission)
for (const permission of ['platform:finance:customer-arap:list', 'platform:finance:fee-source:review', 'platform:finance:fee-source:settlement']) expect(page).toContain(permission)
expect(page).toContain('expectedVersion: detail.value.operationVersion')
const columns = page.slice(page.indexOf('const columns:'))
expect(columns.indexOf("key: 'actions'")).toBeLessThan(columns.indexOf("key: 'direction'"))
@@ -58,7 +58,7 @@ describe('FinanceCustomerAccountsView delivery', () => {
it('restores account summary and ledger after opening the detail URL directly', async () => {
const pinia = createPinia(); setActivePinia(pinia)
const auth = useAuthStore(); auth.token = 'token'; auth.permissions = ['platform:finance:account:view']
const auth = useAuthStore(); auth.token = 'token'; auth.permissions = ['platform:finance:customer-account:list']
useAccessPreviewStore().initializeAfterLogin()
const router = createRouter({ history: createMemoryHistory(), routes: [
{ path: '/finance/customer-accounts', name: 'finance-customer-accounts', component: FinanceCustomerAccountsView },
@@ -118,7 +118,7 @@ describe('FinanceCustomerArapView G2 operations', () => {
})
it('loads detail and submits review and settlement changes with the returned version', async () => {
const wrapper = await mountView(['platform:finance:customer-arap:list', 'platform:finance:fee-source:view', 'platform:finance:fee-source:review', 'platform:finance:fee-source:settlement'])
const wrapper = await mountView(['platform:finance:customer-arap:list', 'platform:finance:fee-source:review', 'platform:finance:fee-source:settlement'])
await loadRows(wrapper)
const vm = wrapper.vm as unknown as {
openDetail(row: Record<string, unknown>): Promise<void>
@@ -145,7 +145,7 @@ describe('FinanceCustomerArapView G2 operations', () => {
it('renders request and trace ids when detail loading fails', async () => {
vi.mocked(getFinanceFeeSource).mockRejectedValueOnce(new ApiResponseError('费用来源不可用', 'FIN-FEE-404', 404, undefined, 'req-g2-error', 'trace-g2-error'))
const wrapper = await mountView(['platform:finance:customer-arap:list', 'platform:finance:fee-source:view'])
const wrapper = await mountView(['platform:finance:customer-arap:list'])
await loadRows(wrapper)
const vm = wrapper.vm as unknown as { openDetail(row: Record<string, unknown>): Promise<void> }
@@ -34,7 +34,7 @@ const detail: FinanceReconciliationDetail = {
revisions: [],
}
async function mountPage(permissions = ['platform:finance:customer-statement:list', 'platform:finance:fee-source:view']) {
async function mountPage(permissions = ['platform:finance:customer-statement:list']) {
const pinia = createPinia(); setActivePinia(pinia)
const auth = useAuthStore(); auth.token = 'token'; auth.permissions = permissions
useAccessPreviewStore().initializeAfterLogin()
@@ -115,12 +115,12 @@ describe('FinanceCustomerStatementsView', () => {
expect(listPlatformTenants).not.toHaveBeenCalled()
})
it('does not request fee-source details without its permission and keeps frozen trace fields visible', async () => {
it('uses statement list permission for fee-source details and keeps frozen trace fields visible', async () => {
const wrapper = await mountPage(['platform:finance:customer-statement:list'])
await (wrapper.vm as unknown as { openDetail(row: FinanceStatementReadModel): Promise<void> }).openDetail(statement)
await flushPromises()
expect(getFinanceFeeSource).not.toHaveBeenCalled()
expect(document.body.textContent).toContain('柜次ID 31')
expect(getFinanceFeeSource).toHaveBeenCalledWith('81')
expect(document.body.textContent).toContain('CONT-31')
expect(document.body.textContent).toContain('hash-81')
})
@@ -8,7 +8,7 @@ withDefaults(defineProps<{ summary: InboundOrderSummary; publicRemark?: string |
function processLabel(status: string) { return inboundStatusLabel(status, inboundProcessStatusLabels, '未知状态') }
function processType(status: string) {
if (status === 'INBOUNDED') return 'success'
if (status === 'WAIT_SPLIT') return 'success'
if (status === 'MEASURE_REJECTED' || status === 'VOIDED') return 'danger'
if (status === 'MEASURING' || status === 'INBOUNDING') return 'info'
return 'warning'
+2 -2
View File
@@ -1,4 +1,4 @@
export type InboundListTab = 'WAIT_MEASURE' | 'WAIT_REVIEW' | 'WAIT_FEE_SEND' | 'INBOUNDED'
export type InboundListTab = 'WAIT_MEASURE' | 'WAIT_REVIEW' | 'WAIT_FEE_SEND' | 'WAIT_SPLIT'
export type InboundProcessStatus =
| 'WAIT_MEASURE'
@@ -8,7 +8,7 @@ export type InboundProcessStatus =
| 'WAIT_PRICING'
| 'FEE_CONFIRMING'
| 'INBOUNDING'
| 'INBOUNDED'
| 'WAIT_SPLIT'
| 'VOIDED'
export type InboundFeeStatus = 'UNPRICED' | 'CALCULATED' | 'CONFIRMED' | 'SENT' | 'VOIDED' | string
@@ -35,7 +35,7 @@ const snapshot: InboundFeeSnapshot = {
totalAmount: 1235.6, currency: 'CNY',
rateEffectiveFrom: '2026-08-01T00:00:00', rateEffectiveTo: null,
calculatedAt: '2026-08-04T10:00:00', confirmedAt: '2026-08-04T10:01:00', sentAt: '2026-08-04T10:02:00',
nextProcessStatus: 'INBOUNDED',
nextProcessStatus: 'WAIT_SPLIT',
}
enableAutoUnmount(afterEach)
+1 -1
View File
@@ -62,7 +62,7 @@ const canAdjust = computed(() => access.can('firstleg:fba-pricing:adjust'))
const customerContextId = computed(() => props.customerId || props.tenantId || '')
const adjustmentEligible = computed(() => (
snapshot.value?.feeStatus === 'SENT'
&& snapshot.value.nextProcessStatus === 'INBOUNDED'
&& snapshot.value.nextProcessStatus === 'WAIT_SPLIT'
))
const chargeModeLabel = computed(() => snapshot.value?.chargeMode === 'KG' ? '按重量计费' : '按体积计费')
const chargeUnitLabel = computed(() => snapshot.value?.chargeUnit === 'KG' ? 'KG' : 'CBM')
+1 -1
View File
@@ -8,7 +8,7 @@ export type InboundMeasurementProcessStatus =
| 'WAIT_PRICING'
| 'FEE_CONFIRMING'
| 'INBOUNDING'
| 'INBOUNDED'
| 'WAIT_SPLIT'
| 'VOIDED'
export interface InboundMeasurementItem {
@@ -65,7 +65,7 @@ const tabs: Array<{ value: InboundListTab | ''; label: string; description: stri
{ value: 'WAIT_MEASURE', label: '待测量', description: '等待测量或补正' },
{ value: 'WAIT_REVIEW', label: '待审核', description: '等待测量审核' },
{ value: 'WAIT_FEE_SEND', label: '待费用/入库', description: '等待费用编排完成' },
{ value: 'INBOUNDED', label: '已入库', description: '费用已发布并完成入库' },
{ value: 'WAIT_SPLIT', label: '待分柜', description: '费用已发布并完成入库,等待分柜' },
]
const advancedFilterKeys = new Set(['orderStatus', 'feeReviewStatus', 'customerName', 'destinationCode', 'holdFlag'])
@@ -91,7 +91,7 @@ const allQueryFields = computed<QueryField[]>(() => [
{ label: '待测量', value: 'WAIT_MEASURE' }, { label: '测量中', value: 'MEASURING' },
{ label: '待测量审核', value: 'MEASURE_PENDING' }, { label: '测量已驳回', value: 'MEASURE_REJECTED' },
{ label: '待计费', value: 'WAIT_PRICING' }, { label: '费用处理中', value: 'FEE_CONFIRMING' },
{ label: '入库处理中', value: 'INBOUNDING' }, { label: '已入库', value: 'INBOUNDED' }, { label: '已作废', value: 'VOIDED' },
{ label: '入库处理中', value: 'INBOUNDING' }, { label: '待分柜', value: 'WAIT_SPLIT' }, { label: '已作废', value: 'VOIDED' },
] },
{ key: 'orderStatus', type: 'select', width: 180, label: '订单状态', placeholder: '全部订单状态', options: Object.entries(inboundOrderStatusLabels).map(([value, label]) => ({ value, label })) },
{ key: 'measureReviewStatus', type: 'select', width: 160, label: '测量审核状态', placeholder: '测量审核状态', options: [
@@ -318,7 +318,7 @@ function statusLabel(status: string) {
return inboundStatusLabel(status, inboundProcessStatusLabels, '未知状态')
}
function statusType(status: string) {
if (status === 'INBOUNDED') return 'success'
if (status === 'WAIT_SPLIT') return 'success'
if (status === 'MEASURE_REJECTED' || status === 'VOIDED') return 'danger'
if (status === 'MEASURING' || status === 'INBOUNDING') return 'info'
return 'warning'
@@ -77,7 +77,7 @@ describe('MeasurementReviewPanel', () => {
})
it('emits changed after a successful review write', async () => {
vi.mocked(approveMeasurement).mockResolvedValue({ feeId: '1', feeNo: 'FEE-1', feeVersion: 1, feeStatus: 'SENT', inboundId: '90001', totalAmount: 100, currency: 'CNY', nextProcessStatus: 'INBOUNDED' })
vi.mocked(approveMeasurement).mockResolvedValue({ feeId: '1', feeNo: 'FEE-1', feeVersion: 1, feeStatus: 'SENT', inboundId: '90001', totalAmount: 100, currency: 'CNY', nextProcessStatus: 'WAIT_SPLIT' })
vi.spyOn(ElMessageBox, 'confirm').mockResolvedValue(undefined as never)
const wrapper = mount(MeasurementReviewPanel, { props: { customerId: '10001', inboundId: '90001' }, global: { plugins: [ElementPlus] } })
await flushPromises()
+2 -2
View File
@@ -1,12 +1,12 @@
export const inboundProcessStatusLabels: Record<string, string> = {
WAIT_MEASURE: '待测量', MEASURING: '测量中', MEASURE_PENDING: '待测量审核', MEASURE_REJECTED: '测量已驳回',
WAIT_PRICING: '待计费', FEE_CONFIRMING: '费用处理中', INBOUNDING: '入库处理中', INBOUNDED: '已入库', VOIDED: '已作废',
WAIT_PRICING: '待计费', FEE_CONFIRMING: '费用处理中', INBOUNDING: '入库处理中', WAIT_SPLIT: '待分柜', VOIDED: '已作废',
}
export const inboundOrderStatusLabels: Record<string, string> = {
DRAFT: '草稿', SUBMITTED: '待审核', APPROVED: '已审核', ACCEPTED: '已受理', REJECTED: '已驳回',
PROCESSING: '处理中', COMPLETED: '已完成', CANCELLED: '已取消', PENDING_REVIEW: '待审核',
WAIT_MEASURE: '待测量', INBOUNDED: '已入库', WAIT_SPLIT: '待分柜', LOADING: '装柜中',
WAIT_MEASURE: '待测量', WAIT_SPLIT: '待分柜', LOADING: '装柜中',
LOADED: '装柜完成', DELIVERED: '派送完成',
}
@@ -19,7 +19,7 @@ describe('outbound dispatch status labels', () => {
expect(timelineStatusLabel('OUTBOUND_DISPATCH', 'READY_FOR_DISPATCH')).toBe('待确认出仓')
expect(timelineStatusLabel('OCEAN_BOOKING', 'RELEASED')).toBe('已放舱')
expect(timelineStatusLabel('TRUCK_APPOINTMENT', 'COMPLETED')).toBe('已完成')
expect(timelineStatusLabel('INBOUND', 'INBOUNDED')).toBe('已入库')
expect(timelineStatusLabel('INBOUND', 'WAIT_SPLIT')).toBe('待分柜')
})
it('does not expose unknown backend enum values', () => {
@@ -22,7 +22,7 @@ const inboundStatusLabels: Record<string, string> = {
WAIT_PRICING: '待计费',
FEE_CONFIRMING: '费用处理中',
INBOUNDING: '入库处理中',
INBOUNDED: '已入库',
WAIT_SPLIT: '待分柜',
VOIDED: '已作废',
}