From 8b38af408097c8c9e405ffcf3a7fc49d35ec7e4d Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Fri, 19 Aug 2022 09:45:25 +0800
Subject: [PATCH] 增加首页结束操作后会刷新页面,修复农事操作后再次操作页面排版问题

---
 src/views/wel/farming.vue |   10 +++++++++-
 src/views/wel/index.vue   |    9 ++++-----
 src/views/wel/land.vue    |    1 +
 src/views/wel/stock.vue   |    1 +
 src/views/wel/over.vue    |    1 +
 5 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/views/wel/farming.vue b/src/views/wel/farming.vue
index 9d1a30b..d959852 100644
--- a/src/views/wel/farming.vue
+++ b/src/views/wel/farming.vue
@@ -234,7 +234,14 @@
     "form.type": {
       handler(val) {
         var stockIdcolumn = this.findObject(this.option.column, "stockId");
-        if (val === "0" || val == 4 || val == 5 || val == 8 || val == 9) {
+        var numColumn = this.findObject(this.option.column,"num")
+        var snumColumn = this.findObject(this.option.column,"snum")
+        if(typeof val =="undefined"){
+          stockIdcolumn.display = false
+          numColumn.display =false
+          snumColumn.display = false
+        }
+        else if (val === "0" || val == 4 || val == 5 || val == 8 || val == 9) {
           stockIdcolumn.display = true;
         } else {
           stockIdcolumn.display = false;
@@ -335,6 +342,7 @@
               type: "success",
               message: "操作成功!",
             });
+            that.$emit("refreshOnLoad")
             done();
           },
           (error) => {
diff --git a/src/views/wel/index.vue b/src/views/wel/index.vue
index 9e8c61b..062e3a8 100644
--- a/src/views/wel/index.vue
+++ b/src/views/wel/index.vue
@@ -170,15 +170,15 @@
         <!-- 弹窗, 采收 -->
         <recovery v-if="recoveryVisible" ref="recovery" :farmDetail="farm"></recovery>
         <!-- 弹窗,结束种养-->
-        <over v-if="overVisible" ref="over"></over>
+        <over v-if="overVisible" ref="over" @refreshOnLoad="refreshAll"></over>
         <!-- 圈地 -->
-        <land v-if="landVisible" ref="land"></land>
+        <land v-if="landVisible" ref="land" @refreshOnLoad="refreshAll"></land>
         <!-- 种养品 -->
         <plant v-if="plantVisible" ref="plant" @refreshOnLoad="refreshAll"></plant>
         <!-- 农事操作 -->
-        <farming v-if="farmingVisible" ref="farming"></farming>
+        <farming v-if="farmingVisible" ref="farming" @refreshOnLoad="refreshAll"></farming>
         <!-- 农资入库 -->
-        <stock v-if="stockVisible" ref="stock"></stock>
+        <stock v-if="stockVisible" ref="stock" @refreshOnLoad="refreshAll"></stock>
     </div>
 </template>
 
@@ -338,7 +338,6 @@
         },
         //获取种植中的种养品
         onLoad () {
-            console.log(11111111111)
             var params = {
                 status: 1,
             }
diff --git a/src/views/wel/land.vue b/src/views/wel/land.vue
index 4c17014..86bd901 100644
--- a/src/views/wel/land.vue
+++ b/src/views/wel/land.vue
@@ -162,6 +162,7 @@
           type: "success",
           message: "操作成功!"
         });
+        this.$emit("refreshOnLoad")
         done();
       }, error => {
         done();
diff --git a/src/views/wel/over.vue b/src/views/wel/over.vue
index 7bb7ba1..2c32cc5 100644
--- a/src/views/wel/over.vue
+++ b/src/views/wel/over.vue
@@ -593,6 +593,7 @@
                         this.onLoad(this.page, this.query)
                     }
                 })
+                this.$emit("refreshOnLoad")
                 this.overVisible = false
             }
         },
diff --git a/src/views/wel/stock.vue b/src/views/wel/stock.vue
index 1f4dec3..b46cb2a 100644
--- a/src/views/wel/stock.vue
+++ b/src/views/wel/stock.vue
@@ -204,6 +204,7 @@
             type: "success",
             message: "操作成功!",
           });
+          that.$emit("refreshOnLoad")
           done();
         },
         (error) => {

--
Gitblit v1.9.3