|
@@ -0,0 +1,177 @@
|
|
|
+<template>
|
|
|
+ <el-drawer
|
|
|
+ title="告警整改"
|
|
|
+ :modal-append-to-body="false"
|
|
|
+ :modal="false"
|
|
|
+ :wrapper-closable="false"
|
|
|
+ size="100%"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ >
|
|
|
+ <div slot="title" class="alertRectify-title">告警整改</div>
|
|
|
+ <div class="alertRectify-wrap">
|
|
|
+ <div v-if="type===1" class="alertRectify-form">
|
|
|
+ <el-form ref="ruleForm" :model="formData" :rules="rules" label-position="right" label-width="120px">
|
|
|
+ <div class="flex">
|
|
|
+ <el-form-item label="已完成" prop="goafSensorAlarmFinishNum">
|
|
|
+ <el-input v-model.number="formData.goafSensorAlarmFinishNum" autocomplete="off" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="未完成" prop="goafSensorAlarmEndNum">
|
|
|
+ <el-input v-model.number="formData.goafSensorAlarmEndNum" autocomplete="off" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <el-form-item label="告警整改情况">
|
|
|
+ <el-input v-model="formData.goafSensorAlarmReportContent" type="textarea" :rows="7" style="width: 75%;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div class="btn-group">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button class="cancel-btn" @click="dialogVisible = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="type===2" class="alertRectifyHand-detail">
|
|
|
+ <div class="head">
|
|
|
+ <div class="state-item">
|
|
|
+ <span class="lable">已完成:</span>
|
|
|
+ <span class="number">{{ formData.goafSensorAlarmFinishNum }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="state-item rt">
|
|
|
+ <span class="lable">未完成:</span>
|
|
|
+ <span class="number">{{ formData.goafSensorAlarmEndNum }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="cont">
|
|
|
+ <span class="lable">告警整改情况:</span>
|
|
|
+ <div class="info">{{ formData.goafSensorAlarmReportContent }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { updateAlertRectify } from '@/api/goaf/alarm'
|
|
|
+export default {
|
|
|
+ name: 'AlertRectifyHand',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ dialogVisible: false,
|
|
|
+ tableData: [],
|
|
|
+ groupList: [],
|
|
|
+ userList: [],
|
|
|
+ type: undefined,
|
|
|
+ formData: {
|
|
|
+ 'goafSensorAlarmEndNum': 0,
|
|
|
+ 'goafSensorAlarmFinishNum': 0,
|
|
|
+ 'goafSensorAlarmReportContent': null,
|
|
|
+ 'goafSensorAlarmReportId': undefined
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ goafSensorAlarmEndNum: [
|
|
|
+ { required: true, message: '请填写未完成数量', trigger: 'blur' },
|
|
|
+ { type: 'number', message: '未完成数量必须为数字值' }
|
|
|
+ ],
|
|
|
+ goafSensorAlarmFinishNum: [
|
|
|
+ { required: true, message: '请填写已完成数量', trigger: 'blur' },
|
|
|
+ { type: 'number', message: '已完成数量必须为数字值' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ dangerStatus(val) {
|
|
|
+ const status = ['待提交', '待评审', '待整改', '待验收', '完成']
|
|
|
+ return val === -1 ? '撤销' : status[val]
|
|
|
+ },
|
|
|
+ AlarmLevel(val) {
|
|
|
+ const obj = { 0: '一般', 1: '重大' }
|
|
|
+ return obj[val] || '--'
|
|
|
+ },
|
|
|
+ loadData(data, type) {
|
|
|
+ this.formData = {
|
|
|
+ 'goafSensorAlarmEndNum': data.goafSensorAlarmEndNum,
|
|
|
+ 'goafSensorAlarmFinishNum': data.goafSensorAlarmFinishNum,
|
|
|
+ 'goafSensorAlarmReportContent': data.goafSensorAlarmReportContent,
|
|
|
+ 'goafSensorAlarmReportId': data.goafSensorAlarmReportId
|
|
|
+ }
|
|
|
+ this.type = type
|
|
|
+ this.dialogVisible = true
|
|
|
+ },
|
|
|
+ submitForm() {
|
|
|
+ this.$refs['ruleForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ updateAlertRectify(this.formData).then((res) => {
|
|
|
+ this.$message.success('编辑成功!')
|
|
|
+ this.$emit('success')
|
|
|
+ this.dialogVisible = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+ <style lang="scss" scoped>
|
|
|
+ .alertRectify-title{
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .alertRectify-form{
|
|
|
+ max-width: 1000px;
|
|
|
+ margin: 0 auto;
|
|
|
+ box-shadow: 2px 4px 8px rgba(48, 99 ,121,0.6);
|
|
|
+ border-radius: 10px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ margin-top: 30px;
|
|
|
+ .flex{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ }
|
|
|
+ .btn-group{
|
|
|
+ padding-top: 30px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .alertRectifyHand-detail{
|
|
|
+ max-width: 800px;
|
|
|
+ padding: 15px 30px;
|
|
|
+ margin: 0 auto;
|
|
|
+ box-shadow: 2px 4px 8px rgba(48, 99 ,121,0.6);
|
|
|
+ border-radius: 10px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ .head{
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 10px 0;
|
|
|
+ .state-item{
|
|
|
+ color: #fff;
|
|
|
+ width: 50%;
|
|
|
+ .lable{
|
|
|
+ width: 120px;
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ .number{
|
|
|
+ font-weight: 600;
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ .rt{
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .cont{
|
|
|
+ color: #fff;
|
|
|
+ display: flex;
|
|
|
+ padding-top: 10px;
|
|
|
+ .lable{
|
|
|
+ width: 120px;
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ .info{
|
|
|
+ display: inline-block;
|
|
|
+ min-height: 150px;
|
|
|
+ flex: 1;
|
|
|
+ line-height: 1.5;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+
|