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
+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>