Files
admin-vben5/apps/web-antd/src/views/property/businessManagement/workOrders/data.ts

248 lines
5.0 KiB
TypeScript
Raw Normal View History

2025-07-09 15:03:17 +08:00
import type {FormSchemaGetter} from '#/adapter/form';
import type {VxeGridProps} from '#/adapter/vxe-table';
import {renderDict} from "#/utils/render";
import {getDictOptions} from "#/utils/dict";
2025-07-09 18:12:28 +08:00
import {h} from "vue";
import {Rate} from "ant-design-vue";
2025-07-09 10:36:42 +08:00
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'orderNo',
label: '工单编号',
},
{
component: 'Input',
fieldName: 'orderName',
label: '工单名称',
},
{
2025-07-09 15:03:17 +08:00
component: 'Select',
2025-07-09 10:36:42 +08:00
componentProps: {
2025-07-09 15:03:17 +08:00
options: getDictOptions('wy_gdclzt'),
2025-07-09 10:36:42 +08:00
},
fieldName: 'status',
label: '状态',
},
];
export const columns: VxeGridProps['columns'] = [
2025-07-09 15:03:17 +08:00
{type: 'checkbox', width: 60},
2025-07-09 10:36:42 +08:00
{
title: '工单编号',
field: 'orderNo',
2025-07-09 15:03:17 +08:00
width: 180,
2025-07-09 10:36:42 +08:00
},
{
title: '工单名称',
field: 'orderName',
2025-07-09 15:03:17 +08:00
minWidth: 180,
2025-07-09 10:36:42 +08:00
},
2025-07-10 16:13:53 +08:00
{
title: '工单类型',
field: 'typeName',
minWidth: 150,
},
2025-07-09 10:36:42 +08:00
{
2025-07-09 18:12:28 +08:00
title: '派单时间',
field: 'dispatchTime',
2025-07-09 15:03:17 +08:00
width: 100,
2025-07-09 10:36:42 +08:00
},
{
title: '状态',
field: 'status',
2025-07-09 15:03:17 +08:00
slots: {
default: ({row}) => {
return renderDict(row.status, 'wy_gdclzt');
},
},
width: 100,
2025-07-09 10:36:42 +08:00
},
{
title: '地址',
field: 'location',
2025-07-09 15:03:17 +08:00
width: 100,
2025-07-09 10:36:42 +08:00
},
{
title: '计划完成时间',
field: 'planCompleTime',
2025-07-09 15:03:17 +08:00
width: 100,
2025-07-09 10:36:42 +08:00
},
{
title: '完成时间',
field: 'compleTime',
2025-07-09 15:03:17 +08:00
width: 100,
2025-07-09 10:36:42 +08:00
},
{
title: '评价',
field: 'serviceEvalua',
2025-07-09 18:12:28 +08:00
width: 180,
2025-07-10 16:13:53 +08:00
slots: {
default: ({row}) => {
2025-07-09 18:12:28 +08:00
return h(Rate, {
value: row.serviceEvalua || 0,
disabled: true,
});
},
},
2025-07-09 10:36:42 +08:00
},
{
title: '是否超时',
field: 'isTimeOut',
2025-07-09 15:03:17 +08:00
width: 100,
2025-07-09 18:12:28 +08:00
slots: {
default: ({row}) => {
2025-07-21 20:41:47 +08:00
return row.isTimeOut ? renderDict(row.isTimeOut, 'wy_sf') : '';
2025-07-09 18:12:28 +08:00
},
},
2025-07-09 10:36:42 +08:00
},
{
field: 'action',
fixed: 'right',
2025-07-09 15:03:17 +08:00
slots: {default: 'action'},
2025-07-09 10:36:42 +08:00
title: '操作',
2025-07-21 20:41:47 +08:00
width: 300,
2025-07-09 10:36:42 +08:00
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: 'id',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '工单名称',
fieldName: 'orderName',
component: 'Input',
rules: 'required',
},
{
label: '工单类型',
fieldName: 'type',
2025-07-09 18:12:28 +08:00
component: 'ApiSelect',
2025-07-09 15:03:17 +08:00
componentProps: {},
2025-07-09 10:36:42 +08:00
rules: 'selectRequired',
},
2025-07-09 15:03:17 +08:00
// {
// label: '状态',
// fieldName: 'status',
// component: 'RadioGroup',
// componentProps: {
// buttonStyle: 'solid',
// optionType: 'button',
// },
// rules: 'selectRequired',
// },
2025-07-21 20:41:47 +08:00
// {
// label: '派单时间',
// fieldName: 'dispatchTime',
// component: 'DatePicker',
// componentProps: {
// showTime: true,
// format: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
// disabledDate: disabledDate
// },
// rules: 'selectRequired',
// },
// {
// label: '发起人',
// fieldName: 'initiatorName',
// component: 'ApiSelect',
// formItemClass: 'col-span-2',
// rules: 'selectRequired',
//
// },
// {
// label: '处理人',
// fieldName: 'handler',
// component: 'ApiSelect',
// formItemClass: 'col-span-2',
// rules: 'selectRequired',
// },
2025-07-09 10:36:42 +08:00
{
2025-07-09 15:03:17 +08:00
label: '具体位置',
2025-07-09 10:36:42 +08:00
fieldName: 'location',
component: 'Input',
2025-07-09 15:03:17 +08:00
rules: 'selectRequired',
2025-07-09 10:36:42 +08:00
},
{
label: '计划完成时间',
fieldName: 'planCompleTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
2025-07-09 15:03:17 +08:00
labelWidth: 110,
rules: 'selectRequired',
2025-07-09 10:36:42 +08:00
},
2025-07-21 20:41:47 +08:00
// {
// label: '完成时间',
// fieldName: 'compleTime',
// component: 'DatePicker',
// componentProps: {
// showTime: true,
// format: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
// },
// rules: 'selectRequired',
// },
// {
// label: '评价',
// fieldName: 'serviceEvalua',
// component: 'Rate',
// rules: 'required',
// },
// {
// label: '是否超时',
// fieldName: 'isTimeOut',
// component: 'RadioGroup',
// componentProps: {
// buttonStyle: 'solid',
// options: getDictOptions('wy_sf'),
// },
// rules: 'selectRequired',
// },
];
export const ordersModalSchema: FormSchemaGetter = () => [
{
label: 'id',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
2025-07-09 10:36:42 +08:00
{
2025-07-21 20:41:47 +08:00
label: '状态',
fieldName: 'status',
component: 'Select',
2025-07-09 10:36:42 +08:00
componentProps: {
2025-07-21 20:41:47 +08:00
options: getDictOptions('wy_gdclzt'),
2025-07-09 10:36:42 +08:00
},
2025-07-09 15:03:17 +08:00
rules: 'selectRequired',
2025-07-21 20:41:47 +08:00
disabled: true
2025-07-09 10:36:42 +08:00
},
{
2025-07-21 20:41:47 +08:00
label: '处理人',
fieldName: 'handler',
component: 'ApiSelect',
formItemClass: 'col-span-2',
2025-07-09 15:03:17 +08:00
rules: 'selectRequired',
2025-07-21 20:41:47 +08:00
dependencies: {
disabled: (formValue) =>formValue.status === '2' ,
triggerFields: ['status'],
},
2025-07-09 10:36:42 +08:00
},
2025-07-21 20:41:47 +08:00
]