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: 'orderId', label: '订单号', }, { component: 'Input', fieldName: 'userId', label: '租赁人id', }, { component: 'Select', componentProps: { options: getDictOptions('pro_invoice_status'), }, fieldName: 'invoiceStatus', label: '开票状态', }, { component: 'Input', fieldName: 'userName', label: '租赁人', }, { component: 'DatePicker', componentProps: { showTime: true, format: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD HH:mm:ss', }, fieldName: 'chargeDate', label: '收费日期', }, { component: 'Select', componentProps: { options: getDictOptions('pro_payment_method'), }, fieldName: 'paymentMethod', label: '支付方式', }, { component: 'Select', componentProps: { options: getDictOptions('pro_charging_status'), }, fieldName: 'chargeStatus', label: '收费状态', }, ]; export const columns: VxeGridProps['columns'] = [ { type: 'checkbox', width: 60 }, { title: '序号', field: 'id', slots: { default: ({ rowIndex }) => { return (rowIndex + 1).toString(); }, }, }, { title: '订单号', field: 'orderId', }, { title: '租赁人id', field: 'userId', }, { title: '租赁人', field: 'userName', }, { title: '租金', field: 'rent', }, { title: '押金', field: 'deposit', }, { title: '违约金', field: 'penalty', }, { title: '总金额', field: 'totalAmount', }, { title: '收费日期', field: 'chargeDate', }, { title: '支付方式', field: 'paymentMethod', slots: { default: ({ row }) => { return renderDict(row.paymentMethod, 'pro_payment_method'); }, }, }, { title: '开票状态', field: 'invoiceStatus', slots: { default: ({ row }) => { return renderDict(row.invoiceStatus, 'pro_invoice_status'); }, }, }, { title: '发票类型', field: 'invoiceType', }, { title: '收费状态', field: 'chargeStatus', slots: { default: ({ row }) => { return renderDict(row.chargeStatus, 'pro_charging_status'); }, }, }, { 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: 'orderId', component: 'Input', rules: 'required', }, { label: '租赁人id', fieldName: 'userId', component: 'Input', rules: 'required', }, { label: '租赁人', fieldName: 'userName', component: 'Input', rules: 'required', }, { label: '租金', fieldName: 'rent', component: 'Input', rules: 'required', }, { label: '押金', fieldName: 'deposit', component: 'Input', rules: 'required', }, { label: '违约金', fieldName: 'penalty', component: 'Input', rules: 'required', }, { label: '开票状态', fieldName: 'invoiceStatus', component: 'Select', componentProps: { options: getDictOptions('pro_invoice_status'), }, rules: 'selectRequired', }, { label: '发票类型', fieldName: 'invoiceType', component: 'Input', rules: 'required', }, { label: '收费状态', fieldName: 'chargeStatus', component: 'Select', componentProps: { options: getDictOptions('pro_charging_status'), }, rules: 'selectRequired', }, ];