admin-vben5/apps/web-antd/src/views/property/clean/cleanOrders/data.ts

252 lines
4.9 KiB
TypeScript
Raw Normal View History

2025-06-19 14:26:08 +08:00
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
2025-06-23 16:50:37 +08:00
import { cleanList } from '#/api/property/clean';
import type { PageResult } from '#/api/common';
import type { CleanVO } from '#/api/property/clean/model';
import { resident_unitList } from '#/api/property/resident/unit';
import dayjs from 'dayjs';
2025-06-19 14:26:08 +08:00
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
2025-06-23 16:50:37 +08:00
fieldName: 'location',
label: '服务地址',
2025-06-19 14:26:08 +08:00
},
{
component: 'Input',
2025-06-23 16:50:37 +08:00
fieldName: 'persion',
label: '申请人',
},
{
component: 'Select',
fieldName: 'payState',
label: '支付状态',
componentProps: {
options: [
{
label: '待支付',
value: 0,
},
{
label: '已支付',
value: 1,
},
],
},
2025-06-19 14:26:08 +08:00
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
2025-06-23 16:50:37 +08:00
title: '序号',
2025-06-19 14:26:08 +08:00
field: 'id',
2025-06-23 16:50:37 +08:00
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
},
{
title: '服务地址',
field: 'location',
},
{
title: '服务面积(㎡)',
field: 'area',
2025-06-19 14:26:08 +08:00
},
{
title: '劳务名称',
field: 'name',
},
{
2025-06-23 16:50:37 +08:00
title: '申报单价含税(元)',
field: 'prices',
2025-06-19 14:26:08 +08:00
},
{
2025-06-23 16:50:37 +08:00
title: '合计费用',
field: 'sumPeices',
2025-06-19 14:26:08 +08:00
},
{
2025-06-23 16:50:37 +08:00
title: '支付状态',
field: 'payState',
slots: {
default: ({ row }) => row.stater === 1 ? '已支付' : '待支付',
},
2025-06-19 14:26:08 +08:00
},
{
2025-06-23 16:50:37 +08:00
title: '服务开始时间',
field: 'starTime',
2025-06-19 14:26:08 +08:00
},
{
2025-06-23 16:50:37 +08:00
title: '服务结束时间',
field: 'endTime',
},
{
title: '申请单位',
field: 'unit',
2025-06-19 14:26:08 +08:00
},
{
2025-06-23 16:50:37 +08:00
title: '申请人',
field: 'persion',
2025-06-19 14:26:08 +08:00
},
{
2025-06-23 16:50:37 +08:00
title: '联系电话',
field: 'phone',
2025-06-19 14:26:08 +08:00
},
2025-06-23 16:50:37 +08:00
// {
// title: '提交时间',
// field: 'stater',
// },
2025-06-19 14:26:08 +08:00
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键id',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
2025-06-23 16:50:37 +08:00
label: '服务地址(房间号)',
fieldName: 'location',
2025-06-19 14:26:08 +08:00
component: 'Input',
rules: 'required',
},
{
2025-06-23 16:50:37 +08:00
label: '服务面积(㎡)',
fieldName: 'area',
component: 'Input',
2025-06-19 14:26:08 +08:00
rules: 'required',
},
2025-06-25 11:37:28 +08:00
{
label: '劳务名称',
fieldName: 'name',
component: 'ApiSelect',
componentProps: {
api: cleanList,
resultField: 'rows',
labelField: 'name',
valueField: 'id',
},
rules: 'required',
},
{
label: '服务单价',
fieldName: 'prices',
component: 'Input',
rules: 'required',
componentProps: {
placeholder: '',
disabled: true,
},
},
2025-06-23 16:50:37 +08:00
// {
// label: '保洁频率',
// fieldName: 'frequency',
// component: 'Input',
// rules: 'required',
// componentProps: {
// placeholder: '',
// disabled: true,
// },
// },
// {
// label: '保洁内容',
// fieldName: 'standard',
// component: 'Input',
// rules: 'required',
// componentProps: {
// placeholder: '',
// disabled: true,
// },
// },
// {
// label: '保洁标准',
// fieldName: 'peices',
// component: 'Input',
// rules: 'required',
// componentProps: {
// placeholder: '',
// disabled: true,
// },
// },
{
label: '开始时间',
fieldName: 'starTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
placeholder: '请选择开始时间'
},
rules: 'required',
2025-06-19 14:26:08 +08:00
},
2025-06-23 16:50:37 +08:00
{
label: '结束时间',
fieldName: 'endTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
placeholder: '请选择结束时间'
},
2025-06-19 14:26:08 +08:00
rules: 'required',
},
{
2025-06-23 16:50:37 +08:00
label: '申请人',
fieldName: 'persion',
2025-06-19 14:26:08 +08:00
component: 'Input',
rules: 'required',
},
{
2025-06-23 16:50:37 +08:00
label: '联系电话',
fieldName: 'phone',
2025-06-19 14:26:08 +08:00
component: 'Input',
rules: 'required',
},
{
2025-06-23 16:50:37 +08:00
label: '申请单位',
fieldName: 'unit',
component: 'ApiSelect',
componentProps: {
api: resident_unitList,
resultField: 'rows',
labelField: 'name',
valueField: 'id',
placeholder: '请选择单位',
},
rules: 'required',
},
{
label: '支付状态',
fieldName: 'payState',
component: 'Select',
componentProps: {
options: [
{
label: '待支付',
value: 0,
},
{
label: '已支付',
value: 1,
},
],
},
2025-06-19 14:26:08 +08:00
rules: 'required',
},
];