This commit is contained in:
yin 2026-04-09 09:01:20 +08:00
parent af865de6fc
commit 3dbd7d43b1
23 changed files with 2364 additions and 528 deletions

Binary file not shown.

View File

@ -135,3 +135,18 @@ export function getExpressList(){
isSystemApi: true
} as any)
}
/** 查询所有已启用的接口类型列表(无需权限,仅需登录) */
export function listInterfaceTypes() {
return request({
url: '/system',
method: 'post',
params: {
method: 'index.listInterfaceTypes',
v: '1.0',
timestamp: new Date().getTime()
},
data: {},
isSystemApi: true
} as any)
}

View File

@ -326,6 +326,20 @@ export function backData(data: any) {
} as any)
}
export function getStockDetail(stock_id: number, pagination?: { page: number; pageSize: number }) {
return request({
url: '/system',
method: 'post',
params: {
method: 'stock.warehouse.getStockDetail',
v,
timestamp: new Date().getTime()
},
data: { stock_id, ...(pagination ? { pagination } : {}) },
isSystemApi: true
} as any)
}
// 已弃用
// export function warehouseSearch(data:any) {
// return request({

View File

@ -0,0 +1,41 @@
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({
url: '/system',
method: 'post',
params: {
method: 'storage.inventory.list',
v,
timestamp: new Date().getTime()
},
data,
isSystemApi: true
} as any)
}

View File

@ -0,0 +1,37 @@
import request from '@/utils/request'
const v = "1.0"
/**
* 出入库记录列表查询
* 支持where条件、分页、排序、批次分组切换。
* 默认按库位合并数量(合并模式),group_by_batch=true时返回每条明细(明细模式)
*/
export function getTransactionList(data: {
/** 统一where条件对象,可用字段:transaction_type(INBOUND/OUTBOUND)、stock_id、space_id、store_id、order_type(SCRK/MATCH)、order_no、inventory_type(ZP/CC/JS/XS/ZT/DJ/FP)、operator_name、created_at(支持between) */
where?: Record<string, any>
/** 分页参数,默认page=1, pageSize=20 */
pagination?: {
page?: number
pageSize?: number
}
/** 排序参数,默认sortField='created_at', sortOrder='DESC' */
sort?: {
sortField?: string
sortOrder?: string
}
/** 是否按批次查询,默认false。false=合并模式(按库位+商品聚合),true=明细模式(逐条返回) */
group_by_batch?: boolean
}): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'storage.transaction.list',
v,
timestamp: new Date().getTime()
},
data,
isSystemApi: true
} as any)
}

View File

@ -131,10 +131,14 @@ export function storeWarehouseSavePolicyConfig(data: {
} as any)
}
/** 人工调整签约关系下的面单余额并记录变更日志 */
/**
* 设置签约关系下的面单目标余额(覆盖写入,非增减量)并记录变更日志。
* 兼容字段名:target_quantity / print_quantity / change_quantity / adjust_quantity,均解释为目标余额。
*/
export function storeWarehouseAdjustPrintQuantity(data: {
id: number
change_quantity: number
/** 目标面单余额(覆盖当前余额,非增减量) */
target_quantity: number
reason: string
business_type?: string
business_id?: number
@ -172,12 +176,14 @@ export function listApiConfig(data: {
}
/** 保存接口配置(新增或更新)
* - app_name:必传,不再自动生成
* - QM_WMS 类型:须填写 qimen_app_key / qimen_customer_id / qimen_warehouse_code
* - OPEN_API 类型:系统自动生成 self_app_key / self_app_secret,无需传入奇门字段
* - OPEN_API 类型:系统自动生成 self_app_key(WMS+32位HEX)和 self_app_secret(64位HEX),无需传入奇门字段
*/
export function saveApiConfig(data: {
id: number
interface_type_id: number
/** 应用名称(必传,不再自动生成) */
app_name: string
qimen_app_key?: string
qimen_customer_id?: string

View File

@ -20,7 +20,5 @@ export const componentMap: Record<string, any> = {
'system/setting/printTemplate/index': () => import('@/views/system/setting/printTemplate/index.vue'),
// 'system/setting/printStation/index': () => import('@/views/system/setting/printStation/index.vue'),
'system/print/station': () => import('@/views/system/setting/printStation/index.vue'),
// 'system/StoreManagement/station2': () => import('@/views/system/setting/printStation/index2.vue'),
// 'system/setting/printStation': () => import('@/views/system/setting/printStation/index.vue'),
// 'admin/land': () => import('@/views/admin/land/index.vue')
'storage/log': () => import('@/views/storage/log/index.vue'),
};

View File

@ -1,2 +1,166 @@
接口文档更新:
[{"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-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",
"method": "storage.inventory.transferByProduct",
"type": "added",
"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。"
}
]

View File

@ -2,11 +2,12 @@
<div class="upper-table-container">
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="120px" :disabled="loading">
<!-- 货主 -->
<!-- <el-form-item label="货主" prop="store_id" title="商品归属货主">
<el-select v-model="formData.store_id" filterable clearable style="width: 100%;" placeholder="请选择货主">
<el-form-item label="货主" prop="store_id" title="商品归属货主">
<el-input v-if="storeDisabled" :model-value="storeDisplayName" disabled style="width: 100%;" />
<el-select v-else v-model="formData.store_id" filterable clearable style="width: 100%;" placeholder="请选择货主">
<el-option v-for="option in stores" :key="option.value" :label="option.label" :value="option.value" />
</el-select>
</el-form-item> -->
</el-form-item>
<!-- 商品名称 -->
<el-form-item label="商品名称" prop="item_name">
@ -287,7 +288,7 @@
</template>
<script setup lang="ts">
import { ref, reactive, watch, onMounted, nextTick } from 'vue'
import { ref, reactive, watch, onMounted, nextTick, computed } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Check, Refresh, InfoFilled, Plus } from '@element-plus/icons-vue'
import * as stockApi from '@/api/stock'
@ -336,10 +337,20 @@ const newProhibitedLevel = ref(1)
const formData = reactive(JSON.parse(JSON.stringify(stockDefaultFormData)))
// 货主展示名称(storeDisabled=true 时用于只读展示)
const storeDisplayName = computed(() => {
if (props.initialStore) {
return props.initialStore.name || props.initialStore.store_name || String(props.initialStore.id || props.initialStore.store_id || '')
}
const match = (props.stores as any[]).find(s => s.value === formData.store_id)
return match?.label || String(formData.store_id || '')
})
// 若父组件传入初始货主,则使用并锁定
watch(() => props.initialStore, (val) => {
if (val) {
formData.store_id = val.id || val.store_id || val.storeId
formData.store_name = val.name || val.store_name || ''
}
}, { immediate: true })

View File

@ -1,113 +1,235 @@
<template>
<div class="container">
<!-- 商品概要信息 -->
<div v-if="stockItem" class="stock-summary">
<span class="summary-item"><b>商品编码:</b>{{ stockItem.item_code }}</span>
<span class="summary-item"><b>商品名称:</b>{{ stockItem.item_name }}</span>
<span v-if="stockItem.sku_property" class="summary-item"><b>规格:</b>{{ stockItem.sku_property }}</span>
<span class="summary-item"><b>总数量:</b>{{ stockItem.quantity }} {{ stockItem.stock_unit }}</span>
<span class="summary-item"><b>锁定数量:</b>{{ stockItem.locked_quantity }}</span>
</div>
<!-- 工具栏 -->
<el-button-group class="toolbar-btn-group">
<el-button
type="primary"
size="small"
icon="Refresh"
@click="loadData"
<el-button
type="primary"
size="small"
:icon="Refresh"
@click="loadData"
title="刷新"
:loading="loading"
:loading="loading"
class="toolbar-btn"
>
刷新
</el-button>
<el-button
type="success"
size="small"
icon="Download"
@click="goToStorageLog"
title="库存流水"
class="toolbar-btn"
>
库存流水
</el-button>
</el-button-group>
<!-- 明细表格 -->
<el-table
:data="tableData"
border
style="width: 100%; height: 100%"
height="100%"
style="width: 100%"
flex="1"
v-loading="loading"
size="small"
>
<el-table-column
fixed
prop="zone_name"
label="库区"
width="150"
/>
<el-table-column
prop="location_code"
prop="space"
label="库位"
width="160"
>
<template #default="{ row }">
<span v-if="row.space">
{{ row.space.space_code }}
<span v-if="row.space.custom_name" class="custom-name">({{ row.space.custom_name }})</span>
</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column
prop="batch_no"
label="批次"
width="120"
>
<template #default="{ row }">{{ row.batch_no ?? '-' }}</template>
</el-table-column>
<el-table-column
prop="inventory_type"
label="库存类型"
width="90"
/>
<el-table-column
prop="quantity"
label="数量"
width="80"
/>
<el-table-column
prop="batch_no"
label="批次"
prop="locked_quantity"
label="锁定数量"
width="80"
/>
<el-table-column
prop="available_quantity"
label="可用数量"
width="80"
/>
<el-table-column
prop="production_date"
label="生产日期"
/>
width="110"
>
<template #default="{ row }">{{ row.production_date ?? '-' }}</template>
</el-table-column>
<el-table-column
prop="expiration_date"
label="过期日期"
/>
prop="expiry_date"
label="到期日期"
width="110"
>
<template #default="{ row }">{{ row.expiry_date ?? '-' }}</template>
</el-table-column>
<el-table-column
prop="stock_type"
label="库存类型"
/>
prop="inbound_order_no"
label="入库单号"
width="160"
>
<template #default="{ row }">{{ row.inbound_order_no ?? '-' }}</template>
</el-table-column>
<el-table-column
prop="supplier_batch_no"
label="供应商批次"
width="120"
>
<template #default="{ row }">{{ row.supplier_batch_no ?? '-' }}</template>
</el-table-column>
<el-table-column
prop="inbound_time"
label="入库时间"
min-width="160"
>
<template #default="{ row }">{{ row.inbound_time ?? '-' }}</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
v-if="pagination.total > 0"
class="pagination"
small
background
layout="total, prev, pager, next"
:total="pagination.total"
:page-size="pagination.pageSize"
:current-page="pagination.page"
@current-change="handlePageChange"
/>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { Refresh, Download } from '@element-plus/icons-vue'
// import * as stockApi from '@/api/stock'
import { ref, reactive, watch, onMounted } from 'vue'
import { Refresh } from '@element-plus/icons-vue'
import * as stockApi from '@/api/stock'
const props = defineProps<{
id?: number | string | null
}>()
const router = useRouter()
const loading = ref(false)
const tableData = ref<any[]>([])
const stockItem = ref<any>(null)
function loadData() {
const pagination = reactive({
page: 1,
pageSize: 20,
total: 0
})
async function loadData() {
if (!props.id) {
tableData.value = []
stockItem.value = null
return
}
loading.value = true
// 暂无库存详情接口,保持与Vue2一致
setTimeout(() => {
try {
const res = await stockApi.getStockDetail(Number(props.id), {
page: pagination.page,
pageSize: pagination.pageSize
})
if (res && res.data) {
tableData.value = res.data.storageList || []
stockItem.value = res.data.stockItem || null
if (res.data.pagination) {
pagination.total = res.data.pagination.total
}
}
} catch (error) {
console.error(error)
} finally {
loading.value = false
}, 500)
}
}
function goToStorageLog() {
router.push('/storage/log')
function handlePageChange(page: number) {
pagination.page = page
loadData()
}
function handleClick(row: any) {
console.log(row)
}
watch(
() => props.id,
(val) => {
if (val) {
pagination.page = 1
loadData()
} else {
tableData.value = []
stockItem.value = null
}
},
{ immediate: true }
)
</script>
<style scoped lang="scss">
.container {
height: 100%;
padding: 10px;
overflow: hidden;
overflow: auto;
display: flex;
flex-direction: column;
gap: 6px;
}
.stock-summary {
display: flex;
flex-wrap: wrap;
gap: 16px;
padding: 6px 10px;
background: #f5f7fa;
border: 1px solid #ebeef5;
border-radius: 4px;
font-size: 13px;
.summary-item {
color: #606266;
}
}
.toolbar-btn-group {
margin-bottom: 5px;
flex-shrink: 0;
}
.el-table {
flex: 1;
}
.custom-name {
color: #909399;
font-size: 12px;
}
.pagination {
flex-shrink: 0;
justify-content: flex-end;
}
</style>

View File

@ -425,6 +425,7 @@ export const stockBatchConfig = {
export const stockDefaultFormData = {
item_code: '',
store_id: undefined as number | undefined,
store_name: '',
barcode: '',
item_name: '',
sku_property: '',

View File

@ -5,6 +5,7 @@ export const availableFields = [
{ label: '已创建', value: 'CREATED' },
{ label: '待入库', value: 'PENDING' },
{ label: '入库中', value: 'PARTIAL' },
{ label: '部分收货', value: 'PARTIAL_RECEIVED' },
{ label: '已完成', value: 'COMPLETED' },
{ label: '已取消', value: 'CANCELLED' },
]},
@ -13,6 +14,12 @@ export const availableFields = [
{ label: '退货入库', value: 'THRK' },
{ label: '其他入库', value: 'QTRK' },
{ label: '盘点入库', value: 'PDRK' },
{ label: '生产入库', value: 'SCRK' },
{ label: '领用入库', value: 'LYRK' },
{ label: '拆解入库', value: 'CCRK' },
{ label: '调拨入库', value: 'DBRK' },
{ label: 'B2B入库', value: 'B2BRK' },
{ label: '虚拟入库', value: 'XNRK' },
]},
{ label: '同步状态', value: 'sync_status', type: 'select', options: [
{ label: '待推送', value: 'PENDING' },

View File

@ -198,6 +198,7 @@ function getStatusType(status: string) {
'CREATED': 'info',
'PENDING': 'warning',
'PARTIAL': 'primary',
'PARTIAL_RECEIVED': 'primary',
'COMPLETED': 'success',
'CANCELLED': 'danger'
}
@ -236,9 +237,9 @@ async function loadData() {
let useMock = false
try {
const res = await entryApi.getEntryList(params)
if (res && res.code === 200 && res.data && res.data.length > 0) {
list.value = res.data
pagination.total = res.total || res.data.length
if (res && res.code === 200 && res.data?.list && res.data.list.length > 0) {
list.value = res.data.list
pagination.total = res.data.pagination?.total || res.data.list.length
} else {
useMock = true
console.log('API未返回数据,准备使用模拟数据')

View File

@ -1,49 +1,33 @@
export const availableFields = [
{ label: '入库单号', value: 'entry_order_code', type: 'input' },
{ label: '商品ID', value: 'stock_id', type: 'input' },
{ label: '库位名称', value: 'space_id', type: 'input' },
{ label: '货主', value: 'store_id', type: 'select', options: [] },
{ label: '状态', value: 'order_status', type: 'select', options: [
{ label: '待处理', value: 'CREATED' },
{ label: '已完成', value: 'COMPLETED' },
{ label: '已关闭', value: 'CLOSED' },
{ label: '已取消', value: 'CANCELLED' }
{ label: '库存类型', value: 'inventory_type', type: 'select', options: [
{ label: '正品', value: 'ZP' },
{ label: '次品', value: 'CC' },
{ label: '机损', value: 'JS' },
{ label: '箱损', value: 'XS' },
{ label: '在途', value: 'ZT' },
{ label: '冻结', value: 'DJ' },
{ label: '分配', value: 'FP' }
]},
{ label: '业务类型', value: 'order_type', type: 'select', options: [
{ label: '采购入库', value: 'CGRK' },
{ label: '退货入库', value: 'THRK' },
{ label: '调拨入库', value: 'DBRK' },
{ label: '盘盈入库', value: 'PYRK' },
{ label: '其他入库', value: 'QTRK' }
]},
{ label: '供应商', value: 'supplier_name', type: 'input' },
{ label: '运单号', value: 'express_code', type: 'input' },
{ label: '单据编号', value: 'purchase_order_code', type: 'input' },
{ label: '是否同步', value: 'sync_status', type: 'select', options: [
{ label: '同步成功', value: 'SUCCESS' },
{ label: '等待同步', value: 'PENDING' },
{ label: '同步失败', value: 'FAIL' }
]},
{ label: '数据来源', value: 'source_type', type: 'select', options: [
{ label: '奇门', value: 'QM' },
{ label: '手工创建', value: 'MANUAL' },
{ label: '接口导入', value: 'API' }
]},
{ label: '创建日期', value: 'create_time_range', type: 'daterange' }
{ label: '批次号', value: 'batch_no', type: 'input' },
{ label: '入库单号', value: 'inbound_order_no', type: 'input' },
{ label: '创建日期', value: 'created_at', type: 'daterange' }
]
export const productstockColums = [
{ prop: 'id', label: 'ID', width: '80' },
{ prop: 'entry_order_code', label: '入库单号', width: '180' },
{ prop: 'stock_id', label: '商品ID', width: '100' },
{ prop: 'item_code', label: '商品编码', width: '150' },
{ prop: 'item_name', label: '商品名称', width: '200' },
{ prop: 'space_code', label: '库位名称', width: '150' },
{ prop: 'store_name', label: '货主', width: '120' },
{ prop: 'order_type', label: '业务类型', width: '100' },
{ prop: 'purchase_order_code', label: '单据编号', width: '150' },
{ prop: 'order_status', label: '状态', width: '100' },
{ prop: 'total_order_lines', label: '物料种数', width: '100' },
{ prop: 'supplier_name', label: '供应商', width: '150' },
{ prop: 'logistics_name', label: '物流公司', width: '120' },
{ prop: 'express_code', label: '运单号', width: '150' },
{ prop: 'order_create_time', label: '创建时间', width: '160' },
{ prop: 'sync_status', label: '同步状态', width: '100' },
{ prop: 'source_type', label: '数据来源', width: '100' }
{ prop: 'inventory_type', label: '库存类型', width: '100' },
{ prop: 'quantity', label: '总数量', width: '100' },
{ prop: 'available_quantity', label: '可用数量', width: '100' },
{ prop: 'locked_quantity', label: '锁定数量', width: '100' },
{ prop: 'last_inbound_time', label: '最后入库时间', width: '160' },
{ prop: 'batch_count', label: '批次数', width: '80' }
]
export const productstockDetail = [

View File

@ -20,6 +20,7 @@
<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">
@ -46,6 +47,12 @@
@refresh="loadData"
@selection-change="onSelectionChange"
>
<template #column-order_status="{ row }">
<el-tag v-if="row.order_status" size="small" :type="orderStatusTagType(row.order_status)">
{{ orderStatusLabel(row.order_status) }}
</el-tag>
</template>
<template #column-status="{ row }">
<el-tag v-if="row.status" size="small">
{{ row.status }}
@ -93,8 +100,9 @@ import { ElMessage, ElMessageBox } 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 entryApi from '@/api/storage/entry'
import * as stockApi from '@/api/storage/stock'
// import * as entryApi from '@/api/storage/entry'
import * as inventoryApi from '@/api/storage/inventory'
import * as receivingApi from '@/api/storage/receiving'
import {
availableFields,
@ -115,6 +123,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 })
@ -149,115 +158,48 @@ async function loadData() {
loading.value = true
const start = Date.now()
// 备用模拟数据(当接口不可用时使用)
const mockData = [
{
id: 90,
entry_order_code: '2885-2011062548597596161',
store_name: '花颜物语',
order_type: 'CGRK',
purchase_order_code: 'PO2026011301',
order_status: 'COMPLETED',
total_order_lines: 5,
supplier_name: '广州美妆供应链',
logistics_name: '顺丰速运',
express_code: 'SF123456789',
order_create_time: '2026-01-13 13:07:36',
sync_status: 'SUCCESS',
source_type: 'QM',
status: '已完成'
},
{
id: 93,
entry_order_code: '2885-2011043642256453634',
store_name: '花颜物语',
order_type: 'CGRK',
purchase_order_code: 'PO2026011302',
order_status: 'COMPLETED',
total_order_lines: 3,
supplier_name: '上海精化有限公司',
logistics_name: '圆通快递',
express_code: 'YT987654321',
order_create_time: '2026-01-13 13:17:13',
sync_status: 'SUCCESS',
source_type: 'QM',
status: '已完成'
},
{
id: 95,
entry_order_code: 'CGW2601201120',
store_name: '花颜物语',
order_type: 'CGRK',
purchase_order_code: 'PO2026012011',
order_status: 'COMPLETED',
total_order_lines: 12,
supplier_name: 'NBBT30',
logistics_name: '中通快递',
express_code: 'ZT20260120',
order_create_time: '2026-01-20 12:48:05',
sync_status: 'SUCCESS',
source_type: 'QM',
status: '已完成'
},
{
id: 97,
entry_order_code: '2885-2021923981203890178',
store_name: '花颜物语',
order_type: 'CGRK',
purchase_order_code: 'PO2026021201',
order_status: 'CREATED',
total_order_lines: 8,
supplier_name: '武汉贸易中心',
logistics_name: '邮政EMS',
express_code: 'EMS666888',
order_create_time: '2026-02-12 12:27:01',
sync_status: 'PENDING',
source_type: 'QM',
status: '待入库'
}
]
try {
const params: any = {
pagination: { page: pagination.currentPage, pageSize: pagination.pageSize },
where: scanBox.value?.getConditions?.() || {}
}
// 适配库存模块的搜索字段
if (quickSearch.value) {
params.where = { ...(params.where || {}), entry_order_code: quickSearch.value }
params.where = { ...(params.where || {}), stock_id: quickSearch.value }
}
const res: any = await stockApi.getinventoryList(params)
if (res && (res.code === 200 || res.status === 'success') && res.data) {
// 优先使用后端返回的数据,做最小结构映射以兼容前端列定义
const rows = Array.isArray(res.data.list) ? res.data.list : (res.data || [])
const res: any = await inventoryApi.getInventoryList(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,
entry_order_code: item.entry_order_code || item.entry_order_code || item.code || '',
store_name: item.store_name || item.store || '',
order_type: item.order_type || item.type || '',
purchase_order_code: item.purchase_order_code || item.purchase_code || '',
order_status: item.order_status || item.status || '',
total_order_lines: item.total_order_lines || item.total_lines || item.lines || 0,
supplier_name: item.supplier_name || item.supplier || '',
logistics_name: item.logistics_name || item.logistics || '',
express_code: item.express_code || item.tracking_no || '',
order_create_time: item.order_create_time || item.create_time || item.created_at || '',
sync_status: item.sync_status || item.sync || '',
source_type: item.source_type || item.source || '',
status: item.display_status || (item.order_status === 'COMPLETED' ? '已完成' : item.order_status || '')
id: item.stock_id + '-' + item.space_id, // 复合 ID
stock_id: item.stock_id,
item_code: item.stock?.item_code || '',
item_name: item.stock?.item_name || '',
space_code: item.space?.space_code || item.space?.custom_name || '',
store_name: item.store?.company_name || item.store_id || '',
inventory_type: item.inventory_type,
quantity: item.quantity,
available_quantity: item.available_quantity,
locked_quantity: item.locked_quantity,
last_inbound_time: item.last_inbound_time,
batch_count: item.batch_count
}))
pagination.currentPage = res.data.pagination?.currentPage || pagination.currentPage
pagination.pageSize = res.data.pagination?.pageSize || pagination.pageSize
pagination.total = res.data.pagination?.total || res.data.total || list.value.length
const pager = data.pagination || {}
pagination.total = pager.total || data.total || list.value.length
} else {
// 接口未返回预期结构,回退到模拟数据
list.value = mockData
pagination.total = mockData.length
list.value = []
pagination.total = 0
}
} catch (e) {
console.error('获取入库单列表失败,使用模拟数据', e)
ElMessage.error('加载入库单失败,已使用本地模拟数据')
list.value = mockData
pagination.total = mockData.length
console.error('获取库存列表失败', e)
ElMessage.error('加载库存列表失败')
list.value = []
pagination.total = 0
} finally {
loading.value = false
queryTime.value = Date.now() - start
@ -354,6 +296,121 @@ async function handleExport() {
function handleImport() {
ElMessage.info('导入功能')
}
// 状态翻译映射
const ORDER_STATUS_MAP: Record<string, string> = {
CREATED: '待处理',
CREATING: '创建中',
PARTIAL_RECEIVED: '部分入库',
COMPLETED: '已完成',
CANCELLED: '已取消',
CLOSED: '已关闭',
PENDING: '待处理',
WAITING: '等待中'
}
const ORDER_STATUS_TAG: Record<string, string> = {
COMPLETED: 'success',
PARTIAL_RECEIVED: 'warning',
CREATED: 'info',
CREATING: 'info',
CANCELLED: 'danger',
CLOSED: 'danger'
}
function orderStatusLabel(val: string) {
return ORDER_STATUS_MAP[val] || val
}
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

@ -0,0 +1,505 @@
<template>
<div class="transaction-log-container" :style="{ height: containerHeight }">
<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>
<el-checkbox v-model="groupByBatch" @change="loadData">按批次分组</el-checkbox>
</div>
</div>
<div class="upper-wrapper">
<upper-table
ref="upperTable"
title="出入库记录列表"
:data="list"
:columns="columns"
:table-size="tableSize"
:pagination="pagination"
:show-index="true"
:loading="loading"
:queryTime="queryTime"
@current-change="handleRowClick"
@page-change="handlePageChange"
@page-size-change="handlePageSizeChange"
@refresh="loadData"
>
<template #column-transaction_type="{ row }">
<el-tag
:type="row.transaction_type === 'INBOUND' ? 'success' : 'danger'"
size="small"
>
{{ row.transaction_type === 'INBOUND' ? '入库' : '出库' }}
</el-tag>
</template>
<template #column-inventory_type="{ row }">
<el-tag size="small">{{ inventoryTypeMap[row.inventory_type] || row.inventory_type }}</el-tag>
</template>
<template #empty>
<div class="empty-tip">暂无出入库记录</div>
</template>
</upper-table>
</div>
<div class="lower-level" v-if="selectedLogId" :class="tableSize">
<div class="detail-header">
<div class="detail-info">
<span class="detail-title">出入库记录详情</span>
</div>
</div>
<div class="detail-container">
<el-descriptions :data="selectedRowData" size="small" border :column="2">
<el-descriptions-item label="交易类型">
<el-tag
:type="selectedRowData.transaction_type === 'INBOUND' ? 'success' : 'danger'"
size="small"
>
{{ selectedRowData.transaction_type === 'INBOUND' ? '入库' : '出库' }}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="库存类型">
<el-tag size="small">{{ inventoryTypeMap[selectedRowData.inventory_type] || selectedRowData.inventory_type }}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="商品ID">{{ selectedRowData.stock_id }}</el-descriptions-item>
<el-descriptions-item label="库位ID">{{ selectedRowData.space_id }}</el-descriptions-item>
<el-descriptions-item label="仓库ID">{{ selectedRowData.warehouse_id }}</el-descriptions-item>
<el-descriptions-item label="货主ID">{{ selectedRowData.store_id }}</el-descriptions-item>
<el-descriptions-item label="订单类型">{{ selectedRowData.order_type }}</el-descriptions-item>
<el-descriptions-item label="操作人">{{ selectedRowData.operator_name }}</el-descriptions-item>
<el-descriptions-item label="数量">{{ selectedRowData.quantity }}</el-descriptions-item>
<el-descriptions-item label="记录数">{{ selectedRowData.record_count }}</el-descriptions-item>
<el-descriptions-item label="首次创建" :span="2">{{ formatDateTime(selectedRowData.first_created_at) }}</el-descriptions-item>
<el-descriptions-item label="最后创建" :span="2">{{ formatDateTime(selectedRowData.last_created_at) }}</el-descriptions-item>
</el-descriptions>
</div>
</div>
<div class="no-selection" v-else>
<div class="empty-tip">
<p>请从上方列表中选择一项查看详情</p>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, computed } from 'vue'
import { ElMessage } from 'element-plus'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import { getTransactionList } from '@/api/storage/transaction'
import * as indexApi from '@/api/index'
import {
transactionColumns,
availableFields,
formatDateTime,
formatTransactionData
} from './log-config'
import { useSettingsStore } from '@/stores/modules/settings'
import dayjs from 'dayjs'
const scanBox = ref<any>(null)
const upperTable = ref<any>(null)
const presetTree = ref<any[]>([])
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(availableFields)))
const settingsStore = useSettingsStore()
const shortcutExpanded = computed(() => settingsStore.shortcutExpanded)
const containerHeight = computed(() => shortcutExpanded.value ? 'calc(100vh - 150px)' : 'calc(100vh - 100px)')
const tableSize = ref('small')
const loading = ref(false)
const exportLoading = ref(false)
const groupByBatch = ref(false)
const queryTime = ref(0)
const list = ref<any[]>([])
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
const columns = ref(transactionColumns)
const selectedLogId = ref<string | null>(null)
const currentCondition = ref<any>(null)
const currentConditionRaw = ref<any>(null)
const inventoryTypeMap: Record<string, string> = {
ZP: '正品',
CC: '残次',
JS: '机损',
XS: '箱损',
ZT: '在途',
DJ: '待检',
FP: '返品'
}
const selectedRowData = computed(() => {
return list.value.find(item => item.id === selectedLogId.value) || {}
})
onMounted(() => {
loadFilterData()
loadData()
})
async function loadFilterData() {
try {
const [storesRes, presetRes]: any = await Promise.all([
indexApi.loadStores({ type: 'transaction' }),
indexApi.fastWhereTree('stock')
])
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 normalizeToWhere(condition: any) {
if (!condition) return {}
if (typeof condition === 'string' || typeof condition === 'number') {
return { stock_id: condition }
}
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
}
})
return where
}
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
}
})
return where
}
return {}
}
function handleConditionChange(condition: any) {
currentConditionRaw.value = condition
currentCondition.value = normalizeToWhere(condition)
pagination.currentPage = 1
loadData()
}
function handleConditionClear() {
currentCondition.value = null
pagination.currentPage = 1
loadData()
}
function handleConditionReset() {
currentCondition.value = null
pagination.currentPage = 1
if (scanBox.value?.reset) {
scanBox.value.reset()
} else if (scanBox.value?.clear) {
scanBox.value.clear()
}
loadData()
}
async function loadData() {
if (loading.value) return
loading.value = true
const start = Date.now()
try {
const where = currentCondition.value || {}
const response = await getTransactionList({
where: Object.keys(where).length > 0 ? where : undefined,
pagination: {
page: pagination.currentPage,
pageSize: pagination.pageSize
},
sort: {
sortField: 'created_at',
sortOrder: 'DESC'
},
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
}
queryTime.value = Date.now() - start
} else {
ElMessage.error(response?.message || '查询失败')
list.value = []
}
} catch (error: any) {
ElMessage.error(error.message || '查询出错')
console.error('查询出入库记录失败:', error)
list.value = []
} finally {
loading.value = false
}
}
function handleRowClick(row: any) {
selectedLogId.value = row?.id || null
}
function handlePageChange(newPage: number) {
pagination.currentPage = newPage
loadData()
}
function handlePageSizeChange(newPageSize: number) {
pagination.pageSize = newPageSize
pagination.currentPage = 1
loadData()
}
async function handleExport() {
try {
exportLoading.value = true
const where = currentCondition.value || {}
const response = await getTransactionList({
where: Object.keys(where).length > 0 ? where : undefined,
pagination: {
page: 1,
pageSize: 10000 // 导出最多10000条
},
group_by_batch: groupByBatch.value
})
if (response && response.flag === 'success' && response.list) {
// 生成CSV
const headers = ['商品ID', '库位ID', '仓库ID', '货主ID', '交易类型', '库存类型', '订单类型', '数量', '记录数', '首次创建时间', '最后创建时间', '操作人']
const rows = response.list.map((item: any) => [
item.stock_id,
item.space_id,
item.warehouse_id,
item.store_id,
item.transaction_type === 'INBOUND' ? '入库' : '出库',
inventoryTypeMap[item.inventory_type] || item.inventory_type,
item.order_type,
item.quantity,
item.record_count,
item.first_created_at,
item.last_created_at,
item.operator_name || '-'
])
const csvContent = [
headers.join(','),
...rows.map((row: any[]) => row.map((cell: any) => `"${cell}"`).join(','))
].join('\n')
const blob = new Blob(['\uFEFF' + csvContent], { type: 'text/csv;charset=utf-8;' })
const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.download = `出入库记录_${dayjs().format('YYYY-MM-DD_HHmmss')}.csv`
link.click()
ElMessage.success('导出成功')
} else {
ElMessage.error('导出失败')
}
} catch (error: any) {
ElMessage.error(error.message || '导出出错')
} finally {
exportLoading.value = false
}
}
</script>
<style lang="scss" scoped>
.transaction-log-container {
display: flex;
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;
.toolbar-left {
display: flex;
gap: 8px;
align-items: center;
}
.toolbar-right {
display: flex;
flex-direction: row;
gap: 15px;
height: 30px;
align-items: center;
}
}
.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: 10px;
border-bottom: 1px solid #ebeef5;
background-color: #fafafa;
.detail-info {
display: flex;
align-items: center;
gap: 10px;
.detail-title {
font-size: 14px;
font-weight: 500;
color: #303133;
}
}
}
.detail-container {
flex: 1;
overflow: auto;
padding: 10px;
:deep(.el-descriptions) {
background: #fff;
}
:deep(.el-descriptions__body) {
background: #fff;
}
:deep(.el-descriptions-item__cell) {
padding: 8px 12px;
}
}
}
.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;
}
}
}
}
</style>

View File

@ -0,0 +1,111 @@
// 时间格式化函数
export function formatDateTime(dateStr: string): string {
if (!dateStr) return '--'
try {
const date = new Date(dateStr)
if (isNaN(date.getTime())) return '--'
// 转换为本地时间,格式:YYYY-MM-DD HH:mm:ss
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
} catch (e) {
return '--'
}
}
// 交易类型配置
export const transactionTypeConfig = {
INBOUND: { text: '入库', tagType: 'success' },
OUTBOUND: { text: '出库', tagType: 'danger' }
}
// 库存类型配置
export const inventoryTypeConfig = {
ZP: { text: '正品', tagType: 'success' },
CC: { text: '残次', tagType: 'warning' },
JS: { text: '机损', tagType: 'warning' },
XS: { text: '箱损', tagType: 'warning' },
ZT: { text: '在途', tagType: 'info' },
DJ: { text: '待检', tagType: 'warning' },
FP: { text: '返品', tagType: 'info' }
}
// 订单类型配置
export const orderTypeConfig = {
SCRK: { text: '标准入库', tagType: 'primary' },
MATCH: { text: '匹配', tagType: 'primary' }
}
// 出入库记录列表列
export const transactionColumns = [
{ prop: 'stock_id', label: '商品ID', width: '100', align: 'center' },
{ prop: 'transaction_type', label: '交易类型', width: '100', align: 'center' },
{ prop: 'inventory_type', label: '库存类型', width: '100', align: 'center' },
{ prop: 'space_id', label: '库位ID', width: '100', align: 'center' },
{ prop: 'warehouse_id', label: '仓库ID', width: '100', align: 'center' },
{ prop: 'order_type', label: '订单类型', width: '100', align: 'center' },
{ prop: 'quantity', label: '数量', width: '100', align: 'right' },
{ prop: 'record_count', label: '记录数', width: '100', align: 'right' },
{ prop: 'first_created_at', label: '首次创建', width: '160', sortable: true, formatter: (row: any) => formatDateTime(row.first_created_at) },
{ prop: 'last_created_at', label: '最后创建', width: '160', sortable: true, formatter: (row: any) => formatDateTime(row.last_created_at) },
{ prop: 'operator_name', label: '操作人', width: '100', align: 'center' }
]
// scan-box 可用字段
export const availableFields = [
{ value: 'transaction_type', label: '交易类型', type: 'select', options: Object.entries(transactionTypeConfig).map(([v, c]) => ({ value: v, label: c.text })) },
{ value: 'inventory_type', label: '库存类型', type: 'select', options: Object.entries(inventoryTypeConfig).map(([v, c]) => ({ value: v, label: c.text })) },
{ value: 'order_type', label: '订单类型', type: 'select', options: Object.entries(orderTypeConfig).map(([v, c]) => ({ value: v, label: c.text })) },
{
value: 'stock_id',
label: '商品ID',
type: 'number',
placeholder: '请输入商品ID',
operators: ['eq', 'contains'],
defaultOperator: 'eq'
},
{
value: 'order_no',
label: '订单号',
type: 'text',
placeholder: '请输入订单号',
operators: ['contains', 'eq'],
defaultOperator: 'contains'
},
{
value: 'operator_name',
label: '操作人',
type: 'text',
placeholder: '请输入操作人名称',
operators: ['contains'],
defaultOperator: 'contains'
},
{
value: 'space_id',
label: '库位ID',
type: 'number',
placeholder: '请输入库位ID',
operators: ['eq'],
defaultOperator: 'eq'
},
{ value: 'store_id', label: '货主', type: 'select', filterable: true, options: [] },
{
value: 'created_at',
label: '创建时间',
type: 'date',
operators: ['between', 'eq', 'gt', 'lt'],
defaultOperator: 'between'
}
]
// 格式化行数据
export function formatTransactionData(data: any[]): any[] {
return data.map(item => ({
...item,
id: `${item.stock_id}-${item.space_id}-${item.transaction_type}`
}))
}

View File

@ -424,6 +424,7 @@ const openAddDrawer = () => {
if (addDrawerStore.value) {
formData.store_id = addDrawerStore.value.id || addDrawerStore.value.store_id || addDrawerStore.value.storeId
formData.store_name = addDrawerStore.value.name || addDrawerStore.value.store_name || ''
}
// 如果勾选了一个商品,自动填充相关字段

View File

@ -409,7 +409,18 @@ function normalizeToWhere(condition: any) {
const where: any = {}
Object.keys(condition.conditions).forEach(k => {
const c = condition.conditions[k]
where[k] = c && c.value !== undefined ? c.value : c
// 如果条件对象包含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
}
})
return where
}
@ -419,8 +430,20 @@ function normalizeToWhere(condition: any) {
const where: any = {}
Object.keys(condition).forEach(k => {
const c = condition[k]
if (c && c.value !== undefined) {
where[k] = c.value
// 如果是对象且包含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
}

View File

@ -85,15 +85,15 @@
{{ row.remaining_days > 0 ? row.remaining_days + '天' : '—' }}
</span>
</template>
<template #column-qimen_config="{ row }">
<template #column-has_qimen_config="{ row }">
<el-tag
size="small"
:type="row.qimen_config ? 'success' : 'info'"
:type="row.has_qimen_config ? 'success' : 'info'"
effect="plain"
@click.stop="openQimenDialog(row)"
style="cursor:pointer"
>
{{ row.qimen_config ? '已配置' : '未配置' }}
{{ row.has_qimen_config ? '已配置' : '未配置' }}
</el-tag>
</template>
<template #column-apply_time="{ row }">
@ -522,43 +522,41 @@
<!-- 接口类型选择 -->
<el-col :span="12">
<el-form-item label="接口类型" required>
<!-- 编辑模式:锁定,仅展示当前类型 -->
<!-- 编辑模式:锁定 -->
<el-select
v-if="qimenDialog.editingConfig"
:model-value="qimenForm.interface_type_id"
:model-value="qimenForm.interface_code"
disabled
style="width:100%"
>
<el-option
:label="`${qimenDialog.editingConfig.interface_name || qimenDialog.editingConfig.interface_code || '接口类型'}(${qimenDialog.editingConfig.interface_code || qimenForm.interface_type_id})`"
:value="qimenForm.interface_type_id"
v-for="t in qimenDialog.availableTypes"
:key="t.interface_code"
:label="`${t.interface_name}(${t.interface_code})`"
:value="t.interface_code"
/>
<!-- 兼容历史数据中未收录的其他类型 -->
<el-option
v-if="qimenForm.interface_code && !qimenDialog.availableTypes.some(t => t.interface_code === qimenForm.interface_code)"
:label="`${qimenDialog.editingConfig?.interface_name || qimenForm.interface_code}(${qimenForm.interface_code})`"
:value="qimenForm.interface_code"
/>
</el-select>
<!-- 新增模式:从 selectableTypes / availableTypes 中选择 -->
<template v-else>
<el-select
v-if="qimenDialog.selectableTypes.length || qimenDialog.availableTypes.length"
v-model="qimenForm.interface_type_id"
placeholder="请选择接口类型"
style="width:100%"
@change="handleInterfaceTypeChange"
>
<el-option
v-for="t in (qimenDialog.selectableTypes.length ? qimenDialog.selectableTypes : qimenDialog.availableTypes)"
:key="t.id"
:label="`${t.interface_name || t.interface_code}(${t.interface_code})`"
:value="t.id"
/>
</el-select>
<el-input-number
v-else
v-model.number="qimenForm.interface_type_id"
:controls="false"
placeholder="请输入接口类型ID"
style="width:100%"
@change="(v: number) => handleInterfaceTypeChange(v)"
<!-- 新增模式:从接口选项中选择,已配置类型标灰禁用 -->
<el-select
v-else
v-model="qimenForm.interface_code"
placeholder="请选择接口类型"
style="width:100%"
@change="handleInterfaceTypeChange"
>
<el-option
v-for="t in selectableTypes"
:key="t.interface_code"
:label="`${t.interface_name}(${t.interface_code})`"
:value="t.interface_code"
/>
</template>
</el-select>
</el-form-item>
</el-col>
<!-- 类型标识 -->
@ -675,7 +673,7 @@
<!-- 面单余额调整弹窗 -->
<el-dialog
v-model="adjustBalanceDialog.visible"
title="面单余额调整"
title="面单余额设置"
width="500px"
align-center
@close="resetAdjustBalanceDialog"
@ -723,7 +721,7 @@
:loading="adjustBalanceDialog.loading"
@click="submitAdjustBalance"
>
确认调整
确认设置
</el-button>
</template>
</el-dialog>
@ -735,6 +733,7 @@ import { ref, reactive, onMounted, computed } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Search, Plus, Refresh, QuestionFilled } from '@element-plus/icons-vue'
import { storeWarehouseList, storeWarehouseSign, storeWarehouseUnbind, storeWarehouseRename, storeWarehouseGetPolicyConfig, storeWarehouseGetPolicyConfigFields, storeWarehouseSavePolicyConfig, saveApiConfig, storeWarehouseDeleteQimenConfig, storeWarehouseAdjustPrintQuantity, listApiConfig } from '@/api/storeWarehouse'
import { listInterfaceTypes } from '@/api/index'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import Detail from './component/detail.vue'
@ -1122,8 +1121,8 @@ const qimenDialog = reactive({
loading: false,
contractRow: null as any,
list: [] as any[],
availableTypes: [] as any[], // 所有可用接口类型(由 listApiConfig 返回或从 list 推导)
selectableTypes: [] as any[], // 新增时可选的类型(已配置类型排除)
availableTypes: [] as any[], // 用于提交时解析 interface_type_id(来源:listInterfaceTypes)
selectableTypes: [] as any[], // 保留字段(兼容,实际下拉由 selectableLocalTypes 驱动)
total: 0,
contract: null as any,
formVisible: false,
@ -1131,6 +1130,9 @@ const qimenDialog = reactive({
editingConfig: null as any
})
/** 新增时可选的接口类型 */
const selectableTypes = computed(() => qimenDialog.availableTypes)
const qimenForm = reactive<Record<string, any>>({ ...qimenFormDefault })
// ─── 面单余额调整 ─────────────────────────────────────────────────────────
@ -1149,8 +1151,8 @@ function resetAdjustBalanceDialog() {
}
async function submitAdjustBalance() {
if (!adjustBalanceForm.change_quantity || adjustBalanceForm.change_quantity === 0) {
ElMessage.warning('请输入有效的调整数量')
if (adjustBalanceForm.target_quantity === undefined || adjustBalanceForm.target_quantity === null) {
ElMessage.warning('请输入目标面单余额')
return
}
if (!adjustBalanceForm.reason?.trim()) {
@ -1162,12 +1164,12 @@ async function submitAdjustBalance() {
try {
const res = await storeWarehouseAdjustPrintQuantity({
id: adjustBalanceDialog.contractRow.id,
change_quantity: adjustBalanceForm.change_quantity,
target_quantity: adjustBalanceForm.target_quantity,
reason: adjustBalanceForm.reason.trim()
}) as any
if (res?.flag === 'success' || res?.code === 200) {
ElMessage.success('面单余额调整成功')
ElMessage.success('面单余额设置成功')
adjustBalanceDialog.visible = false
loadList() // 刷新列表
} else {
@ -1202,40 +1204,37 @@ async function loadQimenConfigs() {
if (!qimenDialog.contractRow) return
qimenDialog.loading = true
try {
const res = await listApiConfig({
id: qimenDialog.contractRow.id
}) as any
// 并行获取已配置列表和全局接口类型列表
const [res, typesRes] = await Promise.all([
listApiConfig({ id: qimenDialog.contractRow.id }) as Promise<any>,
listInterfaceTypes() as Promise<any>
])
// listInterfaceTypes 接口返回 { list: [...], total, ... }
const serverTypes: any[] = Array.isArray(typesRes?.list) ? typesRes.list : []
// 以接口类型列表作为主数据源;对于历史数据中未出现在 serverTypes 的类型进行兜底补充
const typeMap = new Map<number, any>(serverTypes.map((t: any) => [t.id, t]))
if (res?.data) {
qimenDialog.list = res.data.list || []
qimenDialog.total = res.data.total || 0
qimenDialog.contract = res.data.contract || null
// 优先使用后端返回的专用字段,如没有则从 list 中提取接口类型信息作为备用
const directTypes =
res.data.available_types ||
res.data.availableTypes ||
res.data.types ||
res.data.interface_types ||
null
if (directTypes && directTypes.length > 0) {
qimenDialog.availableTypes = directTypes
} else {
// 从 list 中重建接口类型列表(去重)
const typeMap = new Map<number, any>()
;(res.data.list || []).forEach((item: any) => {
const tid = item.interface_type_id
if (tid && !typeMap.has(tid)) {
typeMap.set(tid, {
id: tid,
interface_code: item.interface_code || item.interface_category || '',
interface_name: item.interface_name || item.interface_code || `类型 ${tid}`
})
}
})
qimenDialog.availableTypes = Array.from(typeMap.values())
}
// 将已配置列表中未被 listInterfaceTypes 收录的历史类型追加进去(兜底)
;(res.data.list || []).forEach((item: any) => {
const tid = item.interface_type_id
if (tid && !typeMap.has(tid)) {
typeMap.set(tid, {
id: tid,
interface_code: item.interface_code || item.interface_category || '',
interface_name: item.interface_name || item.interface_code || `类型 ${tid}`
})
}
})
}
qimenDialog.availableTypes = Array.from(typeMap.values())
} catch {
ElMessage.error('加载接口配置列表失败')
} finally {
@ -1243,14 +1242,8 @@ async function loadQimenConfigs() {
}
}
function handleInterfaceTypeChange(typeId: number) {
const type = qimenDialog.availableTypes.find((t: any) => t.id === typeId)
if (type) {
qimenForm.interface_code = type.interface_code || type.code || type.interface_category || ''
} else {
qimenForm.interface_code = ''
}
// 切换类型时清空奇门专属字段
function handleInterfaceTypeChange(_code: string) {
// interface_code 已由 v-model 绑定自动更新,此处只做联动清空
qimenForm.qimen_app_key = ''
qimenForm.qimen_customer_id = ''
qimenForm.qimen_warehouse_code = ''
@ -1266,23 +1259,16 @@ function openQimenForm(config: any) {
if (config.is_enabled !== undefined) qimenForm.is_enabled = config.is_enabled
} else {
Object.assign(qimenForm, qimenFormDefault)
// 新增时:计算尚未配置的类型(已配置的不再允许重复新增)
const configuredTypeIds = new Set(qimenDialog.list.map((item: any) => item.interface_type_id))
qimenDialog.selectableTypes = qimenDialog.availableTypes.filter(
(t: any) => !configuredTypeIds.has(t.id)
)
// 若剩一种可选,自动选中
if (qimenDialog.selectableTypes.length === 1) {
const t = qimenDialog.selectableTypes[0]
qimenForm.interface_type_id = t.id
qimenForm.interface_code = t.interface_code || t.code || t.interface_category || ''
// 若只有一个接口类型,自动选中
if (selectableTypes.value.length === 1) {
qimenForm.interface_code = selectableTypes.value[0]?.interface_code ?? ''
}
}
qimenDialog.formVisible = true
}
async function submitQimenForm() {
if (!qimenForm.interface_type_id) {
if (!qimenForm.interface_code) {
ElMessage.warning('请选择接口类型')
return
}
@ -1307,22 +1293,29 @@ async function submitQimenForm() {
return
}
}
// 解析 interface_type_id:编辑时来自已有配置,新增时从 availableTypes 按 interface_code 反查
const resolvedTypeId: number | undefined =
qimenDialog.editingConfig?.interface_type_id ??
qimenDialog.availableTypes.find((t: any) => t.interface_code === qimenForm.interface_code)?.id
if (!resolvedTypeId) {
ElMessage.warning('无法解析接口类型ID,请稍后重试或刷新页面')
return
}
qimenDialog.formLoading = true
try {
// 构建请求载荷,不提交 interface_code(仅属前端状态)
const { interface_code: _code, ...formData } = qimenForm
const payload: any = {
id: qimenDialog.contractRow?.id,
interface_type_id: qimenDialog.editingConfig?.interface_type_id ?? qimenForm.interface_type_id,
...formData
// 仅提交 saveApiConfig 接口所要求的字段
const payload = {
id: qimenDialog.contractRow?.id as number,
interface_type_id: resolvedTypeId,
app_name: qimenForm.app_name.trim()
} as const
// QM_WMS 类型额外传奇门字段
if (isQmWms) {
;(payload as any).qimen_app_key = qimenForm.qimen_app_key.trim()
;(payload as any).qimen_customer_id = qimenForm.qimen_customer_id.trim()
;(payload as any).qimen_warehouse_code = qimenForm.qimen_warehouse_code.trim()
}
// OPEN_API 类型不传奇门字段
if (!isQmWms) {
delete payload.qimen_app_key
delete payload.qimen_customer_id
delete payload.qimen_warehouse_code
}
const res = await saveApiConfig(payload) as any
const res = await saveApiConfig(payload as any) as any
if (res?.flag === 'success' || res?.code === 200) {
const action = res.data?.action === 'create' ? '新增' : '更新'
ElMessage.success(`奇门配置${action}成功`)

View File

@ -15,6 +15,12 @@ export const signFormDefault = {
remask: ''
}
/** 前端本地定义的接口类型选项,无需依赖后端接口返回即可渲染下拉菜单 */
export const LOCAL_INTERFACE_TYPES: { interface_code: string; interface_name: string }[] = [
{ interface_code: 'QM_WMS', interface_name: '奇门仓储接口' },
{ interface_code: 'OPEN_API', interface_name: '第三方接口' }
]
// 接口配置(apiConfig)表单默认配置
export const qimenFormDefault = {
interface_type_id: undefined as number | undefined,
@ -39,7 +45,7 @@ export const adjustBalanceDialogDefault = {
// 面单余额调整表单默认配置
export const adjustBalanceFormDefault = {
change_quantity: undefined as number | undefined,
target_quantity: undefined as number | undefined,
reason: ''
}
@ -65,16 +71,15 @@ export const qimenFormItems = [
// 面单余额调整表单项配置
export const adjustBalanceFormItems = [
{
label: '调整数量',
prop: 'change_quantity',
label: '目标余额',
prop: 'target_quantity',
type: 'number',
required: true,
placeholder: '请输入调整数量(正数增加,负数扣减)',
placeholder: '请输入目标面单余额(将覆盖当前余额)',
span: 24,
rules: [
{ required: true, message: '请输入调整数量' },
{ type: 'number', message: '调整数量必须是数字' },
{ validator: (rule: any, value: any) => value !== 0, message: '调整数量不能为0' }
{ required: true, message: '请输入目标面单余额' },
{ type: 'number', message: '目标余额必须是数字' }
]
},
{
@ -110,7 +115,7 @@ export const columns = [
{ prop: 'print_quantity', label: '面单余额', width: 100, align: 'center' },
//{ prop: 'is_auth_valid', label: '授权有效', width: 90, align: 'center' },
// { prop: 'remaining_days', label: '剩余天数', width: 90, align: 'center' },
{ prop: 'qimen_config', label: '奇门配置', width: 100, align: 'center' },
{ prop: 'has_qimen_config', label: '奇门配置', width: 100, align: 'center' },
{ prop: 'apply_time', label: '申请时间', width: 160, align: 'center' },
{ prop: 'actions', label: '操作', width: 380, align: 'center', fixed: 'right' }
]
@ -152,7 +157,7 @@ export const detailPanel = [
{ prop: 'apply_time', label: '申请时间' },
{ prop: 'auth_period', label: '授权有效期', span: 2 },
{ prop: 'review_comment', label: '审核意见' },
{ prop: 'qimen_config', label: '奇门配置', span: 2 }
{ prop: 'has_qimen_config', label: '奇门配置', span: 2 }
]
export default {

File diff suppressed because it is too large Load Diff

12
src/测试文档.txt Normal file
View File

@ -0,0 +1,12 @@
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)