import { BasicColumn } from '/@/components/Table'; import { FormSchema } from '/@/components/Table'; import { rules } from '/@/utils/helper/validator'; import { render } from '/@/utils/common/renderUtils'; import { JVxeTypes, JVxeColumn } from '/@/components/jeecg/JVxeTable/types'; import { defHttp } from '/@/utils/http/axios'; import { getWeekMonthQuarterYear } from '/@/utils'; import { uploadUrl } from '/@/api/common/api'; //列表数据 export const columns: BasicColumn[] = [ { title: '编码(code)', align: 'center', dataIndex: 'code', }, { title: '名称(name)', align: 'center', dataIndex: 'name', width: 350, }, { title: '简称(abbreviation)', align: 'center', dataIndex: 'abbreviation', }, { title: '供应商性质(supplier nature)', align: 'center', dataIndex: 'supplierNature_dictText', width: 200, }, { title: '税号(duty paragraph)', align: 'center', dataIndex: 'dutyParagraph', width: 200, }, { title: '法人(legal person)', align: 'center', dataIndex: 'legalPerson', }, { title: '联系人(contacts)', align: 'center', dataIndex: 'contacts', }, { title: '联系电话(phone)', align: 'center', dataIndex: 'phone', }, { title: '国家(country)', align: 'center', dataIndex: 'country', }, { title: '币种(currency)', align: 'center', dataIndex: 'currency_dictText', }, { title: '付款条件(payment terms)', align: 'center', dataIndex: 'paymentTerms_dictText', width: 200, }, { title: '原厂(original factory)', align: 'center', dataIndex: 'originalFactory_dictText', width: 180, }, { title: '隶属部门(Subordinate)', align: 'center', dataIndex: 'subordinateDepart_dictText', }, { title: '状态(status)', align: 'center', dataIndex: 'status_dictText', }, { title: '考评等级(evaluation level)', align: 'center', dataIndex: 'evaluationLevel_dictText', width: 200, }, { title: '临时供应商(temporary supplier)', align: 'center', dataIndex: 'temporarySupplier', width: 300, customRender: function (t, r, index) { if (t.text == 1) { return '申请中(application in progress)'; } else if (t.text == 0) { return '是(yes)'; } else if (t.text == 2) { return '否'; } }, }, { title: '修改人', key: 'updateBy', dataIndex: 'updateBy', align: 'center', }, { title: '修改时间', key: 'updateTime', dataIndex: 'updateTime', align: 'center', }, ]; //查询数据 export const searchFormSchema: FormSchema[] = [ { label: '编码(code)', field: 'code', component: 'JInput', labelWidth: 150, componentProps: { AutoComplete: 'off', }, //colProps: {span: 6}, }, { label: '名称(name)', field: 'name', component: 'JInput', labelWidth: 150, componentProps: { AutoComplete: 'off', }, //colProps: {span: 6}, }, { label: '简称(abbreviation)', field: 'abbreviation', component: 'JInput', labelWidth: 180, //colProps: {span: 6}, }, { label: '税号(dutyParagraph)', field: 'dutyParagraph', component: 'JInput', labelWidth: 150, //colProps: {span: 6}, }, { label: '联系人(contacts)', field: 'contacts', component: 'JInput', labelWidth: 150, //colProps: {span: 6}, }, { label: '联系电话(phone)', field: 'phone', component: 'JInput', labelWidth: 150, //colProps: {span: 6}, }, { label: '付款条件(payment terms)', field: 'paymentTerms', component: 'JDictSelectTag', // component: 'JSelectMultiple', labelWidth: 180, componentProps: { dictCode: 'payment_terms', }, //colProps: {span: 6}, }, { label: '国家(country)', field: 'country', component: 'JDictSelectTag', labelWidth: 150, componentProps: { dictCode: 'country', showSearch: true, }, //colProps: {span: 6}, }, { label: '考评评级(evaluation level)', field: 'evaluationLevel', component: 'JDictSelectTag', labelWidth: 180, componentProps: { dictCode: 'grade', }, //colProps: {span: 6}, }, { label: '原厂(original factory)', field: 'originalFactory', component: 'JDictSelectTag', labelWidth: 150, componentProps: { dictCode: 'yes_or_no', }, //colProps: {span: 6}, }, { label: '供应商性质(supplier nature)', field: 'supplierNature', component: 'JDictSelectTag', labelWidth: 180, componentProps: { dictCode: 'supplier_nature', }, //colProps: {span: 6}, }, { label: '状态(status)', field: 'status', labelWidth: 150, component: 'JDictSelectTag', componentProps: { dictCode: 'valid_status', }, //colProps: {span: 6}, }, { label: '临时供应商(temporary supplier)', field: 'temporarySupplier', component: 'JDictSelectTag', labelWidth: 210, componentProps: { dictCode: 'should_apply', }, //colProps: {span: 6}, }, ]; //表单数据 export const formSchema: FormSchema[] = [ { label: '编码(code)', field: 'code', component: 'Input', labelWidth: 200, colProps: { span: 12 }, componentProps: { placeholder: '自动生成', }, dynamicDisabled: true, }, { label: '名称(name)', field: 'name', colProps: { span: 12 }, component: 'Input', labelWidth: 200, required: true, componentProps: ({ formModel }) => { return { AutoComplete: 'off', onblur: ({ currentTarget }) => { const stringLog = currentTarget.value; let newString = ''; for (let i = 0; i < stringLog.length; i++) { if (/^[A-Za-z]$/.test(stringLog[i]) && /^[a-z]$/.test(stringLog[i])) { newString = newString + stringLog[i].toUpperCase(); } else { newString = newString + stringLog[i]; } } formModel.name = newString; }, }; }, }, { label: '简称(abbreviation)', field: 'abbreviation', colProps: { span: 12 }, labelWidth: 200, component: 'Input', componentProps: ({ formModel }) => { return { AutoComplete: 'off', onblur: ({ currentTarget }) => { const stringLog = currentTarget.value; let newString = ''; for (let i = 0; i < stringLog.length; i++) { if (/^[A-Za-z]$/.test(stringLog[i]) && /^[a-z]$/.test(stringLog[i])) { newString = newString + stringLog[i].toUpperCase(); } else { newString = newString + stringLog[i]; } } formModel.abbreviation = newString; }, }; }, }, { label: '曾用名(name used before)', field: 'nameUsedBefore', colProps: { span: 12 }, component: 'Input', labelWidth: 200, componentProps: { AutoComplete: 'off', }, }, { label: '税号(duty paragraph)', field: 'dutyParagraph', colProps: { span: 12 }, labelWidth: 200, component: 'Input', componentProps: { AutoComplete: 'off', }, }, { label: '法人(legal person)', field: 'legalPerson', colProps: { span: 12 }, component: 'Input', labelWidth: 200, componentProps: { AutoComplete: 'off', }, }, { label: '联系人(contacts)', field: 'contacts', colProps: { span: 12 }, labelWidth: 200, component: 'Input', componentProps: { AutoComplete: 'off', }, }, { label: '联系电话(phone)', field: 'phone', colProps: { span: 12 }, component: 'Input', labelWidth: 200, componentProps: { AutoComplete: 'off', }, }, { label: '邮箱(email)', field: 'email', colProps: { span: 12 }, labelWidth: 200, component: 'Input', componentProps: { AutoComplete: 'off', }, }, { label: '注册地址(register address)', field: 'registerAddress', colProps: { span: 12 }, component: 'Input', labelWidth: 200, componentProps: { AutoComplete: 'off', }, }, { label: '公司地址(address)', field: 'address', colProps: { span: 12 }, labelWidth: 200, component: 'Input', componentProps: { AutoComplete: 'off', }, }, { label: '供应商性质(supplier nature)', field: 'supplierNature', colProps: { span: 12 }, labelWidth: 200, component: 'JDictSelectTag', componentProps: { dictCode: 'supplier_nature', }, }, { label: '国家(country)', field: 'country', colProps: { span: 12 }, labelWidth: 200, component: 'JDictSelectTag', componentProps: { dictCode: 'country', }, }, { label: '国外供应商(abroad supplier)', field: 'abroadSupplier', colProps: { span: 12 }, component: 'JDictSelectTag', componentProps: { dictCode: 'yes_or_no', stringToNumber: true, }, labelWidth: 200, }, { label: '币种(currency)', field: 'currency', colProps: { span: 12 }, labelWidth: 200, component: 'JDictSelectTag', componentProps: { dictCode: 'currency ', }, }, { label: '原厂(original factory)', field: 'originalFactory', colProps: { span: 12 }, labelWidth: 200, component: 'JDictSelectTag', componentProps: { dictCode: 'yes_or_no', stringToNumber: true, }, }, { label: '开户行(opening bank)', field: 'openingBank', labelWidth: 200, colProps: { span: 12 }, component: 'Input', componentProps: { AutoComplete: 'off', }, }, { label: '付款条件(payment terms)', field: 'paymentTerms', colProps: { span: 12 }, labelWidth: 200, component: 'JDictSelectTag', componentProps: { dictCode: 'supplier_payment_terms', }, }, { label: '户名(opening name)', field: 'openingName', colProps: { span: 12 }, labelWidth: 200, component: 'Input', componentProps: { AutoComplete: 'off', }, }, { label: '银行代码(swift code)', field: 'swiftCode', labelWidth: 200, colProps: { span: 12 }, component: 'Input', componentProps: { AutoComplete: 'off', }, }, { label: '银行帐号(bank account)', field: 'bankAccount', colProps: { span: 12 }, labelWidth: 200, component: 'Input', componentProps: { AutoComplete: 'off', }, }, { label: '状态(status)', field: 'status', colProps: { span: 12 }, labelWidth: 200, component: 'JDictSelectTag', defaultValue: 1, componentProps: { dictCode: 'valid_status', stringToNumber: true, }, }, { label: '营业执照(business license)', field: 'businessLicense', colProps: { span: 6 }, labelWidth: 200, component: 'JUpload', componentProps: { //是否显示选择按钮 text: '上传', //最大上传数 maxCount: 1, //是否显示下载按钮 download: true, }, }, { label: '其他文件(other files)', field: 'otherFiles', colProps: { span: 6 }, labelWidth: 200, component: 'JUpload', }, { label: '隶属部门(subordinate)', field: 'subordinateDepart', colProps: { span: 12 }, labelWidth: 200, component: 'ApiSelect', componentProps: { mode: 'multiple',//multiple: 多选;不填写为单选 //请求api,返回结果{ result: { records: [{'id':'1',name:'scott'},{'id':'2',name:'小张'}] }} api: () => defHttp.get({ url: '/sys/sysDepart/listAll',params:{pageSize: -1}}), //数值转成String numberToString: false, //标题字段 labelField: 'departName', //值字段 valueField: 'id', //请求参数 params: { pageSize: -1, status: 1 }, //返回结果字段 resultField: 'records', filterOption: 'true', optionFilterProp: 'label', showSearch: 'true', }, }, // { // label: '隶属部门(subordinate)', // field: 'subordinateDepart', // component: 'JSelectDept',colProps: { span: 12 }, // labelWidth: 200, // componentProps: ({ formActionType, formModel }) => { // return { // // sync: false, // // checkStrictly: true, // defaultExpandLevel: 2, // // onSelect: (options, values) => { // // const { updateSchema } = formActionType; // // //所属部门修改后更新负责部门下拉框数据 // // updateSchema([ // // { // // field: 'departIds', // // componentProps: { options }, // // }, // // ]); // // //update-begin---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整--- // // if(!values){ // // formModel.departIds = []; // // return; // // } // // //update-end---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整--- // // //所属部门修改后更新负责部门数据 // // formModel.departIds && (formModel.departIds = formModel.departIds.filter((item) => values.value.indexOf(item) > -1)); // // }, // }; // }, // }, { label: '备注(notes)', field: 'notes', colProps: { span: 24 }, labelWidth: 200, component: 'Input', componentProps: { AutoComplete: 'off', }, }, // TODO 主键隐藏字段,目前写死为ID { label: '', field: 'id', component: 'Input', show: false, }, ]; //子表单数据 //子表表格配置 export const cuspSupplierProfileManColumns: JVxeColumn[] = [ { title: '姓名(name)', key: 'name', type: JVxeTypes.input, placeholder: '请输入${title}', defaultValue: '', }, { title: '电话(mobile)', key: 'mobile', type: JVxeTypes.input, placeholder: '请输入${title}', defaultValue: '', }, { title: '邮箱(email)', key: 'email', type: JVxeTypes.input, placeholder: '请输入${title}', defaultValue: '', }, { title: '职位(position)', key: 'position', type: JVxeTypes.input, placeholder: '请输入${title}', defaultValue: '', }, { title: '备注(notes)', key: 'notes', type: JVxeTypes.input, placeholder: '请输入${title}', defaultValue: '', }, { title: '操作(operation)', key: 'action', width: '200px', // 固定在右侧 fixed: 'right', // 对齐方式为居中 align: 'center', // 组件类型定义为【插槽】 type: JVxeTypes.slot, // slot 的名称,对应 v-slot 冒号后面和等号前面的内容 slotName: 'action', }, ]; export const cuspSupplierProfileQualificationColumns: JVxeColumn[] = [ { title: '资质证书名称(qualification certificate name)', key: 'qualificationCertificateName', type: JVxeTypes.input, placeholder: '请输入${title}', defaultValue: '', }, { title: '有效期始(valid begin)', key: 'validBegin', type: JVxeTypes.date, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '有效期止(valid end)', key: 'validEnd', // type: JVxeTypes.datetime, type: JVxeTypes.date, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '资质证书附件(qualification certificate)', key: 'qualificationCertificate', type: JVxeTypes.upload, btnText: '点击上传', token: true, responseName: 'message', action: uploadUrl, }, { title: '临期提醒', key: 'deadlineReminder', type: JVxeTypes.select, options: [], dictCode: 'yes_or_no', stringToNumber: true, placeholder: '请选择', }, { title: '是否有ISO资质', key: 'isIos', type: JVxeTypes.select, options: [], dictCode: 'yes_or_no', stringToNumber: true, placeholder: '请选择', }, { title: '操作(operation)', key: 'action', width: '200px', // 固定在右侧 fixed: 'right', // 对齐方式为居中 align: 'center', // 组件类型定义为【插槽】 type: JVxeTypes.slot, // slot 的名称,对应 v-slot 冒号后面和等号前面的内容 slotName: 'action', }, ]; // 高级查询数据 export const superQuerySchema = { status: { title: '状态(1-启用,0-停用)', order: 0, view: 'number', type: 'number', dictCode: '' }, code: { title: '编码', order: 2, view: 'text', type: 'string' }, name: { title: '名称', order: 3, view: 'text', type: 'string' }, abbreviation: { title: '简称', order: 4, view: 'text', type: 'string' }, nameUsedBefore: { title: '曾用名', order: 5, view: 'text', type: 'string' }, dutyParagraph: { title: '税号', order: 6, view: 'text', type: 'string' }, legalPerson: { title: '法人', order: 7, view: 'text', type: 'string' }, contacts: { title: '联系人', order: 8, view: 'text', type: 'string' }, phone: { title: '联系电话', order: 9, view: 'text', type: 'string' }, email: { title: '邮箱', order: 10, view: 'text', type: 'string' }, registerAddress: { title: '注册地址', order: 11, view: 'text', type: 'string' }, address: { title: '公司地址', order: 12, view: 'text', type: 'string' }, supplierNature: { title: '供应商性质', order: 13, view: 'list', type: 'string', dictCode: '' }, country: { title: '国家', order: 14, view: 'list', type: 'string', dictCode: '' }, currency: { title: '币种', order: 15, view: 'text', type: 'string' }, abroadSupplier: { title: '国外供应商', order: 16, view: 'number', type: 'number' }, originalFactory: { title: '原厂', order: 17, view: 'number', type: 'number', dictCode: '' }, openingBank: { title: '开户行', order: 18, view: 'text', type: 'string' }, paymentTerms: { title: '付款条件', order: 19, view: 'list', type: 'string', dictCode: '' }, swiftCode: { title: '银行代码', order: 20, view: 'text', type: 'string' }, bankAccount: { title: '银行帐号', order: 21, view: 'text', type: 'string' }, businessLicense: { title: '营业执照', order: 22, view: 'text', type: 'string' }, otherFiles: { title: '其他文件', order: 23, view: 'text', type: 'string' }, notes: { title: '备注', order: 24, view: 'text', type: 'string' }, temporarySupplier: { title: '临时供应商', order: 25, view: 'number', type: 'number', dictCode: '' }, evaluationLevel: { title: '供应商等级', order: 26, view: 'list', type: 'string', dictCode: '' }, //子表高级查询 cuspSupplierProfileMan: { title: '供应商档案-联系人', view: 'table', fields: { status: { title: '状态(1-启用,0-停用)', order: 0, view: 'number', type: 'number' }, headId: { title: '主表主键(供应商档案)', order: 2, view: 'text', type: 'string' }, code: { title: '编码', order: 3, view: 'text', type: 'string' }, name: { title: '姓名', order: 4, view: 'text', type: 'string' }, mobile: { title: '电话', order: 5, view: 'text', type: 'string' }, email: { title: '邮箱', order: 6, view: 'text', type: 'string' }, position: { title: '职位', order: 7, view: 'text', type: 'string' }, }, }, cuspSupplierProfileQualification: { title: '供应商档案-资质信息', view: 'table', fields: { status: { title: '状态(1-启用,0-停用)', order: 0, view: 'number', type: 'number' }, headId: { title: '主表主键(供应商档案)', order: 2, view: 'text', type: 'string' }, qualificationCertificateName: { title: '资质证书名称', order: 3, view: 'text', type: 'string' }, qualificationCertificateCode: { title: '资质证书编码', order: 4, view: 'text', type: 'string' }, validBegin: { title: '有效期始', order: 5, view: 'datetime', type: 'string' }, validEnd: { title: '有效期止', order: 6, view: 'datetime', type: 'string' }, qualificationCertificate: { title: '资质证书附件', order: 7, view: 'text', type: 'string' }, deadlineReminder: { title: '临期提醒', order: 8, view: 'number', type: 'number' }, }, }, }; /** * 流程表单调用这个方法获取formSchema * @param param */ export function getBpmFormSchema(_formData): FormSchema[] { // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema return formSchema; }