Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
@@ -0,0 +1,61 @@
|
|||||||
|
import type { WorkOrdersVO, WorkOrdersForm, WorkOrdersQuery } from './model';
|
||||||
|
|
||||||
|
import type { ID, IDS } from '#/api/common';
|
||||||
|
import type { PageResult } from '#/api/common';
|
||||||
|
|
||||||
|
import { commonExport } from '#/api/helper';
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工单处理列表
|
||||||
|
* @param params
|
||||||
|
* @returns 工单处理列表
|
||||||
|
*/
|
||||||
|
export function workOrdersList(params?: WorkOrdersQuery) {
|
||||||
|
return requestClient.get<PageResult<WorkOrdersVO>>('/property/workOrders/list', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出工单处理列表
|
||||||
|
* @param params
|
||||||
|
* @returns 工单处理列表
|
||||||
|
*/
|
||||||
|
export function workOrdersExport(params?: WorkOrdersQuery) {
|
||||||
|
return commonExport('/property/workOrders/export', params ?? {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工单处理详情
|
||||||
|
* @param id id
|
||||||
|
* @returns 工单处理详情
|
||||||
|
*/
|
||||||
|
export function workOrdersInfo(id: ID) {
|
||||||
|
return requestClient.get<WorkOrdersVO>(`/property/workOrders/${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增工单处理
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function workOrdersAdd(data: WorkOrdersForm) {
|
||||||
|
return requestClient.postWithMsg<void>('/property/workOrders', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新工单处理
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function workOrdersUpdate(data: WorkOrdersForm) {
|
||||||
|
return requestClient.putWithMsg<void>('/property/workOrders', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工单处理
|
||||||
|
* @param id id
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function workOrdersRemove(id: ID | IDS) {
|
||||||
|
return requestClient.deleteWithMsg<void>(`/property/workOrders/${id}`);
|
||||||
|
}
|
219
apps/web-antd/src/api/property/businessManagement/workOrders/model.d.ts
vendored
Normal file
219
apps/web-antd/src/api/property/businessManagement/workOrders/model.d.ts
vendored
Normal file
@@ -0,0 +1,219 @@
|
|||||||
|
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||||
|
|
||||||
|
export interface WorkOrdersVO {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
id: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单编号
|
||||||
|
*/
|
||||||
|
orderNo: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单名称
|
||||||
|
*/
|
||||||
|
orderName: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单类型
|
||||||
|
*/
|
||||||
|
type: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
status: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 派单时间
|
||||||
|
*/
|
||||||
|
dispatchTime: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起人姓名
|
||||||
|
*/
|
||||||
|
initiatorName: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起人手机号
|
||||||
|
*/
|
||||||
|
initiatorPhone: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理人姓名
|
||||||
|
*/
|
||||||
|
handler: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址
|
||||||
|
*/
|
||||||
|
location: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划完成时间
|
||||||
|
*/
|
||||||
|
planCompleTime: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成时间
|
||||||
|
*/
|
||||||
|
compleTime: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 评价
|
||||||
|
*/
|
||||||
|
serviceEvalua: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否超时
|
||||||
|
*/
|
||||||
|
isTimeOut: number;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WorkOrdersForm extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
id?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单编号
|
||||||
|
*/
|
||||||
|
orderNo?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单名称
|
||||||
|
*/
|
||||||
|
orderName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单类型
|
||||||
|
*/
|
||||||
|
type?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
status?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 派单时间
|
||||||
|
*/
|
||||||
|
dispatchTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起人姓名
|
||||||
|
*/
|
||||||
|
initiatorName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起人手机号
|
||||||
|
*/
|
||||||
|
initiatorPhone?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理人姓名
|
||||||
|
*/
|
||||||
|
handler?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址
|
||||||
|
*/
|
||||||
|
location?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划完成时间
|
||||||
|
*/
|
||||||
|
planCompleTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成时间
|
||||||
|
*/
|
||||||
|
compleTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 评价
|
||||||
|
*/
|
||||||
|
serviceEvalua?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否超时
|
||||||
|
*/
|
||||||
|
isTimeOut?: number;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WorkOrdersQuery extends PageQuery {
|
||||||
|
/**
|
||||||
|
* 工单编号
|
||||||
|
*/
|
||||||
|
orderNo?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单名称
|
||||||
|
*/
|
||||||
|
orderName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单类型
|
||||||
|
*/
|
||||||
|
type?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
status?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 派单时间
|
||||||
|
*/
|
||||||
|
dispatchTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起人姓名
|
||||||
|
*/
|
||||||
|
initiatorName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起人手机号
|
||||||
|
*/
|
||||||
|
initiatorPhone?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理人姓名
|
||||||
|
*/
|
||||||
|
handler?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址
|
||||||
|
*/
|
||||||
|
location?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划完成时间
|
||||||
|
*/
|
||||||
|
planCompleTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成时间
|
||||||
|
*/
|
||||||
|
compleTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 评价
|
||||||
|
*/
|
||||||
|
serviceEvalua?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否超时
|
||||||
|
*/
|
||||||
|
isTimeOut?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期范围参数
|
||||||
|
*/
|
||||||
|
params?: any;
|
||||||
|
}
|
@@ -0,0 +1,61 @@
|
|||||||
|
import type { WorkOrdersTypeVO, WorkOrdersTypeForm, WorkOrdersTypeQuery } from './model';
|
||||||
|
|
||||||
|
import type { ID, IDS } from '#/api/common';
|
||||||
|
import type { PageResult } from '#/api/common';
|
||||||
|
|
||||||
|
import { commonExport } from '#/api/helper';
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工单类型管理列表
|
||||||
|
* @param params
|
||||||
|
* @returns 工单类型管理列表
|
||||||
|
*/
|
||||||
|
export function workOrdersTypeList(params?: WorkOrdersTypeQuery) {
|
||||||
|
return requestClient.get<PageResult<WorkOrdersTypeVO>>('/property/workOrdersType/list', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出工单类型管理列表
|
||||||
|
* @param params
|
||||||
|
* @returns 工单类型管理列表
|
||||||
|
*/
|
||||||
|
export function workOrdersTypeExport(params?: WorkOrdersTypeQuery) {
|
||||||
|
return commonExport('/property/workOrdersType/export', params ?? {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工单类型管理详情
|
||||||
|
* @param id id
|
||||||
|
* @returns 工单类型管理详情
|
||||||
|
*/
|
||||||
|
export function workOrdersTypeInfo(id: ID) {
|
||||||
|
return requestClient.get<WorkOrdersTypeVO>(`/property/workOrdersType/${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增工单类型管理
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function workOrdersTypeAdd(data: WorkOrdersTypeForm) {
|
||||||
|
return requestClient.postWithMsg<void>('/property/workOrdersType', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新工单类型管理
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function workOrdersTypeUpdate(data: WorkOrdersTypeForm) {
|
||||||
|
return requestClient.putWithMsg<void>('/property/workOrdersType', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工单类型管理
|
||||||
|
* @param id id
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function workOrdersTypeRemove(id: ID | IDS) {
|
||||||
|
return requestClient.deleteWithMsg<void>(`/property/workOrdersType/${id}`);
|
||||||
|
}
|
114
apps/web-antd/src/api/property/businessManagement/workOrdersType/model.d.ts
vendored
Normal file
114
apps/web-antd/src/api/property/businessManagement/workOrdersType/model.d.ts
vendored
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||||
|
|
||||||
|
export interface WorkOrdersTypeVO {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
id: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单类型编号
|
||||||
|
*/
|
||||||
|
orderTypeNo: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单类型名称
|
||||||
|
*/
|
||||||
|
orderTypeName: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运作模式
|
||||||
|
*/
|
||||||
|
operationMode: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序值
|
||||||
|
*/
|
||||||
|
sort: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计工单数量
|
||||||
|
*/
|
||||||
|
number: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否支持转单(0支持,1不支持)
|
||||||
|
*/
|
||||||
|
isTransfers: number;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WorkOrdersTypeForm extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
id?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单类型编号
|
||||||
|
*/
|
||||||
|
orderTypeNo?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单类型名称
|
||||||
|
*/
|
||||||
|
orderTypeName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运作模式
|
||||||
|
*/
|
||||||
|
operationMode?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序值
|
||||||
|
*/
|
||||||
|
sort?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计工单数量
|
||||||
|
*/
|
||||||
|
number?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否支持转单(0支持,1不支持)
|
||||||
|
*/
|
||||||
|
isTransfers?: number;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WorkOrdersTypeQuery extends PageQuery {
|
||||||
|
/**
|
||||||
|
* 工单类型编号
|
||||||
|
*/
|
||||||
|
orderTypeNo?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单类型名称
|
||||||
|
*/
|
||||||
|
orderTypeName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运作模式
|
||||||
|
*/
|
||||||
|
operationMode?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序值
|
||||||
|
*/
|
||||||
|
sort?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计工单数量
|
||||||
|
*/
|
||||||
|
number?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否支持转单(0支持,1不支持)
|
||||||
|
*/
|
||||||
|
isTransfers?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期范围参数
|
||||||
|
*/
|
||||||
|
params?: any;
|
||||||
|
}
|
@@ -15,7 +15,7 @@ export function attachList(params?: AttachQuery) {
|
|||||||
return requestClient.get<PageResult<AttachVO>>('/property/attach/list', { params });
|
return requestClient.get<PageResult<AttachVO>>('/property/attach/list', { params });
|
||||||
}
|
}
|
||||||
export function attachListAll() {
|
export function attachListAll() {
|
||||||
return requestClient.get<PageResult<AttachVO>>('/property/attach/attachList', );
|
return requestClient.get<AttachVO[]>('/property/attach/attachList', );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -0,0 +1,230 @@
|
|||||||
|
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: {},
|
||||||
|
fieldName: 'type',
|
||||||
|
label: '工单类型',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: getDictOptions('wy_gdclzt'),
|
||||||
|
},
|
||||||
|
fieldName: 'status',
|
||||||
|
label: '状态',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const columns: VxeGridProps['columns'] = [
|
||||||
|
{type: 'checkbox', width: 60},
|
||||||
|
{
|
||||||
|
title: '工单编号',
|
||||||
|
field: 'orderNo',
|
||||||
|
width: 180,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '工单名称',
|
||||||
|
field: 'orderName',
|
||||||
|
minWidth: 180,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '工单类型',
|
||||||
|
field: 'type',
|
||||||
|
slots: {
|
||||||
|
default: ({row}) => {
|
||||||
|
return renderDict(row.type, 'wy_gdlx');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '状态',
|
||||||
|
field: 'status',
|
||||||
|
slots: {
|
||||||
|
default: ({row}) => {
|
||||||
|
return renderDict(row.status, 'wy_gdclzt');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '派单时间',
|
||||||
|
field: 'dispatchTime',
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '发起人姓名',
|
||||||
|
field: 'initiatorName',
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '发起人手机号',
|
||||||
|
field: 'initiatorPhone',
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '处理人姓名',
|
||||||
|
field: 'handler',
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '地址',
|
||||||
|
field: 'location',
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '计划完成时间',
|
||||||
|
field: 'planCompleTime',
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '完成时间',
|
||||||
|
field: 'compleTime',
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '评价',
|
||||||
|
field: 'serviceEvalua',
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '是否超时',
|
||||||
|
field: 'isTimeOut',
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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: 'orderName',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '工单类型',
|
||||||
|
fieldName: 'type',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {},
|
||||||
|
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',
|
||||||
|
},
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '发起人',
|
||||||
|
fieldName: 'initiatorName',
|
||||||
|
component: 'ApiSelect',
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
rules: 'selectRequired',
|
||||||
|
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// label: '发起人手机号',
|
||||||
|
// fieldName: 'initiatorPhone',
|
||||||
|
// component: 'Input',
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
label: '处理人',
|
||||||
|
fieldName: 'handler',
|
||||||
|
component: 'ApiSelect',
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '具体位置',
|
||||||
|
fieldName: 'location',
|
||||||
|
component: 'Input',
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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: 'serviceEvalua',
|
||||||
|
component: 'Rate',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '是否超时',
|
||||||
|
fieldName: 'isTimeOut',
|
||||||
|
component: 'RadioGroup',
|
||||||
|
componentProps: {
|
||||||
|
buttonStyle: 'solid',
|
||||||
|
options: getDictOptions('wy_sf'),
|
||||||
|
},
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
];
|
@@ -0,0 +1,168 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
|
import { getVxePopupContainer } from '@vben/utils';
|
||||||
|
|
||||||
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
|
|
||||||
|
import {
|
||||||
|
useVbenVxeGrid,
|
||||||
|
vxeCheckboxChecked,
|
||||||
|
type VxeGridProps
|
||||||
|
} from '#/adapter/vxe-table';
|
||||||
|
|
||||||
|
import {
|
||||||
|
workOrdersExport,
|
||||||
|
workOrdersList,
|
||||||
|
workOrdersRemove,
|
||||||
|
} from '#/api/property/businessManagement/workOrders';
|
||||||
|
import type { WorkOrdersForm } from '#/api/property/businessManagement/workOrders/model';
|
||||||
|
import { commonDownloadExcel } from '#/utils/file/download';
|
||||||
|
|
||||||
|
import workOrdersModal from './workOrders-modal.vue';
|
||||||
|
import { columns, querySchema } from './data';
|
||||||
|
|
||||||
|
const formOptions: VbenFormProps = {
|
||||||
|
commonConfig: {
|
||||||
|
labelWidth: 80,
|
||||||
|
componentProps: {
|
||||||
|
allowClear: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
schema: querySchema(),
|
||||||
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||||
|
};
|
||||||
|
|
||||||
|
const gridOptions: VxeGridProps = {
|
||||||
|
checkboxConfig: {
|
||||||
|
// 高亮
|
||||||
|
highlight: true,
|
||||||
|
// 翻页时保留选中状态
|
||||||
|
reserve: true,
|
||||||
|
// 点击行选中
|
||||||
|
// trigger: 'row',
|
||||||
|
},
|
||||||
|
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||||
|
// columns: columns(),
|
||||||
|
columns,
|
||||||
|
height: 'auto',
|
||||||
|
keepSource: true,
|
||||||
|
pagerConfig: {},
|
||||||
|
proxyConfig: {
|
||||||
|
ajax: {
|
||||||
|
query: async ({ page }, formValues = {}) => {
|
||||||
|
return await workOrdersList({
|
||||||
|
pageNum: page.currentPage,
|
||||||
|
pageSize: page.pageSize,
|
||||||
|
...formValues,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rowConfig: {
|
||||||
|
keyField: 'id',
|
||||||
|
},
|
||||||
|
// 表格全局唯一表示 保存列配置需要用到
|
||||||
|
id: 'property-workOrders-index'
|
||||||
|
};
|
||||||
|
|
||||||
|
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||||
|
formOptions,
|
||||||
|
gridOptions,
|
||||||
|
});
|
||||||
|
|
||||||
|
const [WorkOrdersModal, modalApi] = useVbenModal({
|
||||||
|
connectedComponent: workOrdersModal,
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleAdd() {
|
||||||
|
modalApi.setData({});
|
||||||
|
modalApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleEdit(row: Required<WorkOrdersForm>) {
|
||||||
|
modalApi.setData({ id: row.id });
|
||||||
|
modalApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleDelete(row: Required<WorkOrdersForm>) {
|
||||||
|
await workOrdersRemove(row.id);
|
||||||
|
await tableApi.query();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleMultiDelete() {
|
||||||
|
const rows = tableApi.grid.getCheckboxRecords();
|
||||||
|
const ids = rows.map((row: Required<WorkOrdersForm>) => row.id);
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
okType: 'danger',
|
||||||
|
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||||
|
onOk: async () => {
|
||||||
|
await workOrdersRemove(ids);
|
||||||
|
await tableApi.query();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDownloadExcel() {
|
||||||
|
commonDownloadExcel(workOrdersExport, '工单处理数据', tableApi.formApi.form.values, {
|
||||||
|
fieldMappingTime: formOptions.fieldMappingTime,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Page :auto-content-height="true">
|
||||||
|
<BasicTable table-title="工单处理列表">
|
||||||
|
<template #toolbar-tools>
|
||||||
|
<Space>
|
||||||
|
<a-button
|
||||||
|
v-access:code="['property:workOrders:export']"
|
||||||
|
@click="handleDownloadExcel"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.export') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||||
|
danger
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['property:workOrders:remove']"
|
||||||
|
@click="handleMultiDelete">
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['property:workOrders:add']"
|
||||||
|
@click="handleAdd"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.add') }}
|
||||||
|
</a-button>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
<template #action="{ row }">
|
||||||
|
<Space>
|
||||||
|
<ghost-button
|
||||||
|
v-access:code="['property:workOrders:edit']"
|
||||||
|
@click.stop="handleEdit(row)"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.edit') }}
|
||||||
|
</ghost-button>
|
||||||
|
<Popconfirm
|
||||||
|
:get-popup-container="getVxePopupContainer"
|
||||||
|
placement="left"
|
||||||
|
title="确认删除?"
|
||||||
|
@confirm="handleDelete(row)"
|
||||||
|
>
|
||||||
|
<ghost-button
|
||||||
|
danger
|
||||||
|
v-access:code="['property:workOrders:remove']"
|
||||||
|
@click.stop=""
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</ghost-button>
|
||||||
|
</Popconfirm>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<WorkOrdersModal @reload="tableApi.query()" />
|
||||||
|
</Page>
|
||||||
|
</template>
|
@@ -0,0 +1,138 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import {computed, ref} from 'vue';
|
||||||
|
|
||||||
|
import {useVbenModal} from '@vben/common-ui';
|
||||||
|
import {$t} from '@vben/locales';
|
||||||
|
import {cloneDeep} from '@vben/utils';
|
||||||
|
|
||||||
|
import {useVbenForm} from '#/adapter/form';
|
||||||
|
import {
|
||||||
|
workOrdersAdd,
|
||||||
|
workOrdersInfo,
|
||||||
|
workOrdersUpdate
|
||||||
|
} from '#/api/property/businessManagement/workOrders';
|
||||||
|
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||||
|
|
||||||
|
import {modalSchema} from './data';
|
||||||
|
import {personList} from "#/api/property/resident/person";
|
||||||
|
import {renderDictValue} from "#/utils/render";
|
||||||
|
|
||||||
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const title = computed(() => {
|
||||||
|
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||||
|
});
|
||||||
|
|
||||||
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
|
commonConfig: {
|
||||||
|
// 默认占满两列
|
||||||
|
formItemClass: 'col-span-1',
|
||||||
|
// 默认label宽度 px
|
||||||
|
labelWidth: 80,
|
||||||
|
// 通用配置项 会影响到所有表单项
|
||||||
|
componentProps: {
|
||||||
|
class: 'w-full',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
schema: modalSchema(),
|
||||||
|
showDefaultActions: false,
|
||||||
|
wrapperClass: 'grid-cols-2',
|
||||||
|
});
|
||||||
|
|
||||||
|
const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
|
||||||
|
{
|
||||||
|
initializedGetter: defaultFormValueGetter(formApi),
|
||||||
|
currentGetter: defaultFormValueGetter(formApi),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
|
// 在这里更改宽度
|
||||||
|
class: 'w-[70%]',
|
||||||
|
fullscreenButton: false,
|
||||||
|
onBeforeClose,
|
||||||
|
onClosed: handleClosed,
|
||||||
|
onConfirm: handleConfirm,
|
||||||
|
onOpenChange: async (isOpen) => {
|
||||||
|
if (!isOpen) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
modalApi.modalLoading(true);
|
||||||
|
await queryPersonData()
|
||||||
|
const {id} = modalApi.getData() as { id?: number | string };
|
||||||
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
|
if (isUpdate.value && id) {
|
||||||
|
const record = await workOrdersInfo(id);
|
||||||
|
await formApi.setValues(record);
|
||||||
|
}
|
||||||
|
await markInitialized();
|
||||||
|
|
||||||
|
modalApi.modalLoading(false);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
async function handleConfirm() {
|
||||||
|
try {
|
||||||
|
modalApi.lock(true);
|
||||||
|
const {valid} = await formApi.validate();
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||||
|
const data = cloneDeep(await formApi.getValues());
|
||||||
|
await (isUpdate.value ? workOrdersUpdate(data) : workOrdersAdd(data));
|
||||||
|
resetInitialized();
|
||||||
|
emit('reload');
|
||||||
|
modalApi.close();
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
modalApi.lock(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleClosed() {
|
||||||
|
await formApi.resetForm();
|
||||||
|
resetInitialized();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function queryPersonData() {
|
||||||
|
let params = {
|
||||||
|
pageSize: 1000,
|
||||||
|
pageNum: 1,
|
||||||
|
}
|
||||||
|
const res = await personList(params);
|
||||||
|
const options = res.rows.map((user) => ({
|
||||||
|
label: user.userName + '-' + renderDictValue(user.gender, 'sys_user_sex') + '-' + user.phone,
|
||||||
|
value: user.id,
|
||||||
|
}));
|
||||||
|
formApi.updateSchema([{
|
||||||
|
componentProps: () => ({
|
||||||
|
options: options,
|
||||||
|
filterOption: filterOption
|
||||||
|
}),
|
||||||
|
fieldName: 'initiatorName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
componentProps: () => ({
|
||||||
|
options: options,
|
||||||
|
filterOption: filterOption
|
||||||
|
}),
|
||||||
|
fieldName: 'handler',
|
||||||
|
}])
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterOption = (input: string, option: any) => {
|
||||||
|
return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BasicModal :title="title">
|
||||||
|
<BasicForm/>
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
||||||
|
|
@@ -0,0 +1,104 @@
|
|||||||
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||||||
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
|
|
||||||
|
|
||||||
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'orderTypeNo',
|
||||||
|
label: '类型编号',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'orderTypeName',
|
||||||
|
label: '类型名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
},
|
||||||
|
fieldName: 'operationMode',
|
||||||
|
label: '运作模式',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const columns: VxeGridProps['columns'] = [
|
||||||
|
{ type: 'checkbox', width: 60 },
|
||||||
|
{
|
||||||
|
title: '类型编号',
|
||||||
|
field: 'orderTypeNo',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '类型名称',
|
||||||
|
field: 'orderTypeName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '运作模式',
|
||||||
|
field: 'operationMode',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '排序值',
|
||||||
|
field: 'sort',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '累计工单数量',
|
||||||
|
field: 'number',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '是否支持转单',
|
||||||
|
field: 'isTransfers',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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: 'orderTypeNo',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '类型名称',
|
||||||
|
fieldName: 'orderTypeName',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '运作模式',
|
||||||
|
fieldName: 'operationMode',
|
||||||
|
component: 'Input',
|
||||||
|
componentProps: {
|
||||||
|
},
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '排序值',
|
||||||
|
fieldName: 'sort',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '累计工单数量',
|
||||||
|
fieldName: 'number',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '是否支持转单',
|
||||||
|
fieldName: 'isTransfers',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
];
|
@@ -0,0 +1,166 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
|
import { getVxePopupContainer } from '@vben/utils';
|
||||||
|
|
||||||
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
|
|
||||||
|
import {
|
||||||
|
useVbenVxeGrid,
|
||||||
|
vxeCheckboxChecked,
|
||||||
|
type VxeGridProps
|
||||||
|
} from '#/adapter/vxe-table';
|
||||||
|
|
||||||
|
import {
|
||||||
|
workOrdersTypeExport,
|
||||||
|
workOrdersTypeList,
|
||||||
|
workOrdersTypeRemove,
|
||||||
|
} from '#/api/property/businessManagement/workOrdersType';
|
||||||
|
import type { WorkOrdersTypeForm } from '#/api/property/businessManagement/workOrdersType/model';
|
||||||
|
import { commonDownloadExcel } from '#/utils/file/download';
|
||||||
|
|
||||||
|
import workOrdersTypeModal from './workOrdersType-modal.vue';
|
||||||
|
import { columns, querySchema } from './data';
|
||||||
|
|
||||||
|
const formOptions: VbenFormProps = {
|
||||||
|
commonConfig: {
|
||||||
|
labelWidth: 80,
|
||||||
|
componentProps: {
|
||||||
|
allowClear: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
schema: querySchema(),
|
||||||
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||||
|
};
|
||||||
|
|
||||||
|
const gridOptions: VxeGridProps = {
|
||||||
|
checkboxConfig: {
|
||||||
|
// 高亮
|
||||||
|
highlight: true,
|
||||||
|
// 翻页时保留选中状态
|
||||||
|
reserve: true,
|
||||||
|
// 点击行选中
|
||||||
|
// trigger: 'row',
|
||||||
|
},
|
||||||
|
columns,
|
||||||
|
height: 'auto',
|
||||||
|
keepSource: true,
|
||||||
|
pagerConfig: {},
|
||||||
|
proxyConfig: {
|
||||||
|
ajax: {
|
||||||
|
query: async ({ page }, formValues = {}) => {
|
||||||
|
return await workOrdersTypeList({
|
||||||
|
pageNum: page.currentPage,
|
||||||
|
pageSize: page.pageSize,
|
||||||
|
...formValues,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rowConfig: {
|
||||||
|
keyField: 'id',
|
||||||
|
},
|
||||||
|
// 表格全局唯一表示 保存列配置需要用到
|
||||||
|
id: 'property-workOrdersType-index'
|
||||||
|
};
|
||||||
|
|
||||||
|
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||||
|
formOptions,
|
||||||
|
gridOptions,
|
||||||
|
});
|
||||||
|
|
||||||
|
const [WorkOrdersTypeModal, modalApi] = useVbenModal({
|
||||||
|
connectedComponent: workOrdersTypeModal,
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleAdd() {
|
||||||
|
modalApi.setData({});
|
||||||
|
modalApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleEdit(row: Required<WorkOrdersTypeForm>) {
|
||||||
|
modalApi.setData({ id: row.id });
|
||||||
|
modalApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleDelete(row: Required<WorkOrdersTypeForm>) {
|
||||||
|
await workOrdersTypeRemove(row.id);
|
||||||
|
await tableApi.query();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleMultiDelete() {
|
||||||
|
const rows = tableApi.grid.getCheckboxRecords();
|
||||||
|
const ids = rows.map((row: Required<WorkOrdersTypeForm>) => row.id);
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
okType: 'danger',
|
||||||
|
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||||
|
onOk: async () => {
|
||||||
|
await workOrdersTypeRemove(ids);
|
||||||
|
await tableApi.query();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDownloadExcel() {
|
||||||
|
commonDownloadExcel(workOrdersTypeExport, '工单类型管理数据', tableApi.formApi.form.values, {
|
||||||
|
fieldMappingTime: formOptions.fieldMappingTime,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Page :auto-content-height="true">
|
||||||
|
<BasicTable table-title="工单类型列表">
|
||||||
|
<template #toolbar-tools>
|
||||||
|
<Space>
|
||||||
|
<a-button
|
||||||
|
v-access:code="['property:workOrdersType:export']"
|
||||||
|
@click="handleDownloadExcel"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.export') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||||
|
danger
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['property:workOrdersType:remove']"
|
||||||
|
@click="handleMultiDelete">
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['property:workOrdersType:add']"
|
||||||
|
@click="handleAdd"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.add') }}
|
||||||
|
</a-button>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
<template #action="{ row }">
|
||||||
|
<Space>
|
||||||
|
<ghost-button
|
||||||
|
v-access:code="['property:workOrdersType:edit']"
|
||||||
|
@click.stop="handleEdit(row)"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.edit') }}
|
||||||
|
</ghost-button>
|
||||||
|
<Popconfirm
|
||||||
|
:get-popup-container="getVxePopupContainer"
|
||||||
|
placement="left"
|
||||||
|
title="确认删除?"
|
||||||
|
@confirm="handleDelete(row)"
|
||||||
|
>
|
||||||
|
<ghost-button
|
||||||
|
danger
|
||||||
|
v-access:code="['property:workOrdersType:remove']"
|
||||||
|
@click.stop=""
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</ghost-button>
|
||||||
|
</Popconfirm>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<WorkOrdersTypeModal @reload="tableApi.query()" />
|
||||||
|
</Page>
|
||||||
|
</template>
|
@@ -0,0 +1,101 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
|
import { $t } from '@vben/locales';
|
||||||
|
import { cloneDeep } from '@vben/utils';
|
||||||
|
|
||||||
|
import { useVbenForm } from '#/adapter/form';
|
||||||
|
import { workOrdersTypeAdd, workOrdersTypeInfo, workOrdersTypeUpdate } from '#/api/property/businessManagement/workOrdersType';
|
||||||
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
|
import { modalSchema } from './data';
|
||||||
|
|
||||||
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const title = computed(() => {
|
||||||
|
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||||
|
});
|
||||||
|
|
||||||
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
|
commonConfig: {
|
||||||
|
// 默认占满两列
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
// 默认label宽度 px
|
||||||
|
labelWidth: 80,
|
||||||
|
// 通用配置项 会影响到所有表单项
|
||||||
|
componentProps: {
|
||||||
|
class: 'w-full',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
schema: modalSchema(),
|
||||||
|
showDefaultActions: false,
|
||||||
|
wrapperClass: 'grid-cols-2',
|
||||||
|
});
|
||||||
|
|
||||||
|
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||||
|
{
|
||||||
|
initializedGetter: defaultFormValueGetter(formApi),
|
||||||
|
currentGetter: defaultFormValueGetter(formApi),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
|
// 在这里更改宽度
|
||||||
|
class: 'w-[550px]',
|
||||||
|
fullscreenButton: false,
|
||||||
|
onBeforeClose,
|
||||||
|
onClosed: handleClosed,
|
||||||
|
onConfirm: handleConfirm,
|
||||||
|
onOpenChange: async (isOpen) => {
|
||||||
|
if (!isOpen) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
modalApi.modalLoading(true);
|
||||||
|
|
||||||
|
const { id } = modalApi.getData() as { id?: number | string };
|
||||||
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
|
if (isUpdate.value && id) {
|
||||||
|
const record = await workOrdersTypeInfo(id);
|
||||||
|
await formApi.setValues(record);
|
||||||
|
}
|
||||||
|
await markInitialized();
|
||||||
|
|
||||||
|
modalApi.modalLoading(false);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
async function handleConfirm() {
|
||||||
|
try {
|
||||||
|
modalApi.lock(true);
|
||||||
|
const { valid } = await formApi.validate();
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||||
|
const data = cloneDeep(await formApi.getValues());
|
||||||
|
await (isUpdate.value ? workOrdersTypeUpdate(data) : workOrdersTypeAdd(data));
|
||||||
|
resetInitialized();
|
||||||
|
emit('reload');
|
||||||
|
modalApi.close();
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
modalApi.lock(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleClosed() {
|
||||||
|
await formApi.resetForm();
|
||||||
|
resetInitialized();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BasicModal :title="title">
|
||||||
|
<BasicForm />
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
||||||
|
|
@@ -76,8 +76,8 @@ async function handleConfirm() {
|
|||||||
}
|
}
|
||||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||||
const data = cloneDeep(await formApi.getValues());
|
const data = cloneDeep(await formApi.getValues());
|
||||||
data.meetId=conferenceSettingDetail.value.id;
|
data.meetId=conferenceSettingDetail.value?.id;
|
||||||
data.name=conferenceSettingDetail.value.name;
|
data.name=conferenceSettingDetail.value?.name;
|
||||||
if (data.timeSpan && data.timeSpan.length) {
|
if (data.timeSpan && data.timeSpan.length) {
|
||||||
data.scheduledStarttime = data.timeSpan[0]?.format("HH:mm");
|
data.scheduledStarttime = data.timeSpan[0]?.format("HH:mm");
|
||||||
data.scheduledEndtime = data.timeSpan[1]?.format("HH:mm");
|
data.scheduledEndtime = data.timeSpan[1]?.format("HH:mm");
|
||||||
@@ -110,12 +110,7 @@ async function handleOpenChange() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function queryAddServices() {
|
async function queryAddServices() {
|
||||||
let params = {
|
const res = await attachListAll()
|
||||||
pageSize: 1000,
|
|
||||||
pageNum: 1,
|
|
||||||
state: 1
|
|
||||||
}
|
|
||||||
const res = await attachListAll(params)
|
|
||||||
addServiceList.value = res.map(item => ({
|
addServiceList.value = res.map(item => ({
|
||||||
meetAttachId: item.id,
|
meetAttachId: item.id,
|
||||||
projectName: item.projectName,
|
projectName: item.projectName,
|
||||||
@@ -203,7 +198,7 @@ async function changeProjectNum() {
|
|||||||
<template #serverInfo="slotProps">
|
<template #serverInfo="slotProps">
|
||||||
<Table :dataSource="addServiceList" v-bind="slotProps" :columns="addServiceColumns"
|
<Table :dataSource="addServiceList" v-bind="slotProps" :columns="addServiceColumns"
|
||||||
:pagination="false"
|
:pagination="false"
|
||||||
bordered size="small" :show-header="false" :bordered="false">
|
size="small" :show-header="false" bordered>
|
||||||
<template #bodyCell="{ column, record, index }">
|
<template #bodyCell="{ column, record, index }">
|
||||||
<template v-if="column.field === 'price'">
|
<template v-if="column.field === 'price'">
|
||||||
{{ record.price + '元/' + renderDictValue(record.unit, 'pro_product_unit') }}
|
{{ record.price + '元/' + renderDictValue(record.unit, 'pro_product_unit') }}
|
||||||
|
@@ -21,7 +21,9 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item class="form-button">
|
<a-form-item class="form-button">
|
||||||
<a-button @click="handleClean">重置</a-button>
|
<a-button @click="handleClean">重置</a-button>
|
||||||
<a-button type="primary" class="primary-button" @click="handleSearch">搜索</a-button>
|
<a-button type="primary" class="primary-button"
|
||||||
|
:disabled="!formState.appointmentTime||!formState.openHours||!formState.personNumber"
|
||||||
|
@click="handleSearch">搜索</a-button>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
<div v-if="meetingList?.length" class="card-box">
|
<div v-if="meetingList?.length" class="card-box">
|
||||||
|
Reference in New Issue
Block a user