This commit is contained in:
yin 2026-04-13 21:38:47 +08:00
parent 309357bba7
commit a97c7214dd
30 changed files with 21726 additions and 7240 deletions

Binary file not shown.

View File

@ -106,3 +106,13 @@ export const orderDetail = (data: any): Promise<any> => {
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.list', v: '1.0', timestamp: Date.now() }, data: data });
export const orderExpectionList = (data: any): Promise<any> => request({ url: '/system', method: 'post', params: { method: 'order.expectionOrder.list', 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 });

View File

@ -35,6 +35,7 @@ export function matchPutaway(data: {
isSystemApi: true
} as any)
}
// 非本项目接口,不使用
export function transferByProduct(data: {
space_id: number
stock_id: number
@ -52,4 +53,31 @@ export function transferByProduct(data: {
data,
isSystemApi: true
} as any)
}
}
// 非本项目接口,不使用
export function transferLocation(data:any) {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.inventory.transferLocation',
v,
timestamp: new Date().getTime()
},
data,
isSystemApi: true
} as any)
}
// export function transaction(data:any) {
// return request({
// url: '/system',
// method: 'post',
// params: {
// method: 'storage.inventory.transaction',
// v,
// timestamp: new Date().getTime()
// },
// data,
// isSystemApi: true
// } as any)
// }

View File

@ -252,6 +252,19 @@ export function bindDetailProduct(data: any): Promise<any> {
})
}
export function detailChange(data: any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.receiving.detailChange',
v,
timestamp: new Date().getTime()
},
data
})
}
export function quickPutaway(data: {
/** 收货单ID */

View File

@ -0,0 +1,16 @@
import request from '@/utils/request'
const v = '1.0'
export function getExpiryList(data: any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.expiry.list',
v,
timestamp: new Date().getTime()
},
data
})
}

480
src/apichanges.txt Normal file
View File

@ -0,0 +1,480 @@
[
{
"version": "2026.04.07-system-01",
"date": "2026-04-07",
"summary": "修正 warehouse.getAreaRacks 的鉴权/权限链路文档,明确该接口需要 登录并走权限校验。",
"methods": [
"warehouse.getAreaRacks"
],
"notes": [
"对齐当前 system 文档中的 isNeedAuth=true、isNeedLogin=true。",
"用于补充该接口权限链路修正文档的历史上下文,不改变 methods/system.json 的 SSOT 角色。"
]
},
{
"version": "2026.04.07-system-02",
"date": "2026-04-07",
"summary": "补充签约配置相关接口文档,覆盖策略字段元信息查询与面单数量人工调整。",
"methods": [
"storeWarehouse.store.getPolicyConfigFields",
"storeWarehouse.store.adjustPrintQuantity"
],
"notes": [
"getPolicyConfigFields 说明为获取签约策略可配置字段元信息列表。",
"adjustPrintQuantity 说明为人工调整签约关系下的面单余额并记录变更日志,并 明确 id、change_quantity、reason 等关键入参。"
]
},
{
"version": "2026.04.07-system-03",
"date": "2026-04-07",
"summary": "对外命名从 qimenConfig 收口为 apiConfig,并在接口配置文档中强调 interface_type_id 校验。",
"methods": [
"storeWarehouse.store.listApiConfig",
"storeWarehouse.store.saveApiConfig",
"storeWarehouse.store.deleteQimenConfig"
],
"notes": [
"文档对外统一使用 apiConfig / api_config 命名,减少 qimenConfig 历史别名歧义。",
"saveApiConfig 要求 interface_type_id 为必填且必须指向已存在的 wms_interface_type 记录。",
"listApiConfig / deleteQimenConfig 同步补充 interface_type_id 字段说明。"
]
},
{
"version": "2026.04.07-system-04",
"date": "2026-04-07",
"summary": "补充 /api/docs 文档体验增强说明,新增查看变更记录与查看原文 JSON 的入口说明。",
"methods": [
"/api/docs",
"/api/docs/:docName",
"/api/docs/:docName/raw",
"/api/docs/:docName/changes"
],
"notes": [
"sidecar 变更数组用于承载文档历史说明,不替代 methods/system.json 作为 SSOT。",
"原文 JSON 入口继续用于直接查看当前生效文档。"
]
},
{
"version": "2026.04.07-system-05",
"date": "2026-04-07",
"summary": "修正 storeWarehouse.store.adjustPrintQuantity 的面单余额调整语义:由增减/累加改为覆盖设置目标余额。",
"methods": [
"storeWarehouse.store.adjustPrintQuantity"
],
"notes": [
"adjustPrintQuantity 当前兼容 print_quantity、target_quantity、change_quantity、adjust_quantity 作为目标面单余额输入,不再按增减量解释。",
"变更日志中的 change_quantity 由 before/after 自动计算差值,以兼容历史审计与展示。"
]
},
{
"version": "2026.04.07-system-06",
"date": "2026-04-07",
"summary": "按接口类型分类限制必填字段,OPEN_API 创建时自动生成 self_app_key/self_app_secret",
"methods": [
"storeWarehouse.store.saveApiConfig"
],
"notes": [
"QM_WMS 类型须填写 qimen_app_key/qimen_customer_id/qimen_warehouse_code;OPEN_API 类型三个奇门字段非必填,创建时自动生成 self_app_key(WMS+32位HEX)和 self_app_secret(64位HEX),更新时保留已有密钥。"
],
"type": "changed"
},
{
"version": "2026.04.07-system-07",
"date": "2026-04-07",
"summary": "新增接口类型列表查询接口,归属基础模块,无需权限",
"methods": [
"index.listInterfaceTypes"
],
"notes": [
"返回所有已启用的接口类型(wms_interface_type),包含 id、interface_code、interface_name、interface_category、description 字段。设置 isNeedAuth: false, isNeedLogin: true。"
],
"type": "added"
},
{
"version": "2026.04.07-system-08",
"date": "2026-04-07",
"summary": "app_name 改为必传参数",
"methods": [
"storeWarehouse.store.saveApiConfig"
],
"notes": [
"app_name 不再有默认值自动生成逻辑,调用方必须传入非空的 app_name,否则返 回 400 错误。"
],
"type": "changed"
},
{
"version": "2026.04.07-system-09",
"date": "2026-04-07",
"summary": "新增收货单快捷入库上架接口",
"methods": [
"storage.inventory.quickPutaway"
],
"notes": [
"新建 storage.inventory 库存操作模块。quickPutaway 从收货单直接生成入库单 (SCRK)并写入 wms_storage 库存表,同时更新 wms_stock_warehouse 库存数量(悲观行锁),回填收货明细入库状态。要求收货单已完成且所有明细已匹配系统商品。"
],
"type": "added"
},
{
"version": "2026.04.08-system-01",
"date": "2026-04-08",
"summary": "新增收货单与入库单匹配入库接口",
"methods": [
"storage.inventory.matchPutaway"
],
"notes": [
"接收多个收货单和入库单,按商品(stock_warehouse_id)进行数量匹配入库,完 成后根据入库单来源(QM/API)自动触发回传。入参为 receiving_ids(数组)和 entry_order_ids(数组),返回匹配汇总、各收货单入库状态、各入库单状态及回传结果。isNeedAuth=true, isNeedLogin=true, isNeedRight=false。"
],
"type": "added"
},
{
"version": "2026.04.08-system-02",
"date": "2026-04-08",
"summary": "saveApiConfig 新增 callback_url 可选参数",
"methods": [
"storeWarehouse.store.saveApiConfig"
],
"notes": [
"新增 callback_url 参数(VARCHAR(500),可选),用于 OPEN_API 类型入库单的 回调地址配置。"
],
"type": "changed"
},
{
"version": "2026.04.08-system-03",
"date": "2026-04-08",
"summary": "serializeQimenConfig 新增返回 callback_url 字段,影响 list 和 listApiConfig 两个接口",
"methods": [
"storeWarehouse.store.list",
"storeWarehouse.store.listApiConfig"
],
"notes": [
"serializeQimenConfig() 序列化方法新增 callback_url(string)字段。storeWarehouse.store.list 返回的每条记录 api_config 对象中包含 callback_url;storeWarehouse.store.listApiConfig 返回的 list 数组中每条配置包含 callback_url。"
],
"type": "changed"
},
{
"version": "2026.04.08-system-04",
"date": "2026-04-08",
"summary": "新增库存移库(库位转移)接口",
"methods": [
"storage.inventory.transferLocation"
],
"notes": [
"新增 storage.inventory.transferLocation 接口,支持批量多商品多库位移库, 包含部分数量移库与全量移库。入参为 warehouse_id(仓库ID)和 transfers 数组(storage_id、target_space_id、quantity),触发 storage_transfer_completed 通知事件, 每条移库记录独立操作日志。isNeedAuth=true, isNeedLogin=true。"
],
"type": "added"
},
{
"version": "2026.04.08-system-05",
"date": "2026-04-08",
"summary": "简化移库接口入参,从批量 transfers 数组改为单条移库",
"methods": [
"storage.inventory.transferLocation"
],
"notes": [
"移除 warehouse_id 和 transfers 数组入参,改为扁平的 storage_id + target_space_id + quantity 三个顶层参数。warehouse_id 从库存记录自动获取,接口从批量移库简化为单商品单库位移库。响应结构同步简化为单条结果对象。"
],
"type": "modified"
},
{
"version": "2026.04.08-system-06",
"date": "2026-04-08",
"summary": "新增商品库存明细查询接口",
"methods": [
"stock.warehouse.getStockDetail"
],
"notes": [
"新增 stock.warehouse.getStockDetail 接口,按库位/批次维度查询商品库存分布。入参为 stock_id(必填,商品库存ID)和 pagination(可选,含 page/pageSize)。返回 stockItem(商品概要)、storageList(wms_storage 明细数组,含批次号、库位、数 量、锁定数量、生产日期、过期日期等,关联 location_space 库位信息)、pagination 分页信息。isNeedAuth=false, isNeedLogin=true。底层调用 stockStore.getStockDetail,自动校验商品归属当前仓库。"
],
"type": "added"
},
{
"version": "2026.04.08-system-07",
"date": "2026-04-08",
"summary": "新增入参 group_by_batch,支持按批次维度切换库存明细聚合方式",
"methods": [
"stock.warehouse.getStockDetail"
],
"notes": [
"新增可选布尔参数 group_by_batch(默认 false)。false 时按库位合并数量,批次相关字段(batch_no, production_date, expiry_date, inbound_time, inbound_order_no, supplier_batch_no)置 null;true 时保持原逻辑返回每条明细。出参结构不变,但 storageList 中批次字段在合并模式下为 null。"
],
"type": "modified"
},
{
"version": "2026.04.08-system-08",
"date": "2026-04-08",
"summary": "新增按商品维度移库接口",
"methods": [
"storage.inventory.transferByProduct"
],
"notes": [
"新增 storage.inventory.transferByProduct 接口,按库位+商品查找所有库存记 录合并移动。入参为 space_id(原库位ID)、stock_id(商品SKU ID,即 wms_stock_warehouse.id)、target_space_id(目标库位ID)、quantity(移库数量)。开启批次管理(is_batch_mgmt=Y)的商品会被拒绝,需使用 transferLocation 按库存记录精确移库。复用 storage_transfer_completed 通知事件,操作日志编码 STORAGE_TRANSFER_BY_PRODUCT。isNeedAuth=true, isNeedLogin=true。"
],
"type": "added"
},
{
"version": "2026.04.08-system-09",
"date": "2026-04-08",
"summary": "补充 storeWarehouse.store.list 完整 response 输出字段说明,移除 api_config / apiConfig",
"methods": [
"storeWarehouse.store.list"
],
"notes": [
"从返回结果中移除 api_config 和 apiConfig 字段(代码中 delete serialized.api_config / delete serialized.apiConfig),文档 response 补充完整输出字段列表:id, store_id, store_name, warehouse_id, warehouse_name, counterparty_id, counterparty_name, current_subject_role, auth_status, auth_status_label, apply_reason, review_comment, apply_time, review_time, auth_start, auth_end, actual_end, print_quantity, applied_by, reviewed_by, ended_by, remask, use_status, policy_config, is_auth_valid, remaining_days 以及分页和 current_subject 信息。"
],
"type": "updated"
},
{
"version": "2026.04.08-system-10",
"date": "2026-04-08",
"summary": "货主列表返回新增 has_qimen_config 布尔字段",
"methods": [
"storeWarehouse.store.list"
],
"notes": [
"storeWarehouse.store.list 返回的 data.list[] 中新增 has_qimen_config(boolean),表示该货主是否已配置奇门。"
],
"type": "changed"
},
{
"version": "2026.04.08-system-11",
"date": "2026-04-08",
"summary": "补全 stock.warehouse.search 接口文档,新增 params / response / errors 完整说明",
"methods": [
"stock.warehouse.search"
],
"notes": [
"入参补充 keyword(string,模糊匹配 item_code / item_name / goods_code / barcode)和 store_id(number,按货主筛选)。响应补充 data 数组各字段(id, item_code, goods_code, item_name, sku_property, stock_unit, quantity, locked_quantity, brand_name, item_type, barcodes, store_stock)以及 total。errors 补充 code=0 搜 索失败场景。"
],
"type": "updated"
},
{
"version": "2026.04.08-system-12",
"date": "2026-04-08",
"summary": "新增 with_stock / is_batch 参数,支持返回关联库存明细(按库位分 组或按批次逐条)",
"methods": [
"stock.warehouse.search"
],
"notes": [
"入参新增 with_stock(boolean,默认 false,是否返回关联库存数据)和 is_batch(boolean,默认 false,仅 with_stock=true 时生效,按批次明细返回)。响应 data[] 新增 storage[] 字段:is_batch=false 时按库位分组汇总(含 space_id、space、inventory_type、quantity、locked_quantity、available_quantity);is_batch=true 时逐 条返回批次明细(含 id、stock_id、space_id、batch_no、inventory_type、quantity、locked_quantity、available_quantity、production_date、expiry_date、inbound_time、inbound_order_no、supplier_batch_no、created_at、space)。"
],
"type": "updated"
},
{
"version": "2026.04.08-system-13",
"date": "2026-04-08",
"summary": "新增 wms_stock_transaction 表和模型",
"methods": [
"wms_stock_transaction"
],
"notes": [
"新增出入库流水记录表 wms_stock_transaction,含 transaction_type(INBOUND/OUTBOUND)、warehouse_id、store_id、stock_id、storage_id、space_id、quantity、batch_no、inventory_type、order_type、order_no、order_id、receiving_id、entry_order_id、operator_id、operator_name、remark 等字段,关联 StockWarehouse 和 Storage 模型。"
],
"type": "added"
},
{
"version": "2026.04.08-system-14",
"date": "2026-04-08",
"summary": "quickPutaway 和 matchPutaway 入库时自动写入出入库记录",
"methods": [
"storage.inventory.quickPutaway",
"storage.inventory.matchPutaway"
],
"notes": [
"入库操作完成后自动写入 wms_stock_transaction 记录。quickPutaway 写入 order_type='SCRK'(收货入库),matchPutaway 写入 order_type='MATCH'(匹配入库),均 自动填充 warehouse_id、store_id、stock_id、storage_id、space_id、quantity、batch_no、inventory_type 等字段。"
],
"type": "updated"
},
{
"version": "2026.04.08-system-15",
"date": "2026-04-08",
"summary": "新增 storage.inventory.list 出入库记录列表查询接口",
"methods": [
"storage.inventory.list"
],
"notes": [
"出入库记录列表查询,支持 where 条件(transaction_type、stock_id、space_id、store_id、order_type、order_no、inventory_type、operator_name、created_at)、 分页(pagination)、排序(sort)和 group_by_batch 参数。默认合并模式按库位+商品 聚合返回合计数量与记录条数,group_by_batch=true 时返回每条明细含 batch_no、order_no、operator_name 等完整信息。响应均关联 stockItem(item_code、item_name、sku_property、stock_unit)。"
],
"type": "added"
},
{
"version": "2026.04.08-system-16",
"date": "2026-04-08",
"summary": "出入库流水记录查询接口从 storage.inventory.list 改名为 storage.transaction.list",
"methods": [
"storage.transaction.list"
],
"notes": [
"将出入库流水记录查询从 storage.inventory.list 迁移到 storage.transaction.list,避免与库存列表概念混淆。功能和参数不变。isNeedAuth=false, isNeedLogin=true, isNeedRight=false。"
],
"type": "rename",
"module": "storage"
},
{
"version": "2026.04.08-system-17",
"date": "2026-04-08",
"summary": "新增 storage.inventory.list 库存列表查询接口",
"methods": [
"storage.inventory.list"
],
"notes": [
"新增库存列表查询接口,查询 wms_storage 表。支持 where 条件(stock_id/space_id/store_id/inventory_type/batch_no/inbound_order_no/available_quantity/inbound_time/created_at)、分页、排序。支持 group_by_batch 参数:默认 false 按库位+商 品合并(SUM quantity/locked_quantity/available_quantity),true 返回每条明细含 batch_no/production_date/expiry_date 等。关联 stockItem(商品信息)和 space(库位信息)。isNeedAuth=false, isNeedLogin=true, isNeedRight=false。"
],
"type": "add",
"module": "storage"
},
{
"version": "2026.04.08-system-18",
"date": "2026-04-08",
"summary": "移除 storage.entry.create 创建入库单接口",
"methods": [
"storage.entry.create"
],
"notes": [
"不再允许通过 API 创建入库单。入库单仅由快捷入库(quickPutaway)和匹配入库(matchPutaway)等内部流程自动创建。底层 service 实现保留但不再通过 systemMethods 对外暴露。"
],
"type": "remove",
"module": "storage"
},
{
"version": "2026.04.08-system-19",
"date": "2026-04-08",
"summary": "移除 storage.entry.addDetail / deleteDetail / detailChange 对外 接口",
"methods": [
"storage.entry.addDetail",
"storage.entry.deleteDetail",
"storage.entry.detailChange"
],
"notes": [
"入库单明细编辑能力不再通过 systemMethods 对外暴露,入库单模块仅保留 list/get/cancel/completeEntry。"
],
"type": "remove",
"module": "storage"
},
{
"version": "2026.04.08-system-20",
"date": "2026-04-08",
"summary": "新增 storage.stockout 出库单模块(非订单出库单能力)",
"methods": [
"storage.stockout.list",
"storage.stockout.toOrder",
"storage.stockout.listItems"
],
"notes": [
"新增 storage.stockout.list / toOrder / listItems 接口,作为非订单出库单的主出口(对应奇门 stockout.create)。storage.delivery.* 仅作为兼容转发保留;底层 部分能力仍复用 order 模块。"
],
"type": "add",
"module": "storage"
},
{
"version": "2026.04.08-system-21",
"date": "2026-04-08",
"summary": "将 storage.stockout.toOrder 标记为占位接口",
"methods": [
"storage.stockout.toOrder"
],
"notes": [
"storage.stockout.toOrder 当前仅保留方法名用于后续扩展,暂不开放实际逻辑。调用时返回 code=405、message=占位接口,暂未开放。"
],
"type": "change"
},
{
"version": "2026.04.09-system-01",
"date": "2026-04-09",
"summary": "storage.entry.cancel 支持批量作废,新增 ids 入参并兼容单条 id",
"methods": [
"storage.entry.cancel"
],
"notes": [
"新增入参 `ids`(number[])以支持批量作废,兼容旧入参 `id`;当同时传入 `ids` 与 `id` 时以 `ids` 为准。",
"参数校验:`ids` 必须为非空数组;非法 ID 或空数组返回 400。",
"业务约束:已完成/已作废/处于不可作废状态的单据不允许作废;批量场景下任一 单据不存在或状态不允许时整体返回 404/400,未执行部分更新。",
"响应说明:单条作废返回字段 `id`(number);批量作废返回字段 `ids`(number[])。",
"已同步更新 methods/system.json(storage.entry.cancel)为 SSOT。"
]
},
{
"version": "2026.04.09-system-02",
"date": "2026-04-09",
"summary": "新增基础模块车牌识别接口 index.recognizeLicensePlate",
"methods": [
"index.recognizeLicensePlate"
],
"notes": [
"入参:base64(string,必填)或 imageBase64/image_base64(兼容)",
"响应:返回归一化后的识别对象,包含 licensePlate、plateNumber、color、confidence、requestId、imageSize、rawData",
"错误:400(参数或图片格式/尺寸问题),500(第三方 OCR 调用失败或云密钥未 配置)",
"文档中不包含任何敏感配置;实际腾讯云密钥保留在配置文件中,勿在文档中暴露 。"
],
"type": "added"
},
{
"version": "2026.04.09-system-03",
"date": "2026-04-09",
"summary": "收紧基础模块车牌识别接口响应,仅返回 licensePlate 字段",
"methods": [
"index.recognizeLicensePlate"
],
"notes": [
"出参由 {licensePlate, plateNumber, color, confidence, requestId, imageSize, rawData} 调整为 {licensePlate}",
"调用方请仅依赖 licensePlate 字段以适配新版本;历史字段已裁剪且不再保证 存 在。",
"文档中未包含任何云密钥或敏感配置信息。"
],
"type": "changed"
},
{
"version": "2026.04.12-system-01",
"date": "2026-04-12",
"summary": "新增订单工作台各分组 list 接口文档,说明 where 透传与分页上限(pageSize\u003C=200)",
"methods": [
"order.list",
"order.reviewOrder.list",
"order.reviewOrder.reviewOrder",
"order.pendingOrder.list",
"order.expectionOrder.list",
"order.entrustOrder.list",
"order.deliveryOrder.list",
"order.deliveryExpectionOrder.list",
"order.archiveOrder.list"
],
"notes": [
"补充 order 工作台分组 list 接口,并说明所有 list 接口支持 pagination、where、sort;服务端对 pagination.pageSize 做上限截断(MAX=200)。",
"说明 where 参数会被 normalize 并交给解析器 parseWhereConditions,再与模块默认条件合并后用于底层查询;示例:reviewOrder 模块默认 step=0,pendingOrder 默认 step in [1,2],deliveryOrder 默认 dispatch_lane=m4 等。",
"补充待审核模块的审核提交接口 order.reviewOrder.reviewOrder,说明其仅接收 ids 批量入参(number[] 或 string[]),严格同仓校验,不再兼容旧字段。",
"兼容入口(如 getreviewOrderlist / getdeliveryOrderlist 等)作为历史兼容保留,在文档中标为兼容说明,不作为主入口推荐。"
],
"type": "added",
"module": "order"
},
{
"version": "2026.04.13-system-01",
"date": "2026-04-13",
"summary": "新增待处理订单取消接口 order.pendingOrder.cancelOrder(ids-only)",
"methods": [
"order.pendingOrder.cancelOrder"
],
"notes": [
"新增接口 order.pendingOrder.cancelOrder:用于批量取消待处理订单,接口仅接受 ids 数组入参(number[] 或 string[]),不再兼容 id/order_id/逗号字符串等兼容写法。",
"严格同仓校验:仓库上下文由当前登录用户的 store_id 决定,禁止传入 warehouse_id / warehouseId。",
"状态限制:仅允许 step ∈ [1,2] 且 outbound_status != 'padding' 的订单被取消;已取消或已完成的订单不可取消,状态不满足时返回 404/400。",
"取消后语义:接口将把订单表的 status 字段设为 'cancel' 并更新 updated_at;返回首个被取消的订单 id、status、updated_at、updated_count 与 ids 列表。",
"入参/响应契约已按代码侧约定(ids-only、同仓校验、允许状态集合、取消后语义)同步到 methods/system.json。"
],
"type": "added",
"module": "order"
},
{
"version": "2026.04.13-system-02",
"date": "2026-04-13",
"summary": "新增订单工作台角标聚合接口 order.badgeCount",
"methods": [
"order.badgeCount"
],
"notes": [
"聚合返回 8 个订单工作台标签的展示值(用于前端 badge)。",
"按当前登录用户的 store_id 维度做短缓存;5 个模块查表统计数量,≥100 返回 '99+',否则返回实际数字(0..99)。",
"deliveryOrder、deliveryExpectionOrder、archiveOrder 三个字段固定返回 '99+'(不查表)。"
],
"type": "added",
"module": "order"
}
]

4878
src/apijsonconfig.txt Normal file

File diff suppressed because it is too large Load Diff

14466
src/apiweb.html Normal file

File diff suppressed because it is too large Load Diff

View File

@ -55,6 +55,7 @@ export default {
"printTemplate": "Print Template",
'Permission': 'Permission',
'Role':'Role',
'Validity period':'Validity period',
// 'StoreIndex':'Store',
},
"login": {

View File

@ -55,6 +55,7 @@ export default {
"printTemplate": "打印模板",
'Permission': '权限管理',
'Role':'角色管理',
'Validity period':'效期预警',
// 'StoreIndex':'货主',
},

View File

@ -21,4 +21,5 @@ export const componentMap: Record<string, any> = {
// 'system/setting/printStation/index': () => import('@/views/system/setting/printStation/index.vue'),
'system/print/station': () => import('@/views/system/setting/printStation/index.vue'),
'storage/log': () => import('@/views/storage/log/index.vue'),
'storage/validityperiod':import('@/views/storage/validityperiod/index.vue'),
};

View File

@ -1,23 +1,59 @@
接口文档更新:
[
{
"version": "2026.04.10-system-01",
"date": "2026-04-10",
"summary": "订单审核字段由 audit_status 替换为整数字段 step,并添加数据库迁移",
"version": "2026.04.12-system-01",
"date": "2026-04-12",
"summary": "新增订单工作台各分组 list 接口文档,说明 where 透传与分页上限(pageSize\u003C=200)",
"methods": [
"order.getreviewOrderlist",
"order.reviewOrder.getreviewOrderlist",
"order.reviewOrder.reviewOrder",
"order.deliveryOrder.getdeliveryOrderlist",
"order.list",
"order.stats"
"order.reviewOrder.list",
"order.reviewOrder.reviewOrder",
"order.pendingOrder.list",
"order.expectionOrder.list",
"order.entrustOrder.list",
"order.deliveryOrder.list",
"order.deliveryExpectionOrder.list",
"order.archiveOrder.list"
],
"notes": [
"字段变更:order 相关审核字段从字符串/枚举 audit_status 替换为整数 step。",
"step 映射:0=未审核,1=已审核,2=处理中,3=驳回/异常,4=配送中,5=已完成,9=已关闭。",
"reviewOrder 接口在更新 inspection_status 的同时会写入 step 字段。",
"必须执行迁移脚本:20260410150000-replace-audit-status-with-step-on-order-delivery-tables.js"
"补充 order 工作台分组 list 接口,并说明所有 list 接口支持 pagination、where、sort;服务端对 pagination.pageSize 做上限截断(MAX=200)。",
"说明 where 参数会被 normalize 并交给解析器 parseWhereConditions,再与模块默认条件合并后用于底层查询;示例:reviewOrder 模块默认 step=0,pendingOrder 默认 step in [1,2],deliveryOrder 默认 dispatch_lane=m4 等。",
"补充待审核模块的审核提交接口 order.reviewOrder.reviewOrder,说明其用于更新订单审核状态/step,并保留 id、review_status、inspection_status、order_id 等兼容字段说明。",
"兼容入口(如 getreviewOrderlist / getdeliveryOrderlist 等)作为历史兼容保留,在文档中标为兼容说明,不作为主入口推荐。"
],
"type": "changed"
"type": "added",
"module": "order"
},
{
"version": "2026.04.13-system-01",
"date": "2026-04-13",
"summary": "新增待处理订单取消接口 order.pendingOrder.cancelOrder(ids-only)",
"methods": [
"order.pendingOrder.cancelOrder"
],
"notes": [
"新增接口 order.pendingOrder.cancelOrder:用于批量取消待处理订单,接口仅接受 ids 数组入参(number[] 或 string[]),不再兼容 id/order_id/逗号字符串等兼容写法。",
"严格同仓校验:仓库上下文由当前登录用户的 store_id 决定,禁止传入 warehouse_id / warehouseId。",
"状态限制:仅允许 step ∈ [1,2] 且 outbound_status != 'padding' 的订单被取消;已取消或已完成的订单不可取消,状态不满足时返回 404/400。",
"取消后语义:接口将把订单表的 status 字段设为 'cancel' 并更新 updated_at;返回首个被取消的订单 id、status、updated_at、updated_count 与 ids 列表。",
"入参/响应契约已按代码侧约定(ids-only、同仓校验、允许状态集合、取消后语义)同步到 methods/system.json。"
],
"type": "added",
"module": "order"
},
{
"version": "2026.04.13-system-02",
"date": "2026-04-13",
"summary": "新增订单工作台角标聚合接口 order.badgeCount",
"methods": [
"order.badgeCount"
],
"notes": [
"聚合返回 8 个订单工作台标签的展示值(用于前端 badge)。",
"按当前登录用户的 store_id 维度做短缓存;5 个模块查表统计数量,≥100 返回 '99+',否则返回实际数字(0..99)。",
"deliveryOrder、deliveryExpectionOrder、archiveOrder 三个字段固定返回 '99+'(不查表)。"
],
"type": "added",
"module": "order"
}
]

View File

@ -111,6 +111,7 @@ export const deliveryColumns = [
{ prop: 'mobile', label: '移动电话', width: '120' },
{ prop: 'province', label: '省', width: '100' },
{ prop: 'city', label: '市', width: '100' },
{ prop: 'dispatch_lane', label: '道口', width: '80' },
{ prop: 'status', label: '审核状态', width: '100' },
{ prop: 'sync_status', label: '同步状态', width: '100' },
{ prop: 'total_amount', label: '总金额', width: '100' },

View File

@ -234,10 +234,12 @@ async function loadData() {
quickSearch: quickSearch.value,
where: scanBox.value?.getCondition ? scanBox.value.getCondition() : {}
}
const res: any = await orderApi.orderList(params)
if (res && res.code === 200 && res.data) {
list.value = res.data.list || []
pagination.total = res.data.total || (res.data.list ? res.data.list.length : 0)
const res: any = await orderApi.orderDeliveryList(params)
// 根据接口文档1和返回示例,成功状态码 code 为 1,且数据在 res.data 中
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 {
list.value = []
pagination.total = 0

View File

@ -46,6 +46,7 @@ import DeliveryOrder from './deliveryOrder.vue'
import EntrustWarehouse from './entrustWarehouse.vue'
import DeliveryException from './deliveryException.vue'
import ArchiveOrder from './archiveOrder.vue'
import OrderWorkbench from './orderWorkbench.vue'
const route = useRoute()
const router = useRouter()
@ -58,6 +59,12 @@ const activeTab = ref('reviewOrder')
const forceRenderAll = ref(false) // 只有 activeTab 对应的组件会被渲染
const tabs = ref([
{
name: 'orderWorkbench',
label: '订单工作台',
count: 0,
component: OrderWorkbench
},
{
name: 'reviewOrder',
label: '待审核订单',
@ -72,13 +79,13 @@ const tabs = ref([
},
{
name: 'exceptionOrder',
label: '异常订单',
label: '待处理异常订单',
count: 3,
component: ExceptionOrder
},
{
name: 'entrustWarehouse',
label: '委托外仓',
label: '委托外仓订单',
count: 0,
component: EntrustWarehouse
},
@ -90,7 +97,7 @@ const tabs = ref([
},
{
name: 'deliveryException',
label: '配送异常',
label: '配送异常订单',
count: 0,
component: DeliveryException
},
@ -111,13 +118,13 @@ const initFromRoute = () => {
activeTab.value = tabFromUrl
} else {
// 如果没有tab参数或参数无效,设置默认值
activeTab.value = 'reviewOrder'
activeTab.value = 'orderWorkbench'
// 更新URL参数
if (!route.query.tab) {
router.replace({
query: {
...route.query,
tab: 'reviewOrder'
tab: 'orderWorkbench'
}
})
}
@ -132,12 +139,12 @@ watch(
if (newTab && validTabs.includes(newTab as string)) {
activeTab.value = newTab as string
} else {
activeTab.value = 'reviewOrder'
activeTab.value = 'orderWorkbench'
if (!newTab) {
router.replace({
query: {
...route.query,
tab: 'reviewOrder'
tab: 'orderWorkbench'
}
})
}

View File

@ -0,0 +1,159 @@
<template>
<div class="order-workbench">
<el-card class="box-card" shadow="never">
<template #header>
<div class="card-header">
<span>订单数据总览</span>
<el-button type="primary" @click="fetchAllData" :loading="loading">刷新数据</el-button>
</div>
</template>
<div class="table-sections">
<!-- 待审核订单 -->
<section class="table-section">
<h3>待审核订单 (order.reviewOrder.list)</h3>
<el-table :data="reviewOrders" border stripe style="width: 100%">
<el-table-column prop="delivery_order_code" label="订单号" />
<el-table-column prop="source_platform_name" label="平台" />
<el-table-column prop="status" label="状态" />
<el-table-column prop="is_mock" label="数据来源">
<template #default="scope">
<el-tag :type="scope.row.is_mock ? 'warning' : 'success'">
{{ scope.row.is_mock ? '模拟数据' : '服务端数据' }}
</el-tag>
</template>
</el-table-column>
</el-table>
</section>
<!-- 待处理订单 -->
<section class="table-section">
<h3>待处理订单 (order.pendingOrder.list)</h3>
<el-table :data="pendingOrders" border stripe style="width: 100%">
<el-table-column prop="delivery_order_code" label="订单号" />
<el-table-column prop="source_platform_name" label="平台" />
<el-table-column prop="status" label="状态" />
<el-table-column prop="is_mock" label="数据来源">
<template #default="scope">
<el-tag :type="scope.row.is_mock ? 'warning' : 'success'">
{{ scope.row.is_mock ? '模拟数据' : '服务端数据' }}
</el-tag>
</template>
</el-table-column>
</el-table>
</section>
<!-- 配送订单 -->
<section class="table-section">
<h3>配送订单 (order.deliveryOrder.list)</h3>
<el-table :data="deliveryOrders" border stripe style="width: 100%">
<el-table-column prop="delivery_order_code" label="订单号" />
<el-table-column prop="source_platform_name" label="平台" />
<el-table-column prop="dispatch_lane" label="道口" />
<el-table-column prop="is_mock" label="数据来源">
<template #default="scope">
<el-tag :type="scope.row.is_mock ? 'warning' : 'success'">
{{ scope.row.is_mock ? '模拟数据' : '服务端数据' }}
</el-tag>
</template>
</el-table-column>
</el-table>
</section>
</div>
</el-card>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import {
orderReviewList,
orderPendingList,
orderDeliveryList
} from '@/api/order/order'
const loading = ref(false)
const reviewOrders = ref<any[]>([])
const pendingOrders = ref<any[]>([])
const deliveryOrders = ref<any[]>([])
// 模拟数据生成器
const createMockData = (type: string) => [
{
id: 'mock_' + (Math.random() * 1000).toFixed(0),
delivery_order_code: `MOCK_${type}_${Date.now()}`,
source_platform_name: '虚拟平台',
status: 'pending',
dispatch_lane: type === 'DELIVERY' ? 'm4' : '-',
is_mock: true
}
]
const fetchAllData = async () => {
loading.value = true
const commonParams = { pagination: { page: 1, pageSize: 20 } }
try {
// 1. 获取待审核订单
const resReview = await orderReviewList(commonParams).catch(() => ({ data: { list: [] } }))
if (resReview.data?.list?.length) {
reviewOrders.value = resReview.data.list
} else {
reviewOrders.value = createMockData('REVIEW')
}
// 2. 获取待处理订单
const resPending = await orderPendingList(commonParams).catch(() => ({ data: { list: [] } }))
if (resPending.data?.list?.length) {
pendingOrders.value = resPending.data.list
} else {
pendingOrders.value = createMockData('PENDING')
}
// 3. 获取配送订单
const resDelivery = await orderDeliveryList(commonParams).catch(() => ({ data: { list: [] } }))
if (resDelivery.data?.list?.length) {
deliveryOrders.value = resDelivery.data.list
} else {
deliveryOrders.value = createMockData('DELIVERY')
}
} catch (error) {
console.error('Fetch error:', error)
} finally {
loading.value = false
}
}
onMounted(() => {
fetchAllData()
})
</script>
<style lang="scss" scoped>
.order-workbench {
padding: 20px;
height: 100%;
overflow-y: auto;
.table-sections {
display: flex;
flex-direction: column;
gap: 30px;
}
.table-section {
h3 {
margin-bottom: 15px;
padding-left: 10px;
border-left: 4px solid #409eff;
font-size: 16px;
}
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
}
</style>

View File

@ -137,6 +137,68 @@
<el-checkbox label="is_batch_mgmt">批次管理</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-card v-if="hasManagementFlag('is_shelf_life_mgmt')" class="info-card" shadow="never" style="margin-top: 20px;">
<template #header>
<div class="card-header">
<span>保质期管理</span>
<el-tooltip content="开启后按保质期规则进行入库、出库和预警控制" placement="top">
<el-icon><QuestionFilled /></el-icon>
</el-tooltip>
</div>
</template>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="保质期天数" prop="shelf_life_days">
<el-input-number
v-model="formData.shelf_life_days"
:min="0"
:precision="0"
:controls="false"
style="width: 100%"
placeholder="请输入保质期天数"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入库最小天数" prop="inbound_min_days">
<el-input-number
v-model="formData.inbound_min_days"
:min="0"
:precision="0"
:controls="false"
style="width: 100%"
placeholder="请输入入库最小天数要求"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出库最小天数" prop="outbound_min_days">
<el-input-number
v-model="formData.outbound_min_days"
:min="0"
:precision="0"
:controls="false"
style="width: 100%"
placeholder="请输入出库最小天数"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="剩余有效期" prop="remaining_threshold_days">
<el-input-number
v-model="formData.remaining_threshold_days"
:min="0"
:precision="0"
:controls="false"
style="width: 100%"
placeholder="请输入剩余有效期阈值天数"
/>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-col>
<!-- 第二列:尺寸信息和箱规信息 -->
@ -479,13 +541,25 @@ const emit = defineEmits(['refresh'])
const formRef = ref<FormInstance>()
const loading = ref(false)
type StockInfoFormData = typeof stockDefaultFormData & {
id?: number
shelf_life_days: number
inbound_min_days: number
outbound_min_days: number
remaining_threshold_days: number
}
// 基础表单数据
const baseFormData = {
const baseFormData: StockInfoFormData = {
...stockDefaultFormData,
shelf_life_days: (stockDefaultFormData as any).shelf_life_days ?? 0,
inbound_min_days: stockDefaultFormData.inbound_min_days ?? 0,
outbound_min_days: stockDefaultFormData.outbound_min_days ?? 0,
remaining_threshold_days: stockDefaultFormData.remaining_threshold_days ?? 0,
id: undefined as number | undefined
}
const formData = reactive({ ...baseFormData })
const formData = reactive<StockInfoFormData>({ ...baseFormData })
const originalData = ref<any>({})
// 列表数据
@ -576,6 +650,46 @@ const formRules = reactive<FormRules>({
callback()
}
}
}],
inbound_min_days: [{
trigger: 'blur',
validator: (rule: any, value: number, callback: any) => {
if (formData.is_shelf_life_mgmt === 'Y' && (!value || value <= 0)) {
callback(new Error('入库最小天数要求不能为空,且必须大于0'))
} else {
callback()
}
}
}],
outbound_min_days: [{
trigger: 'blur',
validator: (rule: any, value: number, callback: any) => {
if (formData.is_shelf_life_mgmt === 'Y' && (!value || value <= 0)) {
callback(new Error('出库最小天数要求不能为空,且必须大于0'))
} else {
callback()
}
}
}],
remaining_threshold_days: [{
trigger: 'blur',
validator: (rule: any, value: number, callback: any) => {
if (formData.is_shelf_life_mgmt === 'Y' && (!value || value <= 0)) {
callback(new Error('剩余有效期阈值天数不能为空,且必须大于0'))
} else {
callback()
}
}
}],
shelf_life_days: [{
trigger: 'blur',
validator: (rule: any, value: number, callback: any) => {
if (formData.is_shelf_life_mgmt === 'Y' && (!value || value <= 0)) {
callback(new Error('保质期天数不能为空,且必须大于0'))
} else {
callback()
}
}
}]
})
@ -610,6 +724,14 @@ watch(() => formData.managementFlags, (newFlags) => {
watch(() => formData.is_sn_mgmt, updateManagementFlags)
watch(() => formData.is_shelf_life_mgmt, updateManagementFlags)
watch(() => formData.is_batch_mgmt, updateManagementFlags)
watch(() => formData.is_shelf_life_mgmt, (value) => {
if (value !== 'Y') {
formData.shelf_life_days = 0
formData.inbound_min_days = 0
formData.outbound_min_days = 0
formData.remaining_threshold_days = 0
}
})
// 初始化
onMounted(() => {
@ -646,6 +768,10 @@ function updateManagementFlags() {
formData.managementFlags = flags
}
function hasManagementFlag(flag: string) {
return formData.managementFlags.includes(flag)
}
function handleBoxSpecToggle(value: boolean | string | number) {
if (value) {
if (!formData.box_unit) {
@ -709,11 +835,39 @@ function prepareSaveData() {
return data
}
function validateShelfLifeForSave() {
if (formData.is_shelf_life_mgmt !== 'Y') {
return true
}
const requiredFields = [
{ key: 'shelf_life_days', label: '保质期天数' },
{ key: 'inbound_min_days', label: '入库最小天数' },
{ key: 'outbound_min_days', label: '出库最小天数' },
{ key: 'remaining_threshold_days', label: '剩余有效期' }
] as const
const missingField = requiredFields.find((field) => {
const value = formData[field.key]
return !value || value <= 0
})
if (missingField) {
ElMessage.warning(`开启保质期管理后,${missingField.label}为必填且必须大于0`)
return false
}
return true
}
async function handleSave() {
if (!formRef.value) return
try {
await formRef.value.validate()
if (!validateShelfLifeForSave()) {
return
}
loading.value = true
const saveData = prepareSaveData()
const response: any = await stockApi.saveWarehouseStock(saveData)

View File

@ -147,6 +147,13 @@ export const stockColumns = [
slotName: 'is_shelf_life_mgmt',
formatter: (row: any) => row.is_shelf_life_mgmt === 'Y' ? '是' : '否'
},
{
prop: 'shelf_life_days',
label: '保质期天数',
width: '110',
align: 'right',
formatter: (row: any) => row.shelf_life_days ? `${formatNumber(row.shelf_life_days, 0)}天` : '--'
},
{
prop: 'is_batch_mgmt',
label: '批次',
@ -441,7 +448,11 @@ export const stockDefaultFormData = {
retail_price: 0.00,
is_sn_mgmt: 'N',
is_shelf_life_mgmt: 'N',
shelf_life_days: 0,
is_batch_mgmt: 'N',
inbound_min_days: 0,
outbound_min_days: 0,
remaining_threshold_days: 0,
prohibited_id: undefined as number | undefined,
brand_name: '',
managementFlags: [] as string[],

View File

@ -3,103 +3,68 @@
<div class="main-content">
<el-table :data="detailList" border stripe size="small" v-loading="loading">
<el-table-column
v-for="col in productstockDetail"
v-for="col in detailColumns"
:key="col.prop"
:prop="col.prop"
:label="col.label"
:width="col.width"
show-overflow-tooltip
>
<template #default="{ row }" v-if="col.prop === 'inventory_status'">
<el-tag :type="row[col.prop] === '正常' ? 'success' : 'warning'" size="small">
{{ row[col.prop] }}
</el-tag>
</template>
</el-table-column>
/>
</el-table>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, watch } from 'vue'
import { productstockDetail } from '../entry-config'
import { computed, ref, watch } from 'vue'
const props = defineProps<{
id: string | number,
id: string | number
row?: any
groupByBatch?: boolean
}>()
const loading = ref(false)
const detailList = ref<any[]>([])
// 模拟明细数据
const getMockDetails = (id: string | number) => {
const detailColumns = computed(() => {
if (props.groupByBatch) {
return [
{ prop: 'stock_id', label: '商品ID', width: '100' },
{ prop: 'item_code', label: '商品编码', width: '140' },
{ prop: 'item_name', label: '商品名称', width: '200' },
{ prop: 'batch_no', label: '批次号', width: '140' },
{ prop: 'production_date', label: '生产日期', width: '140' },
{ prop: 'expiry_date', label: '到期日期', width: '140' },
{ prop: 'space_code', label: '库位', width: '140' },
{ prop: 'inventory_type', label: '库存类型', width: '100' },
{ prop: 'quantity', label: '总数量', width: '100' },
{ prop: 'available_quantity', label: '可用数量', width: '100' },
{ prop: 'locked_quantity', label: '锁定数量', width: '100' }
]
}
return [
{
id: 101379,
sku_code: 'OUSI9002',
barcode: '6955416420550',
product_name: 'OUSI欧似香水9002(炙爱之水)',
spec_name: '默认规格',
unit: '个',
actual_qty: 100,
available_qty: 318,
batch_no: 'BAT20260111',
warehouse_name: '天豹2',
area_name: 'ZC',
location_name: 'A-01-01',
inventory_status: '正常'
},
{
id: 101384,
sku_code: 'TEST001',
barcode: '011000000228',
product_name: '测试商品',
spec_name: '默认规格3',
unit: '个',
actual_qty: 50,
available_qty: 1500,
batch_no: 'BAT20260120',
warehouse_name: '天豹2',
area_name: 'ZC',
location_name: 'B-02-05',
inventory_status: '正常'
},
{
id: 101409,
sku_code: 'BAG-BLU',
barcode: '6900000000333',
product_name: '蓝色包',
spec_name: '默认规格',
unit: '个',
actual_qty: 20,
available_qty: 173,
batch_no: 'BAT20260212',
warehouse_name: '天豹2',
area_name: 'ZC',
location_name: 'C-01-02',
inventory_status: '正常'
}
{ prop: 'stock_id', label: '商品ID', width: '100' },
{ prop: 'item_code', label: '商品编码', width: '140' },
{ prop: 'item_name', label: '商品名称', width: '200' },
{ prop: 'space_code', label: '库位', width: '140' },
{ prop: 'inventory_type', label: '库存类型', width: '100' },
{ prop: 'quantity', label: '总数量', width: '100' },
{ prop: 'available_quantity', label: '可用数量', width: '100' },
{ prop: 'locked_quantity', label: '锁定数量', width: '100' },
{ prop: 'batch_count', label: '批次数', width: '100' }
]
}
})
const loadData = () => {
loading.value = true
// 模拟接口延迟
setTimeout(() => {
detailList.value = getMockDetails(props.id)
detailList.value = props.row ? [props.row] : []
loading.value = false
}, 300)
}, 120)
}
watch(() => props.id, () => {
loadData()
}, { immediate: true })
onMounted(() => {
loadData()
})
watch(() => [props.id, props.row, props.groupByBatch], loadData, { immediate: true })
</script>
<style scoped lang="scss">

View File

@ -20,12 +20,17 @@
<el-button size="small" :disabled="!hasSelection" @click="confirmBatchCancel">批量作废</el-button>
<el-button size="small" :loading="exportLoading" @click="handleExport">导出</el-button>
<el-button size="small" @click="handleImport">导入</el-button>
<!-- <el-button>是否按批次显示</el-button> -->
</div>
<!-- <div class="toolbar-right">
<el-input size="small" placeholder="搜索入库单号" v-model="quickSearch" style="width:220px" @keyup.enter.native="onQuickSearch" />
</div> -->
<div class="toolbar-right">
<span class="toolbar-label">按批次查询</span>
<el-select v-model="groupByBatch" size="small" style="width:120px" @change="handleGroupByBatchChange">
<el-option label="否" :value="false" />
<el-option label="是" :value="true" />
</el-select>
</div>
</div>
<div class="upper-wrapper">
@ -47,6 +52,12 @@
@refresh="loadData"
@selection-change="onSelectionChange"
>
<template #column-expiry_date="{ row }">
<span :class="{ 'expiry-date-expired': row.is_shelf_life_warning_triggered }">
{{ row.expiry_date || '--' }}
</span>
</template>
<template #column-order_status="{ row }">
<el-tag v-if="row.order_status" size="small" :type="orderStatusTagType(row.order_status)">
{{ orderStatusLabel(row.order_status) }}
@ -68,8 +79,8 @@
<div class="lower-level" v-if="selectedEntryId" :class="tableSize">
<div class="detail-header">
<el-tabs v-model="activeTab" class="detail-tab">
<el-tab-pane label="入库明细" name="details" />
<el-tab-pane label="操作日志" name="logs" />
<el-tab-pane label="库存明细" name="details" />
<!-- <el-tab-pane label="操作日志" name="logs" /> -->
</el-tabs>
</div>
@ -78,7 +89,8 @@
<component
:is="activeComponent"
:id="selectedEntryId"
:row="selectedRow"
:row="selectedRow"
:group-by-batch="groupByBatch"
@refresh="loadData"
/>
</KeepAlive>
@ -106,7 +118,7 @@ import * as inventoryApi from '@/api/storage/inventory'
import {
availableFields,
productstockColums,
} from './entry-config'
} from './inventory-config'
import entrydetail from './component/panelstockdetail.vue'
import log from './component/log.vue'
@ -126,15 +138,17 @@ const queryTime = ref(0)
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
const tableSize = ref('small')
const columns = ref(productstockColums)
const groupByBatch = ref(false)
const columns = computed(() => {
if (groupByBatch.value) return productstockColums
return productstockColums.filter((col: any) => !['production_date', 'expiry_date'].includes(col.prop))
})
const selectionRows = ref<any[]>([])
const hasSelection = ref(false)
const selectedEntryId = ref<number | string | null>(null)
const quickSearch = ref('')
const componentMap: Record<string, any> = {
details: entrydetail,
logs: log
@ -159,12 +173,8 @@ async function loadData() {
try {
const params: any = {
pagination: { page: pagination.currentPage, pageSize: pagination.pageSize },
where: scanBox.value?.getConditions?.() || {}
}
// 适配库存模块的搜索字段
if (quickSearch.value) {
params.where = { ...(params.where || {}), stock_id: quickSearch.value }
where: scanBox.value?.getConditions?.() || {},
group_by_batch: groupByBatch.value
}
const res: any = await inventoryApi.getInventoryList(params)
@ -173,10 +183,15 @@ async function loadData() {
const rows = Array.isArray(data.list) ? data.list : []
list.value = rows.map((item: any) => ({
id: item.stock_id + '-' + item.space_id, // 复合 ID
id: groupByBatch.value
? `${item.stock_id}-${item.space_id}-${item.batch_no || item.id || ''}`
: `${item.stock_id}-${item.space_id}`, // 合并模式下按库位+商品唯一
stock_id: item.stock_id,
item_code: item.stock?.item_code || '',
item_name: item.stock?.item_name || '',
production_date: item.production_date || item.batch?.production_date || '',
expiry_date: item.expiry_date || item.batch?.expiry_date || '',
is_shelf_life_warning_triggered: Boolean(item.is_shelf_life_warning_triggered),
space_code: item.space?.space_code || item.space?.custom_name || '',
store_name: item.store?.company_name || item.store_id || '',
inventory_type: item.inventory_type,
@ -260,8 +275,9 @@ function handlePageSizeChange(size: number) {
loadData()
}
function onQuickSearch() {
function handleGroupByBatchChange() {
pagination.currentPage = 1
selectedEntryId.value = null
loadData()
}
@ -350,9 +366,19 @@ function orderStatusTagType(val: string): any {
.toolbar-right {
display: flex;
flex-direction: row;
gap: 15px;
gap: 8px;
height: 30px;
align-items: center;
.toolbar-label {
font-size: 12px;
color: #606266;
}
}
.expiry-date-expired {
color: #f56c6c;
font-weight: 600;
}
.upper-wrapper {

View File

@ -1,6 +1,6 @@
export const availableFields = [
{ label: '商品ID', value: 'stock_id', type: 'input' },
{ label: '库位名称', value: 'space_id', type: 'input' },
{ label: '商品ID', value: 'stock_id', type: 'text' },
{ label: '库位', value: 'space_id', type: 'text' },
{ label: '货主', value: 'store_id', type: 'select', options: [] },
{ label: '库存类型', value: 'inventory_type', type: 'select', options: [
{ label: '正品', value: 'ZP' },
@ -11,8 +11,8 @@ export const availableFields = [
{ label: '冻结', value: 'DJ' },
{ label: '分配', value: 'FP' }
]},
{ label: '批次号', value: 'batch_no', type: 'input' },
{ label: '入库单号', value: 'inbound_order_no', type: 'input' },
{ label: '批次号', value: 'batch_no', type: 'text' },
{ label: '入库单号', value: 'inbound_order_no', type: 'text' },
{ label: '创建日期', value: 'created_at', type: 'daterange' }
]
@ -20,6 +20,8 @@ export const productstockColums = [
{ prop: 'stock_id', label: '商品ID', width: '100' },
{ prop: 'item_code', label: '商品编码', width: '150' },
{ prop: 'item_name', label: '商品名称', width: '200' },
{ prop: 'production_date', label: '生产日期', width: '120' },
{ prop: 'expiry_date', label: '到期日期', width: '120' },
{ prop: 'space_code', label: '库位名称', width: '150' },
{ prop: 'store_name', label: '货主', width: '120' },
{ prop: 'inventory_type', label: '库存类型', width: '100' },

View File

@ -16,6 +16,11 @@
@click="openAddDrawer"
>添加商品</el-button>
<el-button size="small" type="primary" disabled>批量操作</el-button>
<el-select v-model="validityUnit" size="small" style="width: 120px;" placeholder="时间单位">
<el-option label="按年" value="year" />
<el-option label="按月" value="month" />
<el-option label="按日" value="day" />
</el-select>
<!-- <el-button size="small" disabled>导出</el-button> -->
</div>
<div class="right-actions">
@ -99,6 +104,29 @@
@click="openAddDrawer"
>添加商品</el-button> -->
</template>
<template #column-product_name="{ row }">
<span>
{{ row.product_name }}
<span v-if="isExpired(row.expiry_date)" style="color: #f56c6c;">(已过期)</span>
</span>
</template>
<template #column-production_date="{ row }">
<span class="clickable-date-cell" @click.stop="openDateDialog(row)">
{{ row.production_date || '--' }}
</span>
</template>
<template #column-expiry_date="{ row }">
<span class="clickable-date-cell" @click.stop="openDateDialog(row)">
{{ row.expiry_date || '--' }}
</span>
</template>
<template #column-validity_period="{ row }">
{{ formatValidity(row.production_date, row.expiry_date) }}
</template>
</UpperTable>
</div>
@ -168,6 +196,33 @@
<AddProduct ref="addCompRef" :initialStore="addDrawerStore" :storeDisabled="true" />
</el-drawer>
<el-dialog v-model="dateDialogVisible" title="日期修改" align-center width="420px" append-to-body>
<el-form :model="dateForm" label-width="90px">
<el-form-item label="生产日期">
<el-date-picker
v-model="dateForm.production_date"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择生产日期"
style="width: 100%;"
/>
</el-form-item>
<el-form-item label="到期日期">
<el-date-picker
v-model="dateForm.expiry_date"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择到期日期"
style="width: 100%;"
/>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="dateDialogVisible = false">取消</el-button>
<el-button type="primary" :loading="dateSaving" @click="submitDateChange">保存</el-button>
</template>
</el-dialog>
<!-- 右键菜单 -->
<div v-if="menuVisible" :style="{ top: menuTop + 'px', left: menuLeft + 'px' }" class="context-menu">
<div class="menu-item" @click="handleProductDetail">货品详情</div>
@ -226,7 +281,7 @@
<script setup lang="ts">
import { ref, onMounted, onUnmounted, computed, reactive, watch, nextTick } from 'vue'
import { productdetail, productquick, productsnapshop, windowtopbar, formatProductStorageStatus } from '../receiving-config'
import { ElMessage } from 'element-plus'
import { ElMessage, ElMessageBox } from 'element-plus'
import { FullScreen, Close, CopyDocument, Search } from '@element-plus/icons-vue'
import UpperTable from '@/components/UpperTable/index.vue'
import AddProduct from '@/views/stock/stock/component/add.vue'
@ -250,6 +305,7 @@ const tableData = ref<any[]>([])
const multipleSelection = ref<any[]>([])
const saveLoading = ref(false)
const matchFilter = ref('all')
const validityUnit = ref<'year' | 'month' | 'day'>('day')
const filteredTableData = computed(() => {
if (matchFilter.value === 'matched') {
@ -260,6 +316,54 @@ const filteredTableData = computed(() => {
return tableData.value
})
const DAY_MS = 24 * 60 * 60 * 1000
const getDate = (value?: string) => {
if (!value) return null
const d = new Date(value)
return isNaN(d.getTime()) ? null : d
}
const isExpired = (expiryDate?: string) => {
const expiry = getDate(expiryDate)
if (!expiry) return false
return expiry.getTime() < Date.now()
}
const calcDiffYears = (start: Date, end: Date) => {
let years = end.getFullYear() - start.getFullYear()
const monthDiff = end.getMonth() - start.getMonth()
const dayDiff = end.getDate() - start.getDate()
if (monthDiff < 0 || (monthDiff === 0 && dayDiff < 0)) {
years -= 1
}
return years
}
const calcDiffMonths = (start: Date, end: Date) => {
let months = (end.getFullYear() - start.getFullYear()) * 12 + (end.getMonth() - start.getMonth())
if (end.getDate() < start.getDate()) {
months -= 1
}
return months
}
const formatValidity = (productionDate?: string, expiryDate?: string) => {
const start = getDate(productionDate)
const end = getDate(expiryDate)
if (!start || !end) return '--'
const diffMs = end.getTime() - start.getTime()
if (diffMs < 0) return `0${validityUnit.value === 'day' ? '天' : validityUnit.value === 'month' ? '月' : '年'}`
if (validityUnit.value === 'year') {
return `${calcDiffYears(start, end)}年`
}
if (validityUnit.value === 'month') {
return `${calcDiffMonths(start, end)}月`
}
return `${Math.floor(diffMs / DAY_MS)}天`
}
// 分页相关
const pagination = reactive({
currentPage: 1,
@ -392,6 +496,13 @@ const multipleQuickSelection = ref<any[]>([])
const addDrawerVisible = ref(false)
const addDrawerStore = ref<any>(null)
const addCompRef = ref<any>(null)
const dateDialogVisible = ref(false)
const dateSaving = ref(false)
const editingDateRow = ref<any>(null)
const dateForm = reactive({
production_date: '',
expiry_date: ''
})
const windowStyle = computed(() => {
if (isFullscreen.value) return {}
@ -454,6 +565,63 @@ const openAddDrawer = () => {
}, 100)
}
const openDateDialog = (row: any) => {
editingDateRow.value = row
dateForm.production_date = row?.production_date || ''
dateForm.expiry_date = row?.expiry_date || ''
dateDialogVisible.value = true
if (row?.expiry_date && isExpired(row.expiry_date)) {
ElMessageBox.alert(
`商品名称:${row?.product_name || '--'}已过期,请移除拒绝收货。`,
'过期提醒',
{ type: 'warning' }
)
}
}
const submitDateChange = async () => {
if (!editingDateRow.value?.id) {
ElMessage.warning('缺少明细ID,无法保存')
return
}
if (!dateForm.production_date || !dateForm.expiry_date) {
ElMessage.warning('请选择生产日期和到期日期')
return
}
if (new Date(dateForm.expiry_date).getTime() < new Date(dateForm.production_date).getTime()) {
ElMessage.warning('到期日期不能早于生产日期')
return
}
dateSaving.value = true
try {
// 前端模拟修改:本地更新明细日期,不请求后端
await new Promise(resolve => setTimeout(resolve, 200))
const idx = tableData.value.findIndex((item: any) => item.id === editingDateRow.value.id)
if (idx !== -1) {
tableData.value[idx] = {
...tableData.value[idx],
production_date: dateForm.production_date,
expiry_date: dateForm.expiry_date
}
if (isExpired(dateForm.expiry_date)) {
ElMessageBox.alert(
`商品名称:${tableData.value[idx]?.product_name || '--'}已过期,请移除拒绝收货。`,
'过期提醒',
{ type: 'warning' }
)
}
}
ElMessage.success('日期修改成功')
dateDialogVisible.value = false
} catch (e) {
console.error('日期修改失败', e)
ElMessage.error('日期修改失败')
} finally {
dateSaving.value = false
}
}
const handleSelectionChange = (val: any[]) => {
multipleSelection.value = val
}
@ -969,6 +1137,15 @@ onUnmounted(() => {
justify-content: center;
}
.clickable-date-cell {
color: #409eff;
cursor: pointer;
}
.clickable-date-cell:hover {
text-decoration: underline;
}
/* 商品入库状态样式 */
:deep(.el-table) {
.storage-status-tag {

View File

@ -79,6 +79,15 @@ export function formatDateTime(dateStr: string): string {
}
}
function calculateValidityDays(productionDate?: string, expiryDate?: string): string {
if (!productionDate || !expiryDate) return '--'
const start = new Date(productionDate)
const end = new Date(expiryDate)
if (isNaN(start.getTime()) || isNaN(end.getTime())) return '--'
const diffDays = Math.floor((end.getTime() - start.getTime()) / (24 * 60 * 60 * 1000))
return `${diffDays}天`
}
export const receivingColumns = [
{ prop: 'receiving_number', label: '收货单号', width: '110', fixed: 'left' },
{
@ -314,11 +323,12 @@ export const productquick = [
{ prop: 'boxes_per_pallet', label: '箱规', width: '100', align: 'right' },
{ prop: 'batch_number', label: '批次号', width: '120' },
{ prop: 'production_date', label: '生产日期', width: '120' },
{ prop: 'expiry_date', label: '有效期', width: '120' },
{ prop: 'expiry_date', label: '到期日期', width: '120' },
{ prop: 'validity_period', label: '有效期', width: '120' },
{ prop: 'storage_status', label: '入库', width: '80', align: 'center' },
{ prop: 'space_id', label: '库位', width: '120' },
{ prop: 'remark', label: '备注', minWidth: '150' },
{ prop: 'actions', label: '操作', width: '100', align: 'center', fixed: 'right' },
{ prop: 'actions', label: '操作', width: '160', align: 'center', fixed: 'right' },
]

View File

@ -0,0 +1,104 @@
<template>
<div class="expiry-query">
<el-descriptions class="info-panel" :column="4" border size="small">
<el-descriptions-item label="商品编码">{{ currentRow.item_code || '--' }}</el-descriptions-item>
<el-descriptions-item label="商品名称">{{ currentRow.item_name || '--' }}</el-descriptions-item>
<el-descriptions-item label="库位">{{ currentRow.space_code || '--' }}</el-descriptions-item>
<el-descriptions-item label="库存类型">{{ currentRow.inventory_type || '--' }}</el-descriptions-item>
<el-descriptions-item label="阈值天数">{{ currentRow.threshold_days ?? '--' }}</el-descriptions-item>
<el-descriptions-item label="剩余天数">{{ currentRow.remaining_days ?? '--' }}</el-descriptions-item>
<el-descriptions-item label="状态">
<el-tag size="small" :type="currentRow.is_expired ? 'danger' : 'success'">
{{ currentRow.is_expired ? '已过期' : '有效' }}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="到期日期">{{ currentRow.expiry_date || '--' }}</el-descriptions-item>
</el-descriptions>
<el-table :data="tableData" border stripe size="small" v-loading="loading" height="calc(100% - 90px)">
<el-table-column prop="stock_id" label="商品ID" width="120" />
<el-table-column prop="item_name" label="商品名称" min-width="200" show-overflow-tooltip />
<el-table-column prop="batch_no" label="批次号" width="160" />
<el-table-column prop="production_date" label="生产日期" width="120" />
<el-table-column prop="expiry_date" label="有效期至" width="120">
<template #default="{ row }">
<span class="expiry-date-highlight">{{ row.expiry_date || '--' }}</span>
</template>
</el-table-column>
<el-table-column prop="remaining_days" label="剩余天数" width="100" />
<el-table-column prop="quantity" label="库存数量" width="100" />
<el-table-column label="状态" width="100">
<template #default="{ row }">
<el-tag size="small" :type="getStatusTagType(row.warning_status)">
{{ getStatusLabel(row.warning_status) }}
</el-tag>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script setup lang="ts">
import { computed, ref, watch } from 'vue'
const props = defineProps<{
id: string | number
row?: any
}>()
const loading = ref(false)
const tableData = ref<any[]>([])
const currentRow = computed(() => props.row || {})
function loadData() {
loading.value = true
setTimeout(() => {
const row = currentRow.value || {}
tableData.value = row && row.id
? [{
stock_id: row.stock_id,
item_name: row.item_name,
batch_no: row.batch_no,
production_date: row.production_date,
expiry_date: row.expiry_date,
remaining_days: row.remaining_days,
quantity: row.quantity,
warning_status: row.is_expired ? 'expired' : 'normal'
}]
: []
loading.value = false
}, 250)
}
function getStatusLabel(status: string) {
if (status === 'expired') return '已过期'
return '正常'
}
function getStatusTagType(status: string) {
if (status === 'expired') return 'danger'
return 'success'
}
watch(() => props.id, loadData, { immediate: true })
</script>
<style scoped lang="scss">
.expiry-query {
height: 100%;
display: flex;
flex-direction: column;
gap: 8px;
.info-panel {
background: #fff;
padding: 2px 0;
}
.expiry-date-highlight {
color: #e6a23c;
font-weight: 600;
}
}
</style>

View File

@ -0,0 +1,342 @@
<template>
<div class="validity-period-container">
<scan-box
ref="scanBox"
width="320px"
:tree-props="{ children: 'children', label: 'label' }"
:auto-submit="false"
:preset-tree="presetTree"
:available-fields="availableFieldsRef"
@condition-change="handleConditionChange"
@reset="handleConditionReset"
@condition-clear="handleConditionClear"
/>
<div class="main-content">
<div class="toolbar">
<div class="toolbar-left">
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
<el-button size="small" :loading="exportLoading" @click="handleExport">导出</el-button>
</div>
</div>
<div class="upper-wrapper">
<upper-table
ref="upperTable"
title="有效期商品列表"
:data="list"
:columns="columns"
:table-size="tableSize"
:pagination="pagination"
:show-index="true"
:show-actions="true"
:show-selection="false"
:loading="loading"
:queryTime="queryTime"
@current-change="handleRowClick"
@page-change="handlePageChange"
@page-size-change="handlePageSizeChange"
@refresh="loadData"
>
<template #column-expiry_date="{ row }">
<span class="expiry-date-highlight">{{ row.expiry_date || '--' }}</span>
</template>
<template #empty>
<div class="empty-tip">暂无有效期商品</div>
</template>
</upper-table>
</div>
<div class="lower-level" v-if="selectedEntryId" :class="tableSize">
<div class="detail-header">
<el-tabs v-model="activeTab" class="detail-tab">
<el-tab-pane label="有效期查询" name="expiry" />
</el-tabs>
</div>
<div class="detail-container">
<KeepAlive>
<component :is="activeComponent" :id="selectedEntryId" :row="selectedRow" />
</KeepAlive>
</div>
</div>
<div class="no-selection" v-else>
<div class="empty-tip">
<p>请从上方列表中选择一项查看有效期详情</p>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { computed, 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 * as indexApi from '@/api/index'
import * as validityApi from '@/api/storage/validityperiod'
import expiryQuery from './component/expiryQuery.vue'
import { availableFields } from '../inventory/inventory-config'
const scanBox = ref<any>(null)
const upperTable = ref<any>(null)
const presetTree = ref<any[]>([])
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(availableFields)))
const activeTab = ref('expiry')
const list = ref<any[]>([])
const loading = ref(false)
const exportLoading = ref(false)
const queryTime = ref(0)
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
const tableSize = ref('small')
const columns = ref([
{ prop: 'stock_id', label: '商品ID', width: '110' },
{ prop: 'item_code', label: '商品编码', width: '140' },
{ prop: 'item_name', label: '商品名称', minWidth: '180' },
{ prop: 'batch_no', label: '批次号', width: '160' },
{ prop: 'stock_unit', label: '单位', width: '80' },
{ prop: 'quantity', label: '库存数量', width: '100' },
{ prop: 'remaining_days', label: '剩余天数', width: '100' },
{ prop: 'threshold_days', label: '阈值天数', width: '100' },
{ prop: 'expiry_date', label: '到期日期', width: '170' },
{ prop: 'production_date', label: '生产日期', width: '170' },
{ prop: 'space_code', label: '库位', minWidth: '140' },
{ prop: 'is_expired_text', label: '过期状态', width: '100' }
])
const selectedEntryId = ref<number | string | null>(null)
const componentMap: Record<string, any> = {
expiry: expiryQuery
}
const activeComponent = computed(() => componentMap[activeTab.value] || componentMap.expiry)
const selectedRow = computed(() => list.value.find((i: any) => i.id === selectedEntryId.value) || null)
onMounted(() => {
loadData()
loadFilterData()
})
async function loadData() {
if (loading.value) return
loading.value = true
const start = Date.now()
try {
const params: any = {
pagination: { page: pagination.currentPage, pageSize: pagination.pageSize },
where: scanBox.value?.getConditions?.() || {}
}
const res: any = await validityApi.getExpiryList(params)
if (res && (res.code === 200 || res.code === 1 || res.flag === 'success')) {
const data = res.data || res
const rows = Array.isArray(data.list) ? data.list : []
list.value = rows.map((item: any) => ({
id: item.id || (item.stock_id + '-' + item.space_id + '-' + (item.batch_no || '')),
stock_id: item.stock_id,
item_code: item.stock?.item_code || '',
goods_code: item.stock?.goods_code || '',
item_name: item.stock?.item_name || '',
sku_property: item.stock?.sku_property || '',
stock_unit: item.stock?.stock_unit || '',
space_code: item.space?.space_code || item.space?.custom_name || '',
store_name: item.store?.company_name || item.store_id || '',
batch_no: item.batch_no,
inventory_type: item.inventory_type,
quantity: item.quantity,
available_quantity: item.available_quantity,
locked_quantity: item.locked_quantity,
production_date: item.production_date,
expiry_date: item.expiry_date,
inbound_time: item.inbound_time,
inbound_order_no: item.inbound_order_no,
threshold_days: item.threshold_days,
remaining_days: item.remaining_days,
is_expired: Boolean(item.is_expired),
is_expired_text: item.is_expired ? '已过期' : '有效'
}))
const pager = data.pagination || {}
pagination.total = pager.total || data.total || list.value.length
} else {
list.value = []
pagination.total = 0
}
} catch (e) {
console.error('获取有效期列表失败', e)
ElMessage.error('加载有效期列表失败')
list.value = []
pagination.total = 0
} finally {
loading.value = false
queryTime.value = Date.now() - start
}
}
async function loadFilterData() {
try {
const [storesRes, presetRes]: any = await Promise.all([
indexApi.loadStores({ type: 'entry' }),
indexApi.fastWhereTree('entry')
])
if (storesRes && storesRes.code === 200) {
const f = availableFieldsRef.find((i: any) => i.value === 'store_id')
if (f) f.options = storesRes.stores || []
}
if (presetRes && presetRes.code === 200) {
presetTree.value = presetRes.presetTree || []
}
} catch (e) {
console.error('加载筛选配置失败', e)
}
}
function handleConditionChange() {
pagination.currentPage = 1
loadData()
}
function handleConditionClear() {
pagination.currentPage = 1
loadData()
}
function handleConditionReset() {
pagination.currentPage = 1
if (scanBox.value?.reset) scanBox.value.reset()
loadData()
}
function handleRowClick(row: any) {
selectedEntryId.value = row?.id || null
}
function handlePageChange(page: number) {
pagination.currentPage = page
loadData()
}
function handlePageSizeChange(size: number) {
pagination.pageSize = size
pagination.currentPage = 1
loadData()
}
function handleExport() {
exportLoading.value = true
setTimeout(() => {
exportLoading.value = false
ElMessage.success('导出成功')
}, 1000)
}
</script>
<style scoped lang="scss">
.validity-period-container {
display: flex;
height: calc(100vh - 130px);
width: 100%;
background-color: #f0f2f5;
.main-content {
flex: 1;
display: flex;
flex-direction: column;
padding: 10px;
overflow: hidden;
.toolbar {
padding: 5px;
border-bottom: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #fff;
}
.upper-wrapper {
flex: 1;
min-height: 0;
overflow: hidden;
}
.upper-wrapper :deep(.upper-table-container) {
height: 100%;
display: flex;
flex-direction: column;
}
.upper-wrapper :deep(.upper-table-container) :deep(.table-container) {
height: auto !important;
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
}
.upper-wrapper :deep(.el-table__header-wrapper) {
position: sticky;
top: 0;
z-index: 3;
background: #fff;
}
.upper-wrapper :deep(.el-table__body-wrapper) {
overflow: auto;
min-height: 0;
}
.lower-level {
flex: 0 0 40%;
height: 40%;
display: flex;
flex-direction: column;
border-top: 1px solid #ebeef5;
overflow: hidden;
background-color: #fff;
.detail-header {
padding: 0 10px;
border-bottom: 1px solid #ebeef5;
background-color: #fafafa;
.detail-tab {
margin-bottom: -1px;
:deep(.el-tabs__header) { margin: 0; }
:deep(.el-tabs__item) {
height: 32px;
line-height: 32px;
font-size: 13px;
}
:deep(.el-tabs__nav-wrap::after) { height: 1px; }
}
}
.detail-container {
flex: 1;
overflow: auto;
padding: 10px;
}
}
.no-selection {
flex: 0 0 40%;
height: 40%;
display: flex;
align-items: center;
justify-content: center;
color: #909399;
background-color: #fff;
.empty-tip { text-align: center; font-size: 14px; }
}
}
.expiry-date-highlight {
color: #f56c6c;
font-weight: 600;
}
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,864 +0,0 @@
出库单模块
storage.stockout.list
非订单出库单能力(对应奇门 stockout.create):用于处理由奇门创建的非订单出库单;主出口为 storage.stockout.*,不再推荐通过 storage.delivery.* 命名使用。storage.delivery.* 仅保留兼容转发。
Params (3)
名称 类型 必填 说明
pagination object 否 分页参数,支持 page/pageSize
where object 否 统一 where 条件对象;推荐使用 { operator, value, type } 标准结构,历史简写会在 main 中自动标准化;常用字段包括 delivery_order_code、status、outbound_status、buyer_nick、mobile 与日期区间字段。
sort object 否 排序参数,支持 sortField/sortOrder,默认按 updated_at DESC、id DESC
Response (2)
名称 类型 必填 说明
list array 是 出库单列表
pagination object 是 分页信息(page、pageSize、total、totalPages、hasPrevious、hasNext)
接口返回数据:
{
"flag": "success",
"code": 200,
"message": "ok",
"data": {
"list": [
{
"id": 32,
"delivery_order_code": "CK26013001179",
"pre_delivery_order_code": "",
"pre_delivery_order_id": "",
"order_type": "JYCK",
"warehouse_code": "wdt02060120001",
"order_flag": "",
"source_platform_code": "OFFLINE",
"source_platform_name": "线下",
"create_at": "2026-01-20T13:02:59.000Z",
"delete_at": null,
"updated_at": "2026-03-25T13:36:02.000Z",
"place_order_time": "2026-01-20T13:02:59.000Z",
"pay_time": "2026-01-20T13:02:59.000Z",
"pay_no": "",
"service_code": null,
"operator_name": null,
"operate_time": "2026-03-25T13:36:02.000Z",
"delivery_time": null,
"shop_nick": "af69a68",
"seller_nick": null,
"buyer_nick": "肖宇玄",
"total_amount": "12990.00",
"item_amount": "0.00",
"discount_amount": "0.00",
"freight": "5.00",
"ar_amount": "0.00",
"got_amount": "12990.00",
"service_fee": null,
"logistics_code": "YTO",
"logistics_name": null,
"express_code": "",
"logistics_area_code": "",
"delivery_type": null,
"is_urgency": "N",
"invoice_flag": "N",
"status": "pedding",
"name": "肖宇玄",
"zip_code": "",
"tel": "18727038559",
"mobile": "18727038559",
"email": "",
"country_code": "",
"province": "北京",
"city": "北京市",
"area": "西城区",
"town": "",
"detail_address": "湖北省襄阳市宏泰越秀星汇城",
"id_type": null,
"id_number": null,
"oaid": null,
"sync_status": "padding",
"store_id": 1000016,
"warehouse_id": 100000,
"from_key": 21363512,
"items": "101874+100|101875+1@2",
"items_count": 2,
"items_total": 101,
"items_weight": "2.00",
"items_hash": "4dc8eceb86a6dfeb730321a6779bc360",
"items_crc": 1137,
"wave_id": 0,
"post_status": "none",
"storage_status": "none",
"pick_status": "none",
"pack_status": "none",
"inspection_status": "none",
"print_status": null,
"claim_status": "none",
"outbound_status": "none",
"lock_status": null,
"intercept_status": null
},
{
"id": 31,
"delivery_order_code": "CK26012800003",
"pre_delivery_order_code": "",
"pre_delivery_order_id": "",
"order_type": "JYCK",
"warehouse_code": "wdt02060120001",
"order_flag": "",
"source_platform_code": "OFFLINE",
"source_platform_name": "线下",
"create_at": "2026-01-20T13:02:59.000Z",
"delete_at": null,
"updated_at": "2026-01-28T02:33:35.000Z",
"place_order_time": "2026-01-20T13:02:59.000Z",
"pay_time": "2026-01-20T13:02:59.000Z",
"pay_no": "",
"service_code": null,
"operator_name": null,
"operate_time": "2026-01-28T02:33:35.000Z",
"delivery_time": null,
"shop_nick": "af69a68",
"seller_nick": null,
"buyer_nick": "肖宇玄",
"total_amount": "12990.00",
"item_amount": "0.00",
"discount_amount": "0.00",
"freight": "5.00",
"ar_amount": "0.00",
"got_amount": "12990.00",
"service_fee": null,
"logistics_code": "YTO",
"logistics_name": null,
"express_code": "",
"logistics_area_code": "",
"delivery_type": null,
"is_urgency": "N",
"invoice_flag": "N",
"status": "pedding",
"name": "肖宇玄",
"zip_code": "",
"tel": "18727038559",
"mobile": "18727038559",
"email": "",
"country_code": "",
"province": "北京",
"city": "北京市",
"area": "西城区",
"town": "",
"detail_address": "湖北省襄阳市宏泰越秀星汇城",
"id_type": null,
"id_number": null,
"oaid": null,
"sync_status": "padding",
"store_id": 1000016,
"warehouse_id": 100000,
"from_key": 21363512,
"items": "101874+100|101875+1@2",
"items_count": 2,
"items_total": 101,
"items_weight": "2.00",
"items_hash": "4dc8eceb86a6dfeb730321a6779bc360",
"items_crc": 1137,
"wave_id": 0,
"post_status": "none",
"storage_status": "none",
"pick_status": "none",
"pack_status": "none",
"inspection_status": "none",
"print_status": null,
"claim_status": "none",
"outbound_status": "none",
"lock_status": null,
"intercept_status": null
},
{
"id": 30,
"delivery_order_code": "CK26012000895",
"pre_delivery_order_code": "",
"pre_delivery_order_id": "",
"order_type": "JYCK",
"warehouse_code": "wdt02060120001",
"order_flag": "",
"source_platform_code": "OFFLINE",
"source_platform_name": "线下",
"create_at": "2026-01-20T13:00:40.000Z",
"delete_at": null,
"updated_at": "2026-01-20T13:11:37.000Z",
"place_order_time": "2026-01-20T13:00:41.000Z",
"pay_time": "2026-01-20T13:00:41.000Z",
"pay_no": "",
"service_code": null,
"operator_name": null,
"operate_time": "2026-01-20T13:11:37.000Z",
"delivery_time": null,
"shop_nick": "af69a68",
"seller_nick": null,
"buyer_nick": "测试",
"total_amount": "6495.00",
"item_amount": "0.00",
"discount_amount": "0.00",
"freight": "5.00",
"ar_amount": "0.00",
"got_amount": "6495.00",
"service_fee": null,
"logistics_code": "YTO",
"logistics_name": null,
"express_code": "",
"logistics_area_code": "",
"delivery_type": null,
"is_urgency": "N",
"invoice_flag": "N",
"status": "pedding",
"name": "测试",
"zip_code": "",
"tel": "11111111111",
"mobile": "11111111111",
"email": "",
"country_code": "",
"province": "北京",
"city": "北京市",
"area": "东城区",
"town": "",
"detail_address": "测试",
"id_type": null,
"id_number": null,
"oaid": null,
"sync_status": "padding",
"store_id": 1000016,
"warehouse_id": 100000,
"from_key": 21363512,
"items": "101874+50|101875+1@2",
"items_count": 2,
"items_total": 51,
"items_weight": "2.00",
"items_hash": "e87473418ea8a893825a3b13c2663c10",
"items_crc": 1093,
"wave_id": 0,
"post_status": "none",
"storage_status": "none",
"pick_status": "none",
"pack_status": "none",
"inspection_status": "none",
"print_status": null,
"claim_status": "none",
"outbound_status": "none",
"lock_status": null,
"intercept_status": null
},
{
"id": 29,
"delivery_order_code": "CK26012000894",
"pre_delivery_order_code": "",
"pre_delivery_order_id": "",
"order_type": "JYCK",
"warehouse_code": "wdt02060120001",
"order_flag": "",
"source_platform_code": "OFFLINE",
"source_platform_name": "线下",
"create_at": "2026-01-20T13:02:59.000Z",
"delete_at": null,
"updated_at": "2026-01-20T13:11:33.000Z",
"place_order_time": "2026-01-20T13:02:59.000Z",
"pay_time": "2026-01-20T13:02:59.000Z",
"pay_no": "",
"service_code": null,
"operator_name": null,
"operate_time": "2026-01-20T13:11:33.000Z",
"delivery_time": null,
"shop_nick": "af69a68",
"seller_nick": null,
"buyer_nick": "肖宇玄",
"total_amount": "12990.00",
"item_amount": "0.00",
"discount_amount": "0.00",
"freight": "5.00",
"ar_amount": "0.00",
"got_amount": "12990.00",
"service_fee": null,
"logistics_code": "YTO",
"logistics_name": null,
"express_code": "",
"logistics_area_code": "",
"delivery_type": null,
"is_urgency": "N",
"invoice_flag": "N",
"status": "pedding",
"name": "肖宇玄",
"zip_code": "",
"tel": "18727038559",
"mobile": "18727038559",
"email": "",
"country_code": "",
"province": "北京",
"city": "北京市",
"area": "西城区",
"town": "",
"detail_address": "湖北省襄阳市宏泰越秀星汇城",
"id_type": null,
"id_number": null,
"oaid": null,
"sync_status": "padding",
"store_id": 1000016,
"warehouse_id": 100000,
"from_key": 21363512,
"items": "101874+100|101875+1@2",
"items_count": 2,
"items_total": 101,
"items_weight": "2.00",
"items_hash": "4dc8eceb86a6dfeb730321a6779bc360",
"items_crc": 1137,
"wave_id": 0,
"post_status": "none",
"storage_status": "none",
"pick_status": "none",
"pack_status": "none",
"inspection_status": "none",
"print_status": null,
"claim_status": "none",
"outbound_status": "none",
"lock_status": null,
"intercept_status": null
},
{
"id": 22,
"delivery_order_code": "935520",
"pre_delivery_order_code": "",
"pre_delivery_order_id": "",
"order_type": "JYCK",
"warehouse_code": "100000",
"order_flag": "",
"source_platform_code": "OFFLINE",
"source_platform_name": "线下",
"create_at": "2026-01-13T15:27:36.000Z",
"delete_at": null,
"updated_at": "2026-01-13T15:27:38.000Z",
"place_order_time": "2026-01-13T14:49:50.000Z",
"pay_time": "2026-01-13T14:51:36.000Z",
"pay_no": "S20260113225136223",
"service_code": null,
"operator_name": null,
"operate_time": "2026-01-13T15:27:36.000Z",
"delivery_time": null,
"shop_nick": "{线下}",
"seller_nick": null,
"buyer_nick": "刘付明仁",
"total_amount": "0.00",
"item_amount": "0.00",
"discount_amount": "0.00",
"freight": "0.00",
"ar_amount": "0.00",
"got_amount": "0.00",
"service_fee": null,
"logistics_code": "SFKY",
"logistics_name": "顺丰速运_空运",
"express_code": "",
"logistics_area_code": "",
"delivery_type": null,
"is_urgency": "N",
"invoice_flag": "N",
"status": "pedding",
"name": "刘付明仁",
"zip_code": "",
"tel": "",
"mobile": "18022440198",
"email": "",
"country_code": "",
"province": "广东省",
"city": "广州市",
"area": "白云区",
"town": "",
"detail_address": "钟落潭良沙二路32号",
"id_type": null,
"id_number": null,
"oaid": null,
"sync_status": "padding",
"store_id": 1000000,
"warehouse_id": 100000,
"from_key": 23060081,
"items": "101391+5",
"items_count": 1,
"items_total": 5,
"items_weight": "0.00",
"items_hash": "26939f46b9fb7d216a485c89b6bda980",
"items_crc": 399,
"wave_id": 0,
"post_status": "none",
"storage_status": "none",
"pick_status": "none",
"pack_status": "none",
"inspection_status": "none",
"print_status": null,
"claim_status": "none",
"outbound_status": "none",
"lock_status": null,
"intercept_status": null
},
{
"id": 21,
"delivery_order_code": "JY2026011327233",
"pre_delivery_order_code": "",
"pre_delivery_order_id": "",
"order_type": "JYCK",
"warehouse_code": "100000",
"order_flag": "",
"source_platform_code": "PDD",
"source_platform_name": "拼多多",
"create_at": "2026-01-13T15:26:07.000Z",
"delete_at": null,
"updated_at": "2026-01-13T15:26:07.000Z",
"place_order_time": "2026-01-13T15:22:03.000Z",
"pay_time": "2026-01-13T15:22:03.000Z",
"pay_no": "",
"service_code": null,
"operator_name": "1",
"operate_time": "2026-01-13T15:26:07.000Z",
"delivery_time": null,
"shop_nick": "火火家de小店",
"seller_nick": "1",
"buyer_nick": "刘付明仁18022440198",
"total_amount": "10.00",
"item_amount": "10.00",
"discount_amount": "0.00",
"freight": "0.00",
"ar_amount": "0.00",
"got_amount": "0.00",
"service_fee": null,
"logistics_code": "SFKY",
"logistics_name": "顺丰空运",
"express_code": "",
"logistics_area_code": "",
"delivery_type": null,
"is_urgency": "N",
"invoice_flag": "N",
"status": "pedding",
"name": "刘付明仁",
"zip_code": "",
"tel": "",
"mobile": "18022440198",
"email": "",
"country_code": "CN",
"province": "广东省",
"city": "广州市",
"area": "白云区",
"town": "太和镇",
"detail_address": "广东省 广州市 白云区 太和镇 二路32号",
"id_type": null,
"id_number": null,
"oaid": null,
"sync_status": "padding",
"store_id": 1000000,
"warehouse_id": 100000,
"from_key": 24869601,
"items": "101384+10",
"items_count": 1,
"items_total": 10,
"items_weight": "0.00",
"items_hash": "0043ebfd4f730160a5e9db969f1b856c",
"items_crc": 445,
"wave_id": 0,
"post_status": "none",
"storage_status": "none",
"pick_status": "none",
"pack_status": "none",
"inspection_status": "none",
"print_status": null,
"claim_status": "none",
"outbound_status": "none",
"lock_status": null,
"intercept_status": null
},
{
"id": 20,
"delivery_order_code": "935502",
"pre_delivery_order_code": "",
"pre_delivery_order_id": "",
"order_type": "JYCK",
"warehouse_code": "100000",
"order_flag": "",
"source_platform_code": "OFFLINE",
"source_platform_name": "线下",
"create_at": "2026-01-13T15:09:37.000Z",
"delete_at": null,
"updated_at": "2026-01-13T15:09:40.000Z",
"place_order_time": "2026-01-13T14:49:50.000Z",
"pay_time": "2026-01-13T14:51:36.000Z",
"pay_no": "S20260113225136223",
"service_code": null,
"operator_name": null,
"operate_time": "2026-01-13T15:09:37.000Z",
"delivery_time": null,
"shop_nick": "{线下}",
"seller_nick": null,
"buyer_nick": "刘付明仁",
"total_amount": "0.00",
"item_amount": "0.00",
"discount_amount": "0.00",
"freight": "0.00",
"ar_amount": "0.00",
"got_amount": "0.00",
"service_fee": null,
"logistics_code": "SF",
"logistics_name": "顺丰",
"express_code": "",
"logistics_area_code": "",
"delivery_type": null,
"is_urgency": "N",
"invoice_flag": "N",
"status": "pedding",
"name": "刘付明仁",
"zip_code": "",
"tel": "",
"mobile": "18022440198",
"email": "",
"country_code": "",
"province": "广东省",
"city": "广州市",
"area": "白云区",
"town": "",
"detail_address": "钟落潭良沙二路32号",
"id_type": null,
"id_number": null,
"oaid": null,
"sync_status": "padding",
"store_id": 1000000,
"warehouse_id": 100000,
"from_key": 23060081,
"items": "101391+5",
"items_count": 1,
"items_total": 5,
"items_weight": "0.00",
"items_hash": "26939f46b9fb7d216a485c89b6bda980",
"items_crc": 399,
"wave_id": 0,
"post_status": "none",
"storage_status": "none",
"pick_status": "none",
"pack_status": "none",
"inspection_status": "none",
"print_status": null,
"claim_status": "none",
"outbound_status": "none",
"lock_status": null,
"intercept_status": null
},
{
"id": 19,
"delivery_order_code": "935496",
"pre_delivery_order_code": "",
"pre_delivery_order_id": "",
"order_type": "JYCK",
"warehouse_code": "100000",
"order_flag": "",
"source_platform_code": "OFFLINE",
"source_platform_name": "线下",
"create_at": "2026-01-13T15:05:38.000Z",
"delete_at": null,
"updated_at": "2026-01-13T15:05:40.000Z",
"place_order_time": "2026-01-13T14:49:50.000Z",
"pay_time": "2026-01-13T14:51:36.000Z",
"pay_no": "S20260113225136223",
"service_code": null,
"operator_name": null,
"operate_time": "2026-01-13T15:05:38.000Z",
"delivery_time": null,
"shop_nick": "{线下}",
"seller_nick": null,
"buyer_nick": "刘付明仁",
"total_amount": "0.00",
"item_amount": "0.00",
"discount_amount": "0.00",
"freight": "0.00",
"ar_amount": "0.00",
"got_amount": "0.00",
"service_fee": null,
"logistics_code": "SF",
"logistics_name": "顺丰",
"express_code": "",
"logistics_area_code": "",
"delivery_type": null,
"is_urgency": "N",
"invoice_flag": "N",
"status": "pedding",
"name": "刘付明仁",
"zip_code": "",
"tel": "",
"mobile": "18022440198",
"email": "",
"country_code": "",
"province": "广东省",
"city": "广州市",
"area": "白云区",
"town": "",
"detail_address": "钟落潭良沙二路32号",
"id_type": null,
"id_number": null,
"oaid": null,
"sync_status": "padding",
"store_id": 1000000,
"warehouse_id": 100000,
"from_key": 23060081,
"items": "101391+5",
"items_count": 1,
"items_total": 5,
"items_weight": "0.00",
"items_hash": "26939f46b9fb7d216a485c89b6bda980",
"items_crc": 399,
"wave_id": 0,
"post_status": "none",
"storage_status": "none",
"pick_status": "none",
"pack_status": "none",
"inspection_status": "none",
"print_status": null,
"claim_status": "none",
"outbound_status": "none",
"lock_status": null,
"intercept_status": null
},
{
"id": 17,
"delivery_order_code": "2885-832",
"pre_delivery_order_code": "",
"pre_delivery_order_id": "",
"order_type": "JYCK",
"warehouse_code": "khgj2025100902",
"order_flag": "",
"source_platform_code": "OFFLINE",
"source_platform_name": "线下",
"create_at": "2026-01-13T14:46:22.000Z",
"delete_at": null,
"updated_at": "2026-01-13T14:46:22.000Z",
"place_order_time": "2026-01-13T14:36:37.000Z",
"pay_time": "2026-01-13T14:36:37.000Z",
"pay_no": "",
"service_code": null,
"operator_name": null,
"operate_time": "2026-01-13T14:40:48.000Z",
"delivery_time": null,
"shop_nick": "线下店铺",
"seller_nick": null,
"buyer_nick": null,
"total_amount": "0.00",
"item_amount": "0.00",
"discount_amount": "0.00",
"freight": "0.00",
"ar_amount": "0.00",
"got_amount": "0.00",
"service_fee": null,
"logistics_code": "SF",
"logistics_name": null,
"express_code": "",
"logistics_area_code": "",
"delivery_type": null,
"is_urgency": "N",
"invoice_flag": "N",
"status": "pedding",
"name": "刘付明仁",
"zip_code": "",
"tel": "",
"mobile": "18022440198",
"email": "",
"country_code": "",
"province": "广东省",
"city": "广州市",
"area": "白云区",
"town": "",
"detail_address": "钟落潭良沙二路32号",
"id_type": null,
"id_number": null,
"oaid": null,
"sync_status": "padding",
"store_id": 1000016,
"warehouse_id": 100000,
"from_key": 34597803,
"items": "101842+1|101845+1",
"items_count": 2,
"items_total": 2,
"items_weight": "0.00",
"items_hash": "78ebc40a9cfca92e44e69e4cc3828c3e",
"items_crc": 919,
"wave_id": 0,
"post_status": "none",
"storage_status": "none",
"pick_status": "none",
"pack_status": "none",
"inspection_status": "none",
"print_status": null,
"claim_status": "none",
"outbound_status": "none",
"lock_status": null,
"intercept_status": null
},
{
"id": 14,
"delivery_order_code": "2885-831",
"pre_delivery_order_code": "",
"pre_delivery_order_id": "",
"order_type": "JYCK",
"warehouse_code": "khgj2025100902",
"order_flag": "",
"source_platform_code": "OFFLINE",
"source_platform_name": "线下",
"create_at": "2026-01-13T14:17:35.000Z",
"delete_at": null,
"updated_at": "2026-01-13T14:17:35.000Z",
"place_order_time": "2026-01-13T13:37:42.000Z",
"pay_time": "2026-01-13T13:37:42.000Z",
"pay_no": "",
"service_code": null,
"operator_name": null,
"operate_time": "2026-01-13T13:38:05.000Z",
"delivery_time": null,
"shop_nick": "线下店铺",
"seller_nick": null,
"buyer_nick": null,
"total_amount": "0.00",
"item_amount": "0.00",
"discount_amount": "0.00",
"freight": "0.00",
"ar_amount": "0.00",
"got_amount": "0.00",
"service_fee": null,
"logistics_code": "SF",
"logistics_name": null,
"express_code": "",
"logistics_area_code": "",
"delivery_type": null,
"is_urgency": "N",
"invoice_flag": "N",
"status": "pedding",
"name": "刘付明仁",
"zip_code": "",
"tel": "",
"mobile": "18022440198",
"email": "",
"country_code": "",
"province": "广东省",
"city": "广州市",
"area": "白云区",
"town": "",
"detail_address": "钟落潭良沙二路32号",
"id_type": null,
"id_number": null,
"oaid": null,
"sync_status": "padding",
"store_id": 1000016,
"warehouse_id": 100000,
"from_key": 34597803,
"items": "101845+5",
"items_count": 1,
"items_total": 5,
"items_weight": "0.00",
"items_hash": "cbb47c0389ebc6c930a4671a4ea5d3a3",
"items_crc": 403,
"wave_id": 0,
"post_status": "none",
"storage_status": "none",
"pick_status": "none",
"pack_status": "none",
"inspection_status": "none",
"print_status": "none",
"claim_status": "none",
"outbound_status": "none",
"lock_status": "none",
"intercept_status": "none"
}
],
"pagination": {
"page": 1,
"pageSize": 20,
"total": 10,
"totalPages": 1,
"hasNext": false,
"hasPrevious": false
}
},
"timestamp": 1775696873
}
-----
storage.stockout.listItems
按出库单查询商品明细(用于非订单出库单),底层复用 order.listItems。
Params (3)
名称 类型 必填 说明
delivery_order_code string 否 出库单号,可用于定位订单
order_id number 否 订单ID,可与 id 兼容用于定位订单
id number 否 订单ID,可选;与 delivery_order_code / order_id 至少传一个
Response (2)
名称 类型 必填 说明
order object 是 订单基础信息(含 id、delivery_order_code)
items array 是 出库单商品明细
----------
收货单模块
storage.receiving.getReceivingList
Params (2)
名称 类型 必填 说明
pagination object 否 分页参数,支持 page/pageSize
where object 否 统一 where 条件对象;推荐使用 { operator, value, type } 标准结构,历史简写会在 main 中自动标准化;支持 quickWhere、status、store_id、日期区间等字段。示例:where.status={operator:eq,value:finished}; where.store_id={operator:eq,value:1001}; where.create_time_start={value:2026-03-01}。
Response (3)
名称 类型 必填 说明
list array 是 收货单列表
pagination object 是 分页信息(page、pageSize、total、totalPages、hasPrevious、hasNext)
summary object 是 汇总信息(total_quantity、total_locked、total_available、total_items)
接口返回数据:
{
"flag": "success",
"code": 200,
"message": "ok",
"data": {
"order": {
"id": 32,
"delivery_order_code": "CK26013001179"
},
"items": [
{
"id": 15,
"order_id": 32,
"actual_price": "0.00",
"retail_price": "0.00",
"ext_code": "rrxm202502",
"inventory_type": "ZP",
"item_code": "rrxm202502",
"item_id": 1000691,
"item_name": "真空包装软糯香米5斤*1袋",
"order_line_no": "2786718138979320012",
"owner_code": "wdt02060120001",
"plan_qty": 1,
"source_order_code": "TID2601200501",
"sub_source_order_code": "OID2601200503",
"extend_props": null,
"stock_id": null,
"created_at": "2026-01-30T02:42:45.000Z",
"updated_at": "2026-01-30T02:42:45.000Z",
"createdAt": "2026-01-30T02:42:45.000Z",
"updatedAt": "2026-01-30T02:42:45.000Z"
},
{
"id": 16,
"order_id": 32,
"actual_price": "129.90",
"retail_price": "129.90",
"ext_code": "三层钢蒸锅+屉26cm",
"inventory_type": "ZP",
"item_code": "三层钢蒸锅+屉26cm",
"item_id": 1000690,
"item_name": "【勇哥专属】微压锅电磁炉燃气灶通用7L大容量",
"order_line_no": "2786718137599393996",
"owner_code": "wdt02060120001",
"plan_qty": 100,
"source_order_code": "TID2601200501",
"sub_source_order_code": "OID2601200502",
"extend_props": null,
"stock_id": null,
"created_at": "2026-01-30T02:42:45.000Z",
"updated_at": "2026-01-30T02:42:45.000Z",
"createdAt": "2026-01-30T02:42:45.000Z",
"updatedAt": "2026-01-30T02:42:45.000Z"
}
]
},
"timestamp": 1775697215
}

File diff suppressed because it is too large Load Diff

56
src/项目api接口.txt Normal file
View File

@ -0,0 +1,56 @@
----------
库存模块 storage
storage.receiving.getReceivingList
storage.receiving.getReceivingDetail
storage.receiving.batchCancelReceiving
storage.receiving.create
storage.receiving.bindStore
storage.receiving.bindDetailProduct
storage.receiving.addItem
storage.receiving.removeItem
storage.receiving.saveReceiving
storage.receiving.get
storage.receiving.addDetail
storage.receiving.deleteDetail
storage.receiving.detailChange
storage.receiving.cancel
storage.receiving.completeReceiving
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------