This commit is contained in:
yin 2026-04-07 18:27:40 +08:00
parent df0b693592
commit af865de6fc
9 changed files with 1934 additions and 686 deletions

View File

@ -25,6 +25,8 @@ export function storeWarehouseList(data: {
/** 发起/预览/确认签约 */ /** 发起/预览/确认签约 */
export function storeWarehouseSign(data: { export function storeWarehouseSign(data: {
store_id?: number
warehouse_id?: number
temp_code?: string temp_code?: string
action?: 'preview' | 'confirm' action?: 'preview' | 'confirm'
counterparty_id?: number counterparty_id?: number
@ -45,8 +47,7 @@ export function storeWarehouseSign(data: {
/** 修改签约关系使用状态 */ /** 修改签约关系使用状态 */
export function storeWarehouseUnbind(data: { export function storeWarehouseUnbind(data: {
id?: number id: number
counterparty_id?: number
use_status?: number use_status?: number
}) { }) {
return request({ return request({
@ -64,8 +65,7 @@ export function storeWarehouseUnbind(data: {
/** 修改签约备注 */ /** 修改签约备注 */
export function storeWarehouseRename(data: { export function storeWarehouseRename(data: {
id?: number id: number
counterparty_id?: number
remask: string remask: string
}) { }) {
return request({ return request({
@ -81,17 +81,15 @@ export function storeWarehouseRename(data: {
} as any) } as any)
} }
/** 查询签约关系下的奇门接口配置列表 */ /** 读取签约策略配置 */
export function storeWarehouseListQimenConfig(data: { export function storeWarehouseGetPolicyConfig(data: {
id?: number id: number
counterparty_id?: number
interface_type_id?: number
}) { }) {
return request({ return request({
url: '/system', url: '/system',
method: 'post', method: 'post',
params: { params: {
method: 'storeWarehouse.store.listQimenConfig', method: 'storeWarehouse.store.getPolicyConfig',
v, v,
timestamp: new Date().getTime() timestamp: new Date().getTime()
}, },
@ -100,19 +98,91 @@ export function storeWarehouseListQimenConfig(data: {
} as any) } as any)
} }
/** 保存奇门接口配置(新增或更新) */ /** 获取签约策略可配置字段元信息列表 */
export function storeWarehouseSaveQimenConfig(data: { export function storeWarehouseGetPolicyConfigFields() {
id?: number return request({
counterparty_id?: number url: '/system',
method: 'post',
params: {
method: 'storeWarehouse.store.getPolicyConfigFields',
v,
timestamp: new Date().getTime()
},
data: {},
isSystemApi: true
} as any)
}
/** 保存签约策略配置 */
export function storeWarehouseSavePolicyConfig(data: {
id: number
policy_config: Record<string, any>
}) {
return request({
url: '/system',
method: 'post',
params: {
method: 'storeWarehouse.store.savePolicyConfig',
v,
timestamp: new Date().getTime()
},
data,
isSystemApi: true
} as any)
}
/** 人工调整签约关系下的面单余额并记录变更日志 */
export function storeWarehouseAdjustPrintQuantity(data: {
id: number
change_quantity: number
reason: string
business_type?: string
business_id?: number
}) {
return request({
url: '/system',
method: 'post',
params: {
method: 'storeWarehouse.store.adjustPrintQuantity',
v,
timestamp: new Date().getTime()
},
data,
isSystemApi: true
} as any)
}
/** 查询签约关系下的奇门接口配置列表 */
export function listApiConfig(data: {
id: number
interface_type_id?: number interface_type_id?: number
app_name?: string }) {
qimen_app_key: string return request({
qimen_customer_id: string url: '/system',
qimen_warehouse_code: string method: 'post',
params: {
method: 'storeWarehouse.store.listApiConfig',
v,
timestamp: new Date().getTime()
},
data,
isSystemApi: true
} as any)
}
/** 保存接口配置(新增或更新)
* - QM_WMS 类型:须填写 qimen_app_key / qimen_customer_id / qimen_warehouse_code
* - OPEN_API 类型:系统自动生成 self_app_key / self_app_secret,无需传入奇门字段
*/
export function saveApiConfig(data: {
id: number
interface_type_id: number
app_name: string
qimen_app_key?: string
qimen_customer_id?: string
qimen_warehouse_code?: string
api_version?: string api_version?: string
sign_method?: string
rate_limit?: number
timeout_seconds?: number
contact_person?: string contact_person?: string
contact_phone?: string contact_phone?: string
email?: string email?: string
@ -122,7 +192,7 @@ export function storeWarehouseSaveQimenConfig(data: {
url: '/system', url: '/system',
method: 'post', method: 'post',
params: { params: {
method: 'storeWarehouse.store.saveQimenConfig', method: 'storeWarehouse.store.saveApiConfig',
v, v,
timestamp: new Date().getTime() timestamp: new Date().getTime()
}, },
@ -133,8 +203,7 @@ export function storeWarehouseSaveQimenConfig(data: {
/** 删除签约关系上的奇门接口配置 */ /** 删除签约关系上的奇门接口配置 */
export function storeWarehouseDeleteQimenConfig(data: { export function storeWarehouseDeleteQimenConfig(data: {
id?: number id: number
counterparty_id?: number
interface_type_id?: number interface_type_id?: number
}) { }) {
return request({ return request({

2
src/test.txt Normal file
View File

@ -0,0 +1,2 @@
接口文档更新:
[{"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 入口继续用于直接查看当前生效文档。"]}]

View File

@ -4,6 +4,7 @@ import {
getToken, setToken, removeToken getToken, setToken, removeToken
} from '@/utils/auth' } from '@/utils/auth'
import router from '@/router' import router from '@/router'
import { useUserStore } from '@/stores/modules/user'
// create an axios instance // create an axios instance
const service = axios.create({ const service = axios.create({
@ -82,18 +83,40 @@ service.interceptors.response.use(
// 强制转换为小写键以进行不区分大小写的查找 // 强制转换为小写键以进行不区分大小写的查找
const headers = response.headers const headers = response.headers
const res = response.data const res = response.data
// console.log('响应开始')
// axios 的 headers 对象通常已经处理过大小写,但为了保险起见,检查多种可能的键名 const getHeader = (key: string): string | null => {
const newToken = headers['new-token'] || headers['new-authorization'] || headers['authorization'] || headers['Authorization']; if (typeof headers.get === 'function') {
// console.log(`尝试从 headers.get('${key}') 获取 token`)
const val = headers.get(key)
return val ? String(val) : null
}
return headers[key.toLowerCase()] || headers[key] || null
}
const rawToken = getHeader('authorization') || getHeader('Authorization') || getHeader('new-authorization')
// console.log('检测token:', rawToken)
if (rawToken) {
// 提取 Bearer 之后的 token 字符串(大小写不敏感)
let tokenValue = rawToken.toLowerCase().startsWith('bearer ')
? rawToken.substring(7).trim()
: rawToken.trim()
if (newToken) {
// 提取 Bearer 之后的 token 字符串
const tokenValue = newToken.startsWith('Bearer ') ? newToken.substring(7) : newToken
if (tokenValue && tokenValue !== getToken()) { if (tokenValue && tokenValue !== getToken()) {
console.log('检测到新 Token,正在更新存储...'); console.log('检测到新 Token,正在更新存储...')
// 同步更新 localStorage 和 axios 默认头
setToken(tokenValue) setToken(tokenValue)
// 同步更新当前实例的默认请求头,确保后续请求立即生效 // console.log('Token 已更新:', tokenValue)
service.defaults.headers.common['Authorization'] = `Bearer ${tokenValue}` service.defaults.headers.common['Authorization'] = `Bearer ${tokenValue}`
// 同步更新 Pinia user store(懒获取,避免 Pinia 未初始化时报错)
try {
const userStore = useUserStore()
userStore.updateToken(tokenValue)
} catch (_) {
// Pinia 未就绪时静默忽略,localStorage 已更新,下次请求会从 getToken() 读取
}
} }
} }

View File

@ -246,122 +246,6 @@ const props = defineProps<{
row?: any row?: any
}>() }>()
// 模拟数据
// const mockProductData = [
// {
// id: 1,
// receiving_number: 'RCV202601180001',
// item_name: '商品A - 测试商品',
// barcodes: '6901234567890',
// product_snapshot: '{"id": null, "name": "商品A - 测试商品", "barcode": "6901234567890", "spec": "500g/袋"}',
// system_product_id: null,
// actual_quantity: 20,
// box_quantity: 2,
// boxes_per_pallet: 10,
// pallet_quantity: 0,
// receiving_time: '2026-01-18 22:43:42',
// receiving_status_display: '已完成',
// storage_status: '未入库',
// stored_quantity: 0,
// batch_number: 'BATCH20231215A',
// production_date: '2023-12-01',
// expiry_date: '2024-12-01',
// remark: '商品A测试明细 - 未匹配',
// box_length: 40,
// box_width: 30,
// box_height: 25,
// weight: 10.5,
// space_id: 'A-01-01',
// creator_id: 'EMP001',
// updated_at_display: '2026-01-18 22:43:42',
// created_at_display: '2026-01-18 22:43:42'
// },
// {
// id: 2,
// receiving_number: 'RCV202601180001',
// item_name: '商品B - 进口商品',
// barcodes: '8801234567890',
// product_snapshot: '{"id": null, "name": "商品B - 进口商品", "barcode": "8801234567890", "origin": "日本", "spec": "1kg/盒"}',
// system_product_id: null,
// actual_quantity: 15,
// box_quantity: 1,
// boxes_per_pallet: 15,
// pallet_quantity: 1,
// receiving_time: '2026-01-18 22:43:42',
// receiving_status_display: '已完成',
// storage_status: '未入库',
// stored_quantity: 0,
// batch_number: 'BATCH20231215B',
// production_date: '2023-11-15',
// expiry_date: '2024-11-15',
// remark: '商品B测试明细 - 未匹配',
// box_length: 50,
// box_width: 40,
// box_height: 30,
// weight: 15.0,
// space_id: 'B-02-05',
// creator_id: 'EMP001',
// updated_at_display: '2026-01-18 22:43:42',
// created_at_display: '2026-01-18 22:43:42'
// },
// {
// id: 3,
// receiving_number: 'RCV202601180001',
// item_name: '商品C - 电子商品',
// barcodes: '4901234567890',
// product_snapshot: '{"id": null, "name": "商品C - 电子商品", "barcode": "4901234567890", "brand": "索尼", "model": "X-100"}',
// system_product_id: 152656,
// actual_quantity: 15,
// box_quantity: 2,
// boxes_per_pallet: 8,
// pallet_quantity: 1,
// receiving_time: '2026-01-18 21:43:42',
// receiving_status_display: '已完成',
// storage_status: '部分入库',
// stored_quantity: 5,
// batch_number: 'BATCH20231215C',
// production_date: '2023-10-01',
// expiry_date: '2025-10-01',
// remark: '商品C测试明细 - 未匹配',
// box_length: 30,
// box_width: 20,
// box_height: 15,
// weight: 5.2,
// space_id: 'C-01-12',
// creator_id: 'EMP001',
// updated_at_display: '2026-01-18 22:43:42',
// created_at_display: '2026-01-18 22:43:42'
// },
// {
// id: 48,
// receiving_number: 'RCV2026020100002',
// item_name: 'MOODAMOR绮梦茉莉香型香水',
// barcodes: '6942233906190',
// product_snapshot: '{"store_id":1000166,"store_name":"花颜物语","updated_at":"2026-02-02T08:37:06.691Z"}',
// system_product_id: null,
// actual_quantity: 1000,
// box_quantity: 10,
// boxes_per_pallet: 100,
// pallet_quantity: 20,
// receiving_time: '2026-02-02 07:10:26',
// receiving_status_display: '收货中',
// storage_status: '未入库',
// stored_quantity: 0,
// batch_number: '20260202',
// production_date: '2025-12-01',
// expiry_date: '2028-12-01',
// remark: '1561534',
// box_length: 45,
// box_width: 35,
// box_height: 30,
// weight: 12.8,
// space_id: 'D-05-01',
// creator_id: 'EMP030',
// updated_at_display: '2026-02-02 13:24:43',
// created_at_display: '2026-02-02 07:10:26'
// }
// ]
const tableData = ref<any[]>([]) const tableData = ref<any[]>([])
const multipleSelection = ref<any[]>([]) const multipleSelection = ref<any[]>([])
const saveLoading = ref(false) const saveLoading = ref(false)

View File

@ -1,15 +1,11 @@
<template> <template>
<div> <div class="store-details-container">
<div class="panel-header"> <el-form label-width="120px" class="details-form">
<span>签约单详情:{{ row.id }}</span> <el-row :gutter="30">
<div class="header-ops"> <!-- 第一列 -->
<el-button size="small" type="primary" @click="$emit('view-detail', row)">更多详情</el-button> <el-col :span="12">
</div> <template v-for="(item, index) in leftFields" :key="item.prop">
</div> <el-form-item :label="item.label">
<div class="panel-body">
<el-descriptions :column="3" border size="small">
<template v-for="item in detailPanel" :key="item.prop">
<el-descriptions-item :label="item.label" :span="item.span || 1">
<template v-if="item.prop === 'current_subject_role'"> <template v-if="item.prop === 'current_subject_role'">
<el-tag size="small" :type="row.current_subject_role === 'warehouse' ? 'primary' : 'warning'"> <el-tag size="small" :type="row.current_subject_role === 'warehouse' ? 'primary' : 'warning'">
{{ row.current_subject_role === 'warehouse' ? '仓库方' : '货主方' }} {{ row.current_subject_role === 'warehouse' ? '仓库方' : '货主方' }}
@ -28,58 +24,147 @@
</template> </template>
<template v-else-if="item.prop === 'qimen_config'"> <template v-else-if="item.prop === 'qimen_config'">
<template v-if="row.qimen_config"> <div v-if="row.qimen_config">
<template v-if="Array.isArray(row.qimen_config) && row.qimen_config.length"> <template v-if="Array.isArray(row.qimen_config) && row.qimen_config.length">
<div v-for="cfg in row.qimen_config" :key="cfg.interface_type_id" class="qimen-summary"> <div v-for="cfg in row.qimen_config" :key="cfg.interface_type_id" class="qimen-summary">
<span>{{ cfg.app_name }}({{ cfg.interface_name }})</span> <span>{{ cfg.app_name }}({{ cfg.interface_name }})</span>
<span class="qimen-info">AppKey: {{ cfg.qimen_app_key }},客户ID: {{ cfg.qimen_customer_id }},仓库编码: {{ cfg.qimen_warehouse_code }}</span> <div class="qimen-info">AppKey: {{ cfg.qimen_app_key }},客户ID: {{ cfg.qimen_customer_id }},仓库编码: {{ cfg.qimen_warehouse_code }}</div>
</div> </div>
</template> </template>
<template v-else-if="typeof row.qimen_config === 'object'"> <template v-else-if="typeof row.qimen_config === 'object'">
<div class="qimen-summary"> <div class="qimen-summary">
<span>{{ row.qimen_config.app_name }}({{ row.qimen_config.interface_name }})</span> <span>{{ row.qimen_config.app_name }}({{ row.qimen_config.interface_name }})</span>
<span class="qimen-info">AppKey: {{ row.qimen_config.qimen_app_key }},客户ID: {{ row.qimen_config.qimen_customer_id }},仓库编码: {{ row.qimen_config.qimen_warehouse_code }}</span> <div class="qimen-info">AppKey: {{ row.qimen_config.qimen_app_key }},客户ID: {{ row.qimen_config.qimen_customer_id }},仓库编码: {{ row.qimen_config.qimen_warehouse_code }}</div>
</div> </div>
</template> </template>
<span v-else style="color:#aaa">未配置</span> <span v-else style="color:#aaa">未配置</span>
</template> </div>
<span v-else style="color:#aaa">未配置</span> <span v-else style="color:#aaa">未配置</span>
</template> </template>
<template v-else> <template v-else>
{{ (row[item.prop] !== undefined && row[item.prop] !== null && row[item.prop] !== '') ? row[item.prop] : '—' }} <div class="field-value">{{ (row[item.prop] !== undefined && row[item.prop] !== null && row[item.prop] !== '') ? row[item.prop] : '—' }}</div>
</template> </template>
</el-descriptions-item> </el-form-item>
</template> </template>
</el-descriptions> </el-col>
<!-- 第二列 -->
<el-col :span="12">
<template v-for="(item, index) in rightFields" :key="item.prop">
<el-form-item :label="item.label">
<template v-if="item.prop === 'qimen_config'">
<div v-if="row.qimen_config">
<template v-if="Array.isArray(row.qimen_config) && row.qimen_config.length">
<div v-for="cfg in row.qimen_config" :key="cfg.interface_type_id" class="qimen-summary">
<span>{{ cfg.app_name }}({{ cfg.interface_name }})</span>
<div class="qimen-info">AppKey: {{ cfg.qimen_app_key }},客户ID: {{ cfg.qimen_customer_id }},仓库编码: {{ cfg.qimen_warehouse_code }}</div>
</div>
</template>
<template v-else-if="typeof row.qimen_config === 'object'">
<div class="qimen-summary">
<span>{{ row.qimen_config.app_name }}({{ row.qimen_config.interface_name }})</span>
<div class="qimen-info">AppKey: {{ row.qimen_config.qimen_app_key }},客户ID: {{ row.qimen_config.qimen_customer_id }},仓库编码: {{ row.qimen_config.qimen_warehouse_code }}</div>
</div>
</template>
<span v-else style="color:#aaa">未配置</span>
</div>
<span v-else style="color:#aaa">未配置</span>
</template>
<template v-else>
<div class="field-value">{{ (row[item.prop] !== undefined && row[item.prop] !== null && row[item.prop] !== '') ? row[item.prop] : '—' }}</div>
</template>
</el-form-item>
</template>
</el-col>
</el-row>
</el-form>
<!-- 底部操作按钮 -->
<div class="bottom">
<el-button-group class="toolbar-btn-group">
<el-button type="primary" size="small" icon="More" @click="$emit('view-detail', row)">
更多详情
</el-button>
</el-button-group>
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed } from 'vue'
import { detailPanel } from '../store-config' import { detailPanel } from '../store-config'
const props = defineProps({ const props = defineProps({
row: { type: Object, required: true }, row: { type: Object, required: true },
getAuthStatusType: { type: Function, required: true }, getAuthStatusType: { type: Function, required: true },
getAuthStatusLabel: { type: Function, required: true }, getAuthStatusLabel: { type: Function, required: true },
formatDate: { type: Function, required: true } formatDate: { type: Function, required: true }
}) })
const emit = defineEmits(['view-detail']) const emit = defineEmits(['view-detail'])
// 将字段平分为左右两列
const leftFields = computed(() => {
const mid = Math.ceil(detailPanel.length / 2)
return detailPanel.slice(0, mid)
})
const rightFields = computed(() => {
const mid = Math.ceil(detailPanel.length / 2)
return detailPanel.slice(mid)
})
</script> </script>
<style scoped> <style scoped lang="scss">
.panel-header { .store-details-container {
padding: 10px 16px; height: 100%;
border-bottom: 1px solid #f0f0f0;
display: flex; display: flex;
justify-content: space-between; flex-direction: column;
align-items: center; box-sizing: border-box;
font-weight: bold; background-color: #fff;
color: #333;
} }
.panel-body {
.details-form {
flex: 1; flex: 1;
padding: 16px;
overflow-y: auto; overflow-y: auto;
padding: 20px;
width: 100%;
box-sizing: border-box;
/* 隐藏滚动条 */
&::-webkit-scrollbar {
display: none;
}
-ms-overflow-style: none;
scrollbar-width: none;
}
.field-value {
color: #333;
word-break: break-all;
}
.qimen-summary {
margin-bottom: 8px;
line-height: 1.4;
span {
font-weight: bold;
color: #409eff;
}
}
.qimen-info {
font-size: 12px;
color: #909399;
}
.bottom {
flex-shrink: 0;
text-align: right;
padding: 10px 20px;
border-top: 1px solid #ebeef5;
background-color: #fff;
z-index: 10;
} }
</style> </style>

View File

@ -0,0 +1,180 @@
<template>
<div class="log-container">
<el-button-group class="toolbar-btn-group">
<el-button
type="primary"
size="small"
icon="Refresh"
@click="fetchStockInfo"
title="刷新"
:loading="loading"
class="toolbar-btn"
>
刷新
</el-button>
</el-button-group>
<el-table
:data="tableData"
border
stripe
style="width: 100%"
:height="tableHeight"
v-loading="loading"
>
<el-table-column prop="created_at" label="时间" width="250" />
<el-table-column prop="operator_name" label="操作人" width="120" />
<el-table-column prop="operation_name" label="操作名称" />
<el-table-column prop="platform_name" label="操作平台" />
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button
@click="viewData(scope.row)"
type="primary"
link
size="small"
v-if="scope.row.external_log_id"
>
查看报文
</el-button>
<el-button
@click="backData(scope.row)"
type="primary"
link
size="small"
v-if="scope.row.operation_code === 'UPDATE'"
>
修改前快照
</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination-container">
<el-pagination
v-model:current-page="pagination.page"
v-model:page-size="pagination.pageSize"
:page-sizes="[10, 20, 50, 100]"
:total="pagination.total"
layout="total, sizes, prev, pager, next, jumper"
background
@size-change="handlePageSizeChange"
@current-change="handlePageChange"
/>
</div>
<el-drawer
v-model="showRequestData"
direction="rtl"
:with-header="false"
size="800px"
class="el-drawers"
>
<RequestData
v-if="showRequestData"
:id="requestId"
:type="requestType"
/>
</el-drawer>
</div>
</template>
<script setup lang="ts">
import { ref, reactive, watch, onMounted, computed } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Refresh } from '@element-plus/icons-vue'
import * as stockApi from '@/api/stock'
import RequestData from '@/components/RequestData/index.vue'
const props = defineProps<{
id?: number
}>()
const loading = ref(false)
const tableData = ref<any[]>([])
const showRequestData = ref(false)
const requestId = ref(0)
const requestType = ref('')
const pagination = reactive({
page: 1,
pageSize: 20,
total: 0
})
const tableHeight = computed(() => {
return window.innerHeight - 300 // 根据实际情况调整
})
watch(() => props.id, (newVal) => {
if (newVal) {
fetchStockInfo()
} else {
tableData.value = []
pagination.total = 0
}
})
onMounted(() => {
if (props.id) {
fetchStockInfo()
}
})
async function handlePageChange(page: number) {
pagination.page = page
await fetchStockInfo()
}
async function handlePageSizeChange(pageSize: number) {
pagination.pageSize = pageSize
pagination.page = 1
await fetchStockInfo()
}
async function fetchStockInfo() {
if (!props.id) return
}
function viewData(row: any) {
requestId.value = row.external_log_id
requestType.value = row.external_log_type
showRequestData.value = true
}
function backData(row: any) {
}
</script>
<style scoped lang="scss">
.log-container {
height: 100%;
padding: 10px 20px;
overflow: hidden;
display: flex;
flex-direction: column;
}
.toolbar-btn-group {
margin-bottom: 10px;
}
.el-table {
flex: 1;
overflow-y: auto;
}
.pagination-container {
display: flex;
justify-content: flex-end;
align-items: center;
margin-top: 20px;
}
:deep(.el-drawer__body) {
height: 100%;
padding: 0;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -15,8 +15,10 @@ export const signFormDefault = {
remask: '' remask: ''
} }
// 奇门表单默认配置 // 接口配置(apiConfig)表单默认配置
export const qimenFormDefault = { export const qimenFormDefault = {
interface_type_id: undefined as number | undefined,
interface_code: '' as string, // 本地控制字段,不提交,用于区分 QM_WMS / OPEN_API 等类型
app_name: '', app_name: '',
qimen_app_key: '', qimen_app_key: '',
qimen_customer_id: '', qimen_customer_id: '',
@ -27,16 +29,90 @@ export const qimenFormDefault = {
email: '', email: '',
is_enabled: 1 as number is_enabled: 1 as number
} }
// 面单余额调整弹窗默认配置
export const adjustBalanceDialogDefault = {
visible: false,
loading: false,
contractRow: null as any
}
// 面单余额调整表单默认配置
export const adjustBalanceFormDefault = {
change_quantity: undefined as number | undefined,
reason: ''
}
// 签约表单项配置
export const signFormItems = [
{ label: '对方主体ID', prop: 'counterparty_id', type: 'number', required: true, placeholder: '请输入对方主体ID' },
{ label: '通用名备注', prop: 'remask', type: 'input', placeholder: '给对方主体的通用名称(可选)' }
]
// 接口配置(apiConfig)表单项配置(保留备用)
export const qimenFormItems = [
{ label: '应用名称', prop: 'app_name', type: 'input', required: true, placeholder: '请输入应用名称', span: 24 },
{ label: '奇门AppKey', prop: 'qimen_app_key', type: 'input', required: true, placeholder: '请输入奇门对方AppKey', span: 12 },
{ label: '客户ID', prop: 'qimen_customer_id', type: 'input', required: true, placeholder: '奇门客户ID/货主编码', span: 12 },
{ label: '仓库编码', prop: 'qimen_warehouse_code', type: 'input', required: true, placeholder: '奇门仓库编码', span: 12 },
{ label: 'API版本', prop: 'api_version', type: 'input', placeholder: '默认1.0', span: 12 },
{ label: '联系人', prop: 'contact_person', type: 'input', span: 12 },
{ label: '联系电话', prop: 'contact_phone', type: 'input', span: 12 },
{ label: '邮箱', prop: 'email', type: 'input', span: 12 },
{ label: '是否启用', prop: 'is_enabled', type: 'switch', activeValue: 1, inactiveValue: 0, activeText: '启用', inactiveText: '停用', span: 12 }
]
// 面单余额调整表单项配置
export const adjustBalanceFormItems = [
{
label: '调整数量',
prop: 'change_quantity',
type: 'number',
required: true,
placeholder: '请输入调整数量(正数增加,负数扣减)',
span: 24,
rules: [
{ required: true, message: '请输入调整数量' },
{ type: 'number', message: '调整数量必须是数字' },
{ validator: (rule: any, value: any) => value !== 0, message: '调整数量不能为0' }
]
},
{
label: '调整原因',
prop: 'reason',
type: 'textarea',
required: true,
placeholder: '请输入人工调整缘由(必填)',
span: 24,
rows: 3,
rules: [
{ required: true, message: '请填写调整原因', trigger: 'blur' }
]
}
]
// 接口配置列表列配置
export const qimenTableColumns = [
{ prop: 'app_name', label: '应用名称', minWidth: 120 },
{ prop: 'interface_name', label: '接口类型', width: 130 },
{ prop: 'interface_code', label: '类型编码', width: 100 },
{ prop: 'qimen_app_key', label: 'AppKey', minWidth: 110 },
{ prop: 'qimen_customer_id', label: '客户ID', minWidth: 120 },
{ prop: 'qimen_warehouse_code', label: '仓库编码', width: 110 }
]
export const columns = [ export const columns = [
{ prop: 'counterparty_name', label: '对方主体', minWidth: 140 }, { prop: 'counterparty_name', label: '对方主体', Width: 90 },
{ prop: 'current_subject_role', label: '当前角色', width: 90, align: 'center' }, { prop: 'current_subject_role', label: '当前角色', width: 90, align: 'center' },
{ prop: 'auth_status', label: '签约状态', width: 100, align: 'center' }, { prop: 'auth_status', label: '签约状态', width: 100, align: 'center' },
{ prop: 'use_status', label: '使用状态', width: 90, align: 'center' }, { prop: 'use_status', label: '使用状态', width: 90, align: 'center' },
{ prop: 'is_auth_valid', label: '授权有效', width: 90, align: 'center' }, { prop: 'print_quantity', label: '面单余额', width: 100, align: 'center' },
{ prop: 'remaining_days', label: '剩余天数', width: 90, 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: 'qimen_config', label: '奇门配置', width: 100, align: 'center' },
{ prop: 'apply_time', label: '申请时间', width: 160, align: 'center' }, { prop: 'apply_time', label: '申请时间', width: 160, align: 'center' },
{ prop: 'actions', label: '操作', width: 200, align: 'center', fixed: 'right' } { prop: 'actions', label: '操作', width: 380, align: 'center', fixed: 'right' }
] ]
export const availableFields = [ export const availableFields = [
@ -57,6 +133,7 @@ export const availableFields = [
value: 'use_status', value: 'use_status',
type: 'select', type: 'select',
options: [ options: [
{ label: '全部', value: undefined },
{ label: '启用', value: 1 }, { label: '启用', value: 1 },
{ label: '禁用', value: 0 } { label: '禁用', value: 0 }
] ]
@ -81,5 +158,15 @@ export const detailPanel = [
export default { export default {
columns, columns,
availableFields, availableFields,
presetTree presetTree,
signDialogDefault,
signFormDefault,
qimenFormDefault,
adjustBalanceDialogDefault,
adjustBalanceFormDefault,
signFormItems,
qimenFormItems,
adjustBalanceFormItems,
qimenTableColumns,
detailPanel
} }

View File

@ -1246,30 +1246,19 @@ pick_sequence string 否 pick_sequence 参数
space_status string 否 space_status 参数 space_status string 否 space_status 参数
------- -------
仓货签约模块 仓货签约模块
storeWarehouse.store.list storeWarehouse.store.list
查询当前主体下的仓库-货主签约列表;当前主体是仓库时默认查看本仓下货主,当前主体是货主时默认查看本货主下签约仓库。返回的 `qimen_config` 为该签约关系绑定的奇门接口配置。 查询当前主体可见的仓库-货主签约列表
Params (0) Params (3)
Response (5)
名称 类型 必填 说明 名称 类型 必填 说明
list array 是 签约关系列表;单项含 `store_id/store_name/warehouse_id/warehouse_name/remask/use_status/qimen_config` 等字段 page number 否 页码,默认 1
total number 是 总条数 page_size number 否 分页大小,默认 20
page number 是 当前页码 keyword string 否 签约备注或主体名称关键字
page_size number 是 当前分页大小
current_subject object 是 当前登录主体信息,含 `store_id/company_name/role`
主体是仓库时,接口返回数据:
接口返回数据:
{ {
"flag": "success", "flag": "success",
"code": 200, "code": 200,
@ -1279,11 +1268,11 @@ current_subject object 是 当前登录主体信息,含 `store_id/company_name
{ {
"id": 100001, "id": 100001,
"store_id": 1000016, "store_id": 1000016,
"store_name": "测试", "store_name": "测试111",
"warehouse_id": 100000, "warehouse_id": 100000,
"warehouse_name": "测试仓", "warehouse_name": "测试仓",
"counterparty_id": 1000016, "counterparty_id": 1000016,
"counterparty_name": "测试", "counterparty_name": "测试111",
"current_subject_role": "warehouse", "current_subject_role": "warehouse",
"auth_status": 4, "auth_status": 4,
"auth_status_label": "已解除", "auth_status_label": "已解除",
@ -1298,11 +1287,35 @@ current_subject object 是 当前登录主体信息,含 `store_id/company_name
"applied_by": 1, "applied_by": 1,
"reviewed_by": 1, "reviewed_by": 1,
"ended_by": 1, "ended_by": 1,
"remask": "", "remask": "测试111",
"use_status": 1, "use_status": 1,
"policy_config": null,
"is_auth_valid": false, "is_auth_valid": false,
"remaining_days": 0, "remaining_days": 0,
"qimen_config": { "api_config": {
"id": 6,
"interface_type_id": 1,
"interface_code": "QM_WMS",
"interface_name": "奇门仓储接口",
"interface_category": "QM_WMS",
"contract_id": 100001,
"warehouse_id": 100000,
"app_name": "奇门-旺店通",
"qimen_app_key": "21363512",
"qimen_customer_id": "wdt02060120001",
"qimen_warehouse_code": "wdt02060120001",
"api_version": "1.0",
"sign_method": "md5",
"rate_limit": 1000,
"timeout_seconds": 30,
"contact_person": "",
"contact_phone": "",
"email": "",
"is_enabled": 1,
"created_at": "2026-01-20T12:30:54.000Z",
"updated_at": "2026-01-20T12:30:54.000Z"
},
"apiConfig": {
"id": 6, "id": 6,
"interface_type_id": 1, "interface_type_id": 1,
"interface_code": "QM_WMS", "interface_code": "QM_WMS",
@ -1350,9 +1363,41 @@ current_subject object 是 当前登录主体信息,含 `store_id/company_name
"ended_by": null, "ended_by": null,
"remask": "测试电商1", "remask": "测试电商1",
"use_status": 1, "use_status": 1,
"policy_config": {
"receive_mode": "standard",
"sku_visibility": "all",
"auto_allocate_bin": 0,
"allow_mix_batch": 0,
"allow_temp_storage": 0,
"print_recharge_price": 0.01,
"max_daily_inbound": 0
},
"is_auth_valid": true, "is_auth_valid": true,
"remaining_days": 217, "remaining_days": 214,
"qimen_config": { "api_config": {
"id": 4,
"interface_type_id": 1,
"interface_code": "QM_WMS",
"interface_name": "奇门仓储接口",
"interface_category": "QM_WMS",
"contract_id": 100000,
"warehouse_id": 100000,
"app_name": "奇门-吉客云",
"qimen_app_key": "24869601",
"qimen_customer_id": "jky2025102001",
"qimen_warehouse_code": "100000",
"api_version": "1.0",
"sign_method": "md5",
"rate_limit": 1000,
"timeout_seconds": 30,
"contact_person": "张经理",
"contact_phone": "13800138000",
"email": "zhang@partner.com",
"is_enabled": 1,
"created_at": "2025-10-22T15:23:22.000Z",
"updated_at": "2025-12-03T08:09:00.000Z"
},
"apiConfig": {
"id": 4, "id": 4,
"interface_type_id": 1, "interface_type_id": 1,
"interface_code": "QM_WMS", "interface_code": "QM_WMS",
@ -1386,63 +1431,146 @@ current_subject object 是 当前登录主体信息,含 `store_id/company_name
"role": "warehouse" "role": "warehouse"
} }
}, },
"timestamp": 1775267254 "timestamp": 1775541571
} }
----- -----
storeWarehouse.store.sign storeWarehouse.store.sign
签约接口,支持双阶段流程:1)不传 `temp_code` 时由当前主体发起签约并生成临时码;2)对方主体携带 `temp_code` 使用 `action=preview` 预览或 `action=confirm` 确认后,立即写入签约表并生效。 发起或确认仓库-货主签约
Params (0) Params (3)
Response (4)
名称 类型 必填 说明 名称 类型 必填 说明
mode string 是 `initiate` / `preview` / `confirm` store_id number 否 货主ID;由仓库侧发起时必传
temp_code string 否 临时码,发起和预览阶段都会返回 warehouse_id number 否 仓库ID;由货主侧发起时必传
expires_at string 否 临时码失效时间 temp_code string 否 临时签约码;传入后进入确认或预览流程
contract object 否 确认签约后返回的签约关系对象
无参数请求返回:
请求返回:
{ {
"flag": "failure", "flag": "success",
"code": 400, "code": 200,
"message": "store_id / counterparty_id 参数不能为空", "message": "ok",
"timestamp": 1775267342 "data": {
"mode": "initiate",
"temp_code": "03DFA3EF3A9A",
"expires_at": "2026-04-07T06:13:23.144Z",
"expires_in": 600,
"can_confirm": false,
"current_subject": {
"store_id": 100000,
"company_name": "测试仓",
"role": "warehouse"
},
"counterparty": {
"id": 1000016,
"company_name": "测试",
"role": "store"
}
},
"timestamp": 1775541803
} }
----- -----
storeWarehouse.store.unbind storeWarehouse.store.unbind
解除/恢复仓库-货主签约可用状态;双方均可执行,本接口只变更 `use_status`,不会改动 `auth_status`。 解除或停用签约关系
Params (0) Params (2)
Response (1)
名称 类型 必填 说明 名称 类型 必填 说明
contract object 是 更新后的签约关系对象 id number 是 签约关系ID,兼容 contract_id
use_status number 否 使用状态,0=停用,1=恢复
无参数请求返回:
请求返回:
{ {
"flag": "failure", "flag": "success",
"code": 400, "code": 200,
"message": "store_id / counterparty_id 参数不能为空", "message": "ok",
"timestamp": 1775267431 "data": {
"contract": {
"id": 100001,
"store_id": 1000016,
"store_name": "测试111",
"warehouse_id": 100000,
"warehouse_name": "测试仓",
"counterparty_id": 1000016,
"counterparty_name": "测试111",
"current_subject_role": "warehouse",
"auth_status": 4,
"auth_status_label": "已解除",
"apply_reason": "autotest temp sign flow",
"review_comment": "",
"apply_time": "2026-01-13T19:16:14.000Z",
"review_time": "2026-04-02T11:20:43.000Z",
"auth_start": "2026-04-02",
"auth_end": null,
"actual_end": "2026-04-02T11:20:43.000Z",
"print_quantity": 0,
"applied_by": 1,
"reviewed_by": 1,
"ended_by": 1,
"remask": "测试111",
"use_status": 0,
"policy_config": null,
"is_auth_valid": false,
"remaining_days": 0,
"api_config": {
"id": 6,
"interface_type_id": 1,
"interface_code": "QM_WMS",
"interface_name": "奇门仓储接口",
"interface_category": "QM_WMS",
"contract_id": 100001,
"warehouse_id": 100000,
"app_name": "奇门-旺店通",
"qimen_app_key": "21363512",
"qimen_customer_id": "wdt02060120001",
"qimen_warehouse_code": "wdt02060120001",
"api_version": "1.0",
"sign_method": "md5",
"rate_limit": 1000,
"timeout_seconds": 30,
"contact_person": "",
"contact_phone": "",
"email": "",
"is_enabled": 1,
"created_at": "2026-01-20T12:30:54.000Z",
"updated_at": "2026-01-20T12:30:54.000Z"
},
"apiConfig": {
"id": 6,
"interface_type_id": 1,
"interface_code": "QM_WMS",
"interface_name": "奇门仓储接口",
"interface_category": "QM_WMS",
"contract_id": 100001,
"warehouse_id": 100000,
"app_name": "奇门-旺店通",
"qimen_app_key": "21363512",
"qimen_customer_id": "wdt02060120001",
"qimen_warehouse_code": "wdt02060120001",
"api_version": "1.0",
"sign_method": "md5",
"rate_limit": 1000,
"timeout_seconds": 30,
"contact_person": "",
"contact_phone": "",
"email": "",
"is_enabled": 1,
"created_at": "2026-01-20T12:30:54.000Z",
"updated_at": "2026-01-20T12:30:54.000Z"
}
}
},
"timestamp": 1775541887
} }
----- -----
storeWarehouse.store.rename storeWarehouse.store.rename
修改当前主体给对方设置的签约显示名称/备注;当前主体为仓库时会更新 `store_remask`,当前主体为货主时会更新 `warehouse_remask`。 修改当前主体视角下的签约备注名
Params (0) Params (1)
Response (1)
名称 类型 必填 说明 名称 类型 必填 说明
contract object 是 更新后的签约关系对象 id number 是 签约关系ID,兼容 contract_id
无参数请求返回: 无参数请求返回:
{ {
"flag": "failure", "flag": "failure",
"code": 400, "code": 400,
@ -1451,29 +1579,33 @@ contract object 是 更新后的签约关系对象
} }
----- -----
storeWarehouse.store.listQimenConfig storeWarehouse.store.adjustPrintQuantity
按合约ID拉取该签约关系下的奇门接口配置列表,用于仓库侧查看对应货主的接口绑定情况;若当前登录主体对该合约有访问权限,也可通过 `counterparty_id` 定位后查询。 人工调整签约关系下的面单余额并记录变更日志
Params (3) Params (5)
名称 类型 必填 说明 名称 类型 必填 说明
id number 否 签约关系ID(推荐传入) id number 是 签约关系ID,兼容 contract_id
counterparty_id number 否 对方主体ID;与 `id` 二选一传入 change_quantity number 是 调整数量,整数;支持正数增加、负数扣减,且不能为 0
interface_type_id number 否 按指定奇门接口类型过滤;不传则返回该合约下全部 `QM_WMS` 配置 reason string 是 人工调整缘由,必填
Response (4) business_type string 否 业务来源类型,预留给后续 order_express 等自动扣减场景
business_id number 否 业务关联ID,预留给后续关联 wms_order_express.id
-----
storeWarehouse.store.getPolicyConfig
读取签约策略配置
Params (1)
名称 类型 必填 说明 名称 类型 必填 说明
contract_id number 是 当前查询的合约ID id number 是 签约关系ID,兼容 contract_id
contract object 是 签约关系对象,便于前端同步显示货主/仓库信息
list array 是 奇门接口配置列表;单项含 `app_name/qimen_app_key/qimen_customer_id/qimen_warehouse_code/interface_name/is_enabled` 等字段
total number 是 配置条数
接口返回数据:
请求返回:
{ {
"flag": "success", "flag": "success",
"code": 200, "code": 200,
"message": "ok", "message": "ok",
"data": { "data": {
"contract_id": 100001, "contract_id": 100001,
"policy_config": null,
"contract": { "contract": {
"id": 100001, "id": 100001,
"store_id": 1000016, "store_id": 1000016,
@ -1498,6 +1630,7 @@ total number 是 配置条数
"ended_by": 1, "ended_by": 1,
"remask": "测试111", "remask": "测试111",
"use_status": 1, "use_status": 1,
"policy_config": null,
"is_auth_valid": false, "is_auth_valid": false,
"remaining_days": 0, "remaining_days": 0,
"qimen_config": { "qimen_config": {
@ -1523,9 +1656,151 @@ total number 是 配置条数
"created_at": "2026-01-20T12:30:54.000Z", "created_at": "2026-01-20T12:30:54.000Z",
"updated_at": "2026-01-20T12:30:54.000Z" "updated_at": "2026-01-20T12:30:54.000Z"
} }
}
}, },
"list": [ "timestamp": 1775528041
}
-----
storeWarehouse.store.getPolicyConfigFields
获取签约策略可配置字段元信息列表
返回数据:
{ {
"flag": "success",
"code": 200,
"message": "ok",
"data": [
{
"key": "receive_mode",
"name": "收货模式",
"type": "enum",
"default": "standard",
"required": false,
"description": "控制货主在该仓下的收货校验模式",
"options": [
"standard",
"strict",
"manual"
]
},
{
"key": "sku_visibility",
"name": "SKU 可见范围",
"type": "enum",
"default": "all",
"required": false,
"description": "控制货主在该仓下的 SKU 可见策略",
"options": [
"all",
"whitelist",
"blacklist"
]
},
{
"key": "auto_allocate_bin",
"name": "自动分配库位",
"type": "flag",
"default": 0,
"required": false,
"description": "收货上架时是否自动推荐库位"
},
{
"key": "allow_mix_batch",
"name": "允许混批",
"type": "flag",
"default": 0,
"required": false,
"description": "是否允许不同批次混合存放"
},
{
"key": "allow_temp_storage",
"name": "允许临时存放",
"type": "flag",
"default": 0,
"required": false,
"description": "是否允许进入临时存放区"
},
{
"key": "print_recharge_price",
"name": "面单充值元/单",
"type": "number",
"default": 0,
"required": false,
"description": "面单充值元/单,支持 2 位小数",
"min": 0,
"max": 1000000,
"precision": 2,
"step": 0.01
},
{
"key": "max_daily_inbound",
"name": "单日最大收货量",
"type": "integer",
"default": 0,
"required": false,
"description": "限制该货主在仓库内的日收货上限",
"min": 0,
"max": 1000000
},
{
"key": "remark",
"name": "策略备注",
"type": "string",
"default": "",
"required": false,
"description": "补充说明该货主在仓库内的特殊约束",
"maxLength": 200
}
],
"timestamp": 1775541973
}
-----
storeWarehouse.store.savePolicyConfig
保存签约策略配置
Params (2)
名称 类型 必填 说明
id number 是 签约关系ID,兼容 contract_id
policy_config object 是 策略配置对象;仅支持 receive_mode、sku_visibility、auto_allocate_bin、allow_mix_batch、allow_temp_storage、print_recharge_price(面单充值元/单,支持 2 位小数)、max_daily_inbound、remark
请求返回:
{
"flag": "success",
"code": 200,
"message": "ok",
"data": {
"contract_id": 100001,
"policy_config": null,
"contract": {
"id": 100001,
"store_id": 1000016,
"store_name": "测试111",
"warehouse_id": 100000,
"warehouse_name": "测试仓",
"counterparty_id": 1000016,
"counterparty_name": "测试111",
"current_subject_role": "warehouse",
"auth_status": 4,
"auth_status_label": "已解除",
"apply_reason": "autotest temp sign flow",
"review_comment": "",
"apply_time": "2026-01-13T19:16:14.000Z",
"review_time": "2026-04-02T11:20:43.000Z",
"auth_start": "2026-04-02",
"auth_end": null,
"actual_end": "2026-04-02T11:20:43.000Z",
"print_quantity": 0,
"applied_by": 1,
"reviewed_by": 1,
"ended_by": 1,
"remask": "测试111",
"use_status": 0,
"policy_config": null,
"is_auth_valid": false,
"remaining_days": 0,
"api_config": {
"id": 6, "id": 6,
"interface_type_id": 1, "interface_type_id": 1,
"interface_code": "QM_WMS", "interface_code": "QM_WMS",
@ -1548,18 +1823,18 @@ total number 是 配置条数
"created_at": "2026-01-20T12:30:54.000Z", "created_at": "2026-01-20T12:30:54.000Z",
"updated_at": "2026-01-20T12:30:54.000Z" "updated_at": "2026-01-20T12:30:54.000Z"
}, },
{ "apiConfig": {
"id": 5, "id": 6,
"interface_type_id": 1, "interface_type_id": 1,
"interface_code": "QM_WMS", "interface_code": "QM_WMS",
"interface_name": "奇门仓储接口", "interface_name": "奇门仓储接口",
"interface_category": "QM_WMS", "interface_category": "QM_WMS",
"contract_id": 100001, "contract_id": 100001,
"warehouse_id": 100000, "warehouse_id": 100000,
"app_name": "奇门-客户管家", "app_name": "奇门-旺店通",
"qimen_app_key": "34597803", "qimen_app_key": "21363512",
"qimen_customer_id": "khgj2025100901", "qimen_customer_id": "wdt02060120001",
"qimen_warehouse_code": "khgj2025100902", "qimen_warehouse_code": "wdt02060120001",
"api_version": "1.0", "api_version": "1.0",
"sign_method": "md5", "sign_method": "md5",
"rate_limit": 1000, "rate_limit": 1000,
@ -1568,55 +1843,109 @@ total number 是 配置条数
"contact_phone": "", "contact_phone": "",
"email": "", "email": "",
"is_enabled": 1, "is_enabled": 1,
"created_at": "2026-01-13T11:18:01.000Z", "created_at": "2026-01-20T12:30:54.000Z",
"updated_at": "2026-01-13T11:18:01.000Z" "updated_at": "2026-01-20T12:30:54.000Z"
}
} }
],
"total": 2
}, },
"timestamp": 1775270657 "timestamp": 1775541938
} }
----- -----
storeWarehouse.store.saveQimenConfig storeWarehouse.store.listApiConfig
保存奇门接口配置(新增或更新);仅仓库主体可维护,配置挂载在 `wms_store_warehouse.id -> wms_api_app.contract_id` 的签约关系上。 查询签约关系下的接口配置列表
Params (15) Params (2)
名称 类型 必填 说明 名称 类型 必填 说明
id number 否 签约关系ID;与 `counterparty_id` 二选一传入,用于定位当前仓库与货主的签约关系 id number 是 签约关系ID,兼容 contract_id
counterparty_id number 否 对方主体(货主)ID;仓库侧调用时可用于替代 `id` interface_type_id number 否 接口类型ID,默认查询全部可用类型
interface_type_id number 否 奇门接口类型ID;不传时自动取首个启用的 `QM_WMS` 类型
app_name string 否 应用名称;不传时按“货主-仓库-奇门接口”自动生成
qimen_app_key string 是 奇门对方 AppKey
qimen_customer_id string 是 奇门客户ID/货主编码
qimen_warehouse_code string 是 奇门仓库编码
api_version string 否 API版本,默认 `1.0`
sign_method string 否 签名方式:`md5` / `hmac` / `sha256`,默认 `md5`
rate_limit number 否 限流值(次/分钟),默认 1000
timeout_seconds number 否 超时时间(秒),默认 30
contact_person string 否 联系人
contact_phone string 否 联系电话
email string 否 联系邮箱
is_enabled number 否 是否启用:1启用、0停用,默认 1
Response (3)
-----
storeWarehouse.store.saveApiConfig
新增或更新签约关系下的接口配置。QM_WMS 类型须填写奇门字段;OPEN_API 类型由系统自动生成 self_app_key 和 self_app_secret
Params (6)
名称 类型 必填 说明 名称 类型 必填 说明
action string 是 `create` 或 `update` id number 是 签约关系ID,兼容 contract_id
qimen_config object 是 保存后的奇门配置对象 interface_type_id number 是 接口类型ID,必须是 wms_interface_type 已存在的类型
contract object 是 附带最新 `qimen_config` 的签约关系对象 qimen_app_key string 否 奇门 AppKey(QM_WMS 类型必填,OPEN_API 类型不需要)
qimen_customer_id string 否 奇门客户ID(QM_WMS 类型必填,OPEN_API 类型不需要)
qimen_warehouse_code string 否 奇门仓库编码(QM_WMS 类型必填,OPEN_API 类型不需要)
app_name string 是 应用名称
----- -----
storeWarehouse.store.deleteQimenConfig storeWarehouse.store.deleteQimenConfig
删除签约关系上的奇门接口配置;仅仓库主体可执行。删除后 `storeWarehouse.store.list` 与 `storeWarehouse.store.listQimenConfig` 返回的配置将为空。 删除签约关系下的奇门接口配置
Params (3) Params (2)
名称 类型 必填 说明 名称 类型 必填 说明
id number 否 签约关系ID;与 `counterparty_id` 二选一传入 id number 是 签约关系ID,兼容 contract_id
counterparty_id number 否 对方主体(货主)ID;仓库侧调用时可用于替代 `id` interface_type_id number 否 接口类型ID
interface_type_id number 否 奇门接口类型ID;不传时自动匹配 `QM_WMS`
Response (3) 请求返回:
名称 类型 必填 说明 {
deleted boolean 是 是否已删除成功 "flag": "success",
removed object 是 被删除的奇门配置快照 "code": 200,
contract object 是 删除后返回的签约关系对象(其中 `qimen_config=null`) "message": "ok",
"data": {
"deleted": true,
"contract": {
"id": 100001,
"store_id": 1000016,
"store_name": "测试111",
"warehouse_id": 100000,
"warehouse_name": "测试仓",
"counterparty_id": 1000016,
"counterparty_name": "测试111",
"current_subject_role": "warehouse",
"auth_status": 4,
"auth_status_label": "已解除",
"apply_reason": "autotest temp sign flow",
"review_comment": "",
"apply_time": "2026-01-13T19:16:14.000Z",
"review_time": "2026-04-02T11:20:43.000Z",
"auth_start": "2026-04-02",
"auth_end": null,
"actual_end": "2026-04-02T11:20:43.000Z",
"print_quantity": 0,
"applied_by": 1,
"reviewed_by": 1,
"ended_by": 1,
"remask": "测试111",
"use_status": 0,
"policy_config": null,
"is_auth_valid": false,
"remaining_days": 0,
"api_config": null,
"apiConfig": null
},
"api_config": null,
"apiConfig": null,
"removed": {
"id": 6,
"interface_type_id": 1,
"interface_code": "QM_WMS",
"interface_name": "奇门仓储接口",
"interface_category": "QM_WMS",
"contract_id": 100001,
"warehouse_id": 100000,
"app_name": "奇门-旺店通",
"qimen_app_key": "21363512",
"qimen_customer_id": "wdt02060120001",
"qimen_warehouse_code": "wdt02060120001",
"api_version": "1.0",
"sign_method": "md5",
"rate_limit": 1000,
"timeout_seconds": 30,
"contact_person": "",
"contact_phone": "",
"email": "",
"is_enabled": 1,
"created_at": "2026-01-20T12:30:54.000Z",
"updated_at": "2026-01-20T12:30:54.000Z"
}
},
"timestamp": 1775542109
}