From fd8e1acbc8bac690c020248b806fc4f06af1792e Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Thu, 26 Aug 2021 15:36:58 +0800
Subject: [PATCH] 禁止输入逻辑

---
 src/views/home/index.vue |   49 ++++++++++++++++++++++++++++++++-----------------
 1 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 053f03f..6fe51e3 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -92,6 +92,19 @@
     this.cc();
     this.onLoad(this.page);
     this.dataCard = ourDatas;
+    var cando = [];
+    for (var k in ourDatas) {
+      cando.push({
+        opens: true,
+        type: ourDatas[k].type,
+      });
+    }
+    this.$store.commit("setcanDoIt", cando);
+  },
+  watch: {
+    useWhere() {
+      this.onLoad(this.page);
+    },
   },
   methods: {
     onLoad(page, params = {}) {
@@ -105,25 +118,28 @@
             this.data = this.data.concat(resk.data.data.records);
             getListrev(page.currentPage, page.pageSize, params).then((resv) => {
               this.data = this.data.concat(resv.data.data.records);
-              console.log("已有申请数量", this.data.length);
-              if (this.data.length == 0) {
-                this.$store.commit("changecanDoIt", true);
-              } else {
-                this.$store.commit("changecanDoIt", false);
-              }
+              console.log("已有申请数量:", this.data.length);
               this.showCard = true;
               this.data.forEach((item) => {
                 for (const key in this.dataCard) {
-                  if (this.dataCard[key].ptype == item.ptype) {
-                    console.log("已申请名称", this.dataCard[key].menuName);
-                    console.log("申请状态", this.dataCard[key].type);
-                    if (
-                      this.dataCard[key].type == 0 ||
-                      this.dataCard[key].type == 2
-                    ) {
-                      this.$store.commit("changecanDoIt", false);
-                    } else {
-                      this.$store.commit("changecanDoIt", true);
+                  if (this.dataCard[key].type == item.ptype) {
+                    // console.log("已申请名称:", item.enterprisename);
+                    // console.log("已申请序号:", item.ptype);
+                    // console.log("申请状态:", item.type);
+                    for (var k in this.canDoIt) {
+                      if (this.canDoIt[k].type == item.ptype) {
+                        if (item.type == 0 || item.type == 2) {
+                          this.$store.commit("changecanDoIt", {
+                            o: false,
+                            ptype: item.ptype,
+                          });
+                        } else {
+                          this.$store.commit("changecanDoIt", {
+                            o: false,
+                            ptype: item.ptype,
+                          });
+                        }
+                      }
                     }
                   }
                 }
@@ -163,7 +179,6 @@
         this.$store.commit("doitApprovalShow", true);
         return;
       }
-      this.onLoad(this.page);
       this.$store.commit("changeuseWhere", val);
     },
   },

--
Gitblit v1.9.3