Reiskuchen пре 5 година
родитељ
комит
23ca1d520f
2 измењених фајлова са 36 додато и 7 уклоњено
  1. 2 1
      ys_vue/src/port.js
  2. 34 6
      ys_vue/src/views/Home.vue

+ 2 - 1
ys_vue/src/port.js

@@ -60,7 +60,8 @@ export default {
 
         moldMaintain: '/mouldmaintain/maintain', //维护
         moldMaintainList: '/mouldmaintain/list', //获取列表
-        moldMaintainListGet: '/mould/maintainMouldList' //主页获取模具列表*
+        moldMaintainListGet: '/mould/maintainMouldList', //主页获取保养模具列表
+        moldDiscardListGet: '/mould/scrapMouldList' //主页获取报废模具列表
     },
     //基础管理
     base: {

+ 34 - 6
ys_vue/src/views/Home.vue

@@ -332,8 +332,35 @@ export default {
         this.$router.push("/detection/" + id);
       }
     },
-    //检查是否要进行提示
-    checkNotice() {
+    //检查是否要进行报废提示
+    checkDiscardNotice() {
+      this.http.post(
+        this.port.mold.moldDiscardListGet,
+        {},
+        res => {
+          if (res.code == "ok") {
+            //说明有东西需要保养
+            if (res.data.length > 0) {
+              this.notify("报废");
+            }
+          } else {
+            this.$message({
+              message: res.msg,
+              type: "error"
+            });
+          }
+        },
+        error => {
+          this.editLoading = false;
+          this.$message({
+            message: error,
+            type: "error"
+          });
+        }
+      );
+    },
+    //检查是否要进行保养提示
+    checkMaintainNotice() {
       this.http.post(
         this.port.mold.moldMaintainListGet,
         {},
@@ -341,7 +368,7 @@ export default {
           if (res.code == "ok") {
             //说明有东西需要保养
             if (res.data.length > 0) {
-              this.notify();
+              this.notify("保养");
             }
           } else {
             this.$message({
@@ -360,9 +387,9 @@ export default {
       );
     },
     //右上角弹窗警告
-    notify() {
+    notify(action) {
       this.$notify({
-        title: "有模具需要保养",
+        title: "有模具需要" + action,
         message: "请到消息列表中查看",
         type: "warning",
         duration: 0
@@ -371,7 +398,8 @@ export default {
   },
   mounted() {
     //检查是否需要进行提示
-    this.checkNotice();
+    this.checkMaintainNotice();
+    this.checkDiscardNotice();
     if (this.user) {
       var user = JSON.parse(this.user);
       this.user = user;