Files
qhmes/jeecgboot-vue3/src/views/xslmes/mesXslCustomer/MesXslCustomer.data.ts

106 lines
3.9 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { BasicColumn, FormSchema } from '/@/components/Table';
export const columns: BasicColumn[] = [
{ title: 'ID', align: 'center', dataIndex: 'id', width: 280, ellipsis: true, defaultHidden: true },
{ title: '客户编码', align: 'center', dataIndex: 'customerCode', width: 140 },
{ title: '客户名称', align: 'center', dataIndex: 'customerName', width: 180 },
{ title: '客户简称', align: 'center', dataIndex: 'customerShortName', width: 120 },
{ title: '客户区域', align: 'center', dataIndex: 'customerRegion_dictText', width: 100 },
{ title: 'ERP编码', align: 'center', dataIndex: 'erpCode', width: 140 },
// 库表 status + 字典 xslmes_customer_status 翻译(后端 DictAspect 填充 status_dictText
{ title: '状态', align: 'center', dataIndex: 'status_dictText', width: 100 },
{ title: '客户描述', align: 'center', dataIndex: 'customerDesc', width: 200, ellipsis: true },
{ title: '创建人', align: 'center', dataIndex: 'createBy', width: 100 },
{
title: '创建时间',
align: 'center',
dataIndex: 'createTime',
width: 165,
customRender: ({ text }) => (!text ? '' : String(text).length > 19 ? String(text).substring(0, 19) : text),
},
{ title: '租户ID', align: 'center', dataIndex: 'tenantId', width: 90, defaultHidden: true },
];
export const searchFormSchema: FormSchema[] = [
{ label: '客户编码', field: 'customerCode', component: 'JInput', colProps: { span: 6 } },
{ label: '客户名称', field: 'customerName', component: 'JInput', colProps: { span: 6 } },
{ label: '客户简称', field: 'customerShortName', component: 'JInput', colProps: { span: 6 } },
{
label: '客户区域',
field: 'customerRegion',
component: 'JDictSelectTag',
componentProps: { dictCode: 'xslmes_customer_region' },
colProps: { span: 6 },
},
{
label: '状态',
field: 'status',
component: 'JDictSelectTag',
componentProps: { dictCode: 'xslmes_customer_status' },
colProps: { span: 6 },
},
];
export const formSchema: FormSchema[] = [
{ label: '', field: 'id', component: 'Input', show: false },
{
label: '客户编码',
field: 'customerCode',
required: true,
component: 'Input',
componentProps: { placeholder: '请输入客户编码' },
},
{
label: '客户名称',
field: 'customerName',
required: true,
component: 'Input',
componentProps: { placeholder: '请输入客户名称' },
},
{
label: '客户简称',
field: 'customerShortName',
component: 'Input',
componentProps: { placeholder: '请输入客户简称' },
},
{
label: '客户区域',
field: 'customerRegion',
component: 'JDictSelectTag',
componentProps: { dictCode: 'xslmes_customer_region', placeholder: '请选择客户区域' },
},
{
label: 'ERP编码',
field: 'erpCode',
component: 'Input',
componentProps: { placeholder: '请输入ERP编码' },
},
{
label: '状态',
field: 'status',
component: 'JDictSelectTag',
componentProps: { dictCode: 'xslmes_customer_status', placeholder: '请选择状态' },
// 默认启用仅在新增弹窗内通过 setFieldsValue 写入,避免编辑时 schema 默认值覆盖接口里的 status
},
{
label: '客户描述',
field: 'customerDesc',
component: 'InputTextArea',
componentProps: { rows: 3, placeholder: '请输入客户描述' },
},
{
label: '租户ID',
field: 'tenantId',
component: 'InputNumber',
componentProps: { placeholder: '租户ID可空' },
},
];
export const superQuerySchema = {
customerCode: { title: '客户编码', order: 0, view: 'text' },
customerName: { title: '客户名称', order: 1, view: 'text' },
customerShortName: { title: '客户简称', order: 2, view: 'text' },
customerRegion: { title: '客户区域', order: 3, view: 'list', dictCode: 'xslmes_customer_region' },
status: { title: '状态', order: 4, view: 'list', dictCode: 'xslmes_customer_status' },
};