Pārlūkot izejas kodu

告警处理、运行监测列表

Reiskuchen 5 gadi atpakaļ
vecāks
revīzija
440af55aff

+ 2 - 1
ys_vue/src/port.js

@@ -73,7 +73,8 @@ export default {
         moldMaintainList: '/mouldmaintain/list', //获取列表
         moldMaintainListGet: '/mould/maintainMouldList', //主页获取保养模具列表
         moldDiscardListGet: '/mould/scrapMouldList', //主页获取报废模具列表
-        moldChange: '/mould/changeMouldEquipment' //处理告警
+        moldChange: '/mould/changeMouldEquipment', //处理告警
+        moldChangeRequirement: '/mouldequipment/getEquipmentListByOldMouldAndUser' //处理告警所需的设备
     },
     //基础管理
     base: {

+ 11 - 2
ys_vue/src/views/detection/detection.vue

@@ -46,7 +46,15 @@
       <el-table-column prop="ocCycle" label="每模平均周期" align="center" width="140" sortable></el-table-column>
       <el-table-column prop="hillNumber" label="电量" align="center" width="80" sortable></el-table-column>
       <el-table-column prop="state" label="当前状态" align="center" width="100" sortable></el-table-column>
-      <el-table-column label="云模盒报警" align="center" width="160">低电量、温度过高</el-table-column>
+      <el-table-column label="云模盒报警" align="center" width="160">
+          <template slot-scope="scope">
+          <span v-if="scope.row.stage == 0">正常</span>
+          <span v-else-if="scope.row.stage == 1">温度过高</span>
+          <span v-else-if="scope.row.stage == 2">电量过低</span>
+          <span v-else-if="scope.row.stage == 3">温度过高、电量过低</span>
+          <span v-else>不明</span>
+        </template>
+      </el-table-column>
       <el-table-column label="模具保养" align="center" width="100">
         <template slot-scope="scope">
           <span v-if="scope.row.isMaintain == 1">需要</span>
@@ -123,7 +131,8 @@ export default {
         pageSize: this.size,
         projectId: -1,
         searchType: type,
-        keyName: keyWord
+        keyName: keyWord,
+        type: 0
       };
       this.http.post(
         this.port.mold.molds,

+ 62 - 34
ys_vue/src/views/detection/maintenance.vue

@@ -36,7 +36,7 @@
       云模盒告警:{{warningInfo}}
       <el-button
         size="small"
-        v-if="!(user.parentId == 1 && user.subordinateType == 1)"
+        v-if="!(user.parentId == 1 && user.subordinateType == 1) && stage != 0"
         @click="warningFormVisible = true"
         type="primary"
         style="margin-left: 16px;"
@@ -46,7 +46,7 @@
     <!-- 操作记录 -->
     <el-col :span="24" class="title">处理记录</el-col>
     <!-- 列表 -->
-    <el-table :data="records" highlight-current-row v-loading="listLoading" style="width: 100%;">
+    <el-table :data="records" highlight-current-row v-loading="listLoading" style="width: 100%;" :height="tableHeight">
       <el-table-column type="index" width="60"></el-table-column>
       <el-table-column prop="maintainUserName" label="保养人" width="100" sortable></el-table-column>
       <el-table-column prop="maintainType" label="保养方案" sortable></el-table-column>
@@ -178,7 +178,12 @@
           <el-input placeholder="报警类型" v-model="warningInfo" :disabled="true"></el-input>
         </el-form-item>
         <el-form-item label="云模盒设置" prop="action">
-          <el-select v-model="warningForm.equipmentId" filterable placeholder="请选择云模盒" style="width:202px">
+          <el-select
+            v-model="warningForm.equipmentId"
+            filterable
+            placeholder="请选择云模盒"
+            style="width:202px"
+          >
             <el-option
               v-for="item in equipments"
               :key="item.value"
@@ -189,7 +194,7 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button @click.native="maintenanceFormVisible = false">取消</el-button>
+        <el-button @click.native="warningArrangement = false">取消</el-button>
         <el-button type="primary" @click.native="warningArrangement" :loading="warningLoading">立即处理</el-button>
       </div>
     </el-dialog>
@@ -213,6 +218,7 @@ export default {
       records: [],
       //警告信息
       warningInfo: "低电量、过热",
+      stage: null,
       //告警时需要更换的设备的列表
       equipments: [
         { value: 1, label: "临时设备1" },
@@ -319,6 +325,7 @@ export default {
           this.listLoading = false;
           if (res.code == "ok") {
             this.records = res.data.list;
+            this.total = res.data.total;
           } else {
             this.$message({
               message: res.msg,
@@ -347,6 +354,18 @@ export default {
             this.mouldName = res.data.vo.modelName;
             this.mouldState = res.data.vo.state;
             this.requirement = res.data.vo.isMaintain == 1;
+            this.stage = res.data.vo.stage;
+            if(this.stage == 0){
+                this.warningInfo = "正常";
+            }else if(this.stage == 1){
+                this.warningInfo = "温度过高";
+            }else if(this.stage == 2){
+                this.warningInfo = "电量过低";
+            }else if(this.stage == 3){
+                this.warningInfo = "温度过高、电量过低";
+            }else{
+                this.warningInfo = "状况不明";
+            }
           } else {
             this.$message({
               message: res.msg,
@@ -425,14 +444,16 @@ export default {
     //获取告警时可以更换的设备列表
     getAlternativeEquipment() {
       this.http.post(
-        this.port.base.moulds,
+        this.port.mold.moldChangeRequirement,
         {
-          belongCompanyId: this.user.companyId
+          mouldId: this.mouldId
         },
         res => {
           if (res.code == "ok") {
-            //顺便把相关的告警中的模具ID赋值一下
-            this.warningForm.mouldId = this.mouldId;
+            this.equipments = [];
+            res.data.forEach(item => {
+              this.equipments.push({ label: item.equipmentNo, value: item.id });
+            });
           } else {
             this.$message({
               message: res.msg,
@@ -450,39 +471,46 @@ export default {
     },
     //告警处理
     warningArrangement() {
-        console.log(this.warningForm);
-    //   this.http.post(
-    //     this.port.mold.moldChange,
-    //     this.warningForm,
-    //     res => {
-    //       if (res.code == "ok") {
-    //         this.$message({
-    //           message: "告警处理完毕",
-    //           type: "success"
-    //         });
-    //         this.warningFormVisible = false;
-    //       } else {
-    //         this.$message({
-    //           message: res.msg,
-    //           type: "error"
-    //         });
-    //       }
-    //     },
-    //     error => {
-    //       this.$message({
-    //         message: error,
-    //         type: "error"
-    //       });
-    //     }
-    //   );
+      if (this.warningForm.equipmentId == null) {
+        this.$message({
+          message: "请选择云模盒",
+          type: "error"
+        });
+      } else {
+        this.http.post(
+          this.port.mold.moldChange,
+          this.warningForm,
+          res => {
+            if (res.code == "ok") {
+              this.$message({
+                message: "告警处理完毕",
+                type: "success"
+              });
+              this.warningFormVisible = false;
+            } else {
+              this.$message({
+                message: res.msg,
+                type: "error"
+              });
+            }
+          },
+          error => {
+            this.$message({
+              message: error,
+              type: "error"
+            });
+          }
+        );
+      }
     }
   },
   created() {
     let height = window.innerHeight;
-    this.tableHeight = height - 260;
+    this.tableHeight = height - 370;
   },
   mounted() {
     this.mouldId = this.$route.params.id; //传到当前页面的模具编号
+    this.warningForm.mouldId = this.mouldId; //顺便把相关的告警中的模具ID赋值一下
     this.getList();
     this.getDetail();
     this.getAlternativeEquipment();