@@ -497,6 +522,13 @@
编辑
+ 复制配置
-
-
+
+
+
+ 随机生成
+
+
@@ -652,8 +688,12 @@
-
-
+
+
+
+ 随机生成
+
+
@@ -1930,6 +1970,7 @@ async function loadQimenConfigs() {
function handleInterfaceTypeChange(_code: string) {
// interface_code 已由 v-model 绑定自动更新,此处只做联动清空
qimenForm.qimen_app_key = ''
+ qimenForm.qimen_customer_id = ''
qimenForm.qimen_warehouse_code = ''
}
@@ -1943,6 +1984,10 @@ function randomAlphaNum(length = 12): string {
return result
}
+function generateQimenCustomerCode() {
+ qimenForm.qimen_customer_id = `ST_${randomAlphaNum(10)}`
+}
+
function generateQimenWarehouseCode() {
qimenForm.qimen_warehouse_code = `WH_${randomAlphaNum(10)}`
}
@@ -1971,7 +2016,7 @@ async function copyText(text: string) {
async function copyEditingQimenCustomerId() {
const customerId = getEditingQimenCustomerId()
if (!customerId) {
- ElMessage.warning('暂无可复制的客户ID')
+ ElMessage.warning('暂无可复制的货主编码')
return
}
@@ -1989,12 +2034,25 @@ async function copyEditingQimenCustomerId() {
document.execCommand('copy')
document.body.removeChild(input)
}
- ElMessage.success('客户ID已复制')
+ ElMessage.success('货主编码已复制')
} catch {
- ElMessage.error('复制客户ID失败')
+ ElMessage.error('复制货主编码失败')
}
}
+function copyQmWmsConfig(row: any) {
+ const customerId = String(row.qimen_customer_id || '').trim()
+ const warehouseCode = String(row.qimen_warehouse_code || '').trim()
+ if (!customerId && !warehouseCode) {
+ ElMessage.warning('暂无可复制的奇门配置')
+ return
+ }
+ const lines: string[] = []
+ if (customerId) lines.push(`货主编码:${customerId}`)
+ if (warehouseCode) lines.push(`仓库编码:${warehouseCode}`)
+ copyText(lines.join('\n'))
+}
+
function copyOpenApiConfig(row: any) {
const baseApi = String(import.meta.env.VITE_APP_BASE_API || '').replace(/\/+$/, '')
const lines: string[] = []
@@ -2053,6 +2111,10 @@ async function submitQimenForm() {
ElMessage.warning('奇门备山 QM_WMS 类型必须选择ERP')
return
}
+ if (!qimenForm.qimen_customer_id?.trim()) {
+ ElMessage.warning('奇门备山 QM_WMS 类型必须填写货主编码')
+ return
+ }
if (!qimenForm.qimen_warehouse_code?.trim()) {
ElMessage.warning('奇门备山 QM_WMS 类型必须填写仓库编码')
return
diff --git a/src/views/store/stores/store-config.ts b/src/views/store/stores/store-config.ts
index abf81262..002c12a6 100644
--- a/src/views/store/stores/store-config.ts
+++ b/src/views/store/stores/store-config.ts
@@ -65,6 +65,7 @@ export const signFormItems = [
export const qimenFormItems = [
{ label: '应用名称', prop: 'app_name', type: 'input', required: true, placeholder: '请输入应用名称', span: 24 },
{ label: 'ERP', prop: 'qimen_app_key', type: 'input', required: true, placeholder: '请选择ERP', span: 12 },
+ { label: '货主编码', prop: 'qimen_customer_id', type: 'input', required: true, placeholder: '奇门货主编码', 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 },
@@ -163,6 +164,7 @@ export const qimenTableColumns = [
{ prop: 'interface_name', label: '接口类型', width: 130 },
{ prop: 'interface_code', label: '类型编码', width: 100 },
{ prop: 'erp_display', label: 'ERP', minWidth: 110 },
+ { prop: 'qimen_customer_id', label: '货主编码', width: 110 },
{ prop: 'qimen_warehouse_code', label: '仓库编码', width: 110 },
{ prop: 'self_app_key', label: 'APPKEY', minWidth: 180 },
{ prop: 'callback_url', label: '回调地址', minWidth: 200 }
diff --git a/src/views/warehouses/index.vue b/src/views/warehouses/index.vue
index da3b5d3b..0d1bfc68 100644
--- a/src/views/warehouses/index.vue
+++ b/src/views/warehouses/index.vue
@@ -181,9 +181,6 @@
-
-
-
@@ -349,7 +346,7 @@ import { ref, reactive, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Search, Plus, Refresh } from '@element-plus/icons-vue'
import {
- storeWarehouseList,
+ warehouseList,
storeWarehouseSign,
storeWarehouseConfirmSign,
storeWarehouseUnbind,
@@ -431,7 +428,7 @@ async function loadList() {
}
if (queryForm.keyword) params.keyword = queryForm.keyword
- const res = await storeWarehouseList(params) as any
+ const res = await warehouseList(params) as any
if (res?.data) {
const payload = res.data
list.value = payload.list || []
@@ -559,14 +556,14 @@ const signDialog = reactive({
step: 1,
loading: false,
signMode: '' as string,
+ temp_code: '' as string,
contract: null as any,
currentSubject: null as any,
counterparty: null as any
})
const signForm = reactive({
- counterparty_id: undefined as number | undefined,
- remask: ''
+ counterparty_id: undefined as number | undefined
})
function openSignDialog() {
@@ -574,18 +571,18 @@ function openSignDialog() {
signDialog.step = 1
signDialog.title = '发起签约'
signDialog.signMode = ''
+ signDialog.temp_code = ''
signDialog.contract = null
signDialog.currentSubject = null
signDialog.counterparty = null
signForm.counterparty_id = undefined
- signForm.remask = ''
}
function resetSignDialog() {
signForm.counterparty_id = undefined
- signForm.remask = ''
signDialog.step = 1
signDialog.loading = false
+ signDialog.temp_code = ''
}
async function doPreviewSign() {
@@ -596,12 +593,12 @@ async function doPreviewSign() {
signDialog.loading = true
try {
const res = await storeWarehouseSign({
- action: 'preview',
- warehouse_id: signForm.counterparty_id
+ counterparty_id: signForm.counterparty_id
}) as any
if (res?.data) {
const d = res.data
signDialog.signMode = d.mode || ''
+ signDialog.temp_code = d.temp_code || ''
signDialog.contract = d.contract || null
signDialog.currentSubject = d.current_subject || null
signDialog.counterparty = d.counterparty || null
@@ -622,10 +619,13 @@ async function doSubmitSign() {
}
signDialog.loading = true
try {
- await storeWarehouseSign({
- counterparty_id: signForm.counterparty_id,
- remask: signForm.remask
- })
+ const payload: { counterparty_id: number; temp_code?: string } = {
+ counterparty_id: signForm.counterparty_id
+ }
+ if (signDialog.temp_code) {
+ payload.temp_code = signDialog.temp_code
+ }
+ await storeWarehouseSign(payload)
ElMessage.success('签约申请已提交')
signDialog.visible = false
loadList()
@@ -639,6 +639,7 @@ async function doSubmitSign() {
function goBackToStep1() {
signDialog.step = 1
signDialog.signMode = ''
+ signDialog.temp_code = ''
signDialog.contract = null
signDialog.currentSubject = null
signDialog.counterparty = null