import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; import { getDictOptions } from '#/utils/dict'; import { renderDict } from '#/utils/render'; export const querySchema: FormSchemaGetter = () => [ { component: 'Input', fieldName: 'chargeNo', label: '费用编号', }, { component: 'Select', fieldName: 'costMark', componentProps: { options: getDictOptions('pro_cost_identification'), }, label: '费用标识', }, { component: 'Select', componentProps: { options: getDictOptions('pro_payment_type'), }, fieldName: 'paymentType', label: '付费类型', }, ]; export const columns: VxeGridProps['columns'] = [ { type: 'checkbox', width: 60 }, { title: '费用编号', field: 'chargeNo', }, { title: '费用类型', field: 'costType', slots: { default: ({ row }) => { return renderDict(row.costType, 'pro_expense_type'); }, }, }, { title: '收费项目', field: 'chargeItem', }, { title: '费用标识', field: 'costMark', slots: { default: ({ row }) => { return renderDict(row.costMark, 'pro_cost_identification'); }, }, }, { title: '付费类型', field: 'paymentType', slots: { default: ({ row }) => { return renderDict(row.paymentType, 'pro_payment_type'); }, }, }, { title: '费用周期(月)', field: 'chargeCycle', }, { title: '计算公式', field: 'formula', slots: { default: ({ row }) => { return renderDict(row.formula, 'pro_calculation_formula'); }, }, }, { title: '计费单价', field: 'unitPrice', }, { title: '附加费用', field: 'surcharge', }, { title: '状态', field: 'state', slots: {default: 'state'}, width: 100, }, { field: 'action', fixed: 'right', slots: { default: 'action' }, title: '操作', width: 180, }, ]; export const modalSchema: FormSchemaGetter = () => [ { label: '主键', fieldName: 'id', component: 'Input', dependencies: { show: () => false, triggerFields: [''], }, }, { label: '费用类型', fieldName: 'costType', component: 'Select', componentProps: { options: getDictOptions('pro_expense_type'), }, rules: 'selectRequired', }, { label: '收费项目', fieldName: 'chargeItem', component: 'Input', rules: 'required', }, { label: '费用标识', fieldName: 'costMark', component: 'Select', componentProps: { options: getDictOptions('pro_cost_identification'), }, rules: 'required', }, { label: '付费类型', fieldName: 'paymentType', component: 'Select', componentProps: { options: getDictOptions('pro_payment_type'), }, rules: 'selectRequired', }, { label: '费用周期(月)', fieldName: 'chargeCycle', component: 'Input', rules: 'required', }, { label: '单位', fieldName: 'unit', component: 'Input', rules: 'required', componentProps: { placeholder: '请输入(如:元)', }, }, { label: '手机缴费', fieldName: 'isMobilePay', component: 'Select', componentProps: { options: getDictOptions('pro_mobile_payment'), }, rules: 'selectRequired', }, { label: '进位方式', fieldName: 'roundingMode', componentProps: { options: getDictOptions('pro_carry_method'), }, component: 'Select', rules: 'selectRequired', }, { label: '保留小数', fieldName: 'currencyDecimals', component: 'Select', componentProps: { options: getDictOptions('pro_keep_decimals'), }, rules: 'selectRequired', }, { component: 'Select', componentProps: { options: getDictOptions('wy_state'), }, fieldName: 'state', label: '状态', rules: 'selectRequired', }, { label: '计算公式', fieldName: 'formula', component: 'Select', componentProps: { options: getDictOptions('pro_calculation_formula'), }, rules: 'selectRequired', formItemClass:'col-span-2', }, { label: '计费单价', fieldName: 'unitPrice', component: 'Input', rules: 'required', }, { label: '附加费', fieldName: 'surcharge', component: 'Input', rules: 'required', }, ];