feat:实现保洁管理业务逻辑

This commit is contained in:
fyy
2025-06-23 16:50:37 +08:00
parent 8c5d26c12e
commit d4c26d13ea
8 changed files with 737 additions and 227 deletions

View File

@@ -0,0 +1,189 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'name',
label: '劳务名称',
},
{
component: 'Input',
fieldName: 'method',
label: '计算方式',
},
{
component: 'Select',
fieldName: 'stater',
label: '状态',
componentProps: {
options: [
{ label: '下架', value: 0 },
{ label: '上架', value: 1 },
],
placeholder: '请选择类型',
},
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '序号',
field: 'id',
width: 60,
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
},
{
title: '劳务名称',
field: 'name',
},
{
title: '计量单位',
field: 'measure',
},
{
title: '计算方式',
field: 'method',
},
{
title: '申报单价含税(元)',
field: 'peices',
},
{
title: '保洁频率',
field: 'frequency',
},
// {
// title: '保洁内容',
// field: 'standard',
// },
{
title: '保洁标准',
field: 'standard',
},
{
title: '备注',
field: 'remark',
},
{
title: '状态',
field: 'stater',
slots: {
default: ({ row }) => row.stater === 1 ? '上架' : '下架',
},
},
// {
// 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: 'name',
component: 'Input',
rules: 'required',
},
{
label: '计量单位',
fieldName: 'measure',
component: 'Input',
rules: 'required',
},
{
label: '计算方式',
fieldName: 'method',
component: 'Input',
rules: 'required',
},
{
label: '申报单价含税(元)',
fieldName: 'peices',
component: 'Input',
rules: 'required',
},
{
label: '保洁频率',
fieldName: 'frequency',
component: 'Input',
rules: 'required',
},
// {
// label: '保洁内容',
// fieldName: 'standard',
// component: 'Input',
// rules: 'required',
// },
{
label: '保洁标准',
fieldName: 'standard',
component: 'Input',
rules: 'required',
},
// {
// 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: 'stater',
component: 'Select',
componentProps: {
options: [
{ label: '下架', value: 0 },
{ label: '上架', value: 1 },
],
placeholder: '请选择类型',
},
rules: 'required',
},
{
label: '备注',
fieldName: 'remark',
component: 'Input',
},
];