192 lines
4.6 KiB
TypeScript
192 lines
4.6 KiB
TypeScript
import {BasicColumn} from '/@/components/Table';
|
||
import {FormSchema} from '/@/components/Table';
|
||
import { rules} from '/@/utils/helper/validator';
|
||
import { render } from '/@/utils/common/renderUtils';
|
||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||
//列表数据
|
||
export const columns: BasicColumn[] = [
|
||
{
|
||
title: '供应商名称',
|
||
align:"center",
|
||
dataIndex: 'suppliersName'
|
||
},
|
||
{
|
||
title: '供应商性质',
|
||
align:"center",
|
||
dataIndex: 'suppliersNature_dictText'
|
||
},
|
||
{
|
||
title: '供应商地址',
|
||
align:"center",
|
||
dataIndex: 'suppliersAddress'
|
||
},
|
||
{
|
||
title: '负责人',
|
||
align:"center",
|
||
dataIndex: 'personInCharge'
|
||
},
|
||
{
|
||
title: '联系电话',
|
||
align:"center",
|
||
dataIndex: 'contactNumber'
|
||
},
|
||
{
|
||
title: '供应状态',
|
||
align:"center",
|
||
dataIndex: 'supplyState_dictText'
|
||
},
|
||
{
|
||
title: '开户行',
|
||
align:"center",
|
||
dataIndex: 'openingBank'
|
||
},
|
||
{
|
||
title: '开户行账号',
|
||
align:"center",
|
||
dataIndex: 'openingBankNo'
|
||
},
|
||
{
|
||
title: '微信账号',
|
||
align:"center",
|
||
dataIndex: 'wechartId'
|
||
},
|
||
{
|
||
title: '资质照片',
|
||
align:"center",
|
||
dataIndex: 'imgPath',
|
||
customRender:render.renderImage,
|
||
},
|
||
];
|
||
//查询数据
|
||
export const searchFormSchema: FormSchema[] = [
|
||
{
|
||
label: "供应商名称",
|
||
field: 'suppliersName',
|
||
component: 'Input',
|
||
//colProps: {span: 6},
|
||
},
|
||
{
|
||
label: "负责人",
|
||
field: 'personInCharge',
|
||
component: 'Input',
|
||
//colProps: {span: 6},
|
||
},
|
||
{
|
||
label: "供应状态",
|
||
field: 'supplyState',
|
||
component: 'JSelectMultiple',
|
||
componentProps:{
|
||
dictCode:"supply_state"
|
||
},
|
||
//colProps: {span: 6},
|
||
},
|
||
];
|
||
//表单数据
|
||
export const formSchema: FormSchema[] = [
|
||
{
|
||
label: '供应商名称',
|
||
field: 'suppliersName',
|
||
component: 'Input',
|
||
dynamicRules: ({model,schema}) => {
|
||
return [
|
||
{ required: true, message: '请输入供应商名称!'},
|
||
];
|
||
},
|
||
},
|
||
{
|
||
label: '供应商性质',
|
||
field: 'suppliersNature',
|
||
component: 'JDictSelectTag',
|
||
componentProps:{
|
||
dictCode:"suppliers_nature",
|
||
type: "radio"
|
||
},
|
||
},
|
||
{
|
||
label: '供应商地址',
|
||
field: 'suppliersAddress',
|
||
component: 'Input',
|
||
},
|
||
{
|
||
label: '负责人',
|
||
field: 'personInCharge',
|
||
component: 'Input',
|
||
},
|
||
{
|
||
label: '联系电话',
|
||
field: 'contactNumber',
|
||
component: 'Input',
|
||
dynamicRules: ({model,schema}) => {
|
||
return [
|
||
{ required: true, message: '请输入联系电话!'},
|
||
];
|
||
},
|
||
},
|
||
{
|
||
label: '供应状态',
|
||
field: 'supplyState',
|
||
component: 'JDictSelectTag',
|
||
componentProps:{
|
||
dictCode:"supply_state",
|
||
type: "radio"
|
||
},
|
||
dynamicRules: ({model,schema}) => {
|
||
return [
|
||
{ required: true, message: '请输入供应状态!'},
|
||
];
|
||
},
|
||
},
|
||
{
|
||
label: '开户行',
|
||
field: 'openingBank',
|
||
component: 'Input',
|
||
},
|
||
{
|
||
label: '开户行账号',
|
||
field: 'openingBankNo',
|
||
component: 'Input',
|
||
},
|
||
{
|
||
label: '微信账号',
|
||
field: 'wechartId',
|
||
component: 'Input',
|
||
},
|
||
{
|
||
label: '资质照片',
|
||
field: 'imgPath',
|
||
component: 'JImageUpload',
|
||
componentProps:{
|
||
fileMax: 0
|
||
},
|
||
},
|
||
// TODO 主键隐藏字段,目前写死为ID
|
||
{
|
||
label: '',
|
||
field: 'id',
|
||
component: 'Input',
|
||
show: false
|
||
},
|
||
];
|
||
|
||
// 高级查询数据
|
||
export const superQuerySchema = {
|
||
suppliersName: {title: '供应商名称',order: 0,view: 'text', type: 'string',},
|
||
suppliersNature: {title: '供应商性质',order: 1,view: 'radio', type: 'string',dictCode: 'suppliers_nature',},
|
||
suppliersAddress: {title: '供应商地址',order: 2,view: 'text', type: 'string',},
|
||
personInCharge: {title: '负责人',order: 3,view: 'text', type: 'string',},
|
||
contactNumber: {title: '联系电话',order: 4,view: 'text', type: 'string',},
|
||
supplyState: {title: '供应状态',order: 5,view: 'radio', type: 'string',dictCode: 'supply_state',},
|
||
openingBank: {title: '开户行',order: 6,view: 'text', type: 'string',},
|
||
openingBankNo: {title: '开户行账号',order: 7,view: 'text', type: 'string',},
|
||
wechartId: {title: '微信账号',order: 8,view: 'text', type: 'string',},
|
||
imgPath: {title: '资质照片',order: 9,view: 'image', type: 'string',},
|
||
};
|
||
|
||
/**
|
||
* 流程表单调用这个方法获取formSchema
|
||
* @param param
|
||
*/
|
||
export function getBpmFormSchema(_formData): FormSchema[]{
|
||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
||
return formSchema;
|
||
} |