// 签约弹窗默认配置 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_warehouse_code: '', api_version: '1.0', contact_person: '', contact_phone: '', email: '', is_enabled: 1 as number } // 面单余额调整弹窗默认配置 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 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 } ] export const columns = [ { prop: 'counterparty_name', label: '对方主体', Width: 90 }, { prop: 'current_subject_role', label: '当前角色', width: 90, align: 'center' }, { prop: 'auth_status', label: '签约状态', width: 100, align: 'center' }, { prop: 'use_status', label: '使用状态', width: 90, align: 'center' }, { prop: 'print_quantity', label: '面单余额', width: 100, align: 'center' }, //{ prop: 'is_auth_valid', label: '授权有效', width: 90, align: 'center' }, // { prop: 'remaining_days', label: '剩余天数', width: 90, align: 'center' }, { prop: 'has_qimen_config', label: '奇门配置', width: 100, align: 'center' }, { prop: 'apply_time', label: '申请时间', width: 160, align: 'center' }, { prop: 'actions', label: '操作', width: 380, align: 'center', fixed: 'right' } ] export const availableFields = [ // { label: '对方主体', value: 'counterparty_id', type: 'input' }, { label: '签约状态', value: 'auth_status', type: 'select', options: [ { label: '待审核', value: 1 }, { label: '已通过', value: 2 }, { label: '已拒绝', value: 3 }, { label: '已终止', value: 4 } ] }, { label: '使用状态', value: 'use_status', type: 'select', options: [ { label: '全部', value: undefined }, { label: '启用', value: 1 }, { label: '禁用', value: 0 } ] } ] export const presetTree: any[] = [] // 详情面板字段配置 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 }