4月18
This commit is contained in:
parent
f1dba6c6ab
commit
14b1476982
BIN
dist.tar.gz
BIN
dist.tar.gz
Binary file not shown.
6
env.d.ts
vendored
6
env.d.ts
vendored
@ -4,9 +4,3 @@ declare module '@/utils/auth' {
|
||||
export function setToken(token: string): void
|
||||
export function removeToken(): void
|
||||
}
|
||||
declare module '@/api/user/user' {
|
||||
export function login(data: any): Promise<any>
|
||||
export function getInfo(data: any): Promise<any>
|
||||
export function changeRole(data: any): Promise<any>
|
||||
export function logout(data: any): Promise<any>
|
||||
}
|
||||
|
||||
@ -16,6 +16,8 @@
|
||||
"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: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",
|
||||
"lint": "eslint . --cache",
|
||||
"lint:fix": "eslint . --cache --fix",
|
||||
|
||||
@ -123,7 +123,7 @@ export function putI18nCollect(data:any){
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function getExpressList(data?: { systemOnly?: boolean }){
|
||||
export function getExpressList(data?: Record<string, unknown>) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -137,7 +137,7 @@ export function getExpressList(data?: { systemOnly?: boolean }){
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function getPlatformList(data?: { systemOnly?: boolean }) {
|
||||
export function getPlatformList(data?: Record<string, unknown>) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -194,3 +194,17 @@ export function searchSpace(data:any){
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function recognizeLicensePlate(data:any){
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'index.recognizeLicensePlate',
|
||||
v: '1.0',
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
39
src/api/order.archiveorder/orderarchiveorder.ts
Normal file
39
src/api/order.archiveorder/orderarchiveorder.ts
Normal file
@ -0,0 +1,39 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
const v = '1.0'
|
||||
|
||||
export type OrderWhere = Record<string, any>
|
||||
export type OrderSort = {
|
||||
sortField?: string
|
||||
sortOrder?: 'asc' | 'desc' | 'ASC' | 'DESC'
|
||||
field?: string
|
||||
order?: 'asc' | 'desc' | 'ASC' | 'DESC'
|
||||
}
|
||||
export type OrderPagination = {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
export type ArchiveOrderListParams = {
|
||||
pagination?: OrderPagination
|
||||
where?: OrderWhere
|
||||
sort?: OrderSort
|
||||
}
|
||||
|
||||
export function orderArchiveOrderList(data: ArchiveOrderListParams = {}): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.archiveOrder.list',
|
||||
v,
|
||||
timestamp: Date.now()
|
||||
},
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
export const orderArchiveOrder = {
|
||||
list: orderArchiveOrderList
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
const v = '1.0'
|
||||
|
||||
export type OrderWhere = Record<string, any>
|
||||
export type OrderSort = {
|
||||
sortField?: string
|
||||
sortOrder?: 'asc' | 'desc' | 'ASC' | 'DESC'
|
||||
field?: string
|
||||
order?: 'asc' | 'desc' | 'ASC' | 'DESC'
|
||||
}
|
||||
export type OrderPagination = {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
export type DeliveryExpectionOrderListParams = {
|
||||
pagination?: OrderPagination
|
||||
where?: OrderWhere
|
||||
sort?: OrderSort
|
||||
}
|
||||
|
||||
export function orderDeliveryExpectionOrderList(data: DeliveryExpectionOrderListParams = {}): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.deliveryExpectionOrder.list',
|
||||
v,
|
||||
timestamp: Date.now()
|
||||
},
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
export const orderDeliveryExpectionOrder = {
|
||||
list: orderDeliveryExpectionOrderList
|
||||
}
|
||||
39
src/api/order.entrustorder/orderentrustorder.ts
Normal file
39
src/api/order.entrustorder/orderentrustorder.ts
Normal file
@ -0,0 +1,39 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
const v = '1.0'
|
||||
|
||||
export type OrderWhere = Record<string, any>
|
||||
export type OrderSort = {
|
||||
sortField?: string
|
||||
sortOrder?: 'asc' | 'desc' | 'ASC' | 'DESC'
|
||||
field?: string
|
||||
order?: 'asc' | 'desc' | 'ASC' | 'DESC'
|
||||
}
|
||||
export type OrderPagination = {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
export type EntrustOrderListParams = {
|
||||
pagination?: OrderPagination
|
||||
where?: OrderWhere
|
||||
sort?: OrderSort
|
||||
}
|
||||
|
||||
export function orderEntrustOrderList(data: EntrustOrderListParams = {}): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.entrustOrder.list',
|
||||
v,
|
||||
timestamp: Date.now()
|
||||
},
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
export const orderEntrustOrder = {
|
||||
list: orderEntrustOrderList
|
||||
}
|
||||
39
src/api/order.expectionorder/orderexpectionorder.ts
Normal file
39
src/api/order.expectionorder/orderexpectionorder.ts
Normal file
@ -0,0 +1,39 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
const v = '1.0'
|
||||
|
||||
export type OrderWhere = Record<string, any>
|
||||
export type OrderSort = {
|
||||
sortField?: string
|
||||
sortOrder?: 'asc' | 'desc' | 'ASC' | 'DESC'
|
||||
field?: string
|
||||
order?: 'asc' | 'desc' | 'ASC' | 'DESC'
|
||||
}
|
||||
export type OrderPagination = {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
export type ExpectionOrderListParams = {
|
||||
pagination?: OrderPagination
|
||||
where?: OrderWhere
|
||||
sort?: OrderSort
|
||||
}
|
||||
|
||||
export function orderExpectionOrderList(data: ExpectionOrderListParams = {}): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.expectionOrder.list',
|
||||
v,
|
||||
timestamp: Date.now()
|
||||
},
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
export const orderExpectionOrder = {
|
||||
list: orderExpectionOrderList
|
||||
}
|
||||
@ -69,8 +69,24 @@ export function orderBadgeCount(): Promise<any> {
|
||||
} as any)
|
||||
}
|
||||
|
||||
/** 订单明细行(历史接口 order.detail,未纳入远端 module 清单) */
|
||||
export function orderDetail(data: Record<string, any> = {}): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.detail',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
export const order = {
|
||||
list: orderList,
|
||||
manualOutboundOrder: orderManualOutboundOrder,
|
||||
badgeCount: orderBadgeCount
|
||||
badgeCount: orderBadgeCount,
|
||||
detail: orderDetail
|
||||
}
|
||||
|
||||
@ -30,6 +30,10 @@ export type PendingOrderReverseReviewParams = {
|
||||
order_id?: number | string
|
||||
}
|
||||
|
||||
export type PendingOrderAllocateExpressCodeParams = {
|
||||
orders: Array<Record<string, any>>
|
||||
}
|
||||
|
||||
export function orderPendingOrderList(data: PendingOrderListParams = {}): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
@ -86,9 +90,26 @@ export function orderPendingOrderCancelOrder(data: PendingOrderIdsParams): Promi
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function orderPendingOrderAllocateExpressCode(
|
||||
data: PendingOrderAllocateExpressCodeParams
|
||||
): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.pendingOrder.allocateExpressCode',
|
||||
v,
|
||||
timestamp: Date.now()
|
||||
},
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
export const orderPendingOrder = {
|
||||
list: orderPendingOrderList,
|
||||
reverseReviewOrder: orderPendingOrderReverseReviewOrder,
|
||||
markPendingOutboundOrder: orderPendingOrderMarkPendingOutboundOrder,
|
||||
cancelOrder: orderPendingOrderCancelOrder
|
||||
cancelOrder: orderPendingOrderCancelOrder,
|
||||
allocateExpressCode: orderPendingOrderAllocateExpressCode
|
||||
}
|
||||
|
||||
39
src/api/order.storageallocation/orderstorageallocation.ts
Normal file
39
src/api/order.storageallocation/orderstorageallocation.ts
Normal file
@ -0,0 +1,39 @@
|
||||
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,132 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
const v = "1.0"
|
||||
|
||||
export const getreviewOrderlist = (data: any): Promise<any> => {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.reviewOrder.getreviewOrderlist',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const reviewOrder = (data: any): Promise<any> => {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.reviewOrder.reviewOrder',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function getdeliveryOrderlist(data: any): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.deliveryOrder.getdeliveryOrderlist',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// export const getdeliveryOrderDetail = (data: any): Promise<any> => {
|
||||
// return request({
|
||||
// url: '/system',
|
||||
// method: 'post',
|
||||
// params: {
|
||||
// method: 'order.deliveryOrder.getdeliveryOrderDetail',
|
||||
// v,
|
||||
// timestamp: new Date().getTime()
|
||||
// },
|
||||
// data: data
|
||||
// })
|
||||
// }
|
||||
|
||||
export const getpendingOrderlist = (data: any): Promise<any> => {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.pendingOrder.getpendingOrderlist',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const getexpectionOrderlist = (data: any): Promise<any> => {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.expectionOrder.getexpectionOrderlist',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const getarchiveOrderlist = (data: any): Promise<any> => {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.archiveOrder.getarchiveOrderlist',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 订单列表接口(接口文档:order.list)
|
||||
export const orderList = (data: any): Promise<any> => {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.list',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询订单详情(接口文档:order.detail)
|
||||
// 已停用:deliveryOrder 页面已改为使用 order.deliveryOrder.list 返回数据进行详情展示,不再依赖该接口。
|
||||
export const orderDetail = (data: any): Promise<any> => {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.detail',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// New APIs from test.txt
|
||||
export const orderReviewList = (data: any): Promise<any> => request({ url: '/system', method: 'post', params: { method: 'order.reviewOrder.list', v: '1.0', timestamp: Date.now() }, data: data });
|
||||
export const orderReviewOrder = (data: any): Promise<any> => request({ url: '/system', method: 'post', params: { method: 'order.reviewOrder.reviewOrder', v: '1.0', timestamp: Date.now() }, data: data });
|
||||
export const orderPendingList = (data: any): Promise<any> => request({ url: '/system', method: 'post', params: { method: 'order.pendingOrder.getpendingOrderlist', v: '1.0', timestamp: Date.now() }, data: data });
|
||||
export const orderExpectionList = (data: any): Promise<any> => request({ url: '/system', method: 'post', params: { method: 'order.expectionOrder.getexpectionOrderlist', v: '1.0', timestamp: Date.now() }, data: data });
|
||||
export const orderEntrustList = (data: any): Promise<any> => request({ url: '/system', method: 'post', params: { method: 'order.entrustOrder.list', v: '1.0', timestamp: Date.now() }, data: data });
|
||||
export const orderDeliveryList = (data: any): Promise<any> => request({ url: '/system', method: 'post', params: { method: 'order.deliveryOrder.list', v: '1.0', timestamp: Date.now() }, data: data });
|
||||
export const orderDeliveryExpectionList = (data: any): Promise<any> => request({ url: '/system', method: 'post', params: { method: 'order.deliveryExpectionOrder.list', v: '1.0', timestamp: Date.now() }, data: data });
|
||||
export const orderArchiveList = (data: any): Promise<any> => request({ url: '/system', method: 'post', params: { method: 'order.archiveOrder.list', v: '1.0', timestamp: Date.now() }, data: data });
|
||||
@ -14,7 +14,8 @@ export function getList(data:any){
|
||||
})
|
||||
}
|
||||
|
||||
export function getItem(id: string) {
|
||||
export function getItem(id: string | number) {
|
||||
const numId = Number(id)
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -23,11 +24,16 @@ export function getItem(id: string) {
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: { id }
|
||||
data: Number.isFinite(numId) ? { id: numId } : { id }
|
||||
})
|
||||
}
|
||||
|
||||
export function add(data: any) {
|
||||
export function add(data: Record<string, unknown>) {
|
||||
const body = { ...data }
|
||||
if (body.computer_id !== undefined && body.computer_id !== null && body.computer_id !== '') {
|
||||
const n = Number(body.computer_id)
|
||||
if (Number.isFinite(n)) body.computer_id = n
|
||||
}
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -36,11 +42,16 @@ export function add(data: any) {
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data
|
||||
data: body
|
||||
})
|
||||
}
|
||||
|
||||
export function hasName(data: any) {
|
||||
export function hasName(data: { name: string; id?: string | number | null }) {
|
||||
const body: Record<string, unknown> = { name: data.name }
|
||||
if (data.id !== undefined && data.id !== null && data.id !== '') {
|
||||
const n = Number(data.id)
|
||||
if (Number.isFinite(n)) body.id = n
|
||||
}
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -49,14 +60,23 @@ export function hasName(data: any) {
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data
|
||||
data: body
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export function updateItem(data: any) {
|
||||
export function updateItem(data: Record<string, unknown>) {
|
||||
const body = { ...data }
|
||||
if (body.id !== undefined && body.id !== null && body.id !== '') {
|
||||
const n = Number(body.id)
|
||||
if (Number.isFinite(n)) body.id = n
|
||||
}
|
||||
if (body.computer_id !== undefined && body.computer_id !== null && body.computer_id !== '') {
|
||||
const n = Number(body.computer_id)
|
||||
if (Number.isFinite(n)) body.computer_id = n
|
||||
}
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -65,17 +85,25 @@ export function updateItem(data: any) {
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data
|
||||
data: body
|
||||
})
|
||||
}
|
||||
|
||||
function normalizeDelIds(ids: unknown[]): number[] {
|
||||
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: [String(idOrPayload)] }
|
||||
payload = { ids: normalizeDelIds([idOrPayload]) }
|
||||
} else if (Array.isArray(idOrPayload)) {
|
||||
payload = { ids: idOrPayload }
|
||||
payload = { ids: normalizeDelIds(idOrPayload) }
|
||||
} else if (idOrPayload && Array.isArray(idOrPayload.ids)) {
|
||||
payload = { ids: normalizeDelIds(idOrPayload.ids) }
|
||||
}
|
||||
|
||||
return request({
|
||||
@ -90,9 +118,9 @@ export function delItem(idOrPayload: any) {
|
||||
})
|
||||
}
|
||||
|
||||
// 批量删除打印台,接受 id 字符串数组
|
||||
export function delItems(ids: string[]) {
|
||||
const payload = { ids: ids.map(String) }
|
||||
// 批量删除打印台,接受 id 数组(与后端约定为数字 id)
|
||||
export function delItems(ids: Array<string | number>) {
|
||||
const payload = { ids: normalizeDelIds(ids) }
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -118,7 +146,7 @@ export function getComputer() {
|
||||
})
|
||||
}
|
||||
|
||||
export function getExpressList(data?: { systemOnly?: boolean }) {
|
||||
export function getExpressList(data?: Record<string, unknown>) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -134,7 +162,8 @@ export function getExpressList(data?: { systemOnly?: boolean }) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getComputerPrinter(id: string) {
|
||||
export function getComputerPrinter(id: string | number) {
|
||||
const numId = Number(id)
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -143,12 +172,24 @@ export function getComputerPrinter(id: string) {
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: { id }
|
||||
data: Number.isFinite(numId) ? { id: numId } : { id }
|
||||
})
|
||||
}
|
||||
|
||||
// 保存打印机与快递绑定关系
|
||||
export function savePrinters(data: any) {
|
||||
// 保存打印机与快递绑定关系(字段名与接口 print.savePrinters 一致)
|
||||
export function savePrinters(data: {
|
||||
defaultPrinter: string
|
||||
express?: Array<Record<string, unknown>>
|
||||
print_station_id?: number
|
||||
}) {
|
||||
const body: Record<string, unknown> = {
|
||||
defaultPrinter: data.defaultPrinter,
|
||||
express: data.express ?? []
|
||||
}
|
||||
if (data.print_station_id !== undefined && data.print_station_id !== null) {
|
||||
const n = Number(data.print_station_id)
|
||||
if (Number.isFinite(n)) body.print_station_id = n
|
||||
}
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
@ -157,7 +198,7 @@ export function savePrinters(data: any) {
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data
|
||||
data: body
|
||||
})
|
||||
}
|
||||
|
||||
@ -174,7 +215,3 @@ export function sendPrint(data: any) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function getStationList(arg0: {}): any {
|
||||
throw new Error('Function not implemented.');
|
||||
}
|
||||
|
||||
@ -66,3 +66,16 @@ export function expressUpdate(data: any) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function expressDelete(data: { ids: number[] | string | number }) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'setting.express.delete',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@ -68,24 +68,6 @@ export function batchCancelReceiving(data: any): Promise<any> {
|
||||
// })
|
||||
// }
|
||||
|
||||
// 发送打印任务
|
||||
// data: { stationId, printerName, templateId, businessType, businessId, printData }
|
||||
// 未使用
|
||||
export function sendPrint(data: any) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'print.send',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function createReceiving(data: any): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,18 @@
|
||||
<template>
|
||||
<section class="app-main">
|
||||
<router-view v-slot="{ Component, route }">
|
||||
<transition name="fade-transform">
|
||||
<keep-alive :include="cachedViews">
|
||||
<component :is="Component" :key="route.fullPath" />
|
||||
</keep-alive>
|
||||
</transition>
|
||||
</router-view>
|
||||
<div class="app-main__body">
|
||||
<router-view v-slot="{ Component, route }">
|
||||
<transition name="fade-transform">
|
||||
<keep-alive :include="cachedViews">
|
||||
<component
|
||||
:is="Component"
|
||||
:key="route.fullPath"
|
||||
class="app-router-page"
|
||||
/>
|
||||
</keep-alive>
|
||||
</transition>
|
||||
</router-view>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@ -20,15 +26,34 @@ const cachedViews = computed(() => tagsViewStore.cachedViews)
|
||||
|
||||
<style scoped>
|
||||
.app-main {
|
||||
/* 90 = navbar + tags-view = 50 + 40 */
|
||||
min-height: calc(100vh - 90px);
|
||||
/* 90 = navbar + tags-view = 50 + 40;与 main-box 联动占满剩余视口高度 */
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.fixed-header+.app-main {
|
||||
.app-main__body {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 路由页根节点占满 app-main 剩余高度;具体布局由各页面根样式决定 */
|
||||
.app-main__body :deep(.app-router-page) {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fixed-header + .app-main {
|
||||
padding-top: 90px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -150,6 +150,8 @@ const handleClickOutside = () => {
|
||||
:deep(.app-main) {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
align-self: stretch;
|
||||
}
|
||||
|
||||
.ai-container {
|
||||
|
||||
@ -6,6 +6,23 @@ import { usePermissionStore } from '@/stores/modules/permission'
|
||||
import { h } from 'vue'
|
||||
import { componentMap } from './map'
|
||||
|
||||
/** 供动态菜单兜底:Vite 不允许 `import(\`@/views/${多段路径}.vue\`)`,用 glob 在构建期收集全部页面 */
|
||||
const viewModules = import.meta.glob('@/views/**/*.vue') as Record<
|
||||
string,
|
||||
() => Promise<{ default: object }>
|
||||
>
|
||||
|
||||
function resolveViewFromGlob(componentPath: string) {
|
||||
let rel = componentPath.replace(/\\/g, '/').trim()
|
||||
if (rel.startsWith('@/views/')) rel = rel.slice('@/views/'.length)
|
||||
if (rel.startsWith('/')) rel = rel.slice(1)
|
||||
if (rel.toLowerCase().endsWith('.vue')) rel = rel.slice(0, -4)
|
||||
|
||||
const target = `/views/${rel}.vue`
|
||||
const key = Object.keys(viewModules).find((k) => k.replace(/\\/g, '/').endsWith(target))
|
||||
return key ? viewModules[key] : undefined
|
||||
}
|
||||
|
||||
/**
|
||||
* 空白父级路由组件
|
||||
*/
|
||||
@ -135,14 +152,22 @@ function resolveComponent(componentPath: string) {
|
||||
return componentMap[componentPath]
|
||||
}
|
||||
|
||||
console.warn(`Component ${componentPath} not found in componentMap, using dynamic import`)
|
||||
|
||||
// 处理常见的目录结构,例如 'warehouse' -> 'warehouse/index.vue'
|
||||
const fromGlob = resolveViewFromGlob(componentPath)
|
||||
if (fromGlob) {
|
||||
return fromGlob
|
||||
}
|
||||
|
||||
console.warn(
|
||||
`Component ${componentPath} not found in componentMap or views glob; check DB component 字段与 map 是否一致`
|
||||
)
|
||||
|
||||
// 处理常见的目录结构,例如 'warehouse' -> 'warehouse/index.vue'(变量仅一段,Vite 可分析)
|
||||
if (!componentPath.includes('/')) {
|
||||
return () => import(`@/views/${componentPath}/index.vue`).catch(() => import(`@/views/${componentPath}.vue`))
|
||||
}
|
||||
|
||||
return () => import(`@/views/${componentPath}.vue`)
|
||||
|
||||
// 多段路径禁止再用模板字符串动态 import,否则生产环境报错 unknown variable dynamic import
|
||||
return () => import('@/views/404.vue')
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -3,11 +3,22 @@
|
||||
|
||||
.main-container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
transition: margin-left .28s;
|
||||
margin-left: $sideBarWidth;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.main-box {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.sidebar-container {
|
||||
transition: width 0.28s;
|
||||
width: $sideBarWidth !important;
|
||||
|
||||
@ -100,7 +100,7 @@ import { ElMessage } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
import { getarchiveOrderlist } from '@/api/order/order'
|
||||
import { orderArchiveOrder } from '@/api/order.archiveorder/orderarchiveorder'
|
||||
|
||||
import {
|
||||
archiveAvailableFields,
|
||||
@ -163,56 +163,63 @@ async function loadData() {
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
try {
|
||||
const params = {
|
||||
page: pagination.currentPage,
|
||||
limit: pagination.pageSize,
|
||||
quickSearch: quickSearch.value,
|
||||
...scanBox.value?.getConditions?.()
|
||||
const where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
const res = await getarchiveOrderlist(params)
|
||||
if (res.code === 200) {
|
||||
list.value = res.data || []
|
||||
pagination.total = res.total || 0
|
||||
const params = {
|
||||
pagination: {
|
||||
page: pagination.currentPage,
|
||||
pageSize: pagination.pageSize
|
||||
},
|
||||
where,
|
||||
sort: {
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC' as const
|
||||
}
|
||||
}
|
||||
const res: any = await orderArchiveOrder.list(params)
|
||||
if (res && (res.code === 200 || res.code === 1)) {
|
||||
const responseData = res.data || {}
|
||||
list.value = responseData.list || []
|
||||
pagination.total = responseData.pagination?.total || responseData.total || (responseData.list ? responseData.list.length : 0)
|
||||
} else {
|
||||
throw new Error(res.msg || '接口返回异常')
|
||||
list.value = []
|
||||
pagination.total = 0
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('加载归档订单失败,使用模拟数据:', e)
|
||||
const mockData = [
|
||||
{
|
||||
id: 21,
|
||||
delivery_order_code: 'JY2026011327233',
|
||||
order_code: 'SO202601130005',
|
||||
order_type: 'JYCK',
|
||||
shop_nick: '火火家de小店',
|
||||
source_platform_name: '拼多多',
|
||||
status: 'finished',
|
||||
name: '刘付明仁',
|
||||
mobile: '18022440198',
|
||||
province: '广东省',
|
||||
city: '广州市',
|
||||
area: '白云区',
|
||||
detail_address: '广东省 广州市 白云区 太和镇 二路32号',
|
||||
logistics_name: '顺丰空运',
|
||||
express_code: 'SF666777888',
|
||||
total_amount: 10.00,
|
||||
item_amount: 10.00,
|
||||
items_count: 1,
|
||||
items_total: 10,
|
||||
create_at: '2026-01-13 15:26:07',
|
||||
updated_at: '2026-01-13 15:40:00',
|
||||
place_order_time: '2026-01-13 15:22:03',
|
||||
pay_time: '2026-01-13 15:22:03'
|
||||
}
|
||||
]
|
||||
list.value = mockData
|
||||
pagination.total = mockData.length
|
||||
list.value = []
|
||||
pagination.total = 0
|
||||
ElMessage.error('获取归档订单列表失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
queryTime.value = Date.now() - start
|
||||
}
|
||||
}
|
||||
|
||||
function buildWhereConditions(rawConditions: Record<string, any>) {
|
||||
const where: Record<string, any> = {}
|
||||
Object.keys(rawConditions || {}).forEach((key) => {
|
||||
const condition = rawConditions[key]
|
||||
if (condition && typeof condition === 'object' && 'operator' in condition) {
|
||||
where[key] = condition
|
||||
return
|
||||
}
|
||||
if (condition !== undefined && condition !== null && condition !== '') {
|
||||
where[key] = {
|
||||
operator: 'eq',
|
||||
value: condition,
|
||||
type: Array.isArray(condition) ? 'array' : typeof condition
|
||||
}
|
||||
}
|
||||
})
|
||||
return where
|
||||
}
|
||||
|
||||
async function loadFilterData() {
|
||||
try {
|
||||
const [storesRes]: any = await Promise.all([
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue'
|
||||
import { getarchiveOrderlist } from '@/api/order/order'
|
||||
import { orderArchiveOrder } from '@/api/order.archiveorder/orderarchiveorder'
|
||||
|
||||
const props = defineProps<{
|
||||
orderId?: number | string | null
|
||||
@ -56,7 +56,7 @@ async function loadArchiveOrders() {
|
||||
}
|
||||
}
|
||||
|
||||
const res = await getarchiveOrderlist({
|
||||
const res = await orderArchiveOrder.list({
|
||||
pagination: {
|
||||
page: 1,
|
||||
pageSize: 20
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { orderOutboundOrder } from '@/api/order.outboundOrder/orderoutboundOrder'
|
||||
import { orderOutboundOrder } from '@/api/order.outboundorder/orderoutboundOrder'
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'success', data: any): void
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, onMounted } from 'vue'
|
||||
import * as orderApi from '@/api/order/order'
|
||||
import * as orderApi from '@/api/order.index/orderindex'
|
||||
|
||||
const props = defineProps<{
|
||||
orderId?: number | string
|
||||
|
||||
@ -100,7 +100,7 @@ import { ElMessage } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
import { getarchiveOrderlist } from '@/api/order/order'
|
||||
import { orderDeliveryExpectionOrder } from '@/api/order.deliveryexpectionorder/orderdeliveryexpectionorder'
|
||||
|
||||
import {
|
||||
archiveAvailableFields,
|
||||
@ -163,49 +163,63 @@ async function loadData() {
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
try {
|
||||
const params = {
|
||||
page: pagination.currentPage,
|
||||
limit: pagination.pageSize,
|
||||
quickSearch: quickSearch.value,
|
||||
...scanBox.value?.getConditions?.()
|
||||
const where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
const res = await getarchiveOrderlist(params)
|
||||
if (res.code === 200) {
|
||||
list.value = res.data || []
|
||||
pagination.total = res.total || 0
|
||||
const params = {
|
||||
pagination: {
|
||||
page: pagination.currentPage,
|
||||
pageSize: pagination.pageSize
|
||||
},
|
||||
where,
|
||||
sort: {
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC' as const
|
||||
}
|
||||
}
|
||||
const res: any = await orderDeliveryExpectionOrder.list(params)
|
||||
if (res && (res.code === 200 || res.code === 1)) {
|
||||
const responseData = res.data || {}
|
||||
list.value = responseData.list || []
|
||||
pagination.total = responseData.pagination?.total || responseData.total || (responseData.list ? responseData.list.length : 0)
|
||||
} else {
|
||||
throw new Error(res.msg || '接口返回异常')
|
||||
list.value = []
|
||||
pagination.total = 0
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('加载配送异常失败,使用模拟数据:', e)
|
||||
const mockData = [
|
||||
{
|
||||
id: 201,
|
||||
delivery_order_code: 'DE20260102001',
|
||||
order_code: 'SO20260102001',
|
||||
shop_nick: '示例店铺',
|
||||
status: 'finished',
|
||||
name: '测试用户',
|
||||
mobile: '13800000001',
|
||||
province: '省份',
|
||||
city: '城市',
|
||||
area: '区县',
|
||||
detail_address: '测试地址',
|
||||
total_amount: 50.00,
|
||||
items_count: 1,
|
||||
items_total: 1,
|
||||
create_at: '2026-01-02 10:00:00',
|
||||
updated_at: '2026-01-02 11:00:00'
|
||||
}
|
||||
]
|
||||
list.value = mockData
|
||||
pagination.total = mockData.length
|
||||
list.value = []
|
||||
pagination.total = 0
|
||||
ElMessage.error('获取配送异常订单列表失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
queryTime.value = Date.now() - start
|
||||
}
|
||||
}
|
||||
|
||||
function buildWhereConditions(rawConditions: Record<string, any>) {
|
||||
const where: Record<string, any> = {}
|
||||
Object.keys(rawConditions || {}).forEach((key) => {
|
||||
const condition = rawConditions[key]
|
||||
if (condition && typeof condition === 'object' && 'operator' in condition) {
|
||||
where[key] = condition
|
||||
return
|
||||
}
|
||||
if (condition !== undefined && condition !== null && condition !== '') {
|
||||
where[key] = {
|
||||
operator: 'eq',
|
||||
value: condition,
|
||||
type: Array.isArray(condition) ? 'array' : typeof condition
|
||||
}
|
||||
}
|
||||
})
|
||||
return where
|
||||
}
|
||||
|
||||
async function loadFilterData() {
|
||||
try {
|
||||
const [storesRes]: any = await Promise.all([
|
||||
|
||||
@ -144,7 +144,7 @@ import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import { orderDeliveryOrder } from '@/api/order.deliveryOrder/orderdeliveryOrder'
|
||||
import { orderDeliveryOrder } from '@/api/order.deliveryorder/orderdeliveryOrder'
|
||||
|
||||
import {
|
||||
deliveryAvailableFields,
|
||||
|
||||
@ -100,7 +100,7 @@ import { ElMessage } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
import { getarchiveOrderlist } from '@/api/order/order'
|
||||
import { orderEntrustOrder } from '@/api/order.entrustorder/orderentrustorder'
|
||||
|
||||
import {
|
||||
archiveAvailableFields,
|
||||
@ -163,49 +163,63 @@ async function loadData() {
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
try {
|
||||
const params = {
|
||||
page: pagination.currentPage,
|
||||
limit: pagination.pageSize,
|
||||
quickSearch: quickSearch.value,
|
||||
...scanBox.value?.getConditions?.()
|
||||
const where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
const res = await getarchiveOrderlist(params)
|
||||
if (res.code === 200) {
|
||||
list.value = res.data || []
|
||||
pagination.total = res.total || 0
|
||||
const params = {
|
||||
pagination: {
|
||||
page: pagination.currentPage,
|
||||
pageSize: pagination.pageSize
|
||||
},
|
||||
where,
|
||||
sort: {
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC' as const
|
||||
}
|
||||
}
|
||||
const res: any = await orderEntrustOrder.list(params)
|
||||
if (res && (res.code === 200 || res.code === 1)) {
|
||||
const responseData = res.data || {}
|
||||
list.value = responseData.list || []
|
||||
pagination.total = responseData.pagination?.total || responseData.total || (responseData.list ? responseData.list.length : 0)
|
||||
} else {
|
||||
throw new Error(res.msg || '接口返回异常')
|
||||
list.value = []
|
||||
pagination.total = 0
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('加载委托外仓失败,使用模拟数据:', e)
|
||||
const mockData = [
|
||||
{
|
||||
id: 101,
|
||||
delivery_order_code: 'EW20260101001',
|
||||
order_code: 'SO20260101001',
|
||||
shop_nick: '示例店铺',
|
||||
status: 'finished',
|
||||
name: '测试用户',
|
||||
mobile: '13800000000',
|
||||
province: '省份',
|
||||
city: '城市',
|
||||
area: '区县',
|
||||
detail_address: '测试地址',
|
||||
total_amount: 100.00,
|
||||
items_count: 2,
|
||||
items_total: 3,
|
||||
create_at: '2026-01-01 10:00:00',
|
||||
updated_at: '2026-01-02 11:00:00'
|
||||
}
|
||||
]
|
||||
list.value = mockData
|
||||
pagination.total = mockData.length
|
||||
list.value = []
|
||||
pagination.total = 0
|
||||
ElMessage.error('获取委托外仓订单列表失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
queryTime.value = Date.now() - start
|
||||
}
|
||||
}
|
||||
|
||||
function buildWhereConditions(rawConditions: Record<string, any>) {
|
||||
const where: Record<string, any> = {}
|
||||
Object.keys(rawConditions || {}).forEach((key) => {
|
||||
const condition = rawConditions[key]
|
||||
if (condition && typeof condition === 'object' && 'operator' in condition) {
|
||||
where[key] = condition
|
||||
return
|
||||
}
|
||||
if (condition !== undefined && condition !== null && condition !== '') {
|
||||
where[key] = {
|
||||
operator: 'eq',
|
||||
value: condition,
|
||||
type: Array.isArray(condition) ? 'array' : typeof condition
|
||||
}
|
||||
}
|
||||
})
|
||||
return where
|
||||
}
|
||||
|
||||
async function loadFilterData() {
|
||||
try {
|
||||
const [storesRes]: any = await Promise.all([
|
||||
|
||||
@ -137,7 +137,7 @@ import { ArrowDown } from '@element-plus/icons-vue'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
import { getexpectionOrderlist } from '@/api/order/order'
|
||||
import { orderExpectionOrder } from '@/api/order.expectionorder/orderexpectionorder'
|
||||
|
||||
import {
|
||||
expectionColumns,
|
||||
@ -201,89 +201,63 @@ async function loadData() {
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
try {
|
||||
const params = {
|
||||
page: pagination.currentPage,
|
||||
limit: pagination.pageSize,
|
||||
quickSearch: quickSearch.value,
|
||||
...scanBox.value?.getConditions?.()
|
||||
const where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
const res = await getexpectionOrderlist(params)
|
||||
if (res.code === 200) {
|
||||
list.value = res.data || []
|
||||
pagination.total = res.total || 0
|
||||
const params = {
|
||||
pagination: {
|
||||
page: pagination.currentPage,
|
||||
pageSize: pagination.pageSize
|
||||
},
|
||||
where,
|
||||
sort: {
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC' as const
|
||||
}
|
||||
}
|
||||
const res: any = await orderExpectionOrder.list(params)
|
||||
if (res && (res.code === 200 || res.code === 1)) {
|
||||
const responseData = res.data || {}
|
||||
list.value = responseData.list || []
|
||||
pagination.total = responseData.pagination?.total || responseData.total || (responseData.list ? responseData.list.length : 0)
|
||||
} else {
|
||||
throw new Error(res.msg || '接口返回异常')
|
||||
list.value = []
|
||||
pagination.total = 0
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('加载异常订单失败,使用模拟数据:', e)
|
||||
const mockData = [
|
||||
{
|
||||
id: 14,
|
||||
store_id: '1000016',
|
||||
logistics_name: '顺丰',
|
||||
pre_delivery_order_code: 'PDO202601130001',
|
||||
create_at: '2026-01-13 14:17:35',
|
||||
status: 'pedding',
|
||||
delivery_order_code: '2885-831',
|
||||
order_code: 'SO202601130001',
|
||||
order_type: 'JYCK',
|
||||
shop_nick: '线下店铺',
|
||||
source_platform_name: '线下',
|
||||
intercept_status: 'none',
|
||||
lock_status: 'none',
|
||||
sync_status: 'padding',
|
||||
post_status: 'none',
|
||||
name: '刘付明仁',
|
||||
mobile: '18022440198',
|
||||
province: '广东省',
|
||||
city: '广州市',
|
||||
area: '白云区',
|
||||
detail_address: '钟落潭良沙二路32号',
|
||||
express_code: 'SF123456789',
|
||||
items_count: 1,
|
||||
items_total: 5,
|
||||
items_weight: 0.00,
|
||||
updated_at: '2026-01-13 14:17:35',
|
||||
place_order_time: '2026-01-13 13:37:42'
|
||||
},
|
||||
{
|
||||
id: 29,
|
||||
store_id: '1000017',
|
||||
logistics_name: 'YTO',
|
||||
pre_delivery_order_code: 'PDO202601200001',
|
||||
create_at: '2026-01-20 13:02:59',
|
||||
status: 'pedding',
|
||||
delivery_order_code: 'CK26012000894',
|
||||
order_code: 'SO202601200001',
|
||||
order_type: 'JYCK',
|
||||
shop_nick: 'af69a68',
|
||||
source_platform_name: '线下',
|
||||
intercept_status: 'none',
|
||||
lock_status: 'none',
|
||||
sync_status: 'padding',
|
||||
post_status: 'none',
|
||||
name: '肖宇玄',
|
||||
mobile: '18727038559',
|
||||
province: '北京',
|
||||
city: '北京市',
|
||||
area: '西城区',
|
||||
detail_address: '湖北省襄阳市宏泰越秀星汇城',
|
||||
express_code: 'YTO99887766',
|
||||
items_count: 2,
|
||||
items_total: 101,
|
||||
items_weight: 2.00,
|
||||
updated_at: '2026-01-20 13:11:33',
|
||||
place_order_time: '2026-01-20 13:02:59'
|
||||
}
|
||||
]
|
||||
list.value = mockData
|
||||
pagination.total = mockData.length
|
||||
list.value = []
|
||||
pagination.total = 0
|
||||
ElMessage.error('获取待处理异常订单列表失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
queryTime.value = Date.now() - start
|
||||
}
|
||||
}
|
||||
|
||||
function buildWhereConditions(rawConditions: Record<string, any>) {
|
||||
const where: Record<string, any> = {}
|
||||
Object.keys(rawConditions || {}).forEach((key) => {
|
||||
const condition = rawConditions[key]
|
||||
if (condition && typeof condition === 'object' && 'operator' in condition) {
|
||||
where[key] = condition
|
||||
return
|
||||
}
|
||||
if (condition !== undefined && condition !== null && condition !== '') {
|
||||
where[key] = {
|
||||
operator: 'eq',
|
||||
value: condition,
|
||||
type: Array.isArray(condition) ? 'array' : typeof condition
|
||||
}
|
||||
}
|
||||
})
|
||||
return where
|
||||
}
|
||||
|
||||
async function loadFilterData() {
|
||||
try {
|
||||
const [storesRes]: any = await Promise.all([
|
||||
|
||||
@ -90,18 +90,18 @@ const tabs = ref<OrderTabItem[]>([
|
||||
count: 10,
|
||||
component: PendingOrder
|
||||
},
|
||||
{
|
||||
name: 'outboundOrder',
|
||||
label: '待出库订单',
|
||||
count: 0,
|
||||
component: OutboundOrder
|
||||
},
|
||||
{
|
||||
name: 'exceptionOrder',
|
||||
label: '待处理异常订单',
|
||||
count: 3,
|
||||
component: ExceptionOrder
|
||||
},
|
||||
{
|
||||
name: 'outboundOrder',
|
||||
label: '待出库订单',
|
||||
count: 0,
|
||||
component: OutboundOrder
|
||||
},
|
||||
{
|
||||
name: 'entrustWarehouse',
|
||||
label: '委托外仓订单',
|
||||
|
||||
@ -148,7 +148,7 @@ import { computed, nextTick, onMounted, reactive, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import { orderOutboundOrder } from '@/api/order.outboundOrder/orderoutboundOrder'
|
||||
import { orderOutboundOrder } from '@/api/order.outboundorder/orderoutboundOrder'
|
||||
import {
|
||||
outboundAvailableFields,
|
||||
outboundColumns,
|
||||
|
||||
@ -19,6 +19,25 @@
|
||||
<el-button size="small" :loading="exportLoading" @click="handleExport">导出</el-button>
|
||||
<el-button size="small" :disabled="!hasSelection" :loading="actionLoading" @click="handleReverseReview">反审回待审核</el-button>
|
||||
<el-button size="small" type="warning" :disabled="!hasSelection" :loading="actionLoading" @click="handleMarkPendingOutbound">标记待出库</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>
|
||||
<el-button size="small" type="danger" :disabled="!hasSelection" :loading="actionLoading" @click="handleCancelOrder">取消订单</el-button>
|
||||
</div>
|
||||
|
||||
@ -136,6 +155,75 @@
|
||||
<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-alert
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
class="allocate-tip"
|
||||
title="接口说明"
|
||||
description="对应 order.storageAllocation.allocateStorage:将选中订单 ID 批量参与储位分配(写入拣货等)。可选「允许使用存储储位」与「仓库 ID」;仓库 ID 留空则使用当前登录上下文。"
|
||||
/> -->
|
||||
<el-form label-width="140px" class="storage-allocate-form">
|
||||
<el-form-item label="已选订单数">
|
||||
<span>{{ storagePendingOrderIds.length }} 条</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单 ID 预览">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
readonly
|
||||
:model-value="storageIdsPreview"
|
||||
/>
|
||||
</el-form-item>
|
||||
<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>
|
||||
<el-button type="primary" :loading="storageAllocateLoading" @click="submitStorageAllocate">
|
||||
开始分配
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -145,7 +233,8 @@ import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import { orderPendingOrder } from '@/api/order.pendingOrder/orderpendingOrder'
|
||||
import { orderPendingOrder } from '@/api/order.pendingorder/orderpendingOrder'
|
||||
import { orderStorageAllocation } from '@/api/order.storageallocation/orderstorageallocation'
|
||||
|
||||
import {
|
||||
pendingCloums,
|
||||
@ -169,6 +258,8 @@ const list = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const actionLoading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const allocateLoading = ref(false)
|
||||
const storageAllocateLoading = ref(false)
|
||||
const queryTime = ref(0)
|
||||
|
||||
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
@ -182,6 +273,28 @@ const selectedOrderId = ref<number | string | null>(null)
|
||||
|
||||
const quickSearch = ref('')
|
||||
|
||||
const allocateDialogVisible = ref(false)
|
||||
/** 打开分配弹窗时勾选的订单行快照(用于提交,避免弹窗期间勾选变化) */
|
||||
const allocatePendingRows = ref<any[]>([])
|
||||
|
||||
const storageDialogVisible = ref(false)
|
||||
/** 打开储位弹窗时快照的订单 ID,避免提交前勾选变化 */
|
||||
const storagePendingOrderIds = ref<Array<number | string>>([])
|
||||
const storageForm = reactive<{
|
||||
allowStorageLocation: boolean
|
||||
warehouseId: number | undefined
|
||||
}>({
|
||||
allowStorageLocation: true,
|
||||
warehouseId: undefined
|
||||
})
|
||||
|
||||
const storageIdsPreview = computed(() => {
|
||||
const ids = storagePendingOrderIds.value
|
||||
if (!ids.length) return ''
|
||||
const text = ids.join(', ')
|
||||
return text.length > 500 ? `${text.slice(0, 500)}…` : text
|
||||
})
|
||||
|
||||
const selectedRow = computed(() => {
|
||||
return list.value.find((i: any) => i.id === selectedOrderId.value) || null
|
||||
})
|
||||
@ -322,6 +435,83 @@ 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('请先勾选需要分配储位的订单')
|
||||
return
|
||||
}
|
||||
const ids = getSelectedIds()
|
||||
if (!ids.length) {
|
||||
ElMessage.error('选中行缺少订单 id,请刷新后重试')
|
||||
return
|
||||
}
|
||||
storagePendingOrderIds.value = [...ids]
|
||||
storageForm.allowStorageLocation = true
|
||||
storageForm.warehouseId = inferWarehouseIdFromSelection(selectionRows.value)
|
||||
storageDialogVisible.value = true
|
||||
}
|
||||
|
||||
function resetStorageAllocateDialog() {
|
||||
storagePendingOrderIds.value = []
|
||||
storageForm.allowStorageLocation = true
|
||||
storageForm.warehouseId = undefined
|
||||
}
|
||||
|
||||
async function submitStorageAllocate() {
|
||||
const orderIds = storagePendingOrderIds.value
|
||||
if (!orderIds.length || storageAllocateLoading.value) return
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`确定对 ${orderIds.length} 条订单发起储位分配吗?`,
|
||||
'确认',
|
||||
{ type: 'warning' }
|
||||
)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
storageAllocateLoading.value = true
|
||||
try {
|
||||
const payload: Record<string, any> = {
|
||||
orderIds,
|
||||
allowStorageLocation: storageForm.allowStorageLocation
|
||||
}
|
||||
if (storageForm.warehouseId != null && Number.isFinite(Number(storageForm.warehouseId))) {
|
||||
payload.warehouseId = Number(storageForm.warehouseId)
|
||||
}
|
||||
const res = await orderStorageAllocation.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
|
||||
}
|
||||
}
|
||||
|
||||
async function callAction(
|
||||
title: string,
|
||||
action: () => Promise<any>,
|
||||
@ -386,9 +576,131 @@ async function handleCancelOrder() {
|
||||
await callAction('取消订单', () => orderPendingOrder.cancelOrder({ ids }), '取消订单成功')
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单 express_numbers(已占用的运单序号数组)计算下一批可用的 business_key。
|
||||
* - express_numbers 为已分配过的序号集合;可用序号取从 1 开始的最小未占用正整数。
|
||||
* - count 指本次要新分配的运单数(默认 1,拆单场景可 >1)。
|
||||
*/
|
||||
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
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@use "./styles/order-sub.scss";
|
||||
|
||||
.allocate-tip {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.allocate-confirm-text {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.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>
|
||||
|
||||
|
||||
@ -122,7 +122,7 @@ import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import { orderReviewOrder } from '@/api/order.reviewOrder/orderreviewOrder'
|
||||
import { orderReviewOrder } from '@/api/order.revieworder/orderreviewOrder'
|
||||
|
||||
import {
|
||||
reviewAvailableFields,
|
||||
|
||||
@ -265,7 +265,7 @@ import {
|
||||
addReceivingFields
|
||||
} from './receiving-config'
|
||||
import * as printerApi from '@/api/printer.station/printerstation'
|
||||
import * as templateApi from '@/api/setting.printTemplate/printTemplate'
|
||||
import * as templateApi from '@/api/setting.printtemplate/printTemplate'
|
||||
import * as stationApi from '@/api/print/print'
|
||||
import JsBarcode from 'jsbarcode'
|
||||
import * as XLSX from 'xlsx'
|
||||
|
||||
@ -732,7 +732,7 @@
|
||||
import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Search, Plus, Refresh, QuestionFilled } from '@element-plus/icons-vue'
|
||||
import { storeWarehouseList, storeWarehouseSign, storeWarehouseUnbind, storeWarehouseRename, storeWarehouseGetPolicyConfig, storeWarehouseGetPolicyConfigFields, storeWarehouseSavePolicyConfig, saveApiConfig, storeWarehouseDeleteQimenConfig, storeWarehouseAdjustPrintQuantity, listApiConfig } from '@/api/storeWarehouse.store/storeWarehouse'
|
||||
import { storeWarehouseList, storeWarehouseSign, storeWarehouseUnbind, storeWarehouseRename, storeWarehouseGetPolicyConfig, storeWarehouseGetPolicyConfigFields, storeWarehouseSavePolicyConfig, saveApiConfig, storeWarehouseDeleteQimenConfig, storeWarehouseAdjustPrintQuantity, listApiConfig } from '@/api/storewarehouse.store/storeWarehouse'
|
||||
import { listInterfaceTypes } from '@/api/index/index'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
|
||||
@ -28,10 +28,9 @@
|
||||
row-key="id"
|
||||
>
|
||||
<el-table-column prop="id" label="ID" width="80" />
|
||||
<el-table-column prop="platform_code" label="平台编码" min-width="120" />
|
||||
<el-table-column prop="label" label="显示标签" min-width="180" />
|
||||
<el-table-column prop="platform_name" label="平台名称" min-width="160" />
|
||||
<el-table-column prop="code" label="业务编码" min-width="140" />
|
||||
<el-table-column prop="label" label="显示标签" min-width="180" />
|
||||
<el-table-column prop="name" label="业务名称" min-width="180" />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
|
||||
@ -1,21 +1,26 @@
|
||||
<template>
|
||||
<div class="express-interface-page">
|
||||
<section class="page-header">
|
||||
<div class="header-main">
|
||||
<h3 class="page-title">快递接口配置</h3>
|
||||
<span class="page-subtitle">按仓库维度维护快递渠道参数</span>
|
||||
<header class="page-hero">
|
||||
<div class="hero-leading">
|
||||
<!-- <span class="hero-icon" aria-hidden="true">
|
||||
<el-icon><Connection /></el-icon>
|
||||
</span> -->
|
||||
<!-- <div class="hero-text">
|
||||
<h1 class="page-title">快递接口配置</h1>
|
||||
<p class="page-subtitle">按仓库维度维护快递渠道参数</p>
|
||||
</div> -->
|
||||
</div>
|
||||
<el-tag type="info" effect="plain">共 {{ total }} 条</el-tag>
|
||||
</section>
|
||||
<!-- <el-tag class="hero-stat" type="primary" effect="plain" round>共 {{ total }} 条</el-tag> -->
|
||||
</header>
|
||||
|
||||
<section class="filter-card">
|
||||
<div class="toolbar">
|
||||
<section class="main-panel">
|
||||
<div class="panel-toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-input
|
||||
v-model="query.keyword"
|
||||
clearable
|
||||
class="search-input"
|
||||
placeholder="搜索名称/快递编码/平台编码"
|
||||
placeholder="搜索名称 / 快递编码 / 平台编码"
|
||||
@keyup.enter="handleSearch"
|
||||
@clear="handleSearch"
|
||||
/>
|
||||
@ -24,29 +29,27 @@
|
||||
</div>
|
||||
<el-button type="success" size="small" @click="openCreate">新增接口配置</el-button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="table-card">
|
||||
<div class="table-wrapper">
|
||||
<el-table v-loading="loading" :data="tableData" border stripe height="100%" row-key="id">
|
||||
<el-table-column prop="id" label="ID" width="80" />
|
||||
<el-table-column prop="name" label="配置名称" min-width="150" />
|
||||
<el-table-column prop="express_code" label="快递编码" min-width="120" />
|
||||
<el-table-column prop="platform_code" label="平台编码" min-width="120" />
|
||||
<el-table-column prop="sender_name" label="发件人" min-width="120" />
|
||||
<el-table-column prop="sender_tel" label="发件电话" min-width="130" />
|
||||
<el-table-column prop="shop_name" label="店铺" min-width="180" />
|
||||
<el-table-column prop="can_use_count" label="可用单量" width="100" />
|
||||
<el-table-column label="操作" width="160" fixed="right">
|
||||
<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 class="panel-table">
|
||||
<el-table 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 />
|
||||
<el-table-column prop="platform_code" label="平台编码" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="sender_name" label="发件人" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="sender_tel" label="发件电话" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="shop_name" label="店铺" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="can_use_count" label="可用单量" width="100" 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="pager">
|
||||
<div class="panel-pager">
|
||||
<el-pagination
|
||||
v-model:current-page="query.page"
|
||||
v-model:page-size="query.page_size"
|
||||
@ -69,72 +72,87 @@
|
||||
@close="resetForm"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px" class="dialog-form">
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="如 申通-快手" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="快递编码" prop="express_code">
|
||||
<el-select v-model="formData.express_code" filterable placeholder="请选择快递编码">
|
||||
<el-option
|
||||
v-for="item in expressOptions"
|
||||
:key="item.code"
|
||||
:label="item.label || item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="平台编码" prop="platform_code">
|
||||
<el-select v-model="formData.platform_code" filterable placeholder="请选择平台编码">
|
||||
<el-option
|
||||
v-for="item in platformOptions"
|
||||
:key="item.code"
|
||||
:label="item.label || item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="平台接口ID" prop="express_platform_id">
|
||||
<el-input-number v-model="formData.express_platform_id" :min="1" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发件人">
|
||||
<el-input v-model="formData.sender_name" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发件电话">
|
||||
<el-input v-model="formData.sender_tel" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预设重量">
|
||||
<el-input-number v-model="formData.weight" :min="0" :precision="2" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="token">
|
||||
<el-input v-model="formData.token" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="站点编码">
|
||||
<el-input v-model="formData.site_code" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="店铺名称">
|
||||
<el-input v-model="formData.shop_name" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="form-section">
|
||||
<div class="form-section-title">基础配置</div>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="如 申通-快手" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="快递编码" prop="express_code">
|
||||
<el-select v-model="formData.express_code" filterable placeholder="请选择快递编码">
|
||||
<el-option
|
||||
v-for="item in expressOptions"
|
||||
:key="item.code"
|
||||
:label="item.label || item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="平台编码" prop="platform_code">
|
||||
<el-select v-model="formData.platform_code" filterable placeholder="请选择平台编码">
|
||||
<el-option
|
||||
v-for="item in platformOptions"
|
||||
:key="item.code"
|
||||
:label="item.label || item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="平台接口ID" prop="express_platform_id">
|
||||
<el-input-number v-model="formData.express_platform_id" :min="1" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<div class="form-section">
|
||||
<div class="form-section-title">发件信息</div>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发件人">
|
||||
<el-input v-model="formData.sender_name" placeholder="可选" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发件电话">
|
||||
<el-input v-model="formData.sender_tel" placeholder="可选" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="站点编码">
|
||||
<el-input v-model="formData.site_code" placeholder="可选" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="店铺名称">
|
||||
<el-input v-model="formData.shop_name" placeholder="可选" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<div class="form-section form-section--last">
|
||||
<div class="form-section-title">接口参数</div>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预设重量">
|
||||
<el-input-number v-model="formData.weight" :min="0" :precision="2" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="token">
|
||||
<el-input v-model="formData.token" placeholder="可选" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
@ -147,6 +165,7 @@
|
||||
<script setup lang="ts">
|
||||
import { 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 {
|
||||
@ -154,7 +173,7 @@ import {
|
||||
expressInterfaceDelete,
|
||||
expressInterfaceList,
|
||||
expressInterfaceUpdate
|
||||
} from '@/api/setting.expressInterface/expressInterface'
|
||||
} from '@/api/setting.expressinterface/expressInterface'
|
||||
|
||||
type ExpressOption = { code: string; name: string; label?: string }
|
||||
type PlatformOption = { code: string; name: string; label?: string }
|
||||
@ -373,105 +392,166 @@ onMounted(() => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.express-interface-page {
|
||||
height: calc(100vh - 130px);
|
||||
--ei-page-bg: var(--el-bg-color-page, #f5f7fa);
|
||||
--ei-card-radius: 10px;
|
||||
--ei-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
|
||||
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 12px;
|
||||
gap: 16px;
|
||||
padding: 16px 20px;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
background: var(--ei-page-bg);
|
||||
}
|
||||
|
||||
.page-header {
|
||||
.page-hero {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
align-items: flex-end;
|
||||
padding: 2px 2px 0;
|
||||
gap: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.header-main {
|
||||
.hero-leading {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.hero-icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 12px;
|
||||
background: linear-gradient(145deg, var(--el-color-primary-light-8, #ecf5ff), var(--el-color-primary-light-9, #f5faff));
|
||||
color: var(--el-color-primary);
|
||||
font-size: 22px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.hero-text {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
line-height: 26px;
|
||||
color: #1f2937;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
line-height: 1.3;
|
||||
letter-spacing: -0.02em;
|
||||
color: var(--el-text-color-primary, #1f2937);
|
||||
}
|
||||
|
||||
.page-subtitle {
|
||||
margin: 4px 0 0;
|
||||
font-size: 13px;
|
||||
color: #6b7280;
|
||||
line-height: 1.5;
|
||||
color: var(--el-text-color-secondary, #6b7280);
|
||||
}
|
||||
|
||||
.filter-card,
|
||||
.table-card {
|
||||
background: #fff;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 8px;
|
||||
.hero-stat {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.filter-card {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.table-card {
|
||||
.main-panel {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--el-bg-color, #fff);
|
||||
border: 1px solid var(--el-border-color-lighter, #ebeef5);
|
||||
border-radius: var(--ei-card-radius);
|
||||
box-shadow: var(--ei-card-shadow);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
.panel-toolbar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
padding: 14px 16px;
|
||||
border-bottom: 1px solid var(--el-border-color-lighter, #ebeef5);
|
||||
background: var(--el-fill-color-blank, #fff);
|
||||
}
|
||||
|
||||
.toolbar-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
width: 320px;
|
||||
width: min(320px, 100%);
|
||||
}
|
||||
|
||||
.table-wrapper {
|
||||
.panel-table {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
padding: 0 16px;
|
||||
overflow: hidden;
|
||||
padding: 12px 12px 0;
|
||||
}
|
||||
|
||||
.table-wrapper :deep(.el-table) {
|
||||
.panel-table :deep(.el-table) {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.table-wrapper :deep(.el-table__inner-wrapper) {
|
||||
.panel-table :deep(.el-table__inner-wrapper) {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.table-wrapper :deep(.el-table__body-wrapper) {
|
||||
.panel-table :deep(.el-table__body-wrapper) {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.pager {
|
||||
.panel-pager {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
flex-shrink: 0;
|
||||
padding: 10px 12px 12px;
|
||||
border-top: 1px solid #f0f2f5;
|
||||
padding: 12px 16px 14px;
|
||||
border-top: 1px solid var(--el-border-color-extra-light, #f0f2f5);
|
||||
background: var(--el-fill-color-blank, #fff);
|
||||
}
|
||||
|
||||
.config-dialog :deep(.el-dialog__body) {
|
||||
padding-top: 18px;
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
.dialog-form {
|
||||
max-height: min(70vh, 640px);
|
||||
overflow-y: auto;
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
.form-section {
|
||||
padding-bottom: 4px;
|
||||
margin-bottom: 16px;
|
||||
border-bottom: 1px dashed var(--el-border-color-lighter, #e4e7ed);
|
||||
|
||||
&--last {
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.form-section-title {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--el-text-color-regular, #606266);
|
||||
margin-bottom: 12px;
|
||||
padding-left: 2px;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.dialog-form :deep(.el-select),
|
||||
@ -481,13 +561,22 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.toolbar {
|
||||
.express-interface-page {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.page-hero {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.panel-toolbar {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.toolbar-left {
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
|
||||
@ -48,15 +48,18 @@ const formData = reactive({
|
||||
})
|
||||
|
||||
const rules = {
|
||||
name: [{ required: true, message: '请输入打印台名称', trigger: 'blur' }]
|
||||
name: [{ required: true, message: '请输入打印台名称', trigger: 'blur' }],
|
||||
computer_id: [{ required: true, message: '请选择打印电脑', trigger: 'change' }]
|
||||
}
|
||||
|
||||
const computers = ref<Array<any>>([])
|
||||
|
||||
const okCode = (c: unknown) => c === 0 || c === 200
|
||||
|
||||
const loadComputers = async () => {
|
||||
try {
|
||||
const res: any = await stationApi.getComputer()
|
||||
if (res && (res.code === 0 || res.code === 200)) {
|
||||
if (res && okCode(res.code)) {
|
||||
computers.value = res.data || []
|
||||
}
|
||||
} catch (e) {
|
||||
@ -73,19 +76,20 @@ const handleSave = async () => {
|
||||
}
|
||||
loading.value = true
|
||||
try {
|
||||
// 找到所选打印电脑的对象,用于把电脑的名字一并提交给后端
|
||||
const selectedComp = computers.value.find((c: any) => String(c.id) === String(formData.computer_id))
|
||||
const payload: any = {
|
||||
name: formData.name,
|
||||
computer_id: formData.computer_id,
|
||||
custom_barcode: formData.custom_barcode,
|
||||
// computer_name: selectedComp?.name || '',
|
||||
// 修复后端 notNull Violation: print_stations.update_at 错误
|
||||
// updated_at: new Date().toISOString()
|
||||
default_printer_name: selectedComp?.default_printer_name || ''
|
||||
const cid = Number(formData.computer_id)
|
||||
if (!Number.isFinite(cid)) {
|
||||
ElMessage.warning('请选择有效的打印电脑')
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
const payload: Record<string, unknown> = {
|
||||
name: formData.name.trim(),
|
||||
computer_id: cid,
|
||||
custom_barcode: formData.custom_barcode || '',
|
||||
default_printer_name: formData.default_printer_name || ''
|
||||
}
|
||||
const res: any = await stationApi.add(payload)
|
||||
if (res && (res.code === 0 || res.code === 200)) {
|
||||
if (res && okCode(res.code)) {
|
||||
ElMessage.success('添加成功')
|
||||
emit('saved')
|
||||
resetForm()
|
||||
|
||||
@ -17,16 +17,17 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="打印机" prop="printer_id">
|
||||
<el-select v-model="form.printer_id" placeholder="请选择打印机" clearable @visible-change="onPrinterVisibleChange">
|
||||
<el-form-item label="默认打印机" prop="printer_id">
|
||||
<el-select v-model="form.printer_id" placeholder="请先选择电脑,再选本机打印机" clearable filterable
|
||||
@visible-change="onPrinterVisibleChange">
|
||||
<el-option v-for="item in printerOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="快递公司" prop="express_company">
|
||||
<el-select v-model="form.express_company" placeholder="请选择快递公司" clearable>
|
||||
<el-option v-for="item in expressOptions" :key="item.value" :label="item.label" :value="item.value"
|
||||
@click="getExpressList()" />
|
||||
<el-form-item label="快递绑定" prop="express_company">
|
||||
<el-select v-model="form.express_company" placeholder="可选:与默认打印机绑定" clearable filterable
|
||||
@visible-change="onExpressVisibleChange">
|
||||
<el-option v-for="item in expressOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
@ -41,8 +42,12 @@
|
||||
<aside class="right-col">
|
||||
<div class="right-panel">
|
||||
<div class="panel-item">
|
||||
<div class="panel-label">仓库ID</div>
|
||||
<div class="panel-value">{{ data.warehouse_id }}</div>
|
||||
<div class="panel-label">仓库 ID</div>
|
||||
<div class="panel-value">{{ data.warehouse_id ?? '—' }}</div>
|
||||
</div>
|
||||
<div class="panel-item" v-if="data.creator_name">
|
||||
<div class="panel-label">创建人</div>
|
||||
<div class="panel-value">{{ data.creator_name }}</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-actions">
|
||||
@ -57,8 +62,8 @@
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import * as stationApi from '@/api/print/print'
|
||||
// import { t } from 'vue-router/dist/index-DFCq6eJK.js'
|
||||
// import { fi } from 'element-plus/es/locales.mjs'
|
||||
|
||||
const okCode = (c: unknown) => c === 0 || c === 200
|
||||
|
||||
// 从父组件接收的外部属性
|
||||
const props = defineProps({
|
||||
@ -68,7 +73,7 @@ const props = defineProps({
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: true
|
||||
default: ''
|
||||
},
|
||||
computer_id: {
|
||||
type: [String, Number],
|
||||
@ -115,8 +120,7 @@ const onComputerVisibleChange = (visible: boolean) => {
|
||||
const getComputers = async () => {
|
||||
try {
|
||||
const res: any = await stationApi.getComputer()
|
||||
if (res && res.code === 0) {
|
||||
// console.log('打印台属性', res.data)
|
||||
if (res && okCode(res.code)) {
|
||||
const list = res.data || []
|
||||
computerOptions.value = list.map((it: any) => {
|
||||
if (typeof it === 'string') return { label: it, value: it }
|
||||
@ -134,7 +138,7 @@ const expressOptions = ref<Array<{ label: string; value: string }>>([])
|
||||
const getExpressList = async () => {
|
||||
try {
|
||||
const res: any = await stationApi.getExpressList()
|
||||
if (res && res.code === 0) {
|
||||
if (res && okCode(res.code)) {
|
||||
const list = res.data || []
|
||||
expressOptions.value = list.map((it: any) => {
|
||||
if (typeof it === 'string') return { label: it, value: it }
|
||||
@ -148,6 +152,10 @@ const getExpressList = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const onExpressVisibleChange = (visible: boolean) => {
|
||||
if (visible && expressOptions.value.length === 0) getExpressList()
|
||||
}
|
||||
|
||||
const printerOptions = ref<Array<{ label: string; value: string }>>([])
|
||||
const onPrinterVisibleChange = (visible: boolean) => {
|
||||
if (visible) getComputerPrinter(form.value.computer_id)
|
||||
@ -160,7 +168,7 @@ const getComputerPrinter = async (id: any) => {
|
||||
}
|
||||
try {
|
||||
const res: any = await stationApi.getComputerPrinter(targetId)
|
||||
if (res && res.code === 0) {
|
||||
if (res && okCode(res.code)) {
|
||||
const list = res.data || []
|
||||
printerOptions.value = list.map((it: any) => {
|
||||
if (typeof it === 'string') return { label: it, value: it }
|
||||
@ -190,28 +198,31 @@ const getData = async () => {
|
||||
// 每次获取详情前,先拉取电脑列表
|
||||
await getComputers()
|
||||
|
||||
const response: any = await stationApi.getItem(props.id as string)
|
||||
// console.log('getItem response raw:', response)
|
||||
if (response.code === 0) {
|
||||
data.value = response.data ?? response
|
||||
// copy editable fields into form
|
||||
const response: any = await stationApi.getItem(props.id)
|
||||
if (okCode(response.code)) {
|
||||
data.value = response.data ?? {}
|
||||
form.value.name = data.value.name || ''
|
||||
// 如果后端返回的 custom_barcode 有前缀需要去掉,只在长度大于6时截断,
|
||||
// 否则保留原值,防止短值被截空导致显示为空白
|
||||
const cb = data.value.custom_barcode
|
||||
form.value.custom_barcode = cb ? (String(cb).length > 6 ? String(cb).substring(6) : String(cb)) : ''
|
||||
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 ? String(data.value.computer_id) : ''
|
||||
form.value.computer_id = data.value.computer_id !== undefined && data.value.computer_id !== null
|
||||
? String(data.value.computer_id)
|
||||
: ''
|
||||
|
||||
// 初始化打印机列表
|
||||
if (form.value.computer_id) {
|
||||
await getComputerPrinter(form.value.computer_id)
|
||||
// 确保 form.value.printer_id 有值用于下拉框回显,通常取 default_printer_name
|
||||
form.value.printer_id = data.value.default_printer_name || ''
|
||||
} else {
|
||||
printerOptions.value = []
|
||||
form.value.printer_id = ''
|
||||
}
|
||||
|
||||
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 = ''
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch item:', error)
|
||||
@ -223,73 +234,74 @@ const getData = async () => {
|
||||
const hasName = async (name: string, id?: string | number) => {
|
||||
if (!name) return false
|
||||
try {
|
||||
const payload: any = { name }
|
||||
if (id !== undefined && id !== null) payload.id = id
|
||||
const payload: { name: string; id?: string | number } = { name: name.trim() }
|
||||
if (id !== undefined && id !== null && id !== '') payload.id = id
|
||||
const res: any = await stationApi.hasName(payload)
|
||||
const exists = res && (res.data?.exists ?? res.exists ?? false)
|
||||
return res && res.code === 0 && Boolean(exists)
|
||||
const raw = res?.data
|
||||
const exists =
|
||||
raw === true ||
|
||||
raw?.exists === true ||
|
||||
res?.exists === true
|
||||
return okCode(res?.code) && Boolean(exists)
|
||||
} catch (e) {
|
||||
console.error('Failed to check name uniqueness', e)
|
||||
return false
|
||||
} finally {
|
||||
saveLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const savePrinters = async () => {
|
||||
if (!props.id) return
|
||||
saveLoading.value = true
|
||||
const buildExpressPayload = (): Array<{ express_id: string; name: string }> => {
|
||||
if (form.value.express_company) {
|
||||
return [{
|
||||
express_id: String(form.value.express_company),
|
||||
name: String(form.value.printer_id || '')
|
||||
}]
|
||||
}
|
||||
const sourceExpress = Array.isArray(props.express) && props.express.length > 0
|
||||
? props.express
|
||||
: Array.isArray(data.value?.express)
|
||||
? data.value.express
|
||||
: []
|
||||
return sourceExpress.map((it: any) => {
|
||||
const expressId = it?.express_id ?? it?.id ?? it?.expressId ?? it?.value ?? ''
|
||||
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)
|
||||
}
|
||||
|
||||
const persistPrinterBindings = async () => {
|
||||
const sid = Number(props.id)
|
||||
if (!Number.isFinite(sid)) return false
|
||||
const defaultPrinter = String(form.value.printer_id || '')
|
||||
const expressPayload = buildExpressPayload()
|
||||
try {
|
||||
const defaultPrinter = form.value.default_printer_name || data.value.default_printer_name || ''
|
||||
|
||||
// 来源优先级:props.express -> data.value.express -> []
|
||||
const sourceExpress = Array.isArray(props.express) && props.express.length > 0
|
||||
? props.express
|
||||
: Array.isArray(data.value?.express)
|
||||
? data.value.express
|
||||
: []
|
||||
|
||||
const expressPayload = sourceExpress.map((it: any) => {
|
||||
const expressId = it?.express_id ?? it?.id ?? it?.expressId ?? it?.value ?? ''
|
||||
const name = it?.name ?? it?.printer_name ?? it?.default_printer_name ?? it?.label ?? it?.value ?? ''
|
||||
return { express_id: String(expressId), name: String(name) }
|
||||
}).filter((e: any) => e.express_id || e.name)
|
||||
|
||||
const payload: any = {
|
||||
default: String(defaultPrinter),
|
||||
const res: any = await stationApi.savePrinters({
|
||||
defaultPrinter,
|
||||
print_station_id: sid,
|
||||
express: expressPayload
|
||||
})
|
||||
if (!okCode(res?.code)) {
|
||||
ElMessage.error((res && (res.msg || res.message)) || '打印机与快递绑定保存失败')
|
||||
return false
|
||||
}
|
||||
|
||||
const res: any = await stationApi.savePrinters(payload)
|
||||
if (res && res.code === 0) {
|
||||
ElMessage.success(res.msg || res.message || '打印机绑定保存成功')
|
||||
// 更新本地展示数据
|
||||
if (!data.value) data.value = {}
|
||||
data.value.default_printer_name = payload.default
|
||||
data.value.express = payload.express
|
||||
|
||||
// 通知父组件以便刷新列表或单项展示
|
||||
const updatedFields = {
|
||||
id: props.id,
|
||||
default_printer_name: payload.default,
|
||||
express: payload.express
|
||||
}
|
||||
emit('updated', updatedFields)
|
||||
} else {
|
||||
ElMessage.error((res && (res.msg || res.message)) || '打印机绑定保存失败')
|
||||
}
|
||||
if (!data.value) data.value = {}
|
||||
data.value.default_printer_name = defaultPrinter
|
||||
data.value.express = expressPayload
|
||||
emit('updated', {
|
||||
id: props.id,
|
||||
default_printer_name: defaultPrinter,
|
||||
express: expressPayload
|
||||
})
|
||||
return true
|
||||
} catch (e) {
|
||||
console.error('savePrinters error', e)
|
||||
ElMessage.error('打印机绑定保存失败')
|
||||
} finally {
|
||||
saveLoading.value = false
|
||||
ElMessage.error('打印机与快递绑定保存失败')
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
const handleSave = async () => {
|
||||
if (!props.id) return
|
||||
// 在提交前校验名称唯一性,若已存在则阻止保存
|
||||
if (form.value.name) {
|
||||
if (form.value.name?.trim()) {
|
||||
const nameExists = await hasName(form.value.name, props.id)
|
||||
if (nameExists) {
|
||||
ElMessage.error('打印台名称已存在')
|
||||
@ -298,35 +310,38 @@ const handleSave = async () => {
|
||||
}
|
||||
saveLoading.value = true
|
||||
try {
|
||||
const payload: any = { id: props.id, name: form.value.name, computer_id: form.value.computer_id, custom_barcode: form.value.custom_barcode, default_printer_name: form.value.default_printer_name, express_company: form.value.express_company, printer_id: form.value.printer_id }
|
||||
// ensure backend-required fields are preserved when updating
|
||||
// otherwise backend might overwrite/clear them and affect computed state
|
||||
if (data.value.warehouse_id !== undefined) payload.warehouse_id = String(data.value.warehouse_id)
|
||||
if (data.value.creator_id !== undefined) payload.creator_id = String(data.value.creator_id)
|
||||
if (data.value.creator_name !== undefined) payload.creator_name = data.value.creator_name
|
||||
if (data.value.create_at !== undefined) payload.create_at = data.value.create_at
|
||||
if (data.value.update_at !== undefined) payload.update_at = data.value.update_at
|
||||
if (form.value.name !== undefined) payload.name = form.value.name
|
||||
if (form.value.computer_id !== undefined) payload.computer_id = form.value.computer_id
|
||||
if (form.value.custom_barcode !== undefined) payload.custom_barcode = form.value.custom_barcode
|
||||
|
||||
if (form.value.default_printer_name !== undefined) {
|
||||
payload.default_printer_name = form.value.default_printer_name
|
||||
const payload: Record<string, unknown> = {
|
||||
id: props.id,
|
||||
name: form.value.name?.trim() ?? '',
|
||||
custom_barcode: form.value.custom_barcode ?? ''
|
||||
}
|
||||
if (form.value.computer_id) {
|
||||
payload.computer_id = Number(form.value.computer_id)
|
||||
}
|
||||
|
||||
const res: any = await stationApi.updateItem(payload)
|
||||
if (res.code === 0) {
|
||||
if (!okCode(res?.code)) {
|
||||
ElMessage.error(res?.message || res?.msg || '保存失败')
|
||||
return
|
||||
}
|
||||
|
||||
Object.assign(data.value, {
|
||||
name: form.value.name,
|
||||
custom_barcode: form.value.custom_barcode,
|
||||
computer_id: form.value.computer_id ? Number(form.value.computer_id) : data.value.computer_id
|
||||
})
|
||||
emit('updated', {
|
||||
id: props.id,
|
||||
name: form.value.name,
|
||||
custom_barcode: form.value.custom_barcode,
|
||||
computer_id: form.value.computer_id
|
||||
})
|
||||
|
||||
const bindOk = await persistPrinterBindings()
|
||||
if (bindOk) {
|
||||
ElMessage.success('保存成功')
|
||||
// update local data so readonly fields reflect change
|
||||
Object.assign(data.value, form.value)
|
||||
// notify parent of the updated fields so table can be refreshed locally
|
||||
const updatedFields = {
|
||||
id: props.id,
|
||||
...form.value
|
||||
}
|
||||
emit('updated', updatedFields)
|
||||
} else {
|
||||
ElMessage.error(res.message || '保存失败')
|
||||
ElMessage.warning('打印台信息已保存,默认打印机或快递绑定未保存成功,请检查后重试')
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
|
||||
@ -10,41 +10,13 @@
|
||||
刷新
|
||||
</el-button>
|
||||
|
||||
<template v-if="hasPermission('stock.saveWarehouseStock')">
|
||||
<el-button type="primary" size="small" :icon="Plus" @click="handleAdd" title="添加商品">
|
||||
添加
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" :icon="Plus" @click="handleAdd" title="添加打印台">
|
||||
添加
|
||||
</el-button>
|
||||
|
||||
<el-button type="danger" size="small" :icon="Delete" @click="confirmBatchDelete" title="批量删除"
|
||||
:disabled="!hasSelection">
|
||||
批量删除
|
||||
</el-button>
|
||||
|
||||
<!-- <el-dropdown v-if="hasPermission('stock.saveWarehouseStock')" @command="handleBatchChange">
|
||||
<el-button type="primary" :disabled="!hasSelection" size="small">
|
||||
<el-icon>
|
||||
<Edit />
|
||||
</el-icon>
|
||||
批量修改<el-icon class="el-icon--right">
|
||||
<ArrowDown />
|
||||
</el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="stock_unit">库存单位</el-dropdown-item>
|
||||
<el-dropdown-item command="brand_name">品牌</el-dropdown-item>
|
||||
<el-dropdown-item command="prohibited_id">违禁品类型</el-dropdown-item>
|
||||
<el-dropdown-item command="gross_weight">毛重</el-dropdown-item>
|
||||
<el-dropdown-item command="packing_requirements">打包要求</el-dropdown-item>
|
||||
<el-dropdown-item command="managementFlags">管理标识</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown> -->
|
||||
</template>
|
||||
|
||||
<el-button v-if="hasPermission('warehouseExport')" type="success" size="small" :icon="Download"
|
||||
@click="handleExport" title="导出" :loading="loading">
|
||||
导出
|
||||
<el-button type="danger" size="small" :icon="Delete" @click="confirmBatchDelete" title="批量删除"
|
||||
:disabled="!hasSelection">
|
||||
批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
@ -57,14 +29,6 @@
|
||||
: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-status="{ row }">
|
||||
<el-tag :type="row.status === 'enabled' ? 'success' : 'danger'" size="small">
|
||||
{{ row.status === 'enabled' ? '启用' : '禁用' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<!-- 自定义列模板 -->
|
||||
<template #column-is_online="{ row }">
|
||||
<el-tag :type="row.is_online === 1 ? 'success' : 'danger'" size="small">
|
||||
{{ row.is_online === 1 ? '在线' : '离线' }}
|
||||
@ -111,22 +75,6 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #column-is_sn_mgmt="{ row }">
|
||||
<el-tag :type="row.is_sn_mgmt === 'Y' ? 'success' : 'info'" size="small">
|
||||
{{ row.is_sn_mgmt === 'Y' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #column-is_shelf_life_mgmt="{ row }">
|
||||
<el-tag :type="row.is_shelf_life_mgmt === 'Y' ? 'success' : 'info'" size="small">
|
||||
{{ row.is_shelf_life_mgmt === 'Y' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #column-is_batch_mgmt="{ row }">
|
||||
<el-tag :type="row.is_batch_mgmt === 'Y' ? 'success' : 'info'" size="small">
|
||||
{{ row.is_batch_mgmt === 'Y' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
<div class="custom-empty">
|
||||
<el-icon>
|
||||
@ -173,24 +121,18 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, defineAsyncComponent, computed, onMounted, markRaw } from 'vue'
|
||||
import { ref, computed, onMounted, markRaw } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import Info from './components/info.vue'
|
||||
import PrintComputer from './components/printComputer.vue'
|
||||
import ExpressCompany from './components/expressCompany.vue'
|
||||
import ComponentList from './components/Printer.vue'
|
||||
import Add from './components/add.vue'
|
||||
|
||||
import * as stationApi from '@/api/print/print'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
|
||||
import { useUserStore } from '@/stores/modules/user'
|
||||
import { Delete, Download, Plus, Refresh } from '@element-plus/icons-vue'
|
||||
|
||||
const userStore = useUserStore()
|
||||
import { Delete, Plus, Refresh } from '@element-plus/icons-vue'
|
||||
|
||||
const okCode = (c: unknown) => c === 0 || c === 200
|
||||
|
||||
// scanbox使用
|
||||
const presetTree = ref<Array<{
|
||||
@ -229,12 +171,6 @@ const availableFields = ref([
|
||||
])
|
||||
|
||||
|
||||
// 用户鉴权菜单
|
||||
const hasPermission = (perm: string) => {
|
||||
return userStore.checkPermission(perm)
|
||||
}
|
||||
|
||||
|
||||
// 底部组件
|
||||
const activeTab = ref('info')
|
||||
const currentStationId = ref<string | number | null>(null)
|
||||
@ -292,6 +228,25 @@ const accountColumns = ref([
|
||||
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: '创建人',
|
||||
@ -363,10 +318,6 @@ const accountColumns = ref([
|
||||
const drawer = ref(false)
|
||||
const handleAdd = () => { drawer.value = true }
|
||||
const handleSaved = () => { drawer.value = false; getList() }
|
||||
const handleBatchChange = (command: string) => { }
|
||||
const handleExport = () => { }
|
||||
|
||||
|
||||
// 保存后端数组
|
||||
const list = ref<any[]>([])
|
||||
|
||||
@ -457,7 +408,6 @@ const getList = async () => {
|
||||
pagination.value.total = data.pagination?.total ?? data.total ?? data.count ?? (Array.isArray(rawList) ? rawList.length : 0)
|
||||
}
|
||||
|
||||
console.log('请求结果', response)
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch preset tree:', error)
|
||||
} finally {
|
||||
@ -477,7 +427,7 @@ const confirmBatchDelete = async () => {
|
||||
await ElMessageBox.confirm('确认删除选中打印台?', '删除确认', { type: 'warning' })
|
||||
const ids = selectedRows.value.map((r: any) => String(r.id))
|
||||
const res: any = await stationApi.delItems(ids)
|
||||
if (res && res.code === 0) {
|
||||
if (res && okCode(res.code)) {
|
||||
ElMessage.success('删除成功')
|
||||
await getList()
|
||||
// 如果当前详情被删除,清空
|
||||
@ -497,175 +447,8 @@ const confirmBatchDelete = async () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
const getComputer = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const response: any = await stationApi.getComputer()
|
||||
if (response && response.code === 0) {
|
||||
console.log('所有可用打印电脑:', response.data)
|
||||
} else {
|
||||
console.warn('获取所有打印电脑返回非 0 状态:', response)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch computer :', error)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
const getExpressList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const response: any = await stationApi.getExpressList()
|
||||
if (response && response.code === 0) {
|
||||
console.log('快递公司列表:', response.data)
|
||||
} else {
|
||||
console.warn('获取快递公司列表返回非 0 状态:', response)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch express list :', error)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
const getComputerPrinter = async (stationId?: string | number) => {
|
||||
const id = stationId ?? currentStationId.value
|
||||
loading.value = true
|
||||
try {
|
||||
if (id) {
|
||||
const response: any = await stationApi.getComputerPrinter(String(id))
|
||||
if (response && response.code === 0) {
|
||||
console.log('打印机列表:', response.data)
|
||||
}
|
||||
} else {
|
||||
// 无 id 时请求所有可用打印电脑(print.getComputer)
|
||||
const response: any = await stationApi.getComputer()
|
||||
if (response && response.code === 0) {
|
||||
console.log('所有可用打印机:', response.data)
|
||||
} else {
|
||||
console.warn('获取所有打印机返回非 0 状态:', response)
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch computer printer :', error)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
const getComputerPrinters = async ( id?: string | number) => {
|
||||
loading.value = true
|
||||
try {
|
||||
const compsResp: any = await stationApi.getComputer()
|
||||
if (compsResp && compsResp.code === 0) {
|
||||
const comps: any[] = compsResp.data || []
|
||||
for (const comp of comps) {
|
||||
if (!comp || !comp.id) continue
|
||||
try {
|
||||
const resp: any = await stationApi.getComputerPrinter(String(comp.id))
|
||||
if (resp && resp.code === 0) {
|
||||
console.log(`打印电脑 ${comp.name || comp.id} 上的打印机:`, resp.data)
|
||||
} else {
|
||||
console.warn(`获取打印机返回非 0 状态,电脑 ${comp.id}:`, resp)
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(`Failed to fetch printers for computer ${comp.id}:`, err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.warn('获取打印电脑列表失败:', compsResp)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch computer printers:', error)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
const hashName = async (name: string, id?: string | number) => {
|
||||
try {
|
||||
const payload: any = { name }
|
||||
if (id !== undefined && id !== null) payload.id = id
|
||||
const res: any = await stationApi.hasName(payload)
|
||||
console.log('print.hasName 返回:', res)
|
||||
return res
|
||||
} catch (e) {
|
||||
console.error('Failed to check name uniqueness', e)
|
||||
return null
|
||||
}
|
||||
}
|
||||
const savePrinters = async () => {
|
||||
|
||||
// 构造模拟请求参数:默认打印机名带上站点 id,以及示例 express 绑定数组
|
||||
const payload: any = {
|
||||
default: '1',
|
||||
express: [
|
||||
{ express_id: '1', name: 'Printer-A' },
|
||||
{ express_id: '2', name: 'Printer-B' }
|
||||
]
|
||||
}
|
||||
|
||||
try {
|
||||
// 模拟异步后端请求(500ms 延迟)并返回模拟结果
|
||||
const res: any = await new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve({
|
||||
code: 0,
|
||||
data: {
|
||||
message: '模拟保存成功',
|
||||
savedPayload: payload
|
||||
}
|
||||
})
|
||||
}, 500)
|
||||
})
|
||||
|
||||
// 在控制台打印后端(模拟)返回结果,便于调试
|
||||
console.log('模拟后端返回:', res)
|
||||
|
||||
if (res && res.code === 0) {
|
||||
ElMessage.success(res.data?.message || '保存成功')
|
||||
// 可选:此处可以触发详情刷新或其他后续操作
|
||||
} else {
|
||||
ElMessage.error((res && (res.msg || res.message)) || '保存失败')
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('模拟保存失败:', e)
|
||||
ElMessage.error('保存失败')
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
||||
try {
|
||||
|
||||
const fastRes = await indexApi.fastWhereTree('stock')
|
||||
if (fastRes && fastRes.data && fastRes.data.presetTree) {
|
||||
presetTree.value = fastRes.data.presetTree
|
||||
} else if (fastRes && (fastRes as any).presetTree) {
|
||||
// Handle case where interceptor returns data directly
|
||||
presetTree.value = (fastRes as any).presetTree
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
await getList();
|
||||
|
||||
// savePrinters();
|
||||
// getComputerPrinters();
|
||||
// getExpressList();
|
||||
// try {
|
||||
// if (list.value && list.value.length > 0) {
|
||||
// const sample = list.value[0]
|
||||
// await hashName(sample.name, sample.id)
|
||||
// } else {
|
||||
// await hashName('测试打印台', currentStationId.value ? String(currentStationId.value) : undefined)
|
||||
// }
|
||||
// } catch (e) {
|
||||
// console.error('hashName 调用异常', e)
|
||||
// }
|
||||
|
||||
// getComputer();
|
||||
// getComputerPrinter();
|
||||
// getExpressList();
|
||||
// getComputerPrinters('1');
|
||||
// hashName()
|
||||
await getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ import { ref, computed, onMounted } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Document, Folder } from '@element-plus/icons-vue'
|
||||
import TemplateEditor from './components/TemplateEditor.vue'
|
||||
import * as TemplatesApi from '@/api/setting.printTemplate/printTemplate'
|
||||
import * as TemplatesApi from '@/api/setting.printtemplate/printTemplate'
|
||||
import { usePrintTemplateStore } from '@/stores/modules/printTemplate'
|
||||
import { storeToRefs } from 'pinia'
|
||||
|
||||
|
||||
1357
src/需求文档.txt
1357
src/需求文档.txt
File diff suppressed because it is too large
Load Diff
@ -1,63 +1,121 @@
|
||||
# 接口响应
|
||||
|
||||
更新时间: 2026/4/17 20:05:13
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"接口": "user.login",
|
||||
"message": "登录成功",
|
||||
"data": {
|
||||
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywidXNlcm5hbWUiOiJ5am0iLCJyZWFsX25hbWUiOiJ5aW4iLCJwbGF0Zm9ybV9jb2RlIjoid2ViIiwiY3VycmVudF9yb2xlX2lkIjozMSwiY3VycmVudF9zdG9yZV9pZCI6MTAwMDAwLCJpYXQiOjE3NzY0Mjc1MTEsImV4cCI6MTc3NjQ0MTkxMX0.h2EZ06SLDAZAGSiC8sXdLb3VShAylMm_n2RF4NQe48g"
|
||||
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywidXNlcm5hbWUiOiJ5am0iLCJyZWFsX25hbWUiOiJ5aW4iLCJwbGF0Zm9ybV9jb2RlIjoid2ViIiwiY3VycmVudF9yb2xlX2lkIjozMSwiY3VycmVudF9zdG9yZV9pZCI6MTAwMDAwLCJpYXQiOjE3NzY1MTQwNDcsImV4cCI6MTc3NjUyODQ0N30.jFWl1I2OOPMTNq1x8LGj6oRzIOrWvZhA2oON2Jd23fU"
|
||||
}
|
||||
},
|
||||
{
|
||||
"接口": "setting.expressInterface.list",
|
||||
"message": "ok",
|
||||
"接口": "order.pendingOrder.list",
|
||||
"data": {
|
||||
"list": [
|
||||
{
|
||||
"id": 2,
|
||||
"name": "申通-快手",
|
||||
"express_code": "STO",
|
||||
"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,
|
||||
"warehouse_id": 100000,
|
||||
"platform_code": "kuaishou",
|
||||
"express_platform_id": 1,
|
||||
"sender_name": "吴先生",
|
||||
"sender_tel": "15197817068",
|
||||
"weight": 1,
|
||||
"token": "db820eeeb6c8425eb3f1cc25a28fb2f8",
|
||||
"viewer": null,
|
||||
"client_id": null,
|
||||
"is_share": 0,
|
||||
"share_id": null,
|
||||
"can_use_count": 0,
|
||||
"province_name": "广东省",
|
||||
"city_name": "广州市",
|
||||
"district_name": "白云区",
|
||||
"site_code": "526126",
|
||||
"product_type": null,
|
||||
"shop_name": "仓配吴哥688(天豹云仓@仓配小吴哥)"
|
||||
"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": []
|
||||
}
|
||||
],
|
||||
"total": 1,
|
||||
"page": 1,
|
||||
"page_size": 20
|
||||
"pagination": {
|
||||
"page": 1,
|
||||
"pageSize": 20,
|
||||
"total": 1,
|
||||
"totalPages": 1,
|
||||
"hasPrevious": false,
|
||||
"hasNext": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"接口": "setting.expressInterface.create",
|
||||
"message": "express_platform_id 参数不能为空",
|
||||
"接口": "order.pendingOrder.reverseReviewOrder",
|
||||
"data": null
|
||||
},
|
||||
{
|
||||
"接口": "setting.expressInterface.update",
|
||||
"message": "id 参数不能为空",
|
||||
"接口": "order.pendingOrder.markPendingOutboundOrder",
|
||||
"data": null
|
||||
},
|
||||
{
|
||||
"接口": "setting.expressInterface.delete",
|
||||
"message": "id 参数不能为空",
|
||||
"接口": "order.pendingOrder.cancelOrder",
|
||||
"data": null
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.allocateExpressCode",
|
||||
"data": null
|
||||
}
|
||||
]
|
||||
|
||||
@ -1,57 +1,61 @@
|
||||
# 接口
|
||||
|
||||
- 更新时间: 2026-04-17 20:22:54
|
||||
- 更新时间: 2026-04-18 19:42:37
|
||||
- 扫描目录: `src\api`
|
||||
- 模块数: 27
|
||||
- API 文件数: 27
|
||||
- 接口数: 214
|
||||
- 已启用: 201
|
||||
- 占位接口: 0
|
||||
- 模块数: 31
|
||||
- API 文件数: 31
|
||||
- 接口数: 208
|
||||
- 已启用: 191
|
||||
- 占位接口: 2
|
||||
|
||||
## 模块统计
|
||||
|
||||
| 模块 | 文件数 | 接口数 | 已启用 | 占位 |
|
||||
| --- | ---: | ---: | ---: | ---: |
|
||||
| config | 1 | 1 | 1 | 0 |
|
||||
| config | 1 | 1 | 0 | 0 |
|
||||
| dashboard | 1 | 6 | 6 | 0 |
|
||||
| index | 1 | 14 | 14 | 0 |
|
||||
| order | 1 | 14 | 13 | 0 |
|
||||
| order.deliveryOrder | 1 | 1 | 1 | 0 |
|
||||
| order.index | 1 | 3 | 3 | 0 |
|
||||
| order.outboundOrder | 1 | 2 | 2 | 0 |
|
||||
| order.pendingOrder | 1 | 4 | 4 | 0 |
|
||||
| order.reviewOrder | 1 | 2 | 2 | 0 |
|
||||
| print | 1 | 11 | 11 | 0 |
|
||||
| index | 1 | 15 | 13 | 1 |
|
||||
| order.archiveorder | 1 | 1 | 1 | 0 |
|
||||
| order.deliveryexpectionorder | 1 | 1 | 1 | 0 |
|
||||
| order.deliveryorder | 1 | 1 | 1 | 0 |
|
||||
| order.entrustorder | 1 | 1 | 1 | 0 |
|
||||
| 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.revieworder | 1 | 2 | 2 | 0 |
|
||||
| order.storageallocation | 1 | 1 | 1 | 0 |
|
||||
| print | 1 | 11 | 11 | 1 |
|
||||
| printer.station | 1 | 11 | 11 | 0 |
|
||||
| setting.account | 1 | 7 | 7 | 0 |
|
||||
| setting.express | 1 | 5 | 5 | 0 |
|
||||
| setting.expressInterface | 1 | 4 | 4 | 0 |
|
||||
| setting.express | 1 | 6 | 6 | 0 |
|
||||
| setting.expressinterface | 1 | 4 | 4 | 0 |
|
||||
| setting.permission | 1 | 4 | 4 | 0 |
|
||||
| setting.platform | 1 | 4 | 4 | 0 |
|
||||
| setting.printTemplate | 1 | 13 | 13 | 0 |
|
||||
| setting.printtemplate | 1 | 13 | 13 | 0 |
|
||||
| setting.role | 1 | 5 | 5 | 0 |
|
||||
| stock | 1 | 25 | 24 | 0 |
|
||||
| storage_receiving | 1 | 19 | 9 | 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 |
|
||||
| store | 1 | 6 | 6 | 0 |
|
||||
| storeWarehouse.store | 1 | 11 | 11 | 0 |
|
||||
| storewarehouse.store | 1 | 11 | 11 | 0 |
|
||||
| user | 1 | 8 | 8 | 0 |
|
||||
| warehouse | 1 | 21 | 21 | 0 |
|
||||
| warehouse | 1 | 21 | 20 | 0 |
|
||||
|
||||
## 接口明细
|
||||
|
||||
| 模块 | 接口名 | method | HTTP Method | 启用 | 占位 | 文件 | 备注 |
|
||||
| --- | --- | --- | --- | --- | --- | --- | --- |
|
||||
| config | listConfig | config.list | POST | 是 | 否 | config/config.ts | |
|
||||
| config | listConfig | config.list | POST | 否 | 否 | config/config.ts | |
|
||||
| dashboard | getExpressRatio | dashboard.express_ratio | POST | 是 | 否 | dashboard/dashboard.ts | |
|
||||
| dashboard | getHotOrderRank | dashboard.hot_order_rank | POST | 是 | 否 | dashboard/dashboard.ts | |
|
||||
| dashboard | getOrderTrend | dashboard.order_trend | POST | 是 | 否 | dashboard/dashboard.ts | |
|
||||
| dashboard | getPlatformDist | dashboard.platform_distribution | POST | 是 | 否 | dashboard/dashboard.ts | |
|
||||
| dashboard | getStoreStats | dashboard.storeStats | POST | 是 | 否 | dashboard/dashboard.ts | |
|
||||
| dashboard | getWarehouseStats | dashboard.warehouseStats | POST | 是 | 否 | dashboard/dashboard.ts | |
|
||||
| index | fastWhereTree | index.fastWhereTree | POST | 是 | 否 | index/index.ts | |
|
||||
| index | fastWhereTree | index.fastWhereTree | POST | 否 | 是 | index/index.ts | |
|
||||
| index | getCOSUploadConfig | index.getCOSUploadConfig | POST | 是 | 否 | index/index.ts | |
|
||||
| index | getExpressList | index.getExpressList | POST | 是 | 否 | index/index.ts | |
|
||||
| index | getExpressProductTypeList | index.getExpressProductTypeList | POST | 是 | 否 | index/index.ts | |
|
||||
@ -62,42 +66,36 @@
|
||||
| index | listInterfaceTypes | index.listInterfaceTypes | POST | 是 | 否 | index/index.ts | |
|
||||
| index | loadStores | index.loadStores | POST | 是 | 否 | index/index.ts | |
|
||||
| index | putI18nCollect | index.putI18nCollect | POST | 是 | 否 | index/index.ts | |
|
||||
| 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 | uploadSuccessNotify | index.uploadSuccessNotify | POST | 是 | 否 | index/index.ts | |
|
||||
| order | getarchiveOrderlist | order.archiveOrder.getarchiveOrderlist | POST | 是 | 否 | order/order.ts | |
|
||||
| order | orderArchiveList | order.archiveOrder.list | POST | 是 | 否 | order/order.ts | |
|
||||
| order | orderDeliveryExpectionList | order.deliveryExpectionOrder.list | POST | 是 | 否 | order/order.ts | |
|
||||
| order | getdeliveryOrderDetail | order.deliveryOrder.getdeliveryOrderDetail | POST | 否 | 否 | order/order.ts | |
|
||||
| order | getdeliveryOrderlist | order.deliveryOrder.getdeliveryOrderlist | POST | 是 | 否 | order/order.ts | |
|
||||
| order | orderDeliveryList | order.deliveryOrder.list | POST | 是 | 否 | order/order.ts | |
|
||||
| order | orderDetail | order.detail | POST | 是 | 否 | order/order.ts | |
|
||||
| order | orderEntrustList | order.entrustOrder.list | POST | 是 | 否 | order/order.ts | |
|
||||
| order | getexpectionOrderlist | order.expectionOrder.getexpectionOrderlist | POST | 是 | 否 | order/order.ts | |
|
||||
| order | orderList | order.list | POST | 是 | 否 | order/order.ts | |
|
||||
| order | getpendingOrderlist | order.pendingOrder.getpendingOrderlist | POST | 是 | 否 | order/order.ts | |
|
||||
| order | getreviewOrderlist | order.reviewOrder.getreviewOrderlist | POST | 是 | 否 | order/order.ts | |
|
||||
| order | orderReviewList | order.reviewOrder.list | POST | 是 | 否 | order/order.ts | |
|
||||
| order | reviewOrder | order.reviewOrder.reviewOrder | POST | 是 | 否 | order/order.ts | |
|
||||
| order.deliveryOrder | orderDeliveryOrderList | order.deliveryOrder.list | POST | 是 | 否 | order.deliveryOrder/orderdeliveryOrder.ts | |
|
||||
| order.archiveorder | orderArchiveOrderList | order.archiveOrder.list | POST | 是 | 否 | order.archiveorder/orderarchiveorder.ts | |
|
||||
| order.deliveryexpectionorder | orderDeliveryExpectionOrderList | order.deliveryExpectionOrder.list | POST | 是 | 否 | order.deliveryexpectionorder/orderdeliveryexpectionorder.ts | |
|
||||
| order.deliveryorder | orderDeliveryOrderList | order.deliveryOrder.list | POST | 是 | 否 | order.deliveryorder/orderdeliveryOrder.ts | |
|
||||
| order.entrustorder | orderEntrustOrderList | order.entrustOrder.list | POST | 是 | 否 | order.entrustorder/orderentrustorder.ts | |
|
||||
| order.expectionorder | orderExpectionOrderList | order.expectionOrder.list | POST | 是 | 否 | order.expectionorder/orderexpectionorder.ts | |
|
||||
| order.index | orderBadgeCount | order.badgeCount | POST | 是 | 否 | order.index/orderindex.ts | |
|
||||
| order.index | orderDetail | order.detail | POST | 否 | 否 | order.index/orderindex.ts | |
|
||||
| order.index | orderList | order.list | POST | 是 | 否 | order.index/orderindex.ts | |
|
||||
| order.index | orderManualOutboundOrder | order.manualOutboundOrder | POST | 是 | 否 | order.index/orderindex.ts | |
|
||||
| order.outboundOrder | orderOutboundOrderList | order.outboundOrder.list | POST | 是 | 否 | order.outboundOrder/orderoutboundOrder.ts | |
|
||||
| order.outboundOrder | orderOutboundOrderManualOutboundOrder | order.outboundOrder.manualOutboundOrder | POST | 是 | 否 | order.outboundOrder/orderoutboundOrder.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.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 | 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 | |
|
||||
| print | getComputer | print.getComputer | POST | 是 | 否 | print/print.ts | |
|
||||
| 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 | getList | print.getList | 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 | |
|
||||
@ -122,13 +120,14 @@
|
||||
| setting.account | accountUpdate | setting.account.update | POST | 是 | 否 | setting.account/account.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 | |
|
||||
| setting.express | expressList | setting.express.list | POST | 是 | 否 | setting.express/express.ts | |
|
||||
| setting.express | expressListBase | setting.express.listBase | POST | 是 | 否 | setting.express/express.ts | |
|
||||
| setting.express | expressUpdate | setting.express.update | POST | 是 | 否 | setting.express/express.ts | |
|
||||
| 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 | expressInterfaceUpdate | setting.expressInterface.update | POST | 是 | 否 | setting.expressInterface/expressInterface.ts | |
|
||||
| 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 | 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 | |
|
||||
@ -137,19 +136,19 @@
|
||||
| setting.platform | settingPlatformDelete | setting.platform.delete | POST | 是 | 否 | setting.platform/platform.ts | |
|
||||
| setting.platform | settingPlatformList | setting.platform.list | POST | 是 | 否 | setting.platform/platform.ts | |
|
||||
| setting.platform | settingPlatformUpdate | setting.platform.update | POST | 是 | 否 | setting.platform/platform.ts | |
|
||||
| setting.printTemplate | addElement | setting.printTemplate.addElement | POST | 是 | 否 | setting.printTemplate/printTemplate.ts | |
|
||||
| setting.printTemplate | createTemplate | setting.printTemplate.create | POST | 是 | 否 | setting.printTemplate/printTemplate.ts | |
|
||||
| setting.printTemplate | deleteTemplate | setting.printTemplate.delete | POST | 是 | 否 | setting.printTemplate/printTemplate.ts | |
|
||||
| setting.printTemplate | deleteElement | setting.printTemplate.deleteElement | POST | 是 | 否 | setting.printTemplate/printTemplate.ts | |
|
||||
| setting.printTemplate | duplicateElement | setting.printTemplate.duplicateElement | POST | 是 | 否 | setting.printTemplate/printTemplate.ts | |
|
||||
| setting.printTemplate | exportTemplateXml | setting.printTemplate.exportXml | POST | 是 | 否 | setting.printTemplate/printTemplate.ts | |
|
||||
| setting.printTemplate | getTemplateDetail | setting.printTemplate.get | POST | 是 | 否 | setting.printTemplate/printTemplate.ts | |
|
||||
| setting.printTemplate | importTemplateXml | setting.printTemplate.importXml | POST | 是 | 否 | setting.printTemplate/printTemplate.ts | |
|
||||
| setting.printTemplate | listTemplates | setting.printTemplate.list | POST | 是 | 否 | setting.printTemplate/printTemplate.ts | |
|
||||
| setting.printTemplate | listTemplatesByType | setting.printTemplate.listTemplatesByType | POST | 是 | 否 | setting.printTemplate/printTemplate.ts | |
|
||||
| setting.printTemplate | saveTemplate | setting.printTemplate.save | POST | 是 | 否 | setting.printTemplate/printTemplate.ts | |
|
||||
| setting.printTemplate | updateTemplate | setting.printTemplate.update | POST | 是 | 否 | setting.printTemplate/printTemplate.ts | |
|
||||
| setting.printTemplate | updateElement | setting.printTemplate.updateElement | POST | 是 | 否 | setting.printTemplate/printTemplate.ts | |
|
||||
| setting.printtemplate | addElement | setting.printTemplate.addElement | POST | 是 | 否 | setting.printtemplate/printTemplate.ts | |
|
||||
| setting.printtemplate | createTemplate | setting.printTemplate.create | POST | 是 | 否 | setting.printtemplate/printTemplate.ts | |
|
||||
| setting.printtemplate | deleteTemplate | setting.printTemplate.delete | POST | 是 | 否 | setting.printtemplate/printTemplate.ts | |
|
||||
| setting.printtemplate | deleteElement | setting.printTemplate.deleteElement | POST | 是 | 否 | setting.printtemplate/printTemplate.ts | |
|
||||
| setting.printtemplate | duplicateElement | setting.printTemplate.duplicateElement | POST | 是 | 否 | setting.printtemplate/printTemplate.ts | |
|
||||
| setting.printtemplate | exportTemplateXml | setting.printTemplate.exportXml | POST | 是 | 否 | setting.printtemplate/printTemplate.ts | |
|
||||
| setting.printtemplate | getTemplateDetail | setting.printTemplate.get | POST | 是 | 否 | setting.printtemplate/printTemplate.ts | |
|
||||
| setting.printtemplate | importTemplateXml | setting.printTemplate.importXml | POST | 是 | 否 | setting.printtemplate/printTemplate.ts | |
|
||||
| setting.printtemplate | listTemplates | setting.printTemplate.list | POST | 是 | 否 | setting.printtemplate/printTemplate.ts | |
|
||||
| setting.printtemplate | listTemplatesByType | setting.printTemplate.listTemplatesByType | POST | 是 | 否 | setting.printtemplate/printTemplate.ts | |
|
||||
| setting.printtemplate | saveTemplate | setting.printTemplate.save | POST | 是 | 否 | setting.printtemplate/printTemplate.ts | |
|
||||
| setting.printtemplate | updateTemplate | setting.printTemplate.update | POST | 是 | 否 | setting.printtemplate/printTemplate.ts | |
|
||||
| setting.printtemplate | updateElement | setting.printTemplate.updateElement | POST | 是 | 否 | setting.printtemplate/printTemplate.ts | |
|
||||
| setting.role | roleAdd | setting.role.add | POST | 是 | 否 | setting.role/role.ts | |
|
||||
| setting.role | roleDelete | setting.role.delete | POST | 是 | 否 | setting.role/role.ts | |
|
||||
| setting.role | roleList | setting.role.list | POST | 是 | 否 | setting.role/role.ts | |
|
||||
@ -180,7 +179,6 @@
|
||||
| stock | saveWarehouseStockBarcode | stock.warehouse.saveWarehouseStockBarcode | POST | 是 | 否 | stock/stock.ts | |
|
||||
| stock | warehouseSearch | stock.warehouse.search | POST | 是 | 否 | stock/stock.ts | |
|
||||
| stock | unbindItem | stock.warehouse.unbindItem | POST | 是 | 否 | stock/stock.ts | |
|
||||
| storage_receiving | sendPrint | print.send | POST | 是 | 否 | storage_receiving/receiving.ts | |
|
||||
| storage_receiving | quickPutaway | storage.inventory.quickPutaway | POST | 是 | 否 | storage_receiving/receiving.ts | |
|
||||
| storage_receiving | addDetail | storage.receiving.addDetail | POST | 否 | 否 | storage_receiving/receiving.ts | |
|
||||
| storage_receiving | addItem | storage.receiving.addItem | POST | 否 | 否 | storage_receiving/receiving.ts | |
|
||||
@ -218,17 +216,17 @@
|
||||
| store | getStoreRoles | store.getStoreRoles | POST | 是 | 否 | store/store.ts | |
|
||||
| store | joinStore | store.joinStore | POST | 是 | 否 | store/store.ts | |
|
||||
| store | joinWarehouse | store.joinWarehouse | POST | 是 | 否 | store/store.ts | |
|
||||
| storeWarehouse.store | storeWarehouseAdjustPrintQuantity | storeWarehouse.store.adjustPrintQuantity | POST | 是 | 否 | storeWarehouse.store/storeWarehouse.ts | |
|
||||
| storeWarehouse.store | storeWarehouseDeleteQimenConfig | storeWarehouse.store.deleteQimenConfig | POST | 是 | 否 | storeWarehouse.store/storeWarehouse.ts | |
|
||||
| storeWarehouse.store | storeWarehouseGetPolicyConfig | storeWarehouse.store.getPolicyConfig | POST | 是 | 否 | storeWarehouse.store/storeWarehouse.ts | |
|
||||
| storeWarehouse.store | storeWarehouseGetPolicyConfigFields | storeWarehouse.store.getPolicyConfigFields | POST | 是 | 否 | storeWarehouse.store/storeWarehouse.ts | |
|
||||
| storeWarehouse.store | storeWarehouseList | storeWarehouse.store.list | POST | 是 | 否 | storeWarehouse.store/storeWarehouse.ts | |
|
||||
| storeWarehouse.store | listApiConfig | storeWarehouse.store.listApiConfig | POST | 是 | 否 | storeWarehouse.store/storeWarehouse.ts | |
|
||||
| storeWarehouse.store | storeWarehouseRename | storeWarehouse.store.rename | POST | 是 | 否 | storeWarehouse.store/storeWarehouse.ts | |
|
||||
| storeWarehouse.store | saveApiConfig | storeWarehouse.store.saveApiConfig | POST | 是 | 否 | storeWarehouse.store/storeWarehouse.ts | |
|
||||
| storeWarehouse.store | storeWarehouseSavePolicyConfig | storeWarehouse.store.savePolicyConfig | POST | 是 | 否 | storeWarehouse.store/storeWarehouse.ts | |
|
||||
| storeWarehouse.store | storeWarehouseSign | storeWarehouse.store.sign | POST | 是 | 否 | storeWarehouse.store/storeWarehouse.ts | |
|
||||
| storeWarehouse.store | storeWarehouseUnbind | storeWarehouse.store.unbind | POST | 是 | 否 | storeWarehouse.store/storeWarehouse.ts | |
|
||||
| storewarehouse.store | storeWarehouseAdjustPrintQuantity | storeWarehouse.store.adjustPrintQuantity | POST | 是 | 否 | storewarehouse.store/storeWarehouse.ts | |
|
||||
| storewarehouse.store | storeWarehouseDeleteQimenConfig | storeWarehouse.store.deleteQimenConfig | POST | 是 | 否 | storewarehouse.store/storeWarehouse.ts | |
|
||||
| storewarehouse.store | storeWarehouseGetPolicyConfig | storeWarehouse.store.getPolicyConfig | POST | 是 | 否 | storewarehouse.store/storeWarehouse.ts | |
|
||||
| storewarehouse.store | storeWarehouseGetPolicyConfigFields | storeWarehouse.store.getPolicyConfigFields | POST | 是 | 否 | storewarehouse.store/storeWarehouse.ts | |
|
||||
| storewarehouse.store | storeWarehouseList | storeWarehouse.store.list | POST | 是 | 否 | storewarehouse.store/storeWarehouse.ts | |
|
||||
| storewarehouse.store | listApiConfig | storeWarehouse.store.listApiConfig | POST | 是 | 否 | storewarehouse.store/storeWarehouse.ts | |
|
||||
| storewarehouse.store | storeWarehouseRename | storeWarehouse.store.rename | POST | 是 | 否 | storewarehouse.store/storeWarehouse.ts | |
|
||||
| storewarehouse.store | saveApiConfig | storeWarehouse.store.saveApiConfig | POST | 是 | 否 | storewarehouse.store/storeWarehouse.ts | |
|
||||
| storewarehouse.store | storeWarehouseSavePolicyConfig | storeWarehouse.store.savePolicyConfig | POST | 是 | 否 | storewarehouse.store/storeWarehouse.ts | |
|
||||
| storewarehouse.store | storeWarehouseSign | storeWarehouse.store.sign | POST | 是 | 否 | storewarehouse.store/storeWarehouse.ts | |
|
||||
| storewarehouse.store | storeWarehouseUnbind | storeWarehouse.store.unbind | POST | 是 | 否 | storewarehouse.store/storeWarehouse.ts | |
|
||||
| user | changeRole | user.changeRole | POST | 是 | 否 | user/user.ts | |
|
||||
| user | getBindWechatCode | user.getBindWechatCode | POST | 是 | 否 | user/user.ts | |
|
||||
| user | getLoginWechatCode | user.getLoginWechatCode | POST | 是 | 否 | user/user.ts | |
|
||||
@ -238,7 +236,7 @@
|
||||
| user | register | user.register | POST | 是 | 否 | user/user.ts | |
|
||||
| user | unbindWechat | user.unbindWechat | POST | 是 | 否 | user/user.ts | |
|
||||
| warehouse | checkBarcodeUnique | warehouse.checkBarcodeUnique | POST | 是 | 否 | warehouse/warehouse.ts | |
|
||||
| warehouse | checkConnectivity | warehouse.checkConnectivity | POST | 是 | 否 | warehouse/warehouse.ts | |
|
||||
| warehouse | checkConnectivity | warehouse.checkConnectivity | POST | 否 | 否 | warehouse/warehouse.ts | |
|
||||
| warehouse | create | warehouse.create | POST | 是 | 否 | warehouse/warehouse.ts | |
|
||||
| warehouse | createRack | warehouse.createRack | POST | 是 | 否 | warehouse/warehouse.ts | |
|
||||
| warehouse | createRackWithSpaces | warehouse.createRackWithSpaces | POST | 是 | 否 | warehouse/warehouse.ts | |
|
||||
|
||||
@ -26,17 +26,33 @@
|
||||
- 条件读取:`workflows/api-doc-agent/config/接口.md`(仅在存在删除项或软删除处理时读取)
|
||||
3. 若 `pending-updates.json` 已给出 `interfaceUpdates`,禁止再遍历读取无关模块文件。
|
||||
4. 任何“扫描全部文件/目录”行为均视为违规(包括为了“确认一下”而做的全量读取)。
|
||||
5. **例外(仅用于 §4 校验)**:允许(1)列出 `src/api` **一级子目录名**;(2)对工作区内 `src/api` 做按字面量 `method:` 的搜索。不得借机通读无关 `.ts` 全文。
|
||||
|
||||
## 1.2 模块目录强制对齐(与 `module-list` / `module` 一致)
|
||||
|
||||
**目标**:`src/api` 的「模块」= `src/api` 下一级子目录;其**个数与命名**必须与远端清洗结果一致,且**双向一一对应** `module-list.json` 中的文档模块。
|
||||
|
||||
1. **权威集合 `M`**:从 `module-list.json` 的 `modules` 数组提取全部 **`folder` 字段**,去重得到集合 `M`。正常情况下 `moduleCount === |M|`,且 `src/api` 应对齐到该 `|M|`。若元数据中 `moduleCount` 与去重后的 `|M|` 不一致,以 `workflows/api-doc-system/data/module/` 下**实际存在的子目录名**为准构造 `M`,并在 §5 结果中注明 `module-list` 元数据异常。
|
||||
2. **强制数量**:`src/api` 下**一级子目录的个数**必须等于 `moduleCount`(即等于 `|M|`),**禁止**多一个、少一个。
|
||||
3. **强制命名**:每个一级目录名必须与 `M` 中对应项 **字符串完全一致**(含大小写、点号)。**禁止**使用与 `folder` 不同的大小写变体(如文档为 `setting.printtemplate` 则目录名必须为 `setting.printtemplate`,不得长期保留 `setting.printTemplate` 等别名;在 Windows 上重命名需必要时经临时名两阶段改名,避免仅大小写变更失败)。
|
||||
4. **双向对应**:
|
||||
- 对任意 `f ∈ M`,必须存在目录 `src/api/<f>/`(且内含至少一个 `.ts` 作为该模块 API 入口层,文件名按项目既有约定即可)。
|
||||
- 对任意 `src/api` 下一级目录 `d`,必须满足 `d ∈ M`;**禁止**出现文档中不存在的杂项目录(例如历史上合并用的裸 `order/` 若不在 `M` 中则必须迁出并删除空目录)。
|
||||
5. **接口归属**:`data/module/<folder>/module.json` 中列出的每个接口,其 **`method` 的封装实现必须位于 `src/api/<folder>/` 下的 `.ts` 文件内**(`params` 等与 `module.json` 一致)。**禁止**把某 `folder` 文档模块下的接口长期写在另一个 `folder` 目录下(例如某接口在文档中归在 `setting.express`,则不得仅写在 `index/` 下;应放在 `src/api/setting.express/` 或按项目规范再分子路径,但首段目录名仍为 `setting.express`)。
|
||||
6. **迁出合并代码**:若发现多个文档 `folder` 的接口被写在同一历史文件(如 `order/order.ts`),必须按 `folder` **拆分目录与文件**,并同步修正业务侧 `import`(至少全局检索旧路径并更新到 `src/api/<folder>/...`)。
|
||||
7. **`接口.md` 的「模块数」**:在遵守本条后,扫描脚本按路径首段聚合的「模块数」**应与 `moduleCount` 一致**;若仍不一致,视为目录命名或残留非法目录未清干净,**不算完成**。
|
||||
|
||||
## 2. 自动执行步骤(严格顺序)
|
||||
|
||||
1. 读取 `pending-updates.json`。
|
||||
2. 若 `pending-updates.json` 为 `{}`,先执行 `npm run apiconfig`。
|
||||
3. 无论 `pending-updates.json` 是否为 `{}`,都必须读取 `module-list.json`,但只提取本次变更涉及的 `folder` 列表(禁止全量展开所有模块细节)。
|
||||
3. 读取 `module-list.json`,构造集合 `M`(见 §1.2),并列出 `src/api` 当前一级子目录集合 `D`(允许使用 §1.1 第 5 条的目录列举)。若 `D ≠ M`(元素或数量不一致),**必须先**完成目录级对齐:新建缺失的 `src/api/<folder>/`、将误放接口迁回对应 `<folder>`、删除或改名不在 `M` 中的目录,直至 `D = M`;再处理接口级增删改。
|
||||
4. 若 `pending-updates.json` 存在变更项(接口增删、`Params/Response` 变化),按“增删优先”原则更新 `src/api`:
|
||||
- 新增/更新:只读取对应 `folder` 的 `module.json`,并只修改对应 `src/api` 文件。
|
||||
- 新增/更新:只读对应 `folder` 的 `module.json` 中本次涉及条目(含 Params),**仅在** `src/api/<folder>/` 下增改 `.ts`。
|
||||
- 删除:不硬删除代码;仅在 `config/接口.md` 标记 `启用=否`(仅处理命中 method)。
|
||||
5. 若 `pending-updates.json` 为 `{}` 且 `npm run apiconfig` 后仍为 `{}`,仅执行一致性检查,不得触发全量文件读取。
|
||||
5. 若 `pending-updates.json` 为 `{}` 且 `npm run apiconfig` 后仍为 `{}`,仍须执行 §4 的**目录集合 + method 归属**校验(§1.1 第 5 条)。
|
||||
6. 完成接口改动后,执行 `npm run apiagent -- --script api-list-update`。
|
||||
7. 在 §5 结果输出中给出:`M` 与对齐前 `D` 的差异摘要;若有 **method 未出现在其 `folder` 目录下** 的项,逐条列出(视为未完成直至修复)。
|
||||
|
||||
## 3. `config/接口.md` 维护规则(必须遵守)
|
||||
|
||||
@ -48,18 +64,20 @@
|
||||
|
||||
## 4. 完成判定
|
||||
|
||||
以下条件同时满足才算完成:
|
||||
以下条件**同时**满足才算完成(**强制目录与 module 一致**,见 §1.2):
|
||||
|
||||
1. `src/api` 的文件数与模块结构和 `module` 数据一致。
|
||||
2. `src/api` 中接口定义满足对应 `module` 的 `params` 传参要求。
|
||||
3. `npm run apiagent -- --script api-list-update` 执行成功。
|
||||
4. `pending-updates.json` 已被清空为 `{}`。
|
||||
1. **目录集合一致**:`src/api` 一级子目录名构成的集合与 `module-list` 导出的集合 `M` **完全相等**;`src/api` 子目录个数 **=** `moduleCount`。
|
||||
2. **接口归属一致**:对每个 `folder ∈ M`,`data/module/<folder>/module.json` 中的每个 `method` 要么(a)在 `src/api/<folder>/` 下某 `.ts` 中出现对应封装,要么(b)已按 §3 在 `接口.md` 中对同一 `method` 标记为禁用;Params 等与文档一致(无文档 Params 时可为空对象或合理宽类型)。
|
||||
3. **无跨目录挂靠**:任一启用接口的 `method` 字符串,其所在文件路径的首段目录名必须等于该接口所属文档的 `folder`(与 §1.2 第 5 条一致)。
|
||||
4. `npm run apiagent -- --script api-list-update` 执行成功,且输出中的「模块数」**等于** `moduleCount`(否则继续清理非法目录或错误命名直至一致)。
|
||||
5. `pending-updates.json` 已被清空为 `{}`(在确认第 1~4 条已满足后执行 `npm run apiconfig:clear-pending`)。
|
||||
|
||||
## 5. 结果输出
|
||||
|
||||
返回以下信息:
|
||||
|
||||
- 更新统计:模块变更数量、接口变更数量
|
||||
- 实际改动文件:`src/api/...`
|
||||
- 异常接口列表(若有)
|
||||
- 更新统计:`pending` / `module-list.changes` 中的模块变更数量、接口变更数量
|
||||
- **目录对齐**:对齐前 `D` 与目标集合 `M` 的差集(多目录、少目录、命名不一致项);对齐后确认 `D = M`
|
||||
- 实际改动文件:`src/api/...` 及因迁目录而改动的 `import` 路径(若有)
|
||||
- 异常列表:`method` 未出现在其 `folder` 目录下、Params 明显不一致、或 `接口.md`「模块数」≠ `moduleCount` 的项(若有)
|
||||
- 收尾结果:`api-list-update` 与 `clear-pending` 执行状态
|
||||
|
||||
@ -8,57 +8,29 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"method": "setting.expressInterface.list",
|
||||
"method": "order.pendingOrder.list",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "setting.expressInterface.create",
|
||||
"body": {
|
||||
}
|
||||
},
|
||||
{
|
||||
"method": "setting.expressInterface.update",
|
||||
"method": "order.pendingOrder.reverseReviewOrder",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "setting.expressInterface.delete",
|
||||
"method": "order.pendingOrder.markPendingOutboundOrder",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "",
|
||||
"method": "order.pendingOrder.cancelOrder",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "",
|
||||
"method": "order.pendingOrder.allocateExpressCode",
|
||||
"body": {}
|
||||
}
|
||||
],
|
||||
"successMessages": [
|
||||
"ok",
|
||||
"成功",
|
||||
"登录成功"
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,58 +1,227 @@
|
||||
[
|
||||
{
|
||||
"接口": "user.login",
|
||||
"message": "登录成功",
|
||||
"data": {
|
||||
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywidXNlcm5hbWUiOiJ5am0iLCJyZWFsX25hbWUiOiJ5aW4iLCJwbGF0Zm9ybV9jb2RlIjoid2ViIiwiY3VycmVudF9yb2xlX2lkIjozMSwiY3VycmVudF9zdG9yZV9pZCI6MTAwMDAwLCJpYXQiOjE3NzY0Mjc1MTEsImV4cCI6MTc3NjQ0MTkxMX0.h2EZ06SLDAZAGSiC8sXdLb3VShAylMm_n2RF4NQe48g"
|
||||
}
|
||||
{
|
||||
"数据一览": {
|
||||
"当前请求数": 6,
|
||||
"成功数": 2,
|
||||
"全部请求数": 6,
|
||||
"成功数与全部请求数": "2/6",
|
||||
"成功判定名单": [
|
||||
"ok",
|
||||
"成功",
|
||||
"登录成功"
|
||||
],
|
||||
"失败接口": [
|
||||
{
|
||||
"接口": "order.pendingOrder.reverseReviewOrder",
|
||||
"message": "接口错误: 订单ID不能为空",
|
||||
"code": 500,
|
||||
"模块目录": "order.pendingorder",
|
||||
"api封装": [
|
||||
{
|
||||
"文件": "src/api/order.pendingorder/orderpendingOrder.ts",
|
||||
"方法名": "orderPendingOrderReverseReviewOrder"
|
||||
},
|
||||
{
|
||||
"文件": "src/api/order.pendingorder/orderpendingOrder.ts",
|
||||
"方法名": "orderPendingOrder.reverseReviewOrder",
|
||||
"说明": "聚合对象方法"
|
||||
}
|
||||
],
|
||||
"引用页面": [
|
||||
"src/views/order/orderManagement/pendingOrder.vue"
|
||||
]
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.markPendingOutboundOrder",
|
||||
"message": "接口错误: 待处理出库接口仅支持 ids 数组入参",
|
||||
"code": 500,
|
||||
"模块目录": "order.pendingorder",
|
||||
"api封装": [
|
||||
{
|
||||
"文件": "src/api/order.pendingorder/orderpendingOrder.ts",
|
||||
"方法名": "orderPendingOrderMarkPendingOutboundOrder"
|
||||
},
|
||||
{
|
||||
"文件": "src/api/order.pendingorder/orderpendingOrder.ts",
|
||||
"方法名": "orderPendingOrder.markPendingOutboundOrder",
|
||||
"说明": "聚合对象方法"
|
||||
}
|
||||
],
|
||||
"引用页面": [
|
||||
"src/views/order/orderManagement/pendingOrder.vue"
|
||||
]
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.cancelOrder",
|
||||
"message": "接口错误: 待处理取消接口仅支持 ids 数组入参",
|
||||
"code": 500,
|
||||
"模块目录": "order.pendingorder",
|
||||
"api封装": [
|
||||
{
|
||||
"文件": "src/api/order.pendingorder/orderpendingOrder.ts",
|
||||
"方法名": "orderPendingOrderCancelOrder"
|
||||
},
|
||||
{
|
||||
"文件": "src/api/order.pendingorder/orderpendingOrder.ts",
|
||||
"方法名": "orderPendingOrder.cancelOrder",
|
||||
"说明": "聚合对象方法"
|
||||
}
|
||||
],
|
||||
"引用页面": [
|
||||
"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"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"接口": "setting.expressInterface.list",
|
||||
"message": "ok",
|
||||
"data": {
|
||||
"list": [
|
||||
{
|
||||
"id": 2,
|
||||
"name": "申通-快手",
|
||||
"express_code": "STO",
|
||||
"warehouse_id": 100000,
|
||||
"platform_code": "kuaishou",
|
||||
"express_platform_id": 1,
|
||||
"sender_name": "吴先生",
|
||||
"sender_tel": "15197817068",
|
||||
"weight": 1,
|
||||
"token": "db820eeeb6c8425eb3f1cc25a28fb2f8",
|
||||
"viewer": null,
|
||||
"client_id": null,
|
||||
"is_share": 0,
|
||||
"share_id": null,
|
||||
"can_use_count": 0,
|
||||
"province_name": "广东省",
|
||||
"city_name": "广州市",
|
||||
"district_name": "白云区",
|
||||
"site_code": "526126",
|
||||
"product_type": null,
|
||||
"shop_name": "仓配吴哥688(天豹云仓@仓配小吴哥)"
|
||||
"详情": [
|
||||
{
|
||||
"接口": "user.login",
|
||||
"message": "登录成功",
|
||||
"code": 200,
|
||||
"data": {
|
||||
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywidXNlcm5hbWUiOiJ5am0iLCJyZWFsX25hbWUiOiJ5aW4iLCJwbGF0Zm9ybV9jb2RlIjoid2ViIiwiY3VycmVudF9yb2xlX2lkIjozMSwiY3VycmVudF9zdG9yZV9pZCI6MTAwMDAwLCJpYXQiOjE3NzY1MTQwNDcsImV4cCI6MTc3NjUyODQ0N30.jFWl1I2OOPMTNq1x8LGj6oRzIOrWvZhA2oON2Jd23fU"
|
||||
}
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.list",
|
||||
"message": "ok",
|
||||
"code": 1,
|
||||
"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,
|
||||
"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": []
|
||||
}
|
||||
],
|
||||
"pagination": {
|
||||
"page": 1,
|
||||
"pageSize": 20,
|
||||
"total": 1,
|
||||
"totalPages": 1,
|
||||
"hasPrevious": false,
|
||||
"hasNext": false
|
||||
}
|
||||
],
|
||||
"total": 1,
|
||||
"page": 1,
|
||||
"page_size": 20
|
||||
}
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.reverseReviewOrder",
|
||||
"message": "接口错误: 订单ID不能为空",
|
||||
"code": 500,
|
||||
"data": null
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.markPendingOutboundOrder",
|
||||
"message": "接口错误: 待处理出库接口仅支持 ids 数组入参",
|
||||
"code": 500,
|
||||
"data": null
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.cancelOrder",
|
||||
"message": "接口错误: 待处理取消接口仅支持 ids 数组入参",
|
||||
"code": 500,
|
||||
"data": null
|
||||
},
|
||||
{
|
||||
"接口": "order.pendingOrder.allocateExpressCode",
|
||||
"message": "接口错误: 分配快递号接口仅支持订单对象数组入参",
|
||||
"code": 500,
|
||||
"data": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"接口": "setting.expressInterface.create",
|
||||
"message": "express_platform_id 参数不能为空",
|
||||
"data": null
|
||||
},
|
||||
{
|
||||
"接口": "setting.expressInterface.update",
|
||||
"message": "id 参数不能为空",
|
||||
"data": null
|
||||
},
|
||||
{
|
||||
"接口": "setting.expressInterface.delete",
|
||||
"message": "id 参数不能为空",
|
||||
"data": null
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
||||
import { mkdir, readdir, readFile, writeFile, stat } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { crawlApi } from "../apidata/crawler.mjs";
|
||||
|
||||
@ -6,6 +6,8 @@ const APIDATA_DIR = path.join("workflows", "api-doc-system", "apidata");
|
||||
const APIDATA_CONFIG_FILE = path.join(APIDATA_DIR, "config.json");
|
||||
const APIDATA_DATA_FILE = path.join(APIDATA_DIR, "data.json");
|
||||
const RESPONSE_MARKDOWN_FILE = path.join("workflows", "api-doc-agent", "config", "响应.md");
|
||||
const MODULE_DATA_ROOT = path.join("workflows", "api-doc-system", "data", "module");
|
||||
const MODULE_LIST_FILE = path.join("workflows", "api-doc-system", "data", "module-list", "module-list.json");
|
||||
|
||||
const CRAWLER_CONFIG = {
|
||||
baseUrl: "http://192.168.11.56:6060/system",
|
||||
@ -13,6 +15,68 @@ const CRAWLER_CONFIG = {
|
||||
timeoutMs: 20000,
|
||||
};
|
||||
|
||||
const LOGIN_METHOD = "user.login";
|
||||
|
||||
/** apidata/config.json 未配置 successMessages 时使用;可在 config 中写 successMessages 数组覆盖 */
|
||||
const DEFAULT_SUCCESS_MESSAGES = ["ok", "成功", "登录成功"];
|
||||
|
||||
function normalizeSuccessMessageKey(value) {
|
||||
return String(value ?? "")
|
||||
.trim()
|
||||
.toLowerCase();
|
||||
}
|
||||
|
||||
function resolveSuccessMessages(rawConfig) {
|
||||
const arr = rawConfig?.successMessages;
|
||||
if (Array.isArray(arr) && arr.length > 0) {
|
||||
const cleaned = arr.map((x) => String(x).trim()).filter(Boolean);
|
||||
if (cleaned.length > 0) {
|
||||
return cleaned;
|
||||
}
|
||||
}
|
||||
return [...DEFAULT_SUCCESS_MESSAGES];
|
||||
}
|
||||
|
||||
/** message 与成功名单某项在 trim + 小写比较下一致则视为成功(英文 ok 与 OK 等价) */
|
||||
function isResponseMessageOk(message, successMessages) {
|
||||
const key = normalizeSuccessMessageKey(message);
|
||||
if (!key) {
|
||||
return false;
|
||||
}
|
||||
const allow = new Set(successMessages.map((x) => normalizeSuccessMessageKey(x)).filter(Boolean));
|
||||
return allow.has(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array<{ 接口: string, message: string, code?: unknown, data: unknown }>} rows
|
||||
* @param {string[]} successMessages
|
||||
*/
|
||||
function buildDataOverview(rows, successMessages) {
|
||||
const total = rows.length;
|
||||
let success = 0;
|
||||
/** @type {{ 接口: string, message: string, code: unknown }[]} */
|
||||
const 失败接口 = [];
|
||||
for (const row of rows) {
|
||||
if (isResponseMessageOk(row.message, successMessages)) {
|
||||
success += 1;
|
||||
} else {
|
||||
失败接口.push({
|
||||
接口: row.接口,
|
||||
message: String(row.message ?? ""),
|
||||
code: row.code ?? null,
|
||||
});
|
||||
}
|
||||
}
|
||||
return {
|
||||
当前请求数: total,
|
||||
成功数: success,
|
||||
全部请求数: total,
|
||||
成功数与全部请求数: `${success}/${total}`,
|
||||
成功判定名单: [...successMessages],
|
||||
失败接口,
|
||||
};
|
||||
}
|
||||
|
||||
function ensurePlainObject(value, fallbackValue = {}) {
|
||||
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
||||
return fallbackValue;
|
||||
@ -38,7 +102,7 @@ function normalizeConfigRequest(item) {
|
||||
return {
|
||||
method,
|
||||
body: ensurePlainObject(item?.body, {}),
|
||||
needAuth: item?.needAuth ?? method !== "user.login",
|
||||
needAuth: item?.needAuth ?? method !== LOGIN_METHOD,
|
||||
};
|
||||
}
|
||||
|
||||
@ -55,24 +119,604 @@ function normalizeConfig(rawConfig) {
|
||||
};
|
||||
}
|
||||
|
||||
function createMarkdownContent(rows) {
|
||||
const generatedAt = new Date().toLocaleString("zh-CN", { hour12: false });
|
||||
return [
|
||||
"# 接口响应",
|
||||
"",
|
||||
`更新时间: ${generatedAt}`,
|
||||
"",
|
||||
"```json",
|
||||
JSON.stringify(rows, null, 2),
|
||||
"```",
|
||||
"",
|
||||
].join("\n");
|
||||
function printHelp() {
|
||||
console.log(`
|
||||
apidata — 按 config.json 请求远端并写入 apidata/data.json 与 api-doc-agent/config/响应.md(响应.md 仅含各接口 method 与 data)
|
||||
|
||||
成功判定: 响应 message 与「成功判定名单」某项在 trim 且英文忽略大小写后一致即成功(默认含 ok、成功、登录成功)。
|
||||
可在 apidata/config.json 根级设置 successMessages 数组覆盖默认名单。
|
||||
|
||||
失败接口: 写入 data.json 时会在每条失败记录上附加「模块目录」(来自 data/module-list/module-list.json)、
|
||||
「api封装」(在 src/api 中匹配到的 export)及「引用页面」(扫描 src/views、src/components、src/layout 下 .vue/.ts/.tsx 的引用路径,相对仓库根)。
|
||||
|
||||
用法:
|
||||
npm run apiconfig:apidata
|
||||
npm run apiconfig:apidata -- [选项] [模块名 ...]
|
||||
|
||||
选项:
|
||||
-c, -r, --clear 清空除 ${LOGIN_METHOD} 外的请求项(无模块名时仅保留登录)
|
||||
-n, --no-clear 指定模块时仍保留 config 中其它模块的请求(默认:指定模块时会先清空)
|
||||
-h, --help 显示本说明
|
||||
|
||||
模块名:
|
||||
与 data/module/<folder> 一致,例如 order.index、order.revieworder(大小写不敏感)
|
||||
指定一个或多个模块时,默认会先「清空除登录外的条目」,再写入这些模块在 module.json 中的全部 method。
|
||||
|
||||
示例:
|
||||
npm run apiconfig:apidata
|
||||
npm run apiconfig:apidata -- order.index order.revieworder
|
||||
npm run apiconfig:apidata -- -c
|
||||
npm run apiconfig:apidata -- --no-clear order.index
|
||||
`);
|
||||
}
|
||||
|
||||
async function run() {
|
||||
const config = normalizeConfig(await readJson(APIDATA_CONFIG_FILE));
|
||||
/**
|
||||
* @param {string[]} argv process.argv.slice(2)
|
||||
*/
|
||||
export function parseApidataCli(argv) {
|
||||
const flags = { clear: false, noClear: false, help: false };
|
||||
const positionals = [];
|
||||
|
||||
await writeJson(APIDATA_DATA_FILE, []);
|
||||
for (const arg of argv) {
|
||||
if (arg === "--") {
|
||||
continue;
|
||||
}
|
||||
if (arg === "-h" || arg === "--help") {
|
||||
flags.help = true;
|
||||
continue;
|
||||
}
|
||||
if (arg === "-c" || arg === "-r" || arg === "--clear") {
|
||||
flags.clear = true;
|
||||
continue;
|
||||
}
|
||||
if (arg === "-n" || arg === "--no-clear") {
|
||||
flags.noClear = true;
|
||||
continue;
|
||||
}
|
||||
if (arg.startsWith("-")) {
|
||||
throw new Error(`未知参数: ${arg}(使用 --help 查看说明)`);
|
||||
}
|
||||
positionals.push(arg.trim());
|
||||
}
|
||||
|
||||
const modules = positionals.filter(Boolean);
|
||||
let clearOld = false;
|
||||
if (flags.help) {
|
||||
return { flags, modules, clearOld, help: true };
|
||||
}
|
||||
if (flags.noClear && flags.clear) {
|
||||
throw new Error("不能同时使用 --clear 与 --no-clear");
|
||||
}
|
||||
if (modules.length > 0) {
|
||||
clearOld = !flags.noClear;
|
||||
} else {
|
||||
clearOld = flags.clear;
|
||||
}
|
||||
|
||||
return { flags, modules, clearOld, help: false };
|
||||
}
|
||||
|
||||
async function listModuleFolders() {
|
||||
const entries = await readdir(MODULE_DATA_ROOT, { withFileTypes: true });
|
||||
return entries.filter((e) => e.isDirectory()).map((e) => e.name);
|
||||
}
|
||||
|
||||
async function resolveModuleFolder(userInput) {
|
||||
const name = String(userInput ?? "").trim();
|
||||
if (!name) {
|
||||
return null;
|
||||
}
|
||||
const folders = await listModuleFolders();
|
||||
const exact = folders.find((f) => f === name);
|
||||
if (exact) {
|
||||
return exact;
|
||||
}
|
||||
const lower = name.toLowerCase();
|
||||
const ci = folders.find((f) => f.toLowerCase() === lower);
|
||||
if (ci) {
|
||||
return ci;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
async function loadMethodsFromModuleFolder(folder) {
|
||||
const filePath = path.join(MODULE_DATA_ROOT, folder, "module.json");
|
||||
const raw = await readJson(filePath);
|
||||
const list = Array.isArray(raw?.interfaces) ? raw.interfaces : [];
|
||||
const methods = [];
|
||||
for (const item of list) {
|
||||
const m = String(item?.method ?? "").trim();
|
||||
if (m) {
|
||||
methods.push(m);
|
||||
}
|
||||
}
|
||||
return methods;
|
||||
}
|
||||
|
||||
function requestEntry(method, body = {}) {
|
||||
return {
|
||||
method,
|
||||
body: ensurePlainObject(body, {}),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {{ existingRaw: object, modules: string[], clearOld: boolean }} opts
|
||||
*/
|
||||
async function buildAndWriteConfig(opts) {
|
||||
const { existingRaw, modules, clearOld } = opts;
|
||||
const existing = normalizeConfig(existingRaw);
|
||||
const loginReq = existing.requests.find((r) => r.method === LOGIN_METHOD);
|
||||
|
||||
const methodToRequest = new Map();
|
||||
for (const r of existing.requests) {
|
||||
methodToRequest.set(r.method, { method: r.method, body: { ...r.body }, needAuth: r.needAuth });
|
||||
}
|
||||
|
||||
const unknownModules = [];
|
||||
const moduleMethodsOrdered = [];
|
||||
|
||||
for (const mod of modules) {
|
||||
const folder = await resolveModuleFolder(mod);
|
||||
if (!folder) {
|
||||
unknownModules.push(mod);
|
||||
continue;
|
||||
}
|
||||
const methods = await loadMethodsFromModuleFolder(folder);
|
||||
for (const m of methods) {
|
||||
moduleMethodsOrdered.push(m);
|
||||
}
|
||||
}
|
||||
|
||||
const seenMethod = new Set();
|
||||
const uniqueModuleMethods = [];
|
||||
for (const m of moduleMethodsOrdered) {
|
||||
if (seenMethod.has(m)) {
|
||||
continue;
|
||||
}
|
||||
seenMethod.add(m);
|
||||
uniqueModuleMethods.push(m);
|
||||
}
|
||||
|
||||
if (unknownModules.length) {
|
||||
const available = (await listModuleFolders()).sort().join(", ");
|
||||
throw new Error(
|
||||
`未找到模块: ${unknownModules.join(", ")}\n` + `data/module 下可用 folder: ${available}`,
|
||||
);
|
||||
}
|
||||
|
||||
const moduleMethodSet = new Set(uniqueModuleMethods);
|
||||
|
||||
let nextRequests = [];
|
||||
|
||||
if (clearOld) {
|
||||
if (loginReq) {
|
||||
nextRequests.push(requestEntry(LOGIN_METHOD, loginReq.body));
|
||||
} else {
|
||||
throw new Error(`清空模式下需要在 config.json 中保留 ${LOGIN_METHOD} 及 body,以便后续接口鉴权`);
|
||||
}
|
||||
for (const m of uniqueModuleMethods) {
|
||||
if (m === LOGIN_METHOD) {
|
||||
continue;
|
||||
}
|
||||
nextRequests.push(requestEntry(m, {}));
|
||||
}
|
||||
} else if (modules.length > 0) {
|
||||
const merged = [];
|
||||
for (const r of existing.requests) {
|
||||
if (r.method === LOGIN_METHOD) {
|
||||
merged.push({ method: r.method, body: { ...r.body } });
|
||||
continue;
|
||||
}
|
||||
if (moduleMethodSet.has(r.method)) {
|
||||
continue;
|
||||
}
|
||||
merged.push({ method: r.method, body: { ...r.body } });
|
||||
}
|
||||
for (const m of uniqueModuleMethods) {
|
||||
if (m === LOGIN_METHOD) {
|
||||
continue;
|
||||
}
|
||||
const prev = methodToRequest.get(m);
|
||||
merged.push(requestEntry(m, prev?.body ?? {}));
|
||||
}
|
||||
nextRequests = merged;
|
||||
const hasLogin = nextRequests.some((r) => r.method === LOGIN_METHOD);
|
||||
if (!hasLogin) {
|
||||
throw new Error(`config 中须包含 ${LOGIN_METHOD},或先使用清空模式生成配置`);
|
||||
}
|
||||
} else {
|
||||
nextRequests = existing.requests.map((r) => ({ method: r.method, body: { ...r.body } }));
|
||||
}
|
||||
|
||||
nextRequests.sort((a, b) => {
|
||||
if (a.method === LOGIN_METHOD) {
|
||||
return -1;
|
||||
}
|
||||
if (b.method === LOGIN_METHOD) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
const out = {
|
||||
requests: nextRequests.map((r) => ({
|
||||
method: r.method,
|
||||
body: r.body ?? {},
|
||||
})),
|
||||
};
|
||||
|
||||
const prevSm = existingRaw?.successMessages;
|
||||
if (Array.isArray(prevSm) && prevSm.length > 0) {
|
||||
const cleaned = prevSm.map((x) => String(x).trim()).filter(Boolean);
|
||||
if (cleaned.length > 0) {
|
||||
out.successMessages = cleaned;
|
||||
}
|
||||
}
|
||||
|
||||
await writeJson(APIDATA_CONFIG_FILE, out);
|
||||
console.log(`已更新 ${APIDATA_CONFIG_FILE}(共 ${out.requests.length} 条请求)`);
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* 响应.md 仅含「接口 method + 响应 data」,不含数据一览、message 等。
|
||||
* @param {Array<{ 接口: string, message?: string, code?: unknown, data: unknown }>} rows
|
||||
*/
|
||||
function buildMethodDataOnlyForMarkdown(rows) {
|
||||
return rows.map((row) => ({
|
||||
接口: row.接口,
|
||||
data: row.data ?? null,
|
||||
}));
|
||||
}
|
||||
|
||||
function createResponseMarkdown(rows) {
|
||||
const slim = buildMethodDataOnlyForMarkdown(rows);
|
||||
return ["```json", JSON.stringify(slim, null, 2), "```", ""].join("\n");
|
||||
}
|
||||
|
||||
function escapeRegex(s) {
|
||||
return String(s).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||
}
|
||||
|
||||
function toPosix(p) {
|
||||
return p.split(path.sep).join("/");
|
||||
}
|
||||
|
||||
/** @returns {Promise<string[]>} */
|
||||
async function walkFilesRecursive(rootDir, { extensions } = {}) {
|
||||
const out = [];
|
||||
let st;
|
||||
try {
|
||||
st = await stat(rootDir);
|
||||
} catch {
|
||||
return out;
|
||||
}
|
||||
if (!st.isDirectory()) {
|
||||
return out;
|
||||
}
|
||||
const entries = await readdir(rootDir, { withFileTypes: true });
|
||||
for (const e of entries) {
|
||||
const full = path.join(rootDir, e.name);
|
||||
if (e.isDirectory()) {
|
||||
out.push(...(await walkFilesRecursive(full, { extensions })));
|
||||
} else if (e.isFile()) {
|
||||
if (extensions && extensions.length > 0) {
|
||||
const ext = path.extname(e.name).toLowerCase();
|
||||
if (!extensions.includes(ext)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
out.push(full);
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从 module-list.json 构建 method -> folder(module.json 所在目录名,对应 src/api/<folder>)
|
||||
* @returns {Promise<Map<string, string>>}
|
||||
*/
|
||||
async function loadMethodToFolderFromModuleList() {
|
||||
const map = new Map();
|
||||
try {
|
||||
const raw = await readJson(MODULE_LIST_FILE);
|
||||
const modules = Array.isArray(raw?.modules) ? raw.modules : [];
|
||||
for (const mod of modules) {
|
||||
const folder = String(mod?.folder ?? "").trim();
|
||||
const interfaces = Array.isArray(mod?.interfaces) ? mod.interfaces : [];
|
||||
for (const it of interfaces) {
|
||||
const m = String(it?.method ?? "").trim();
|
||||
if (m && folder && !map.has(m)) {
|
||||
map.set(m, folder);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// 无 module-list 时仅全量扫描 src/api
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} apiFileAbs
|
||||
* @param {string} repoRoot
|
||||
*/
|
||||
function apiFileToImportPath(apiFileAbs, repoRoot) {
|
||||
const rel = toPosix(path.relative(repoRoot, apiFileAbs));
|
||||
const withoutExt = rel.replace(/\.ts$/i, "");
|
||||
if (withoutExt.startsWith("src/")) {
|
||||
return "@" + withoutExt.slice("src".length);
|
||||
}
|
||||
return "@" + withoutExt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析单文件:method 字符串对应的封装(export function / export const fn = ( / 聚合对象上的属性)
|
||||
* @returns {{ kind: 'function', exportName: string } | { kind: 'objectProperty', objectName: string, propName: string }}[]
|
||||
*/
|
||||
function extractWrappersFromApiSource(content, methodStr) {
|
||||
const needleSingle = `method: '${methodStr}'`;
|
||||
const needleDouble = `method: "${methodStr}"`;
|
||||
if (!content.includes(needleSingle) && !content.includes(needleDouble)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const lines = content.split(/\r?\n/);
|
||||
let currentExport = null;
|
||||
/** @type {Map<string, Set<string>>} method -> function export names */
|
||||
const methodToFnExports = new Map();
|
||||
|
||||
const exportFnRe = /export\s+function\s+(\w+)\s*\(/;
|
||||
const exportConstFnRe = /export\s+const\s+(\w+)\s*=\s*(?:async\s*)?\(/;
|
||||
const methodLineRe = /method:\s*['"]([^'"]+)['"]/;
|
||||
|
||||
function addFnExport(meth, name) {
|
||||
if (!meth || !name) {
|
||||
return;
|
||||
}
|
||||
if (!methodToFnExports.has(meth)) {
|
||||
methodToFnExports.set(meth, new Set());
|
||||
}
|
||||
methodToFnExports.get(meth).add(name);
|
||||
}
|
||||
|
||||
for (const line of lines) {
|
||||
let m = line.match(exportFnRe);
|
||||
if (m) {
|
||||
currentExport = m[1];
|
||||
} else {
|
||||
m = line.match(exportConstFnRe);
|
||||
if (m) {
|
||||
currentExport = m[1];
|
||||
}
|
||||
}
|
||||
const mm = line.match(methodLineRe);
|
||||
if (mm && currentExport) {
|
||||
addFnExport(mm[1], currentExport);
|
||||
}
|
||||
}
|
||||
|
||||
const fnNames = methodToFnExports.get(methodStr);
|
||||
if (!fnNames || fnNames.size === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
/** @type {any[]} */
|
||||
const wrappers = [];
|
||||
for (const fnName of fnNames) {
|
||||
wrappers.push({ kind: "function", exportName: fnName });
|
||||
for (const { objectName, propName } of findObjectPropertyAliases(content, fnName)) {
|
||||
wrappers.push({ kind: "objectProperty", objectName, propName });
|
||||
}
|
||||
}
|
||||
return wrappers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} content
|
||||
* @param {string} fnName
|
||||
* @returns {{ objectName: string, propName: string }[]}
|
||||
*/
|
||||
function findObjectPropertyAliases(content, fnName) {
|
||||
const re = new RegExp(`\\b(\\w+)\\s*:\\s*${escapeRegex(fnName)}\\b`, "g");
|
||||
const results = [];
|
||||
let m;
|
||||
while ((m = re.exec(content)) !== null) {
|
||||
const propName = m[1];
|
||||
const before = content.slice(0, m.index);
|
||||
const objs = [...before.matchAll(/export\s+const\s+(\w+)\s*=\s*\{/g)];
|
||||
if (objs.length === 0) {
|
||||
continue;
|
||||
}
|
||||
const objectName = objs[objs.length - 1][1];
|
||||
results.push({ objectName, propName });
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} importPath
|
||||
*/
|
||||
function importsFromPath(content, importPath) {
|
||||
return new RegExp(`from\\s*['"]${escapeRegex(importPath)}['"]`).test(content);
|
||||
}
|
||||
|
||||
/**
|
||||
* import { a, b } from 'path'(支持多行)
|
||||
*/
|
||||
function namedImportDeclaresSymbol(content, importPath, symbol) {
|
||||
if (!importsFromPath(content, importPath)) {
|
||||
return false;
|
||||
}
|
||||
const ep = escapeRegex(importPath);
|
||||
const blocks = [...content.matchAll(new RegExp(`import\\s*\\{([\\s\\S]*?)\\}\\s*from\\s*['"]${ep}['"]`, "g"))];
|
||||
for (const b of blocks) {
|
||||
if (new RegExp(`\\b${escapeRegex(symbol)}\\b`).test(b[1])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function namespaceAlias(content, importPath) {
|
||||
const ep = escapeRegex(importPath);
|
||||
const m = content.match(new RegExp(`import\\s*\\*\\s*as\\s+(\\w+)\\s+from\\s*['"]${ep}['"]`));
|
||||
return m ? m[1] : null;
|
||||
}
|
||||
|
||||
function viewUsesFunctionExport(content, importPath, exportName) {
|
||||
const alias = namespaceAlias(content, importPath);
|
||||
if (alias && new RegExp(`\\b${escapeRegex(alias)}\\.${escapeRegex(exportName)}\\s*\\(`).test(content)) {
|
||||
return true;
|
||||
}
|
||||
if (namedImportDeclaresSymbol(content, importPath, exportName)) {
|
||||
if (new RegExp(`(?:^|[^.\\w])${escapeRegex(exportName)}\\s*\\(`).test(content)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function viewUsesObjectProperty(content, importPath, objectName, propName) {
|
||||
if (!namedImportDeclaresSymbol(content, importPath, objectName)) {
|
||||
return false;
|
||||
}
|
||||
return new RegExp(
|
||||
`\\b${escapeRegex(objectName)}\\.${escapeRegex(propName)}\\s*\\(`,
|
||||
).test(content);
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫描整个 src/api(module-list 的 folder 仅写入失败项的「模块目录」,不排除其它目录下的同名 method 封装)
|
||||
* @param {string} repoRoot
|
||||
* @param {string} methodStr
|
||||
*/
|
||||
async function collectWrappersForMethod(repoRoot, methodStr) {
|
||||
const srcApi = path.join(repoRoot, "src", "api");
|
||||
const tsFiles = await walkFilesRecursive(srcApi, { extensions: [".ts"] });
|
||||
|
||||
const seen = new Set();
|
||||
/** @type {{ relFile: string, importPath: string, kind: string, exportName?: string, objectName?: string, propName?: string }[]} */
|
||||
const out = [];
|
||||
|
||||
for (const abs of tsFiles) {
|
||||
let text;
|
||||
try {
|
||||
text = await readFile(abs, "utf8");
|
||||
} catch {
|
||||
continue;
|
||||
}
|
||||
const wrappers = extractWrappersFromApiSource(text, methodStr);
|
||||
if (wrappers.length === 0) {
|
||||
continue;
|
||||
}
|
||||
const relFile = toPosix(path.relative(repoRoot, abs));
|
||||
const importPath = apiFileToImportPath(abs, repoRoot);
|
||||
for (const w of wrappers) {
|
||||
const key =
|
||||
w.kind === "function"
|
||||
? `${relFile}|fn|${w.exportName}`
|
||||
: `${relFile}|obj|${w.objectName}.${w.propName}`;
|
||||
if (seen.has(key)) {
|
||||
continue;
|
||||
}
|
||||
seen.add(key);
|
||||
if (w.kind === "function") {
|
||||
out.push({ relFile, importPath, kind: "function", exportName: w.exportName });
|
||||
} else {
|
||||
out.push({
|
||||
relFile,
|
||||
importPath,
|
||||
kind: "objectProperty",
|
||||
objectName: w.objectName,
|
||||
propName: w.propName,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
/** 失败接口「引用页面」扫描目录(相对 src/) */
|
||||
const APIDATA_USAGE_SCAN_SEGMENTS = ["views", "components", "layout"];
|
||||
|
||||
/**
|
||||
* @param {string} repoRoot
|
||||
* @param {Awaited<ReturnType<typeof collectWrappersForMethod>>} wrappers
|
||||
*/
|
||||
async function findViewsUsingWrappers(repoRoot, wrappers) {
|
||||
if (wrappers.length === 0) {
|
||||
return [];
|
||||
}
|
||||
const candidates = [];
|
||||
for (const seg of APIDATA_USAGE_SCAN_SEGMENTS) {
|
||||
const root = path.join(repoRoot, "src", seg);
|
||||
const files = await walkFilesRecursive(root, { extensions: [".vue", ".ts", ".tsx"] });
|
||||
candidates.push(...files);
|
||||
}
|
||||
const hits = new Set();
|
||||
for (const abs of candidates) {
|
||||
let content;
|
||||
try {
|
||||
content = await readFile(abs, "utf8");
|
||||
} catch {
|
||||
continue;
|
||||
}
|
||||
for (const w of wrappers) {
|
||||
let ok = false;
|
||||
if (w.kind === "function") {
|
||||
ok = viewUsesFunctionExport(content, w.importPath, w.exportName);
|
||||
} else if (w.kind === "objectProperty") {
|
||||
ok = viewUsesObjectProperty(content, w.importPath, w.objectName, w.propName);
|
||||
}
|
||||
if (ok) {
|
||||
hits.add(toPosix(path.relative(repoRoot, abs)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return [...hits].sort();
|
||||
}
|
||||
|
||||
/**
|
||||
* 为「失败接口」补充 api 封装与引用页面路径(views / components / layout)
|
||||
* @param {Array<{ 接口: string, message: string, code: unknown }>} failedList
|
||||
*/
|
||||
async function enrichFailedInterfacesWithUsage(failedList) {
|
||||
const repoRoot = process.cwd();
|
||||
const methodToFolder = await loadMethodToFolderFromModuleList();
|
||||
const enriched = [];
|
||||
for (const item of failedList) {
|
||||
const methodStr = String(item.接口 ?? "").trim();
|
||||
const folder = methodToFolder.get(methodStr) ?? null;
|
||||
const wrappers = await collectWrappersForMethod(repoRoot, methodStr);
|
||||
const 引用页面 = await findViewsUsingWrappers(repoRoot, wrappers);
|
||||
const api封装 = wrappers.map((w) => {
|
||||
if (w.kind === "function") {
|
||||
return { 文件: w.relFile, 方法名: w.exportName };
|
||||
}
|
||||
return {
|
||||
文件: w.relFile,
|
||||
方法名: `${w.objectName}.${w.propName}`,
|
||||
说明: "聚合对象方法",
|
||||
};
|
||||
});
|
||||
enriched.push({
|
||||
...item,
|
||||
模块目录: folder,
|
||||
api封装,
|
||||
引用页面,
|
||||
});
|
||||
}
|
||||
return enriched;
|
||||
}
|
||||
|
||||
async function runCrawlFromConfigFile() {
|
||||
const rawConfig = await readJson(APIDATA_CONFIG_FILE);
|
||||
const successMessages = resolveSuccessMessages(rawConfig);
|
||||
const config = normalizeConfig(rawConfig);
|
||||
|
||||
const rows = [];
|
||||
let authToken = null;
|
||||
@ -91,21 +735,57 @@ async function run() {
|
||||
authToken = result.response.data.token;
|
||||
}
|
||||
|
||||
const res = result.response;
|
||||
rows.push({
|
||||
接口: req.method,
|
||||
message: result.response?.message ?? "",
|
||||
data: result.response?.data ?? null,
|
||||
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,
|
||||
});
|
||||
}
|
||||
|
||||
await writeJson(APIDATA_DATA_FILE, rows);
|
||||
const 数据一览 = buildDataOverview(rows, successMessages);
|
||||
数据一览.失败接口 = await enrichFailedInterfacesWithUsage(数据一览.失败接口);
|
||||
const payload = {
|
||||
数据一览,
|
||||
详情: rows,
|
||||
};
|
||||
|
||||
await writeJson(APIDATA_DATA_FILE, payload);
|
||||
await mkdir(path.dirname(RESPONSE_MARKDOWN_FILE), { recursive: true });
|
||||
await writeFile(RESPONSE_MARKDOWN_FILE, createMarkdownContent(rows), "utf8");
|
||||
await writeFile(RESPONSE_MARKDOWN_FILE, createResponseMarkdown(rows), "utf8");
|
||||
console.log(`已写入接口响应数据: ${APIDATA_DATA_FILE}`);
|
||||
console.log(
|
||||
`数据一览: 当前请求数=${数据一览.当前请求数} 成功数/全部请求数=${数据一览.成功数与全部请求数} 失败数=${数据一览.失败接口.length}`,
|
||||
);
|
||||
if (数据一览.失败接口.length) {
|
||||
for (const item of 数据一览.失败接口) {
|
||||
console.log(` 失败: ${item.接口} — code=${JSON.stringify(item.code)} — ${item.message}`);
|
||||
}
|
||||
}
|
||||
console.log(`已更新响应文档: ${RESPONSE_MARKDOWN_FILE}`);
|
||||
}
|
||||
|
||||
run().catch((error) => {
|
||||
console.error("执行 apidata 抓取失败:", error);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
export async function runApidata() {
|
||||
const cli = parseApidataCli(process.argv.slice(2));
|
||||
if (cli.help) {
|
||||
printHelp();
|
||||
return;
|
||||
}
|
||||
|
||||
const existingRaw = await readJson(APIDATA_CONFIG_FILE);
|
||||
|
||||
if (cli.modules.length > 0 || cli.clearOld) {
|
||||
console.log(
|
||||
`apidata: clearOld=${cli.clearOld}, modules=[${cli.modules.join(", ")}]`,
|
||||
);
|
||||
await buildAndWriteConfig({
|
||||
existingRaw,
|
||||
modules: cli.modules,
|
||||
clearOld: cli.clearOld,
|
||||
});
|
||||
}
|
||||
|
||||
await runCrawlFromConfigFile();
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -12,49 +12,65 @@
|
||||
"label": "全部"
|
||||
}
|
||||
},
|
||||
"totalInterfaceCount": 182,
|
||||
"totalInterfaceCount": 185,
|
||||
"changes": {
|
||||
"summary": {
|
||||
"moduleAdded": 0,
|
||||
"moduleAdded": 1,
|
||||
"moduleDeleted": 0,
|
||||
"moduleUpdated": 1,
|
||||
"interfaceAdded": 0,
|
||||
"interfaceAdded": 2,
|
||||
"interfaceDeleted": 0,
|
||||
"interfaceParamsUpdated": 1,
|
||||
"interfaceParamsUpdated": 0,
|
||||
"interfaceResponseUpdated": 0
|
||||
},
|
||||
"moduleUpdates": {
|
||||
"added": [],
|
||||
"added": [
|
||||
{
|
||||
"moduleName": "订单储位分配模块",
|
||||
"moduleKey": "order.storageAllocation",
|
||||
"folder": "order.storageallocation",
|
||||
"methods": [
|
||||
"order.storageAllocation.allocateStorage"
|
||||
],
|
||||
"interfaceCount": 1
|
||||
}
|
||||
],
|
||||
"deleted": [],
|
||||
"updated": [
|
||||
{
|
||||
"moduleName": "平台编码管理模块",
|
||||
"moduleKey": "setting.platform",
|
||||
"folder": "setting.platform",
|
||||
"previousModuleName": "平台编码管理模块",
|
||||
"previousModuleKey": "setting.platform",
|
||||
"moduleName": "订单待处理模块",
|
||||
"moduleKey": "order.pendingOrder",
|
||||
"folder": "order.pendingorder",
|
||||
"previousModuleName": "订单待处理模块",
|
||||
"previousModuleKey": "order.pendingOrder",
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [
|
||||
"index.getPlatformList"
|
||||
"addedMethods": [
|
||||
"order.pendingOrder.allocateExpressCode"
|
||||
],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"interfaceUpdates": {
|
||||
"added": [],
|
||||
"deleted": [],
|
||||
"paramsUpdated": [
|
||||
"added": [
|
||||
{
|
||||
"moduleName": "平台编码管理模块",
|
||||
"moduleKey": "setting.platform",
|
||||
"folder": "setting.platform",
|
||||
"method": "index.getPlatformList"
|
||||
"moduleName": "订单储位分配模块",
|
||||
"moduleKey": "order.storageAllocation",
|
||||
"folder": "order.storageallocation",
|
||||
"method": "order.storageAllocation.allocateStorage"
|
||||
},
|
||||
{
|
||||
"moduleName": "订单待处理模块",
|
||||
"moduleKey": "order.pendingOrder",
|
||||
"folder": "order.pendingorder",
|
||||
"method": "order.pendingOrder.allocateExpressCode"
|
||||
}
|
||||
],
|
||||
"deleted": [],
|
||||
"paramsUpdated": [],
|
||||
"responseUpdated": []
|
||||
}
|
||||
},
|
||||
@ -313,14 +329,7 @@
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [],
|
||||
"params": [
|
||||
{
|
||||
"name": "systemOnly",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "可选,是否仅返回系统基础快递列表;默认不传或 false 时返回合并仓库设置的快递列表;systemOnly=true 时只返回系统基础快递列表。"
|
||||
}
|
||||
],
|
||||
"params": [],
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
@ -413,14 +422,7 @@
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [],
|
||||
"params": [
|
||||
{
|
||||
"name": "systemOnly",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "可选,是否仅返回系统基础平台列表;默认不传或 false 时返回合并仓库设置的平台列表;systemOnly=true 时只返回系统基础平台列表。"
|
||||
}
|
||||
],
|
||||
"params": [],
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
@ -1369,6 +1371,63 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "订单待处理模块",
|
||||
"moduleKey": "order.pendingOrder",
|
||||
"moduleFolder": "order.pendingorder",
|
||||
"method": "order.pendingOrder.allocateExpressCode",
|
||||
"title": "批量分配待处理订单的快递号,接收订单对象数组,复用 express.createWaybillCodePipeline。",
|
||||
"description": "批量分配待处理订单的快递号,接收订单对象数组,复用 express.createWaybillCodePipeline。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "orders",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "订单对象数组;每个对象应为待处理订单列表或详情中获取的原始订单对象。每个订单对象必须包含 order_id 与 business_key;sys_platform_code 与 logistics_code 为订单对象自带字段,前端无需额外拼装或从外部构造,直接原样回传订单对象即可。其余字段会原样透传给运单创建链路。business_key 说明:business_key 是运单创建的序号键数组(例如:新分配 1 个运单号时传 [1];订单拆单时可能传 [2,3]),该字段会在 createWaybillCodePipeline 的返回 data 中原样返回,便于前端关联订单与运单创建结果。"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "flag",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "全局调用结果标识,成功时为 success"
|
||||
},
|
||||
{
|
||||
"name": "code",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "业务状态码,200 表示成功"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "返回信息"
|
||||
},
|
||||
{
|
||||
"name": "data",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "createWaybillCodePipeline 返回的运单创建结果,包含 success/failed 列表与 summary 等字段"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "订单待处理模块",
|
||||
"moduleKey": "order.pendingOrder",
|
||||
@ -1765,6 +1824,75 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"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",
|
||||
@ -2757,6 +2885,63 @@
|
||||
],
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"moduleName": "快递编码管理模块",
|
||||
"moduleKey": "setting.express",
|
||||
"moduleFolder": "setting.express",
|
||||
"method": "setting.express.delete",
|
||||
"title": "批量软删除快递映射;接受 ids 参数,已删除记录会在结果中标记。",
|
||||
"description": "批量软删除快递映射;接受 ids 参数,已删除记录会在结果中标记。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "ids",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "待删除的映射ID数组;支持数组、逗号字符串或单个ID。"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "ids",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "请求中的所有 id 列表(原样返回)"
|
||||
},
|
||||
{
|
||||
"name": "deleted_ids",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "本次实际被软删除的 ID 列表(即原本未被删除的 ID)"
|
||||
},
|
||||
{
|
||||
"name": "already_deleted_ids",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "请求中已处于已删除状态的 ID 列表"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "固定返回 'deleted'"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "快递编码管理模块",
|
||||
"moduleKey": "setting.express",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -12,50 +12,66 @@
|
||||
"label": "全部"
|
||||
}
|
||||
},
|
||||
"moduleCount": 30,
|
||||
"totalInterfaceCount": 182,
|
||||
"moduleCount": 31,
|
||||
"totalInterfaceCount": 185,
|
||||
"changes": {
|
||||
"summary": {
|
||||
"moduleAdded": 0,
|
||||
"moduleAdded": 1,
|
||||
"moduleDeleted": 0,
|
||||
"moduleUpdated": 1,
|
||||
"interfaceAdded": 0,
|
||||
"interfaceAdded": 2,
|
||||
"interfaceDeleted": 0,
|
||||
"interfaceParamsUpdated": 1,
|
||||
"interfaceParamsUpdated": 0,
|
||||
"interfaceResponseUpdated": 0
|
||||
},
|
||||
"moduleUpdates": {
|
||||
"added": [],
|
||||
"added": [
|
||||
{
|
||||
"moduleName": "订单储位分配模块",
|
||||
"moduleKey": "order.storageAllocation",
|
||||
"folder": "order.storageallocation",
|
||||
"methods": [
|
||||
"order.storageAllocation.allocateStorage"
|
||||
],
|
||||
"interfaceCount": 1
|
||||
}
|
||||
],
|
||||
"deleted": [],
|
||||
"updated": [
|
||||
{
|
||||
"moduleName": "平台编码管理模块",
|
||||
"moduleKey": "setting.platform",
|
||||
"folder": "setting.platform",
|
||||
"previousModuleName": "平台编码管理模块",
|
||||
"previousModuleKey": "setting.platform",
|
||||
"moduleName": "订单待处理模块",
|
||||
"moduleKey": "order.pendingOrder",
|
||||
"folder": "order.pendingorder",
|
||||
"previousModuleName": "订单待处理模块",
|
||||
"previousModuleKey": "order.pendingOrder",
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [
|
||||
"index.getPlatformList"
|
||||
"addedMethods": [
|
||||
"order.pendingOrder.allocateExpressCode"
|
||||
],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"interfaceUpdates": {
|
||||
"added": [],
|
||||
"deleted": [],
|
||||
"paramsUpdated": [
|
||||
"added": [
|
||||
{
|
||||
"moduleName": "平台编码管理模块",
|
||||
"moduleKey": "setting.platform",
|
||||
"folder": "setting.platform",
|
||||
"method": "index.getPlatformList"
|
||||
"moduleName": "订单储位分配模块",
|
||||
"moduleKey": "order.storageAllocation",
|
||||
"folder": "order.storageallocation",
|
||||
"method": "order.storageAllocation.allocateStorage"
|
||||
},
|
||||
{
|
||||
"moduleName": "订单待处理模块",
|
||||
"moduleKey": "order.pendingOrder",
|
||||
"folder": "order.pendingorder",
|
||||
"method": "order.pendingOrder.allocateExpressCode"
|
||||
}
|
||||
],
|
||||
"deleted": [],
|
||||
"paramsUpdated": [],
|
||||
"responseUpdated": []
|
||||
}
|
||||
},
|
||||
@ -223,6 +239,17 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "订单储位分配模块",
|
||||
"moduleKey": "order.storageAllocation",
|
||||
"folder": "order.storageallocation",
|
||||
"interfaceCount": 1,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "order.storageAllocation.allocateStorage"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "订单待出库模块",
|
||||
"moduleKey": "order.outboundOrder",
|
||||
@ -241,7 +268,7 @@
|
||||
"moduleName": "订单待处理模块",
|
||||
"moduleKey": "order.pendingOrder",
|
||||
"folder": "order.pendingorder",
|
||||
"interfaceCount": 4,
|
||||
"interfaceCount": 5,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "order.pendingOrder.list"
|
||||
@ -254,6 +281,9 @@
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.cancelOrder"
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.allocateExpressCode"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -513,7 +543,7 @@
|
||||
"moduleName": "快递编码管理模块",
|
||||
"moduleKey": "setting.express",
|
||||
"folder": "setting.express",
|
||||
"interfaceCount": 6,
|
||||
"interfaceCount": 7,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "index.getExpressList"
|
||||
@ -532,6 +562,9 @@
|
||||
},
|
||||
{
|
||||
"method": "setting.express.update"
|
||||
},
|
||||
{
|
||||
"method": "setting.express.delete"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -16,14 +16,16 @@
|
||||
"name": "订单待处理模块",
|
||||
"key": "order.pendingOrder",
|
||||
"folder": "order.pendingorder",
|
||||
"interfaceCount": 4
|
||||
"interfaceCount": 5
|
||||
},
|
||||
"changes": {
|
||||
"fromPreviousSnapshot": {
|
||||
"moduleAdded": false,
|
||||
"moduleRenamed": false,
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [],
|
||||
"addedMethods": [
|
||||
"order.pendingOrder.allocateExpressCode"
|
||||
],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
@ -288,6 +290,60 @@
|
||||
"description": "实际更新的订单 ID 列表"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.pendingOrder.allocateExpressCode",
|
||||
"title": "批量分配待处理订单的快递号,接收订单对象数组,复用 express.createWaybillCodePipeline。",
|
||||
"description": "批量分配待处理订单的快递号,接收订单对象数组,复用 express.createWaybillCodePipeline。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "orders",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "订单对象数组;每个对象应为待处理订单列表或详情中获取的原始订单对象。每个订单对象必须包含 order_id 与 business_key;sys_platform_code 与 logistics_code 为订单对象自带字段,前端无需额外拼装或从外部构造,直接原样回传订单对象即可。其余字段会原样透传给运单创建链路。business_key 说明:business_key 是运单创建的序号键数组(例如:新分配 1 个运单号时传 [1];订单拆单时可能传 [2,3]),该字段会在 createWaybillCodePipeline 的返回 data 中原样返回,便于前端关联订单与运单创建结果。"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "flag",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "全局调用结果标识,成功时为 success"
|
||||
},
|
||||
{
|
||||
"name": "code",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "业务状态码,200 表示成功"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "返回信息"
|
||||
},
|
||||
{
|
||||
"name": "data",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "createWaybillCodePipeline 返回的运单创建结果,包含 success/failed 列表与 summary 等字段"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
{
|
||||
"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-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 19:37:49",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -16,7 +16,7 @@
|
||||
"name": "快递编码管理模块",
|
||||
"key": "setting.express",
|
||||
"folder": "setting.express",
|
||||
"interfaceCount": 6
|
||||
"interfaceCount": 7
|
||||
},
|
||||
"changes": {
|
||||
"fromPreviousSnapshot": {
|
||||
@ -43,14 +43,7 @@
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [],
|
||||
"params": [
|
||||
{
|
||||
"name": "systemOnly",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "可选,是否仅返回系统基础快递列表;默认不传或 false 时返回合并仓库设置的快递列表;systemOnly=true 时只返回系统基础快递列表。"
|
||||
}
|
||||
],
|
||||
"params": [],
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
@ -219,6 +212,60 @@
|
||||
}
|
||||
],
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"method": "setting.express.delete",
|
||||
"title": "批量软删除快递映射;接受 ids 参数,已删除记录会在结果中标记。",
|
||||
"description": "批量软删除快递映射;接受 ids 参数,已删除记录会在结果中标记。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "ids",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "待删除的映射ID数组;支持数组、逗号字符串或单个ID。"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "ids",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "请求中的所有 id 列表(原样返回)"
|
||||
},
|
||||
{
|
||||
"name": "deleted_ids",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "本次实际被软删除的 ID 列表(即原本未被删除的 ID)"
|
||||
},
|
||||
{
|
||||
"name": "already_deleted_ids",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "请求中已处于已删除状态的 ID 列表"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "固定返回 'deleted'"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 20:21:27",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 19:16:50",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -25,9 +25,7 @@
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [
|
||||
"index.getPlatformList"
|
||||
],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
}
|
||||
}
|
||||
@ -45,14 +43,7 @@
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [],
|
||||
"params": [
|
||||
{
|
||||
"name": "systemOnly",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"description": "可选,是否仅返回系统基础平台列表;默认不传或 false 时返回合并仓库设置的平台列表;systemOnly=true 时只返回系统基础平台列表。"
|
||||
}
|
||||
],
|
||||
"params": [],
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-04-17 20:34:19",
|
||||
"generatedAtLocal": "2026-04-17 20:34:19",
|
||||
"generatedAt": "2026-04-18 19:40:53",
|
||||
"generatedAtLocal": "2026-04-18 19:40:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-04-17 20:34:19",
|
||||
"updatedAt": "2026-04-18 19:40:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user