Parcourir la source

告警消息模块提交

LAPTOP-16IUEB3P\Lenovo il y a 3 ans
Parent
commit
3e355404e1

+ 6 - 1
package-lock.json

@@ -1,5 +1,5 @@
 {
-  "name": "ele-admin-template",
+  "name": "page-eam",
   "version": "1.11.2",
   "lockfileVersion": 1,
   "requires": true,
@@ -8025,6 +8025,11 @@
         "renderkid": "^3.0.0"
       }
     },
+    "print-js": {
+      "version": "1.6.0",
+      "resolved": "https://registry.npmjs.org/print-js/-/print-js-1.6.0.tgz",
+      "integrity": "sha512-BfnOIzSKbqGRtO4o0rnj/K3681BSd2QUrsIZy/+WdCIugjIswjmx3lDEZpXB2ruGf9d4b3YNINri81+J0FsBWg=="
+    },
     "process-nextick-args": {
       "version": "2.0.1",
       "resolved": "https://registry.npmmirror.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz",

+ 2 - 1
package.json

@@ -28,6 +28,7 @@
     "jsbarcode": "^3.11.5",
     "json-bigint": "^1.0.0",
     "nprogress": "^0.2.0",
+    "print-js": "^1.6.0",
     "tinymce": "^5.10.5",
     "vue": "^2.7.10",
     "vue-clipboard2": "^0.3.3",
@@ -62,4 +63,4 @@
     "vue-template-compiler": "^2.7.10",
     "webpack": "^5.74.0"
   }
-}
+}

+ 4 - 1
src/enum/dict.js

@@ -14,5 +14,8 @@ export default {
   规则周期: 'rule_cycle',
   运维计划状态: 'plan_status',
   紧急程度: 'urgent_type',
-  委外单状态: 'extrinsic_state'
+  委外单状态: 'extrinsic_state',
+  告警级别: 'warning_level',
+  告警方式: 'warning_style',
+  告警触发条件: 'warning_conditions'
 };

+ 451 - 0
src/views/maintenance/repair/outsourcingOrder/components/AppointDetailsDialog.vue

@@ -0,0 +1,451 @@
+<template>
+  <!-- 维修工单弹框 -->
+  <el-dialog
+    :title="dialogTitle"
+    :visible.sync="equipmentdialog"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    width="60%"
+  >
+    <el-tabs v-model="detailsTabsActiveName" type="border-card">
+      <el-tab-pane label="工单信息" name="keepInRepair">
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>工单编号:</span>
+            <span>{{ workOrderInfo ? workOrderInfo.outsourcCode : '' }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>发布时间:</span>
+            <span>{{ workOrderInfo ? workOrderInfo.createTime : '' }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>委外单位:</span>
+            <span>{{ workOrderInfo ? workOrderInfo.outsourcUnit : '' }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>发布人:</span>
+            <span>{{ workOrderInfo ? workOrderInfo.createBy : '' }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>计划完成时间:</span>
+            <span>{{
+              workOrderInfo ? workOrderInfo.plannCompletionTime : ''
+            }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>实际完成时间:</span>
+            <el-date-picker
+              v-if="row.isshow"
+              v-model="checkTime"
+              type="datetime"
+              style="width: 50%"
+              placeholder="选择日期时间"
+              size="small"
+              value-format="yyyy-MM-dd HH:mm:ss"
+            >
+            </el-date-picker>
+            <span v-else>{{
+              workOrderInfo ? workOrderInfo.checkTime : ''
+            }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>状态:</span>
+            <span>{{ statusObj[workOrderInfo.status] }}</span>
+          </el-col>
+        </el-row>
+        <el-row
+          class="repair_row"
+          v-if="!row.isshow && workOrderInfo.status != 2"
+        >
+          <el-col :span="24" class="repair_column">
+            <span>驳回说明:</span>
+            <span>{{ workOrderInfo ? workOrderInfo.rejectReason : '' }}</span>
+          </el-col>
+        </el-row>
+<!--        <el-row class="repair_row">
+          <el-col :span="24" class="repair_column">
+            <span>图片:</span>
+            <div class="upload-img" v-if="row.isshow">
+              <UploadImg
+                @getImgs="cbUploadImg"
+                :assetName="`工单`"
+                ref="UploadImg"
+              />
+            </div>
+            <el-image
+              v-for="(item, index) in workOrderInfo.repairsImg"
+              :key="index"
+              style="width: 100px; height: 100px; margin-right: 5px"
+              :src="item.url"
+              :preview-src-list="[item.url]"
+            />
+          </el-col>
+        </el-row> -->
+      </el-tab-pane>
+      <el-tab-pane label="设备信息" name="equipment">
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>设备编码:</span>
+            <span>{{ equipmentInfo ? equipmentInfo.assetCode : '' }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>权属部门:</span>
+            <span>{{
+              equipmentInfo ? equipmentInfo.ownershipDeptName : ''
+            }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>设备名称:</span>
+            <span>{{ equipmentInfo ? equipmentInfo.assetName : '' }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>权属人:</span>
+            <span>{{
+              equipmentInfo ? equipmentInfo.ownershipUserName : ''
+            }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>设备分类:</span>
+            <span>{{
+              equipmentInfo.assetType
+                ? assetTypeList[equipmentInfo.assetType - 1]
+                : ''
+            }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>权属人电话:</span>
+            <span>{{
+              equipmentInfo ? equipmentInfo.ownershipUserMobile : ''
+            }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>固定资产编码:</span>
+            <span>{{ equipmentInfo ? equipmentInfo.fixAssetCode : '' }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>设备位置:</span>
+            <span
+              >{{ equipmentInfo ? equipmentInfo.factoryName : '' }}—{{
+                equipmentInfo ? equipmentInfo.workshopName : ''
+              }}—{{ equipmentInfo ? equipmentInfo.lineName : '' }}</span
+            >
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>规格型号:</span>
+            <span>{{
+              equipmentInfo.information
+                ? equipmentInfo.information.specification
+                : ''
+            }}</span>
+          </el-col>
+        </el-row>
+      </el-tab-pane>
+      <el-tab-pane label="报修信息" name="repairApplication">
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>报修记录编号:</span>
+            <span>{{ infoData ? infoData.repairsCode : '' }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>报修时间:</span>
+            <span>{{ infoData ? infoData.createTime : '' }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>来源:</span>
+            <span>{{
+              infoData && infoData.source ? infoData.source.desc : ''
+            }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>来源编码:</span>
+            <span>{{ infoData ? infoData.sourceCode : '' }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>报修部门:</span>
+            <span>{{ infoData ? infoData.repairsDeptName : '' }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>报修人:</span>
+            <span>{{ infoData ? infoData.repairsPerson : '' }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>报修人电话:</span>
+            <span>{{ infoData ? infoData.repairsDeptPhone : '' }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>期望完成时间:</span>
+            <span>{{ infoData ? infoData.expectedTime : '' }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="24" class="repair_column">
+            <span>故障描述:</span>
+            <span>{{ infoData ? infoData.repairsDescription : '' }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="24" class="repair_column">
+            <span>图片:</span>
+            <el-image
+              v-for="(item, index) in infoData.repairsImg"
+              :key="index"
+              style="width: 100px; height: 100px; margin-right: 5px"
+              :src="item.url"
+              :preview-src-list="[item.url]"
+            />
+          </el-col>
+        </el-row>
+      </el-tab-pane>
+    </el-tabs>
+
+    <div class="btnbox" v-if="row.isshow">
+      <el-button class="confirm-btn" type="danger" plain @click="reject"
+        >驳回</el-button
+      >
+      <el-button class="confirm-btn" type="success" plain @click="pass"
+        >验收</el-button
+      >
+      <el-button class="cancel-btn" @click="handleClose">关闭</el-button>
+    </div>
+    <div class="textbox" v-if="showtext">
+      <el-input
+        type="textarea"
+        placeholder="请输入驳回原因"
+        v-model="cause"
+        maxlength="30"
+        rows="5"
+        show-word-limit
+      >
+      </el-input>
+      <div class="textbtnbox">
+        <el-button size="small" round @click="cancelreject">取消</el-button>
+        <el-button size="small" round @click="surereject">提交</el-button>
+      </div>
+    </div>
+    <div slot="footer" v-if="!row.isshow">
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+// import {
+//   getOutsourcDetail,
+//   getDetailByCode,
+//   checkOrBack
+// } from '@/api/maintenance/repair/repair'
+// import { getWorkOrderDetail } from '@/api/maintenance/repair/maintenancePlan'
+// import { getNewinfo } from '@/api/stockManagement/stocking'
+// import { imageView } from '@/utils'
+// import UploadImg from '@/components/uploadImg/WithView.vue'
+export default {
+  props: {},
+  // components: { RepairNotesTab, WorkOrderTab, UploadImg },
+  data () {
+    return {
+      equipmentdialog: false,
+      detailsTabsActiveName: 'repairApplication',
+      workOrderInfo: {},
+      equipmentInfo: {},
+      infoData: {},
+      statusObj: {
+        0: '委外中',
+        1: '未修复',
+        2: '已完成'
+      },
+      dialogTitle: '',
+      row: {},
+      cause: '',
+      showtext: false,
+      assetTypeList: [
+        '生产设备',
+        '舟皿',
+        '物料',
+        '产品',
+        '周转车',
+        '模具',
+        '备品备件',
+        '耗材'
+      ],
+      checkTime: '',
+      imageUrl: null
+    }
+  },
+  methods: {
+    handleClose () {
+      this.equipmentdialog = false
+      this.checkTime = ''
+      this.imageUrl = null
+      this.detailsTabsActiveName = 'keepInRepair'
+    },
+    async init (row) {
+      console.log(row)
+      this.row = row
+      this.equipmentdialog = true
+      this.dialogTitle = row.title
+      this.detailsTabsActiveName = 'keepInRepair'
+      // const res = await getOutsourcDetail(row.id)
+      // this.workOrderInfo = res.data
+      // this.getSbinfo({ code: this.row.equiCode })
+      // this.getBxinfo(row.repairsCode)
+    },
+
+    getSbinfo (params) {
+      getNewinfo(params).then(res => {
+        if (res.success) {
+          this.equipmentInfo = res.data
+        }
+      })
+    },
+
+    getBxinfo (params) {
+      getDetailByCode(params).then(res => {
+        if (res.success) {
+          this.infoData = res.data
+          // 处理图片
+          if (this.infoData && this.infoData.repairsImg) {
+            const repairsImg = this.infoData.repairsImg
+            this.infoData.repairsImg = []
+            repairsImg.split(',').map(item => {
+              imageView(item).then(res => {
+                this.infoData.repairsImg.push({
+                  name: item.substring('/download/'.length),
+                  url: res
+                })
+              })
+              return
+            })
+          }
+        }
+      })
+    },
+
+    //通过按钮事件
+    pass () {
+      let params = {
+        id: this.row.id,
+        checkResult: 1,
+        checkTime: this.checkTime,
+        picPath: this.imageUrl,
+        rejectReason: ''
+      }
+      checkOrBack(params).then(res => {
+        if (res.success) {
+          this.$message.success('验收成功!')
+          this.$emit('refesh')
+          this.handleClose()
+        }
+      })
+    },
+    //驳回按钮事件
+    reject () {
+      this.showtext = true
+      let ele = document.getElementsByClassName('el-dialog__wrapper')
+      let bodyscrollHeight = document.body.scrollHeight
+      this.$nextTick(() => {
+        ele.forEach(element => {
+          if (element.style.display !== 'none') {
+            element.scrollTop = bodyscrollHeight
+          }
+        })
+      })
+    },
+    cancelreject () {
+      this.showtext = false
+      this.cause = ''
+    },
+    surereject () {
+      if (!this.cause) {
+        this.$message.info('请填写驳回原因!')
+      } else {
+        let params = {
+          id: this.row.id,
+          checkResult: 0,
+          checkTime: this.checkTime,
+          picPath: this.imageUrl,
+          rejectReason: this.cause
+        }
+        checkOrBack(params).then(res => {
+          if (res.success) {
+            this.$message.success('驳回成功!')
+            this.$emit('refesh')
+            this.handleClose()
+          }
+        })
+      }
+    },
+
+    // 选择图片回调
+    cbUploadImg (data) {
+      if (data.length > 0) {
+        this.imageUrl = data[0]
+      } else {
+        this.imageUrl = ''
+      }
+    }
+  },
+  watch: {
+    equipmentdialog (nVal, oVal) {
+      if (!nVal) {
+        this.cause = ''
+        this.showtext = false
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.repair_row {
+  margin-bottom: 15px;
+  .repair_column {
+    display: flex;
+    align-items: center;
+    > span {
+      &:first-child {
+        font-weight: 700;
+        text-align: right;
+        width: 120px;
+      }
+    }
+  }
+}
+.btnbox {
+  display: flex;
+  justify-content: center;
+  margin-top: 10px;
+}
+::v-deep .el-button {
+  padding: 10px 20px;
+  margin-right: 10px;
+}
+.textbox {
+  margin-top: 10px;
+}
+.textbtnbox {
+  margin-top: 10px;
+  display: flex;
+  justify-content: center;
+}
+</style>

+ 288 - 0
src/views/maintenance/repair/outsourcingOrder/components/appointDialog.vue

@@ -0,0 +1,288 @@
+<template>
+  <el-dialog
+    title="委外单"
+    :visible.sync="appointVisible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    width="60%"
+  >
+    <div class="main_container"  id='printBill'>
+        <div class="basic-details-title border-none">
+          <span class="border-span">委外信息</span>
+        </div>
+        <el-descriptions title="" :column="2" size="medium" border>
+          <el-descriptions-item>
+            <template slot="label"> 工单编号 </template>
+            {{ workOrderInfo ? workOrderInfo.outsourcCode : '' }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 发布时间 </template>
+            {{ workOrderInfo ? workOrderInfo.createTime : '' }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 委外单位</template>
+            {{ workOrderInfo ? workOrderInfo.outsourcUnit : ''}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 发布人 </template>
+            {{ workOrderInfo ? workOrderInfo.createBy : '' }}
+          </el-descriptions-item>
+          <el-descriptions-item :span="2">
+            <template slot="label"> 计划完成时间 </template>
+            {{ workOrderInfo ? workOrderInfo.plannCompletionTime : '' }}
+          </el-descriptions-item>
+        </el-descriptions>
+        <div class="basic-details-title border-none">
+          <span class="border-span">设备信息</span>
+        </div>
+        <el-descriptions title="" :column="2" size="medium" border>
+          <el-descriptions-item>
+            <template slot="label"> 设备编码 </template>
+            {{ equipmentInfo ? equipmentInfo.assetCode : '' }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 权属部门 </template>
+            {{ equipmentInfo ? equipmentInfo.ownershipDeptName : ''}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 设备名称 </template>
+            {{ equipmentInfo ? equipmentInfo.assetName : '' }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 权属人 </template>
+            {{  equipmentInfo ? equipmentInfo.ownershipUserName : '' }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 权属人电话 </template>
+            {{ equipmentInfo ? equipmentInfo.ownershipUserMobile : ''  }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 固定资产编码 </template>
+            {{ equipmentInfo ? equipmentInfo.fixAssetCode : '' }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label" :span="2"> 设备位置 </template>
+            {{ equipmentInfo ? equipmentInfo.factoryName : '' }}—{{
+              equipmentInfo ? equipmentInfo.workshopName : ''
+            }}—{{ equipmentInfo ? equipmentInfo.lineName : '' }}
+          </el-descriptions-item>
+        </el-descriptions>
+        <div class="basic-details-title border-none">
+          <span class="border-span">报修信息</span>
+        </div>
+        <el-descriptions title="" :column="2" size="medium" border>
+          <el-descriptions-item>
+            <template slot="label"> 报修记录编号 </template>
+            {{ infoData ? infoData.repairsCode : '' }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 报修时间 </template>
+            {{ infoData ? infoData.createTime : '' }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 报修人 </template>
+            {{ infoData ? infoData.repairsPerson : '' }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 报修人电话 </template>
+            {{ infoData ? infoData.repairsDeptPhone : '' }}
+          </el-descriptions-item>
+          <el-descriptions-item :span="2">
+            <template slot="label" > 故障描述 </template>
+            {{ infoData ? infoData.repairsDescription : '' }}
+          </el-descriptions-item>
+          <el-descriptions-item :span="2">
+            <template slot="label" > 图片 </template>
+            <el-image
+              v-for="(item, index) in infoData.repairsImg"
+              :key="index"
+              style="width: 100px; height: 100px; margin-right: 5px"
+              :src="item.url"
+              :preview-src-list="[item.url]"
+            />
+          </el-descriptions-item>
+        </el-descriptions>
+        <div class="container-write">
+            <div class="write-box">
+               <span class="box-tips">验收说明:</span>
+            </div>
+            <div class="write-choose">
+              <div class="choose-item"><span class="item-span"></span>通过</div>
+              <div class="choose-item"><span class="item-span"></span>不通过</div>
+            </div>
+            <div class="write-name"><span class="name-tips">验收人:</span></div>
+            <div class="write-name"><span class="name-tips">验收日期:</span></div>
+        </div>
+    </div>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="billPrintClick">打印</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+// import { getOutsourcDetail , getDetailByCode } from '@/api/maintenance/repair/repair'
+// import { getWorkOrderDetail } from '@/api/maintenance/repair/maintenancePlan'
+// import { getNewinfo } from '@/api/stockManagement/stocking'
+// import { imageView } from '@/utils'
+import print from 'print-js'
+export default {
+  props: {
+
+  },
+ watch: {
+
+  },
+  data () {
+    return {
+      appointVisible:false,
+      workOrderInfo: {},
+      equipmentInfo: {},
+      infoData: {},
+    }
+  },
+  created () {
+
+  },
+  methods: {
+    async init(row){
+      this.appointVisible = true
+      // const res = await getOutsourcDetail(row.id)
+      // this.workOrderInfo = res.data
+      // this.getSbinfo({ code: row.equiCode })
+      // this.getBxinfo(row.repairsCode)
+    },
+
+    getSbinfo (params) {
+      getNewinfo(params).then(res => {
+        if (res.success) {
+          this.equipmentInfo = res.data
+        }
+      })
+    },
+
+    getBxinfo(params){
+      getDetailByCode(params).then(res=>{
+         if (res.success) {
+           this.infoData = res.data
+           // 处理图片
+            if (this.infoData && this.infoData.repairsImg) {
+              const repairsImg = this.infoData.repairsImg
+              this.infoData.repairsImg = []
+              repairsImg.split(',').map(item => {
+                imageView(item).then(res => {
+                  this.infoData.repairsImg.push({
+                    name: item.substring('/download/'.length),
+                    url: res
+                  })
+                })
+                return
+              })
+            }
+         }
+      })
+    },
+
+
+
+    handleClose () {
+      this.appointVisible = false
+    },
+
+    billPrintClick(){
+      const style = '@page {margin:0 10mm};'//打印时去掉眉页眉尾
+      //打印为什么要去掉眉页眉尾?因为眉页title时打印当前页面的title,相当于是获取html中title标签里面的内容,但是比如我打印的内容只是一个弹框里面的内容,是没有title的,这时候就会出现undefined,为了避免出现这种情况,就可以隐藏眉页眉尾
+      printJS({
+        printable: 'printBill',// 标签元素id
+        type: 'html',
+        header: '',
+        targetStyles: ['*'],
+        style
+      });
+      //各个配置项
+      //printable:要打印的id。
+      //type:可以是 html 、pdf、 json 等。
+      //properties:是打印json时所需要的数据属性。
+      //gridHeaderStyle和gridStyle都是打印json时可选的样式。
+      //repeatTableHeader:在打印JSON数据时使用。设置为时false,数据表标题将仅在第一页显示。
+      //scanStyles:设置为false时,库将不处理应用于正在打印的html的样式。使用css参数时很有用,此时自己设置的原来想要打印的样式就会失效,在打印预览时可以看到效果
+      //targetStyles: [’*’],这样设置继承了页面要打印元素原有的css属性。
+      //style:传入自定义样式的字符串,使用在要打印的html页面 也就是纸上的样子。
+      //ignoreElements:传入要打印的div中的子元素id,使其不打印。非常好用
+    },
+
+
+
+
+
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.dialog_top {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 10px;
+}
+.btns {
+  text-align: right;
+  margin: 10px 0;
+}
+.border-span{
+	width: 100%;
+	margin: 15px 0;
+	display: inline-block;
+}
+:deep(.main_container){
+     page-break-after:always;
+	 width: 100%;
+   .el-descriptions--medium.is-bordered .el-descriptions-item__cell{
+      min-width:120px!important;
+    }
+    .container-write{
+	  width: 97%;
+      margin:20px 0;
+    }
+    .write-box{
+      width:100%;
+      height:100px;
+      border:1px solid #999;
+      border-radius:4px;
+      padding: 10px;
+    }
+    .write-choose{
+      width:100%;
+      margin:15px auto;
+      display:flex;
+      align-items:center;
+      .choose-item{
+        margin-right:10px;
+        display:flex;
+        align-items:center;
+        width:80px;
+        .item-span{
+          display:inline-block;
+          width:15px;
+          height:15px;
+          border:1px solid #999;
+          margin-right:4px;
+        }
+      }
+    }
+    .write-name{
+      margin-bottom:10px;
+      display:flex;
+      align-items:center;
+      justify-content: flex-end;
+      .name-tips{
+        margin-right:150px;
+        width:80px;
+      }
+    }
+}
+
+</style>

+ 60 - 44
src/views/maintenance/repair/outsourcingOrder/index.vue

@@ -8,27 +8,15 @@
 	     ref="table"
 	     :columns="columns"
 	     :datasource="datasource"
-	     cache-key="systemRoleTable"
+	     cache-key="systemAppointTable"
+		 @select-all="onSelectAll"
+		 @selection-change="selectItem"
+		 highlight-current-row
 	   >
 	     <!-- 表头工具栏 -->
 	     <template v-slot:toolbar>
-	       <el-button
-	         size="small"
-	         type="primary"
-	         icon="el-icon-plus"
-	         class="ele-btn-icon"
-	         @click="openEdit()"
-	       >
-	         新建
-	       </el-button>
-<!-- 		   <el-button
-		     size="small"
-		     type="primary"
-		     class="ele-btn-icon"
-		     @click="goDetail({id:12})"
-		   >
-		     详情
-		   </el-button> -->
+	       <el-button icon="el-icon-upload2" size="small"  @click="handlExport">导出</el-button>
+	       <el-button icon="el-icon-printer" size="small" @click="openAppoint">打印委外单</el-button>
 	     </template>
        <template v-slot:outsourcCode="{ row }">
          <el-link type="primary" :underline="false" @click="goDetail(row)">
@@ -41,27 +29,41 @@
 	         type="primary"
 	         :underline="false"
 	         icon="el-icon-edit"
-	         @click="openEdit(row)"
+	         @click="openCheck(row)"
 	       >
 	         验收
 	       </el-link>
 	     </template>
 	   </ele-pro-table>
      </el-card>
+	 <!-- 验收 -->
+	 <AppointDetailsDialog ref="detailsDialogRef" @refesh="reload"/>
+	 <!-- 委派单模板 -->
+	 <AppointDialog ref="appointDialogRef" />
   </div>
 </template>
 
 <script>
   import OrderSearch from './components/order-search.vue';
+  import AppointDialog from './components/appointDialog.vue'
+  import AppointDetailsDialog from './components/AppointDetailsDialog.vue'
   import { pageRoles } from '@/api/system/role';
   export default {
     components: {
-      OrderSearch
+      OrderSearch,
+	  AppointDialog,
+	  AppointDetailsDialog
     },
     data () {
       return {
 		// 表格列配置
 		columns: [
+		  {
+			width: 45,
+			type: 'selection',
+			columnKey: 'selection',
+			align: 'center'
+		  },
 		  {
 		    columnKey: 'index',
 		    label: '序号',
@@ -161,7 +163,7 @@
         addDialogTitle: '新增报修记录',
         detailsDialogTitle: '报修记录详情',
         deviceInfo: {}, //设备信息
-		
+		multipleSelection:[]
       };
     },
     computed: {
@@ -172,38 +174,52 @@
       datasource({ page, limit, where, order }) {
         return pageRoles({ pageNum: page, size: limit, ...where });
       },
-      async changeEnable(row) {
-        const res = await putRoles(row);
-        if (res.code == 0) {
-          this.$message({
-            type: 'success',
-            message: '修改成功',
-            customClass: 'ele-message-border'
-          });
-          this.reload();
-        }
-      },
       /* 刷新表格 */
       reload(where) {
         this.$refs.table.reload({ page: 1, where });
       },
 	  
-	  openEdit(row){
-		  this.addDialogTitle = '新增报修记录'
-		  this.$refs.addDialogRef.addRepairNotesDialog = true
+	  openCheck(row){
+		  row.isshow = true
+		  row.title = '工单详情'
+		  this.$refs.detailsDialogRef.init(row)
 	  },
 	  
 	  goDetail(row){
-		  row.tabLabel = '维修信息'
-		  row.title = '报修记录详情'
-		  row.workOrderCode = row.id
+		  row.isshow = false
+		  row.title = '工单详情'
 		  this.$refs.detailsDialogRef.init(row)
-		  // this.$router.push({
-		  //   path: '/maintenance/patrol/plan/details',
-		  //   // query: {
-		  //   //   id
-		  //   // }
-		  // })
+	  },
+	  
+	  onSelectAll() {
+	    this.$refs.table.clearSelection();
+	  },
+	  selectItem(rows) {
+	    if (rows.length > 1) {
+	      const newRows = rows.filter((it, index) => {
+	        if (index == rows.length - 1) {
+	          this.$refs.table.toggleRowSelection(it, true);
+	          return true;
+	        } else {
+	          this.$refs.table.toggleRowSelection(it, false);
+	          return false;
+	        }
+	      });
+	      this.multipleSelection = newRows;
+	    } else {
+	      this.multipleSelection = rows;
+	    }
+	  },
+	  
+	  handlExport(){
+		  
+	  },
+	  
+	  openAppoint(){
+		  if(this.multipleSelection.length==0){
+		    return this.$message.warning('请选择一条委外单')
+		  }
+		  this.$refs.appointDialogRef.init(this.multipleSelection[0])
 	  }
 	  
     }

+ 109 - 0
src/views/warning/warningMessage/components/message-search.vue

@@ -0,0 +1,109 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="100px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="告警级别:" label-width="80px">
+          <DictSelection dictName="告警级别" clearable v-model="where.staus">
+          </DictSelection>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="告警设备分类:">
+          <equipmentSelect v-model="where.categoryLevelId" />
+        </el-form-item>
+      </el-col>
+	  <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+		  <el-form-item label="告警时间:" label-width="80px">
+			<el-date-picker
+				v-model="time"
+				type="daterange"
+				range-separator="至"
+				start-placeholder="开始日期"
+				end-placeholder="结束日期"
+				value-format="yyyy-MM-dd HH:mm:ss"
+				:default-time="['00:00:00', '23:59:59']"
+				>
+			</el-date-picker>
+		  </el-form-item>
+	    </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+		<div class="ele-form-actions">
+			<el-button
+				type="primary"
+				icon="el-icon-search"
+				class="ele-btn-icon"
+				@click="search"
+				size="small"
+			>
+				查询
+			</el-button>
+			 <el-button @click="reset"
+				 icon="el-icon-refresh-left"
+				 size="small"
+				 type="primary"
+			 >重置</el-button>
+		</div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+	import equipmentSelect from '@/components/CommomSelect/equipment-select.vue';
+  export default {
+		components: { equipmentSelect  },
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+		name:'',
+        ruleName: '',
+        code: '',
+        groupId:'',
+        status:'',
+		categoryLevelId:''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere },
+        time:[]
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created(){
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        if(this.time.length){
+        	this.where.startTime = this.time[0]
+        	this.where.endTime = this.time[1]
+        }
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+		this.time = []
+        this.where = { ...this.defaultWhere };
+        this.search();
+      },
+    }
+  };
+</script>
+<style lang="scss" scoped>
+    .ele-form-actions{
+		display:flex;
+		align-items: center;
+		justify-content: flex-end;
+	}
+</style>

+ 131 - 0
src/views/warning/warningMessage/index.vue

@@ -0,0 +1,131 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <message-search @search="reload"> </message-search>
+      <!-- 数据表格 -->
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        cache-key="systemRoleTable"
+      >
+<!--        <template v-slot:code="{ row }">
+          <el-link type="primary" :underline="false">
+            {{ row.code }}
+          </el-link>
+        </template> -->
+      </ele-pro-table>
+    </el-card>
+
+  </div>
+</template>
+
+<script>
+  import MessageSearch from './components/message-search.vue';
+  import { planConfigPage, removeRule } from '@/api/ruleManagement/plan';
+  import dictMixins from '@/mixins/dictMixins';
+  export default {
+    mixins: [dictMixins],
+    components: {
+      MessageSearch
+    },
+    data () {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '告警级别',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot: 'code'
+          },
+          {
+            prop: 'name',
+            label: '告警设备分类',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'groupName',
+            label: '设备编号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'categoryName',
+            label: '设备名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'ruleName',
+            label: '告警内容',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'autoOrder',
+            label: '告警方式',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              let autoOrder =
+                _row.autoOrder == 1 ? '是' : _row.autoOrder == 0 ? '否' : '-';
+              return autoOrder;
+            }
+          },
+          {
+            prop: 'createTime',
+            label: '告警时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.$util.toDateString(cellValue);
+            }
+          }
+        ],
+        // 加载状态
+        loading: false,
+      };
+    },
+    computed: {},
+    created () {
+      this.requestDict('规则状态');
+    },
+    methods: {
+      /* 表格数据源 */
+      datasource ({ page, limit, where, order }) {
+        return planConfigPage({
+          pageNum: page,
+          size: limit,
+          ...where,
+          ruleType: 2
+        });
+      },
+
+      /* 刷新表格 */
+      reload (where) {
+        this.$refs.table.reload({ page: 1, where, ruleType: 2 });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 518 - 0
src/views/warning/warningSetting/components/addWarningDialog.vue

@@ -0,0 +1,518 @@
+<template>
+  <el-dialog
+    :title="dialogTitle"
+    :visible.sync="addWarningDialog"
+    width="60%"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    :before-close="handleClose"
+  >
+    <el-tabs
+      type="border-card"
+      v-model="tabActiveName"
+      v-loading="saveLoading"
+      @tab-click="handleTabClick"
+    >
+      <el-tab-pane label="基本信息" name="baseInfo">
+        <el-form
+          :model="baseInfoForm"
+          :rules="baseInfoFormRules"
+          ref="baseInfoFormRef"
+          label-width="120px"
+        >
+          <el-row>
+            <el-col :span="10">
+              <el-form-item label="告警级别:" prop="alarmLevel">
+				<DictSelection dictName="告警级别" clearable v-model="baseInfoForm.alarmLevel" style="width: 80%">
+				</DictSelection>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="告警设备类型:" prop="alarmEquipmentName" style="width: 90%">
+				 <equipmentSelect v-model="baseInfoForm.alarmEquipmentName"/>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="10">
+              <el-form-item label="告警名称:" prop="alarmName">
+                <el-input
+                  v-model="baseInfoForm.alarmName"
+                  style="width: 80%"
+                  placeholder="请输入告警名称"
+                  size="small"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="4">
+              <el-form-item label="生成报修记录:">
+                <el-switch
+                  v-model="baseInfoForm.isCreate"
+                  active-color="#13ce66"
+                  inactive-color="#989898"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="4">
+              <el-form-item label="状态:">
+                <el-switch
+                  v-model="baseInfoForm.status"
+                  active-color="#13ce66"
+                  inactive-color="#989898"
+                />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="24">
+              <el-form-item label="告警描述:">
+                <el-input
+                  type="textarea"
+                  :rows="3"
+                  resize="none"
+                  size="small"
+                  v-model="baseInfoForm.alarmDescribe"
+                  placeholder="请输入告警描述"
+                  style="width: 85%"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="触发条件:" prop="alarmTrigger">
+                <el-select
+                  filterable
+                  v-model="baseInfoForm.alarmTrigger"
+                  size="small"
+                >
+                  <el-option
+                    label="当满足以下所有条件时"
+                    :value="0"
+                  ></el-option>
+                  <el-option
+                    label="当满足以下任一条件时"
+                    :value="1"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24" class="table_wrapper">
+              <el-table
+                :data="baseInfoForm.alarmTriggerList"
+                style="width: 100%"
+              >
+                <el-table-column label="">
+                  <template slot-scope="scope">
+                    <el-select
+                      filterable
+                      v-model="scope.row.alarmType"
+                      size="small"
+                      style="width: 100%"
+                      placeholder="请选择"
+                    >
+                      <el-option
+                        v-for="item in temperatureList"
+                        :key="item.identifier"
+                        :value="item.identifier"
+                        :label="item.name"
+                      ></el-option>
+                    </el-select>
+                  </template>
+                </el-table-column>
+                <el-table-column label="">
+                  <template slot-scope="scope">
+					<DictSelection dictName="告警触发条件" clearable v-model="scope.row.alarmCondition">
+					</DictSelection>
+                  </template>
+                </el-table-column>
+                <el-table-column label="">
+                  <template slot-scope="scope">
+                    <el-input
+                      v-model="scope.row.alarmValue"
+                      oninput="value=value.replace(/[^\d.]/g,'')"
+                      size="small"
+                      placeholder="请输入值"
+                    ></el-input>
+                  </template>
+                </el-table-column>
+                <el-table-column label="" width="70">
+                  <template slot-scope="scope">
+                    <div class="alarm_trigger_handler">
+                      <div
+                        v-if="
+                          scope.$index <
+                          baseInfoForm.alarmTriggerList.length - 1
+                        "
+                      >
+                        <span v-if="baseInfoForm.alarmTrigger === 0">且</span>
+                        <span v-if="baseInfoForm.alarmTrigger === 1">或</span>
+                      </div>
+                      <el-button
+                        v-if="scope.$index > 0"
+                        type="text"
+                        @click="handleDeleteTriggerCondition(scope.$index)"
+                        >删除</el-button
+                      >
+                    </div>
+                  </template>
+                </el-table-column>
+              </el-table>
+              <el-button
+                type="text"
+                icon="el-icon-plus"
+                @click="handleAddTriggerCondition"
+                >增加条件</el-button
+              >
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="告警方式:">
+				  <DictSelection dictName="告警方式" clearable v-model="baseInfoForm.alarmMode">
+				  </DictSelection>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </el-tab-pane>
+      <el-tab-pane label="短信设置" name="shortMessage" disabled
+        >短信设置</el-tab-pane
+      >
+      <el-tab-pane label="邮箱设置" name="email" disabled>邮箱设置</el-tab-pane>
+      <el-tab-pane label="通知设置" name="notice">
+        <div class="add_notice_table_row">
+          <el-button type="primary" size="small" @click="handleAddNoticeRow"
+            >添加</el-button
+          >
+        </div>
+        <el-table
+          :data="baseInfoForm.alarmNoticeSetList"
+          style="width: 100%"
+          border
+        >
+          <el-table-column label="" align="center" width="60">
+            <template slot-scope="scope">
+              <span>{{ scope.$index + 1 }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="通知人" align="center">
+            <template slot-scope="scope">
+              <el-select
+                filterable
+                v-model="scope.row.alarmNotifierId"
+                size="small"
+              >
+				<el-option
+				  v-for="item in alarmNotifierList"
+				  :key="item.id"
+				  :value="item.id"
+				  :label="item.name"
+				></el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column label="手机号码" align="center">
+            <template slot-scope="scope">
+              <el-input
+                v-model="scope.row.alarmNotifierPhone"
+                size="small"
+                placeholder="请输入手机号码"
+                @blur="checkPhone(scope.$index, scope.row.alarmNotifierPhone)"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="邮箱" align="center">
+            <template slot-scope="scope">
+              <el-input
+                v-model="scope.row.alarmNotifierMailbox"
+                size="small"
+                placeholder="请输入邮箱"
+                @blur="checkMailbox(scope.$index, scope.row.mailbox)"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="通知方式" width="260px" align="center">
+            <template slot-scope="scope">
+              <el-checkbox v-model="scope.row.shortMessage">短信</el-checkbox>
+              <el-checkbox v-model="scope.row.mail">邮件</el-checkbox>
+              <el-checkbox v-model="scope.row.system">系统</el-checkbox>
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" width="70px" align="center">
+            <template slot-scope="scope">
+              <el-button
+                type="text"
+                @click="handleDeleteNoticeRow(scope.$index)"
+                >删除</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-tab-pane>
+    </el-tabs>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="handleClose">取 消</el-button>
+      <el-button size="small" type="primary" @click="saveWarningSetting"
+        >确 定</el-button
+      >
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+	import equipmentSelect from '@/components/CommomSelect/equipment-select.vue';
+	import { getUserPage } from '@/api/system/organization';
+export default {
+  components: { equipmentSelect  },
+  props: {
+    equipmentList: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    viewForm: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    },
+    dialogTitle: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      addWarningDialog: false,
+      tabActiveName: 'baseInfo',
+      saveLoading: false,
+      baseInfoForm: {
+        alarmLevel: '', // 告警级别
+        alarmEquipmentId: '', // 告警设备类型id
+        alarmEquipmentName: '', // 告警设备类型name
+        alarmName: '', // 告警名称
+        status: false, // 状态
+        isCreate: false, // 是否生成保修工单
+        alarmDescribe: '', // 告警描述
+        alarmTrigger: 0, // 告警触发条件类型选择
+        alarmMode: '', // 告警方式
+        alarmTriggerList: [{}], // 基本信息触发条件表格
+        alarmNoticeSetList: [
+          {
+            alarmNotifierId: '', // 告警通知人id
+            alarmNotifierName: '', // 告警通知人name
+            alarmNotifierMailbox: '', // 邮箱
+            alarmNotifierPhone: '', // 电话
+            mail: false, // 邮件
+            shortMessage: false, // 短信
+            system: false // 系统
+          }
+        ] // 通知设置表格
+      },
+      baseInfoFormRules: {
+        alarmLevel: [
+          { required: true, message: '请选择告警级别', trigger: 'change' }
+        ],
+        alarmEquipmentName: [
+          { required: true, message: '请选择告警设备类型', trigger: 'change' }
+        ],
+        alarmName: [
+          { required: true, message: '请输入告警名称', trigger: 'blur' }
+        ],
+        alarmTrigger: [
+          { required: true, message: '请选择触发条件', trigger: 'change' }
+        ]
+      },
+      alarmNotifierList: [], // 通知人用户列表
+      temperatureList: [],
+    }
+  },
+  watch: {
+    viewForm (val) {
+      console.log('shujval', val)
+      this.baseInfoForm = val
+      this.getTemperatureList(val.alarmEquipmentId)
+    }
+  },
+  methods: {
+    getTemperatureList (val) {
+      warningSetting.getAlarmTermType(val).then(res => {
+        if (res?.success) {
+          this.temperatureList = res.data
+        }
+      })
+    },
+
+    // 告警设备类型变更
+    async handleEquipmentChange (val) {
+      this.baseInfoForm.alarmEquipmentId = val
+      warningSetting
+        .getAlarmTermType(this.baseInfoForm.alarmEquipmentId)
+        .then(res => {
+          if (res?.success) {
+            this.temperatureList = res.data
+            console.log('列表数据', this.temperatureList)
+            this.baseInfoForm.alarmTriggerList.forEach(item => {
+              if (item.alarmType) {
+                item.alarmType = ''
+              }
+            })
+          }
+        })
+        .catch(err => {
+          this.temperatureList = []
+          this.baseInfoForm.alarmTriggerList.forEach(item => {
+            if (item.alarmType) {
+              item.alarmType = ''
+            }
+          })
+        })
+    },
+    // 获取通知人列表数据
+	async getUserList() {
+	  try {
+	    let data = { pageNum: 1, size: -1 };
+	    const res = await getUserPage(data);
+	    this.alarmNotifierList = res.list;
+	  } catch (error) {}
+	},
+	
+    // tab栏切换
+    handleTabClick (tab) {
+      // 获取通知人下拉数据
+      if (tab.name === 'notice') {
+        this.getUserList()
+      }
+    },
+    // 关闭新增弹窗
+    handleClose () {
+      this.addWarningDialog = false
+      this._resetDialogInfo()
+    },
+    // 增加触发条件
+    handleAddTriggerCondition () {
+      this.baseInfoForm.alarmTriggerList.push({})
+    },
+    // 删除触发条件
+    handleDeleteTriggerCondition (index) {
+      this.baseInfoForm.alarmTriggerList.splice(index, 1)
+    },
+    // 通知设置 - 添加表格一行
+    handleAddNoticeRow () {
+      this.baseInfoForm.alarmNoticeSetList.push({
+        alarmNotifierId: '', // 告警通知人id
+        alarmNotifierName: '', // 告警通知人name
+        alarmNotifierMailbox: '', // 邮箱
+        alarmNotifierPhone: '', // 电话
+        mail: false, // 邮件
+        shortMessage: false, // 短信
+        system: false // 系统
+      })
+    },
+    // 通知设置 - 删除表格一行
+    handleDeleteNoticeRow (index) {
+      this.baseInfoForm.alarmNoticeSetList.splice(index, 1)
+    },
+    // 验证手机号
+    checkPhone (index, phone) {
+      const phoneReg = /^1[345789]\d{9}$/
+      if (phone && !phoneReg.test(phone)) {
+        this.baseInfoForm.alarmNoticeSetList[index].alarmNotifierPhone = ''
+        return this.$message.error('手机号码格式错误,请重新输入!')
+      }
+    },
+    // 验证邮箱
+    checkMailbox (index, mailbox) {
+      const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
+      if (mailbox && !mailReg.test(mailbox)) {
+        this.baseInfoForm.alarmNoticeSetList[index].alarmNotifierMailbox = ''
+        return this.$message.error('邮箱格式错误,请重新输入!')
+      }
+    },
+    // 保存
+    async saveWarningSetting () {
+      this.$refs.baseInfoFormRef.validate(async valid => {
+        if (valid) {
+          try {
+            this.saveLoading = true
+            const res = await warningSetting.saveWarningSetting(
+              this.baseInfoForm
+            )
+            // console.log('新增告警结果:', res)
+            this.addWarningDialog = false
+            this._resetDialogInfo()
+            this.saveLoading = false
+            this.$emit('refreshList')
+            this.$message.success('新增成功!')
+          } catch (error) {
+            this.saveLoading = false
+          }
+        }
+      })
+    },
+    // 重置弹窗信息
+    _resetDialogInfo () {
+      this.baseInfoForm = {
+        alarmLevel: '', // 告警级别
+        alarmEquipmentId: '', // 告警设备类型id
+        alarmEquipmentName: '', // 告警设备类型name
+        alarmName: '', // 告警名称
+        status: false, // 状态
+        isCreate: false, // 是否生成保修工单
+        alarmDescribe: '', // 告警描述
+        alarmTrigger: 0, // 告警触发条件类型选择
+        alarmMode: '', // 告警方式
+        alarmTriggerList: [{}], // 基本信息触发条件表格
+        alarmNoticeSetList: [
+          {
+            alarmNotifierId: '', // 告警通知人id
+            alarmNotifierName: '', // 告警通知人name
+            alarmNotifierMailbox: '', // 邮箱
+            alarmNotifierPhone: '', // 电话
+            mail: false, // 邮件
+            shortMessage: false, // 短信
+            system: false // 系统
+          }
+        ] // 通知设置表格
+      }
+      this.tabActiveName = 'baseInfo'
+      this.$refs.baseInfoFormRef.resetFields()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-dialog__headerbtn .el-dialog__close {
+  color: #fff;
+  font-weight: 700;
+  font-size: 20px;
+}
+.table_wrapper {
+  padding-left: 120px;
+  padding-right: 8vw;
+  ::v-deep .el-table__header-wrapper {
+    display: none;
+  }
+  ::v-deep .el-table .cell {
+    padding-left: 0;
+  }
+}
+.add_notice_table_row {
+  text-align: right;
+  padding-bottom: 8px;
+}
+.alarm_trigger_handler {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+::v-deep .el-form-item {
+  margin-bottom: 14px;
+}
+::v-deep .el-form-item__error {
+  padding-top: 0;
+}
+</style>

+ 89 - 0
src/views/warning/warningSetting/components/setting-search.vue

@@ -0,0 +1,89 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="100px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="告警级别:">
+          <DictSelection dictName="告警级别" clearable v-model="where.staus">
+          </DictSelection>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="告警设备分类:">
+          <equipmentSelect v-model="where.categoryLevelId" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
+		<div class="ele-form-actions">
+			<el-button
+				type="primary"
+				icon="el-icon-search"
+				class="ele-btn-icon"
+				@click="search"
+				size="small"
+			>
+				查询
+			</el-button>
+			 <el-button @click="reset"
+				 icon="el-icon-refresh-left"
+				 size="small"
+				 type="primary"
+			 >重置</el-button>
+		</div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+	import equipmentSelect from '@/components/CommomSelect/equipment-select.vue';
+  export default {
+		components: { equipmentSelect  },
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+		name:'',
+        ruleName: '',
+        code: '',
+        groupId:'',
+        status:'',
+	    categoryLevelId:''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created(){
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      },
+    }
+  };
+</script>
+<style lang="scss" scoped>
+    .ele-form-actions{
+		display:flex;
+		align-items: center;
+		justify-content: flex-end;
+	}
+</style>

+ 186 - 0
src/views/warning/warningSetting/index.vue

@@ -0,0 +1,186 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <setting-search @search="reload"> </setting-search>
+      <!-- 数据表格 -->
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        cache-key="systemRoleTable"
+      >
+        <!-- 表头工具栏 -->
+        <template v-slot:toolbar>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="openEdit()"
+          >
+            新建
+          </el-button>
+        </template>
+        <template v-slot:enable="{ row }">
+          <el-switch
+            v-model="row.enable"
+            active-color="#13ce66"
+            inactive-color="#ff4949"
+            :active-value="1"
+            :inactive-value="0"
+            disabled
+          >
+          </el-switch>
+        </template>
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit(row)"
+          >
+            修改
+          </el-link>
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除此告警设置吗?"
+            @confirm="remove(row)"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+        </template>
+      </ele-pro-table>
+    </el-card>
+	
+	<AddWarningDialog
+	  ref="addWarningDialogRef"
+	  :dialogTitle="dialogTitle"
+	  @refreshList="reload"
+	/>
+
+  </div>
+</template>
+
+<script>
+  import SettingSearch from './components/setting-search.vue';
+  import AddWarningDialog from './components/addWarningDialog.vue'
+  import dictMixins from '@/mixins/dictMixins';
+  import { planConfigPage, removeRule } from '@/api/ruleManagement/plan';
+  export default {
+    mixins: [dictMixins],
+    components: {
+      SettingSearch, AddWarningDialog
+    },
+    data () {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'status',
+            label: '告警级别',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.getDictValue('告警级别', _row.status);
+            }
+          },		  
+          {
+            prop: 'enable',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'fl',
+            label: '告警设备分类',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+		  {
+		    prop: 'groupName',
+		    label: '告警名称',
+		    align: 'center',
+		    showOverflowTooltip: true,
+		    minWidth: 110
+		  },
+		  {
+		    prop: 'categoryName',
+		    label: '告警描述',
+		    align: 'center',
+		    showOverflowTooltip: true,
+		    minWidth: 110
+		  },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 150,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
+        // 加载状态
+        loading: false,
+        pageType: 'add',
+        dialogTitle: '',
+        isBindPlan: false
+      };
+    },
+    computed: {},
+    created () {
+      this.requestDict('告警级别');
+    },
+    methods: {
+      /* 表格数据源 */
+      datasource ({ page, limit, where, order }) {
+        return planConfigPage({
+          pageNum: page,
+          size: limit,
+          ...where,
+          ruleType: 2
+        });
+      },
+
+      /* 刷新表格 */
+      reload (where) {
+        this.$refs.table.reload({ page: 1, where, ruleType: 2 });
+      },
+
+      openEdit (row) {
+		  if(row){
+			  this.dialogTitle = '编辑告警'
+		  }else{
+			  this.dialogTitle = '新增告警'
+		  }
+		  this.$refs.addWarningDialogRef.addWarningDialog = true
+      },
+
+      remove (row) {
+        removeRule([row.id]).then((res) => {
+          this.$message.success('删除成功!');
+          this.reload();
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped></style>