300 lines
6.1 KiB
TypeScript
300 lines
6.1 KiB
TypeScript
import type { FormSchemaGetter } from '#/adapter/form';
|
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
|
|
|
import { resident_unitList } from '#/api/property/resident/unit';
|
|
import { useCleanStore } from '#/store';
|
|
|
|
const cleanStore = useCleanStore();
|
|
|
|
export const querySchema: FormSchemaGetter = () => [
|
|
{
|
|
component: 'Input',
|
|
fieldName: 'location',
|
|
label: '服务地址',
|
|
},
|
|
// {
|
|
// label: '服务地址(房间号)',
|
|
// component: 'TreeSelect',
|
|
// defaultValue: undefined,
|
|
// fieldName: 'location',
|
|
// rules: 'required',
|
|
// },
|
|
// {
|
|
// label: '服务地址(房间号)',
|
|
// fieldName: 'location',
|
|
// component: 'ApiSelect',
|
|
// componentProps: {
|
|
// api: resident_unitList,
|
|
// resultField: 'rows',
|
|
// labelField: 'name',
|
|
// valueField: 'id',
|
|
// placeholder: '请选择服务地址',
|
|
// onChange: (val: string | number) => {
|
|
// cleanStore.setLocation(val);
|
|
// },
|
|
// },
|
|
// rules: 'required',
|
|
// },
|
|
// {
|
|
// label: '申请人hhh',
|
|
// fieldName: 'persion',
|
|
// component: 'ApiSelect',
|
|
// componentProps: {
|
|
// api: cleanList,
|
|
// resultField: 'rows',
|
|
// labelField: 'name',
|
|
// valueField: 'id',
|
|
// placeholder: '请选择申请人',
|
|
// disabled: computed(() => !cleanStore.isPersionEnabled),
|
|
// },
|
|
// rules: 'required',
|
|
// },
|
|
{
|
|
component: 'Input',
|
|
fieldName: 'persion',
|
|
label: '申请人',
|
|
},
|
|
{
|
|
component: 'Select',
|
|
fieldName: 'payState',
|
|
label: '支付状态',
|
|
componentProps: {
|
|
options: [
|
|
{
|
|
label: '待支付',
|
|
value: 0,
|
|
},
|
|
{
|
|
label: '已支付',
|
|
value: 1,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
];
|
|
|
|
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
// export const columns: () => VxeGridProps['columns'] = () => [
|
|
export const columns: VxeGridProps['columns'] = [
|
|
{
|
|
title: '序号',
|
|
field: 'id',
|
|
width: '60',
|
|
slots: {
|
|
default: ({ rowIndex }) => {
|
|
return (rowIndex + 1).toString();
|
|
},
|
|
},
|
|
},
|
|
{
|
|
title: '服务地址',
|
|
field: 'location',
|
|
width: '180',
|
|
},
|
|
// {
|
|
// title: '服务面积(㎡)',
|
|
// field: 'area',
|
|
// width: 'auto',
|
|
// },
|
|
// {
|
|
// title: '劳务名称',
|
|
// field: 'name',
|
|
// width: 'auto',
|
|
// },
|
|
// {
|
|
// title: '申报单价含税(元)',
|
|
// field: 'prices',
|
|
// width: 'auto',
|
|
// },
|
|
{
|
|
title: '合计费用(元)',
|
|
field: 'sumPeices',
|
|
width: '120',
|
|
},
|
|
{
|
|
title: '支付状态',
|
|
field: 'payState',
|
|
width: '120',
|
|
slots: {
|
|
default: ({ row }) => (row.stater === 1 ? '已支付' : '待支付'),
|
|
},
|
|
},
|
|
{
|
|
title: '服务开始时间',
|
|
field: 'starTime',
|
|
width: 'auto',
|
|
},
|
|
{
|
|
title: '服务结束时间',
|
|
field: 'endTime',
|
|
width: 'auto',
|
|
},
|
|
{
|
|
title: '申请单位',
|
|
field: 'unit',
|
|
width: '150',
|
|
},
|
|
{
|
|
title: '申请人',
|
|
field: 'persion',
|
|
width: '150',
|
|
},
|
|
{
|
|
title: '联系电话',
|
|
field: 'phone',
|
|
width: 'auto',
|
|
},
|
|
// {
|
|
// title: '提交时间',
|
|
// field: 'stater',
|
|
// },
|
|
{
|
|
field: 'action',
|
|
fixed: 'right',
|
|
slots: { default: 'action' },
|
|
title: '操作',
|
|
},
|
|
];
|
|
|
|
export const modalSchema: FormSchemaGetter = () => [
|
|
{
|
|
label: '主键id',
|
|
fieldName: 'id',
|
|
component: 'Input',
|
|
dependencies: {
|
|
show: () => false,
|
|
triggerFields: [''],
|
|
},
|
|
},
|
|
{
|
|
label: '服务地址(房间号)',
|
|
component: 'Input',
|
|
defaultValue: undefined,
|
|
fieldName: 'location',
|
|
rules: 'required',
|
|
},
|
|
// {
|
|
// label: '服务面积(㎡)',
|
|
// fieldName: 'area',
|
|
// component: 'Input',
|
|
// rules: 'required',
|
|
// },
|
|
// {
|
|
// 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,
|
|
// },
|
|
// },
|
|
// {
|
|
// 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',
|
|
},
|
|
{
|
|
label: '结束时间',
|
|
fieldName: 'endTime',
|
|
component: 'DatePicker',
|
|
componentProps: {
|
|
showTime: true,
|
|
format: 'YYYY-MM-DD HH:mm:ss',
|
|
placeholder: '请选择结束时间',
|
|
},
|
|
rules: 'required',
|
|
},
|
|
{
|
|
label: '申请人',
|
|
fieldName: 'persion',
|
|
component: 'Input',
|
|
rules: 'required',
|
|
},
|
|
{
|
|
label: '联系电话',
|
|
fieldName: 'phone',
|
|
component: 'Input',
|
|
rules: 'required',
|
|
},
|
|
{
|
|
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,
|
|
},
|
|
],
|
|
},
|
|
rules: 'required',
|
|
},
|
|
];
|