import { BasicColumn } from '/@/components/Table'; import { FormSchema } from '/@/components/Table'; import { JVxeTypes, JVxeColumn } from '/@/components/jeecg/JVxeTable/types'; import { defHttp } from '/@/utils/http/axios'; import { ProjectOption, CustomerOption } from './SaleContract.api'; //列表数据 export const columns: BasicColumn[] = [ { title: '单据编码(bill code)', align: 'center', dataIndex: 'billCode', }, { title: '单据日期(bill date)', align: 'center', sorter: true, dataIndex: 'billDate', customRender: ({ text }) => { text = !text ? '' : text.length > 10 ? text.substr(0, 10) : text; return text; }, }, { title: '项目(Project)', align: 'center', dataIndex: 'quotationProjectName', }, { title: '客户(Customer)', align: 'center', dataIndex: 'quotationCustomerName', }, { title: '优先级(priority)', align: 'center', dataIndex: 'priority_dictText', }, { title: '产品分类(production class)', align: 'center', dataIndex: 'productionClass_dictText', }, { title: '机型(model)', align: 'center', dataIndex: 'model', }, { title: '厂家(maker)', align: 'center', dataIndex: 'maker', }, // { // title: '业务类型(busyness type)', // align:"center", // dataIndex: 'busynessType', // // width:250, // }, { title: '销售部门(sale department)', align: 'center', dataIndex: 'saleDepartmentName', }, { title: '业务员(salesman)', align: 'center', dataIndex: 'saleDepartmentName', }, { title: '关闭(close)', align: 'center', dataIndex: 'isClose_dictText', }, { title: '提交(submit)', align: 'center', dataIndex: 'status_dictText', }, { title: '版本号', align: 'center', dataIndex: 'version', }, ]; //查询数据 export const searchFormSchema: FormSchema[] = [ { label: '单据编码(bill code)', field: 'billCode', component: 'JInput', labelWidth: 150, componentProps: { AutoComplete: 'off', }, //colProps: {span: 6}, }, { label: '单据日期(bill date)', field: 'billDate', component: 'RangePicker', labelWidth: 150, componentProps: { valueType: 'Date', }, //colProps: {span: 6}, }, { label: '客户(Customer)', field: 'quotationCustomer', labelWidth: 150, component: 'ApiSelect', componentProps: { // mode: 'multiple',//multiple: 多选;不填写为单选 //请求api,返回结果{ result: { records: [{'id':'1',name:'scott'},{'id':'2',name:'小张'}] }} api: CustomerOption, //数值转成String numberToString: false, //标题字段 labelField: 'abbreviation', //值字段 valueField: 'id', //请求参数 params: { pageSize: -1 }, //返回结果字段 resultField: 'records', filterOption: 'true', showSearch: 'true', optionFilterProp: 'label', }, //colProps: {span: 6}, }, { label: '项目(Project)', field: 'quotationProject', labelWidth: 150, component: 'ApiSelect', componentProps: { // mode: 'multiple',//multiple: 多选;不填写为单选 //请求api,返回结果{ result: { records: [{'id':'1',name:'scott'},{'id':'2',name:'小张'}] }} api: ProjectOption, //数值转成String numberToString: false, //标题字段 labelField: 'name', //值字段 valueField: 'id', //请求参数 params: { pageSize: -1 }, //返回结果字段 resultField: 'records', filterOption: 'true', showSearch: 'true', optionFilterProp: 'label', }, //colProps: {span: 6}, }, { label: '优先级(priority)', field: 'priority', labelWidth: 150, component: 'JDictSelectTag', componentProps: { dictCode: 'priority', }, //colProps: {span: 6}, }, { label: '产品分类(production class)', field: 'productionClass', labelWidth: 180, component: 'ApiSelect', componentProps: { // mode: 'multiple',//multiple: 多选;不填写为单选 //请求api,返回结果{ result: { records: [{'id':'1',name:'scott'},{'id':'2',name:'小张'}] }} api: () => defHttp.get({ url: 'baseCode/baseProductClass/list?pageSize=-1' }), //数值转成String numberToString: false, //标题字段 labelField: 'name', //值字段 valueField: 'id', //请求参数 params: {}, //返回结果字段 resultField: 'records', filterOption: 'true', showSearch: 'true', optionFilterProp: 'label', }, //colProps: {span: 6}, }, { label: '机型(model)', field: 'model', labelWidth: 150, component: 'JDictSelectTag', componentProps: { dictCode: 'model_typer', }, //colProps: {span: 6}, }, { label: '厂家(maker)', field: 'maker', labelWidth: 150, component: 'JDictSelectTag', componentProps: { dictCode: 'factory', }, //colProps: {span: 6}, }, { label: '提交(submit)', field: 'status', labelWidth: 150, component: 'JDictSelectTag', componentProps: { dictCode: 'yes_or_no', }, //colProps: {span: 6}, }, { label: '关闭(close)', field: 'isClose', labelWidth: 150, component: 'JDictSelectTag', componentProps: { dictCode: 'yes_or_no', }, //colProps: {span: 6}, }, ]; //表单数据 export const formSchema: FormSchema[] = [ { label: '合同编号(bill code)', field: 'billCode', labelWidth: 200, component: 'Input', dynamicDisabled: true, componentProps: { placeholder: '自动生成', }, }, { label: '单据日期(bill date)', field: 'billDate', component: 'DatePicker', componentProps: { valueFormat: 'YYYY-MM-DD', }, dynamicDisabled: true, labelWidth: 200, }, { label: '报价项目(quotation project)', labelWidth: 200, field: 'quotationProjectName', component: 'InputSearch', slot: 'quotationProjectName', dynamicRules: ({ model, schema }) => { return [{ required: true, message: '请输入报价项目名称!' }]; }, }, { label: '客户(customer)', labelWidth: 200, field: 'quotationCustomerName', component: 'Input', dynamicDisabled: true, componentProps: { AutoComplete: 'off', }, }, { label: '业务类型(busyness type)', labelWidth: 200, field: 'busynessType', component: 'JDictSelectTag', componentProps: { dictCode: 'busyness_type', }, }, { label: '优先级(priority)', labelWidth: 200, field: 'priority', component: 'JDictSelectTag', componentProps: { dictCode: 'priority', }, }, { label: '产品分类(production class)', labelWidth: 200, field: 'productionClass', component: 'ApiSelect', componentProps: { // mode: 'multiple',//multiple: 多选;不填写为单选 //请求api,返回结果{ result: { records: [{'id':'1',name:'scott'},{'id':'2',name:'小张'}] }} api: () => defHttp.get({ url: 'baseCode/baseProductClass/list?pageSize=-1' }), //数值转成String numberToString: false, //标题字段 labelField: 'name', //值字段 valueField: 'id', //请求参数 params: {}, //返回结果字段 resultField: 'records', filterOption: 'true', showSearch: 'true', optionFilterProp: 'label', }, }, { label: '机型(model)', field: 'model', labelWidth: 200, component: 'JDictSelectTag', componentProps: { dictCode: 'model_typer', }, }, { label: '厂家(maker)', labelWidth: 200, field: 'maker', component: 'JDictSelectTag', componentProps: { dictCode: 'factory', }, }, { label: '币种(currency)', labelWidth: 200, field: 'currency', component: 'JDictSelectTag', dynamicDisabled: true, dynamicRules: ({ model, schema }) => { return [{ required: true, message: '请输入币种!' }]; }, componentProps: { dictCode: 'currency', }, }, { label: '交货条款(delivery terms)', labelWidth: 200, field: 'deliveryTerms', component: 'JDictSelectTag', componentProps: { dictCode: 'delivery_terms', }, }, { label: '付款条件(payment terms)', field: 'paymentTerms', labelWidth: 200, component: 'JDictSelectTag', componentProps: { dictCode: 'payment_terms', }, }, { label: '付款条件2', field: 'paymentInfo', labelWidth: 200, component: 'Input', componentProps: { AutoComplete: 'off', }, }, { label: '销售部门(sale department)', field: 'saleDepartmentName', labelWidth: 200, component: 'Input', dynamicDisabled: true, componentProps: {}, }, { label: '', field: 'saleDepartment', component: 'Input', show: false, }, { label: '业务员(salesman)', field: 'salesmanName', labelWidth: 200, component: 'Input', dynamicDisabled: true, componentProps: {}, }, { label: '', field: 'salesman', component: 'Input', show: false, }, { label: '汇率(exchange rate)', field: 'exchangeRate', labelWidth: 200, component: 'Input', dynamicDisabled: true, componentProps: { AutoComplete: 'off', }, }, { label: '备注(notes)', field: 'notes', labelWidth: 200, component: 'Input', componentProps: { AutoComplete: 'off', }, }, { label: '附件(attachs)', field: 'attachs', labelWidth: 200, component: 'JUpload', }, { label: '', field: 'id', component: 'Input', show: false, }, { label: '', field: 'quotationCustomer', component: 'Input', show: false, }, { label: '', field: 'quotationProject', component: 'Input', show: false, }, { label: '', field: 'status', component: 'Input', show: false, }, { label: '', field: 'sourceCode', component: 'Input', show: false, }, ]; //子表单数据 //子表表格配置 export const saleContractShipColumns: JVxeColumn[] = [ { title: '船名(ship name)', key: 'shipName', type: JVxeTypes.normal, placeholder: '请输入${title}', defaultValue: '', }, { title: '主机号(hostN number)', key: 'hostNumber', type: JVxeTypes.input, placeholder: '请输入${title}', defaultValue: '', }, { title: '工程编号(project No)', key: 'projectNo', type: JVxeTypes.input, placeholder: '请输入${title}', defaultValue: '', }, { title: '船厂(ship factory)', key: 'shipFactory', type: JVxeTypes.normal, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '船东(shipowner)', key: 'shipowner', type: JVxeTypes.normal, placeholder: '请输入${title}', defaultValue: '', }, { title: '操作(operation)', key: 'action', width: '400px', // 固定在右侧 fixed: 'right', // 对齐方式为居中 align: 'center', // 组件类型定义为【插槽】 type: JVxeTypes.slot, // slot 的名称,对应 v-slot 冒号后面和等号前面的内容 slotName: 'action', }, ]; export const saleContractProductColumns: JVxeColumn[] = [ { title: '交期(delivery time)', key: 'deliveryTime', type: JVxeTypes.date, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '产品分类(product class)', key: 'productClass', type: JVxeTypes.normal, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '产品编码(product code)', key: 'productCode', type: JVxeTypes.normal, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '产品中文名chinese name)', key: 'chineseName', type: JVxeTypes.normal, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '产品英文名(english name)', key: 'englishName', type: JVxeTypes.normal, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '型号(model)', key: 'model', type: JVxeTypes.normal, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '备件号(partno)', key: 'partno', type: JVxeTypes.normal, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '图号(drawingno)', key: 'drawingno', type: JVxeTypes.normal, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '订货号(orderno)', key: 'orderno', type: JVxeTypes.normal, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, // { // title: '厂家(factory)', // key: 'factory', // type: JVxeTypes.normal, // width: '200px', // placeholder: '请输入${title}', // defaultValue: '', // }, { title: '质量等级(quality grade)', key: 'qualityGrade', type: JVxeTypes.normal, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '数量(quantity)', key: 'quantity', type: JVxeTypes.normal, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '税率(tax rate)', key: 'taxRate', type: JVxeTypes.normal, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '折扣(discount)', key: 'discount', type: JVxeTypes.normal, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '单价(price)', key: 'taxPrice', type: JVxeTypes.normal, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '金额(amount)', key: 'taxAmount', type: JVxeTypes.normal, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '备注(notes)', key: 'notes', type: JVxeTypes.input, width: '200px', placeholder: '请输入${title}', defaultValue: '', }, { title: '操作(operation)', key: 'action', width: '200px', // 固定在右侧 fixed: 'right', // 对齐方式为居中 align: 'center', // 组件类型定义为【插槽】 type: JVxeTypes.slot, // slot 的名称,对应 v-slot 冒号后面和等号前面的内容 slotName: 'action', }, ]; // 高级查询数据 export const superQuerySchema = { hisId: { title: '历史主键', order: 0, view: 'text', type: 'string' }, status: { title: '状态(1-已提交,0-未提交)', order: 1, view: 'number', type: 'number' }, billDate: { title: '单据日期', order: 2, view: 'date', type: 'string' }, billCode: { title: '单据编码', order: 3, view: 'text', type: 'string' }, quotationProject: { title: '报价项目', order: 4, view: 'text', type: 'string' }, quotationProjectName: { title: '报价项目名称', order: 5, view: 'text', type: 'string' }, quotationCustomer: { title: '报价客户', order: 6, view: 'text', type: 'string' }, quotationCustomerName: { title: '报价客户名称', order: 7, view: 'text', type: 'string' }, busynessType: { title: '业务类型(busyness type)', order: 8, view: 'text', type: 'string' }, priority: { title: '优先级(priority)', order: 9, view: 'text', type: 'string' }, productionClass: { title: '产品分类(production class)', order: 10, view: 'text', type: 'string' }, model: { title: '机型(model)', order: 11, view: 'text', type: 'string' }, maker: { title: '厂家(maker)', order: 12, view: 'text', type: 'string' }, currency: { title: '币种(currency)', order: 13, view: 'text', type: 'string' }, deliveryTerms: { title: '交货条款(delivery terms)', order: 14, view: 'text', type: 'string' }, paymentTerms: { title: '付款条件(payment terms)', order: 15, view: 'text', type: 'string' }, paymentInfo: { title: '付款条件2', order: 16, view: 'text', type: 'string' }, saleDepartment: { title: '销售部门(sale department)', order: 17, view: 'sel_depart', type: 'string' }, salesman: { title: '业务员(salesman)', order: 18, view: 'sel_user', type: 'string' }, exchangeRate: { title: '汇率(exchange rate)', order: 19, view: 'text', type: 'string' }, notes: { title: '备注(notes)', order: 20, view: 'text', type: 'string' }, attachs: { title: '附件(attachs)', order: 21, view: 'text', type: 'string' }, version: { title: '版本号', order: 22, view: 'text', type: 'string' }, isClose: { title: '关闭(1-是,0-否)', order: 23, view: 'number', type: 'number' }, //子表高级查询 saleContractShip: { title: '销售合同-船明细', view: 'table', fields: { status: { title: '状态(1-启用,0-停用)', order: 0, view: 'number', type: 'number' }, headId: { title: '表头主键(销售合同)', order: 2, view: 'text', type: 'string' }, shipId: { title: '船id', order: 3, view: 'text', type: 'string' }, shipName: { title: '船名', order: 4, view: 'text', type: 'string' }, hostNumber: { title: '主机号', order: 5, view: 'text', type: 'string' }, projectNo: { title: '工程编号', order: 6, view: 'text', type: 'string' }, shipFactory: { title: '船厂', order: 7, view: 'text', type: 'string' }, shipowner: { title: '船东', order: 8, view: 'text', type: 'string' }, }, }, saleContractProduct: { title: '销售合同-产品明细', view: 'table', fields: { status: { title: '状态(1-启用,0-停用)', order: 0, view: 'number', type: 'number' }, headId: { title: '表头主键(销售报价单)', order: 2, view: 'text', type: 'string' }, deliveryTime: { title: '交期', order: 3, view: 'datetime', type: 'string' }, productId: { title: '产品id', order: 4, view: 'text', type: 'string' }, productClass: { title: '产品分类', order: 5, view: 'text', type: 'string' }, productCode: { title: '产品编码', order: 6, view: 'text', type: 'string' }, chineseName: { title: '产品中文名', order: 7, view: 'text', type: 'string' }, englishName: { title: '产品英文名', order: 8, view: 'text', type: 'string' }, specifications: { title: '规格', order: 9, view: 'text', type: 'string' }, model: { title: '型号', order: 10, view: 'text', type: 'string' }, partno: { title: '备件号', order: 11, view: 'text', type: 'string' }, drawingno: { title: '图号', order: 12, view: 'text', type: 'string' }, orderno: { title: '订货号', order: 13, view: 'text', type: 'string' }, factory: { title: '厂家', order: 14, view: 'text', type: 'string' }, qualityGrade: { title: '质量等级', order: 15, view: 'text', type: 'string' }, quantity: { title: '数量', order: 16, view: 'number', type: 'number' }, unit: { title: '单位', order: 17, view: 'text', type: 'string' }, taxRate: { title: '税率(tax rate)', order: 18, view: 'number', type: 'number' }, discount: { title: '折扣(discount)', order: 19, view: 'text', type: 'string' }, taxPrice: { title: '单价(price)', order: 20, view: 'number', type: 'number' }, taxAmount: { title: '金额(amount)', order: 21, view: 'number', type: 'number' }, notes: { title: '备注(notes)', order: 22, view: 'text', type: 'string' }, }, }, }; /** * 流程表单调用这个方法获取formSchema * @param param */ export function getBpmFormSchema(_formData): FormSchema[] { // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema return formSchema; }