5月5日
This commit is contained in:
parent
487a7a64f7
commit
dba7bbc8d7
30
src/api/order.print/orderprint.ts
Normal file
30
src/api/order.print/orderprint.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
const v = '1.0'
|
||||
|
||||
export type GetWavePrintDataParams = {
|
||||
warehouse_id: number
|
||||
wave_ids: Array<number | string>
|
||||
}
|
||||
|
||||
/** 接口文档:summary / wave_list / ext;wave_list 单项结构由后端定义 */
|
||||
export type WavePrintDataPayload = {
|
||||
summary?: Record<string, unknown>
|
||||
wave_list?: Record<string, unknown>[]
|
||||
ext?: Record<string, unknown>
|
||||
}
|
||||
|
||||
/** 按波次 IDs 获取订单打印数据(order.print.getWavePrintData) */
|
||||
export function getWavePrintData(data: GetWavePrintDataParams) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.print.getWavePrintData',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
@ -102,6 +102,20 @@ export function orderWaveGroupOrderFetchList(data: WaveGroupOrderFetchListParams
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function orderWaveSingleOrderFetchList(data: WaveGroupOrderFetchListParams = {}): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.wave.singleOrderFetchList',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function orderWaveFetch(data: WaveFetchParams): Promise<WaveFetchResponse & { code?: number; message?: string }> {
|
||||
return request({
|
||||
url: '/system',
|
||||
@ -189,6 +203,7 @@ export function orderWaveBatchRemoveOrders(data: WaveBatchRemoveOrdersParams): P
|
||||
export const orderWave = {
|
||||
batchList: orderWaveBatchList,
|
||||
groupOrderFetchList: orderWaveGroupOrderFetchList,
|
||||
singleOrderFetchList: orderWaveSingleOrderFetchList,
|
||||
fetch: orderWaveFetch,
|
||||
fetchTaskProgress: orderWaveFetchTaskProgress,
|
||||
batchCancel: orderWaveBatchCancel,
|
||||
|
||||
@ -213,7 +213,21 @@ export function createUnit(data: any) {
|
||||
// } as any)
|
||||
// }
|
||||
|
||||
export function checkItemCodeUnique(data: any) {
|
||||
/**
|
||||
* stock.warehouse.checkItemCodeUnique(module/stock)
|
||||
* 必填业务项:item_code、warehouse_id(可省略则由后端按登录仓库上下文补全)、货主 owner_id 或 store_id
|
||||
* 编辑排除自身:item_id(推荐)或 id
|
||||
*/
|
||||
export type CheckItemCodeUniqueParams = {
|
||||
warehouse_id?: number
|
||||
item_code: string
|
||||
item_id?: number
|
||||
id?: number
|
||||
owner_id?: number
|
||||
store_id?: number
|
||||
}
|
||||
|
||||
export function checkItemCodeUnique(data: CheckItemCodeUniqueParams) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -326,7 +340,17 @@ export function backData(data: any) {
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function getStockDetail(stock_id: number, pagination?: { page: number; pageSize: number }) {
|
||||
export function getStockDetail(
|
||||
stock_id: number,
|
||||
options?: { page?: number; pageSize?: number; group_by_batch?: boolean }
|
||||
) {
|
||||
const data: Record<string, unknown> = { stock_id }
|
||||
if (options?.group_by_batch !== undefined) {
|
||||
data.group_by_batch = options.group_by_batch
|
||||
}
|
||||
if (options && (options.page !== undefined || options.pageSize !== undefined)) {
|
||||
data.pagination = { page: options.page, pageSize: options.pageSize }
|
||||
}
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -335,7 +359,7 @@ export function getStockDetail(stock_id: number, pagination?: { page: number; pa
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: { stock_id, ...(pagination ? { pagination } : {}) },
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
@ -182,46 +182,64 @@
|
||||
<el-button size="small" type="danger" plain @click="handleRepairColumnConfig">故障修复</el-button>
|
||||
</div>
|
||||
<div class="column-config-list">
|
||||
<div
|
||||
v-for="(item, idx) in editableColumnConfigs"
|
||||
:key="item.prop"
|
||||
class="column-config-item"
|
||||
:class="{
|
||||
'is-draggable': true,
|
||||
'is-drag-over': dragOverProp === item.prop
|
||||
}"
|
||||
draggable="true"
|
||||
@dragstart="onColumnDragStart(item)"
|
||||
@dragover.prevent="onColumnDragOver(item)"
|
||||
@drop.prevent="onColumnDrop(item)"
|
||||
@dragend="onColumnDragEnd"
|
||||
>
|
||||
<div class="column-config-main">
|
||||
<span class="drag-handle">⋮⋮</span>
|
||||
<el-checkbox
|
||||
:model-value="item.visible"
|
||||
@change="(val: any) => onToggleColumnVisible(item.prop, !!val)"
|
||||
<template v-for="section in columnConfigDialogSections" :key="section.key">
|
||||
<div class="column-config-section">
|
||||
<div class="column-config-section-title">{{ section.title }}</div>
|
||||
<div
|
||||
v-for="(item, sIdx) in section.items"
|
||||
:key="item.prop"
|
||||
class="column-config-item"
|
||||
:class="{
|
||||
'is-fixed-column': section.key !== 'scroll',
|
||||
'is-draggable': section.key === 'scroll',
|
||||
'is-drag-over': section.key === 'scroll' && dragOverProp === item.prop
|
||||
}"
|
||||
:draggable="section.key === 'scroll'"
|
||||
@dragstart="onColumnDragStart($event, item)"
|
||||
@dragover.prevent="onColumnDragOver(item)"
|
||||
@drop.prevent="onColumnDrop(item)"
|
||||
@dragend="onColumnDragEnd"
|
||||
>
|
||||
{{ item.label || item.prop }}
|
||||
</el-checkbox>
|
||||
<div class="column-config-main">
|
||||
<span
|
||||
v-if="section.key === 'scroll'"
|
||||
class="drag-handle"
|
||||
aria-hidden="true"
|
||||
>⋮⋮</span>
|
||||
<span
|
||||
v-else
|
||||
class="drag-handle drag-handle--locked"
|
||||
title="固定列不可调整顺序"
|
||||
>⋮⋮</span>
|
||||
<el-checkbox
|
||||
:model-value="item.visible"
|
||||
@change="(val: any) => onToggleColumnVisible(item.prop, !!val)"
|
||||
>
|
||||
{{ item.label || item.prop }}
|
||||
</el-checkbox>
|
||||
</div>
|
||||
<div v-if="section.key === 'scroll'" class="column-config-actions">
|
||||
<el-button
|
||||
text
|
||||
:disabled="sIdx === 0"
|
||||
@click="moveColumn(item.prop, 'up')"
|
||||
>
|
||||
上移
|
||||
</el-button>
|
||||
<el-button
|
||||
text
|
||||
:disabled="sIdx === section.items.length - 1"
|
||||
@click="moveColumn(item.prop, 'down')"
|
||||
>
|
||||
下移
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-else class="column-config-actions column-config-actions--fixed">
|
||||
<span class="column-config-fixed-hint">固定</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column-config-actions">
|
||||
<el-button
|
||||
text
|
||||
:disabled="idx === 0"
|
||||
@click="moveColumn(item.prop, 'up')"
|
||||
>
|
||||
上移
|
||||
</el-button>
|
||||
<el-button
|
||||
text
|
||||
:disabled="idx === editableColumnConfigs.length - 1"
|
||||
@click="moveColumn(item.prop, 'down')"
|
||||
>
|
||||
下移
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="columnConfigDialogVisible = false">关闭</el-button>
|
||||
@ -461,6 +479,50 @@ const normalizedColumns = computed<ColumnItem[]>(() => {
|
||||
return (props.columns || []).filter((column: ColumnItem) => !!column?.prop)
|
||||
})
|
||||
|
||||
/** 列配置项与列定义合并后的 fixed 语义(用于字段设置与表头顺序) */
|
||||
function effectiveColumnFixed(item: ColumnConfigItem, col: ColumnItem): 'left' | 'right' | undefined {
|
||||
if (item.fixed === false) return undefined
|
||||
const f = item.fixed ?? col.fixed
|
||||
if (f === true || f === 'left') return 'left'
|
||||
if (f === 'right') return 'right'
|
||||
return undefined
|
||||
}
|
||||
|
||||
function isColumnOrderLocked(item: ColumnConfigItem): boolean {
|
||||
const col = normalizedColumns.value.find((c) => String(c.prop) === item.prop)
|
||||
if (!col) return false
|
||||
return effectiveColumnFixed(item, col) !== undefined
|
||||
}
|
||||
|
||||
function normalizeFromParts(left: ColumnConfigItem[], mid: ColumnConfigItem[], right: ColumnConfigItem[]) {
|
||||
let o = 0
|
||||
return [...left, ...mid, ...right].map((c) => ({ ...c, order: o++ }))
|
||||
}
|
||||
|
||||
/** 按列定义顺序拆成左固定 / 可排序 / 右固定;中间块按当前 order 排序 */
|
||||
function partitionColumnConfigsTriplet(configs: ColumnConfigItem[]) {
|
||||
const map = new Map(configs.map((c) => [c.prop, c]))
|
||||
const left: ColumnConfigItem[] = []
|
||||
const mid: ColumnConfigItem[] = []
|
||||
const right: ColumnConfigItem[] = []
|
||||
for (const col of normalizedColumns.value) {
|
||||
const p = String(col.prop || '')
|
||||
const item = map.get(p)
|
||||
if (!item) continue
|
||||
const z = effectiveColumnFixed(item, col)
|
||||
if (z === 'left') left.push(item)
|
||||
else if (z === 'right') right.push(item)
|
||||
else mid.push(item)
|
||||
}
|
||||
mid.sort((a, b) => a.order - b.order)
|
||||
return { left, mid, right }
|
||||
}
|
||||
|
||||
function normalizeColumnConfigOrders(configs: ColumnConfigItem[]): ColumnConfigItem[] {
|
||||
const { left, mid, right } = partitionColumnConfigsTriplet(configs)
|
||||
return normalizeFromParts(left, mid, right)
|
||||
}
|
||||
|
||||
const effectiveTableId = computed(() => props.tableId?.trim())
|
||||
|
||||
const columnConfigStorageKey = computed(() => {
|
||||
@ -503,6 +565,34 @@ const displayColumns = computed(() => {
|
||||
})
|
||||
})
|
||||
|
||||
/** 字段设置弹窗分组:固定列仅显示/隐藏,中间块可拖动排序 */
|
||||
const columnConfigDialogSections = computed(() => {
|
||||
const { left, mid, right } = partitionColumnConfigsTriplet(editableColumnConfigs.value)
|
||||
const sections: { key: string; title: string; items: ColumnConfigItem[] }[] = []
|
||||
if (left.length) {
|
||||
sections.push({
|
||||
key: 'fixed-left',
|
||||
title: '左侧固定列(仅显示/隐藏,顺序与列定义一致)',
|
||||
items: left
|
||||
})
|
||||
}
|
||||
if (mid.length) {
|
||||
sections.push({
|
||||
key: 'scroll',
|
||||
title: '可调整顺序(拖动或上移/下移)',
|
||||
items: mid
|
||||
})
|
||||
}
|
||||
if (right.length) {
|
||||
sections.push({
|
||||
key: 'fixed-right',
|
||||
title: '右侧固定列(仅显示/隐藏,顺序与列定义一致)',
|
||||
items: right
|
||||
})
|
||||
}
|
||||
return sections
|
||||
})
|
||||
|
||||
// Computed
|
||||
const virtualRowHeight = computed(() => {
|
||||
if (props.tableSize === 'large') return 49
|
||||
@ -689,7 +779,7 @@ function buildMergedColumnConfigs(raw?: Partial<ColumnConfigItem>[]) {
|
||||
})
|
||||
|
||||
merged.sort((a, b) => a.order - b.order)
|
||||
return merged.map((item, index) => ({ ...item, order: index }))
|
||||
return normalizeColumnConfigOrders(merged)
|
||||
}
|
||||
|
||||
function readStoredColumnConfigs() {
|
||||
@ -699,6 +789,8 @@ function readStoredColumnConfigs() {
|
||||
try {
|
||||
const parsed = JSON.parse(raw) as TableColumnProfile
|
||||
if (!parsed || !Array.isArray(parsed.columns)) return null
|
||||
const storedVersion = parsed.schemaVersion ?? 1
|
||||
if (storedVersion !== props.columnConfigSchemaVersion) return null
|
||||
return parsed.columns
|
||||
} catch {
|
||||
return null
|
||||
@ -764,15 +856,13 @@ async function copyOrderFlagText(value: unknown) {
|
||||
}
|
||||
|
||||
function persistEditableConfigs() {
|
||||
const normalized = [...editableColumnConfigs.value]
|
||||
.sort((a, b) => a.order - b.order)
|
||||
.map((item, index) => ({ ...item, order: index }))
|
||||
const normalized = normalizeColumnConfigOrders([...editableColumnConfigs.value])
|
||||
applyColumnConfigMap(normalized)
|
||||
saveColumnConfig(normalized)
|
||||
}
|
||||
|
||||
function openColumnConfig() {
|
||||
editableColumnConfigs.value = Object.values(columnConfigMap.value).sort((a, b) => a.order - b.order)
|
||||
editableColumnConfigs.value = normalizeColumnConfigOrders(Object.values(columnConfigMap.value))
|
||||
columnConfigDialogVisible.value = true
|
||||
}
|
||||
|
||||
@ -786,26 +876,36 @@ function onToggleColumnVisible(prop: string, visible: boolean) {
|
||||
}
|
||||
|
||||
function moveColumn(prop: string, direction: 'up' | 'down') {
|
||||
const list = [...editableColumnConfigs.value].sort((a, b) => a.order - b.order)
|
||||
const index = list.findIndex((item) => item.prop === prop)
|
||||
if (index === -1) return
|
||||
const current = list[index]
|
||||
const targetIndex = direction === 'up' ? index - 1 : index + 1
|
||||
if (targetIndex < 0 || targetIndex >= list.length) return
|
||||
const target = list[targetIndex]
|
||||
list[index] = target as ColumnConfigItem
|
||||
list[targetIndex] = current as ColumnConfigItem
|
||||
editableColumnConfigs.value = list.map((item, idx) => ({ ...item, order: idx }))
|
||||
persistEditableConfigs()
|
||||
const cfg = editableColumnConfigs.value.find((c) => c.prop === prop)
|
||||
if (!cfg || isColumnOrderLocked(cfg)) return
|
||||
|
||||
const { left, mid, right } = partitionColumnConfigsTriplet(editableColumnConfigs.value)
|
||||
const i = mid.findIndex((c) => c.prop === prop)
|
||||
if (i === -1) return
|
||||
const j = direction === 'up' ? i - 1 : i + 1
|
||||
if (j < 0 || j >= mid.length) return
|
||||
const tmp = mid[i]!
|
||||
mid[i] = mid[j]!
|
||||
mid[j] = tmp
|
||||
|
||||
const next = normalizeFromParts(left, mid, right)
|
||||
applyColumnConfigMap(next)
|
||||
saveColumnConfig(next)
|
||||
}
|
||||
|
||||
function onColumnDragStart(item: ColumnConfigItem) {
|
||||
function onColumnDragStart(e: DragEvent, item: ColumnConfigItem) {
|
||||
if (isColumnOrderLocked(item)) {
|
||||
e.preventDefault()
|
||||
return
|
||||
}
|
||||
draggingProp.value = item.prop
|
||||
}
|
||||
|
||||
function onColumnDragOver(item: ColumnConfigItem) {
|
||||
if (!draggingProp.value) return
|
||||
if (draggingProp.value === item.prop) return
|
||||
const sourceCfg = editableColumnConfigs.value.find((c) => c.prop === draggingProp.value)
|
||||
if (!sourceCfg || isColumnOrderLocked(sourceCfg) || isColumnOrderLocked(item)) return
|
||||
dragOverProp.value = item.prop
|
||||
}
|
||||
|
||||
@ -816,24 +916,32 @@ function onColumnDrop(target: ColumnConfigItem) {
|
||||
return
|
||||
}
|
||||
|
||||
const list = [...editableColumnConfigs.value].sort((a, b) => a.order - b.order)
|
||||
const sourceIndex = list.findIndex((item) => item.prop === sourceProp)
|
||||
const targetIndex = list.findIndex((item) => item.prop === target.prop)
|
||||
const sourceCfg = editableColumnConfigs.value.find((c) => c.prop === sourceProp)
|
||||
if (!sourceCfg || isColumnOrderLocked(sourceCfg) || isColumnOrderLocked(target)) {
|
||||
onColumnDragEnd()
|
||||
return
|
||||
}
|
||||
|
||||
const { left, mid, right } = partitionColumnConfigsTriplet(editableColumnConfigs.value)
|
||||
const sourceIndex = mid.findIndex((item) => item.prop === sourceProp)
|
||||
const targetIndex = mid.findIndex((item) => item.prop === target.prop)
|
||||
if (sourceIndex === -1 || targetIndex === -1) {
|
||||
onColumnDragEnd()
|
||||
return
|
||||
}
|
||||
|
||||
const sourceItem = list[sourceIndex]
|
||||
const sourceItem = mid[sourceIndex]
|
||||
if (!sourceItem) {
|
||||
onColumnDragEnd()
|
||||
return
|
||||
}
|
||||
|
||||
list.splice(sourceIndex, 1)
|
||||
list.splice(targetIndex, 0, sourceItem)
|
||||
editableColumnConfigs.value = list.map((item, idx) => ({ ...item, order: idx }))
|
||||
persistEditableConfigs()
|
||||
mid.splice(sourceIndex, 1)
|
||||
mid.splice(targetIndex, 0, sourceItem)
|
||||
|
||||
const next = normalizeFromParts(left, mid, right)
|
||||
applyColumnConfigMap(next)
|
||||
saveColumnConfig(next)
|
||||
onColumnDragEnd()
|
||||
}
|
||||
|
||||
@ -843,7 +951,7 @@ function onColumnDragEnd() {
|
||||
}
|
||||
|
||||
function resetColumnConfig() {
|
||||
const defaults = getDefaultColumnConfigs()
|
||||
const defaults = normalizeColumnConfigOrders(getDefaultColumnConfigs())
|
||||
applyColumnConfigMap(defaults)
|
||||
saveColumnConfig(defaults)
|
||||
ElMessage.success('已恢复默认字段配置')
|
||||
@ -1402,6 +1510,23 @@ watch(
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.column-config-section {
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.column-config-section:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.column-config-section-title {
|
||||
padding: 8px 12px 6px;
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
background: #fafafa;
|
||||
font-weight: 600;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
}
|
||||
|
||||
.column-config-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -1410,6 +1535,15 @@ watch(
|
||||
border-bottom: 1px solid #f2f3f5;
|
||||
}
|
||||
|
||||
.column-config-section .column-config-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.column-config-item.is-fixed-column {
|
||||
background: #f5f7fa;
|
||||
border-left: 3px solid #909399;
|
||||
}
|
||||
|
||||
.column-config-item.is-draggable {
|
||||
cursor: move;
|
||||
}
|
||||
@ -1419,8 +1553,21 @@ watch(
|
||||
border-top: 1px dashed #409eff;
|
||||
}
|
||||
|
||||
.column-config-item:last-child {
|
||||
border-bottom: none;
|
||||
.drag-handle--locked {
|
||||
color: #dcdfe6;
|
||||
cursor: not-allowed;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.column-config-actions--fixed {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.column-config-fixed-hint {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
padding: 0 10px;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.column-config-main {
|
||||
|
||||
@ -124,7 +124,8 @@ import {
|
||||
archiveOrderToolbarButtons,
|
||||
type ToolbarButtonConfig,
|
||||
translateOrderField,
|
||||
getTagType
|
||||
getTagType,
|
||||
fillExpressCompanyScanFieldOptions
|
||||
} from './config/order-common-config'
|
||||
import WorkbenchOrderDetail from './component/WorkbenchOrderDetail.vue'
|
||||
import log from './component/log.vue'
|
||||
@ -258,14 +259,20 @@ function buildWhereConditions(rawConditions: Record<string, any>) {
|
||||
|
||||
async function loadFilterData() {
|
||||
try {
|
||||
const [storesRes]: any = await Promise.all([
|
||||
indexApi.loadStores({ type: 'order' })
|
||||
const [storesRes, expressRes]: any = await Promise.all([
|
||||
indexApi.loadStores({ type: 'order' }),
|
||||
indexApi.getExpressList({})
|
||||
])
|
||||
if (storesRes?.code === 200) {
|
||||
const f = availableFieldsRef.find((i: any) => i.value === 'store_id')
|
||||
if (f) f.options = storesRes.stores || []
|
||||
}
|
||||
} catch (e) {}
|
||||
const expressData: any = expressRes?.data
|
||||
const expressRaw = expressData?.list || expressData || []
|
||||
fillExpressCompanyScanFieldOptions(availableFieldsRef, expressRaw)
|
||||
} catch (e) {
|
||||
fillExpressCompanyScanFieldOptions(availableFieldsRef, [])
|
||||
}
|
||||
}
|
||||
|
||||
function handleConditionChange() {
|
||||
|
||||
@ -317,7 +317,7 @@ import { ref, reactive, computed, watch, nextTick } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
import { stockWarehouse } from '@/api/stock/stock'
|
||||
import { warehouseSearch } from '@/api/stock/stock'
|
||||
import { orderPendingOrder } from '@/api/order.pendingOrder/orderpendingOrder'
|
||||
import type { PendingOrderCreateOrderParams } from '@/api/order.pendingOrder/orderpendingOrder'
|
||||
import pcasCodeData from 'china-division/dist/pcas-code.json'
|
||||
@ -378,6 +378,7 @@ const platformCodeSourcePlatformMap = ref<Record<string, string>>({})
|
||||
const stockSelectorDialogVisible = ref(false)
|
||||
const stockSelectorLoading = ref(false)
|
||||
const stockSelectorKeyword = ref('')
|
||||
const stockSelectorAllRows = ref<any[]>([])
|
||||
const stockSelectorList = ref<any[]>([])
|
||||
const stockSelectorSelections = ref<any[]>([])
|
||||
const stockSelectorSyncingSelection = ref(false)
|
||||
@ -746,37 +747,40 @@ function mapStockItem(raw: any) {
|
||||
}
|
||||
}
|
||||
|
||||
function applyStockSelectorPageSlice() {
|
||||
const start = (stockSelectorPagination.currentPage - 1) * stockSelectorPagination.pageSize
|
||||
const end = start + stockSelectorPagination.pageSize
|
||||
stockSelectorList.value = stockSelectorAllRows.value.slice(start, end)
|
||||
}
|
||||
|
||||
async function loadStockSelectorList() {
|
||||
if (stockSelectorLoading.value) return
|
||||
stockSelectorLoading.value = true
|
||||
try {
|
||||
const keyword = stockSelectorKeyword.value
|
||||
const where = keyword
|
||||
? {
|
||||
keyword: {
|
||||
operator: 'like',
|
||||
value: keyword,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
: {}
|
||||
const res: any = await stockWarehouse(
|
||||
{ page: stockSelectorPagination.currentPage, pageSize: stockSelectorPagination.pageSize },
|
||||
where
|
||||
)
|
||||
const keyword = stockSelectorKeyword.value.trim()
|
||||
const res: any = await warehouseSearch({
|
||||
keyword: keyword || undefined,
|
||||
store_id: createOrderForm.store_id
|
||||
})
|
||||
const ok = res && (res.code === 1 || res.code === 200 || res.flag === 'success')
|
||||
if (!ok) {
|
||||
stockSelectorAllRows.value = []
|
||||
stockSelectorList.value = []
|
||||
stockSelectorPagination.total = 0
|
||||
ElMessage.error(res?.message || '获取商品列表失败')
|
||||
return
|
||||
}
|
||||
const data = res?.data || {}
|
||||
const rawList = data?.list || []
|
||||
stockSelectorList.value = Array.isArray(rawList) ? rawList.map(mapStockItem) : []
|
||||
stockSelectorPagination.total = Number(data?.pagination?.total || data?.total || 0)
|
||||
const rawList = Array.isArray(res?.data) ? res.data : []
|
||||
stockSelectorAllRows.value = rawList.map(mapStockItem)
|
||||
stockSelectorPagination.total = stockSelectorAllRows.value.length
|
||||
const maxPage = Math.max(1, Math.ceil(stockSelectorPagination.total / stockSelectorPagination.pageSize))
|
||||
if (stockSelectorPagination.currentPage > maxPage) {
|
||||
stockSelectorPagination.currentPage = maxPage
|
||||
}
|
||||
applyStockSelectorPageSlice()
|
||||
syncStockSelectorSelectionFromStaged()
|
||||
} catch {
|
||||
stockSelectorAllRows.value = []
|
||||
stockSelectorList.value = []
|
||||
stockSelectorPagination.total = 0
|
||||
ElMessage.error('获取商品列表失败')
|
||||
@ -827,10 +831,11 @@ async function openStockSelectorDialog(mode: 'single' | 'multi' = 'multi', rowIn
|
||||
}
|
||||
|
||||
stockSelectorDialogVisible.value = true
|
||||
if (!stockSelectorList.value.length) {
|
||||
if (!stockSelectorAllRows.value.length) {
|
||||
await loadStockSelectorList()
|
||||
return
|
||||
}
|
||||
applyStockSelectorPageSlice()
|
||||
syncStockSelectorSelectionFromStaged()
|
||||
}
|
||||
|
||||
@ -867,13 +872,15 @@ function handleStockSelectorSelectionChange(rows: any[]) {
|
||||
|
||||
function handleStockSelectorPageChange(page: number) {
|
||||
stockSelectorPagination.currentPage = page
|
||||
loadStockSelectorList()
|
||||
applyStockSelectorPageSlice()
|
||||
syncStockSelectorSelectionFromStaged()
|
||||
}
|
||||
|
||||
function handleStockSelectorPageSizeChange(size: number) {
|
||||
stockSelectorPagination.pageSize = size
|
||||
stockSelectorPagination.currentPage = 1
|
||||
loadStockSelectorList()
|
||||
applyStockSelectorPageSlice()
|
||||
syncStockSelectorSelectionFromStaged()
|
||||
}
|
||||
|
||||
function confirmStockSelection() {
|
||||
@ -963,6 +970,10 @@ function resetStockSelectorDialog() {
|
||||
stockSelectorSyncingSelection.value = false
|
||||
stockSelectorSingleSelected.value = null
|
||||
stockSelectorStagedCodeMap.value = new Map()
|
||||
stockSelectorAllRows.value = []
|
||||
stockSelectorList.value = []
|
||||
stockSelectorPagination.currentPage = 1
|
||||
stockSelectorPagination.total = 0
|
||||
stockSelectorTableRef.value?.clearSelection?.()
|
||||
stockSelectorTableRef.value?.setCurrentRow?.(null)
|
||||
}
|
||||
|
||||
@ -16,6 +16,8 @@ export const COMMON_TRANSLATIONS: Record<string, Record<string, string>> = {
|
||||
},
|
||||
sync_status: {
|
||||
'padding': '待同步',
|
||||
'pedding': '待同步',
|
||||
'pending': '待同步',
|
||||
'fin': '已完成',
|
||||
'error': '错误',
|
||||
'none': '未同步'
|
||||
@ -117,6 +119,7 @@ export const COMMON_TAG_TYPES: Record<string, Record<string, string>> = {
|
||||
},
|
||||
sync_status: {
|
||||
'padding': 'warning',
|
||||
'pedding': 'warning',
|
||||
'pending': 'warning',
|
||||
'fin': 'success',
|
||||
'error': 'danger',
|
||||
@ -289,16 +292,62 @@ export const REVIEW_TOOLBAR_API_ACTIONS: ToolbarApiActionConfig[] = [
|
||||
}
|
||||
]
|
||||
|
||||
function normalizeUrgencyValue(value: any): string | undefined {
|
||||
if (value === true || value === 1 || value === '1') return 'Y'
|
||||
if (value === false || value === 0 || value === '0') return 'N'
|
||||
const s = String(value).trim().toUpperCase()
|
||||
if (s === 'Y' || s === 'YES' || s === 'TRUE') return 'Y'
|
||||
if (s === 'N' || s === 'NO' || s === 'FALSE') return 'N'
|
||||
return undefined
|
||||
}
|
||||
|
||||
function normalizeSyncStatusKey(value: any): string {
|
||||
return String(value ?? '').trim()
|
||||
}
|
||||
|
||||
export function getTagType(field: string, value: any) {
|
||||
if (COMMON_TAG_TYPES[field] && COMMON_TAG_TYPES[field][value] !== undefined) {
|
||||
return COMMON_TAG_TYPES[field][value]
|
||||
if (field === 'is_urgency') {
|
||||
const y = normalizeUrgencyValue(value)
|
||||
const urgencyTags = COMMON_TAG_TYPES['is_urgency']
|
||||
if (y && urgencyTags && urgencyTags[y] !== undefined) {
|
||||
return urgencyTags[y]
|
||||
}
|
||||
}
|
||||
const map = COMMON_TAG_TYPES[field]
|
||||
if (map) {
|
||||
if (map[value] !== undefined) return map[value]
|
||||
if (field === 'sync_status') {
|
||||
const k = normalizeSyncStatusKey(value)
|
||||
if (k && map[k] !== undefined) return map[k]
|
||||
const lower = k.toLowerCase()
|
||||
const hit = Object.keys(map).find((key) => key.toLowerCase() === lower)
|
||||
if (hit) return map[hit]
|
||||
}
|
||||
}
|
||||
return 'info'
|
||||
}
|
||||
|
||||
export function translateOrderField(field: string, value: any) {
|
||||
if (COMMON_TRANSLATIONS[field] && COMMON_TRANSLATIONS[field][value] !== undefined) {
|
||||
return COMMON_TRANSLATIONS[field][value]
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
}
|
||||
if (field === 'is_urgency') {
|
||||
const y = normalizeUrgencyValue(value)
|
||||
const urgencyText = COMMON_TRANSLATIONS['is_urgency']
|
||||
if (y && urgencyText && urgencyText[y] !== undefined) {
|
||||
return urgencyText[y]
|
||||
}
|
||||
}
|
||||
const table = COMMON_TRANSLATIONS[field]
|
||||
if (table) {
|
||||
if (table[value] !== undefined) return table[value]
|
||||
if (field === 'sync_status') {
|
||||
const k = normalizeSyncStatusKey(value)
|
||||
if (k && table[k] !== undefined) return table[k]
|
||||
const lower = k.toLowerCase()
|
||||
const hit = Object.keys(table).find((key) => key.toLowerCase() === lower)
|
||||
if (hit) return table[hit]
|
||||
}
|
||||
}
|
||||
return value
|
||||
}
|
||||
@ -410,6 +459,38 @@ export const waveAssignmentScanField = {
|
||||
]
|
||||
}
|
||||
|
||||
/** ScanBox:快递公司(快递编码),选项由 index.getExpressList + fillExpressCompanyScanFieldOptions 注入 */
|
||||
export const expressCompanyScanField = {
|
||||
label: '快递公司',
|
||||
value: 'logistics_code',
|
||||
type: 'select',
|
||||
options: [] as Array<{ label: string; value: string }>
|
||||
}
|
||||
|
||||
export function mapExpressListToCompanySelectOptions(rawList: any[]): Array<{ label: string; value: string }> {
|
||||
const result: Array<{ label: string; value: string }> = []
|
||||
const seen = new Set<string>()
|
||||
for (const item of rawList || []) {
|
||||
const codeRaw = ['code', 'logistics_code', 'express_code']
|
||||
.map((k) => item?.[k])
|
||||
.find((v) => v !== undefined && v !== null && v !== '')
|
||||
const code = String(codeRaw ?? '').trim()
|
||||
if (!code || seen.has(code)) continue
|
||||
const nameRaw = ['name', 'logistics_name', 'express_name']
|
||||
.map((k) => item?.[k])
|
||||
.find((v) => v !== undefined && v !== null && v !== '')
|
||||
const name = String(nameRaw ?? '').trim()
|
||||
result.push({ value: code, label: name ? `${code} - ${name}` : code })
|
||||
seen.add(code)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export function fillExpressCompanyScanFieldOptions(availableFields: any[], expressRaw: any[]) {
|
||||
const field = availableFields.find((f: any) => f.value === 'logistics_code')
|
||||
if (field) field.options = mapExpressListToCompanySelectOptions(expressRaw)
|
||||
}
|
||||
|
||||
// deliveryOrder相关配置
|
||||
export const deliveryAvailableFields = [
|
||||
{ label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] },
|
||||
@ -421,6 +502,7 @@ export const deliveryAvailableFields = [
|
||||
{ label: '收货人', value: 'name', type: 'text' },
|
||||
{ label: '手机号', value: 'mobile', type: 'text' },
|
||||
{ label: '物流公司', value: 'logistics_name', type: 'select', options: [] },
|
||||
expressCompanyScanField,
|
||||
{ label: '物流单号', value: 'waybill_codes', type: 'text' },
|
||||
{ label: '紧急订单', value: 'is_urgency', type: 'select', options: [
|
||||
{ label: '是', value: 'Y' },
|
||||
@ -513,6 +595,7 @@ export const deliveryOrderToolbarButtons = simpleListToolbarButtons
|
||||
|
||||
// revieworder相关配置
|
||||
export const reviewAvailableFields = [
|
||||
{ label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] },
|
||||
{ label: '发货单号', value: 'delivery_order_code', type: 'text' },
|
||||
waveAssignmentScanField,
|
||||
{ label: '波次号', value: 'wave_no', type: 'text' },
|
||||
@ -520,6 +603,7 @@ export const reviewAvailableFields = [
|
||||
{ label: '平台编码', value: 'sys_platform_code', type: 'select', options: [] },
|
||||
{ label: '收货人', value: 'name', type: 'text' },
|
||||
{ label: '手机号', value: 'mobile', type: 'text' },
|
||||
expressCompanyScanField,
|
||||
{ label: '订单状态', value: 'status', type: 'select', options: [ { label: '待审核', value: 'pedding' }, { label: '已创建', value: 'created' }, { label: '错误', value: 'error' } ] },
|
||||
{ label: '是否紧急', value: 'is_urgency', type: 'select', options: [ { label: '是', value: 'Y' }, { label: '否', value: 'N' } ] },
|
||||
{ label: '同步状态', value: 'sync_status', type: 'select', options: [ { label: '待同步', value: 'padding' }, { label: '已完成', value: 'fin' }, { label: '错误', value: 'error' }, { label: '未同步', value: 'none' } ] },
|
||||
@ -653,6 +737,7 @@ export const pendingAvailableFields = [
|
||||
{ label: '店铺名称', value: 'shop_nick', type: 'text' },
|
||||
{ label: '来源平台', value: 'sys_platform_name', type: 'select', options: [] },
|
||||
{ label: '物流公司', value: 'logistics_name', type: 'select', options: [] },
|
||||
expressCompanyScanField,
|
||||
{ label: '快递单号', value: 'waybill_codes', type: 'text' },
|
||||
{ label: '订单状态', value: 'status', type: 'select', options: [
|
||||
{ label: '待审核', value: 'pedding' },
|
||||
@ -680,20 +765,26 @@ export const pendingAvailableFields = [
|
||||
{ label: '打包中', value: 'padding' },
|
||||
{ label: '已完成', value: 'fin' },
|
||||
] },
|
||||
{ label: '是否紧急', value: 'is_urgency', type: 'select', options: [
|
||||
{ label: '是', value: 'Y' },
|
||||
{ label: '否', value: 'N' }
|
||||
]},
|
||||
{ label: '同步状态', value: 'sync_status', type: 'select', options: [
|
||||
{ label: '待同步', value: 'padding' },
|
||||
{ label: '已同步', value: 'fin' },
|
||||
{ label: '错误', value: 'error' }
|
||||
] },
|
||||
{ label: '收货人', value: 'name', type: 'text' },
|
||||
{ label: '手机号', value: 'mobile', type: 'text' },
|
||||
{ label: '省份', value: 'province', type: 'text' },
|
||||
{ label: '城市', value: 'city', type: 'text' },
|
||||
{ label: '区县', value: 'area', type: 'text' },
|
||||
{ label: '是否紧急', value: 'is_urgency', type: 'select', options: [ { label: '是', value: 'Y' }, { label: '否', value: 'N' } ] },
|
||||
|
||||
{ label: '同步状态', value: 'sync_status', type: 'select', options: [ { label: '待同步', value: 'padding' }, { label: '已同步', value: 'fin' }, { label: '错误', value: 'error' } ] },
|
||||
{ label: '下单时间', value: 'place_order_time', type: 'daterange' },
|
||||
{ label: '创建时间', value: 'create_at', type: 'daterange' },
|
||||
]
|
||||
|
||||
export const pendingCloums = [
|
||||
{ prop: 'delivery_order_code', label: '发货单号', width: '170' },
|
||||
{ prop: 'delivery_order_code', label: '发货单号', width: '170' ,fixed: 'left'},
|
||||
{ prop: 'wave_no', label: '波次号', width: '170' },
|
||||
{ prop: 'order_flag', label: '订单标记', minWidth: '260' },
|
||||
{ prop: 'shop_nick', label: '店铺名称', width: '140' },
|
||||
@ -836,7 +927,7 @@ export const pendingToolbarButtons = pickToolbarButtons(pendingToolbarButtonKeys
|
||||
|
||||
|
||||
/**
|
||||
* 异常订单页:与 pendingToolbarButtonKeys 相同的一批接口按钮,去掉「同步订单」,末尾为处理异常订单
|
||||
* deliveryException
|
||||
*/
|
||||
export const exceptionToolbarButtonKeys = [
|
||||
...pendingToolbarButtonKeys.filter((key) => key !== 'syncOrderIds'),
|
||||
@ -845,7 +936,7 @@ export const exceptionToolbarButtonKeys = [
|
||||
export const exceptionToolbarButtons = pickToolbarButtons(exceptionToolbarButtonKeys)
|
||||
|
||||
|
||||
|
||||
// outboundOrder
|
||||
export const outboundAvailableFields = pendingAvailableFields
|
||||
export const outboundColumns = pendingCloums
|
||||
|
||||
@ -914,12 +1005,51 @@ export const expectionOrderAvailableFields = [
|
||||
waveAssignmentScanField,
|
||||
{ label: '波次号', value: 'wave_no', type: 'text' },
|
||||
{ label: '物流公司', value: 'logistics_name', type: 'select', options: [] },
|
||||
expressCompanyScanField,
|
||||
{ label: '快递单号', value: 'express_code', type: 'text' },
|
||||
{label:'是否紧急', value: 'is_urgency', type: 'select', options: [ { label: '是', value: 'Y' }, { label: '否', value: 'N' } ] },
|
||||
{ label: '拦截状态', value: 'intercept_status', type: 'select', options: [
|
||||
{ label: '无', value: 'none' },
|
||||
{ label: '待拦截', value: 'pending' },
|
||||
{ label: '已拦截', value: 'success' }
|
||||
]},
|
||||
{label:'订单状态', value: 'status', type: 'select', options: [
|
||||
{ label: '待审核', value: 'pedding' },
|
||||
{ label: '已审核', value: 'created' },
|
||||
{ label: '异常', value: 'error' },
|
||||
{ label: '已作废', value: 'cancelled' },
|
||||
{ label: '已归档', value: 'archived' }
|
||||
]},
|
||||
{label:'同步状态', value: 'sync_status', type: 'select', options: [
|
||||
{ label: '待同步', value: 'padding' },
|
||||
{ label: '同步中', value: 'pending' },
|
||||
{ label: '已完成', value: 'fin' },
|
||||
{ label: '错误', value: 'error' },
|
||||
{ label: '未同步', value: 'none' }
|
||||
]},
|
||||
{label:'分配状态', value: 'storage_status', type: 'select', options: [
|
||||
{ label: '未分配', value: 'none' },
|
||||
{ label: '分配中', value: 'padding' },
|
||||
{ label: '已完成', value: 'fin' },
|
||||
{ label: '错误', value: 'error' }
|
||||
]},
|
||||
{label:'快递状态', value: 'post_status', type: 'select', options: [
|
||||
{ label: '未分配', value: 'none' },
|
||||
{ label: '分配中', value: 'padding' },
|
||||
{ label: '已完成', value: 'fin' },
|
||||
{ label: '错误', value: 'error' },
|
||||
{ label: '超时', value: 'timeout' }
|
||||
]},
|
||||
{label:'拣货状态', value: 'pick_status', type: 'select', options: [
|
||||
{ label: '未拣货', value: 'none' },
|
||||
{ label: '拣货中', value: 'padding' },
|
||||
{ label: '已完成', value: 'fin' }
|
||||
]},
|
||||
{label:'打包状态', value: 'pack_status', type: 'select', options: [
|
||||
{ label: '未打包', value: 'none' },
|
||||
{ label: '打包中', value: 'padding' },
|
||||
{ label: '已完成', value: 'fin' }
|
||||
]},
|
||||
{ label: '创建时间', value: 'create_at', type: 'daterange' },
|
||||
]
|
||||
|
||||
@ -998,23 +1128,51 @@ export const expectionOrderbuttonList: any[] = [
|
||||
]
|
||||
|
||||
|
||||
// archiveOrder相关配置
|
||||
// deliveryException相关配置
|
||||
export const archiveAvailableFields = [
|
||||
{ label: '货主', value: 'store_id', type: 'select', multiple: true, options: [] },
|
||||
{ label: '订单号', value: 'order_code', type: 'text' },
|
||||
{ label: '发货单号', value: 'delivery_order_code', type: 'text' },
|
||||
waveAssignmentScanField,
|
||||
{ label: '波次号', value: 'wave_no', type: 'text' },
|
||||
{ label: '店铺名称', value: 'shop_nick', type: 'text' },
|
||||
{ label: '收货人', value: 'name', type: 'text' },
|
||||
{ label: '手机号', value: 'mobile', type: 'text' },
|
||||
expressCompanyScanField,
|
||||
{label:'是否紧急', value: 'is_urgency', type: 'select', options: [ { label: '是', value: 'Y' }, { label: '否', value: 'N' } ] },
|
||||
{ label: '订单状态', value: 'status', type: 'select', options: [
|
||||
{ label: '待审核', value: 'pedding' },
|
||||
{ label: '已创建', value: 'created' },
|
||||
{ label: '异常', value: 'error' },
|
||||
{ label: '已作废', value: 'cancelled' },
|
||||
{ label: '已归档', value: 'archived' }
|
||||
]},
|
||||
{ label: '状态', value: 'status', type: 'select', options: [
|
||||
{ label: '已完成', value: 'finished' },
|
||||
{ label: '已作废', value: 'cancelled' },
|
||||
{ label: '已归档', value: 'archived' }
|
||||
]},
|
||||
{ label: '创建时间', value: 'create_at', type: 'daterange' },
|
||||
{ label: '归档时间', value: 'updated_at', type: 'daterange' },
|
||||
{label:'同步状态', value: 'sync_status', type: 'select', options: [
|
||||
{ label: '待同步', value: 'padding' },
|
||||
{ label: '已完成', value: 'fin' },
|
||||
{ label: '错误', value: 'error' },
|
||||
{ label: '未同步', value: 'none' }
|
||||
]},
|
||||
{label:'出库状态', value: 'outbound_status', type: 'select', options: [
|
||||
{ label: '未出库', value: 'none' },
|
||||
{ label: '待出库', value: 'padding' },
|
||||
{ label: '已出库', value: 'fin' }
|
||||
]},
|
||||
{label:'拣货状态', value: 'pick_status', type: 'select', options: [
|
||||
{ label: '未拣货', value: 'none' },
|
||||
{ label: '拣货中', value: 'padding' },
|
||||
{ label: '已完成', value: 'fin' }
|
||||
]},
|
||||
{label:'打包状态', value: 'pack_status', type: 'select', options: [
|
||||
{ label: '未打包', value: 'none' },
|
||||
{ label: '打包中', value: 'padding' },
|
||||
{ label: '已完成', value: 'fin' }
|
||||
]},
|
||||
{ label: '店铺名称', value: 'shop_nick', type: 'text' },
|
||||
{ label: '收货人', value: 'name', type: 'text' },
|
||||
{ label: '手机号', value: 'mobile', type: 'text' },
|
||||
]
|
||||
|
||||
export const archiveColumns = [
|
||||
|
||||
@ -124,7 +124,8 @@ import {
|
||||
deliveryExceptionToolbarButtons,
|
||||
type ToolbarButtonConfig,
|
||||
translateOrderField,
|
||||
getTagType
|
||||
getTagType,
|
||||
fillExpressCompanyScanFieldOptions
|
||||
} from './config/order-common-config'
|
||||
import WorkbenchOrderDetail from './component/WorkbenchOrderDetail.vue'
|
||||
import log from './component/log.vue'
|
||||
@ -258,14 +259,20 @@ function buildWhereConditions(rawConditions: Record<string, any>) {
|
||||
|
||||
async function loadFilterData() {
|
||||
try {
|
||||
const [storesRes]: any = await Promise.all([
|
||||
indexApi.loadStores({ type: 'order' })
|
||||
const [storesRes, expressRes]: any = await Promise.all([
|
||||
indexApi.loadStores({ type: 'order' }),
|
||||
indexApi.getExpressList({})
|
||||
])
|
||||
if (storesRes?.code === 200) {
|
||||
const f = availableFieldsRef.find((i: any) => i.value === 'store_id')
|
||||
if (f) f.options = storesRes.stores || []
|
||||
}
|
||||
} catch (e) {}
|
||||
const expressData: any = expressRes?.data
|
||||
const expressRaw = expressData?.list || expressData || []
|
||||
fillExpressCompanyScanFieldOptions(availableFieldsRef, expressRaw)
|
||||
} catch (e) {
|
||||
fillExpressCompanyScanFieldOptions(availableFieldsRef, [])
|
||||
}
|
||||
}
|
||||
|
||||
function handleConditionChange() {
|
||||
|
||||
@ -166,7 +166,7 @@ import { ElMessage } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
import { orderDeliveryOrder } from '@/api/order.deliveryOrder/orderdeliveryOrder'
|
||||
import { orderDeliveryOrder } from '@/api/order.deliveryorder/orderdeliveryOrder'
|
||||
|
||||
import {
|
||||
deliveryAvailableFields,
|
||||
@ -174,7 +174,8 @@ import {
|
||||
deliveryOrderToolbarButtons,
|
||||
type ToolbarButtonConfig,
|
||||
translateOrderField,
|
||||
getTagType
|
||||
getTagType,
|
||||
fillExpressCompanyScanFieldOptions
|
||||
} from './config/order-common-config'
|
||||
import WorkbenchOrderDetail from './component/WorkbenchOrderDetail.vue'
|
||||
import log from './component/log.vue'
|
||||
@ -254,11 +255,13 @@ async function loadOrderMetaOptions() {
|
||||
|
||||
const logisticsField = availableFieldsRef.find((i: any) => i.value === 'logistics_name')
|
||||
if (logisticsField) logisticsField.options = mapNameOptions(expressRaw, ['name', 'logistics_name', 'express_name'])
|
||||
fillExpressCompanyScanFieldOptions(availableFieldsRef, expressRaw)
|
||||
const platformField = availableFieldsRef.find((i: any) => i.value === 'sys_platform_name')
|
||||
if (platformField) platformField.options = mapNameOptions(platformRaw, ['name', 'platform_name'])
|
||||
} catch {
|
||||
const logisticsField = availableFieldsRef.find((i: any) => i.value === 'logistics_name')
|
||||
if (logisticsField) logisticsField.options = []
|
||||
fillExpressCompanyScanFieldOptions(availableFieldsRef, [])
|
||||
const platformField = availableFieldsRef.find((i: any) => i.value === 'sys_platform_name')
|
||||
if (platformField) platformField.options = []
|
||||
}
|
||||
|
||||
@ -124,7 +124,8 @@ import {
|
||||
entrustWarehouseToolbarButtons,
|
||||
type ToolbarButtonConfig,
|
||||
translateOrderField,
|
||||
getTagType
|
||||
getTagType,
|
||||
fillExpressCompanyScanFieldOptions
|
||||
} from './config/order-common-config'
|
||||
import WorkbenchOrderDetail from './component/WorkbenchOrderDetail.vue'
|
||||
import log from './component/log.vue'
|
||||
@ -258,14 +259,20 @@ function buildWhereConditions(rawConditions: Record<string, any>) {
|
||||
|
||||
async function loadFilterData() {
|
||||
try {
|
||||
const [storesRes]: any = await Promise.all([
|
||||
indexApi.loadStores({ type: 'order' })
|
||||
const [storesRes, expressRes]: any = await Promise.all([
|
||||
indexApi.loadStores({ type: 'order' }),
|
||||
indexApi.getExpressList({})
|
||||
])
|
||||
if (storesRes?.code === 200) {
|
||||
const f = availableFieldsRef.find((i: any) => i.value === 'store_id')
|
||||
if (f) f.options = storesRes.stores || []
|
||||
}
|
||||
} catch (e) {}
|
||||
const expressData: any = expressRes?.data
|
||||
const expressRaw = expressData?.list || expressData || []
|
||||
fillExpressCompanyScanFieldOptions(availableFieldsRef, expressRaw)
|
||||
} catch (e) {
|
||||
fillExpressCompanyScanFieldOptions(availableFieldsRef, [])
|
||||
}
|
||||
}
|
||||
|
||||
function handleConditionChange() {
|
||||
|
||||
@ -111,6 +111,18 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #column-is_urgency="{ row }">
|
||||
<el-tag :type="getTagType('is_urgency', row.is_urgency)" size="small">
|
||||
{{ translateOrderField('is_urgency', row.is_urgency) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #column-sync_status="{ row }">
|
||||
<el-tag :type="getTagType('sync_status', row.sync_status)" size="small">
|
||||
{{ translateOrderField('sync_status', row.sync_status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #column-storage_status="{ row }">
|
||||
<el-tag :type="getTagType('storage_status', row.storage_status)" size="small">
|
||||
{{ translateOrderField('storage_status', row.storage_status) }}
|
||||
@ -303,7 +315,8 @@ import {
|
||||
type ToolbarButtonConfig,
|
||||
translateOrderField,
|
||||
formatOrderTime,
|
||||
getTagType
|
||||
getTagType,
|
||||
fillExpressCompanyScanFieldOptions
|
||||
} from './config/order-common-config'
|
||||
|
||||
const EXPORT_TIME_PROPS = new Set([
|
||||
@ -604,11 +617,13 @@ async function loadOrderMetaOptions() {
|
||||
if (logisticsField) {
|
||||
logisticsField.options = mapNameOptions(expressRaw, ['name', 'logistics_name', 'express_name'])
|
||||
}
|
||||
fillExpressCompanyScanFieldOptions(availableFieldsRef, expressRaw)
|
||||
} catch {
|
||||
expressCodeOptions.value = []
|
||||
platformCodeOptions.value = []
|
||||
const logisticsField = availableFieldsRef.find((i: any) => i.value === 'logistics_name')
|
||||
if (logisticsField) logisticsField.options = []
|
||||
fillExpressCompanyScanFieldOptions(availableFieldsRef, [])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -171,14 +171,15 @@ import { ElMessage } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
import { orderOutboundOrder } from '@/api/order.outboundOrder/orderoutboundOrder'
|
||||
import { orderOutboundOrder } from '@/api/order.outboundorder/orderoutboundOrder'
|
||||
import {
|
||||
outboundAvailableFields,
|
||||
outboundColumns,
|
||||
outboundToolbarButtons,
|
||||
type ToolbarButtonConfig,
|
||||
translateOrderField,
|
||||
getTagType
|
||||
getTagType,
|
||||
fillExpressCompanyScanFieldOptions
|
||||
} from './config/order-common-config'
|
||||
import log from './component/log.vue'
|
||||
import WorkbenchOrderDetail from './component/WorkbenchOrderDetail.vue'
|
||||
@ -424,11 +425,13 @@ async function loadOrderMetaOptions() {
|
||||
|
||||
const logisticsField = availableFieldsRef.find((i: any) => i.value === 'logistics_name')
|
||||
if (logisticsField) logisticsField.options = mapNameOptions(expressRaw, ['name', 'logistics_name', 'express_name'])
|
||||
fillExpressCompanyScanFieldOptions(availableFieldsRef, expressRaw)
|
||||
const platformField = availableFieldsRef.find((i: any) => i.value === 'sys_platform_name')
|
||||
if (platformField) platformField.options = mapNameOptions(platformRaw, ['name', 'platform_name'])
|
||||
} catch {
|
||||
const logisticsField = availableFieldsRef.find((i: any) => i.value === 'logistics_name')
|
||||
if (logisticsField) logisticsField.options = []
|
||||
fillExpressCompanyScanFieldOptions(availableFieldsRef, [])
|
||||
const platformField = availableFieldsRef.find((i: any) => i.value === 'sys_platform_name')
|
||||
if (platformField) platformField.options = []
|
||||
}
|
||||
|
||||
@ -244,7 +244,8 @@ import {
|
||||
pendingToolbarButtons,
|
||||
type ToolbarButtonConfig,
|
||||
translateOrderField,
|
||||
getTagType
|
||||
getTagType,
|
||||
fillExpressCompanyScanFieldOptions
|
||||
} from './config/order-common-config'
|
||||
import ArchiveOrderPanel from './component/ArchiveOrderPanel.vue'
|
||||
import PendingOrderDetailPanel from './component/PendingOrderDetailPanel.vue'
|
||||
@ -662,6 +663,7 @@ async function loadOrderMetaOptions() {
|
||||
if (logisticsField) {
|
||||
logisticsField.options = mapNameOptions(expressRaw, ['name', 'logistics_name', 'express_name'])
|
||||
}
|
||||
fillExpressCompanyScanFieldOptions(availableFieldsRef, expressRaw)
|
||||
const platformField = availableFieldsRef.find((i: any) => i.value === 'sys_platform_name')
|
||||
if (platformField) {
|
||||
platformField.options = mapNameOptions(platformRaw, ['name', 'platform_name'])
|
||||
@ -671,6 +673,7 @@ async function loadOrderMetaOptions() {
|
||||
platformCodeOptions.value = []
|
||||
const logisticsField = availableFieldsRef.find((i: any) => i.value === 'logistics_name')
|
||||
if (logisticsField) logisticsField.options = []
|
||||
fillExpressCompanyScanFieldOptions(availableFieldsRef, [])
|
||||
const platformField = availableFieldsRef.find((i: any) => i.value === 'sys_platform_name')
|
||||
if (platformField) platformField.options = []
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
import { orderReviewOrder } from '@/api/order.reviewOrder/orderreviewOrder'
|
||||
import { orderReviewOrder } from '@/api/order.revieworder/orderreviewOrder'
|
||||
|
||||
import {
|
||||
reviewAvailableFields,
|
||||
@ -153,7 +153,8 @@ import {
|
||||
reviewToolbarButtons,
|
||||
type ToolbarButtonConfig,
|
||||
translateOrderField,
|
||||
getTagType
|
||||
getTagType,
|
||||
fillExpressCompanyScanFieldOptions
|
||||
} from './config/order-common-config'
|
||||
import WorkbenchOrderDetail from './component/WorkbenchOrderDetail.vue'
|
||||
import ManualCreatePendingOrderDialog from './component/ManualCreatePendingOrderDialog.vue'
|
||||
@ -231,16 +232,23 @@ function mapCodeOptions(rawList: any[], codeKeys: string[], nameKeys: string[])
|
||||
|
||||
async function loadOrderMetaOptions() {
|
||||
try {
|
||||
const platformRes: any = await indexApi.getPlatformList({})
|
||||
const [platformRes, expressRes] = await Promise.all([
|
||||
indexApi.getPlatformList({}),
|
||||
indexApi.getExpressList({})
|
||||
])
|
||||
const platformData: any = platformRes?.data
|
||||
const platformRaw = platformData?.list || platformData || []
|
||||
const expressData: any = expressRes?.data
|
||||
const expressRaw = expressData?.list || expressData || []
|
||||
const platformField = availableFieldsRef.find((i: any) => i.value === 'sys_platform_code')
|
||||
if (platformField) {
|
||||
platformField.options = mapCodeOptions(platformRaw, ['code', 'platform_code'], ['name', 'platform_name'])
|
||||
}
|
||||
fillExpressCompanyScanFieldOptions(availableFieldsRef, expressRaw)
|
||||
} catch {
|
||||
const platformField = availableFieldsRef.find((i: any) => i.value === 'sys_platform_code')
|
||||
if (platformField) platformField.options = []
|
||||
fillExpressCompanyScanFieldOptions(availableFieldsRef, [])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="isGroupWaveTab && fetchTaskProgress.taskId" class="task-progress-panel task-progress-panel--toolbar">
|
||||
<div v-if="fetchTaskProgress.taskId" class="task-progress-panel task-progress-panel--toolbar">
|
||||
<div class="task-progress-panel__header">
|
||||
<span class="task-progress-panel__title">抓取任务进度</span>
|
||||
<span class="task-progress-panel__meta">任务ID:{{ fetchTaskProgress.taskId }}</span>
|
||||
@ -62,6 +62,7 @@
|
||||
ref="upperTable"
|
||||
:title="waveUpperTableDefaults.title"
|
||||
:enable-column-config="waveUpperTableDefaults.enableColumnConfig"
|
||||
:column-config-schema-version="3"
|
||||
:table-id="tableListId"
|
||||
:data="list"
|
||||
:row-key="getRowIdentity"
|
||||
@ -380,12 +381,190 @@
|
||||
<el-button size="small" type="primary" :loading="groupOrderSubmitting" @click="submitGroupOrderDialog">抓取选中结构</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
v-model="singleOrderDialogVisible"
|
||||
title="抓取散单候选"
|
||||
width="1280px"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="group-order-dialog">
|
||||
<el-alert
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
class="structure-fetch-hint"
|
||||
title="与团购列表的区别:本列表仅展示「同组订单数」小于团购判定阈值(默认取仓库 min_group_order_fetch_quantity)的散单候选分组;勾选后提交抓取任务的方式与团购一致。"
|
||||
/>
|
||||
<el-form :inline="true" size="small" class="group-order-filters">
|
||||
<el-form-item label="货主">
|
||||
<el-select
|
||||
v-model="singleOrderFilters.storeId"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 180px"
|
||||
@change="handleSingleOrderFilterChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="store in groupOrderStoreOptions"
|
||||
:key="'s-' + String(store.value)"
|
||||
:label="store.label"
|
||||
:value="store.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<template #label>
|
||||
<span>团购判定阈值</span>
|
||||
<el-tooltip
|
||||
placement="top"
|
||||
content="同组订单数 ≥ 该值视为团购命中并从团购列表返回;本接口返回同组订单数 < 该值的散单候选。未填写时使用仓库配置 min_group_order_fetch_quantity(默认 13)。"
|
||||
>
|
||||
<el-icon class="structure-fetch-label-help"><QuestionFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<el-input-number
|
||||
v-model="singleOrderFilters.sameOrderQuantity"
|
||||
:min="1"
|
||||
:controls="false"
|
||||
style="width: 150px"
|
||||
@change="handleSingleOrderFilterChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺名称">
|
||||
<el-input
|
||||
v-model="singleOrderFilters.shopName"
|
||||
clearable
|
||||
placeholder="模糊匹配店铺名称"
|
||||
style="width: 180px"
|
||||
@keyup.enter="fetchSingleOrderList"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="包含 SKU">
|
||||
<el-input
|
||||
v-model="singleOrderFilters.includeSku"
|
||||
clearable
|
||||
placeholder="仅保留包含该 SKU 的分组"
|
||||
style="width: 180px"
|
||||
@keyup.enter="fetchSingleOrderList"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-switch
|
||||
v-model="singleOrderFilters.distinguishExpress"
|
||||
active-text="区分快递"
|
||||
inactive-text="不区分快递"
|
||||
@change="handleSingleOrderFilterChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" :loading="singleOrderListLoading" @click="fetchSingleOrderList">查询</el-button>
|
||||
<el-button @click="resetSingleOrderFilters">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="group-order-toolbar">
|
||||
<div class="group-order-toolbar__left">
|
||||
<span>已选 {{ singleOrderSelectionRows.length }} 个结构</span>
|
||||
</div>
|
||||
<el-checkbox v-model="singleOrderFilters.returnOrderIds">返回订单 ID 列表</el-checkbox>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
ref="singleOrderTableRef"
|
||||
:data="singleOrderList"
|
||||
v-loading="singleOrderListLoading"
|
||||
border
|
||||
size="small"
|
||||
row-key="item_detail_machine"
|
||||
max-height="460"
|
||||
@selection-change="handleSingleOrderSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="48" reserve-selection />
|
||||
<el-table-column prop="item_detail" label="商品结构" min-width="260" show-overflow-tooltip />
|
||||
<el-table-column prop="logistics_name" label="快递" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="group_count" label="同组订单数" min-width="100" align="right" />
|
||||
<el-table-column prop="items_total" label="商品总数" min-width="100" align="right" />
|
||||
<el-table-column label="货主" min-width="110">
|
||||
<template #default="{ row }">
|
||||
{{ getGroupOrderStoreText(row) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态汇总" min-width="240">
|
||||
<template #default="{ row }">
|
||||
<span class="status-summary-text">{{ getGroupOrderStatusSummary(row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品快照" min-width="280">
|
||||
<template #default="{ row }">
|
||||
<span class="order-info-text">{{ getGroupOrderItemSnapshotText(row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="抓取数量" width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
:model-value="singleOrderQuantityMap[row.item_detail_machine]"
|
||||
:min="1"
|
||||
:controls="false"
|
||||
placeholder="默认"
|
||||
style="width: 92px"
|
||||
@change="(value: number | undefined) => updateSingleOrderQuantity(row, value)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="首单时间" min-width="168">
|
||||
<template #default="{ row }">
|
||||
{{ formatDateTime(row.first_order_time) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="末单时间" min-width="168">
|
||||
<template #default="{ row }">
|
||||
{{ formatDateTime(row.last_order_time) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<template #empty>
|
||||
<div class="empty-tip">暂无可抓取的散单候选结构</div>
|
||||
</template>
|
||||
</el-table>
|
||||
|
||||
<div class="group-order-pagination">
|
||||
<el-pagination
|
||||
v-model:current-page="singleOrderPagination.currentPage"
|
||||
v-model:page-size="singleOrderPagination.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:total="singleOrderPagination.total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
background
|
||||
size="small"
|
||||
@size-change="handleSingleOrderPageSizeChange"
|
||||
@current-change="handleSingleOrderPageChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button size="small" @click="singleOrderDialogVisible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="singleOrderSubmitting" @click="submitSingleOrderDialog">抓取选中结构</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<wave-batch-print-preview-dialog
|
||||
v-model="wavePrintDialogVisible"
|
||||
:loading="wavePrintDialogLoading"
|
||||
:error-message="wavePrintDialogError"
|
||||
:payload="wavePrintDialogPayload"
|
||||
:request-meta="wavePrintRequestMeta"
|
||||
align-center
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, onMounted, reactive, ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { QuestionFilled } from '@element-plus/icons-vue'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
|
||||
@ -402,8 +581,21 @@ import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
import PendingOrderListPanel from './component/PendingOrderListPanel.vue'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
import { settingWarehouseGetSettings as getWarehouseSettings } from '@/api/setting.warehouse/settingwarehouse'
|
||||
import { orderWaveBatchAutoGrouping, orderWaveBatchCancel, orderWaveBatchFinishAutoGrouping, orderWaveBatchList, orderWaveFetch, orderWaveFetchTaskProgress, orderWaveGroupOrderFetchList } from '@/api/order.wave/orderwave'
|
||||
import {
|
||||
orderWaveBatchAutoGrouping,
|
||||
orderWaveBatchCancel,
|
||||
orderWaveBatchFinishAutoGrouping,
|
||||
orderWaveBatchList,
|
||||
orderWaveFetch,
|
||||
orderWaveFetchTaskProgress,
|
||||
orderWaveGroupOrderFetchList,
|
||||
orderWaveSingleOrderFetchList
|
||||
} from '@/api/order.wave/orderwave'
|
||||
import type { WaveFetchParams, WaveFetchResponse, WaveFetchTaskProgressResponse } from '@/api/order.wave/orderwave'
|
||||
import { useUserStore } from '@/stores/modules/user'
|
||||
import { getWavePrintData } from '@/api/order.print/orderprint'
|
||||
import type { WavePrintDataPayload } from '@/api/order.print/orderprint'
|
||||
import WaveBatchPrintPreviewDialog from './component/WaveBatchPrintPreviewDialog.vue'
|
||||
const props = defineProps<{
|
||||
/** 1 团购波次,2 散单波次 */
|
||||
waveType: 1 | 2
|
||||
@ -412,11 +604,19 @@ const props = defineProps<{
|
||||
const scanBox = ref<any>(null)
|
||||
const upperTable = ref<any>(null)
|
||||
const groupOrderTableRef = ref<any>(null)
|
||||
const singleOrderTableRef = ref<any>(null)
|
||||
const scrollContainerRef = ref<HTMLElement | null>(null)
|
||||
const loading = ref(false)
|
||||
const batchAutoGroupingLoading = ref(false)
|
||||
const batchFinishAutoGroupingLoading = ref(false)
|
||||
const batchCancelLoading = ref(false)
|
||||
const batchPrintLoading = ref(false)
|
||||
const userStore = useUserStore()
|
||||
const wavePrintDialogVisible = ref(false)
|
||||
const wavePrintDialogLoading = ref(false)
|
||||
const wavePrintDialogError = ref('')
|
||||
const wavePrintDialogPayload = ref<WavePrintDataPayload | null>(null)
|
||||
const wavePrintRequestMeta = ref<{ warehouse_id: number; wave_ids: Array<number | string> } | null>(null)
|
||||
const queryTime = ref(0)
|
||||
const tableSize = ref('small')
|
||||
const list = ref<any[]>([])
|
||||
@ -449,6 +649,12 @@ const fetchTaskProgress = reactive({
|
||||
|
||||
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
const groupOrderPagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
const singleOrderDialogVisible = ref(false)
|
||||
const singleOrderListLoading = ref(false)
|
||||
const singleOrderSubmitting = ref(false)
|
||||
const singleOrderList = ref<any[]>([])
|
||||
const singleOrderSelectionRows = ref<any[]>([])
|
||||
const singleOrderPagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
const presetTree = ref<any[]>([])
|
||||
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(waveAvailableFields)))
|
||||
const columns = ref(JSON.parse(JSON.stringify(waveBatchColumns)))
|
||||
@ -503,7 +709,8 @@ const buttonLoadingMap = computed(() => ({
|
||||
loading: loading.value,
|
||||
batchAutoGroupingLoading: batchAutoGroupingLoading.value,
|
||||
batchFinishAutoGroupingLoading: batchFinishAutoGroupingLoading.value,
|
||||
batchCancelLoading: batchCancelLoading.value
|
||||
batchCancelLoading: batchCancelLoading.value,
|
||||
batchPrintLoading: batchPrintLoading.value
|
||||
}))
|
||||
|
||||
const buttonDisabledMap = computed(() => ({
|
||||
@ -547,7 +754,8 @@ const toolbarActionMap: Record<string, () => void> = {
|
||||
handleBatchCancel: () => {
|
||||
void handleBatchCancel()
|
||||
},
|
||||
openGroupOrderDialog: () => openGroupOrderDialog()
|
||||
openGroupOrderDialog: () => openGroupOrderDialog(),
|
||||
openSingleOrderDialog: () => openSingleOrderDialog()
|
||||
}
|
||||
|
||||
function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
|
||||
@ -565,6 +773,15 @@ const groupOrderFilters = reactive({
|
||||
returnOrderIds: false
|
||||
})
|
||||
const groupOrderQuantityMap = reactive<Record<string, number | undefined>>({})
|
||||
const singleOrderFilters = reactive({
|
||||
distinguishExpress: true,
|
||||
storeId: undefined as number | string | undefined,
|
||||
sameOrderQuantity: undefined as number | undefined,
|
||||
shopName: '',
|
||||
includeSku: '',
|
||||
returnOrderIds: false
|
||||
})
|
||||
const singleOrderQuantityMap = reactive<Record<string, number | undefined>>({})
|
||||
const isGroupWaveTab = computed(() => props.waveType === 1)
|
||||
const currentWaveType = computed(() => props.waveType)
|
||||
const tableListId = computed(() => `wave-management-list-${props.waveType}`)
|
||||
@ -1090,7 +1307,34 @@ async function handleBatchFinishAutoGrouping() {
|
||||
}
|
||||
}
|
||||
|
||||
function handleBatchPrint() {
|
||||
function unwrapWavePrintPayload(res: any): WavePrintDataPayload {
|
||||
const inner =
|
||||
res?.data !== undefined && res?.data !== null && typeof res.data === 'object' && !Array.isArray(res.data)
|
||||
? res.data
|
||||
: res
|
||||
const summaryRaw = inner?.summary
|
||||
const summary =
|
||||
summaryRaw !== undefined && summaryRaw !== null && typeof summaryRaw === 'object' && !Array.isArray(summaryRaw)
|
||||
? (summaryRaw as Record<string, unknown>)
|
||||
: {}
|
||||
const waveListRaw = inner?.wave_list
|
||||
const wave_list = Array.isArray(waveListRaw)
|
||||
? (waveListRaw.filter((x) => x && typeof x === 'object') as Record<string, unknown>[])
|
||||
: []
|
||||
const extRaw = inner?.ext
|
||||
const ext =
|
||||
extRaw !== undefined && extRaw !== null && typeof extRaw === 'object' && !Array.isArray(extRaw)
|
||||
? (extRaw as Record<string, unknown>)
|
||||
: undefined
|
||||
return { summary, wave_list, ext }
|
||||
}
|
||||
|
||||
async function handleBatchPrint() {
|
||||
if (!isGroupWaveTab.value) {
|
||||
ElMessage.warning('批量打印仅在「团购波次」页签可用')
|
||||
return
|
||||
}
|
||||
|
||||
if (!selectionRows.value.length) {
|
||||
ElMessage.warning('请先勾选要打印的波次')
|
||||
return
|
||||
@ -1123,7 +1367,42 @@ function handleBatchPrint() {
|
||||
ElMessage.warning(`已自动移除 ${removedCount} 个“自动加团中”波次,不计入批量打印`)
|
||||
}
|
||||
|
||||
ElMessage.info(`已选 ${printableSelectionRows.value.length} 个波次,共 ${selectedWaveOrderTotal.value} 单。当前页面尚未接入波次打印接口。`)
|
||||
const rows = printableSelectionRows.value
|
||||
const first = rows[0] as Record<string, unknown>
|
||||
const warehouseId = Number(first?.warehouse_id ?? userStore.user?.warehouse_id ?? userStore.user?.store_id)
|
||||
if (!Number.isFinite(warehouseId) || warehouseId <= 0) {
|
||||
ElMessage.error('无法确定仓库 ID,请确认列表中的仓库字段或当前登录仓库上下文')
|
||||
return
|
||||
}
|
||||
|
||||
const wave_ids = rows
|
||||
.map((row: any) => row?.id ?? row?.wave_id ?? row?.batch_id)
|
||||
.filter((id: unknown) => id !== undefined && id !== null && id !== '')
|
||||
|
||||
if (!wave_ids.length) {
|
||||
ElMessage.warning('当前勾选记录缺少可用的波次 ID')
|
||||
return
|
||||
}
|
||||
|
||||
wavePrintRequestMeta.value = { warehouse_id: warehouseId, wave_ids }
|
||||
wavePrintDialogPayload.value = null
|
||||
wavePrintDialogError.value = ''
|
||||
wavePrintDialogVisible.value = true
|
||||
wavePrintDialogLoading.value = true
|
||||
|
||||
batchPrintLoading.value = true
|
||||
try {
|
||||
const res: any = await getWavePrintData({ warehouse_id: warehouseId, wave_ids })
|
||||
wavePrintDialogPayload.value = unwrapWavePrintPayload(res)
|
||||
const waveCount = wavePrintDialogPayload.value.wave_list?.length ?? 0
|
||||
ElMessage.success(res?.message || `已获取打印数据,返回 ${waveCount} 个波次`)
|
||||
} catch (error: any) {
|
||||
wavePrintDialogError.value = error?.message || '获取波次打印数据失败'
|
||||
wavePrintDialogPayload.value = null
|
||||
} finally {
|
||||
wavePrintDialogLoading.value = false
|
||||
batchPrintLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function stopFetchTaskPolling() {
|
||||
@ -1234,6 +1513,16 @@ function openGroupOrderDialog() {
|
||||
fetchGroupOrderList()
|
||||
}
|
||||
|
||||
function openSingleOrderDialog() {
|
||||
singleOrderDialogVisible.value = true
|
||||
singleOrderFilters.distinguishExpress = true
|
||||
singleOrderPagination.currentPage = 1
|
||||
singleOrderSelectionRows.value = []
|
||||
resetSingleOrderQuantityMap()
|
||||
loadGroupOrderStoreOptions()
|
||||
fetchSingleOrderList()
|
||||
}
|
||||
|
||||
async function loadGroupOrderStoreOptions() {
|
||||
if (groupOrderStoreOptions.value.length > 0) return
|
||||
try {
|
||||
@ -1249,32 +1538,79 @@ async function loadGroupOrderStoreOptions() {
|
||||
}
|
||||
}
|
||||
|
||||
function buildGroupOrderListPayload() {
|
||||
type StructureFetchListFilters = {
|
||||
distinguishExpress: boolean
|
||||
storeId: number | string | undefined
|
||||
sameOrderQuantity: number | undefined
|
||||
shopName: string
|
||||
includeSku: string
|
||||
returnOrderIds: boolean
|
||||
}
|
||||
|
||||
function buildStructureFetchListPayload(
|
||||
pagination: { currentPage: number; pageSize: number },
|
||||
filters: StructureFetchListFilters
|
||||
) {
|
||||
const payload: Record<string, any> = {
|
||||
pagination: {
|
||||
page: groupOrderPagination.currentPage,
|
||||
pageSize: groupOrderPagination.pageSize
|
||||
page: pagination.currentPage,
|
||||
pageSize: pagination.pageSize
|
||||
},
|
||||
distinguish_express: groupOrderFilters.distinguishExpress,
|
||||
return_order_ids: groupOrderFilters.returnOrderIds
|
||||
distinguish_express: filters.distinguishExpress,
|
||||
return_order_ids: filters.returnOrderIds
|
||||
}
|
||||
|
||||
if (groupOrderFilters.storeId !== undefined && groupOrderFilters.storeId !== null && groupOrderFilters.storeId !== '') {
|
||||
payload.store_id = Number(groupOrderFilters.storeId)
|
||||
if (filters.storeId !== undefined && filters.storeId !== null && filters.storeId !== '') {
|
||||
payload.store_id = Number(filters.storeId)
|
||||
}
|
||||
if (groupOrderFilters.sameOrderQuantity !== undefined && groupOrderFilters.sameOrderQuantity !== null) {
|
||||
payload.same_order_quantity = Number(groupOrderFilters.sameOrderQuantity)
|
||||
if (filters.sameOrderQuantity !== undefined && filters.sameOrderQuantity !== null) {
|
||||
payload.same_order_quantity = Number(filters.sameOrderQuantity)
|
||||
}
|
||||
if (groupOrderFilters.shopName.trim()) {
|
||||
payload.shop_name = groupOrderFilters.shopName.trim()
|
||||
if (filters.shopName.trim()) {
|
||||
payload.shop_name = filters.shopName.trim()
|
||||
}
|
||||
if (groupOrderFilters.includeSku.trim()) {
|
||||
payload.include_sku = groupOrderFilters.includeSku.trim()
|
||||
if (filters.includeSku.trim()) {
|
||||
payload.include_sku = filters.includeSku.trim()
|
||||
}
|
||||
|
||||
return payload
|
||||
}
|
||||
|
||||
function buildGroupOrderListPayload() {
|
||||
return buildStructureFetchListPayload(groupOrderPagination, groupOrderFilters)
|
||||
}
|
||||
|
||||
function buildSingleOrderListPayload() {
|
||||
return buildStructureFetchListPayload(singleOrderPagination, singleOrderFilters)
|
||||
}
|
||||
|
||||
async function fetchSingleOrderList() {
|
||||
singleOrderListLoading.value = true
|
||||
try {
|
||||
const res: any = await orderWaveSingleOrderFetchList(buildSingleOrderListPayload())
|
||||
if (!res || !okCode(res.code)) {
|
||||
throw new Error(res?.message || '获取散单候选列表失败')
|
||||
}
|
||||
const responseList = Array.isArray(res.list)
|
||||
? res.list
|
||||
: Array.isArray(res.data?.list)
|
||||
? res.data.list
|
||||
: []
|
||||
const responsePagination = res.pagination || res.data?.pagination || {}
|
||||
singleOrderList.value = responseList
|
||||
singleOrderPagination.currentPage = responsePagination.page || singleOrderPagination.currentPage
|
||||
singleOrderPagination.pageSize = responsePagination.pageSize || singleOrderPagination.pageSize
|
||||
singleOrderPagination.total = responsePagination.total || 0
|
||||
} catch (error: any) {
|
||||
console.error('fetch single order list failed:', error)
|
||||
singleOrderList.value = []
|
||||
singleOrderPagination.total = 0
|
||||
ElMessage.error(error?.message || '获取散单候选列表失败')
|
||||
} finally {
|
||||
singleOrderListLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchGroupOrderList() {
|
||||
groupOrderListLoading.value = true
|
||||
try {
|
||||
@ -1333,6 +1669,53 @@ function handleGroupOrderPageSizeChange(size: number) {
|
||||
fetchGroupOrderList()
|
||||
}
|
||||
|
||||
function handleSingleOrderSelectionChange(rows: any[]) {
|
||||
singleOrderSelectionRows.value = rows || []
|
||||
}
|
||||
|
||||
function handleSingleOrderFilterChange() {
|
||||
singleOrderPagination.currentPage = 1
|
||||
fetchSingleOrderList()
|
||||
}
|
||||
|
||||
function resetSingleOrderFilters() {
|
||||
singleOrderFilters.distinguishExpress = true
|
||||
singleOrderFilters.storeId = undefined
|
||||
singleOrderFilters.sameOrderQuantity = undefined
|
||||
singleOrderFilters.shopName = ''
|
||||
singleOrderFilters.includeSku = ''
|
||||
singleOrderFilters.returnOrderIds = false
|
||||
singleOrderPagination.currentPage = 1
|
||||
fetchSingleOrderList()
|
||||
}
|
||||
|
||||
function handleSingleOrderPageChange(page: number) {
|
||||
singleOrderPagination.currentPage = page
|
||||
fetchSingleOrderList()
|
||||
}
|
||||
|
||||
function handleSingleOrderPageSizeChange(size: number) {
|
||||
singleOrderPagination.pageSize = size
|
||||
singleOrderPagination.currentPage = 1
|
||||
fetchSingleOrderList()
|
||||
}
|
||||
|
||||
function updateSingleOrderQuantity(row: any, value: number | undefined) {
|
||||
const key = String(row?.item_detail_machine || '')
|
||||
if (!key) return
|
||||
if (value === undefined || value === null || Number.isNaN(Number(value))) {
|
||||
delete singleOrderQuantityMap[key]
|
||||
return
|
||||
}
|
||||
singleOrderQuantityMap[key] = Math.max(1, Math.trunc(Number(value)))
|
||||
}
|
||||
|
||||
function resetSingleOrderQuantityMap() {
|
||||
Object.keys(singleOrderQuantityMap).forEach((key) => {
|
||||
delete singleOrderQuantityMap[key]
|
||||
})
|
||||
}
|
||||
|
||||
function updateGroupOrderQuantity(row: any, value: number | undefined) {
|
||||
const key = String(row?.item_detail_machine || '')
|
||||
if (!key) return
|
||||
@ -1433,6 +1816,61 @@ async function submitGroupOrderDialog() {
|
||||
groupOrderSubmitting.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function submitSingleOrderDialog() {
|
||||
if (!singleOrderSelectionRows.value.length) {
|
||||
ElMessage.warning('请先勾选要抓取的散单结构')
|
||||
return
|
||||
}
|
||||
|
||||
singleOrderSubmitting.value = true
|
||||
try {
|
||||
const structureList: WaveFetchParams['structure_list'] = singleOrderSelectionRows.value.map((row: any) => {
|
||||
const key = String(row?.item_detail_machine || '')
|
||||
const payload: WaveFetchParams['structure_list'][number] = {
|
||||
item_detail_machine: key
|
||||
}
|
||||
const quantity = singleOrderQuantityMap[key]
|
||||
if (quantity !== undefined) {
|
||||
payload.quantity = quantity
|
||||
}
|
||||
return payload
|
||||
})
|
||||
|
||||
const res = await orderWaveFetch({ structure_list: structureList }) as WaveFetchResponse & { code?: number; message?: string }
|
||||
if (!res || !okCode(res.code)) {
|
||||
throw new Error(res?.message || '抓取散单失败')
|
||||
}
|
||||
|
||||
const acceptedMessage = [
|
||||
res?.message || '任务已提交,后端异步处理中',
|
||||
res?.task_id ? `任务ID:${res.task_id}` : '',
|
||||
res?.structure_count !== undefined ? `结构数:${res.structure_count}` : ''
|
||||
].filter(Boolean).join(';')
|
||||
|
||||
applyFetchTaskProgress({
|
||||
task_id: res.task_id,
|
||||
status: 'submitted',
|
||||
warehouse_id: res.warehouse_id,
|
||||
structure_count: res.structure_count,
|
||||
finished_structure_count: 0,
|
||||
progress_percent: 0,
|
||||
total_fetched_quantity: 0,
|
||||
message: res.message || '任务已提交,后端异步处理中'
|
||||
})
|
||||
scheduleFetchTaskPolling(1000)
|
||||
|
||||
ElMessage.success(acceptedMessage)
|
||||
singleOrderDialogVisible.value = false
|
||||
singleOrderSelectionRows.value = []
|
||||
resetSingleOrderQuantityMap()
|
||||
} catch (error: any) {
|
||||
console.error('fetch single order failed:', error)
|
||||
ElMessage.error(error?.message || '抓取散单失败')
|
||||
} finally {
|
||||
singleOrderSubmitting.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@ -1512,6 +1950,17 @@ async function submitGroupOrderDialog() {
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.structure-fetch-hint {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.structure-fetch-label-help {
|
||||
margin-left: 4px;
|
||||
vertical-align: middle;
|
||||
color: var(--el-color-info);
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
.group-order-dialog {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@ -0,0 +1,326 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visibleProxy"
|
||||
title="波次批量打印数据"
|
||||
width="min(1040px, 94vw)"
|
||||
destroy-on-close
|
||||
append-to-body
|
||||
class="wave-batch-print-dialog"
|
||||
>
|
||||
<div v-if="loading" class="wave-print-loading">
|
||||
<el-icon class="is-loading wave-print-loading__icon"><Loading /></el-icon>
|
||||
<span>正在请求 order.print.getWavePrintData …</span>
|
||||
</div>
|
||||
<div v-else-if="errorMessage" class="wave-print-error">
|
||||
<el-alert type="error" :closable="false" :title="errorMessage" />
|
||||
</div>
|
||||
<div v-else-if="payload" ref="printRootRef" class="wave-print-body">
|
||||
<div class="wave-print-meta">
|
||||
<span>仓库 ID:<code>{{ requestMeta?.warehouse_id ?? '—' }}</code></span>
|
||||
<span>请求波次 ID 数:<code>{{ requestMeta?.wave_ids?.length ?? 0 }}</code></span>
|
||||
<span>返回波次数:<code>{{ waveRows.length }}</code></span>
|
||||
</div>
|
||||
|
||||
<el-alert v-if="filterHint" type="warning" :closable="false" show-icon class="wave-print-hint">
|
||||
{{ filterHint }}
|
||||
</el-alert>
|
||||
|
||||
<section class="wave-print-section">
|
||||
<h4 class="wave-print-section__title">汇总 summary</h4>
|
||||
<el-descriptions v-if="summaryEntries.length" :column="2" border size="small">
|
||||
<el-descriptions-item v-for="[k, v] in summaryEntries" :key="k" :label="String(k)">
|
||||
{{ formatPrimitive(v) }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<p v-else class="wave-print-muted">(无 summary 或为空对象)</p>
|
||||
</section>
|
||||
|
||||
<section class="wave-print-section wave-print-section--table">
|
||||
<h4 class="wave-print-section__title">波次明细 wave_list</h4>
|
||||
<p class="wave-print-muted wave-print-section__sub">
|
||||
接口说明:自动过滤快递未完全分配的波次;以下为通过过滤的波次及订单明细(订单列为后端返回的首层字段动态展开)。
|
||||
</p>
|
||||
<el-table :data="waveRows" border size="small" row-key="__key">
|
||||
<el-table-column type="expand">
|
||||
<template #default="{ row }">
|
||||
<div class="wave-print-expand">
|
||||
<div v-if="!row.__orders.length" class="wave-print-muted">(该波次下无订单数组字段 orders / order_list 等)</div>
|
||||
<el-table v-else :data="row.__orders" border size="small" max-height="360">
|
||||
<el-table-column
|
||||
v-for="col in row.__orderColumns"
|
||||
:key="col"
|
||||
:label="col"
|
||||
min-width="112"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row: orow }">
|
||||
{{ formatCell((orow as Record<string, unknown>)[col]) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="__waveNo" label="波次号" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="__waveId" label="波次 ID" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="订单条数" width="96" align="right">
|
||||
<template #default="{ row }">{{ row.__orders.length }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</section>
|
||||
|
||||
<section v-if="payload.ext && Object.keys(payload.ext).length" class="wave-print-section">
|
||||
<h4 class="wave-print-section__title">扩展 ext</h4>
|
||||
<pre class="wave-print-json">{{ JSON.stringify(payload.ext, null, 2) }}</pre>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="visibleProxy = false">关闭</el-button>
|
||||
<el-button :disabled="!payload || loading" @click="copyJson">复制 JSON</el-button>
|
||||
<el-button type="primary" :disabled="!payload || loading" @click="printReport">浏览器打印</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { Loading } from '@element-plus/icons-vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { WavePrintDataPayload } from '@/api/order.print/orderprint'
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: boolean
|
||||
loading: boolean
|
||||
errorMessage: string
|
||||
payload: WavePrintDataPayload | null
|
||||
requestMeta: { warehouse_id: number; wave_ids: Array<number | string> } | null
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:modelValue': [boolean]
|
||||
}>()
|
||||
|
||||
const printRootRef = ref<HTMLElement | null>(null)
|
||||
|
||||
const visibleProxy = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (v: boolean) => emit('update:modelValue', v)
|
||||
})
|
||||
|
||||
const summaryEntries = computed(() => {
|
||||
const s = props.payload?.summary
|
||||
if (!s || typeof s !== 'object') return [] as [string, unknown][]
|
||||
return Object.entries(s)
|
||||
})
|
||||
|
||||
const filterHint = computed(() => {
|
||||
const s = props.payload?.summary
|
||||
if (!s || typeof s !== 'object') return ''
|
||||
const o = s as Record<string, unknown>
|
||||
const parts: string[] = []
|
||||
const pickStr = (v: unknown) => (typeof v === 'string' && v.trim() ? v.trim() : '')
|
||||
const msg = pickStr(o.message) || pickStr(o.msg) || pickStr(o.hint)
|
||||
if (msg) parts.push(msg)
|
||||
|
||||
const candidates = [
|
||||
['requested_wave_count', '请求波次数'],
|
||||
['accepted_wave_count', '接受波次数'],
|
||||
['filtered_wave_count', '过滤波次数'],
|
||||
['skipped_wave_count', '跳过波次数'],
|
||||
['order_total', '订单合计']
|
||||
] as const
|
||||
for (const [key, label] of candidates) {
|
||||
if (o[key] !== undefined && o[key] !== null && o[key] !== '') {
|
||||
parts.push(`${label}:${formatPrimitive(o[key])}`)
|
||||
}
|
||||
}
|
||||
if (Array.isArray(o.filtered_wave_ids) && o.filtered_wave_ids.length) {
|
||||
parts.push(`已过滤波次 ID:${JSON.stringify(o.filtered_wave_ids)}`)
|
||||
}
|
||||
if (Array.isArray(o.skipped_wave_ids) && o.skipped_wave_ids.length) {
|
||||
parts.push(`跳过波次 ID:${JSON.stringify(o.skipped_wave_ids)}`)
|
||||
}
|
||||
return parts.filter(Boolean).join(';')
|
||||
})
|
||||
|
||||
function pickOrderArray(wave: Record<string, unknown>): unknown[] {
|
||||
const keys = ['orders', 'order_list', 'order_details', 'items', 'print_orders', 'order_rows']
|
||||
for (const k of keys) {
|
||||
const v = wave[k]
|
||||
if (Array.isArray(v)) return v
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
function orderColumnsForRows(orders: unknown[]): string[] {
|
||||
const first = orders[0]
|
||||
if (!first || typeof first !== 'object') return []
|
||||
return Object.keys(first as Record<string, unknown>).slice(0, 18)
|
||||
}
|
||||
|
||||
const waveRows = computed(() => {
|
||||
const list = props.payload?.wave_list
|
||||
if (!Array.isArray(list)) return []
|
||||
return list.map((raw, idx) => {
|
||||
const wave = raw && typeof raw === 'object' ? (raw as Record<string, unknown>) : {}
|
||||
const orders = pickOrderArray(wave)
|
||||
const __waveNo = String(wave.wave_no ?? wave.batch_no ?? wave.wave_code ?? '—')
|
||||
const __waveId = wave.wave_id ?? wave.id ?? wave.batch_id ?? '—'
|
||||
return {
|
||||
__key: `${__waveNo}-${idx}`,
|
||||
__waveNo,
|
||||
__waveId,
|
||||
__orders: orders,
|
||||
__orderColumns: orderColumnsForRows(orders)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
function formatPrimitive(v: unknown): string {
|
||||
if (v === null || v === undefined) return '—'
|
||||
if (typeof v === 'object') return JSON.stringify(v)
|
||||
return String(v)
|
||||
}
|
||||
|
||||
function formatCell(v: unknown): string {
|
||||
if (v === null || v === undefined) return '—'
|
||||
if (typeof v === 'object') return JSON.stringify(v)
|
||||
return String(v)
|
||||
}
|
||||
|
||||
function buildExportJson(): string {
|
||||
const body: WavePrintDataPayload = {
|
||||
summary: props.payload?.summary,
|
||||
wave_list: props.payload?.wave_list,
|
||||
ext: props.payload?.ext
|
||||
}
|
||||
return JSON.stringify(body, null, 2)
|
||||
}
|
||||
|
||||
async function copyJson() {
|
||||
try {
|
||||
await navigator.clipboard.writeText(buildExportJson())
|
||||
ElMessage.success('已复制 summary / wave_list / ext 的 JSON')
|
||||
} catch {
|
||||
ElMessage.error('复制失败,请手动选择内容复制')
|
||||
}
|
||||
}
|
||||
|
||||
function printReport() {
|
||||
const el = printRootRef.value
|
||||
if (!el) {
|
||||
ElMessage.warning('暂无可打印内容')
|
||||
return
|
||||
}
|
||||
const w = window.open('', '_blank')
|
||||
if (!w) {
|
||||
ElMessage.warning('浏览器拦截了新窗口,请允许弹窗后重试')
|
||||
return
|
||||
}
|
||||
const styles = `
|
||||
body { font-family: system-ui, sans-serif; padding: 16px; color: #303133; }
|
||||
h1 { font-size: 18px; margin: 0 0 12px; }
|
||||
.meta { font-size: 13px; margin-bottom: 12px; color: #606266; }
|
||||
.meta code { background: #f4f4f5; padding: 2px 6px; border-radius: 4px; }
|
||||
table { border-collapse: collapse; width: 100%; font-size: 12px; margin-bottom: 16px; }
|
||||
th, td { border: 1px solid #dcdfe6; padding: 6px 8px; text-align: left; }
|
||||
th { background: #f5f7fa; }
|
||||
h4 { margin: 16px 0 8px; font-size: 14px; }
|
||||
pre { background: #f5f7fa; padding: 10px; overflow: auto; font-size: 11px; }
|
||||
.hint { background: #fdf6ec; border: 1px solid #faecd8; padding: 8px 10px; margin-bottom: 12px; font-size: 12px; color: #e6a23c; }
|
||||
`
|
||||
const hintHtml = filterHint.value ? `<div class="hint">${escapeHtml(filterHint.value)}</div>` : ''
|
||||
w.document.write(`<!DOCTYPE html><html><head><meta charset="utf-8"/><title>波次打印数据</title><style>${styles}</style></head><body>`)
|
||||
w.document.write(`<h1>波次批量打印数据</h1>`)
|
||||
w.document.write(
|
||||
`<div class="meta">仓库 ID:<code>${escapeHtml(String(props.requestMeta?.warehouse_id ?? ''))}</code>;请求波次 ID 数:<code>${props.requestMeta?.wave_ids?.length ?? 0}</code></div>`
|
||||
)
|
||||
w.document.write(hintHtml)
|
||||
w.document.write(el.innerHTML)
|
||||
w.document.write('</body></html>')
|
||||
w.document.close()
|
||||
w.focus()
|
||||
w.print()
|
||||
}
|
||||
|
||||
function escapeHtml(s: string) {
|
||||
return s
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.wave-print-loading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 24px 8px;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
|
||||
&__icon {
|
||||
font-size: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
.wave-print-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16px;
|
||||
margin-bottom: 12px;
|
||||
font-size: 13px;
|
||||
color: #606266;
|
||||
|
||||
code {
|
||||
background: #f4f4f5;
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.wave-print-hint {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.wave-print-section {
|
||||
margin-bottom: 18px;
|
||||
|
||||
&__title {
|
||||
margin: 0 0 8px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
&__sub {
|
||||
margin: 0 0 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.wave-print-muted {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.wave-print-expand {
|
||||
padding: 8px 12px 12px;
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.wave-print-json {
|
||||
margin: 0;
|
||||
padding: 10px 12px;
|
||||
background: #f5f7fa;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
line-height: 1.45;
|
||||
overflow: auto;
|
||||
max-height: 240px;
|
||||
}
|
||||
</style>
|
||||
@ -1,8 +1,8 @@
|
||||
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
|
||||
|
||||
/** 工具栏按钮:可限定仅在团购波次(waveType === 1)显示 */
|
||||
/** 工具栏按钮:可限定仅在对应波次页签显示(1 团购 / 2 散单) */
|
||||
export type WaveToolbarButtonConfig = ToolbarButtonConfig & {
|
||||
onlyForWaveType?: 1
|
||||
onlyForWaveType?: 1 | 2
|
||||
}
|
||||
|
||||
/** ScanBox 默认 props(与 orderManagement 子页一致的可配置项) */
|
||||
@ -53,6 +53,21 @@ export const waveAvailableFields = [
|
||||
{ label: '否', value: 0 }
|
||||
]
|
||||
},
|
||||
{label:'库位分配', value: 'storage_assignment_status', type: 'select', options: [
|
||||
{ label: '未分配', value: 'none' },
|
||||
{ label: '分配中', value: 'padding' },
|
||||
{ label: '已完成', value: 'fin' }
|
||||
]},
|
||||
{label:'快递分配', value: 'express_assignment_status', type: 'select', options: [
|
||||
{ label: '未分配', value: 'none' },
|
||||
{ label: '分配中', value: 'padding' },
|
||||
{ label: '已完成', value: 'fin' }
|
||||
]},
|
||||
{label:'打印状态', value: 'print_assignment_status', type: 'select', options: [
|
||||
{ label: '未打印', value: 'none' },
|
||||
{ label: '打印中', value: 'padding' },
|
||||
{ label: '已完成', value: 'fin' }
|
||||
]},
|
||||
{ label: '最小订单数', value: 'total_orders_min', type: 'number' },
|
||||
{ label: '最大订单数', value: 'total_orders_max', type: 'number' },
|
||||
{ label: '最小已处理订单', value: 'processed_orders_min', type: 'number' },
|
||||
@ -81,7 +96,7 @@ export const waveBatchColumns = [
|
||||
{ prop: 'warehouse_id', label: '仓库ID', minWidth: 110 },
|
||||
{ prop: 'create_time', label: '创建时间', minWidth: 168 },
|
||||
{ prop: 'update_time', label: '更新时间', minWidth: 168 },
|
||||
{ prop: 'operation', label: '操作', minWidth: 110, fixed: 'left' }
|
||||
{ prop: 'operation', label: '操作', minWidth: 110, fixed: 'right' }
|
||||
]
|
||||
|
||||
/** 列表查询 where 白名单(与 sanitizeWaveWhere 一致) */
|
||||
@ -124,7 +139,9 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
disabledKey: 'batchPrintDisabled',
|
||||
action: 'handleBatchPrint'
|
||||
loadingKey: 'batchPrintLoading',
|
||||
action: 'handleBatchPrint',
|
||||
onlyForWaveType: 1
|
||||
},
|
||||
{
|
||||
key: 'batchAutoGrouping',
|
||||
@ -160,6 +177,14 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
size: 'small',
|
||||
action: 'openGroupOrderDialog',
|
||||
onlyForWaveType: 1
|
||||
},
|
||||
{
|
||||
key: 'fetchSingleOrder',
|
||||
label: '抓取散单候选',
|
||||
type: 'warning',
|
||||
size: 'small',
|
||||
action: 'openSingleOrderDialog',
|
||||
onlyForWaveType: 2
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@ -292,8 +292,11 @@ import { ref, reactive, watch, onMounted, nextTick, computed } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Check, Refresh, InfoFilled, Plus } from '@element-plus/icons-vue'
|
||||
import * as stockApi from '@/api/stock/stock'
|
||||
import { useUserStore } from '@/stores/modules/user'
|
||||
import { stockDefaultFormData, stockFormRules } from '../stock-config'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const props = defineProps({
|
||||
id: {
|
||||
type: Number,
|
||||
@ -406,22 +409,33 @@ const validateItemCode = async (rule: any, value: any, callback: any) => {
|
||||
}
|
||||
|
||||
if (!formData.store_id) {
|
||||
// Store ID required for uniqueness check usually, but let's proceed or wait
|
||||
itemCodeError.value = '请先选择货主'
|
||||
callback(new Error(itemCodeError.value))
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
const u = userStore.user || {}
|
||||
const ctxWh = u.warehouse_id ?? u.store_id
|
||||
const w =
|
||||
ctxWh != null && ctxWh !== '' ? Number(ctxWh) : undefined
|
||||
const wid = w != null && Number.isFinite(w) ? w : undefined
|
||||
|
||||
const response = await stockApi.checkItemCodeUnique({
|
||||
store_id: formData.store_id,
|
||||
item_code: formData.item_code.trim()
|
||||
...(wid != null ? { warehouse_id: wid } : {}),
|
||||
item_code: formData.item_code.trim(),
|
||||
owner_id: formData.store_id,
|
||||
store_id: formData.store_id
|
||||
})
|
||||
|
||||
if (response && (response as any).code == 200) {
|
||||
const data = (response as any).data
|
||||
if (data.isUnique) {
|
||||
const isUnique = data?.unique ?? data?.isUnique
|
||||
if (isUnique === true) {
|
||||
itemCodeError.value = ""
|
||||
callback()
|
||||
} else {
|
||||
itemCodeError.value = data.message || "条码已存在"
|
||||
itemCodeError.value = data?.message || '商品编码已存在'
|
||||
callback(new Error(itemCodeError.value))
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -611,20 +611,33 @@ const validateItemCode = async (rule: any, value: string, callback: any) => {
|
||||
}
|
||||
|
||||
try {
|
||||
const u = userStore.user || {}
|
||||
const ctxWh = u.warehouse_id ?? u.store_id
|
||||
const warehouse_id =
|
||||
(formData as any).warehouse_id != null && (formData as any).warehouse_id !== ''
|
||||
? Number((formData as any).warehouse_id)
|
||||
: ctxWh != null && ctxWh !== ''
|
||||
? Number(ctxWh)
|
||||
: undefined
|
||||
const wid = warehouse_id != null && Number.isFinite(warehouse_id) ? warehouse_id : undefined
|
||||
|
||||
const response: any = await stockApi.checkItemCodeUnique({
|
||||
store_id: formData.store_id,
|
||||
...(wid != null ? { warehouse_id: wid } : {}),
|
||||
item_code: formData.item_code.trim(),
|
||||
id: formData.id
|
||||
owner_id: formData.store_id,
|
||||
store_id: formData.store_id,
|
||||
...(formData.id != null ? { item_id: formData.id, id: formData.id } : {})
|
||||
})
|
||||
|
||||
if (response.code == 200) {
|
||||
const data = response.data
|
||||
if (data.isUnique) {
|
||||
const isUnique = data?.unique ?? data?.isUnique
|
||||
if (isUnique === true) {
|
||||
itemCodeError = ""
|
||||
callback()
|
||||
} else {
|
||||
itemCodeError = data.message
|
||||
callback(new Error(data.message))
|
||||
itemCodeError = data?.message || '商品编码已存在'
|
||||
callback(new Error(itemCodeError))
|
||||
}
|
||||
} else {
|
||||
itemCodeError = "检测条码唯一性失败"
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
<!-- 主内容区域 -->
|
||||
<div class="main-content">
|
||||
<!-- 工具栏 -->
|
||||
<div class="toolbar">
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-button-group class="toolbar-btn-group">
|
||||
<el-button
|
||||
@ -81,6 +81,22 @@
|
||||
>
|
||||
导出
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
size="small"
|
||||
@click="openColumnConfigPanel"
|
||||
title="字段设置"
|
||||
>
|
||||
字段设置
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
size="small"
|
||||
@click="toggleDetailVisible"
|
||||
:title="detailVisible ? '隐藏详情' : '显示详情'"
|
||||
>
|
||||
{{ detailVisible ? '隐藏详情' : '显示详情' }}
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
|
||||
@ -98,26 +114,29 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 上层列表 -->
|
||||
<div class="upper-wrapper">
|
||||
<upper-table
|
||||
ref="accountTableRef"
|
||||
title="商品列表"
|
||||
:data="list"
|
||||
:columns="accountColumns"
|
||||
:table-size="tableSize"
|
||||
:pagination="pagination"
|
||||
:show-index="true"
|
||||
:show-actions="true"
|
||||
:show-selection="showSelection"
|
||||
:loading="loading"
|
||||
:queryTime="queryTime"
|
||||
@current-change="handleRowClick"
|
||||
@page-change="handlePageChange"
|
||||
@page-size-change="handlePageSizeChange"
|
||||
@refresh="handleRefresh"
|
||||
@selection-change="selectionChange"
|
||||
>
|
||||
<div class="split-stack" ref="splitStackRef">
|
||||
<!-- 上层列表 -->
|
||||
<div class="upper-wrapper" :style="detailVisible ? upperPaneStyle : upperPaneFullStyle">
|
||||
<upper-table
|
||||
ref="accountTableRef"
|
||||
title="商品列表"
|
||||
:enable-column-config="true"
|
||||
table-id="stock-management-list"
|
||||
:data="list"
|
||||
:columns="accountColumns"
|
||||
:table-size="tableSize"
|
||||
:pagination="pagination"
|
||||
:show-index="true"
|
||||
:show-actions="true"
|
||||
:show-selection="showSelection"
|
||||
:loading="loading"
|
||||
:queryTime="queryTime"
|
||||
@current-change="handleRowClick"
|
||||
@page-change="handlePageChange"
|
||||
@page-size-change="handlePageSizeChange"
|
||||
@refresh="handleRefresh"
|
||||
@selection-change="selectionChange"
|
||||
>
|
||||
<!-- 自定义状态列 -->
|
||||
<template #column-is_sn_mgmt="{ row }">
|
||||
<el-tag :type="row.is_sn_mgmt === 'Y' ? 'success' : 'info'" size="small">
|
||||
@ -143,43 +162,52 @@
|
||||
<p>暂无商品数据</p>
|
||||
</div>
|
||||
</template>
|
||||
</upper-table>
|
||||
</div>
|
||||
|
||||
<!-- 下层详情区域 -->
|
||||
<div class="lower-level" v-if="currentStockId" :class="tableSize">
|
||||
<div class="detail-header">
|
||||
<el-tabs v-model="activeTab" @tab-change="handleTabChange" class="detail-tab">
|
||||
<el-tab-pane label="商品明细" name="info" />
|
||||
<el-tab-pane label="图片" name="images" />
|
||||
<el-tab-pane label="条码" name="barcode" />
|
||||
<el-tab-pane label="外部商品绑定" name="erpStock" />
|
||||
<el-tab-pane label="库存" name="storage" />
|
||||
<el-tab-pane label="日志" name="log" />
|
||||
</el-tabs>
|
||||
</upper-table>
|
||||
</div>
|
||||
|
||||
<div class="detail-container">
|
||||
<keep-alive>
|
||||
<div class="detail-component-wrapper">
|
||||
<component
|
||||
:is="activeComponent"
|
||||
:id="currentStockId"
|
||||
type="stock"
|
||||
@refresh="handleRefresh"
|
||||
/>
|
||||
<template v-if="detailVisible">
|
||||
<div
|
||||
class="pane-resizer"
|
||||
title="拖动调整列表与详情区域高度"
|
||||
@mousedown="beginSplitDrag"
|
||||
/>
|
||||
|
||||
<!-- 下层详情区域 -->
|
||||
<div class="lower-level" v-if="currentStockId" :class="tableSize" :style="lowerPaneStyle">
|
||||
<div class="detail-header">
|
||||
<el-tabs v-model="activeTab" @tab-change="handleTabChange" class="detail-tab">
|
||||
<el-tab-pane label="商品明细" name="info" />
|
||||
<el-tab-pane label="图片" name="images" />
|
||||
<el-tab-pane label="条码" name="barcode" />
|
||||
<el-tab-pane label="外部商品绑定" name="erpStock" />
|
||||
<el-tab-pane label="库存" name="storage" />
|
||||
<el-tab-pane label="日志" name="log" />
|
||||
</el-tabs>
|
||||
</div>
|
||||
</keep-alive>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="no-selection" v-else>
|
||||
<div class="empty-tip">
|
||||
<el-icon><InfoFilled /></el-icon>
|
||||
<p>请从上方列表中选择一项查看详情</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-container">
|
||||
<keep-alive>
|
||||
<div class="detail-component-wrapper">
|
||||
<component
|
||||
:is="activeComponent"
|
||||
:id="currentStockId"
|
||||
type="stock"
|
||||
@refresh="handleRefresh"
|
||||
/>
|
||||
</div>
|
||||
</keep-alive>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="no-selection" v-else :style="lowerPaneStyle">
|
||||
<div class="empty-tip">
|
||||
<el-icon><InfoFilled /></el-icon>
|
||||
<p>请从上方列表中选择一项查看详情</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 抽屉:添加 -->
|
||||
<el-drawer v-model="drawer" :with-header="false" direction="rtl" size="800px">
|
||||
@ -240,6 +268,7 @@ import * as stockApi from '@/api/stock/stock'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
// Store
|
||||
import { useUserStore } from '@/stores/modules/user'
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
|
||||
// Utils
|
||||
import { parseTime } from '@/utils/index'
|
||||
@ -264,6 +293,7 @@ const batchDialogCommand = ref('')
|
||||
const drawer = ref(false)
|
||||
const showRecycle = ref(false)
|
||||
const activeTab = ref('info')
|
||||
const detailVisible = ref(true)
|
||||
const loading = ref(false)
|
||||
const showSelection = ref(true)
|
||||
const queryTime = ref(0)
|
||||
@ -283,6 +313,14 @@ const pagination = reactive({
|
||||
const batchConfig = reactive(JSON.parse(JSON.stringify(stockBatchConfig)))
|
||||
|
||||
const tableSize = ref('small')
|
||||
const { splitStackRef, beginSplitDrag, lowerPaneStyle, upperPaneStyle } = useVerticalSplitPane({
|
||||
defaultLowerPercent: 40
|
||||
})
|
||||
const upperPaneFullStyle = computed(() => ({
|
||||
flex: '1 1 auto',
|
||||
minHeight: '0',
|
||||
overflow: 'hidden'
|
||||
}))
|
||||
|
||||
// Components Mapping
|
||||
const componentMap: Record<string, any> = {
|
||||
@ -332,6 +370,14 @@ const handleRefresh = () => {
|
||||
loadData()
|
||||
}
|
||||
|
||||
const toggleDetailVisible = () => {
|
||||
detailVisible.value = !detailVisible.value
|
||||
}
|
||||
|
||||
const openColumnConfigPanel = () => {
|
||||
accountTableRef.value?.openColumnConfig?.()
|
||||
}
|
||||
|
||||
const loadData = async () => {
|
||||
loading.value = true
|
||||
const startTime = Date.now()
|
||||
@ -594,9 +640,7 @@ const loadStockUnits = async () => {
|
||||
}
|
||||
|
||||
.upper-wrapper {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
/* upper-wrapper 自动填充剩余空间 */
|
||||
/* 高度占比由 :style(upperPaneStyle / upperPaneFullStyle)控制 */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@ -606,9 +650,29 @@ const loadStockUnits = async () => {
|
||||
}
|
||||
|
||||
|
||||
.split-stack {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.pane-resizer {
|
||||
flex: 0 0 6px;
|
||||
min-height: 6px;
|
||||
background: #e4e7ed;
|
||||
cursor: row-resize;
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
||||
&:hover {
|
||||
background: #dcdfe6;
|
||||
}
|
||||
}
|
||||
|
||||
.lower-level {
|
||||
flex: 0 0 40%;
|
||||
height: 40%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-top: 1px solid #ebeef5;
|
||||
@ -645,8 +709,6 @@ const loadStockUnits = async () => {
|
||||
}
|
||||
|
||||
.no-selection {
|
||||
flex: 0 0 40%;
|
||||
height: 40%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
# 接口
|
||||
|
||||
- 更新时间: 2026-05-04 17:43:07
|
||||
- 更新时间: 2026-05-05 17:30:32
|
||||
- 扫描目录: `src\api`
|
||||
- 模块数: 33
|
||||
- API 文件数: 33
|
||||
- 接口数: 258
|
||||
- 已启用: 228
|
||||
- 模块数: 34
|
||||
- API 文件数: 34
|
||||
- 接口数: 260
|
||||
- 已启用: 230
|
||||
- 占位接口: 2
|
||||
|
||||
## 模块统计
|
||||
@ -23,8 +23,9 @@
|
||||
| order.index | 1 | 6 | 5 | 0 |
|
||||
| order.outboundorder | 1 | 3 | 3 | 0 |
|
||||
| order.pendingorder | 1 | 16 | 16 | 0 |
|
||||
| order.print | 1 | 1 | 1 | 0 |
|
||||
| order.revieworder | 1 | 3 | 3 | 0 |
|
||||
| order.wave | 1 | 8 | 8 | 0 |
|
||||
| order.wave | 1 | 9 | 9 | 0 |
|
||||
| pick | 1 | 1 | 1 | 0 |
|
||||
| print | 1 | 13 | 12 | 1 |
|
||||
| printer.station | 1 | 11 | 1 | 0 |
|
||||
@ -65,7 +66,7 @@
|
||||
| index | getImages | index.getImages | POST | 是 | 否 | index/index.ts | |
|
||||
| index | getLocationTypeList | index.getLocationTypeList | POST | 是 | 否 | index/index.ts | |
|
||||
| index | getMessageDetail | index.getMessageDetail | POST | 是 | 否 | index/index.ts | |
|
||||
| index | getPlatformList | index.getPlatformList | POST | 是 | 否 | index/index.ts | 表单用 |
|
||||
| index | getPlatformList | index.getPlatformList | POST | 是 | 否 | index/index.ts | 平台编码表单用 |
|
||||
| index | listInterfaceTypes | index.listInterfaceTypes | POST | 是 | 否 | index/index.ts | |
|
||||
| index | loadStores | index.loadStores | POST | 是 | 否 | index/index.ts | |
|
||||
| index | loginToIm | index.loginToIm | POST | 否 | 否 | index/index.ts | |
|
||||
@ -111,6 +112,7 @@
|
||||
| order.pendingorder | orderPendingOrderSyncOrderIds | order.pendingOrder.syncOrderIds | POST | 是 | 否 | order.pendingorder/orderpendingOrder.ts | |
|
||||
| order.pendingorder | orderPendingOrderUpdateOrderExpress | order.pendingOrder.updateOrderExpress | POST | 是 | 否 | order.pendingorder/orderpendingOrder.ts | |
|
||||
| order.pendingorder | orderPendingOrderUpdateOrderPlatform | order.pendingOrder.updateOrderPlatform | POST | 是 | 否 | order.pendingorder/orderpendingOrder.ts | |
|
||||
| order.print | getWavePrintData | order.print.getWavePrintData | POST | 是 | 否 | order.print/orderprint.ts | |
|
||||
| order.revieworder | orderReviewOrderDetail | order.reviewOrder.detail | POST | 是 | 否 | order.revieworder/orderreviewOrder.ts | |
|
||||
| order.revieworder | orderReviewOrderList | order.reviewOrder.list | POST | 是 | 否 | order.revieworder/orderreviewOrder.ts | |
|
||||
| order.revieworder | orderReviewOrderReviewOrder | order.reviewOrder.reviewOrder | POST | 是 | 否 | order.revieworder/orderreviewOrder.ts | |
|
||||
@ -122,6 +124,7 @@
|
||||
| order.wave | orderWaveFetch | order.wave.fetch | POST | 是 | 否 | order.wave/orderwave.ts | |
|
||||
| order.wave | orderWaveFetchTaskProgress | order.wave.fetchTaskProgress | POST | 是 | 否 | order.wave/orderwave.ts | |
|
||||
| order.wave | orderWaveGroupOrderFetchList | order.wave.groupOrderFetchList | POST | 是 | 否 | order.wave/orderwave.ts | |
|
||||
| order.wave | orderWaveSingleOrderFetchList | order.wave.singleOrderFetchList | POST | 是 | 否 | order.wave/orderwave.ts | |
|
||||
| pick | pickQuery | pick.query | POST | 是 | 否 | pick/pick.ts | |
|
||||
| print | getExpressList | index.getExpressList | POST | 否 | 否 | print/print.ts | |
|
||||
| print | add | print.add | POST | 是 | 否 | print/print.ts | |
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -12,43 +12,32 @@
|
||||
"label": "全部"
|
||||
}
|
||||
},
|
||||
"totalInterfaceCount": 222,
|
||||
"totalInterfaceCount": 225,
|
||||
"changes": {
|
||||
"summary": {
|
||||
"moduleAdded": 1,
|
||||
"moduleAdded": 0,
|
||||
"moduleDeleted": 0,
|
||||
"moduleUpdated": 1,
|
||||
"interfaceAdded": 1,
|
||||
"interfaceDeleted": 2,
|
||||
"interfaceDeleted": 0,
|
||||
"interfaceParamsUpdated": 0,
|
||||
"interfaceResponseUpdated": 0
|
||||
},
|
||||
"moduleUpdates": {
|
||||
"added": [
|
||||
{
|
||||
"moduleName": "拣货模块",
|
||||
"moduleKey": "pick",
|
||||
"folder": "pick",
|
||||
"methods": [
|
||||
"pick.query"
|
||||
],
|
||||
"interfaceCount": 1
|
||||
}
|
||||
],
|
||||
"added": [],
|
||||
"deleted": [],
|
||||
"updated": [
|
||||
{
|
||||
"moduleName": "商品模块",
|
||||
"moduleKey": "stock",
|
||||
"folder": "stock",
|
||||
"previousModuleName": "商品模块",
|
||||
"previousModuleKey": "stock",
|
||||
"moduleName": "订单波次模块",
|
||||
"moduleKey": "order.wave",
|
||||
"folder": "order.wave",
|
||||
"previousModuleName": "订单波次模块",
|
||||
"previousModuleKey": "order.wave",
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [],
|
||||
"deletedMethods": [
|
||||
"stock.stockWarehouse",
|
||||
"stock.warehouse.getStockDetail"
|
||||
"addedMethods": [
|
||||
"order.wave.singleOrderFetchList"
|
||||
],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
}
|
||||
@ -58,26 +47,13 @@
|
||||
"interfaceUpdates": {
|
||||
"added": [
|
||||
{
|
||||
"moduleName": "拣货模块",
|
||||
"moduleKey": "pick",
|
||||
"folder": "pick",
|
||||
"method": "pick.query"
|
||||
}
|
||||
],
|
||||
"deleted": [
|
||||
{
|
||||
"moduleName": "商品模块",
|
||||
"moduleKey": "stock",
|
||||
"folder": "stock",
|
||||
"method": "stock.stockWarehouse"
|
||||
},
|
||||
{
|
||||
"moduleName": "商品模块",
|
||||
"moduleKey": "stock",
|
||||
"folder": "stock",
|
||||
"method": "stock.warehouse.getStockDetail"
|
||||
"moduleName": "订单波次模块",
|
||||
"moduleKey": "order.wave",
|
||||
"folder": "order.wave",
|
||||
"method": "order.wave.singleOrderFetchList"
|
||||
}
|
||||
],
|
||||
"deleted": [],
|
||||
"paramsUpdated": [],
|
||||
"responseUpdated": []
|
||||
}
|
||||
@ -3048,6 +3024,63 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "订单打印模块",
|
||||
"moduleKey": "order.print",
|
||||
"moduleFolder": "order.print",
|
||||
"method": "order.print.getWavePrintData",
|
||||
"title": "按波次 IDs 获取订单打印数据,自动过滤快递未完全分配的波次,返回通过过滤的波次订单明细,按波次号分组",
|
||||
"description": "按波次 IDs 获取订单打印数据,自动过滤快递未完全分配的波次,返回通过过滤的波次订单明细,按波次号分组",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "warehouse_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "仓库ID"
|
||||
},
|
||||
{
|
||||
"name": "wave_ids",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "波次ID列表(支持数字或字符串,内部自动去重与归一化)"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "summary",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "汇总信息"
|
||||
},
|
||||
{
|
||||
"name": "wave_list",
|
||||
"type": "array",
|
||||
"required": false,
|
||||
"description": "波次列表(按 wave_no 排序)"
|
||||
},
|
||||
{
|
||||
"name": "ext",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "扩展字段"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "订单工作台入口模块",
|
||||
"moduleKey": "order.index",
|
||||
@ -3891,6 +3924,87 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "订单波次模块",
|
||||
"moduleKey": "order.wave",
|
||||
"moduleFolder": "order.wave",
|
||||
"method": "order.wave.singleOrderFetchList",
|
||||
"title": "按机器结构分组的散单候选列表。仅处理待处理订单(排除待审核),且排除已在波次中的订单。与 order.wave.groupOrderFetchList 不同:groupOrderFetchList 返回满足同组订单数量 >= same_order_quantity(或仓库配置 min_group_order_fetch_quantity)的团购命中分组;singleOrderFetchList 则排除这些团购命中分组,仅返回同组订单数量小于该阈值的散单候选分组(即 < same_order_quantity)。",
|
||||
"description": "按机器结构分组的散单候选列表。仅处理待处理订单(排除待审核),且排除已在波次中的订单。与 order.wave.groupOrderFetchList 不同:groupOrderFetchList 返回满足同组订单数量 >= same_order_quantity(或仓库配置 min_group_order_fetch_quantity)的团购命中分组;singleOrderFetchList 则排除这些团购命中分组,仅返回同组订单数量小于该阈值的散单候选分组(即 < same_order_quantity)。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "pagination",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "分页参数,支持 page / pageSize"
|
||||
},
|
||||
{
|
||||
"name": "distinguish_express",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "是否区分快递(影响分组粒度)"
|
||||
},
|
||||
{
|
||||
"name": "store_id",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "货主ID(仅作为筛选条件)"
|
||||
},
|
||||
{
|
||||
"name": "same_order_quantity",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "最小同组订单数量阈值(用于判定团购命中);本接口返回同组订单数量小于该阈值的分组。若显式传入有效数值则按传入值使用;未传入时使用仓库配置 min_group_order_fetch_quantity(默认 13)。"
|
||||
},
|
||||
{
|
||||
"name": "shop_name",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "店铺名称(模糊匹配)"
|
||||
},
|
||||
{
|
||||
"name": "include_sku",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "仅保留包含该 SKU 的分组(页内过滤)"
|
||||
},
|
||||
{
|
||||
"name": "return_order_ids",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "是否在结果中返回组内订单ID列表"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "list",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "散单候选分组列表,items 示例见实现:包含 item_detail_machine/item_snapshot/group_count 等字段;返回的 group_count 均小于 same_order_quantity(或仓库配置的 min_group_order_fetch_quantity)。"
|
||||
},
|
||||
{
|
||||
"name": "pagination",
|
||||
"type": "object",
|
||||
"required": true,
|
||||
"description": "分页信息(page、pageSize、total、totalPages、hasPrevious、hasNext)"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "拣货模块",
|
||||
"moduleKey": "pick",
|
||||
@ -6381,8 +6495,8 @@
|
||||
"moduleKey": "stock",
|
||||
"moduleFolder": "stock",
|
||||
"method": "stock.warehouse.checkItemCodeUnique",
|
||||
"title": "校验商品编码在货主维度唯一性",
|
||||
"description": "校验商品编码在货主维度唯一性",
|
||||
"title": "检测商品编码唯一性。在同一仓库和货主下,排除商品自身后,判断商品编码是否已存在于未删除商品中。",
|
||||
"description": "检测商品编码唯一性。在同一仓库和货主下,排除商品自身后,判断商品编码是否已存在于未删除商品中。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
@ -6399,26 +6513,63 @@
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "warehouse_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "仓库ID;默认使用当前登录主体/仓库上下文(ctx.user.store_id)"
|
||||
},
|
||||
{
|
||||
"name": "item_code",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "item_code 参数"
|
||||
"description": "要检测的商品编码"
|
||||
},
|
||||
{
|
||||
"name": "store_id",
|
||||
"name": "item_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "store_id 参数"
|
||||
"required": false,
|
||||
"description": "当前商品ID(编辑场景用,排除自身);兼容字段名 id"
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "id 参数"
|
||||
"description": "兼容字段 id"
|
||||
},
|
||||
{
|
||||
"name": "owner_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "货主ID(对应表字段 store_id);兼容字段名 store_id"
|
||||
},
|
||||
{
|
||||
"name": "store_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "兼容字段 store_id"
|
||||
}
|
||||
],
|
||||
"response": []
|
||||
"response": [
|
||||
{
|
||||
"name": "unique",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "true 表示编码唯一,false 表示已存在重复"
|
||||
},
|
||||
{
|
||||
"name": "isUnique",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "同 unique(兼容旧字段名)"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "重复时返回 '商品编码已存在',唯一时不返回该字段"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "商品模块",
|
||||
@ -6634,6 +6785,69 @@
|
||||
"params": [],
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"moduleName": "商品模块",
|
||||
"moduleKey": "stock",
|
||||
"moduleFolder": "stock",
|
||||
"method": "stock.warehouse.getStockDetail",
|
||||
"title": "按库位/批次维度查询商品库存分布",
|
||||
"description": "按库位/批次维度查询商品库存分布",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "stock_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "商品库存ID(stock_warehouse.id)"
|
||||
},
|
||||
{
|
||||
"name": "pagination",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "分页参数,包含 page/pageSize"
|
||||
},
|
||||
{
|
||||
"name": "group_by_batch",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "是否按批次返回明细;true 返回每条明细,false 按库位合并"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "stockItem",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "商品概要,包含 id、item_code、item_name、sku_property、stock_unit、quantity、locked_quantity 等"
|
||||
},
|
||||
{
|
||||
"name": "storageList",
|
||||
"type": "array",
|
||||
"required": false,
|
||||
"description": "库存明细数组;group_by_batch=true 返回 wms_storage 明细(含 batch_no、production_date、expiry_date、inbound_time、inbound_order_no、supplier_batch_no 等),group_by_batch=false 时按库位合并,批次相关字段为 null"
|
||||
},
|
||||
{
|
||||
"name": "pagination",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "分页信息,包含 page、pageSize、total"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "商品模块",
|
||||
"moduleKey": "stock",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -12,44 +12,33 @@
|
||||
"label": "全部"
|
||||
}
|
||||
},
|
||||
"moduleCount": 33,
|
||||
"totalInterfaceCount": 222,
|
||||
"moduleCount": 34,
|
||||
"totalInterfaceCount": 225,
|
||||
"changes": {
|
||||
"summary": {
|
||||
"moduleAdded": 1,
|
||||
"moduleAdded": 0,
|
||||
"moduleDeleted": 0,
|
||||
"moduleUpdated": 1,
|
||||
"interfaceAdded": 1,
|
||||
"interfaceDeleted": 2,
|
||||
"interfaceDeleted": 0,
|
||||
"interfaceParamsUpdated": 0,
|
||||
"interfaceResponseUpdated": 0
|
||||
},
|
||||
"moduleUpdates": {
|
||||
"added": [
|
||||
{
|
||||
"moduleName": "拣货模块",
|
||||
"moduleKey": "pick",
|
||||
"folder": "pick",
|
||||
"methods": [
|
||||
"pick.query"
|
||||
],
|
||||
"interfaceCount": 1
|
||||
}
|
||||
],
|
||||
"added": [],
|
||||
"deleted": [],
|
||||
"updated": [
|
||||
{
|
||||
"moduleName": "商品模块",
|
||||
"moduleKey": "stock",
|
||||
"folder": "stock",
|
||||
"previousModuleName": "商品模块",
|
||||
"previousModuleKey": "stock",
|
||||
"moduleName": "订单波次模块",
|
||||
"moduleKey": "order.wave",
|
||||
"folder": "order.wave",
|
||||
"previousModuleName": "订单波次模块",
|
||||
"previousModuleKey": "order.wave",
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [],
|
||||
"deletedMethods": [
|
||||
"stock.stockWarehouse",
|
||||
"stock.warehouse.getStockDetail"
|
||||
"addedMethods": [
|
||||
"order.wave.singleOrderFetchList"
|
||||
],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
}
|
||||
@ -59,26 +48,13 @@
|
||||
"interfaceUpdates": {
|
||||
"added": [
|
||||
{
|
||||
"moduleName": "拣货模块",
|
||||
"moduleKey": "pick",
|
||||
"folder": "pick",
|
||||
"method": "pick.query"
|
||||
}
|
||||
],
|
||||
"deleted": [
|
||||
{
|
||||
"moduleName": "商品模块",
|
||||
"moduleKey": "stock",
|
||||
"folder": "stock",
|
||||
"method": "stock.stockWarehouse"
|
||||
},
|
||||
{
|
||||
"moduleName": "商品模块",
|
||||
"moduleKey": "stock",
|
||||
"folder": "stock",
|
||||
"method": "stock.warehouse.getStockDetail"
|
||||
"moduleName": "订单波次模块",
|
||||
"moduleKey": "order.wave",
|
||||
"folder": "order.wave",
|
||||
"method": "order.wave.singleOrderFetchList"
|
||||
}
|
||||
],
|
||||
"deleted": [],
|
||||
"paramsUpdated": [],
|
||||
"responseUpdated": []
|
||||
}
|
||||
@ -327,11 +303,14 @@
|
||||
"moduleName": "订单波次模块",
|
||||
"moduleKey": "order.wave",
|
||||
"folder": "order.wave",
|
||||
"interfaceCount": 8,
|
||||
"interfaceCount": 9,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "order.wave.groupOrderFetchList"
|
||||
},
|
||||
{
|
||||
"method": "order.wave.singleOrderFetchList"
|
||||
},
|
||||
{
|
||||
"method": "order.wave.batchList"
|
||||
},
|
||||
@ -355,6 +334,17 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "订单打印模块",
|
||||
"moduleKey": "order.print",
|
||||
"folder": "order.print",
|
||||
"interfaceCount": 1,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "order.print.getWavePrintData"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "订单待出库模块",
|
||||
"moduleKey": "order.outboundOrder",
|
||||
@ -798,7 +788,7 @@
|
||||
"moduleName": "商品模块",
|
||||
"moduleKey": "stock",
|
||||
"folder": "stock",
|
||||
"interfaceCount": 21,
|
||||
"interfaceCount": 22,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "stock.warehouse.list"
|
||||
@ -809,6 +799,9 @@
|
||||
{
|
||||
"method": "stock.warehouse.getInfo"
|
||||
},
|
||||
{
|
||||
"method": "stock.warehouse.getStockDetail"
|
||||
},
|
||||
{
|
||||
"method": "stock.warehouse.saveWarehouseStock"
|
||||
},
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
{
|
||||
"module": {
|
||||
"name": "订单打印模块",
|
||||
"key": "order.print",
|
||||
"folder": "order.print"
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-05 09:15:19",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
89
workflows/api-doc-system/data/module/order.print/module.json
Normal file
89
workflows/api-doc-system/data/module/order.print/module.json
Normal file
@ -0,0 +1,89 @@
|
||||
{
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
"value": "web",
|
||||
"label": "网页端"
|
||||
},
|
||||
"project": {
|
||||
"value": "all",
|
||||
"label": "全部"
|
||||
}
|
||||
},
|
||||
"module": {
|
||||
"name": "订单打印模块",
|
||||
"key": "order.print",
|
||||
"folder": "order.print",
|
||||
"interfaceCount": 1
|
||||
},
|
||||
"changes": {
|
||||
"fromPreviousSnapshot": {
|
||||
"moduleAdded": false,
|
||||
"moduleRenamed": false,
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "order.print.getWavePrintData",
|
||||
"title": "按波次 IDs 获取订单打印数据,自动过滤快递未完全分配的波次,返回通过过滤的波次订单明细,按波次号分组",
|
||||
"description": "按波次 IDs 获取订单打印数据,自动过滤快递未完全分配的波次,返回通过过滤的波次订单明细,按波次号分组",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "warehouse_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "仓库ID"
|
||||
},
|
||||
{
|
||||
"name": "wave_ids",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "波次ID列表(支持数字或字符串,内部自动去重与归一化)"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "summary",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "汇总信息"
|
||||
},
|
||||
{
|
||||
"name": "wave_list",
|
||||
"type": "array",
|
||||
"required": false,
|
||||
"description": "波次列表(按 wave_no 排序)"
|
||||
},
|
||||
{
|
||||
"name": "ext",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "扩展字段"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-04 09:11:04",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -16,14 +16,16 @@
|
||||
"name": "订单波次模块",
|
||||
"key": "order.wave",
|
||||
"folder": "order.wave",
|
||||
"interfaceCount": 8
|
||||
"interfaceCount": 9
|
||||
},
|
||||
"changes": {
|
||||
"fromPreviousSnapshot": {
|
||||
"moduleAdded": false,
|
||||
"moduleRenamed": false,
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [],
|
||||
"addedMethods": [
|
||||
"order.wave.singleOrderFetchList"
|
||||
],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
@ -109,6 +111,84 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.wave.singleOrderFetchList",
|
||||
"title": "按机器结构分组的散单候选列表。仅处理待处理订单(排除待审核),且排除已在波次中的订单。与 order.wave.groupOrderFetchList 不同:groupOrderFetchList 返回满足同组订单数量 >= same_order_quantity(或仓库配置 min_group_order_fetch_quantity)的团购命中分组;singleOrderFetchList 则排除这些团购命中分组,仅返回同组订单数量小于该阈值的散单候选分组(即 < same_order_quantity)。",
|
||||
"description": "按机器结构分组的散单候选列表。仅处理待处理订单(排除待审核),且排除已在波次中的订单。与 order.wave.groupOrderFetchList 不同:groupOrderFetchList 返回满足同组订单数量 >= same_order_quantity(或仓库配置 min_group_order_fetch_quantity)的团购命中分组;singleOrderFetchList 则排除这些团购命中分组,仅返回同组订单数量小于该阈值的散单候选分组(即 < same_order_quantity)。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "pagination",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "分页参数,支持 page / pageSize"
|
||||
},
|
||||
{
|
||||
"name": "distinguish_express",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "是否区分快递(影响分组粒度)"
|
||||
},
|
||||
{
|
||||
"name": "store_id",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "货主ID(仅作为筛选条件)"
|
||||
},
|
||||
{
|
||||
"name": "same_order_quantity",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "最小同组订单数量阈值(用于判定团购命中);本接口返回同组订单数量小于该阈值的分组。若显式传入有效数值则按传入值使用;未传入时使用仓库配置 min_group_order_fetch_quantity(默认 13)。"
|
||||
},
|
||||
{
|
||||
"name": "shop_name",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "店铺名称(模糊匹配)"
|
||||
},
|
||||
{
|
||||
"name": "include_sku",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "仅保留包含该 SKU 的分组(页内过滤)"
|
||||
},
|
||||
{
|
||||
"name": "return_order_ids",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "是否在结果中返回组内订单ID列表"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "list",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "散单候选分组列表,items 示例见实现:包含 item_detail_machine/item_snapshot/group_count 等字段;返回的 group_count 均小于 same_order_quantity(或仓库配置的 min_group_order_fetch_quantity)。"
|
||||
},
|
||||
{
|
||||
"name": "pagination",
|
||||
"type": "object",
|
||||
"required": true,
|
||||
"description": "分页信息(page、pageSize、total、totalPages、hasPrevious、hasNext)"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.wave.batchList",
|
||||
"title": "波次列表查询。仅使用当前登录操作者的仓库ID作为查询约束(禁止传入 warehouse_id / warehouseId)。支持通过白名单字段进行过滤(通过 where 对象传入),接口对 wave_status 固定叠加查询状态 0/1,无需客户端传入。列表按订单数量从大到小排序,并附带波次基础信息与分配状态汇总。",
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -20,12 +20,10 @@
|
||||
},
|
||||
"changes": {
|
||||
"fromPreviousSnapshot": {
|
||||
"moduleAdded": true,
|
||||
"moduleAdded": false,
|
||||
"moduleRenamed": false,
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [
|
||||
"pick.query"
|
||||
],
|
||||
"addedMethods": [],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 19:37:49",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 20:21:27",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 19:16:50",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-04 09:11:04",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -16,7 +16,7 @@
|
||||
"name": "商品模块",
|
||||
"key": "stock",
|
||||
"folder": "stock",
|
||||
"interfaceCount": 21
|
||||
"interfaceCount": 22
|
||||
},
|
||||
"changes": {
|
||||
"fromPreviousSnapshot": {
|
||||
@ -24,10 +24,7 @@
|
||||
"moduleRenamed": false,
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [],
|
||||
"deletedMethods": [
|
||||
"stock.stockWarehouse",
|
||||
"stock.warehouse.getStockDetail"
|
||||
],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
}
|
||||
@ -113,6 +110,66 @@
|
||||
"params": [],
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"method": "stock.warehouse.getStockDetail",
|
||||
"title": "按库位/批次维度查询商品库存分布",
|
||||
"description": "按库位/批次维度查询商品库存分布",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "stock_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "商品库存ID(stock_warehouse.id)"
|
||||
},
|
||||
{
|
||||
"name": "pagination",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "分页参数,包含 page/pageSize"
|
||||
},
|
||||
{
|
||||
"name": "group_by_batch",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "是否按批次返回明细;true 返回每条明细,false 按库位合并"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "stockItem",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "商品概要,包含 id、item_code、item_name、sku_property、stock_unit、quantity、locked_quantity 等"
|
||||
},
|
||||
{
|
||||
"name": "storageList",
|
||||
"type": "array",
|
||||
"required": false,
|
||||
"description": "库存明细数组;group_by_batch=true 返回 wms_storage 明细(含 batch_no、production_date、expiry_date、inbound_time、inbound_order_no、supplier_batch_no 等),group_by_batch=false 时按库位合并,批次相关字段为 null"
|
||||
},
|
||||
{
|
||||
"name": "pagination",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "分页信息,包含 page、pageSize、total"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "stock.warehouse.saveWarehouseStock",
|
||||
"title": "更新仓库商品资料",
|
||||
@ -269,8 +326,8 @@
|
||||
},
|
||||
{
|
||||
"method": "stock.warehouse.checkItemCodeUnique",
|
||||
"title": "校验商品编码在货主维度唯一性",
|
||||
"description": "校验商品编码在货主维度唯一性",
|
||||
"title": "检测商品编码唯一性。在同一仓库和货主下,排除商品自身后,判断商品编码是否已存在于未删除商品中。",
|
||||
"description": "检测商品编码唯一性。在同一仓库和货主下,排除商品自身后,判断商品编码是否已存在于未删除商品中。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
@ -287,26 +344,63 @@
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "warehouse_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "仓库ID;默认使用当前登录主体/仓库上下文(ctx.user.store_id)"
|
||||
},
|
||||
{
|
||||
"name": "item_code",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "item_code 参数"
|
||||
"description": "要检测的商品编码"
|
||||
},
|
||||
{
|
||||
"name": "store_id",
|
||||
"name": "item_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "store_id 参数"
|
||||
"required": false,
|
||||
"description": "当前商品ID(编辑场景用,排除自身);兼容字段名 id"
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "id 参数"
|
||||
"description": "兼容字段 id"
|
||||
},
|
||||
{
|
||||
"name": "owner_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "货主ID(对应表字段 store_id);兼容字段名 store_id"
|
||||
},
|
||||
{
|
||||
"name": "store_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "兼容字段 store_id"
|
||||
}
|
||||
],
|
||||
"response": []
|
||||
"response": [
|
||||
{
|
||||
"name": "unique",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "true 表示编码唯一,false 表示已存在重复"
|
||||
},
|
||||
{
|
||||
"name": "isUnique",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "同 unique(兼容旧字段名)"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "重复时返回 '商品编码已存在',唯一时不返回该字段"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "stock.warehouse.queryStockLogs",
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-05 17:25:14",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-04 17:23:48",
|
||||
"generatedAtLocal": "2026-05-04 17:23:48",
|
||||
"generatedAt": "2026-05-05 17:25:14",
|
||||
"generatedAtLocal": "2026-05-05 17:25:14",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user