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

211 lines
4.1 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-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,
slots:{
default: ({ row }) => {
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}) => {
return renderDict(row.status, 'wy_sf');
},
},
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: '操作',
width: 180,
},
];
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-09 10:36:42 +08:00
{
label: '派单时间',
fieldName: 'dispatchTime',
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
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: 'initiatorName',
2025-07-09 15:03:17 +08:00
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: 'handler',
2025-07-09 15:03:17 +08:00
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
formItemClass: 'col-span-2',
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
},
{
label: '完成时间',
fieldName: 'compleTime',
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
rules: 'selectRequired',
2025-07-09 10:36:42 +08:00
},
{
label: '评价',
fieldName: 'serviceEvalua',
2025-07-09 15:03:17 +08:00
component: 'Rate',
rules: 'required',
2025-07-09 10:36:42 +08:00
},
{
label: '是否超时',
fieldName: 'isTimeOut',
2025-07-09 15:03:17 +08:00
component: 'RadioGroup',
componentProps: {
buttonStyle: 'solid',
options: getDictOptions('wy_sf'),
},
rules: 'selectRequired',
2025-07-09 10:36:42 +08:00
},
];