diff --git a/dist.tar.gz b/dist.tar.gz index 24384b83..d220e63d 100644 Binary files a/dist.tar.gz and b/dist.tar.gz differ diff --git a/src/api/order.recheckorder/recheckOrder.ts b/src/api/order.recheckorder/recheckOrder.ts index 8e3bf03c..9a8adc39 100644 --- a/src/api/order.recheckorder/recheckOrder.ts +++ b/src/api/order.recheckorder/recheckOrder.ts @@ -2,30 +2,44 @@ import request from '@/utils/request' const v = '1.0' -/** 运单号;支持 waybill_no、waybillCode、waybill_code */ -export type RecheckWaybillParams = { +/** 扫描关键词;支持 keyword、value、运单号与车号别名(见 order.recheckorder module.json) */ +export type RecheckScanOrderParams = { + keyword?: string + value?: string waybill_no?: string waybillCode?: string waybill_code?: string + cart_code?: string + cartCode?: string } -function pickWaybillBody(data: RecheckWaybillParams): Record { - const v = - data.waybill_no?.trim() || - data.waybillCode?.trim() || - data.waybill_code?.trim() || - '' - if (!v) { - throw new Error('运单号不能为空(waybill_no / waybillCode / waybill_code)') +const SCAN_ORDER_FIELD_KEYS: (keyof RecheckScanOrderParams)[] = [ + 'keyword', + 'value', + 'waybill_no', + 'waybillCode', + 'waybill_code', + 'cart_code', + 'cartCode' +] + +function pickScanOrderBody(data: RecheckScanOrderParams): Record { + for (const key of SCAN_ORDER_FIELD_KEYS) { + const raw = data[key] + if (raw !== undefined && raw !== null && String(raw).trim() !== '') { + return { [key]: String(raw).trim() } + } } - if (data.waybill_no?.trim()) return { waybill_no: v } - if (data.waybillCode?.trim()) return { waybillCode: v } - return { waybill_code: v } + throw new Error( + '扫描关键词不能为空(keyword / value / waybill_no / waybillCode / waybill_code / cart_code / cartCode)' + ) } -/** scanWaybill 成功时服务端常用字段(见 order.recheckorder module.json) */ -export type ScanWaybillResultShape = { - order_id?: number +/** scanOrder 成功时服务端常用字段 */ +export type ScanOrderResultShape = { + match_type?: 'waybill' | 'cart' | string + cart_match_view?: Record | null + order_id?: number | string waybill_no?: string order?: Record items?: unknown[] @@ -33,21 +47,36 @@ export type ScanWaybillResultShape = { logs?: unknown[] } -/** order.recheckOrder.scanWaybill:扫码查询运单并返回订单详情(含 order_id 供 confirmRecheck 使用) */ -export function scanWaybill(data: RecheckWaybillParams): Promise { +/** confirmRecheck 成功时服务端常用字段 */ +export type ConfirmRecheckResultShape = { + order_id?: number + waybill_no?: string + recheck_status?: string + recheck_time?: string + review_no?: string + reviewNo?: string +} + +/** order.recheckOrder.scanOrder:扫码查询订单(运单号或车号) */ +export function scanOrder(data: RecheckScanOrderParams): Promise { return request({ url: '/system', method: 'post', params: { - method: 'order.recheckOrder.scanWaybill', + method: 'order.recheckOrder.scanOrder', v, timestamp: Date.now() }, - data: pickWaybillBody(data), + data: pickScanOrderBody(data), isSystemApi: true } as any) } +/** @deprecated 接口已下线,请使用 scanOrder */ +export function scanWaybill(data: RecheckScanOrderParams): Promise { + return scanOrder(data) +} + /** 订单 ID;优先 order_id,兼容 id、orderId */ export type ConfirmRecheckParams = { order_id?: string | number @@ -63,7 +92,6 @@ function coerceOrderId(v: string | number): string | number { return s } -/** 统一 body:优先读取 order_id,其次 id,再 orderId;以 order_id 键提交 */ function pickConfirmRecheckBody(data: ConfirmRecheckParams): { order_id: string | number } { const raw = data.order_id !== undefined && data.order_id !== null && `${data.order_id}`.trim() !== '' @@ -95,6 +123,6 @@ export function confirmRecheck(data: ConfirmRecheckParams): Promise { } export const orderRecheckOrder = { - scanWaybill, + scanOrder, confirmRecheck } diff --git a/src/api/storage_receiving/receiving.ts b/src/api/storage_receiving/receiving.ts index e3082068..5d9204be 100644 --- a/src/api/storage_receiving/receiving.ts +++ b/src/api/storage_receiving/receiving.ts @@ -268,7 +268,15 @@ export function bindReceivingStore(data: any): Promise { data: data }) } -export function bindDetailProduct(data: any): Promise { +export type BindDetailProductParams = { + /** 收货单明细ID(兼容字段 id) */ + detail_id: number + /** 系统商品ID(StockWarehouse.id,须属于当前仓库) */ + system_product_id: number + id?: number +} + +export function bindDetailProduct(data: BindDetailProductParams): Promise { return request({ url: '/system', method: 'post', diff --git a/src/api/storeWarehouse.store/storeWarehouse.ts b/src/api/storeWarehouse.store/storeWarehouse.ts index d99600e2..8cbea539 100644 --- a/src/api/storeWarehouse.store/storeWarehouse.ts +++ b/src/api/storeWarehouse.store/storeWarehouse.ts @@ -228,6 +228,32 @@ export function saveApiConfig(data: { } as any) } +/** 按 store_id 分页查询面单余额变更日志 */ +export function queryPrintQuantityLogs(data: { + store_id: number | string + pagination?: { page?: number; page_size?: number } +}) { + const sid = Number(data.store_id) + if (!Number.isFinite(sid)) { + return Promise.reject(new Error('storeWarehouse.store.queryPrintQuantityLogs:store_id 无效')) + } + const body: Record = { store_id: sid } + if (data.pagination && typeof data.pagination === 'object') { + body.pagination = data.pagination + } + return request({ + url: '/system', + method: 'post', + params: { + method: 'storeWarehouse.store.queryPrintQuantityLogs', + v, + timestamp: new Date().getTime() + }, + data: body, + isSystemApi: true + } as any) +} + /** 删除签约关系上的奇门接口配置 */ export function storeWarehouseDeleteQimenConfig(data: { id: number diff --git a/src/views/order/orderreview/index.vue b/src/views/order/orderreview/index.vue index 77ed6ce5..e13b21b4 100644 --- a/src/views/order/orderreview/index.vue +++ b/src/views/order/orderreview/index.vue @@ -1,163 +1,631 @@ diff --git a/src/views/order/orderreview/recheck-config.ts b/src/views/order/orderreview/recheck-config.ts new file mode 100644 index 00000000..2e9f96c4 --- /dev/null +++ b/src/views/order/orderreview/recheck-config.ts @@ -0,0 +1,27 @@ +/** 订单复核 ScanBox 筛选字段(对应 order.recheckOrder.scanOrder 入参别名) */ +export const recheckAvailableFields = [ + { + value: 'keyword', + label: '扫描关键词', + type: 'text', + placeholder: '运单号或车号,回车后在侧栏点查询', + operators: ['eq'], + defaultOperator: 'eq' + }, + { + value: 'waybill_no', + label: '运单号', + type: 'text', + placeholder: '请输入运单号', + operators: ['eq'], + defaultOperator: 'eq' + }, + { + value: 'cart_code', + label: '车号', + type: 'text', + placeholder: '请输入车号', + operators: ['eq'], + defaultOperator: 'eq' + } +] diff --git a/src/views/storage/receiving/component/Product.vue b/src/views/storage/receiving/component/Product.vue index 0357add5..f152f97e 100644 --- a/src/views/storage/receiving/component/Product.vue +++ b/src/views/storage/receiving/component/Product.vue @@ -18,8 +18,9 @@ -
- + + + + + + + + + + + +
@@ -399,6 +447,13 @@
+
@@ -454,7 +509,14 @@