From a241495afcbc57ec712136907caf2ca43596dfcd Mon Sep 17 00:00:00 2001 From: yin <3313488199@qq.com> Date: Sun, 23 Aug 2026 18:15:02 +0800 Subject: [PATCH] 1 --- src/api/pick/pick.ts | 2 + src/api/returnunpack/index.ts | 19 ++++++-- src/api/stock/stock.ts | 43 +++++++++++++++++-- src/api/storage.inventory/inventory.ts | 23 +++++++--- src/views/express/returnUnpackwork/index.vue | 27 +++++++++--- .../express/returnUnpackwork/scan-commands.ts | 7 ++- .../config/order-common-config.ts | 4 +- src/views/stock/stock/component/add.vue | 8 ++++ src/views/stock/stock/component/info.vue | 8 ++++ src/views/stock/stock/index.vue | 6 +++ src/views/stock/stock/stock-config.ts | 8 ++++ src/views/storage/inventory/index.vue | 8 ++++ .../storage/inventory/inventory-config.ts | 1 + 13 files changed, 141 insertions(+), 23 deletions(-) diff --git a/src/api/pick/pick.ts b/src/api/pick/pick.ts index 46c09bd5..5f0abd5a 100644 --- a/src/api/pick/pick.ts +++ b/src/api/pick/pick.ts @@ -181,6 +181,8 @@ export type PickWaveClaimScanResponse = { waybill_no: string /** 波次下订单总数 */ total_order_count: number + /** 波次下拦截订单数(拦截订单跳过领料,其未打印/未领料状态不阻隔领料与拣货) */ + intercepted_order_count: number /** 本次置为 fin 的订单数(已全部领单时返回 0) */ claimed_order_count: number /** 操作结果:claimed(整波领单完成)或 already_claimed(波次已领单) */ diff --git a/src/api/returnunpack/index.ts b/src/api/returnunpack/index.ts index 0436ddee..a174df4e 100644 --- a/src/api/returnunpack/index.ts +++ b/src/api/returnunpack/index.ts @@ -87,7 +87,7 @@ export type ReturnUnpackRecord = { [key: string]: any } -/** 原订单商品明细行(order.items 顶层透出) */ +/** 原订单商品明细行(order.items 的元素) */ export type ReturnUnpackOrderItem = { /** 商品编码 */ item_code?: string @@ -170,9 +170,9 @@ export type ReturnUnpackCreateResponse = { is_original_return: boolean /** 货主的合约货主备注名称,未命中时为空字符串 */ store_remark: string - /** 原订单详情(仅原单退回时返回,非原单为 null) */ + /** 原订单详情(含 items 明细,仅原单退回时返回,非原单为 null) */ order?: ReturnUnpackOriginalOrder | null - /** 原订单商品明细数组(order.items 顶层透出,仅原单退回时返回;非原单退回或原订单详情缺失时为 null) */ + /** 原订单商品明细数组(即 order.items 的顶层透出,仅原单退回时返回;非原单退回或原订单详情缺失时为 null) */ order_items?: ReturnUnpackOrderItem[] | null /** 是否幂等复用已有拆包单 */ reused?: boolean @@ -380,6 +380,10 @@ export type ReturnUnpackListWhere = { order_express_id?: number /** 原订单ID(等值) */ order_id?: number + /** 是否有视频记录(等值):1 有视频记录 / 2 无视频记录 */ + has_video?: 1 | 2 + /** 录像是否可用(等值):1 可用(存在 video_url 非空且 status!=failed 的记录) / 2 不可用 */ + video_enable?: 1 | 2 } /** returnUnpack.list 排序参数 */ @@ -405,8 +409,15 @@ export type ReturnUnpackListParams = { sort?: ReturnUnpackListSort } +/** returnUnpack.list 响应 */ +export type ReturnUnpackListResponse = { + /** 拆包单列表,每条含主表字段 + is_original_return 派生字段 + 格式化时间字段 + camera_ids 数组 + 视频派生字段 has_video(1=有视频记录/2=无)与 video_enable(1=录像可用/2=不可用)+ videos 视频数组(id/video_url/status/camera_id/camera_name) */ + list: ReturnUnpackRecord[] + pagination: ReturnUnpackPagination +} + /** returnUnpack.list:拆包单分页列表(仓库隔离,服务端注入 warehouse_id) */ -export function returnUnpackList(data: ReturnUnpackListParams = {}): Promise { +export function returnUnpackList(data: ReturnUnpackListParams = {}): Promise { return request({ url: '/system', method: 'post', diff --git a/src/api/stock/stock.ts b/src/api/stock/stock.ts index 8990f550..7ad10184 100644 --- a/src/api/stock/stock.ts +++ b/src/api/stock/stock.ts @@ -103,6 +103,13 @@ export function getProhibitedList() { } as any) } +/** stock.warehouse.getInfo 响应 data */ +export type StockWarehouseInfoResponse = { + /** 是否需要复核:Y=需要复核,N=不需要复核 */ + need_recheck?: string + [key: string]: any +} + export function getInfo(id: any) { return request({ url: '/system', @@ -117,7 +124,15 @@ export function getInfo(id: any) { } as any) } -export function saveWarehouseStock(data: any) { +/** stock.warehouse.saveWarehouseStock 请求参数 */ +export type SaveWarehouseStockParams = { + /** 是否需要复核:Y=需要复核,N=不需要复核(非 Y/N 值会报错) */ + need_recheck?: string + [key: string]: any +} + +/** stock.warehouse.saveWarehouseStock:新增/更新仓库商品 */ +export function saveWarehouseStock(data: SaveWarehouseStockParams) { return request({ url: '/system', method: 'post', @@ -299,7 +314,15 @@ export function checkItemCodeUnique(data: CheckItemCodeUniqueParams) { } as any) } -export function createWarehouseStock(data: any) { +/** stock.warehouse.createWarehouseStock 请求参数 */ +export type CreateWarehouseStockParams = { + /** 是否需要复核:Y=需要复核,N=不需要复核;缺省默认 Y(需要复核) */ + need_recheck?: string + [key: string]: any +} + +/** stock.warehouse.createWarehouseStock:新增仓库商品 */ +export function createWarehouseStock(data: CreateWarehouseStockParams) { return request({ url: '/system', method: 'post', @@ -327,7 +350,21 @@ export function handleBatchDelete(data: any) { } as any) } -export function handleBatchChange(data: any) { +/** stock.warehouse.handleBatchChange 请求参数 */ +export type HandleBatchChangeParams = { + /** 要批量修改的仓库商品记录 ID 数组(stock_warehouse.id) */ + ids?: number[] + /** 要修改的字段名:brand_name、prohibited_id、gross_weight、packing_requirements、managementFlags、stock_unit、need_recheck */ + method?: string + /** 修改值,类型依 method 而定:brand_name/packing_requirements/stock_unit 为 string(<=255 字符);prohibited_id 为 number(整数);gross_weight 为 number(正整数,单位 g);managementFlags 为 object(含 is_sn_mgmt/is_shelf_life_mgmt/is_batch_mgmt,值为 Y/N);need_recheck 为 string(仅支持 Y/N) */ + value?: string | number | Record + /** 兼容字段:当前实现以 value 为准,不使用 values */ + values?: any + [key: string]: any +} + +/** stock.warehouse.handleBatchChange:批量修改仓库商品字段 */ +export function handleBatchChange(data: HandleBatchChangeParams) { return request({ url: '/system', method: 'post', diff --git a/src/api/storage.inventory/inventory.ts b/src/api/storage.inventory/inventory.ts index 5a1c5fca..d8e1b873 100644 --- a/src/api/storage.inventory/inventory.ts +++ b/src/api/storage.inventory/inventory.ts @@ -3,7 +3,20 @@ import request from '@/utils/request' const v = "1.0" -export function getInventoryList(data: any): Promise { +/** storage.inventory.list 请求参数 */ +export type InventoryListParams = { + /** 统一 where 条件对象,可用字段:stock_id(商品ID)、space_id(库位ID)、store_id(货主ID)、inventory_type(ZP/CC/JS/XS/ZT/DJ/FP)、batch_no(批次号)、inbound_order_no(入库单号)、available_quantity(可用数量,支持 gt/lt)、inbound_time(入库时间,支持 between)、created_at(创建时间,支持 between)、stock_query(虚拟筛选字段:按商品编码/名称/货物编码/条码/SKU ID 模糊匹配,如 { operator: 'like', value: '111' }) */ + where?: Record + /** 分页参数 { page, pageSize },默认 page=1, pageSize=20 */ + pagination?: { page?: number; pageSize?: number } + /** 排序参数 { sortField, sortOrder },默认 sortField='created_at', sortOrder='DESC' */ + sort?: { sortField?: string; sortOrder?: 'ASC' | 'DESC' } + /** 是否按批次查询,默认 false。false=合并模式(按库位+商品聚合 quantity/locked_quantity/available_quantity),true=明细模式(逐条返回含 batch_no/production_date/expiry_date 等) */ + group_by_batch?: boolean +} + +/** 库存明细列表查询 */ +export function getInventoryList(data: InventoryListParams = {}): Promise { return request({ url: '/system', method: 'post', @@ -182,16 +195,14 @@ export function getExpiryList(data: any): Promise { /** storage.inventory.export 请求参数 */ export type InventoryExportParams = { - /** 导出模式:'stock_location'(默认,按商品+库位聚合)| 'storage'(按库存记录逐条导出) */ - exportMode?: 'stock_location' | 'storage' - /** 统一 where 条件对象,与 storage.inventory.list 的 where 语义一致 */ + /** 统一 where 条件对象,与 storage.inventory.list 的 where 语义完全一致(暂不支持 stock_query 虚拟筛选)。支持字段:stock_id(商品ID)、space_id(库位ID)、store_id(货主ID)、inventory_type(ZP/CC/JS/XS/ZT/DJ/FP)、batch_no(批次号)、inbound_order_no(入库单号)、available_quantity(可用数量,支持 gt/lt)、inbound_time(入库时间,支持 between)、created_at(创建时间,支持 between) */ where?: Record - /** 排序参数 { sortField, sortOrder } */ + /** 排序参数,与 storage.inventory.list 的 sort 语义一致。sortField 支持:id/stock_id/space_id/created_at/updated_at/inbound_time/quantity,sortOrder 支持 ASC/DESC。默认 id DESC */ sort?: { sortField?: string sortOrder?: 'ASC' | 'DESC' } - /** 是否按批次查询导出,对齐查询模式 group_by_batch */ + /** 是否按批次导出,默认 false。false=合并模式(按 stock_id+库位聚合导出库存汇总,含总库存/锁定/可用/批次数/最近入库时间),true=明细模式(按 storage_id 逐条导出库存明细,含批次号/库存类型/生产日期/过期日期/入库单号等) */ group_by_batch?: boolean } diff --git a/src/views/express/returnUnpackwork/index.vue b/src/views/express/returnUnpackwork/index.vue index fdb7e315..2daa65be 100644 --- a/src/views/express/returnUnpackwork/index.vue +++ b/src/views/express/returnUnpackwork/index.vue @@ -88,7 +88,7 @@ 打印贴纸
+ + 是 + 否 + + +
diff --git a/src/views/stock/stock/component/info.vue b/src/views/stock/stock/component/info.vue index 0f758007..a0113aa6 100644 --- a/src/views/stock/stock/component/info.vue +++ b/src/views/stock/stock/component/info.vue @@ -138,6 +138,14 @@ + + + + 是 + 否 + + + + + + + diff --git a/src/views/storage/inventory/inventory-config.ts b/src/views/storage/inventory/inventory-config.ts index 2b3c90a1..22ea3cbd 100644 --- a/src/views/storage/inventory/inventory-config.ts +++ b/src/views/storage/inventory/inventory-config.ts @@ -221,6 +221,7 @@ export const productstockColums = [ { prop: 'last_inbound_time', label: '最后入库时间', width: '160' }, { prop: 'is_shelf_life_mgmt', label: '保质期管理', width: '100' }, { prop: 'remaining_threshold_days', label: '临期阈值(天)', width: '110' }, + { prop: 'is_shelf_life_warning_triggered', label: '临期预警', width: '100' }, { prop: 'is_batch_mgmt_enabled', label: '批次管理', width: '100' }, { prop: 'batch_count', label: '批次数', width: '80' } ]