258 lines
8.9 KiB
TypeScript
258 lines
8.9 KiB
TypeScript
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
|
||
|
||
// 签约弹窗默认配置
|
||
export const signDialogDefault = {
|
||
visible: false,
|
||
title: '发起签约',
|
||
step: 1, // 1=填写信息, 2=临时码/预览/确认
|
||
loading: false,
|
||
mode: '', // initiate / preview / confirm
|
||
tempCode: '',
|
||
contract: null as any
|
||
}
|
||
|
||
// 签约表单默认配置
|
||
export const signFormDefault = {
|
||
counterparty_id: undefined as number | undefined,
|
||
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,
|
||
interface_code: '' as string, // 本地控制字段,不提交,用于区分 QM_WMS / OPEN_API 等类型
|
||
app_name: '',
|
||
qimen_app_key: '',
|
||
qimen_customer_id: '',
|
||
qimen_warehouse_code: '',
|
||
api_version: '1.0',
|
||
contact_person: '',
|
||
contact_phone: '',
|
||
email: '',
|
||
is_enabled: 1 as number,
|
||
callback_url: ''
|
||
}
|
||
|
||
// 面单余额调整弹窗默认配置
|
||
export const adjustBalanceDialogDefault = {
|
||
visible: false,
|
||
loading: false,
|
||
fetchLoading: false,
|
||
contractRow: null as any
|
||
}
|
||
|
||
// 面单余额调整表单默认配置
|
||
export const adjustBalanceFormDefault = {
|
||
/** 列表接口返回的最新面单余额(只读展示) */
|
||
current_print_quantity: undefined as number | undefined,
|
||
target_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: 'ERP', prop: 'qimen_app_key', type: 'input', required: true, placeholder: '请选择ERP', 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 openAccountDialogDefault = {
|
||
visible: false,
|
||
loading: false
|
||
}
|
||
|
||
// 代开户表单默认配置
|
||
export const openAccountFormDefault = {
|
||
username: '',
|
||
password: '',
|
||
real_name: '',
|
||
company_name: '',
|
||
business_license: '',
|
||
contact_person: '',
|
||
contact_phone: '',
|
||
legal_person: '',
|
||
contact_email: '',
|
||
address: '',
|
||
industry: '',
|
||
logo_url: '',
|
||
domain: '',
|
||
auth_start: '',
|
||
auth_end: '',
|
||
print_quantity: 0,
|
||
apply_reason: '仓库代开户',
|
||
store_remask: '',
|
||
warehouse_remask: ''
|
||
}
|
||
|
||
// 代开户表单项配置
|
||
export const openAccountFormItems = [
|
||
{ label: '登录账号', prop: 'username', required: true, placeholder: '登录账号(全局唯一)' },
|
||
{ label: '初始密码', prop: 'password', placeholder: '留空则自动随机生成12位密码' },
|
||
{ label: '真实姓名', prop: 'real_name', placeholder: '可选' },
|
||
{ label: '公司全称', prop: 'company_name', required: true, placeholder: '公司全称(全局唯一,1-200字符)' },
|
||
{ label: '营业执照号', prop: 'business_license', placeholder: '可选' },
|
||
{ label: '联系人', prop: 'contact_person', required: true, placeholder: '联系人姓名(1-50字符)' },
|
||
{ label: '联系电话', prop: 'contact_phone', placeholder: '可选' },
|
||
{ label: '法人代表', prop: 'legal_person', placeholder: '可选' },
|
||
{ label: '联系邮箱', prop: 'contact_email', placeholder: '可选' },
|
||
{ label: '公司地址', prop: 'address', placeholder: '可选' },
|
||
{ label: '所属行业', prop: 'industry', placeholder: '可选' },
|
||
{ label: '初始面单余额', prop: 'print_quantity', type: 'number', placeholder: '默认0' },
|
||
{ label: '授权开始日期', prop: 'auth_start', type: 'date', placeholder: '默认当天' },
|
||
{ label: '授权结束日期', prop: 'auth_end', type: 'date', placeholder: '可选' },
|
||
{ label: '申请原因', prop: 'apply_reason', placeholder: '默认"仓库代开户"' },
|
||
{ label: '货主备注名', prop: 'store_remask', placeholder: '最长50字符' },
|
||
{ label: '仓库备注名', prop: 'warehouse_remask', placeholder: '最长50字符' }
|
||
]
|
||
|
||
// 面单余额调整表单项配置
|
||
export const adjustBalanceFormItems = [
|
||
{
|
||
label: '当前面单余额',
|
||
prop: 'current_print_quantity',
|
||
type: 'display',
|
||
span: 24
|
||
},
|
||
{
|
||
label: '目标余额',
|
||
prop: 'target_quantity',
|
||
type: 'number',
|
||
required: true,
|
||
placeholder: '请输入目标面单余额(将覆盖当前余额)',
|
||
span: 24,
|
||
rules: [
|
||
{ required: true, message: '请输入目标面单余额' },
|
||
{ type: 'number', message: '目标余额必须是数字' }
|
||
]
|
||
},
|
||
{
|
||
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: 'erp_display', label: 'ERP', minWidth: 110 },
|
||
{ prop: 'qimen_warehouse_code', label: '仓库编码', width: 110 },
|
||
{ prop: 'self_app_key', label: 'APPKEY', minWidth: 180 },
|
||
{ prop: 'callback_url', label: '回调地址', minWidth: 200 }
|
||
]
|
||
|
||
|
||
export const columns = [
|
||
{ prop: 'store_id', label: '货主ID', width: 90 },
|
||
{ prop: 'counterparty_name', label: '货主', minWidth: 120 },
|
||
{ prop: 'auth_status', label: '签约状态', width: 100 },
|
||
{ prop: 'warehouse_use_status', label: '使用状态', width: 90 },
|
||
{ prop: 'print_quantity', label: '面单余额', width: 100 },
|
||
{ prop: 'has_qimen_config', label: '奇门配置', width: 100 },
|
||
{ prop: 'apply_time', label: '申请时间', width: 160 },
|
||
{ prop: 'actions', label: '操作', width: 380, fixed: 'right' }
|
||
]
|
||
|
||
export const availableFields = [
|
||
{
|
||
label: '签约状态',
|
||
value: 'auth_status',
|
||
type: 'select',
|
||
options: [
|
||
{ label: '待审核', value: 1 },
|
||
{ label: '已通过', value: 2 },
|
||
{ label: '已拒绝', value: 3 },
|
||
{ label: '已解除', value: 4 },
|
||
{ label: '已过期', value: 5 }
|
||
]
|
||
},
|
||
{
|
||
label: '使用状态',
|
||
value: 'warehouse_use_status',
|
||
type: 'select',
|
||
options: [
|
||
{ label: '全部', value: undefined },
|
||
{ label: '启用', value: 1 },
|
||
{ label: '禁用', value: 0 }
|
||
]
|
||
}
|
||
]
|
||
|
||
export const presetTree: any[] = []
|
||
|
||
// 详情面板字段配置
|
||
/** 货主列表主工具栏按钮(action 与 stores/index.vue 内 toolbarActionMap 键一致) */
|
||
export const storeToolbarButtons: ToolbarButtonConfig[] = [
|
||
{ key: 'refresh', label: '刷新', type: 'primary', size: 'small', loadingKey: 'loading', action: 'loadList' },
|
||
{ key: 'openAccount', label: '代开户', type: 'success', size: 'small', action: 'openOpenAccountDialog' },
|
||
{
|
||
key: 'toggleBalance',
|
||
label: '显示余额',
|
||
dynamicLabelKey: 'balanceToggleLabel',
|
||
size: 'small',
|
||
action: 'toggleBalance'
|
||
},
|
||
{
|
||
key: 'toggleDetail',
|
||
label: '显示详情',
|
||
dynamicLabelKey: 'detailToggleLabel',
|
||
size: 'small',
|
||
action: 'toggleDetailVisible'
|
||
}
|
||
]
|
||
|
||
export const detailPanel = [
|
||
{ prop: 'id', label: '签约ID' },
|
||
{ prop: 'current_subject_role', label: '当前角色' },
|
||
{ prop: 'auth_status', label: '签约状态' },
|
||
{ prop: 'store_name', label: '货主' },
|
||
{ prop: 'remask', label: '备注' },
|
||
{ prop: 'apply_time', label: '申请时间' },
|
||
{ prop: 'auth_period', label: '授权有效期', span: 2 },
|
||
{ prop: 'review_comment', label: '审核意见' },
|
||
{ prop: 'has_qimen_config', label: '奇门配置', span: 2 }
|
||
]
|
||
|
||
export default {
|
||
columns,
|
||
availableFields,
|
||
presetTree,
|
||
signDialogDefault,
|
||
signFormDefault,
|
||
qimenFormDefault,
|
||
adjustBalanceDialogDefault,
|
||
adjustBalanceFormDefault,
|
||
signFormItems,
|
||
qimenFormItems,
|
||
adjustBalanceFormItems,
|
||
qimenTableColumns,
|
||
detailPanel
|
||
}
|