|
|
@@ -96,7 +96,7 @@
|
|
|
type="info"
|
|
|
icon="el-icon-document"
|
|
|
size="mini"
|
|
|
- @click="handleViewMemo"
|
|
|
+ @click="handleViewMemoList"
|
|
|
>查看维修备忘录</el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
@@ -121,9 +121,19 @@
|
|
|
<span>{{ getStaffNameById(scope.row.responsible) || '-' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="维修状态" align="center" width="120">
|
|
|
+ <el-table-column label="维修状态" align="center" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ getRecordStatusText(scope.row.recordStatus) }}</span>
|
|
|
+ <el-tag :type="getRecordStatusTagType(scope.row.recordStatus)" size="small">
|
|
|
+ {{ getRecordStatusText(scope.row.recordStatus) }}
|
|
|
+ </el-tag>
|
|
|
+ <el-tag
|
|
|
+ v-if="scope.row.memo"
|
|
|
+ type="warning"
|
|
|
+ size="small"
|
|
|
+ style="margin-left: 5px; cursor: pointer;"
|
|
|
+ @click.native.stop="handleViewMemo(scope.row.memo)">
|
|
|
+ 备忘录
|
|
|
+ </el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="检查内容" align="center" prop="inspectContent" :show-overflow-tooltip="true"/>
|
|
|
@@ -293,7 +303,35 @@
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 查看备忘录详情对话框 -->
|
|
|
+ <el-dialog title="备忘录详情" :visible.sync="memoDialogVisible" width="700px" append-to-body>
|
|
|
+ <el-descriptions :column="2" border v-if="memoDetail">
|
|
|
+ <el-descriptions-item label="装置">{{ memoDetail.plant || '-' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="设备名称">{{ memoDetail.devName || '-' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="设备位号">{{ memoDetail.devTag || '-' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="部件名称">{{ memoDetail.compoName || '-' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="维修类型">
|
|
|
+ <span v-if="memoDetail.maintType === '1'">检查</span>
|
|
|
+ <span v-else-if="memoDetail.maintType === '2'">维修</span>
|
|
|
+ <span v-else-if="memoDetail.maintType === '3'">更换</span>
|
|
|
+ <span v-else>{{ memoDetail.maintType || '-' }}</span>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="维修责任人">{{ getStaffNameById(memoDetail.responsible) || '-' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="维修内容" :span="2">{{ memoDetail.maintContent || '-' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="备忘原因" :span="2">{{ memoDetail.memoReason || '-' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="备忘时间">
|
|
|
+ <span v-if="memoDetail.memoTime">{{ parseTime(memoDetail.memoTime, '{y}-{m}-{d}') }}</span>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="备注" :span="2">{{ memoDetail.remarks || '-' }}</el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="memoDialogVisible = false">关 闭</el-button>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
<!-- 用户导入对话框 -->
|
|
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
<el-upload
|
|
|
@@ -329,6 +367,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 { treeselect } from "@/api/system/dept";
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
import { listStaffmgrAll } from "@/api/plant/staffmgr";
|
|
|
@@ -413,6 +452,9 @@ export default {
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
},
|
|
|
+ // 备忘录对话框
|
|
|
+ memoDialogVisible: false,
|
|
|
+ memoDetail: null,
|
|
|
// 所有人员选项
|
|
|
staffOptions: []
|
|
|
};
|
|
|
@@ -470,6 +512,27 @@ export default {
|
|
|
if (status === 2 || status === '2') return '已完成';
|
|
|
return status != null ? status : '-';
|
|
|
},
|
|
|
+ /** 获取维修状态标签类型 */
|
|
|
+ getRecordStatusTagType(status) {
|
|
|
+ if (status === -1 || status === '-1') return 'danger';
|
|
|
+ if (status === 0 || status === '0') return 'warning';
|
|
|
+ if (status === 1 || status === '1') return 'info';
|
|
|
+ if (status === 2 || status === '2') return 'success';
|
|
|
+ return '';
|
|
|
+ },
|
|
|
+ /** 查看备忘录 */
|
|
|
+ handleViewMemo(memo) {
|
|
|
+ if (memo && memo.memoId) {
|
|
|
+ // 如果memo对象已经有完整信息,直接显示
|
|
|
+ this.memoDetail = memo;
|
|
|
+ this.memoDialogVisible = true;
|
|
|
+ } else if (memo && memo.recordId) {
|
|
|
+ // 如果只有recordId,需要通过recordId查询备忘录
|
|
|
+ // 这里可以根据需要调用API查询
|
|
|
+ this.memoDetail = memo;
|
|
|
+ this.memoDialogVisible = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
|
@@ -587,8 +650,8 @@ export default {
|
|
|
this.download(response.msg);
|
|
|
})
|
|
|
},
|
|
|
- /** 查看维修备忘录 */
|
|
|
- handleViewMemo() {
|
|
|
+ /** 查看维修备忘录列表页面 */
|
|
|
+ handleViewMemoList() {
|
|
|
this.$router.push({ path: '/reliability/rel_maint_memo' });
|
|
|
},
|
|
|
/** 导入按钮操作 */
|