68
This commit is contained in:
parent
e042da850d
commit
a872bb2ac4
BIN
dist.tar.gz
BIN
dist.tar.gz
Binary file not shown.
@ -634,9 +634,13 @@ export type OrderPendingOrderApi = {
|
||||
importOrdersFromExcel: typeof orderPendingOrderImportOrdersFromExcel;
|
||||
parseAddress: typeof orderPendingOrderParseAddress;
|
||||
batchIntercept: typeof orderPendingOrderBatchIntercept;
|
||||
batchInterceptTaskProgress: typeof orderPendingOrderBatchInterceptTaskProgress;
|
||||
batchUnintercept: typeof orderPendingOrderBatchUnintercept;
|
||||
batchUninterceptTaskProgress: typeof orderPendingOrderBatchUninterceptTaskProgress;
|
||||
batchLock: typeof orderPendingOrderBatchLock;
|
||||
batchLockTaskProgress: typeof orderPendingOrderBatchLockTaskProgress;
|
||||
batchUnlock: typeof orderPendingOrderBatchUnlock;
|
||||
batchUnlockTaskProgress: typeof orderPendingOrderBatchUnlockTaskProgress;
|
||||
};
|
||||
|
||||
export const orderPendingOrder: OrderPendingOrderApi = {
|
||||
@ -658,7 +662,11 @@ export const orderPendingOrder: OrderPendingOrderApi = {
|
||||
importOrdersFromExcel: orderPendingOrderImportOrdersFromExcel,
|
||||
parseAddress: orderPendingOrderParseAddress,
|
||||
batchIntercept: orderPendingOrderBatchIntercept,
|
||||
batchInterceptTaskProgress: orderPendingOrderBatchInterceptTaskProgress,
|
||||
batchUnintercept: orderPendingOrderBatchUnintercept,
|
||||
batchUninterceptTaskProgress: orderPendingOrderBatchUninterceptTaskProgress,
|
||||
batchLock: orderPendingOrderBatchLock,
|
||||
batchUnlock: orderPendingOrderBatchUnlock
|
||||
batchLockTaskProgress: orderPendingOrderBatchLockTaskProgress,
|
||||
batchUnlock: orderPendingOrderBatchUnlock,
|
||||
batchUnlockTaskProgress: orderPendingOrderBatchUnlockTaskProgress
|
||||
};
|
||||
|
||||
@ -76,16 +76,19 @@ export type WavePickTaskListResponse = {
|
||||
page_size: number
|
||||
}
|
||||
|
||||
type WavePickTaskListPagination = {
|
||||
total?: number
|
||||
page?: number
|
||||
pageSize?: number
|
||||
page_size?: number
|
||||
}
|
||||
|
||||
export type WavePickTaskListApiResponse = WavePickTaskListResponse & {
|
||||
code?: number
|
||||
message?: string
|
||||
pagination?: WavePickTaskListPagination
|
||||
data?: Partial<WavePickTaskListResponse> & {
|
||||
pagination?: {
|
||||
total?: number
|
||||
page?: number
|
||||
pageSize?: number
|
||||
page_size?: number
|
||||
}
|
||||
pagination?: WavePickTaskListPagination
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,8 +33,20 @@
|
||||
<!-- 文本类型 -->
|
||||
<div v-if="field.type === 'text'" class="field-form-item">
|
||||
<div class="field-label">
|
||||
<span>{{ field.label }}</span>
|
||||
<el-tag v-if="field.required" size="small" type="danger">必填</el-tag>
|
||||
<span class="field-label-text">
|
||||
<span>{{ field.label }}</span>
|
||||
<el-tag v-if="field.required" size="small" type="danger">必填</el-tag>
|
||||
</span>
|
||||
<el-button
|
||||
v-if="field.extraAction?.label"
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
class="field-extra-action"
|
||||
@click="handleFieldAction(field)"
|
||||
>
|
||||
{{ field.extraAction.label }}
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="field-control">
|
||||
<el-select
|
||||
@ -482,7 +494,7 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['condition-change', 'reset', 'condition-clear', 'submit'])
|
||||
const emit = defineEmits(['condition-change', 'reset', 'condition-clear', 'submit', 'field-action'])
|
||||
const route = useRoute()
|
||||
const scanBoxCacheStore = useScanBoxCacheStore()
|
||||
|
||||
@ -691,7 +703,7 @@ function cloneConditionDefaultValue(value: any) {
|
||||
return value
|
||||
}
|
||||
|
||||
function initCustomConditions(fields: any[], isSilent = false) {
|
||||
function initCustomConditions(fields: any[], isSilent = false, forceReset = false) {
|
||||
fields.forEach(field => {
|
||||
let defaultValue: any = undefined
|
||||
let defaultOperator = ''
|
||||
@ -735,7 +747,7 @@ function initCustomConditions(fields: any[], isSilent = false) {
|
||||
valueMin: undefined,
|
||||
valueMax: undefined
|
||||
}
|
||||
} else {
|
||||
} else if (forceReset) {
|
||||
customConditions[field.value].value = defaultValue
|
||||
customConditions[field.value].operator = defaultOperator
|
||||
customConditions[field.value].valueMin = undefined
|
||||
@ -927,7 +939,7 @@ function filterNode(value: string, data: any) {
|
||||
|
||||
/** 仅重置内部 UI 状态,不向外 emit(供 defineExpose 与父组件二次调用,避免与 @reset 形成递归) */
|
||||
function applyResetState() {
|
||||
initCustomConditions(props.availableFields, true)
|
||||
initCustomConditions(props.availableFields, true, true)
|
||||
activeCondition.value = null
|
||||
presetSearchText.value = ''
|
||||
filterPresetTree('')
|
||||
@ -1077,7 +1089,57 @@ function clear() {
|
||||
clearActiveCondition()
|
||||
}
|
||||
|
||||
defineExpose({ getConditions, reset, clear })
|
||||
function handleFieldAction(field: any) {
|
||||
emit('field-action', field.value, field)
|
||||
}
|
||||
|
||||
function getFieldDraft(fieldKey: string) {
|
||||
const condition = customConditions[fieldKey]
|
||||
if (!condition) return null
|
||||
return {
|
||||
value: condition.value,
|
||||
operator: condition.operator,
|
||||
valueMin: condition.valueMin,
|
||||
valueMax: condition.valueMax
|
||||
}
|
||||
}
|
||||
|
||||
function setFieldCondition(
|
||||
fieldKey: string,
|
||||
patch: { operator?: string; value?: any; valueMin?: any; valueMax?: any },
|
||||
options: { autoSubmit?: boolean } = {}
|
||||
) {
|
||||
if (!customConditions[fieldKey]) {
|
||||
customConditions[fieldKey] = {
|
||||
value: undefined,
|
||||
operator: 'eq',
|
||||
valueMin: undefined,
|
||||
valueMax: undefined
|
||||
}
|
||||
}
|
||||
|
||||
activeTab.value = 'custom'
|
||||
|
||||
const nextCondition = {
|
||||
...customConditions[fieldKey],
|
||||
...(patch.operator !== undefined ? { operator: patch.operator } : {}),
|
||||
...(patch.value !== undefined ? { value: patch.value } : {}),
|
||||
...(patch.valueMin !== undefined ? { valueMin: patch.valueMin } : {}),
|
||||
...(patch.valueMax !== undefined ? { valueMax: patch.valueMax } : {})
|
||||
}
|
||||
customConditions[fieldKey] = nextCondition
|
||||
|
||||
scheduleSaveSnapshot()
|
||||
if (options.autoSubmit === true) {
|
||||
handleSubmit()
|
||||
return
|
||||
}
|
||||
if (options.autoSubmit !== false && props.autoSubmit) {
|
||||
handleCustomChange()
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ getConditions, reset, clear, getFieldDraft, setFieldCondition, submit: handleSubmit })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@ -1169,8 +1231,22 @@ defineExpose({ getConditions, reset, clear })
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.field-label-text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.field-label .el-tag {
|
||||
margin-left: 4px;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.field-extra-action {
|
||||
flex-shrink: 0;
|
||||
padding: 0;
|
||||
height: auto;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.field-control {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
||||
<div class="pending-order-detail" v-loading="loading">
|
||||
<div v-if="!row?.id" class="empty-tip">请从上方列表中选择一项查看订单明细</div>
|
||||
<template v-else-if="detail">
|
||||
<div v-for="section in pendingOrderDetailSections" :key="section.title" class="section">
|
||||
<div v-for="section in detailSections" :key="section.title" class="section">
|
||||
<div class="section-title">{{ section.title }}</div>
|
||||
<el-descriptions :column="section.column || 3" border size="small">
|
||||
<el-descriptions-item
|
||||
@ -28,7 +28,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { orderPendingOrder } from '@/api/order.pendingorder/orderpendingOrder'
|
||||
import {
|
||||
@ -37,15 +37,19 @@ import {
|
||||
getTagType,
|
||||
pendingOrderDetailSections,
|
||||
translateOrderField,
|
||||
type OrderDetailFieldConfig
|
||||
type OrderDetailFieldConfig,
|
||||
type OrderDetailSectionConfig
|
||||
} from '../config/order-common-config'
|
||||
import { parseOrderDetailPayload, resolveOrderRecheckStatus } from '../utils/order-index-helpers'
|
||||
|
||||
const props = defineProps<{
|
||||
row: Record<string, any> | null
|
||||
detailRequest?: (data: Record<string, any>) => Promise<any>
|
||||
sections?: OrderDetailSectionConfig[]
|
||||
}>()
|
||||
|
||||
const detailSections = computed(() => props.sections ?? pendingOrderDetailSections)
|
||||
|
||||
const loading = ref(false)
|
||||
const detail = ref<Record<string, any> | null>(null)
|
||||
let latestRequestId = 0
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
>
|
||||
<div class="select-product-meta">
|
||||
<span v-if="storeId">货主 ID:{{ storeId }}</span>
|
||||
<span v-else class="select-product-meta--warn">请先选择货主</span>
|
||||
<span v-else>全部货主</span>
|
||||
<span>已选 {{ localSelectedItems.length }} 个</span>
|
||||
</div>
|
||||
|
||||
@ -20,11 +20,10 @@
|
||||
placeholder="支持多个查询使用逗号分隔"
|
||||
clearable
|
||||
size="small"
|
||||
:disabled="!storeId"
|
||||
@keyup.enter="handleSearch"
|
||||
@input="normalizeKeyword"
|
||||
/>
|
||||
<el-button type="primary" size="small" :disabled="!storeId" :loading="loading" @click="handleSearch">
|
||||
<el-button type="primary" size="small" :loading="loading" @click="handleSearch">
|
||||
查询
|
||||
</el-button>
|
||||
<span class="default-qty-label">默认计划数量</span>
|
||||
@ -39,10 +38,10 @@
|
||||
max-height="280"
|
||||
v-loading="loading"
|
||||
row-key="item_id"
|
||||
:empty-text="storeId ? '暂无商品' : '请先选择货主'"
|
||||
empty-text="暂无商品"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="46" :reserve-selection="true" :selectable="() => Boolean(storeId)" />
|
||||
<el-table-column type="selection" width="46" :reserve-selection="true" />
|
||||
<el-table-column prop="item_code" label="商品编码" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="item_name" label="商品名称" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="barcode" label="条码" min-width="100" show-overflow-tooltip />
|
||||
@ -80,7 +79,7 @@
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" :disabled="!storeId" @click="handleConfirm">确定</el-button>
|
||||
<el-button type="primary" @click="handleConfirm">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@ -96,6 +95,7 @@ export type SelectProductItem = {
|
||||
item_name: string
|
||||
barcode: string
|
||||
plan_qty: string
|
||||
store_id?: number
|
||||
}
|
||||
|
||||
const visible = defineModel<boolean>({ default: false })
|
||||
@ -148,14 +148,11 @@ watch(visible, (opened) => {
|
||||
})
|
||||
|
||||
async function initDialog() {
|
||||
if (!props.storeId) {
|
||||
resetListState()
|
||||
return
|
||||
}
|
||||
syncingSelection.value = true
|
||||
try {
|
||||
tableRef.value?.clearSelection?.()
|
||||
await loadList()
|
||||
await enrichLocalSelectedItems()
|
||||
await syncSelectionFromLocal()
|
||||
} finally {
|
||||
await nextTick()
|
||||
@ -184,12 +181,77 @@ function hasValidItemId(item: SelectProductItem) {
|
||||
}
|
||||
|
||||
function getStockItemId(row: any): number | undefined {
|
||||
const itemId = Number(row?.item_id ?? row?.id ?? 0)
|
||||
return Number.isInteger(itemId) && itemId > 0 ? itemId : undefined
|
||||
const candidates = [
|
||||
row?.item_id,
|
||||
row?.id,
|
||||
row?.store_stock?.item_id,
|
||||
row?.store_stock?.id,
|
||||
row?.stock?.item_id,
|
||||
row?.stock?.id,
|
||||
row?.goods?.item_id,
|
||||
row?.goods?.id
|
||||
]
|
||||
for (const candidate of candidates) {
|
||||
const itemId = Number(candidate)
|
||||
if (Number.isInteger(itemId) && itemId > 0) return itemId
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
function getStockItemCode(row: any) {
|
||||
return String(row?.item_code || row?.goods_code || '').trim()
|
||||
const candidates = [
|
||||
row?.item_code,
|
||||
row?.goods_code,
|
||||
row?.store_stock?.item_code,
|
||||
row?.store_stock?.goods_code,
|
||||
row?.stock?.item_code,
|
||||
row?.stock?.goods_code,
|
||||
row?.goods?.item_code,
|
||||
row?.goods?.goods_code
|
||||
]
|
||||
for (const candidate of candidates) {
|
||||
const text = String(candidate ?? '').trim()
|
||||
if (text) return text
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
function getStockItemName(row: any) {
|
||||
const candidates = [
|
||||
row?.item_name,
|
||||
row?.product_name,
|
||||
row?.goods_name,
|
||||
row?.name,
|
||||
row?.store_stock?.item_name,
|
||||
row?.store_stock?.product_name,
|
||||
row?.stock?.item_name,
|
||||
row?.goods?.item_name,
|
||||
row?.goods?.product_name
|
||||
]
|
||||
for (const candidate of candidates) {
|
||||
const text = String(candidate ?? '').trim()
|
||||
if (text) return text
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
function getStockBarcode(row: any) {
|
||||
const candidates = [
|
||||
row?.barcode,
|
||||
row?.store_stock?.barcode,
|
||||
row?.stock?.barcode,
|
||||
row?.goods?.barcode
|
||||
]
|
||||
for (const candidate of candidates) {
|
||||
const text = String(candidate ?? '').trim()
|
||||
if (text) return text
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
function getStockStoreId(row: any): number | undefined {
|
||||
const storeId = Number(row?.store_stock?.store_id ?? row?.store_id)
|
||||
return Number.isFinite(storeId) && storeId > 0 ? storeId : undefined
|
||||
}
|
||||
|
||||
function mapStockPickerItem(row: any) {
|
||||
@ -197,9 +259,9 @@ function mapStockPickerItem(row: any) {
|
||||
return {
|
||||
...row,
|
||||
item_id: itemId,
|
||||
item_code: String(row?.item_code || row?.goods_code || '').trim(),
|
||||
item_name: String(row?.item_name || row?.product_name || '').trim(),
|
||||
barcode: String(row?.barcode || '').trim()
|
||||
item_code: getStockItemCode(row),
|
||||
item_name: getStockItemName(row),
|
||||
barcode: getStockBarcode(row)
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,9 +272,81 @@ function buildSelectedItemFromStock(row: any, planQty: string): SelectProductIte
|
||||
return {
|
||||
item_id: itemId,
|
||||
item_code: itemCode,
|
||||
item_name: String(row?.item_name || row?.product_name || '').trim(),
|
||||
barcode: String(row?.barcode || '').trim(),
|
||||
plan_qty: planQty || '1'
|
||||
item_name: getStockItemName(row),
|
||||
barcode: getStockBarcode(row),
|
||||
plan_qty: planQty || '1',
|
||||
store_id: getStockStoreId(row)
|
||||
}
|
||||
}
|
||||
|
||||
function enrichSelectedItemFromStockRow(item: SelectProductItem, stockRow: any): SelectProductItem {
|
||||
return {
|
||||
...item,
|
||||
item_id: item.item_id || getStockItemId(stockRow),
|
||||
item_code: item.item_code || getStockItemCode(stockRow),
|
||||
item_name: String(item.item_name || '').trim() || getStockItemName(stockRow),
|
||||
barcode: String(item.barcode || '').trim() || getStockBarcode(stockRow),
|
||||
store_id: item.store_id || getStockStoreId(stockRow)
|
||||
}
|
||||
}
|
||||
|
||||
function enrichLocalSelectedItemsFromRows(rows: any[]) {
|
||||
if (!localSelectedItems.value.length || !rows.length) return
|
||||
|
||||
const byId = new Map<number, any>()
|
||||
const byCode = new Map<string, any>()
|
||||
for (const row of rows) {
|
||||
const itemId = getStockItemId(row)
|
||||
const itemCode = getStockItemCode(row)
|
||||
if (itemId) byId.set(itemId, row)
|
||||
if (itemCode) byCode.set(itemCode, row)
|
||||
}
|
||||
|
||||
localSelectedItems.value = localSelectedItems.value.map((item) => {
|
||||
const stockRow =
|
||||
(hasValidItemId(item) ? byId.get(Number(item.item_id)) : undefined)
|
||||
|| (item.item_code ? byCode.get(item.item_code) : undefined)
|
||||
if (!stockRow) return item
|
||||
return enrichSelectedItemFromStockRow(item, stockRow)
|
||||
})
|
||||
}
|
||||
|
||||
async function fetchStockRowsForSelectedItems(items: SelectProductItem[]) {
|
||||
const codes = Array.from(new Set(
|
||||
items
|
||||
.filter((item) => !String(item.item_name || '').trim() && String(item.item_code || '').trim())
|
||||
.map((item) => String(item.item_code).trim())
|
||||
))
|
||||
if (!codes.length) return []
|
||||
|
||||
const requestData: { keyword?: string; store_id?: number } = {
|
||||
keyword: codes.join(',')
|
||||
}
|
||||
if (props.storeId) {
|
||||
requestData.store_id = props.storeId
|
||||
}
|
||||
|
||||
const res: any = await warehouseSearch(requestData)
|
||||
const ok = res && (res.code === 1 || res.code === 200 || res.flag === 'success')
|
||||
if (!ok) return []
|
||||
|
||||
const rawList = Array.isArray(res?.data) ? res.data : []
|
||||
return rawList.map(mapStockPickerItem).filter((item: any) => item.item_id)
|
||||
}
|
||||
|
||||
async function enrichLocalSelectedItems() {
|
||||
enrichLocalSelectedItemsFromRows(allRows.value)
|
||||
|
||||
const needsFetch = localSelectedItems.value.some(
|
||||
(item) => !String(item.item_name || '').trim() && String(item.item_code || '').trim()
|
||||
)
|
||||
if (!needsFetch) return
|
||||
|
||||
try {
|
||||
const extraRows = await fetchStockRowsForSelectedItems(localSelectedItems.value)
|
||||
enrichLocalSelectedItemsFromRows(extraRows)
|
||||
} catch (error) {
|
||||
console.error('enrich selected product names failed:', error)
|
||||
}
|
||||
}
|
||||
|
||||
@ -223,16 +357,17 @@ function applyPageSlice() {
|
||||
}
|
||||
|
||||
async function loadList() {
|
||||
if (!props.storeId) {
|
||||
resetListState()
|
||||
return
|
||||
}
|
||||
loading.value = true
|
||||
try {
|
||||
const res: any = await warehouseSearch({
|
||||
keyword: keyword.value.trim() || undefined,
|
||||
store_id: props.storeId
|
||||
})
|
||||
const requestData: { keyword?: string; store_id?: number } = {}
|
||||
const normalizedKeyword = keyword.value.trim()
|
||||
if (normalizedKeyword) {
|
||||
requestData.keyword = normalizedKeyword
|
||||
}
|
||||
if (props.storeId) {
|
||||
requestData.store_id = props.storeId
|
||||
}
|
||||
const res: any = await warehouseSearch(requestData)
|
||||
const ok = res && (res.code === 1 || res.code === 200 || res.flag === 'success')
|
||||
if (!ok) {
|
||||
resetListState()
|
||||
@ -300,6 +435,18 @@ function applySelectedItems(selections: any[]) {
|
||||
return true
|
||||
}
|
||||
return selectedIdsInTable.has(Number(item.item_id))
|
||||
}).map((item) => {
|
||||
if (!String(item.item_name || '').trim()) {
|
||||
const stockRow = allRows.value.find((row) => {
|
||||
const itemId = getStockItemId(row)
|
||||
return (hasValidItemId(item) && itemId === Number(item.item_id))
|
||||
|| (item.item_code && getStockItemCode(row) === item.item_code)
|
||||
})
|
||||
if (stockRow) {
|
||||
return enrichSelectedItemFromStockRow(item, stockRow)
|
||||
}
|
||||
}
|
||||
return item
|
||||
})
|
||||
|
||||
const keptIdSet = new Set(
|
||||
@ -335,13 +482,10 @@ function removeSelectedItem(itemCode: string) {
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
if (!props.storeId) {
|
||||
ElMessage.warning('请先选择货主')
|
||||
return
|
||||
}
|
||||
pagination.currentPage = 1
|
||||
syncingSelection.value = true
|
||||
void loadList()
|
||||
.then(() => enrichLocalSelectedItems())
|
||||
.then(() => syncSelectionFromLocal())
|
||||
.finally(async () => {
|
||||
await nextTick()
|
||||
@ -360,8 +504,8 @@ function handlePageChange(page: number) {
|
||||
}
|
||||
|
||||
function handleConfirm() {
|
||||
if (!props.storeId) {
|
||||
ElMessage.warning('请先选择货主')
|
||||
if (!localSelectedItems.value.length) {
|
||||
ElMessage.warning('请至少选择 1 个商品')
|
||||
return
|
||||
}
|
||||
emit('confirm', localSelectedItems.value.map((item) => ({ ...item })), defaultPlanQty.value)
|
||||
|
||||
@ -214,6 +214,23 @@ export interface ToolbarApiActionConfig {
|
||||
failText: string
|
||||
}
|
||||
|
||||
export type PendingBatchAsyncTaskType = 'intercept' | 'unintercept' | 'lock' | 'unlock'
|
||||
|
||||
export interface PendingBatchAsyncTaskConfig {
|
||||
taskType: PendingBatchAsyncTaskType
|
||||
action: string
|
||||
submitApiMethod: string
|
||||
progressApiMethod: string
|
||||
title: string
|
||||
description: string
|
||||
submitButtonText: string
|
||||
resultCountLabel: string
|
||||
resultIdsLabel: string
|
||||
progressCountKey: string
|
||||
progressIdsKey: string
|
||||
failText: string
|
||||
}
|
||||
|
||||
export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
|
||||
refresh: { key: 'refresh', label: '刷新', type: 'primary', size: 'small', action: 'loadData' },
|
||||
export: { key: 'export', label: '导出', size: 'small', loadingKey: 'exportLoading', action: 'handleExport' },
|
||||
@ -244,14 +261,15 @@ export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
|
||||
allocateExpress: { key: 'allocateExpress', label: '分配快递号', size: 'small', type: 'success', loadingKey: 'allocateLoading', disabledKey: 'hasNoSelection', action: 'openAllocateExpressDialog' },
|
||||
updateExpress: { key: 'updateExpress', label: '修改快递', size: 'small', type: 'warning', plain: true, loadingKey: 'updateOrderMetaLoading', disabledKey: 'hasNoSelection', action: 'openUpdateOrderExpressDialog' },
|
||||
updatePlatform: { key: 'updatePlatform', label: '修改平台', size: 'small', type: 'info', plain: true, loadingKey: 'updateOrderMetaLoading', disabledKey: 'hasNoSelection', action: 'openUpdateOrderPlatformDialog' },
|
||||
updateAddress: { key: 'updateAddress', label: '修改地址', size: 'small', type: 'warning', plain: true, loadingKey: 'updateAddressLoading', disabledKey: 'hasNoSelection', action: 'openUpdateAddressDialog' },
|
||||
createOrder: { key: 'createOrder', label: '建单', size: 'small', type: 'primary', plain: true, action: 'openCreateOrderDialog' },
|
||||
cloneOrder: { key: 'cloneOrder', label: '克隆订单', size: 'small', type: 'warning', plain: true, loadingKey: 'cloneOrderLoading', disabledKey: 'notSingleSelection', action: 'openCloneOrderDialog' },
|
||||
syncOrderIds: { key: 'syncOrderIds', label: '同步订单', size: 'small', type: 'primary', plain: true, loadingKey: 'syncOrderIdsLoading', disabledKey: 'hasNoSelection', action: 'openSyncOrderIdsDialog' },
|
||||
cancelOrder: { key: 'cancelOrder', label: '取消订单', size: 'small', type: 'danger', loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleCancelOrder' },
|
||||
batchIntercept: { key: 'batchIntercept', label: '批量拦截', size: 'small', type: 'danger', plain: true, loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleBatchIntercept' },
|
||||
batchUnintercept: { key: 'batchUnintercept', label: '解除拦截', size: 'small', type: 'warning', plain: true, loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleBatchUnintercept' },
|
||||
batchLock: { key: 'batchLock', label: '批量锁定', size: 'small', type: 'warning', plain: true, loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleBatchLock' },
|
||||
batchUnlock: { key: 'batchUnlock', label: '批量解锁', size: 'small', type: 'primary', plain: true, loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleBatchUnlock' },
|
||||
batchIntercept: { key: 'batchIntercept', label: '批量拦截', size: 'small', type: 'danger', plain: true, loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchIntercept' },
|
||||
batchUnintercept: { key: 'batchUnintercept', label: '解除拦截', size: 'small', type: 'warning', plain: true, loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchUnintercept' },
|
||||
batchLock: { key: 'batchLock', label: '批量锁定', size: 'small', type: 'warning', plain: true, loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchLock' },
|
||||
batchUnlock: { key: 'batchUnlock', label: '批量解锁', size: 'small', type: 'primary', plain: true, loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchUnlock' },
|
||||
batchPrint: { key: 'batchPrint', label: '批量打印', size: 'small', type: 'primary', loadingKey: 'batchPrintLoading', disabledKey: 'hasNoSelection', action: 'handleBatchPrint' },
|
||||
batchReview: { key: 'batchReview', label: '批量审核通过', size: 'small', type: 'success', loadingKey: 'reviewSubmitting', disabledKey: 'hasNoSelection', action: 'handleBatchReview' },
|
||||
manualOutboundMigrate: {
|
||||
@ -280,7 +298,8 @@ export function pickToolbarButtons(keys: string[]) {
|
||||
.filter((button): button is ToolbarButtonConfig => Boolean(button))
|
||||
}
|
||||
|
||||
export const PENDING_TOOLBAR_API_ACTIONS: ToolbarApiActionConfig[] = [
|
||||
/** 同步批量操作:提交后立即返回结果 */
|
||||
export const PENDING_SYNC_TOOLBAR_API_ACTIONS: ToolbarApiActionConfig[] = [
|
||||
{
|
||||
action: 'handleReverseReview',
|
||||
apiMethod: 'reverseReviewOrder',
|
||||
@ -307,45 +326,72 @@ export const PENDING_TOOLBAR_API_ACTIONS: ToolbarApiActionConfig[] = [
|
||||
confirmType: 'error',
|
||||
successText: '取消订单成功',
|
||||
failText: '取消订单失败'
|
||||
},
|
||||
{
|
||||
action: 'handleBatchIntercept',
|
||||
apiMethod: 'batchIntercept',
|
||||
payloadKey: 'order_ids',
|
||||
confirmText: '确定对选中的 {count} 条订单提交拦截请求吗?',
|
||||
confirmType: 'error',
|
||||
successText: '拦截请求已提交,异步处理中',
|
||||
failText: '拦截请求提交失败'
|
||||
},
|
||||
{
|
||||
action: 'handleBatchUnintercept',
|
||||
apiMethod: 'batchUnintercept',
|
||||
payloadKey: 'order_ids',
|
||||
confirmText: '确定对选中的 {count} 条订单提交解除拦截吗?',
|
||||
confirmType: 'warning',
|
||||
successText: '解除拦截请求已提交,异步处理中',
|
||||
failText: '解除拦截请求提交失败'
|
||||
},
|
||||
{
|
||||
action: 'handleBatchLock',
|
||||
apiMethod: 'batchLock',
|
||||
payloadKey: 'order_ids',
|
||||
confirmText: '确定对选中的 {count} 条订单提交锁定请求吗?',
|
||||
confirmType: 'warning',
|
||||
successText: '锁定请求已提交,异步处理中',
|
||||
failText: '锁定请求提交失败'
|
||||
},
|
||||
{
|
||||
action: 'handleBatchUnlock',
|
||||
apiMethod: 'batchUnlock',
|
||||
payloadKey: 'order_ids',
|
||||
confirmText: '确定对选中的 {count} 条订单提交解锁请求吗?',
|
||||
confirmType: 'info',
|
||||
successText: '解锁请求已提交,异步处理中',
|
||||
failText: '解锁请求提交失败'
|
||||
}
|
||||
]
|
||||
|
||||
/** 异步批量任务:提交后返回 task_id,需轮询 TaskProgress */
|
||||
export const PENDING_BATCH_ASYNC_TASK_ACTIONS: PendingBatchAsyncTaskConfig[] = [
|
||||
{
|
||||
taskType: 'intercept',
|
||||
action: 'handleBatchIntercept',
|
||||
submitApiMethod: 'batchIntercept',
|
||||
progressApiMethod: 'batchInterceptTaskProgress',
|
||||
title: '批量拦截',
|
||||
description: '提交后将异步更新订单 intercept_status 为 requested,可在下方查看任务进度。',
|
||||
submitButtonText: '提交拦截',
|
||||
resultCountLabel: '已拦截',
|
||||
resultIdsLabel: '已拦截订单ID',
|
||||
progressCountKey: 'intercepted_order_count',
|
||||
progressIdsKey: 'intercepted_order_ids',
|
||||
failText: '批量拦截失败'
|
||||
},
|
||||
{
|
||||
taskType: 'unintercept',
|
||||
action: 'handleBatchUnintercept',
|
||||
submitApiMethod: 'batchUnintercept',
|
||||
progressApiMethod: 'batchUninterceptTaskProgress',
|
||||
title: '批量解除拦截',
|
||||
description: '提交后将异步更新订单 intercept_status 为 none,可在下方查看任务进度。',
|
||||
submitButtonText: '提交解除拦截',
|
||||
resultCountLabel: '已解除拦截',
|
||||
resultIdsLabel: '已解除拦截订单ID',
|
||||
progressCountKey: 'unintercepted_order_count',
|
||||
progressIdsKey: 'unintercepted_order_ids',
|
||||
failText: '批量解除拦截失败'
|
||||
},
|
||||
{
|
||||
taskType: 'lock',
|
||||
action: 'handleBatchLock',
|
||||
submitApiMethod: 'batchLock',
|
||||
progressApiMethod: 'batchLockTaskProgress',
|
||||
title: '批量锁定',
|
||||
description: '提交后将异步更新订单 lock_status 为 warehouse,可在下方查看任务进度。',
|
||||
submitButtonText: '提交锁定',
|
||||
resultCountLabel: '已锁定',
|
||||
resultIdsLabel: '已锁定订单ID',
|
||||
progressCountKey: 'locked_order_count',
|
||||
progressIdsKey: 'locked_order_ids',
|
||||
failText: '批量锁定失败'
|
||||
},
|
||||
{
|
||||
taskType: 'unlock',
|
||||
action: 'handleBatchUnlock',
|
||||
submitApiMethod: 'batchUnlock',
|
||||
progressApiMethod: 'batchUnlockTaskProgress',
|
||||
title: '批量解锁',
|
||||
description: '提交后将异步更新订单 lock_status 为 none,可在下方查看任务进度。',
|
||||
submitButtonText: '提交解锁',
|
||||
resultCountLabel: '已解锁',
|
||||
resultIdsLabel: '已解锁订单ID',
|
||||
progressCountKey: 'unlocked_order_count',
|
||||
progressIdsKey: 'unlocked_order_ids',
|
||||
failText: '批量解锁失败'
|
||||
}
|
||||
]
|
||||
|
||||
/** @deprecated 请使用 PENDING_SYNC_TOOLBAR_API_ACTIONS */
|
||||
export const PENDING_TOOLBAR_API_ACTIONS = PENDING_SYNC_TOOLBAR_API_ACTIONS
|
||||
|
||||
export const REVIEW_TOOLBAR_API_ACTIONS: ToolbarApiActionConfig[] = [
|
||||
{
|
||||
action: 'handleBatchReview',
|
||||
@ -702,6 +748,22 @@ export function fillExpressCompanyScanFieldOptions(availableFields: any[], expre
|
||||
}
|
||||
|
||||
/** ScanBox:货主,选项由 index.loadStores + fillStoreScanFieldOptions 注入 */
|
||||
export function resolveStoreOptionLabel(item: any, fallbackValue?: string | number): string {
|
||||
const fallback = String(fallbackValue ?? '').trim()
|
||||
const candidates = [
|
||||
item?.label,
|
||||
item?.store_remask,
|
||||
item?.store_name,
|
||||
item?.name,
|
||||
item?.storeName
|
||||
]
|
||||
for (const candidate of candidates) {
|
||||
const text = String(candidate ?? '').trim()
|
||||
if (text) return text
|
||||
}
|
||||
return fallback
|
||||
}
|
||||
|
||||
export function mapStoreListToSelectOptions(rawStores: any[]): Array<{ label: string; value: number | string }> {
|
||||
const result: Array<{ label: string; value: number | string }> = []
|
||||
const seen = new Set<string>()
|
||||
@ -711,8 +773,7 @@ export function mapStoreListToSelectOptions(rawStores: any[]): Array<{ label: st
|
||||
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
|
||||
const label = resolveStoreOptionLabel(item, key)
|
||||
result.push({ label, value })
|
||||
seen.add(key)
|
||||
}
|
||||
@ -765,31 +826,67 @@ export const deliveryAvailableFields = [
|
||||
]
|
||||
|
||||
export const deliveryColumns = [
|
||||
{ prop: 'delivery_order_code', label: '配送单号', width: '170', fixed: 'left' },
|
||||
{ prop: 'shop_nick', label: '店铺名称', width: '140' },
|
||||
{ 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: 'wave_no', label: '波次号', width: '150' },
|
||||
{ prop: 'order_flag', label: '订单标记', minWidth: '220' },
|
||||
{ prop: 'sys_platform_name', label: '来源平台', width: '110' },
|
||||
{ prop: 'order_type', label: '订单类型', width: '90' },
|
||||
{ prop: 'buyer_nick', label: '买家昵称', width: '120' },
|
||||
{ prop: 'name', label: '收货人', width: '100' },
|
||||
{ prop: 'mobile', label: '手机号', width: '120' },
|
||||
{ prop: 'province', label: '省份', width: '90' },
|
||||
{ prop: 'city', label: '城市', width: '90' },
|
||||
{ prop: 'status', label: '订单状态', width: '100' },
|
||||
{ prop: 'outbound_status', label: '出库状态', width: '100' },
|
||||
{ prop: 'sync_status', label: '同步状态', width: '100' },
|
||||
{ prop: 'storage_status', label: '储位', width: '100' },
|
||||
{ prop: 'post_status', label: '快递', width: '100' },
|
||||
{ prop: 'pick_status', label: '拣货', width: '100' },
|
||||
{ prop: 'pack_status', label: '打包', width: '100' },
|
||||
{ prop: 'inspection_status', label: '审核状态', width: '100' },
|
||||
{ prop: 'recheck_status', label: '复核状态', width: '100' },
|
||||
{ prop: 'storage_status', label: '储位', width: '90' },
|
||||
{ prop: 'post_status', label: '快递', width: '90' },
|
||||
{ prop: 'print_status', label: '打印状态', width: '100' },
|
||||
{ prop: 'pick_status', label: '拣货', width: '90' },
|
||||
{ prop: 'pack_status', label: '打包', width: '90' },
|
||||
{ prop: 'intercept_status', label: '拦截状态', width: '100' },
|
||||
{ prop: 'logistics_name', label: '物流公司', width: '120' },
|
||||
{ prop: 'waybill_codes', label: '物流单号', width: '160', formatter: waybillCodesFormatter },
|
||||
{ prop: 'waybill_codes', label: '物流单号', width: '150', formatter: waybillCodesFormatter },
|
||||
{ prop: 'source_order_codes', label: '来源单号', width: '140' },
|
||||
{ prop: 'is_urgency', label: '紧急', width: '80' },
|
||||
{ prop: 'dispatch_lane', label: '道口', width: '80' },
|
||||
{ prop: 'items_count', label: '商品种类', width: '100' },
|
||||
{ prop: 'items_total', label: '商品总数', width: '100' },
|
||||
{ prop: 'total_amount', label: '订单金额', width: '110' },
|
||||
{ prop: 'delivery_time', label: '配送时间', width: '165', formatter: orderTimeFormatter },
|
||||
{ prop: 'create_at', label: '创建时间', width: '165', formatter: orderTimeFormatter },
|
||||
{ prop: 'items_count', label: '商品种类', width: '90' },
|
||||
{ prop: 'items_total', label: '商品总数', width: '90' },
|
||||
{ prop: 'items_weight', label: '总重量', width: '90' },
|
||||
{ prop: 'total_amount', label: '订单金额', width: '100' },
|
||||
{ prop: 'remark', label: '留言', width: '140' },
|
||||
{ prop: 'pay_time', label: '支付时间', width: '160', formatter: orderTimeFormatter },
|
||||
{ prop: 'place_order_time', label: '下单时间', width: '160', formatter: orderTimeFormatter },
|
||||
{ prop: 'create_at', label: '创建时间', width: '160', formatter: orderTimeFormatter },
|
||||
]
|
||||
|
||||
function appendOrderDetailSectionFields(
|
||||
sections: OrderDetailSectionConfig[],
|
||||
patches: Record<string, OrderDetailFieldConfig[]>
|
||||
): OrderDetailSectionConfig[] {
|
||||
return sections.map((section) => ({
|
||||
...section,
|
||||
fields: [...section.fields, ...(patches[section.title] || [])]
|
||||
}))
|
||||
}
|
||||
|
||||
/** 配送订单详情分区(在通用订单详情基础上补充配送高频字段) */
|
||||
export const deliveryOrderDetailSections = appendOrderDetailSectionFields(pendingOrderDetailSections, {
|
||||
'基础信息': [
|
||||
{ prop: 'remark', label: '备注', span: 4 },
|
||||
{ prop: 'buyer_message', label: '买家留言', span: 2 },
|
||||
{ prop: 'seller_message', label: '卖家留言', span: 2 }
|
||||
],
|
||||
'流程与状态': [
|
||||
{ prop: 'basket_number', label: '篮号' }
|
||||
],
|
||||
'金额汇总': [
|
||||
{ prop: 'items', label: '商品明细摘要', span: 4 }
|
||||
]
|
||||
})
|
||||
|
||||
export const deliverydetail = [
|
||||
{ label: '订单总金额', prop: 'total_amount' },
|
||||
{ label: '商品总金额', prop: 'item_amount' },
|
||||
@ -1178,6 +1275,7 @@ export const pendingToolbarButtonKeys = [
|
||||
'allocateExpress',
|
||||
'updateExpress',
|
||||
'updatePlatform',
|
||||
'updateAddress',
|
||||
'createOrder',
|
||||
'cloneOrder',
|
||||
'syncOrderIds',
|
||||
|
||||
@ -15,19 +15,28 @@
|
||||
|
||||
<div class="main-content">
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<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)"
|
||||
<div class="toolbar-left" @wheel="handleToolbarWheel">
|
||||
<div
|
||||
class="toolbar-scroll-container"
|
||||
ref="scrollContainerRef"
|
||||
@mousedown="handleMouseDown"
|
||||
@mousemove="handleMouseMove"
|
||||
@mouseup="handleMouseUp"
|
||||
@mouseleave="handleMouseUp"
|
||||
>
|
||||
{{ resolveButtonLabel(button.label, button.dynamicLabelKey) }}
|
||||
</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)"
|
||||
>
|
||||
{{ resolveButtonLabel(button.label, button.dynamicLabelKey) }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="toolbar-right">
|
||||
@ -63,10 +72,6 @@
|
||||
@refresh="loadData"
|
||||
@selection-change="onSelectionChange"
|
||||
>
|
||||
<template #column-sys_platform_code="{ row }">
|
||||
{{ translateOrderField('sys_platform_code', row.sys_platform_code) }}
|
||||
</template>
|
||||
|
||||
<template #column-status="{ row }">
|
||||
<el-tag :type="getTagType('status', row.status)" size="small">
|
||||
{{ translateOrderField('status', row.status) }}
|
||||
@ -121,6 +126,24 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #column-inspection_status="{ row }">
|
||||
<el-tag :type="getTagType('inspection_status', row.inspection_status)" size="small">
|
||||
{{ translateOrderField('inspection_status', row.inspection_status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #column-recheck_status="{ row }">
|
||||
<el-tag :type="getTagType('recheck_status', resolveOrderRecheckStatus(row))" size="small">
|
||||
{{ translateOrderField('recheck_status', resolveOrderRecheckStatus(row)) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #column-intercept_status="{ row }">
|
||||
<el-tag :type="getTagType('intercept_status', row.intercept_status)" size="small">
|
||||
{{ translateOrderField('intercept_status', row.intercept_status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
<div class="empty-tip">暂无配送订单</div>
|
||||
</template>
|
||||
@ -140,7 +163,11 @@
|
||||
<div class="detail-container">
|
||||
<KeepAlive>
|
||||
<div v-if="activeTab === 'detail'" class="detail-page order-detail-wrapper">
|
||||
<pending-order-detail-panel :row="selectedRow" :detail-request="fetchDeliveryOrderDetail" />
|
||||
<pending-order-detail-panel
|
||||
:row="selectedRow"
|
||||
:detail-request="fetchDeliveryOrderDetail"
|
||||
:sections="deliveryOrderDetailSections"
|
||||
/>
|
||||
</div>
|
||||
<div v-else-if="activeTab === 'items'" class="detail-page order-detail-wrapper">
|
||||
<order-items-detail-panel :row="selectedRow" :detail-request="fetchDeliveryOrderDetail" />
|
||||
@ -184,6 +211,7 @@ import { orderDeliveryOrder } from '@/api/order.deliveryorder/orderdeliveryOrder
|
||||
import {
|
||||
deliveryAvailableFields,
|
||||
deliveryColumns,
|
||||
deliveryOrderDetailSections,
|
||||
deliveryOrderToolbarButtons,
|
||||
type ToolbarButtonConfig,
|
||||
translateOrderField,
|
||||
@ -197,13 +225,14 @@ import OrderItemsDetailPanel from './component/OrderItemsDetailPanel.vue'
|
||||
import log from './component/log.vue'
|
||||
import OrderExportProgressDialog from './component/OrderExportProgressDialog.vue'
|
||||
import { createOrderPageExport } from './utils/order-page-export'
|
||||
import { parseOrderListResponse } from './utils/order-index-helpers'
|
||||
import { parseOrderListResponse, resolveOrderRecheckStatus } from './utils/order-index-helpers'
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
import { createSimpleListToolbarController } from './utils/toolbar-actions'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
|
||||
const scanBox = ref<any>(null)
|
||||
const upperTable = ref<any>(null)
|
||||
const scrollContainerRef = ref<HTMLElement | null>(null)
|
||||
const presetTree = ref<any[]>([])
|
||||
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(deliveryAvailableFields)))
|
||||
const activeTab = ref('detail')
|
||||
@ -214,23 +243,7 @@ const queryTime = ref(0)
|
||||
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
const tableSize = ref('small')
|
||||
|
||||
const buildDeliveryColumns = () => {
|
||||
const source = Array.isArray(deliveryColumns) ? [...deliveryColumns] : []
|
||||
if (source.some((col: any) => String(col?.prop || '') === 'print_status')) {
|
||||
return source
|
||||
}
|
||||
|
||||
const printColumn = { prop: 'print_status', label: '打印状态', width: '100' }
|
||||
const insertAfterIndex = source.findIndex((col: any) => String(col?.prop || '') === 'post_status')
|
||||
if (insertAfterIndex >= 0) {
|
||||
source.splice(insertAfterIndex + 1, 0, printColumn)
|
||||
} else {
|
||||
source.push(printColumn)
|
||||
}
|
||||
return source
|
||||
}
|
||||
|
||||
const columns = ref(buildDeliveryColumns())
|
||||
const columns = ref([...deliveryColumns])
|
||||
const selectionRows = ref<any[]>([])
|
||||
const selectedOrderId = ref<number | string | null>(null)
|
||||
const detailVisible = ref(true)
|
||||
@ -257,6 +270,36 @@ function fetchDeliveryOrderDetail(data: Record<string, any>) {
|
||||
})
|
||||
}
|
||||
|
||||
const isDragging = ref(false)
|
||||
const startX = ref(0)
|
||||
const scrollLeft = ref(0)
|
||||
|
||||
const handleToolbarWheel = (e: WheelEvent) => {
|
||||
if (scrollContainerRef.value) {
|
||||
e.preventDefault()
|
||||
scrollContainerRef.value.scrollLeft += e.deltaY
|
||||
}
|
||||
}
|
||||
|
||||
const handleMouseDown = (e: MouseEvent) => {
|
||||
if (!scrollContainerRef.value) return
|
||||
isDragging.value = true
|
||||
startX.value = e.pageX - scrollContainerRef.value.offsetLeft
|
||||
scrollLeft.value = scrollContainerRef.value.scrollLeft
|
||||
}
|
||||
|
||||
const handleMouseMove = (e: MouseEvent) => {
|
||||
if (!isDragging.value || !scrollContainerRef.value) return
|
||||
e.preventDefault()
|
||||
const x = e.pageX - scrollContainerRef.value.offsetLeft
|
||||
const walk = (x - startX.value) * 1.5
|
||||
scrollContainerRef.value.scrollLeft = scrollLeft.value - walk
|
||||
}
|
||||
|
||||
const handleMouseUp = () => {
|
||||
isDragging.value = false
|
||||
}
|
||||
|
||||
const { splitStackRef, beginSplitDrag, lowerPaneStyle, upperPaneStyle } = useVerticalSplitPane({
|
||||
defaultLowerPercent: 38
|
||||
})
|
||||
@ -503,5 +546,39 @@ function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
|
||||
|
||||
<style scoped lang="scss">
|
||||
@use "./styles/order-sub.scss";
|
||||
|
||||
.order-sub-container .main-content {
|
||||
.toolbar {
|
||||
.toolbar-left {
|
||||
cursor: grab;
|
||||
|
||||
&:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.toolbar-scroll-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
overflow-x: auto;
|
||||
scrollbar-width: none;
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.detail-page {
|
||||
height: 100%;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.order-detail-wrapper,
|
||||
.order-log-wrapper {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@ -300,6 +300,37 @@
|
||||
@closed="resetCloneOrderDialog"
|
||||
@submit="submitCloneOrder"
|
||||
/>
|
||||
<update-address-form
|
||||
v-model="updateAddressDialogVisible"
|
||||
v-model:form="updateAddressForm"
|
||||
:order-count="updateAddressOrderIds.length"
|
||||
:loading="updateAddressLoading"
|
||||
@closed="resetUpdateAddressDialog"
|
||||
@submit="submitUpdateAddress"
|
||||
/>
|
||||
<batch-async-task-form
|
||||
v-if="batchAsyncTaskConfig"
|
||||
v-model="batchAsyncTaskDialogVisible"
|
||||
:title="batchAsyncTaskConfig.title"
|
||||
:description="batchAsyncTaskConfig.description"
|
||||
:submit-button-text="batchAsyncTaskConfig.submitButtonText"
|
||||
:result-count-label="batchAsyncTaskConfig.resultCountLabel"
|
||||
:result-ids-label="batchAsyncTaskConfig.resultIdsLabel"
|
||||
:order-count="batchAsyncTaskOrderIds.length"
|
||||
:loading="batchAsyncTaskLoading"
|
||||
:phase="batchAsyncTaskPhase"
|
||||
:task-id="batchAsyncTaskProgress.taskId"
|
||||
:task-state="batchAsyncTaskProgress.taskState"
|
||||
:progress-percent="batchAsyncTaskProgress.progressPercent"
|
||||
:total-order-count="batchAsyncTaskProgress.totalOrderCount"
|
||||
:processed-order-count="batchAsyncTaskProgress.processedOrderCount"
|
||||
:result-order-count="batchAsyncTaskProgress.resultOrderCount"
|
||||
:result-order-ids="batchAsyncTaskProgress.resultOrderIds"
|
||||
:accept-message="batchAsyncTaskProgress.acceptMessage"
|
||||
:error-message="batchAsyncTaskProgress.errorMessage"
|
||||
@closed="resetBatchAsyncTaskDialog"
|
||||
@submit="submitBatchAsyncTask"
|
||||
/>
|
||||
|
||||
<el-dialog
|
||||
v-model="resolveExceptionDialogVisible"
|
||||
@ -389,6 +420,8 @@ import AllocateExpressForm from './form/AllocateExpressForm.vue'
|
||||
import StorageAllocateForm from './form/StorageAllocateForm.vue'
|
||||
import UpdateOrderMetaForm from './form/UpdateOrderMetaForm.vue'
|
||||
import CloneOrderForm from './form/CloneOrderForm.vue'
|
||||
import UpdateAddressForm from './form/UpdateAddressForm.vue'
|
||||
import BatchAsyncTaskForm from './form/BatchAsyncTaskForm.vue'
|
||||
import OrderExportProgressDialog from './component/OrderExportProgressDialog.vue'
|
||||
import { createOrderPageExport } from './utils/order-page-export'
|
||||
import { parseOrderListResponse } from './utils/order-index-helpers'
|
||||
@ -923,16 +956,30 @@ const {
|
||||
cloneOrderLoading,
|
||||
cloneSourceOrderId,
|
||||
cloneSourceOrderCode,
|
||||
updateAddressDialogVisible,
|
||||
updateAddressLoading,
|
||||
updateAddressOrderIds,
|
||||
updateAddressForm,
|
||||
batchAsyncTaskDialogVisible,
|
||||
batchAsyncTaskLoading,
|
||||
batchAsyncTaskConfig,
|
||||
batchAsyncTaskOrderIds,
|
||||
batchAsyncTaskPhase,
|
||||
batchAsyncTaskProgress,
|
||||
waveSingleFetchLoading
|
||||
},
|
||||
submitStorageAllocate,
|
||||
submitUpdateOrderMeta,
|
||||
submitCloneOrder,
|
||||
submitAllocateExpress,
|
||||
submitUpdateAddress,
|
||||
submitBatchAsyncTask,
|
||||
resetAllocateDialog,
|
||||
resetStorageAllocateDialog,
|
||||
resetUpdateOrderMetaDialog,
|
||||
resetCloneOrderDialog
|
||||
resetCloneOrderDialog,
|
||||
resetUpdateAddressDialog,
|
||||
resetBatchAsyncTaskDialog
|
||||
} = createPendingToolbarController({
|
||||
loadData,
|
||||
handleExport,
|
||||
@ -967,6 +1014,8 @@ const buttonLoadingMap = computed<Record<string, boolean>>(() => ({
|
||||
allocateLoading: allocateLoading.value,
|
||||
updateOrderMetaLoading: updateOrderMetaLoading.value,
|
||||
cloneOrderLoading: cloneOrderLoading.value,
|
||||
updateAddressLoading: updateAddressLoading.value,
|
||||
batchAsyncTaskLoading: batchAsyncTaskLoading.value,
|
||||
resolveExceptionLoading: resolveExceptionLoading.value,
|
||||
waveSingleFetchLoading: waveSingleFetchLoading.value,
|
||||
batchPrintLoading: batchPrintLoading.value
|
||||
|
||||
177
src/views/order/orderManagement/form/BatchAsyncTaskForm.vue
Normal file
177
src/views/order/orderManagement/form/BatchAsyncTaskForm.vue
Normal file
@ -0,0 +1,177 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:title="title"
|
||||
width="560px"
|
||||
align-center
|
||||
destroy-on-close
|
||||
:close-on-click-modal="!loading"
|
||||
:close-on-press-escape="!loading"
|
||||
:show-close="!loading"
|
||||
@closed="emit('closed')"
|
||||
>
|
||||
<el-alert
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
class="batch-async-task-alert"
|
||||
:title="description"
|
||||
/>
|
||||
|
||||
<el-form label-width="120px" class="batch-async-task-form">
|
||||
<el-form-item label="已选订单数">
|
||||
<span>{{ orderCount }} 条</span>
|
||||
</el-form-item>
|
||||
|
||||
<template v-if="phase === 'progress'">
|
||||
<el-form-item label="任务ID">
|
||||
<span class="batch-async-task-id">{{ taskId || '—' }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态">
|
||||
<span>{{ taskStateText }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="处理进度">
|
||||
<div class="batch-async-task-progress">
|
||||
<el-progress
|
||||
:percentage="normalizedProgressPercent"
|
||||
:status="progressBarStatus"
|
||||
:stroke-width="16"
|
||||
/>
|
||||
<div class="batch-async-task-progress__meta">
|
||||
<span>总订单:{{ totalOrderCount }}</span>
|
||||
<span>已处理:{{ processedOrderCount }}</span>
|
||||
<span>{{ resultCountLabel }}:{{ resultOrderCount }}</span>
|
||||
</div>
|
||||
<div v-if="acceptMessage" class="batch-async-task-progress__message">{{ acceptMessage }}</div>
|
||||
<div v-if="errorMessage" class="batch-async-task-progress__error">{{ errorMessage }}</div>
|
||||
<div v-if="resultOrderIds.length" class="batch-async-task-progress__ids">
|
||||
<span>{{ resultIdsLabel }}:</span>
|
||||
<span>{{ resultOrderIds.join(', ') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<el-button :disabled="loading && phase === 'progress'" @click="visible = false">
|
||||
{{ phase === 'progress' && !isFinished ? '后台处理' : '关闭' }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="phase === 'confirm'"
|
||||
type="primary"
|
||||
:loading="loading"
|
||||
@click="emit('submit')"
|
||||
>
|
||||
{{ submitButtonText }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
|
||||
const visible = defineModel<boolean>({ default: false })
|
||||
|
||||
const props = defineProps<{
|
||||
title: string
|
||||
description: string
|
||||
submitButtonText: string
|
||||
resultCountLabel: string
|
||||
resultIdsLabel: string
|
||||
orderCount: number
|
||||
loading: boolean
|
||||
phase: 'confirm' | 'progress'
|
||||
taskId?: string
|
||||
taskState?: string
|
||||
progressPercent?: number
|
||||
totalOrderCount?: number
|
||||
processedOrderCount?: number
|
||||
resultOrderCount?: number
|
||||
resultOrderIds?: Array<number | string>
|
||||
acceptMessage?: string
|
||||
errorMessage?: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'submit'): void
|
||||
(e: 'closed'): void
|
||||
}>()
|
||||
|
||||
const normalizedProgressPercent = computed(() => {
|
||||
const value = Number(props.progressPercent || 0)
|
||||
if (!Number.isFinite(value)) return 0
|
||||
return Math.max(0, Math.min(100, value))
|
||||
})
|
||||
|
||||
const taskStateText = computed(() => {
|
||||
const map: Record<string, string> = {
|
||||
submitted: '已提交',
|
||||
running: '执行中',
|
||||
success: '已完成',
|
||||
failed: '失败',
|
||||
not_found: '未找到'
|
||||
}
|
||||
const key = String(props.taskState || '').trim().toLowerCase()
|
||||
return map[key] || props.taskState || '—'
|
||||
})
|
||||
|
||||
const progressBarStatus = computed(() => {
|
||||
const key = String(props.taskState || '').trim().toLowerCase()
|
||||
if (['failed', 'not_found'].includes(key)) return 'exception'
|
||||
if (key === 'success' || normalizedProgressPercent.value >= 100) return 'success'
|
||||
return undefined
|
||||
})
|
||||
|
||||
const isFinished = computed(() => {
|
||||
const key = String(props.taskState || '').trim().toLowerCase()
|
||||
return ['success', 'failed', 'not_found'].includes(key)
|
||||
})
|
||||
|
||||
const resultOrderIds = computed(() => props.resultOrderIds || [])
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.batch-async-task-alert {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.batch-async-task-id {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.batch-async-task-progress {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.batch-async-task-progress__meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
margin-top: 8px;
|
||||
color: #606266;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.batch-async-task-progress__message,
|
||||
.batch-async-task-progress__error,
|
||||
.batch-async-task-progress__ids {
|
||||
margin-top: 6px;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.batch-async-task-progress__message {
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.batch-async-task-progress__error {
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
.batch-async-task-progress__ids {
|
||||
color: #909399;
|
||||
}
|
||||
</style>
|
||||
205
src/views/order/orderManagement/form/UpdateAddressForm.vue
Normal file
205
src/views/order/orderManagement/form/UpdateAddressForm.vue
Normal file
@ -0,0 +1,205 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
title="批量修改收件地址"
|
||||
width="640px"
|
||||
align-center
|
||||
destroy-on-close
|
||||
@closed="emit('closed')"
|
||||
>
|
||||
<el-alert
|
||||
type="warning"
|
||||
:closable="false"
|
||||
show-icon
|
||||
class="update-address-alert"
|
||||
title="修改限制"
|
||||
description="仅允许修改 post_status='none'(未分配快递)的订单。至少填写一项地址字段,空白字段不会更新到订单。"
|
||||
/>
|
||||
|
||||
<el-form label-width="96px" class="update-address-form">
|
||||
<el-form-item label="已选订单数">
|
||||
<span>{{ orderCount }} 条</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="收件人">
|
||||
<el-input v-model="form.name" clearable placeholder="留空则不修改" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号">
|
||||
<el-input v-model="form.mobile" clearable placeholder="留空则不修改" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电话">
|
||||
<el-input v-model="form.tel" clearable placeholder="留空则不修改" />
|
||||
</el-form-item>
|
||||
<el-form-item label="邮编">
|
||||
<el-input v-model="form.zip_code" clearable placeholder="留空则不修改" />
|
||||
</el-form-item>
|
||||
<el-form-item label="省份">
|
||||
<el-select
|
||||
v-model="form.province_code"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="留空则不修改"
|
||||
style="width: 100%"
|
||||
@change="handleProvinceChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in provinceOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="城市">
|
||||
<el-select
|
||||
v-model="form.city_code"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="留空则不修改"
|
||||
style="width: 100%"
|
||||
:disabled="!form.province_code"
|
||||
@change="handleCityChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in cityOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="区/县">
|
||||
<el-select
|
||||
v-model="form.area_code"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="留空则不修改"
|
||||
style="width: 100%"
|
||||
:disabled="!form.city_code"
|
||||
@change="handleAreaChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in areaOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="镇/街道">
|
||||
<el-input v-model="form.town" clearable placeholder="留空则不修改" />
|
||||
</el-form-item>
|
||||
<el-form-item label="详细地址">
|
||||
<el-input
|
||||
v-model="form.detail_address"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
resize="none"
|
||||
clearable
|
||||
placeholder="留空则不修改"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="emit('submit')">确认修改</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import {
|
||||
buildCityOptions,
|
||||
buildDistrictOptions,
|
||||
buildProvinceOptions,
|
||||
chinaRegionTree,
|
||||
findRegionNameByCode,
|
||||
getCityNodes,
|
||||
getDistrictNodes
|
||||
} from '@/views/system/setting/expressinterface/express-interface-config'
|
||||
|
||||
export type UpdateAddressFormModel = {
|
||||
name: string
|
||||
mobile: string
|
||||
tel: string
|
||||
zip_code: string
|
||||
province: string
|
||||
city: string
|
||||
area: string
|
||||
town: string
|
||||
detail_address: string
|
||||
province_code: string
|
||||
city_code: string
|
||||
area_code: string
|
||||
}
|
||||
|
||||
const visible = defineModel<boolean>({ default: false })
|
||||
const form = defineModel<UpdateAddressFormModel>('form', {
|
||||
default: () => ({
|
||||
name: '',
|
||||
mobile: '',
|
||||
tel: '',
|
||||
zip_code: '',
|
||||
province: '',
|
||||
city: '',
|
||||
area: '',
|
||||
town: '',
|
||||
detail_address: '',
|
||||
province_code: '',
|
||||
city_code: '',
|
||||
area_code: ''
|
||||
})
|
||||
})
|
||||
|
||||
defineProps<{
|
||||
orderCount: number
|
||||
loading: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'submit'): void
|
||||
(e: 'closed'): void
|
||||
}>()
|
||||
|
||||
const provinceOptions = buildProvinceOptions()
|
||||
|
||||
const cityOptions = computed(() => buildCityOptions(form.value.province_code))
|
||||
const areaOptions = computed(() => buildDistrictOptions(form.value.province_code, form.value.city_code))
|
||||
|
||||
function handleProvinceChange(code: string) {
|
||||
form.value.province_code = code || ''
|
||||
form.value.province = findRegionNameByCode(chinaRegionTree, code) || ''
|
||||
form.value.city_code = ''
|
||||
form.value.area_code = ''
|
||||
form.value.city = ''
|
||||
form.value.area = ''
|
||||
}
|
||||
|
||||
function handleCityChange(code: string) {
|
||||
form.value.city_code = code || ''
|
||||
form.value.city = findRegionNameByCode(getCityNodes(form.value.province_code), code) || ''
|
||||
form.value.area_code = ''
|
||||
form.value.area = ''
|
||||
}
|
||||
|
||||
function handleAreaChange(code: string) {
|
||||
form.value.area_code = code || ''
|
||||
form.value.area = findRegionNameByCode(
|
||||
getDistrictNodes(form.value.province_code, form.value.city_code),
|
||||
code
|
||||
) || ''
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.update-address-alert {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.update-address-form {
|
||||
max-height: 58vh;
|
||||
overflow-y: auto;
|
||||
padding-right: 4px;
|
||||
}
|
||||
</style>
|
||||
@ -268,6 +268,37 @@
|
||||
@closed="resetSyncOrderIdsDialog"
|
||||
@submit="submitSyncOrderIds"
|
||||
/>
|
||||
<update-address-form
|
||||
v-model="updateAddressDialogVisible"
|
||||
v-model:form="updateAddressForm"
|
||||
:order-count="updateAddressOrderIds.length"
|
||||
:loading="updateAddressLoading"
|
||||
@closed="resetUpdateAddressDialog"
|
||||
@submit="submitUpdateAddress"
|
||||
/>
|
||||
<batch-async-task-form
|
||||
v-if="batchAsyncTaskConfig"
|
||||
v-model="batchAsyncTaskDialogVisible"
|
||||
:title="batchAsyncTaskConfig.title"
|
||||
:description="batchAsyncTaskConfig.description"
|
||||
:submit-button-text="batchAsyncTaskConfig.submitButtonText"
|
||||
:result-count-label="batchAsyncTaskConfig.resultCountLabel"
|
||||
:result-ids-label="batchAsyncTaskConfig.resultIdsLabel"
|
||||
:order-count="batchAsyncTaskOrderIds.length"
|
||||
:loading="batchAsyncTaskLoading"
|
||||
:phase="batchAsyncTaskPhase"
|
||||
:task-id="batchAsyncTaskProgress.taskId"
|
||||
:task-state="batchAsyncTaskProgress.taskState"
|
||||
:progress-percent="batchAsyncTaskProgress.progressPercent"
|
||||
:total-order-count="batchAsyncTaskProgress.totalOrderCount"
|
||||
:processed-order-count="batchAsyncTaskProgress.processedOrderCount"
|
||||
:result-order-count="batchAsyncTaskProgress.resultOrderCount"
|
||||
:result-order-ids="batchAsyncTaskProgress.resultOrderIds"
|
||||
:accept-message="batchAsyncTaskProgress.acceptMessage"
|
||||
:error-message="batchAsyncTaskProgress.errorMessage"
|
||||
@closed="resetBatchAsyncTaskDialog"
|
||||
@submit="submitBatchAsyncTask"
|
||||
/>
|
||||
|
||||
<create-pending-order-dialog v-model="createOrderDialogVisible" @success="loadData" />
|
||||
<qrcode-dialog v-model:visible="qrDialogVisible" :code="currentWaybillCode" />
|
||||
@ -327,6 +358,8 @@ import StorageAllocateForm from './form/StorageAllocateForm.vue'
|
||||
import UpdateOrderMetaForm from './form/UpdateOrderMetaForm.vue'
|
||||
import CloneOrderForm from './form/CloneOrderForm.vue'
|
||||
import SyncOrderIdsForm from './form/SyncOrderIdsForm.vue'
|
||||
import UpdateAddressForm from './form/UpdateAddressForm.vue'
|
||||
import BatchAsyncTaskForm from './form/BatchAsyncTaskForm.vue'
|
||||
import ExpressWaybillPanel from './component/ExpressWaybillPanel.vue'
|
||||
import OrderExportProgressDialog from './component/OrderExportProgressDialog.vue'
|
||||
import { createOrderPageExport } from './utils/order-page-export'
|
||||
@ -686,6 +719,16 @@ const {
|
||||
cloneSourceOrderCode,
|
||||
syncOrderIdsDialogVisible,
|
||||
syncOrderIdsLoading,
|
||||
updateAddressDialogVisible,
|
||||
updateAddressLoading,
|
||||
updateAddressOrderIds,
|
||||
updateAddressForm,
|
||||
batchAsyncTaskDialogVisible,
|
||||
batchAsyncTaskLoading,
|
||||
batchAsyncTaskConfig,
|
||||
batchAsyncTaskOrderIds,
|
||||
batchAsyncTaskPhase,
|
||||
batchAsyncTaskProgress,
|
||||
waveSingleFetchLoading
|
||||
},
|
||||
submitStorageAllocate,
|
||||
@ -693,11 +736,15 @@ const {
|
||||
submitCloneOrder,
|
||||
submitSyncOrderIds,
|
||||
submitAllocateExpress,
|
||||
submitUpdateAddress,
|
||||
submitBatchAsyncTask,
|
||||
resetAllocateDialog,
|
||||
resetStorageAllocateDialog,
|
||||
resetUpdateOrderMetaDialog,
|
||||
resetCloneOrderDialog,
|
||||
resetSyncOrderIdsDialog
|
||||
resetSyncOrderIdsDialog,
|
||||
resetUpdateAddressDialog,
|
||||
resetBatchAsyncTaskDialog
|
||||
} = createPendingToolbarController({
|
||||
loadData,
|
||||
handleExport,
|
||||
@ -800,6 +847,8 @@ const buttonLoadingMap = computed<Record<string, boolean>>(() => ({
|
||||
updateOrderMetaLoading: updateOrderMetaLoading.value,
|
||||
cloneOrderLoading: cloneOrderLoading.value,
|
||||
syncOrderIdsLoading: syncOrderIdsLoading.value,
|
||||
updateAddressLoading: updateAddressLoading.value,
|
||||
batchAsyncTaskLoading: batchAsyncTaskLoading.value,
|
||||
waveSingleFetchLoading: waveSingleFetchLoading.value,
|
||||
batchPrintLoading: batchPrintLoading.value
|
||||
}))
|
||||
|
||||
@ -2,10 +2,13 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { computed, reactive, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import {
|
||||
PENDING_TOOLBAR_API_ACTIONS,
|
||||
PENDING_BATCH_ASYNC_TASK_ACTIONS,
|
||||
PENDING_SYNC_TOOLBAR_API_ACTIONS,
|
||||
REVIEW_TOOLBAR_API_ACTIONS,
|
||||
type PendingBatchAsyncTaskConfig,
|
||||
type ToolbarApiActionConfig
|
||||
} from '../config/order-common-config'
|
||||
import type { UpdateAddressFormModel } from '../form/UpdateAddressForm.vue'
|
||||
import { orderWaveSingleFetchByIds } from '@/api/order.wave/orderwave'
|
||||
import { navigateToSandanWaveTab } from '@/utils/wave-order-nav'
|
||||
|
||||
@ -81,7 +84,7 @@ export function createPendingToolbarActionMap(params: {
|
||||
...params.baseActions
|
||||
}
|
||||
|
||||
for (const config of PENDING_TOOLBAR_API_ACTIONS) {
|
||||
for (const config of PENDING_SYNC_TOOLBAR_API_ACTIONS) {
|
||||
actionMap[config.action] = () =>
|
||||
executeApiAction({
|
||||
ids: params.getSelectedIds(),
|
||||
@ -95,6 +98,89 @@ export function createPendingToolbarActionMap(params: {
|
||||
return actionMap
|
||||
}
|
||||
|
||||
function createEmptyUpdateAddressForm(): UpdateAddressFormModel {
|
||||
return {
|
||||
name: '',
|
||||
mobile: '',
|
||||
tel: '',
|
||||
zip_code: '',
|
||||
province: '',
|
||||
city: '',
|
||||
area: '',
|
||||
town: '',
|
||||
detail_address: '',
|
||||
province_code: '',
|
||||
city_code: '',
|
||||
area_code: ''
|
||||
}
|
||||
}
|
||||
|
||||
function buildUpdateAddressPayload(ids: OrderId[], form: UpdateAddressFormModel) {
|
||||
const payload: Record<string, unknown> = {
|
||||
ids: ids.map((id) => Number(id)).filter((id) => Number.isInteger(id) && id > 0)
|
||||
}
|
||||
const fields: Array<keyof UpdateAddressFormModel> = [
|
||||
'name',
|
||||
'mobile',
|
||||
'tel',
|
||||
'zip_code',
|
||||
'province',
|
||||
'city',
|
||||
'area',
|
||||
'town',
|
||||
'detail_address'
|
||||
]
|
||||
let hasAddressField = false
|
||||
for (const field of fields) {
|
||||
const value = String(form[field] ?? '').trim()
|
||||
if (value) {
|
||||
payload[field] = value
|
||||
hasAddressField = true
|
||||
}
|
||||
}
|
||||
return { payload, hasAddressField }
|
||||
}
|
||||
|
||||
function normalizeBatchTaskState(value: unknown) {
|
||||
return String(value ?? '').trim().toLowerCase()
|
||||
}
|
||||
|
||||
function isBatchTaskSuccessState(state: string) {
|
||||
return state === 'success'
|
||||
}
|
||||
|
||||
function isBatchTaskFailureState(state: string) {
|
||||
return ['failed', 'not_found'].includes(state)
|
||||
}
|
||||
|
||||
function applyBatchAsyncTaskProgress(
|
||||
target: {
|
||||
taskId: string
|
||||
taskState: string
|
||||
progressPercent: number
|
||||
totalOrderCount: number
|
||||
processedOrderCount: number
|
||||
resultOrderCount: number
|
||||
resultOrderIds: Array<number | string>
|
||||
acceptMessage: string
|
||||
errorMessage: string
|
||||
},
|
||||
progress: Record<string, any>,
|
||||
config: PendingBatchAsyncTaskConfig,
|
||||
fallbackTaskId = ''
|
||||
) {
|
||||
target.taskId = String(progress.task_id || fallbackTaskId || target.taskId || '')
|
||||
target.taskState = normalizeBatchTaskState(progress.state || progress.status)
|
||||
target.progressPercent = Number(progress.progress_percent ?? target.progressPercent ?? 0) || 0
|
||||
target.totalOrderCount = Number(progress.total_order_count ?? target.totalOrderCount ?? 0) || 0
|
||||
target.processedOrderCount = Number(progress.processed_order_count ?? target.processedOrderCount ?? 0) || 0
|
||||
target.resultOrderCount = Number(progress[config.progressCountKey] ?? target.resultOrderCount ?? 0) || 0
|
||||
const resultIds = progress[config.progressIdsKey]
|
||||
target.resultOrderIds = Array.isArray(resultIds) ? resultIds : []
|
||||
target.acceptMessage = String(progress.message || target.acceptMessage || '')
|
||||
target.errorMessage = String(progress.error_message || progress.error || target.errorMessage || '')
|
||||
}
|
||||
|
||||
export function createReviewToolbarActionMap(params: {
|
||||
baseActions: Record<string, ActionHandler>
|
||||
getSelectedIds: () => OrderId[]
|
||||
@ -303,6 +389,28 @@ export function createPendingToolbarController(params: {
|
||||
const syncOrderIdsDialogVisible = ref(false)
|
||||
const syncOrderIdsLoading = ref(false)
|
||||
|
||||
const updateAddressDialogVisible = ref(false)
|
||||
const updateAddressLoading = ref(false)
|
||||
const updateAddressOrderIds = ref<number[]>([])
|
||||
const updateAddressForm = reactive(createEmptyUpdateAddressForm())
|
||||
|
||||
const batchAsyncTaskDialogVisible = ref(false)
|
||||
const batchAsyncTaskLoading = ref(false)
|
||||
const batchAsyncTaskConfig = ref<PendingBatchAsyncTaskConfig | null>(null)
|
||||
const batchAsyncTaskOrderIds = ref<number[]>([])
|
||||
const batchAsyncTaskPhase = ref<'confirm' | 'progress'>('confirm')
|
||||
const batchAsyncTaskProgress = reactive({
|
||||
taskId: '',
|
||||
taskState: '',
|
||||
progressPercent: 0,
|
||||
totalOrderCount: 0,
|
||||
processedOrderCount: 0,
|
||||
resultOrderCount: 0,
|
||||
resultOrderIds: [] as Array<number | string>,
|
||||
acceptMessage: '',
|
||||
errorMessage: ''
|
||||
})
|
||||
|
||||
const waveSingleFetchLoading = ref(false)
|
||||
|
||||
async function handleWaveSingleFetchByIds() {
|
||||
@ -382,6 +490,7 @@ export function createPendingToolbarController(params: {
|
||||
openAllocateExpressDialog,
|
||||
openUpdateOrderExpressDialog: () => openUpdateOrderMetaDialog('express'),
|
||||
openUpdateOrderPlatformDialog: () => openUpdateOrderMetaDialog('platform'),
|
||||
openUpdateAddressDialog,
|
||||
openCreateOrderDialog: params.openCreateOrderDialog,
|
||||
openCloneOrderDialog,
|
||||
openSyncOrderIdsDialog,
|
||||
@ -394,6 +503,10 @@ export function createPendingToolbarController(params: {
|
||||
loadData: params.loadData
|
||||
})
|
||||
|
||||
for (const config of PENDING_BATCH_ASYNC_TASK_ACTIONS) {
|
||||
actionMap[config.action] = () => openBatchAsyncTaskDialog(config)
|
||||
}
|
||||
|
||||
function openStorageDialog(mode: 'allocate' | 'cancel') {
|
||||
const rows = params.getSelectedRows()
|
||||
if (!rows.length) {
|
||||
@ -719,6 +832,179 @@ export function createPendingToolbarController(params: {
|
||||
|
||||
function resetSyncOrderIdsDialog() {}
|
||||
|
||||
function openUpdateAddressDialog() {
|
||||
const ids = params.getSelectedIds()
|
||||
if (!ids.length) {
|
||||
ElMessage.warning('请先勾选需要修改地址的订单')
|
||||
return
|
||||
}
|
||||
updateAddressOrderIds.value = [...ids]
|
||||
Object.assign(updateAddressForm, createEmptyUpdateAddressForm())
|
||||
updateAddressDialogVisible.value = true
|
||||
}
|
||||
|
||||
async function submitUpdateAddress() {
|
||||
if (updateAddressLoading.value) return
|
||||
const ids = [...updateAddressOrderIds.value]
|
||||
if (!ids.length) {
|
||||
ElMessage.error('没有可提交的订单')
|
||||
return
|
||||
}
|
||||
const { payload, hasAddressField } = buildUpdateAddressPayload(ids, updateAddressForm)
|
||||
if (!hasAddressField) {
|
||||
ElMessage.warning('请至少填写一项地址字段')
|
||||
return
|
||||
}
|
||||
updateAddressLoading.value = true
|
||||
try {
|
||||
const res = await params.pendingApi.updateAddress(payload)
|
||||
const ok = res && (res.code === 1 || res.code === 200 || res.flag === 'success')
|
||||
if (!ok) {
|
||||
ElMessage.error(res?.message || '批量修改地址失败')
|
||||
return
|
||||
}
|
||||
const updated = Number(res?.data?.updated_count ?? res?.updated_count ?? ids.length) || ids.length
|
||||
ElMessage.success(`收件地址修改成功 ${updated} 条`)
|
||||
updateAddressDialogVisible.value = false
|
||||
params.clearSelection()
|
||||
await params.loadData()
|
||||
} catch {
|
||||
ElMessage.error('批量修改地址失败')
|
||||
} finally {
|
||||
updateAddressLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function resetUpdateAddressDialog() {
|
||||
updateAddressOrderIds.value = []
|
||||
Object.assign(updateAddressForm, createEmptyUpdateAddressForm())
|
||||
}
|
||||
|
||||
function resetBatchAsyncTaskDialog() {
|
||||
batchAsyncTaskConfig.value = null
|
||||
batchAsyncTaskOrderIds.value = []
|
||||
batchAsyncTaskPhase.value = 'confirm'
|
||||
batchAsyncTaskProgress.taskId = ''
|
||||
batchAsyncTaskProgress.taskState = ''
|
||||
batchAsyncTaskProgress.progressPercent = 0
|
||||
batchAsyncTaskProgress.totalOrderCount = 0
|
||||
batchAsyncTaskProgress.processedOrderCount = 0
|
||||
batchAsyncTaskProgress.resultOrderCount = 0
|
||||
batchAsyncTaskProgress.resultOrderIds = []
|
||||
batchAsyncTaskProgress.acceptMessage = ''
|
||||
batchAsyncTaskProgress.errorMessage = ''
|
||||
}
|
||||
|
||||
function openBatchAsyncTaskDialog(config: PendingBatchAsyncTaskConfig) {
|
||||
const ids = params.getSelectedIds()
|
||||
if (!ids.length) {
|
||||
ElMessage.warning('请先选择订单')
|
||||
return
|
||||
}
|
||||
if (batchAsyncTaskLoading.value) return
|
||||
resetBatchAsyncTaskDialog()
|
||||
batchAsyncTaskConfig.value = config
|
||||
batchAsyncTaskOrderIds.value = [...ids]
|
||||
batchAsyncTaskPhase.value = 'confirm'
|
||||
batchAsyncTaskDialogVisible.value = true
|
||||
}
|
||||
|
||||
async function pollBatchAsyncTaskProgress(taskId: string, config: PendingBatchAsyncTaskConfig) {
|
||||
const progressApi = params.pendingApi[config.progressApiMethod]
|
||||
if (typeof progressApi !== 'function') {
|
||||
throw new Error(`未找到进度接口:${config.progressApiMethod}`)
|
||||
}
|
||||
|
||||
let latestPayload: Record<string, any> = {}
|
||||
for (let attempt = 0; attempt < 120; attempt += 1) {
|
||||
const progressRes = await progressApi({ task_id: taskId })
|
||||
const progressOk = progressRes && (progressRes.code === 1 || progressRes.code === 200 || progressRes.flag === 'success')
|
||||
if (!progressOk) {
|
||||
throw new Error(progressRes?.message || '查询任务进度失败')
|
||||
}
|
||||
latestPayload = getApiResponsePayload(progressRes)
|
||||
applyBatchAsyncTaskProgress(batchAsyncTaskProgress, latestPayload, config, taskId)
|
||||
const state = normalizeBatchTaskState(latestPayload.state || latestPayload.status)
|
||||
if (isBatchTaskSuccessState(state)) {
|
||||
return latestPayload
|
||||
}
|
||||
if (isBatchTaskFailureState(state)) {
|
||||
throw new Error(
|
||||
String(latestPayload.error_message || latestPayload.error || config.failText)
|
||||
)
|
||||
}
|
||||
await sleep(1500)
|
||||
}
|
||||
return latestPayload
|
||||
}
|
||||
|
||||
async function submitBatchAsyncTask() {
|
||||
const config = batchAsyncTaskConfig.value
|
||||
if (!config || batchAsyncTaskLoading.value) return
|
||||
const order_ids = [...batchAsyncTaskOrderIds.value]
|
||||
if (!order_ids.length) {
|
||||
ElMessage.error('没有可提交的订单')
|
||||
return
|
||||
}
|
||||
|
||||
const submitApi = params.pendingApi[config.submitApiMethod]
|
||||
if (typeof submitApi !== 'function') {
|
||||
ElMessage.error(`未找到提交接口:${config.submitApiMethod}`)
|
||||
return
|
||||
}
|
||||
|
||||
batchAsyncTaskLoading.value = true
|
||||
try {
|
||||
const res = await submitApi({ order_ids })
|
||||
const ok = res && (res.code === 1 || res.code === 200 || res.flag === 'success')
|
||||
if (!ok) {
|
||||
ElMessage.error(res?.message || config.failText)
|
||||
return
|
||||
}
|
||||
|
||||
const acceptedPayload = getApiResponsePayload(res)
|
||||
const taskId = String(acceptedPayload.task_id || res?.task_id || '').trim()
|
||||
batchAsyncTaskPhase.value = 'progress'
|
||||
batchAsyncTaskProgress.acceptMessage = String(acceptedPayload.message || res?.message || '任务已提交')
|
||||
batchAsyncTaskProgress.totalOrderCount = order_ids.length
|
||||
|
||||
if (!taskId) {
|
||||
ElMessage.success(batchAsyncTaskProgress.acceptMessage || '任务已提交')
|
||||
batchAsyncTaskDialogVisible.value = false
|
||||
params.clearSelection()
|
||||
await params.loadData()
|
||||
return
|
||||
}
|
||||
|
||||
applyBatchAsyncTaskProgress(batchAsyncTaskProgress, {
|
||||
task_id: taskId,
|
||||
state: acceptedPayload.state || 'submitted',
|
||||
progress_percent: 0,
|
||||
total_order_count: order_ids.length,
|
||||
processed_order_count: 0,
|
||||
[config.progressCountKey]: 0,
|
||||
message: batchAsyncTaskProgress.acceptMessage
|
||||
}, config, taskId)
|
||||
|
||||
ElMessage.success(`${batchAsyncTaskProgress.acceptMessage}(任务ID: ${taskId})`)
|
||||
params.clearSelection()
|
||||
|
||||
const progressPayload = await pollBatchAsyncTaskProgress(taskId, config)
|
||||
const resultCount = Number(progressPayload[config.progressCountKey] ?? order_ids.length) || order_ids.length
|
||||
ElMessage.success(`${config.title}完成 ${resultCount} 条`)
|
||||
await params.loadData()
|
||||
} catch (error: any) {
|
||||
const message = String(error?.message || config.failText)
|
||||
batchAsyncTaskProgress.errorMessage = message
|
||||
if (batchAsyncTaskPhase.value === 'progress') {
|
||||
batchAsyncTaskProgress.taskState = 'failed'
|
||||
}
|
||||
ElMessage.error(message)
|
||||
} finally {
|
||||
batchAsyncTaskLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
actionMap,
|
||||
dialogState: {
|
||||
@ -748,6 +1034,16 @@ export function createPendingToolbarController(params: {
|
||||
cloneSourceOrderCode,
|
||||
syncOrderIdsDialogVisible,
|
||||
syncOrderIdsLoading,
|
||||
updateAddressDialogVisible,
|
||||
updateAddressLoading,
|
||||
updateAddressOrderIds,
|
||||
updateAddressForm,
|
||||
batchAsyncTaskDialogVisible,
|
||||
batchAsyncTaskLoading,
|
||||
batchAsyncTaskConfig,
|
||||
batchAsyncTaskOrderIds,
|
||||
batchAsyncTaskPhase,
|
||||
batchAsyncTaskProgress,
|
||||
waveSingleFetchLoading
|
||||
},
|
||||
submitStorageAllocate,
|
||||
@ -755,11 +1051,15 @@ export function createPendingToolbarController(params: {
|
||||
submitCloneOrder,
|
||||
submitSyncOrderIds,
|
||||
submitAllocateExpress,
|
||||
submitUpdateAddress,
|
||||
submitBatchAsyncTask,
|
||||
resetAllocateDialog,
|
||||
resetStorageAllocateDialog,
|
||||
resetUpdateOrderMetaDialog,
|
||||
resetCloneOrderDialog,
|
||||
resetSyncOrderIdsDialog
|
||||
resetSyncOrderIdsDialog,
|
||||
resetUpdateAddressDialog,
|
||||
resetBatchAsyncTaskDialog
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -294,7 +294,7 @@ function getOrderInterceptStatus(order: any): string {
|
||||
return String((order as any)?.intercept_status ?? 'none').trim()
|
||||
}
|
||||
|
||||
function getOrderKey(order: any, index: number): string {
|
||||
function getOrderKey(order: any, index: string | number): string {
|
||||
const field = props.rowKeyField
|
||||
const val = field.split('.').reduce((obj: any, key: string) => obj?.[key], order)
|
||||
return String(val ?? index)
|
||||
|
||||
@ -944,7 +944,7 @@ async function handleConfirmIntercept() {
|
||||
if (id == null) return
|
||||
try {
|
||||
await ElMessageBox.confirm(`确认对订单 ID ${id} 执行拦截操作?`, '确认拦截', {
|
||||
type: 'danger'
|
||||
type: 'warning'
|
||||
})
|
||||
} catch {
|
||||
return
|
||||
|
||||
@ -426,6 +426,7 @@
|
||||
:error-message="platformPrintErrorMessage"
|
||||
:payload="platformPrintPayload"
|
||||
:request-meta="platformPrintRequestMeta"
|
||||
enable-printer-picker
|
||||
@refresh="handlePlatformPrintDialogRefresh"
|
||||
@print-success="handlePlatformPrintListRefresh"
|
||||
/>
|
||||
|
||||
@ -27,8 +27,67 @@
|
||||
:value="item.stationId"
|
||||
/>
|
||||
</el-select>
|
||||
<template v-if="enablePrinterPicker">
|
||||
<el-select
|
||||
v-model="printSettings.defaultPrinter"
|
||||
placeholder="请选择默认打印机"
|
||||
size="small"
|
||||
filterable
|
||||
clearable
|
||||
:loading="printerLoading"
|
||||
@change="handleDefaultPrinterChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in printerOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button size="small" :loading="printerLoading" @click="loadPrinterOptions">
|
||||
刷新打印机
|
||||
</el-button>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<section v-if="enablePrinterPicker && uniqueExpressList.length > 0" class="wave-print-express-printers">
|
||||
<div class="wave-print-express-printers__header">
|
||||
<span class="wave-print-express-printers__title">快递打印机(留空则使用默认打印机)</span>
|
||||
</div>
|
||||
<div class="wave-print-express-printers__table">
|
||||
<div class="wave-print-express-printers__row wave-print-express-printers__row--head">
|
||||
<div class="wave-print-express-printers__cell wave-print-express-printers__cell--express">快递</div>
|
||||
<div class="wave-print-express-printers__cell wave-print-express-printers__cell--printer">打印机</div>
|
||||
</div>
|
||||
<div
|
||||
v-for="item in uniqueExpressList"
|
||||
:key="item.key"
|
||||
class="wave-print-express-printers__row"
|
||||
>
|
||||
<div class="wave-print-express-printers__cell wave-print-express-printers__cell--express">
|
||||
{{ item.label }}
|
||||
</div>
|
||||
<div class="wave-print-express-printers__cell wave-print-express-printers__cell--printer">
|
||||
<el-select
|
||||
v-model="expressPrinterOverrides[item.key]"
|
||||
placeholder="同默认打印机"
|
||||
size="small"
|
||||
filterable
|
||||
clearable
|
||||
:loading="printerLoading"
|
||||
>
|
||||
<el-option
|
||||
v-for="printer in printerOptions"
|
||||
:key="`${item.key}-${printer.value}`"
|
||||
:label="printer.label"
|
||||
:value="printer.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="wave-print-meta">
|
||||
<span class="wave-print-meta__hint">{{ browserPrintHint }}</span>
|
||||
<span>仓库:<code>{{ requestMeta?.warehouse_id ?? '—' }}</code></span>
|
||||
@ -176,12 +235,15 @@ import {
|
||||
import { usePrinterComponentStore } from '@/stores/modules/printerComponent'
|
||||
import {
|
||||
buildWaveGroupsForNotifyLock,
|
||||
collectWavePlatformPrintComponents,
|
||||
fetchConnectedComponentPrinters,
|
||||
parseExpressPrinterMapFromStationDetail,
|
||||
sendWavePlatformBrowserPrint,
|
||||
type BrowserWavePrintItemResult
|
||||
} from '../config/print'
|
||||
|
||||
const WAVE_PRINT_STATION_STORAGE_KEY = 'wave_platform_print_station_id'
|
||||
const WAVE_PRINT_DEFAULT_PRINTER_STORAGE_KEY = 'wave_platform_print_default_printer'
|
||||
|
||||
type AnyRecord = Record<string, unknown>
|
||||
type WaveGroupPlatform = {
|
||||
@ -208,6 +270,8 @@ const props = defineProps<{
|
||||
errorMessage: string
|
||||
payload: WavePlatformPrintDataPayload | null
|
||||
requestMeta: { warehouse_id: number; wave_ids: Array<number | string> } | null
|
||||
/** 散单波次等场景:展示本机打印机选择 */
|
||||
enablePrinterPicker?: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
@ -229,15 +293,21 @@ const stationOptions = ref<StationOption[]>([])
|
||||
const stationLoading = ref(false)
|
||||
const stationPrinting = ref(false)
|
||||
const browserPrinting = ref(false)
|
||||
const printerLoading = ref(false)
|
||||
const printerOptions = ref<Array<{ label: string; value: string }>>([])
|
||||
const expressPrinterOverrides = reactive<Record<string, string>>({})
|
||||
/** print.send express 的 requestCode,同一次弹窗会话内保持不变 */
|
||||
const expressRequestCode = ref('')
|
||||
const unlockAllLoading = ref(false)
|
||||
const unlockingPlatformKey = ref('')
|
||||
const unlockedPlatformKeys = ref<Set<string>>(new Set())
|
||||
const printSettings = reactive({
|
||||
station: '' as string
|
||||
station: '' as string,
|
||||
defaultPrinter: '' as string
|
||||
})
|
||||
|
||||
const enablePrinterPicker = computed(() => props.enablePrinterPicker === true)
|
||||
|
||||
const visibleProxy = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (v: boolean) => emit('update:modelValue', v)
|
||||
@ -294,7 +364,14 @@ watch(
|
||||
unlockingPlatformKey.value = ''
|
||||
unlockAllLoading.value = false
|
||||
expressRequestCode.value = buildExpressRequestCode()
|
||||
void loadStationOptions()
|
||||
void (async () => {
|
||||
resetExpressPrinterOverrides()
|
||||
await loadStationOptions()
|
||||
if (enablePrinterPicker.value) {
|
||||
await loadPrinterOptions()
|
||||
await applyStationPrinterDefaults()
|
||||
}
|
||||
})()
|
||||
} else {
|
||||
expressRequestCode.value = ''
|
||||
}
|
||||
@ -307,6 +384,13 @@ watch(
|
||||
// 父级刷新到新 payload 后,清空本地已解锁过滤,确保页面展示后端最新状态
|
||||
unlockedPlatformKeys.value = new Set()
|
||||
unlockingPlatformKey.value = ''
|
||||
if (props.modelValue && enablePrinterPicker.value) {
|
||||
void (async () => {
|
||||
resetExpressPrinterOverrides()
|
||||
await loadPrinterOptions()
|
||||
await applyStationPrinterDefaults()
|
||||
})()
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
@ -337,6 +421,34 @@ const hasLockedWaveGroups = computed(() => {
|
||||
return lockedWaveGroupList.value.length > 0
|
||||
})
|
||||
|
||||
type ExpressPrinterRow = {
|
||||
key: string
|
||||
label: string
|
||||
sys_logistics_code: string
|
||||
sys_logistics_name: string
|
||||
}
|
||||
|
||||
const uniqueExpressList = computed<ExpressPrinterRow[]>(() => {
|
||||
const map = new Map<string, ExpressPrinterRow>()
|
||||
const appendFromPlatforms = (platforms: WaveGroupPlatform[]) => {
|
||||
platforms.forEach((platform) => {
|
||||
const code = String(platform.sys_logistics_code || '').trim()
|
||||
const name = String(platform.sys_logistics_name || '').trim()
|
||||
const key = code || name || platform.platform || platform.platformKey
|
||||
if (!key || map.has(key)) return
|
||||
const labelParts = [name, code].filter(Boolean)
|
||||
map.set(key, {
|
||||
key,
|
||||
label: labelParts.length ? labelParts.join(' / ') : platform.platform_name || key,
|
||||
sys_logistics_code: code,
|
||||
sys_logistics_name: name
|
||||
})
|
||||
})
|
||||
}
|
||||
waveGroupList.value.forEach((wave) => appendFromPlatforms(wave.platforms))
|
||||
return [...map.values()]
|
||||
})
|
||||
|
||||
const browserPrintHint = computed(() => getBrowserPrintUsageHint())
|
||||
|
||||
function toText(v: unknown, fallback = '—'): string {
|
||||
@ -703,13 +815,164 @@ async function loadStationOptions() {
|
||||
}
|
||||
}
|
||||
|
||||
function handleStationChange(val: string | number) {
|
||||
async function handleStationChange(val: string | number) {
|
||||
const stationId = String(val || '').trim()
|
||||
if (!stationId) {
|
||||
clearSavedStationId()
|
||||
return
|
||||
}
|
||||
saveStationId(stationId)
|
||||
if (enablePrinterPicker.value) {
|
||||
await loadComputerPrintersForStation(stationId).then((names) => mergePrinterOptionNames(names))
|
||||
await applyStationPrinterDefaults()
|
||||
}
|
||||
}
|
||||
|
||||
function resetExpressPrinterOverrides() {
|
||||
Object.keys(expressPrinterOverrides).forEach((key) => {
|
||||
delete expressPrinterOverrides[key]
|
||||
})
|
||||
uniqueExpressList.value.forEach((item) => {
|
||||
expressPrinterOverrides[item.key] = ''
|
||||
})
|
||||
}
|
||||
|
||||
function mergePrinterOptionNames(names: string[]) {
|
||||
const merged = new Map<string, { label: string; value: string }>()
|
||||
printerOptions.value.forEach((item) => merged.set(item.value, item))
|
||||
names.forEach((raw) => {
|
||||
const name = String(raw || '').trim()
|
||||
if (!name || merged.has(name)) return
|
||||
merged.set(name, { label: name, value: name })
|
||||
})
|
||||
printerOptions.value = [...merged.values()].sort((a, b) => a.label.localeCompare(b.label, 'zh-CN'))
|
||||
}
|
||||
|
||||
async function loadComputerPrintersForStation(stationId: string): Promise<string[]> {
|
||||
const station = stationOptions.value.find((item) => item.stationId === stationId)
|
||||
const computerId = String(station?.computer_id_legacy || '').trim()
|
||||
if (!computerId) return []
|
||||
try {
|
||||
const res: any = await stationApi.getComputerPrinter(computerId)
|
||||
if (!isApiSuccess(res)) return []
|
||||
const root = res?.data
|
||||
const printerList = Array.isArray(root) ? root : Array.isArray(root?.list) ? root.list : []
|
||||
return printerList
|
||||
.map((item: any) => String(item?.name ?? item?.printerName ?? item ?? '').trim())
|
||||
.filter(Boolean)
|
||||
} catch {
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
async function loadPrinterOptions() {
|
||||
if (!enablePrinterPicker.value) return
|
||||
printerLoading.value = true
|
||||
try {
|
||||
usePrinterComponentStore().refreshFromRuntime()
|
||||
const waveGroups = props.payload?.waveGroups
|
||||
const componentNames = Array.isArray(waveGroups) && waveGroups.length
|
||||
? collectWavePlatformPrintComponents(waveGroups)
|
||||
: undefined
|
||||
const componentResult = await fetchConnectedComponentPrinters(componentNames)
|
||||
mergePrinterOptionNames(componentResult.printers)
|
||||
|
||||
const stationId = String(printSettings.station || '').trim()
|
||||
if (stationId) {
|
||||
const computerPrinters = await loadComputerPrintersForStation(stationId)
|
||||
mergePrinterOptionNames(computerPrinters)
|
||||
}
|
||||
|
||||
if (!printSettings.defaultPrinter) {
|
||||
const saved = getSavedDefaultPrinter()
|
||||
if (saved && printerOptions.value.some((item) => item.value === saved)) {
|
||||
printSettings.defaultPrinter = saved
|
||||
} else if (componentResult.defaultPrinter) {
|
||||
printSettings.defaultPrinter = componentResult.defaultPrinter
|
||||
}
|
||||
}
|
||||
|
||||
if (!printerOptions.value.length) {
|
||||
ElMessage.warning('未获取到本机打印机,请确认打印组件已连接后点击「刷新打印机」')
|
||||
}
|
||||
} catch {
|
||||
ElMessage.warning('加载本机打印机失败')
|
||||
} finally {
|
||||
printerLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function applyStationPrinterDefaults() {
|
||||
const stationId = String(printSettings.station || '').trim()
|
||||
if (!stationId) return
|
||||
|
||||
const { defaultPrinter, expressPrinterMap } = await loadStationPrinterBindings(stationId)
|
||||
mergePrinterOptionNames([defaultPrinter, ...Object.values(expressPrinterMap)])
|
||||
|
||||
const computerPrinters = await loadComputerPrintersForStation(stationId)
|
||||
mergePrinterOptionNames(computerPrinters)
|
||||
|
||||
const saved = getSavedDefaultPrinter()
|
||||
if (saved && printerOptions.value.some((item) => item.value === saved)) {
|
||||
printSettings.defaultPrinter = saved
|
||||
} else if (defaultPrinter) {
|
||||
printSettings.defaultPrinter = defaultPrinter
|
||||
}
|
||||
|
||||
uniqueExpressList.value.forEach((item) => {
|
||||
const code = item.sys_logistics_code
|
||||
const name = item.sys_logistics_name
|
||||
const mapped = (code && expressPrinterMap[code]) || (name && expressPrinterMap[name]) || ''
|
||||
if (mapped) {
|
||||
expressPrinterOverrides[item.key] = mapped
|
||||
mergePrinterOptionNames([mapped])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function handleDefaultPrinterChange(val: string | number) {
|
||||
const printer = String(val || '').trim()
|
||||
if (!printer) {
|
||||
clearSavedDefaultPrinter()
|
||||
return
|
||||
}
|
||||
saveDefaultPrinter(printer)
|
||||
}
|
||||
|
||||
function buildEffectiveExpressPrinterMap(stationMap: Record<string, string>): Record<string, string> {
|
||||
const merged = { ...stationMap }
|
||||
uniqueExpressList.value.forEach((item) => {
|
||||
const selected = String(expressPrinterOverrides[item.key] || '').trim()
|
||||
if (!selected) return
|
||||
if (item.sys_logistics_code) merged[item.sys_logistics_code] = selected
|
||||
if (item.sys_logistics_name) merged[item.sys_logistics_name] = selected
|
||||
merged[item.key] = selected
|
||||
})
|
||||
return merged
|
||||
}
|
||||
|
||||
function getSavedDefaultPrinter() {
|
||||
try {
|
||||
return String(localStorage.getItem(WAVE_PRINT_DEFAULT_PRINTER_STORAGE_KEY) || '').trim()
|
||||
} catch {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
function saveDefaultPrinter(printer: string) {
|
||||
try {
|
||||
localStorage.setItem(WAVE_PRINT_DEFAULT_PRINTER_STORAGE_KEY, printer)
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
function clearSavedDefaultPrinter() {
|
||||
try {
|
||||
localStorage.removeItem(WAVE_PRINT_DEFAULT_PRINTER_STORAGE_KEY)
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
function buildExpressRequestCode(): string {
|
||||
@ -906,12 +1169,23 @@ async function printReport() {
|
||||
usePrinterComponentStore().refreshFromRuntime()
|
||||
|
||||
const hasStation = String(printSettings.station || '').trim().length > 0
|
||||
const { defaultPrinter, expressPrinterMap } = hasStation
|
||||
const { defaultPrinter: stationDefaultPrinter, expressPrinterMap: stationExpressMap } = hasStation
|
||||
? await loadStationPrinterBindings(printSettings.station)
|
||||
: { defaultPrinter: '', expressPrinterMap: {} as Record<string, string> }
|
||||
|
||||
const userDefaultPrinter = String(printSettings.defaultPrinter || stationDefaultPrinter || '').trim()
|
||||
const expressPrinterMap = enablePrinterPicker.value
|
||||
? buildEffectiveExpressPrinterMap(stationExpressMap)
|
||||
: stationExpressMap
|
||||
|
||||
if (enablePrinterPicker.value && !userDefaultPrinter && !Object.keys(expressPrinterMap).length) {
|
||||
ElMessage.warning('请选择默认打印机,或为各快递指定打印机')
|
||||
return
|
||||
}
|
||||
|
||||
console.log('[wave browser print] printReport: 打印机映射来源', {
|
||||
hasStation,
|
||||
defaultPrinter,
|
||||
userDefaultPrinter,
|
||||
expressPrinterMapKeys: Object.keys(expressPrinterMap),
|
||||
})
|
||||
|
||||
@ -920,7 +1194,7 @@ async function printReport() {
|
||||
warehouseId,
|
||||
waveGroups,
|
||||
requestCode,
|
||||
defaultPrinter,
|
||||
defaultPrinter: userDefaultPrinter,
|
||||
expressPrinterMap
|
||||
})
|
||||
|
||||
@ -1014,6 +1288,8 @@ async function printReport() {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-bottom: 8px;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
|
||||
.el-select {
|
||||
min-width: 240px;
|
||||
@ -1021,6 +1297,64 @@ async function printReport() {
|
||||
}
|
||||
}
|
||||
|
||||
.wave-print-express-printers {
|
||||
margin-bottom: 12px;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 6px;
|
||||
background: #fafafa;
|
||||
overflow: hidden;
|
||||
|
||||
&__header {
|
||||
padding: 8px 10px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
background: #f5f7fa;
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
&__table {
|
||||
padding: 8px 10px 10px;
|
||||
}
|
||||
|
||||
&__row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin-bottom: 8px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&--head {
|
||||
margin-bottom: 6px;
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
&__cell {
|
||||
&--express {
|
||||
flex: 0 0 180px;
|
||||
font-size: 12px;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
&--printer {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wave-print-body {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
|
||||
@ -1630,25 +1630,51 @@ function pickBestPrinterName(preferred: string, candidates: string[], fallback =
|
||||
return fallbackTrim || candidates[0] || '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印前向组件查询 getPrinters,用组件内真实打印机名下发(与 printserver / oldprint 一致)。
|
||||
*/
|
||||
async function alignComponentPrinterName(
|
||||
function parseComponentGetPrintersResponse(
|
||||
response: Record<string, unknown>,
|
||||
useJingdongProtocol: boolean,
|
||||
): ComponentPrinterListResult {
|
||||
const printerNames = useJingdongProtocol
|
||||
? parseJingdongPrinterNames(response)
|
||||
: (() => {
|
||||
const printersRaw = Array.isArray(response.printers) ? response.printers : [];
|
||||
return printersRaw
|
||||
.map((item) => {
|
||||
if (typeof item === 'string') return item.trim();
|
||||
if (item && typeof item === 'object') {
|
||||
return String((item as Record<string, unknown>).name ?? '').trim();
|
||||
}
|
||||
return '';
|
||||
})
|
||||
.filter(Boolean);
|
||||
})();
|
||||
const defaultFromComponent = String(response.defaultPrinter ?? '').trim();
|
||||
return {
|
||||
printers: printerNames,
|
||||
defaultPrinter: defaultFromComponent || printerNames[0] || '',
|
||||
};
|
||||
}
|
||||
|
||||
export type ComponentPrinterListResult = {
|
||||
printers: string[];
|
||||
defaultPrinter: string;
|
||||
};
|
||||
|
||||
/** 向已连接的本地打印组件查询 getPrinters 列表 */
|
||||
export async function queryComponentPrinterList(
|
||||
componentName: string,
|
||||
preferredPrinter: string,
|
||||
fallbackDefaultPrinter: string,
|
||||
requestID?: string,
|
||||
): Promise<string> {
|
||||
const desired = String(preferredPrinter ?? '').trim();
|
||||
timeoutMs = 2000,
|
||||
): Promise<ComponentPrinterListResult | null> {
|
||||
const eventName =
|
||||
COMPONENT_GET_PRINTERS_EVENT[componentName] ??
|
||||
(isJingdongComponent(componentName) ? 'jingdongMessage' : undefined);
|
||||
if (!eventName) return desired;
|
||||
if (!eventName) return null;
|
||||
|
||||
try {
|
||||
const { printerComponents } = await import('@/core/printerRuntime');
|
||||
if (!printerComponents.isComponentOpen(componentName)) {
|
||||
return desired;
|
||||
return null;
|
||||
}
|
||||
|
||||
const reqId = requestID || `wave-${componentName}-getPrinters-${Date.now()}`;
|
||||
@ -1657,7 +1683,7 @@ async function alignComponentPrinterName(
|
||||
const timeout = setTimeout(() => {
|
||||
printerComponents.off(eventName, onMessage);
|
||||
resolve(null);
|
||||
}, 2000);
|
||||
}, timeoutMs);
|
||||
|
||||
const onMessage = (msg: unknown) => {
|
||||
const text = String(msg ?? '');
|
||||
@ -1700,7 +1726,68 @@ async function alignComponentPrinterName(
|
||||
);
|
||||
});
|
||||
|
||||
if (!response) {
|
||||
if (!response) return null;
|
||||
return parseComponentGetPrintersResponse(response, useJingdongProtocol);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** 汇总已连接打印组件的本机打印机列表(去重) */
|
||||
export async function fetchConnectedComponentPrinters(
|
||||
componentNames?: string[],
|
||||
): Promise<ComponentPrinterListResult> {
|
||||
const { printerComponents, DEFAULT_PRINTER_COMPONENTS } = await import('@/core/printerRuntime');
|
||||
const targets =
|
||||
componentNames?.length
|
||||
? componentNames
|
||||
: DEFAULT_PRINTER_COMPONENTS.map((item) => item.name);
|
||||
const merged = new Set<string>();
|
||||
let defaultPrinter = '';
|
||||
|
||||
for (const componentName of targets) {
|
||||
if (!printerComponents.isComponentOpen(componentName)) continue;
|
||||
const result = await queryComponentPrinterList(componentName);
|
||||
if (!result) continue;
|
||||
result.printers.forEach((name) => merged.add(name));
|
||||
if (!defaultPrinter && result.defaultPrinter) {
|
||||
defaultPrinter = result.defaultPrinter;
|
||||
}
|
||||
}
|
||||
|
||||
const printers = [...merged];
|
||||
if (!defaultPrinter && printers.length) {
|
||||
defaultPrinter = printers[0] ?? '';
|
||||
}
|
||||
return { printers, defaultPrinter };
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印前向组件查询 getPrinters,用组件内真实打印机名下发(与 printserver / oldprint 一致)。
|
||||
*/
|
||||
async function alignComponentPrinterName(
|
||||
componentName: string,
|
||||
preferredPrinter: string,
|
||||
fallbackDefaultPrinter: string,
|
||||
requestID?: string,
|
||||
): Promise<string> {
|
||||
const desired = String(preferredPrinter ?? '').trim();
|
||||
const eventName =
|
||||
COMPONENT_GET_PRINTERS_EVENT[componentName] ??
|
||||
(isJingdongComponent(componentName) ? 'jingdongMessage' : undefined);
|
||||
if (!eventName) return desired;
|
||||
|
||||
try {
|
||||
const { printerComponents } = await import('@/core/printerRuntime');
|
||||
if (!printerComponents.isComponentOpen(componentName)) {
|
||||
return desired;
|
||||
}
|
||||
|
||||
const result = await queryComponentPrinterList(
|
||||
componentName,
|
||||
requestID || `wave-${componentName}-getPrinters-${Date.now()}`,
|
||||
);
|
||||
if (!result) {
|
||||
waveBrowserPrintLog('alignComponentPrinterName: getPrinters 超时,使用原打印机名', {
|
||||
componentName,
|
||||
desired,
|
||||
@ -1708,33 +1795,17 @@ async function alignComponentPrinterName(
|
||||
return desired || String(fallbackDefaultPrinter ?? '').trim();
|
||||
}
|
||||
|
||||
const printerNames = useJingdongProtocol
|
||||
? parseJingdongPrinterNames(response)
|
||||
: (() => {
|
||||
const printersRaw = Array.isArray(response.printers) ? response.printers : [];
|
||||
return printersRaw
|
||||
.map((item) => {
|
||||
if (typeof item === 'string') return item.trim();
|
||||
if (item && typeof item === 'object') {
|
||||
return String((item as Record<string, unknown>).name ?? '').trim();
|
||||
}
|
||||
return '';
|
||||
})
|
||||
.filter(Boolean);
|
||||
})();
|
||||
|
||||
const defaultFromComponent = String(response.defaultPrinter ?? '').trim();
|
||||
waveBrowserPrintLog('alignComponentPrinterName: getPrinters 成功', {
|
||||
componentName,
|
||||
desired,
|
||||
defaultFromComponent,
|
||||
printerNames,
|
||||
defaultFromComponent: result.defaultPrinter,
|
||||
printerNames: result.printers,
|
||||
});
|
||||
|
||||
if (!printerNames.length) {
|
||||
return desired || defaultFromComponent || String(fallbackDefaultPrinter ?? '').trim();
|
||||
if (!result.printers.length) {
|
||||
return desired || result.defaultPrinter || String(fallbackDefaultPrinter ?? '').trim();
|
||||
}
|
||||
return pickBestPrinterName(desired, printerNames, defaultFromComponent || fallbackDefaultPrinter);
|
||||
return pickBestPrinterName(desired, result.printers, result.defaultPrinter || fallbackDefaultPrinter);
|
||||
} catch {
|
||||
return desired || String(fallbackDefaultPrinter ?? '').trim();
|
||||
}
|
||||
@ -1754,7 +1825,7 @@ async function resolveFinalExpressPrinter(
|
||||
}
|
||||
|
||||
/** 从 waveGroups 解析本次打印涉及的平台打印组件名(去重) */
|
||||
function collectWavePlatformPrintComponents(waveGroups: unknown[]): string[] {
|
||||
export function collectWavePlatformPrintComponents(waveGroups: unknown[]): string[] {
|
||||
const names = new Set<string>();
|
||||
for (const rawWave of waveGroups) {
|
||||
const wave = asRecord(rawWave);
|
||||
|
||||
@ -0,0 +1,534 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
title="按商品编码筛选"
|
||||
width="720px"
|
||||
align-center
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
@closed="handleClosed"
|
||||
>
|
||||
<div class="picker-meta">
|
||||
<span v-if="storeId">货主 ID:{{ storeId }}</span>
|
||||
<span v-else>全部货主</span>
|
||||
<span>已选 {{ localSelectedItems.length }} 个商品</span>
|
||||
</div>
|
||||
|
||||
<div class="picker-toolbar">
|
||||
<el-input
|
||||
v-model="keyword"
|
||||
placeholder="支持多个商品编码,逗号分隔"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
<el-button type="primary" size="small" :loading="loading" @click="handleSearch">
|
||||
查询
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
:data="list"
|
||||
border
|
||||
size="small"
|
||||
max-height="280"
|
||||
v-loading="loading"
|
||||
row-key="item_id"
|
||||
empty-text="暂无商品"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="46" :reserve-selection="true" />
|
||||
<el-table-column prop="item_id" label="商品ID" width="90" />
|
||||
<el-table-column prop="item_code" label="商品编码" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="item_name" label="商品名称" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="barcode" label="条码" min-width="100" show-overflow-tooltip />
|
||||
</el-table>
|
||||
|
||||
<div class="picker-pagination">
|
||||
<el-pagination
|
||||
background
|
||||
small
|
||||
layout="total, prev, pager, next"
|
||||
:total="pagination.total"
|
||||
:current-page="pagination.currentPage"
|
||||
:page-size="pagination.pageSize"
|
||||
@current-change="handlePageChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="selected-items-panel">
|
||||
<div class="selected-items-title">已选商品(将写入左侧商品ID筛选)</div>
|
||||
<el-table :data="localSelectedItems" border size="small" max-height="160" empty-text="未选择商品">
|
||||
<el-table-column prop="item_id" label="商品ID" width="90" />
|
||||
<el-table-column prop="item_code" label="编码" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="item_name" label="名称" min-width="110" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="60">
|
||||
<template #default="{ row: item }">
|
||||
<el-button type="danger" link size="small" @click="removeSelectedItem(item)">移除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="handleConfirm">确定筛选</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { nextTick, reactive, ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { warehouseSearch } from '@/api/stock/stock'
|
||||
|
||||
export type InventoryStockPickerItem = {
|
||||
item_id?: number
|
||||
item_code: string
|
||||
item_name: string
|
||||
barcode: string
|
||||
store_id?: number
|
||||
}
|
||||
|
||||
const visible = defineModel<boolean>({ default: false })
|
||||
|
||||
const props = defineProps<{
|
||||
storeId?: number
|
||||
selectedItems?: InventoryStockPickerItem[]
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
confirm: [items: InventoryStockPickerItem[]]
|
||||
}>()
|
||||
|
||||
const loading = ref(false)
|
||||
const keyword = ref('')
|
||||
const allRows = ref<any[]>([])
|
||||
const list = ref<any[]>([])
|
||||
const syncingSelection = ref(false)
|
||||
const tableRef = ref<any>(null)
|
||||
const localSelectedItems = ref<InventoryStockPickerItem[]>([])
|
||||
const pagination = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
total: 0
|
||||
})
|
||||
|
||||
watch(visible, (opened) => {
|
||||
if (!opened) return
|
||||
localSelectedItems.value = (props.selectedItems || []).map((item) => ({ ...item }))
|
||||
keyword.value = ''
|
||||
pagination.currentPage = 1
|
||||
void initDialog()
|
||||
})
|
||||
|
||||
function getSearchKeyword() {
|
||||
return String(keyword.value || '')
|
||||
.replace(/[\r\n]+/g, ',')
|
||||
.replace(/[,;;、]/g, ',')
|
||||
.split(',')
|
||||
.map((s) => s.trim())
|
||||
.filter((s) => s !== '')
|
||||
.join(',')
|
||||
}
|
||||
|
||||
async function initDialog() {
|
||||
syncingSelection.value = true
|
||||
try {
|
||||
tableRef.value?.clearSelection?.()
|
||||
await loadList()
|
||||
await enrichLocalSelectedItems()
|
||||
await syncSelectionFromLocal()
|
||||
} finally {
|
||||
await nextTick()
|
||||
syncingSelection.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleClosed() {
|
||||
keyword.value = ''
|
||||
localSelectedItems.value = []
|
||||
resetListState()
|
||||
}
|
||||
|
||||
function resetListState() {
|
||||
allRows.value = []
|
||||
list.value = []
|
||||
pagination.currentPage = 1
|
||||
pagination.total = 0
|
||||
tableRef.value?.clearSelection?.()
|
||||
}
|
||||
|
||||
function hasValidItemId(item: InventoryStockPickerItem) {
|
||||
const itemId = Number(item.item_id)
|
||||
return Number.isInteger(itemId) && itemId > 0
|
||||
}
|
||||
|
||||
function getStockItemId(row: any): number | undefined {
|
||||
const candidates = [
|
||||
row?.item_id,
|
||||
row?.id,
|
||||
row?.store_stock?.item_id,
|
||||
row?.store_stock?.id,
|
||||
row?.stock?.item_id,
|
||||
row?.stock?.id,
|
||||
row?.goods?.item_id,
|
||||
row?.goods?.id
|
||||
]
|
||||
for (const candidate of candidates) {
|
||||
const itemId = Number(candidate)
|
||||
if (Number.isInteger(itemId) && itemId > 0) return itemId
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
function getStockItemCode(row: any) {
|
||||
const candidates = [
|
||||
row?.item_code,
|
||||
row?.goods_code,
|
||||
row?.store_stock?.item_code,
|
||||
row?.store_stock?.goods_code,
|
||||
row?.stock?.item_code,
|
||||
row?.stock?.goods_code,
|
||||
row?.goods?.item_code,
|
||||
row?.goods?.goods_code
|
||||
]
|
||||
for (const candidate of candidates) {
|
||||
const text = String(candidate ?? '').trim()
|
||||
if (text) return text
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
function getStockItemName(row: any) {
|
||||
const candidates = [
|
||||
row?.item_name,
|
||||
row?.product_name,
|
||||
row?.goods_name,
|
||||
row?.name,
|
||||
row?.store_stock?.item_name,
|
||||
row?.store_stock?.product_name,
|
||||
row?.stock?.item_name,
|
||||
row?.goods?.item_name,
|
||||
row?.goods?.product_name
|
||||
]
|
||||
for (const candidate of candidates) {
|
||||
const text = String(candidate ?? '').trim()
|
||||
if (text) return text
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
function getStockBarcode(row: any) {
|
||||
const candidates = [
|
||||
row?.barcode,
|
||||
row?.store_stock?.barcode,
|
||||
row?.stock?.barcode,
|
||||
row?.goods?.barcode
|
||||
]
|
||||
for (const candidate of candidates) {
|
||||
const text = String(candidate ?? '').trim()
|
||||
if (text) return text
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
function getStockStoreId(row: any): number | undefined {
|
||||
const storeId = Number(row?.store_stock?.store_id ?? row?.store_id)
|
||||
return Number.isFinite(storeId) && storeId > 0 ? storeId : undefined
|
||||
}
|
||||
|
||||
function mapStockPickerItem(row: any): InventoryStockPickerItem {
|
||||
const itemId = getStockItemId(row)
|
||||
return {
|
||||
...row,
|
||||
item_id: itemId,
|
||||
item_code: getStockItemCode(row),
|
||||
item_name: getStockItemName(row),
|
||||
barcode: getStockBarcode(row),
|
||||
store_id: getStockStoreId(row)
|
||||
}
|
||||
}
|
||||
|
||||
function buildSelectedItemFromStock(row: any): InventoryStockPickerItem | null {
|
||||
const itemId = getStockItemId(row)
|
||||
const itemCode = getStockItemCode(row)
|
||||
if (!itemId || !itemCode) return null
|
||||
return {
|
||||
item_id: itemId,
|
||||
item_code: itemCode,
|
||||
item_name: getStockItemName(row),
|
||||
barcode: getStockBarcode(row),
|
||||
store_id: getStockStoreId(row)
|
||||
}
|
||||
}
|
||||
|
||||
function enrichSelectedItemFromStockRow(
|
||||
item: InventoryStockPickerItem,
|
||||
stockRow: any
|
||||
): InventoryStockPickerItem {
|
||||
return {
|
||||
...item,
|
||||
item_id: item.item_id || getStockItemId(stockRow),
|
||||
item_code: item.item_code || getStockItemCode(stockRow),
|
||||
item_name: String(item.item_name || '').trim() || getStockItemName(stockRow),
|
||||
barcode: String(item.barcode || '').trim() || getStockBarcode(stockRow),
|
||||
store_id: item.store_id || getStockStoreId(stockRow)
|
||||
}
|
||||
}
|
||||
|
||||
function enrichLocalSelectedItemsFromRows(rows: any[]) {
|
||||
if (!localSelectedItems.value.length || !rows.length) return
|
||||
|
||||
const byId = new Map<number, any>()
|
||||
const byCode = new Map<string, any>()
|
||||
for (const row of rows) {
|
||||
const itemId = getStockItemId(row)
|
||||
const itemCode = getStockItemCode(row)
|
||||
if (itemId) byId.set(itemId, row)
|
||||
if (itemCode) byCode.set(itemCode, row)
|
||||
}
|
||||
|
||||
localSelectedItems.value = localSelectedItems.value.map((item) => {
|
||||
const stockRow =
|
||||
(hasValidItemId(item) ? byId.get(Number(item.item_id)) : undefined)
|
||||
|| (item.item_code ? byCode.get(item.item_code) : undefined)
|
||||
if (!stockRow) return item
|
||||
return enrichSelectedItemFromStockRow(item, stockRow)
|
||||
})
|
||||
}
|
||||
|
||||
async function fetchStockRowsForSelectedItems(items: InventoryStockPickerItem[]) {
|
||||
const codes = Array.from(new Set(
|
||||
items
|
||||
.filter((item) => !String(item.item_name || '').trim() && String(item.item_code || '').trim())
|
||||
.map((item) => String(item.item_code).trim())
|
||||
))
|
||||
if (!codes.length) return []
|
||||
|
||||
const requestData: { keyword?: string; store_id?: number } = {
|
||||
keyword: codes.join(',')
|
||||
}
|
||||
if (props.storeId) {
|
||||
requestData.store_id = props.storeId
|
||||
}
|
||||
|
||||
const res: any = await warehouseSearch(requestData)
|
||||
const ok = res && (res.code === 1 || res.code === 200 || res.flag === 'success')
|
||||
if (!ok) return []
|
||||
|
||||
const rawList = Array.isArray(res?.data) ? res.data : []
|
||||
return rawList.map(mapStockPickerItem).filter((item: InventoryStockPickerItem) => item.item_id)
|
||||
}
|
||||
|
||||
async function enrichLocalSelectedItems() {
|
||||
enrichLocalSelectedItemsFromRows(allRows.value)
|
||||
|
||||
const needsFetch = localSelectedItems.value.some(
|
||||
(item) => !String(item.item_name || '').trim() && String(item.item_code || '').trim()
|
||||
)
|
||||
if (!needsFetch) return
|
||||
|
||||
try {
|
||||
const extraRows = await fetchStockRowsForSelectedItems(localSelectedItems.value)
|
||||
enrichLocalSelectedItemsFromRows(extraRows)
|
||||
} catch (error) {
|
||||
console.error('enrich selected stock items failed:', error)
|
||||
}
|
||||
}
|
||||
|
||||
function applyPageSlice() {
|
||||
const start = (pagination.currentPage - 1) * pagination.pageSize
|
||||
const end = start + pagination.pageSize
|
||||
list.value = allRows.value.slice(start, end)
|
||||
}
|
||||
|
||||
async function loadList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const requestData: { keyword?: string; store_id?: number } = {}
|
||||
const normalizedKeyword = getSearchKeyword()
|
||||
if (normalizedKeyword) {
|
||||
requestData.keyword = normalizedKeyword
|
||||
}
|
||||
if (props.storeId) {
|
||||
requestData.store_id = props.storeId
|
||||
}
|
||||
const res: any = await warehouseSearch(requestData)
|
||||
const ok = res && (res.code === 1 || res.code === 200 || res.flag === 'success')
|
||||
if (!ok) {
|
||||
resetListState()
|
||||
ElMessage.error(res?.message || '查询商品失败')
|
||||
return
|
||||
}
|
||||
const rawList = Array.isArray(res?.data) ? res.data : []
|
||||
allRows.value = rawList.map(mapStockPickerItem).filter((item: InventoryStockPickerItem) => item.item_id)
|
||||
pagination.total = allRows.value.length
|
||||
const maxPage = Math.max(1, Math.ceil(pagination.total / pagination.pageSize))
|
||||
if (pagination.currentPage > maxPage) {
|
||||
pagination.currentPage = maxPage
|
||||
}
|
||||
applyPageSlice()
|
||||
} catch (error) {
|
||||
console.error('load inventory stock picker failed:', error)
|
||||
resetListState()
|
||||
ElMessage.error('查询商品失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function syncSelectionFromLocal(releaseSync = true) {
|
||||
await nextTick()
|
||||
const table = tableRef.value
|
||||
if (!table) return
|
||||
|
||||
syncingSelection.value = true
|
||||
table.clearSelection?.()
|
||||
await nextTick()
|
||||
|
||||
const selectedIdSet = new Set(
|
||||
localSelectedItems.value.filter((item) => hasValidItemId(item)).map((item) => Number(item.item_id))
|
||||
)
|
||||
allRows.value
|
||||
.filter((item) => selectedIdSet.has(Number(item.item_id)))
|
||||
.forEach((item) => {
|
||||
table.toggleRowSelection?.(item, true)
|
||||
})
|
||||
|
||||
if (releaseSync) {
|
||||
await nextTick()
|
||||
syncingSelection.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function applySelectedItems(selections: any[]) {
|
||||
const loadedItemIds = new Set(
|
||||
allRows.value.map((item) => getStockItemId(item)).filter((id): id is number => Boolean(id))
|
||||
)
|
||||
const selectedIdsInTable = new Set(
|
||||
(selections || []).map((item) => getStockItemId(item)).filter((id): id is number => Boolean(id))
|
||||
)
|
||||
|
||||
const keptItems = localSelectedItems.value.filter((item) => {
|
||||
if (!hasValidItemId(item)) {
|
||||
return String(item.item_code || '').trim() !== ''
|
||||
}
|
||||
if (!loadedItemIds.has(Number(item.item_id))) {
|
||||
return true
|
||||
}
|
||||
return selectedIdsInTable.has(Number(item.item_id))
|
||||
}).map((item) => {
|
||||
if (!String(item.item_name || '').trim()) {
|
||||
const stockRow = allRows.value.find((row) => {
|
||||
const itemId = getStockItemId(row)
|
||||
return (hasValidItemId(item) && itemId === Number(item.item_id))
|
||||
|| (item.item_code && getStockItemCode(row) === item.item_code)
|
||||
})
|
||||
if (stockRow) {
|
||||
return enrichSelectedItemFromStockRow(item, stockRow)
|
||||
}
|
||||
}
|
||||
return item
|
||||
})
|
||||
|
||||
const keptIdSet = new Set(
|
||||
keptItems.filter((item) => hasValidItemId(item)).map((item) => Number(item.item_id))
|
||||
)
|
||||
|
||||
for (const selected of selections || []) {
|
||||
const nextItem = buildSelectedItemFromStock(selected)
|
||||
if (!nextItem || keptIdSet.has(Number(nextItem.item_id))) continue
|
||||
keptItems.push(nextItem)
|
||||
keptIdSet.add(Number(nextItem.item_id))
|
||||
}
|
||||
|
||||
localSelectedItems.value = keptItems
|
||||
}
|
||||
|
||||
function handleSelectionChange(rows: any[]) {
|
||||
if (syncingSelection.value) return
|
||||
applySelectedItems(rows || [])
|
||||
}
|
||||
|
||||
function removeSelectedItem(item: InventoryStockPickerItem) {
|
||||
const itemId = Number(item.item_id)
|
||||
localSelectedItems.value = localSelectedItems.value.filter((row) => {
|
||||
if (hasValidItemId(item) && hasValidItemId(row)) {
|
||||
return Number(row.item_id) !== itemId
|
||||
}
|
||||
return row.item_code !== item.item_code
|
||||
})
|
||||
syncingSelection.value = true
|
||||
void syncSelectionFromLocal().finally(async () => {
|
||||
await nextTick()
|
||||
syncingSelection.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
pagination.currentPage = 1
|
||||
syncingSelection.value = true
|
||||
void loadList()
|
||||
.then(() => enrichLocalSelectedItems())
|
||||
.then(() => syncSelectionFromLocal())
|
||||
.finally(async () => {
|
||||
await nextTick()
|
||||
syncingSelection.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function handlePageChange(page: number) {
|
||||
pagination.currentPage = page
|
||||
syncingSelection.value = true
|
||||
applyPageSlice()
|
||||
void syncSelectionFromLocal().finally(async () => {
|
||||
await nextTick()
|
||||
syncingSelection.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function handleConfirm() {
|
||||
if (!localSelectedItems.value.length) {
|
||||
ElMessage.warning('请至少选择 1 个商品')
|
||||
return
|
||||
}
|
||||
emit('confirm', localSelectedItems.value.map((item) => ({ ...item })))
|
||||
visible.value = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.picker-meta {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.picker-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.picker-pagination {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.selected-items-panel {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.selected-items-title {
|
||||
margin-bottom: 8px;
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
}
|
||||
</style>
|
||||
@ -10,6 +10,7 @@
|
||||
@condition-change="handleConditionChange"
|
||||
@reset="handleConditionReset"
|
||||
@condition-clear="handleConditionClear"
|
||||
@field-action="handleScanBoxFieldAction"
|
||||
/>
|
||||
|
||||
<div class="main-content">
|
||||
@ -151,11 +152,18 @@
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<InventoryStockPickerDialog
|
||||
v-model="stockPickerVisible"
|
||||
:store-id="stockPickerStoreId"
|
||||
:selected-items="stockPickerSelectedItems"
|
||||
@confirm="handleStockPickerConfirm"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import { ref, reactive, onMounted, computed, nextTick } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
@ -171,10 +179,15 @@ import {
|
||||
|
||||
import entrydetail from './component/panelstockdetail.vue'
|
||||
import log from './component/log.vue'
|
||||
import InventoryStockPickerDialog from './component/InventoryStockPickerDialog.vue'
|
||||
import type { InventoryStockPickerItem } from './component/InventoryStockPickerDialog.vue'
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
|
||||
const scanBox = ref<any>(null)
|
||||
const upperTable = ref<any>(null)
|
||||
const stockPickerVisible = ref(false)
|
||||
const stockPickerStoreId = ref<number | undefined>(undefined)
|
||||
const stockPickerSelectedItems = ref<InventoryStockPickerItem[]>([])
|
||||
|
||||
const {
|
||||
splitStackRef,
|
||||
@ -397,6 +410,64 @@ function handleConditionReset() {
|
||||
loadData()
|
||||
}
|
||||
|
||||
function parseStockIdDraftValue(raw: unknown): number[] {
|
||||
if (raw === undefined || raw === null || raw === '') return []
|
||||
const values = Array.isArray(raw)
|
||||
? raw
|
||||
: String(raw).split(/[,,\s]+/)
|
||||
return values
|
||||
.map((item) => Number(String(item).trim()))
|
||||
.filter((id) => Number.isInteger(id) && id > 0)
|
||||
}
|
||||
|
||||
function resolveStoreIdFromScanBox(): number | undefined {
|
||||
const draft = scanBox.value?.getFieldDraft?.('store_id')
|
||||
const val = draft?.value
|
||||
if (Array.isArray(val)) {
|
||||
if (val.length === 1) {
|
||||
const storeId = Number(val[0])
|
||||
return Number.isInteger(storeId) && storeId > 0 ? storeId : undefined
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
const storeId = Number(val)
|
||||
return Number.isInteger(storeId) && storeId > 0 ? storeId : undefined
|
||||
}
|
||||
|
||||
function buildStockPickerSelectedItems(ids: number[]): InventoryStockPickerItem[] {
|
||||
return ids.map((itemId) => ({
|
||||
item_id: itemId,
|
||||
item_code: '',
|
||||
item_name: '',
|
||||
barcode: ''
|
||||
}))
|
||||
}
|
||||
|
||||
function handleScanBoxFieldAction(fieldKey: string) {
|
||||
if (fieldKey !== 'stock_id') return
|
||||
stockPickerStoreId.value = resolveStoreIdFromScanBox()
|
||||
const existingIds = parseStockIdDraftValue(scanBox.value?.getFieldDraft?.('stock_id')?.value)
|
||||
stockPickerSelectedItems.value = buildStockPickerSelectedItems(existingIds)
|
||||
stockPickerVisible.value = true
|
||||
}
|
||||
|
||||
async function handleStockPickerConfirm(items: InventoryStockPickerItem[]) {
|
||||
const pickedIds = items
|
||||
.map((item) => Number(item.item_id))
|
||||
.filter((id) => Number.isInteger(id) && id > 0)
|
||||
if (!pickedIds.length) {
|
||||
ElMessage.warning('未获取到有效商品ID')
|
||||
return
|
||||
}
|
||||
|
||||
const operator = pickedIds.length > 1 ? 'in' : 'eq'
|
||||
const value = pickedIds.join(',')
|
||||
|
||||
scanBox.value?.setFieldCondition?.('stock_id', { operator, value }, { autoSubmit: false })
|
||||
await nextTick()
|
||||
scanBox.value?.submit?.()
|
||||
}
|
||||
|
||||
function onSelectionChange(rows: any[]) {
|
||||
selectionRows.value = rows || []
|
||||
hasSelection.value = selectionRows.value.length > 0
|
||||
|
||||
@ -1,5 +1,11 @@
|
||||
export const availableFields = [
|
||||
{ label: '商品ID', value: 'stock_id', type: 'text' },
|
||||
{
|
||||
label: '商品ID',
|
||||
value: 'stock_id',
|
||||
type: 'text',
|
||||
placeholder: '请输入商品ID',
|
||||
extraAction: { label: '编码筛选' }
|
||||
},
|
||||
{ label: '库位', value: 'space_id', type: 'text' },
|
||||
{ label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] },
|
||||
{ label: '库存类型', value: 'inventory_type', type: 'select', options: [
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -8,30 +8,11 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.detail",
|
||||
"body": {
|
||||
"id": 14,
|
||||
"ids": [
|
||||
14
|
||||
],
|
||||
"tableType": "order"
|
||||
}
|
||||
},
|
||||
{
|
||||
"method": "",
|
||||
"body": {
|
||||
}
|
||||
},
|
||||
{
|
||||
"method": "",
|
||||
"method": "order.deliveryOrder.list",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "",
|
||||
"method": "order.deliveryOrder.detail",
|
||||
"body": {}
|
||||
}
|
||||
],
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -13,7 +13,7 @@
|
||||
}
|
||||
},
|
||||
"moduleCount": 41,
|
||||
"totalInterfaceCount": 300,
|
||||
"totalInterfaceCount": 312,
|
||||
"changes": {
|
||||
"summary": {
|
||||
"moduleAdded": 0,
|
||||
@ -199,6 +199,26 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "打印模块",
|
||||
"moduleKey": "order.print",
|
||||
"folder": "order.print",
|
||||
"interfaceCount": 4,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "order.print.getWavePrintData"
|
||||
},
|
||||
{
|
||||
"method": "order.print.getWavePlatformPrintData"
|
||||
},
|
||||
{
|
||||
"method": "order.print.unlockWavePlatformPrintDataByGroup"
|
||||
},
|
||||
{
|
||||
"method": "order.print.getOrderPrintData"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "打印模块",
|
||||
"moduleKey": "print",
|
||||
@ -370,23 +390,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "订单打印模块",
|
||||
"moduleKey": "order.print",
|
||||
"folder": "order.print",
|
||||
"interfaceCount": 3,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "order.print.getWavePrintData"
|
||||
},
|
||||
{
|
||||
"method": "order.print.getWavePlatformPrintData"
|
||||
},
|
||||
{
|
||||
"method": "order.print.unlockWavePlatformPrintDataByGroup"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "订单待出库模块",
|
||||
"moduleKey": "order.outboundOrder",
|
||||
@ -408,7 +411,7 @@
|
||||
"moduleName": "订单待处理模块",
|
||||
"moduleKey": "order.pendingOrder",
|
||||
"folder": "order.pendingorder",
|
||||
"interfaceCount": 17,
|
||||
"interfaceCount": 25,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "order.pendingOrder.list"
|
||||
@ -460,6 +463,30 @@
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.updateAddress"
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.batchIntercept"
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.batchInterceptTaskProgress"
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.batchLock"
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.batchLockTaskProgress"
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.batchUnlock"
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.batchUnlockTaskProgress"
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.batchUnintercept"
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.batchUninterceptTaskProgress"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -484,13 +511,22 @@
|
||||
"moduleName": "订单复核模块",
|
||||
"moduleKey": "order.recheckOrder",
|
||||
"folder": "order.recheckorder",
|
||||
"interfaceCount": 2,
|
||||
"interfaceCount": 5,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "order.recheckOrder.scanOrder"
|
||||
},
|
||||
{
|
||||
"method": "order.recheckOrder.confirmRecheck"
|
||||
},
|
||||
{
|
||||
"method": "order.recheckOrder.confirmIntercept"
|
||||
},
|
||||
{
|
||||
"method": "order.recheckOrder.recheckOrderList"
|
||||
},
|
||||
{
|
||||
"method": "order.recheckOrder.scanTask"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -16,7 +16,7 @@
|
||||
"name": "订单待处理模块",
|
||||
"key": "order.pendingOrder",
|
||||
"folder": "order.pendingorder",
|
||||
"interfaceCount": 17
|
||||
"interfaceCount": 25
|
||||
},
|
||||
"changes": {
|
||||
"fromPreviousSnapshot": {
|
||||
@ -1235,6 +1235,750 @@
|
||||
"description": "请求的订单ID数组(原样返回)"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.batchIntercept",
|
||||
"title": "批量提交订单拦截请求(异步任务模式)。接收订单ID数组,提交后立即返回 task_id 和受理信息,后端异步将每个订单的 intercept_status 更新为 'requested' 并写入操作日志(ORDER_INTERCEPT_REQUEST)。相同 task_id 幂等提交会返回已存在任务的信息。仓库ID统一使用当前上下文(ctx.user.store_id)。",
|
||||
"description": "批量提交订单拦截请求(异步任务模式)。接收订单ID数组,提交后立即返回 task_id 和受理信息,后端异步将每个订单的 intercept_status 更新为 'requested' 并写入操作日志(ORDER_INTERCEPT_REQUEST)。相同 task_id 幂等提交会返回已存在任务的信息。仓库ID统一使用当前上下文(ctx.user.store_id)。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "order_ids / orderIds / ids",
|
||||
"type": "number[]",
|
||||
"required": true,
|
||||
"description": "订单ID数组;优先级 order_ids > orderIds > ids"
|
||||
},
|
||||
{
|
||||
"name": "task_id / taskId",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "外部指定任务ID(用于幂等提交,不传则自动生成)"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "task_id",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务ID,格式 recheck_intercept_{warehouseId}_{timestamp}_{rand}(幂等提交时返回已有任务的 task_id)"
|
||||
},
|
||||
{
|
||||
"name": "warehouse_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "仓库ID(取自当前上下文)"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务提交状态说明:'批量拦截任务已提交。' 或 '批量拦截任务已存在,请勿重复提交。'"
|
||||
},
|
||||
{
|
||||
"name": "accepted_at",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务受理时间(ISO 字符串)"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "提交状态(固定为 'success')"
|
||||
},
|
||||
{
|
||||
"name": "state",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "幂等提交时返回已有任务的状态:submitted / running / success / failed"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.batchInterceptTaskProgress",
|
||||
"title": "查询批量拦截任务进度。根据 task_id 返回任务的当前状态、进度百分比、已处理/已拦截订单数等信息。任务状态 state 包含 submitted(已提交)、running(执行中)、success(已完成)、failed(失败)、not_found(未找到)。",
|
||||
"description": "查询批量拦截任务进度。根据 task_id 返回任务的当前状态、进度百分比、已处理/已拦截订单数等信息。任务状态 state 包含 submitted(已提交)、running(执行中)、success(已完成)、failed(失败)、not_found(未找到)。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "task_id / taskId",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务ID"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "task_id",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务ID"
|
||||
},
|
||||
{
|
||||
"name": "state",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务状态:submitted / running / success / failed / not_found"
|
||||
},
|
||||
{
|
||||
"name": "warehouse_id",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "仓库ID(not_found 时不返回)"
|
||||
},
|
||||
{
|
||||
"name": "submitted_at",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "任务提交时间戳(毫秒)"
|
||||
},
|
||||
{
|
||||
"name": "start_time",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "任务开始执行时间戳(毫秒,running/success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "end_time",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "任务结束时间戳(毫秒,success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "progress_percent",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "进度百分比 0-100(submitted/running/success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "total_order_count",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "总订单数(submitted/running/success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "processed_order_count",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "已处理订单数(仅 submitted/running 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "intercepted_order_count",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "已拦截订单数(submitted/running/success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "intercepted_order_ids",
|
||||
"type": "number[]",
|
||||
"required": false,
|
||||
"description": "已拦截订单ID列表(仅 success 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "duration_ms",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "任务耗时(毫秒,success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "error_message",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "错误信息(仅 failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "error_code",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "错误码(仅 failed 时返回,默认 'BATCH_INTERCEPT_FAILED')"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.batchLock",
|
||||
"title": "批量提交订单锁定请求(异步任务模式)。接收订单ID数组,提交后立即返回 task_id 和受理信息,后端异步将每个订单的 lock_status 更新为 'warehouse' 并写入操作日志(ORDER_LOCK)。相同 task_id 幂等提交会返回已存在任务的信息。仓库ID统一使用当前上下文(ctx.user.store_id)。",
|
||||
"description": "批量提交订单锁定请求(异步任务模式)。接收订单ID数组,提交后立即返回 task_id 和受理信息,后端异步将每个订单的 lock_status 更新为 'warehouse' 并写入操作日志(ORDER_LOCK)。相同 task_id 幂等提交会返回已存在任务的信息。仓库ID统一使用当前上下文(ctx.user.store_id)。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "order_ids / orderIds / ids",
|
||||
"type": "number[]",
|
||||
"required": true,
|
||||
"description": "订单ID数组;优先级 order_ids > orderIds > ids"
|
||||
},
|
||||
{
|
||||
"name": "task_id / taskId",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "外部指定任务ID(用于幂等提交,不传则自动生成)"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "task_id",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务ID,格式 order_lock_{warehouseId}_{timestamp}_{rand}(幂等提交时返回已有任务的 task_id)"
|
||||
},
|
||||
{
|
||||
"name": "warehouse_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "仓库ID(取自当前上下文)"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务提交状态说明:'批量锁定任务已提交。' 或 '批量锁定任务已存在,请勿重复提交。'"
|
||||
},
|
||||
{
|
||||
"name": "accepted_at",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务受理时间(ISO 字符串)"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "提交状态(固定为 'success')"
|
||||
},
|
||||
{
|
||||
"name": "state",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "幂等提交时返回已有任务的状态:submitted / running / success / failed"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.batchLockTaskProgress",
|
||||
"title": "查询批量锁定任务进度。根据 task_id 返回任务的当前状态、进度百分比、已处理/已锁定订单数等信息。任务状态 state 包含 submitted(已提交)、running(执行中)、success(已完成)、failed(失败)、not_found(未找到)。",
|
||||
"description": "查询批量锁定任务进度。根据 task_id 返回任务的当前状态、进度百分比、已处理/已锁定订单数等信息。任务状态 state 包含 submitted(已提交)、running(执行中)、success(已完成)、failed(失败)、not_found(未找到)。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "task_id / taskId",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务ID"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "task_id",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务ID"
|
||||
},
|
||||
{
|
||||
"name": "state",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务状态:submitted / running / success / failed / not_found"
|
||||
},
|
||||
{
|
||||
"name": "warehouse_id",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "仓库ID(not_found 时不返回)"
|
||||
},
|
||||
{
|
||||
"name": "submitted_at",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "任务提交时间戳(毫秒)"
|
||||
},
|
||||
{
|
||||
"name": "start_time",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "任务开始执行时间戳(毫秒,running/success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "end_time",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "任务结束时间戳(毫秒,success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "progress_percent",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "进度百分比 0-100(submitted/running/success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "total_order_count",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "总订单数(submitted/running/success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "processed_order_count",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "已处理订单数(仅 submitted/running 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "locked_order_count",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "已锁定订单数(submitted/running/success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "locked_order_ids",
|
||||
"type": "number[]",
|
||||
"required": false,
|
||||
"description": "已锁定订单ID列表(仅 success 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "duration_ms",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "任务耗时(毫秒,success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "error_message",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "错误信息(仅 failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "error_code",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "错误码(仅 failed 时返回,默认 'BATCH_LOCK_FAILED')"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.batchUnlock",
|
||||
"title": "批量提交订单解锁请求(异步任务模式)。接收订单ID数组,提交后立即返回 task_id 和受理信息,后端异步将每个订单的 lock_status 更新为 'none' 并写入操作日志(ORDER_UNLOCK)。相同 task_id 幂等提交会返回已存在任务的信息。仓库ID统一使用当前上下文(ctx.user.store_id)。",
|
||||
"description": "批量提交订单解锁请求(异步任务模式)。接收订单ID数组,提交后立即返回 task_id 和受理信息,后端异步将每个订单的 lock_status 更新为 'none' 并写入操作日志(ORDER_UNLOCK)。相同 task_id 幂等提交会返回已存在任务的信息。仓库ID统一使用当前上下文(ctx.user.store_id)。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "order_ids / orderIds / ids",
|
||||
"type": "number[]",
|
||||
"required": true,
|
||||
"description": "订单ID数组;优先级 order_ids > orderIds > ids"
|
||||
},
|
||||
{
|
||||
"name": "task_id / taskId",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "外部指定任务ID(用于幂等提交,不传则自动生成)"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "task_id",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务ID,格式 order_unlock_{warehouseId}_{timestamp}_{rand}(幂等提交时返回已有任务的 task_id)"
|
||||
},
|
||||
{
|
||||
"name": "warehouse_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "仓库ID(取自当前上下文)"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务提交状态说明:'批量解锁任务已提交。' 或 '批量解锁任务已存在,请勿重复提交。'"
|
||||
},
|
||||
{
|
||||
"name": "accepted_at",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务受理时间(ISO 字符串)"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "提交状态(固定为 'success')"
|
||||
},
|
||||
{
|
||||
"name": "state",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "幂等提交时返回已有任务的状态:submitted / running / success / failed"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.batchUnlockTaskProgress",
|
||||
"title": "查询批量解锁任务进度。根据 task_id 返回任务的当前状态、进度百分比、已处理/已解锁订单数等信息。任务状态 state 包含 submitted(已提交)、running(执行中)、success(已完成)、failed(失败)、not_found(未找到)。",
|
||||
"description": "查询批量解锁任务进度。根据 task_id 返回任务的当前状态、进度百分比、已处理/已解锁订单数等信息。任务状态 state 包含 submitted(已提交)、running(执行中)、success(已完成)、failed(失败)、not_found(未找到)。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "task_id / taskId",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务ID"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "task_id",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务ID"
|
||||
},
|
||||
{
|
||||
"name": "state",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务状态:submitted / running / success / failed / not_found"
|
||||
},
|
||||
{
|
||||
"name": "warehouse_id",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "仓库ID(not_found 时不返回)"
|
||||
},
|
||||
{
|
||||
"name": "submitted_at",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "任务提交时间戳(毫秒)"
|
||||
},
|
||||
{
|
||||
"name": "start_time",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "任务开始执行时间戳(毫秒,running/success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "end_time",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "任务结束时间戳(毫秒,success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "progress_percent",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "进度百分比 0-100(submitted/running/success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "total_order_count",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "总订单数(submitted/running/success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "processed_order_count",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "已处理订单数(仅 submitted/running 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "unlocked_order_count",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "已解锁订单数(submitted/running/success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "unlocked_order_ids",
|
||||
"type": "number[]",
|
||||
"required": false,
|
||||
"description": "已解锁订单ID列表(仅 success 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "duration_ms",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "任务耗时(毫秒,success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "error_message",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "错误信息(仅 failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "error_code",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "错误码(仅 failed 时返回,默认 'BATCH_UNLOCK_FAILED')"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.batchUnintercept",
|
||||
"title": "批量提交解除拦截请求(异步任务模式)。接收订单ID数组,提交后立即返回 task_id 和受理信息,后端异步将每个订单的 intercept_status 更新为 'none' 并写入操作日志(ORDER_INTERCEPT_CANCEL)。相同 task_id 幂等提交会返回已存在任务的信息。仓库ID统一使用当前上下文(ctx.user.store_id)。",
|
||||
"description": "批量提交解除拦截请求(异步任务模式)。接收订单ID数组,提交后立即返回 task_id 和受理信息,后端异步将每个订单的 intercept_status 更新为 'none' 并写入操作日志(ORDER_INTERCEPT_CANCEL)。相同 task_id 幂等提交会返回已存在任务的信息。仓库ID统一使用当前上下文(ctx.user.store_id)。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "order_ids / orderIds / ids",
|
||||
"type": "number[]",
|
||||
"required": true,
|
||||
"description": "订单ID数组;优先级 order_ids > orderIds > ids"
|
||||
},
|
||||
{
|
||||
"name": "task_id / taskId",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "外部指定任务ID(用于幂等提交,不传则自动生成)"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "task_id",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务ID,格式 order_unintercept_{warehouseId}_{timestamp}_{rand}(幂等提交时返回已有任务的 task_id)"
|
||||
},
|
||||
{
|
||||
"name": "warehouse_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "仓库ID(取自当前上下文)"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务提交状态说明:'批量解除拦截任务已提交。' 或 '批量解除拦截任务已存在,请勿重复提交。'"
|
||||
},
|
||||
{
|
||||
"name": "accepted_at",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务受理时间(ISO 字符串)"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "提交状态(固定为 'success')"
|
||||
},
|
||||
{
|
||||
"name": "state",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "幂等提交时返回已有任务的状态:submitted / running / success / failed"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.batchUninterceptTaskProgress",
|
||||
"title": "查询批量解除拦截任务进度。根据 task_id 返回任务的当前状态、进度百分比、已处理/已解除拦截订单数等信息。任务状态 state 包含 submitted(已提交)、running(执行中)、success(已完成)、failed(失败)、not_found(未找到)。",
|
||||
"description": "查询批量解除拦截任务进度。根据 task_id 返回任务的当前状态、进度百分比、已处理/已解除拦截订单数等信息。任务状态 state 包含 submitted(已提交)、running(执行中)、success(已完成)、failed(失败)、not_found(未找到)。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "task_id / taskId",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务ID"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "task_id",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务ID"
|
||||
},
|
||||
{
|
||||
"name": "state",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务状态:submitted / running / success / failed / not_found"
|
||||
},
|
||||
{
|
||||
"name": "warehouse_id",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "仓库ID(not_found 时不返回)"
|
||||
},
|
||||
{
|
||||
"name": "submitted_at",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "任务提交时间戳(毫秒)"
|
||||
},
|
||||
{
|
||||
"name": "start_time",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "任务开始执行时间戳(毫秒,running/success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "end_time",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "任务结束时间戳(毫秒,success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "progress_percent",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "进度百分比 0-100(submitted/running/success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "total_order_count",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "总订单数(submitted/running/success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "processed_order_count",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "已处理订单数(仅 submitted/running 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "unintercepted_order_count",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "已解除拦截订单数(submitted/running/success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "unintercepted_order_ids",
|
||||
"type": "number[]",
|
||||
"required": false,
|
||||
"description": "已解除拦截订单ID列表(仅 success 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "duration_ms",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "任务耗时(毫秒,success/failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "error_message",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "错误信息(仅 failed 时返回)"
|
||||
},
|
||||
{
|
||||
"name": "error_code",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "错误码(仅 failed 时返回,默认 'BATCH_UNINTERCEPT_FAILED')"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
{
|
||||
"module": {
|
||||
"name": "订单打印模块",
|
||||
"name": "打印模块",
|
||||
"key": "order.print",
|
||||
"folder": "order.print"
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-05 09:15:19",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -13,10 +13,10 @@
|
||||
}
|
||||
},
|
||||
"module": {
|
||||
"name": "订单打印模块",
|
||||
"name": "打印模块",
|
||||
"key": "order.print",
|
||||
"folder": "order.print",
|
||||
"interfaceCount": 3
|
||||
"interfaceCount": 4
|
||||
},
|
||||
"changes": {
|
||||
"fromPreviousSnapshot": {
|
||||
@ -240,6 +240,60 @@
|
||||
"description": "扩展字段"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.print.getOrderPrintData",
|
||||
"title": "按订单ID拉取平台打印中间态数据,与 getWavePlatformPrintData 返回结构一致。不限制打印锁定状态,所有订单(包括已锁定)统一返回。仓库ID统一从当前上下文获取,无需调用方传入。自动过滤快递未完全分配的订单(post_status !== 'fin'),返回 waveGroups(波次 -> 平台 -> 订单)结构。",
|
||||
"description": "按订单ID拉取平台打印中间态数据,与 getWavePlatformPrintData 返回结构一致。不限制打印锁定状态,所有订单(包括已锁定)统一返回。仓库ID统一从当前上下文获取,无需调用方传入。自动过滤快递未完全分配的订单(post_status !== 'fin'),返回 waveGroups(波次 -> 平台 -> 订单)结构。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "order_ids",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "订单ID列表(支持数字或字符串,内部自动去重与归一化,必须为非空数组)"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "summary",
|
||||
"type": "object",
|
||||
"required": true,
|
||||
"description": "汇总信息"
|
||||
},
|
||||
{
|
||||
"name": "wave_ids",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "通过过滤的波次ID数组"
|
||||
},
|
||||
{
|
||||
"name": "waveGroups",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "主返回结构:按波次分组(波次 -> 平台 -> 订单)"
|
||||
},
|
||||
{
|
||||
"name": "ext",
|
||||
"type": "object",
|
||||
"required": true,
|
||||
"description": "扩展字段"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-20 08:59:09",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -16,7 +16,7 @@
|
||||
"name": "订单复核模块",
|
||||
"key": "order.recheckOrder",
|
||||
"folder": "order.recheckorder",
|
||||
"interfaceCount": 2
|
||||
"interfaceCount": 5
|
||||
},
|
||||
"changes": {
|
||||
"fromPreviousSnapshot": {
|
||||
@ -33,8 +33,8 @@
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "order.recheckOrder.scanOrder",
|
||||
"title": "扫码查询订单(支持运单号与车号)并返回订单详情。车号命中时按 pick_mode 返回语义化结构。",
|
||||
"description": "扫码查询订单(支持运单号与车号)并返回订单详情。车号命中时按 pick_mode 返回语义化结构。",
|
||||
"title": "扫描关键词并返回以波次为单位的复核视图。支持运单号、波次号、车号三种匹配模式。运单号/波次号命中(散单)返回扁平化订单列表 list_type='single',车号命中(团单)返回嵌套波次结构 list_type='group'。运单号命中但订单无波次信息时,退回单订单详情模式(list 每项含 detail/items/expresses/logs)。",
|
||||
"description": "扫描关键词并返回以波次为单位的复核视图。支持运单号、波次号、车号三种匹配模式。运单号/波次号命中(散单)返回扁平化订单列表 list_type='single',车号命中(团单)返回嵌套波次结构 list_type='group'。运单号命中但订单无波次信息时,退回单订单详情模式(list 每项含 detail/items/expresses/logs)。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
@ -52,10 +52,10 @@
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "keyword / value / waybill_no / waybillCode / waybill_code / cart_code / cartCode",
|
||||
"name": "keyword / value / waybill_no / waybillCode / waybill_code / wave_no / waveNo / cart_code / cartCode",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "扫描关键词;优先按运单号匹配,未命中时回退到 wms_wave_pick_task.current_cart_code_snapshot / wms_wave_pick_task_order.cart_code_snapshot 车号匹配,支持别名 waybillCode/waybill_code/cart_code/cartCode"
|
||||
"description": "扫描关键词;匹配优先级:运单号 → 波次号 → 车号。支持别名 waybillCode/waybill_code(运单号)、waveNo(波次号)、cartCode(车号)"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
@ -63,104 +63,104 @@
|
||||
"name": "match_type",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "命中类型:waybill(运单号命中)/ cart(车号命中)"
|
||||
"description": "命中类型:waybill(运单号命中)/ wave(波次号命中)/ cart(车号命中)"
|
||||
},
|
||||
{
|
||||
"name": "cart_match_view",
|
||||
"type": "object|null",
|
||||
"required": true,
|
||||
"description": "仅 cart 命中返回对象,waybill 命中返回 null"
|
||||
},
|
||||
{
|
||||
"name": "cart_match_view.mode_code",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "波次类型编码(pick_mode)"
|
||||
},
|
||||
{
|
||||
"name": "cart_match_view.mode_name",
|
||||
"name": "list_type",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "波次类型名称"
|
||||
},
|
||||
{
|
||||
"name": "cart_match_view.view_type",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "语义化视图类型:groups/orders/pick_groups/box_groups"
|
||||
},
|
||||
{
|
||||
"name": "cart_match_view.task",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "任务摘要信息"
|
||||
},
|
||||
{
|
||||
"name": "cart_match_view.groups",
|
||||
"type": "array",
|
||||
"required": false,
|
||||
"description": "仅 mode_code=1/5 返回,按 wave 分组"
|
||||
},
|
||||
{
|
||||
"name": "cart_match_view.orders",
|
||||
"type": "array",
|
||||
"required": false,
|
||||
"description": "仅 mode_code=2 返回,直接返回订单列表"
|
||||
},
|
||||
{
|
||||
"name": "cart_match_view.pick_groups",
|
||||
"type": "array",
|
||||
"required": false,
|
||||
"description": "仅 mode_code=3 返回,按 pick_status 分组"
|
||||
},
|
||||
{
|
||||
"name": "cart_match_view.box_groups",
|
||||
"type": "array",
|
||||
"required": false,
|
||||
"description": "仅 mode_code=4 返回,按 box_no 分组"
|
||||
},
|
||||
{
|
||||
"name": "order_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "准确的订单 ID(供 confirmRecheck 使用)"
|
||||
"description": "列表模式:single(散单扁平列表)/ group(团购嵌套波次列表)"
|
||||
},
|
||||
{
|
||||
"name": "waybill_no",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "匹配到的运单号"
|
||||
"required": false,
|
||||
"description": "仅 waybill 命中时返回,匹配到的运单号"
|
||||
},
|
||||
{
|
||||
"name": "order",
|
||||
"type": "object",
|
||||
"required": true,
|
||||
"description": "订单头对象"
|
||||
"name": "task_id",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "散单有波次信息时返回(来自拣货任务表 wms_wave_pick_task.id),团单车号命中时返回 cartMatchContext 中的任务 ID"
|
||||
},
|
||||
{
|
||||
"name": "items",
|
||||
"name": "picker_id",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "仅散单模式(有波次信息时)返回,拣货人ID(来自 wms_wave_pick_task.pick_user_id)"
|
||||
},
|
||||
{
|
||||
"name": "picker_name",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "仅散单模式(有波次信息时)返回,拣货人名称(来自 wms_wave_pick_task.pick_user_name)"
|
||||
},
|
||||
{
|
||||
"name": "wave_id",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "仅散单模式(有波次信息时)返回,波次ID"
|
||||
},
|
||||
{
|
||||
"name": "wave_no",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "仅散单模式(有波次信息时)返回,波次号"
|
||||
},
|
||||
{
|
||||
"name": "wave_type",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "仅散单模式(有波次信息时)返回,波次类型编码(来自 wms_wave_batch.wave_type)"
|
||||
},
|
||||
{
|
||||
"name": "pick_mode",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "拣货模式:1-团购小波次 2-散单单品单件 3-散单先拣后分 4-边拣边分 5-团购大波次。散单模式在顶层返回,团购模式在每个波次视图项内返回"
|
||||
},
|
||||
{
|
||||
"name": "strategy_id",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "仅散单模式返回,波次策略ID"
|
||||
},
|
||||
{
|
||||
"name": "strategy_name",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "仅散单模式返回,波次策略名称"
|
||||
},
|
||||
{
|
||||
"name": "total_orders",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "仅散单模式返回,波次内订单总数"
|
||||
},
|
||||
{
|
||||
"name": "reviewed_count",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "仅散单模式返回,已复核订单数"
|
||||
},
|
||||
{
|
||||
"name": "unreviewed_count",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "仅散单模式返回,未复核订单数"
|
||||
},
|
||||
{
|
||||
"name": "list",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "订单商品明细"
|
||||
},
|
||||
{
|
||||
"name": "expresses",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "运单信息数组"
|
||||
},
|
||||
{
|
||||
"name": "logs",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "相关操作日志"
|
||||
"description": "统一列表输出。散单模式(list_type=single)有波次信息时:扁平订单数组;无波次信息时退回单订单详情模式(每项含 detail、items、expresses、logs)。团购模式(list_type=group):波次视图数组(每项含 wave_id、wave_no、wave_type、wave_status、total_orders、processed_orders、creator、create_time、update_time、order_count、pick_mode、box_no、orders[])"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.recheckOrder.confirmRecheck",
|
||||
"title": "按订单 ID 确认复核并记录复核任务到 wms_recheck_task(入参兼容 id/orderId)",
|
||||
"description": "按订单 ID 确认复核并记录复核任务到 wms_recheck_task(入参兼容 id/orderId)",
|
||||
"title": "按订单 ID 确认复核并记录复核任务到 wms_recheck_task(入参兼容 id/orderId)。确认复核后,若该订单所属波次拣货任务下所有订单均已复核完成,则自动解绑车任务:清空 wms_wave_pick_task 的车绑定信息(current_cart_id、current_cart_code_snapshot)、停用 wms_pick_task_cart_binding 绑定记录(is_active=0 并记录解绑人和时间)并释放 wms_pick_cart(清空 current_task_id、bind_user_id)。解绑失败仅记录 warn 日志,不影响复核主流程。",
|
||||
"description": "按订单 ID 确认复核并记录复核任务到 wms_recheck_task(入参兼容 id/orderId)。确认复核后,若该订单所属波次拣货任务下所有订单均已复核完成,则自动解绑车任务:清空 wms_wave_pick_task 的车绑定信息(current_cart_id、current_cart_code_snapshot)、停用 wms_pick_task_cart_binding 绑定记录(is_active=0 并记录解绑人和时间)并释放 wms_pick_cart(清空 current_task_id、bind_user_id)。解绑失败仅记录 warn 日志,不影响复核主流程。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
@ -188,34 +188,262 @@
|
||||
{
|
||||
"name": "order_id",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"required": true,
|
||||
"description": "订单 ID"
|
||||
},
|
||||
{
|
||||
"name": "waybill_no",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"required": true,
|
||||
"description": "运单号"
|
||||
},
|
||||
{
|
||||
"name": "recheck_status",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "复核结果状态"
|
||||
"required": true,
|
||||
"description": "复核结果状态(固定为 'fin')"
|
||||
},
|
||||
{
|
||||
"name": "recheck_time",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"required": true,
|
||||
"description": "复核时间(ISO 字符串)"
|
||||
},
|
||||
{
|
||||
"name": "review_no",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"required": true,
|
||||
"description": "复核任务编号"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.recheckOrder.confirmIntercept",
|
||||
"title": "确认拦截:通过订单ID直接匹配订单,将其拦截状态更新为 intercepted_at_warehouse(仓库已拦截)。仅拦截当前指定订单,不波及波次内其他订单。操作成功后写入操作日志(ORDER_INTERCEPT_CONFIRM),日志写入失败不影响主流程。",
|
||||
"description": "确认拦截:通过订单ID直接匹配订单,将其拦截状态更新为 intercepted_at_warehouse(仓库已拦截)。仅拦截当前指定订单,不波及波次内其他订单。操作成功后写入操作日志(ORDER_INTERCEPT_CONFIRM),日志写入失败不影响主流程。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "order_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "订单 ID"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "order_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "订单 ID"
|
||||
},
|
||||
{
|
||||
"name": "order_no",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "订单号(优先 delivery_order_code,其次 pre_delivery_order_code)"
|
||||
},
|
||||
{
|
||||
"name": "intercept_status",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "拦截状态(固定为 'intercepted_at_warehouse')"
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "更新时间(ISO 字符串)"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.recheckOrder.recheckOrderList",
|
||||
"title": "复核订单列表查询,通过入参 list_type 区分散单模式与团购模式。散单模式(single,默认)返回待复核订单列表(每项为一个订单,排除 pick_status='none' 和 recheck_status='fin'),团购模式(group)返回波次维度的复核汇总列表(每项为一个波次及其订单复核统计,含 review_assignment_status 计算字段)。统一使用 list 字段名输出,均支持分页与筛选。",
|
||||
"description": "复核订单列表查询,通过入参 list_type 区分散单模式与团购模式。散单模式(single,默认)返回待复核订单列表(每项为一个订单,排除 pick_status='none' 和 recheck_status='fin'),团购模式(group)返回波次维度的复核汇总列表(每项为一个波次及其订单复核统计,含 review_assignment_status 计算字段)。统一使用 list 字段名输出,均支持分页与筛选。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "list_type",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "列表模式:single(散单模式,默认)/ group(团购模式)"
|
||||
},
|
||||
{
|
||||
"name": "where",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "筛选条件。散单模式支持 keyword(运单号/订单号模糊搜索)、wave_no(精确匹配)、recheck_status、pick_status;团购模式支持 wave_no(模糊搜索)、wave_type、wave_status"
|
||||
},
|
||||
{
|
||||
"name": "pagination",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "分页参数,支持 page / pageSize(默认 page=1, pageSize=20)"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "list",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "散单模式(list_type=single):订单数组,每项含 order_id、delivery_order_code、order_type、wave_id、wave_no、pick_status、recheck_status、shop_nick、logistics_name、items_count、items_total、status、create_at、pick_time、recheck_time。团购模式(list_type=group):波次汇总数组,每项含 wave_id、wave_no、wave_type、wave_status、total_orders、processed_orders、creator、create_time、update_time、order_count、reviewed_count、unreviewed_count、review_assignment_status(unreviewed/partially_reviewed/reviewed)"
|
||||
},
|
||||
{
|
||||
"name": "pagination",
|
||||
"type": "object",
|
||||
"required": true,
|
||||
"description": "分页信息,含 page、pageSize、total、totalPages、hasPrevious、hasNext"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.recheckOrder.scanTask",
|
||||
"title": "按拣货任务 ID 拉取复核扫描视图。根据任务的 pick_mode 区分散单/团单模式,返回与 scanOrder 一致的数据结构,用于前端刷新数据。散单模式(pick_mode 2/3/4)扁平化任务下所有波次的订单列表(按 order_id 去重,未复核优先、wave_index 升序),顶层携带拣货人/任务等汇总信息(包括 picker_id、picker_name、pick_mode、total_orders、reviewed_count、unreviewed_count);团购模式(pick_mode 1/5)返回任务下所有团购波次及订单的分组列表(list_type='group')。",
|
||||
"description": "按拣货任务 ID 拉取复核扫描视图。根据任务的 pick_mode 区分散单/团单模式,返回与 scanOrder 一致的数据结构,用于前端刷新数据。散单模式(pick_mode 2/3/4)扁平化任务下所有波次的订单列表(按 order_id 去重,未复核优先、wave_index 升序),顶层携带拣货人/任务等汇总信息(包括 picker_id、picker_name、pick_mode、total_orders、reviewed_count、unreviewed_count);团购模式(pick_mode 1/5)返回任务下所有团购波次及订单的分组列表(list_type='group')。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "task_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "拣货任务 ID(对应 wms_wave_pick_task.id)"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "match_type",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "固定为 'task',表示通过任务 ID 匹配"
|
||||
},
|
||||
{
|
||||
"name": "list_type",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "列表模式:single(散单扁平列表)/ group(团购嵌套波次列表),由拣货任务的 pick_mode 决定"
|
||||
},
|
||||
{
|
||||
"name": "task_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "拣货任务 ID"
|
||||
},
|
||||
{
|
||||
"name": "picker_id",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "拣货人 ID(来自 wms_wave_pick_task.pick_user_id),散单模式返回"
|
||||
},
|
||||
{
|
||||
"name": "picker_name",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "拣货人名称(来自 wms_wave_pick_task.pick_user_name),散单模式返回"
|
||||
},
|
||||
{
|
||||
"name": "pick_mode",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "拣货模式:1-团购小波次 2-散单单品单件 3-散单先拣后分 4-边拣边分 5-团购大波次"
|
||||
},
|
||||
{
|
||||
"name": "wave_id",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "散单模式固定为 0,团购模式不返回"
|
||||
},
|
||||
{
|
||||
"name": "wave_no",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "散单模式固定为空字符串,团购模式不返回"
|
||||
},
|
||||
{
|
||||
"name": "wave_type",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "波次类型编码(取任务下第一个有效波次的 wave_type),散单模式返回"
|
||||
},
|
||||
{
|
||||
"name": "strategy_id",
|
||||
"type": "number|null",
|
||||
"required": false,
|
||||
"description": "散单模式固定为 null(任务级别不绑定单一策略)"
|
||||
},
|
||||
{
|
||||
"name": "strategy_name",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "散单模式固定为空字符串(任务级别不绑定单一策略)"
|
||||
},
|
||||
{
|
||||
"name": "total_orders",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "任务下订单总数(去重后),散单模式返回"
|
||||
},
|
||||
{
|
||||
"name": "reviewed_count",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "已复核订单数,散单模式返回"
|
||||
},
|
||||
{
|
||||
"name": "unreviewed_count",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "未复核订单数,散单模式返回"
|
||||
},
|
||||
{
|
||||
"name": "list",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "统一列表输出。散单模式(list_type=single):扁平订单数组(每项结构与 scanOrder 散单有波次模式一致,含 order_id/delivery_order_code/waybill_no/pick_status/is_printed/is_reviewed/shop_nick/items_count/wave_index/recheck_status/order_type/status/logistics_name/store_remark/intercept_status/stock[])。团购模式(list_type=group):波次视图数组(结构与 scanOrder 团购模式一致,每项含 wave_id/wave_no/wave_type/wave_status/total_orders/processed_orders/creator/create_time/update_time/order_count/pick_mode/box_no/orders[])"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-04 09:11:04",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -2086,12 +2086,6 @@
|
||||
"required": true,
|
||||
"description": "仓库默认抓取数量或全局默认值"
|
||||
},
|
||||
{
|
||||
"name": "auto_fetch_disabled_marker",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "手动抓取标记;值为 'wave_manual_fetch' 表示手动抓取"
|
||||
},
|
||||
{
|
||||
"name": "fetch_mode",
|
||||
"type": "string",
|
||||
@ -2158,12 +2152,6 @@
|
||||
"required": true,
|
||||
"description": "仓库默认抓取数量或全局默认值"
|
||||
},
|
||||
{
|
||||
"name": "auto_fetch_disabled_marker",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "手动抓取标记;值为 'wave_manual_fetch' 表示手动抓取"
|
||||
},
|
||||
{
|
||||
"name": "fetch_mode",
|
||||
"type": "string",
|
||||
@ -2236,12 +2224,6 @@
|
||||
"required": true,
|
||||
"description": "仓库默认抓取数量或全局默认值"
|
||||
},
|
||||
{
|
||||
"name": "auto_fetch_disabled_marker",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "手动抓取标记;值为 'wave_manual_fetch' 表示手动抓取"
|
||||
},
|
||||
{
|
||||
"name": "fetch_mode",
|
||||
"type": "string",
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-09 09:52:14",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-06-03 16:55:40",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 19:37:49",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 20:21:27",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-29 09:07:53",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-29 09:07:53",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 19:16:50",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-04 09:11:04",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-25 17:05:16",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-15 17:32:36",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-06-07 17:58:31",
|
||||
"generatedAtLocal": "2026-06-07 17:58:31",
|
||||
"generatedAt": "2026-06-08 16:54:48",
|
||||
"generatedAtLocal": "2026-06-08 16:54:48",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-06-07 17:58:31",
|
||||
"updatedAt": "2026-06-08 16:54:48",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user