add(dms): 生成保养项目、保养标准、保养部位、保养计划、保养计划明细与保养部位关联项目,没有完善逻辑

- 新增相关页面(没有保养部位关联项目)和接口
- 实现了新增、编辑、删除、查询等功能
- 集成了字典数据和设备类型下拉框
master
zch 1 week ago
parent 0555e541b8
commit 1c39707166

@ -0,0 +1,77 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsBaseMaintProjectVO, DmsBaseMaintProjectForm, DmsBaseMaintProjectQuery } from '@/api/dms/dmsBaseMaintProject/types';
/**
*
* @param query
* @returns {*}
*/
export const listDmsBaseMaintProject = (query?: DmsBaseMaintProjectQuery): AxiosPromise<DmsBaseMaintProjectVO[]> => {
return request({
url: '/dms/dmsBaseMaintProject/list',
method: 'get',
params: query
});
};
/**
*
* @param maintProjectId
*/
export const getDmsBaseMaintProject = (maintProjectId: string | number): AxiosPromise<DmsBaseMaintProjectVO> => {
return request({
url: '/dms/dmsBaseMaintProject/' + maintProjectId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addDmsBaseMaintProject = (data: DmsBaseMaintProjectForm) => {
return request({
url: '/dms/dmsBaseMaintProject',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateDmsBaseMaintProject = (data: DmsBaseMaintProjectForm) => {
return request({
url: '/dms/dmsBaseMaintProject',
method: 'put',
data: data
});
};
/**
*
* @param maintProjectId
*/
export const delDmsBaseMaintProject = (maintProjectId: string | number | Array<string | number>) => {
return request({
url: '/dms/dmsBaseMaintProject/' + maintProjectId,
method: 'delete'
});
};
/**
*
* @param query
* @returns {*}
*/
export function getDmsBaseMaintProjectList (query) {
return request({
url: '/dms/dmsBaseMaintProject/getDmsBaseMaintProjectList',
method: 'get',
params: query
});
};

@ -0,0 +1,86 @@
export interface DmsBaseMaintProjectVO {
/**
*
*/
maintProjectId: string | number;
/**
*
*/
maintProjectName: string;
/**
*
*/
maintProjectDesc: string;
/**
*
*/
remark: string;
/**
* 1 0
*/
activeFlag: string;
}
export interface DmsBaseMaintProjectForm extends BaseEntity {
/**
*
*/
maintProjectId?: string | number;
/**
*
*/
maintProjectName?: string;
/**
*
*/
maintProjectDesc?: string;
/**
*
*/
remark?: string;
/**
* 1 0
*/
activeFlag?: string;
}
export interface DmsBaseMaintProjectQuery extends PageQuery {
/**
*
*/
maintProjectId?: string | number;
/**
*
*/
maintProjectName?: string;
/**
*
*/
maintProjectDesc?: string;
/**
* 1 0
*/
activeFlag?: string;
/**
*
*/
params?: any;
}

@ -0,0 +1,77 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsBaseMaintStandardVO, DmsBaseMaintStandardForm, DmsBaseMaintStandardQuery } from '@/api/dms/dmsBaseMaintStandard/types';
/**
*
* @param query
* @returns {*}
*/
export const listDmsBaseMaintStandard = (query?: DmsBaseMaintStandardQuery): AxiosPromise<DmsBaseMaintStandardVO[]> => {
return request({
url: '/dms/dmsBaseMaintStandard/list',
method: 'get',
params: query
});
};
/**
*
* @param maintStandardId
*/
export const getDmsBaseMaintStandard = (maintStandardId: string | number): AxiosPromise<DmsBaseMaintStandardVO> => {
return request({
url: '/dms/dmsBaseMaintStandard/' + maintStandardId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addDmsBaseMaintStandard = (data: DmsBaseMaintStandardForm) => {
return request({
url: '/dms/dmsBaseMaintStandard',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateDmsBaseMaintStandard = (data: DmsBaseMaintStandardForm) => {
return request({
url: '/dms/dmsBaseMaintStandard',
method: 'put',
data: data
});
};
/**
*
* @param maintStandardId
*/
export const delDmsBaseMaintStandard = (maintStandardId: string | number | Array<string | number>) => {
return request({
url: '/dms/dmsBaseMaintStandard/' + maintStandardId,
method: 'delete'
});
};
/**
*
* @param query
* @returns {*}
*/
export function getDmsBaseMaintStandardList (query) {
return request({
url: '/dms/dmsBaseMaintStandard/getDmsBaseMaintStandardList',
method: 'get',
params: query
});
};

@ -0,0 +1,122 @@
export interface DmsBaseMaintStandardVO {
/**
*
*/
maintStandardId: string | number;
/**
*
*/
maintStandardCode: string;
/**
* IDbase_device_typedevice_type_id
*/
deviceTypeId: string | number;
/**
*
*/
maintProtocol: string;
/**
*
*/
operationDescription: string;
/**
*
*/
remark: string;
/**
* 1 0
*/
activeFlag: string;
deviceTypeName: string;//JOIN
}
export interface DmsBaseMaintStandardForm extends BaseEntity {
/**
*
*/
maintStandardId?: string | number;
/**
*
*/
maintStandardCode?: string;
/**
* IDbase_device_typedevice_type_id
*/
deviceTypeId?: string | number;
/**
*
*/
maintProtocol?: string;
/**
*
*/
operationDescription?: string;
/**
*
*/
remark?: string;
/**
* 1 0
*/
activeFlag?: string;
deviceTypeName?: string;//JOIN
}
export interface DmsBaseMaintStandardQuery extends PageQuery {
/**
*
*/
maintStandardId?: string | number;
/**
*
*/
maintStandardCode?: string;
/**
* IDbase_device_typedevice_type_id
*/
deviceTypeId?: string | number;
/**
*
*/
maintProtocol?: string;
/**
*
*/
operationDescription?: string;
/**
* 1 0
*/
activeFlag?: string;
/**
*
*/
params?: any;
deviceTypeName?: string;//JOIN
}

@ -0,0 +1,77 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsBaseMaintStationVO, DmsBaseMaintStationForm, DmsBaseMaintStationQuery } from '@/api/dms/dmsBaseMaintStation/types';
/**
*
* @param query
* @returns {*}
*/
export const listDmsBaseMaintStation = (query?: DmsBaseMaintStationQuery): AxiosPromise<DmsBaseMaintStationVO[]> => {
return request({
url: '/dms/dmsBaseMaintStation/list',
method: 'get',
params: query
});
};
/**
*
* @param maintStationId
*/
export const getDmsBaseMaintStation = (maintStationId: string | number): AxiosPromise<DmsBaseMaintStationVO> => {
return request({
url: '/dms/dmsBaseMaintStation/' + maintStationId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addDmsBaseMaintStation = (data: DmsBaseMaintStationForm) => {
return request({
url: '/dms/dmsBaseMaintStation',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateDmsBaseMaintStation = (data: DmsBaseMaintStationForm) => {
return request({
url: '/dms/dmsBaseMaintStation',
method: 'put',
data: data
});
};
/**
*
* @param maintStationId
*/
export const delDmsBaseMaintStation = (maintStationId: string | number | Array<string | number>) => {
return request({
url: '/dms/dmsBaseMaintStation/' + maintStationId,
method: 'delete'
});
};
/**
*
* @param query
* @returns {*}
*/
export function getDmsBaseMaintStationList (query) {
return request({
url: '/dms/dmsBaseMaintStation/getDmsBaseMaintStationList',
method: 'get',
params: query
});
};

@ -0,0 +1,116 @@
export interface DmsBaseMaintStationVO {
/**
*
*/
maintStationId: string | number;
/**
* IDbase_device_typedevice_type_id
*/
deviceTypeId: string | number;
/**
* ID
*/
maintStandardId: string | number;
/**
*
*/
maintStationCode: string;
/**
*
*/
maintStationName: string;
/**
* 1 0
*/
activeFlag: string;
/**
*
*/
remark: string;
}
export interface DmsBaseMaintStationForm extends BaseEntity {
/**
*
*/
maintStationId?: string | number;
/**
* IDbase_device_typedevice_type_id
*/
deviceTypeId?: string | number;
/**
* ID
*/
maintStandardId?: string | number;
/**
*
*/
maintStationCode?: string;
/**
*
*/
maintStationName?: string;
/**
* 1 0
*/
activeFlag?: string;
/**
*
*/
remark?: string;
}
export interface DmsBaseMaintStationQuery extends PageQuery {
/**
*
*/
maintStationId?: string | number;
/**
* IDbase_device_typedevice_type_id
*/
deviceTypeId?: string | number;
/**
* ID
*/
maintStandardId?: string | number;
/**
*
*/
maintStationCode?: string;
/**
*
*/
maintStationName?: string;
/**
* 1 0
*/
activeFlag?: string;
/**
*
*/
params?: any;
}

@ -0,0 +1,77 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsBaseStationProjectVO, DmsBaseStationProjectForm, DmsBaseStationProjectQuery } from '@/api/dms/dmsBaseStationProject/types';
/**
*
* @param query
* @returns {*}
*/
export const listDmsBaseStationProject = (query?: DmsBaseStationProjectQuery): AxiosPromise<DmsBaseStationProjectVO[]> => {
return request({
url: '/dms/dmsBaseStationProject/list',
method: 'get',
params: query
});
};
/**
*
* @param maintStationId
*/
export const getDmsBaseStationProject = (maintStationId: string | number): AxiosPromise<DmsBaseStationProjectVO> => {
return request({
url: '/dms/dmsBaseStationProject/' + maintStationId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addDmsBaseStationProject = (data: DmsBaseStationProjectForm) => {
return request({
url: '/dms/dmsBaseStationProject',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateDmsBaseStationProject = (data: DmsBaseStationProjectForm) => {
return request({
url: '/dms/dmsBaseStationProject',
method: 'put',
data: data
});
};
/**
*
* @param maintStationId
*/
export const delDmsBaseStationProject = (maintStationId: string | number | Array<string | number>) => {
return request({
url: '/dms/dmsBaseStationProject/' + maintStationId,
method: 'delete'
});
};
/**
*
* @param query
* @returns {*}
*/
export function getDmsBaseStationProjectList (query) {
return request({
url: '/dms/dmsBaseStationProject/getDmsBaseStationProjectList',
method: 'get',
params: query
});
};

@ -0,0 +1,46 @@
export interface DmsBaseStationProjectVO {
/**
* ID
*/
maintStationId: string | number;
/**
* ID
*/
maintProjectId: string | number;
}
export interface DmsBaseStationProjectForm extends BaseEntity {
/**
* ID
*/
maintStationId?: string | number;
/**
* ID
*/
maintProjectId?: string | number;
}
export interface DmsBaseStationProjectQuery extends PageQuery {
/**
* ID
*/
maintStationId?: string | number;
/**
* ID
*/
maintProjectId?: string | number;
/**
*
*/
params?: any;
}

@ -0,0 +1,77 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsPlanMaintVO, DmsPlanMaintForm, DmsPlanMaintQuery } from '@/api/dms/dmsPlanMaint/types';
/**
*
* @param query
* @returns {*}
*/
export const listDmsPlanMaint = (query?: DmsPlanMaintQuery): AxiosPromise<DmsPlanMaintVO[]> => {
return request({
url: '/dms/dmsPlanMaint/list',
method: 'get',
params: query
});
};
/**
*
* @param planMaintId
*/
export const getDmsPlanMaint = (planMaintId: string | number): AxiosPromise<DmsPlanMaintVO> => {
return request({
url: '/dms/dmsPlanMaint/' + planMaintId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addDmsPlanMaint = (data: DmsPlanMaintForm) => {
return request({
url: '/dms/dmsPlanMaint',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateDmsPlanMaint = (data: DmsPlanMaintForm) => {
return request({
url: '/dms/dmsPlanMaint',
method: 'put',
data: data
});
};
/**
*
* @param planMaintId
*/
export const delDmsPlanMaint = (planMaintId: string | number | Array<string | number>) => {
return request({
url: '/dms/dmsPlanMaint/' + planMaintId,
method: 'delete'
});
};
/**
*
* @param query
* @returns {*}
*/
export function getDmsPlanMaintList (query) {
return request({
url: '/dms/dmsPlanMaint/getDmsPlanMaintList',
method: 'get',
params: query
});
};

@ -0,0 +1,206 @@
export interface DmsPlanMaintVO {
/**
*
*/
planMaintId: string | number;
/**
*
*/
planMaintCode: string;
/**
* 1 2 3
*/
maintLevel: string;
/**
*
*/
maintGroup: string;
/**
*
*/
maintSupervisor: string;
/**
*
*/
maintTime: string;
/**
* sj_jobid
*/
jobId: string | number;
/**
* ;
*/
timeLimit: number;
/**
*
*/
cyclePeriod: number;
/**
* 1 2 3
*/
maintStatus: number;
/**
* 1 2
*/
createMethod: number;
/**
*
*/
remark: string;
/**
* 1 0
*/
activeFlag: string;
}
export interface DmsPlanMaintForm extends BaseEntity {
/**
*
*/
planMaintId?: string | number;
/**
*
*/
planMaintCode?: string;
/**
* 1 2 3
*/
maintLevel?: string;
/**
*
*/
maintGroup?: string;
/**
*
*/
maintSupervisor?: string;
/**
*
*/
maintTime?: string;
/**
* sj_jobid
*/
jobId?: string | number;
/**
* ;
*/
timeLimit?: number;
/**
*
*/
cyclePeriod?: number;
/**
* 1 2 3
*/
maintStatus?: number;
/**
* 1 2
*/
createMethod?: number;
/**
*
*/
remark?: string;
/**
* 1 0
*/
activeFlag?: string;
}
export interface DmsPlanMaintQuery extends PageQuery {
/**
*
*/
planMaintId?: string | number;
/**
*
*/
planMaintCode?: string;
/**
* 1 2 3
*/
maintLevel?: string;
/**
*
*/
maintGroup?: string;
/**
*
*/
maintSupervisor?: string;
/**
*
*/
maintTime?: string;
/**
* sj_jobid
*/
jobId?: string | number;
/**
* ;
*/
timeLimit?: number;
/**
*
*/
cyclePeriod?: number;
/**
* 1 2 3
*/
maintStatus?: number;
/**
* 1 2
*/
createMethod?: number;
/**
* 1 0
*/
activeFlag?: string;
/**
*
*/
params?: any;
}

@ -0,0 +1,77 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsPlanMaintDetailVO, DmsPlanMaintDetailForm, DmsPlanMaintDetailQuery } from '@/api/dms/dmsPlanMaintDetail/types';
/**
*
* @param query
* @returns {*}
*/
export const listDmsPlanMaintDetail = (query?: DmsPlanMaintDetailQuery): AxiosPromise<DmsPlanMaintDetailVO[]> => {
return request({
url: '/dms/dmsPlanMaintDetail/list',
method: 'get',
params: query
});
};
/**
*
* @param planMaintDetailId
*/
export const getDmsPlanMaintDetail = (planMaintDetailId: string | number): AxiosPromise<DmsPlanMaintDetailVO> => {
return request({
url: '/dms/dmsPlanMaintDetail/' + planMaintDetailId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addDmsPlanMaintDetail = (data: DmsPlanMaintDetailForm) => {
return request({
url: '/dms/dmsPlanMaintDetail',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateDmsPlanMaintDetail = (data: DmsPlanMaintDetailForm) => {
return request({
url: '/dms/dmsPlanMaintDetail',
method: 'put',
data: data
});
};
/**
*
* @param planMaintDetailId
*/
export const delDmsPlanMaintDetail = (planMaintDetailId: string | number | Array<string | number>) => {
return request({
url: '/dms/dmsPlanMaintDetail/' + planMaintDetailId,
method: 'delete'
});
};
/**
*
* @param query
* @returns {*}
*/
export function getDmsPlanMaintDetailList (query) {
return request({
url: '/dms/dmsPlanMaintDetail/getDmsPlanMaintDetailList',
method: 'get',
params: query
});
};

@ -0,0 +1,182 @@
export interface DmsPlanMaintDetailVO {
/**
*
*/
planMaintDetailId: string | number;
/**
* IDdms_plan_maintplan_maint_id
*/
planMaintId: string | number;
/**
* IDprod_base_machine_infomachine_id
*/
machineId: string | number;
/**
* ,dms_base_maint_stationmaint_station_id
*/
maintStationId: string | number;
/**
* ID
*/
maintStandardId: string | number;
/**
*
*/
operationDescription: string;
/**
*
*/
remark: string;
/**
*
*
*/
maintStandardCode: string;
/**
*
*/
planMaintCode: string;
/**
*
*/
machineName: string;
/**
*
*/
maintStationName: string;
}
export interface DmsPlanMaintDetailForm extends BaseEntity {
/**
*
*/
planMaintDetailId?: string | number;
/**
* IDdms_plan_maintplan_maint_id
*/
planMaintId?: string | number;
/**
* IDprod_base_machine_infomachine_id
*/
machineId?: string | number;
/**
* ,dms_base_maint_stationmaint_station_id
*/
maintStationId?: string | number;
/**
* ID
*/
maintStandardId?: string | number;
/**
*
*/
operationDescription?: string;
/**
*
*/
remark?: string;
/**
*
*
*/
maintStandardCode?: string;
/**
*
*/
planMaintCode?: string;
/**
*
*/
machineName?: string;
/**
*
*/
maintStationName?: string;
}
export interface DmsPlanMaintDetailQuery extends PageQuery {
/**
*
*/
planMaintDetailId?: string | number;
/**
* IDdms_plan_maintplan_maint_id
*/
planMaintId?: string | number;
/**
* IDprod_base_machine_infomachine_id
*/
machineId?: string | number;
/**
* ,dms_base_maint_stationmaint_station_id
*/
maintStationId?: string | number;
/**
* ID
*/
maintStandardId?: string | number;
/**
*
*/
operationDescription?: string;
/**
*
*/
params?: any;
/**
*
*
*/
maintStandardCode?: string;
/**
*
*/
planMaintCode?: string;
/**
*
*/
machineName?: string;
/**
*
*/
maintStationName?: string;
}

@ -0,0 +1,272 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<!-- <el-form-item label="主键标识" prop="maintProjectId">
<el-input v-model="queryParams.maintProjectId" placeholder="请输入主键标识" clearable @keyup.enter="handleQuery" />
</el-form-item>-->
<el-form-item label="项目名称" prop="maintProjectName">
<el-input v-model="queryParams.maintProjectName" placeholder="请输入项目名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="项目描述" prop="maintProjectDesc">
<el-input v-model="queryParams.maintProjectDesc" placeholder="请输入项目描述" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="激活标识" prop="activeFlag">
<el-select v-model="queryParams.activeFlag" placeholder="请选择激活标识" clearable >
<el-option v-for="dict in active_flag" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['dms:dmsBaseMaintProject:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['dms:dmsBaseMaintProject:edit']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['dms:dmsBaseMaintProject:remove']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['dms:dmsBaseMaintProject:export']"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="dmsBaseMaintProjectList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="maintProjectId" v-if="columns[0].visible"/>
<el-table-column label="项目名称" align="center" prop="maintProjectName" v-if="columns[2].visible"/>
<el-table-column label="项目描述" align="center" prop="maintProjectDesc" v-if="columns[3].visible"/>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[4].visible"/>
<el-table-column label="激活标识" align="center" prop="activeFlag" v-if="columns[5].visible">
<template #default="scope">
<dict-tag :options="active_flag" :value="scope.row.activeFlag"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['dms:dmsBaseMaintProject:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['dms:dmsBaseMaintProject:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改保养项目信息对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="dmsBaseMaintProjectFormRef" :model="form" :rules="rules" label-width="80px">
<!-- <el-form-item label="主键标识" prop="maintProjectId">
<el-input v-model="form.maintProjectId" placeholder="请输入主键标识" />
</el-form-item>-->
<el-form-item label="项目名称" prop="maintProjectName">
<el-input v-model="form.maintProjectName" placeholder="请输入项目名称" />
</el-form-item>
<el-form-item label="项目描述" prop="maintProjectDesc">
<el-input v-model="form.maintProjectDesc" placeholder="请输入项目描述" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="激活标识" prop="activeFlag">
<el-radio-group v-model="form.activeFlag">
<el-radio
v-for="dict in active_flag"
:key="dict.value"
:value="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="DmsBaseMaintProject" lang="ts">
import { listDmsBaseMaintProject, getDmsBaseMaintProject, delDmsBaseMaintProject, addDmsBaseMaintProject, updateDmsBaseMaintProject } from '@/api/dms/dmsBaseMaintProject';
import { DmsBaseMaintProjectVO, DmsBaseMaintProjectQuery, DmsBaseMaintProjectForm } from '@/api/dms/dmsBaseMaintProject/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { active_flag } = toRefs<any>(proxy?.useDict('active_flag'));
const dmsBaseMaintProjectList = ref<DmsBaseMaintProjectVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const dmsBaseMaintProjectFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `主键标识`, visible: false },
{ key: 1, label: `租户编号`, visible: false },
{ key: 2, label: `项目名称`, visible: true },
{ key: 3, label: `项目描述`, visible: true },
{ key: 4, label: `备注`, visible: true },
{ key: 5, label: `激活标识`, visible: true },
{ key: 6, label: `创建部门`, visible: false },
{ key: 7, label: `创建人`, visible: false },
{ key: 8, label: `创建时间`, visible: false },
{ key: 9, label: `更新人`, visible: false },
{ key: 10, label: `更新时间`, visible: false },
]);
const initFormData: DmsBaseMaintProjectForm = {
maintProjectId: undefined,
maintProjectName: undefined,
maintProjectDesc: undefined,
remark: undefined,
activeFlag: undefined,
}
const data = reactive<PageData<DmsBaseMaintProjectForm, DmsBaseMaintProjectQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
maintProjectId: undefined,
maintProjectName: undefined,
maintProjectDesc: undefined,
activeFlag: undefined,
params: {
}
},
rules: {
maintProjectName: [
{ required: true, message: "项目名称不能为空", trigger: "blur" }
],
activeFlag: [
{ required: true, message: "激活标识不能为空", trigger: "change" }
],
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询保养项目信息列表 */
const getList = async () => {
loading.value = true;
const res = await listDmsBaseMaintProject(queryParams.value);
dmsBaseMaintProjectList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
dmsBaseMaintProjectFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: DmsBaseMaintProjectVO[]) => {
ids.value = selection.map(item => item.maintProjectId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加保养项目信息";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: DmsBaseMaintProjectVO) => {
reset();
const _maintProjectId = row?.maintProjectId || ids.value[0]
const res = await getDmsBaseMaintProject(_maintProjectId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改保养项目信息";
}
/** 提交按钮 */
const submitForm = () => {
dmsBaseMaintProjectFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.maintProjectId) {
await updateDmsBaseMaintProject(form.value).finally(() => buttonLoading.value = false);
} else {
await addDmsBaseMaintProject(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: DmsBaseMaintProjectVO) => {
const _maintProjectIds = row?.maintProjectId || ids.value;
await proxy?.$modal.confirm('是否确认删除保养项目信息编号为"' + _maintProjectIds + '"的数据项?').finally(() => loading.value = false);
await delDmsBaseMaintProject(_maintProjectIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('dms/dmsBaseMaintProject/export', {
...queryParams.value
}, `dmsBaseMaintProject_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
getList();
});
</script>

@ -0,0 +1,309 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<!-- <el-form-item label="主键标识" prop="maintStandardId">
<el-input v-model="queryParams.maintStandardId" placeholder="请输入主键标识" clearable @keyup.enter="handleQuery" />
</el-form-item>-->
<el-form-item label="标准编号" prop="maintStandardCode">
<el-input v-model="queryParams.maintStandardCode" placeholder="请输入标准编号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="设备类型" prop="deviceTypeId">
<!-- <el-input v-model="queryParams.deviceTypeId" placeholder="请输入设备类型" clearable @keyup.enter="handleQuery" />-->
</el-form-item>
<!-- <el-form-item label="保养标准" prop="maintProtocol">
<el-input v-model="queryParams.maintProtocol" placeholder="请输入保养标准" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="操作描述" prop="operationDescription">
<el-input v-model="queryParams.operationDescription" placeholder="请输入操作描述" clearable @keyup.enter="handleQuery" />
</el-form-item>-->
<el-form-item label="激活标识" prop="activeFlag">
<el-select v-model="queryParams.activeFlag" placeholder="请选择激活标识" clearable >
<el-option v-for="dict in active_flag" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['dms:dmsBaseMaintStandard:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['dms:dmsBaseMaintStandard:edit']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['dms:dmsBaseMaintStandard:remove']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['dms:dmsBaseMaintStandard:export']"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="dmsBaseMaintStandardList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="maintStandardId" v-if="columns[0].visible"/>
<el-table-column label="标准编号" align="center" prop="maintStandardCode" v-if="columns[2].visible"/>
<el-table-column label="设备类型" align="center" prop="deviceTypeName" v-if="columns[3].visible"/>
<el-table-column label="保养标准" align="center" prop="maintProtocol" v-if="columns[4].visible"/>
<el-table-column label="操作描述" align="center" prop="operationDescription" v-if="columns[5].visible"/>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[6].visible"/>
<el-table-column label="激活标识" align="center" prop="activeFlag" v-if="columns[7].visible">
<template #default="scope">
<dict-tag :options="active_flag" :value="scope.row.activeFlag"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['dms:dmsBaseMaintStandard:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['dms:dmsBaseMaintStandard:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改保养标准信息对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="dmsBaseMaintStandardFormRef" :model="form" :rules="rules" label-width="80px">
<!-- <el-form-item label="主键标识" prop="maintStandardId">
<el-input v-model="form.maintStandardId" placeholder="请输入主键标识" />
</el-form-item>-->
<el-form-item label="标准编号" prop="maintStandardCode">
<el-input v-model="form.maintStandardCode" placeholder="请输入标准编号" />
</el-form-item>
<el-form-item label="设备类型" prop="deviceTypeId">
<!-- <el-input v-model="form.deviceTypeId" placeholder="请输入设备类型" />-->
<el-select v-model="form.deviceTypeId" placeholder="请选择设备类型" clearable >
<el-option v-for="item in dviceTypeOptions"
:key="item.deviceTypeId"
:label="item.deviceTypeName"
:value="item.deviceTypeId"/>
</el-select>
</el-form-item>
<el-form-item label="保养标准" prop="maintProtocol">
<el-input v-model="form.maintProtocol" placeholder="请输入保养标准" />
</el-form-item>
<el-form-item label="操作描述" prop="operationDescription">
<el-input v-model="form.operationDescription" placeholder="请输入操作描述" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="激活标识" prop="activeFlag">
<el-radio-group v-model="form.activeFlag">
<el-radio
v-for="dict in active_flag"
:key="dict.value"
:value="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="DmsBaseMaintStandard" lang="ts">
import { listDmsBaseMaintStandard, getDmsBaseMaintStandard, delDmsBaseMaintStandard, addDmsBaseMaintStandard, updateDmsBaseMaintStandard } from '@/api/dms/dmsBaseMaintStandard';
import { DmsBaseMaintStandardVO, DmsBaseMaintStandardQuery, DmsBaseMaintStandardForm } from '@/api/dms/dmsBaseMaintStandard/types';
import {getBaseDeviceTypeListInWMS} from "@/api/dms/baseDeviceType";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { active_flag } = toRefs<any>(proxy?.useDict('active_flag'));
const dmsBaseMaintStandardList = ref<DmsBaseMaintStandardVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const dmsBaseMaintStandardFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `主键标识`, visible: false },
{ key: 1, label: `租户编号`, visible: false },
{ key: 2, label: `标准编号`, visible: true },
{ key: 3, label: `设备类型`, visible: true },
{ key: 4, label: `保养标准`, visible: true },
{ key: 5, label: `操作描述`, visible: true },
{ key: 6, label: `备注`, visible: true },
{ key: 7, label: `激活标识`, visible: true },
{ key: 8, label: `创建部门`, visible: false },
{ key: 9, label: `创建人`, visible: false },
{ key: 10, label: `创建时间`, visible: false },
{ key: 11, label: `更新人`, visible: false },
{ key: 12, label: `更新时间`, visible: false },
]);
const initFormData: DmsBaseMaintStandardForm = {
maintStandardId: undefined,
maintStandardCode: undefined,
deviceTypeId: undefined,
maintProtocol: undefined,
operationDescription: undefined,
remark: undefined,
activeFlag: '1',
deviceTypeName: undefined,
}
const data = reactive<PageData<DmsBaseMaintStandardForm, DmsBaseMaintStandardQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
maintStandardId: undefined,
maintStandardCode: undefined,
deviceTypeId: undefined,
maintProtocol: undefined,
operationDescription: undefined,
activeFlag: undefined,
deviceTypeName: undefined,
params: {
}
},
rules: {
maintStandardCode: [
{ required: true, message: "标准编号不能为空", trigger: "blur" }
],
activeFlag: [
{ required: true, message: "激活标识不能为空", trigger: "change" }
],
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询保养标准信息列表 */
const getList = async () => {
loading.value = true;
const res = await listDmsBaseMaintStandard(queryParams.value);
dmsBaseMaintStandardList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
dmsBaseMaintStandardFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: DmsBaseMaintStandardVO[]) => {
ids.value = selection.map(item => item.maintStandardId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加保养标准信息";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: DmsBaseMaintStandardVO) => {
reset();
const _maintStandardId = row?.maintStandardId || ids.value[0]
const res = await getDmsBaseMaintStandard(_maintStandardId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改保养标准信息";
}
/** 提交按钮 */
const submitForm = () => {
dmsBaseMaintStandardFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.maintStandardId) {
await updateDmsBaseMaintStandard(form.value).finally(() => buttonLoading.value = false);
} else {
await addDmsBaseMaintStandard(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: DmsBaseMaintStandardVO) => {
const _maintStandardIds = row?.maintStandardId || ids.value;
await proxy?.$modal.confirm('是否确认删除保养标准信息编号为"' + _maintStandardIds + '"的数据项?').finally(() => loading.value = false);
await delDmsBaseMaintStandard(_maintStandardIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('dms/dmsBaseMaintStandard/export', {
...queryParams.value
}, `dmsBaseMaintStandard_${new Date().getTime()}.xlsx`)
}
//
let dviceTypeOptions = ref([]);
const getDviceTypeOption = async () => {
const res = await getBaseDeviceTypeListInWMS(null);
dviceTypeOptions.value = res.data;
}
onMounted(() => {
getDviceTypeOption();
getList();
});
</script>

@ -0,0 +1,323 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<!-- <el-form-item label="主键标识" prop="maintStationId">
<el-input v-model="queryParams.maintStationId" placeholder="请输入主键标识" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="设备类型" prop="deviceTypeId">
<el-input v-model="queryParams.deviceTypeId" placeholder="请输入设备类型" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="保养标准ID" prop="maintStandardId">
<el-input v-model="queryParams.maintStandardId" placeholder="请输入保养标准ID" clearable @keyup.enter="handleQuery" />
</el-form-item>-->
<el-form-item label="部位编号" prop="maintStationCode">
<el-input v-model="queryParams.maintStationCode" placeholder="请输入部位编号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="部位名称" prop="maintStationName">
<el-input v-model="queryParams.maintStationName" placeholder="请输入部位名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="激活标识" prop="activeFlag">
<el-select v-model="queryParams.activeFlag" placeholder="请选择激活标识" clearable >
<el-option v-for="dict in active_flag" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['dms:dmsBaseMaintStation:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['dms:dmsBaseMaintStation:edit']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['dms:dmsBaseMaintStation:remove']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['dms:dmsBaseMaintStation:export']"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="dmsBaseMaintStationList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="maintStationId" v-if="columns[0].visible"/>
<el-table-column label="设备类型" align="center" prop="deviceTypeName" v-if="columns[2].visible"/>
<el-table-column label="保养标准" align="center" prop="maintStandardCode" v-if="columns[3].visible"/>
<el-table-column label="部位编号" align="center" prop="maintStationCode" v-if="columns[4].visible"/>
<el-table-column label="部位名称" align="center" prop="maintStationName" v-if="columns[5].visible"/>
<el-table-column label="激活标识" align="center" prop="activeFlag" v-if="columns[6].visible">
<template #default="scope">
<dict-tag :options="active_flag" :value="scope.row.activeFlag"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[7].visible"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['dms:dmsBaseMaintStation:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['dms:dmsBaseMaintStation:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改保养部位信息对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="dmsBaseMaintStationFormRef" :model="form" :rules="rules" label-width="80px">
<!-- <el-form-item label="主键标识" prop="maintStationId">
<el-input v-model="form.maintStationId" placeholder="请输入主键标识" />
</el-form-item>-->
<el-form-item label="设备类型" prop="deviceTypeId">
<el-input v-model="form.deviceTypeId" placeholder="请输入设备类型" />
</el-form-item>
<el-form-item label="保养标准" prop="maintStandardId">
<!-- <el-input v-model="form.maintStandardId" placeholder="请输入保养标准ID" />-->
<el-select v-model="form.maintStandardId" placeholder="请选择保养标准" >
<el-option v-for="item in maintStandardOptions" :key="item.maintStandardId" :label="item.maintStandardCode" :value="item.maintStandardId" />
</el-select>
</el-form-item>
<el-form-item label="部位编号" prop="maintStationCode">
<el-input v-model="form.maintStationCode" placeholder="请输入部位编号" />
</el-form-item>
<el-form-item label="部位名称" prop="maintStationName">
<el-input v-model="form.maintStationName" placeholder="请输入部位名称" />
</el-form-item>
<el-form-item label="激活标识" prop="activeFlag">
<el-radio-group v-model="form.activeFlag">
<el-radio
v-for="dict in active_flag"
:key="dict.value"
:value="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="DmsBaseMaintStation" lang="ts">
import { listDmsBaseMaintStation, getDmsBaseMaintStation, delDmsBaseMaintStation, addDmsBaseMaintStation, updateDmsBaseMaintStation } from '@/api/dms/dmsBaseMaintStation';
import { DmsBaseMaintStationVO, DmsBaseMaintStationQuery, DmsBaseMaintStationForm } from '@/api/dms/dmsBaseMaintStation/types';
import {getDmsBaseMaintStandardList} from "@/api/dms/dmsBaseMaintStandard";
import {getBaseDeviceTypeListInWMS} from "@/api/dms/baseDeviceType";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { active_flag } = toRefs<any>(proxy?.useDict('active_flag'));
const dmsBaseMaintStationList = ref<DmsBaseMaintStationVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const dmsBaseMaintStationFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `主键标识`, visible: false },
{ key: 1, label: `租户编号`, visible: false },
{ key: 2, label: `设备类型`, visible: true },
{ key: 3, label: `保养标准ID`, visible: true },
{ key: 4, label: `部位编号`, visible: true },
{ key: 5, label: `部位名称`, visible: true },
{ key: 6, label: `激活标识`, visible: true },
{ key: 7, label: `备注`, visible: true },
{ key: 8, label: `创建部门`, visible: false },
{ key: 9, label: `创建人`, visible: false },
{ key: 10, label: `创建时间`, visible: false },
{ key: 11, label: `更新人`, visible: false },
{ key: 12, label: `更新时间`, visible: false },
]);
const initFormData: DmsBaseMaintStationForm = {
maintStationId: undefined,
deviceTypeId: undefined,
maintStandardId: undefined,
maintStationCode: undefined,
maintStationName: undefined,
activeFlag: undefined,
remark: undefined,
}
const data = reactive<PageData<DmsBaseMaintStationForm, DmsBaseMaintStationQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
maintStationId: undefined,
deviceTypeId: undefined,
maintStandardId: undefined,
maintStationCode: undefined,
maintStationName: undefined,
activeFlag: undefined,
params: {
}
},
rules: {
deviceTypeId: [
{ required: true, message: "设备类型不能为空", trigger: "blur" }
],
maintStandardId: [
{ required: true, message: "保养标准ID不能为空", trigger: "blur" }
],
maintStationCode: [
{ required: true, message: "部位编号不能为空", trigger: "blur" }
],
activeFlag: [
{ required: true, message: "激活标识不能为空", trigger: "change" }
],
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询保养部位信息列表 */
const getList = async () => {
loading.value = true;
const res = await listDmsBaseMaintStation(queryParams.value);
dmsBaseMaintStationList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
dmsBaseMaintStationFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: DmsBaseMaintStationVO[]) => {
ids.value = selection.map(item => item.maintStationId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加保养部位信息";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: DmsBaseMaintStationVO) => {
reset();
const _maintStationId = row?.maintStationId || ids.value[0]
const res = await getDmsBaseMaintStation(_maintStationId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改保养部位信息";
}
/** 提交按钮 */
const submitForm = () => {
dmsBaseMaintStationFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.maintStationId) {
await updateDmsBaseMaintStation(form.value).finally(() => buttonLoading.value = false);
} else {
await addDmsBaseMaintStation(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: DmsBaseMaintStationVO) => {
const _maintStationIds = row?.maintStationId || ids.value;
await proxy?.$modal.confirm('是否确认删除保养部位信息编号为"' + _maintStationIds + '"的数据项?').finally(() => loading.value = false);
await delDmsBaseMaintStation(_maintStationIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('dms/dmsBaseMaintStation/export', {
...queryParams.value
}, `dmsBaseMaintStation_${new Date().getTime()}.xlsx`)
}
//
let maintStandardOption = ref([]);
const getMaintStandardOtions = async () => {
const res = await getDmsBaseMaintStandardList(null);
maintStandardOption.value = res.data;
}
//
let dviceTypeOptions = ref([]);
const getDviceTypeOption = async () => {
const res = await getBaseDeviceTypeListInWMS(null);
dviceTypeOptions.value = res.data;
}
onMounted(() => {
getMaintStandardOtions();
getDviceTypeOption();
getList();
});
</script>

@ -0,0 +1,227 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="保养部位ID" prop="maintStationId">
<el-input v-model="queryParams.maintStationId" placeholder="请输入保养部位ID" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="保养项目ID" prop="maintProjectId">
<el-input v-model="queryParams.maintProjectId" placeholder="请输入保养项目ID" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['dms:dmsBaseStationProject:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['dms:dmsBaseStationProject:edit']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['dms:dmsBaseStationProject:remove']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['dms:dmsBaseStationProject:export']"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="dmsBaseStationProjectList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="保养部位ID" align="center" prop="maintStationId" v-if="columns[0].visible"/>
<el-table-column label="保养项目ID" align="center" prop="maintProjectId" v-if="columns[1].visible"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['dms:dmsBaseStationProject:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['dms:dmsBaseStationProject:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改保养部位关联项目信息对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="dmsBaseStationProjectFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="保养部位ID" prop="maintStationId">
<el-input v-model="form.maintStationId" placeholder="请输入保养部位ID" />
</el-form-item>
<el-form-item label="保养项目ID" prop="maintProjectId">
<el-input v-model="form.maintProjectId" placeholder="请输入保养项目ID" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="DmsBaseStationProject" lang="ts">
import { listDmsBaseStationProject, getDmsBaseStationProject, delDmsBaseStationProject, addDmsBaseStationProject, updateDmsBaseStationProject } from '@/api/dms/dmsBaseStationProject';
import { DmsBaseStationProjectVO, DmsBaseStationProjectQuery, DmsBaseStationProjectForm } from '@/api/dms/dmsBaseStationProject/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const dmsBaseStationProjectList = ref<DmsBaseStationProjectVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const dmsBaseStationProjectFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `保养部位ID`, visible: true },
{ key: 1, label: `保养项目ID`, visible: true },
]);
const initFormData: DmsBaseStationProjectForm = {
maintStationId: undefined,
maintProjectId: undefined
}
const data = reactive<PageData<DmsBaseStationProjectForm, DmsBaseStationProjectQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
maintStationId: undefined,
maintProjectId: undefined,
params: {
}
},
rules: {
maintStationId: [
{ required: true, message: "保养部位ID不能为空", trigger: "blur" }
],
maintProjectId: [
{ required: true, message: "保养项目ID不能为空", trigger: "blur" }
]
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询保养部位关联项目信息列表 */
const getList = async () => {
loading.value = true;
const res = await listDmsBaseStationProject(queryParams.value);
dmsBaseStationProjectList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
dmsBaseStationProjectFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: DmsBaseStationProjectVO[]) => {
ids.value = selection.map(item => item.maintStationId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加保养部位关联项目信息";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: DmsBaseStationProjectVO) => {
reset();
const _maintStationId = row?.maintStationId || ids.value[0]
const res = await getDmsBaseStationProject(_maintStationId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改保养部位关联项目信息";
}
/** 提交按钮 */
const submitForm = () => {
dmsBaseStationProjectFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.maintStationId) {
await updateDmsBaseStationProject(form.value).finally(() => buttonLoading.value = false);
} else {
await addDmsBaseStationProject(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: DmsBaseStationProjectVO) => {
const _maintStationIds = row?.maintStationId || ids.value;
await proxy?.$modal.confirm('是否确认删除保养部位关联项目信息编号为"' + _maintStationIds + '"的数据项?').finally(() => loading.value = false);
await delDmsBaseStationProject(_maintStationIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('dms/dmsBaseStationProject/export', {
...queryParams.value
}, `dmsBaseStationProject_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
getList();
});
</script>

@ -0,0 +1,397 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<!-- <el-form-item label="主键标识" prop="planMaintId">
<el-input v-model="queryParams.planMaintId" placeholder="请输入主键标识" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="计划编号" prop="planMaintCode">
<el-input v-model="queryParams.planMaintCode" placeholder="请输入计划编号" clearable @keyup.enter="handleQuery" />
</el-form-item>-->
<el-form-item label="保养级别" prop="maintLevel">
<el-select v-model="queryParams.maintLevel" placeholder="请选择保养级别" clearable >
<el-option v-for="dict in maint_level" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<!-- <el-form-item label="保养组别" prop="maintGroup">
<el-input v-model="queryParams.maintGroup" placeholder="请输入保养组别" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="保养负责人" prop="maintSupervisor">
<el-input v-model="queryParams.maintSupervisor" placeholder="请输入保养负责人" clearable @keyup.enter="handleQuery" />
</el-form-item>-->
<el-form-item label="本次保养时间" prop="maintTime">
<el-date-picker clearable
v-model="queryParams.maintTime"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择本次保养时间"
/>
</el-form-item>
<!-- <el-form-item label="关联sj_job主键id" prop="jobId">
<el-input v-model="queryParams.jobId" placeholder="请输入关联sj_job主键id" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="时限" prop="timeLimit">
<el-input v-model="queryParams.timeLimit" placeholder="请输入时限" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="循环周期" prop="cyclePeriod">
<el-input v-model="queryParams.cyclePeriod" placeholder="请输入循环周期" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="保养状态" prop="maintStatus">
<el-select v-model="queryParams.maintStatus" placeholder="请选择保养状态" clearable >
<el-option v-for="dict in maint_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>-->
<el-form-item label="创建方式" prop="createMethod">
<el-select v-model="queryParams.createMethod" placeholder="请选择创建方式" clearable >
<el-option v-for="dict in create_method" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="激活标识" prop="activeFlag">
<el-input v-model="queryParams.activeFlag" placeholder="请输入激活标识" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['dms:dmsPlanMaint:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['dms:dmsPlanMaint:edit']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['dms:dmsPlanMaint:remove']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['dms:dmsPlanMaint:export']"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="dmsPlanMaintList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="planMaintId" v-if="columns[0].visible"/>
<el-table-column label="计划编号" align="center" prop="planMaintCode" v-if="columns[2].visible"/>
<el-table-column label="保养级别" align="center" prop="maintLevel" v-if="columns[3].visible">
<template #default="scope">
<dict-tag :options="maint_level" :value="scope.row.maintLevel"/>
</template>
</el-table-column>
<el-table-column label="保养组别" align="center" prop="maintGroup" v-if="columns[4].visible"/>
<el-table-column label="保养负责人" align="center" prop="maintSupervisor" v-if="columns[5].visible"/>
<el-table-column label="本次保养时间" align="center" prop="maintTime" width="180" v-if="columns[6].visible">
<template #default="scope">
<span>{{ parseTime(scope.row.maintTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="jobId" align="center" prop="jobId" v-if="columns[7].visible"/>
<el-table-column label="时限" align="center" prop="timeLimit" v-if="columns[8].visible"/>
<el-table-column label="循环周期" align="center" prop="cyclePeriod" v-if="columns[9].visible"/>
<el-table-column label="保养状态" align="center" prop="maintStatus" v-if="columns[10].visible">
<template #default="scope">
<dict-tag :options="maint_status" :value="scope.row.maintStatus"/>
</template>
</el-table-column>
<el-table-column label="创建方式" align="center" prop="createMethod" v-if="columns[11].visible">
<template #default="scope">
<dict-tag :options="create_method" :value="scope.row.createMethod"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[12].visible"/>
<el-table-column label="激活标识" align="center" prop="activeFlag" v-if="columns[13].visible">
<template #default="scope">
<dict-tag :options="active_flag" :value="scope.row.activeFlag"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['dms:dmsPlanMaint:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['dms:dmsPlanMaint:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改保养计划信息对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="dmsPlanMaintFormRef" :model="form" :rules="rules" label-width="80px">
<!-- <el-form-item label="主键标识" prop="planMaintId">
<el-input v-model="form.planMaintId" placeholder="请输入主键标识" />
</el-form-item>-->
<el-form-item label="计划编号" prop="planMaintCode">
<el-input v-model="form.planMaintCode" placeholder="请输入计划编号" />
</el-form-item>
<el-form-item label="保养级别" prop="maintLevel">
<el-select v-model="form.maintLevel" placeholder="请选择保养级别">
<el-option
v-for="dict in maint_level"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="保养组别" prop="maintGroup">
<el-input v-model="form.maintGroup" placeholder="请输入保养组别" />
</el-form-item>
<el-form-item label="保养负责人" prop="maintSupervisor">
<el-input v-model="form.maintSupervisor" placeholder="请输入保养负责人" />
</el-form-item>
<el-form-item label="本次保养时间" prop="maintTime">
<el-date-picker clearable
v-model="form.maintTime"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择本次保养时间">
</el-date-picker>
</el-form-item>
<el-form-item label="关联sj_job主键id" prop="jobId">
<el-input v-model="form.jobId" placeholder="请输入关联sj_job主键id" />
</el-form-item>
<el-form-item label="时限" prop="timeLimit">
<el-input v-model="form.timeLimit" placeholder="请输入时限" />
</el-form-item>
<el-form-item label="循环周期" prop="cyclePeriod">
<el-input v-model="form.cyclePeriod" placeholder="请输入循环周期" />
</el-form-item>
<el-form-item label="保养状态" prop="maintStatus">
<el-select v-model="form.maintStatus" placeholder="请选择保养状态">
<el-option
v-for="dict in maint_status"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="创建方式" prop="createMethod">
<el-select v-model="form.createMethod" placeholder="请选择创建方式">
<el-option
v-for="dict in create_method"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="激活标识" prop="activeFlag">
<el-input v-model="form.activeFlag" placeholder="请输入激活标识" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="DmsPlanMaint" lang="ts">
import { listDmsPlanMaint, getDmsPlanMaint, delDmsPlanMaint, addDmsPlanMaint, updateDmsPlanMaint } from '@/api/dms/dmsPlanMaint';
import { DmsPlanMaintVO, DmsPlanMaintQuery, DmsPlanMaintForm } from '@/api/dms/dmsPlanMaint/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { maint_status, maint_level, create_method } = toRefs<any>(proxy?.useDict('maint_status', 'maint_level', 'create_method'));
const dmsPlanMaintList = ref<DmsPlanMaintVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const dmsPlanMaintFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `主键标识`, visible: false },
{ key: 1, label: `租户编号`, visible: false },
{ key: 2, label: `计划编号`, visible: true },
{ key: 3, label: `保养级别`, visible: true },
{ key: 4, label: `保养组别`, visible: true },
{ key: 5, label: `保养负责人`, visible: true },
{ key: 6, label: `本次保养时间`, visible: true },
{ key: 7, label: `关联sj_job主键id`, visible: true },
{ key: 8, label: `时限`, visible: true },
{ key: 9, label: `循环周期`, visible: true },
{ key: 10, label: `保养状态`, visible: true },
{ key: 11, label: `创建方式`, visible: true },
{ key: 12, label: `备注`, visible: true },
{ key: 13, label: `激活标识`, visible: false },
{ key: 14, label: `创建部门`, visible: false },
{ key: 15, label: `创建人`, visible: false },
{ key: 16, label: `创建时间`, visible: false },
{ key: 17, label: `更新人`, visible: false },
{ key: 18, label: `更新时间`, visible: false },
]);
const initFormData: DmsPlanMaintForm = {
planMaintId: undefined,
planMaintCode: undefined,
maintLevel: undefined,
maintGroup: undefined,
maintSupervisor: undefined,
maintTime: undefined,
jobId: undefined,
timeLimit: undefined,
cyclePeriod: undefined,
maintStatus: undefined,
createMethod: undefined,
remark: undefined,
activeFlag: undefined,
}
const data = reactive<PageData<DmsPlanMaintForm, DmsPlanMaintQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
planMaintId: undefined,
planMaintCode: undefined,
maintLevel: undefined,
maintGroup: undefined,
maintSupervisor: undefined,
maintTime: undefined,
jobId: undefined,
timeLimit: undefined,
cyclePeriod: undefined,
maintStatus: undefined,
createMethod: undefined,
activeFlag: undefined,
params: {
}
},
rules: {
planMaintCode: [
{ required: true, message: "计划编号不能为空", trigger: "blur" }
],
activeFlag: [
{ required: true, message: "激活标识不能为空", trigger: "blur" }
],
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询保养计划信息列表 */
const getList = async () => {
loading.value = true;
const res = await listDmsPlanMaint(queryParams.value);
dmsPlanMaintList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
dmsPlanMaintFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: DmsPlanMaintVO[]) => {
ids.value = selection.map(item => item.planMaintId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加保养计划信息";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: DmsPlanMaintVO) => {
reset();
const _planMaintId = row?.planMaintId || ids.value[0]
const res = await getDmsPlanMaint(_planMaintId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改保养计划信息";
}
/** 提交按钮 */
const submitForm = () => {
dmsPlanMaintFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.planMaintId) {
await updateDmsPlanMaint(form.value).finally(() => buttonLoading.value = false);
} else {
await addDmsPlanMaint(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: DmsPlanMaintVO) => {
const _planMaintIds = row?.planMaintId || ids.value;
await proxy?.$modal.confirm('是否确认删除保养计划信息编号为"' + _planMaintIds + '"的数据项?').finally(() => loading.value = false);
await delDmsPlanMaint(_planMaintIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('dms/dmsPlanMaint/export', {
...queryParams.value
}, `dmsPlanMaint_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
getList();
});
</script>

@ -0,0 +1,344 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<!-- <el-form-item label="主键标识" prop="planMaintDetailId">
<el-input v-model="queryParams.planMaintDetailId" placeholder="请输入主键标识" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="计划" prop="planMaintId">
<el-input v-model="queryParams.planMaintId" placeholder="请输入计划" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="设备" prop="machineId">
<el-input v-model="queryParams.machineId" placeholder="请输入设备" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="保养部位" prop="maintStationId">
<el-input v-model="queryParams.maintStationId" placeholder="请输入保养部位" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="保养标准" prop="maintStandardId">
<el-input v-model="queryParams.maintStandardId" placeholder="请输入保养标准" clearable @keyup.enter="handleQuery" />
</el-form-item>-->
<!-- <el-form-item label="操作描述" prop="operationDescription">
<el-input v-model="queryParams.operationDescription" placeholder="请输入操作描述" clearable @keyup.enter="handleQuery" />
</el-form-item>-->
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['dms:dmsPlanMaintDetail:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['dms:dmsPlanMaintDetail:edit']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['dms:dmsPlanMaintDetail:remove']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['dms:dmsPlanMaintDetail:export']"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="dmsPlanMaintDetailList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="planMaintDetailId" v-if="columns[0].visible"/>
<el-table-column label="计划" align="center" prop="planMaintCode" v-if="columns[2].visible"/>
<el-table-column label="设备" align="center" prop="machineName" v-if="columns[3].visible"/>
<el-table-column label="保养部位" align="center" prop="maintStationName" v-if="columns[4].visible"/>
<el-table-column label="保养标准" align="center" prop="maintStandardCode" v-if="columns[5].visible"/>
<el-table-column label="操作描述" align="center" prop="operationDescription" v-if="columns[6].visible"/>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[7].visible"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['dms:dmsPlanMaintDetail:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['dms:dmsPlanMaintDetail:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改保养计划明细对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="dmsPlanMaintDetailFormRef" :model="form" :rules="rules" label-width="80px">
<!-- <el-form-item label="主键标识" prop="planMaintDetailId">
<el-input v-model="form.planMaintDetailId" placeholder="请输入主键标识" />
</el-form-item>-->
<el-form-item label="计划" prop="planMaintId">
<!-- <el-input v-model="form.planMaintId" placeholder="请输入计划" />-->
<el-select v-model="form.planMaintId" placeholder="请选择计划" >
<el-option v-for="item in planOtion" :key="item.planMaintId" :label="item.planMaintCode" :value="item.planMaintId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="设备" prop="machineId">
<!-- <el-input v-model="form.machineId" placeholder="请输入设备" />-->
<el-select v-model="form.machineId" placeholder="请选择设备" >
<el-option v-for="item in machineOption" :key="item.machineId" :label="item.machineName" :value="item.machineId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="保养部位" prop="maintStationId">
<!-- <el-input v-model="form.maintStationId" placeholder="请输入保养部位" />-->
<el-select v-model="form.maintStationId" placeholder="请选择保养部位" >
<el-option v-for="item in maintStationOption" :key="item.maintStationId" :label="item.maintStationName" :value="item.maintStationId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="保养标准" prop="maintStandardId">
<!-- <el-input v-model="form.maintStandardId" placeholder="请输入保养标准" />-->
<el-select v-model="form.maintStandardId" placeholder="请选择保养标准" >
<el-option v-for="item in maintStandardOption" :key="item.maintStandardId" :label="item.maintStandardCode" :value="item.maintStandardId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="操作描述" prop="operationDescription">
<el-input v-model="form.operationDescription" placeholder="请输入操作描述" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="DmsPlanMaintDetail" lang="ts">
import { listDmsPlanMaintDetail, getDmsPlanMaintDetail, delDmsPlanMaintDetail, addDmsPlanMaintDetail, updateDmsPlanMaintDetail } from '@/api/dms/dmsPlanMaintDetail';
import { DmsPlanMaintDetailVO, DmsPlanMaintDetailQuery, DmsPlanMaintDetailForm } from '@/api/dms/dmsPlanMaintDetail/types';
import {getDmsPlanMaint} from "@/api/dms/dmsPlanMaint";
import {getDmsBaseMachineInfoList} from "@/api/dms/dmsBaseMachineInfo";
import {getDmsBaseMaintStationList} from "@/api/dms/dmsBaseMaintStation";
import {getDmsBaseMaintStandardList} from "@/api/dms/dmsBaseMaintStandard";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const dmsPlanMaintDetailList = ref<DmsPlanMaintDetailVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const dmsPlanMaintDetailFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `主键标识`, visible: false },
{ key: 1, label: `租户编号`, visible: false },
{ key: 2, label: `计划`, visible: true },
{ key: 3, label: `设备`, visible: true },
{ key: 4, label: `保养部位`, visible: true },
{ key: 5, label: `保养标准`, visible: true },
{ key: 6, label: `操作描述`, visible: true },
{ key: 7, label: `备注`, visible: false },
{ key: 8, label: `创建部门`, visible: false },
{ key: 9, label: `创建人`, visible: false },
{ key: 10, label: `创建时间`, visible: false },
{ key: 11, label: `更新人`, visible: false },
{ key: 12, label: `更新时间`, visible: false },
]);
const initFormData: DmsPlanMaintDetailForm = {
planMaintDetailId: undefined,
planMaintId: undefined,
machineId: undefined,
maintStationId: undefined,
maintStandardId: undefined,
operationDescription: undefined,
remark: undefined,
maintStandardCode: undefined,
planMaintCode:undefined,
machineName:undefined,
maintStationName:undefined,
}
const data = reactive<PageData<DmsPlanMaintDetailForm, DmsPlanMaintDetailQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
planMaintDetailId: undefined,
planMaintId: undefined,
machineId: undefined,
maintStationId: undefined,
maintStandardId: undefined,
operationDescription: undefined,
maintStandardCode: undefined,
planMaintCode:undefined,
machineName:undefined,
maintStationName:undefined,
params: {
}
},
rules: {
planMaintId: [
{ required: true, message: "计划不能为空", trigger: "blur" }
],
machineId: [
{ required: true, message: "设备不能为空", trigger: "blur" }
],
maintStationId: [
{ required: true, message: "保养部位不能为空", trigger: "blur" }
],
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询保养计划明细列表 */
const getList = async () => {
loading.value = true;
const res = await listDmsPlanMaintDetail(queryParams.value);
dmsPlanMaintDetailList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
dmsPlanMaintDetailFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: DmsPlanMaintDetailVO[]) => {
ids.value = selection.map(item => item.planMaintDetailId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加保养计划明细";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: DmsPlanMaintDetailVO) => {
reset();
const _planMaintDetailId = row?.planMaintDetailId || ids.value[0]
const res = await getDmsPlanMaintDetail(_planMaintDetailId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改保养计划明细";
}
/** 提交按钮 */
const submitForm = () => {
dmsPlanMaintDetailFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.planMaintDetailId) {
await updateDmsPlanMaintDetail(form.value).finally(() => buttonLoading.value = false);
} else {
await addDmsPlanMaintDetail(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: DmsPlanMaintDetailVO) => {
const _planMaintDetailIds = row?.planMaintDetailId || ids.value;
await proxy?.$modal.confirm('是否确认删除保养计划明细编号为"' + _planMaintDetailIds + '"的数据项?').finally(() => loading.value = false);
await delDmsPlanMaintDetail(_planMaintDetailIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('dms/dmsPlanMaintDetail/export', {
...queryParams.value
}, `dmsPlanMaintDetail_${new Date().getTime()}.xlsx`)
}
//
let planOtion = ref([]);
const getPlplanOtions = async () => {
const res = await getDmsPlanMaint(null);
planOtion.value = res.data;
}
//
let machineOption = ref([]);
const getMachineOtions = async () => {
const res = await getDmsBaseMachineInfoList(null);
machineOption.value = res.data;
}
//
let maintStationOption = ref([]);
const getMaintStationOtions = async () => {
const res = await getDmsBaseMaintStationList(null);
maintStationOption.value = res.data;
}
//
let maintStandardOption = ref([]);
const getMaintStandardOtions = async () => {
const res = await getDmsBaseMaintStandardList(null);
maintStandardOption.value = res.data;
}
onMounted(() => {
getPlplanOtions();
getMachineOtions();
getMaintStationOtions();
getMaintStandardOtions();
getList();
});
</script>
Loading…
Cancel
Save