优化
This commit is contained in:
@@ -82,6 +82,7 @@ import {
|
||||
updateMeasurementOuterDimensions,
|
||||
InboundFeePanel,
|
||||
InboundMeasurementDialog,
|
||||
InboundTaskList,
|
||||
MeasurementEvidenceThumbnail,
|
||||
DropshipPalletPrintPanel,
|
||||
sendInboundFee,
|
||||
@@ -322,6 +323,9 @@ const showAdvancedFilters = ref(false)
|
||||
const filters = ref<FilterModel>(emptyFilters())
|
||||
const appliedFilters = ref<FilterModel>(emptyFilters())
|
||||
const selectedStatus = ref<UnifiedOrderMainStatus | ''>('')
|
||||
const measurementReviewSelected = ref(false)
|
||||
const selectedTab = computed(() => measurementReviewSelected.value ? 'MEASUREMENT_REVIEW' : selectedStatus.value)
|
||||
const statusTabList = ref<HTMLElement | null>(null)
|
||||
const businessInboundCode = computed(() => route.name === 'unified-order-detail-by-inbound-code' && typeof route.params.inboundCode === 'string'
|
||||
? route.params.inboundCode.trim()
|
||||
: '')
|
||||
@@ -584,7 +588,9 @@ async function waitForSavedMeasurementVersion(tenantId: string, inboundId: strin
|
||||
|
||||
const statusTabs = computed(() => [
|
||||
{ value: '' as const, label: '全部' },
|
||||
...unifiedOrderStatusOptions,
|
||||
...unifiedOrderStatusOptions.flatMap((tab) => tab.value === 'WAIT_MEASURE' && can('firstleg:inbound:measurement-review')
|
||||
? [tab, { value: 'MEASUREMENT_REVIEW' as const, label: '测量数据审核' }]
|
||||
: [tab]),
|
||||
])
|
||||
|
||||
const warehouseOptions = computed(() => warehouses.value.map((warehouse) => ({
|
||||
@@ -706,8 +712,11 @@ function optionalBoolean(value: string | null | undefined) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
function selectStatus(status: UnifiedOrderMainStatus | '') {
|
||||
if (selectedStatus.value === status) return
|
||||
function selectStatus(status: UnifiedOrderMainStatus | '' | 'MEASUREMENT_REVIEW') {
|
||||
if (selectedTab.value === status) return
|
||||
measurementReviewSelected.value = status === 'MEASUREMENT_REVIEW'
|
||||
if (measurementReviewSelected.value) selectedOrders.value = []
|
||||
if (status === 'MEASUREMENT_REVIEW') return
|
||||
selectedStatus.value = status
|
||||
if (page.value === 1) void loadOrders()
|
||||
else page.value = 1
|
||||
@@ -724,8 +733,9 @@ function handleTabKeydown(event: KeyboardEvent, index: number) {
|
||||
const tab = statusTabs.value[nextIndex]
|
||||
if (!tab) return
|
||||
selectStatus(tab.value)
|
||||
const buttons = (event.currentTarget as HTMLElement).parentElement?.querySelectorAll<HTMLElement>('[role="tab"]')
|
||||
buttons?.[nextIndex]?.focus()
|
||||
void nextTick(() => {
|
||||
statusTabList.value?.querySelectorAll<HTMLElement>('[role="tab"]')[nextIndex]?.focus()
|
||||
})
|
||||
}
|
||||
|
||||
function can(permission: string) {
|
||||
@@ -1574,6 +1584,7 @@ async function loadWarehouses() {
|
||||
}
|
||||
|
||||
async function loadOrders() {
|
||||
if (measurementReviewSelected.value) return
|
||||
selectedApprovalOrders.value = []
|
||||
selectedOrders.value = []
|
||||
loading.value = true
|
||||
@@ -2691,7 +2702,27 @@ onBeforeUnmount(() => {
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<ListPageLayout ariaLabel="统一订单列表">
|
||||
<div v-if="measurementReviewSelected" id="unified-orders-results" role="tabpanel">
|
||||
<InboundTaskList mode="review" title="订单列表">
|
||||
<template #status-tabs>
|
||||
<div ref="statusTabList" class="status-tabs density-status-tabs" role="tablist" aria-label="订单主状态">
|
||||
<button
|
||||
v-for="(tab, index) in statusTabs"
|
||||
:key="tab.value || 'ALL'"
|
||||
type="button"
|
||||
role="tab"
|
||||
:aria-selected="selectedTab === tab.value"
|
||||
aria-controls="unified-orders-results"
|
||||
:tabindex="selectedTab === tab.value ? 0 : -1"
|
||||
:class="['status-tab', { 'is-active': selectedTab === tab.value }]"
|
||||
@click="selectStatus(tab.value)"
|
||||
@keydown="handleTabKeydown($event, index)"
|
||||
>{{ tab.label }}</button>
|
||||
</div>
|
||||
</template>
|
||||
</InboundTaskList>
|
||||
</div>
|
||||
<ListPageLayout v-else ariaLabel="统一订单列表">
|
||||
|
||||
|
||||
|
||||
@@ -2701,16 +2732,16 @@ onBeforeUnmount(() => {
|
||||
<template #toolbar-start><h1>订单列表</h1></template>
|
||||
<template #filters>
|
||||
<div class="orders-query-panel integrated-query-group">
|
||||
<div class="status-tabs density-status-tabs" role="tablist" aria-label="订单主状态">
|
||||
<div ref="statusTabList" class="status-tabs density-status-tabs" role="tablist" aria-label="订单主状态">
|
||||
<button
|
||||
v-for="(tab, index) in statusTabs"
|
||||
:key="tab.value || 'ALL'"
|
||||
type="button"
|
||||
role="tab"
|
||||
:aria-selected="selectedStatus === tab.value"
|
||||
:aria-selected="selectedTab === tab.value"
|
||||
aria-controls="unified-orders-results"
|
||||
:tabindex="selectedStatus === tab.value ? 0 : -1"
|
||||
:class="['status-tab', { 'is-active': selectedStatus === tab.value }]"
|
||||
:tabindex="selectedTab === tab.value ? 0 : -1"
|
||||
:class="['status-tab', { 'is-active': selectedTab === tab.value }]"
|
||||
@click="selectStatus(tab.value)"
|
||||
@keydown="handleTabKeydown($event, index)"
|
||||
>{{ tab.label }}</button>
|
||||
|
||||
Reference in New Issue
Block a user