1
This commit is contained in:
parent
d5f598da57
commit
f68c1fd301
@ -44,7 +44,10 @@ export type OrderListPagination = {
|
||||
|
||||
/** 订单工作台 / 各订单模块 list 响应 data 结构
|
||||
* - list 每条 raw 行数据新增 store_remark(货主备注)字段、wave_index(波次内序号,联查 wms_order_wave_index,无记录时为 0)
|
||||
* - list 每条 raw 行数据包含 confirm_print_status(确认打印状态,none/fin)与 claim_status(领料状态,none/padding/fin/error)
|
||||
* - list 每条 lock_status 统一输出为 Y/N:none(含空值)→ 'N',其余值(如 warehouse/store)→ 'Y'
|
||||
* - 各模块响应描述以各自 module.json 为准(部分模块 list 仅含 wave_index)
|
||||
* - 列表运单号回填为服务端修复项(wms_order_express 按「订单ID + 订单所属仓库ID」隔离读取,禁止跨仓串读),前端无需处理
|
||||
*/
|
||||
export type OrderWorkbenchListResponse = {
|
||||
list: any[]
|
||||
|
||||
@ -47,6 +47,10 @@ export type PendingOrderListParams = {
|
||||
* {"create_channel":"MANUAL"} 单值精确;{"create_channel":["QM","API"]} 裸数组按 in 多选;
|
||||
* {"create_channel":{"operator":"in","value":["QM","API"]}} 标准结构多选;{"create_channel":{"operator":"ne","value":"MANUAL"}} 排除指定渠道。
|
||||
* 注意:列表响应中的 create_channel 已格式化为中文标签,查询条件须传英文枚举值。
|
||||
* confirm_print_status 确认打印状态筛选(按订单表列过滤;枚举:none=未确认打印、fin=已确认打印):
|
||||
* {"confirm_print_status":"fin"} 单值精确,也支持裸数组按 in 与 {operator,value} 标准结构(同 create_channel 示例)。
|
||||
* claim_status 领料状态筛选(按订单表列过滤;枚举:none=未领料、padding=领料中、fin=已领料、error=异常):
|
||||
* 例 {"claim_status":{"operator":"ne","value":"fin"}} 查未完成领料的订单。
|
||||
*/
|
||||
where?: OrderWhere;
|
||||
sort?: OrderSort;
|
||||
|
||||
@ -45,7 +45,9 @@ export type WaveBatchListWhere = {
|
||||
* 注意:列表返回的是中文文案(未领料/已领料)。
|
||||
*/
|
||||
claim_assignment_status?: 'unclaimed' | 'claimed'
|
||||
/** 英文枚举:unpicked | partially_picked | picked */
|
||||
// 注:文档差异——2026-09-21 快照的 where【字段清单】未列 pick_assignment_status,
|
||||
// 但响应仍返回该字段且页面按它筛选,暂判为文档漏列,保留声明
|
||||
/** 拣货状态(仅 eq)。英文枚举:unpicked | partially_picked | picked */
|
||||
pick_assignment_status?: 'unpicked' | 'partially_picked' | 'picked'
|
||||
/** 中文:未分配 | 部分分配 | 已分配 */
|
||||
storage_assignment_status?: string
|
||||
|
||||
@ -389,3 +389,60 @@ export function markWavePrintStatus(data: MarkWavePrintStatusParams): Promise<an
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
/** print.confirmWavePrint 请求参数 */
|
||||
export type ConfirmWavePrintParams = {
|
||||
/** 面单号/运单号(必填,用于定位订单及所属波次) */
|
||||
waybill_no: string
|
||||
}
|
||||
|
||||
/** print.confirmWavePrint 业务 data */
|
||||
export type ConfirmWavePrintResponse = {
|
||||
/** 扫描的面单号 */
|
||||
waybill_no?: string
|
||||
/** 面单号匹配到的订单ID */
|
||||
matched_order_id?: number
|
||||
/** 波次ID */
|
||||
wave_id?: number
|
||||
/** 波次编码 */
|
||||
wave_no?: string
|
||||
/** 波次下总订单数 */
|
||||
total_order_count?: number
|
||||
/** 波次下拦截订单数(跳过确认) */
|
||||
intercepted_order_count?: number
|
||||
/** 已确认打印订单数(confirm_print_status='fin') */
|
||||
confirmed_order_count?: number
|
||||
/** 本次新增确认订单数(仅 status=confirmed 时返回) */
|
||||
newly_confirmed_order_count?: number
|
||||
/** confirmed=本次完成确认 / already_confirmed=已全部确认 */
|
||||
status?: 'confirmed' | 'already_confirmed' | string
|
||||
}
|
||||
|
||||
/**
|
||||
* print.confirmWavePrint:波次确认打印(打印完成后扫面单确认)。
|
||||
* 扫描波次内任一订单的面单号 → 将该波次下全部已打印(print_status='fin')且非拦截的订单
|
||||
* 批量标记 confirm_print_status='fin'。
|
||||
* - 拦截订单跳过(不确认、不阻断);波次下存在未打印订单时后端阻断(错误响应带 unprinted_order_count);
|
||||
* - 波次下订单已全部确认时重复扫描返回 status=already_confirmed,不重复写日志。
|
||||
* 说明:与 order.wave.confirmPrintScan 是同一业务动作的两个入口(入参 / 响应字段一致,
|
||||
* 见 api-doc-system 快照 print 模块与 order 模块),本文件按 print 模块归属封装。
|
||||
*/
|
||||
export function confirmWavePrint(
|
||||
data: ConfirmWavePrintParams
|
||||
): Promise<ConfirmWavePrintResponse & { code?: number; message?: string; data?: Partial<ConfirmWavePrintResponse> }> {
|
||||
const waybillNo = String(data?.waybill_no ?? '').trim()
|
||||
if (!waybillNo) {
|
||||
return Promise.reject(new Error('print.confirmWavePrint:waybill_no 不能为空'))
|
||||
}
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'print.confirmWavePrint',
|
||||
v,
|
||||
timestamp: stamp()
|
||||
},
|
||||
data: { waybill_no: waybillNo },
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
@ -136,54 +136,144 @@ export function checkBarcode(data: {
|
||||
export interface WorkbenchBusinessParams {
|
||||
/** 业务名称:queryOrder/query(条码查订单)、packOrder、finishPack、sendWeight */
|
||||
name: string
|
||||
/** 业务数据(透传)。queryOrder/query 需 barcode(运单号,必填)+ warehouseId(仓库ID,必填) */
|
||||
/**
|
||||
* 业务数据(透传)。仓库与工作台均由服务端从工作台 token 解析注入,
|
||||
* body 传入 warehouse_id / workbench_id 一律忽略(禁止前端传值,防跨仓查单)。
|
||||
* - queryOrder/query:token(工作台 token,64 位,必填)+ barcode(运单号,必填);
|
||||
* 查询成功时响应额外返回打包上下文 key(20 分钟有效)。
|
||||
* - packOrder(最新设计):推荐只传 token + key(来自 queryOrder 响应),订单号/波次号/运单号由后端从缓存拉取;
|
||||
* 不传 key 的旧参数模式(delivery_order_code 等直传)为过渡兼容,后续版本将移除;
|
||||
* key 缺失或过期返回 400(请重新扫码)、跨仓库/跨工作台使用他人 key 返回 403。
|
||||
* - finishPack/sendWeight:token + 业务字段(工作台同样由服务端从 token 解析)。
|
||||
*/
|
||||
data?: Record<string, any>
|
||||
}
|
||||
|
||||
/** workbench.queryOrder 响应:订单信息(来自订单分表 current/dispatch 命中行)
|
||||
* 注:intercept_flag / pack_flag 仅散单(isSandan=1)返回,团购原始字段不含该两标志。
|
||||
*/
|
||||
export interface WorkbenchQueryOrderOrder {
|
||||
/** 订单ID */
|
||||
id: number
|
||||
/** 发货单号 */
|
||||
delivery_order_code: string
|
||||
/** 订单类型 */
|
||||
order_type?: number | string
|
||||
/** 仓库ID */
|
||||
warehouse_id: number
|
||||
/** 货主ID */
|
||||
store_id?: number
|
||||
/** 订单状态 */
|
||||
status?: number | string
|
||||
/** 订单步骤 */
|
||||
step?: number | string
|
||||
/** 波次ID(散单为 0) */
|
||||
wave_id?: number
|
||||
/** 波次号 */
|
||||
wave_no?: string
|
||||
/** 打单状态 */
|
||||
post_status?: string
|
||||
/** 拣货状态 */
|
||||
pick_status?: string
|
||||
/** 打包状态(原始值,空值未归一化) */
|
||||
pack_status?: string
|
||||
/** 拦截状态(原始值,空值未归一化) */
|
||||
intercept_status?: string
|
||||
/** 复核状态 */
|
||||
recheck_status?: string
|
||||
/** 出库状态 */
|
||||
outbound_status?: string
|
||||
/** SKU 品种数 */
|
||||
items_count?: number
|
||||
/** 商品总件数 */
|
||||
items_total?: number
|
||||
/** 订单商品重量 */
|
||||
items_weight?: number
|
||||
/** 来源平台编码 */
|
||||
source_platform_code?: string
|
||||
/** 物流公司名称 */
|
||||
logistics_name?: string
|
||||
/** 创建时间 */
|
||||
create_at?: string
|
||||
/** 更新时间 */
|
||||
updated_at?: string
|
||||
/** 拦截标志(仅散单):拦截状态空值归一化为 none,非 none 记 1 否则 0 */
|
||||
intercept_flag?: number
|
||||
/** 打包标志(仅散单):按运单维度判定——该运单号已有打包流水(wms_pack_task.waybill_code 命中,或历史订单级流水 waybill_code 为空兜底)时为 1,否则 0;主/子单号互不影响 */
|
||||
pack_flag?: number
|
||||
}
|
||||
|
||||
/** workbench.queryOrder 响应:商品明细项(按 id ASC,逐项合并 stock 详情;查询异常时为空数组) */
|
||||
export interface WorkbenchQueryOrderItem {
|
||||
/** 订单商品行ID */
|
||||
id: number
|
||||
/** 订单ID */
|
||||
order_id: number
|
||||
/** 商品ID */
|
||||
item_id?: number
|
||||
/** 商品编码(订单行缺失时取 stock.item_code) */
|
||||
item_code?: string
|
||||
/** 商品名称(订单行缺失时取 stock.item_name) */
|
||||
item_name?: string
|
||||
/** 计划数量 */
|
||||
plan_qty?: number
|
||||
/** 实际单价 */
|
||||
actual_price?: number
|
||||
/** 库存商品ID */
|
||||
stock_id?: number
|
||||
/** 订单行号 */
|
||||
order_line_no?: string
|
||||
/** 库存类型 */
|
||||
inventory_type?: string
|
||||
/** SKU 属性(来自 stock 详情) */
|
||||
sku_property?: string
|
||||
/** 库存单位(来自 stock 详情) */
|
||||
stock_unit?: string
|
||||
/** 条码列表(来自 stock 详情,无则空数组) */
|
||||
barcodes?: string[]
|
||||
/** 商品图片地址(来自 stock 详情) */
|
||||
image_url?: string
|
||||
/** 打包要求(来自 stock 详情,trim 后返回;未命中/异常时为空字符串) */
|
||||
packing_requirements?: string
|
||||
/** 是否需要复核:Y=需要复核,N=不需要复核(免验)(来自 stock 详情,缺省 Y) */
|
||||
need_recheck?: string
|
||||
}
|
||||
|
||||
/** 工作台业务入口响应(queryOrder/query 条码查订单结构) */
|
||||
export interface WorkbenchBusinessResponse {
|
||||
/** 条码(运单号) */
|
||||
/** 打包上下文 key(20 分钟有效,凭此 key 调用 workbench.packOrder;缓存写入失败时缺省) */
|
||||
key?: string
|
||||
/** 条码(运单号,trim 后返回) */
|
||||
barcode: string
|
||||
/** 运单号 */
|
||||
waybill_code: string
|
||||
/** 是否散单:1=散单 0=团购 */
|
||||
/** 是否散单:1=散单 0=团购(波次类型 wave_type=1 时判定为团购) */
|
||||
isSandan: number
|
||||
/** 货主备注 */
|
||||
/** 货主备注(合约表 store_warehouse.store_remask;无记录或查询失败时为空串) */
|
||||
store_remark: string
|
||||
/** 运单信息 */
|
||||
/** 运单快照信息(来自 wms_order_express) */
|
||||
express: {
|
||||
logistics_name?: string
|
||||
weighing_weight?: number
|
||||
/** 运单号 */
|
||||
waybill_code?: string
|
||||
/** 物流公司名称(可空) */
|
||||
logistics_name?: string | null
|
||||
/** 运单称重重量(单位 g);未称重时为空 */
|
||||
weighing_weight?: number | string
|
||||
/** 包材名称快照(无快照时为空串) */
|
||||
package_material_name?: string
|
||||
}
|
||||
/** 订单详情 */
|
||||
order: Record<string, unknown>
|
||||
/** 订单商品明细 */
|
||||
items: Array<{
|
||||
id?: number
|
||||
order_id?: number
|
||||
item_id?: number
|
||||
item_code?: string
|
||||
item_name?: string
|
||||
plan_qty?: number
|
||||
actual_price?: number
|
||||
stock_id?: number
|
||||
order_line_no?: number
|
||||
inventory_type?: string
|
||||
sku_property?: string
|
||||
stock_unit?: string
|
||||
barcodes?: string[]
|
||||
image_url?: string
|
||||
/** 打包要求(来自 stock,未命中/异常时为空字符串) */
|
||||
packing_requirements?: string
|
||||
}>
|
||||
/** 订单信息 */
|
||||
order: WorkbenchQueryOrderOrder
|
||||
/** 订单商品明细数组 */
|
||||
items: WorkbenchQueryOrderItem[]
|
||||
/** 订单命中分表:current(待处理表)或 dispatch(配送表) */
|
||||
source_table: 'current' | 'dispatch'
|
||||
/** 波次汇总(仅团购 isSandan=0 返回) */
|
||||
/** 波次汇总(仅团购 isSandan=0 时返回) */
|
||||
batch?: {
|
||||
wave_id?: number
|
||||
wave_no?: string
|
||||
wave_type?: number
|
||||
/** 波次订单总数(current+dispatch 分表实时统计,15s 短缓存兜底) */
|
||||
total_orders?: number
|
||||
}
|
||||
code?: number
|
||||
@ -244,11 +334,165 @@ export function bind(data: {
|
||||
} as any)
|
||||
}
|
||||
|
||||
/** 使用 token 获取工作台信息(免登录、免鉴权):先查缓存 workbench:token:{token},未命中则按 token 查库并回填缓存后返回;返回不含 token/login_code;条码 barcode 字段已下线;token 不存在或无对应工作台返回失败(flag=failure、code=403) */
|
||||
/** workbench.getWorkbenchInfo 响应:成员(wms_workbench_member 未软删除记录,按 id ASC;查询失败降级为空数组) */
|
||||
export interface WorkbenchInfoMember {
|
||||
/** 成员记录ID(对应 wms_workbench_member.id,可用于 workbench.removeMember 的 ids 参数) */
|
||||
id: number
|
||||
/** 关联 wms_account.id;可空 null(非系统账号用户) */
|
||||
user_id?: number | null
|
||||
/** 成员名快照;可空 null */
|
||||
user_name?: string | null
|
||||
}
|
||||
|
||||
/** workbench.getWorkbenchInfo 响应:当前正在打包的团购波次
|
||||
* (wms_pack_task 中 pack_mode=2 且 wave_id>0 的最新一条未结束任务,按任务 id 倒序;无团购任务或查询异常时为空对象 {})
|
||||
*/
|
||||
export interface WorkbenchInfoCurrentWave {
|
||||
/** 打包任务ID(wms_pack_task.id) */
|
||||
task_id?: number
|
||||
wave_id?: number
|
||||
wave_no?: string
|
||||
/** 任务状态:0=待处理 1=打包中 */
|
||||
status?: number
|
||||
/** 波次订单数(current+dispatch 分表实时计数,15s 短缓存兜底) */
|
||||
order_count?: number
|
||||
/** 波次商品总件数(非 SKU 品种数;按 items_total 列 wave_id+warehouse_id 求和,15s 短缓存兜底) */
|
||||
items_total?: number
|
||||
/** 操作人文本(多人逗号分隔) */
|
||||
operator_text?: string
|
||||
/** 开始打包时间;可空 null */
|
||||
start_time?: string | null
|
||||
}
|
||||
|
||||
/** workbench.getWorkbenchInfo 响应:当前作业订单的商品项
|
||||
* - 散单任务(pack_mode=1):单笔订单商品明细(逐项合并 stock 详情)
|
||||
* - 团购任务(pack_mode=2):波次商品 SKU 聚合汇总(波次内全部未拦截订单按 SKU 聚合计划数量,15s 短缓存兜底),
|
||||
* 元素另附 is_wave_summary=true 用于区分;查询异常降级为空数组
|
||||
*/
|
||||
export interface WorkbenchInfoOrderItem {
|
||||
/** 订单商品明细ID(团购波次聚合行为 0) */
|
||||
id: number
|
||||
/** 订单ID(团购波次聚合行为 0) */
|
||||
order_id?: number
|
||||
item_id?: number
|
||||
/** 商品编码(明细为空时回退 stock.item_code) */
|
||||
item_code?: string
|
||||
/** 商品名称(明细为空时回退 stock.item_name) */
|
||||
item_name?: string
|
||||
/** 计划数量(团购波次聚合行为波次内该 SKU 计划数量合计) */
|
||||
plan_qty?: number
|
||||
actual_price?: number
|
||||
stock_id?: number
|
||||
order_line_no?: string
|
||||
inventory_type?: string
|
||||
/** SKU 属性(来自 stock 详情,无则空串) */
|
||||
sku_property?: string
|
||||
/** 库存单位(来自 stock 详情,无则空串) */
|
||||
stock_unit?: string
|
||||
/** 条码列表(来自 stock 详情,无则空数组) */
|
||||
barcodes?: string[]
|
||||
/** 商品图片地址数组(来自 stock 详情,无则空数组) */
|
||||
image_url?: string[]
|
||||
/** 包装要求(来自 stock 详情,无则空串) */
|
||||
packing_requirements?: string
|
||||
/** 是否需要复核:Y=需要复核,N=不需要复核(免验)(来自 stock 详情,缺省 Y) */
|
||||
need_recheck?: string
|
||||
/** 是否波次聚合行(仅团购任务 items 元素返回 true) */
|
||||
is_wave_summary?: boolean
|
||||
}
|
||||
|
||||
/** workbench.getWorkbenchInfo 响应:当前正在打包的订单 */
|
||||
export interface WorkbenchInfoCurrentOrder {
|
||||
/** 打包任务ID(wms_pack_task.id) */
|
||||
task_id: number
|
||||
order_id: number
|
||||
/** 发货单号(分表未命中时为空串) */
|
||||
delivery_order_code: string
|
||||
wave_id: number
|
||||
wave_no: string
|
||||
/** 打包模式:1=散单 2=团购 */
|
||||
pack_mode: number
|
||||
/** 任务状态:0=待处理 1=打包中 */
|
||||
status: number
|
||||
/** 打包数量(件数) */
|
||||
pack_quantity: number
|
||||
/** 商品总数量(wms_pack_task.item_quantity) */
|
||||
item_quantity: number
|
||||
/** 商品种类数(SKU 数) */
|
||||
sku_count: number
|
||||
/** 运单号(来自 wms_pack_task.waybill_code,散单任务创建时未回填则为空串) */
|
||||
waybill_code?: string
|
||||
/** 订单类型(订单分表未命中时为空串) */
|
||||
order_type?: string
|
||||
/** 货主ID(订单分表未命中时为 0) */
|
||||
store_id: number
|
||||
/** 货主备注(合约表 wms_store_warehouse.store_remask;仅散单任务返回,团购为空字符串) */
|
||||
store_remark?: string
|
||||
/** 运单信息(仅散单任务返回,团购为 null;与 workbench.queryOrder 的 express 口径一致) */
|
||||
express?: {
|
||||
waybill_code?: string
|
||||
logistics_name?: string
|
||||
/** 称重重量(克) */
|
||||
weighing_weight?: number
|
||||
/** 包材名称(package_material_name_snapshot,无包材为空字符串) */
|
||||
package_material_name?: string
|
||||
} | null
|
||||
/** 订单商品品种数(订单分表 items_count,未命中时为 0) */
|
||||
items_count: number
|
||||
/** 订单商品总件数(订单分表 items_total,未命中时为 0) */
|
||||
items_total: number
|
||||
/** 商品数组(散单=单笔明细;团购=波次 SKU 聚合汇总,元素带 is_wave_summary;查询异常降级为空数组) */
|
||||
items: WorkbenchInfoOrderItem[]
|
||||
/** 操作人文本(多人逗号分隔) */
|
||||
operator_text: string
|
||||
/** 开始打包时间;可空 null */
|
||||
start_time?: string | null
|
||||
}
|
||||
|
||||
/** workbench.getWorkbenchInfo 响应 data(缓存 workbench:token:{token},TTL 300s,缓存值已含 members 与打包信息) */
|
||||
export interface WorkbenchGetWorkbenchInfoData {
|
||||
id: number
|
||||
warehouse_id: number
|
||||
name: string
|
||||
/** 状态:0-禁用 1-启用 */
|
||||
status: number
|
||||
/** 工作台类型:personal-个人工作台 group-团体工作台 */
|
||||
type: string
|
||||
remark?: string
|
||||
device_ids?: number[]
|
||||
created_at: string
|
||||
updated_at: string
|
||||
members: WorkbenchInfoMember[]
|
||||
/** 当前正在打包的团购波次;无团购任务或查询异常时为空对象 {} */
|
||||
current_wave: WorkbenchInfoCurrentWave | Record<string, never>
|
||||
/** 当前正在打包的订单数组(status<2 的未结束任务,按任务 id 倒序);无进行中任务或查询异常时为空数组 */
|
||||
current_orders: WorkbenchInfoCurrentOrder[]
|
||||
}
|
||||
|
||||
/** workbench.getWorkbenchInfo 响应体(免登录接口:业务失败用 flag=failure + code,不用 HTTP 4xx) */
|
||||
export interface WorkbenchGetWorkbenchInfoResponse {
|
||||
/** success=成功 failure=失败 */
|
||||
flag?: string
|
||||
/** 成功 200;token 缺失 401、token 不存在或无对应工作台 403 */
|
||||
code?: number
|
||||
message?: string
|
||||
data?: WorkbenchGetWorkbenchInfoData
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用 token 获取工作台信息(免登录、免鉴权)。
|
||||
* - 先查缓存 `workbench:token:{token}`(TTL 300s,缓存值已包含 members 与 current_wave/current_orders),
|
||||
* 未命中则按 token 查库并回填缓存后返回;响应不含 token/login_code,条码 barcode 字段已下线。
|
||||
* - 绑定/移除成员、packOrder/finishPack 等打包状态变更后会立即失效 token 缓存,下一次调用即返回最新信息。
|
||||
* - 降级:打包信息查询异常时 current_wave 为空对象、current_orders 为空数组;单笔商品明细查询异常时 items 为空数组,
|
||||
* 不影响主信息与 members。
|
||||
* - ⚠ token 缺失返回 flag=failure、code=401(消息「工作台 token 不能为空」),token 不存在或无对应工作台返回 403;
|
||||
* 请求层把 401 当登录态过期处理,此接口只应在工作台端(或带工作台 token 的调试场景)调用。
|
||||
*/
|
||||
export function getWorkbenchInfo(data: {
|
||||
/** 工作台 token(64 位) */
|
||||
token: string
|
||||
}): Promise<any> {
|
||||
}): Promise<WorkbenchGetWorkbenchInfoResponse> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
|
||||
@ -83,7 +83,9 @@ export default {
|
||||
'generalreport':'General Report',
|
||||
'afterSale':'After Sale',
|
||||
'afterSaletypeList':'AfterSale TypeList',
|
||||
'afterSalelist':'AfterSale List'
|
||||
'afterSalelist':'AfterSale List',
|
||||
'inbox_auto_reply':'Inbox Auto Reply',
|
||||
'InboxAutoReply':'Inbox Auto Reply',
|
||||
},
|
||||
"login": {
|
||||
"title": "Login",
|
||||
|
||||
@ -87,6 +87,8 @@ export default {
|
||||
'afterSale':'售后',
|
||||
'afterSaletypeList':'售后类型列表',
|
||||
'afterSalelist':'售后列表',
|
||||
'inbox_auto_reply':'回信规则配置',
|
||||
'InboxAutoReply':'回信规则配置',
|
||||
},
|
||||
"login": {
|
||||
"title": "登录",
|
||||
|
||||
@ -5,7 +5,7 @@ import { useUserStore } from './user'
|
||||
export type TableMode = 'performance' | 'resource'
|
||||
|
||||
/** tab 缓存默认最大数量(超出后按 LRU 淘汰最久未使用) */
|
||||
export const DEFAULT_TAB_CACHE_MAX = 2
|
||||
export const DEFAULT_TAB_CACHE_MAX = 3
|
||||
|
||||
/** 页面缓存默认最大数量(路由级 keep-alive,超出后按 LRU 淘汰最久未使用) */
|
||||
export const DEFAULT_PAGE_CACHE_MAX = 8
|
||||
@ -26,7 +26,7 @@ export const useExperimentalStore = defineStore('experimental', () => {
|
||||
const tableMode = ref<TableMode>('resource')
|
||||
/** tab 缓存功能开关(默认开启) */
|
||||
const tabCacheEnabled = ref(true)
|
||||
/** 最大缓存 tab 数量(默认 2,超出后淘汰最久未使用) */
|
||||
/** 最大缓存 tab 数量(默认 3,超出后淘汰最久未使用) */
|
||||
const tabCacheMax = ref<number>(DEFAULT_TAB_CACHE_MAX)
|
||||
/** 页面缓存功能开关(路由级 keep-alive,默认开启) */
|
||||
const pageCacheEnabled = ref(true)
|
||||
|
||||
@ -885,6 +885,9 @@
|
||||
@refresh="handlePlatformPrintDialogRefresh"
|
||||
@print-success="handlePlatformPrintListRefresh"
|
||||
/>
|
||||
|
||||
<!-- 确认打印(print.confirmWavePrint):扫/输面单号确认整波已打印订单 -->
|
||||
<confirm-wave-print-dialog v-model="confirmWavePrintVisible" @success="loadData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -937,6 +940,7 @@ import WaveBatchDetailPanel from './component/WaveBatchDetailPanel.vue'
|
||||
import WaveFetchTaskProgressDialog from './component/WaveFetchTaskProgressDialog.vue'
|
||||
import WaveBatchTaskProgressDialog from './component/WaveBatchTaskProgressDialog.vue'
|
||||
import WaveStrategyQuickScanProgressDialog from './component/WaveStrategyQuickScanProgressDialog.vue'
|
||||
import ConfirmWavePrintDialog from './component/ConfirmWavePrintDialog.vue'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
import {
|
||||
settingWarehouseGetSettings as getWarehouseSettings,
|
||||
@ -1049,6 +1053,8 @@ const platformPrintDialogVisible = ref(false)
|
||||
const platformPrintPayload = ref<WavePlatformPrintDataPayload | null>(null)
|
||||
const platformPrintErrorMessage = ref('')
|
||||
const platformPrintRequestMeta = ref<{ warehouse_id: number; wave_ids: Array<number | string> } | null>(null)
|
||||
/** 确认打印弹窗(print.confirmWavePrint,扫面单号确认整波) */
|
||||
const confirmWavePrintVisible = ref(false)
|
||||
const batchAllocateExpressLoading = ref(false)
|
||||
const batchAllocateStorageLoading = ref(false)
|
||||
const batchRemoveExceptionOrdersLoading = ref(false)
|
||||
@ -1343,7 +1349,10 @@ const toolbarActionMap: Record<string, () => void> = {
|
||||
void handleBatchRemoveExceptionOrders()
|
||||
},
|
||||
openGroupOrderDialog: () => openGroupOrderDialog(),
|
||||
openSingleOrderDialog: () => openSingleOrderDialog()
|
||||
openSingleOrderDialog: () => openSingleOrderDialog(),
|
||||
openConfirmWavePrintDialog: () => {
|
||||
confirmWavePrintVisible.value = true
|
||||
}
|
||||
}
|
||||
|
||||
function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
|
||||
|
||||
@ -488,6 +488,9 @@
|
||||
</el-dialog>
|
||||
|
||||
<printer-list-test-dialog v-model="printerListTestVisible" />
|
||||
|
||||
<!-- 确认打印(print.confirmWavePrint):扫/输面单号确认整波已打印订单 -->
|
||||
<confirm-wave-print-dialog v-model="confirmWavePrintVisible" @success="loadData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -532,6 +535,7 @@ import BatchReceivingPrintDialog from '@/components/BatchReceivingPrintDialog.vu
|
||||
import WavePlatformPrintPreviewDialog from './component/WavePlatformPrintPreviewDialog.vue'
|
||||
import PrinterComponentConnectionPanel from './component/PrinterComponentConnectionPanel.vue'
|
||||
import PrinterListTestDialog from './component/PrinterListTestDialog.vue'
|
||||
import ConfirmWavePrintDialog from './component/ConfirmWavePrintDialog.vue'
|
||||
import PendingOrderListPanel from './component/PendingOrderListPanel.vue'
|
||||
import WaveBatchDetailPanel from './component/WaveBatchDetailPanel.vue'
|
||||
import WaveFetchTaskProgressDialog from './component/WaveFetchTaskProgressDialog.vue'
|
||||
@ -614,6 +618,8 @@ const platformPrintErrorMessage = ref('')
|
||||
const platformPrintRequestMeta = ref<{ warehouse_id: number; wave_ids: Array<number | string> } | null>(null)
|
||||
const printerComponentConnectionVisible = ref(false)
|
||||
const printerListTestVisible = ref(false)
|
||||
/** 确认打印弹窗(print.confirmWavePrint,扫面单号确认整波) */
|
||||
const confirmWavePrintVisible = ref(false)
|
||||
const batchAllocateExpressLoading = ref(false)
|
||||
const batchAllocateStorageLoading = ref(false)
|
||||
const batchRemoveExceptionOrdersLoading = ref(false)
|
||||
@ -832,6 +838,9 @@ const toolbarActionMap: Record<string, () => void> = {
|
||||
},
|
||||
openPrinterListTestDialog: () => {
|
||||
printerListTestVisible.value = true
|
||||
},
|
||||
openConfirmWavePrintDialog: () => {
|
||||
confirmWavePrintVisible.value = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
214
src/views/order/waveOrder/component/ConfirmWavePrintDialog.vue
Normal file
214
src/views/order/waveOrder/component/ConfirmWavePrintDialog.vue
Normal file
@ -0,0 +1,214 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visibleProxy"
|
||||
title="确认打印(扫面单号)"
|
||||
width="520px"
|
||||
align-center
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
@opened="handleOpened"
|
||||
>
|
||||
<div class="confirm-wave-print">
|
||||
<el-alert type="info" :closable="false" show-icon class="confirm-wave-print__tip">
|
||||
<template #title>
|
||||
扫描波次内任一订单的面单号,把该波次下「已打印且非拦截」的订单全部标记为已确认打印
|
||||
</template>
|
||||
<div class="confirm-wave-print__tip-detail">
|
||||
面单号会自行定位所属波次,无需先选中;波次内仍有未打印订单时会被阻断;已全部确认时重复扫描不会重复写日志。
|
||||
</div>
|
||||
</el-alert>
|
||||
|
||||
<div class="confirm-wave-print__field">
|
||||
<span class="field-label">面单号/运单号</span>
|
||||
<el-input
|
||||
ref="inputRef"
|
||||
v-model="waybillNo"
|
||||
placeholder="扫描或输入面单号后回车"
|
||||
clearable
|
||||
:disabled="submitting"
|
||||
@keyup.enter="handleSubmit"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="lastResult" class="confirm-wave-print__result" :class="{ 'is-repeat': lastResult.repeated }">
|
||||
<div class="result-row">
|
||||
<span class="result-label">波次</span>
|
||||
<span class="result-value">{{ lastResult.waveLabel }}</span>
|
||||
</div>
|
||||
<div class="result-row">
|
||||
<span class="result-label">结果</span>
|
||||
<span class="result-value">{{ lastResult.text }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="confirm-wave-print__hint">
|
||||
提示:本页支持直接扫面单号(长度超过 8 位)自动确认打印;此处弹窗用于手工输入或复核最近一次确认结果。
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="visibleProxy = false">关闭</el-button>
|
||||
<el-button type="primary" :loading="submitting" @click="handleSubmit">确认打印</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { confirmWavePrint } from '@/api/print/print'
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:modelValue': [boolean]
|
||||
/** 确认成功(含重复确认)后触发,父级可刷新列表 */
|
||||
success: [{ waveId?: number; status: string }]
|
||||
}>()
|
||||
|
||||
const visibleProxy = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (v: boolean) => {
|
||||
if (!v) resetState()
|
||||
emit('update:modelValue', v)
|
||||
}
|
||||
})
|
||||
|
||||
const inputRef = ref<any>(null)
|
||||
/** 待确认的面单号/运单号 */
|
||||
const waybillNo = ref('')
|
||||
const submitting = ref(false)
|
||||
/** 最近一次确认结果(弹窗内保留,便于连扫时核对) */
|
||||
const lastResult = ref<{ waveLabel: string; text: string; repeated: boolean } | null>(null)
|
||||
|
||||
function resetState() {
|
||||
waybillNo.value = ''
|
||||
lastResult.value = null
|
||||
}
|
||||
|
||||
function focusInput() {
|
||||
void nextTick(() => inputRef.value?.focus?.())
|
||||
}
|
||||
|
||||
function handleOpened() {
|
||||
focusInput()
|
||||
}
|
||||
|
||||
/** 把响应归一化为业务 data(兼容 data 嵌套与顶层平铺两种返回) */
|
||||
function unwrapPayload(res: any): any {
|
||||
return res?.data && typeof res.data === 'object' ? res.data : res
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
if (submitting.value) return
|
||||
const code = waybillNo.value.trim()
|
||||
if (!code) {
|
||||
ElMessage.warning('请先扫描或输入面单号')
|
||||
focusInput()
|
||||
return
|
||||
}
|
||||
|
||||
submitting.value = true
|
||||
try {
|
||||
const res: any = await confirmWavePrint({ waybill_no: code })
|
||||
const data = unwrapPayload(res)
|
||||
const waveIdRaw = Number(data?.wave_id)
|
||||
const waveId = Number.isFinite(waveIdRaw) && waveIdRaw > 0 ? waveIdRaw : undefined
|
||||
const waveLabel = data?.wave_no ? `波次 ${data.wave_no}` : waveId ? `波次ID ${waveId}` : '该波次'
|
||||
|
||||
if (data?.status === 'already_confirmed') {
|
||||
const text = '订单已全部确认打印(重复扫描未重复写日志)'
|
||||
ElMessage.info(`${waveLabel}:${text}`)
|
||||
lastResult.value = { waveLabel, text, repeated: true }
|
||||
emit('success', { waveId, status: 'already_confirmed' })
|
||||
} else {
|
||||
const detail = [
|
||||
`本次确认打印 ${Number(data?.newly_confirmed_order_count ?? 0)} 单`,
|
||||
data?.total_order_count ? `共 ${Number(data.total_order_count)} 单` : '',
|
||||
data?.intercepted_order_count ? `跳过拦截 ${Number(data.intercepted_order_count)} 单` : ''
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(',')
|
||||
ElMessage.success(`${waveLabel}(${code})确认打印成功:${detail}`)
|
||||
lastResult.value = { waveLabel, text: detail, repeated: false }
|
||||
emit('success', { waveId, status: 'confirmed' })
|
||||
}
|
||||
|
||||
// 支持连扫:清空输入框并重新聚焦,方便直接扫下一个波次的面单号
|
||||
waybillNo.value = ''
|
||||
focusInput()
|
||||
} catch {
|
||||
// 请求层已统一提示(存在未打印订单被阻断 / 未查询到该面单号 / 无权限等)
|
||||
} finally {
|
||||
submitting.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.confirm-wave-print {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
|
||||
&__tip {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
&__tip-detail {
|
||||
margin-top: 4px;
|
||||
line-height: 1.6;
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
|
||||
&__field {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.field-label {
|
||||
flex: 0 0 96px;
|
||||
text-align: right;
|
||||
color: var(--el-text-color-regular);
|
||||
}
|
||||
|
||||
&__result {
|
||||
padding: 10px 12px;
|
||||
border-radius: 4px;
|
||||
background: var(--el-color-success-light-9);
|
||||
border: 1px solid var(--el-color-success-light-7);
|
||||
|
||||
&.is-repeat {
|
||||
background: var(--el-color-info-light-9);
|
||||
border-color: var(--el-color-info-light-7);
|
||||
}
|
||||
}
|
||||
|
||||
.result-row {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.result-label {
|
||||
flex: 0 0 40px;
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
|
||||
.result-value {
|
||||
flex: 1;
|
||||
color: var(--el-text-color-primary);
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
&__hint {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
line-height: 1.6;
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -189,16 +189,22 @@ export const waveAvailableFields = [
|
||||
}),
|
||||
group: WAVE_SCAN_PROCESS_STATUS_GROUP
|
||||
},
|
||||
{ ...scanWorkflowField({
|
||||
label: '拣货状态',
|
||||
value: 'pick_assignment_status',
|
||||
type: 'select',
|
||||
options: [
|
||||
{ label: '未拣货', value: 'unpicked' },
|
||||
{ label: '部分拣货', value: 'partially_picked' },
|
||||
{ label: '已拣货', value: 'picked' },
|
||||
]
|
||||
}), group: WAVE_SCAN_PROCESS_STATUS_GROUP },
|
||||
{
|
||||
// ⚠️ 文档差异(2026-09-21 快照):order.wave.batchList 的 where 描述【字段清单】未列 pick_assignment_status,
|
||||
// 但响应仍返回该字段、本页与 waveOrder2「拣货状态」tab 一直按它筛选 → 暂判为文档漏列,保留筛选项;
|
||||
// 若后端确已收紧白名单(不在允许集合内返回 400),需同步移除本页 + waveOrder2 的该筛选项。
|
||||
...scanWorkflowField({
|
||||
label: '拣货状态',
|
||||
value: 'pick_assignment_status',
|
||||
type: 'select',
|
||||
options: [
|
||||
{ label: '未拣货', value: 'unpicked' },
|
||||
{ label: '部分拣货', value: 'partially_picked' },
|
||||
{ label: '已拣货', value: 'picked' },
|
||||
]
|
||||
}),
|
||||
group: WAVE_SCAN_PROCESS_STATUS_GROUP
|
||||
},
|
||||
{ ...scanWorkflowField({
|
||||
label: '复核状态',
|
||||
value: 'review_assignment_status',
|
||||
@ -460,6 +466,9 @@ export const waveWhereAllowedFieldList = [
|
||||
'review_assignment_status',
|
||||
// 同步状态(order.wave.batchList where 仅 eq,英文枚举 unsynced/partially_synced/synced)
|
||||
'sync_assignment_status',
|
||||
// ⚠️ 文档差异:2026-09-21 快照的 where【字段清单】未列 pick_assignment_status,但响应仍返回该字段、
|
||||
// 页面(本页与 waveOrder2 拣货状态 tab)按它筛选 → 暂判为文档漏列,保留白名单
|
||||
'pick_assignment_status',
|
||||
'total_orders',
|
||||
'total_orders_min',
|
||||
'total_orders_max',
|
||||
@ -708,6 +717,15 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
action: 'handleBatchPrintPickingList',
|
||||
onlyForWaveType: 2
|
||||
},
|
||||
{
|
||||
// print.confirmWavePrint:扫波次内任一面单号 → 整波次「已打印且非拦截」订单批量确认打印。
|
||||
// 面单号自行定位波次,故不依赖选中行、不做 onlyForWaveType 限制(团购波次 / 散单波次都显示)。
|
||||
key: 'confirmWavePrint',
|
||||
label: '确认打印',
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
action: 'openConfirmWavePrintDialog'
|
||||
},
|
||||
{
|
||||
key: 'batchAutoGrouping',
|
||||
label: '批量改为自动加团',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user