diff --git a/dist.tar.gz b/dist.tar.gz index 6091fd4e..0df61bd3 100644 Binary files a/dist.tar.gz and b/dist.tar.gz differ diff --git a/src/views/order/orderManagement/config/order-common-config.ts b/src/views/order/orderManagement/config/order-common-config.ts index aff86ceb..8e580bae 100644 --- a/src/views/order/orderManagement/config/order-common-config.ts +++ b/src/views/order/orderManagement/config/order-common-config.ts @@ -562,7 +562,9 @@ export function translateOrderField(field: string, value: any) { } const INTERCEPT_STATUS_MAP: Record = { - none: '—', + none: '无', + pending: '待拦截', + success: '已拦截', requesting: '请求拦截中', requested: '已请求拦截', intercepting: '拦截中', @@ -578,10 +580,24 @@ const INTERCEPT_STATUS_MAP: Record = { } export function translateInterceptStatus(value: any): string { - if (value === null || value === undefined || value === '' || value === 'none') { - return '—' + const normalized = String(value ?? 'none').trim().toLowerCase() + if (!normalized || normalized === 'none') { + return INTERCEPT_STATUS_MAP.none ?? '无' } - return INTERCEPT_STATUS_MAP[String(value)] || String(value) + return INTERCEPT_STATUS_MAP[normalized] ?? INTERCEPT_STATUS_MAP[String(value).trim()] ?? String(value) +} + +export function getInterceptStatusTagType(value: unknown): string { + const normalized = String(value ?? 'none').trim().toLowerCase() + if (!normalized || normalized === 'none') return 'info' + if (['failed', 'exception', 'timeout', 'delivered_by_mistake'].includes(normalized)) return 'danger' + if (['success', 'intercepted_in_transit', 'intercepted_at_warehouse', 'returned'].includes(normalized)) { + return 'success' + } + if (['pending', 'requesting', 'requested', 'intercepting', 'returning'].includes(normalized)) { + return 'warning' + } + return 'danger' } function pad2(value: number) { @@ -1279,6 +1295,7 @@ export type UpperTableCopyAction = 'copy' | 'copyQr' const ORDER_LIST_COPY_ACTIONS: Record = { delivery_order_code: 'copy', order_code: 'copy', + wave_no: 'copy', source_order_codes: 'copy', express_numbers: 'copyQr', waybill_codes: 'copyQr', @@ -1297,11 +1314,20 @@ export function applyOrderListCopyActions -
+ +
@@ -274,7 +275,6 @@ const columns = ref([...deliveryColumns]) const selectionRows = ref([]) const selectedOrderId = ref(null) const detailVisible = ref(true) -const quickSearch = ref('') const toolbarButtons = deliveryOrderToolbarButtons const selectedRow = computed(() => { @@ -419,22 +419,7 @@ async function loadData() { } function buildWhere() { - let where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {}) - if (quickSearch.value) { - const q = quickSearch.value.trim() - if (/^\d+$/.test(q)) { - where.id = { - operator: 'eq', - value: Number(q), - type: 'text' - } - } - where.delivery_order_code = { - operator: 'like', - value: q, - type: 'text' - } - } + const where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {}) return sanitizeDeliveryListWhere(where) } @@ -500,11 +485,6 @@ function handlePageSizeChange(size: number) { loadData() } -function onQuickSearch() { - pagination.currentPage = 1 - loadData() -} - function openColumnConfigPanel() { upperTable.value?.openColumnConfig?.() } diff --git a/src/views/order/orderManagement/outboundOrder.vue b/src/views/order/orderManagement/outboundOrder.vue index 3a899420..b347714c 100644 --- a/src/views/order/orderManagement/outboundOrder.vue +++ b/src/views/order/orderManagement/outboundOrder.vue @@ -25,7 +25,8 @@ @action="handleToolbarButtonClick" />
-
+ +
@@ -231,7 +232,6 @@ const columns = ref(buildPendingStyleColumns(outboundColumns)) const selectionRows = ref([]) const selectedOrderId = ref(null) const detailVisible = ref(true) -const quickSearch = ref('') const toolbarButtons = outboundToolbarButtons const manualResult = ref(null) @@ -271,22 +271,7 @@ function sanitizeOutboundListWhere(where: Record) { } function buildWhere() { - let where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {}) - if (quickSearch.value) { - const q = quickSearch.value.trim() - if (/^\d+$/.test(q)) { - where.id = { - operator: 'eq', - value: Number(q), - type: 'text' - } - } - where.delivery_order_code = { - operator: 'like', - value: q, - type: 'text' - } - } + const where = buildOrderWhereConditions(scanBox.value?.getConditions?.() || {}) return sanitizeOutboundListWhere(where) } @@ -407,11 +392,6 @@ function handlePageSizeChange(size: number) { loadData() } -function onQuickSearch() { - pagination.currentPage = 1 - loadData() -} - function openColumnConfigPanel() { upperTable.value?.openColumnConfig?.() } diff --git a/src/views/order/orderManagement/pendingOrder.vue b/src/views/order/orderManagement/pendingOrder.vue index 677e7ecf..db8d6457 100644 --- a/src/views/order/orderManagement/pendingOrder.vue +++ b/src/views/order/orderManagement/pendingOrder.vue @@ -100,10 +100,12 @@ + + + + @@ -170,13 +185,21 @@ import SyncOrderIdsForm from '@/views/order/orderManagement/form/SyncOrderIdsFor import ManualWaybillForm from '@/views/order/orderManagement/form/ManualWaybillForm.vue' import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue' import { createPendingToolbarController } from '@/views/order/orderManagement/utils/toolbar-actions' -import { buildOrderWhereConditions, sanitizeOrderListWhere } from '@/views/order/orderManagement/utils/order-index-helpers' import { - pendingCloums, + buildOrderWhereConditions, + parseOrderListResponse, + resolveOrderInterceptStatus, + resolveOrderRecheckStatus, + sanitizeOrderListWhere +} from '@/views/order/orderManagement/utils/order-index-helpers' +import { + buildPendingStyleColumns, pendingAvailableFields, pickToolbarButtons, type ToolbarButtonConfig, translateOrderField, + translateInterceptStatus, + getInterceptStatusTagType, getTagType, fillExpressCompanyScanFieldOptions } from '@/views/order/orderManagement/config/order-common-config' @@ -198,7 +221,7 @@ const list = ref([]) const loading = ref(false) const queryTime = ref(0) const tableSize = ref('small') -const columns = ref(pendingCloums) +const columns = ref(buildPendingStyleColumns()) const selectionRows = ref([]) const hasSelection = ref(false) const quickSearch = ref('') @@ -271,9 +294,10 @@ async function loadData() { sortOrder: 'DESC' as const } }) - if (res && (res.code === 1 || res.code === 200) && res.data) { - list.value = res.data.list || [] - pagination.total = res.data.pagination?.total || res.data.total || 0 + if (res && (res.code === 1 || res.code === 200)) { + const data = parseOrderListResponse(res) + list.value = data.list + pagination.total = data.total } else { list.value = [] pagination.total = 0 diff --git a/src/views/storage/inventory/inventory-config.ts b/src/views/storage/inventory/inventory-config.ts index 58fb9f58..53b4341b 100644 --- a/src/views/storage/inventory/inventory-config.ts +++ b/src/views/storage/inventory/inventory-config.ts @@ -14,8 +14,8 @@ type InventoryScanFieldGroupKey = keyof typeof INVENTORY_SCAN_FIELD_GROUPS export function inventoryScanField( group: G, field: Record -) { - return { ...field, group: INVENTORY_SCAN_FIELD_GROUPS[group] } +): InventoryScanFieldConfig { + return { ...field, group: INVENTORY_SCAN_FIELD_GROUPS[group] } as InventoryScanFieldConfig } function extractInventoryScanConds(condition: any): Record | null {