258 lines
4.8 KiB
TypeScript
258 lines
4.8 KiB
TypeScript
|
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: '订单id',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'userId',
|
||
|
label: '租赁人id',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'userName',
|
||
|
label: '租赁人名称',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'rent',
|
||
|
label: '租金',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'deposit',
|
||
|
label: '押金',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'penalty',
|
||
|
label: '违约金',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'totalAmount',
|
||
|
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_invoice_status'),
|
||
|
},
|
||
|
fieldName: 'invoiceStatus',
|
||
|
label: '开票状态',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'invoiceType',
|
||
|
label: '发票类型',
|
||
|
},
|
||
|
{
|
||
|
component: 'Select',
|
||
|
componentProps: {
|
||
|
options: getDictOptions('pro_charging_status'),
|
||
|
},
|
||
|
fieldName: 'chargeStatus',
|
||
|
label: '收费状态',
|
||
|
},
|
||
|
];
|
||
|
|
||
|
export const columns: VxeGridProps['columns'] = [
|
||
|
{ type: 'checkbox', width: 60 },
|
||
|
{
|
||
|
title: '主键',
|
||
|
field: 'id',
|
||
|
},
|
||
|
{
|
||
|
title: '订单id',
|
||
|
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: '订单id',
|
||
|
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: 'totalAmount',
|
||
|
component: 'Input',
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '收费日期',
|
||
|
fieldName: 'chargeDate',
|
||
|
component: 'DatePicker',
|
||
|
componentProps: {
|
||
|
showTime: true,
|
||
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||
|
},
|
||
|
rules: 'required',
|
||
|
},
|
||
|
{
|
||
|
label: '支付方式',
|
||
|
fieldName: 'paymentMethod',
|
||
|
component: 'Select',
|
||
|
componentProps: {
|
||
|
options: getDictOptions('pro_payment_method'),
|
||
|
},
|
||
|
rules: 'selectRequired',
|
||
|
},
|
||
|
{
|
||
|
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',
|
||
|
},
|
||
|
];
|