4月7日
This commit is contained in:
parent
df0b693592
commit
af865de6fc
@ -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
2
src/test.txt
Normal 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 入口继续用于直接查看当前生效文档。"]}]
|
||||||
@ -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() 读取
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
@ -1,85 +1,170 @@
|
|||||||
<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">
|
<template v-if="item.prop === 'current_subject_role'">
|
||||||
<el-descriptions :column="3" border size="small">
|
<el-tag size="small" :type="row.current_subject_role === 'warehouse' ? 'primary' : 'warning'">
|
||||||
<template v-for="item in detailPanel" :key="item.prop">
|
{{ row.current_subject_role === 'warehouse' ? '仓库方' : '货主方' }}
|
||||||
<el-descriptions-item :label="item.label" :span="item.span || 1">
|
</el-tag>
|
||||||
<template v-if="item.prop === 'current_subject_role'">
|
</template>
|
||||||
<el-tag size="small" :type="row.current_subject_role === 'warehouse' ? 'primary' : 'warning'">
|
|
||||||
{{ row.current_subject_role === 'warehouse' ? '仓库方' : '货主方' }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template v-else-if="item.prop === 'auth_status'">
|
<template v-else-if="item.prop === 'auth_status'">
|
||||||
<el-tag size="small" :type="getAuthStatusType(row.auth_status)">
|
<el-tag size="small" :type="getAuthStatusType(row.auth_status)">
|
||||||
{{ getAuthStatusLabel(row.auth_status) }}
|
{{ getAuthStatusLabel(row.auth_status) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-else-if="item.prop === 'auth_period'">
|
<template v-else-if="item.prop === 'auth_period'">
|
||||||
{{ formatDate(row.auth_start) || '—' }} 至 {{ formatDate(row.auth_end) || '—' }}
|
{{ formatDate(row.auth_start) || '—' }} 至 {{ formatDate(row.auth_end) || '—' }}
|
||||||
<span v-if="row.remaining_days !== undefined"> ({{ row.remaining_days }}天)</span>
|
<span v-if="row.remaining_days !== undefined"> ({{ row.remaining_days }}天)</span>
|
||||||
</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>
|
||||||
</div>
|
|
||||||
|
<!-- 第二列 -->
|
||||||
|
<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>
|
||||||
</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;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
box-sizing: border-box;
|
||||||
align-items: center;
|
background-color: #fff;
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
}
|
}
|
||||||
.panel-body {
|
|
||||||
flex: 1;
|
.details-form {
|
||||||
padding: 16px;
|
flex: 1;
|
||||||
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>
|
||||||
180
src/views/store/component/log.vue
Normal file
180
src/views/store/component/log.vue
Normal 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
@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
959
src/需求文档.txt
959
src/需求文档.txt
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user