This commit is contained in:
2026-08-14 19:02:34 +08:00
parent 44ee2be246
commit 4dec54feef
14 changed files with 215 additions and 54 deletions
@@ -133,6 +133,13 @@ describe('UnifiedOrdersView contract', () => {
expect(source).toContain('v-if="moreUnifiedOrderActions(row as UnifiedOrderResource).length"')
})
it('opens smart loading from the order table toolbar with its own permission', () => {
expect(source).toContain("can('platform:firstleg:smart-loading:list')")
expect(source).toContain('#toolbar-actions')
expect(source).toContain('@click="smartLoadingOpen = true"')
expect(source).toContain('<SmartLoadingDialog v-model="smartLoadingOpen" />')
})
it('keeps editable query values separate from the applied list request', () => {
expect(source).toContain('const appliedFilters = ref<FilterModel>(emptyFilters())')
expect(source).toContain('const activeFilters = appliedFilters.value')
@@ -40,6 +40,7 @@ import {
firstLegTransportModeLabel,
} from '@/shared/utils/firstLegBusinessLabels'
import { UnifiedOrderWorkflowPanel } from '@/modules/unified-orders/workflows'
import SmartLoadingDialog from '@/modules/container-loading/components/SmartLoadingDialog.vue'
import {
unifiedOrderHistoryActionLabel,
unifiedOrderLoadingStatusLabel,
@@ -115,6 +116,7 @@ const measurementLoadedKey = ref('')
const measurementImageUrls = ref<string[]>([])
const measurementCollapsed = reactive({ customer: false, outer: false, actual: false })
const measurementDialogOpen = ref(false)
const smartLoadingOpen = ref(false)
const measurementOrder = ref<UnifiedOrderResource | null>(null)
let detailLoadingKey = ''
let detailRequestSerial = 0
@@ -986,6 +988,9 @@ onMounted(() => {
<template #default>
<div v-if="!loadError" id="unified-orders-results" class="surface-panel table-panel table-card" role="tabpanel">
<DataTable v-model:page="page" v-model:page-size="pageSize" :data="records" :columns="columns" preference-key="unified-orders-table" :loading="loading" :total="total" :page-sizes="[20, 50, 100]" row-key="orderId" border stripe empty-text="暂无符合条件的订单" aria-label="统一订单列表">
<template v-if="can('platform:firstleg:smart-loading:list')" #toolbar-actions>
<el-button type="primary" @click="smartLoadingOpen = true"><PackageOpen :size="16" />智能装柜</el-button>
</template>
<template #actions="{ row }">
<div class="row-actions">
<el-button size="small" plain type="primary" @click="openDetail(row as UnifiedOrderResource)"><Eye :size="15" />详情</el-button>
@@ -1030,6 +1035,7 @@ onMounted(() => {
</div>
</template>
</ListPageLayout>
<SmartLoadingDialog v-model="smartLoadingOpen" />
</template>
<AppDrawer v-model="relationOpen" title="父子订单关联" size="min(860px, 94vw)" :show-footer="false" destroy-on-close>