import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; 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'; export const querySchema: FormSchemaGetter = () => [ { component: 'Input', fieldName: 'location', label: '服务地址', }, { 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'] = [ { type: 'checkbox', width: 60 }, { title: '序号', field: 'id', slots: { default: ({ rowIndex }) => { return (rowIndex + 1).toString(); }, }, }, { title: '服务地址', field: 'location', }, { title: '服务面积(㎡)', field: 'area', }, { title: '劳务名称', field: 'name', }, { title: '申报单价含税(元)', field: 'prices', }, { title: '合计费用', field: 'sumPeices', }, { title: '支付状态', field: 'payState', slots: { default: ({ row }) => row.stater === 1 ? '已支付' : '待支付', }, }, { title: '服务开始时间', field: 'starTime', }, { title: '服务结束时间', field: 'endTime', }, { title: '申请单位', field: 'unit', }, { title: '申请人', field: 'persion', }, { title: '联系电话', field: 'phone', }, // { // title: '提交时间', // field: 'stater', // }, { field: 'action', fixed: 'right', slots: { default: 'action' }, title: '操作', width: 180, }, ]; export const modalSchema: FormSchemaGetter = () => [ { label: '主键id', fieldName: 'id', component: 'Input', dependencies: { show: () => false, triggerFields: [''], }, }, { label: '服务地址(房间号)', fieldName: 'location', component: 'Input', 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', }, ];