Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhanghan11 2024-06-20 11:07:15 +08:00
commit b4858b078e
15 changed files with 1535 additions and 1029 deletions

View File

@ -69,9 +69,18 @@ public class IpcEquipInfoController extends BaseController
}
@GetMapping("/getInfoByParentId")
public AjaxResult getInfoByParentId(@RequestParam String parentEquipId,String type)
public AjaxResult getInfoByParentId(@RequestParam String parentEquipId,String type,Long deptId)
{
return AjaxResult.success(ipcEquipInfoService.selectIpcEquipInfoListByParentId(parentEquipId,type));
return AjaxResult.success(ipcEquipInfoService.selectIpcEquipInfoListByParentId(parentEquipId,type,deptId));
}
/**
* 根据部门选择设备树
*/
@GetMapping("/getEquipTreeByDept")
public AjaxResult getEquipTreeByDept(Long deptId)
{
return AjaxResult.success(ipcEquipInfoService.selectIpcEquipInfoTreeByDeptId(deptId));
}
/**

View File

@ -32,6 +32,11 @@ public class TreeSelect implements Serializable {
*/
private String remark;
/**
*
*/
private Long value;
/**
* 子节点
*/
@ -44,6 +49,7 @@ public class TreeSelect implements Serializable {
public TreeSelect(SysDept dept) {
this.id = dept.getDeptId();
this.value = dept.getDeptId();
this.label = dept.getDeptName();
this.remark = dept.getRemark();
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
@ -85,6 +91,14 @@ public class TreeSelect implements Serializable {
this.label = label;
}
public Long getValue() {
return value;
}
public void setValue(Long value) {
this.value = value;
}
public List<TreeSelect> getChildren() {
return children;
}

View File

@ -49,6 +49,13 @@ public class EquipTreeSelect implements Serializable {
this.children = equipCategory.getChildList().stream().map(EquipTreeSelect::new).collect(Collectors.toList());
}
public EquipTreeSelect(IpcEquipInfo equipInfo){
this.id = equipInfo.getId();
this.label = equipInfo.getEquipName();
this.value = equipInfo.getId();
this.children = equipInfo.getChildList().stream().map(EquipTreeSelect::new).collect(Collectors.toList());
}
public String getId() {
return id;
}

View File

@ -1,12 +1,14 @@
package com.inspur.equip.domain;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.inspur.common.annotation.Excel;
import com.inspur.common.core.domain.BaseEntity;
import com.inspur.common.core.domain.entity.SysDept;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -114,13 +116,18 @@ public class IpcEquipInfo extends BaseEntity
private String equipFilesPath;
private List<IpcEquipInfo> childList;
private List<IpcEquipInfo> childList = new ArrayList<>();
/**
* 是否叶子节点
*/
private boolean leaf;
/**
* 子设备
*/
private List<IpcEquipInfo> children;
public void setId(String id)
{
this.id = id;
@ -354,6 +361,14 @@ public class IpcEquipInfo extends BaseEntity
this.leaf = leaf;
}
public List<IpcEquipInfo> getChildren() {
return children;
}
public void setChildren(List<IpcEquipInfo> children) {
this.children = children;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

View File

@ -6,6 +6,7 @@ import com.inspur.common.annotation.DataSource;
import com.inspur.common.enums.DataSourceType;
import com.inspur.equip.domain.EquipTreeSelect;
import com.inspur.equip.domain.IpcEquipInfo;
import org.apache.ibatis.annotations.Param;
public interface IpcEquipInfoMapper
@ -46,7 +47,8 @@ public interface IpcEquipInfoMapper
/**
* 通过父节点id获取设备信息
*/
public List<IpcEquipInfo> selectIpcEquipInfoListByParentId(String parentEquipId);
public List<IpcEquipInfo> selectIpcEquipInfoListByParentId(@Param("parentEquipId")String parentEquipId,
@Param("deptId")Long deptId);
/**
* 查询正常运行设备

View File

@ -1,6 +1,8 @@
package com.inspur.equip.service;
import java.util.List;
import com.inspur.equip.domain.EquipTreeSelect;
import com.inspur.equip.domain.IpcEquipInfo;
/**
@ -42,7 +44,12 @@ public interface IIpcEquipInfoService
/**
* 通过父节点id获取设备信息
*/
public List<IpcEquipInfo> selectIpcEquipInfoListByParentId(String parentEquipId,String type);
public List<IpcEquipInfo> selectIpcEquipInfoListByParentId(String parentEquipId,String type,Long deptId);
/**
* 根据部门id获取设备树信息
*/
public List<EquipTreeSelect> selectIpcEquipInfoTreeByDeptId(Long deptId);
/**
* 新增设备信息

View File

@ -1,12 +1,11 @@
package com.inspur.equip.service.impl;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
import com.inspur.common.utils.StringUtils;
import com.inspur.common.utils.uuid.IdUtils;
import com.inspur.equip.domain.EquipTreeSelect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.inspur.equip.mapper.IpcEquipInfoMapper;
@ -71,6 +70,7 @@ public class IpcEquipInfoServiceImpl implements IIpcEquipInfoService
* @param ipcEquipInfo
* @return
*/
@Override
public List<IpcEquipInfo> selectQueryIpcEquipInfoList(IpcEquipInfo ipcEquipInfo){
return ipcEquipInfoMapper.selectQueryIpcEquipInfoList(ipcEquipInfo);
}
@ -78,15 +78,29 @@ public class IpcEquipInfoServiceImpl implements IIpcEquipInfoService
/**
* 通过父节点id获取设备信息
*/
public List<IpcEquipInfo> selectIpcEquipInfoListByParentId(String parentEquipId,String type){
@Override
public List<IpcEquipInfo> selectIpcEquipInfoListByParentId(String parentEquipId,String type,Long deptId){
if(type == null){
return ipcEquipInfoMapper.selectIpcEquipInfoListByParentId(parentEquipId);
return ipcEquipInfoMapper.selectIpcEquipInfoListByParentId(parentEquipId,deptId);
}else {
return ipcEquipInfoMapper.selectRunningIpcEquipInfoListByParentId(parentEquipId);
}
}
/**
* 根据部门id获取设备树信息
*/
@Override
public List<EquipTreeSelect> selectIpcEquipInfoTreeByDeptId(Long deptId){
//根据deptId查询设备信息
IpcEquipInfo query = new IpcEquipInfo();
query.setDeptId(deptId);
List<IpcEquipInfo> equipInfos = ipcEquipInfoMapper.selectIpcEquipInfoList(query);
List<IpcEquipInfo> equipTrees = getEquipTree(equipInfos);
return equipTrees.stream().map(EquipTreeSelect :: new).collect(Collectors.toList());
}
/**
* 新增设备信息
*
@ -180,5 +194,74 @@ public class IpcEquipInfoServiceImpl implements IIpcEquipInfoService
).collect(Collectors.toList());
}
/**
* 获取设备树
*/
private List<IpcEquipInfo> getEquipTree(List<IpcEquipInfo> equipInfos) {
List<IpcEquipInfo> returnList = new ArrayList<IpcEquipInfo>();
List<String> tempList = new ArrayList<String>();
for (IpcEquipInfo equipInfo : equipInfos)
{
tempList.add(equipInfo.getId());
}
for (IpcEquipInfo equipInfo : equipInfos)
{
// 如果是顶级节点, 遍历该父节点的所有子节点
if (!tempList.contains(equipInfo.getParentEquipId()))
{
recursionFn(equipInfos, equipInfo);
returnList.add(equipInfo);
}
}
if (returnList.isEmpty())
{
returnList = equipInfos;
}
return returnList;
}
/**
* 递归列表
*/
private void recursionFn(List<IpcEquipInfo> list, IpcEquipInfo t)
{
// 得到子节点列表
List<IpcEquipInfo> childList = getChildList(list, t);
t.setChildren(childList);
for (IpcEquipInfo tChild : childList)
{
if (hasChild(list, tChild))
{
recursionFn(list, tChild);
}
}
}
/**
* 得到子节点列表
*/
private List<IpcEquipInfo> getChildList(List<IpcEquipInfo> list, IpcEquipInfo t)
{
List<IpcEquipInfo> tlist = new ArrayList<IpcEquipInfo>();
Iterator<IpcEquipInfo> it = list.iterator();
while (it.hasNext())
{
IpcEquipInfo n = (IpcEquipInfo) it.next();
if (StringUtils.isNotNull(n.getParentEquipId()) && n.getParentEquipId().equals(t.getId()))
{
tlist.add(n);
}
}
return tlist;
}
/**
* 判断是否有子节点
*/
private boolean hasChild(List<IpcEquipInfo> list, IpcEquipInfo t)
{
return getChildList(list, t).size() > 0;
}
}

View File

@ -136,6 +136,7 @@
SELECT a.*,(NOT EXISTS(SELECT * from `ipc_equip_info` b WHERE b.parent_equip_id = a.id )) as leaf
FROM `ipc_equip_info` a
WHERE parent_equip_id = #{parentEquipId}
<if test="deptId != null and deptId != ''">and a.dept_id = #{deptId}</if>
</select>
<!-- 查询正常运行设备 selectRunningIpcEquipInfoListByParentId-->

View File

@ -704,6 +704,8 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.deptId = null;
this.$refs.tree.setCurrentKey(null);
this.handleQuery();
},
//

View File

@ -105,7 +105,7 @@
:gutter="10"
class="mb8"
>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
@ -114,7 +114,7 @@
@click="handleAdd"
v-hasPermi="['equip:info:add']"
>新增</el-button>
</el-col>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="success"
@ -287,7 +287,7 @@
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
<!-- <el-button
size="mini"
type="text"
icon="el-icon-plus"
@ -307,7 +307,7 @@
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['equip:info:remove']"
>删除</el-button>
>删除</el-button> -->
<el-button
size="mini"
type="text"
@ -991,13 +991,17 @@
:value="dict.value"
/>
</el-select> -->
<template>
<template v-if="detailsForm.equipLevel">
<dict-tag
class="pop-span"
:options="dict.type.equip_level"
:value="detailsForm.equipLevel"
/>
</template>
<span
v-else
class="pop-span"
></span>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
@ -1028,13 +1032,17 @@
:value="dict.value"
/>
</el-select> -->
<template>
<template v-if="detailsForm.equipDangerLevel">
<dict-tag
class="pop-span"
:options="dict.type.equip_danger_level"
:value="detailsForm.equipDangerLevel"
/>
</template>
<span
v-else
class="pop-span"
></span>
</el-form-item>
</el-col>
<el-col :span="12">
@ -2009,6 +2017,7 @@ export default {
this.resetForm("queryForm");
this.queryParams.equipCategoryId = [];
this.queryParams.deptId = null;
this.$refs.tree.setCurrentKey(null);
this.queryParams.pageNum = 1;
this.getList();
},

View File

@ -1,83 +1,117 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="80px"
style="text-align:right"
>
<el-form-item
label="传感器名称"
prop="sensorName"
<el-row :gutter="20">
<!--部门数据-->
<el-col
:span="4"
:xs="24"
>
<el-input
v-model="queryParams.sensorName"
placeholder="请输入传感器名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item
label="传感器型号"
prop="sensorModel"
>
<el-input
v-model="queryParams.sensorModel"
placeholder="请输入传感器型号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item
label="所属设备"
prop="equipId"
>
<el-cascader
v-model="queryParams.equipIds"
:props="props"
placeholder="请选择设备"
/>
</el-form-item>
<el-form-item
label="传感器状态"
prop="status"
>
<el-select
v-model="queryParams.status"
placeholder="请选择传感器状态"
clearable
>
<el-option
v-for="dict in dict.type.sensor_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
<div class="head-container">
<el-input
v-model="deptName"
placeholder="请输入部门名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button>
</el-form-item>
</el-form>
</div>
<div class="head-container">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="id"
default-expand-all
highlight-current
@node-click="handleNodeClick"
/>
</div>
</el-col>
<el-col
:span="20"
:xs="24"
>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="80px"
style="text-align:right"
>
<el-form-item
label="传感器名称"
prop="sensorName"
>
<el-input
v-model="queryParams.sensorName"
placeholder="请输入传感器名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item
label="传感器型号"
prop="sensorModel"
>
<el-input
v-model="queryParams.sensorModel"
placeholder="请输入传感器型号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item
label="所属设备"
prop="equipId"
>
<el-cascader
v-model="queryParams.equipIds"
:props="props"
placeholder="请选择设备"
/>
</el-form-item>
<el-form-item
label="传感器状态"
prop="status"
>
<el-select
v-model="queryParams.status"
placeholder="请选择传感器状态"
clearable
>
<el-option
v-for="dict in dict.type.sensor_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button>
</el-form-item>
</el-form>
<el-row
:gutter="10"
class="mb8"
>
<el-col :span="1.5">
<el-row
:gutter="10"
class="mb8"
>
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
@ -108,9 +142,9 @@
@click="handleDelete"
v-hasPermi="['sensor:info:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-button
</el-col> -->
<el-col :span="1.5">
<!-- <el-button
type="warning"
plain
icon="el-icon-download"
@ -118,133 +152,133 @@
@click="handleExport"
v-hasPermi="['sensor:info:export']"
>导出</el-button> -->
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="infoList"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
/>
<el-table-column
label="传感器名称"
align="center"
prop="sensorName"
/>
<el-table-column
label="传感器型号"
align="center"
prop="sensorModel"
/>
<el-table-column
label="传感器编号"
align="center"
prop="sensorNum"
/>
<el-table-column
label="传感器序列号"
align="center"
prop="sensorSerialNum"
/>
<el-table-column
label="所属设备"
align="center"
prop="equipName"
/>
<el-table-column
label="所属部门/产线"
align="center"
prop="deptName"
/>
<el-table-column
label="生产厂商"
align="center"
prop="sensorManufacturer"
/>
<el-table-column
label="传感器类型"
align="center"
prop="sensorType"
/>
<el-table-column
label="传感器价格"
align="center"
prop="sensorPrice"
/>
<el-table-column
label="传感器技术参数"
align="center"
prop="sensorTechnicalSpecifications"
/>
<el-table-column
label="出厂日期"
align="center"
prop="sensorProductionDate"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.sensorProductionDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column
label="安装日期"
align="center"
prop="sensorPurchaseDate"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.sensorPurchaseDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column
label="传感器描述"
align="center"
prop="description"
/>
<el-table-column
label="备注"
align="center"
prop="remark"
/>
<el-table-column
label="传感器状态"
align="center"
prop="status"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.sensor_type"
:value="scope.row.status"
<el-table
v-loading="loading"
:data="infoList"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
/>
</template>
</el-table-column>
<el-table-column
label="传感器图片"
align="center"
prop="sensorPicPath"
width="100"
>
<template slot-scope="scope">
<image-preview
:src="scope.row.sensorPicPath"
:width="50"
:height="50"
<el-table-column
label="传感器名称"
align="center"
prop="sensorName"
/>
<el-table-column
label="传感器型号"
align="center"
prop="sensorModel"
/>
<el-table-column
label="传感器编号"
align="center"
prop="sensorNum"
/>
<el-table-column
label="传感器序列号"
align="center"
prop="sensorSerialNum"
/>
<el-table-column
label="所属设备"
align="center"
prop="equipName"
/>
<el-table-column
label="所属部门/产线"
align="center"
prop="deptName"
/>
<el-table-column
label="生产厂商"
align="center"
prop="sensorManufacturer"
/>
<el-table-column
label="传感器类型"
align="center"
prop="sensorType"
/>
</template>
</el-table-column>
<el-table-column
<el-table-column
label="传感器价格"
align="center"
prop="sensorPrice"
/>
<el-table-column
label="传感器技术参数"
align="center"
prop="sensorTechnicalSpecifications"
/>
<el-table-column
label="出厂日期"
align="center"
prop="sensorProductionDate"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.sensorProductionDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column
label="安装日期"
align="center"
prop="sensorPurchaseDate"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.sensorPurchaseDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column
label="传感器描述"
align="center"
prop="description"
/>
<el-table-column
label="备注"
align="center"
prop="remark"
/>
<el-table-column
label="传感器状态"
align="center"
prop="status"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.sensor_type"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column
label="传感器图片"
align="center"
prop="sensorPicPath"
width="100"
>
<template slot-scope="scope">
<image-preview
:src="scope.row.sensorPicPath"
:width="50"
:height="50"
/>
</template>
</el-table-column>
<!-- <el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
@ -265,17 +299,18 @@
v-hasPermi="['sensor:info:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-table-column> -->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 添加或修改传感器信息对话框 -->
<el-dialog
:title="title"
@ -454,6 +489,7 @@ import {
} from "@/api/sensor/sensor";
import { getInfoByParentId } from "@/api/equip/equip";
import _ from "lodash";
import { deptTreeSelect } from "@/api/system/user";
export default {
name: "Sensor",
dicts: ["sensor_type"],
@ -587,12 +623,46 @@ export default {
});
},
},
options: [], //
defaultProps: {
children: "children",
label: "label",
},
//
deptOptions: undefined,
//
deptName: undefined,
deptSelected: false,
};
},
watch: {
//
deptName(val) {
this.$refs.tree.filter(val);
},
},
created() {
this.getList();
this.getDeptTree();
},
methods: {
/** 查询部门下拉树结构 */
getDeptTree() {
deptTreeSelect().then((response) => {
this.deptOptions = response.data;
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.deptSelected = true;
this.queryParams.deptId = data.id;
this.handleQuery();
},
/** 查询传感器信息列表 */
getList() {
this.loading = true;
@ -641,6 +711,8 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.queryParams.equipIds = null;
this.queryParams.deptId = null;
this.$refs.tree.setCurrentKey(null);
this.resetForm("queryForm");
this.handleQuery();
},

View File

@ -1,95 +1,129 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
style="text-align:right"
>
<el-form-item
label="设备"
prop="equipIds"
<el-row :gutter="20">
<!--部门数据-->
<el-col
:span="4"
:xs="24"
>
<el-cascader
v-model="queryParams.equipIds"
:props="props"
placeholder="请选择设备"
/>
</el-form-item>
<el-form-item
label="维修人"
prop="executorId"
>
<el-input
v-model="queryParams.executorName"
@focus="handleSelectUser('query')"
placeholder="请选择维修人"
/>
</el-form-item>
<el-form-item
label="维修开始时间"
label-width="90px"
>
<el-date-picker
v-model="daterangeMaintenanceStartTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item
label="状态"
prop="status"
>
<el-select
v-model="queryParams.status"
placeholder="请选择状态"
clearable
>
<el-option
v-for="dict in dict.type.maintenance_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
<div class="head-container">
<el-input
v-model="deptName"
placeholder="请输入部门名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button>
</el-form-item>
</el-form>
<el-row
:gutter="10"
class="mb8"
>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['maintenance:record:add']"
>新增</el-button>
</div>
<div class="head-container">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="id"
default-expand-all
highlight-current
@node-click="handleNodeClick"
/>
</div>
</el-col>
<!-- <el-col :span="1.5">
<el-col
:span="20"
:xs="24"
>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
style="text-align:right"
>
<el-form-item
label="设备"
prop="equipIds"
>
<el-cascader
v-model="queryParams.equipIds"
:props="props"
placeholder="请选择设备"
/>
</el-form-item>
<el-form-item
label="维修人"
prop="executorId"
>
<el-input
v-model="queryParams.executorName"
@focus="handleSelectUser('query')"
placeholder="请选择维修人"
/>
</el-form-item>
<el-form-item
label="维修开始时间"
label-width="90px"
>
<el-date-picker
v-model="daterangeMaintenanceStartTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item
label="状态"
prop="status"
>
<el-select
v-model="queryParams.status"
placeholder="请选择状态"
clearable
>
<el-option
v-for="dict in dict.type.maintenance_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button>
</el-form-item>
</el-form>
<el-row
:gutter="10"
class="mb8"
>
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['maintenance:record:add']"
>新增</el-button>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
@ -121,123 +155,124 @@
v-hasPermi="['maintenance:record:export']"
>导出</el-button>
</el-col> -->
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="recordList"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
/>
<el-table-column
label="维修工单编号"
align="center"
prop="maintenanceOrderNum"
/>
<el-table-column
label="设备"
align="center"
prop="equipName"
/>
<el-table-column
label="维修人"
align="center"
prop="executorName"
/>
<el-table-column
label="设备组件名称"
align="center"
prop="maintenanceComponent"
/>
<el-table-column
label="维修开始时间"
align="center"
prop="maintenanceStartTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.maintenanceStartTime, '{yy}-{mm}-{dd} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column
label="状态"
align="center"
prop="status"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.maintenance_status"
:value="scope.row.status"
<el-table
v-loading="loading"
:data="recordList"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
/>
<el-table-column
label="维修工单编号"
align="center"
prop="maintenanceOrderNum"
/>
<el-table-column
label="设备"
align="center"
prop="equipName"
/>
<el-table-column
label="维修人"
align="center"
prop="executorName"
/>
<el-table-column
label="设备组件名称"
align="center"
prop="maintenanceComponent"
/>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
v-if="scope.row.status === '2'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['maintenance:record:edit']"
>修改</el-button>
<el-button
v-if="scope.row.status === '2'"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['maintenance:record:remove']"
>删除</el-button>
<el-button
v-if="scope.row.status === '2'"
size="mini"
type="text"
icon="el-icon-upload"
@click="handleSubmit(scope.row)"
v-hasPermi="['maintenance:record:submit']"
>提交</el-button>
<el-button
v-if="scope.row.status === '0'"
size="mini"
type="text"
icon="el-icon-finished"
@click="handleComplete(scope.row)"
v-hasPermi="['maintenance:record:complete']"
>完成</el-button>
<el-button
v-if="scope.row.status === '1'"
size="mini"
type="text"
icon="el-icon-tickets"
@click="handleDetails(scope.row)"
v-hasPermi="['maintenance:record:edit']"
>详情</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-table-column
label="维修开始时间"
align="center"
prop="maintenanceStartTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.maintenanceStartTime, '{yy}-{mm}-{dd} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column
label="状态"
align="center"
prop="status"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.maintenance_status"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<!-- <el-button
v-if="scope.row.status === '2'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['maintenance:record:edit']"
>修改</el-button>
<el-button
v-if="scope.row.status === '2'"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['maintenance:record:remove']"
>删除</el-button>
<el-button
v-if="scope.row.status === '2'"
size="mini"
type="text"
icon="el-icon-upload"
@click="handleSubmit(scope.row)"
v-hasPermi="['maintenance:record:submit']"
>提交</el-button>
<el-button
v-if="scope.row.status === '0'"
size="mini"
type="text"
icon="el-icon-finished"
@click="handleComplete(scope.row)"
v-hasPermi="['maintenance:record:complete']"
>完成</el-button> -->
<el-button
v-if="scope.row.status === '1'"
size="mini"
type="text"
icon="el-icon-tickets"
@click="handleDetails(scope.row)"
v-hasPermi="['maintenance:record:edit']"
>详情</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 添加或修改设备维修记录对话框 -->
<el-dialog
:title="title"
@ -947,6 +982,7 @@ import {
updateOutbound,
} from "@/api/spareparts/outbound";
import { listScrapRecord } from "@/api/scrap/record";
import { deptTreeSelect } from "@/api/system/user";
export default {
name: "Record",
dicts: ["maintenance_status"],
@ -1093,12 +1129,43 @@ export default {
pageSize: 10,
equipId: null,
},
defaultProps: {
children: "children",
label: "label",
},
//
deptOptions: undefined,
//
deptName: undefined,
};
},
watch: {
//
deptName(val) {
this.$refs.tree.filter(val);
},
},
created() {
this.getList();
this.getDeptTree();
},
methods: {
/** 查询部门下拉树结构 */
getDeptTree() {
deptTreeSelect().then((response) => {
this.deptOptions = response.data;
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.handleQuery();
},
/**报废单选择相关 */
handleSelectScrap() {
this.scrapOpen = true;
@ -1366,6 +1433,8 @@ export default {
resetQuery() {
this.daterangeMaintenanceStartTime = [];
this.queryParams.executorName = null;
this.queryParams.deptId = null;
this.$refs.tree.setCurrentKey(null);
this.resetForm("queryForm");
this.handleQuery();
},

View File

@ -1,200 +1,235 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
style="text-align:right"
>
<el-form-item
label="报废时间"
prop="scrappingTime"
<el-row :gutter="20">
<!--部门数据-->
<el-col
:span="4"
:xs="24"
>
<el-date-picker
v-model="daterange"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
/>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button>
</el-form-item>
</el-form>
<el-row
:gutter="10"
class="mb8"
>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['scrap:record:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['scrap:record:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['scrap:record:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['scrap:record:export']"
>导出</el-button>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="recordList"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
/>
<el-table-column
label="报废设备"
align="center"
prop="equipName"
/>
<el-table-column
label="报废单号"
align="center"
prop="scrappingRecordNum"
/>
<el-table-column
label="报废时间"
align="center"
prop="scrappingTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.scrappingTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column
label="报废原因"
:show-overflow-tooltip="true"
align="center"
prop="scrappingReason"
/>
<el-table-column
label="报废处理方式"
:show-overflow-tooltip="true"
align="center"
prop="scrappingTreatment"
/>
<el-table-column
label="报废记录人"
align="center"
prop="creatorName"
/>
<el-table-column
label="报废处理人"
align="center"
prop="handlerName"
/>
<el-table-column
label="报废设备照片"
align="center"
prop="equipPicPath"
width="100"
>
<template slot-scope="scope">
<image-preview
:src="scope.row.equipPicPath"
:width="50"
:height="50"
<div class="head-container">
<el-input
v-model="deptName"
placeholder="请输入部门名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</template>
</el-table-column>
<el-table-column
label="备注"
align="center"
:show-overflow-tooltip="true"
prop="remark"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
</div>
<div class="head-container">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="id"
default-expand-all
highlight-current
@node-click="handleNodeClick"
/>
</div>
</el-col>
<el-col
:span="20"
:xs="24"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['scrap:record:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['scrap:record:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
style="text-align:right"
>
<el-form-item
label="报废时间"
prop="scrappingTime"
>
<el-date-picker
v-model="daterange"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
/>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button>
</el-form-item>
</el-form>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-row
:gutter="10"
class="mb8"
>
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['scrap:record:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['scrap:record:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['scrap:record:remove']"
>删除</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['scrap:record:export']"
>导出</el-button>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="recordList"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
/>
<el-table-column
label="报废设备"
align="center"
prop="equipName"
/>
<el-table-column
label="报废单号"
align="center"
prop="scrappingRecordNum"
/>
<el-table-column
label="报废时间"
align="center"
prop="scrappingTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.scrappingTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column
label="报废原因"
:show-overflow-tooltip="true"
align="center"
prop="scrappingReason"
/>
<el-table-column
label="报废处理方式"
:show-overflow-tooltip="true"
align="center"
prop="scrappingTreatment"
/>
<el-table-column
label="报废记录人"
align="center"
prop="creatorName"
/>
<el-table-column
label="报废处理人"
align="center"
prop="handlerName"
/>
<el-table-column
label="报废设备照片"
align="center"
prop="equipPicPath"
width="100"
>
<template slot-scope="scope">
<image-preview
:src="scope.row.equipPicPath"
:width="50"
:height="50"
/>
</template>
</el-table-column>
<el-table-column
label="备注"
align="center"
:show-overflow-tooltip="true"
prop="remark"
/>
<!-- <el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['scrap:record:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['scrap:record:remove']"
>删除</el-button>
</template>
</el-table-column> -->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 添加或修改设备报废记录对话框 -->
<el-dialog
:title="title"
@ -377,6 +412,7 @@ import {
import { getInfoByParentId, getInfo } from "@/api/equip/equip";
import { listUser } from "@/api/system/user";
import _ from "lodash";
import { deptTreeSelect } from "@/api/system/user";
export default {
name: "Record",
data() {
@ -463,12 +499,43 @@ export default {
},
queryMark: null,
daterange: [],
defaultProps: {
children: "children",
label: "label",
},
//
deptOptions: undefined,
//
deptName: undefined,
};
},
watch: {
//
deptName(val) {
this.$refs.tree.filter(val);
},
},
created() {
this.getList();
this.getDeptTree();
},
methods: {
/** 查询部门下拉树结构 */
getDeptTree() {
deptTreeSelect().then((response) => {
this.deptOptions = response.data;
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.handleQuery();
},
/**用户选择相关 */
handleSelectUser(mark) {
this.queryMark = mark;
@ -564,6 +631,8 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.daterange = [];
this.queryParams.deptId = null;
this.$refs.tree.setCurrentKey(null);
// this.resetForm("queryForm");
this.handleQuery();
},

View File

@ -1,68 +1,102 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
style="text-align:right"
>
<el-form-item
label="设备"
prop="equipId"
<el-row :gutter="20">
<!--部门数据-->
<el-col
:span="4"
:xs="24"
>
<el-cascader
v-model="queryParams.equipIds"
:props="props"
placeholder="请选择设备"
/>
</el-form-item>
<el-form-item
label="执行人"
prop="maintainerId"
>
<el-input
v-model="queryParams.maintainerName"
@focus="handleSelectUser('queryMaintainer')"
placeholder="请选择执行人"
/>
</el-form-item>
<el-form-item
label="计划开始时间范围"
prop="daterange"
label-width="120px"
>
<el-date-picker
v-model="daterange"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
/>
</el-form-item>
<el-form-item
label="保养计划状态"
prop="status"
label-width="90px"
>
<el-select
v-model="queryParams.status"
placeholder="请选择保养计划状态"
clearable
>
<el-option
v-for="dict in dict.type.upkeep_plan_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
<div class="head-container">
<el-input
v-model="deptName"
placeholder="请输入部门名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</el-select>
</el-form-item>
<!-- <el-form-item
</div>
<div class="head-container">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="id"
default-expand-all
highlight-current
@node-click="handleNodeClick"
/>
</div>
</el-col>
<el-col
:span="20"
:xs="24"
>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
style="text-align:right"
>
<el-form-item
label="设备"
prop="equipId"
>
<el-cascader
v-model="queryParams.equipIds"
:props="props"
placeholder="请选择设备"
/>
</el-form-item>
<el-form-item
label="执行人"
prop="maintainerId"
>
<el-input
v-model="queryParams.maintainerName"
@focus="handleSelectUser('queryMaintainer')"
placeholder="请选择执行人"
/>
</el-form-item>
<el-form-item
label="计划开始时间范围"
prop="daterange"
label-width="120px"
>
<el-date-picker
v-model="daterange"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
/>
</el-form-item>
<el-form-item
label="保养计划状态"
prop="status"
label-width="90px"
>
<el-select
v-model="queryParams.status"
placeholder="请选择保养计划状态"
clearable
>
<el-option
v-for="dict in dict.type.upkeep_plan_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item
label="计划保养开始时间"
prop="planStartTime"
>
@ -89,7 +123,7 @@
</el-date-picker>
</el-form-item> -->
<!-- <el-form-item
<!-- <el-form-item
label="所属部门id"
prop="deptId"
>
@ -100,26 +134,26 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button>
</el-form-item>
</el-form>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button>
</el-form-item>
</el-form>
<el-row
:gutter="10"
class="mb8"
>
<el-col :span="1.5">
<el-row
:gutter="10"
class="mb8"
>
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
@ -150,8 +184,8 @@
@click="handleDelete"
v-hasPermi="['upkeep:plan:remove']"
>删除</el-button>
</el-col>
<!-- <el-col :span="1.5">
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
@ -161,104 +195,104 @@
v-hasPermi="['upkeep:plan:export']"
>导出</el-button>
</el-col> -->
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="planList"
@selection-change="handleSelectionChange"
:row-class-name="tableRowClassName"
>
<el-table-column
type="selection"
width="55"
align="center"
/>
<el-table-column
label="设备名称"
align="center"
prop="equipName"
/>
<el-table-column
label="保养计划编号"
align="center"
prop="planNum"
/>
<el-table-column
label="预期保养部件"
align="center"
prop="planComponent"
/>
<el-table-column
label="预期保养内容"
align="center"
prop="planContent"
/>
<el-table-column
label="计划保养开始时间"
align="center"
prop="planStartTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planStartTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column
label="计划完成时间"
align="center"
prop="planEndTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planEndTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column
label="保养计划制定人"
align="center"
prop="creatorName"
/>
<el-table-column
label="保养计划执行人"
align="center"
prop="maintainerName"
/>
<el-table-column
label="保养计划监管人"
align="center"
prop="supervisorName"
/>
<el-table-column
label="保养计划优先级"
align="center"
prop="planPriority"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.upkeep_priority"
:value="scope.row.planPriority"
<el-table
v-loading="loading"
:data="planList"
@selection-change="handleSelectionChange"
:row-class-name="tableRowClassName"
>
<el-table-column
type="selection"
width="55"
align="center"
/>
</template>
</el-table-column>
<el-table-column
label="保养计划状态"
align="center"
prop="status"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.upkeep_plan_status"
:value="scope.row.status"
<el-table-column
label="设备名称"
align="center"
prop="equipName"
/>
</template>
</el-table-column>
<el-table-column
label="保养计划编号"
align="center"
prop="planNum"
/>
<el-table-column
label="预期保养部件"
align="center"
prop="planComponent"
/>
<el-table-column
label="预期保养内容"
align="center"
prop="planContent"
/>
<el-table-column
label="计划保养开始时间"
align="center"
prop="planStartTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planStartTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column
label="计划完成时间"
align="center"
prop="planEndTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planEndTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column
label="保养计划制定人"
align="center"
prop="creatorName"
/>
<el-table-column
label="保养计划执行人"
align="center"
prop="maintainerName"
/>
<el-table-column
label="保养计划监管人"
align="center"
prop="supervisorName"
/>
<el-table-column
label="保养计划优先级"
align="center"
prop="planPriority"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.upkeep_priority"
:value="scope.row.planPriority"
/>
</template>
</el-table-column>
<el-table-column
label="保养计划状态"
align="center"
prop="status"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.upkeep_plan_status"
:value="scope.row.status"
/>
</template>
</el-table-column>
<!-- <el-table-column
<!-- <el-table-column
label="计划实际完成时间"
align="center"
prop="planActualTime"
@ -268,48 +302,49 @@
<span>{{ parseTime(scope.row.planActualTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column> -->
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
v-if="scope.row.status === '2' || scope.row.status === '3'"
size="mini"
type="text"
icon="el-icon-document"
@click="handleReport(scope.row)"
v-hasPermi="['upkeep:plan:edit']"
>报告</el-button>
<el-button
v-if="scope.row.status === '0'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['upkeep:plan:edit']"
>修改</el-button>
<el-button
v-if="scope.row.status === '0'"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['upkeep:plan:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- <el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
v-if="scope.row.status === '2' || scope.row.status === '3'"
size="mini"
type="text"
icon="el-icon-document"
@click="handleReport(scope.row)"
v-hasPermi="['upkeep:plan:edit']"
>报告</el-button>
<el-button
v-if="scope.row.status === '0'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['upkeep:plan:edit']"
>修改</el-button>
<el-button
v-if="scope.row.status === '0'"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['upkeep:plan:remove']"
>删除</el-button>
</template>
</el-table-column> -->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 添加或修改保养计划对话框 -->
<el-dialog
:title="title"
@ -895,6 +930,7 @@ import {
addOutbound,
updateOutbound,
} from "@/api/spareparts/outbound";
import { deptTreeSelect } from "@/api/system/user";
export default {
name: "Plan",
dicts: ["upkeep_priority", "upkeep_plan_status", "in_out_bound_status"],
@ -1044,12 +1080,43 @@ export default {
pageNum: 1,
pageSize: 10,
},
defaultProps: {
children: "children",
label: "label",
},
//
deptOptions: undefined,
//
deptName: undefined,
};
},
watch: {
//
deptName(val) {
this.$refs.tree.filter(val);
},
},
created() {
this.getList();
this.getDeptTree();
},
methods: {
/** 查询部门下拉树结构 */
getDeptTree() {
deptTreeSelect().then((response) => {
this.deptOptions = response.data;
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.handleQuery();
},
selectParts() {
this.partsOpen = false;
this.selectedPartsId = null;
@ -1282,6 +1349,8 @@ export default {
this.queryParams.maintainerName = null;
this.queryParams.params = {};
this.daterange = null;
this.queryParams.deptId = null;
this.$refs.tree.setCurrentKey(null);
this.handleQuery();
},
//

View File

@ -1,68 +1,102 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
style="text-align:right"
>
<el-form-item
label="设备"
prop="equipId"
<el-row :gutter="20">
<!--部门数据-->
<el-col
:span="4"
:xs="24"
>
<el-cascader
v-model="queryParams.equipIds"
:props="props"
placeholder="请选择设备"
/>
</el-form-item>
<el-form-item
label="执行人"
prop="maintainerId"
>
<el-input
v-model="queryParams.maintainerName"
@focus="handleSelectUser('queryMaintainer')"
placeholder="请选择执行人"
/>
</el-form-item>
<el-form-item
label="计划开始时间范围"
prop="daterange"
label-width="120px"
>
<el-date-picker
v-model="daterange"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
/>
</el-form-item>
<el-form-item
label="保养计划状态"
prop="status"
label-width="90px"
>
<el-select
v-model="queryParams.status"
placeholder="请选择保养计划状态"
clearable
>
<el-option
v-for="dict in dict.type.upkeep_plan_complete_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
<div class="head-container">
<el-input
v-model="deptName"
placeholder="请输入部门名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</el-select>
</el-form-item>
<!-- <el-form-item
</div>
<div class="head-container">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="id"
default-expand-all
highlight-current
@node-click="handleNodeClick"
/>
</div>
</el-col>
<el-col
:span="20"
:xs="24"
>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
style="text-align:right"
>
<el-form-item
label="设备"
prop="equipId"
>
<el-cascader
v-model="queryParams.equipIds"
:props="props"
placeholder="请选择设备"
/>
</el-form-item>
<el-form-item
label="执行人"
prop="maintainerId"
>
<el-input
v-model="queryParams.maintainerName"
@focus="handleSelectUser('queryMaintainer')"
placeholder="请选择执行人"
/>
</el-form-item>
<el-form-item
label="计划开始时间范围"
prop="daterange"
label-width="120px"
>
<el-date-picker
v-model="daterange"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
/>
</el-form-item>
<el-form-item
label="保养计划状态"
prop="status"
label-width="90px"
>
<el-select
v-model="queryParams.status"
placeholder="请选择保养计划状态"
clearable
>
<el-option
v-for="dict in dict.type.upkeep_plan_complete_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item
label="计划保养开始时间"
prop="planStartTime"
>
@ -89,7 +123,7 @@
</el-date-picker>
</el-form-item> -->
<!-- <el-form-item
<!-- <el-form-item
label="所属部门id"
prop="deptId"
>
@ -100,113 +134,113 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button>
</el-form-item>
</el-form>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="recordList"
@selection-change="handleSelectionChange"
:row-class-name="tableRowClassName"
>
<el-table-column
type="selection"
width="55"
align="center"
/>
<el-table-column
label="设备名称"
align="center"
prop="equipName"
/>
<el-table-column
label="保养计划编号"
align="center"
prop="planNum"
/>
<el-table-column
label="预期保养部件"
align="center"
prop="planComponent"
/>
<el-table-column
label="预期保养内容"
align="center"
prop="planContent"
/>
<el-table-column
label="计划保养开始时间"
align="center"
prop="planStartTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planStartTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column
label="计划完成时间"
align="center"
prop="planEndTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planEndTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column
label="保养计划制定人"
align="center"
prop="creatorName"
/>
<el-table-column
label="保养计划执行人"
align="center"
prop="maintainerName"
/>
<el-table-column
label="保养计划监管人"
align="center"
prop="supervisorName"
/>
<el-table-column
label="保养计划优先级"
align="center"
prop="planPriority"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.upkeep_priority"
:value="scope.row.planPriority"
<el-table
v-loading="loading"
:data="recordList"
@selection-change="handleSelectionChange"
:row-class-name="tableRowClassName"
>
<el-table-column
type="selection"
width="55"
align="center"
/>
</template>
</el-table-column>
<el-table-column
label="保养计划状态"
align="center"
prop="status"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.upkeep_plan_complete_status"
:value="scope.row.status"
<el-table-column
label="设备名称"
align="center"
prop="equipName"
/>
</template>
</el-table-column>
<el-table-column
label="保养计划编号"
align="center"
prop="planNum"
/>
<el-table-column
label="预期保养部件"
align="center"
prop="planComponent"
/>
<el-table-column
label="预期保养内容"
align="center"
prop="planContent"
/>
<el-table-column
label="计划保养开始时间"
align="center"
prop="planStartTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planStartTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column
label="计划完成时间"
align="center"
prop="planEndTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planEndTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column
label="保养计划制定人"
align="center"
prop="creatorName"
/>
<el-table-column
label="保养计划执行人"
align="center"
prop="maintainerName"
/>
<el-table-column
label="保养计划监管人"
align="center"
prop="supervisorName"
/>
<el-table-column
label="保养计划优先级"
align="center"
prop="planPriority"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.upkeep_priority"
:value="scope.row.planPriority"
/>
</template>
</el-table-column>
<el-table-column
label="保养计划状态"
align="center"
prop="status"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.upkeep_plan_complete_status"
:value="scope.row.status"
/>
</template>
</el-table-column>
<!-- <el-table-column
<!-- <el-table-column
label="计划实际完成时间"
align="center"
prop="planActualTime"
@ -216,19 +250,19 @@
<span>{{ parseTime(scope.row.planActualTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column> -->
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-document"
@click="handleReport(scope.row)"
>详情</el-button>
<!-- <el-button
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-document"
@click="handleReport(scope.row)"
>详情</el-button>
<!-- <el-button
v-if="scope.row.status === '0'"
size="mini"
type="text"
@ -244,18 +278,19 @@
@click="handleDelete(scope.row)"
v-hasPermi="['upkeep:plan:remove']"
>删除</el-button> -->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 用户选择弹出框 -->
<el-dialog
:title="userTitle"
@ -326,7 +361,7 @@
<el-dialog
:title="reportTitle"
:visible.sync="reportOpen"
width="500px"
width="700px"
append-to-body
>
<el-form
@ -383,7 +418,10 @@
<span class="showdata">{{ this.upkeepPlanData.planContent }}</span>
</el-form-item>
</el-col>
<el-col :span="14">
<el-col
v-if="this.upkeepReportData.sparePartsOutboundId"
:span="12"
>
<el-form-item
label="备件出库单号"
prop="sparePartsOutboundId"
@ -391,7 +429,10 @@
<span class="showdata">{{ this.upkeepReportData.sparePartsOutboundNum }}</span>
</el-form-item>
</el-col>
<el-col :span="10">
<el-col
v-if="this.upkeepReportData.sparePartsOutboundId"
:span="12"
>
<el-form-item
label="使用备件名"
prop="sparePartsOutboundId"
@ -399,7 +440,10 @@
<span class="showdata">{{ this.upkeepReportData.sparePartsName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col
v-if="this.upkeepReportData.sparePartsOutboundId"
:span="12"
>
<el-form-item
label="使用备件数量"
prop="outboundQuantity"
@ -474,6 +518,7 @@ import {
updateReport,
} from "@/api/upkeep/report";
import _ from "lodash";
import { deptTreeSelect } from "@/api/system/user";
export default {
name: "Plan",
dicts: ["upkeep_priority", "upkeep_plan_complete_status"],
@ -612,12 +657,43 @@ export default {
reportContent: null,
},
baseUrl: process.env.VUE_APP_BASE_API,
defaultProps: {
children: "children",
label: "label",
},
//
deptOptions: undefined,
//
deptName: undefined,
};
},
watch: {
//
deptName(val) {
this.$refs.tree.filter(val);
},
},
created() {
this.getList();
this.getDeptTree();
},
methods: {
/** 查询部门下拉树结构 */
getDeptTree() {
deptTreeSelect().then((response) => {
this.deptOptions = response.data;
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.handleQuery();
},
tableRowClassName({ row, rowIndex }) {
if (row.status === "4") {
return "warning-row";
@ -770,8 +846,10 @@ export default {
this.resetForm("queryForm");
this.queryParams.equipIds = null;
this.queryParams.maintainerName = null;
this.queryParams.deptId = null;
this.queryParams.params = {};
this.daterange = null;
this.$refs.tree.setCurrentKey(null);
this.handleQuery();
},
//