This commit is contained in:
yin 2026-04-09 18:53:43 +08:00
parent 3dbd7d43b1
commit 69e6a26f03
24 changed files with 1927 additions and 1502 deletions

Binary file not shown.

View File

@ -340,17 +340,22 @@ export function getStockDetail(stock_id: number, pagination?: { page: number; pa
} as any)
}
// 已弃用
// export function warehouseSearch(data:any) {
// return request({
// url: '/system',
// method: 'post',
// params: {
// method: 'stock.warehouse.search',
// v,
// timestamp: new Date().getTime()
// },
// data: data,
// isSystemApi: true
// } as any)
// }
// PDA使用,本项目不使用
export function warehouseSearch(data: {
keyword?: string
store_id?: number
with_stock?: boolean
is_batch?: boolean
}) {
return request({
url: '/system',
method: 'post',
params: {
method: 'stock.warehouse.search',
v,
timestamp: new Date().getTime()
},
data,
isSystemApi: true
} as any)
}

View File

@ -28,58 +28,6 @@ export function getEntryDetail(data:any): Promise<any> {
})
}
export function createEntry(data:any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.entry.create',
v,
timestamp: new Date().getTime()
},
data: data
})
}
export function addDetail(data:any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.entry.addDetail',
v,
timestamp: new Date().getTime()
},
data: data
})
}
export function deleteDetail(data:any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.entry.deleteDetail',
v,
timestamp: new Date().getTime()
},
data: data
})
}
export function detailChange(data:any): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.entry.detailChange',
v,
timestamp: new Date().getTime()
},
data: data
})
}
export function cancelEntry(data:any): Promise<any> {
return request({
url: '/system',
@ -104,4 +52,21 @@ export function completeEntry(data:any): Promise<any> {
},
data: data
})
}
// 废弃接口,不再使用
export function createEntry(data:any): Promise<any> {
return Promise.reject(new Error('storage.entry.create 已下线,请使用 quickPutaway / matchPutaway 流程'))
}
export function addDetail(data:any): Promise<any> {
return Promise.reject(new Error('storage.entry.addDetail 已下线,入库单明细不再对外编辑'))
}
export function deleteDetail(data:any): Promise<any> {
return Promise.reject(new Error('storage.entry.deleteDetail 已下线,入库单明细不再对外编辑'))
}
export function detailChange(data:any): Promise<any> {
return Promise.reject(new Error('storage.entry.detailChange 已下线,入库单明细不再对外编辑'))
}

View File

@ -2,29 +2,6 @@ import request from '@/utils/request'
const v = "1.0"
/**
* 收货单快捷入库上架
* 从收货单直接生成入库单(SCRK)并写入库存,同时更新库存数量。
* 要求收货单已完成且所有明细已匹配系统商品。
*/
export function quickPutaway(data: {
/** 收货单ID */
receiving_id: number
/** 可选:指定目标仓库货位等附加信息 */
extra?: Record<string, any>
}): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.inventory.quickPutaway',
v,
timestamp: new Date().getTime()
},
data,
isSystemApi: true
} as any)
}
export function getInventoryList(data: any): Promise<any> {
return request({
@ -38,4 +15,41 @@ export function getInventoryList(data: any): Promise<any> {
data,
isSystemApi: true
} as any)
}
// 非本项目接口,不使用
export function matchPutaway(data: {
receiving_id: number
extra?: Record<string, any>
}): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.inventory.matchPutaway',
v,
timestamp: new Date().getTime()
},
data,
isSystemApi: true
} as any)
}
export function transferByProduct(data: {
space_id: number
stock_id: number
target_space_id: number
quantity: number
}): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.inventory.transferByProduct',
v,
timestamp: new Date().getTime()
},
data,
isSystemApi: true
} as any)
}

View File

@ -255,4 +255,24 @@ export function bindDetailProduct(data: any): Promise<any> {
},
data: data,
})
}
export function quickPutaway(data: {
/** 收货单ID */
receiving_id: number
/** 可选:指定目标仓库货位等附加信息 */
extra?: Record<string, any>
}): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.inventory.quickPutaway',
v,
timestamp: new Date().getTime()
},
data,
isSystemApi: true
} as any)
}

View File

@ -12,4 +12,21 @@ export const stockoutList = (data: any) => {
},
data: data
})
}
export const stockoutListItems = (data: {
delivery_order_code?: string
order_id?: number
id?: number
}) => {
return request({
url: `/system`,
method: 'post',
params: {
method: 'storage.stockout.listItems',
v,
timestamp: new Date().getTime()
},
data: data
})
}

View File

@ -42,7 +42,7 @@
placeholder="条件类型"
size="small"
class="operator-select"
@change="handleTextOperatorChange(field)"
@change="handleOperatorChange(field)"
>
<el-option
v-for="op in getOperators(field)"
@ -51,7 +51,9 @@
:value="op.value"
/>
</el-select>
<span v-if="isNullishOperator(customConditions[field.value].operator)" class="no-value-tip">无需填值</span>
<el-input
v-else
v-model="customConditions[field.value].value"
:placeholder="getTextPlaceholder(field)"
size="small"
@ -75,6 +77,7 @@
placeholder="请选择"
size="small"
class="operator-select"
@change="handleOperatorChange(field)"
>
<el-option
v-for="op in getOperators(field)"
@ -83,7 +86,41 @@
:value="op.value"
/>
</el-select>
<!-- isnull / isnotnull: 无需填值 -->
<span v-if="isNullishOperator(customConditions[field.value].operator)" class="no-value-tip">无需填值</span>
<!-- between / notbetween: 区间双输入 -->
<template v-else-if="isRangeOperator(customConditions[field.value].operator)">
<el-input-number
v-model="customConditions[field.value].valueMin"
:controls="false"
size="small"
placeholder="最小值"
class="range-input"
@change="handleCustomChange"
/>
<span class="range-sep">至</span>
<el-input-number
v-model="customConditions[field.value].valueMax"
:controls="false"
size="small"
placeholder="最大值"
class="range-input"
@change="handleCustomChange"
/>
</template>
<!-- in / notin: 逗号分隔文本 -->
<el-input
v-else-if="isMultiOperator(customConditions[field.value].operator)"
v-model="customConditions[field.value].value"
placeholder="多个值逗号分隔"
size="small"
clearable
class="value-input"
@change="handleCustomChange"
/>
<!-- 普通单值 -->
<el-input-number
v-else
v-model="customConditions[field.value].value"
:controls="false"
size="small"
@ -106,6 +143,7 @@
placeholder="请选择"
size="small"
class="operator-select"
@change="handleOperatorChange(field)"
>
<el-option
v-for="op in getOperators(field)"
@ -114,7 +152,23 @@
:value="op.value"
/>
</el-select>
<span v-if="isNullishOperator(customConditions[field.value].operator)" class="no-value-tip">无需填值</span>
<!-- between / notbetween: 日期区间 -->
<el-date-picker
v-else-if="isRangeOperator(customConditions[field.value].operator)"
v-model="customConditions[field.value].value"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
size="small"
style="width: 100%;"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
@change="handleCustomChange"
/>
<el-date-picker
v-else
v-model="customConditions[field.value].value"
type="date"
:placeholder="field.placeholder || `请选择${field.label}`"
@ -127,7 +181,7 @@
</div>
</div>
<!-- 日期范围类型 -->
<!-- 日期范围类型,operator 固定为 between -->
<div v-else-if="field.type === 'daterange'" class="field-form-item">
<div class="field-label">
<span>{{ field.label }}</span>
@ -362,9 +416,16 @@ const props = defineProps({
text: [
{ value: 'eq', label: '等于' },
{ value: 'ne', label: '不等于' },
{ value: 'like', label: '模糊匹配' },
{ value: 'contains', label: '包含' },
{ value: 'startswith', label: '开头为' },
{ value: 'endswith', label: '结尾为' }
{ value: 'endswith', label: '结尾为' },
{ value: 'in', label: 'IN(逗号分隔)' },
{ value: 'notin', label: 'NOT IN' },
{ value: 'isnull', label: '为空' },
{ value: 'isnotnull', label: '不为空' },
{ value: 'regexp', label: '正则匹配' },
{ value: 'notregexp', label: '正则不匹配' }
],
number: [
{ value: 'eq', label: '等于' },
@ -373,13 +434,27 @@ const props = defineProps({
{ value: 'lt', label: '小于' },
{ value: 'ge', label: '大于等于' },
{ value: 'le', label: '小于等于' },
{ value: 'between', label: '包含' }
{ value: 'between', label: '区间内' },
{ value: 'notbetween', label: '区间外' },
{ value: 'in', label: 'IN(逗号分隔)' },
{ value: 'notin', label: 'NOT IN' },
{ value: 'isnull', label: '为空' },
{ value: 'isnotnull', label: '不为空' }
],
date: [
{ value: 'eq', label: '等于' },
{ value: 'ne', label: '不等于' },
{ value: 'gt', label: '晚于' },
{ value: 'lt', label: '早于' }
{ value: 'lt', label: '早于' },
{ value: 'ge', label: '大于等于' },
{ value: 'le', label: '小于等于' },
{ value: 'between', label: '区间内' },
{ value: 'notbetween', label: '区间外' },
{ value: 'isnull', label: '为空' },
{ value: 'isnotnull', label: '不为空' }
],
daterange: [
{ value: 'between', label: '区间' }
]
})
},
@ -451,28 +526,52 @@ onBeforeUnmount(() => {
})
// Methods
// 操作符类型辅助函数
function isNullishOperator(op: string) {
return ['isnull', 'isnotnull'].includes(op)
}
function isRangeOperator(op: string) {
return ['between', 'notbetween'].includes(op)
}
function isMultiOperator(op: string) {
return ['in', 'notin'].includes(op)
}
function getTextPlaceholder(field: any) {
const operator = customConditions[field.value].operator
const basePlaceholder = field.placeholder || `请输入${field.label}`
if (operator === 'contains') {
if (operator === 'contains' || operator === 'in' || operator === 'notin') {
return `${basePlaceholder}(多个值用逗号分隔)`
}
return basePlaceholder
}
function handleTextOperatorChange(field: any) {
// 统一的操作符切换处理函数
function handleOperatorChange(field: any) {
const operator = customConditions[field.value].operator
if (operator !== 'contains') {
// 切换至非多值操作符时,如果当前值是数组则转为逗号字符串
if (!['contains', 'in', 'notin'].includes(operator)) {
const currentValue = customConditions[field.value].value
if (Array.isArray(currentValue)) {
customConditions[field.value].value = currentValue.join(', ')
}
}
// 切换至 isnull/isnotnull 时清空值
if (isNullishOperator(operator)) {
customConditions[field.value].value = undefined
customConditions[field.value].valueMin = undefined
customConditions[field.value].valueMax = undefined
}
handleCustomChange()
}
// 升级兼容:保留旧名称供内部历史调用
function handleTextOperatorChange(field: any) {
handleOperatorChange(field)
}
function normalizeTextValue(field: any) {
const operator = customConditions[field.value].operator
const value = customConditions[field.value].value
@ -496,7 +595,7 @@ function normalizeTextValue(field: any) {
function initCustomConditions(fields: any[]) {
fields.forEach(field => {
let defaultValue = undefined
let defaultValue: any = undefined
let defaultOperator = ''
switch (field.type) {
@ -509,29 +608,36 @@ function initCustomConditions(fields: any[]) {
break
case 'daterange':
defaultValue = []
defaultOperator = 'between' // daterange 固定使用 between
break
default:
defaultValue = undefined
}
if (field.operators && Array.isArray(field.operators) && field.operators.length > 0) {
defaultOperator = field.defaultOperator || field.operators[0]
} else {
const defaultOps = props.defaultOperators[field.type as keyof typeof props.defaultOperators]
if (defaultOps && defaultOps.length > 0) {
defaultOperator = field.defaultOperator || defaultOps[0].value || ''
// daterange 已在上面 switch 设置了 defaultOperator,其他类型按字段配置或默认列表确定
if (field.type !== 'daterange') {
if (field.operators && Array.isArray(field.operators) && field.operators.length > 0) {
defaultOperator = field.defaultOperator || field.operators[0]
} else {
const defaultOps = props.defaultOperators[field.type as keyof typeof props.defaultOperators]
if (defaultOps && defaultOps.length > 0) {
defaultOperator = field.defaultOperator || defaultOps[0].value || ''
}
}
}
// Assign to reactive object
// Using Object.assign or direct assignment for existing properties to maintain reactivity if needed,
// but here we are initializing/resetting so direct assignment is fine, but we need to ensure reactivity.
// Since customConditions is reactive({}), adding new properties works.
if (!customConditions[field.value]) {
customConditions[field.value] = { value: defaultValue, operator: defaultOperator }
customConditions[field.value] = {
value: defaultValue,
operator: defaultOperator,
valueMin: undefined,
valueMax: undefined
}
} else {
customConditions[field.value].value = defaultValue
customConditions[field.value].operator = defaultOperator
customConditions[field.value].value = defaultValue
customConditions[field.value].operator = defaultOperator
customConditions[field.value].valueMin = undefined
customConditions[field.value].valueMax = undefined
}
})
}
@ -602,15 +708,50 @@ function buildAndEmitCustomCondition() {
props.availableFields.forEach((field: any) => {
const condition = customConditions[field.value]
const op = condition.operator
// isnull / isnotnull: 无需值,直接包含
if (isNullishOperator(op)) {
conditions[field.value] = {
value: null,
operator: op,
field: field.value,
type: field.type
}
hasCondition = true
return
}
// between / notbetween 对 number 类型:使用 valueMin/valueMax
if (field.type === 'number' && isRangeOperator(op)) {
const min = condition.valueMin
const max = condition.valueMax
if (min !== undefined && min !== null && max !== undefined && max !== null) {
conditions[field.value] = {
value: [min, max],
operator: op,
field: field.value,
type: 'number'
}
hasCondition = true
}
return
}
let conditionValue = condition.value
if (field.type === 'text' && condition.operator === 'contains' && conditionValue) {
const values = conditionValue.split(',').filter((v: string) => v.trim())
// 处理多值操作符:contains / in / notin 逗号分隔 -> 数组
if (['contains', 'in', 'notin'].includes(op) && typeof conditionValue === 'string' && conditionValue) {
const values = conditionValue.split(',').map((v: string) => v.trim()).filter(Boolean)
if (values.length > 0) {
conditionValue = values
}
}
// daterange 固定 operator = between
const finalOp = field.type === 'daterange' ? 'between' : op
const finalType = field.type === 'daterange' ? 'daterange' : field.type
if (conditionValue !== undefined &&
conditionValue !== null &&
conditionValue !== '' &&
@ -618,9 +759,9 @@ function buildAndEmitCustomCondition() {
conditions[field.value] = {
value: conditionValue,
operator: condition.operator,
operator: finalOp,
field: field.value,
type: field.type,
type: finalType,
isMultiple: Array.isArray(conditionValue)
}
hasCondition = true
@ -730,20 +871,51 @@ function buildConditionsObject() {
const conditions: any = {}
props.availableFields.forEach((field: any) => {
const condition = customConditions[field.value]
const op = condition.operator
// isnull / isnotnull
if (isNullishOperator(op)) {
conditions[field.value] = {
value: null,
operator: op,
type: field.type
}
return
}
// between / notbetween 对 number
if (field.type === 'number' && isRangeOperator(op)) {
const min = condition.valueMin
const max = condition.valueMax
if (min !== undefined && min !== null && max !== undefined && max !== null) {
conditions[field.value] = {
value: [min, max],
operator: op,
type: 'number'
}
}
return
}
let conditionValue = condition.value
if (field.type === 'text' && condition.operator === 'contains' && conditionValue) {
const values = conditionValue.split(',').filter((v: string) => v.trim())
if (values.length > 0) {
conditionValue = values
}
if (['contains', 'in', 'notin'].includes(op) && typeof conditionValue === 'string' && conditionValue) {
const values = conditionValue.split(',').map((v: string) => v.trim()).filter(Boolean)
if (values.length > 0) conditionValue = values
}
const finalOp = field.type === 'daterange' ? 'between' : op
const finalType = field.type === 'daterange' ? 'daterange' : field.type
if (conditionValue !== undefined &&
conditionValue !== null &&
conditionValue !== '' &&
!(Array.isArray(conditionValue) && conditionValue.length === 0)) {
conditions[field.value] = conditionValue
conditions[field.value] = {
value: conditionValue,
operator: finalOp,
type: finalType
}
}
})
return conditions
@ -968,4 +1140,28 @@ defineExpose({ getConditions, reset, clear })
.reset-btn {
color: #666;
}
/* 区间双输入样式 */
.range-input {
flex: 1;
min-width: 0;
}
.range-sep {
flex-shrink: 0;
line-height: 28px;
font-size: 12px;
color: #909399;
padding: 0 2px;
}
/* isnull/isnotnull 无需填值提示 */
.no-value-tip {
flex: 1;
font-size: 12px;
color: #c0c4cc;
line-height: 28px;
padding-left: 4px;
font-style: italic;
}
</style>

View File

@ -1,160 +1,5 @@
接口文档更新:
[
{
"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 自动计算差值,以兼容历史审计与展示。"
]
},
{
"id": "2026.04.07-system-06",
"date": "2026-04-07",
"method": "storeWarehouse.store.saveApiConfig",
"type": "changed",
"summary": "按接口类型分类限制必填字段,OPEN_API 创建时自动生成 self_app_key/self_app_secret",
"detail": "QM_WMS 类型须填写 qimen_app_key/qimen_customer_id/qimen_warehouse_code;OPEN_API 类型三个奇门字段非必填,创建时自动生成 self_app_key(WMS+32位HEX)和 self_app_secret(64位HEX),更新时保留已有密钥。"
},
{
"id": "2026.04.07-system-07",
"date": "2026-04-07",
"method": "index.listInterfaceTypes",
"type": "added",
"summary": "新增接口类型列表查询接口,归属基础模块,无需权限",
"detail": "返回所有已启用的接口类型(wms_interface_type),包含 id、interface_code、interface_name、interface_category、description 字段。设置 isNeedAuth: false, isNeedLogin: true。"
},
{
"id": "2026.04.07-system-08",
"date": "2026-04-07",
"method": "storeWarehouse.store.saveApiConfig",
"type": "changed",
"summary": "app_name 改为必传参数",
"detail": "app_name 不再有默认值自动生成逻辑,调用方必须传入非空的 app_name,否则返回 400 错误。"
},
{
"id": "2026.04.07-system-09",
"date": "2026-04-07",
"method": "storage.inventory.quickPutaway",
"type": "added",
"summary": "新增收货单快捷入库上架接口",
"detail": "新建 storage.inventory 库存操作模块。quickPutaway 从收货单直接生成入库单(SCRK)并写入 wms_storage 库存表,同时更新 wms_stock_warehouse 库存数量(悲观行锁),回填收货明细入库状态。要求收货单已完成且所有明细已匹配系统商品。"
},
{
"id": "2026.04.08-system-01",
"date": "2026-04-08",
"method": "storage.inventory.matchPutaway",
"type": "added",
"summary": "新增收货单与入库单匹配入库接口",
"detail": "接收多个收货单和入库单,按商品(stock_warehouse_id)进行数量匹配入库,完成后根据入库单来源(QM/API)自动触发回传。入参为 receiving_ids(数组)和 entry_order_ids(数组),返回匹配汇总、各收货单入库状态、各入库单状态及回传结果。isNeedAuth=true, isNeedLogin=true, isNeedRight=false。"
},
{
"id": "2026.04.08-system-02",
"date": "2026-04-08",
"method": "storeWarehouse.store.saveApiConfig",
"type": "changed",
"summary": "saveApiConfig 新增 callback_url 可选参数",
"detail": "新增 callback_url 参数(VARCHAR(500),可选),用于 OPEN_API 类型入库单的回调地址配置。"
},
{
"id": "2026.04.08-system-03",
"date": "2026-04-08",
"method": "storeWarehouse.store.list, storeWarehouse.store.listApiConfig",
"type": "changed",
"summary": "serializeQimenConfig 新增返回 callback_url 字段,影响 list 和 listApiConfig 两个接口",
"detail": "serializeQimenConfig() 序列化方法新增 callback_url(string)字段。storeWarehouse.store.list 返回的每条记录 api_config 对象中包含 callback_url;storeWarehouse.store.listApiConfig 返回的 list 数组中每条配置包含 callback_url。"
},
{
"id": "2026.04.08-system-04",
"date": "2026-04-08",
"method": "storage.inventory.transferLocation",
"type": "added",
"summary": "新增库存移库(库位转移)接口",
"detail": "新增 storage.inventory.transferLocation 接口,支持批量多商品多库位移库,包含部分数量移库与全量移库。入参为 warehouse_id(仓库ID)和 transfers 数组(storage_id、target_space_id、quantity),触发 storage_transfer_completed 通知事件,每条移库记录独立操作日志。isNeedAuth=true, isNeedLogin=true。"
},
{
"id": "2026.04.08-system-05",
"date": "2026-04-08",
"method": "storage.inventory.transferLocation",
"type": "modified",
"summary": "简化移库接口入参,从批量 transfers 数组改为单条移库",
"detail": "移除 warehouse_id 和 transfers 数组入参,改为扁平的 storage_id + target_space_id + quantity 三个顶层参数。warehouse_id 从库存记录自动获取,接口从批量移库简化为单商品单库位移库。响应结构同步简化为单条结果对象。"
},
{
"id": "2026.04.08-system-06",
"date": "2026-04-08",
"method": "stock.warehouse.getStockDetail",
"type": "added",
"summary": "新增商品库存明细查询接口",
"detail": "新增 stock.warehouse.getStockDetail 接口,按库位/批次维度查询商品库存分布。入参为 stock_id(必填,商品库存ID)和 pagination(可选,含 page/pageSize)。返回 stockItem(商品概要)、storageList(wms_storage 明细数组,含批次号、库位、数量、锁定数量、生产日期、过期日期等,关联 location_space 库位信息)、pagination 分页信息。isNeedAuth=false, isNeedLogin=true。底层调用 stockStore.getStockDetail,自动校验商品归属当前仓库。"
},
{
"id": "2026.04.08-system-07",
"date": "2026-04-08",
"method": "stock.warehouse.getStockDetail",
"type": "modified",
"summary": "新增入参 group_by_batch,支持按批次维度切换库存明细聚合方式",
"detail": "新增可选布尔参数 group_by_batch(默认 false)。false 时按库位合并数量,批次相关字段(batch_no, production_date, expiry_date, inbound_time, inbound_order_no, supplier_batch_no)置 null;true 时保持原逻辑返回每条明细。出参结构不变,但 storageList 中批次字段在合并模式下为 null。"
},
{
"id": "2026.04.08-system-08",
"date": "2026-04-08",
@ -163,4 +8,113 @@
"summary": "新增按商品维度移库接口",
"detail": "新增 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。"
}
{
"id": "2026.04.08-system-09",
"date": "2026-04-08",
"method": "storeWarehouse.store.list",
"type": "updated",
"summary": "补充 storeWarehouse.store.list 完整 response 输出字段说明,移除 api_config / apiConfig",
"detail": "从返回结果中移除 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 信息。"
},
{
"id": "2026.04.08-system-10",
"date": "2026-04-08",
"method": "storeWarehouse.store.list",
"type": "changed",
"summary": "货主列表返回新增 has_qimen_config 布尔字段",
"detail": "storeWarehouse.store.list 返回的 data.list[] 中新增 has_qimen_config(boolean),表示该货主是否已配置奇门。"
},
{
"id": "2026.04.08-system-11",
"date": "2026-04-08",
"method": "stock.warehouse.search",
"type": "updated",
"summary": "补全 stock.warehouse.search 接口文档,新增 params / response / errors 完整说明",
"detail": "入参补充 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 搜索失败场景。"
},
{
"id": "2026.04.08-system-12",
"date": "2026-04-08",
"method": "stock.warehouse.search",
"type": "updated",
"summary": "新增 with_stock / is_batch 参数,支持返回关联库存明细(按库位分组或按批次逐条)",
"detail": "入参新增 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)。"
},
{
"id": "2026.04.08-system-13",
"date": "2026-04-08",
"method": "wms_stock_transaction",
"type": "added",
"summary": "新增 wms_stock_transaction 表和模型",
"detail": "新增出入库流水记录表 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 模型。"
},
{
"id": "2026.04.08-system-14",
"date": "2026-04-08",
"method": "storage.inventory.quickPutaway,storage.inventory.matchPutaway",
"type": "updated",
"summary": "quickPutaway 和 matchPutaway 入库时自动写入出入库记录",
"detail": "入库操作完成后自动写入 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 等字段。"
},
{
"id": "2026.04.08-system-15",
"date": "2026-04-08",
"method": "storage.inventory.list",
"type": "added",
"summary": "新增 storage.inventory.list 出入库记录列表查询接口",
"detail": "出入库记录列表查询,支持 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)。"
},
{
"id": "2026.04.08-system-16",
"date": "2026-04-08",
"module": "storage",
"method": "storage.transaction.list",
"type": "rename",
"summary": "出入库流水记录查询接口从 storage.inventory.list 改名为 storage.transaction.list",
"detail": "将出入库流水记录查询从 storage.inventory.list 迁移到 storage.transaction.list,避免与库存列表概念混淆。功能和参数不变。isNeedAuth=false, isNeedLogin=true, isNeedRight=false。"
},
{
"id": "2026.04.08-system-17",
"date": "2026-04-08",
"module": "storage",
"method": "storage.inventory.list",
"type": "add",
"summary": "新增 storage.inventory.list 库存列表查询接口",
"detail": "新增库存列表查询接口,查询 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。"
},
{
"id": "2026.04.08-system-18",
"date": "2026-04-08",
"module": "storage",
"method": "storage.entry.create",
"type": "remove",
"summary": "移除 storage.entry.create 创建入库单接口",
"detail": "不再允许通过 API 创建入库单。入库单仅由快捷入库(quickPutaway)和匹配入库(matchPutaway)等内部流程自动创建。底层 service 实现保留但不再通过 systemMethods 暴露。"
},
{
"id": "2026.04.08-system-19",
"date": "2026-04-08",
"module": "storage",
"method": "storage.entry.addDetail, storage.entry.deleteDetail, storage.entry.detailChange",
"type": "remove",
"summary": "移除 storage.entry.addDetail / deleteDetail / detailChange 对外接口",
"detail": "入库单明细编辑能力不再通过 systemMethods 对外暴露,入库单模块仅保留 list/get/cancel/completeEntry。"
},
{
"id": "2026.04.08-system-20",
"date": "2026-04-08",
"module": "storage",
"method": "storage.stockout.list, storage.stockout.toOrder, storage.stockout.listItems",
"type": "add",
"summary": "新增 storage.stockout 出库单模块(非订单出库单能力)",
"detail": "新增 storage.stockout.list / toOrder / listItems 接口,作为非订单出库单的主出口(对应奇门 stockout.create)。storage.delivery.* 仅作为兼容转发保留;底层部分能力仍复用 order 模块。"
},
{
"id": "2026.04.08-system-21",
"date": "2026-04-08",
"method": "storage.stockout.toOrder",
"type": "change",
"summary": "将 storage.stockout.toOrder 标记为占位接口",
"detail": "storage.stockout.toOrder 当前仅保留方法名用于后续扩展,暂不开放实际逻辑。调用时返回 code=405、message=占位接口,暂未开放。"
}
]

View File

@ -3,7 +3,7 @@
<div class="header-actions">
<div class="left-actions">
<el-button size="small" @click="loadEntryDetail">刷新</el-button>
<el-button size="small" @click="handleAddDetail">新增入库</el-button>
<!-- <el-button size="small" @click="handleAddDetail">新增入库</el-button> -->
<!-- <el-button size="small" type="primary" disabled>批量入库</el-button> -->
<el-button size="small" disabled>EXCEL导出</el-button>
<el-button size="small" disabled>导出</el-button>
@ -118,50 +118,31 @@ async function loadEntryDetail() {
try {
console.log('加载入库单详情, ID:', props.id)
let useMock = false
try {
const res = await entryApi.getEntryDetail({
id: props.id,
page: pagination.currentPage,
page_size: pagination.pageSize
})
if (res && res.code === 200 && res.data) {
tableData.value = Array.isArray(res.data) ? res.data : [res.data]
pagination.total = res.total || tableData.value.length
} else {
useMock = true
}
} catch (apiError) {
console.warn('详情API调用失败,改用模拟数据', apiError)
useMock = true
}
if (useMock) {
// 模拟数据源
const allMockDetails: Record<number | string, any[]> = {
90: [
{ id: 91, order_id: 90, out_biz_code: '', order_line_no: 1, owner_code: 'khgj2025100901', item_code: '6977520597331', item_id: 0, count: 5000, inventory_type: 'ZP', stock_id: 101845, received_quantity: 5000, confirm_quantity: 5000 }
],
93: [
{ id: 94, order_id: 93, out_biz_code: '', order_line_no: 1, owner_code: 'khgj2025100901', item_code: '6977520597331', item_id: 1000689, count: 1000, inventory_type: 'ZP', stock_id: 101845, received_quantity: 1000, confirm_quantity: 1000 }
],
95: [
{ id: 95, order_id: 95, out_biz_code: '', order_line_no: 2786714391389667366, owner_code: 'wdt02060120001', item_code: '三层钢蒸锅+屉26cm', item_id: 1000690, count: 1000, inventory_type: 'ZP', stock_id: 101874, received_quantity: 1000, confirm_quantity: 1000 }
],
96: [
{ id: 96, order_id: 96, out_biz_code: '', order_line_no: 2786720123363262666, owner_code: 'wdt02060120001', item_code: 'rrxm202502', item_id: 1000691, count: 1000, inventory_type: 'ZP', stock_id: 101875, received_quantity: 1000, confirm_quantity: 1000 }
],
97: [
{ id: 97, order_id: 97, out_biz_code: '', order_line_no: 1, owner_code: 'khgj2025100901', item_code: '20251023-18', item_id: 1000686, count: 1000, inventory_type: 'ZP', stock_id: 101842, received_quantity: 0, confirm_quantity: 0 }
]
}
const mockDetails = allMockDetails[props.id] || []
tableData.value = mockDetails
pagination.total = mockDetails.length
const res = await entryApi.getEntryDetail({
id: props.id
})
if (res && res.code === 200 && res.data?.entryOrder) {
const entryOrder = res.data.entryOrder
// 接口文档1显示 items 在 entryOrder 对象中
const items = entryOrder.items || []
// 处理 items 数据,将嵌套的 stock 信息平铺,方便表格展示
tableData.value = items.map((item: any) => ({
...item,
item_name: item.stock?.item_name || '',
// 如果列配置中有其他需要从 stock 获取的字段,可以在此映射
}))
pagination.total = tableData.value.length
} else {
throw new Error(res?.message || '接口返回数据异常')
}
} catch (error) {
console.error('获取明细失败:', error)
ElMessage.error('获取明细失败')
tableData.value = []
pagination.total = 0
} finally {
loading.value = false
}
@ -185,24 +166,9 @@ async function submitAddDetail() {
addLoading.value = true
try {
const params = {
order_id: Number(props.id),
count: addForm.count,
item_code: addForm.item_code
}
const res = await entryApi.addDetail(params)
if (res && res.code === 200) {
ElMessage.success('新增明细成功')
addDialogVisible.value = false
loadEntryDetail()
emit('refresh')
} else {
ElMessage.error(res?.message || '新增失败')
}
} catch (e) {
console.error('新增明细错误:', e)
ElMessage.error('操作失败')
ElMessage.warning('接口已下线:storage.entry.addDetail 不再对外开放')
addDialogVisible.value = false
emit('refresh')
} finally {
addLoading.value = false
}

View File

@ -49,10 +49,10 @@
<!-- 底部操作按钮 -->
<div class="bottom">
<el-button-group class="toolbar-btn-group">
<el-button type="primary" icon="Check" @click="handleSave" :loading="saveLoading">
<el-button type="primary" icon="Check" disabled :loading="saveLoading" >
保存
</el-button>
<el-button type="danger" icon="Refresh" @click="handleReset">
<el-button type="danger" icon="Refresh" disabled>
重置
</el-button>
</el-button-group>

View File

@ -16,7 +16,7 @@
<div class="toolbar">
<div class="toolbar-left">
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
<el-button size="small" @click="handleCreateEntry">新建入库单</el-button>
<!-- <el-button size="small" @click="handleCreateEntry">新建入库单</el-button> -->
<el-button size="small" @click="handleCompleteEntry">完成入库</el-button>
<el-button size="small" :disabled="!hasSelection" @click="confirmBatchCancel">批量作废</el-button>
<el-button size="small" :loading="exportLoading" @click="handleExport">导出</el-button>
@ -64,6 +64,18 @@
</el-tag>
</template>
<template #column-order_create_time="{ row }">
{{ formatTime(row.order_create_time) }}
</template>
<template #column-expect_start_time="{ row }">
{{ formatTime(row.expect_start_time) }}
</template>
<template #column-expect_end_time="{ row }">
{{ formatTime(row.expect_end_time) }}
</template>
<template #empty>
<div class="empty-tip">暂无入库单</div>
</template>
@ -193,6 +205,51 @@ function translateField(fieldValue: string, value: any) {
return value
}
function pad(n: number) {
return n < 10 ? '0' + n : String(n)
}
function formatTime(val: any) {
if (!val && val !== 0) return ''
const d = new Date(val)
if (isNaN(d.getTime())) return String(val)
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`
}
/**
* 将 scan-box 返回的条件标准化为后端推荐结构:{ operator, value, type }
* 支持三种情况:
* - 已经是 {value, operator, type} 形式:原样返回
* - 是简单值(string/number/array):包装为 { operator: 'eq', value: val }
* - 空或 undefined:忽略该字段
*/
function normalizeWhere(conds: any) {
if (!conds || typeof conds !== 'object') return {}
const where: any = {}
Object.keys(conds).forEach(key => {
const c = conds[key]
if (c === undefined) return
// 已经是标准对象
if (c && typeof c === 'object' && ('operator' in c || 'value' in c || 'type' in c)) {
// 保持 operator/value/type 字段,若缺失则做适度默认
where[key] = {
operator: c.operator || (Array.isArray(c.value) ? 'in' : 'eq'),
value: c.value,
type: c.type || undefined
}
return
}
// 简单类型,直接包装为 eq(数组则为 in)
where[key] = {
operator: Array.isArray(c) ? 'in' : 'eq',
value: c
}
})
return where
}
function getStatusType(status: string) {
const map: Record<string, string> = {
'CREATED': 'info',
@ -225,24 +282,30 @@ async function loadData() {
loading.value = true
const start = Date.now()
try {
const conditions = scanBox.value?.getConditions() || {}
const where = normalizeWhere(conditions)
const params = {
page: pagination.currentPage,
page_size: pagination.pageSize,
quick_search: quickSearch.value,
sort_prop: currentSort.prop,
sort_order: currentSort.order,
...(scanBox.value?.getConditions() || {})
pagination: {
page: pagination.currentPage,
pageSize: pagination.pageSize
},
sort: currentSort.prop ? {
sortField: currentSort.prop,
sortOrder: currentSort.order === 'ascending' ? 'ASC' : 'DESC'
} : undefined,
where: where
}
let useMock = false
try {
const res = await entryApi.getEntryList(params)
if (res && res.code === 200 && res.data?.list && res.data.list.length > 0) {
if (res && res.code === 200 && res.data?.list) {
list.value = res.data.list
pagination.total = res.data.pagination?.total || res.data.list.length
pagination.total = res.data.pagination?.total || 0
// 如果有 summary,可以考虑在此处处理
} else {
useMock = true
console.log('API未返回数据,准备使用模拟数据')
console.log('API未返回有效数据,准备使用模拟数据')
}
} catch (apiError) {
console.warn('API调用失败,改用模拟数据', apiError)
@ -440,8 +503,7 @@ const createForm = reactive<any>({
})
function handleCreateEntry() {
Object.keys(createForm).forEach(key => createForm[key] = '')
createDialogVisible.value = true
ElMessage.warning('接口已下线:入库单不再支持手工新建,请使用快捷入库/匹配入库流程')
}
async function handleCompleteEntry() {
@ -479,27 +541,7 @@ function handleCreateDialogClosed() {
}
async function submitCreateEntry() {
if (!createForm.order_type) {
ElMessage.warning('请选择业务类型')
return
}
createLoading.value = true
try {
const res = await entryApi.createEntry(createForm)
if (res && res.code === 200) {
ElMessage.success('新建入库单成功')
createDialogVisible.value = false
loadData()
} else {
ElMessage.error(res?.message || '新建失败')
}
} catch (e) {
console.error('新建入库单出错:', e)
ElMessage.error('新建入库单失败')
} finally {
createLoading.value = false
}
ElMessage.warning('接口已下线:storage.entry.create 不再对外开放')
}
async function confirmBatchCancel() {

View File

@ -16,11 +16,11 @@
<div class="toolbar">
<div class="toolbar-left">
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
<el-button size="small" @click="handleCreateEntry">新建入库单</el-button>
<!-- <el-button size="small" @click="handleCreateEntry">新建入库单</el-button> -->
<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 size="small" type="success" :disabled="!hasSelection" :loading="quickPutawayLoading" @click="handleQuickPutaway">快捷入库</el-button>
</div>
<!-- <div class="toolbar-right">
@ -102,7 +102,6 @@ import UpperTable from '@/components/UpperTable/index.vue'
import * as indexApi from '@/api/index'
// import * as entryApi from '@/api/storage/entry'
import * as inventoryApi from '@/api/storage/inventory'
import * as receivingApi from '@/api/storage/receiving'
import {
availableFields,
@ -123,7 +122,6 @@ const activeTab = ref('details')
const list = ref<any[]>([])
const loading = ref(false)
const exportLoading = ref(false)
const quickPutawayLoading = ref(false)
const queryTime = ref(0)
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
@ -323,94 +321,7 @@ function orderStatusTagType(val: string): any {
return ORDER_STATUS_TAG[val] || ''
}
async function handleQuickPutaway() {
if (!selectionRows.value.length) {
ElMessage.warning('请先勾选要快捷入库的入库单')
return
}
quickPutawayLoading.value = true
// 逐行校验:通过 purchase_order_code 查询收货单,验证状态与匹配状态
const validRows: Array<{ entry: any; receivingId: number }> = []
const errors: string[] = []
try {
for (const row of selectionRows.value) {
const receivingNumber = row.purchase_order_code
if (!receivingNumber) {
errors.push(`入库单【${row.entry_order_code || row.id}】无单据编号,无法查询收货单`)
continue
}
let rcvRes: any
try {
rcvRes = await receivingApi.getReceivingList({ where: { receiving_number: receivingNumber } })
} catch {
errors.push(`入库单【${row.entry_order_code}】查询收货单失败`)
continue
}
const rcvList = rcvRes?.data?.list ?? rcvRes?.data ?? []
if (!rcvList.length) {
errors.push(`入库单【${row.entry_order_code}】未找到对应收货单(单据编号:${receivingNumber})`)
continue
}
const rcv = rcvList[0]
const isCompleted = (rcv.status || '').toLowerCase() === 'completed'
const isAllMatched = (rcv.detail_status || '').toLowerCase() === 'all_matched'
if (!isCompleted) {
errors.push(`入库单【${row.entry_order_code}】对应收货单收货未完成(当前状态:${rcv.status || '未知'})`)
continue
}
if (!isAllMatched) {
errors.push(`入库单【${row.entry_order_code}】对应收货单明细匹配未完成(当前明细状态:${rcv.detail_status || '未全部匹配'})`)
continue
}
validRows.push({ entry: row, receivingId: rcv.id })
}
} finally {
if (!validRows.length || errors.length) {
quickPutawayLoading.value = false
}
}
if (errors.length) {
ElMessageBox.alert(errors.join('\n'), '校验未通过,无法快捷入库', { type: 'error' })
return
}
try {
await ElMessageBox.confirm(
`即将对以下 ${validRows.length} 条入库单执行快捷入库上架:\n${validRows.map(r => r.entry.entry_order_code).join('\n')}`,
'快捷入库确认',
{ type: 'warning', confirmButtonText: '确定入库', cancelButtonText: '取消' }
)
} catch {
quickPutawayLoading.value = false
return
}
quickPutawayLoading.value = true
const failList: string[] = []
try {
for (const { entry, receivingId } of validRows) {
try {
const res: any = await inventoryApi.quickPutaway({ receiving_id: receivingId })
if (!res || (res.code !== 200 && res.status !== 'success' && res.flag !== 'success')) {
failList.push(`${entry.entry_order_code}:${res?.message || res?.msg || '接口返回失败'}`)
}
} catch (e: any) {
failList.push(`${entry.entry_order_code}:${e?.message || '请求异常'}`)
}
}
if (failList.length) {
ElMessage.error(`${failList.length} 条入库单执行失败:\n${failList.join('\n')}`)
} else {
ElMessage.success(`${validRows.length} 条入库单快捷入库成功!`)
}
loadData()
} finally {
quickPutawayLoading.value = false
}
}
</script>
<style scoped lang="scss">

View File

@ -282,12 +282,13 @@ async function loadData() {
group_by_batch: groupByBatch.value
})
if (response && response.flag === 'success') {
list.value = formatTransactionData(response.list || [])
if (response.pagination) {
pagination.currentPage = response.pagination.page
pagination.pageSize = response.pagination.pageSize
pagination.total = response.pagination.total
if (response && (response.flag === 'success' || response.code === 200)) {
const payload = response.data || response
list.value = formatTransactionData(payload.list || [])
if (payload.pagination) {
pagination.currentPage = payload.pagination.page || pagination.currentPage
pagination.pageSize = payload.pagination.pageSize || pagination.pageSize
pagination.total = payload.pagination.total || 0
}
queryTime.value = Date.now() - start
} else {
@ -332,10 +333,11 @@ async function handleExport() {
group_by_batch: groupByBatch.value
})
if (response && response.flag === 'success' && response.list) {
const payload = response?.data || response
if ((response?.flag === 'success' || response?.code === 200) && payload?.list) {
// 生成CSV
const headers = ['商品ID', '库位ID', '仓库ID', '货主ID', '交易类型', '库存类型', '订单类型', '数量', '记录数', '首次创建时间', '最后创建时间', '操作人']
const rows = response.list.map((item: any) => [
const rows = payload.list.map((item: any) => [
item.stock_id,
item.space_id,
item.warehouse_id,
@ -344,9 +346,9 @@ async function handleExport() {
inventoryTypeMap[item.inventory_type] || item.inventory_type,
item.order_type,
item.quantity,
item.record_count,
item.first_created_at,
item.last_created_at,
item.record_count || 1,
item.first_created_at || item.created_at,
item.last_created_at || item.created_at,
item.operator_name || '-'
])

View File

@ -106,6 +106,9 @@ export const availableFields = [
export function formatTransactionData(data: any[]): any[] {
return data.map(item => ({
...item,
record_count: item.record_count ?? 1,
first_created_at: item.first_created_at || item.created_at,
last_created_at: item.last_created_at || item.created_at,
id: `${item.stock_id}-${item.space_id}-${item.transaction_type}`
}))
}

View File

@ -19,6 +19,7 @@
一键入库
</el-button>
<el-button size="small" :disabled="!hasSelection" @click="confirmBatchCancel">批量作废</el-button>
<el-button type="success" size="small" :disabled="selectionRows.length !== 1" :loading="quickPutawayLoading" @click="handleQuickPutaway">快捷入库</el-button>
<el-button type="info" size="small" icon="el-icon-printer" @click="handleOpenPrintDialog" title="打印收货单"
:disabled="!hasSelection" class="toolbar-btn">
打印收货单
@ -285,6 +286,7 @@ const activeTab = ref('details')
const list = ref<any[]>([])
const loading = ref(false)
const exportLoading = ref(false)
const quickPutawayLoading = ref(false)
const queryTime = ref(0)
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
@ -354,7 +356,7 @@ async function loadData() {
}
if (quickSearch.value) {
params.where = { ...(params.where || {}), receiving_number: quickSearch.value }
params.where.receiving_number = { operator: 'like', value: quickSearch.value, type: 'text' }
}
const res: any = await receivingApi.getReceivingList(params)
@ -399,54 +401,75 @@ async function loadFilterData() {
function normalizeToWhere(condition: any) {
if (!condition) return {}
// 如果是字符串或简单值,直接返回为搜索值
// 如果是字符串或简单值,直接返回为收货单号查询(默认模糊)
if (typeof condition === 'string' || typeof condition === 'number') {
return { receiving_number: condition }
return { receiving_number: { operator: 'like', value: condition, type: 'text' } }
}
// 获取字段定义的辅助函数
const getFieldConfig = (key: string) => {
return availableFields.find(f => f.value === key)
}
// 映射类型到规范格式
const mapType = (type: string, value: any) => {
if (type === 'daterange' || Array.isArray(value)) return 'daterange'
if (type === 'number' || typeof value === 'number') return 'number'
if (type === 'boolean' || typeof value === 'boolean') return 'boolean'
return 'text'
}
const processConditionValue = (k: string, c: any) => {
const config = getFieldConfig(k)
const fieldType = config?.type || 'text'
// 如果 c 本身已经是规范的对象结构 { value, operator, type }
if (c && typeof c === 'object' && !Array.isArray(c)) {
const op = c.operator || (fieldType === 'daterange' ? 'between' : 'eq')
const type = c.type || mapType(fieldType, c.value)
// isnull / isnotnull 无需值,直接传递
if (['isnull', 'isnotnull'].includes(op)) {
return { operator: op, value: null, type }
}
const val = c.value !== undefined ? c.value : c
// 空值跳过(非 isnull/isnotnull)
if (val === null || val === undefined || val === '' || (Array.isArray(val) && val.length === 0)) return null
// daterange 强制 type=daterange, operator=between
if (fieldType === 'daterange' || type === 'daterange') {
return { operator: 'between', value: val, type: 'daterange' }
}
return { operator: op, value: val, type }
}
// 简单空值跳过
if (c === null || c === undefined || c === '' || (Array.isArray(c) && c.length === 0)) return null
// 处理简单值
const simpleOp = fieldType === 'daterange' ? 'between' : 'eq'
const simpleType = mapType(fieldType, c)
return { operator: simpleOp, value: c, type: simpleType }
}
// 如果来自 ScanBox 的 preset(包含 conditions)
if (condition.conditions && typeof condition.conditions === 'object') {
const where: any = {}
Object.keys(condition.conditions).forEach(k => {
const c = condition.conditions[k]
// 如果条件对象包含operator和value,保留完整的条件结构
if (c && typeof c === 'object' && c.value !== undefined) {
where[k] = {
operator: c.operator || 'eq',
value: c.value,
type: c.type
}
} else if (c && c.value !== undefined) {
where[k] = c.value
} else {
where[k] = c
}
const result = processConditionValue(k, condition.conditions[k])
if (result) where[k] = result
})
return where
}
// 普通自定义条件对象,键 -> { value, operator, ... }
// 普通自定义条件对象,键 -> { value, operator, ... } 或 键 -> 简单值
if (typeof condition === 'object') {
const where: any = {}
Object.keys(condition).forEach(k => {
const c = condition[k]
// 如果是对象且包含operator和value,保留条件结构
if (c && typeof c === 'object' && c.value !== undefined && c.operator) {
where[k] = {
operator: c.operator,
value: c.value,
type: c.type
}
} else if (c && c.value !== undefined) {
// 如果只有value,使用默认operator(等于)
where[k] = {
operator: 'eq',
value: c.value,
type: c.type
}
} else {
where[k] = c
}
const result = processConditionValue(k, condition[k])
if (result) where[k] = result
})
return where
}
@ -1053,6 +1076,78 @@ function printReceiving() {
}
}
async function handleQuickPutaway() {
if (selectionRows.value.length !== 1) {
ElMessage.warning('请仅选择一条收货单进行快捷入库')
return
}
// 校验收货单状态:要求收货单已完成(completed)且所有明细已匹配系统商品(all_matched)
const errors: string[] = []
const validRows: any[] = []
selectionRows.value.forEach(row => {
const isCompleted = (row.status || '').toLowerCase() === 'completed'
const isAllMatched = (row.detail_status || '').toLowerCase() === 'all_matched'
if (!isCompleted) {
errors.push(`收货单【${row.receiving_number}】未完成(当前状态:${row.status || '未知'})`)
} else if (!isAllMatched) {
errors.push(`收货单【${row.receiving_number}】明细未全部匹配(当前明细状态:${row.detail_status || '未全部匹配'})`)
} else {
validRows.push(row)
}
})
if (errors.length > 0) {
ElMessageBox.alert(
`<div style="max-height: 300px; overflow: auto;">${errors.join('<br/>')}</div>`,
'校验未通过,无法快捷入库',
{ confirmButtonText: '确定', dangerouslyUseHTMLString: true, type: 'error' }
)
return
}
try {
await ElMessageBox.confirm(
`确定对选中的 ${validRows.length} 条收货单执行快捷入库上架吗?`,
'快捷入库确认',
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }
)
} catch {
return
}
quickPutawayLoading.value = true
const failList: string[] = []
try {
for (const row of validRows) {
try {
const res = await receivingApi.quickPutaway({ receiving_id: row.id })
if (!res || (res.code !== 200 && res.flag !== 'success' && res.status !== 'success')) {
failList.push(`${row.receiving_number}:${res?.message || res?.msg || '接口返回失败'}`)
}
} catch (e: any) {
failList.push(`${row.receiving_number}:${e?.message || '请求异常'}`)
}
}
if (failList.length > 0) {
ElMessageBox.alert(
`<div style="max-height: 300px; overflow: auto;">${failList.join('<br/>')}</div>`,
`${failList.length} 条收货单处理失败`,
{ confirmButtonText: '确定', dangerouslyUseHTMLString: true, type: 'error' }
)
} else {
ElMessage.success('选中的收货单已全部快捷入库成功')
}
loadData()
} finally {
quickPutawayLoading.value = false
}
}
async function handleExport() {
if (selectionRows.value.length === 0) {
ElMessage.warning('请先勾选要导出的收货单')

View File

@ -131,7 +131,7 @@ export const availableFields = [
label: '商品种类',
type: 'number',
placeholder: '请输入商品种类数',
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between'],
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between', 'notbetween', 'in', 'notin', 'isnull', 'isnotnull'],
defaultOperator: 'ge'
},
{
@ -139,7 +139,7 @@ export const availableFields = [
label: '总数量',
type: 'number',
placeholder: '请输入总数量',
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between'],
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between', 'notbetween', 'in', 'notin', 'isnull', 'isnotnull'],
defaultOperator: 'ge'
},
{
@ -147,7 +147,7 @@ export const availableFields = [
label: '总箱数',
type: 'number',
placeholder: '请输入总箱数',
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between'],
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between', 'notbetween', 'in', 'notin', 'isnull', 'isnotnull'],
defaultOperator: 'ge'
},
{
@ -155,7 +155,7 @@ export const availableFields = [
label: '总托盘数',
type: 'number',
placeholder: '请输入总托盘数',
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between'],
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between', 'notbetween', 'in', 'notin', 'isnull', 'isnotnull'],
defaultOperator: 'ge'
},
// 时间筛选

View File

@ -1,5 +1,8 @@
<template>
<div class="stockout-product-container">
<div v-if="orderInfo" class="order-info">
<span class="order-code">出库单号:{{ orderInfo.delivery_order_code }}</span>
</div>
<el-table
v-loading="loading"
:data="data"
@ -18,47 +21,68 @@
:fixed="col.fixed"
:align="col.align"
/>
<template #empty>
<div style="padding: 20px; color: #909399;">暂无商品明细</div>
</template>
</el-table>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, watch } from 'vue'
import { ref, watch } from 'vue'
import { ElMessage } from 'element-plus'
import { productColumns } from '../stockout-config'
import * as entryApi from '@/api/storage/entry'
import * as stockoutApi from '@/api/storage/stockout'
const props = defineProps<{
id: string | number
}>()
const data = ref([])
const data = ref<any[]>([])
const orderInfo = ref<any>(null)
const loading = ref(false)
const loadData = async () => {
if (!props.id) return
loading.value = true
data.value = []
orderInfo.value = null
try {
const res: any = await entryApi.getEntryDetail({ id: props.id })
const res: any = await stockoutApi.stockoutListItems({ id: Number(props.id) })
if (res && res.code === 200) {
// 假设详情中有 details 数组
data.value = res.data.details || []
orderInfo.value = res.data?.order || null
data.value = res.data?.items || []
} else {
ElMessage.error(res?.message || '加载商品明细失败')
}
} catch (error) {
console.error('加载商品明细失败', error)
ElMessage.error('加载商品明细失败')
} finally {
loading.value = false
}
}
watch(() => props.id, loadData, { immediate: true })
onMounted(loadData)
</script>
<style scoped lang="scss">
.stockout-product-container {
height: 100%;
padding: 10px;
display: flex;
flex-direction: column;
box-sizing: border-box;
.order-info {
padding: 6px 10px;
font-size: 13px;
color: #606266;
border-bottom: 1px solid #ebeef5;
background: #fafafa;
.order-code {
font-weight: 500;
}
}
}
</style>

View File

@ -24,7 +24,7 @@
</div>
<div class="toolbar-right">
<el-input size="small" placeholder="搜索出库单号" v-model="quickSearch" style="width:220px" @keyup.enter.native="onQuickSearch" />
<el-input size="small" placeholder="搜索出库单号" v-model="quickSearch" style="width:220px" @keyup.enter="onQuickSearch" />
</div>
</div>
@ -171,13 +171,13 @@ async function loadData() {
}
if (quickSearch.value) {
params.where = { ...(params.where || {}), entry_order_code: quickSearch.value }
params.where = { ...(params.where || {}), delivery_order_code: quickSearch.value }
}
const res: any = await stockoutApi.stockoutList(params)
if (res && res.code === 200) {
list.value = formatStockoutData(res.data.list || [])
pagination.currentPage = res.data.pagination?.currentPage || pagination.currentPage
pagination.currentPage = res.data.pagination?.page || pagination.currentPage
pagination.pageSize = res.data.pagination?.pageSize || pagination.pageSize
pagination.total = res.data.pagination?.total || 0
} else {

View File

@ -1,11 +1,15 @@
export const statusConfig = {
// status 实际值(接口存在拼写:pedding)
export const statusConfig: Record<string, { text: string; tagType: string }> = {
pedding: { text: '待出库', tagType: 'warning' },
pending: { text: '待出库', tagType: 'warning' },
processing: { text: '出库中', tagType: 'primary' },
completed: { text: '已完成', tagType: 'success' },
cancelled: { text: '已作废', tagType: 'danger' }
}
export const syncStatusConfig = {
// sync_status 实际值(接口存在拼写:padding)
export const syncStatusConfig: Record<string, { text: string; tagType: string }> = {
padding: { text: '待同步', tagType: 'info' },
pending: { text: '待同步', tagType: 'info' },
success: { text: '同步成功', tagType: 'success' },
failed: { text: '同步失败', tagType: 'danger' }
@ -30,67 +34,83 @@ export function formatDateTime(dateStr: string): string {
}
export const entryColums = [
{ prop: 'entry_order_code', label: '出库单号', width: '180', fixed: 'left' },
{ prop: 'delivery_order_code', label: '出库单号', width: '180', fixed: 'left' },
{ prop: 'status', label: '出库状态', width: '100', align: 'center' },
{ prop: 'order_type', label: '单据类型', width: '120' },
{ prop: 'store_name', label: '货主', width: '120' },
{ prop: 'total_order_lines', label: '商品种类', width: '100', align: 'right' },
{ prop: 'supplier_name', label: '收货方', width: '150' },
{ prop: 'logistics_name', label: '物流公司', width: '120' },
{ prop: 'express_code', label: '运单号', width: '150' },
{ prop: 'sync_status', label: '同步状态', width: '100', align: 'center' },
{ prop: 'order_create_time', label: '下单时间', width: '160', sortable: true, formatter: (row: any) => formatDateTime(row.order_create_time) },
{ prop: 'expect_start_time', label: '预计开始', width: '160', sortable: true, formatter: (row: any) => formatDateTime(row.expect_start_time) },
{ prop: 'expect_end_time', label: '预计结束', width: '160', sortable: true, formatter: (row: any) => formatDateTime(row.expect_end_time) },
{ prop: 'source_type', label: '来源', width: '100' },
{ prop: 'remark', label: '备注', minWidth: '150' }
{ prop: 'order_type', label: '单据类型', width: '100' },
{ prop: 'source_platform_name', label: '来源平台', width: '110' },
{ prop: 'buyer_nick', label: '买家', width: '130' },
{ prop: 'name', label: '收货人', width: '100' },
{ prop: 'mobile', label: '联系电话', width: '130' },
{ prop: 'logistics_name', label: '物流公司', width: '130' },
{ prop: 'express_code', label: '运单号', width: '150' },
{ prop: 'items_count', label: '商品种类', width: '90', align: 'right' },
{ prop: 'items_total', label: '商品总数', width: '90', align: 'right' },
{ prop: 'place_order_time', label: '下单时间', width: '160', sortable: true, formatter: (row: any) => formatDateTime(row.place_order_time) },
{ prop: 'updated_at', label: '更新时间', width: '160', sortable: true, formatter: (row: any) => formatDateTime(row.updated_at) }
]
export const availableFields = [
{ value: 'entry_order_code', label: '出库单号', type: 'text' },
{ value: 'status', label: '出库状态', type: 'select', options: Object.entries(statusConfig).map(([v, c]) => ({ value: v, label: c.text })) },
{ value: 'delivery_order_code', label: '出库单号', type: 'text' },
{ value: 'status', label: '出库状态', type: 'select', options: [
{ value: 'pedding', label: '待出库' },
{ value: 'processing', label: '出库中' },
{ value: 'completed', label: '已完成' },
{ value: 'cancelled', label: '已作废' }
]},
{ value: 'sync_status', label: '同步状态', type: 'select', options: [
{ value: 'padding', label: '待同步' },
{ value: 'success', label: '同步成功' },
{ value: 'failed', label: '同步失败' }
]},
{ value: 'store_id', label: '货主', type: 'select', filterable: true, options: [] },
{ value: 'order_type', label: '单据类型', type: 'select', options: [
{ label: '销售出库', value: 'SALE' },
{ label: '交易出库', value: 'JYCK' },
{ label: '调拨出库', value: 'TRANSFER' },
{ label: '退货出库', value: 'RETURN' },
{ label: '其他出库', value: 'OTHER' }
]},
{ value: 'sync_status', label: '同步状态', type: 'select', options: Object.entries(syncStatusConfig).map(([v, c]) => ({ value: v, label: c.text })) },
{ value: 'logistics_name', label: '物流公司', type: 'text' },
{ value: 'buyer_nick', label: '买家', type: 'text' },
{ value: 'mobile', label: '联系电话', type: 'text' },
{ value: 'logistics_code', label: '物流公司', type: 'text' },
{ value: 'express_code', label: '运单号', type: 'text' },
{ value: 'order_create_time', label: '下单时间', type: 'daterange', startPlaceholder: '开始时间', endPlaceholder: '结束时间' },
{ value: 'remark', label: '备注', type: 'text' }
{ value: 'place_order_time', label: '下单时间', type: 'daterange', startPlaceholder: '开始时间', endPlaceholder: '结束时间' }
]
// 详情面板表单配置
export const detailpanel = [
{ prop: 'entry_order_code', label: '出库单号', type: 'input', disabled: true },
{ prop: 'store_name', label: '货主', type: 'input', disabled: true },
{ prop: 'status', label: '出库状态', type: 'select', disabled: true },
{ prop: 'delivery_order_code', label: '出库单号', type: 'input', disabled: true },
{ prop: 'order_type', label: '单据类型', type: 'input', disabled: true },
{ prop: 'supplier_name', label: '收货方', type: 'input' },
{ prop: 'status', label: '出库状态', type: 'select', disabled: true },
{ prop: 'source_platform_name', label: '来源平台', type: 'input', disabled: true },
{ prop: 'buyer_nick', label: '买家', type: 'input', disabled: true },
{ prop: 'name', label: '收货人', type: 'input', disabled: true },
{ prop: 'mobile', label: '联系电话', type: 'input', disabled: true },
{ prop: 'logistics_name', label: '物流公司', type: 'input' },
{ prop: 'express_code', label: '运单号', type: 'input' },
{ prop: 'total_order_lines', label: '商品种类', type: 'number', disabled: true },
{ prop: 'remark', label: '备注', type: 'textarea' }
{ prop: 'province', label: '省', type: 'input', disabled: true },
{ prop: 'city', label: '市', type: 'input', disabled: true },
{ prop: 'detail_address', label: '详细地址', type: 'input', disabled: true }
]
export const productColumns = [
{ prop: 'product_name', label: '商品名称', width: '180', fixed: 'left' },
{ prop: 'barcode', label: '条码', width: '150' },
{ prop: 'spec', label: '规格', width: '120' },
{ prop: 'plan_quantity', label: '计划数量', width: '100', align: 'right' },
{ prop: 'actual_quantity', label: '实际出库', width: '100', align: 'right' },
{ prop: 'batch_number', label: '批次', width: '120' },
{ prop: 'remark', label: '备注', minWidth: '150' }
{ prop: 'item_code', label: '商品编码', width: '150', fixed: 'left' },
{ prop: 'item_name', label: '商品名称', minWidth: '180' },
{ prop: 'sku_property', label: '规格', width: '120' },
{ prop: 'barcode', label: '条码', width: '140' },
{ prop: 'plan_qty', label: '计划数量', width: '100', align: 'right' },
{ prop: 'actual_qty', label: '实际出库', width: '100', align: 'right' },
{ prop: 'stock_unit', label: '单位', width: '80' },
{ prop: 'batch_no', label: '批次号', width: '130' },
{ prop: 'remark', label: '备注', minWidth: '120' }
]
export function formatStockoutData(list: any[] = []) {
return (list || []).map(item => ({
...item,
// 可以在这里做一些数据映射或格式化
status: item.status || item.order_status || 'pending',
sync_status: item.sync_status || 'pending'
status: item.status || 'pedding',
sync_status: item.sync_status || 'padding',
// 接口返回 create_at,统一为 created_at
created_at: item.created_at || item.create_at
}))
}

View File

@ -783,8 +783,11 @@ async function loadList() {
const res = await storeWarehouseList(params) as any
if (res?.data) {
list.value = res.data.list || []
pagination.total = res.data.total || 0
const payload = res.data
list.value = payload.list || []
pagination.total = payload.pagination?.total || payload.total || 0
pagination.currentPage = payload.pagination?.page || pagination.currentPage
pagination.pageSize = payload.pagination?.pageSize || pagination.pageSize
}
} catch (e) {
ElMessage.error('获取列表失败')

View File

@ -242,12 +242,17 @@ const filteredTreeData = computed(() => {
let filtered: any[] = []
for (const node of nodes) {
const isMatch = node.type === currentType.value
let matchedChildren = []
let matchedChildren: any[] = []
if (node.children && node.children.length > 0) {
matchedChildren = filterNodes(node.children)
}
if (isMatch || matchedChildren.length > 0) {
if (isMatch) {
// node 类型匹配,保留此节点并将匹配到的子节点作为 children
filtered.push({ ...node, children: matchedChildren.length > 0 ? matchedChildren : undefined })
} else if (matchedChildren.length > 0) {
// node 本身类型不匹配,但其子节点有匹配的,提升匹配的子节点为当前层级
filtered.push(...matchedChildren)
}
}
return filtered

View File

@ -20,7 +20,7 @@
批量删除
</el-button>
<el-dropdown v-if="hasPermission('stock.saveWarehouseStock')" @command="handleBatchChange">
<!-- <el-dropdown v-if="hasPermission('stock.saveWarehouseStock')" @command="handleBatchChange">
<el-button type="primary" :disabled="!hasSelection" size="small">
<el-icon>
<Edit />
@ -39,7 +39,7 @@
<el-dropdown-item command="managementFlags">管理标识</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</el-dropdown> -->
</template>
<el-button v-if="hasPermission('warehouseExport')" type="success" size="small" :icon="Download"

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,796 @@
出库单模块
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)
名称 类型 必填 说明
@ -10,3 +803,62 @@ 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
}