From c2611a1bfd77df91828e549acb24d31655de01cb Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Mon, 14 Sep 2026 17:18:56 +0800 Subject: [PATCH] feat(client): optimize first-leg order actions --- src/modules/first-leg/api/unifiedOrders.ts | 1 + src/modules/first-leg/store/firstLegOrders.ts | 1 + src/modules/first-leg/types/firstLegOrder.ts | 1 + .../views/FirstLegOrdersView.test.mjs | 24 +++++--- .../first-leg/views/FirstLegOrdersView.vue | 58 ++++++++++++++++--- 5 files changed, 69 insertions(+), 16 deletions(-) diff --git a/src/modules/first-leg/api/unifiedOrders.ts b/src/modules/first-leg/api/unifiedOrders.ts index e32787f..944a78f 100644 --- a/src/modules/first-leg/api/unifiedOrders.ts +++ b/src/modules/first-leg/api/unifiedOrders.ts @@ -59,6 +59,7 @@ export interface MerchantUnifiedOrderRow { lxCode?: string | null mainStatus: ApiUnifiedOrderMainStatus nextAction: string | null + customerFeeConfirmationRequired: boolean internalOrderStatus: ApiFirstLegStatus | null customerId: number | string | null customerName: string diff --git a/src/modules/first-leg/store/firstLegOrders.ts b/src/modules/first-leg/store/firstLegOrders.ts index 75703f4..2feaf38 100644 --- a/src/modules/first-leg/store/firstLegOrders.ts +++ b/src/modules/first-leg/store/firstLegOrders.ts @@ -198,6 +198,7 @@ function timeline(detail: MerchantFirstLegOrderDetail): FirstLegOrderTimelineIte function businessSummary(summary?: MerchantUnifiedOrderRow): FirstLegOrder['businessSummary'] { return { + customerFeeConfirmationRequired: summary?.customerFeeConfirmationRequired ?? false, totalPackageCount: summary?.totalPackageCount ?? null, actualGrossWeightKg: summary?.actualGrossWeightKg ?? null, actualVolumeCbm: summary?.actualVolumeCbm ?? null, diff --git a/src/modules/first-leg/types/firstLegOrder.ts b/src/modules/first-leg/types/firstLegOrder.ts index d663a29..3d7abce 100644 --- a/src/modules/first-leg/types/firstLegOrder.ts +++ b/src/modules/first-leg/types/firstLegOrder.ts @@ -64,6 +64,7 @@ export interface FirstLegOrderTimelineItem { } export interface FirstLegOrderBusinessSummary { + customerFeeConfirmationRequired: boolean totalPackageCount: number | null actualGrossWeightKg: number | null actualVolumeCbm: number | null diff --git a/src/modules/first-leg/views/FirstLegOrdersView.test.mjs b/src/modules/first-leg/views/FirstLegOrdersView.test.mjs index 232db1b..0320b63 100644 --- a/src/modules/first-leg/views/FirstLegOrdersView.test.mjs +++ b/src/modules/first-leg/views/FirstLegOrdersView.test.mjs @@ -8,6 +8,7 @@ const editorShellSource = readFileSync(new URL('../components/FirstLegOrderEdito const progressSource = readFileSync(new URL('../components/OrderProgressPanel.vue', import.meta.url), 'utf8') const customsDialogSource = readFileSync(new URL('../components/CustomsDocumentsDialog.vue', import.meta.url), 'utf8') const customsApiSource = readFileSync(new URL('../api/customs.ts', import.meta.url), 'utf8') +const orderStoreSource = readFileSync(new URL('../store/firstLegOrders.ts', import.meta.url), 'utf8') test('routes the confirmed first-leg path to the implemented order view', () => { assert.match(routerSource, /path: 'orders\/first-leg'[\s\S]*?component: \(\) => import\('\.\/views\/FirstLegOrdersView\.vue'\)[\s\S]*?release: 'active'/) @@ -88,7 +89,7 @@ test('uses the shared query toolbar and data table without metric cards', () => assert.match(source, /import QueryToolbar, \{ type QueryField, type QueryModel \}/) assert.match(source, /import DataTable, \{ type DataTableColumn \}/) assert.match(source, /const filters = ref/) - assert.match(source, //) + assert.match(source, //) assert.match(source, /async function searchOrders\(model: QueryModel\)/) assert.match(source, /await store\.load\(\{/) assert.match(source, / assert.doesNotMatch(source, /order-metrics|订单概览/) }) -test('adds prototype download actions to the order query panel', () => { +test('adds download actions to the order-list toolbar', () => { assert.match(source, /下载唛头/) assert.match(source, /导出订单信息/) assert.match(source, /function downloadShippingMarks\(\)/) @@ -237,12 +238,12 @@ test('keeps the seven-stage progress and business summary usable on mobile', () }) test('keeps the first viewport compact and moves create into the table toolbar', () => { - const queryToolbarSource = source.slice(source.indexOf('') + ''.length) + const tableToolbarSource = source.slice(source.indexOf('class="order-table-toolbar"'), source.indexOf('class="order-eligibility is-pending"')) assert.match(source, /class="order-table-toolbar"/) assert.match(source, /订单列表<\/strong>共 \{\{ filteredOrders\.length \}\} 条<\/span>/) assert.match(source, /class="order-table-toolbar"[\s\S]*order:first-leg:create[\s\S]*创建订单[\s\S]*class="order-eligibility is-pending"/) - assert.match(queryToolbarSource, /