export const getSortConfig = function (id = 'sortBy') { return { label: '排序:', id, type: 'input-number', el: { precision: 0, min: 0, }, } } export const getStationListConfig = function () { return { label: '所属集货站:', id: 'stationId', type: 'bus-select', el: { interfaceUri: 'flower/api/station/list', props: { label: 'name', value: 'id', }, filterable: true, clearable: true, style: 'width:100%', }, str: true, strKey: 'stationName', } } export const getAuditForm = () => { return [ { label: '审核意见:', id: 'result', type: 'radio-group', options: [ { label: '审核通过', value: 'Y' }, { label: '审核不通过', value: 'N' }, ], rules: { required: true, message: '请选择审核意见' }, on: { change: (e, updateForm) => { updateForm({ auditRejectReason: '' }) }, }, }, { label: '不通过原因:', id: 'auditRejectReason', type: 'input', el: { type: 'textarea', rows: 6, }, rules: { required: true, message: '请输入不通过原因', trigger: 'blur', }, hidden: (row) => row.result !== 'N', }, ] } export const getPartnerListConfig = () => { return { label: '合伙人:', id: 'partnerId', type: 'bus-select', el: { interfaceUri: 'flower/api/partner/page', extraQuery: { current: 1, size: 2000, status: 'P', isEnabled: 1, }, props: { label: 'name', value: 'id', dataPath: 'records', }, filterable: true, clearable: true, style: 'width:100%', // 列表返回的是id是int但是存的是string情况 filterOptions: (list) => { return list.map((item) => ({ ...item, id: item.id + '' })) }, }, } } export const getPartnerListNameWithIdConfig = () => { return { label: '合伙人:', id: 'partnerId', type: 'bus-select', el: { interfaceUri: 'flower/api/partner/page', extraQuery: { current: 1, size: 2000, status: 'P', isEnabled: 1, }, props: { label: 'name', value: 'id', dataPath: 'records', }, filterable: true, clearable: true, style: 'width:100%', // 列表返回的是id是int但是存的是string情况 filterOptions: (list) => { const listFilter= list.map((item) => ({ ...item, id: item.id + '',name:item.name+'(PID:'+item.id +')'})) return listFilter }, }, } } export const getGoodsCategoryListConfig = ( checkStrictly = false, multiple = false ) => { return { label: '商品分类:', id: 'categoryId', type: 'bus-cascader', el: { otherInterfaceUri: 'flower/api/flower/category/tree', props: { label: 'name', value: 'id', emitPath: false, checkStrictly, multiple, }, filterable: true, clearable: true, style: 'width:100%', }, } } export const getGoodsListConfig = () => { return { label: '商品:', id: 'flowerId', type: 'bus-select', el: { interfaceUri: 'flower/api/flower/list', extraQuery: { current: 1, size: 50, status: 'UP', }, props: { label: 'name', value: 'id', dataPath: 'records', queryKey: 'name', }, filterable: true, remote: true, clearable: true, style: 'width:100%', filterOptions: (list) => { return list.map((item) => { item.name = [item.name, item.color, item.levelStr] .filter((i) => !!i) .join(' · ') if (item.supplierName) { item.name += `(${item.supplierName})` } return item }) }, }, } } export const getSupplierTypeListConfig = () => { return { label: '供应商类型:', id: 'typeId', type: 'bus-select', el: { interfaceUri: 'flower/api/supplier/type/page', extraQuery: { current: 1, size: 2000, }, props: { label: 'name', value: 'id', dataPath: 'records', }, filterable: true, clearable: true, style: 'width:100%', }, } } export const getSupplierListConfig = () => { return { label: '供应商:', id: 'supplierId', type: 'bus-select', el: { interfaceUri: 'flower/api/supplier/page', extraQuery: { current: 1, size: 2000, status: 'P', isEnabled: 1, }, props: { label: 'name', value: 'id', dataPath: 'records', }, filterable: true, clearable: true, style: 'width:100%', // 列表返回的是id是int但是存的是string情况 filterOptions: (list) => { return list.map((item) => ({ ...item, id: item.id + '' })) }, }, } } export const getSupplierListWithIdConfig = () => { return { label: '供应商:', id: 'supplierId', type: 'bus-select', el: { interfaceUri: 'flower/api/supplier/page', extraQuery: { current: 1, size: 2000, status: 'P', isEnabled: 1, }, props: { label: 'name', value: 'id', dataPath: 'records', }, filterable: true, clearable: true, style: 'width:100%', // 列表返回的是id是int但是存的是string情况 filterOptions: (list) => { const listFilter= list.map((item) => ({ ...item, id: item.id + '',name:item.name+'(SID:'+item.id +')'})) return listFilter }, }, } }