4月19
This commit is contained in:
parent
13b25e1d9c
commit
67bd0bb7c5
BIN
dist.tar.gz
BIN
dist.tar.gz
Binary file not shown.
@ -16,6 +16,7 @@
|
||||
"apiconfig:api-interface-update": "node ./workflows/api-doc-system/api-interface-update.mjs",
|
||||
"apiconfig:api-interface-clean": "node ./workflows/api-doc-system/api-interface-clean.mjs",
|
||||
"apiconfig:apidata": "node ./workflows/api-doc-system/scripts/apidata.mjs",
|
||||
"apiconfig:apidata:quick": "node ./workflows/api-doc-system/scripts/apidata.mjs -- --quick",
|
||||
"apiconfig:apidata:clear": "node ./workflows/api-doc-system/scripts/apidata.mjs -- --clear",
|
||||
"apiconfig:apidata:help": "node ./workflows/api-doc-system/scripts/apidata.mjs -- --help",
|
||||
"apiagent": "node ./workflows/api-doc-system/scripts/agent/run.mjs",
|
||||
|
||||
@ -137,6 +137,20 @@ export function getExpressList(data?: Record<string, unknown>) {
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function tryAutoTranslateNewKeys(data?: Record<string, unknown>) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'index.tryAutoTranslateNewKeys',
|
||||
v: '1.0',
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data ?? {},
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function getPlatformList(data?: Record<string, unknown>) {
|
||||
return request({
|
||||
url: '/system',
|
||||
|
||||
@ -34,6 +34,20 @@ export type PendingOrderAllocateExpressCodeParams = {
|
||||
orders: Array<Record<string, any>>
|
||||
}
|
||||
|
||||
/** 与文档 Params 别名对齐;不再传 warehouse_id(由登录上下文决定仓库) */
|
||||
export type PendingOrderAllocateStorageParams = {
|
||||
allow_storage_location?: boolean
|
||||
allowStorageLocation?: boolean
|
||||
is_allow_storage?: boolean
|
||||
isAllowStorage?: boolean
|
||||
order_ids?: Array<number | string> | string | number
|
||||
orderIds?: Array<number | string> | string | number
|
||||
ids?: Array<number | string> | string | number
|
||||
order_id?: number | string
|
||||
orderId?: number | string
|
||||
id?: number | string
|
||||
}
|
||||
|
||||
export function orderPendingOrderList(data: PendingOrderListParams = {}): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
@ -106,10 +120,27 @@ export function orderPendingOrderAllocateExpressCode(
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function orderPendingOrderAllocateStorage(
|
||||
data: PendingOrderAllocateStorageParams
|
||||
): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.pendingOrder.allocateStorage',
|
||||
v,
|
||||
timestamp: Date.now()
|
||||
},
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
export const orderPendingOrder = {
|
||||
list: orderPendingOrderList,
|
||||
reverseReviewOrder: orderPendingOrderReverseReviewOrder,
|
||||
markPendingOutboundOrder: orderPendingOrderMarkPendingOutboundOrder,
|
||||
cancelOrder: orderPendingOrderCancelOrder,
|
||||
allocateExpressCode: orderPendingOrderAllocateExpressCode
|
||||
allocateExpressCode: orderPendingOrderAllocateExpressCode,
|
||||
allocateStorage: orderPendingOrderAllocateStorage
|
||||
}
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
const v = '1.0'
|
||||
|
||||
/** 与文档 Params 别名对齐;至少提供一种订单 ID 列表形式 */
|
||||
export type OrderStorageAllocationAllocateStorageParams = {
|
||||
allow_storage_location?: boolean
|
||||
allowStorageLocation?: boolean
|
||||
is_allow_storage?: boolean
|
||||
isAllowStorage?: boolean
|
||||
order_ids?: Array<number | string> | string | number
|
||||
orderIds?: Array<number | string> | string | number
|
||||
ids?: Array<number | string> | string | number
|
||||
order_id?: number | string
|
||||
orderId?: number | string
|
||||
id?: number | string
|
||||
warehouse_id?: number
|
||||
warehouseId?: number
|
||||
}
|
||||
|
||||
export function orderStorageAllocationAllocateStorage(
|
||||
data: OrderStorageAllocationAllocateStorageParams
|
||||
): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.storageAllocation.allocateStorage',
|
||||
v,
|
||||
timestamp: Date.now()
|
||||
},
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
export const orderStorageAllocation = {
|
||||
allocateStorage: orderStorageAllocationAllocateStorage
|
||||
}
|
||||
@ -1,16 +1,28 @@
|
||||
import request from '@/utils/request'
|
||||
const v = "1.0";
|
||||
|
||||
export function getList(data:any){
|
||||
const v = '1.0'
|
||||
|
||||
function stamp() {
|
||||
return Date.now()
|
||||
}
|
||||
|
||||
/** print.getList:page、pageSize、where(支持 id / name / computer_id / custom_barcode 等,见 print 模块) */
|
||||
export type PrintListParams = {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
where?: Record<string, unknown>
|
||||
}
|
||||
|
||||
export function getList(data?: PrintListParams) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'print.getList',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
timestamp: stamp()
|
||||
},
|
||||
data: data
|
||||
data: data ?? {}
|
||||
})
|
||||
}
|
||||
|
||||
@ -22,7 +34,7 @@ export function getItem(id: string | number) {
|
||||
params: {
|
||||
method: 'print.getItem',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
timestamp: stamp()
|
||||
},
|
||||
data: Number.isFinite(numId) ? { id: numId } : { id }
|
||||
})
|
||||
@ -40,7 +52,7 @@ export function add(data: Record<string, unknown>) {
|
||||
params: {
|
||||
method: 'print.add',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
timestamp: stamp()
|
||||
},
|
||||
data: body
|
||||
})
|
||||
@ -58,15 +70,12 @@ export function hasName(data: { name: string; id?: string | number | null }) {
|
||||
params: {
|
||||
method: 'print.hasName',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
timestamp: stamp()
|
||||
},
|
||||
data: body
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export function updateItem(data: Record<string, unknown>) {
|
||||
const body = { ...data }
|
||||
if (body.id !== undefined && body.id !== null && body.id !== '') {
|
||||
@ -83,53 +92,26 @@ export function updateItem(data: Record<string, unknown>) {
|
||||
params: {
|
||||
method: 'print.updateItem',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
timestamp: stamp()
|
||||
},
|
||||
data: body
|
||||
})
|
||||
}
|
||||
|
||||
function normalizeDelIds(ids: unknown[]): number[] {
|
||||
return ids
|
||||
.map((i) => Number(i))
|
||||
.filter((n) => Number.isFinite(n))
|
||||
return ids.map((i) => Number(i)).filter((n) => Number.isFinite(n))
|
||||
}
|
||||
|
||||
// 删除单个打印台(兼容传入 id 或 { ids: [...] })
|
||||
export function delItem(idOrPayload: any) {
|
||||
let payload: any = idOrPayload
|
||||
if (typeof idOrPayload === 'string' || typeof idOrPayload === 'number') {
|
||||
payload = { ids: normalizeDelIds([idOrPayload]) }
|
||||
} else if (Array.isArray(idOrPayload)) {
|
||||
payload = { ids: normalizeDelIds(idOrPayload) }
|
||||
} else if (idOrPayload && Array.isArray(idOrPayload.ids)) {
|
||||
payload = { ids: normalizeDelIds(idOrPayload.ids) }
|
||||
}
|
||||
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'print.del',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: payload
|
||||
})
|
||||
}
|
||||
|
||||
// 批量删除打印台,接受 id 数组(与后端约定为数字 id)
|
||||
export function delItems(ids: Array<string | number>) {
|
||||
const payload = { ids: normalizeDelIds(ids) }
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'print.del',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
timestamp: stamp()
|
||||
},
|
||||
data: payload
|
||||
data: { ids: normalizeDelIds(ids) }
|
||||
})
|
||||
}
|
||||
|
||||
@ -140,28 +122,12 @@ export function getComputer() {
|
||||
params: {
|
||||
method: 'print.getComputer',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
timestamp: stamp()
|
||||
},
|
||||
data: {}
|
||||
})
|
||||
}
|
||||
|
||||
export function getExpressList(data?: Record<string, unknown>) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'index.getExpressList',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: {
|
||||
systemOnly: true,
|
||||
...(data || {})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export function getComputerPrinter(id: string | number) {
|
||||
const numId = Number(id)
|
||||
return request({
|
||||
@ -170,13 +136,39 @@ export function getComputerPrinter(id: string | number) {
|
||||
params: {
|
||||
method: 'print.getComputerPrinter',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
timestamp: stamp()
|
||||
},
|
||||
data: Number.isFinite(numId) ? { id: numId } : { id }
|
||||
})
|
||||
}
|
||||
|
||||
export function getPrintResult(printId: string) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'print.getPrintResult',
|
||||
v,
|
||||
timestamp: stamp()
|
||||
},
|
||||
data: { printId }
|
||||
})
|
||||
}
|
||||
|
||||
export function getPrintRecordItem(id: string | number) {
|
||||
const numId = Number(id)
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'print.getPrintRecordItem',
|
||||
v,
|
||||
timestamp: stamp()
|
||||
},
|
||||
data: Number.isFinite(numId) ? { id: numId } : { id }
|
||||
})
|
||||
}
|
||||
|
||||
// 保存打印机与快递绑定关系(字段名与接口 print.savePrinters 一致)
|
||||
export function savePrinters(data: {
|
||||
defaultPrinter: string
|
||||
express?: Array<Record<string, unknown>>
|
||||
@ -196,22 +188,21 @@ export function savePrinters(data: {
|
||||
params: {
|
||||
method: 'print.savePrinters',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
timestamp: stamp()
|
||||
},
|
||||
data: body
|
||||
})
|
||||
}
|
||||
|
||||
// 发送打印任务
|
||||
export function sendPrint(data: any) {
|
||||
export function sendPrint(data: Record<string, unknown>) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'print.send',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
timestamp: stamp()
|
||||
},
|
||||
data: data
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@ -1,171 +1,17 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// ---------------- 打印台 (Print Station) ----------------
|
||||
const v = '1.0'
|
||||
|
||||
// 打印台列表
|
||||
export function listPrintStations(data:any) {
|
||||
/** 打印机站点模块:printer.station.list(无请求体参数,见 module 明细) */
|
||||
export function printerStationList(data: Record<string, unknown> = {}) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'printer.station.list',
|
||||
v: '1.0',
|
||||
timestamp: new Date().getTime()
|
||||
v,
|
||||
timestamp: Date.now()
|
||||
},
|
||||
data: data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
// 创建打印台
|
||||
export function createPrintStation(data:any) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'printer.station.create',
|
||||
v: '1.0',
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
// 更新打印台
|
||||
export function updatePrintStation(data:any) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'printer.station.update',
|
||||
v: '1.0',
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
// 删除打印台
|
||||
export function deletePrintStation(data:any) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'printer.station.delete',
|
||||
v: '1.0',
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
// ---------------- 打印电脑 (Print Computer) ----------------
|
||||
|
||||
// 打印电脑列表
|
||||
export function listPrintComputers(data:any) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'printer.computer.list',
|
||||
v: '1.0',
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
// 创建打印电脑
|
||||
export function createPrintComputer(data:any) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'printer.computer.create',
|
||||
v: '1.0',
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
// 更新打印电脑
|
||||
export function updatePrintComputer(data:any) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'printer.computer.update',
|
||||
v: '1.0',
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
// 删除打印电脑
|
||||
export function deletePrintComputer(data:any) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'printer.computer.delete',
|
||||
v: '1.0',
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
// ---------------- 打印机绑定 (Printer Binding) ----------------
|
||||
|
||||
// 打印机列表 (获取电脑上的物理打印机)
|
||||
export function listPrinters(data:any) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'printer.device.list',
|
||||
v: '1.0',
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
// 绑定打印机到打印台
|
||||
export function bindPrinterToStation(data:any) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'printer.station.bind',
|
||||
v: '1.0',
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
// 解绑打印机
|
||||
export function unbindPrinterFromStation(data:any) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'printer.station.unbind',
|
||||
v: '1.0',
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@ -2,6 +2,20 @@ import request from '@/utils/request'
|
||||
|
||||
const v = '1.0'
|
||||
|
||||
/** 文档列在快递模块下的 index.getExpressList 封装(与 index 模块同源) */
|
||||
export function expressIndexGetExpressList(data?: Record<string, unknown>) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'index.getExpressList',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data || {}
|
||||
})
|
||||
}
|
||||
|
||||
export function expressList(data: any) {
|
||||
return request({
|
||||
url: '/system',
|
||||
@ -67,7 +81,18 @@ export function expressUpdate(data: any) {
|
||||
})
|
||||
}
|
||||
|
||||
export function expressDelete(data: { ids: number[] | string | number }) {
|
||||
/** setting.express.delete:ids 为映射主键数组(与 module 一致) */
|
||||
export function expressDelete(data: { ids: Array<number | string> | string | number }) {
|
||||
let ids: number[] = []
|
||||
if (Array.isArray(data.ids)) {
|
||||
ids = data.ids.map((id) => Number(id)).filter((n) => Number.isFinite(n))
|
||||
} else if (data.ids !== undefined && data.ids !== null && data.ids !== '') {
|
||||
const n = Number(data.ids)
|
||||
if (Number.isFinite(n)) ids = [n]
|
||||
}
|
||||
if (!ids.length) {
|
||||
return Promise.resolve({ code: 400, message: 'ids 不能为空' } as any)
|
||||
}
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -76,6 +101,6 @@ export function expressDelete(data: { ids: number[] | string | number }) {
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data
|
||||
data: { ids }
|
||||
})
|
||||
}
|
||||
|
||||
@ -2,7 +2,20 @@ import request from '@/utils/request'
|
||||
|
||||
const v = '1.0'
|
||||
|
||||
export function expressInterfaceList(data?: { page?: number; page_size?: number; keyword?: string }) {
|
||||
export type ExpressInterfacePagination = {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
currentPage?: number
|
||||
page_size?: number
|
||||
size?: number
|
||||
}
|
||||
|
||||
export type ExpressInterfaceListParams = {
|
||||
pagination?: ExpressInterfacePagination
|
||||
where?: Record<string, any>
|
||||
}
|
||||
|
||||
export function expressInterfaceList(data?: ExpressInterfaceListParams) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -15,6 +28,19 @@ export function expressInterfaceList(data?: { page?: number; page_size?: number;
|
||||
})
|
||||
}
|
||||
|
||||
export function expressInterfaceListByWarehousePlatformCode(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'setting.expressInterface.listByWarehousePlatformCode',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function expressInterfaceCreate(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/system',
|
||||
|
||||
@ -2,6 +2,20 @@ import request from '@/utils/request'
|
||||
|
||||
const v = '1.0'
|
||||
|
||||
/** 文档列在平台设置模块下的 index.getPlatformList 封装(与 index 模块同源) */
|
||||
export function settingPlatformIndexGetPlatformList(data?: Record<string, unknown>) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'index.getPlatformList',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data || {}
|
||||
})
|
||||
}
|
||||
|
||||
export function settingPlatformList(data?: { page?: number; page_size?: number; keyword?: string }) {
|
||||
return request({
|
||||
url: '/system',
|
||||
|
||||
@ -359,3 +359,18 @@ export function warehouseSearch(data: {
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
/** 文档兼容入口 stock.stockWarehouse,请求体与 stock.warehouse.list 一致(pagination + where) */
|
||||
export function stockStockWarehouse(data: { pagination?: any; where?: any }) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'stock.stockWarehouse',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data || {},
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
@ -17,6 +17,23 @@ export function getInventoryList(data: any): Promise<any> {
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function quickPutaway(data: { receiving_id: number; id?: number }): Promise<any> {
|
||||
const body: Record<string, any> = { ...data }
|
||||
if (body.receiving_id === undefined && body.id != null) {
|
||||
body.receiving_id = Number(body.id)
|
||||
}
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'storage.inventory.quickPutaway',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: body,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
// 非本项目接口,不使用
|
||||
export function matchPutaway(data: {
|
||||
|
||||
@ -30,3 +30,17 @@ export const stockoutListItems = (data: {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/** 占位扩展接口,参数预留;与文档 storage.stockout.toOrder 对齐 */
|
||||
export const stockoutToOrder = (data?: { id?: number; delivery_order_code?: string }) => {
|
||||
return request({
|
||||
url: `/system`,
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'storage.stockout.toOrder',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data || {}
|
||||
})
|
||||
}
|
||||
|
||||
@ -23,6 +23,20 @@ export function login(data: UserLoginParams) {
|
||||
} as SystemApiRequestConfig<UserLoginParams>);
|
||||
}
|
||||
|
||||
export function loginByCode(data: { code: string }) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'user.loginByCode',
|
||||
v: '1.0',
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as SystemApiRequestConfig<{ code: string }>);
|
||||
}
|
||||
|
||||
export function register (data:any):any {
|
||||
return request({
|
||||
url: '/system',
|
||||
|
||||
@ -516,9 +516,12 @@ export const expectionOrderAvailableFields = [
|
||||
|
||||
export const expectionColumns = [
|
||||
{ prop: 'store_id', label: '货主', width: '100' },
|
||||
{ prop: 'delivery_order_code', label: '发货单号', width: '170' },
|
||||
{ prop: 'logistics_name', label: '快递', width: '120' },
|
||||
{ prop: 'pre_delivery_order_code', label: '发货单号', width: '160' },
|
||||
{ prop: 'create_at', label: '创建日期', width: '160' },
|
||||
{ prop: 'pre_delivery_order_code', label: '前置单号', width: '140' },
|
||||
{ prop: 'order_flag', label: '订单标记', minWidth: '260' },
|
||||
{ prop: 'create_at', label: '创建时间', width: '165', formatter: orderTimeFormatter },
|
||||
{ prop: 'updated_at', label: '更新时间', width: '165', formatter: orderTimeFormatter },
|
||||
{ prop: 'status', label: '订单状态', width: '100' },
|
||||
]
|
||||
|
||||
@ -533,6 +536,7 @@ export const expectionOrderDetail = [
|
||||
{ prop: 'intercept_status', label: '拦截状态' },
|
||||
|
||||
// 异常/状态标记
|
||||
{ prop: 'order_flag', label: '订单标记', span: 3 },
|
||||
{ prop: 'lock_status', label: '锁定状态' },
|
||||
{ prop: 'sync_status', label: '同步状态' },
|
||||
{ prop: 'post_status', label: '投递状态' },
|
||||
|
||||
@ -17,7 +17,26 @@
|
||||
<div class="toolbar-left">
|
||||
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
|
||||
<el-button size="small" :loading="exportLoading" @click="handleExport">导出</el-button>
|
||||
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
plain
|
||||
:disabled="!hasSelection"
|
||||
:loading="storageAllocateLoading"
|
||||
@click="openStorageAllocateDialog"
|
||||
>
|
||||
分配储位
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="success"
|
||||
:disabled="!hasSelection"
|
||||
:loading="allocateLoading"
|
||||
@click="openAllocateExpressDialog"
|
||||
>
|
||||
分配快递号
|
||||
</el-button>
|
||||
|
||||
<template v-for="(btn, index) in expectionOrderbuttonList" :key="index">
|
||||
<el-dropdown
|
||||
v-if="btn.type === 'dropdown'"
|
||||
@ -91,6 +110,25 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #column-order_flag="{ row }">
|
||||
<el-tooltip
|
||||
:content="orderFlagFullText(row)"
|
||||
placement="top"
|
||||
:disabled="!orderFlagFullText(row)"
|
||||
:show-after="400"
|
||||
>
|
||||
<span
|
||||
class="order-flag-cell"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
@click.stop="copyOrderFlag(row)"
|
||||
@keydown.enter.prevent="copyOrderFlag(row)"
|
||||
>
|
||||
{{ orderFlagCellText(row) }}
|
||||
</span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
<div class="empty-tip">暂无异常订单</div>
|
||||
</template>
|
||||
@ -126,6 +164,47 @@
|
||||
<p>请从上方列表中选择一项查看详情</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
v-model="allocateDialogVisible"
|
||||
title="批量分配快递号"
|
||||
width="420px"
|
||||
align-center
|
||||
destroy-on-close
|
||||
@closed="resetAllocateDialog"
|
||||
>
|
||||
<p class="allocate-confirm-text">是否确认分配?</p>
|
||||
<template #footer>
|
||||
<el-button @click="allocateDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="allocateLoading" @click="submitAllocateExpress">
|
||||
确认
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
v-model="storageDialogVisible"
|
||||
title="按订单批量分配储位"
|
||||
width="520px"
|
||||
align-center
|
||||
destroy-on-close
|
||||
@closed="resetStorageAllocateDialog"
|
||||
>
|
||||
<el-form label-width="140px" class="storage-allocate-form">
|
||||
<el-form-item label="已选订单数">
|
||||
<span>{{ storagePendingOrderIds.length }} 条</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="允许存储储位">
|
||||
<el-switch v-model="storageForm.allowStorageLocation" active-text="是" inactive-text="否" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="storageDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="storageAllocateLoading" @click="submitStorageAllocate">
|
||||
开始分配
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -138,16 +217,26 @@ import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
import { orderExpectionOrder } from '@/api/order.expectionorder/orderexpectionorder'
|
||||
import { orderPendingOrder } from '@/api/order.pendingorder/orderpendingOrder'
|
||||
|
||||
import {
|
||||
expectionColumns,
|
||||
expectionOrderDetail,
|
||||
expectionOrderAvailableFields,
|
||||
expectionOrderbuttonList,
|
||||
translateOrderField
|
||||
translateOrderField,
|
||||
formatOrderTime
|
||||
} from './config/order-common-config'
|
||||
|
||||
const EXPORT_TIME_PROPS = new Set([
|
||||
'create_at',
|
||||
'updated_at',
|
||||
'pay_time',
|
||||
'place_order_time',
|
||||
'operate_time',
|
||||
'delivery_time'
|
||||
])
|
||||
import detail from './component/detail.vue'
|
||||
import log from './component/log.vue'
|
||||
import { exportUpperTableRows } from './utils/export'
|
||||
|
||||
const scanBox = ref<any>(null)
|
||||
@ -161,8 +250,19 @@ const activeTab = ref('details')
|
||||
const list = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const allocateLoading = ref(false)
|
||||
const storageAllocateLoading = ref(false)
|
||||
const queryTime = ref(0)
|
||||
|
||||
const allocateDialogVisible = ref(false)
|
||||
const allocatePendingRows = ref<any[]>([])
|
||||
|
||||
const storageDialogVisible = ref(false)
|
||||
const storagePendingOrderIds = ref<Array<number | string>>([])
|
||||
const storageForm = reactive<{ allowStorageLocation: boolean }>({
|
||||
allowStorageLocation: false
|
||||
})
|
||||
|
||||
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
const tableSize = ref('small')
|
||||
const columns = ref(expectionColumns)
|
||||
@ -191,6 +291,195 @@ function getStatusType(status: string) {
|
||||
return 'danger'
|
||||
}
|
||||
|
||||
function orderFlagFullText(row: any): string {
|
||||
const v = row?.order_flag
|
||||
if (v == null) return ''
|
||||
return String(v).trim()
|
||||
}
|
||||
|
||||
/** 列表格内省略展示,完整内容见 tooltip,点击复制全文 */
|
||||
function orderFlagCellText(row: any): string {
|
||||
const t = orderFlagFullText(row)
|
||||
if (!t) return '—'
|
||||
const max = 48
|
||||
return t.length > max ? `${t.slice(0, max)}…` : t
|
||||
}
|
||||
|
||||
async function copyOrderFlag(row: any) {
|
||||
const text = orderFlagFullText(row)
|
||||
if (!text) {
|
||||
ElMessage.warning('当前行无订单标记可复制')
|
||||
return
|
||||
}
|
||||
try {
|
||||
if (navigator.clipboard?.writeText) {
|
||||
await navigator.clipboard.writeText(text)
|
||||
} else {
|
||||
throw new Error('no clipboard api')
|
||||
}
|
||||
ElMessage.success('订单标记已复制到剪贴板')
|
||||
} catch {
|
||||
try {
|
||||
const ta = document.createElement('textarea')
|
||||
ta.value = text
|
||||
ta.setAttribute('readonly', 'readonly')
|
||||
ta.style.position = 'fixed'
|
||||
ta.style.left = '-9999px'
|
||||
document.body.appendChild(ta)
|
||||
ta.select()
|
||||
document.execCommand('copy')
|
||||
document.body.removeChild(ta)
|
||||
ElMessage.success('订单标记已复制到剪贴板')
|
||||
} catch {
|
||||
ElMessage.error('复制失败,请手动复制')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getSelectedIds() {
|
||||
return selectionRows.value
|
||||
.map((item: any) => item?.id)
|
||||
.filter((id: any) => id !== undefined && id !== null)
|
||||
}
|
||||
|
||||
function openStorageAllocateDialog() {
|
||||
if (!selectionRows.value.length) {
|
||||
ElMessage.warning('请先勾选需要分配储位的订单')
|
||||
return
|
||||
}
|
||||
const ids = getSelectedIds()
|
||||
if (!ids.length) {
|
||||
ElMessage.error('选中行缺少订单 id,请刷新后重试')
|
||||
return
|
||||
}
|
||||
storagePendingOrderIds.value = [...ids]
|
||||
storageForm.allowStorageLocation = false
|
||||
storageDialogVisible.value = true
|
||||
}
|
||||
|
||||
function resetStorageAllocateDialog() {
|
||||
storagePendingOrderIds.value = []
|
||||
storageForm.allowStorageLocation = false
|
||||
}
|
||||
|
||||
async function submitStorageAllocate() {
|
||||
const order_ids = [...storagePendingOrderIds.value]
|
||||
if (!order_ids.length || storageAllocateLoading.value) return
|
||||
|
||||
storageAllocateLoading.value = true
|
||||
try {
|
||||
const payload: Record<string, any> = {
|
||||
order_ids,
|
||||
allowStorageLocation: storageForm.allowStorageLocation
|
||||
}
|
||||
const res = await orderPendingOrder.allocateStorage(payload)
|
||||
const ok = res && (res.code === 1 || res.code === 200 || res.flag === 'success')
|
||||
if (ok) {
|
||||
ElMessage.success(res.message || '储位分配已提交')
|
||||
storageDialogVisible.value = false
|
||||
upperTable.value?.clearSelection?.()
|
||||
selectionRows.value = []
|
||||
hasSelection.value = false
|
||||
await loadData()
|
||||
} else {
|
||||
ElMessage.error(res?.message || '储位分配失败')
|
||||
}
|
||||
} catch {
|
||||
ElMessage.error('储位分配失败')
|
||||
} finally {
|
||||
storageAllocateLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function computeAvailableBusinessKeys(expressNumbers: any, count = 1): number[] {
|
||||
const used = new Set<number>()
|
||||
if (Array.isArray(expressNumbers)) {
|
||||
for (const item of expressNumbers) {
|
||||
const n = Number(item)
|
||||
if (Number.isFinite(n) && n > 0 && Number.isInteger(n)) {
|
||||
used.add(n)
|
||||
}
|
||||
}
|
||||
}
|
||||
const need = Math.max(1, Number(count) || 1)
|
||||
const result: number[] = []
|
||||
let cursor = 1
|
||||
while (result.length < need) {
|
||||
if (!used.has(cursor)) {
|
||||
result.push(cursor)
|
||||
}
|
||||
cursor += 1
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
function openAllocateExpressDialog() {
|
||||
if (!selectionRows.value.length) {
|
||||
ElMessage.warning('请先勾选需要分配快递号的订单')
|
||||
return
|
||||
}
|
||||
const invalid = selectionRows.value.filter((row: any) => row?.id == null && row?.order_id == null)
|
||||
if (invalid.length) {
|
||||
ElMessage.error('存在无法识别 order_id 的行,请刷新列表后重试')
|
||||
return
|
||||
}
|
||||
allocatePendingRows.value = selectionRows.value.map((row: any) => ({ ...row }))
|
||||
allocateDialogVisible.value = true
|
||||
}
|
||||
|
||||
function resetAllocateDialog() {
|
||||
allocatePendingRows.value = []
|
||||
}
|
||||
|
||||
function buildAllocateExpressPayload(rows: any[]): Array<Record<string, any>> {
|
||||
return rows.map((row) => {
|
||||
const base = { ...row }
|
||||
const order_id = base.order_id ?? base.id
|
||||
const business_key = computeAvailableBusinessKeys(row.express_numbers, 1)
|
||||
return {
|
||||
...base,
|
||||
order_id,
|
||||
business_key
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async function submitAllocateExpress() {
|
||||
const rows = allocatePendingRows.value
|
||||
if (!rows.length || allocateLoading.value) return
|
||||
|
||||
allocateLoading.value = true
|
||||
try {
|
||||
const orders = buildAllocateExpressPayload(rows)
|
||||
const res = await orderPendingOrder.allocateExpressCode({ orders })
|
||||
const ok = res && (res.code === 1 || res.code === 200 || res.flag === 'success')
|
||||
if (ok) {
|
||||
const data = res.data || {}
|
||||
const summary = data.summary
|
||||
const successLen = Array.isArray(data.success) ? data.success.length : undefined
|
||||
const failedLen = Array.isArray(data.failed) ? data.failed.length : undefined
|
||||
let extra = ''
|
||||
if (summary && typeof summary === 'object') {
|
||||
extra = ` ${JSON.stringify(summary)}`
|
||||
} else if (successLen !== undefined || failedLen !== undefined) {
|
||||
extra = ` 成功 ${successLen ?? '—'} 条,失败 ${failedLen ?? '—'} 条`
|
||||
}
|
||||
ElMessage.success((res.message || '分配请求已提交') + extra)
|
||||
allocateDialogVisible.value = false
|
||||
upperTable.value?.clearSelection?.()
|
||||
selectionRows.value = []
|
||||
hasSelection.value = false
|
||||
await loadData()
|
||||
} else {
|
||||
ElMessage.error(res?.message || '分配快递号失败')
|
||||
}
|
||||
} catch {
|
||||
ElMessage.error('分配快递号失败')
|
||||
} finally {
|
||||
allocateLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadData()
|
||||
loadFilterData()
|
||||
@ -352,7 +641,8 @@ async function handleExport() {
|
||||
rows: selectionRows.value,
|
||||
columns: columns.value,
|
||||
fileName: `异常订单-${Date.now()}.xlsx`,
|
||||
transformCell: (prop, value) => translateOrderField(prop, value)
|
||||
transformCell: (prop, value) =>
|
||||
EXPORT_TIME_PROPS.has(String(prop)) ? formatOrderTime(value) : translateOrderField(prop, value)
|
||||
})
|
||||
ElMessage.success('导出完成')
|
||||
} catch (error) {
|
||||
@ -365,5 +655,39 @@ async function handleExport() {
|
||||
|
||||
<style scoped lang="scss">
|
||||
@use "./styles/order-sub.scss";
|
||||
|
||||
.order-flag-cell {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
vertical-align: bottom;
|
||||
cursor: pointer;
|
||||
color: var(--el-color-primary);
|
||||
line-height: 1.5;
|
||||
border-bottom: 1px dashed var(--el-color-primary-light-5);
|
||||
|
||||
&:hover {
|
||||
color: var(--el-color-primary-dark-2);
|
||||
}
|
||||
|
||||
&:focus-visible {
|
||||
outline: 2px solid var(--el-color-primary-light-3);
|
||||
outline-offset: 2px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.allocate-confirm-text {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.storage-allocate-form {
|
||||
margin-top: 12px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@ -196,18 +196,6 @@
|
||||
<el-form-item label="允许存储储位">
|
||||
<el-switch v-model="storageForm.allowStorageLocation" active-text="是" inactive-text="否" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库 ID">
|
||||
<el-input-number
|
||||
v-model="storageForm.warehouseId"
|
||||
:min="1"
|
||||
:step="1"
|
||||
controls-position="right"
|
||||
placeholder="可选"
|
||||
clearable
|
||||
class="storage-warehouse-input"
|
||||
/>
|
||||
<span class="form-item-hint">留空表示不传 warehouseId,由服务端使用当前仓库</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="storageDialogVisible = false">取消</el-button>
|
||||
@ -226,7 +214,6 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import { orderPendingOrder } from '@/api/order.pendingorder/orderpendingOrder'
|
||||
import { orderStorageAllocation } from '@/api/order.storageallocation/orderstorageallocation'
|
||||
|
||||
import {
|
||||
pendingCloums,
|
||||
@ -274,10 +261,8 @@ const storageDialogVisible = ref(false)
|
||||
const storagePendingOrderIds = ref<Array<number | string>>([])
|
||||
const storageForm = reactive<{
|
||||
allowStorageLocation: boolean
|
||||
warehouseId: number | undefined
|
||||
}>({
|
||||
allowStorageLocation: true,
|
||||
warehouseId: undefined
|
||||
allowStorageLocation: false
|
||||
})
|
||||
|
||||
const selectedRow = computed(() => {
|
||||
@ -420,18 +405,6 @@ function getSelectedIds() {
|
||||
.filter((id: any) => id !== undefined && id !== null)
|
||||
}
|
||||
|
||||
function inferWarehouseIdFromSelection(rows: any[]): number | undefined {
|
||||
if (!rows.length) return undefined
|
||||
const raw = rows
|
||||
.map((r) => r?.warehouse_id ?? r?.warehouseId)
|
||||
.filter((x: any) => x !== undefined && x !== null && x !== '')
|
||||
if (!raw.length) return undefined
|
||||
const first = Number(raw[0])
|
||||
if (!Number.isFinite(first)) return undefined
|
||||
const same = raw.every((x: any) => Number(x) === first)
|
||||
return same ? first : undefined
|
||||
}
|
||||
|
||||
function openStorageAllocateDialog() {
|
||||
if (!selectionRows.value.length) {
|
||||
ElMessage.warning('请先勾选需要分配储位的订单')
|
||||
@ -443,15 +416,13 @@ function openStorageAllocateDialog() {
|
||||
return
|
||||
}
|
||||
storagePendingOrderIds.value = [...ids]
|
||||
storageForm.allowStorageLocation = true
|
||||
storageForm.warehouseId = inferWarehouseIdFromSelection(selectionRows.value)
|
||||
storageForm.allowStorageLocation = false
|
||||
storageDialogVisible.value = true
|
||||
}
|
||||
|
||||
function resetStorageAllocateDialog() {
|
||||
storagePendingOrderIds.value = []
|
||||
storageForm.allowStorageLocation = true
|
||||
storageForm.warehouseId = undefined
|
||||
storageForm.allowStorageLocation = false
|
||||
}
|
||||
|
||||
async function submitStorageAllocate() {
|
||||
@ -473,10 +444,7 @@ async function submitStorageAllocate() {
|
||||
order_ids,
|
||||
allowStorageLocation: storageForm.allowStorageLocation
|
||||
}
|
||||
if (storageForm.warehouseId != null && Number.isFinite(Number(storageForm.warehouseId))) {
|
||||
payload.warehouseId = Number(storageForm.warehouseId)
|
||||
}
|
||||
const res = await orderStorageAllocation.allocateStorage(payload)
|
||||
const res = await orderPendingOrder.allocateStorage(payload)
|
||||
const ok =
|
||||
res &&
|
||||
(res.code === 1 || res.code === 200 || res.flag === 'success')
|
||||
@ -676,16 +644,5 @@ async function submitAllocateExpress() {
|
||||
.storage-allocate-form {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.storage-warehouse-input {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.form-item-hint {
|
||||
display: block;
|
||||
margin-top: 6px;
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@ -264,7 +264,6 @@ import {
|
||||
printFormConfig,
|
||||
addReceivingFields
|
||||
} from './receiving-config'
|
||||
import * as printerApi from '@/api/printer.station/printerstation'
|
||||
import * as templateApi from '@/api/setting.printtemplate/printTemplate'
|
||||
import * as stationApi from '@/api/print/print'
|
||||
import JsBarcode from 'jsbarcode'
|
||||
|
||||
@ -15,26 +15,47 @@
|
||||
</div>
|
||||
<div class="toolbar-right">
|
||||
<el-button type="success" size="small" @click="openCreate">新增编码</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
plain
|
||||
:disabled="!selectedIds.length"
|
||||
:loading="batchDeleting"
|
||||
@click="handleBatchDelete"
|
||||
>
|
||||
批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-wrapper">
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
stripe
|
||||
height="100%"
|
||||
row-key="id"
|
||||
@selection-change="onSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="48" fixed="left" />
|
||||
<el-table-column prop="id" label="ID" width="80" />
|
||||
<el-table-column prop="express_name" label="快递名称" min-width="180" />
|
||||
<el-table-column prop="code" label="业务编码" min-width="180" />
|
||||
<el-table-column prop="name" label="业务名称" min-width="180" />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<el-table-column label="操作" width="140" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" @click="openEdit(row)">编辑</el-button>
|
||||
<el-button link type="danger" disabled>删除</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
:loading="deletingId === row.id"
|
||||
:disabled="row.id == null"
|
||||
@click="handleDelete(row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -65,9 +86,18 @@
|
||||
<el-input
|
||||
v-model="formData.code"
|
||||
placeholder="如 SF.KY"
|
||||
:disabled="dialogMode === 'edit'"
|
||||
@blur="validateCodeUnique"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-alert
|
||||
v-if="dialogMode === 'edit'"
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
class="form-tip"
|
||||
title="业务编码创建后不可修改;仅可调整名称与关联快递公司(platform)。"
|
||||
/> -->
|
||||
<el-form-item label="业务名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="如 顺丰空运产品" />
|
||||
</el-form-item>
|
||||
@ -98,12 +128,13 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { getExpressList } from '@/api/index/index'
|
||||
import {
|
||||
expressCheckCodeUnique,
|
||||
expressCreate,
|
||||
expressDelete,
|
||||
expressList,
|
||||
expressUpdate
|
||||
} from '@/api/setting.express/express'
|
||||
@ -119,12 +150,17 @@ type ExpressRecord = {
|
||||
code: string
|
||||
name: string
|
||||
express_code: string
|
||||
platform?: string
|
||||
express_name?: string
|
||||
express_label?: string
|
||||
}
|
||||
|
||||
const tableRef = ref()
|
||||
const loading = ref(false)
|
||||
const saving = ref(false)
|
||||
const deletingId = ref<number | string | null>(null)
|
||||
const batchDeleting = ref(false)
|
||||
const selectedIds = ref<number[]>([])
|
||||
const tableData = ref<ExpressRecord[]>([])
|
||||
const total = ref(0)
|
||||
const expressOptions = ref<ExpressOption[]>([])
|
||||
@ -154,14 +190,42 @@ const rules: FormRules = {
|
||||
|
||||
const isSuccess = (res: any) => res && [0, 1, 200].includes(res.code)
|
||||
|
||||
/** setting.express.list:pagination(module)+ keyword(兼容旧入参) */
|
||||
function buildListPayload() {
|
||||
const kw = query.keyword.trim()
|
||||
const payload: Record<string, any> = {
|
||||
pagination: {
|
||||
page: query.page,
|
||||
pageSize: query.page_size
|
||||
}
|
||||
}
|
||||
if (kw) {
|
||||
payload.keyword = kw
|
||||
}
|
||||
return payload
|
||||
}
|
||||
|
||||
function normalizeListRow(item: any): ExpressRecord {
|
||||
const platform = item?.platform ?? item?.express_code ?? ''
|
||||
const baseName = item?.express_name ?? item?.platform_name ?? ''
|
||||
return {
|
||||
...item,
|
||||
express_code: platform,
|
||||
express_name: baseName || item?.name
|
||||
}
|
||||
}
|
||||
|
||||
function onSelectionChange(rows: ExpressRecord[]) {
|
||||
selectedIds.value = (rows || [])
|
||||
.map((r) => r.id)
|
||||
.filter((id): id is number => id != null && Number.isFinite(Number(id)))
|
||||
.map((id) => Number(id))
|
||||
}
|
||||
|
||||
async function loadList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res: any = await expressList({
|
||||
page: query.page,
|
||||
page_size: query.page_size,
|
||||
keyword: query.keyword
|
||||
})
|
||||
const res: any = await expressList(buildListPayload())
|
||||
if (!isSuccess(res)) {
|
||||
ElMessage.error(res?.message || '获取快递编码失败')
|
||||
tableData.value = []
|
||||
@ -169,8 +233,11 @@ async function loadList() {
|
||||
return
|
||||
}
|
||||
const data = res?.data || {}
|
||||
tableData.value = data.list || []
|
||||
total.value = Number(data.total || 0)
|
||||
const raw = data.list || []
|
||||
tableData.value = raw.map((item: any) => normalizeListRow(item))
|
||||
total.value = Number(
|
||||
data.pagination?.total ?? data.total ?? data.count ?? 0
|
||||
)
|
||||
} catch (error) {
|
||||
tableData.value = []
|
||||
total.value = 0
|
||||
@ -231,11 +298,89 @@ function openEdit(row: ExpressRecord) {
|
||||
formData.id = row.id
|
||||
formData.code = row.code
|
||||
formData.name = row.name
|
||||
formData.express_code = row.express_code
|
||||
formData.express_code = row.express_code || row.platform || ''
|
||||
formData.express_name = row.express_name
|
||||
formRef.value?.clearValidate()
|
||||
}
|
||||
|
||||
function summarizeDeleteResult(data: Record<string, any> | null | undefined) {
|
||||
if (!data || typeof data !== 'object') return ''
|
||||
const deleted = Array.isArray(data.deleted_ids) ? data.deleted_ids.length : 0
|
||||
const already = Array.isArray(data.already_deleted_ids) ? data.already_deleted_ids.length : 0
|
||||
const parts: string[] = []
|
||||
if (deleted) parts.push(`已删除 ${deleted} 条`)
|
||||
if (already) parts.push(`已为删除状态 ${already} 条`)
|
||||
return parts.length ? `(${parts.join(';')})` : ''
|
||||
}
|
||||
|
||||
async function handleDelete(row: ExpressRecord) {
|
||||
const id = row.id
|
||||
if (id == null || !Number.isFinite(Number(id))) {
|
||||
ElMessage.warning('无法删除:缺少有效 ID')
|
||||
return
|
||||
}
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`确定软删除快递映射「${row.name || row.code}」吗?`,
|
||||
'删除确认',
|
||||
{ type: 'warning', confirmButtonText: '删除', cancelButtonText: '取消' }
|
||||
)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
deletingId.value = id
|
||||
try {
|
||||
const res: any = await expressDelete({ ids: [Number(id)] })
|
||||
if (!isSuccess(res)) {
|
||||
ElMessage.error(res?.message || '删除失败')
|
||||
return
|
||||
}
|
||||
const extra = summarizeDeleteResult(res.data)
|
||||
ElMessage.success((res.message || '删除成功') + extra)
|
||||
await loadList()
|
||||
} catch {
|
||||
ElMessage.error('删除失败')
|
||||
} finally {
|
||||
deletingId.value = null
|
||||
}
|
||||
}
|
||||
|
||||
async function handleBatchDelete() {
|
||||
const ids = [...selectedIds.value]
|
||||
if (!ids.length) {
|
||||
ElMessage.warning('请先勾选要删除的映射')
|
||||
return
|
||||
}
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`确定批量软删除选中的 ${ids.length} 条快递映射吗?`,
|
||||
'删除确认',
|
||||
{ type: 'warning', confirmButtonText: '删除', cancelButtonText: '取消' }
|
||||
)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
batchDeleting.value = true
|
||||
try {
|
||||
const res: any = await expressDelete({ ids })
|
||||
if (!isSuccess(res)) {
|
||||
ElMessage.error(res?.message || '批量删除失败')
|
||||
return
|
||||
}
|
||||
const extra = summarizeDeleteResult(res.data)
|
||||
ElMessage.success((res.message || '批量删除已提交') + extra)
|
||||
selectedIds.value = []
|
||||
tableRef.value?.clearSelection?.()
|
||||
await loadList()
|
||||
} catch {
|
||||
ElMessage.error('批量删除失败')
|
||||
} finally {
|
||||
batchDeleting.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function validateCodeUnique() {
|
||||
if (!formData.code) return true
|
||||
try {
|
||||
@ -264,16 +409,17 @@ async function submitForm() {
|
||||
saving.value = true
|
||||
try {
|
||||
const createPayload = {
|
||||
code: formData.code,
|
||||
name: formData.name,
|
||||
...(formData.express_code ? { platform: formData.express_code } : {})
|
||||
code: formData.code.trim(),
|
||||
name: formData.name.trim(),
|
||||
...(formData.express_code ? { platform: String(formData.express_code).trim() } : {})
|
||||
}
|
||||
/** setting.express.update:仅 id、name、platform(与 module 一致) */
|
||||
const updatePayload = {
|
||||
id: formData.id,
|
||||
code: formData.code,
|
||||
name: formData.name,
|
||||
express_code: formData.express_code,
|
||||
express_name: formData.express_name
|
||||
id: Number(formData.id),
|
||||
name: formData.name.trim(),
|
||||
...(formData.express_code
|
||||
? { platform: String(formData.express_code).trim() }
|
||||
: {})
|
||||
}
|
||||
const res: any = dialogMode.value === 'create'
|
||||
? await expressCreate(createPayload)
|
||||
@ -349,4 +495,8 @@ onMounted(() => {
|
||||
.table-wrapper :deep(.el-table__body-wrapper) {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.form-tip {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -16,22 +16,80 @@
|
||||
<section class="main-panel">
|
||||
<div class="panel-toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-input
|
||||
v-model="query.keyword"
|
||||
clearable
|
||||
class="search-input"
|
||||
placeholder="搜索名称 / 快递编码 / 平台编码"
|
||||
@keyup.enter="handleSearch"
|
||||
@clear="handleSearch"
|
||||
/>
|
||||
<el-button type="primary" size="small" @click="handleSearch">搜索</el-button>
|
||||
<el-button size="small" :loading="loading" @click="loadList">刷新</el-button>
|
||||
<el-radio-group
|
||||
v-model="viewMode"
|
||||
class="view-mode-toggle"
|
||||
size="small"
|
||||
@change="onViewModeChange"
|
||||
>
|
||||
<el-radio-button label="paged">分页列表</el-radio-button>
|
||||
<el-radio-button label="warehouse">按仓库 + 平台(全量)</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<template v-if="viewMode === 'paged'">
|
||||
<el-input
|
||||
v-model="query.keyword"
|
||||
clearable
|
||||
class="search-input"
|
||||
placeholder="关键词(where.quickWhere)"
|
||||
@keyup.enter="handleSearch"
|
||||
@clear="handleSearch"
|
||||
/>
|
||||
<el-button type="primary" size="small" @click="handleSearch">搜索</el-button>
|
||||
<el-button size="small" :loading="loading" @click="loadList">刷新</el-button>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<el-input-number
|
||||
v-model="warehouseQuery.warehouse_id"
|
||||
class="warehouse-id-input"
|
||||
:min="1"
|
||||
:precision="0"
|
||||
controls-position="right"
|
||||
placeholder="仓库 ID"
|
||||
clearable
|
||||
/>
|
||||
<el-select
|
||||
v-model="warehouseQuery.platform_code"
|
||||
class="platform-filter-select"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="平台编码(必填)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in platformOptions"
|
||||
:key="item.code"
|
||||
:label="item.label || item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button type="primary" size="small" :loading="platformLoading" @click="loadByWarehousePlatform">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
:loading="platformLoading"
|
||||
:disabled="!warehouseQuery.platform_code"
|
||||
@click="loadByWarehousePlatform"
|
||||
>
|
||||
刷新
|
||||
</el-button>
|
||||
<span v-if="warehouseContextHint" class="toolbar-hint">{{ warehouseContextHint }}</span>
|
||||
</template>
|
||||
</div>
|
||||
<el-button type="success" size="small" @click="openCreate">新增接口配置</el-button>
|
||||
</div>
|
||||
|
||||
<div class="panel-table">
|
||||
<el-table v-loading="loading" :data="tableData" border stripe height="100%" row-key="id">
|
||||
<el-table
|
||||
v-if="viewMode === 'paged'"
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
stripe
|
||||
height="100%"
|
||||
row-key="id"
|
||||
>
|
||||
<el-table-column prop="id" label="ID" width="80" align="center" />
|
||||
<el-table-column prop="name" label="配置名称" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="express_code" label="快递编码" min-width="120" show-overflow-tooltip />
|
||||
@ -47,9 +105,49 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-table
|
||||
v-else
|
||||
v-loading="platformLoading"
|
||||
:data="platformScopeTableData"
|
||||
border
|
||||
stripe
|
||||
height="100%"
|
||||
row-key="id"
|
||||
>
|
||||
<el-table-column prop="weight" label="权重" width="80" align="right" />
|
||||
<el-table-column prop="id" label="ID" width="80" align="center" />
|
||||
<el-table-column prop="name" label="配置名称" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="express_code" label="快递编码" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="关联快递" min-width="160" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<template v-if="row.express">
|
||||
{{ row.express.name || '—' }}
|
||||
<span class="muted">({{ row.express.code || row.express_code }})</span>
|
||||
</template>
|
||||
<span v-else class="muted">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="快递平台" min-width="100" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ row.express?.platform ?? '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="platform_code" label="平台编码" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="sender_name" label="发件人" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="sender_tel" label="发件电话" min-width="110" show-overflow-tooltip />
|
||||
<el-table-column prop="shop_name" label="店铺" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="can_use_count" label="可用单量" width="90" align="right" />
|
||||
<el-table-column label="操作" width="160" fixed="right" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" @click="openEdit(row)">编辑</el-button>
|
||||
<el-button link type="danger" @click="handleDelete(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<div class="panel-pager">
|
||||
<div v-show="viewMode === 'paged'" class="panel-pager">
|
||||
<el-pagination
|
||||
v-model:current-page="query.page"
|
||||
v-model:page-size="query.page_size"
|
||||
@ -163,35 +261,57 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Connection } from '@element-plus/icons-vue'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { getExpressList, getPlatformList } from '@/api/index/index'
|
||||
import {
|
||||
expressInterfaceCreate,
|
||||
expressInterfaceDelete,
|
||||
expressInterfaceList,
|
||||
expressInterfaceListByWarehousePlatformCode,
|
||||
expressInterfaceUpdate
|
||||
} from '@/api/setting.expressinterface/expressInterface'
|
||||
import { useUserStore } from '@/stores/modules/user'
|
||||
|
||||
type ExpressOption = { code: string; name: string; label?: string }
|
||||
type PlatformOption = { code: string; name: string; label?: string }
|
||||
type ExpressInterfaceRecord = Record<string, any>
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const loading = ref(false)
|
||||
const platformLoading = ref(false)
|
||||
const saving = ref(false)
|
||||
const total = ref(0)
|
||||
const tableData = ref<ExpressInterfaceRecord[]>([])
|
||||
const platformScopeTableData = ref<ExpressInterfaceRecord[]>([])
|
||||
const expressOptions = ref<ExpressOption[]>([])
|
||||
const platformOptions = ref<PlatformOption[]>([])
|
||||
|
||||
const viewMode = ref<'paged' | 'warehouse'>('paged')
|
||||
|
||||
const query = reactive({
|
||||
keyword: '',
|
||||
page: 1,
|
||||
page_size: 20
|
||||
})
|
||||
|
||||
const warehouseQuery = reactive<{
|
||||
warehouse_id: number | undefined
|
||||
platform_code: string
|
||||
}>({
|
||||
warehouse_id: undefined,
|
||||
platform_code: ''
|
||||
})
|
||||
|
||||
const warehouseContextHint = computed(() => {
|
||||
const u = userStore.user || {}
|
||||
const sid = u.store_id ?? u.warehouse_id
|
||||
if (sid === undefined || sid === null || sid === '') return ''
|
||||
return `未填仓库 ID 时默认使用登录上下文(store_id / 仓库:${sid})`
|
||||
})
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const dialogMode = ref<'create' | 'edit'>('create')
|
||||
const formRef = ref<FormInstance>()
|
||||
@ -221,10 +341,14 @@ const isSuccess = (res: any) => res && [0, 1, 200].includes(res.code)
|
||||
async function loadList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const kw = query.keyword.trim()
|
||||
const where = kw ? { quickWhere: kw } : {}
|
||||
const res: any = await expressInterfaceList({
|
||||
page: query.page,
|
||||
page_size: query.page_size,
|
||||
keyword: query.keyword
|
||||
pagination: {
|
||||
page: query.page,
|
||||
pageSize: query.page_size
|
||||
},
|
||||
where
|
||||
})
|
||||
if (!isSuccess(res)) {
|
||||
ElMessage.error(res?.message || '获取快递接口配置失败')
|
||||
@ -244,6 +368,48 @@ async function loadList() {
|
||||
}
|
||||
}
|
||||
|
||||
function onViewModeChange() {
|
||||
if (viewMode.value === 'paged') {
|
||||
loadList()
|
||||
return
|
||||
}
|
||||
if (warehouseQuery.platform_code) {
|
||||
loadByWarehousePlatform()
|
||||
} else {
|
||||
platformScopeTableData.value = []
|
||||
}
|
||||
}
|
||||
|
||||
async function loadByWarehousePlatform() {
|
||||
const code = warehouseQuery.platform_code?.trim()
|
||||
if (!code) {
|
||||
ElMessage.warning('请选择或填写平台编码(platform_code)')
|
||||
return
|
||||
}
|
||||
platformLoading.value = true
|
||||
try {
|
||||
const payload: Record<string, any> = {
|
||||
platform_code: code
|
||||
}
|
||||
if (warehouseQuery.warehouse_id != null && warehouseQuery.warehouse_id > 0) {
|
||||
payload.warehouse_id = warehouseQuery.warehouse_id
|
||||
}
|
||||
const res: any = await expressInterfaceListByWarehousePlatformCode(payload)
|
||||
if (!isSuccess(res)) {
|
||||
ElMessage.error(res?.message || '按仓库与平台查询失败')
|
||||
platformScopeTableData.value = []
|
||||
return
|
||||
}
|
||||
const data = res?.data || {}
|
||||
platformScopeTableData.value = data.list || []
|
||||
} catch (error) {
|
||||
platformScopeTableData.value = []
|
||||
ElMessage.error('按仓库与平台查询失败')
|
||||
} finally {
|
||||
platformLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function loadExpressOptions() {
|
||||
try {
|
||||
const res: any = await getExpressList({ systemOnly: true })
|
||||
@ -357,7 +523,11 @@ async function submitForm() {
|
||||
}
|
||||
ElMessage.success(dialogMode.value === 'create' ? '新增成功' : '更新成功')
|
||||
dialogVisible.value = false
|
||||
loadList()
|
||||
if (viewMode.value === 'warehouse' && warehouseQuery.platform_code) {
|
||||
loadByWarehousePlatform()
|
||||
} else {
|
||||
loadList()
|
||||
}
|
||||
} catch (error) {
|
||||
ElMessage.error('保存失败')
|
||||
} finally {
|
||||
@ -375,10 +545,14 @@ function handleDelete(row: ExpressInterfaceRecord) {
|
||||
return
|
||||
}
|
||||
ElMessage.success('删除成功')
|
||||
if (tableData.value.length === 1 && query.page > 1) {
|
||||
if (viewMode.value === 'paged' && tableData.value.length === 1 && query.page > 1) {
|
||||
query.page -= 1
|
||||
}
|
||||
loadList()
|
||||
if (viewMode.value === 'warehouse' && warehouseQuery.platform_code) {
|
||||
loadByWarehousePlatform()
|
||||
} else {
|
||||
loadList()
|
||||
}
|
||||
})
|
||||
.catch(() => undefined)
|
||||
}
|
||||
@ -490,6 +664,29 @@ onMounted(() => {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.view-mode-toggle {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.warehouse-id-input {
|
||||
width: 148px;
|
||||
}
|
||||
|
||||
.platform-filter-select {
|
||||
width: min(200px, 100%);
|
||||
}
|
||||
|
||||
.toolbar-hint {
|
||||
font-size: 12px;
|
||||
color: var(--el-text-color-secondary, #909399);
|
||||
line-height: 1.4;
|
||||
max-width: min(360px, 100%);
|
||||
}
|
||||
|
||||
.muted {
|
||||
color: var(--el-text-color-secondary, #909399);
|
||||
}
|
||||
|
||||
.search-input {
|
||||
width: min(320px, 100%);
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ const rules = {
|
||||
|
||||
const computers = ref<Array<any>>([])
|
||||
|
||||
const okCode = (c: unknown) => c === 0 || c === 200
|
||||
const okCode = (c: unknown) => c === 0 || c === 200 || c === 1
|
||||
|
||||
const loadComputers = async () => {
|
||||
try {
|
||||
@ -84,10 +84,12 @@ const handleSave = async () => {
|
||||
}
|
||||
const payload: Record<string, unknown> = {
|
||||
name: formData.name.trim(),
|
||||
computer_id: cid,
|
||||
custom_barcode: formData.custom_barcode || '',
|
||||
default_printer_name: formData.default_printer_name || ''
|
||||
computer_id: cid
|
||||
}
|
||||
const bc = formData.custom_barcode?.trim()
|
||||
if (bc) payload.custom_barcode = bc
|
||||
const dp = formData.default_printer_name?.trim()
|
||||
if (dp) payload.default_printer_name = dp
|
||||
const res: any = await stationApi.add(payload)
|
||||
if (res && okCode(res.code)) {
|
||||
ElMessage.success('添加成功')
|
||||
|
||||
@ -6,12 +6,12 @@
|
||||
<el-input v-model="form.name" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="自定义编码" prop="custom_barcode">
|
||||
<el-form-item label="自定义条码" prop="custom_barcode">
|
||||
<el-input v-model="form.custom_barcode" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="电脑ID" prop="computer_id">
|
||||
<el-select v-model="form.computer_id" placeholder="请选择电脑ID" clearable
|
||||
<el-form-item label="打印电脑" prop="computer_id">
|
||||
<el-select v-model="form.computer_id" placeholder="请选择打印电脑" clearable
|
||||
@visible-change="onComputerVisibleChange">
|
||||
<el-option v-for="item in computerOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
@ -59,11 +59,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { ref, watch, nextTick } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import * as stationApi from '@/api/print/print'
|
||||
import { getExpressList } from '@/api/index/index'
|
||||
|
||||
const okCode = (c: unknown) => c === 0 || c === 200
|
||||
const okCode = (c: unknown) => c === 0 || c === 200 || c === 1
|
||||
|
||||
// 从父组件接收的外部属性
|
||||
const props = defineProps({
|
||||
@ -75,6 +76,11 @@ const props = defineProps({
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
/** 列表当前行,用于与 print.getItem 字段/嵌套结构不一致时立即对齐表单展示 */
|
||||
tableRow: {
|
||||
type: Object,
|
||||
default: undefined
|
||||
},
|
||||
computer_id: {
|
||||
type: [String, Number],
|
||||
required: false
|
||||
@ -112,6 +118,91 @@ const form = ref({
|
||||
})
|
||||
const saveLoading = ref(false)
|
||||
|
||||
/** 避免 getData 与「切换行」并发时旧请求覆盖新表单 */
|
||||
let loadDetailSeq = 0
|
||||
/** 从接口拉取并回填表单期间,跳过 computer_id 的 watch,防止误清空打印机/竞态 */
|
||||
const hydratingFromApi = ref(false)
|
||||
|
||||
const STATION_LEAF_KEYS = [
|
||||
'name',
|
||||
'station_name',
|
||||
'print_station_name',
|
||||
'computer_id',
|
||||
'computerId',
|
||||
'custom_barcode',
|
||||
'customBarcode',
|
||||
'default_printer_name',
|
||||
'defaultPrinterName'
|
||||
] as const
|
||||
|
||||
function unwrapPrintStationRecord(raw: unknown, depth = 0): Record<string, any> {
|
||||
if (raw == null || typeof raw !== 'object' || depth > 8) return {}
|
||||
const o = raw as Record<string, any>
|
||||
if (STATION_LEAF_KEYS.some((k) => k in o)) {
|
||||
return o
|
||||
}
|
||||
const inner =
|
||||
o.record ??
|
||||
o.item ??
|
||||
o.detail ??
|
||||
o.printStation ??
|
||||
o.print_station ??
|
||||
o.station ??
|
||||
(typeof o.data === 'object' && o.data !== null ? o.data : null)
|
||||
if (inner && typeof inner === 'object') {
|
||||
return unwrapPrintStationRecord(inner, depth + 1)
|
||||
}
|
||||
return o
|
||||
}
|
||||
|
||||
/** 将列表行或接口记录上的别名统一到表单使用的字段语义 */
|
||||
function normalizeStationRecord(src: Record<string, any>): Record<string, any> {
|
||||
if (!src || typeof src !== 'object') return {}
|
||||
const name =
|
||||
src.name ?? src.station_name ?? src.print_station_name ?? src.printName ?? src.stationName ?? ''
|
||||
const custom_barcode =
|
||||
src.custom_barcode ?? src.customBarcode ?? src.barcode ?? ''
|
||||
const computer_id = src.computer_id ?? src.computerId ?? src.print_computer_id ?? ''
|
||||
const default_printer_name =
|
||||
src.default_printer_name ?? src.defaultPrinterName ?? src.printer_name ?? src.default_printer ?? ''
|
||||
return {
|
||||
...src,
|
||||
name,
|
||||
custom_barcode,
|
||||
computer_id,
|
||||
default_printer_name
|
||||
}
|
||||
}
|
||||
|
||||
function rowMatchesPropsId(row: Record<string, any> | null | undefined, id: string | number) {
|
||||
if (!row || typeof row !== 'object') return false
|
||||
const rid = row.id ?? row.print_station_id ?? row.station_id ?? row.print_id ?? row.printId
|
||||
if (rid == null || rid === '') return false
|
||||
return String(rid) === String(id)
|
||||
}
|
||||
|
||||
function seedFormFromTableRow(row: Record<string, any>) {
|
||||
const n = normalizeStationRecord(row)
|
||||
form.value.name = n.name != null ? String(n.name) : ''
|
||||
form.value.custom_barcode =
|
||||
n.custom_barcode != null && String(n.custom_barcode) !== '' ? String(n.custom_barcode) : ''
|
||||
const rawCid = n.computer_id
|
||||
form.value.computer_id =
|
||||
rawCid !== undefined && rawCid !== null && String(rawCid).trim() !== ''
|
||||
? String(rawCid).trim()
|
||||
: ''
|
||||
if (form.value.computer_id) {
|
||||
ensureComputerOption(form.value.computer_id)
|
||||
}
|
||||
}
|
||||
|
||||
function ensureComputerOption(id: string | number | null | undefined) {
|
||||
if (id === null || id === undefined || id === '') return
|
||||
const v = String(id)
|
||||
if (computerOptions.value.some((o) => o.value === v)) return
|
||||
computerOptions.value = [...computerOptions.value, { label: `电脑 ${v}`, value: v }]
|
||||
}
|
||||
|
||||
// 选项列表
|
||||
const computerOptions = ref<Array<{ label: string; value: string }>>([])
|
||||
const onComputerVisibleChange = (visible: boolean) => {
|
||||
@ -135,9 +226,9 @@ const getComputers = async () => {
|
||||
}
|
||||
|
||||
const expressOptions = ref<Array<{ label: string; value: string }>>([])
|
||||
const getExpressList = async () => {
|
||||
const loadExpressOptions = async () => {
|
||||
try {
|
||||
const res: any = await stationApi.getExpressList()
|
||||
const res: any = await getExpressList({ systemOnly: true })
|
||||
if (res && okCode(res.code)) {
|
||||
const list = res.data || []
|
||||
expressOptions.value = list.map((it: any) => {
|
||||
@ -153,7 +244,7 @@ const getExpressList = async () => {
|
||||
}
|
||||
|
||||
const onExpressVisibleChange = (visible: boolean) => {
|
||||
if (visible && expressOptions.value.length === 0) getExpressList()
|
||||
if (visible && expressOptions.value.length === 0) loadExpressOptions()
|
||||
}
|
||||
|
||||
const printerOptions = ref<Array<{ label: string; value: string }>>([])
|
||||
@ -192,42 +283,70 @@ const getComputerPrinter = async (id: any) => {
|
||||
|
||||
// api接口
|
||||
const getData = async () => {
|
||||
if (!props.id) return
|
||||
if (props.id === null || props.id === undefined || props.id === '') return
|
||||
const seq = ++loadDetailSeq
|
||||
loading.value = true
|
||||
hydratingFromApi.value = true
|
||||
try {
|
||||
// 每次获取详情前,先拉取电脑列表
|
||||
const tr = props.tableRow as Record<string, any> | null | undefined
|
||||
if (tr && rowMatchesPropsId(tr, props.id)) {
|
||||
seedFormFromTableRow(tr)
|
||||
}
|
||||
|
||||
await getComputers()
|
||||
if (seq !== loadDetailSeq) return
|
||||
|
||||
const response: any = await stationApi.getItem(props.id)
|
||||
if (okCode(response.code)) {
|
||||
data.value = response.data ?? {}
|
||||
form.value.name = data.value.name || ''
|
||||
form.value.custom_barcode = data.value.custom_barcode != null ? String(data.value.custom_barcode) : ''
|
||||
form.value.default_printer_name = data.value.default_printer_name || ''
|
||||
form.value.computer_id = data.value.computer_id !== undefined && data.value.computer_id !== null
|
||||
? String(data.value.computer_id)
|
||||
: ''
|
||||
if (seq !== loadDetailSeq) return
|
||||
|
||||
if (form.value.computer_id) {
|
||||
await getComputerPrinter(form.value.computer_id)
|
||||
form.value.printer_id = data.value.default_printer_name || ''
|
||||
} else {
|
||||
printerOptions.value = []
|
||||
form.value.printer_id = ''
|
||||
}
|
||||
if (!okCode(response?.code)) return
|
||||
|
||||
const ex = data.value.express
|
||||
if (Array.isArray(ex) && ex.length > 0) {
|
||||
const first = ex[0]
|
||||
form.value.express_company = String(first?.express_id ?? first?.id ?? first?.expressId ?? '')
|
||||
} else {
|
||||
form.value.express_company = ''
|
||||
}
|
||||
const record = normalizeStationRecord(unwrapPrintStationRecord(response.data))
|
||||
data.value = record
|
||||
|
||||
// 仅在接口返回了非空值时才覆盖,避免把表格行已种子的字段冲掉为空
|
||||
if (record.name != null && String(record.name) !== '') {
|
||||
form.value.name = String(record.name)
|
||||
}
|
||||
if (record.custom_barcode != null && String(record.custom_barcode) !== '') {
|
||||
form.value.custom_barcode = String(record.custom_barcode)
|
||||
}
|
||||
if (record.default_printer_name != null && String(record.default_printer_name) !== '') {
|
||||
form.value.default_printer_name = String(record.default_printer_name)
|
||||
}
|
||||
|
||||
const rawCid = record.computer_id ?? record.computerId
|
||||
if (rawCid !== undefined && rawCid !== null && String(rawCid).trim() !== '') {
|
||||
form.value.computer_id = String(rawCid).trim()
|
||||
}
|
||||
|
||||
ensureComputerOption(form.value.computer_id || rawCid)
|
||||
|
||||
if (form.value.computer_id) {
|
||||
await getComputerPrinter(form.value.computer_id)
|
||||
if (seq !== loadDetailSeq) return
|
||||
const defName = record.default_printer_name
|
||||
form.value.printer_id = defName != null && defName !== '' ? String(defName) : ''
|
||||
} else {
|
||||
printerOptions.value = []
|
||||
form.value.printer_id = ''
|
||||
}
|
||||
|
||||
const ex = record.express
|
||||
if (Array.isArray(ex) && ex.length > 0) {
|
||||
const first = ex[0]
|
||||
form.value.express_company = String(first?.express_id ?? first?.id ?? first?.expressId ?? '')
|
||||
} else {
|
||||
form.value.express_company = ''
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch item:', error)
|
||||
} finally {
|
||||
loading.value = false
|
||||
if (seq === loadDetailSeq) {
|
||||
loading.value = false
|
||||
await nextTick()
|
||||
hydratingFromApi.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -240,7 +359,9 @@ const hasName = async (name: string, id?: string | number) => {
|
||||
const raw = res?.data
|
||||
const exists =
|
||||
raw === true ||
|
||||
raw === 1 ||
|
||||
raw?.exists === true ||
|
||||
(typeof raw === 'object' && raw !== null && raw.exists === true) ||
|
||||
res?.exists === true
|
||||
return okCode(res?.code) && Boolean(exists)
|
||||
} catch (e) {
|
||||
@ -249,12 +370,12 @@ const hasName = async (name: string, id?: string | number) => {
|
||||
}
|
||||
}
|
||||
|
||||
const buildExpressPayload = (): Array<{ express_id: string; name: string }> => {
|
||||
const buildExpressPayload = (): Array<Record<string, unknown>> => {
|
||||
if (form.value.express_company) {
|
||||
return [{
|
||||
express_id: String(form.value.express_company),
|
||||
name: String(form.value.printer_id || '')
|
||||
}]
|
||||
const eid = form.value.express_company
|
||||
const num = Number(eid)
|
||||
const express_id = Number.isFinite(num) ? num : String(eid)
|
||||
return [{ express_id, name: String(form.value.printer_id || '') }]
|
||||
}
|
||||
const sourceExpress = Array.isArray(props.express) && props.express.length > 0
|
||||
? props.express
|
||||
@ -262,22 +383,29 @@ const buildExpressPayload = (): Array<{ express_id: string; name: string }> => {
|
||||
? data.value.express
|
||||
: []
|
||||
return sourceExpress.map((it: any) => {
|
||||
const expressId = it?.express_id ?? it?.id ?? it?.expressId ?? it?.value ?? ''
|
||||
const rawId = it?.express_id ?? it?.id ?? it?.expressId ?? it?.value ?? ''
|
||||
const numId = Number(rawId)
|
||||
const express_id = Number.isFinite(numId) ? numId : String(rawId)
|
||||
const name = it?.name ?? it?.printer_name ?? it?.default_printer_name ?? it?.label ?? ''
|
||||
return { express_id: String(expressId), name: String(name) }
|
||||
}).filter((e: { express_id: string; name: string }) => e.express_id || e.name)
|
||||
return { express_id, name: String(name) }
|
||||
}).filter((e: Record<string, unknown>) => {
|
||||
const id = e.express_id
|
||||
const hasId = id !== '' && id != null
|
||||
const hasName = String(e.name ?? '').trim() !== ''
|
||||
return hasId || hasName
|
||||
})
|
||||
}
|
||||
|
||||
const persistPrinterBindings = async () => {
|
||||
const sid = Number(props.id)
|
||||
if (!Number.isFinite(sid)) return false
|
||||
const defaultPrinter = String(form.value.printer_id || '')
|
||||
const defaultPrinter = String(form.value.printer_id ?? '').trim()
|
||||
const expressPayload = buildExpressPayload()
|
||||
try {
|
||||
const res: any = await stationApi.savePrinters({
|
||||
defaultPrinter,
|
||||
print_station_id: sid,
|
||||
express: expressPayload
|
||||
express: Array.isArray(expressPayload) ? expressPayload : []
|
||||
})
|
||||
if (!okCode(res?.code)) {
|
||||
ElMessage.error((res && (res.msg || res.message)) || '打印机与快递绑定保存失败')
|
||||
@ -337,6 +465,23 @@ const handleSave = async () => {
|
||||
computer_id: form.value.computer_id
|
||||
})
|
||||
|
||||
const printerNow = String(form.value.printer_id ?? '').trim()
|
||||
const expressNow = String(form.value.express_company ?? '').trim()
|
||||
const hadPrinter = String(data.value?.default_printer_name ?? '').trim() !== ''
|
||||
const hadExpress =
|
||||
Array.isArray(data.value?.express) &&
|
||||
data.value.express.some((x: any) => String(x?.express_id ?? x?.id ?? '').trim() !== '')
|
||||
const shouldSaveBind =
|
||||
printerNow !== '' ||
|
||||
expressNow !== '' ||
|
||||
hadPrinter ||
|
||||
hadExpress
|
||||
|
||||
if (!shouldSaveBind) {
|
||||
ElMessage.success('保存成功')
|
||||
return
|
||||
}
|
||||
|
||||
const bindOk = await persistPrinterBindings()
|
||||
if (bindOk) {
|
||||
ElMessage.success('保存成功')
|
||||
@ -352,28 +497,33 @@ const handleSave = async () => {
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getData()
|
||||
})
|
||||
// 只监听 id:避免 tableRow 引用因列表刷新/保存合并而变时重复 getData,导致 seed 或竞态把表单清空
|
||||
watch(
|
||||
() => props.id,
|
||||
(id) => {
|
||||
if (id === null || id === undefined || id === '') return
|
||||
getData()
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
// when computer_id changes, reload printers and clear printer selection
|
||||
watch(() => form.value.computer_id, (newId) => {
|
||||
if (newId) {
|
||||
getComputerPrinter(newId)
|
||||
// 如果是用户点击切换,则清除之前选中的打印机
|
||||
// 如果是初始化加载切换,由于 getData 异步运行,这里通过 data.value.computer_id 判断是否是用户行为
|
||||
if (data.value && String(data.value.computer_id) !== String(newId)) {
|
||||
form.value.printer_id = ''
|
||||
// 用户手动切换电脑时重载本机打印机列表;回填表单期间由 hydratingFromApi 跳过
|
||||
watch(
|
||||
() => form.value.computer_id,
|
||||
(newId) => {
|
||||
if (hydratingFromApi.value) return
|
||||
if (newId) {
|
||||
getComputerPrinter(newId)
|
||||
if (data.value && String(data.value.computer_id ?? data.value.computerId ?? '') !== String(newId)) {
|
||||
form.value.printer_id = ''
|
||||
}
|
||||
} else {
|
||||
printerOptions.value = []
|
||||
form.value.printer_id = ''
|
||||
}
|
||||
} else {
|
||||
printerOptions.value = []
|
||||
form.value.printer_id = ''
|
||||
}
|
||||
})
|
||||
|
||||
watch(() => props.id, () => {
|
||||
getData()
|
||||
})
|
||||
},
|
||||
{ flush: 'post' }
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@ -1,122 +1,119 @@
|
||||
<template>
|
||||
<div class="printer-management-container">
|
||||
<ScanBox width="300px" ref="scanBox" :preset-tree="presetTree" :available-fields="availableFields" />
|
||||
<ScanBox
|
||||
ref="scanBox"
|
||||
width="300px"
|
||||
:preset-tree="presetTree"
|
||||
:available-fields="availableFields"
|
||||
@condition-change="onScanConditionChange"
|
||||
@condition-clear="onScanConditionClear"
|
||||
/>
|
||||
|
||||
<div class="main-content">
|
||||
<!-- 工具栏 -->
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-button type="primary" size="small" :icon="Refresh" @click="handleRefresh" title="刷新" :loading="loading">
|
||||
<el-button type="primary" size="small" :icon="Refresh" title="刷新" :loading="loading" @click="handleRefresh">
|
||||
刷新
|
||||
</el-button>
|
||||
|
||||
<el-button type="primary" size="small" :icon="Plus" @click="handleAdd" title="添加打印台">
|
||||
<el-button type="primary" size="small" :icon="Plus" title="添加打印台" @click="handleAdd">
|
||||
添加
|
||||
</el-button>
|
||||
|
||||
<el-button type="danger" size="small" :icon="Delete" @click="confirmBatchDelete" title="批量删除"
|
||||
:disabled="!hasSelection">
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
:icon="Delete"
|
||||
title="批量删除"
|
||||
:disabled="!hasSelection"
|
||||
@click="confirmBatchDelete"
|
||||
>
|
||||
批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<div class="toolbar-right">
|
||||
|
||||
</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">
|
||||
<template #column-is_online="{ row }">
|
||||
<el-tag :type="row.is_online === 1 ? 'success' : 'danger'" size="small">
|
||||
{{ row.is_online === 1 ? '在线' : '离线' }}
|
||||
</el-tag>
|
||||
<upper-table
|
||||
ref="accountTableRef"
|
||||
title="打印台列表"
|
||||
:data="list"
|
||||
:columns="tableColumns"
|
||||
:table-size="tableSize"
|
||||
:pagination="pagination"
|
||||
:show-index="true"
|
||||
:show-actions="true"
|
||||
:show-selection="showSelection"
|
||||
:loading="loading"
|
||||
:query-time="queryTime"
|
||||
@current-change="handleTableRowSelect"
|
||||
@row-click="handleTableRowSelect"
|
||||
@page-change="handlePageChange"
|
||||
@page-size-change="handlePageSizeChange"
|
||||
@refresh="handleRefresh"
|
||||
@selection-change="selectionChange"
|
||||
>
|
||||
<template #column-computer_id="{ row }">
|
||||
<span>{{ computerLabel(row.computer_id) }}</span>
|
||||
</template>
|
||||
<template #column-components_douyin="{ row }">
|
||||
<el-tag :type="row.components_douyin === 1 ? 'success' : 'danger'" size="small">
|
||||
{{ row.components_douyin === 1 ? '在线' : '离线' }}
|
||||
</el-tag>
|
||||
<template #column-components="{ row }">
|
||||
<div class="component-tags" v-if="row.components?.length">
|
||||
<span
|
||||
v-for="(c, idx) in row.components"
|
||||
:key="idx"
|
||||
:class="['comp-pill', componentOnline(c) ? 'comp-pill--online' : 'comp-pill--offline']"
|
||||
>
|
||||
<span class="comp-pill__name">{{ c.name }}</span>
|
||||
<span class="comp-pill__state">{{ componentOnline(c) ? '在线' : '离线' }}</span>
|
||||
</span>
|
||||
</div>
|
||||
<span v-else class="text-muted">—</span>
|
||||
</template>
|
||||
<template #column-components_pinduoduo="{ row }">
|
||||
<el-tag :type="row.components_pinduoduo === 1 ? 'success' : 'danger'" size="small">
|
||||
{{ row.components_pinduoduo === 1 ? '在线' : '离线' }}
|
||||
</el-tag>
|
||||
<template #column-create_at="{ row }">
|
||||
{{ formatTime(row.create_at) }}
|
||||
</template>
|
||||
<template #column-components_kuaishou="{ row }">
|
||||
<el-tag :type="row.components_kuaishou === 1 ? 'success' : 'danger'" size="small">
|
||||
{{ row.components_kuaishou === 1 ? '在线' : '离线' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #column-components_jd="{ row }">
|
||||
<el-tag :type="row.components_jd === 1 ? 'success' : 'danger'" size="small">
|
||||
{{ row.components_jd === 1 ? '在线' : '离线' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #column-components_cainiao="{ row }">
|
||||
<el-tag :type="row.components_cainiao === 1 ? 'success' : 'danger'" size="small">
|
||||
{{ row.components_cainiao === 1 ? '在线' : '离线' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #column-components_shipinhao="{ row }">
|
||||
<el-tag :type="row.components_shipinhao === 1 ? 'success' : 'danger'" size="small">
|
||||
{{ row.components_shipinhao === 1 ? '在线' : '离线' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #column-components_xiaohongshu="{ row }">
|
||||
<el-tag :type="row.components_xiaohongshu === 1 ? 'success' : 'danger'" size="small">
|
||||
{{ row.components_xiaohongshu === 1 ? '在线' : '离线' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #column-components_lodop="{ row }">
|
||||
<el-tag :type="row.components_lodop === 1 ? 'success' : 'danger'" size="small">
|
||||
{{ row.components_lodop === 1 ? '在线' : '离线' }}
|
||||
</el-tag>
|
||||
<template #column-update_at="{ row }">
|
||||
{{ formatTime(row.update_at) }}
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
<div class="custom-empty">
|
||||
<el-icon>
|
||||
<User />
|
||||
</el-icon>
|
||||
<el-icon><Printer /></el-icon>
|
||||
<p>暂无打印台数据</p>
|
||||
</div>
|
||||
</template>
|
||||
</upper-table>
|
||||
</div>
|
||||
|
||||
<!-- 下层详情区域 -->
|
||||
<div class="lower-level" v-if="currentStationId" :class="tableSize">
|
||||
<div v-if="currentStationId" class="lower-level" :class="tableSize">
|
||||
<div class="detail-header">
|
||||
<el-tabs v-model="activeTab" class="detail-tab">
|
||||
<el-tab-pane label="属性" name="info" />
|
||||
<!-- <el-tab-pane label="打印电脑" name="computer" />
|
||||
<el-tab-pane label="快递公司" name="express" />
|
||||
<el-tab-pane label="组件" name="components" /> -->
|
||||
</el-tabs>
|
||||
<el-tab-pane label="属性" name="info" />
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
<div class="detail-container">
|
||||
<KeepAlive>
|
||||
<component :is="activeComponent" :id="currentStationId" :name="currentStationName" @refresh="handleRefresh"
|
||||
@updated="handleItemUpdated" />
|
||||
<component
|
||||
:is="activeComponent"
|
||||
:key="String(currentStationId ?? '')"
|
||||
:id="currentStationId"
|
||||
:name="currentStationName"
|
||||
:table-row="currentTableRow"
|
||||
@refresh="handleRefresh"
|
||||
@updated="handleItemUpdated"
|
||||
/>
|
||||
</KeepAlive>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="no-selection" v-else>
|
||||
<div v-else class="no-selection">
|
||||
<div class="empty-tip">
|
||||
<p>请从上方列表中选择一项查看详情</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 抽屉:添加(复用 stock 的 Add 组件) -->
|
||||
<el-drawer v-model="drawer" :with-header="false" direction="rtl" size="800px">
|
||||
<Add v-if="drawer" @saved="handleSaved" />
|
||||
</el-drawer>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -127,312 +124,257 @@ import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import Info from './components/info.vue'
|
||||
import Add from './components/add.vue'
|
||||
import * as printApi from '@/api/print/print'
|
||||
import { Delete, Plus, Refresh, Printer } from '@element-plus/icons-vue'
|
||||
|
||||
import * as stationApi from '@/api/print/print'
|
||||
const okCode = (c: unknown) => c === 0 || c === 200 || c === 1
|
||||
|
||||
import { Delete, Plus, Refresh } from '@element-plus/icons-vue'
|
||||
const scanBox = ref<any>(null)
|
||||
|
||||
const okCode = (c: unknown) => c === 0 || c === 200
|
||||
|
||||
// scanbox使用
|
||||
const presetTree = ref<Array<{
|
||||
label: string;
|
||||
id: string | number;
|
||||
custom_barcode?: string;
|
||||
is_online?: number;
|
||||
children?: Array<{ label: string; is_online: number }>;
|
||||
}>>([])
|
||||
const presetTree = ref<
|
||||
Array<{
|
||||
label: string
|
||||
id: string | number
|
||||
custom_barcode?: string
|
||||
is_online?: number
|
||||
children?: Array<{ label: string; is_online: number }>
|
||||
}>
|
||||
>([])
|
||||
|
||||
/** 与 print.getList 的 where 一致(print 模块 module.json) */
|
||||
const availableFields = ref([
|
||||
{
|
||||
label: '在线状态',
|
||||
value: 'status',
|
||||
type: 'select',
|
||||
options: [
|
||||
{ label: '在线', value: 'online' },
|
||||
{ label: '离线', value: 'offline' },
|
||||
{ label: '异常', value: 'error' }
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '绑定状态',
|
||||
value: 'bindingStatus',
|
||||
type: 'select',
|
||||
options: [
|
||||
{ label: '已绑定', value: 'bound' },
|
||||
{ label: '未绑定', value: 'unbound' }
|
||||
]
|
||||
},
|
||||
// {
|
||||
// label: '字段1',
|
||||
// value: 'field1',
|
||||
// type: 'text'
|
||||
// },
|
||||
{ label: '打印台 ID', value: 'id', type: 'number' },
|
||||
{ label: '打印台名称', value: 'name', type: 'text' },
|
||||
{ label: '打印电脑 ID', value: 'computer_id', type: 'text' },
|
||||
{ label: '自定义条码', value: 'custom_barcode', type: 'text' }
|
||||
])
|
||||
|
||||
|
||||
// 底部组件
|
||||
const activeTab = ref('info')
|
||||
const currentStationId = ref<string | number | null>(null)
|
||||
const currentStationName = ref('')
|
||||
const currentTableRow = ref<Record<string, any> | undefined>(undefined)
|
||||
|
||||
const activeComponent = computed(() => {
|
||||
if (activeTab.value === 'info') {
|
||||
return markRaw(Info)
|
||||
}
|
||||
// if (activeTab.value === 'computer') {
|
||||
// return markRaw(PrintComputer)
|
||||
// }
|
||||
// if (activeTab.value === 'express') {
|
||||
// return markRaw(ExpressCompany)
|
||||
// }
|
||||
// if (activeTab.value === 'components') {
|
||||
// return markRaw(ComponentList)
|
||||
// }
|
||||
if (activeTab.value === 'info') return markRaw(Info)
|
||||
return null
|
||||
})
|
||||
|
||||
// 选中打印台
|
||||
const currentStationName = ref<string>('')
|
||||
|
||||
|
||||
// table
|
||||
const handleRowClick = (row: any) => {
|
||||
if (row && row.id) {
|
||||
currentStationId.value = row.id
|
||||
currentStationName.value = row.name || ''
|
||||
}
|
||||
const handleTableRowSelect = (row: any) => {
|
||||
if (!row) return
|
||||
const rid = row.id
|
||||
if (rid == null || rid === '') return
|
||||
currentStationId.value = rid
|
||||
currentStationName.value = row.name ?? ''
|
||||
currentTableRow.value = row
|
||||
}
|
||||
|
||||
const handlePageChange = (page: number) => {
|
||||
pagination.value.currentPage = page
|
||||
getList()
|
||||
fetchPrintStationList()
|
||||
}
|
||||
|
||||
const handlePageSizeChange = (size: number) => {
|
||||
pagination.value.pageSize = size
|
||||
getList()
|
||||
fetchPrintStationList()
|
||||
}
|
||||
|
||||
// 表格使用
|
||||
const selectedRows = ref<any[]>([])
|
||||
const selectionChange = (selection: any[]) => {
|
||||
hasSelection.value = selection.length > 0
|
||||
selectedRows.value = selection
|
||||
}
|
||||
const accountColumns = ref([
|
||||
{
|
||||
prop: 'name',
|
||||
label: '打印台名称',
|
||||
fixed: 'left',
|
||||
minWidth: '150',
|
||||
showOverflowTooltip: true,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
prop: 'computer_id',
|
||||
label: '打印电脑 ID',
|
||||
minWidth: '110',
|
||||
showOverflowTooltip: true,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
prop: 'custom_barcode',
|
||||
label: '自定义条码',
|
||||
minWidth: '120',
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'default_printer_name',
|
||||
label: '默认打印机',
|
||||
minWidth: '120',
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'creator_name',
|
||||
label: '创建人',
|
||||
minWidth: '100',
|
||||
showOverflowTooltip: true,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
prop: 'is_online',
|
||||
label: '在线状态',
|
||||
minWidth: '100',
|
||||
showOverflowTooltip: true,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
prop: 'components_douyin',
|
||||
label: '抖音',
|
||||
minWidth: '100',
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'components_pinduoduo',
|
||||
label: '拼多多',
|
||||
minWidth: '100',
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'components_kuaishou',
|
||||
label: '快手',
|
||||
minWidth: '100',
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'components_jd',
|
||||
label: '京东',
|
||||
minWidth: '100',
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'components_cainiao',
|
||||
label: '菜鸟',
|
||||
minWidth: '100',
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'components_shipinhao',
|
||||
label: '视频号',
|
||||
minWidth: '100',
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'components_xiaohongshu',
|
||||
label: '小红书',
|
||||
minWidth: '100',
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'components_lodop',
|
||||
label: 'LODOP',
|
||||
minWidth: '100',
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
prop: '',
|
||||
},
|
||||
]);
|
||||
|
||||
// handlers
|
||||
const tableColumns = ref([
|
||||
{ prop: 'name', label: '打印台名称', fixed: 'left' as const, minWidth: '140', showOverflowTooltip: true, sortable: true },
|
||||
{ prop: 'id', label: 'ID', minWidth: '72', showOverflowTooltip: true, sortable: true },
|
||||
{ prop: 'computer_id', label: '打印电脑', minWidth: '160', showOverflowTooltip: true, sortable: true },
|
||||
{ prop: 'custom_barcode', label: '自定义条码', minWidth: '120', showOverflowTooltip: true },
|
||||
{ prop: 'default_printer_name', label: '默认打印机', minWidth: '130', showOverflowTooltip: true },
|
||||
{ prop: 'components', label: '打印组件', minWidth: '280', showOverflowTooltip: true },
|
||||
{ prop: 'creator_name', label: '创建人', minWidth: '100', showOverflowTooltip: true },
|
||||
{ prop: 'create_at', label: '创建时间', minWidth: '168', showOverflowTooltip: true },
|
||||
{ prop: 'update_at', label: '更新时间', minWidth: '168', showOverflowTooltip: true }
|
||||
])
|
||||
|
||||
const drawer = ref(false)
|
||||
const handleAdd = () => { drawer.value = true }
|
||||
const handleSaved = () => { drawer.value = false; getList() }
|
||||
// 保存后端数组
|
||||
const handleAdd = () => {
|
||||
drawer.value = true
|
||||
}
|
||||
const handleSaved = () => {
|
||||
drawer.value = false
|
||||
fetchPrintStationList()
|
||||
}
|
||||
|
||||
const list = ref<any[]>([])
|
||||
|
||||
// 更新回调
|
||||
const handleItemUpdated = (updated: any) => {
|
||||
const idx = list.value.findIndex((i: any) => String(i.id) === String(updated.id))
|
||||
if (idx !== -1) {
|
||||
// merge edited fields
|
||||
list.value[idx] = { ...list.value[idx], ...updated }
|
||||
if (currentStationId.value != null && String(currentStationId.value) === String(updated.id)) {
|
||||
currentTableRow.value = list.value[idx]
|
||||
}
|
||||
}
|
||||
// update presetTree entry too, so scan box reflects changes
|
||||
const treeItem: any = presetTree.value.find((i: any) => String(i.id) === String(updated.id))
|
||||
if (treeItem) {
|
||||
Object.assign(treeItem, {
|
||||
label: updated.name || treeItem.label,
|
||||
...updated
|
||||
})
|
||||
Object.assign(treeItem, { label: updated.name || treeItem.label, ...updated })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const tableSize = ref('default')
|
||||
const pagination = ref({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0
|
||||
})
|
||||
const pagination = ref({ currentPage: 1, pageSize: 10, total: 0 })
|
||||
const loading = ref(false)
|
||||
const queryTime = ref(0)
|
||||
const hasSelection = ref(false)
|
||||
const showSelection = ref(true)
|
||||
|
||||
const computerMap = ref<Map<string, string>>(new Map())
|
||||
|
||||
// api功能
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
const PRINT_WHERE_KEYS = ['id', 'name', 'computer_id', 'custom_barcode'] as const
|
||||
|
||||
function buildWhereFromScan(raw: Record<string, any>): Record<string, unknown> {
|
||||
const out: Record<string, unknown> = {}
|
||||
for (const key of PRINT_WHERE_KEYS) {
|
||||
const c = raw[key]
|
||||
if (c === undefined || c === null || c === '') continue
|
||||
if (c && typeof c === 'object' && 'operator' in c) {
|
||||
out[key] = c
|
||||
continue
|
||||
}
|
||||
if (key === 'id') {
|
||||
const n = Number(c)
|
||||
if (Number.isFinite(n)) out[key] = { operator: 'eq', value: n, type: 'number' }
|
||||
continue
|
||||
}
|
||||
if (key === 'computer_id') {
|
||||
out[key] = { operator: 'eq', value: String(c).trim(), type: 'text' }
|
||||
continue
|
||||
}
|
||||
if (key === 'name' && typeof c === 'string') {
|
||||
out[key] = { operator: 'like', value: c.trim(), type: 'text' }
|
||||
continue
|
||||
}
|
||||
out[key] = { operator: 'eq', value: c, type: 'text' }
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
function onScanConditionChange() {
|
||||
pagination.value.currentPage = 1
|
||||
fetchPrintStationList()
|
||||
}
|
||||
|
||||
function onScanConditionClear() {
|
||||
pagination.value.currentPage = 1
|
||||
fetchPrintStationList()
|
||||
}
|
||||
|
||||
function syncCurrentTableRowFromList() {
|
||||
const sid = currentStationId.value
|
||||
if (sid == null || sid === '') return
|
||||
const row = list.value.find((r: any) => String(r?.id) === String(sid))
|
||||
if (row) currentTableRow.value = row
|
||||
}
|
||||
|
||||
async function loadComputersForLabels() {
|
||||
try {
|
||||
const res: any = await printApi.getComputer()
|
||||
if (!res || !okCode(res.code)) return
|
||||
const arr = res.data || []
|
||||
const m = new Map<string, string>()
|
||||
for (const it of arr) {
|
||||
if (it && typeof it === 'object' && it.id != null) {
|
||||
m.set(String(it.id), String(it.name ?? it.id))
|
||||
}
|
||||
}
|
||||
computerMap.value = m
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
function computerLabel(computerId: unknown): string {
|
||||
if (computerId === undefined || computerId === null || computerId === '') return '—'
|
||||
const key = String(computerId)
|
||||
const name = computerMap.value.get(key)
|
||||
return name ? `${name}(${key})` : key
|
||||
}
|
||||
|
||||
function formatTime(v: unknown): string {
|
||||
if (v == null || v === '') return '—'
|
||||
const s = String(v)
|
||||
return s.length >= 19 ? s.slice(0, 19).replace('T', ' ') : s
|
||||
}
|
||||
|
||||
/** 接口 is_online:1 为在线,其余为离线(与 data.json 一致) */
|
||||
function componentOnline(c: { is_online?: number }): boolean {
|
||||
return Number(c?.is_online) === 1
|
||||
}
|
||||
|
||||
/** print.getList:分页 + where(id / name / computer_id / custom_barcode) */
|
||||
const fetchPrintStationList = async () => {
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
try {
|
||||
const scanRaw = scanBox.value?.getConditions?.() || {}
|
||||
const where = buildWhereFromScan(scanRaw)
|
||||
const payload = {
|
||||
page: pagination.value.currentPage || 1,
|
||||
pageSize: pagination.value.pageSize || 10,
|
||||
where: {}
|
||||
...(Object.keys(where).length ? { where } : {})
|
||||
}
|
||||
|
||||
const response: any = await stationApi.getList(payload)
|
||||
|
||||
// 支持后端返回 code 为 200 或 0 的情况
|
||||
if (response && (response.code === 200 || response.code === 0)) {
|
||||
const response: any = await printApi.getList(payload)
|
||||
if (response && okCode(response.code)) {
|
||||
const data = response.data || {}
|
||||
const rawList: any[] = data.list || []
|
||||
|
||||
const nameMap: Record<string, string> = {
|
||||
'抖音': 'components_douyin',
|
||||
'拼多多': 'components_pinduoduo',
|
||||
'快手': 'components_kuaishou',
|
||||
'京东': 'components_jd',
|
||||
'菜鸟': 'components_cainiao',
|
||||
'视频号': 'components_shipinhao',
|
||||
'小红书': 'components_xiaohongshu',
|
||||
'LODOP': 'components_lodop'
|
||||
}
|
||||
|
||||
list.value = rawList.map((item: { components?: { name: string; is_online: number }[] }) => {
|
||||
const flatItem: any = { ...item }
|
||||
if (item.components) {
|
||||
item.components.forEach((comp: { name: string; is_online: number }) => {
|
||||
const key = nameMap[comp.name]
|
||||
if (key) {
|
||||
flatItem[key] = comp.is_online
|
||||
}
|
||||
})
|
||||
}
|
||||
return flatItem
|
||||
})
|
||||
|
||||
// 转换为 presetTree 格式
|
||||
presetTree.value = rawList.map((item: { name: string; id: string; custom_barcode: string; is_online: number; components?: { name: string; is_online: number }[] }) => ({
|
||||
list.value = rawList
|
||||
syncCurrentTableRowFromList()
|
||||
presetTree.value = rawList.map((item: any) => ({
|
||||
label: item.name,
|
||||
id: item.id,
|
||||
custom_barcode: item.custom_barcode,
|
||||
is_online: item.is_online,
|
||||
children: item.components ? item.components.map(comp => ({
|
||||
label: comp.name,
|
||||
is_online: comp.is_online
|
||||
})) : []
|
||||
children: Array.isArray(item.components)
|
||||
? item.components.map((comp: { name: string; is_online: number }) => ({
|
||||
label: comp.name,
|
||||
is_online: comp.is_online
|
||||
}))
|
||||
: []
|
||||
}))
|
||||
|
||||
// 更新分页总数,兼容不同后端字段名
|
||||
pagination.value.total = data.pagination?.total ?? data.total ?? data.count ?? (Array.isArray(rawList) ? rawList.length : 0)
|
||||
pagination.value.total =
|
||||
data.pagination?.total ?? data.total ?? data.count ?? (Array.isArray(rawList) ? rawList.length : 0)
|
||||
} else {
|
||||
ElMessage.error((response && (response.msg || response.message)) || '加载打印台列表失败')
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch preset tree:', error)
|
||||
console.error(error)
|
||||
ElMessage.error('加载打印台列表失败')
|
||||
} finally {
|
||||
queryTime.value = Date.now() - start
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleRefresh = () => {
|
||||
getList()
|
||||
fetchPrintStationList()
|
||||
}
|
||||
|
||||
const confirmBatchDelete = async () => {
|
||||
if (!selectedRows.value || selectedRows.value.length === 0) {
|
||||
if (!selectedRows.value?.length) {
|
||||
ElMessage.warning('请先选择要删除的打印台')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await ElMessageBox.confirm('确认删除选中打印台?', '删除确认', { type: 'warning' })
|
||||
const ids = selectedRows.value.map((r: any) => String(r.id))
|
||||
const res: any = await stationApi.delItems(ids)
|
||||
const ids = selectedRows.value.map((r: any) => r.id).filter((x: any) => x != null && x !== '')
|
||||
const res: any = await printApi.delItems(ids)
|
||||
if (res && okCode(res.code)) {
|
||||
ElMessage.success('删除成功')
|
||||
await getList()
|
||||
// 如果当前详情被删除,清空
|
||||
if (currentStationId.value && ids.includes(String(currentStationId.value))) {
|
||||
await fetchPrintStationList()
|
||||
const deleted = new Set(ids.map((x: any) => String(x)))
|
||||
if (currentStationId.value != null && deleted.has(String(currentStationId.value))) {
|
||||
currentStationId.value = null
|
||||
currentTableRow.value = undefined
|
||||
}
|
||||
selectedRows.value = []
|
||||
hasSelection.value = false
|
||||
@ -440,15 +382,16 @@ const confirmBatchDelete = async () => {
|
||||
ElMessage.error((res && (res.msg || res.message)) || '删除失败')
|
||||
}
|
||||
} catch (e: any) {
|
||||
// 取消时 MessageBox 会抛出,忽略取消动作
|
||||
if (e && e !== 'cancel') {
|
||||
console.error(e)
|
||||
ElMessage.error('删除失败')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await getList()
|
||||
await loadComputersForLabels()
|
||||
await fetchPrintStationList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -478,11 +421,9 @@ onMounted(async () => {
|
||||
.upper-wrapper {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
/* 不允许 upper-wrapper 自身滚动,保证页面布局不随数据滚动 */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 在 receiving 页面内覆盖 UpperTable,使表格容器填满可用高度,表体滚动,表头与分页固定 */
|
||||
.upper-wrapper :deep(.upper-table-container) {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
@ -490,25 +431,65 @@ onMounted(async () => {
|
||||
}
|
||||
|
||||
.upper-wrapper :deep(.upper-table-container) :deep(.table-container) {
|
||||
/* 取消 UpperTable 的固定像素高度,改为弹性填充 */
|
||||
height: auto !important;
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
/* 交由 el-table__body-wrapper 控制滚动 */
|
||||
}
|
||||
|
||||
/* 表格 body 使用自身滚动条 */
|
||||
.upper-wrapper :deep(.el-table__body-wrapper) {
|
||||
overflow: auto;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.component-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.comp-pill {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 2px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.comp-pill__name {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.comp-pill__state {
|
||||
font-size: 11px;
|
||||
opacity: 0.95;
|
||||
}
|
||||
|
||||
.comp-pill--online {
|
||||
color: #0d5c1f;
|
||||
background-color: #e8f5e9;
|
||||
border: 1px solid #81c784;
|
||||
}
|
||||
|
||||
.comp-pill--offline {
|
||||
color: #b71c1c;
|
||||
background-color: #ffebee;
|
||||
border: 1px solid #e57373;
|
||||
}
|
||||
|
||||
.text-muted {
|
||||
color: #909399;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.lower-level {
|
||||
background-color: #fff;
|
||||
margin-top: 10px;
|
||||
flex: 0 0 300px;
|
||||
/* 固定高度/基础高度 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
@ -538,6 +519,17 @@ onMounted(async () => {
|
||||
align-items: center;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.custom-empty {
|
||||
padding: 24px;
|
||||
text-align: center;
|
||||
color: #909399;
|
||||
|
||||
.el-icon {
|
||||
font-size: 40px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@ -3,119 +3,251 @@
|
||||
{
|
||||
"接口": "user.login",
|
||||
"data": {
|
||||
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywidXNlcm5hbWUiOiJ5am0iLCJyZWFsX25hbWUiOiJ5aW4iLCJwbGF0Zm9ybV9jb2RlIjoid2ViIiwiY3VycmVudF9yb2xlX2lkIjozMSwiY3VycmVudF9zdG9yZV9pZCI6MTAwMDAwLCJpYXQiOjE3NzY1MTQwNDcsImV4cCI6MTc3NjUyODQ0N30.jFWl1I2OOPMTNq1x8LGj6oRzIOrWvZhA2oON2Jd23fU"
|
||||
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywidXNlcm5hbWUiOiJ5am0iLCJyZWFsX25hbWUiOiJ5aW4iLCJwbGF0Zm9ybV9jb2RlIjoid2ViIiwiY3VycmVudF9yb2xlX2lkIjozMSwiY3VycmVudF9zdG9yZV9pZCI6MTAwMDAwLCJpYXQiOjE3NzY1OTIwMzYsImV4cCI6MTc3NjYwNjQzNn0.J360T9CB8fcLMeMguHsVdix1aXI4uGA4RE7PvVAKkxQ"
|
||||
}
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.list",
|
||||
"接口": "index.getPlatformList",
|
||||
"data": [
|
||||
{
|
||||
"code": "1688",
|
||||
"name": "阿里巴巴",
|
||||
"default_express_interface": "cainiao",
|
||||
"value": "1688",
|
||||
"label": "阿里巴巴",
|
||||
"platform_code": "1688",
|
||||
"platform_name": "阿里巴巴",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "DW",
|
||||
"name": "得物",
|
||||
"default_express_interface": "polyapi",
|
||||
"value": "DW",
|
||||
"label": "得物",
|
||||
"platform_code": "DW",
|
||||
"platform_name": "得物",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "DYCS",
|
||||
"name": "抖音超市",
|
||||
"default_express_interface": "polyapi",
|
||||
"value": "DYCS",
|
||||
"label": "抖音超市",
|
||||
"platform_code": "DYCS",
|
||||
"platform_name": "抖音超市",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "DYGX",
|
||||
"name": "抖音供销",
|
||||
"default_express_interface": "polyapi",
|
||||
"value": "DYGX",
|
||||
"label": "抖音供销",
|
||||
"platform_code": "DYGX",
|
||||
"platform_name": "抖音供销",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "DYXD",
|
||||
"name": "抖音小店",
|
||||
"default_express_interface": "polyapi",
|
||||
"value": "DYXD",
|
||||
"label": "抖音小店",
|
||||
"platform_code": "DYXD",
|
||||
"platform_name": "抖音小店",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "JD",
|
||||
"name": "京东",
|
||||
"default_express_interface": "polyapi",
|
||||
"value": "JD",
|
||||
"label": "京东",
|
||||
"platform_code": "JD",
|
||||
"platform_name": "京东",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "KS",
|
||||
"name": "快手",
|
||||
"default_express_interface": "polyapi",
|
||||
"value": "KS",
|
||||
"label": "快手",
|
||||
"platform_code": "KS",
|
||||
"platform_name": "快手",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "MAOCHAO",
|
||||
"name": "天猫超市",
|
||||
"default_express_interface": "cainiao",
|
||||
"value": "MAOCHAO",
|
||||
"label": "天猫超市",
|
||||
"platform_code": "MAOCHAO",
|
||||
"platform_name": "天猫超市",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "OFFLINE",
|
||||
"name": "线下",
|
||||
"default_express_interface": "cainiao",
|
||||
"value": "OFFLINE",
|
||||
"label": "线下",
|
||||
"platform_code": "OFFLINE",
|
||||
"platform_name": "线下",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "OTHER",
|
||||
"name": "其他",
|
||||
"default_express_interface": "cainiao",
|
||||
"value": "OTHER",
|
||||
"label": "其他",
|
||||
"platform_code": "OTHER",
|
||||
"platform_name": "其他",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "PDD",
|
||||
"name": "拼多多",
|
||||
"default_express_interface": "pdd",
|
||||
"value": "PDD",
|
||||
"label": "拼多多",
|
||||
"platform_code": "PDD",
|
||||
"platform_name": "拼多多",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "SPH",
|
||||
"name": "视频号",
|
||||
"default_express_interface": "polyapi",
|
||||
"value": "SPH",
|
||||
"label": "视频号",
|
||||
"platform_code": "SPH",
|
||||
"platform_name": "视频号",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "TB",
|
||||
"name": "淘宝",
|
||||
"default_express_interface": "cainiao",
|
||||
"value": "TB",
|
||||
"label": "淘宝",
|
||||
"platform_code": "TB",
|
||||
"platform_name": "淘宝",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "TGC",
|
||||
"name": "淘工厂",
|
||||
"default_express_interface": "cainiao",
|
||||
"value": "TGC",
|
||||
"label": "淘工厂",
|
||||
"platform_code": "TGC",
|
||||
"platform_name": "淘工厂",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "TM",
|
||||
"name": "天猫",
|
||||
"default_express_interface": "cainiao",
|
||||
"value": "TM",
|
||||
"label": "天猫",
|
||||
"platform_code": "TM",
|
||||
"platform_name": "天猫",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "XHS",
|
||||
"name": "小红书",
|
||||
"default_express_interface": "polyapi",
|
||||
"value": "XHS",
|
||||
"label": "小红书",
|
||||
"platform_code": "XHS",
|
||||
"platform_name": "小红书",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "DY",
|
||||
"name": "DY (抖音小店)",
|
||||
"value": "DY",
|
||||
"label": "DY (抖音小店)",
|
||||
"is_system_setting": true,
|
||||
"id": 2,
|
||||
"alias": "",
|
||||
"platform_code": "DYXD",
|
||||
"platform_name": "抖音小店",
|
||||
"default_express_interface": "polyapi"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"接口": "setting.platform.list",
|
||||
"data": {
|
||||
"list": [
|
||||
{
|
||||
"id": 5,
|
||||
"delivery_order_code": "JY2026041518542-02",
|
||||
"pre_delivery_order_code": "",
|
||||
"pre_delivery_order_id": "",
|
||||
"order_type": "JYCK",
|
||||
"warehouse_code": "100000",
|
||||
"order_flag": "",
|
||||
"source_platform_code": "DYXD",
|
||||
"source_platform_name": "放心购(抖音小店)",
|
||||
"sys_platform_code": "DYXD",
|
||||
"sys_platform_name": "抖音小店",
|
||||
"create_at": "2026-04-15T12:55:36.000Z",
|
||||
"delete_at": null,
|
||||
"updated_at": "2026-04-15T12:58:28.000Z",
|
||||
"place_order_time": "2026-04-15T09:33:23.000Z",
|
||||
"pay_time": "2026-04-15T09:33:23.000Z",
|
||||
"pay_no": "",
|
||||
"service_code": null,
|
||||
"operator_name": "吴",
|
||||
"operate_time": "2026-04-15T12:55:36.000Z",
|
||||
"delivery_time": null,
|
||||
"shop_nick": "欧似",
|
||||
"seller_nick": "吴",
|
||||
"buyer_nick": "12413800000000",
|
||||
"total_amount": "60.00",
|
||||
"item_amount": "60.00",
|
||||
"discount_amount": "0.00",
|
||||
"freight": "0.00",
|
||||
"ar_amount": "0.00",
|
||||
"got_amount": "0.00",
|
||||
"service_fee": null,
|
||||
"logistics_code": "ZTO",
|
||||
"logistics_name": "中通快递",
|
||||
"sys_logistics_code": "ZTO",
|
||||
"sys_logistics_name": "中通快递",
|
||||
"express_code": "",
|
||||
"logistics_area_code": "",
|
||||
"delivery_type": null,
|
||||
"is_urgency": "N",
|
||||
"invoice_flag": "N",
|
||||
"status": "pedding",
|
||||
"name": "124",
|
||||
"zip_code": "",
|
||||
"tel": "",
|
||||
"mobile": "13800000000",
|
||||
"email": "",
|
||||
"country_code": "CN",
|
||||
"province": "广东省",
|
||||
"city": "广州市",
|
||||
"area": "白云区",
|
||||
"town": "黄石街道",
|
||||
"detail_address": "广东省 广州市 白云区 黄石街道 测试地址",
|
||||
"id_type": null,
|
||||
"id_number": null,
|
||||
"oaid": null,
|
||||
"sync_status": "padding",
|
||||
"store_id": 1000000,
|
||||
"id": 3,
|
||||
"code": "OTHER",
|
||||
"name": "线下单(仓管家映射)",
|
||||
"platform_code": "OFFLINE",
|
||||
"warehouse_id": 100000,
|
||||
"from_key": 24869601,
|
||||
"items": "101384+2",
|
||||
"items_count": 1,
|
||||
"items_total": 2,
|
||||
"items_weight": "0.00",
|
||||
"items_hash": "8d32aed5d5711b32e3021855d0107431",
|
||||
"items_crc": 98242157,
|
||||
"wave_id": 0,
|
||||
"post_status": "none",
|
||||
"storage_status": "none",
|
||||
"pick_status": "none",
|
||||
"pack_status": "none",
|
||||
"inspection_status": "fin",
|
||||
"step": 1,
|
||||
"print_status": "none",
|
||||
"claim_status": "none",
|
||||
"outbound_status": "none",
|
||||
"lock_status": "none",
|
||||
"intercept_status": "none",
|
||||
"express_numbers": [],
|
||||
"waybill_codes": []
|
||||
"label": "OTHER (线下)",
|
||||
"platform_name": "线下",
|
||||
"platform_label": "OTHER (线下)",
|
||||
"platform": {
|
||||
"code": "OFFLINE",
|
||||
"name": "线下",
|
||||
"platform_code": "cainiao"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"code": "DY",
|
||||
"name": "抖音(仓管家映射)",
|
||||
"platform_code": "DYXD",
|
||||
"warehouse_id": 100000,
|
||||
"label": "DY (抖音小店)",
|
||||
"platform_name": "抖音小店",
|
||||
"platform_label": "DY (抖音小店)",
|
||||
"platform": {
|
||||
"code": "DYXD",
|
||||
"name": "抖音小店",
|
||||
"platform_code": "polyapi"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"code": "1688",
|
||||
"name": "阿里巴巴",
|
||||
"platform_code": "1688",
|
||||
"warehouse_id": 100000,
|
||||
"label": "1688 (阿里巴巴)",
|
||||
"platform_name": "阿里巴巴",
|
||||
"platform_label": "1688 (阿里巴巴)",
|
||||
"platform": {
|
||||
"code": "1688",
|
||||
"name": "阿里巴巴",
|
||||
"platform_code": "cainiao"
|
||||
}
|
||||
}
|
||||
],
|
||||
"pagination": {
|
||||
"page": 1,
|
||||
"pageSize": 20,
|
||||
"total": 1,
|
||||
"totalPages": 1,
|
||||
"hasPrevious": false,
|
||||
"hasNext": false
|
||||
}
|
||||
"total": 3,
|
||||
"page": 1,
|
||||
"page_size": 20
|
||||
}
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.reverseReviewOrder",
|
||||
"接口": "setting.platform.create",
|
||||
"data": null
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.markPendingOutboundOrder",
|
||||
"接口": "setting.platform.update",
|
||||
"data": null
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.cancelOrder",
|
||||
"data": null
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.allocateExpressCode",
|
||||
"接口": "setting.platform.delete",
|
||||
"data": null
|
||||
}
|
||||
]
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
# 接口
|
||||
|
||||
- 更新时间: 2026-04-18 19:42:37
|
||||
- 更新时间: 2026-04-19 11:10:05
|
||||
- 扫描目录: `src\api`
|
||||
- 模块数: 31
|
||||
- API 文件数: 31
|
||||
- 接口数: 208
|
||||
- 已启用: 191
|
||||
- 模块数: 30
|
||||
- API 文件数: 30
|
||||
- 接口数: 218
|
||||
- 已启用: 201
|
||||
- 占位接口: 2
|
||||
|
||||
## 模块统计
|
||||
@ -14,7 +14,7 @@
|
||||
| --- | ---: | ---: | ---: | ---: |
|
||||
| config | 1 | 1 | 0 | 0 |
|
||||
| dashboard | 1 | 6 | 6 | 0 |
|
||||
| index | 1 | 15 | 13 | 1 |
|
||||
| index | 1 | 16 | 14 | 1 |
|
||||
| order.archiveorder | 1 | 1 | 1 | 0 |
|
||||
| order.deliveryexpectionorder | 1 | 1 | 1 | 0 |
|
||||
| order.deliveryorder | 1 | 1 | 1 | 0 |
|
||||
@ -22,26 +22,25 @@
|
||||
| order.expectionorder | 1 | 1 | 1 | 0 |
|
||||
| order.index | 1 | 4 | 3 | 0 |
|
||||
| order.outboundorder | 1 | 2 | 2 | 0 |
|
||||
| order.pendingorder | 1 | 5 | 5 | 0 |
|
||||
| order.pendingorder | 1 | 6 | 6 | 0 |
|
||||
| order.revieworder | 1 | 2 | 2 | 0 |
|
||||
| order.storageallocation | 1 | 1 | 1 | 0 |
|
||||
| print | 1 | 11 | 11 | 1 |
|
||||
| print | 1 | 13 | 13 | 1 |
|
||||
| printer.station | 1 | 11 | 11 | 0 |
|
||||
| setting.account | 1 | 7 | 7 | 0 |
|
||||
| setting.express | 1 | 6 | 6 | 0 |
|
||||
| setting.expressinterface | 1 | 4 | 4 | 0 |
|
||||
| setting.express | 1 | 7 | 7 | 0 |
|
||||
| setting.expressinterface | 1 | 5 | 5 | 0 |
|
||||
| setting.permission | 1 | 4 | 4 | 0 |
|
||||
| setting.platform | 1 | 4 | 4 | 0 |
|
||||
| setting.platform | 1 | 5 | 5 | 0 |
|
||||
| setting.printtemplate | 1 | 13 | 13 | 0 |
|
||||
| setting.role | 1 | 5 | 5 | 0 |
|
||||
| stock | 1 | 25 | 24 | 0 |
|
||||
| stock | 1 | 26 | 25 | 0 |
|
||||
| storage_receiving | 1 | 18 | 8 | 0 |
|
||||
| storage.entry | 1 | 4 | 4 | 0 |
|
||||
| storage.inventory | 1 | 7 | 6 | 0 |
|
||||
| storage.stockout | 1 | 2 | 2 | 0 |
|
||||
| storage.inventory | 1 | 8 | 7 | 0 |
|
||||
| storage.stockout | 1 | 3 | 3 | 0 |
|
||||
| store | 1 | 6 | 6 | 0 |
|
||||
| storewarehouse.store | 1 | 11 | 11 | 0 |
|
||||
| user | 1 | 8 | 8 | 0 |
|
||||
| user | 1 | 9 | 9 | 0 |
|
||||
| warehouse | 1 | 21 | 20 | 0 |
|
||||
|
||||
## 接口明细
|
||||
@ -69,6 +68,7 @@
|
||||
| index | recognizeLicensePlate | index.recognizeLicensePlate | POST | 否 | 否 | index/index.ts | |
|
||||
| index | ReferenceFile | index.ReferenceFile | POST | 是 | 否 | index/index.ts | |
|
||||
| index | searchSpace | index.searchSpace | POST | 是 | 否 | index/index.ts | |
|
||||
| index | tryAutoTranslateNewKeys | index.tryAutoTranslateNewKeys | POST | 是 | 否 | index/index.ts | |
|
||||
| index | uploadSuccessNotify | index.uploadSuccessNotify | POST | 是 | 否 | index/index.ts | |
|
||||
| order.archiveorder | orderArchiveOrderList | order.archiveOrder.list | POST | 是 | 否 | order.archiveorder/orderarchiveorder.ts | |
|
||||
| order.deliveryexpectionorder | orderDeliveryExpectionOrderList | order.deliveryExpectionOrder.list | POST | 是 | 否 | order.deliveryexpectionorder/orderdeliveryexpectionorder.ts | |
|
||||
@ -82,13 +82,13 @@
|
||||
| order.outboundorder | orderOutboundOrderList | order.outboundOrder.list | POST | 是 | 否 | order.outboundorder/orderoutboundOrder.ts | |
|
||||
| order.outboundorder | orderOutboundOrderManualOutboundOrder | order.outboundOrder.manualOutboundOrder | POST | 是 | 否 | order.outboundorder/orderoutboundOrder.ts | |
|
||||
| order.pendingorder | orderPendingOrderAllocateExpressCode | order.pendingOrder.allocateExpressCode | POST | 是 | 否 | order.pendingorder/orderpendingOrder.ts | |
|
||||
| order.pendingorder | orderPendingOrderAllocateStorage | order.pendingOrder.allocateStorage | POST | 是 | 否 | order.pendingorder/orderpendingOrder.ts | |
|
||||
| order.pendingorder | orderPendingOrderCancelOrder | order.pendingOrder.cancelOrder | POST | 是 | 否 | order.pendingorder/orderpendingOrder.ts | |
|
||||
| order.pendingorder | orderPendingOrderList | order.pendingOrder.list | POST | 是 | 否 | order.pendingorder/orderpendingOrder.ts | |
|
||||
| order.pendingorder | orderPendingOrderMarkPendingOutboundOrder | order.pendingOrder.markPendingOutboundOrder | POST | 是 | 否 | order.pendingorder/orderpendingOrder.ts | |
|
||||
| order.pendingorder | orderPendingOrderReverseReviewOrder | order.pendingOrder.reverseReviewOrder | POST | 是 | 否 | order.pendingorder/orderpendingOrder.ts | |
|
||||
| order.revieworder | orderReviewOrderList | order.reviewOrder.list | POST | 是 | 否 | order.revieworder/orderreviewOrder.ts | |
|
||||
| order.revieworder | orderReviewOrderReviewOrder | order.reviewOrder.reviewOrder | POST | 是 | 否 | order.revieworder/orderreviewOrder.ts | |
|
||||
| order.storageallocation | orderStorageAllocationAllocateStorage | order.storageAllocation.allocateStorage | POST | 是 | 否 | order.storageallocation/orderstorageallocation.ts | |
|
||||
| print | getExpressList | index.getExpressList | POST | 是 | 否 | print/print.ts | |
|
||||
| print | add | print.add | POST | 是 | 否 | print/print.ts | |
|
||||
| print | delItem | print.del | POST | 是 | 否 | print/print.ts | |
|
||||
@ -96,6 +96,8 @@
|
||||
| print | getComputerPrinter | print.getComputerPrinter | POST | 是 | 否 | print/print.ts | |
|
||||
| print | getItem | print.getItem | POST | 是 | 否 | print/print.ts | |
|
||||
| print | getList | print.getList | POST | 是 | 是 | print/print.ts | |
|
||||
| print | getPrintRecordItem | print.getPrintRecordItem | POST | 是 | 否 | print/print.ts | |
|
||||
| print | getPrintResult | print.getPrintResult | POST | 是 | 否 | print/print.ts | |
|
||||
| print | hasName | print.hasName | POST | 是 | 否 | print/print.ts | |
|
||||
| print | savePrinters | print.savePrinters | POST | 是 | 否 | print/print.ts | |
|
||||
| print | sendPrint | print.send | POST | 是 | 否 | print/print.ts | |
|
||||
@ -118,6 +120,7 @@
|
||||
| setting.account | accountResetPassword | setting.account.resetPassword | POST | 是 | 否 | setting.account/account.ts | |
|
||||
| setting.account | unbindWechat | setting.account.unbindWechat | POST | 是 | 否 | setting.account/account.ts | |
|
||||
| setting.account | accountUpdate | setting.account.update | POST | 是 | 否 | setting.account/account.ts | |
|
||||
| setting.express | expressIndexGetExpressList | index.getExpressList | POST | 是 | 否 | setting.express/express.ts | |
|
||||
| setting.express | expressCheckCodeUnique | setting.express.checkCodeUnique | POST | 是 | 否 | setting.express/express.ts | |
|
||||
| setting.express | expressCreate | setting.express.create | POST | 是 | 否 | setting.express/express.ts | |
|
||||
| setting.express | expressDelete | setting.express.delete | POST | 是 | 否 | setting.express/express.ts | |
|
||||
@ -127,11 +130,13 @@
|
||||
| setting.expressinterface | expressInterfaceCreate | setting.expressInterface.create | POST | 是 | 否 | setting.expressinterface/expressInterface.ts | |
|
||||
| setting.expressinterface | expressInterfaceDelete | setting.expressInterface.delete | POST | 是 | 否 | setting.expressinterface/expressInterface.ts | |
|
||||
| setting.expressinterface | expressInterfaceList | setting.expressInterface.list | POST | 是 | 否 | setting.expressinterface/expressInterface.ts | |
|
||||
| setting.expressinterface | expressInterfaceListByWarehousePlatformCode | setting.expressInterface.listByWarehousePlatformCode | POST | 是 | 否 | setting.expressinterface/expressInterface.ts | |
|
||||
| setting.expressinterface | expressInterfaceUpdate | setting.expressInterface.update | POST | 是 | 否 | setting.expressinterface/expressInterface.ts | |
|
||||
| setting.permission | permissionAdd | setting.permission.add | POST | 是 | 否 | setting.permission/permission.ts | |
|
||||
| setting.permission | permissionDelete | setting.permission.delete | POST | 是 | 否 | setting.permission/permission.ts | |
|
||||
| setting.permission | permissionList | setting.permission.list | POST | 是 | 否 | setting.permission/permission.ts | |
|
||||
| setting.permission | permissionUpdate | setting.permission.update | POST | 是 | 否 | setting.permission/permission.ts | |
|
||||
| setting.platform | settingPlatformIndexGetPlatformList | index.getPlatformList | POST | 是 | 否 | setting.platform/platform.ts | |
|
||||
| setting.platform | settingPlatformCreate | setting.platform.create | POST | 是 | 否 | setting.platform/platform.ts | |
|
||||
| setting.platform | settingPlatformDelete | setting.platform.delete | POST | 是 | 否 | setting.platform/platform.ts | |
|
||||
| setting.platform | settingPlatformList | setting.platform.list | POST | 是 | 否 | setting.platform/platform.ts | |
|
||||
@ -154,6 +159,7 @@
|
||||
| setting.role | roleList | setting.role.list | POST | 是 | 否 | setting.role/role.ts | |
|
||||
| setting.role | permissionroleList | setting.role.permission | POST | 是 | 否 | setting.role/role.ts | |
|
||||
| setting.role | roleUpdate | setting.role.update | POST | 是 | 否 | setting.role/role.ts | |
|
||||
| stock | stockStockWarehouse | stock.stockWarehouse | POST | 是 | 否 | stock/stock.ts | |
|
||||
| stock | backData | stock.warehouse.backData | POST | 是 | 否 | stock/stock.ts | |
|
||||
| stock | bindItem | stock.warehouse.bindItem | POST | 是 | 否 | stock/stock.ts | |
|
||||
| stock | checkItemCodeUnique | stock.warehouse.checkItemCodeUnique | POST | 是 | 否 | stock/stock.ts | |
|
||||
@ -204,12 +210,14 @@
|
||||
| storage.inventory | getExpiryList | storage.expiry.list | POST | 是 | 否 | storage.inventory/inventory.ts | |
|
||||
| storage.inventory | getInventoryList | storage.inventory.list | POST | 是 | 否 | storage.inventory/inventory.ts | |
|
||||
| storage.inventory | matchPutaway | storage.inventory.matchPutaway | POST | 是 | 否 | storage.inventory/inventory.ts | |
|
||||
| storage.inventory | quickPutaway | storage.inventory.quickPutaway | POST | 是 | 否 | storage.inventory/inventory.ts | |
|
||||
| storage.inventory | transaction | storage.inventory.transaction | POST | 否 | 否 | storage.inventory/inventory.ts | |
|
||||
| storage.inventory | transferByProduct | storage.inventory.transferByProduct | POST | 是 | 否 | storage.inventory/inventory.ts | |
|
||||
| storage.inventory | transferLocation | storage.inventory.transferLocation | POST | 是 | 否 | storage.inventory/inventory.ts | |
|
||||
| storage.inventory | getTransactionList | storage.transaction.list | POST | 是 | 否 | storage.inventory/inventory.ts | |
|
||||
| storage.stockout | stockoutList | storage.stockout.list | POST | 是 | 否 | storage.stockout/stockout.ts | |
|
||||
| storage.stockout | stockoutListItems | storage.stockout.listItems | POST | 是 | 否 | storage.stockout/stockout.ts | |
|
||||
| storage.stockout | stockoutToOrder | storage.stockout.toOrder | POST | 是 | 否 | storage.stockout/stockout.ts | |
|
||||
| store | auditApply | store.auditApply | POST | 是 | 否 | store/store.ts | |
|
||||
| store | createStore | store.createStore | POST | 是 | 否 | store/store.ts | |
|
||||
| store | createWarehouse | store.createWarehouse | POST | 是 | 否 | store/store.ts | |
|
||||
@ -232,6 +240,7 @@
|
||||
| user | getLoginWechatCode | user.getLoginWechatCode | POST | 是 | 否 | user/user.ts | |
|
||||
| user | getInfo | user.info | POST | 是 | 否 | user/user.ts | |
|
||||
| user | login | user.login | POST | 是 | 否 | user/user.ts | |
|
||||
| user | loginByCode | user.loginByCode | POST | 是 | 否 | user/user.ts | |
|
||||
| user | logout | user.logout | POST | 是 | 否 | user/user.ts | |
|
||||
| user | register | user.register | POST | 是 | 否 | user/user.ts | |
|
||||
| user | unbindWechat | user.unbindWechat | POST | 是 | 否 | user/user.ts | |
|
||||
|
||||
@ -8,29 +8,30 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.list",
|
||||
"method": "index.getPlatformList",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.reverseReviewOrder",
|
||||
"method": "setting.platform.list",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.markPendingOutboundOrder",
|
||||
"method": "setting.platform.create",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.cancelOrder",
|
||||
"method": "setting.platform.update",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.allocateExpressCode",
|
||||
"method": "setting.platform.delete",
|
||||
"body": {}
|
||||
}
|
||||
],
|
||||
"successMessages": [
|
||||
"ok",
|
||||
"成功",
|
||||
"登录成功"
|
||||
"登录成功",
|
||||
"success"
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,96 +1,63 @@
|
||||
{
|
||||
"数据一览": {
|
||||
"当前请求数": 6,
|
||||
"成功数": 2,
|
||||
"成功数": 3,
|
||||
"全部请求数": 6,
|
||||
"成功数与全部请求数": "2/6",
|
||||
"成功数与全部请求数": "3/6",
|
||||
"成功判定名单": [
|
||||
"ok",
|
||||
"成功",
|
||||
"登录成功"
|
||||
"登录成功",
|
||||
"success"
|
||||
],
|
||||
"失败接口": [
|
||||
{
|
||||
"接口": "order.pendingOrder.reverseReviewOrder",
|
||||
"message": "接口错误: 订单ID不能为空",
|
||||
"code": 500,
|
||||
"模块目录": "order.pendingorder",
|
||||
"接口": "setting.platform.create",
|
||||
"message": "code 参数不能为空",
|
||||
"code": 400,
|
||||
"模块目录": "setting.platform",
|
||||
"api封装": [
|
||||
{
|
||||
"文件": "src/api/order.pendingorder/orderpendingOrder.ts",
|
||||
"方法名": "orderPendingOrderReverseReviewOrder"
|
||||
},
|
||||
{
|
||||
"文件": "src/api/order.pendingorder/orderpendingOrder.ts",
|
||||
"方法名": "orderPendingOrder.reverseReviewOrder",
|
||||
"说明": "聚合对象方法"
|
||||
"文件": "src/api/setting.platform/platform.ts",
|
||||
"方法名": "settingPlatformCreate"
|
||||
}
|
||||
],
|
||||
"引用页面": [
|
||||
"src/views/order/orderManagement/pendingOrder.vue"
|
||||
"src/views/system/setting/encoding/components/PlatformCodeManagement.vue"
|
||||
]
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.markPendingOutboundOrder",
|
||||
"message": "接口错误: 待处理出库接口仅支持 ids 数组入参",
|
||||
"code": 500,
|
||||
"模块目录": "order.pendingorder",
|
||||
"接口": "setting.platform.update",
|
||||
"message": "id 参数不能为空",
|
||||
"code": 400,
|
||||
"模块目录": "setting.platform",
|
||||
"api封装": [
|
||||
{
|
||||
"文件": "src/api/order.pendingorder/orderpendingOrder.ts",
|
||||
"方法名": "orderPendingOrderMarkPendingOutboundOrder"
|
||||
},
|
||||
{
|
||||
"文件": "src/api/order.pendingorder/orderpendingOrder.ts",
|
||||
"方法名": "orderPendingOrder.markPendingOutboundOrder",
|
||||
"说明": "聚合对象方法"
|
||||
"文件": "src/api/setting.platform/platform.ts",
|
||||
"方法名": "settingPlatformUpdate"
|
||||
}
|
||||
],
|
||||
"引用页面": [
|
||||
"src/views/order/orderManagement/pendingOrder.vue"
|
||||
"src/views/system/setting/encoding/components/PlatformCodeManagement.vue"
|
||||
]
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.cancelOrder",
|
||||
"message": "接口错误: 待处理取消接口仅支持 ids 数组入参",
|
||||
"code": 500,
|
||||
"模块目录": "order.pendingorder",
|
||||
"接口": "setting.platform.delete",
|
||||
"message": "ids 参数不能为空",
|
||||
"code": 400,
|
||||
"模块目录": "setting.platform",
|
||||
"api封装": [
|
||||
{
|
||||
"文件": "src/api/order.pendingorder/orderpendingOrder.ts",
|
||||
"方法名": "orderPendingOrderCancelOrder"
|
||||
},
|
||||
{
|
||||
"文件": "src/api/order.pendingorder/orderpendingOrder.ts",
|
||||
"方法名": "orderPendingOrder.cancelOrder",
|
||||
"说明": "聚合对象方法"
|
||||
"文件": "src/api/setting.platform/platform.ts",
|
||||
"方法名": "settingPlatformDelete"
|
||||
}
|
||||
],
|
||||
"引用页面": [
|
||||
"src/views/order/orderManagement/pendingOrder.vue"
|
||||
]
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.allocateExpressCode",
|
||||
"message": "接口错误: 分配快递号接口仅支持订单对象数组入参",
|
||||
"code": 500,
|
||||
"模块目录": "order.pendingorder",
|
||||
"api封装": [
|
||||
{
|
||||
"文件": "src/api/order.pendingorder/orderpendingOrder.ts",
|
||||
"方法名": "orderPendingOrderAllocateExpressCode"
|
||||
},
|
||||
{
|
||||
"文件": "src/api/order.pendingorder/orderpendingOrder.ts",
|
||||
"方法名": "orderPendingOrder.allocateExpressCode",
|
||||
"说明": "聚合对象方法"
|
||||
}
|
||||
],
|
||||
"引用页面": [
|
||||
"src/views/order/orderManagement/pendingOrder.vue"
|
||||
"src/views/system/setting/encoding/components/PlatformCodeManagement.vue"
|
||||
]
|
||||
}
|
||||
]
|
||||
],
|
||||
"空数据接口": []
|
||||
},
|
||||
"详情": [
|
||||
{
|
||||
@ -98,129 +65,261 @@
|
||||
"message": "登录成功",
|
||||
"code": 200,
|
||||
"data": {
|
||||
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywidXNlcm5hbWUiOiJ5am0iLCJyZWFsX25hbWUiOiJ5aW4iLCJwbGF0Zm9ybV9jb2RlIjoid2ViIiwiY3VycmVudF9yb2xlX2lkIjozMSwiY3VycmVudF9zdG9yZV9pZCI6MTAwMDAwLCJpYXQiOjE3NzY1MTQwNDcsImV4cCI6MTc3NjUyODQ0N30.jFWl1I2OOPMTNq1x8LGj6oRzIOrWvZhA2oON2Jd23fU"
|
||||
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywidXNlcm5hbWUiOiJ5am0iLCJyZWFsX25hbWUiOiJ5aW4iLCJwbGF0Zm9ybV9jb2RlIjoid2ViIiwiY3VycmVudF9yb2xlX2lkIjozMSwiY3VycmVudF9zdG9yZV9pZCI6MTAwMDAwLCJpYXQiOjE3NzY1OTIwMzYsImV4cCI6MTc3NjYwNjQzNn0.J360T9CB8fcLMeMguHsVdix1aXI4uGA4RE7PvVAKkxQ"
|
||||
}
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.list",
|
||||
"接口": "index.getPlatformList",
|
||||
"message": "ok",
|
||||
"code": 1,
|
||||
"code": 200,
|
||||
"data": [
|
||||
{
|
||||
"code": "1688",
|
||||
"name": "阿里巴巴",
|
||||
"default_express_interface": "cainiao",
|
||||
"value": "1688",
|
||||
"label": "阿里巴巴",
|
||||
"platform_code": "1688",
|
||||
"platform_name": "阿里巴巴",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "DW",
|
||||
"name": "得物",
|
||||
"default_express_interface": "polyapi",
|
||||
"value": "DW",
|
||||
"label": "得物",
|
||||
"platform_code": "DW",
|
||||
"platform_name": "得物",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "DYCS",
|
||||
"name": "抖音超市",
|
||||
"default_express_interface": "polyapi",
|
||||
"value": "DYCS",
|
||||
"label": "抖音超市",
|
||||
"platform_code": "DYCS",
|
||||
"platform_name": "抖音超市",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "DYGX",
|
||||
"name": "抖音供销",
|
||||
"default_express_interface": "polyapi",
|
||||
"value": "DYGX",
|
||||
"label": "抖音供销",
|
||||
"platform_code": "DYGX",
|
||||
"platform_name": "抖音供销",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "DYXD",
|
||||
"name": "抖音小店",
|
||||
"default_express_interface": "polyapi",
|
||||
"value": "DYXD",
|
||||
"label": "抖音小店",
|
||||
"platform_code": "DYXD",
|
||||
"platform_name": "抖音小店",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "JD",
|
||||
"name": "京东",
|
||||
"default_express_interface": "polyapi",
|
||||
"value": "JD",
|
||||
"label": "京东",
|
||||
"platform_code": "JD",
|
||||
"platform_name": "京东",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "KS",
|
||||
"name": "快手",
|
||||
"default_express_interface": "polyapi",
|
||||
"value": "KS",
|
||||
"label": "快手",
|
||||
"platform_code": "KS",
|
||||
"platform_name": "快手",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "MAOCHAO",
|
||||
"name": "天猫超市",
|
||||
"default_express_interface": "cainiao",
|
||||
"value": "MAOCHAO",
|
||||
"label": "天猫超市",
|
||||
"platform_code": "MAOCHAO",
|
||||
"platform_name": "天猫超市",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "OFFLINE",
|
||||
"name": "线下",
|
||||
"default_express_interface": "cainiao",
|
||||
"value": "OFFLINE",
|
||||
"label": "线下",
|
||||
"platform_code": "OFFLINE",
|
||||
"platform_name": "线下",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "OTHER",
|
||||
"name": "其他",
|
||||
"default_express_interface": "cainiao",
|
||||
"value": "OTHER",
|
||||
"label": "其他",
|
||||
"platform_code": "OTHER",
|
||||
"platform_name": "其他",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "PDD",
|
||||
"name": "拼多多",
|
||||
"default_express_interface": "pdd",
|
||||
"value": "PDD",
|
||||
"label": "拼多多",
|
||||
"platform_code": "PDD",
|
||||
"platform_name": "拼多多",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "SPH",
|
||||
"name": "视频号",
|
||||
"default_express_interface": "polyapi",
|
||||
"value": "SPH",
|
||||
"label": "视频号",
|
||||
"platform_code": "SPH",
|
||||
"platform_name": "视频号",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "TB",
|
||||
"name": "淘宝",
|
||||
"default_express_interface": "cainiao",
|
||||
"value": "TB",
|
||||
"label": "淘宝",
|
||||
"platform_code": "TB",
|
||||
"platform_name": "淘宝",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "TGC",
|
||||
"name": "淘工厂",
|
||||
"default_express_interface": "cainiao",
|
||||
"value": "TGC",
|
||||
"label": "淘工厂",
|
||||
"platform_code": "TGC",
|
||||
"platform_name": "淘工厂",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "TM",
|
||||
"name": "天猫",
|
||||
"default_express_interface": "cainiao",
|
||||
"value": "TM",
|
||||
"label": "天猫",
|
||||
"platform_code": "TM",
|
||||
"platform_name": "天猫",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "XHS",
|
||||
"name": "小红书",
|
||||
"default_express_interface": "polyapi",
|
||||
"value": "XHS",
|
||||
"label": "小红书",
|
||||
"platform_code": "XHS",
|
||||
"platform_name": "小红书",
|
||||
"is_system_setting": false
|
||||
},
|
||||
{
|
||||
"code": "DY",
|
||||
"name": "DY (抖音小店)",
|
||||
"value": "DY",
|
||||
"label": "DY (抖音小店)",
|
||||
"is_system_setting": true,
|
||||
"id": 2,
|
||||
"alias": "",
|
||||
"platform_code": "DYXD",
|
||||
"platform_name": "抖音小店",
|
||||
"default_express_interface": "polyapi"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"接口": "setting.platform.list",
|
||||
"message": "ok",
|
||||
"code": 200,
|
||||
"data": {
|
||||
"list": [
|
||||
{
|
||||
"id": 5,
|
||||
"delivery_order_code": "JY2026041518542-02",
|
||||
"pre_delivery_order_code": "",
|
||||
"pre_delivery_order_id": "",
|
||||
"order_type": "JYCK",
|
||||
"warehouse_code": "100000",
|
||||
"order_flag": "",
|
||||
"source_platform_code": "DYXD",
|
||||
"source_platform_name": "放心购(抖音小店)",
|
||||
"sys_platform_code": "DYXD",
|
||||
"sys_platform_name": "抖音小店",
|
||||
"create_at": "2026-04-15T12:55:36.000Z",
|
||||
"delete_at": null,
|
||||
"updated_at": "2026-04-15T12:58:28.000Z",
|
||||
"place_order_time": "2026-04-15T09:33:23.000Z",
|
||||
"pay_time": "2026-04-15T09:33:23.000Z",
|
||||
"pay_no": "",
|
||||
"service_code": null,
|
||||
"operator_name": "吴",
|
||||
"operate_time": "2026-04-15T12:55:36.000Z",
|
||||
"delivery_time": null,
|
||||
"shop_nick": "欧似",
|
||||
"seller_nick": "吴",
|
||||
"buyer_nick": "12413800000000",
|
||||
"total_amount": "60.00",
|
||||
"item_amount": "60.00",
|
||||
"discount_amount": "0.00",
|
||||
"freight": "0.00",
|
||||
"ar_amount": "0.00",
|
||||
"got_amount": "0.00",
|
||||
"service_fee": null,
|
||||
"logistics_code": "ZTO",
|
||||
"logistics_name": "中通快递",
|
||||
"sys_logistics_code": "ZTO",
|
||||
"sys_logistics_name": "中通快递",
|
||||
"express_code": "",
|
||||
"logistics_area_code": "",
|
||||
"delivery_type": null,
|
||||
"is_urgency": "N",
|
||||
"invoice_flag": "N",
|
||||
"status": "pedding",
|
||||
"name": "124",
|
||||
"zip_code": "",
|
||||
"tel": "",
|
||||
"mobile": "13800000000",
|
||||
"email": "",
|
||||
"country_code": "CN",
|
||||
"province": "广东省",
|
||||
"city": "广州市",
|
||||
"area": "白云区",
|
||||
"town": "黄石街道",
|
||||
"detail_address": "广东省 广州市 白云区 黄石街道 测试地址",
|
||||
"id_type": null,
|
||||
"id_number": null,
|
||||
"oaid": null,
|
||||
"sync_status": "padding",
|
||||
"store_id": 1000000,
|
||||
"id": 3,
|
||||
"code": "OTHER",
|
||||
"name": "线下单(仓管家映射)",
|
||||
"platform_code": "OFFLINE",
|
||||
"warehouse_id": 100000,
|
||||
"from_key": 24869601,
|
||||
"items": "101384+2",
|
||||
"items_count": 1,
|
||||
"items_total": 2,
|
||||
"items_weight": "0.00",
|
||||
"items_hash": "8d32aed5d5711b32e3021855d0107431",
|
||||
"items_crc": 98242157,
|
||||
"wave_id": 0,
|
||||
"post_status": "none",
|
||||
"storage_status": "none",
|
||||
"pick_status": "none",
|
||||
"pack_status": "none",
|
||||
"inspection_status": "fin",
|
||||
"step": 1,
|
||||
"print_status": "none",
|
||||
"claim_status": "none",
|
||||
"outbound_status": "none",
|
||||
"lock_status": "none",
|
||||
"intercept_status": "none",
|
||||
"express_numbers": [],
|
||||
"waybill_codes": []
|
||||
"label": "OTHER (线下)",
|
||||
"platform_name": "线下",
|
||||
"platform_label": "OTHER (线下)",
|
||||
"platform": {
|
||||
"code": "OFFLINE",
|
||||
"name": "线下",
|
||||
"platform_code": "cainiao"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"code": "DY",
|
||||
"name": "抖音(仓管家映射)",
|
||||
"platform_code": "DYXD",
|
||||
"warehouse_id": 100000,
|
||||
"label": "DY (抖音小店)",
|
||||
"platform_name": "抖音小店",
|
||||
"platform_label": "DY (抖音小店)",
|
||||
"platform": {
|
||||
"code": "DYXD",
|
||||
"name": "抖音小店",
|
||||
"platform_code": "polyapi"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"code": "1688",
|
||||
"name": "阿里巴巴",
|
||||
"platform_code": "1688",
|
||||
"warehouse_id": 100000,
|
||||
"label": "1688 (阿里巴巴)",
|
||||
"platform_name": "阿里巴巴",
|
||||
"platform_label": "1688 (阿里巴巴)",
|
||||
"platform": {
|
||||
"code": "1688",
|
||||
"name": "阿里巴巴",
|
||||
"platform_code": "cainiao"
|
||||
}
|
||||
}
|
||||
],
|
||||
"pagination": {
|
||||
"page": 1,
|
||||
"pageSize": 20,
|
||||
"total": 1,
|
||||
"totalPages": 1,
|
||||
"hasPrevious": false,
|
||||
"hasNext": false
|
||||
}
|
||||
"total": 3,
|
||||
"page": 1,
|
||||
"page_size": 20
|
||||
}
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.reverseReviewOrder",
|
||||
"message": "接口错误: 订单ID不能为空",
|
||||
"code": 500,
|
||||
"接口": "setting.platform.create",
|
||||
"message": "code 参数不能为空",
|
||||
"code": 400,
|
||||
"data": null
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.markPendingOutboundOrder",
|
||||
"message": "接口错误: 待处理出库接口仅支持 ids 数组入参",
|
||||
"code": 500,
|
||||
"接口": "setting.platform.update",
|
||||
"message": "id 参数不能为空",
|
||||
"code": 400,
|
||||
"data": null
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.cancelOrder",
|
||||
"message": "接口错误: 待处理取消接口仅支持 ids 数组入参",
|
||||
"code": 500,
|
||||
"data": null
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.allocateExpressCode",
|
||||
"message": "接口错误: 分配快递号接口仅支持订单对象数组入参",
|
||||
"code": 500,
|
||||
"接口": "setting.platform.delete",
|
||||
"message": "ids 参数不能为空",
|
||||
"code": 400,
|
||||
"data": null
|
||||
}
|
||||
]
|
||||
|
||||
@ -12,13 +12,173 @@ const MODULE_LIST_FILE = path.join("workflows", "api-doc-system", "data", "modul
|
||||
const CRAWLER_CONFIG = {
|
||||
baseUrl: "http://192.168.11.56:6060/system",
|
||||
version: "1.0",
|
||||
/** 普通抓取:单接口 fetch 上限 */
|
||||
timeoutMs: 20000,
|
||||
/** --quick 全量顺序请求时服务端易排队,单接口默认放宽(可被 config.requestTimeoutMs 覆盖) */
|
||||
quickModeTimeoutMs: 60000,
|
||||
/** 单请求失败(fetch failed / timeout / 5xx)自动重试次数(不含首次) */
|
||||
defaultMaxRetries: 2,
|
||||
quickMaxRetries: 3,
|
||||
/** 连续请求之间的间隔(ms),防止服务端雪崩 */
|
||||
defaultDelayMs: 0,
|
||||
quickDelayMs: 120,
|
||||
/** 重试退避起始时间(ms),指数退避上限 */
|
||||
retryBackoffMsBase: 500,
|
||||
retryBackoffMsMax: 5000,
|
||||
};
|
||||
|
||||
/** @param {number} ms */
|
||||
function clampRequestTimeoutMs(ms) {
|
||||
const n = Math.floor(ms);
|
||||
if (!Number.isFinite(n) || n < 1000) {
|
||||
return CRAWLER_CONFIG.timeoutMs;
|
||||
}
|
||||
return Math.min(n, 900000);
|
||||
}
|
||||
|
||||
/**
|
||||
* apidata/config.json 根级可选 requestTimeoutMs(毫秒)覆盖默认;否则 quick 用 quickModeTimeoutMs。
|
||||
* CLI 的 --timeout=<ms> 优先级最高。
|
||||
* @param {{ rawConfig: object, quickCheck: boolean, cliTimeoutMs?: number | null }} args
|
||||
*/
|
||||
function resolveCrawlTimeoutMs({ rawConfig, quickCheck, cliTimeoutMs = null }) {
|
||||
if (Number.isFinite(cliTimeoutMs) && cliTimeoutMs > 0) {
|
||||
return clampRequestTimeoutMs(cliTimeoutMs);
|
||||
}
|
||||
const fromFile = Number(rawConfig?.requestTimeoutMs);
|
||||
if (Number.isFinite(fromFile) && fromFile > 0) {
|
||||
return clampRequestTimeoutMs(fromFile);
|
||||
}
|
||||
return quickCheck ? CRAWLER_CONFIG.quickModeTimeoutMs : CRAWLER_CONFIG.timeoutMs;
|
||||
}
|
||||
|
||||
/** @param {number} n */
|
||||
function clampNonNegativeInt(n) {
|
||||
const v = Math.floor(Number(n));
|
||||
if (!Number.isFinite(v) || v < 0) {
|
||||
return 0;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {{ rawConfig: object, quickCheck: boolean, cliDelayMs?: number | null }} args
|
||||
*/
|
||||
function resolveRequestDelayMs({ rawConfig, quickCheck, cliDelayMs = null }) {
|
||||
if (Number.isFinite(cliDelayMs) && cliDelayMs >= 0) {
|
||||
return clampNonNegativeInt(cliDelayMs);
|
||||
}
|
||||
const v = Number(rawConfig?.requestDelayMs);
|
||||
if (Number.isFinite(v) && v >= 0) {
|
||||
return clampNonNegativeInt(v);
|
||||
}
|
||||
return quickCheck ? CRAWLER_CONFIG.quickDelayMs : CRAWLER_CONFIG.defaultDelayMs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {{ rawConfig: object, quickCheck: boolean, cliMaxRetries?: number | null }} args
|
||||
*/
|
||||
function resolveMaxRetries({ rawConfig, quickCheck, cliMaxRetries = null }) {
|
||||
if (Number.isFinite(cliMaxRetries) && cliMaxRetries >= 0) {
|
||||
return clampNonNegativeInt(cliMaxRetries);
|
||||
}
|
||||
const v = Number(rawConfig?.maxRetries);
|
||||
if (Number.isFinite(v) && v >= 0) {
|
||||
return clampNonNegativeInt(v);
|
||||
}
|
||||
return quickCheck ? CRAWLER_CONFIG.quickMaxRetries : CRAWLER_CONFIG.defaultMaxRetries;
|
||||
}
|
||||
|
||||
function sleepMs(ms) {
|
||||
if (!Number.isFinite(ms) || ms <= 0) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
return new Promise((r) => setTimeout(r, ms));
|
||||
}
|
||||
|
||||
/** 瞬时网络错误/超时/5xx 视为可重试 */
|
||||
function isRetryableCrawlError(err) {
|
||||
const name = String(err?.name ?? "");
|
||||
const msg = String(err?.message ?? err ?? "");
|
||||
if (name === "TimeoutError" || /timeout/i.test(msg)) {
|
||||
return true;
|
||||
}
|
||||
if (/fetch failed|ECONNRESET|ECONNREFUSED|ETIMEDOUT|EAI_AGAIN|ENOTFOUND|EPIPE|socket hang up/i.test(msg)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isRetryableStatus(status) {
|
||||
return status === 0 || status === 408 || status === 425 || status === 429 || (status >= 500 && status <= 599);
|
||||
}
|
||||
|
||||
function backoffDelayMs(attempt) {
|
||||
const base = CRAWLER_CONFIG.retryBackoffMsBase;
|
||||
const max = CRAWLER_CONFIG.retryBackoffMsMax;
|
||||
const exp = Math.min(max, base * 2 ** attempt);
|
||||
const jitter = Math.floor(Math.random() * Math.min(300, exp));
|
||||
return exp + jitter;
|
||||
}
|
||||
|
||||
/**
|
||||
* 带重试的 crawlApi 封装:捕获网络异常与可重试状态码
|
||||
* @returns {Promise<{ ok: boolean, status: number, response: unknown, error?: string, attempts: number, elapsedMs: number }>}
|
||||
*/
|
||||
async function crawlApiWithRetry({ method, body, token, timeoutMs, maxRetries }) {
|
||||
const started = Date.now();
|
||||
let lastError = null;
|
||||
for (let attempt = 0; attempt <= maxRetries; attempt += 1) {
|
||||
try {
|
||||
const r = await crawlApi({
|
||||
baseUrl: CRAWLER_CONFIG.baseUrl,
|
||||
version: CRAWLER_CONFIG.version,
|
||||
method,
|
||||
body,
|
||||
timeoutMs,
|
||||
token,
|
||||
});
|
||||
if (!r.ok && isRetryableStatus(r.status) && attempt < maxRetries) {
|
||||
await sleepMs(backoffDelayMs(attempt));
|
||||
continue;
|
||||
}
|
||||
return {
|
||||
ok: r.ok,
|
||||
status: r.status,
|
||||
response: r.response,
|
||||
attempts: attempt + 1,
|
||||
elapsedMs: Date.now() - started,
|
||||
};
|
||||
} catch (err) {
|
||||
lastError = err;
|
||||
if (attempt < maxRetries && isRetryableCrawlError(err)) {
|
||||
await sleepMs(backoffDelayMs(attempt));
|
||||
continue;
|
||||
}
|
||||
return {
|
||||
ok: false,
|
||||
status: 0,
|
||||
response: null,
|
||||
error: String(err?.message ?? err),
|
||||
attempts: attempt + 1,
|
||||
elapsedMs: Date.now() - started,
|
||||
};
|
||||
}
|
||||
}
|
||||
return {
|
||||
ok: false,
|
||||
status: 0,
|
||||
response: null,
|
||||
error: String(lastError?.message ?? lastError ?? "unknown"),
|
||||
attempts: maxRetries + 1,
|
||||
elapsedMs: Date.now() - started,
|
||||
};
|
||||
}
|
||||
|
||||
const LOGIN_METHOD = "user.login";
|
||||
|
||||
/** apidata/config.json 未配置 successMessages 时使用;可在 config 中写 successMessages 数组覆盖 */
|
||||
const DEFAULT_SUCCESS_MESSAGES = ["ok", "成功", "登录成功"];
|
||||
const DEFAULT_SUCCESS_MESSAGES = ["ok", "成功", "登录成功",];
|
||||
|
||||
function normalizeSuccessMessageKey(value) {
|
||||
return String(value ?? "")
|
||||
@ -47,6 +207,26 @@ function isResponseMessageOk(message, successMessages) {
|
||||
return allow.has(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功响应中 data 含 list 且列表无元素([] 或 null)时视为「空数据」。
|
||||
* 无 list 字段的接口(如登录)不归入此类。
|
||||
* @param {unknown} data
|
||||
*/
|
||||
function isDataWithEmptyList(data) {
|
||||
if (!data || typeof data !== "object" || Array.isArray(data)) {
|
||||
return false;
|
||||
}
|
||||
const obj = /** @type {Record<string, unknown>} */ (data);
|
||||
if (!Object.prototype.hasOwnProperty.call(obj, "list")) {
|
||||
return false;
|
||||
}
|
||||
const list = obj.list;
|
||||
if (list == null) {
|
||||
return true;
|
||||
}
|
||||
return Array.isArray(list) && list.length === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array<{ 接口: string, message: string, code?: unknown, data: unknown }>} rows
|
||||
* @param {string[]} successMessages
|
||||
@ -56,9 +236,18 @@ function buildDataOverview(rows, successMessages) {
|
||||
let success = 0;
|
||||
/** @type {{ 接口: string, message: string, code: unknown }[]} */
|
||||
const 失败接口 = [];
|
||||
/** @type {{ 接口: string, message: string, code: unknown }[]} */
|
||||
const 空数据接口 = [];
|
||||
for (const row of rows) {
|
||||
if (isResponseMessageOk(row.message, successMessages)) {
|
||||
success += 1;
|
||||
if (isDataWithEmptyList(row.data)) {
|
||||
空数据接口.push({
|
||||
接口: row.接口,
|
||||
message: String(row.message ?? ""),
|
||||
code: row.code ?? null,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
失败接口.push({
|
||||
接口: row.接口,
|
||||
@ -74,6 +263,7 @@ function buildDataOverview(rows, successMessages) {
|
||||
成功数与全部请求数: `${success}/${total}`,
|
||||
成功判定名单: [...successMessages],
|
||||
失败接口,
|
||||
空数据接口,
|
||||
};
|
||||
}
|
||||
|
||||
@ -121,14 +311,20 @@ function normalizeConfig(rawConfig) {
|
||||
|
||||
function printHelp() {
|
||||
console.log(`
|
||||
apidata — 按 config.json 请求远端并写入 apidata/data.json 与 api-doc-agent/config/响应.md(响应.md 仅含各接口 method 与 data)
|
||||
apidata — 按 config.json 请求远端并写入 apidata/data.json;默认同时写入 api-doc-agent/config/响应.md(仅含各接口 method 与 data)。
|
||||
快速检查(--quick)不写入 响应.md,且 data.json 仅含「数据一览」、不含「详情」。
|
||||
|
||||
成功判定: 响应 message 与「成功判定名单」某项在 trim 且英文忽略大小写后一致即成功(默认含 ok、成功、登录成功)。
|
||||
可在 apidata/config.json 根级设置 successMessages 数组覆盖默认名单。
|
||||
可在同文件根级设置 requestTimeoutMs(数字,毫秒)覆盖单次 fetch 超时;未设置时 --quick 默认单接口 ${CRAWLER_CONFIG.quickModeTimeoutMs}ms,普通模式 ${CRAWLER_CONFIG.timeoutMs}ms。
|
||||
|
||||
失败接口: 写入 data.json 时会在每条失败记录上附加「模块目录」(来自 data/module-list/module-list.json)、
|
||||
失败接口: 默认在每条失败记录上附加「模块目录」(来自 data/module-list/module-list.json)、
|
||||
「api封装」(在 src/api 中匹配到的 export)及「引用页面」(扫描 src/views、src/components、src/layout 下 .vue/.ts/.tsx 的引用路径,相对仓库根)。
|
||||
|
||||
空数据接口: message 判定成功且响应 data 中存在 list 字段且为 [] 或 null 的接口,写入「数据一览.空数据接口」,默认附加信息与失败接口相同。
|
||||
|
||||
快速检查(--quick)下:失败/空数据条目仅含 接口、message、文件(api 封装所在文件路径,去重)、引用页面;不含 模块目录、code、api 封装明细等。
|
||||
|
||||
用法:
|
||||
npm run apiconfig:apidata
|
||||
npm run apiconfig:apidata -- [选项] [模块名 ...]
|
||||
@ -136,6 +332,11 @@ apidata — 按 config.json 请求远端并写入 apidata/data.json 与 api-doc-
|
||||
选项:
|
||||
-c, -r, --clear 清空除 ${LOGIN_METHOD} 外的请求项(无模块名时仅保留登录)
|
||||
-n, --no-clear 指定模块时仍保留 config 中其它模块的请求(默认:指定模块时会先清空)
|
||||
-q, --quick 快速检查:自动包含 data/module 下全部模块的接口(等同清空后写入全量),
|
||||
data.json 仅含「数据一览」、不含「详情」;失败/空数据条目仅含 接口、message、文件、引用页面;不写入 响应.md
|
||||
--timeout=<ms> 覆盖单次 fetch 超时;优先级高于 config.requestTimeoutMs
|
||||
--delay=<ms> 请求间隔;优先级高于 config.requestDelayMs(--quick 默认 ${CRAWLER_CONFIG.quickDelayMs}ms)
|
||||
--retries=<n> 单请求失败重试次数(不含首次);优先级高于 config.maxRetries(--quick 默认 ${CRAWLER_CONFIG.quickMaxRetries})
|
||||
-h, --help 显示本说明
|
||||
|
||||
模块名:
|
||||
@ -147,6 +348,8 @@ apidata — 按 config.json 请求远端并写入 apidata/data.json 与 api-doc-
|
||||
npm run apiconfig:apidata -- order.index order.revieworder
|
||||
npm run apiconfig:apidata -- -c
|
||||
npm run apiconfig:apidata -- --no-clear order.index
|
||||
npm run apiconfig:apidata -- --quick
|
||||
npm run apiconfig:apidata:quick
|
||||
`);
|
||||
}
|
||||
|
||||
@ -154,9 +357,20 @@ apidata — 按 config.json 请求远端并写入 apidata/data.json 与 api-doc-
|
||||
* @param {string[]} argv process.argv.slice(2)
|
||||
*/
|
||||
export function parseApidataCli(argv) {
|
||||
const flags = { clear: false, noClear: false, help: false };
|
||||
const flags = { clear: false, noClear: false, help: false, quickCheck: false };
|
||||
/** @type {{ delayMs: number | null, maxRetries: number | null, timeoutMs: number | null }} */
|
||||
const tune = { delayMs: null, maxRetries: null, timeoutMs: null };
|
||||
const positionals = [];
|
||||
|
||||
/** @param {string} raw */
|
||||
const parseIntOpt = (raw) => {
|
||||
const v = Number(raw);
|
||||
if (!Number.isFinite(v) || v < 0) {
|
||||
throw new Error(`无效数值: ${raw}`);
|
||||
}
|
||||
return Math.floor(v);
|
||||
};
|
||||
|
||||
for (const arg of argv) {
|
||||
if (arg === "--") {
|
||||
continue;
|
||||
@ -173,6 +387,22 @@ export function parseApidataCli(argv) {
|
||||
flags.noClear = true;
|
||||
continue;
|
||||
}
|
||||
if (arg === "-q" || arg === "--quick") {
|
||||
flags.quickCheck = true;
|
||||
continue;
|
||||
}
|
||||
if (arg.startsWith("--delay=")) {
|
||||
tune.delayMs = parseIntOpt(arg.slice("--delay=".length));
|
||||
continue;
|
||||
}
|
||||
if (arg.startsWith("--retries=")) {
|
||||
tune.maxRetries = parseIntOpt(arg.slice("--retries=".length));
|
||||
continue;
|
||||
}
|
||||
if (arg.startsWith("--timeout=")) {
|
||||
tune.timeoutMs = parseIntOpt(arg.slice("--timeout=".length));
|
||||
continue;
|
||||
}
|
||||
if (arg.startsWith("-")) {
|
||||
throw new Error(`未知参数: ${arg}(使用 --help 查看说明)`);
|
||||
}
|
||||
@ -182,7 +412,13 @@ export function parseApidataCli(argv) {
|
||||
const modules = positionals.filter(Boolean);
|
||||
let clearOld = false;
|
||||
if (flags.help) {
|
||||
return { flags, modules, clearOld, help: true };
|
||||
return { flags, modules, clearOld, help: true, quickCheck: false, tune };
|
||||
}
|
||||
if (flags.quickCheck && flags.noClear) {
|
||||
throw new Error("快速检查模式(--quick)不能与 --no-clear 同时使用");
|
||||
}
|
||||
if (flags.quickCheck && modules.length > 0) {
|
||||
throw new Error("快速检查模式会自动包含 data/module 下全部模块,请勿再指定模块名");
|
||||
}
|
||||
if (flags.noClear && flags.clear) {
|
||||
throw new Error("不能同时使用 --clear 与 --no-clear");
|
||||
@ -193,7 +429,7 @@ export function parseApidataCli(argv) {
|
||||
clearOld = flags.clear;
|
||||
}
|
||||
|
||||
return { flags, modules, clearOld, help: false };
|
||||
return { flags, modules, clearOld, help: false, quickCheck: flags.quickCheck, tune };
|
||||
}
|
||||
|
||||
async function listModuleFolders() {
|
||||
@ -354,6 +590,11 @@ async function buildAndWriteConfig(opts) {
|
||||
}
|
||||
}
|
||||
|
||||
const prevRt = Number(existingRaw?.requestTimeoutMs);
|
||||
if (Number.isFinite(prevRt) && prevRt > 0) {
|
||||
out.requestTimeoutMs = clampRequestTimeoutMs(prevRt);
|
||||
}
|
||||
|
||||
await writeJson(APIDATA_CONFIG_FILE, out);
|
||||
console.log(`已更新 ${APIDATA_CONFIG_FILE}(共 ${out.requests.length} 条请求)`);
|
||||
return out;
|
||||
@ -713,58 +954,151 @@ async function enrichFailedInterfacesWithUsage(failedList) {
|
||||
return enriched;
|
||||
}
|
||||
|
||||
async function runCrawlFromConfigFile() {
|
||||
/**
|
||||
* 快速检查:失败/空数据条目仅保留 接口、message、文件(api 封装去重后的相对路径)、引用页面
|
||||
* @param {Awaited<ReturnType<typeof enrichFailedInterfacesWithUsage>>[number]} enriched
|
||||
*/
|
||||
function slimUsageRowForQuickCheck(enriched) {
|
||||
const 文件 = [];
|
||||
const seen = new Set();
|
||||
for (const w of enriched.api封装 ?? []) {
|
||||
const f = w?.文件;
|
||||
if (typeof f === "string" && f && !seen.has(f)) {
|
||||
seen.add(f);
|
||||
文件.push(f);
|
||||
}
|
||||
}
|
||||
文件.sort();
|
||||
return {
|
||||
接口: enriched.接口,
|
||||
message: enriched.message,
|
||||
文件,
|
||||
引用页面: Array.isArray(enriched.引用页面) ? [...enriched.引用页面] : [],
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {{ quickCheck?: boolean, tune?: { delayMs?: number | null, maxRetries?: number | null, timeoutMs?: number | null } }} [opts]
|
||||
*/
|
||||
async function runCrawlFromConfigFile(opts = {}) {
|
||||
const { quickCheck = false, tune = {} } = opts;
|
||||
const rawConfig = await readJson(APIDATA_CONFIG_FILE);
|
||||
const successMessages = resolveSuccessMessages(rawConfig);
|
||||
const config = normalizeConfig(rawConfig);
|
||||
const crawlTimeoutMs = resolveCrawlTimeoutMs({
|
||||
rawConfig,
|
||||
quickCheck,
|
||||
cliTimeoutMs: tune.timeoutMs ?? null,
|
||||
});
|
||||
const requestDelayMs = resolveRequestDelayMs({
|
||||
rawConfig,
|
||||
quickCheck,
|
||||
cliDelayMs: tune.delayMs ?? null,
|
||||
});
|
||||
const maxRetries = resolveMaxRetries({
|
||||
rawConfig,
|
||||
quickCheck,
|
||||
cliMaxRetries: tune.maxRetries ?? null,
|
||||
});
|
||||
console.log(
|
||||
`apidata 抓取参数: 超时=${crawlTimeoutMs}ms 间隔=${requestDelayMs}ms 重试=${maxRetries}${quickCheck ? "(快速检查)" : ""}`,
|
||||
);
|
||||
|
||||
const rows = [];
|
||||
let authToken = null;
|
||||
const total = config.requests.length;
|
||||
let idx = 0;
|
||||
const networkErrors = [];
|
||||
|
||||
for (const req of config.requests) {
|
||||
const result = await crawlApi({
|
||||
baseUrl: CRAWLER_CONFIG.baseUrl,
|
||||
version: CRAWLER_CONFIG.version,
|
||||
idx += 1;
|
||||
const isLogin = req.method === LOGIN_METHOD;
|
||||
const result = await crawlApiWithRetry({
|
||||
method: req.method,
|
||||
body: req.body,
|
||||
timeoutMs: CRAWLER_CONFIG.timeoutMs,
|
||||
timeoutMs: crawlTimeoutMs,
|
||||
token: req.needAuth ? authToken : null,
|
||||
maxRetries: isLogin ? Math.max(maxRetries, 1) : maxRetries,
|
||||
});
|
||||
|
||||
if (result.response?.data?.token) {
|
||||
authToken = result.response.data.token;
|
||||
}
|
||||
|
||||
const res = result.response;
|
||||
rows.push({
|
||||
接口: req.method,
|
||||
message: res && typeof res === "object" && !Array.isArray(res) ? String(res.message ?? "") : "",
|
||||
code:
|
||||
res && typeof res === "object" && !Array.isArray(res) && "code" in res ? res.code : null,
|
||||
data: res && typeof res === "object" && !Array.isArray(res) ? res.data ?? null : null,
|
||||
});
|
||||
const isObj = res && typeof res === "object" && !Array.isArray(res);
|
||||
if (isObj && /** @type {{ data?: { token?: unknown } }} */ (res).data?.token) {
|
||||
authToken = /** @type {{ data: { token: string } }} */ (res).data.token;
|
||||
}
|
||||
|
||||
if (result.error) {
|
||||
rows.push({
|
||||
接口: req.method,
|
||||
message: `NETWORK: ${result.error}`,
|
||||
code: null,
|
||||
data: null,
|
||||
});
|
||||
networkErrors.push({ method: req.method, error: result.error, attempts: result.attempts });
|
||||
console.log(
|
||||
` [${idx}/${total}] ${req.method} — 网络失败(重试${result.attempts - 1}次): ${result.error}`,
|
||||
);
|
||||
if (isLogin) {
|
||||
throw new Error(`登录接口 ${LOGIN_METHOD} 多次失败,无法继续鉴权抓取:${result.error}`);
|
||||
}
|
||||
} else {
|
||||
rows.push({
|
||||
接口: req.method,
|
||||
message: isObj ? String(/** @type {{ message?: unknown }} */ (res).message ?? "") : "",
|
||||
code: isObj && "code" in res ? /** @type {{ code?: unknown }} */ (res).code : null,
|
||||
data: isObj ? /** @type {{ data?: unknown }} */ (res).data ?? null : null,
|
||||
});
|
||||
if (quickCheck || result.attempts > 1) {
|
||||
console.log(
|
||||
` [${idx}/${total}] ${req.method} — ${result.elapsedMs}ms${result.attempts > 1 ? `(重试${result.attempts - 1}次)` : ""}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (requestDelayMs > 0 && idx < total) {
|
||||
await sleepMs(requestDelayMs);
|
||||
}
|
||||
}
|
||||
|
||||
const 数据一览 = buildDataOverview(rows, successMessages);
|
||||
数据一览.失败接口 = await enrichFailedInterfacesWithUsage(数据一览.失败接口);
|
||||
const payload = {
|
||||
数据一览,
|
||||
详情: rows,
|
||||
};
|
||||
const failedEnriched = await enrichFailedInterfacesWithUsage(数据一览.失败接口);
|
||||
const emptyEnriched = await enrichFailedInterfacesWithUsage(数据一览.空数据接口);
|
||||
if (quickCheck) {
|
||||
数据一览.失败接口 = failedEnriched.map(slimUsageRowForQuickCheck);
|
||||
数据一览.空数据接口 = emptyEnriched.map(slimUsageRowForQuickCheck);
|
||||
} else {
|
||||
数据一览.失败接口 = failedEnriched;
|
||||
数据一览.空数据接口 = emptyEnriched;
|
||||
}
|
||||
|
||||
const payload = quickCheck ? { 数据一览 } : { 数据一览, 详情: rows };
|
||||
|
||||
await writeJson(APIDATA_DATA_FILE, payload);
|
||||
await mkdir(path.dirname(RESPONSE_MARKDOWN_FILE), { recursive: true });
|
||||
await writeFile(RESPONSE_MARKDOWN_FILE, createResponseMarkdown(rows), "utf8");
|
||||
console.log(`已写入接口响应数据: ${APIDATA_DATA_FILE}`);
|
||||
if (quickCheck) {
|
||||
console.log("快速检查模式:已跳过写入 响应.md");
|
||||
} else {
|
||||
await mkdir(path.dirname(RESPONSE_MARKDOWN_FILE), { recursive: true });
|
||||
await writeFile(RESPONSE_MARKDOWN_FILE, createResponseMarkdown(rows), "utf8");
|
||||
console.log(`已更新响应文档: ${RESPONSE_MARKDOWN_FILE}`);
|
||||
}
|
||||
console.log(
|
||||
`数据一览: 当前请求数=${数据一览.当前请求数} 成功数/全部请求数=${数据一览.成功数与全部请求数} 失败数=${数据一览.失败接口.length}`,
|
||||
`数据一览: 当前请求数=${数据一览.当前请求数} 成功数/全部请求数=${数据一览.成功数与全部请求数} 失败数=${数据一览.失败接口.length} 空数据数=${数据一览.空数据接口.length} 网络错误=${networkErrors.length}`,
|
||||
);
|
||||
if (数据一览.失败接口.length) {
|
||||
for (const item of 数据一览.失败接口) {
|
||||
console.log(` 失败: ${item.接口} — code=${JSON.stringify(item.code)} — ${item.message}`);
|
||||
if (数据一览.空数据接口.length) {
|
||||
for (const item of 数据一览.空数据接口) {
|
||||
const codePart =
|
||||
!quickCheck && "code" in item ? ` — code=${JSON.stringify(/** @type {{ code?: unknown }} */ (item).code)}` : "";
|
||||
console.log(` 空数据: ${item.接口}${codePart} — ${item.message}`);
|
||||
}
|
||||
}
|
||||
if (数据一览.失败接口.length) {
|
||||
for (const item of 数据一览.失败接口) {
|
||||
const codePart =
|
||||
!quickCheck && "code" in item ? ` — code=${JSON.stringify(/** @type {{ code?: unknown }} */ (item).code)}` : "";
|
||||
console.log(` 失败: ${item.接口}${codePart} — ${item.message}`);
|
||||
}
|
||||
}
|
||||
console.log(`已更新响应文档: ${RESPONSE_MARKDOWN_FILE}`);
|
||||
}
|
||||
|
||||
export async function runApidata() {
|
||||
@ -776,7 +1110,18 @@ export async function runApidata() {
|
||||
|
||||
const existingRaw = await readJson(APIDATA_CONFIG_FILE);
|
||||
|
||||
if (cli.modules.length > 0 || cli.clearOld) {
|
||||
if (cli.quickCheck) {
|
||||
const all = (await listModuleFolders()).sort();
|
||||
if (all.length === 0) {
|
||||
throw new Error("快速检查:data/module 下无模块目录");
|
||||
}
|
||||
console.log(`apidata 快速检查:将清空并请求全部模块接口(${all.length} 个模块目录)`);
|
||||
await buildAndWriteConfig({
|
||||
existingRaw,
|
||||
modules: all,
|
||||
clearOld: true,
|
||||
});
|
||||
} else if (cli.modules.length > 0 || cli.clearOld) {
|
||||
console.log(
|
||||
`apidata: clearOld=${cli.clearOld}, modules=[${cli.modules.join(", ")}]`,
|
||||
);
|
||||
@ -787,5 +1132,5 @@ export async function runApidata() {
|
||||
});
|
||||
}
|
||||
|
||||
await runCrawlFromConfigFile();
|
||||
await runCrawlFromConfigFile({ quickCheck: cli.quickCheck, tune: cli.tune });
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -12,63 +12,24 @@
|
||||
"label": "全部"
|
||||
}
|
||||
},
|
||||
"totalInterfaceCount": 185,
|
||||
"totalInterfaceCount": 186,
|
||||
"changes": {
|
||||
"summary": {
|
||||
"moduleAdded": 1,
|
||||
"moduleAdded": 0,
|
||||
"moduleDeleted": 0,
|
||||
"moduleUpdated": 1,
|
||||
"interfaceAdded": 2,
|
||||
"moduleUpdated": 0,
|
||||
"interfaceAdded": 0,
|
||||
"interfaceDeleted": 0,
|
||||
"interfaceParamsUpdated": 0,
|
||||
"interfaceResponseUpdated": 0
|
||||
},
|
||||
"moduleUpdates": {
|
||||
"added": [
|
||||
{
|
||||
"moduleName": "订单储位分配模块",
|
||||
"moduleKey": "order.storageAllocation",
|
||||
"folder": "order.storageallocation",
|
||||
"methods": [
|
||||
"order.storageAllocation.allocateStorage"
|
||||
],
|
||||
"interfaceCount": 1
|
||||
}
|
||||
],
|
||||
"added": [],
|
||||
"deleted": [],
|
||||
"updated": [
|
||||
{
|
||||
"moduleName": "订单待处理模块",
|
||||
"moduleKey": "order.pendingOrder",
|
||||
"folder": "order.pendingorder",
|
||||
"previousModuleName": "订单待处理模块",
|
||||
"previousModuleKey": "order.pendingOrder",
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [
|
||||
"order.pendingOrder.allocateExpressCode"
|
||||
],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
}
|
||||
}
|
||||
]
|
||||
"updated": []
|
||||
},
|
||||
"interfaceUpdates": {
|
||||
"added": [
|
||||
{
|
||||
"moduleName": "订单储位分配模块",
|
||||
"moduleKey": "order.storageAllocation",
|
||||
"folder": "order.storageallocation",
|
||||
"method": "order.storageAllocation.allocateStorage"
|
||||
},
|
||||
{
|
||||
"moduleName": "订单待处理模块",
|
||||
"moduleKey": "order.pendingOrder",
|
||||
"folder": "order.pendingorder",
|
||||
"method": "order.pendingOrder.allocateExpressCode"
|
||||
}
|
||||
],
|
||||
"added": [],
|
||||
"deleted": [],
|
||||
"paramsUpdated": [],
|
||||
"responseUpdated": []
|
||||
@ -1428,6 +1389,69 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "订单待处理模块",
|
||||
"moduleKey": "order.pendingOrder",
|
||||
"moduleFolder": "order.pendingorder",
|
||||
"method": "order.pendingOrder.allocateStorage",
|
||||
"title": "按订单批量分配储位(迁移自 order.storageAllocation.allocateStorage)。只接受订单相关入参,不再接受 warehouse_id / warehouseId,仓库上下文来自当前登录用户。",
|
||||
"description": "按订单批量分配储位(迁移自 order.storageAllocation.allocateStorage)。只接受订单相关入参,不再接受 warehouse_id / warehouseId,仓库上下文来自当前登录用户。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "allow_storage_location / allowStorageLocation / is_allow_storage / isAllowStorage",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "是否允许使用存储储位,支持多种字段别名。"
|
||||
},
|
||||
{
|
||||
"name": "order_ids / orderIds / ids / order_id / orderId / id",
|
||||
"type": "array|string|number",
|
||||
"required": true,
|
||||
"description": "订单 ID 列表,支持数组、逗号分隔字符串或单个 ID(兼容多种别名)。"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "flag",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "全局调用结果标识,成功为 success"
|
||||
},
|
||||
{
|
||||
"name": "code",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "业务状态码,200 表示成功"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "提示信息,成功或部分成功时给出人类可读的摘要。"
|
||||
},
|
||||
{
|
||||
"name": "data",
|
||||
"type": "object",
|
||||
"required": true,
|
||||
"description": "分配结果汇总对象,包含以下字段"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "订单待处理模块",
|
||||
"moduleKey": "order.pendingOrder",
|
||||
@ -1824,75 +1848,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "订单储位分配模块",
|
||||
"moduleKey": "order.storageAllocation",
|
||||
"moduleFolder": "order.storageallocation",
|
||||
"method": "order.storageAllocation.allocateStorage",
|
||||
"title": "按订单批量分配储位:将订单明细按优先级分配到库位并写入 wms_picking,支持存储位优先/分拣位优先策略与部分分配并标记异常。",
|
||||
"description": "按订单批量分配储位:将订单明细按优先级分配到库位并写入 wms_picking,支持存储位优先/分拣位优先策略与部分分配并标记异常。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "allow_storage_location / allowStorageLocation / is_allow_storage / isAllowStorage",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "是否允许使用存储储位,支持多种字段别名。"
|
||||
},
|
||||
{
|
||||
"name": "order_ids / orderIds / ids / order_id / orderId / id",
|
||||
"type": "array|string|number",
|
||||
"required": true,
|
||||
"description": "订单 ID 列表,支持数组、逗号分隔字符串或单个 ID(兼容多种别名)。"
|
||||
},
|
||||
{
|
||||
"name": "warehouse_id / warehouseId",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "仓库 ID(可选),未传时使用当前登录上下文的仓库。"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "flag",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "全局调用结果标识,成功为 success。"
|
||||
},
|
||||
{
|
||||
"name": "code",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "业务状态码,200 表示成功。"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "提示信息,成功或部分成功时给出人类可读的摘要。"
|
||||
},
|
||||
{
|
||||
"name": "data",
|
||||
"type": "object",
|
||||
"required": true,
|
||||
"description": "分配结果汇总对象,包含以下字段"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "打印模块",
|
||||
"moduleKey": "print",
|
||||
@ -3303,6 +3258,51 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "快递接口管理模块",
|
||||
"moduleKey": "setting.expressInterface",
|
||||
"moduleFolder": "setting.expressinterface",
|
||||
"method": "setting.expressInterface.listByWarehousePlatformCode",
|
||||
"title": "按 warehouse_id + platform_code 查询快递接口全字段数组,支持缓存;返回结果按 weight 升序、必要时按 id 升序排序,每条记录显式包含 express_code 以及关联的 express 对象(如 express.id/express.code/express.name/express.platform)。该接口不分页,按 warehouse_id + platform_code 全量返回匹配记录。",
|
||||
"description": "按 warehouse_id + platform_code 查询快递接口全字段数组,支持缓存;返回结果按 weight 升序、必要时按 id 升序排序,每条记录显式包含 express_code 以及关联的 express 对象(如 express.id/express.code/express.name/express.platform)。该接口不分页,按 warehouse_id + platform_code 全量返回匹配记录。",
|
||||
"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 / warehouseId",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "仓库ID;默认使用当前登录主体/仓库上下文(ctx.user.store_id),也支持显式传入以查询指定仓库,文档兼容 warehouse_id 与 warehouseId 两种写法。"
|
||||
},
|
||||
{
|
||||
"name": "platform_code / platformCode",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "平台代码;作为缓存键的一部分,建议使用大写形式(服务端会标准化处理)。"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "list",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "快递接口记录数组(按 warehouse_id + platform_code 全量返回,不分页),每项包含以下字段:"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "快递接口管理模块",
|
||||
"moduleKey": "setting.expressInterface",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -12,64 +12,25 @@
|
||||
"label": "全部"
|
||||
}
|
||||
},
|
||||
"moduleCount": 31,
|
||||
"totalInterfaceCount": 185,
|
||||
"moduleCount": 30,
|
||||
"totalInterfaceCount": 186,
|
||||
"changes": {
|
||||
"summary": {
|
||||
"moduleAdded": 1,
|
||||
"moduleAdded": 0,
|
||||
"moduleDeleted": 0,
|
||||
"moduleUpdated": 1,
|
||||
"interfaceAdded": 2,
|
||||
"moduleUpdated": 0,
|
||||
"interfaceAdded": 0,
|
||||
"interfaceDeleted": 0,
|
||||
"interfaceParamsUpdated": 0,
|
||||
"interfaceResponseUpdated": 0
|
||||
},
|
||||
"moduleUpdates": {
|
||||
"added": [
|
||||
{
|
||||
"moduleName": "订单储位分配模块",
|
||||
"moduleKey": "order.storageAllocation",
|
||||
"folder": "order.storageallocation",
|
||||
"methods": [
|
||||
"order.storageAllocation.allocateStorage"
|
||||
],
|
||||
"interfaceCount": 1
|
||||
}
|
||||
],
|
||||
"added": [],
|
||||
"deleted": [],
|
||||
"updated": [
|
||||
{
|
||||
"moduleName": "订单待处理模块",
|
||||
"moduleKey": "order.pendingOrder",
|
||||
"folder": "order.pendingorder",
|
||||
"previousModuleName": "订单待处理模块",
|
||||
"previousModuleKey": "order.pendingOrder",
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [
|
||||
"order.pendingOrder.allocateExpressCode"
|
||||
],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
}
|
||||
}
|
||||
]
|
||||
"updated": []
|
||||
},
|
||||
"interfaceUpdates": {
|
||||
"added": [
|
||||
{
|
||||
"moduleName": "订单储位分配模块",
|
||||
"moduleKey": "order.storageAllocation",
|
||||
"folder": "order.storageallocation",
|
||||
"method": "order.storageAllocation.allocateStorage"
|
||||
},
|
||||
{
|
||||
"moduleName": "订单待处理模块",
|
||||
"moduleKey": "order.pendingOrder",
|
||||
"folder": "order.pendingorder",
|
||||
"method": "order.pendingOrder.allocateExpressCode"
|
||||
}
|
||||
],
|
||||
"added": [],
|
||||
"deleted": [],
|
||||
"paramsUpdated": [],
|
||||
"responseUpdated": []
|
||||
@ -239,17 +200,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "订单储位分配模块",
|
||||
"moduleKey": "order.storageAllocation",
|
||||
"folder": "order.storageallocation",
|
||||
"interfaceCount": 1,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "order.storageAllocation.allocateStorage"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "订单待出库模块",
|
||||
"moduleKey": "order.outboundOrder",
|
||||
@ -268,7 +218,7 @@
|
||||
"moduleName": "订单待处理模块",
|
||||
"moduleKey": "order.pendingOrder",
|
||||
"folder": "order.pendingorder",
|
||||
"interfaceCount": 5,
|
||||
"interfaceCount": 6,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "order.pendingOrder.list"
|
||||
@ -284,6 +234,9 @@
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.allocateExpressCode"
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.allocateStorage"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -572,11 +525,14 @@
|
||||
"moduleName": "快递接口管理模块",
|
||||
"moduleKey": "setting.expressInterface",
|
||||
"folder": "setting.expressinterface",
|
||||
"interfaceCount": 4,
|
||||
"interfaceCount": 5,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "setting.expressInterface.list"
|
||||
},
|
||||
{
|
||||
"method": "setting.expressInterface.listByWarehousePlatformCode"
|
||||
},
|
||||
{
|
||||
"method": "setting.expressInterface.create"
|
||||
},
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -16,16 +16,14 @@
|
||||
"name": "订单待处理模块",
|
||||
"key": "order.pendingOrder",
|
||||
"folder": "order.pendingorder",
|
||||
"interfaceCount": 5
|
||||
"interfaceCount": 6
|
||||
},
|
||||
"changes": {
|
||||
"fromPreviousSnapshot": {
|
||||
"moduleAdded": false,
|
||||
"moduleRenamed": false,
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [
|
||||
"order.pendingOrder.allocateExpressCode"
|
||||
],
|
||||
"addedMethods": [],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
@ -344,6 +342,66 @@
|
||||
"description": "createWaybillCodePipeline 返回的运单创建结果,包含 success/failed 列表与 summary 等字段"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.allocateStorage",
|
||||
"title": "按订单批量分配储位(迁移自 order.storageAllocation.allocateStorage)。只接受订单相关入参,不再接受 warehouse_id / warehouseId,仓库上下文来自当前登录用户。",
|
||||
"description": "按订单批量分配储位(迁移自 order.storageAllocation.allocateStorage)。只接受订单相关入参,不再接受 warehouse_id / warehouseId,仓库上下文来自当前登录用户。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "allow_storage_location / allowStorageLocation / is_allow_storage / isAllowStorage",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "是否允许使用存储储位,支持多种字段别名。"
|
||||
},
|
||||
{
|
||||
"name": "order_ids / orderIds / ids / order_id / orderId / id",
|
||||
"type": "array|string|number",
|
||||
"required": true,
|
||||
"description": "订单 ID 列表,支持数组、逗号分隔字符串或单个 ID(兼容多种别名)。"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "flag",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "全局调用结果标识,成功为 success"
|
||||
},
|
||||
{
|
||||
"name": "code",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "业务状态码,200 表示成功"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "提示信息,成功或部分成功时给出人类可读的摘要。"
|
||||
},
|
||||
{
|
||||
"name": "data",
|
||||
"type": "object",
|
||||
"required": true,
|
||||
"description": "分配结果汇总对象,包含以下字段"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
{
|
||||
"module": {
|
||||
"name": "订单储位分配模块",
|
||||
"key": "order.storageAllocation",
|
||||
"folder": "order.storageallocation"
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
@ -1,103 +0,0 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
"value": "web",
|
||||
"label": "网页端"
|
||||
},
|
||||
"project": {
|
||||
"value": "all",
|
||||
"label": "全部"
|
||||
}
|
||||
},
|
||||
"module": {
|
||||
"name": "订单储位分配模块",
|
||||
"key": "order.storageAllocation",
|
||||
"folder": "order.storageallocation",
|
||||
"interfaceCount": 1
|
||||
},
|
||||
"changes": {
|
||||
"fromPreviousSnapshot": {
|
||||
"moduleAdded": true,
|
||||
"moduleRenamed": false,
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [
|
||||
"order.storageAllocation.allocateStorage"
|
||||
],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "order.storageAllocation.allocateStorage",
|
||||
"title": "按订单批量分配储位:将订单明细按优先级分配到库位并写入 wms_picking,支持存储位优先/分拣位优先策略与部分分配并标记异常。",
|
||||
"description": "按订单批量分配储位:将订单明细按优先级分配到库位并写入 wms_picking,支持存储位优先/分拣位优先策略与部分分配并标记异常。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "allow_storage_location / allowStorageLocation / is_allow_storage / isAllowStorage",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "是否允许使用存储储位,支持多种字段别名。"
|
||||
},
|
||||
{
|
||||
"name": "order_ids / orderIds / ids / order_id / orderId / id",
|
||||
"type": "array|string|number",
|
||||
"required": true,
|
||||
"description": "订单 ID 列表,支持数组、逗号分隔字符串或单个 ID(兼容多种别名)。"
|
||||
},
|
||||
{
|
||||
"name": "warehouse_id / warehouseId",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "仓库 ID(可选),未传时使用当前登录上下文的仓库。"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "flag",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "全局调用结果标识,成功为 success。"
|
||||
},
|
||||
{
|
||||
"name": "code",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "业务状态码,200 表示成功。"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "提示信息,成功或部分成功时给出人类可读的摘要。"
|
||||
},
|
||||
{
|
||||
"name": "data",
|
||||
"type": "object",
|
||||
"required": true,
|
||||
"description": "分配结果汇总对象,包含以下字段"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 19:37:49",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 20:21:27",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -16,7 +16,7 @@
|
||||
"name": "快递接口管理模块",
|
||||
"key": "setting.expressInterface",
|
||||
"folder": "setting.expressinterface",
|
||||
"interfaceCount": 4
|
||||
"interfaceCount": 5
|
||||
},
|
||||
"changes": {
|
||||
"fromPreviousSnapshot": {
|
||||
@ -91,6 +91,48 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "setting.expressInterface.listByWarehousePlatformCode",
|
||||
"title": "按 warehouse_id + platform_code 查询快递接口全字段数组,支持缓存;返回结果按 weight 升序、必要时按 id 升序排序,每条记录显式包含 express_code 以及关联的 express 对象(如 express.id/express.code/express.name/express.platform)。该接口不分页,按 warehouse_id + platform_code 全量返回匹配记录。",
|
||||
"description": "按 warehouse_id + platform_code 查询快递接口全字段数组,支持缓存;返回结果按 weight 升序、必要时按 id 升序排序,每条记录显式包含 express_code 以及关联的 express 对象(如 express.id/express.code/express.name/express.platform)。该接口不分页,按 warehouse_id + platform_code 全量返回匹配记录。",
|
||||
"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 / warehouseId",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "仓库ID;默认使用当前登录主体/仓库上下文(ctx.user.store_id),也支持显式传入以查询指定仓库,文档兼容 warehouse_id 与 warehouseId 两种写法。"
|
||||
},
|
||||
{
|
||||
"name": "platform_code / platformCode",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "平台代码;作为缓存键的一部分,建议使用大写形式(服务端会标准化处理)。"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "list",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "快递接口记录数组(按 warehouse_id + platform_code 全量返回,不分页),每项包含以下字段:"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "setting.expressInterface.create",
|
||||
"title": "在当前仓库范围内创建快递接口,仅写入已实现字段(见 params),仓库由系统自动填充,禁止传入 warehouse_id/warehouseId。",
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 19:16:50",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"updatedAt": "2026-04-19 09:32:24",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"generatedAt": "2026-04-19 09:32:24",
|
||||
"generatedAtLocal": "2026-04-19 09:32:24",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user