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:
@@ -26,6 +26,16 @@ export interface DeviceLocationVO {
|
|||||||
*/
|
*/
|
||||||
searchValue: string;
|
searchValue: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 位置类型
|
||||||
|
*/
|
||||||
|
locationObjName: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索值
|
||||||
|
*/
|
||||||
|
remark: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeviceLocationForm extends BaseEntity {
|
export interface DeviceLocationForm extends BaseEntity {
|
||||||
|
@@ -0,0 +1,61 @@
|
|||||||
|
import type { MachineVO, MachineForm, MachineQuery } 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 machineList(params?: MachineQuery) {
|
||||||
|
return requestClient.get<PageResult<MachineVO>>('/property/machine/list', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出设备列表列表
|
||||||
|
* @param params
|
||||||
|
* @returns 设备列表列表
|
||||||
|
*/
|
||||||
|
export function machineExport(params?: MachineQuery) {
|
||||||
|
return commonExport('/property/machine/export', params ?? {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备列表详情
|
||||||
|
* @param id id
|
||||||
|
* @returns 设备列表详情
|
||||||
|
*/
|
||||||
|
export function machineInfo(id: ID) {
|
||||||
|
return requestClient.get<MachineVO>(`/property/machine/${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备列表
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function machineAdd(data: MachineForm) {
|
||||||
|
return requestClient.postWithMsg<void>('/property/machine', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新设备列表
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function machineUpdate(data: MachineForm) {
|
||||||
|
return requestClient.putWithMsg<void>('/property/machine', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设备列表
|
||||||
|
* @param id id
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function machineRemove(id: ID | IDS) {
|
||||||
|
return requestClient.deleteWithMsg<void>(`/property/machine/${id}`);
|
||||||
|
}
|
204
apps/web-antd/src/api/property/equipmentManagement/machine/model.d.ts
vendored
Normal file
204
apps/web-antd/src/api/property/equipmentManagement/machine/model.d.ts
vendored
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||||
|
|
||||||
|
export interface MachineVO {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
id: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
machineName: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备编码
|
||||||
|
*/
|
||||||
|
machineCode: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备品牌
|
||||||
|
*/
|
||||||
|
machineBrand: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备类型
|
||||||
|
*/
|
||||||
|
machineTypeId: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 位置详情
|
||||||
|
*/
|
||||||
|
locationId: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购价格
|
||||||
|
*/
|
||||||
|
purchasePrice: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用时间
|
||||||
|
*/
|
||||||
|
activationTime: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保修截至时间
|
||||||
|
*/
|
||||||
|
deadline: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用年限(年)
|
||||||
|
*/
|
||||||
|
serviceLife: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保修周期
|
||||||
|
*/
|
||||||
|
maintenanceCycle: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用状态
|
||||||
|
*/
|
||||||
|
state: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 责任人
|
||||||
|
*/
|
||||||
|
personId: string | number;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MachineForm extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
id?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
machineName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备编码
|
||||||
|
*/
|
||||||
|
machineCode?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备品牌
|
||||||
|
*/
|
||||||
|
machineBrand?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备类型
|
||||||
|
*/
|
||||||
|
machineTypeId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 位置详情
|
||||||
|
*/
|
||||||
|
locationId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购价格
|
||||||
|
*/
|
||||||
|
purchasePrice?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用时间
|
||||||
|
*/
|
||||||
|
activationTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保修截至时间
|
||||||
|
*/
|
||||||
|
deadline?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用年限(年)
|
||||||
|
*/
|
||||||
|
serviceLife?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保修周期
|
||||||
|
*/
|
||||||
|
maintenanceCycle?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用状态
|
||||||
|
*/
|
||||||
|
state?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 责任人
|
||||||
|
*/
|
||||||
|
personId?: string | number;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MachineQuery extends PageQuery {
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
machineName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备编码
|
||||||
|
*/
|
||||||
|
machineCode?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备品牌
|
||||||
|
*/
|
||||||
|
machineBrand?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备类型
|
||||||
|
*/
|
||||||
|
machineTypeId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 位置详情
|
||||||
|
*/
|
||||||
|
locationId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购价格
|
||||||
|
*/
|
||||||
|
purchasePrice?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用时间
|
||||||
|
*/
|
||||||
|
activationTime?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保修截至时间
|
||||||
|
*/
|
||||||
|
deadline?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用年限(年)
|
||||||
|
*/
|
||||||
|
serviceLife?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保修周期
|
||||||
|
*/
|
||||||
|
maintenanceCycle?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用状态
|
||||||
|
*/
|
||||||
|
state?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 责任人
|
||||||
|
*/
|
||||||
|
personId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期范围参数
|
||||||
|
*/
|
||||||
|
params?: any;
|
||||||
|
}
|
@@ -0,0 +1,61 @@
|
|||||||
|
import type { MaintainPlanVO, MaintainPlanForm, MaintainPlanQuery } 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 maintainPlanList(params?: MaintainPlanQuery) {
|
||||||
|
return requestClient.get<PageResult<MaintainPlanVO>>('/property/maintainPlan/list', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出保养计划列表
|
||||||
|
* @param params
|
||||||
|
* @returns 保养计划列表
|
||||||
|
*/
|
||||||
|
export function maintainPlanExport(params?: MaintainPlanQuery) {
|
||||||
|
return commonExport('/property/maintainPlan/export', params ?? {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询保养计划详情
|
||||||
|
* @param id id
|
||||||
|
* @returns 保养计划详情
|
||||||
|
*/
|
||||||
|
export function maintainPlanInfo(id: ID) {
|
||||||
|
return requestClient.get<MaintainPlanVO>(`/property/maintainPlan/${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保养计划
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function maintainPlanAdd(data: MaintainPlanForm) {
|
||||||
|
return requestClient.postWithMsg<void>('/property/maintainPlan', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新保养计划
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function maintainPlanUpdate(data: MaintainPlanForm) {
|
||||||
|
return requestClient.putWithMsg<void>('/property/maintainPlan', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除保养计划
|
||||||
|
* @param id id
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function maintainPlanRemove(id: ID | IDS) {
|
||||||
|
return requestClient.deleteWithMsg<void>(`/property/maintainPlan/${id}`);
|
||||||
|
}
|
174
apps/web-antd/src/api/property/equipmentManagement/maintainPlan/model.d.ts
vendored
Normal file
174
apps/web-antd/src/api/property/equipmentManagement/maintainPlan/model.d.ts
vendored
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||||
|
|
||||||
|
export interface MaintainPlanVO {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
id: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划名称
|
||||||
|
*/
|
||||||
|
planName: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划编号
|
||||||
|
*/
|
||||||
|
planNo: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养周期(1月/天2.固定天)
|
||||||
|
*/
|
||||||
|
planPeriod: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养设备类型id
|
||||||
|
*/
|
||||||
|
machineTypeId: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养天
|
||||||
|
*/
|
||||||
|
maintainDay: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养月
|
||||||
|
*/
|
||||||
|
maintainMonth: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 固定天
|
||||||
|
*/
|
||||||
|
maintainEveryday: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
startDate: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
endDate: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0启用,1停用)
|
||||||
|
*/
|
||||||
|
state: string;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MaintainPlanForm extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
id?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划名称
|
||||||
|
*/
|
||||||
|
planName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划编号
|
||||||
|
*/
|
||||||
|
planNo?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养周期(1月/天2.固定天)
|
||||||
|
*/
|
||||||
|
planPeriod?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养设备类型id
|
||||||
|
*/
|
||||||
|
machineTypeId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养天
|
||||||
|
*/
|
||||||
|
maintainDay?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养月
|
||||||
|
*/
|
||||||
|
maintainMonth?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 固定天
|
||||||
|
*/
|
||||||
|
maintainEveryday?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
startDate?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
endDate?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0启用,1停用)
|
||||||
|
*/
|
||||||
|
state?: string;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MaintainPlanQuery extends PageQuery {
|
||||||
|
/**
|
||||||
|
* 计划名称
|
||||||
|
*/
|
||||||
|
planName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划编号
|
||||||
|
*/
|
||||||
|
planNo?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养周期(1月/天2.固定天)
|
||||||
|
*/
|
||||||
|
planPeriod?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养设备类型id
|
||||||
|
*/
|
||||||
|
machineTypeId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养天
|
||||||
|
*/
|
||||||
|
maintainDay?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保养月
|
||||||
|
*/
|
||||||
|
maintainMonth?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 固定天
|
||||||
|
*/
|
||||||
|
maintainEveryday?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
startDate?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
endDate?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0启用,1停用)
|
||||||
|
*/
|
||||||
|
state?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期范围参数
|
||||||
|
*/
|
||||||
|
params?: any;
|
||||||
|
}
|
@@ -1,5 +1,7 @@
|
|||||||
import type { FormSchemaGetter } from '#/adapter/form';
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
|
import {getDictOptions} from "#/utils/dict";
|
||||||
|
import {renderDict} from "#/utils/render";
|
||||||
|
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
@@ -8,23 +10,14 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
fieldName: 'locationName',
|
fieldName: 'locationName',
|
||||||
label: '位置名称',
|
label: '位置名称',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'locationCode',
|
|
||||||
label: '位置编号',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
|
options: getDictOptions('pro_location_type'),
|
||||||
},
|
},
|
||||||
fieldName: 'locationType',
|
fieldName: 'locationType',
|
||||||
label: '位置类型',
|
label: '位置类型',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'searchValue',
|
|
||||||
label: '搜索值',
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||||
@@ -32,24 +25,30 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{ type: 'checkbox', width: 60 },
|
{ type: 'checkbox', width: 60 },
|
||||||
{
|
{
|
||||||
title: '主键',
|
title: '位置编码',
|
||||||
field: 'id',
|
field: 'locationCode',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '位置名称',
|
title: '位置名称',
|
||||||
field: 'locationName',
|
field: 'locationName',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '位置编号',
|
|
||||||
field: 'locationCode',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '位置类型',
|
title: '位置类型',
|
||||||
field: 'locationType',
|
field: 'locationType',
|
||||||
|
slots: {
|
||||||
|
default: ({ row }) => {
|
||||||
|
return renderDict(row.locationType, 'pro_location_type');
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '搜索值',
|
title: '位置对象',
|
||||||
field: 'searchValue',
|
field: 'locationObject',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '备注',
|
||||||
|
field: 'remark',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'action',
|
field: 'action',
|
||||||
@@ -60,37 +59,41 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const modalSchema: FormSchemaGetter = () => [
|
// export const modalSchema: FormSchemaGetter = () => [
|
||||||
{
|
// {
|
||||||
label: '主键',
|
// label: '主键',
|
||||||
fieldName: 'id',
|
// fieldName: 'id',
|
||||||
component: 'Input',
|
// component: 'Input',
|
||||||
dependencies: {
|
// dependencies: {
|
||||||
show: () => false,
|
// show: () => false,
|
||||||
triggerFields: [''],
|
// triggerFields: [''],
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
label: '位置名称',
|
// label: '位置名称',
|
||||||
fieldName: 'locationName',
|
// fieldName: 'locationName',
|
||||||
component: 'Input',
|
// component: 'Input',
|
||||||
rules: 'required',
|
// rules: 'required',
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
label: '位置编号',
|
// label: '位置类型',
|
||||||
fieldName: 'locationCode',
|
// fieldName: 'locationType',
|
||||||
component: 'Input',
|
// component: 'Select',
|
||||||
},
|
// componentProps: {
|
||||||
{
|
// options: getDictOptions('pro_location_type'),
|
||||||
label: '位置类型',
|
// },
|
||||||
fieldName: 'locationType',
|
// rules: 'selectRequired',
|
||||||
component: 'Select',
|
// },
|
||||||
componentProps: {
|
// {
|
||||||
},
|
// component: 'TreeSelect',
|
||||||
},
|
// fieldName: 'locationObject',
|
||||||
{
|
// defaultValue: undefined,
|
||||||
label: '搜索值',
|
// label: '位置对象',
|
||||||
fieldName: 'searchValue',
|
// rules: 'selectRequired',
|
||||||
component: 'Input',
|
// },
|
||||||
},
|
// {
|
||||||
];
|
// label: '备注',
|
||||||
|
// fieldName: 'remark',
|
||||||
|
// component: 'Textarea',
|
||||||
|
// },
|
||||||
|
// ];
|
||||||
|
@@ -0,0 +1,52 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type {DeviceLocationVO} from '#/api/property/equipmentManagement/deviceLocation/model';
|
||||||
|
import {shallowRef} from 'vue';
|
||||||
|
import {useVbenModal} from '@vben/common-ui';
|
||||||
|
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||||
|
import {deviceLocationInfo} from '#/api/property/equipmentManagement/deviceLocation';
|
||||||
|
import {renderDict} from "#/utils/render";
|
||||||
|
|
||||||
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
|
onOpenChange: handleOpenChange,
|
||||||
|
onClosed() {
|
||||||
|
deviceLocationDetail.value = null;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const deviceLocationDetail = shallowRef<null | DeviceLocationVO>(null);
|
||||||
|
|
||||||
|
async function handleOpenChange(open: boolean) {
|
||||||
|
if (!open) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
modalApi.modalLoading(true);
|
||||||
|
const {id} = modalApi.getData() as { id: number | string };
|
||||||
|
const response = await deviceLocationInfo(id);
|
||||||
|
deviceLocationDetail.value = response;
|
||||||
|
modalApi.modalLoading(false);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BasicModal :footer="false" :fullscreen-button="false" title="查看收费" class="w-[70%]">
|
||||||
|
<Descriptions v-if="deviceLocationDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
|
||||||
|
<DescriptionsItem label="位置编码">
|
||||||
|
{{ deviceLocationDetail.locationCode }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="位置名称">
|
||||||
|
{{ deviceLocationDetail.locationName }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="位置类型" v-if="deviceLocationDetail.locationType!=null">
|
||||||
|
<component
|
||||||
|
:is="renderDict(deviceLocationDetail.locationType,'pro_location_type')"
|
||||||
|
/>
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="位置对象">
|
||||||
|
{{ deviceLocationDetail.locationObjName }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="备注">
|
||||||
|
{{ deviceLocationDetail.remark }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
</Descriptions>
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
@@ -1,23 +1,71 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { $t } from '@vben/locales';
|
import { $t } from '@vben/locales';
|
||||||
import { cloneDeep } from '@vben/utils';
|
import {cloneDeep, handleNode} from '@vben/utils';
|
||||||
|
|
||||||
import {useVbenForm} from '#/adapter/form';
|
import {useVbenForm} from '#/adapter/form';
|
||||||
import { deviceLocationAdd, deviceLocationInfo, deviceLocationUpdate } from '#/api/property/deviceLocation';
|
import { deviceLocationAdd, deviceLocationInfo, deviceLocationUpdate } from '#/api/property/equipmentManagement/deviceLocation';
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
// import { modalSchema } from './data';
|
||||||
import { modalSchema } from './data';
|
import {communityTree} from "#/api/property/community";
|
||||||
|
import {getDictOptions} from "#/utils/dict";
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
|
|
||||||
const title = computed(() => {
|
const title = computed(() => {
|
||||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const modalSchema = [
|
||||||
|
{
|
||||||
|
label: '主键',
|
||||||
|
fieldName: 'id',
|
||||||
|
component: 'Input',
|
||||||
|
dependencies: {
|
||||||
|
show: () => false,
|
||||||
|
triggerFields: [''],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '位置名称',
|
||||||
|
fieldName: 'locationName',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '位置类型',
|
||||||
|
fieldName: 'locationType',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: getDictOptions('pro_location_type'),
|
||||||
|
onChange: async (value: string) => {
|
||||||
|
if(value) {
|
||||||
|
await setupCommunitySelect(value)
|
||||||
|
await formApi.setFieldValue('locationObjId', null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'TreeSelect',
|
||||||
|
fieldName: 'locationObjId',
|
||||||
|
defaultValue: undefined,
|
||||||
|
label: '位置对象',
|
||||||
|
dependencies: {
|
||||||
|
show: (formValue) =>formValue.locationType!==undefined ,
|
||||||
|
triggerFields: ['locationType'],
|
||||||
|
},
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '备注',
|
||||||
|
fieldName: 'remark',
|
||||||
|
component: 'Textarea',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
const [BasicForm, formApi] = useVbenForm({
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
// 默认占满两列
|
// 默认占满两列
|
||||||
@@ -29,7 +77,7 @@ const [BasicForm, formApi] = useVbenForm({
|
|||||||
class: 'w-full',
|
class: 'w-full',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
schema: modalSchema(),
|
schema: modalSchema,
|
||||||
showDefaultActions: false,
|
showDefaultActions: false,
|
||||||
wrapperClass: 'grid-cols-2',
|
wrapperClass: 'grid-cols-2',
|
||||||
});
|
});
|
||||||
@@ -53,16 +101,14 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
|
|
||||||
const { id } = modalApi.getData() as { id?: number | string };
|
const { id } = modalApi.getData() as { id?: number | string };
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await deviceLocationInfo(id);
|
const record = await deviceLocationInfo(id);
|
||||||
|
record.locationType = record.locationType?.toString();
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
|
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -74,7 +120,6 @@ async function handleConfirm() {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
|
||||||
const data = cloneDeep(await formApi.getValues());
|
const data = cloneDeep(await formApi.getValues());
|
||||||
await (isUpdate.value ? deviceLocationUpdate(data) : deviceLocationAdd(data));
|
await (isUpdate.value ? deviceLocationUpdate(data) : deviceLocationAdd(data));
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
@@ -91,6 +136,39 @@ async function handleClosed() {
|
|||||||
await formApi.resetForm();
|
await formApi.resetForm();
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function setupCommunitySelect(value:any) {
|
||||||
|
const areaList = await communityTree(Number(value)+1);
|
||||||
|
const splitStr = '/';
|
||||||
|
handleNode(areaList, 'label', splitStr, function (node: any) {
|
||||||
|
if (node.level != Number(value)+1) {
|
||||||
|
node.disabled = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
formApi.updateSchema([
|
||||||
|
{
|
||||||
|
componentProps: () => ({
|
||||||
|
class: 'w-full',
|
||||||
|
fieldNames: {
|
||||||
|
key: 'id',
|
||||||
|
label: 'label',
|
||||||
|
value: 'code',
|
||||||
|
children: 'children',
|
||||||
|
},
|
||||||
|
placeholder: '请选择',
|
||||||
|
showSearch: true,
|
||||||
|
treeData: areaList,
|
||||||
|
treeDefaultExpandAll: true,
|
||||||
|
treeLine: { showLeafIcon: false },
|
||||||
|
// 筛选的字段
|
||||||
|
treeNodeFilterProp: 'label',
|
||||||
|
// 选中后显示在输入框的值
|
||||||
|
treeNodeLabelProp: 'fullName',
|
||||||
|
}),
|
||||||
|
fieldName: 'locationObjId',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@@ -1,29 +1,19 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Recordable } from '@vben/types';
|
|
||||||
|
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
import { getVxePopupContainer } from '@vben/utils';
|
import { getVxePopupContainer } from '@vben/utils';
|
||||||
|
|
||||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
import dayjs from 'dayjs';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useVbenVxeGrid,
|
useVbenVxeGrid,
|
||||||
vxeCheckboxChecked,
|
vxeCheckboxChecked,
|
||||||
type VxeGridProps
|
type VxeGridProps
|
||||||
} from '#/adapter/vxe-table';
|
} from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
deviceLocationExport,
|
|
||||||
deviceLocationList,
|
deviceLocationList,
|
||||||
deviceLocationRemove,
|
deviceLocationRemove,
|
||||||
} from '#/api/property/deviceLocation';
|
} from '#/api/property/equipmentManagement/deviceLocation';
|
||||||
import type { DeviceLocationForm } from '#/api/property/deviceLocation/model';
|
import type { DeviceLocationForm } from '#/api/property/equipmentManagement/deviceLocation/model';
|
||||||
import { commonDownloadExcel } from '#/utils/file/download';
|
|
||||||
|
|
||||||
import deviceLocationModal from './deviceLocation-modal.vue';
|
import deviceLocationModal from './deviceLocation-modal.vue';
|
||||||
|
import deviceLocationDetail from './deviceLocation-detail.vue';
|
||||||
import { columns, querySchema } from './data';
|
import { columns, querySchema } from './data';
|
||||||
|
|
||||||
const formOptions: VbenFormProps = {
|
const formOptions: VbenFormProps = {
|
||||||
@@ -35,15 +25,6 @@ const formOptions: VbenFormProps = {
|
|||||||
},
|
},
|
||||||
schema: querySchema(),
|
schema: querySchema(),
|
||||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
|
||||||
// 不需要直接删除
|
|
||||||
// fieldMappingTime: [
|
|
||||||
// [
|
|
||||||
// 'createTime',
|
|
||||||
// ['params[beginTime]', 'params[endTime]'],
|
|
||||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
|
||||||
// ],
|
|
||||||
// ],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const gridOptions: VxeGridProps = {
|
const gridOptions: VxeGridProps = {
|
||||||
@@ -55,8 +36,6 @@ const gridOptions: VxeGridProps = {
|
|||||||
// 点击行选中
|
// 点击行选中
|
||||||
// trigger: 'row',
|
// trigger: 'row',
|
||||||
},
|
},
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// columns: columns(),
|
|
||||||
columns,
|
columns,
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
keepSource: true,
|
keepSource: true,
|
||||||
@@ -117,10 +96,13 @@ function handleMultiDelete() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleDownloadExcel() {
|
const [deviceLocationDetailModal, deviceLocationDetailApi] = useVbenModal({
|
||||||
commonDownloadExcel(deviceLocationExport, '设备位置数据', tableApi.formApi.form.values, {
|
connectedComponent: deviceLocationDetail,
|
||||||
fieldMappingTime: formOptions.fieldMappingTime,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
async function handleInfo(row: Required<DeviceLocationForm>) {
|
||||||
|
deviceLocationDetailApi.setData({ id: row.id });
|
||||||
|
deviceLocationDetailApi.open();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -129,12 +111,6 @@ function handleDownloadExcel() {
|
|||||||
<BasicTable table-title="设备位置列表">
|
<BasicTable table-title="设备位置列表">
|
||||||
<template #toolbar-tools>
|
<template #toolbar-tools>
|
||||||
<Space>
|
<Space>
|
||||||
<a-button
|
|
||||||
v-access:code="['property:deviceLocation:export']"
|
|
||||||
@click="handleDownloadExcel"
|
|
||||||
>
|
|
||||||
{{ $t('pages.common.export') }}
|
|
||||||
</a-button>
|
|
||||||
<a-button
|
<a-button
|
||||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||||
danger
|
danger
|
||||||
@@ -154,6 +130,11 @@ function handleDownloadExcel() {
|
|||||||
</template>
|
</template>
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
<Space>
|
<Space>
|
||||||
|
<ghost-button
|
||||||
|
@click.stop="handleInfo(row)"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.info') }}
|
||||||
|
</ghost-button>
|
||||||
<ghost-button
|
<ghost-button
|
||||||
v-access:code="['property:deviceLocation:edit']"
|
v-access:code="['property:deviceLocation:edit']"
|
||||||
@click.stop="handleEdit(row)"
|
@click.stop="handleEdit(row)"
|
||||||
@@ -178,5 +159,6 @@ function handleDownloadExcel() {
|
|||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<DeviceLocationModal @reload="tableApi.query()" />
|
<DeviceLocationModal @reload="tableApi.query()" />
|
||||||
|
<deviceLocationDetailModal/>
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -0,0 +1,217 @@
|
|||||||
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||||||
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
|
import {getDictOptions} from "#/utils/dict";
|
||||||
|
import {renderDict} from "#/utils/render";
|
||||||
|
|
||||||
|
|
||||||
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'machineName',
|
||||||
|
label: '设备名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'machineCode',
|
||||||
|
label: '设备编码',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Select',
|
||||||
|
componentProps:{
|
||||||
|
options:getDictOptions('wy_sbsyzt')
|
||||||
|
},
|
||||||
|
fieldName: 'state',
|
||||||
|
label: '使用状态',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const columns: VxeGridProps['columns'] = [
|
||||||
|
{ type: 'checkbox', width: 60 },
|
||||||
|
{
|
||||||
|
title: '设备名称',
|
||||||
|
field: 'machineName',
|
||||||
|
minWidth:180
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '设备编码',
|
||||||
|
field: 'machineCode',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '设备品牌',
|
||||||
|
field: 'machineBrand',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '设备类型',
|
||||||
|
field: 'machineTypeId',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '位置详情',
|
||||||
|
field: 'locationId',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '采购价格',
|
||||||
|
field: 'purchasePrice',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '启用时间',
|
||||||
|
field: 'activationTime',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '保修截至时间',
|
||||||
|
field: 'deadline',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '使用年限',
|
||||||
|
field: 'serviceLife',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '保修周期',
|
||||||
|
field: 'maintenanceCycle',
|
||||||
|
width:100,
|
||||||
|
slots:{
|
||||||
|
default: ({row})=>{
|
||||||
|
return renderDict(row.maintenanceCycle,'wy_sbbxzq')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '使用状态',
|
||||||
|
field: 'state',
|
||||||
|
width:100,
|
||||||
|
slots:{
|
||||||
|
default: ({row})=>{
|
||||||
|
return renderDict(row.state,'wy_sbsyzt')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '责任人',
|
||||||
|
field: 'personId',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'action',
|
||||||
|
fixed: 'right',
|
||||||
|
slots: { default: 'action' },
|
||||||
|
title: '操作',
|
||||||
|
width: 180,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const modalSchema: FormSchemaGetter = () => [
|
||||||
|
{
|
||||||
|
label: '主键',
|
||||||
|
fieldName: 'id',
|
||||||
|
component: 'Input',
|
||||||
|
dependencies: {
|
||||||
|
show: () => false,
|
||||||
|
triggerFields: [''],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '设备名称',
|
||||||
|
fieldName: 'machineName',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '设备编码',
|
||||||
|
fieldName: 'machineCode',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '设备品牌',
|
||||||
|
fieldName: 'machineBrand',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '设备类型',
|
||||||
|
fieldName: 'machineTypeId',
|
||||||
|
component: 'TreeSelect',
|
||||||
|
rules: 'selectRequired',
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '位置详情',
|
||||||
|
fieldName: 'locationId',
|
||||||
|
component: 'ApiSelect',
|
||||||
|
rules: 'selectRequired',
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '采购价格',
|
||||||
|
fieldName: 'purchasePrice',
|
||||||
|
component: 'InputNumber',
|
||||||
|
componentProps:{
|
||||||
|
min:0,
|
||||||
|
precision:2
|
||||||
|
},
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '启用时间',
|
||||||
|
fieldName: 'activationTime',
|
||||||
|
component: 'DatePicker',
|
||||||
|
componentProps: {
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
valueFormat: 'YYYY-MM-DD',
|
||||||
|
},
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '保修截至时间',
|
||||||
|
fieldName: 'deadline',
|
||||||
|
component: 'DatePicker',
|
||||||
|
componentProps: {
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
valueFormat: 'YYYY-MM-DD',
|
||||||
|
},
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '使用年限',
|
||||||
|
fieldName: 'serviceLife',
|
||||||
|
component: 'InputNumber',
|
||||||
|
componentProps:{
|
||||||
|
min:1,
|
||||||
|
precision:0
|
||||||
|
},
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '保修周期',
|
||||||
|
fieldName: 'maintenanceCycle',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options:getDictOptions('wy_sbbxzq')
|
||||||
|
},
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '使用状态',
|
||||||
|
fieldName: 'state',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps:{
|
||||||
|
options:getDictOptions('wy_sbsyzt')
|
||||||
|
},
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '责任人',
|
||||||
|
fieldName: 'personId',
|
||||||
|
component: 'ApiSelect',
|
||||||
|
rules: 'selectRequired',
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
},
|
||||||
|
];
|
@@ -0,0 +1,204 @@
|
|||||||
|
<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 {
|
||||||
|
machineExport,
|
||||||
|
machineList,
|
||||||
|
machineRemove,
|
||||||
|
} from '#/api/property/equipmentManagement/machine';
|
||||||
|
import type {MachineForm} from '#/api/property/equipmentManagement/machine/model';
|
||||||
|
import {commonDownloadExcel} from '#/utils/file/download';
|
||||||
|
|
||||||
|
import machineModal from './machine-modal.vue';
|
||||||
|
import {columns, querySchema} from './data';
|
||||||
|
import MachineTypeTree from '../components/machine-type-tree.vue'
|
||||||
|
import machineDetail from './machine-detail.vue'
|
||||||
|
import {ref} from "vue";
|
||||||
|
|
||||||
|
const selectTypeId = ref('')
|
||||||
|
|
||||||
|
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',
|
||||||
|
handleReset: async () => {
|
||||||
|
selectTypeId.value = '';
|
||||||
|
const { formApi, reload } = tableApi;
|
||||||
|
await formApi.resetForm();
|
||||||
|
const formValues = formApi.form.values;
|
||||||
|
formApi.setLatestSubmissionValues(formValues);
|
||||||
|
await reload(formValues);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const gridOptions: VxeGridProps = {
|
||||||
|
checkboxConfig: {
|
||||||
|
// 高亮
|
||||||
|
highlight: true,
|
||||||
|
// 翻页时保留选中状态
|
||||||
|
reserve: true,
|
||||||
|
// 点击行选中
|
||||||
|
// trigger: 'row',
|
||||||
|
},
|
||||||
|
columns,
|
||||||
|
height: 'auto',
|
||||||
|
keepSource: true,
|
||||||
|
pagerConfig: {},
|
||||||
|
proxyConfig: {
|
||||||
|
ajax: {
|
||||||
|
query: async ({page}, formValues = {}) => {
|
||||||
|
formValues.machineTypeId = selectTypeId.value
|
||||||
|
return await machineList({
|
||||||
|
pageNum: page.currentPage,
|
||||||
|
pageSize: page.pageSize,
|
||||||
|
...formValues,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rowConfig: {
|
||||||
|
keyField: 'id',
|
||||||
|
},
|
||||||
|
// 表格全局唯一表示 保存列配置需要用到
|
||||||
|
id: 'property-machine-index'
|
||||||
|
};
|
||||||
|
|
||||||
|
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||||
|
formOptions,
|
||||||
|
gridOptions,
|
||||||
|
});
|
||||||
|
|
||||||
|
const [MachineModal, modalApi] = useVbenModal({
|
||||||
|
connectedComponent: machineModal,
|
||||||
|
});
|
||||||
|
|
||||||
|
const [MachineDetail, detailApi] = useVbenModal({
|
||||||
|
connectedComponent: machineDetail,
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleAdd() {
|
||||||
|
modalApi.setData({});
|
||||||
|
modalApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleEdit(row: Required<MachineForm>) {
|
||||||
|
modalApi.setData({id: row.id});
|
||||||
|
modalApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleInfo(row: Required<MachineForm>) {
|
||||||
|
detailApi.setData({id: row.id});
|
||||||
|
detailApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleDelete(row: Required<MachineForm>) {
|
||||||
|
await machineRemove(row.id);
|
||||||
|
await tableApi.query();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleMultiDelete() {
|
||||||
|
const rows = tableApi.grid.getCheckboxRecords();
|
||||||
|
const ids = rows.map((row: Required<MachineForm>) => row.id);
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
okType: 'danger',
|
||||||
|
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||||
|
onOk: async () => {
|
||||||
|
await machineRemove(ids);
|
||||||
|
await tableApi.query();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDownloadExcel() {
|
||||||
|
commonDownloadExcel(machineExport, '设备列表数据', tableApi.formApi.form.values, {
|
||||||
|
fieldMappingTime: formOptions.fieldMappingTime,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Page :auto-content-height="true">
|
||||||
|
<div class="flex h-full gap-[8px]">
|
||||||
|
<MachineTypeTree
|
||||||
|
v-model:select-dept-id="selectTypeId"
|
||||||
|
class="w-[260px]"
|
||||||
|
@reload="() => tableApi.reload()"
|
||||||
|
@select="() => tableApi.reload()"
|
||||||
|
/>
|
||||||
|
<BasicTable class="flex-1 overflow-hidden" table-title="设备列表列表">
|
||||||
|
<template #toolbar-tools>
|
||||||
|
<Space>
|
||||||
|
<a-button
|
||||||
|
v-access:code="['property:machine:export']"
|
||||||
|
@click="handleDownloadExcel"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.export') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||||
|
danger
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['property:machine:remove']"
|
||||||
|
@click="handleMultiDelete">
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['property:machine:add']"
|
||||||
|
@click="handleAdd"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.add') }}
|
||||||
|
</a-button>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
<template #action="{ row }">
|
||||||
|
<Space>
|
||||||
|
<ghost-button
|
||||||
|
v-access:code="['property:machine:info']"
|
||||||
|
@click.stop="handleInfo(row)"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.info') }}
|
||||||
|
</ghost-button>
|
||||||
|
<ghost-button
|
||||||
|
v-access:code="['property:machine: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:machine:remove']"
|
||||||
|
@click.stop=""
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</ghost-button>
|
||||||
|
</Popconfirm>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
</div>
|
||||||
|
<MachineModal @reload="tableApi.query()"/>
|
||||||
|
<MachineDetail/>
|
||||||
|
</Page>
|
||||||
|
</template>
|
@@ -0,0 +1,83 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import {shallowRef} from 'vue';
|
||||||
|
import {useVbenModal} from '@vben/common-ui';
|
||||||
|
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import duration from 'dayjs/plugin/duration';
|
||||||
|
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||||
|
import {renderDict} from "#/utils/render";
|
||||||
|
dayjs.extend(duration);
|
||||||
|
dayjs.extend(relativeTime);
|
||||||
|
import {CheckboxGroup} from 'ant-design-vue'
|
||||||
|
import {getDictOptions} from "#/utils/dict";
|
||||||
|
import {machineInfo} from "#/api/property/equipmentManagement/machine";
|
||||||
|
import type {MachineVO} from "#/api/property/equipmentManagement/machine/model";
|
||||||
|
|
||||||
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
|
onOpenChange: handleOpenChange,
|
||||||
|
onClosed() {
|
||||||
|
machineDetail.value = null;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const machineDetail = shallowRef<null | MachineVO>(null);
|
||||||
|
|
||||||
|
async function handleOpenChange(open: boolean) {
|
||||||
|
if (!open) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
modalApi.modalLoading(true);
|
||||||
|
const {id} = modalApi.getData() as { id: number | string };
|
||||||
|
machineDetail.value = await machineInfo(id);
|
||||||
|
modalApi.modalLoading(false);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BasicModal :footer="false" :fullscreen-button="false" title="设备详情" class="w-[70%]">
|
||||||
|
<Descriptions v-if="machineDetail" size="small" :column="2" bordered
|
||||||
|
:labelStyle="{width:'120px'}">
|
||||||
|
<DescriptionsItem label="设备名称">
|
||||||
|
{{ machineDetail.machineName }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="设备编码">
|
||||||
|
{{ machineDetail.machineCode }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="设备品牌">
|
||||||
|
{{ machineDetail.machineBrand }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="设备类型">
|
||||||
|
{{ machineDetail.machineTypeId }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="位置详情">
|
||||||
|
{{ machineDetail.locationId }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="采购价格">
|
||||||
|
{{ machineDetail.purchasePrice }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="启用时间">
|
||||||
|
{{ machineDetail.activationTime }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="保修截至时间">
|
||||||
|
{{ machineDetail.deadline }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="使用年限(年)">
|
||||||
|
{{ machineDetail.serviceLife }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
|
||||||
|
<DescriptionsItem label="保修周期" v-if="machineDetail.maintenanceCycle!=null">
|
||||||
|
<component
|
||||||
|
:is="renderDict(machineDetail.maintenanceCycle,'wy_sbbxzq')"
|
||||||
|
/>
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="使用状态" v-if="machineDetail.state!=null">
|
||||||
|
<component
|
||||||
|
:is="renderDict(machineDetail.state,'wy_sbsyzt')"
|
||||||
|
/>
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="责任人" >
|
||||||
|
{{ machineDetail.personId }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
</Descriptions>
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
@@ -0,0 +1,186 @@
|
|||||||
|
<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 {machineAdd, machineInfo, machineUpdate} from '#/api/property/equipmentManagement/machine';
|
||||||
|
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||||
|
|
||||||
|
import {modalSchema} from './data';
|
||||||
|
import {personList} from "#/api/property/resident/person";
|
||||||
|
import {renderDictValue} from "#/utils/render";
|
||||||
|
import {getMachineTypeTree} from "#/api/property/machineType";
|
||||||
|
import {deviceLocationList} from "#/api/property/equipmentManagement/deviceLocation";
|
||||||
|
|
||||||
|
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: 110,
|
||||||
|
// 通用配置项 会影响到所有表单项
|
||||||
|
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()
|
||||||
|
await setupTypeSelect()
|
||||||
|
await queryLocationData()
|
||||||
|
const {id} = modalApi.getData() as { id?: number | string };
|
||||||
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
|
if (isUpdate.value && id) {
|
||||||
|
const record = await machineInfo(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 ? machineUpdate(data) : machineAdd(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 + '-' + user.unitName,
|
||||||
|
value: user.id,
|
||||||
|
}));
|
||||||
|
formApi.updateSchema([{
|
||||||
|
componentProps: () => ({
|
||||||
|
options: options,
|
||||||
|
showSearch: true,
|
||||||
|
optionFilterProp: 'label',
|
||||||
|
optionLabelProp: 'label',
|
||||||
|
}),
|
||||||
|
fieldName: 'personId',
|
||||||
|
}])
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*初始化设别类型数据
|
||||||
|
*/
|
||||||
|
async function setupTypeSelect() {
|
||||||
|
const typeList = await getMachineTypeTree();
|
||||||
|
formApi.updateSchema([
|
||||||
|
{
|
||||||
|
componentProps: () => ({
|
||||||
|
class: 'w-full',
|
||||||
|
fieldNames: {
|
||||||
|
key: 'id',
|
||||||
|
label: 'machineTypeName',
|
||||||
|
value: 'id',
|
||||||
|
children: 'children',
|
||||||
|
},
|
||||||
|
placeholder: '请选择',
|
||||||
|
showSearch: true,
|
||||||
|
treeData: typeList,
|
||||||
|
treeDefaultExpandAll: true,
|
||||||
|
treeLine: {showLeafIcon: false},
|
||||||
|
// 筛选的字段
|
||||||
|
treeNodeFilterProp: 'label',
|
||||||
|
// 选中后显示在输入框的值
|
||||||
|
treeNodeLabelProp: 'machineTypeName',
|
||||||
|
}),
|
||||||
|
fieldName: 'machineTypeId',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询设备位置数据
|
||||||
|
*/
|
||||||
|
async function queryLocationData() {
|
||||||
|
let params = {
|
||||||
|
pageSize: 1000,
|
||||||
|
pageNum: 1,
|
||||||
|
}
|
||||||
|
const res = await deviceLocationList(params);
|
||||||
|
const options = res.rows.map((item) => ({
|
||||||
|
label: item.locationName + '-' + renderDictValue(item.locationType, 'pro_location_type'),
|
||||||
|
value: item.id,
|
||||||
|
}));
|
||||||
|
formApi.updateSchema([{
|
||||||
|
componentProps: () => ({
|
||||||
|
options: options,
|
||||||
|
showSearch: true,
|
||||||
|
optionFilterProp: 'label',
|
||||||
|
optionLabelProp: 'label',
|
||||||
|
}),
|
||||||
|
fieldName: 'locationId',
|
||||||
|
}])
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BasicModal :title="title">
|
||||||
|
<BasicForm/>
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
||||||
|
|
@@ -0,0 +1,209 @@
|
|||||||
|
import type {FormSchemaGetter} from '#/adapter/form';
|
||||||
|
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||||
|
import {getDictOptions} from "#/utils/dict";
|
||||||
|
import {renderDict} from "#/utils/render";
|
||||||
|
|
||||||
|
|
||||||
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'planName',
|
||||||
|
label: '计划名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Select',
|
||||||
|
fieldName: 'state',
|
||||||
|
label: '状态',
|
||||||
|
componentProps: {
|
||||||
|
options: getDictOptions('wy_state')
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const columns: VxeGridProps['columns'] = [
|
||||||
|
{type: 'checkbox', width: 60},
|
||||||
|
{
|
||||||
|
title: '主键',
|
||||||
|
field: 'id',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '计划名称',
|
||||||
|
field: 'planName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '计划编号',
|
||||||
|
field: 'planNo',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '设备类型',
|
||||||
|
field: 'machineTypeId',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '保养周期',
|
||||||
|
field: 'planPeriod',
|
||||||
|
slots: {
|
||||||
|
default: ({row}) => {
|
||||||
|
return renderDict(row.planPeriod,'wy_sbbyzq')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: '保养天',
|
||||||
|
// field: 'maintainDay',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '保养月',
|
||||||
|
// field: 'maintainMonth',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '固定天',
|
||||||
|
// field: 'maintainEveryday',
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: '开始时间',
|
||||||
|
field: 'startDate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '结束时间',
|
||||||
|
field: 'endDate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '状态',
|
||||||
|
field: 'state',
|
||||||
|
slots:{
|
||||||
|
default:'state'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'action',
|
||||||
|
fixed: 'right',
|
||||||
|
slots: {default: 'action'},
|
||||||
|
title: '操作',
|
||||||
|
width: 180,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const modalSchema: FormSchemaGetter = () => [
|
||||||
|
{
|
||||||
|
label: '主键',
|
||||||
|
fieldName: 'id',
|
||||||
|
component: 'Input',
|
||||||
|
dependencies: {
|
||||||
|
show: () => false,
|
||||||
|
triggerFields: [''],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '计划名称',
|
||||||
|
fieldName: 'planName',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '计划编号',
|
||||||
|
fieldName: 'planNo',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '保养周期',
|
||||||
|
fieldName: 'planPeriod',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: getDictOptions('wy_sbbyzq')
|
||||||
|
},
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '设备类型',
|
||||||
|
fieldName: 'machineTypeId',
|
||||||
|
component: 'TreeSelect',
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '月',
|
||||||
|
fieldName: 'maintainMonth',
|
||||||
|
component: 'CheckboxGroup',
|
||||||
|
dependencies: {
|
||||||
|
show: (formValue) => formValue.planPeriod=='1',
|
||||||
|
triggerFields: ['planPeriod'],
|
||||||
|
},
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
componentProps: {
|
||||||
|
options: Array.from({ length: 12 }, (_, i) => ({
|
||||||
|
label: `${i + 1}月`,
|
||||||
|
value: (i + 1).toString(),
|
||||||
|
})),
|
||||||
|
},
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '日',
|
||||||
|
fieldName: 'maintainDay',
|
||||||
|
component: 'CheckboxGroup',
|
||||||
|
dependencies: {
|
||||||
|
show: (formValue) => formValue.planPeriod=='1',
|
||||||
|
triggerFields: ['planPeriod'],
|
||||||
|
},
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
componentProps: {
|
||||||
|
options: Array.from({ length: 31 }, (_, i) => ({
|
||||||
|
label: `${i + 1}日`,
|
||||||
|
value: (i + 1).toString(),
|
||||||
|
})),
|
||||||
|
},
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '固定天数',
|
||||||
|
fieldName: 'maintainEveryday',
|
||||||
|
component: 'InputNumber',
|
||||||
|
dependencies: {
|
||||||
|
show: (formValue) => formValue.planPeriod=='2',
|
||||||
|
triggerFields: ['planPeriod'],
|
||||||
|
},
|
||||||
|
rules:'required',
|
||||||
|
componentProps:{
|
||||||
|
min:0,
|
||||||
|
precision:2,
|
||||||
|
placeholder:'请填写多少天后保养一次',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '计划日期',
|
||||||
|
fieldName: 'planDate',
|
||||||
|
component: 'RangePicker',
|
||||||
|
componentProps: {
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
valueFormat: 'YYYY-MM-DD',
|
||||||
|
},
|
||||||
|
rules:'required'
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// label: '开始时间',
|
||||||
|
// fieldName: 'startDate',
|
||||||
|
// component: 'DatePicker',
|
||||||
|
// componentProps: {
|
||||||
|
// showTime: true,
|
||||||
|
// format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
// },
|
||||||
|
// rules:'required'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '结束时间',
|
||||||
|
// fieldName: 'endDate',
|
||||||
|
// component: 'DatePicker',
|
||||||
|
// componentProps: {
|
||||||
|
// showTime: true,
|
||||||
|
// format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
// },
|
||||||
|
// rules:'required'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '状态(0启用,1停用)',
|
||||||
|
// fieldName: 'state',
|
||||||
|
// component: 'Input',
|
||||||
|
// },
|
||||||
|
];
|
@@ -0,0 +1,197 @@
|
|||||||
|
<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 {
|
||||||
|
maintainPlanExport,
|
||||||
|
maintainPlanList,
|
||||||
|
maintainPlanRemove, maintainPlanUpdate,
|
||||||
|
} from '#/api/property/equipmentManagement/maintainPlan';
|
||||||
|
import type { MaintainPlanForm } from '#/api/property/equipmentManagement/maintainPlan/model';
|
||||||
|
import { commonDownloadExcel } from '#/utils/file/download';
|
||||||
|
|
||||||
|
import maintainPlanModal from './maintainPlan-modal.vue';
|
||||||
|
import { columns, querySchema } from './data';
|
||||||
|
import planDetail from './plan-detail.vue'
|
||||||
|
import {TableSwitch} from "#/components/table";
|
||||||
|
import {useAccess} from "@vben/access";
|
||||||
|
|
||||||
|
const { hasAccessByCodes } = useAccess();
|
||||||
|
|
||||||
|
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 maintainPlanList({
|
||||||
|
pageNum: page.currentPage,
|
||||||
|
pageSize: page.pageSize,
|
||||||
|
...formValues,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rowConfig: {
|
||||||
|
keyField: 'id',
|
||||||
|
},
|
||||||
|
// 表格全局唯一表示 保存列配置需要用到
|
||||||
|
id: 'property-maintainPlan-index'
|
||||||
|
};
|
||||||
|
|
||||||
|
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||||
|
formOptions,
|
||||||
|
gridOptions,
|
||||||
|
});
|
||||||
|
|
||||||
|
const [MaintainPlanModal, modalApi] = useVbenModal({
|
||||||
|
connectedComponent: maintainPlanModal,
|
||||||
|
});
|
||||||
|
|
||||||
|
const [PlanDetail, detailApi] = useVbenModal({
|
||||||
|
connectedComponent: planDetail,
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleAdd() {
|
||||||
|
modalApi.setData({});
|
||||||
|
modalApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleEdit(row: Required<MaintainPlanForm>) {
|
||||||
|
modalApi.setData({ id: row.id });
|
||||||
|
modalApi.open();
|
||||||
|
}
|
||||||
|
async function handleInfo(row: Required<MaintainPlanForm>) {
|
||||||
|
detailApi.setData({ id: row.id });
|
||||||
|
detailApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleDelete(row: Required<MaintainPlanForm>) {
|
||||||
|
await maintainPlanRemove(row.id);
|
||||||
|
await tableApi.query();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleMultiDelete() {
|
||||||
|
const rows = tableApi.grid.getCheckboxRecords();
|
||||||
|
const ids = rows.map((row: Required<MaintainPlanForm>) => row.id);
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
okType: 'danger',
|
||||||
|
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||||
|
onOk: async () => {
|
||||||
|
await maintainPlanRemove(ids);
|
||||||
|
await tableApi.query();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDownloadExcel() {
|
||||||
|
commonDownloadExcel(maintainPlanExport, '保养计划数据', 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:maintainPlan:export']"
|
||||||
|
@click="handleDownloadExcel"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.export') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||||
|
danger
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['property:maintainPlan:remove']"
|
||||||
|
@click="handleMultiDelete">
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['property:maintainPlan:add']"
|
||||||
|
@click="handleAdd"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.add') }}
|
||||||
|
</a-button>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
<template #action="{ row }">
|
||||||
|
<Space>
|
||||||
|
<ghost-button
|
||||||
|
v-access:code="['property:maintainPlan:info']"
|
||||||
|
@click.stop="handleInfo(row)"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.info') }}
|
||||||
|
</ghost-button>
|
||||||
|
<ghost-button
|
||||||
|
v-access:code="['property:maintainPlan: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:maintainPlan:remove']"
|
||||||
|
@click.stop=""
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</ghost-button>
|
||||||
|
</Popconfirm>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
<template #state="{row}">
|
||||||
|
<TableSwitch
|
||||||
|
:checkedValue="1"
|
||||||
|
:unCheckedValue="0"
|
||||||
|
v-model:value="row.state"
|
||||||
|
:api="() => maintainPlanUpdate(row)"
|
||||||
|
:disabled="!hasAccessByCodes(['property:depot:edit'])"
|
||||||
|
@reload="() => tableApi.query()"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<MaintainPlanModal @reload="tableApi.query()" />
|
||||||
|
<PlanDetail/>
|
||||||
|
</Page>
|
||||||
|
</template>
|
@@ -0,0 +1,153 @@
|
|||||||
|
<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 {
|
||||||
|
maintainPlanAdd,
|
||||||
|
maintainPlanInfo,
|
||||||
|
maintainPlanUpdate
|
||||||
|
} from '#/api/property/equipmentManagement/maintainPlan';
|
||||||
|
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||||
|
|
||||||
|
import {modalSchema} from './data';
|
||||||
|
import {getMachineTypeTree} from "#/api/property/machineType";
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
const {id} = modalApi.getData() as { id?: number | string };
|
||||||
|
isUpdate.value = !!id;
|
||||||
|
await setupTypeSelect();
|
||||||
|
if (isUpdate.value && id) {
|
||||||
|
const record = await maintainPlanInfo(id);
|
||||||
|
record.planDate = [record.startDate, record.endDate]
|
||||||
|
if (record.planPeriod == '1') {
|
||||||
|
record.maintainanceMonth = record.maintainanceMonth?.split(',')
|
||||||
|
record.maintainanceDay = record.maintainanceDay?.split(',')
|
||||||
|
}
|
||||||
|
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());
|
||||||
|
if (data.planDate && data.planDate.length) {
|
||||||
|
data.startDate = data.planDate[0]
|
||||||
|
data.endDate = data.planDate[1]
|
||||||
|
}
|
||||||
|
if (data.planPeriod == '1') {
|
||||||
|
data.maintainanceMonth = data.maintainanceMonth?.join(',')
|
||||||
|
data.maintainanceDay = data.maintainanceDay?.join(',')
|
||||||
|
data.maintainanceEveryday = undefined
|
||||||
|
} else {
|
||||||
|
data.maintainanceMonth = undefined
|
||||||
|
data.maintainanceDay = undefined
|
||||||
|
}
|
||||||
|
await (isUpdate.value ? maintainPlanUpdate(data) : maintainPlanAdd(data));
|
||||||
|
resetInitialized();
|
||||||
|
emit('reload');
|
||||||
|
modalApi.close();
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
modalApi.lock(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleClosed() {
|
||||||
|
await formApi.resetForm();
|
||||||
|
resetInitialized();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*初始化设别类型数据
|
||||||
|
*/
|
||||||
|
async function setupTypeSelect() {
|
||||||
|
const typeList = await getMachineTypeTree();
|
||||||
|
formApi.updateSchema([
|
||||||
|
{
|
||||||
|
componentProps: () => ({
|
||||||
|
class: 'w-full',
|
||||||
|
fieldNames: {
|
||||||
|
key: 'id',
|
||||||
|
label: 'machineTypeName',
|
||||||
|
value: 'id',
|
||||||
|
children: 'children',
|
||||||
|
},
|
||||||
|
placeholder: '请选择',
|
||||||
|
showSearch: true,
|
||||||
|
treeData: typeList,
|
||||||
|
treeDefaultExpandAll: true,
|
||||||
|
treeLine: {showLeafIcon: false},
|
||||||
|
// 筛选的字段
|
||||||
|
treeNodeFilterProp: 'label',
|
||||||
|
// 选中后显示在输入框的值
|
||||||
|
treeNodeLabelProp: 'machineTypeName',
|
||||||
|
}),
|
||||||
|
fieldName: 'machineTypeId',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BasicModal :title="title">
|
||||||
|
<BasicForm/>
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
||||||
|
|
@@ -0,0 +1,88 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import {shallowRef} from 'vue';
|
||||||
|
import {useVbenModal} from '@vben/common-ui';
|
||||||
|
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import duration from 'dayjs/plugin/duration';
|
||||||
|
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||||
|
import {renderDict} from "#/utils/render";
|
||||||
|
|
||||||
|
dayjs.extend(duration);
|
||||||
|
dayjs.extend(relativeTime);
|
||||||
|
import {CheckboxGroup} from 'ant-design-vue'
|
||||||
|
import {getDictOptions} from "#/utils/dict";
|
||||||
|
import {maintainPlanInfo} from "#/api/property/equipmentManagement/maintainPlan";
|
||||||
|
import type {MaintainPlanVO} from "#/api/property/equipmentManagement/maintainPlan/model";
|
||||||
|
|
||||||
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
|
onOpenChange: handleOpenChange,
|
||||||
|
onClosed() {
|
||||||
|
maintainPlanDetail.value = null;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const maintainPlanDetail = shallowRef<null | MaintainPlanVO>(null);
|
||||||
|
|
||||||
|
async function handleOpenChange(open: boolean) {
|
||||||
|
if (!open) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
modalApi.modalLoading(true);
|
||||||
|
const {id} = modalApi.getData() as { id: number | string };
|
||||||
|
maintainPlanDetail.value = await maintainPlanInfo(id);
|
||||||
|
if (maintainPlanDetail.value.planPeriod == '1') {
|
||||||
|
maintainPlanDetail.value.maintainMonth = maintainPlanDetail.value.maintainMonth?.split(',');
|
||||||
|
maintainPlanDetail.value.maintainDay = maintainPlanDetail.value.maintainDay?.split(',');
|
||||||
|
}
|
||||||
|
modalApi.modalLoading(false);
|
||||||
|
}
|
||||||
|
const dayArr=Array.from({ length: 31 }, (_, i) => ({
|
||||||
|
label: `${i + 1}日`,
|
||||||
|
value: (i + 1).toString(),
|
||||||
|
}));
|
||||||
|
const monthArr=Array.from({ length: 12 }, (_, i) => ({
|
||||||
|
label: `${i + 1}月`,
|
||||||
|
value: (i + 1).toString(),
|
||||||
|
}))
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BasicModal :footer="false" :fullscreen-button="false" title="保养计划详情" class="w-[70%]">
|
||||||
|
<Descriptions v-if="maintainPlanDetail" size="small" :column="2" bordered
|
||||||
|
:labelStyle="{width:'100px'}">
|
||||||
|
<DescriptionsItem label="计划名称">
|
||||||
|
{{ maintainPlanDetail.planName }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="计划编号">
|
||||||
|
{{ maintainPlanDetail.planNo }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="保养周期" v-if="maintainPlanDetail.planPeriod!=null">
|
||||||
|
<component
|
||||||
|
:is="renderDict(maintainPlanDetail.planPeriod,'wy_sbbyzq')"
|
||||||
|
/>
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="设备类型">
|
||||||
|
{{ maintainPlanDetail.machineTypeId }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="月" :span="2" v-if="maintainPlanDetail.planPeriod=='1'">
|
||||||
|
<CheckboxGroup v-model:value="maintainPlanDetail.maintainMonth"
|
||||||
|
:options="monthArr"/>
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="日" :span="2" v-if="maintainPlanDetail.planPeriod=='1'">
|
||||||
|
<CheckboxGroup v-model:value="maintainPlanDetail.maintainDay"
|
||||||
|
:options="dayArr"/>
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="固定天数" v-if="maintainPlanDetail.planPeriod=='2'">
|
||||||
|
{{maintainPlanDetail.maintainEveryday}}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="计划日期" :span="2">
|
||||||
|
{{ maintainPlanDetail.startDate + '\xa0至\xa0' + maintainPlanDetail.endDate }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="状态" v-if="maintainPlanDetail.state!=null">
|
||||||
|
<component
|
||||||
|
:is="renderDict(maintainPlanDetail.state,'wy_state')"
|
||||||
|
/>
|
||||||
|
</DescriptionsItem>
|
||||||
|
</Descriptions>
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
@@ -15,10 +15,10 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
options:getDictOptions('wy_xjqdfs')
|
options:getDictOptions('wy_xjzt')
|
||||||
},
|
},
|
||||||
fieldName: 'taskType',
|
fieldName: 'status',
|
||||||
label: '巡检方式',
|
label: '巡检状态',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
width:100,
|
width:100,
|
||||||
slots: {
|
slots: {
|
||||||
default: ({ row }) => {
|
default: ({ row }) => {
|
||||||
return renderDict(row.taskType, 'wy_xjqdfs');
|
return renderDict(row.taskType, 'wy_xjzt');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@@ -3,7 +3,7 @@ import { computed, ref } from 'vue';
|
|||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { $t } from '@vben/locales';
|
import { $t } from '@vben/locales';
|
||||||
import {cloneDeep, getPopupContainer, handleNode} from '@vben/utils';
|
import {cloneDeep, handleNode} from '@vben/utils';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { resident_unitAdd, resident_unitInfo, resident_unitUpdate } from '#/api/property/resident/unit';
|
import { resident_unitAdd, resident_unitInfo, resident_unitUpdate } from '#/api/property/resident/unit';
|
||||||
@@ -108,7 +108,6 @@ async function initLocationOptions() {
|
|||||||
value: 'code',
|
value: 'code',
|
||||||
children: 'children',
|
children: 'children',
|
||||||
},
|
},
|
||||||
getPopupContainer,
|
|
||||||
placeholder: '请选择入驻位置',
|
placeholder: '请选择入驻位置',
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
treeData: locationList,
|
treeData: locationList,
|
||||||
|
Reference in New Issue
Block a user