Compare commits
No commits in common. "b30cb15793e7090c554630016c55d7d0669eb1f1" and "4269253dc3713aa5377392a27941a08f1a4d569f" have entirely different histories.
b30cb15793
...
4269253dc3
@ -110,25 +110,6 @@ export type PendingOrderAllocateStorageParams = {
|
|||||||
id?: number | string;
|
id?: number | string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type PendingOrderAllocateStorageProgressParams = {
|
|
||||||
request_id?: string;
|
|
||||||
requestId?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type PendingOrderAllocateStorageProgressResponse = {
|
|
||||||
request_id?: string;
|
|
||||||
status?: string;
|
|
||||||
progress_percent?: number;
|
|
||||||
total_count?: number;
|
|
||||||
success_count?: number;
|
|
||||||
failed_count?: number;
|
|
||||||
updated_count?: number;
|
|
||||||
error?: string;
|
|
||||||
message?: string;
|
|
||||||
update_time?: string;
|
|
||||||
result?: Record<string, any>;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type PendingOrderSyncOrderIdsParams = {
|
export type PendingOrderSyncOrderIdsParams = {
|
||||||
order_ids?: Array<number | string> | string | number;
|
order_ids?: Array<number | string> | string | number;
|
||||||
orderIds?: Array<number | string> | string | number;
|
orderIds?: Array<number | string> | string | number;
|
||||||
@ -260,22 +241,6 @@ export function orderPendingOrderCancelAllocateStorage(
|
|||||||
} as any);
|
} as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function orderPendingOrderAllocateStorageProgress(
|
|
||||||
data: PendingOrderAllocateStorageProgressParams,
|
|
||||||
): Promise<PendingOrderAllocateStorageProgressResponse & { code?: number; message?: string; flag?: string; data?: any }> {
|
|
||||||
return request({
|
|
||||||
url: "/system",
|
|
||||||
method: "post",
|
|
||||||
params: {
|
|
||||||
method: "order.pendingOrder.allocateStorageProgress",
|
|
||||||
v,
|
|
||||||
timestamp: Date.now(),
|
|
||||||
},
|
|
||||||
data,
|
|
||||||
isSystemApi: true,
|
|
||||||
} as any);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function orderPendingOrderSyncOrderIds(
|
export function orderPendingOrderSyncOrderIds(
|
||||||
data: PendingOrderSyncOrderIdsParams,
|
data: PendingOrderSyncOrderIdsParams,
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
@ -390,7 +355,6 @@ export const orderPendingOrder = {
|
|||||||
cancelOrder: orderPendingOrderCancelOrder,
|
cancelOrder: orderPendingOrderCancelOrder,
|
||||||
allocateExpressCode: orderPendingOrderAllocateExpressCode,
|
allocateExpressCode: orderPendingOrderAllocateExpressCode,
|
||||||
allocateStorage: orderPendingOrderAllocateStorage,
|
allocateStorage: orderPendingOrderAllocateStorage,
|
||||||
allocateStorageProgress: orderPendingOrderAllocateStorageProgress,
|
|
||||||
cancelAllocateStorage: orderPendingOrderCancelAllocateStorage,
|
cancelAllocateStorage: orderPendingOrderCancelAllocateStorage,
|
||||||
syncOrderIds: orderPendingOrderSyncOrderIds,
|
syncOrderIds: orderPendingOrderSyncOrderIds,
|
||||||
updateOrderPlatform: orderPendingOrderUpdateOrderPlatform,
|
updateOrderPlatform: orderPendingOrderUpdateOrderPlatform,
|
||||||
|
|||||||
@ -1,198 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
const v = '1.0'
|
|
||||||
|
|
||||||
export type WaveBatchListParams = {
|
|
||||||
pagination?: {
|
|
||||||
page?: number
|
|
||||||
pageSize?: number
|
|
||||||
}
|
|
||||||
where?: Record<string, any>
|
|
||||||
}
|
|
||||||
|
|
||||||
export type WaveGroupOrderFetchListParams = {
|
|
||||||
pagination?: {
|
|
||||||
page?: number
|
|
||||||
pageSize?: number
|
|
||||||
}
|
|
||||||
distinguish_express?: boolean
|
|
||||||
store_id?: number
|
|
||||||
same_order_quantity?: number
|
|
||||||
shop_name?: string
|
|
||||||
include_sku?: string
|
|
||||||
return_order_ids?: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
export type WaveFetchParams = {
|
|
||||||
structure_list: Array<{
|
|
||||||
item_detail_machine: string
|
|
||||||
quantity?: number
|
|
||||||
}>
|
|
||||||
}
|
|
||||||
|
|
||||||
export type WaveFetchResponse = {
|
|
||||||
task_id: string
|
|
||||||
warehouse_id: number
|
|
||||||
structure_count: number
|
|
||||||
default_quantity: number
|
|
||||||
auto_fetch_disabled_marker: string
|
|
||||||
message?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export type WaveFetchTaskProgressParams = {
|
|
||||||
task_id?: string
|
|
||||||
taskId?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export type WaveFetchTaskProgressResponse = {
|
|
||||||
task_id: string
|
|
||||||
status: 'submitted' | 'running' | 'success' | 'failed' | 'not_found'
|
|
||||||
warehouse_id?: number
|
|
||||||
structure_count?: number
|
|
||||||
finished_structure_count?: number
|
|
||||||
progress_percent?: number
|
|
||||||
total_fetched_quantity?: number
|
|
||||||
duration_ms?: number
|
|
||||||
error?: string
|
|
||||||
update_time?: string
|
|
||||||
message?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export type WaveBatchCancelParams = {
|
|
||||||
ids: Array<string | number> | string | number
|
|
||||||
}
|
|
||||||
|
|
||||||
export type WaveBatchAutoGroupingParams = {
|
|
||||||
ids: Array<string | number> | string | number
|
|
||||||
}
|
|
||||||
|
|
||||||
export type WaveBatchFinishAutoGroupingParams = {
|
|
||||||
ids: Array<string | number> | string | number
|
|
||||||
}
|
|
||||||
|
|
||||||
export type WaveBatchRemoveOrdersParams = {
|
|
||||||
ids: Array<string | number> | string | number
|
|
||||||
}
|
|
||||||
|
|
||||||
export function orderWaveBatchList(data: WaveBatchListParams = {}): Promise<any> {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'order.wave.batchList',
|
|
||||||
v,
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data,
|
|
||||||
isSystemApi: true
|
|
||||||
} as any)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function orderWaveGroupOrderFetchList(data: WaveGroupOrderFetchListParams = {}): Promise<any> {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'order.wave.groupOrderFetchList',
|
|
||||||
v,
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data,
|
|
||||||
isSystemApi: true
|
|
||||||
} as any)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function orderWaveFetch(data: WaveFetchParams): Promise<WaveFetchResponse & { code?: number; message?: string }> {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'order.wave.fetch',
|
|
||||||
v,
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data,
|
|
||||||
isSystemApi: true
|
|
||||||
} as any)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function orderWaveFetchTaskProgress(data: WaveFetchTaskProgressParams): Promise<WaveFetchTaskProgressResponse & { code?: number; message?: string }> {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'order.wave.fetchTaskProgress',
|
|
||||||
v,
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data,
|
|
||||||
isSystemApi: true
|
|
||||||
} as any)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function orderWaveBatchCancel(data: WaveBatchCancelParams): Promise<any> {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'order.wave.batchCancel',
|
|
||||||
v,
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data,
|
|
||||||
isSystemApi: true
|
|
||||||
} as any)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function orderWaveBatchAutoGrouping(data: WaveBatchAutoGroupingParams): Promise<any> {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'order.wave.batchAutoGrouping',
|
|
||||||
v,
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data,
|
|
||||||
isSystemApi: true
|
|
||||||
} as any)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function orderWaveBatchFinishAutoGrouping(data: WaveBatchFinishAutoGroupingParams): Promise<any> {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'order.wave.batchFinishAutoGrouping',
|
|
||||||
v,
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data,
|
|
||||||
isSystemApi: true
|
|
||||||
} as any)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function orderWaveBatchRemoveOrders(data: WaveBatchRemoveOrdersParams): Promise<any> {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'order.wave.batchRemoveOrders',
|
|
||||||
v,
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data,
|
|
||||||
isSystemApi: true
|
|
||||||
} as any)
|
|
||||||
}
|
|
||||||
|
|
||||||
export const orderWave = {
|
|
||||||
batchList: orderWaveBatchList,
|
|
||||||
groupOrderFetchList: orderWaveGroupOrderFetchList,
|
|
||||||
fetch: orderWaveFetch,
|
|
||||||
fetchTaskProgress: orderWaveFetchTaskProgress,
|
|
||||||
batchCancel: orderWaveBatchCancel,
|
|
||||||
batchAutoGrouping: orderWaveBatchAutoGrouping,
|
|
||||||
batchFinishAutoGrouping: orderWaveBatchFinishAutoGrouping,
|
|
||||||
batchRemoveOrders: orderWaveBatchRemoveOrders
|
|
||||||
}
|
|
||||||
@ -16,20 +16,6 @@ export function getWarehouseZones(data:any) {
|
|||||||
} as any)
|
} as any)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getSettings(data:any = {}) {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'setting.warehouse.getSettings',
|
|
||||||
v: '1.0',
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data,
|
|
||||||
isSystemApi: true
|
|
||||||
} as any)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getWarehouseTree(warehouseId:any) {
|
export function getWarehouseTree(warehouseId:any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system',
|
url: '/system',
|
||||||
|
|||||||
@ -88,24 +88,6 @@
|
|||||||
<template v-if="column.formatter">
|
<template v-if="column.formatter">
|
||||||
<span v-html="column.formatter(scope.row, scope.column, scope.row[scope.column.property], scope.$index)"></span>
|
<span v-html="column.formatter(scope.row, scope.column, scope.row[scope.column.property], scope.$index)"></span>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="column.prop === 'order_flag'">
|
|
||||||
<el-tooltip
|
|
||||||
:content="getOrderFlagFullText(scope.row[column.prop])"
|
|
||||||
placement="top"
|
|
||||||
:disabled="!getOrderFlagFullText(scope.row[column.prop])"
|
|
||||||
:show-after="400"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
:class="getDefaultCellTextClass(column.prop, scope.row[column.prop])"
|
|
||||||
role="button"
|
|
||||||
tabindex="0"
|
|
||||||
@click.stop="copyOrderFlagText(scope.row[column.prop])"
|
|
||||||
@keydown.enter.prevent="copyOrderFlagText(scope.row[column.prop])"
|
|
||||||
>
|
|
||||||
{{ getOrderFlagCellText(scope.row[column.prop]) }}
|
|
||||||
</span>
|
|
||||||
</el-tooltip>
|
|
||||||
</template>
|
|
||||||
<template v-else-if="column.template">
|
<template v-else-if="column.template">
|
||||||
<component
|
<component
|
||||||
:is="column.template"
|
:is="column.template"
|
||||||
@ -124,7 +106,7 @@
|
|||||||
preview-teleported
|
preview-teleported
|
||||||
></el-image>
|
></el-image>
|
||||||
</template>
|
</template>
|
||||||
<span v-else :class="getDefaultCellTextClass(column.prop, scope.row[column.prop])">{{ scope.row[column.prop] }}</span>
|
<span v-else>{{ scope.row[column.prop] }}</span>
|
||||||
</slot>
|
</slot>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
@ -498,7 +480,8 @@ const displayColumns = computed(() => {
|
|||||||
return {
|
return {
|
||||||
...column,
|
...column,
|
||||||
width: cfg.width ?? column.width,
|
width: cfg.width ?? column.width,
|
||||||
fixed: cfg.fixed === false ? undefined : (cfg.fixed ?? column.fixed)
|
// 在字段设置模式下,以用户排序为最高优先级,避免 fixed 导致“置顶”不生效
|
||||||
|
fixed: undefined
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -713,56 +696,6 @@ function rebuildColumnConfig() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDefaultCellTextClass(prop: string | undefined, value: unknown) {
|
|
||||||
if (prop === 'order_flag' && value !== undefined && value !== null && String(value).trim() !== '') {
|
|
||||||
return 'order-flag-text order-flag-copyable'
|
|
||||||
}
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
|
|
||||||
function getOrderFlagFullText(value: unknown) {
|
|
||||||
if (value == null) return ''
|
|
||||||
return String(value).trim()
|
|
||||||
}
|
|
||||||
|
|
||||||
function getOrderFlagCellText(value: unknown) {
|
|
||||||
const text = getOrderFlagFullText(value)
|
|
||||||
if (!text) return '—'
|
|
||||||
const max = 48
|
|
||||||
return text.length > max ? `${text.slice(0, max)}…` : text
|
|
||||||
}
|
|
||||||
|
|
||||||
async function copyOrderFlagText(value: unknown) {
|
|
||||||
const text = getOrderFlagFullText(value)
|
|
||||||
if (!text) {
|
|
||||||
ElMessage.warning('当前行无订单标记可复制')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
if (navigator.clipboard?.writeText) {
|
|
||||||
await navigator.clipboard.writeText(text)
|
|
||||||
} else {
|
|
||||||
throw new Error('no clipboard api')
|
|
||||||
}
|
|
||||||
ElMessage.success('订单标记已复制到剪贴板')
|
|
||||||
} catch {
|
|
||||||
try {
|
|
||||||
const textarea = document.createElement('textarea')
|
|
||||||
textarea.value = text
|
|
||||||
textarea.setAttribute('readonly', 'readonly')
|
|
||||||
textarea.style.position = 'fixed'
|
|
||||||
textarea.style.left = '-9999px'
|
|
||||||
document.body.appendChild(textarea)
|
|
||||||
textarea.select()
|
|
||||||
document.execCommand('copy')
|
|
||||||
document.body.removeChild(textarea)
|
|
||||||
ElMessage.success('订单标记已复制到剪贴板')
|
|
||||||
} catch {
|
|
||||||
ElMessage.error('复制失败,请手动复制')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function persistEditableConfigs() {
|
function persistEditableConfigs() {
|
||||||
const normalized = [...editableColumnConfigs.value]
|
const normalized = [...editableColumnConfigs.value]
|
||||||
.sort((a, b) => a.order - b.order)
|
.sort((a, b) => a.order - b.order)
|
||||||
@ -1438,15 +1371,6 @@ watch(
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-flag-text {
|
|
||||||
color: #f56c6c;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.order-flag-copyable {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 表格尺寸样式 */
|
/* 表格尺寸样式 */
|
||||||
.upper-table-container.small :deep(.el-table) {
|
.upper-table-container.small :deep(.el-table) {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
|||||||
@ -3,12 +3,9 @@ export const componentMap: Record<string, any> = {
|
|||||||
'login/index': () => import('@/views/login/index.vue'),
|
'login/index': () => import('@/views/login/index.vue'),
|
||||||
'system/setting/permission/index': () => import('@/views/system/setting/permission/index.vue'),
|
'system/setting/permission/index': () => import('@/views/system/setting/permission/index.vue'),
|
||||||
'system/setting/index': () => import('@/views/system/setting/index.vue'),
|
'system/setting/index': () => import('@/views/system/setting/index.vue'),
|
||||||
'system/setting/index': () => import('@/views/system/setting/index.vue'),
|
|
||||||
'order/index': () => import('@/views/order/orderManagement/index.vue'),
|
'order/index': () => import('@/views/order/orderManagement/index.vue'),
|
||||||
/** 与后端菜单 component 字段兼容:部分环境为 order/setting */
|
/** 与后端菜单 component 字段兼容:部分环境为 order/setting */
|
||||||
'order/setting': () => import('@/views/order/orderManagement/index.vue'),
|
'order/setting': () => import('@/views/order/orderManagement/index.vue'),
|
||||||
/** 与后端菜单 component 字段兼容:部分环境为 order/setting */
|
|
||||||
'order/setting': () => import('@/views/order/orderManagement/index.vue'),
|
|
||||||
'auth/approve': () => import('@/views/auth/approve.vue'),
|
'auth/approve': () => import('@/views/auth/approve.vue'),
|
||||||
'account/index': () => import('@/views/system/setting/account/index.vue'),
|
'account/index': () => import('@/views/system/setting/account/index.vue'),
|
||||||
// 'permission/index': () => import('@/views/system/setting/permission/index.vue'),
|
// 'permission/index': () => import('@/views/system/setting/permission/index.vue'),
|
||||||
@ -21,9 +18,6 @@ export const componentMap: Record<string, any> = {
|
|||||||
'storage/inventory': () => import('@/views/storage/inventory/index.vue'),
|
'storage/inventory': () => import('@/views/storage/inventory/index.vue'),
|
||||||
'storage/stockout': () => import('@/views/storage/stockout/index.vue'),
|
'storage/stockout': () => import('@/views/storage/stockout/index.vue'),
|
||||||
'store/index': () => import('@/views/store/index.vue'),
|
'store/index': () => import('@/views/store/index.vue'),
|
||||||
'wave/index': () => import('@/views/wave/index.vue'),
|
|
||||||
'role/index': () => import('@/views/system/setting/role/index.vue'),
|
|
||||||
'system/setting/role/index': () => import('@/views/system/setting/role/index.vue'),
|
|
||||||
'role/index': () => import('@/views/system/setting/role/index.vue'),
|
'role/index': () => import('@/views/system/setting/role/index.vue'),
|
||||||
'system/setting/role/index': () => import('@/views/system/setting/role/index.vue'),
|
'system/setting/role/index': () => import('@/views/system/setting/role/index.vue'),
|
||||||
'system/setting/printTemplate/index': () => import('@/views/system/setting/printTemplate/index.vue'),
|
'system/setting/printTemplate/index': () => import('@/views/system/setting/printTemplate/index.vue'),
|
||||||
|
|||||||
@ -64,7 +64,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { orderPendingOrder } from '@/api/order.pendingOrder/orderpendingOrder'
|
import { orderPendingOrder } from '@/api/order.pendingorder/orderpendingOrder'
|
||||||
|
|
||||||
const visible = defineModel<boolean>({ default: false })
|
const visible = defineModel<boolean>({ default: false })
|
||||||
|
|
||||||
|
|||||||
@ -318,8 +318,8 @@ import { ElMessage } from 'element-plus'
|
|||||||
import type { FormInstance, FormRules } from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
import * as indexApi from '@/api/index/index'
|
import * as indexApi from '@/api/index/index'
|
||||||
import { stockWarehouse } from '@/api/stock/stock'
|
import { stockWarehouse } from '@/api/stock/stock'
|
||||||
import { orderPendingOrder } from '@/api/order.pendingOrder/orderpendingOrder'
|
import { orderPendingOrder } from '@/api/order.pendingorder/orderpendingOrder'
|
||||||
import type { PendingOrderCreateOrderParams } from '@/api/order.pendingOrder/orderpendingOrder'
|
import type { PendingOrderCreateOrderParams } from '@/api/order.pendingorder/orderpendingOrder'
|
||||||
import pcasCodeData from 'china-division/dist/pcas-code.json'
|
import pcasCodeData from 'china-division/dist/pcas-code.json'
|
||||||
|
|
||||||
const visible = defineModel<boolean>({ default: false })
|
const visible = defineModel<boolean>({ default: false })
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { orderPendingOrder } from '@/api/order.pendingOrder/orderpendingOrder'
|
import { orderPendingOrder } from '@/api/order.pendingorder/orderpendingOrder'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
row: Record<string, any> | null
|
row: Record<string, any> | null
|
||||||
|
|||||||
@ -41,7 +41,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { orderOutboundOrder } from '@/api/order.outboundOrder/orderoutboundOrder'
|
import { orderOutboundOrder } from '@/api/order.outboundorder/orderoutboundOrder'
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'success', data: any): void
|
(e: 'success', data: any): void
|
||||||
|
|||||||
@ -80,7 +80,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { orderPendingOrder } from '@/api/order.pendingOrder/orderpendingOrder'
|
import { orderPendingOrder } from '@/api/order.pendingorder/orderpendingOrder'
|
||||||
import { getTagType, translateOrderField } from '../config/order-common-config'
|
import { getTagType, translateOrderField } from '../config/order-common-config'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
|||||||
@ -27,8 +27,7 @@ export const COMMON_TRANSLATIONS: Record<string, Record<string, string>> = {
|
|||||||
storage_status: {
|
storage_status: {
|
||||||
'none': '未分配',
|
'none': '未分配',
|
||||||
'padding': '分配中',
|
'padding': '分配中',
|
||||||
'fin': '已完成',
|
'fin': '已完成'
|
||||||
'error': '错误'
|
|
||||||
},
|
},
|
||||||
print_status: {
|
print_status: {
|
||||||
'none': '未打印',
|
'none': '未打印',
|
||||||
@ -130,8 +129,7 @@ export const COMMON_TAG_TYPES: Record<string, Record<string, string>> = {
|
|||||||
'none': 'info',
|
'none': 'info',
|
||||||
'padding': 'warning',
|
'padding': 'warning',
|
||||||
'pending': 'warning',
|
'pending': 'warning',
|
||||||
'fin': 'success',
|
'fin': 'success'
|
||||||
'error': 'danger'
|
|
||||||
},
|
},
|
||||||
print_status: {
|
print_status: {
|
||||||
'none': 'info',
|
'none': 'info',
|
||||||
@ -402,7 +400,6 @@ export const simpleListToolbarButtons = pickToolbarButtons(simpleListToolbarButt
|
|||||||
export const deliveryAvailableFields = [
|
export const deliveryAvailableFields = [
|
||||||
{ label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] },
|
{ label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] },
|
||||||
{ label: '订单号', value: 'delivery_order_code', type: 'text' },
|
{ label: '订单号', value: 'delivery_order_code', type: 'text' },
|
||||||
{ label: '波次号', value: 'wave_no', type: 'text' },
|
|
||||||
{ label: '店铺名称', value: 'shop_nick', type: 'text' },
|
{ label: '店铺名称', value: 'shop_nick', type: 'text' },
|
||||||
{ label: '来源平台', value: 'sys_platform_name', type: 'select', options: [] },
|
{ label: '来源平台', value: 'sys_platform_name', type: 'select', options: [] },
|
||||||
{ label: '收货人', value: 'name', type: 'text' },
|
{ label: '收货人', value: 'name', type: 'text' },
|
||||||
@ -430,8 +427,6 @@ export const deliveryAvailableFields = [
|
|||||||
export const deliveryColumns = [
|
export const deliveryColumns = [
|
||||||
{ prop: 'shop_nick', label: '店铺名称', width: '140' },
|
{ prop: 'shop_nick', label: '店铺名称', width: '140' },
|
||||||
{ prop: 'delivery_order_code', label: '配送单号', width: '170' },
|
{ prop: 'delivery_order_code', label: '配送单号', width: '170' },
|
||||||
{ prop: 'wave_no', label: '波次号', width: '170' },
|
|
||||||
{ prop: 'order_flag', label: '订单标记', minWidth: '260' },
|
|
||||||
{ prop: 'sys_platform_code', label: '平台来源', width: '100' },
|
{ prop: 'sys_platform_code', label: '平台来源', width: '100' },
|
||||||
{ prop: 'name', label: '收货人', width: '100' },
|
{ prop: 'name', label: '收货人', width: '100' },
|
||||||
{ prop: 'mobile', label: '手机号', width: '120' },
|
{ prop: 'mobile', label: '手机号', width: '120' },
|
||||||
@ -501,7 +496,6 @@ export const deliveryOrderToolbarButtons = simpleListToolbarButtons
|
|||||||
// revieworder相关配置
|
// revieworder相关配置
|
||||||
export const reviewAvailableFields = [
|
export const reviewAvailableFields = [
|
||||||
{ label: '发货单号', value: 'delivery_order_code', type: 'text' },
|
{ label: '发货单号', value: 'delivery_order_code', type: 'text' },
|
||||||
{ label: '波次号', value: 'wave_no', type: 'text' },
|
|
||||||
{ label: '店铺名称', value: 'shop_nick', type: 'text' },
|
{ label: '店铺名称', value: 'shop_nick', type: 'text' },
|
||||||
{ label: '平台编码', value: 'sys_platform_code', type: 'select', options: [] },
|
{ label: '平台编码', value: 'sys_platform_code', type: 'select', options: [] },
|
||||||
{ label: '收货人', value: 'name', type: 'text' },
|
{ label: '收货人', value: 'name', type: 'text' },
|
||||||
@ -514,8 +508,6 @@ export const reviewAvailableFields = [
|
|||||||
|
|
||||||
export const reviewColums = [
|
export const reviewColums = [
|
||||||
{ prop: 'delivery_order_code', label: '发货单号', width: '170' },
|
{ prop: 'delivery_order_code', label: '发货单号', width: '170' },
|
||||||
{ prop: 'wave_no', label: '波次号', width: '170' },
|
|
||||||
{ prop: 'order_flag', label: '订单标记', minWidth: '260' },
|
|
||||||
{ prop: 'shop_nick', label: '店铺名称', width: '140' },
|
{ prop: 'shop_nick', label: '店铺名称', width: '140' },
|
||||||
{ prop: 'sys_platform_code', label: '平台编码', width: '100' },
|
{ prop: 'sys_platform_code', label: '平台编码', width: '100' },
|
||||||
{ prop: 'name', label: '收货人', width: '110' },
|
{ prop: 'name', label: '收货人', width: '110' },
|
||||||
@ -634,7 +626,6 @@ export const outboundToolbarButtons = pickToolbarButtons(outboundToolbarButtonKe
|
|||||||
export const pendingAvailableFields = [
|
export const pendingAvailableFields = [
|
||||||
{ label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] },
|
{ label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] },
|
||||||
{ label: '订单号', value: 'order_code', type: 'text' },
|
{ label: '订单号', value: 'order_code', type: 'text' },
|
||||||
{ label: '波次号', value: 'wave_no', type: 'text' },
|
|
||||||
{ label: '店铺名称', value: 'shop_nick', type: 'text' },
|
{ label: '店铺名称', value: 'shop_nick', type: 'text' },
|
||||||
{ label: '来源平台', value: 'sys_platform_name', type: 'select', options: [] },
|
{ label: '来源平台', value: 'sys_platform_name', type: 'select', options: [] },
|
||||||
{ label: '物流公司', value: 'logistics_name', type: 'select', options: [] },
|
{ label: '物流公司', value: 'logistics_name', type: 'select', options: [] },
|
||||||
@ -652,8 +643,6 @@ export const pendingAvailableFields = [
|
|||||||
|
|
||||||
export const pendingCloums = [
|
export const pendingCloums = [
|
||||||
{ prop: 'delivery_order_code', label: '发货单号', width: '170' },
|
{ prop: 'delivery_order_code', label: '发货单号', width: '170' },
|
||||||
{ prop: 'wave_no', label: '波次号', width: '170' },
|
|
||||||
{ prop: 'order_flag', label: '订单标记', minWidth: '260' },
|
|
||||||
{ prop: 'shop_nick', label: '店铺名称', width: '140' },
|
{ prop: 'shop_nick', label: '店铺名称', width: '140' },
|
||||||
{ prop: 'name', label: '收件人', width: '110' },
|
{ prop: 'name', label: '收件人', width: '110' },
|
||||||
{ prop: 'mobile', label: '电话', width: '120' },
|
{ prop: 'mobile', label: '电话', width: '120' },
|
||||||
@ -818,7 +807,6 @@ export const workbenchStatusOptions = [
|
|||||||
|
|
||||||
export const workbenchAvailableFields = [
|
export const workbenchAvailableFields = [
|
||||||
{ label: '订单号', value: 'delivery_order_code', type: 'text' },
|
{ label: '订单号', value: 'delivery_order_code', type: 'text' },
|
||||||
{ label: '波次号', value: 'wave_no', type: 'text' },
|
|
||||||
{ label: '买家昵称', value: 'buyer_nick', type: 'text' },
|
{ label: '买家昵称', value: 'buyer_nick', type: 'text' },
|
||||||
{ label: '订单状态', value: 'status', type: 'select', options: workbenchStatusOptions },
|
{ label: '订单状态', value: 'status', type: 'select', options: workbenchStatusOptions },
|
||||||
{ label: '是否紧急', value: 'is_urgency', type: 'select', options: [ { label: '是', value: 'Y' }, { label: '否', value: 'N' } ] }
|
{ label: '是否紧急', value: 'is_urgency', type: 'select', options: [ { label: '是', value: 'Y' }, { label: '否', value: 'N' } ] }
|
||||||
@ -826,8 +814,6 @@ export const workbenchAvailableFields = [
|
|||||||
|
|
||||||
export const workbenchColumns = [
|
export const workbenchColumns = [
|
||||||
{ prop: 'delivery_order_code', label: '订单号', minWidth: 160 },
|
{ prop: 'delivery_order_code', label: '订单号', minWidth: 160 },
|
||||||
{ prop: 'wave_no', label: '波次号', minWidth: 160 },
|
|
||||||
{ prop: 'order_flag', label: '订单标记', minWidth: 260 },
|
|
||||||
{ prop: 'sys_platform_name', label: '平台', minWidth: 120 },
|
{ prop: 'sys_platform_name', label: '平台', minWidth: 120 },
|
||||||
{ prop: 'shop_nick', label: '店铺名称', minWidth: 140 },
|
{ prop: 'shop_nick', label: '店铺名称', minWidth: 140 },
|
||||||
{ prop: 'buyer_nick', label: '买家昵称', minWidth: 140 },
|
{ prop: 'buyer_nick', label: '买家昵称', minWidth: 140 },
|
||||||
@ -868,7 +854,6 @@ export const expectionOrderAvailableFields = [
|
|||||||
{ label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] },
|
{ label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] },
|
||||||
{ label: '订单号', value: 'order_code', type: 'text' },
|
{ label: '订单号', value: 'order_code', type: 'text' },
|
||||||
{ label: '发货单号', value: 'delivery_order_code', type: 'text' },
|
{ label: '发货单号', value: 'delivery_order_code', type: 'text' },
|
||||||
{ label: '波次号', value: 'wave_no', type: 'text' },
|
|
||||||
{ label: '物流公司', value: 'logistics_name', type: 'select', options: [] },
|
{ label: '物流公司', value: 'logistics_name', type: 'select', options: [] },
|
||||||
{ label: '快递单号', value: 'express_code', type: 'text' },
|
{ label: '快递单号', value: 'express_code', type: 'text' },
|
||||||
{ label: '拦截状态', value: 'intercept_status', type: 'select', options: [
|
{ label: '拦截状态', value: 'intercept_status', type: 'select', options: [
|
||||||
@ -881,7 +866,6 @@ export const expectionOrderAvailableFields = [
|
|||||||
|
|
||||||
export const expectionColumns = [
|
export const expectionColumns = [
|
||||||
{ prop: 'delivery_order_code', label: '发货单号', width: '170' },
|
{ prop: 'delivery_order_code', label: '发货单号', width: '170' },
|
||||||
{ prop: 'wave_no', label: '波次号', width: '170' },
|
|
||||||
{ prop: 'sys_platform_name', label: '来源平台', width: '120' },
|
{ prop: 'sys_platform_name', label: '来源平台', width: '120' },
|
||||||
{ prop: 'shop_nick', label: '店铺名称', width: '140' },
|
{ prop: 'shop_nick', label: '店铺名称', width: '140' },
|
||||||
{ prop: 'is_urgency', label: '是否紧急', width: '100' },
|
{ prop: 'is_urgency', label: '是否紧急', width: '100' },
|
||||||
@ -962,7 +946,6 @@ export const archiveAvailableFields = [
|
|||||||
{ label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] },
|
{ label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] },
|
||||||
{ label: '订单号', value: 'order_code', type: 'text' },
|
{ label: '订单号', value: 'order_code', type: 'text' },
|
||||||
{ label: '发货单号', value: 'delivery_order_code', type: 'text' },
|
{ label: '发货单号', value: 'delivery_order_code', type: 'text' },
|
||||||
{ label: '波次号', value: 'wave_no', type: 'text' },
|
|
||||||
{ label: '店铺名称', value: 'shop_nick', type: 'text' },
|
{ label: '店铺名称', value: 'shop_nick', type: 'text' },
|
||||||
{ label: '收货人', value: 'name', type: 'text' },
|
{ label: '收货人', value: 'name', type: 'text' },
|
||||||
{ label: '手机号', value: 'mobile', type: 'text' },
|
{ label: '手机号', value: 'mobile', type: 'text' },
|
||||||
@ -979,8 +962,6 @@ export const archiveColumns = [
|
|||||||
{ prop: 'id', label: 'ID', width: '80' },
|
{ prop: 'id', label: 'ID', width: '80' },
|
||||||
{ prop: 'order_code', label: '订单号', width: '180' },
|
{ prop: 'order_code', label: '订单号', width: '180' },
|
||||||
{ prop: 'delivery_order_code', label: '发货单号', width: '160' },
|
{ prop: 'delivery_order_code', label: '发货单号', width: '160' },
|
||||||
{ prop: 'wave_no', label: '波次号', width: '160' },
|
|
||||||
{ prop: 'order_flag', label: '订单标记', minWidth: '260' },
|
|
||||||
{ prop: 'shop_nick', label: '店铺名称', width: '140' },
|
{ prop: 'shop_nick', label: '店铺名称', width: '140' },
|
||||||
{ prop: 'name', label: '收货人', width: '120' },
|
{ prop: 'name', label: '收货人', width: '120' },
|
||||||
{ prop: 'mobile', label: '手机号', width: '120' },
|
{ prop: 'mobile', label: '手机号', width: '120' },
|
||||||
|
|||||||
@ -166,7 +166,7 @@ import { ElMessage } from 'element-plus'
|
|||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
import * as indexApi from '@/api/index/index'
|
import * as indexApi from '@/api/index/index'
|
||||||
import { orderDeliveryOrder } from '@/api/order.deliveryOrder/orderdeliveryOrder'
|
import { orderDeliveryOrder } from '@/api/order.deliveryorder/orderdeliveryOrder'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
deliveryAvailableFields,
|
deliveryAvailableFields,
|
||||||
|
|||||||
@ -196,13 +196,6 @@
|
|||||||
:mode="storageDialogMode"
|
:mode="storageDialogMode"
|
||||||
:order-count="storagePendingOrderIds.length"
|
:order-count="storagePendingOrderIds.length"
|
||||||
:loading="storageAllocateLoading"
|
:loading="storageAllocateLoading"
|
||||||
:request-id="storageAllocateRequestId"
|
|
||||||
:task-status="storageAllocateTaskStatus"
|
|
||||||
:progress-percent="storageAllocateProgressPercent"
|
|
||||||
:total-count="storageAllocateTotalCount"
|
|
||||||
:success-count="storageAllocateSuccessCount"
|
|
||||||
:failed-count="storageAllocateFailedCount"
|
|
||||||
:message="storageAllocateMessage"
|
|
||||||
@closed="resetStorageAllocateDialog"
|
@closed="resetStorageAllocateDialog"
|
||||||
@submit="submitStorageAllocate"
|
@submit="submitStorageAllocate"
|
||||||
/>
|
/>
|
||||||
@ -270,7 +263,7 @@ import UpperTable from '@/components/UpperTable/index.vue'
|
|||||||
import * as indexApi from '@/api/index/index'
|
import * as indexApi from '@/api/index/index'
|
||||||
import { orderQueryOrderLogs } from '@/api/order.index/orderindex'
|
import { orderQueryOrderLogs } from '@/api/order.index/orderindex'
|
||||||
import { orderExpectionOrder } from '@/api/order.expectionorder/orderexpectionorder'
|
import { orderExpectionOrder } from '@/api/order.expectionorder/orderexpectionorder'
|
||||||
import { orderPendingOrder } from '@/api/order.pendingOrder/orderpendingOrder'
|
import { orderPendingOrder } from '@/api/order.pendingorder/orderpendingOrder'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
expectionColumns,
|
expectionColumns,
|
||||||
@ -766,13 +759,6 @@ const {
|
|||||||
storagePendingOrderIds,
|
storagePendingOrderIds,
|
||||||
storageAllocateLoading,
|
storageAllocateLoading,
|
||||||
storageForm,
|
storageForm,
|
||||||
storageAllocateRequestId,
|
|
||||||
storageAllocateTaskStatus,
|
|
||||||
storageAllocateProgressPercent,
|
|
||||||
storageAllocateTotalCount,
|
|
||||||
storageAllocateSuccessCount,
|
|
||||||
storageAllocateFailedCount,
|
|
||||||
storageAllocateMessage,
|
|
||||||
updateOrderMetaDialogVisible,
|
updateOrderMetaDialogVisible,
|
||||||
updateOrderMetaDialogMode,
|
updateOrderMetaDialogMode,
|
||||||
updateOrderMetaOrderIds,
|
updateOrderMetaOrderIds,
|
||||||
|
|||||||
@ -14,30 +14,11 @@
|
|||||||
<el-form-item v-if="mode !== 'cancel'" label="允许存储储位">
|
<el-form-item v-if="mode !== 'cancel'" label="允许存储储位">
|
||||||
<el-switch v-model="allowStorageLocationProxy" active-text="是" inactive-text="否" />
|
<el-switch v-model="allowStorageLocationProxy" active-text="是" inactive-text="否" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<template v-if="mode !== 'cancel' && requestId">
|
|
||||||
<el-form-item label="任务ID">
|
|
||||||
<span>{{ requestId }}</span>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="任务状态">
|
|
||||||
<span>{{ progressStatusText }}</span>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="处理进度">
|
|
||||||
<div class="storage-allocate-progress">
|
|
||||||
<el-progress :percentage="normalizedProgressPercent" :status="progressBarStatus" :stroke-width="16" />
|
|
||||||
<div class="storage-allocate-progress__meta">
|
|
||||||
<span>总数:{{ totalCount }}</span>
|
|
||||||
<span>成功:{{ successCount }}</span>
|
|
||||||
<span>失败:{{ failedCount }}</span>
|
|
||||||
</div>
|
|
||||||
<div v-if="message" class="storage-allocate-progress__message">{{ message }}</div>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
</template>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button :disabled="loading && !!requestId" @click="visible = false">取消</el-button>
|
<el-button @click="visible = false">取消</el-button>
|
||||||
<el-button type="primary" :loading="loading" @click="emit('submit')">
|
<el-button type="primary" :loading="loading" @click="emit('submit')">
|
||||||
{{ submitButtonText }}
|
{{ mode === 'cancel' ? '确认取消' : '开始分配' }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -53,13 +34,6 @@ const props = defineProps<{
|
|||||||
mode: 'allocate' | 'cancel'
|
mode: 'allocate' | 'cancel'
|
||||||
orderCount: number
|
orderCount: number
|
||||||
loading: boolean
|
loading: boolean
|
||||||
requestId?: string
|
|
||||||
taskStatus?: string
|
|
||||||
progressPercent?: number
|
|
||||||
totalCount?: number
|
|
||||||
successCount?: number
|
|
||||||
failedCount?: number
|
|
||||||
message?: string
|
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@ -73,64 +47,4 @@ const allowStorageLocationProxy = computed({
|
|||||||
allowStorageLocation.value = value
|
allowStorageLocation.value = value
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const normalizedProgressPercent = computed(() => {
|
|
||||||
const value = Number(props.progressPercent || 0)
|
|
||||||
if (!Number.isFinite(value)) return 0
|
|
||||||
return Math.max(0, Math.min(100, value))
|
|
||||||
})
|
|
||||||
|
|
||||||
const progressStatusText = computed(() => {
|
|
||||||
const map: Record<string, string> = {
|
|
||||||
submitted: '已受理',
|
|
||||||
running: '进行中',
|
|
||||||
processing: '进行中',
|
|
||||||
pending: '等待处理',
|
|
||||||
success: '已完成',
|
|
||||||
finished: '已完成',
|
|
||||||
fin: '已完成',
|
|
||||||
failed: '失败',
|
|
||||||
error: '失败',
|
|
||||||
exception: '异常',
|
|
||||||
timeout: '超时',
|
|
||||||
not_found: '未找到'
|
|
||||||
}
|
|
||||||
const key = String(props.taskStatus || '').trim().toLowerCase()
|
|
||||||
return map[key] || props.taskStatus || '—'
|
|
||||||
})
|
|
||||||
|
|
||||||
const progressBarStatus = computed(() => {
|
|
||||||
const key = String(props.taskStatus || '').trim().toLowerCase()
|
|
||||||
if (['failed', 'error', 'exception', 'timeout', 'not_found'].includes(key)) return 'exception'
|
|
||||||
if (['success', 'finished', 'fin'].includes(key) || normalizedProgressPercent.value >= 100) return 'success'
|
|
||||||
return undefined
|
|
||||||
})
|
|
||||||
|
|
||||||
const submitButtonText = computed(() => {
|
|
||||||
if (props.mode === 'cancel') return '确认取消'
|
|
||||||
if (props.requestId) return '处理中'
|
|
||||||
return '开始分配'
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.storage-allocate-progress {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.storage-allocate-progress__meta {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 12px;
|
|
||||||
margin-top: 8px;
|
|
||||||
color: #606266;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.storage-allocate-progress__message {
|
|
||||||
margin-top: 6px;
|
|
||||||
color: #606266;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@ -171,7 +171,7 @@ import { ElMessage } from 'element-plus'
|
|||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
import * as indexApi from '@/api/index/index'
|
import * as indexApi from '@/api/index/index'
|
||||||
import { orderOutboundOrder } from '@/api/order.outboundOrder/orderoutboundOrder'
|
import { orderOutboundOrder } from '@/api/order.outboundorder/orderoutboundOrder'
|
||||||
import {
|
import {
|
||||||
outboundAvailableFields,
|
outboundAvailableFields,
|
||||||
outboundColumns,
|
outboundColumns,
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
width="320px"
|
width="320px"
|
||||||
:tree-props="{ children: 'children', label: 'label' }"
|
:tree-props="{ children: 'children', label: 'label' }"
|
||||||
:auto-submit="false"
|
:auto-submit="false"
|
||||||
:initial-conditions="initialConditions"
|
|
||||||
:preset-tree="presetTree"
|
:preset-tree="presetTree"
|
||||||
:available-fields="availableFieldsRef"
|
:available-fields="availableFieldsRef"
|
||||||
@condition-change="handleConditionChange"
|
@condition-change="handleConditionChange"
|
||||||
@ -187,13 +186,6 @@
|
|||||||
:mode="storageDialogMode"
|
:mode="storageDialogMode"
|
||||||
:order-count="storagePendingOrderIds.length"
|
:order-count="storagePendingOrderIds.length"
|
||||||
:loading="storageAllocateLoading"
|
:loading="storageAllocateLoading"
|
||||||
:request-id="storageAllocateRequestId"
|
|
||||||
:task-status="storageAllocateTaskStatus"
|
|
||||||
:progress-percent="storageAllocateProgressPercent"
|
|
||||||
:total-count="storageAllocateTotalCount"
|
|
||||||
:success-count="storageAllocateSuccessCount"
|
|
||||||
:failed-count="storageAllocateFailedCount"
|
|
||||||
:message="storageAllocateMessage"
|
|
||||||
@closed="resetStorageAllocateDialog"
|
@closed="resetStorageAllocateDialog"
|
||||||
@submit="submitStorageAllocate"
|
@submit="submitStorageAllocate"
|
||||||
/>
|
/>
|
||||||
@ -231,11 +223,10 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted, computed } from 'vue'
|
import { ref, reactive, onMounted, computed } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
import { orderPendingOrder } from '@/api/order.pendingOrder/orderpendingOrder'
|
import { orderPendingOrder } from '@/api/order.pendingorder/orderpendingOrder'
|
||||||
import * as indexApi from '@/api/index/index'
|
import * as indexApi from '@/api/index/index'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -265,7 +256,6 @@ import { safeInvoke } from '@/utils/safe-invoke'
|
|||||||
const scanBox = ref<any>(null)
|
const scanBox = ref<any>(null)
|
||||||
const upperTable = ref<any>(null)
|
const upperTable = ref<any>(null)
|
||||||
const scrollContainerRef = ref<HTMLElement | null>(null)
|
const scrollContainerRef = ref<HTMLElement | null>(null)
|
||||||
const route = useRoute()
|
|
||||||
|
|
||||||
const { splitStackRef, beginSplitDrag, lowerPaneStyle, upperPaneStyle } = useVerticalSplitPane({
|
const { splitStackRef, beginSplitDrag, lowerPaneStyle, upperPaneStyle } = useVerticalSplitPane({
|
||||||
defaultLowerPercent: 38,
|
defaultLowerPercent: 38,
|
||||||
@ -299,22 +289,6 @@ const detailVisible = ref(true)
|
|||||||
|
|
||||||
const quickSearch = ref('')
|
const quickSearch = ref('')
|
||||||
const toolbarButtons = pendingToolbarButtons
|
const toolbarButtons = pendingToolbarButtons
|
||||||
const initialConditions = computed(() => {
|
|
||||||
const waveNo = String(route.query.wave_no || '').trim()
|
|
||||||
if (!waveNo) return undefined
|
|
||||||
|
|
||||||
return {
|
|
||||||
type: 'custom',
|
|
||||||
conditions: {
|
|
||||||
wave_no: {
|
|
||||||
field: 'wave_no',
|
|
||||||
type: 'text',
|
|
||||||
operator: 'eq',
|
|
||||||
value: waveNo
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// Toolbar 滚动与拖拽逻辑
|
// Toolbar 滚动与拖拽逻辑
|
||||||
const isDragging = ref(false)
|
const isDragging = ref(false)
|
||||||
@ -384,14 +358,6 @@ async function loadData() {
|
|||||||
const start = Date.now()
|
const start = Date.now()
|
||||||
|
|
||||||
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||||
const routeWaveNo = String(route.query.wave_no || '').trim()
|
|
||||||
if (routeWaveNo) {
|
|
||||||
where.wave_no = {
|
|
||||||
operator: 'eq',
|
|
||||||
value: routeWaveNo,
|
|
||||||
type: 'text'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (quickSearch.value) {
|
if (quickSearch.value) {
|
||||||
where.delivery_order_code = {
|
where.delivery_order_code = {
|
||||||
operator: 'like',
|
operator: 'like',
|
||||||
@ -530,13 +496,6 @@ const {
|
|||||||
storagePendingOrderIds,
|
storagePendingOrderIds,
|
||||||
storageAllocateLoading,
|
storageAllocateLoading,
|
||||||
storageForm,
|
storageForm,
|
||||||
storageAllocateRequestId,
|
|
||||||
storageAllocateTaskStatus,
|
|
||||||
storageAllocateProgressPercent,
|
|
||||||
storageAllocateTotalCount,
|
|
||||||
storageAllocateSuccessCount,
|
|
||||||
storageAllocateFailedCount,
|
|
||||||
storageAllocateMessage,
|
|
||||||
updateOrderMetaDialogVisible,
|
updateOrderMetaDialogVisible,
|
||||||
updateOrderMetaDialogMode,
|
updateOrderMetaDialogMode,
|
||||||
updateOrderMetaOrderIds,
|
updateOrderMetaOrderIds,
|
||||||
|
|||||||
@ -145,7 +145,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
|||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
import * as indexApi from '@/api/index/index'
|
import * as indexApi from '@/api/index/index'
|
||||||
import { orderReviewOrder } from '@/api/order.reviewOrder/orderreviewOrder'
|
import { orderReviewOrder } from '@/api/order.revieworder/orderreviewOrder'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
reviewAvailableFields,
|
reviewAvailableFields,
|
||||||
|
|||||||
@ -222,29 +222,6 @@ function buildAllocateExpressPayload(rows: any[]): Array<Record<string, any>> {
|
|||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizeAsyncTaskStatus(value: unknown) {
|
|
||||||
return String(value ?? '').trim().toLowerCase()
|
|
||||||
}
|
|
||||||
|
|
||||||
function isAsyncTaskSuccessStatus(status: string) {
|
|
||||||
return ['success', 'succeeded', 'finished', 'fin', 'done', 'completed', 'complete'].includes(status)
|
|
||||||
}
|
|
||||||
|
|
||||||
function isAsyncTaskFailureStatus(status: string) {
|
|
||||||
return ['failed', 'failure', 'error', 'exception', 'cancel', 'cancelled', 'canceled', 'timeout', 'not_found'].includes(status)
|
|
||||||
}
|
|
||||||
|
|
||||||
function sleep(ms: number) {
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
setTimeout(resolve, ms)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function getApiResponsePayload<T = Record<string, any>>(response: any): T {
|
|
||||||
if (response?.data && typeof response.data === 'object') return response.data as T
|
|
||||||
return (response || {}) as T
|
|
||||||
}
|
|
||||||
|
|
||||||
export function createPendingToolbarController(params: {
|
export function createPendingToolbarController(params: {
|
||||||
loadData: () => Promise<void>
|
loadData: () => Promise<void>
|
||||||
handleExport: () => Promise<void>
|
handleExport: () => Promise<void>
|
||||||
@ -269,13 +246,6 @@ export function createPendingToolbarController(params: {
|
|||||||
const storagePendingOrderIds = ref<Array<number | string>>([])
|
const storagePendingOrderIds = ref<Array<number | string>>([])
|
||||||
const storageAllocateLoading = ref(false)
|
const storageAllocateLoading = ref(false)
|
||||||
const storageForm = reactive({ allowStorageLocation: false })
|
const storageForm = reactive({ allowStorageLocation: false })
|
||||||
const storageAllocateRequestId = ref('')
|
|
||||||
const storageAllocateTaskStatus = ref('')
|
|
||||||
const storageAllocateProgressPercent = ref(0)
|
|
||||||
const storageAllocateTotalCount = ref(0)
|
|
||||||
const storageAllocateSuccessCount = ref(0)
|
|
||||||
const storageAllocateFailedCount = ref(0)
|
|
||||||
const storageAllocateMessage = ref('')
|
|
||||||
|
|
||||||
const updateOrderMetaDialogVisible = ref(false)
|
const updateOrderMetaDialogVisible = ref(false)
|
||||||
const updateOrderMetaDialogMode = ref<'express' | 'platform'>('express')
|
const updateOrderMetaDialogMode = ref<'express' | 'platform'>('express')
|
||||||
@ -333,26 +303,9 @@ export function createPendingToolbarController(params: {
|
|||||||
storageDialogMode.value = mode
|
storageDialogMode.value = mode
|
||||||
storagePendingOrderIds.value = [...ids]
|
storagePendingOrderIds.value = [...ids]
|
||||||
storageForm.allowStorageLocation = false
|
storageForm.allowStorageLocation = false
|
||||||
storageAllocateRequestId.value = ''
|
|
||||||
storageAllocateTaskStatus.value = ''
|
|
||||||
storageAllocateProgressPercent.value = 0
|
|
||||||
storageAllocateTotalCount.value = 0
|
|
||||||
storageAllocateSuccessCount.value = 0
|
|
||||||
storageAllocateFailedCount.value = 0
|
|
||||||
storageAllocateMessage.value = ''
|
|
||||||
storageDialogVisible.value = true
|
storageDialogVisible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyStorageAllocateProgress(progress: Record<string, any>, fallbackRequestId = '') {
|
|
||||||
storageAllocateRequestId.value = String(progress.request_id || fallbackRequestId || storageAllocateRequestId.value || '')
|
|
||||||
storageAllocateTaskStatus.value = normalizeAsyncTaskStatus(progress.status)
|
|
||||||
storageAllocateProgressPercent.value = Number(progress.progress_percent ?? storageAllocateProgressPercent.value ?? 0) || 0
|
|
||||||
storageAllocateTotalCount.value = Number(progress.total_count ?? progress.result?.total_count ?? storageAllocateTotalCount.value ?? 0) || 0
|
|
||||||
storageAllocateSuccessCount.value = Number(progress.success_count ?? progress.updated_count ?? progress.result?.updated_count ?? storageAllocateSuccessCount.value ?? 0) || 0
|
|
||||||
storageAllocateFailedCount.value = Number(progress.failed_count ?? progress.result?.failed_count ?? storageAllocateFailedCount.value ?? 0) || 0
|
|
||||||
storageAllocateMessage.value = String(progress.error || progress.message || '')
|
|
||||||
}
|
|
||||||
|
|
||||||
async function submitStorageAllocate() {
|
async function submitStorageAllocate() {
|
||||||
const order_ids = [...storagePendingOrderIds.value]
|
const order_ids = [...storagePendingOrderIds.value]
|
||||||
if (!order_ids.length || storageAllocateLoading.value) return
|
if (!order_ids.length || storageAllocateLoading.value) return
|
||||||
@ -370,70 +323,10 @@ export function createPendingToolbarController(params: {
|
|||||||
ElMessage.error(res?.message || (isCancel ? '取消分配储位失败' : '储位分配失败'))
|
ElMessage.error(res?.message || (isCancel ? '取消分配储位失败' : '储位分配失败'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
ElMessage.success(res.message || (isCancel ? '取消分配储位已提交' : '储位分配已提交'))
|
||||||
if (isCancel) {
|
|
||||||
ElMessage.success(res.message || '取消分配储位已提交')
|
|
||||||
storageDialogVisible.value = false
|
storageDialogVisible.value = false
|
||||||
params.clearSelection()
|
params.clearSelection()
|
||||||
await params.loadData()
|
await params.loadData()
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const acceptedPayload = getApiResponsePayload<{ request_id?: string }>(res)
|
|
||||||
const requestId = String(acceptedPayload.request_id || res?.request_id || '').trim()
|
|
||||||
if (!requestId) {
|
|
||||||
ElMessage.success(res.message || '储位分配已提交')
|
|
||||||
storageDialogVisible.value = false
|
|
||||||
params.clearSelection()
|
|
||||||
await params.loadData()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
applyStorageAllocateProgress({
|
|
||||||
request_id: requestId,
|
|
||||||
status: 'submitted',
|
|
||||||
progress_percent: 0,
|
|
||||||
total_count: order_ids.length,
|
|
||||||
success_count: 0,
|
|
||||||
failed_count: 0,
|
|
||||||
message: res.message || '储位分配任务已受理'
|
|
||||||
}, requestId)
|
|
||||||
|
|
||||||
ElMessage.success((res.message || '储位分配任务已受理') + `(任务ID: ${requestId})`)
|
|
||||||
params.clearSelection()
|
|
||||||
|
|
||||||
const pollProgress = async () => {
|
|
||||||
let latestPayload: Record<string, any> = {}
|
|
||||||
for (let attempt = 0; attempt < 120; attempt += 1) {
|
|
||||||
const progressRes = await params.pendingApi.allocateStorageProgress({ request_id: requestId })
|
|
||||||
const progressOk = progressRes && (progressRes.code === 1 || progressRes.code === 200 || progressRes.flag === 'success')
|
|
||||||
if (!progressOk) {
|
|
||||||
throw new Error(progressRes?.message || '查询储位分配进度失败')
|
|
||||||
}
|
|
||||||
latestPayload = getApiResponsePayload(progressRes)
|
|
||||||
applyStorageAllocateProgress(latestPayload, requestId)
|
|
||||||
const status = normalizeAsyncTaskStatus(latestPayload.status)
|
|
||||||
if (isAsyncTaskSuccessStatus(status)) {
|
|
||||||
return latestPayload
|
|
||||||
}
|
|
||||||
if (isAsyncTaskFailureStatus(status)) {
|
|
||||||
throw new Error(String(latestPayload.error || latestPayload.message || '储位分配失败'))
|
|
||||||
}
|
|
||||||
await sleep(1500)
|
|
||||||
}
|
|
||||||
return latestPayload
|
|
||||||
}
|
|
||||||
|
|
||||||
const progressPayload = await pollProgress()
|
|
||||||
const updatedCount = Number(
|
|
||||||
progressPayload.updated_count
|
|
||||||
?? progressPayload.success_count
|
|
||||||
?? progressPayload.result?.updated_count
|
|
||||||
?? order_ids.length
|
|
||||||
) || order_ids.length
|
|
||||||
ElMessage.success(`储位分配完成 ${updatedCount} 条`)
|
|
||||||
storageDialogVisible.value = false
|
|
||||||
await params.loadData()
|
|
||||||
} catch {
|
} catch {
|
||||||
ElMessage.error(isCancel ? '取消分配储位失败' : '储位分配失败')
|
ElMessage.error(isCancel ? '取消分配储位失败' : '储位分配失败')
|
||||||
} finally {
|
} finally {
|
||||||
@ -622,13 +515,6 @@ export function createPendingToolbarController(params: {
|
|||||||
storageDialogMode.value = 'allocate'
|
storageDialogMode.value = 'allocate'
|
||||||
storagePendingOrderIds.value = []
|
storagePendingOrderIds.value = []
|
||||||
storageForm.allowStorageLocation = false
|
storageForm.allowStorageLocation = false
|
||||||
storageAllocateRequestId.value = ''
|
|
||||||
storageAllocateTaskStatus.value = ''
|
|
||||||
storageAllocateProgressPercent.value = 0
|
|
||||||
storageAllocateTotalCount.value = 0
|
|
||||||
storageAllocateSuccessCount.value = 0
|
|
||||||
storageAllocateFailedCount.value = 0
|
|
||||||
storageAllocateMessage.value = ''
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetUpdateOrderMetaDialog() {
|
function resetUpdateOrderMetaDialog() {
|
||||||
@ -654,13 +540,6 @@ export function createPendingToolbarController(params: {
|
|||||||
storagePendingOrderIds,
|
storagePendingOrderIds,
|
||||||
storageAllocateLoading,
|
storageAllocateLoading,
|
||||||
storageForm,
|
storageForm,
|
||||||
storageAllocateRequestId,
|
|
||||||
storageAllocateTaskStatus,
|
|
||||||
storageAllocateProgressPercent,
|
|
||||||
storageAllocateTotalCount,
|
|
||||||
storageAllocateSuccessCount,
|
|
||||||
storageAllocateFailedCount,
|
|
||||||
storageAllocateMessage,
|
|
||||||
updateOrderMetaDialogVisible,
|
updateOrderMetaDialogVisible,
|
||||||
updateOrderMetaDialogMode,
|
updateOrderMetaDialogMode,
|
||||||
updateOrderMetaOrderIds,
|
updateOrderMetaOrderIds,
|
||||||
|
|||||||
@ -438,7 +438,7 @@ import {
|
|||||||
printFormConfig,
|
printFormConfig,
|
||||||
addReceivingFields
|
addReceivingFields
|
||||||
} from './receiving-config'
|
} from './receiving-config'
|
||||||
import * as templateApi from '@/api/setting.printTemplate/printTemplate'
|
import * as templateApi from '@/api/setting.printtemplate/printTemplate'
|
||||||
|
|
||||||
import * as stationApi from '@/api/print/print'
|
import * as stationApi from '@/api/print/print'
|
||||||
import JsBarcode from 'jsbarcode'
|
import JsBarcode from 'jsbarcode'
|
||||||
|
|||||||
@ -776,7 +776,7 @@ import { storeWarehouseList, storeWarehouseSign, storeWarehouseUnbind,
|
|||||||
storeWarehouseRename, storeWarehouseGetPolicyConfig, storeWarehouseGetPolicyConfigFields,
|
storeWarehouseRename, storeWarehouseGetPolicyConfig, storeWarehouseGetPolicyConfigFields,
|
||||||
storeWarehouseSavePolicyConfig, saveApiConfig, storeWarehouseDeleteQimenConfig,
|
storeWarehouseSavePolicyConfig, saveApiConfig, storeWarehouseDeleteQimenConfig,
|
||||||
storeWarehouseAdjustPrintQuantity, listApiConfig
|
storeWarehouseAdjustPrintQuantity, listApiConfig
|
||||||
} from '@/api/storeWarehouse.store/storeWarehouse'
|
} from '@/api/storewarehouse.store/storeWarehouse'
|
||||||
import { listInterfaceTypes, getExpressList, getPlatformList } from '@/api/index/index'
|
import { listInterfaceTypes, getExpressList, getPlatformList } from '@/api/index/index'
|
||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
|
|||||||
@ -271,7 +271,7 @@ import {
|
|||||||
expressInterfaceList,
|
expressInterfaceList,
|
||||||
expressInterfaceListByWarehousePlatformCode,
|
expressInterfaceListByWarehousePlatformCode,
|
||||||
expressInterfaceUpdate
|
expressInterfaceUpdate
|
||||||
} from '@/api/setting.expressInterface/expressInterface'
|
} from '@/api/setting.expressinterface/expressInterface'
|
||||||
import { useUserStore } from '@/stores/modules/user'
|
import { useUserStore } from '@/stores/modules/user'
|
||||||
|
|
||||||
type ExpressOption = { code: string; name: string; label?: string }
|
type ExpressOption = { code: string; name: string; label?: string }
|
||||||
|
|||||||
@ -53,7 +53,7 @@ import { ref, computed, onMounted } from 'vue'
|
|||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { Document, Folder } from '@element-plus/icons-vue'
|
import { Document, Folder } from '@element-plus/icons-vue'
|
||||||
import TemplateEditor from './components/TemplateEditor.vue'
|
import TemplateEditor from './components/TemplateEditor.vue'
|
||||||
import * as TemplatesApi from '@/api/setting.printTemplate/printTemplate'
|
import * as TemplatesApi from '@/api/setting.printtemplate/printTemplate'
|
||||||
import { usePrintTemplateStore } from '@/stores/modules/printTemplate'
|
import { usePrintTemplateStore } from '@/stores/modules/printTemplate'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
|
|
||||||
|
|||||||
@ -1,607 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="pending-order-panel">
|
|
||||||
<scan-box
|
|
||||||
ref="scanBox"
|
|
||||||
width="300px"
|
|
||||||
:tree-props="{ children: 'children', label: 'label' }"
|
|
||||||
:auto-submit="false"
|
|
||||||
:initial-conditions="initialConditions"
|
|
||||||
:preset-tree="presetTree"
|
|
||||||
:available-fields="availableFieldsRef"
|
|
||||||
@condition-change="handleConditionChange"
|
|
||||||
@reset="handleConditionReset"
|
|
||||||
@condition-clear="handleConditionClear"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div class="pending-order-panel__main">
|
|
||||||
<div class="pending-order-panel__toolbar">
|
|
||||||
<div class="pending-order-panel__toolbar-left">
|
|
||||||
<span class="pending-order-panel__wave">当前波次:{{ waveNo }}</span>
|
|
||||||
<el-button
|
|
||||||
size="small"
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
:disabled="!hasSelection"
|
|
||||||
:loading="removeFromWaveLoading"
|
|
||||||
@click="handleRemoveOrdersFromWave"
|
|
||||||
>
|
|
||||||
移出波次
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-for="button in toolbarButtons"
|
|
||||||
:key="button.key"
|
|
||||||
:size="button.size || 'small'"
|
|
||||||
:type="button.type"
|
|
||||||
:plain="button.plain"
|
|
||||||
:disabled="resolveButtonDisabled(button.disabledKey)"
|
|
||||||
:loading="resolveButtonLoading(button.loadingKey)"
|
|
||||||
@click="handleToolbarButtonClick(button.action)"
|
|
||||||
>
|
|
||||||
{{ button.label }}
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="pending-order-panel__toolbar-right">
|
|
||||||
<el-input v-model="quickSearch" size="small" placeholder="搜索订单号" style="width: 220px" @keyup.enter="onQuickSearch" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<upper-table
|
|
||||||
ref="upperTable"
|
|
||||||
title="待处理订单列表"
|
|
||||||
:enable-column-config="true"
|
|
||||||
table-id="wave-pending-order-dialog"
|
|
||||||
:data="list"
|
|
||||||
:columns="columns"
|
|
||||||
:table-size="tableSize"
|
|
||||||
:pagination="pagination"
|
|
||||||
:show-index="true"
|
|
||||||
:show-selection="true"
|
|
||||||
:loading="loading"
|
|
||||||
:queryTime="queryTime"
|
|
||||||
@page-change="handlePageChange"
|
|
||||||
@page-size-change="handlePageSizeChange"
|
|
||||||
@refresh="loadData"
|
|
||||||
@selection-change="onSelectionChange"
|
|
||||||
>
|
|
||||||
<template #column-status="{ row }">
|
|
||||||
<el-tag :type="getTagType('status', row.status)" size="small">
|
|
||||||
{{ translateOrderField('status', row.status) }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #column-is_urgency="{ row }">
|
|
||||||
<el-tag :type="getTagType('is_urgency', row.is_urgency)" size="small">
|
|
||||||
{{ translateOrderField('is_urgency', row.is_urgency) }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #column-post_status="{ row }">
|
|
||||||
<el-tag :type="getTagType('post_status', row.post_status)" size="small">
|
|
||||||
{{ translateOrderField('post_status', row.post_status) }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #column-storage_status="{ row }">
|
|
||||||
<el-tag :type="getTagType('storage_status', row.storage_status)" size="small">
|
|
||||||
{{ translateOrderField('storage_status', row.storage_status) }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #column-print_status="{ row }">
|
|
||||||
<el-tag :type="getTagType('print_status', row.print_status)" size="small">
|
|
||||||
{{ translateOrderField('print_status', row.print_status) }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #column-pick_status="{ row }">
|
|
||||||
<el-tag :type="getTagType('pick_status', row.pick_status)" size="small">
|
|
||||||
{{ translateOrderField('pick_status', row.pick_status) }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #column-pack_status="{ row }">
|
|
||||||
<el-tag :type="getTagType('pack_status', row.pack_status)" size="small">
|
|
||||||
{{ translateOrderField('pack_status', row.pack_status) }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #column-sync_status="{ row }">
|
|
||||||
<el-tag :type="getTagType('sync_status', row.sync_status)" size="small">
|
|
||||||
{{ translateOrderField('sync_status', row.sync_status) }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #empty>
|
|
||||||
<div class="empty-tip">暂无待处理订单</div>
|
|
||||||
</template>
|
|
||||||
</upper-table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<allocate-express-form
|
|
||||||
v-model="allocateDialogVisible"
|
|
||||||
:loading="allocateLoading"
|
|
||||||
@closed="resetAllocateDialog"
|
|
||||||
@submit="submitAllocateExpress"
|
|
||||||
/>
|
|
||||||
<storage-allocate-form
|
|
||||||
v-model="storageDialogVisible"
|
|
||||||
v-model:allow-storage-location="storageForm.allowStorageLocation"
|
|
||||||
:mode="storageDialogMode"
|
|
||||||
:order-count="storagePendingOrderIds.length"
|
|
||||||
:loading="storageAllocateLoading"
|
|
||||||
:request-id="storageAllocateRequestId"
|
|
||||||
:task-status="storageAllocateTaskStatus"
|
|
||||||
:progress-percent="storageAllocateProgressPercent"
|
|
||||||
:total-count="storageAllocateTotalCount"
|
|
||||||
:success-count="storageAllocateSuccessCount"
|
|
||||||
:failed-count="storageAllocateFailedCount"
|
|
||||||
:message="storageAllocateMessage"
|
|
||||||
@closed="resetStorageAllocateDialog"
|
|
||||||
@submit="submitStorageAllocate"
|
|
||||||
/>
|
|
||||||
<sync-order-ids-form
|
|
||||||
v-model="syncOrderIdsDialogVisible"
|
|
||||||
:order-count="selectionRows.length"
|
|
||||||
:loading="syncOrderIdsLoading"
|
|
||||||
@closed="resetSyncOrderIdsDialog"
|
|
||||||
@submit="submitSyncOrderIds"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { computed, onMounted, reactive, ref, watch } from 'vue'
|
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
|
||||||
import { orderPendingOrder } from '@/api/order.pendingOrder/orderpendingOrder'
|
|
||||||
import { orderWaveBatchRemoveOrders } from '@/api/order.wave/orderwave'
|
|
||||||
import * as indexApi from '@/api/index/index'
|
|
||||||
import AllocateExpressForm from '@/views/order/orderManagement/form/AllocateExpressForm.vue'
|
|
||||||
import StorageAllocateForm from '@/views/order/orderManagement/form/StorageAllocateForm.vue'
|
|
||||||
import SyncOrderIdsForm from '@/views/order/orderManagement/form/SyncOrderIdsForm.vue'
|
|
||||||
import { createPendingToolbarController } from '@/views/order/orderManagement/utils/toolbar-actions'
|
|
||||||
import {
|
|
||||||
pendingCloums,
|
|
||||||
pendingAvailableFields,
|
|
||||||
pickToolbarButtons,
|
|
||||||
type ToolbarButtonConfig,
|
|
||||||
translateOrderField,
|
|
||||||
getTagType
|
|
||||||
} from '@/views/order/orderManagement/config/order-common-config'
|
|
||||||
|
|
||||||
const props = defineProps<{
|
|
||||||
waveNo: string
|
|
||||||
}>()
|
|
||||||
|
|
||||||
const scanBox = ref<any>(null)
|
|
||||||
const upperTable = ref<any>(null)
|
|
||||||
|
|
||||||
const presetTree = ref<any[]>([])
|
|
||||||
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(pendingAvailableFields.filter((field: any) => field.value !== 'wave_no'))))
|
|
||||||
const toolbarButtons = pickToolbarButtons(['refresh', 'columnConfig', 'allocateStorage', 'allocateExpress', 'syncOrderIds'])
|
|
||||||
|
|
||||||
const list = ref<any[]>([])
|
|
||||||
const loading = ref(false)
|
|
||||||
const queryTime = ref(0)
|
|
||||||
const tableSize = ref('small')
|
|
||||||
const columns = ref(pendingCloums)
|
|
||||||
const selectionRows = ref<any[]>([])
|
|
||||||
const hasSelection = ref(false)
|
|
||||||
const quickSearch = ref('')
|
|
||||||
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
|
||||||
const actionLoading = ref(false)
|
|
||||||
const removeFromWaveLoading = ref(false)
|
|
||||||
|
|
||||||
const expressCodeOptions = ref<Array<{ label: string; value: string }>>([])
|
|
||||||
const platformCodeOptions = ref<Array<{ label: string; value: string }>>([])
|
|
||||||
|
|
||||||
const initialConditions = computed(() => ({
|
|
||||||
type: 'custom',
|
|
||||||
conditions: {
|
|
||||||
wave_no: {
|
|
||||||
field: 'wave_no',
|
|
||||||
type: 'text',
|
|
||||||
operator: 'eq',
|
|
||||||
value: props.waveNo
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
loadData()
|
|
||||||
loadOrderMetaOptions()
|
|
||||||
loadStoreOptions()
|
|
||||||
})
|
|
||||||
|
|
||||||
watch(() => props.waveNo, () => {
|
|
||||||
pagination.currentPage = 1
|
|
||||||
loadData()
|
|
||||||
})
|
|
||||||
|
|
||||||
function normalizePositiveIntId(raw: unknown): number | null {
|
|
||||||
if (raw === undefined || raw === null || raw === '') return null
|
|
||||||
const n = typeof raw === 'number' ? raw : Number(raw)
|
|
||||||
if (!Number.isInteger(n) || n <= 0) return null
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildWhereConditions(rawConditions: Record<string, any>) {
|
|
||||||
const where: Record<string, any> = {}
|
|
||||||
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[normalizedKey] = Array.isArray(condition.value)
|
|
||||||
? { ...condition, value: condition.value[0] ?? '', type: 'text' }
|
|
||||||
: condition
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (condition !== undefined && condition !== null && condition !== '') {
|
|
||||||
where[normalizedKey] = {
|
|
||||||
operator: 'eq',
|
|
||||||
value: Array.isArray(condition) ? condition[0] ?? '' : condition,
|
|
||||||
type: 'text'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return where
|
|
||||||
}
|
|
||||||
|
|
||||||
function sanitizePendingListWhere(where: Record<string, any>) {
|
|
||||||
const w = { ...where }
|
|
||||||
delete w.warehouse_id
|
|
||||||
delete w.warehouseId
|
|
||||||
return w
|
|
||||||
}
|
|
||||||
|
|
||||||
async function loadData() {
|
|
||||||
if (loading.value) return
|
|
||||||
loading.value = true
|
|
||||||
const start = Date.now()
|
|
||||||
|
|
||||||
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
|
||||||
where.wave_no = {
|
|
||||||
operator: 'eq',
|
|
||||||
value: props.waveNo,
|
|
||||||
type: 'text'
|
|
||||||
}
|
|
||||||
if (quickSearch.value) {
|
|
||||||
where.delivery_order_code = {
|
|
||||||
operator: 'like',
|
|
||||||
value: quickSearch.value,
|
|
||||||
type: 'text'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
where = sanitizePendingListWhere(where)
|
|
||||||
|
|
||||||
try {
|
|
||||||
const res = await orderPendingOrder.list({
|
|
||||||
pagination: {
|
|
||||||
page: pagination.currentPage,
|
|
||||||
pageSize: pagination.pageSize
|
|
||||||
},
|
|
||||||
where,
|
|
||||||
sort: {
|
|
||||||
sortField: 'updated_at',
|
|
||||||
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
|
|
||||||
} else {
|
|
||||||
list.value = []
|
|
||||||
pagination.total = 0
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
list.value = []
|
|
||||||
pagination.total = 0
|
|
||||||
ElMessage.error('获取待处理订单列表失败')
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
queryTime.value = Date.now() - start
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onSelectionChange(rows: any[]) {
|
|
||||||
selectionRows.value = rows || []
|
|
||||||
hasSelection.value = selectionRows.value.length > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleConditionChange() {
|
|
||||||
pagination.currentPage = 1
|
|
||||||
loadData()
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleConditionClear() {
|
|
||||||
pagination.currentPage = 1
|
|
||||||
loadData()
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleConditionReset() {
|
|
||||||
pagination.currentPage = 1
|
|
||||||
scanBox.value?.reset?.()
|
|
||||||
loadData()
|
|
||||||
}
|
|
||||||
|
|
||||||
function handlePageChange(page: number) {
|
|
||||||
pagination.currentPage = page
|
|
||||||
loadData()
|
|
||||||
}
|
|
||||||
|
|
||||||
function handlePageSizeChange(size: number) {
|
|
||||||
pagination.pageSize = size
|
|
||||||
pagination.currentPage = 1
|
|
||||||
loadData()
|
|
||||||
}
|
|
||||||
|
|
||||||
function onQuickSearch() {
|
|
||||||
pagination.currentPage = 1
|
|
||||||
loadData()
|
|
||||||
}
|
|
||||||
|
|
||||||
function openColumnConfigPanel() {
|
|
||||||
upperTable.value?.openColumnConfig?.()
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSelectedIds(): number[] {
|
|
||||||
const ids: number[] = []
|
|
||||||
for (const item of selectionRows.value) {
|
|
||||||
const n = normalizePositiveIntId(item?.id)
|
|
||||||
if (n !== null) ids.push(n)
|
|
||||||
}
|
|
||||||
return ids
|
|
||||||
}
|
|
||||||
|
|
||||||
const {
|
|
||||||
actionMap,
|
|
||||||
dialogState: {
|
|
||||||
allocateDialogVisible,
|
|
||||||
allocateLoading,
|
|
||||||
storageDialogVisible,
|
|
||||||
storageDialogMode,
|
|
||||||
storagePendingOrderIds,
|
|
||||||
storageAllocateLoading,
|
|
||||||
storageForm,
|
|
||||||
storageAllocateRequestId,
|
|
||||||
storageAllocateTaskStatus,
|
|
||||||
storageAllocateProgressPercent,
|
|
||||||
storageAllocateTotalCount,
|
|
||||||
storageAllocateSuccessCount,
|
|
||||||
storageAllocateFailedCount,
|
|
||||||
storageAllocateMessage,
|
|
||||||
syncOrderIdsDialogVisible,
|
|
||||||
syncOrderIdsLoading
|
|
||||||
},
|
|
||||||
submitStorageAllocate,
|
|
||||||
submitAllocateExpress,
|
|
||||||
submitSyncOrderIds,
|
|
||||||
resetAllocateDialog,
|
|
||||||
resetStorageAllocateDialog,
|
|
||||||
resetSyncOrderIdsDialog
|
|
||||||
} = createPendingToolbarController({
|
|
||||||
loadData,
|
|
||||||
handleExport: async () => {},
|
|
||||||
openColumnConfigPanel,
|
|
||||||
toggleDetailVisible: () => {},
|
|
||||||
openManualCreateDialog: () => {},
|
|
||||||
openImportOrderDialog: () => {},
|
|
||||||
getSelectedRows: () => selectionRows.value,
|
|
||||||
getSelectedIds,
|
|
||||||
pendingApi: orderPendingOrder,
|
|
||||||
actionLoading,
|
|
||||||
clearSelection: () => {
|
|
||||||
upperTable.value?.clearSelection?.()
|
|
||||||
selectionRows.value = []
|
|
||||||
hasSelection.value = false
|
|
||||||
},
|
|
||||||
expressCodeOptions,
|
|
||||||
platformCodeOptions
|
|
||||||
})
|
|
||||||
|
|
||||||
function resolveButtonLoading(loadingKey?: string) {
|
|
||||||
if (!loadingKey) return false
|
|
||||||
const loadingMap: Record<string, boolean> = {
|
|
||||||
actionLoading: actionLoading.value,
|
|
||||||
storageAllocateLoading: storageAllocateLoading.value,
|
|
||||||
allocateLoading: allocateLoading.value,
|
|
||||||
syncOrderIdsLoading: syncOrderIdsLoading.value
|
|
||||||
}
|
|
||||||
return Boolean(loadingMap[loadingKey])
|
|
||||||
}
|
|
||||||
|
|
||||||
function resolveButtonDisabled(disabledKey?: string) {
|
|
||||||
if (!disabledKey) return false
|
|
||||||
const disabledMap: Record<string, boolean> = {
|
|
||||||
hasNoSelection: !hasSelection.value
|
|
||||||
}
|
|
||||||
return Boolean(disabledMap[disabledKey])
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
|
|
||||||
const handler = actionMap[action]
|
|
||||||
if (!handler) return
|
|
||||||
void handler()
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleRemoveOrdersFromWave() {
|
|
||||||
const ids = getSelectedIds()
|
|
||||||
if (!ids.length) {
|
|
||||||
ElMessage.warning('请先勾选需要移出波次的订单')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (removeFromWaveLoading.value) return
|
|
||||||
|
|
||||||
try {
|
|
||||||
await ElMessageBox.confirm(
|
|
||||||
`确定将选中的 ${ids.length} 条订单移出当前波次吗?`,
|
|
||||||
'移出波次',
|
|
||||||
{ type: 'warning', confirmButtonText: '确认移出', cancelButtonText: '取消' }
|
|
||||||
)
|
|
||||||
} catch {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
removeFromWaveLoading.value = true
|
|
||||||
try {
|
|
||||||
const res = await orderWaveBatchRemoveOrders({ ids })
|
|
||||||
const ok = res && (res.code === 1 || res.code === 200 || res.flag === 'success')
|
|
||||||
if (!ok) {
|
|
||||||
ElMessage.error(res?.message || '移出波次失败')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const updatedCount = Number(res?.data?.updated_count ?? ids.length) || ids.length
|
|
||||||
ElMessage.success(`${res?.message || '移出波次成功'} ${updatedCount} 条`)
|
|
||||||
upperTable.value?.clearSelection?.()
|
|
||||||
selectionRows.value = []
|
|
||||||
hasSelection.value = false
|
|
||||||
await loadData()
|
|
||||||
} catch (error: any) {
|
|
||||||
ElMessage.error(error?.message || '移出波次失败')
|
|
||||||
} finally {
|
|
||||||
removeFromWaveLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function normalizeCode(value: unknown) {
|
|
||||||
return String(value ?? '').trim()
|
|
||||||
}
|
|
||||||
|
|
||||||
function mapCodeOptions(rawList: any[], codeKeys: string[], nameKeys: string[]) {
|
|
||||||
const result: Array<{ label: string; value: string }> = []
|
|
||||||
const seen = new Set<string>()
|
|
||||||
for (const item of rawList || []) {
|
|
||||||
const code = normalizeCode(codeKeys.map((key) => item?.[key]).find((v) => v !== undefined && v !== null && v !== ''))
|
|
||||||
if (!code || seen.has(code)) continue
|
|
||||||
const name = normalizeCode(nameKeys.map((key) => item?.[key]).find((v) => v !== undefined && v !== null && v !== ''))
|
|
||||||
result.push({ value: code, label: name ? `${code} - ${name}` : code })
|
|
||||||
seen.add(code)
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
function mapNameOptions(rawList: any[], nameKeys: string[]) {
|
|
||||||
const result: Array<{ label: string; value: string }> = []
|
|
||||||
const seen = new Set<string>()
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
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 || []
|
|
||||||
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((item: any) => item.value === 'logistics_name')
|
|
||||||
if (logisticsField) {
|
|
||||||
logisticsField.options = mapNameOptions(expressRaw, ['name', 'logistics_name', 'express_name'])
|
|
||||||
}
|
|
||||||
const platformField = availableFieldsRef.find((item: any) => item.value === 'sys_platform_name')
|
|
||||||
if (platformField) {
|
|
||||||
platformField.options = mapNameOptions(platformRaw, ['name', 'platform_name'])
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
expressCodeOptions.value = []
|
|
||||||
platformCodeOptions.value = []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function normalizeStoreOptions(rawStores: any[]) {
|
|
||||||
const result: Array<{ label: string; value: number | string }> = []
|
|
||||||
const seen = new Set<string>()
|
|
||||||
for (const item of rawStores || []) {
|
|
||||||
const rawValue = item?.value ?? item?.store_id ?? item?.id ?? item?.storeId
|
|
||||||
if (rawValue === undefined || rawValue === null || rawValue === '') continue
|
|
||||||
const value = Number.isNaN(Number(rawValue)) ? String(rawValue) : Number(rawValue)
|
|
||||||
const key = String(value)
|
|
||||||
if (seen.has(key)) continue
|
|
||||||
const label = String(item?.label ?? item?.store_name ?? item?.name ?? item?.storeName ?? key).trim() || key
|
|
||||||
result.push({ label, value })
|
|
||||||
seen.add(key)
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
async function loadStoreOptions() {
|
|
||||||
try {
|
|
||||||
const storesRes: any = await indexApi.loadStores({ type: 'order' })
|
|
||||||
const rawStores = storesRes?.stores || storesRes?.data?.stores || storesRes?.data || []
|
|
||||||
const storeField = availableFieldsRef.find((item: any) => item.value === 'store_id')
|
|
||||||
if (storeField) {
|
|
||||||
storeField.options = normalizeStoreOptions(rawStores)
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
const storeField = availableFieldsRef.find((item: any) => item.value === 'store_id')
|
|
||||||
if (storeField) storeField.options = []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.pending-order-panel {
|
|
||||||
display: flex;
|
|
||||||
gap: 12px;
|
|
||||||
height: 72vh;
|
|
||||||
min-height: 560px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pending-order-panel__main {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 0;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pending-order-panel__toolbar {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
gap: 12px;
|
|
||||||
padding: 10px 12px;
|
|
||||||
background: #f8fafc;
|
|
||||||
border: 1px solid #ebeef5;
|
|
||||||
border-radius: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pending-order-panel__toolbar-left {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pending-order-panel__toolbar-right {
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pending-order-panel__wave {
|
|
||||||
font-size: 13px;
|
|
||||||
color: #606266;
|
|
||||||
margin-right: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.upper-table-container) {
|
|
||||||
flex: 1;
|
|
||||||
min-height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.scan-box-container) {
|
|
||||||
flex: 0 0 300px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user