diff --git a/dist.tar.gz b/dist.tar.gz index d560bc74..6f65ee4c 100644 Binary files a/dist.tar.gz and b/dist.tar.gz differ diff --git a/package-lock.json b/package-lock.json index 5979ccca..b2cf3882 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,6 +31,7 @@ "vue-draggable-plus": "^0.6.1", "vue-i18n": "^11.2.8", "vue-router": "^5.0.3", + "vue-virtual-scroller": "^3.0.2", "xlsx": "^0.18.5" }, "devDependencies": { @@ -9748,6 +9749,15 @@ "typescript": ">=5.0.0" } }, + "node_modules/vue-virtual-scroller": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/vue-virtual-scroller/-/vue-virtual-scroller-3.0.2.tgz", + "integrity": "sha512-zneKxsBecfFBpH2NAk8zF0IWBRSYRaXnXK/dPQ/AnXE9xlbRyW6sSO9EUb5L5cSFz2Dpfb2giN30/y+/Xvu5PQ==", + "license": "MIT", + "peerDependencies": { + "vue": "^3.3.0" + } + }, "node_modules/webpack-virtual-modules": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz", diff --git a/package.json b/package.json index 430bf80f..79da6344 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "vue-draggable-plus": "^0.6.1", "vue-i18n": "^11.2.8", "vue-router": "^5.0.3", + "vue-virtual-scroller": "^3.0.2", "xlsx": "^0.18.5" }, "devDependencies": { diff --git a/src/api/storage_receiving/receiving.ts b/src/api/storage_receiving/receiving.ts index 05e4c861..564a0aaf 100644 --- a/src/api/storage_receiving/receiving.ts +++ b/src/api/storage_receiving/receiving.ts @@ -55,6 +55,32 @@ export function batchCancelReceiving(data: any): Promise { }) } +export function reviewReceiving(data: any): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'storage.receiving.reviewReceiving', + v, + timestamp: new Date().getTime() + }, + data: data + }) +} + +export function rejectReceiving(data: any): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'storage.receiving.rejectReceiving', + v, + timestamp: new Date().getTime() + }, + data: data + }) +} + // export function exportReceiving(data: any): Promise { // return request({ // url: '/system', @@ -247,6 +273,19 @@ export function detailChange(data: any): Promise { }) } +export function save(data: any): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'storage.receiving.save', + v, + timestamp: new Date().getTime() + }, + data + }) +} + export function quickPutaway(data: { /** 收货单ID */ diff --git a/src/components/UpperTable/index.vue b/src/components/UpperTable/index.vue index 2554886e..83abbce8 100644 --- a/src/components/UpperTable/index.vue +++ b/src/components/UpperTable/index.vue @@ -168,11 +168,20 @@ v-for="(item, idx) in editableColumnConfigs" :key="item.prop" class="column-config-item" + :class="{ + 'is-draggable': true, + 'is-drag-over': dragOverProp === item.prop + }" + draggable="true" + @dragstart="onColumnDragStart(item)" + @dragover.prevent="onColumnDragOver(item)" + @drop.prevent="onColumnDrop(item)" + @dragend="onColumnDragEnd" >
+ ⋮⋮ {{ item.label || item.prop }} @@ -181,14 +190,14 @@
上移 下移 @@ -379,8 +388,6 @@ type ColumnItem = { label?: string width?: number | string fixed?: 'left' | 'right' | boolean - lockVisible?: boolean - lockOrder?: boolean [key: string]: any } @@ -391,8 +398,6 @@ type ColumnConfigItem = { order: number width?: number | string fixed?: 'left' | 'right' | false - lockVisible?: boolean - lockOrder?: boolean } type TableColumnProfile = { @@ -419,6 +424,8 @@ const checkboxUpdateKey = ref(null) const columnConfigDialogVisible = ref(false) const editableColumnConfigs = ref([]) const columnConfigMap = ref>({}) +const draggingProp = ref('') +const dragOverProp = ref('') const tableContainer = ref(null) const bodyScrollEl = ref(null) const virtualScrollTop = ref(0) @@ -473,7 +480,8 @@ const displayColumns = computed(() => { return { ...column, width: cfg.width ?? column.width, - fixed: cfg.fixed === false ? undefined : (cfg.fixed ?? column.fixed) + // 在字段设置模式下,以用户排序为最高优先级,避免 fixed 导致“置顶”不生效 + fixed: undefined } }) }) @@ -608,9 +616,7 @@ function getDefaultColumnConfigs() { visible: true, order: index, width: column.width, - fixed: column.fixed === true ? 'left' : (column.fixed as 'left' | 'right' | undefined), - lockVisible: !!column.lockVisible, - lockOrder: !!column.lockOrder + fixed: column.fixed === true ? 'left' : (column.fixed as 'left' | 'right' | undefined) })) } @@ -706,7 +712,6 @@ function openColumnConfig() { function onToggleColumnVisible(prop: string, visible: boolean) { const next = editableColumnConfigs.value.map((item) => { if (item.prop !== prop) return item - if (item.lockVisible) return item return { ...item, visible } }) editableColumnConfigs.value = next @@ -718,17 +723,58 @@ function moveColumn(prop: string, direction: 'up' | 'down') { const index = list.findIndex((item) => item.prop === prop) if (index === -1) return const current = list[index] - if (current?.lockOrder) return const targetIndex = direction === 'up' ? index - 1 : index + 1 if (targetIndex < 0 || targetIndex >= list.length) return const target = list[targetIndex] - if (target?.lockOrder) return list[index] = target as ColumnConfigItem list[targetIndex] = current as ColumnConfigItem editableColumnConfigs.value = list.map((item, idx) => ({ ...item, order: idx })) persistEditableConfigs() } +function onColumnDragStart(item: ColumnConfigItem) { + draggingProp.value = item.prop +} + +function onColumnDragOver(item: ColumnConfigItem) { + if (!draggingProp.value) return + if (draggingProp.value === item.prop) return + dragOverProp.value = item.prop +} + +function onColumnDrop(target: ColumnConfigItem) { + const sourceProp = draggingProp.value + if (!sourceProp || sourceProp === target.prop) { + onColumnDragEnd() + return + } + + const list = [...editableColumnConfigs.value].sort((a, b) => a.order - b.order) + const sourceIndex = list.findIndex((item) => item.prop === sourceProp) + const targetIndex = list.findIndex((item) => item.prop === target.prop) + if (sourceIndex === -1 || targetIndex === -1) { + onColumnDragEnd() + return + } + + const sourceItem = list[sourceIndex] + if (!sourceItem) { + onColumnDragEnd() + return + } + + list.splice(sourceIndex, 1) + list.splice(targetIndex, 0, sourceItem) + editableColumnConfigs.value = list.map((item, idx) => ({ ...item, order: idx })) + persistEditableConfigs() + onColumnDragEnd() +} + +function onColumnDragEnd() { + draggingProp.value = '' + dragOverProp.value = '' +} + function resetColumnConfig() { const defaults = getDefaultColumnConfigs() applyColumnConfigMap(defaults) @@ -1297,15 +1343,34 @@ watch( border-bottom: 1px solid #f2f3f5; } +.column-config-item.is-draggable { + cursor: move; +} + +.column-config-item.is-drag-over { + background: #f0f9ff; + border-top: 1px dashed #409eff; +} + .column-config-item:last-child { border-bottom: none; } .column-config-main { + display: flex; + align-items: center; + gap: 8px; flex: 1; min-width: 0; } +.drag-handle { + color: #909399; + font-size: 14px; + line-height: 1; + user-select: none; +} + /* 表格尺寸样式 */ .upper-table-container.small :deep(.el-table) { font-size: 12px; diff --git a/src/views/order/orderManagement/archiveOrder.vue b/src/views/order/orderManagement/archiveOrder.vue index 34725f1e..35714e23 100644 --- a/src/views/order/orderManagement/archiveOrder.vue +++ b/src/views/order/orderManagement/archiveOrder.vue @@ -225,15 +225,18 @@ function buildWhereConditions(rawConditions: Record) { const where: Record = {} Object.keys(rawConditions || {}).forEach((key) => { const condition = rawConditions[key] + const normalizedKey = key === 'order_code' ? 'delivery_order_code' : key if (condition && typeof condition === 'object' && 'operator' in condition) { - where[key] = condition + where[normalizedKey] = Array.isArray(condition.value) + ? { ...condition, value: condition.value[0] ?? '', type: 'text' } + : condition return } if (condition !== undefined && condition !== null && condition !== '') { - where[key] = { + where[normalizedKey] = { operator: 'eq', - value: condition, - type: Array.isArray(condition) ? 'array' : typeof condition + value: Array.isArray(condition) ? condition[0] ?? '' : condition, + type: 'text' } } }) diff --git a/src/views/order/orderManagement/component/PendingOrderDetailPanel.vue b/src/views/order/orderManagement/component/PendingOrderDetailPanel.vue index 72008aa2..50f2d537 100644 --- a/src/views/order/orderManagement/component/PendingOrderDetailPanel.vue +++ b/src/views/order/orderManagement/component/PendingOrderDetailPanel.vue @@ -7,7 +7,7 @@ {{ detail.delivery_order_code || '-' }} {{ detail.shop_nick || '-' }} - {{ detail.source_platform_name || '-' }} + {{ detail.buyer_nick || '-' }} @@ -89,6 +89,7 @@ const props = defineProps<{ const loading = ref(false) const detail = ref | null>(null) +let latestRequestId = 0 function formatTime(value: unknown) { if (!value) return '-' @@ -112,6 +113,7 @@ async function loadDetail() { detail.value = null return } + const requestId = ++latestRequestId loading.value = true try { const res: any = await orderPendingOrder.detail({ @@ -119,25 +121,30 @@ async function loadDetail() { ids: [props.row.id], tableType: 'order' }) + if (requestId !== latestRequestId) return const ok = res && (res.code === 1 || res.code === 200) if (!ok) { ElMessage.error(res?.message || '获取订单明细失败') detail.value = null return } - detail.value = res?.data?.detail || null + const payload = res?.data || {} + detail.value = payload.order || payload.detail || payload || null } catch { + if (requestId !== latestRequestId) return ElMessage.error('获取订单明细失败') detail.value = null } finally { - loading.value = false + if (requestId === latestRequestId) { + loading.value = false + } } } watch( - () => props.row?.id, + () => [props.row?.id, props.row?.updated_at, props.row?.status], () => { - loadDetail() + void loadDetail() }, { immediate: true } ) diff --git a/src/views/order/orderManagement/config/order-common-config.ts b/src/views/order/orderManagement/config/order-common-config.ts index 00ab738e..e25e7df7 100644 --- a/src/views/order/orderManagement/config/order-common-config.ts +++ b/src/views/order/orderManagement/config/order-common-config.ts @@ -355,10 +355,10 @@ export const deliveryAvailableFields = [ { label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] }, { label: '订单号', value: 'delivery_order_code', type: 'text' }, { label: '店铺名称', value: 'shop_nick', type: 'text' }, - { label: '来源平台', value: 'source_platform_name', type: 'text' }, + { label: '来源平台', value: 'source_platform_name', type: 'select', options: [] }, { label: '收货人', value: 'name', type: 'text' }, { label: '手机号', value: 'mobile', type: 'text' }, - { label: '物流公司', value: 'logistics_name', type: 'text' }, + { label: '物流公司', value: 'logistics_name', type: 'select', options: [] }, { label: '物流单号', value: 'waybill_codes', type: 'text' }, { label: '紧急订单', value: 'is_urgency', type: 'select', options: [ { label: '是', value: 'Y' }, @@ -444,7 +444,7 @@ export const deliverybuttonList: any[] = [ export const reviewAvailableFields = [ { label: '发货单号', value: 'delivery_order_code', type: 'text' }, { label: '店铺名称', value: 'shop_nick', type: 'text' }, - { label: '平台编码', value: 'sys_platform_code', type: 'text' }, + { label: '平台编码', value: 'sys_platform_code', type: 'select', options: [] }, { label: '收货人', value: 'name', type: 'text' }, { label: '手机号', value: 'mobile', type: 'text' }, { label: '订单状态', value: 'status', type: 'select', options: [ { label: '待审核', value: 'pedding' }, { label: '已创建', value: 'created' }, { label: '错误', value: 'error' } ] }, @@ -558,12 +558,14 @@ export const pendingAvailableFields = [ { label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] }, { label: '订单号', value: 'order_code', type: 'text' }, { label: '店铺名称', value: 'shop_nick', type: 'text' }, - { label: '来源平台', value: 'source_platform_name', type: 'text' }, - { label: '物流公司', value: 'logistics_name', type: 'text' }, + { label: '来源平台', value: 'source_platform_name', type: 'select', options: [] }, + { label: '物流公司', value: 'logistics_name', type: 'select', options: [] }, { label: '物流单号', value: 'waybill_codes', type: 'text' }, { label: '收货人', value: 'name', type: 'text' }, { label: '手机号', value: 'mobile', type: 'text' }, - { label: '省/市/区', value: 'province_city_area', type: 'text' }, + { label: '省份', value: 'province', type: 'text' }, + { label: '城市', value: 'city', type: 'text' }, + { label: '区县', value: 'area', type: 'text' }, { label: '是否紧急', value: 'is_urgency', type: 'select', options: [ { label: '是', value: 'Y' }, { label: '否', value: 'N' } ] }, { label: '同步状态', value: 'sync_status', type: 'select', options: [ { label: '待同步', value: 'padding' }, { label: '已同步', value: 'fin' }, { label: '错误', value: 'error' } ] }, { label: '下单时间', value: 'place_order_time', type: 'daterange' }, @@ -588,7 +590,7 @@ export const pendingCloums = [ { prop: 'create_at', label: '创建时间', width: '165', formatter: orderTimeFormatter }, { prop: 'pay_time', label: '支付时间', width: '160', formatter: orderTimeFormatter }, { prop: 'place_order_time', label: '时效', width: '165', formatter: orderTimeFormatter }, - { prop: 'source_platform_name', label: '来源', width: '120' }, + { prop: 'sys_platform_name', label: '来源', width: '120' }, { prop: 'logistics_name', label: '快递', width: '120' }, { prop: 'waybill_codes', label: '快递单号', width: '160', formatter: waybillCodesFormatter }, { prop: 'remark', label: '留言', width: '160' }, @@ -773,7 +775,7 @@ export const expectionOrderAvailableFields = [ { label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] }, { label: '订单号', value: 'order_code', type: 'input' }, { label: '发货单号', value: 'delivery_order_code', type: 'input' }, - { label: '物流公司', value: 'logistics_name', type: 'input' }, + { label: '物流公司', value: 'logistics_name', type: 'select', options: [] }, { label: '快递单号', value: 'express_code', type: 'input' }, { label: '拦截状态', value: 'intercept_status', type: 'select', options: [ { label: '无', value: 'none' }, diff --git a/src/views/order/orderManagement/deliveryException.vue b/src/views/order/orderManagement/deliveryException.vue index c7c77fda..a32bcd5e 100644 --- a/src/views/order/orderManagement/deliveryException.vue +++ b/src/views/order/orderManagement/deliveryException.vue @@ -225,15 +225,18 @@ function buildWhereConditions(rawConditions: Record) { const where: Record = {} Object.keys(rawConditions || {}).forEach((key) => { const condition = rawConditions[key] + const normalizedKey = key === 'order_code' ? 'delivery_order_code' : key if (condition && typeof condition === 'object' && 'operator' in condition) { - where[key] = condition + where[normalizedKey] = Array.isArray(condition.value) + ? { ...condition, value: condition.value[0] ?? '', type: 'text' } + : condition return } if (condition !== undefined && condition !== null && condition !== '') { - where[key] = { + where[normalizedKey] = { operator: 'eq', - value: condition, - type: Array.isArray(condition) ? 'array' : typeof condition + value: Array.isArray(condition) ? condition[0] ?? '' : condition, + type: 'text' } } }) diff --git a/src/views/order/orderManagement/deliveryOrder.vue b/src/views/order/orderManagement/deliveryOrder.vue index c024dc03..213403f2 100644 --- a/src/views/order/orderManagement/deliveryOrder.vue +++ b/src/views/order/orderManagement/deliveryOrder.vue @@ -157,7 +157,8 @@ import { ref, reactive, onMounted, computed } from 'vue' import { ElMessage } from 'element-plus' import ScanBox from '@/components/ScanBox/index.vue' import UpperTable from '@/components/UpperTable/index.vue' -import { orderDeliveryOrder } from '@/api/order.deliveryOrder/orderdeliveryOrder' +import * as indexApi from '@/api/index/index' +import { orderDeliveryOrder } from '@/api/order.deliveryorder/orderdeliveryOrder' import { deliveryAvailableFields, @@ -208,8 +209,48 @@ function toggleDetailVisible() { onMounted(() => { loadData() + loadOrderMetaOptions() }) +function normalizeOptionValue(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 = normalizeOptionValue(nameKeys.map((k) => item?.[k]).find((v) => v !== undefined && v !== null && v !== '')) + if (!name || seen.has(name)) continue + result.push({ label: name, value: name }) + seen.add(name) + } + return result +} + +async function loadOrderMetaOptions() { + try { + const [expressRes, platformRes] = await Promise.all([ + indexApi.getExpressList({}), + indexApi.getPlatformList({}) + ]) + const expressData: any = expressRes?.data + const platformData: any = platformRes?.data + const expressRaw = expressData?.list || expressData || [] + const platformRaw = platformData?.list || platformData || [] + + const logisticsField = availableFieldsRef.find((i: any) => i.value === 'logistics_name') + if (logisticsField) logisticsField.options = mapNameOptions(expressRaw, ['name', 'logistics_name', 'express_name']) + const platformField = availableFieldsRef.find((i: any) => i.value === 'source_platform_name') + if (platformField) platformField.options = mapNameOptions(platformRaw, ['name', 'platform_name']) + } catch { + const logisticsField = availableFieldsRef.find((i: any) => i.value === 'logistics_name') + if (logisticsField) logisticsField.options = [] + const platformField = availableFieldsRef.find((i: any) => i.value === 'source_platform_name') + if (platformField) platformField.options = [] + } +} + async function loadData() { if (loading.value) return loading.value = true @@ -257,15 +298,18 @@ function buildWhereConditions(rawConditions: Record) { const where: Record = {} Object.keys(rawConditions || {}).forEach((key) => { const condition = rawConditions[key] + const normalizedKey = key === 'order_code' ? 'delivery_order_code' : key if (condition && typeof condition === 'object' && 'operator' in condition) { - where[key] = condition + where[normalizedKey] = Array.isArray(condition.value) + ? { ...condition, value: condition.value[0] ?? '', type: 'text' } + : condition return } if (condition !== undefined && condition !== null && condition !== '') { - where[key] = { + where[normalizedKey] = { operator: 'eq', - value: condition, - type: Array.isArray(condition) ? 'array' : typeof condition + value: Array.isArray(condition) ? condition[0] ?? '' : condition, + type: 'text' } } }) diff --git a/src/views/order/orderManagement/entrustWarehouse.vue b/src/views/order/orderManagement/entrustWarehouse.vue index 897e3112..15bccfe3 100644 --- a/src/views/order/orderManagement/entrustWarehouse.vue +++ b/src/views/order/orderManagement/entrustWarehouse.vue @@ -225,15 +225,18 @@ function buildWhereConditions(rawConditions: Record) { const where: Record = {} Object.keys(rawConditions || {}).forEach((key) => { const condition = rawConditions[key] + const normalizedKey = key === 'order_code' ? 'delivery_order_code' : key if (condition && typeof condition === 'object' && 'operator' in condition) { - where[key] = condition + where[normalizedKey] = Array.isArray(condition.value) + ? { ...condition, value: condition.value[0] ?? '', type: 'text' } + : condition return } if (condition !== undefined && condition !== null && condition !== '') { - where[key] = { + where[normalizedKey] = { operator: 'eq', - value: condition, - type: Array.isArray(condition) ? 'array' : typeof condition + value: Array.isArray(condition) ? condition[0] ?? '' : condition, + type: 'text' } } }) diff --git a/src/views/order/orderManagement/exceptionOrder.vue b/src/views/order/orderManagement/exceptionOrder.vue index 9e8d16a0..f9366a21 100644 --- a/src/views/order/orderManagement/exceptionOrder.vue +++ b/src/views/order/orderManagement/exceptionOrder.vue @@ -611,6 +611,18 @@ function mapCodeOptions(rawList: any[], codeKeys: string[], nameKeys: string[]) return result } +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((k) => item?.[k]).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 getSelectedIds(): number[] { const ids: number[] = [] for (const item of selectionRows.value) { @@ -943,15 +955,18 @@ function buildWhereConditions(rawConditions: Record) { const where: Record = {} Object.keys(rawConditions || {}).forEach((key) => { const condition = rawConditions[key] + const normalizedKey = key === 'order_code' ? 'delivery_order_code' : key if (condition && typeof condition === 'object' && 'operator' in condition) { - where[key] = condition + where[normalizedKey] = Array.isArray(condition.value) + ? { ...condition, value: condition.value[0] ?? '', type: 'text' } + : condition return } if (condition !== undefined && condition !== null && condition !== '') { - where[key] = { + where[normalizedKey] = { operator: 'eq', - value: condition, - type: Array.isArray(condition) ? 'array' : typeof condition + value: Array.isArray(condition) ? condition[0] ?? '' : condition, + type: 'text' } } }) @@ -982,9 +997,15 @@ async function loadOrderMetaOptions() { const platformRaw = platformData?.list || platformData || [] expressCodeOptions.value = mapCodeOptions(expressRaw, ['code', 'logistics_code', 'express_code'], ['name', 'logistics_name', 'express_name']) platformCodeOptions.value = mapCodeOptions(platformRaw, ['code', 'platform_code'], ['name', 'platform_name']) + const logisticsField = availableFieldsRef.find((i: any) => i.value === 'logistics_name') + if (logisticsField) { + logisticsField.options = mapNameOptions(expressRaw, ['name', 'logistics_name', 'express_name']) + } } catch { expressCodeOptions.value = [] platformCodeOptions.value = [] + const logisticsField = availableFieldsRef.find((i: any) => i.value === 'logistics_name') + if (logisticsField) logisticsField.options = [] } } diff --git a/src/views/order/orderManagement/outboundOrder.vue b/src/views/order/orderManagement/outboundOrder.vue index 4f780cce..f9c0ad39 100644 --- a/src/views/order/orderManagement/outboundOrder.vue +++ b/src/views/order/orderManagement/outboundOrder.vue @@ -169,6 +169,7 @@ import { computed, nextTick, onMounted, reactive, ref } from 'vue' import { ElMessage } from 'element-plus' import ScanBox from '@/components/ScanBox/index.vue' import UpperTable from '@/components/UpperTable/index.vue' +import * as indexApi from '@/api/index/index' import { orderOutboundOrder } from '@/api/order.outboundorder/orderoutboundOrder' import { outboundAvailableFields, @@ -246,15 +247,18 @@ function buildWhereConditions(rawConditions: Record) { const where: Record = {} Object.keys(rawConditions || {}).forEach((key) => { const condition = rawConditions[key] + const normalizedKey = key === 'order_code' ? 'delivery_order_code' : key if (condition && typeof condition === 'object' && 'operator' in condition) { - where[key] = condition + where[normalizedKey] = Array.isArray(condition.value) + ? { ...condition, value: condition.value[0] ?? '', type: 'text' } + : condition return } if (condition !== undefined && condition !== null && condition !== '') { - where[key] = { + where[normalizedKey] = { operator: 'eq', - value: condition, - type: Array.isArray(condition) ? 'array' : typeof condition + value: Array.isArray(condition) ? condition[0] ?? '' : condition, + type: 'text' } } }) @@ -382,7 +386,47 @@ function openColumnConfigPanel() { onMounted(() => { loadData() + loadOrderMetaOptions() }) + +function normalizeOptionValue(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 = normalizeOptionValue(nameKeys.map((k) => item?.[k]).find((v) => v !== undefined && v !== null && v !== '')) + if (!name || seen.has(name)) continue + result.push({ label: name, value: name }) + seen.add(name) + } + return result +} + +async function loadOrderMetaOptions() { + try { + const [expressRes, platformRes] = await Promise.all([ + indexApi.getExpressList({}), + indexApi.getPlatformList({}) + ]) + const expressData: any = expressRes?.data + const platformData: any = platformRes?.data + const expressRaw = expressData?.list || expressData || [] + const platformRaw = platformData?.list || platformData || [] + + const logisticsField = availableFieldsRef.find((i: any) => i.value === 'logistics_name') + if (logisticsField) logisticsField.options = mapNameOptions(expressRaw, ['name', 'logistics_name', 'express_name']) + const platformField = availableFieldsRef.find((i: any) => i.value === 'source_platform_name') + if (platformField) platformField.options = mapNameOptions(platformRaw, ['name', 'platform_name']) + } catch { + const logisticsField = availableFieldsRef.find((i: any) => i.value === 'logistics_name') + if (logisticsField) logisticsField.options = [] + const platformField = availableFieldsRef.find((i: any) => i.value === 'source_platform_name') + if (platformField) platformField.options = [] + } +} \ No newline at end of file diff --git a/src/views/warehouse/ZoneManagement.vue b/src/views/warehouse/ZoneManagement.vue index 52c3a601..f98d871a 100644 --- a/src/views/warehouse/ZoneManagement.vue +++ b/src/views/warehouse/ZoneManagement.vue @@ -84,18 +84,22 @@ function getZoneTypeText(type: string) { return zoneTypeMap[type]?.text || type \ No newline at end of file diff --git a/src/views/warehouse/components/RackBulkModifyDialog.vue b/src/views/warehouse/components/RackBulkModifyDialog.vue index 84bfdd29..935dae4f 100644 --- a/src/views/warehouse/components/RackBulkModifyDialog.vue +++ b/src/views/warehouse/components/RackBulkModifyDialog.vue @@ -4,6 +4,7 @@ title="导入批量修改" width="1000px" top="calc(50% - 250px)" + align-center :close-on-click-modal="false" destroy-on-close append-to-body @@ -27,62 +28,70 @@ 错误: {{ errorCount }}
-
- - - - +
+
+
+
仓位编码
+
自定义名称
+
自定义条码
+
拣货顺序
+
库位类型
+
错误
+
操作
+
- - - + +