From 90f97e846f48c032b6644d8332c9ff736668f871 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Tue, 15 Sep 2026 15:01:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/fee-items/pages/FeeItemsView.vue | 4 +++- src/modules/loading-lists/status.test.ts | 15 +++++++++++++++ src/shared/components/StatusBadge.vue | 4 ++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/modules/fee-items/pages/FeeItemsView.vue b/src/modules/fee-items/pages/FeeItemsView.vue index 161e2efb..70222bc0 100644 --- a/src/modules/fee-items/pages/FeeItemsView.vue +++ b/src/modules/fee-items/pages/FeeItemsView.vue @@ -403,7 +403,9 @@ onMounted(() => { 仅查看 - {{ (row as PlatformFeeItemResource).feeTypeName }}{{ (row as PlatformFeeItemResource).feeCode || '未分配编码' }} + {{ (row as PlatformFeeItemResource).feeTypeName }} + + {{ (row as PlatformFeeItemResource).tradeScope === 'DOMESTIC' ? '国内' : '国际' }} {{ directionText((row as PlatformFeeItemResource).pickupPayable, (row as PlatformFeeItemResource).pickupReceivable) }} {{ directionText((row as PlatformFeeItemResource).warehousePayable, (row as PlatformFeeItemResource).warehouseReceivable) }} diff --git a/src/modules/loading-lists/status.test.ts b/src/modules/loading-lists/status.test.ts index 601698c5..571fb044 100644 --- a/src/modules/loading-lists/status.test.ts +++ b/src/modules/loading-lists/status.test.ts @@ -1,7 +1,22 @@ import { describe, expect, it } from 'vitest' +import { mount } from '@vue/test-utils' +import StatusBadge from '@/shared/components/StatusBadge.vue' import { loadingListStatusLabel } from './status' describe('loading list status labels', () => { + it.each([ + ['WAIT_LOADING', '待装柜', 'warning'], + ['EDITING', '预装柜中', 'warning'], + ['LOADING', '拣货中', 'info'], + ['COMPLETED', '装柜完成', 'success'], + ['NEW_LOADING_STATE', '未知状态', 'neutral'], + ])('renders %s with its shared status tone', (status, label, tone) => { + const wrapper = mount(StatusBadge, { props: { status: loadingListStatusLabel(status) } }) + expect(wrapper.text()).toBe(label) + expect(wrapper.classes()).toContain(`is-${tone}`) + wrapper.unmount() + }) + it('translates known states and hides unknown backend enums', () => { expect(loadingListStatusLabel('EDITING')).toBe('预装柜中') expect(loadingListStatusLabel('COMPLETED')).toBe('装柜完成') diff --git a/src/shared/components/StatusBadge.vue b/src/shared/components/StatusBadge.vue index db5b50f9..a020174c 100644 --- a/src/shared/components/StatusBadge.vue +++ b/src/shared/components/StatusBadge.vue @@ -5,8 +5,8 @@ const props = defineProps<{ status: string }>() const tone = computed(() => { if (['正常', '启用', '已完成', '已审核', '审核通过', '已入库', '装柜完成', '派送完成', '已确认', '已放舱'].includes(props.status)) return 'success' - if (['待审核', '草稿', '待处理', '待分配', '未提交', '未录入', '待测量数据', '待分柜', '变更中'].includes(props.status)) return 'warning' - if (['已受理', '已订舱', '已提交', '运输中', '处理中', '装柜中'].includes(props.status)) return 'info' + if (['待审核', '草稿', '待处理', '待分配', '未提交', '未录入', '待测量数据', '待分柜', '待装柜', '预装柜中', '变更中'].includes(props.status)) return 'warning' + if (['已受理', '已订舱', '已提交', '运输中', '处理中', '拣货中', '装柜中'].includes(props.status)) return 'info' if (['停用', '已取消', '已驳回', '审核驳回', '失败', '订舱失败'].includes(props.status)) return 'danger' return 'neutral' })