|
|
@@ -1,6 +1,12 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <el-tabs v-model="activeTab" class="compact-tabs">
|
|
|
+ <el-tab-pane label="维修记录" name="record" />
|
|
|
+ <el-tab-pane label="维修备忘录" name="memo" />
|
|
|
+ </el-tabs>
|
|
|
+
|
|
|
+ <div v-show="activeTab === 'record'">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="recordShowSearch" label-width="68px">
|
|
|
<el-form-item label="装置" prop="plant">
|
|
|
<el-input
|
|
|
v-model="queryParams.plant"
|
|
|
@@ -46,10 +52,6 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="维修状态" prop="recordStatus">
|
|
|
<el-select v-model="queryParams.recordStatus" placeholder="请选择维修状态" clearable size="small">
|
|
|
- <el-option label="计划中" value="9" />
|
|
|
- <el-option label="删除申请中" value="-1" />
|
|
|
- <el-option label="新增申请中" value="0" />
|
|
|
- <el-option label="待完成" value="1" />
|
|
|
<el-option label="已完成" value="2" />
|
|
|
<el-option label="已延期" value="3" />
|
|
|
</el-select>
|
|
|
@@ -63,9 +65,10 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
+ <el-row :gutter="10" class="mb8 compact-row">
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
+ class="compact-button"
|
|
|
type="success"
|
|
|
icon="el-icon-edit"
|
|
|
size="mini"
|
|
|
@@ -76,6 +79,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
+ class="compact-button"
|
|
|
type="danger"
|
|
|
icon="el-icon-delete"
|
|
|
size="mini"
|
|
|
@@ -86,6 +90,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
+ class="compact-button"
|
|
|
type="warning"
|
|
|
icon="el-icon-download"
|
|
|
size="mini"
|
|
|
@@ -93,15 +98,7 @@
|
|
|
v-hasPermi="['reliability:rel_maint_record:list']"
|
|
|
>导出</el-button>
|
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="info"
|
|
|
- icon="el-icon-document"
|
|
|
- size="mini"
|
|
|
- @click="handleViewMemoList"
|
|
|
- >查看维修备忘录</el-button>
|
|
|
- </el-col>
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ <right-toolbar :showSearch.sync="recordShowSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
<el-table v-loading="loading" :data="rel_maint_recordList" @selection-change="handleSelectionChange" :height="clientHeight" border>
|
|
|
@@ -159,6 +156,19 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
+ <el-table-column label="测厚记录" align="center" width="110">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.thicknessList && scope.row.thicknessList.length"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-view"
|
|
|
+ @click="handleViewThickness(scope.row)">
|
|
|
+ 查看({{ scope.row.thicknessList.length }})
|
|
|
+ </el-button>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
<el-table-column label="维修部门" align="center" prop="maintDept" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column label="维修内容" align="center" prop="maintContent" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column label="维修结果" align="center" prop="maintResult" :show-overflow-tooltip="true"/>
|
|
|
@@ -200,6 +210,7 @@
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
+ class="compact-link"
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
@@ -207,6 +218,7 @@
|
|
|
>修改</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
+ class="compact-link"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
@@ -224,6 +236,139 @@
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-show="activeTab === 'memo'">
|
|
|
+ <el-form :model="memoQueryParams" ref="memoQueryForm" :inline="true" v-show="memoShowSearch" label-width="68px">
|
|
|
+ <el-form-item label="装置" prop="plant">
|
|
|
+ <el-input
|
|
|
+ v-model="memoQueryParams.plant"
|
|
|
+ placeholder="请输入装置"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleMemoQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备名称" prop="devName">
|
|
|
+ <el-input
|
|
|
+ v-model="memoQueryParams.devName"
|
|
|
+ placeholder="请输入设备名称"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleMemoQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备位号" prop="devTag">
|
|
|
+ <el-input
|
|
|
+ v-model="memoQueryParams.devTag"
|
|
|
+ placeholder="请输入设备位号"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleMemoQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="部件名称" prop="compoName">
|
|
|
+ <el-input
|
|
|
+ v-model="memoQueryParams.compoName"
|
|
|
+ placeholder="请输入部件名称"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleMemoQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="维修类型" prop="maintType">
|
|
|
+ <el-select v-model="memoQueryParams.maintType" placeholder="请选择维修类型" clearable size="small">
|
|
|
+ <el-option label="检查" value="1" />
|
|
|
+ <el-option label="维修" value="2" />
|
|
|
+ <el-option label="更换" value="3" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="维修责任人" prop="responsible">
|
|
|
+ <el-input
|
|
|
+ v-model="memoQueryParams.responsible"
|
|
|
+ placeholder="请输入维修责任人"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleMemoQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleMemoQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetMemoQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8 compact-row">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ class="compact-button"
|
|
|
+ type="danger"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ size="mini"
|
|
|
+ :disabled="memoMultiple"
|
|
|
+ @click="handleMemoDelete"
|
|
|
+ v-hasPermi="['reliability:rel_maint_record:remove']"
|
|
|
+ >删除</el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="memoShowSearch" @queryTable="getMemoList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table v-loading="memoLoading" :data="rel_maint_memoList" @selection-change="handleMemoSelectionChange" :height="clientHeight" border>
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="装置" align="center" prop="plant" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="设备名称" align="center" prop="devName" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="设备位号" align="center" prop="devTag" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="部件名称" align="center" prop="compoName" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="维修类型" align="center" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.maintType === '1'">检查</span>
|
|
|
+ <span v-else-if="scope.row.maintType === '2'">维修</span>
|
|
|
+ <span v-else-if="scope.row.maintType === '3'">更换</span>
|
|
|
+ <span v-else>{{ scope.row.maintType || '-' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="维修责任人" align="center" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ getStaffNameById(scope.row.responsible) || '-' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="维修内容" align="center" prop="maintContent" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="备忘原因" align="center" prop="memoReason" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="备忘时间" align="center" prop="memoTime" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.memoTime, '{y}-{m}-{d}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-view"
|
|
|
+ @click="handleViewMemo(scope.row)">
|
|
|
+ 查看
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleMemoDelete(scope.row)"
|
|
|
+ v-hasPermi="['reliability:rel_maint_record:remove']"
|
|
|
+ >删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="memoTotal>0"
|
|
|
+ :total="memoTotal"
|
|
|
+ :page.sync="memoQueryParams.pageNum"
|
|
|
+ :limit.sync="memoQueryParams.pageSize"
|
|
|
+ @pagination="getMemoList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+
|
|
|
<!-- 添加或修改部件维修记录对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
@@ -379,6 +524,24 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <el-dialog title="测厚记录" :visible.sync="thicknessDialogVisible" width="650px" append-to-body>
|
|
|
+ <el-table :data="thicknessViewList" border size="small">
|
|
|
+ <el-table-column label="序号" type="index" width="60" align="center" />
|
|
|
+ <el-table-column label="测厚点" prop="thicknessPt" width="180" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column label="测厚日期" width="140" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.thicknessDate, '{y}-{m}-{d}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="测厚数据" prop="thicknessData" width="120" align="center" />
|
|
|
+ <el-table-column label="备注" prop="remarks" :show-overflow-tooltip="true" />
|
|
|
+ </el-table>
|
|
|
+ <div v-if="thicknessViewList.length === 0" style="text-align: center; color: #999; padding: 20px;">暂无测厚记录</div>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="thicknessDialogVisible = false">关 闭</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!-- 照片预览对话框 -->
|
|
|
<el-dialog title="照片预览" :visible.sync="photoPreviewVisible" width="800px" append-to-body>
|
|
|
<div class="photo-preview-container">
|
|
|
@@ -449,7 +612,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { listRel_maint_record, getRel_maint_record, delRel_maint_record, addRel_maint_record, updateRel_maint_record, exportRel_maint_record, importTemplate} from "@/api/reliability/rel_maint_record";
|
|
|
-import { getRel_maint_memo } from "@/api/reliability/rel_maint_memo";
|
|
|
+import { listRel_maint_memo, delRel_maint_memo } from "@/api/reliability/rel_maint_memo";
|
|
|
import { treeselect } from "@/api/system/dept";
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
import { listStaffmgrAll } from "@/api/plant/staffmgr";
|
|
|
@@ -464,6 +627,7 @@ export default {
|
|
|
// components: { Editor },
|
|
|
data() {
|
|
|
return {
|
|
|
+ activeTab: 'record',
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
// 选中数组
|
|
|
@@ -473,11 +637,19 @@ export default {
|
|
|
// 非多个禁用
|
|
|
multiple: true,
|
|
|
// 显示搜索条件
|
|
|
- showSearch: false,
|
|
|
+ recordShowSearch: false,
|
|
|
+ memoShowSearch: false,
|
|
|
// 总条数
|
|
|
total: 0,
|
|
|
// 部件维修记录表格数据
|
|
|
rel_maint_recordList: [],
|
|
|
+
|
|
|
+ // 维修备忘录tab
|
|
|
+ memoLoading: false,
|
|
|
+ memoTotal: 0,
|
|
|
+ rel_maint_memoList: [],
|
|
|
+ memoIds: [],
|
|
|
+ memoMultiple: true,
|
|
|
// 弹出层标题
|
|
|
title: "",
|
|
|
// 部门树选项
|
|
|
@@ -528,7 +700,20 @@ export default {
|
|
|
updatedate: null,
|
|
|
deptId: null,
|
|
|
remarks: null,
|
|
|
- recordStatus: null
|
|
|
+ recordStatus: null,
|
|
|
+ // 仅查询已完成/已延期(由后端 SQL 处理)
|
|
|
+ recordStatusCompleted: true
|
|
|
+ },
|
|
|
+
|
|
|
+ memoQueryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ plant: null,
|
|
|
+ devName: null,
|
|
|
+ devTag: null,
|
|
|
+ compoName: null,
|
|
|
+ maintType: null,
|
|
|
+ responsible: null
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
@@ -541,6 +726,8 @@ export default {
|
|
|
// 维修计划详情对话框
|
|
|
planDetailVisible: false,
|
|
|
planDetailId: null,
|
|
|
+ thicknessDialogVisible: false,
|
|
|
+ thicknessViewList: [],
|
|
|
// 照片预览对话框
|
|
|
photoPreviewVisible: false,
|
|
|
previewPhotoList: [],
|
|
|
@@ -556,6 +743,12 @@ export default {
|
|
|
deptName(val) {
|
|
|
this.$refs.tree.filter(val);
|
|
|
}
|
|
|
+ ,
|
|
|
+ activeTab(val) {
|
|
|
+ if (val === 'memo' && this.rel_maint_memoList.length === 0) {
|
|
|
+ this.getMemoList();
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
//设置表格高度对应屏幕高度
|
|
|
@@ -576,6 +769,18 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ /** 查询维修备忘录列表 */
|
|
|
+ getMemoList() {
|
|
|
+ this.memoLoading = true;
|
|
|
+ listRel_maint_memo(this.memoQueryParams).then(response => {
|
|
|
+ this.rel_maint_memoList = response.rows;
|
|
|
+ this.memoTotal = response.total;
|
|
|
+ this.memoLoading = false;
|
|
|
+ }).catch(() => {
|
|
|
+ this.memoLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
/** 查询部门下拉树结构 */
|
|
|
getTreeselect() {
|
|
|
treeselect().then(response => {
|
|
|
@@ -662,6 +867,11 @@ export default {
|
|
|
this.viewAttachmentList = this.parseFileList(attachments, 'file');
|
|
|
this.attachmentDialogVisible = true;
|
|
|
},
|
|
|
+
|
|
|
+ handleViewThickness(row) {
|
|
|
+ this.thicknessViewList = (row && row.thicknessList) ? row.thicknessList : [];
|
|
|
+ this.thicknessDialogVisible = true;
|
|
|
+ },
|
|
|
/** 下载附件 */
|
|
|
downloadAttachment(file) {
|
|
|
if (file.url) {
|
|
|
@@ -722,12 +932,30 @@ export default {
|
|
|
this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
+
|
|
|
+ /** 备忘录tab - 搜索按钮操作 */
|
|
|
+ handleMemoQuery() {
|
|
|
+ this.memoQueryParams.pageNum = 1;
|
|
|
+ this.getMemoList();
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 备忘录tab - 重置按钮操作 */
|
|
|
+ resetMemoQuery() {
|
|
|
+ this.resetForm("memoQueryForm");
|
|
|
+ this.handleMemoQuery();
|
|
|
+ },
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
this.ids = selection.map(item => item.recordId)
|
|
|
this.single = selection.length!==1
|
|
|
this.multiple = !selection.length
|
|
|
},
|
|
|
+
|
|
|
+ // 备忘录tab - 多选框选中数据
|
|
|
+ handleMemoSelectionChange(selection) {
|
|
|
+ this.memoIds = selection.map(item => item.memoId)
|
|
|
+ this.memoMultiple = !selection.length
|
|
|
+ },
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
this.reset();
|
|
|
@@ -791,9 +1019,20 @@ export default {
|
|
|
this.download(response.msg);
|
|
|
})
|
|
|
},
|
|
|
- /** 查看维修备忘录列表页面 */
|
|
|
- handleViewMemoList() {
|
|
|
- this.$router.push({ path: '/reliability/rel_maint_memo' });
|
|
|
+
|
|
|
+ /** 备忘录tab - 删除按钮操作 */
|
|
|
+ handleMemoDelete(row) {
|
|
|
+ const memoIds = row && row.memoId ? row.memoId : this.memoIds;
|
|
|
+ this.$confirm('是否确认删除?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ return delRel_maint_memo(memoIds);
|
|
|
+ }).then(() => {
|
|
|
+ this.getMemoList();
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
+ })
|
|
|
},
|
|
|
/** 导入按钮操作 */
|
|
|
handleImport() {
|
|
|
@@ -827,6 +1066,37 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+.app-container {
|
|
|
+ /* 仅当前页面收紧顶部留白 */
|
|
|
+ padding-top: 8px;
|
|
|
+}
|
|
|
+
|
|
|
+/* 适度压缩标签与内容的上下间距 */
|
|
|
+.compact-tabs {
|
|
|
+ margin-bottom: 4px;
|
|
|
+}
|
|
|
+
|
|
|
+/* 覆盖 el-tabs 默认 header 间距 */
|
|
|
+.compact-tabs >>> .el-tabs__header {
|
|
|
+ margin-bottom: 4px;
|
|
|
+}
|
|
|
+
|
|
|
+.compact-row {
|
|
|
+ margin-bottom: 4px;
|
|
|
+}
|
|
|
+
|
|
|
+.compact-button {
|
|
|
+ /* 仅用于减少上下留白时的外边距,不改变默认按钮尺寸 */
|
|
|
+ margin-top: 0;
|
|
|
+ margin-bottom: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.compact-link {
|
|
|
+ /* 保持链接按钮尺寸,压缩上下空隙 */
|
|
|
+ margin-top: 0;
|
|
|
+ margin-bottom: 0;
|
|
|
+}
|
|
|
+
|
|
|
/* 照片预览容器样式 */
|
|
|
.photo-preview-container {
|
|
|
display: flex;
|