feat: complete customer overseas business flows

This commit is contained in:
2026-09-04 12:41:58 +08:00
parent 2a7e042420
commit 0957324fb0
18 changed files with 840 additions and 38 deletions
@@ -25,12 +25,15 @@ test('isolates recoverable dashboard failures without hiding successful sections
assert.doesNotMatch(source, /<template v-else>\s*<section class="quick-order-band">/)
})
test('matches the prototype business overview while keeping real order routing and data', () => {
test('matches the prototype business overview and routes each card to its real business page', () => {
assert.match(source, /选择业务,快速下单/)
assert.match(source, /海外采购/)
assert.match(source, /美国本土卡/)
assert.match(source, /美本土散板/)
assert.match(source, /void router\.push\('\/orders\/first-leg\/create'\)/)
assert.match(source, /route: '\/cross-border\/procurement'/)
assert.match(source, /route: '\/cross-border\/domestic-trucking'/)
assert.match(source, /route: '\/cross-border\/pallet-shipping'/)
assert.match(source, /auth\.hasPermission\(business\.permission\)/)
assert.match(source, /order\.status === 'DELIVERED'/)
assert.match(source, /currentMonthOrderCount/)
assert.match(source, /提交订单后,专属客户经理将在 24 小时内与您联系/)
+12 -11
View File
@@ -40,7 +40,6 @@ const loadErrorItems = computed(() =>
})),
)
const canViewOrders = computed(() => auth.hasPermission('order:first-leg:list'))
const canCreateOrders = computed(() => auth.hasPermission('order:first-leg:create'))
const accountName = computed(() => {
if (!companyUnavailable.value && tenant.company.companyName) return tenant.company.companyName
return auth.user?.tenantName || auth.user?.name || '企业客户'
@@ -67,18 +66,24 @@ const businessCards = [
description: '采购代购 · 验货质检 · 集中发货',
icon: ShoppingCart,
tone: 'blue',
route: '/cross-border/procurement',
permission: 'merchant:cross-border:procurement',
},
{
title: '美国本土卡',
description: '港口提柜 · 仓到仓 · 仓到门',
icon: Truck,
tone: 'green',
route: '/cross-border/domestic-trucking',
permission: 'merchant:cross-border:domestic-trucking',
},
{
title: '美本土散板',
description: '拼车拼载 · 打盘服务 · 灵活派送',
icon: PanelsTopLeft,
tone: 'teal',
route: '/cross-border/pallet-shipping',
permission: 'merchant:cross-border:pallet-shipping',
},
] as const
@@ -111,16 +116,12 @@ async function loadDashboardData() {
}
}
function openBusinessOrder() {
if (canCreateOrders.value) {
void router.push('/orders/first-leg/create')
function openBusinessOrder(business: typeof businessCards[number]) {
if (auth.hasPermission(business.permission)) {
void router.push(business.route)
return
}
if (canViewOrders.value) {
void router.push('/orders/first-leg')
return
}
ElMessage.warning('当前账号暂无头程订单权限,请联系企业管理员。')
ElMessage.warning(`当前账号暂无${business.title}权限,请联系企业管理员。`)
}
function showSupportMessage(type: 'service' | 'faq' | 'quote') {
@@ -164,7 +165,7 @@ onMounted(() => void loadDashboardData())
type="button"
class="business-card"
:class="`business-card--${business.tone}`"
@click="openBusinessOrder"
@click="openBusinessOrder(business)"
>
<span class="business-card__icon" aria-hidden="true">
<component :is="business.icon" :size="29" :stroke-width="2.4" />
@@ -174,7 +175,7 @@ onMounted(() => void loadDashboardData())
<small>{{ business.description }}</small>
</span>
<span class="business-card__action">
{{ canCreateOrders ? '开始下单' : canViewOrders ? '查看订单' : '暂无权限' }}
{{ auth.hasPermission(business.permission) ? '开始下单' : '暂无权限' }}
<ArrowRight :size="18" aria-hidden="true" />
</span>
</button>