diff --git a/src/views/order/waveOrder/WaveBatchListPanel.vue b/src/views/order/waveOrder/WaveBatchListPanel.vue
index ced1bb39..3634cbfb 100644
--- a/src/views/order/waveOrder/WaveBatchListPanel.vue
+++ b/src/views/order/waveOrder/WaveBatchListPanel.vue
@@ -495,10 +495,38 @@
>
-
-
+
+
+ {{ row.delivery_no || row.delivery_order_code || row.order_sn || '—' }}
+
+
+
+
+ {{ row.tracking_no || row.tracking_number || '—' }}
+
+
+
+
+ {{ row.store_name || row.shop_name || row.shop || '—' }}
+
+
-
+
+
+ {{ row.sys_logistics_name || row.logistics_name || '—' }}
+
+
+
+
+
+ {{ row.items_count ?? row.item_count ?? '—' }}
+
+
+
+
+ {{ row.items_total ?? row.item_total ?? '—' }}
+
+
{{ getFallbackOrderItemSnapshotText(row) }}
@@ -753,7 +781,6 @@ import { KeepAlive, computed, onBeforeUnmount, onMounted, reactive, ref, watch }
import { ElMessage, ElMessageBox } from 'element-plus'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
-import { pendingAvailableFields } from '@/views/order/orderManagement/config/order-common-config'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import {
waveScanBoxConfig,
@@ -987,9 +1014,25 @@ const waveStrategyQuickScanResult = reactive({
errorMessage: ''
})
const waveStrategyPagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
+const fallbackOrderOwnerOptions = ref>([])
+const fallbackOrderLogisticsOptions = ref>([])
+const fallbackOrderPlatformOptions = ref>([])
const presetTree = ref([])
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(waveAvailableFields)))
-const fallbackOrderAvailableFieldsRef = reactive(JSON.parse(JSON.stringify(pendingAvailableFields)))
+const fallbackOrderAvailableFieldsRef = reactive([
+ { label: '订单ID', value: 'id', type: 'number' },
+ { label: '订单号', value: 'delivery_no', type: 'text' },
+ { label: '物流单号', value: 'tracking_no', type: 'text' },
+ { label: '商品种数最小值', value: 'items_count_min', type: 'number' },
+ { label: '商品种数最大值', value: 'items_count_max', type: 'number' },
+ { label: '商品总数最小值', value: 'items_total_min', type: 'number' },
+ { label: '商品总数最大值', value: 'items_total_max', type: 'number' },
+ { label: '物流公司', value: 'sys_logistics_name', type: 'select', options: fallbackOrderLogisticsOptions.value },
+ { label: '店铺名称', value: 'store_name', type: 'text' },
+ { label: '货主', value: 'owner_name', type: 'select', options: fallbackOrderOwnerOptions.value },
+ { label: '省份', value: 'province', type: 'text' },
+ { label: '来源平台', value: 'sys_platform_name', type: 'select', options: fallbackOrderPlatformOptions.value }
+])
const columns = ref(JSON.parse(JSON.stringify(waveBatchColumns)))
const toolbarButtons = computed(() => getWaveToolbarButtons(props.waveType))
@@ -2354,9 +2397,94 @@ function openSingleOrderDialog() {
waveStrategyPagination.currentPage = 1
waveStrategyList.value = []
waveStrategyPagination.total = 0
+ void loadFallbackOrderFilterOptions()
void fetchFallbackOrderList()
}
+function normalizeCode(value: unknown) {
+ return String(value ?? '').trim()
+}
+
+function mapNameOptions(rawList: any[], nameKeys: string[]) {
+ const result: Array<{ label: string; value: string }> = []
+ const seen = new Set()
+ for (const item of rawList || []) {
+ const name = normalizeCode(nameKeys.map((key) => item?.[key]).find((v) => v !== undefined && v !== null && v !== ''))
+ if (!name || seen.has(name)) continue
+ result.push({ value: name, label: name })
+ seen.add(name)
+ }
+ return result
+}
+
+function unwrapIndexListResponse(res: any): any[] {
+ const payload = res?.data !== undefined ? res.data : res
+ if (Array.isArray(payload)) return payload
+ if (payload && typeof payload === 'object') {
+ if (Array.isArray(payload.list)) return payload.list
+ if (Array.isArray(payload.items)) return payload.items
+ if (Array.isArray(payload.records)) return payload.records
+ }
+ if (Array.isArray(res?.list)) return res.list
+ return []
+}
+
+function patchFallbackFieldOptions(fieldValue: string, options: Array<{ label: string; value: string }>) {
+ const targetField = fallbackOrderAvailableFieldsRef.find((field: any) => field.value === fieldValue)
+ if (targetField) {
+ targetField.options = options
+ }
+}
+
+async function loadFallbackOrderFilterOptions() {
+ const hasReadyOptions = fallbackOrderOwnerOptions.value.length > 0
+ && fallbackOrderLogisticsOptions.value.length > 0
+ && fallbackOrderPlatformOptions.value.length > 0
+ if (hasReadyOptions) return
+
+ try {
+ const [storesRes, expressRes, platformRes] = await Promise.all([
+ indexApi.loadStores({ type: 'order' }),
+ indexApi.getExpressList({}),
+ indexApi.getPlatformList({})
+ ])
+
+ const storesResAny = storesRes as any
+ const stores = Array.isArray(storesResAny?.stores)
+ ? storesResAny.stores
+ : Array.isArray(storesResAny?.data?.stores)
+ ? storesResAny.data.stores
+ : []
+ const expressRaw = unwrapIndexListResponse(expressRes)
+ const platformRaw = unwrapIndexListResponse(platformRes)
+
+ const ownerNameSet = new Set()
+ stores.forEach((item: any) => {
+ const ownerName = String(item?.label || item?.name || '').trim()
+ if (!ownerName) return
+ ownerNameSet.add(ownerName)
+ })
+ fallbackOrderOwnerOptions.value = Array.from(ownerNameSet).map((name) => ({
+ label: name,
+ value: name
+ }))
+ fallbackOrderLogisticsOptions.value = mapNameOptions(expressRaw, ['name', 'logistics_name', 'express_name', 'label'])
+ fallbackOrderPlatformOptions.value = mapNameOptions(platformRaw, ['name', 'platform_name', 'sys_platform_name', 'label'])
+
+ patchFallbackFieldOptions('owner_name', fallbackOrderOwnerOptions.value)
+ patchFallbackFieldOptions('sys_logistics_name', fallbackOrderLogisticsOptions.value)
+ patchFallbackFieldOptions('sys_platform_name', fallbackOrderPlatformOptions.value)
+ } catch (error) {
+ console.error('load fallback order filter options failed:', error)
+ fallbackOrderOwnerOptions.value = []
+ fallbackOrderLogisticsOptions.value = []
+ fallbackOrderPlatformOptions.value = []
+ patchFallbackFieldOptions('owner_name', [])
+ patchFallbackFieldOptions('sys_logistics_name', [])
+ patchFallbackFieldOptions('sys_platform_name', [])
+ }
+}
+
async function loadGroupOrderStoreOptions() {
if (groupOrderStoreOptions.value.length > 0) return
try {
@@ -2415,12 +2543,30 @@ function buildGroupOrderListPayload() {
}
function sanitizeFallbackOrderWhere(where: Record) {
+ const allowedFieldMap: Record = {
+ id: 'id',
+ delivery_no: 'delivery_no',
+ deliveryNo: 'delivery_no',
+ tracking_no: 'tracking_no',
+ trackingNo: 'tracking_no',
+ items_count_min: 'items_count_min',
+ items_count_max: 'items_count_max',
+ items_total_min: 'items_total_min',
+ items_total_max: 'items_total_max',
+ sys_logistics_name: 'sys_logistics_name',
+ store_name: 'store_name',
+ owner_name: 'owner_name',
+ province: 'province',
+ sys_platform_name: 'sys_platform_name'
+ }
const nextWhere: Record = {}
Object.keys(where || {}).forEach((key) => {
if (key === 'warehouse_id' || key === 'warehouseId') return
+ const normalizedKey = allowedFieldMap[key]
+ if (!normalizedKey) return
const value = where[key]
if (value === undefined || value === null || value === '' || (Array.isArray(value) && value.length === 0)) return
- nextWhere[key] = value
+ nextWhere[normalizedKey] = value
})
return nextWhere
}
@@ -2431,11 +2577,7 @@ function buildFallbackOrderListPayload() {
page: fallbackOrderPagination.currentPage,
pageSize: fallbackOrderPagination.pageSize
},
- where: sanitizeFallbackOrderWhere(buildWhereConditions(fallbackOrderScanBox.value?.getConditions?.() || {})),
- sort: {
- sortField: 'updated_at',
- sortOrder: 'DESC'
- }
+ where: sanitizeFallbackOrderWhere(buildWhereConditions(fallbackOrderScanBox.value?.getConditions?.() || {}))
}
}