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

309 lines
6.4 KiB
TypeScript

import type {FormSchemaGetter} from '#/adapter/form';
import type {VxeGridProps} from '#/adapter/vxe-table';
import {renderDict} from "#/utils/render";
import {getDictOptions} from "#/utils/dict";
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'orderNo',
label: '工单编号',
},
{
component: 'Input',
fieldName: 'orderName',
label: '工单名称',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('wy_gdclzt'),
},
fieldName: 'status',
label: '状态',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('pro_processing_weight'),
},
fieldName: 'processingWeight',
label: '处理优先级',
},
];
export const columns: VxeGridProps['columns'] = [
{type: 'checkbox', width: 60},
{
title: '工单编号',
field: 'orderNo',
width: 180,
},
{
title: '工单名称',
field: 'orderName',
minWidth: 180,
},
{
title: '工单类型',
field: 'typeName',
minWidth: 150,
},
{
title: '上报类型',
field: 'reportingType',
slots: {
default: ({row}) => {
return row.reportingType!=null?renderDict(row.reportingType, 'wy_gdsblx'):'';
},
},
width: 100,
},
{
title: '派单时间',
field: 'dispatchTime',
width: 100,
},
{
title: '状态',
field: 'status',
slots: {
default: ({row}) => {
return renderDict(row.status, 'wy_gdclzt');
},
},
width: 100,
},
{
title: '地址',
field: 'location',
width: 100,
},
{
title: '处理优先级',
field: 'processingWeight',
slots: {
default: ({row}) => {
return row.processingWeight!=null?renderDict(row.processingWeight, 'pro_processing_weight'):'';
},
},
width: 100,
},
// {
// title: '计划完成时间',
// field: 'planCompleTime',
// width: 100,
// },
// {
// title: '完成时间',
// field: 'compleTime',
// width: 100,
// },
// {
// title: '评价',
// field: 'serviceEvalua',
// width: 180,
// slots: {
// default: ({row}) => {
// return h(Rate, {
// value: row.serviceEvalua || 0,
// disabled: true,
// });
// },
// },
// },
// {
// title: '是否超时',
// field: 'isTimeOut',
// width: 100,
// slots: {
// default: ({row}) => {
// return row.isTimeOut ? renderDict(row.isTimeOut, 'wy_sf') : '';
// },
// },
// },
{
title: '创建时间',
field: 'createTime',
width: 100,
},
{
title: '备注',
field: 'remark',
width: 100,
},
{
field: 'action',
fixed: 'right',
slots: {default: 'action'},
title: '操作',
width: 300,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: 'id',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '工单名称',
fieldName: 'orderName',
component: 'Input',
rules: 'required',
},
{
label: '工单类型',
fieldName: 'type',
component: 'TreeSelect',
rules: 'selectRequired',
},
{
label: '处理优先级',
fieldName: 'processingWeight',
component: 'Select',
componentProps: {
options: getDictOptions('pro_processing_weight'),
},
rules: 'selectRequired',
},
{
label: '上报类型',
fieldName: 'reportingType',
component: 'Select',
componentProps: {
options: getDictOptions('wy_gdsblx'),
},
rules: 'selectRequired',
},
// {
// label: '状态',
// fieldName: 'status',
// component: 'RadioGroup',
// componentProps: {
// buttonStyle: 'solid',
// optionType: 'button',
// },
// rules: 'selectRequired',
// },
// {
// 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',
// },
{
label: '具体位置',
fieldName: 'location',
component: 'Input',
rules: 'selectRequired',
formItemClass:'col-span-2'
},
// {
// label: '计划完成时间',
// fieldName: 'planCompleTime',
// component: 'DatePicker',
// componentProps: {
// showTime: true,
// format: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
// },
// labelWidth: 110,
// rules: 'selectRequired',
// },
// {
// 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: 'remark',
component: 'Textarea',
formItemClass:'col-span-2'
},
// {
// label: '是否超时',
// fieldName: 'isTimeOut',
// component: 'RadioGroup',
// componentProps: {
// buttonStyle: 'solid',
// options: getDictOptions('wy_sf'),
// },
// rules: 'selectRequired',
// },
{
label: '工单图片',
fieldName: 'orderImgUrl',
component: 'ImageUpload',
componentProps: {
maxCount: 1,
},
formItemClass: 'col-span-2',
},
];
export const ordersModalSchema: FormSchemaGetter = () => [
{
label: 'id',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '状态',
fieldName: 'status',
component: 'Select',
componentProps: {
options: getDictOptions('wy_gdclzt'),
},
rules: 'selectRequired',
disabled: true
},
{
label: '处理人',
fieldName: 'handler',
component: 'ApiSelect',
formItemClass: 'col-span-2',
rules: 'selectRequired',
dependencies: {
disabled: (formValue) =>formValue.status === '2' ,
triggerFields: ['status'],
},
},
]