Browse Source

新增问题

East 4 years ago
parent
commit
bfdfdfc57b

+ 17 - 0
src/views/modules/basicdata/bperiod.vue

@@ -270,6 +270,23 @@ export default {
           this.form[key] = row[key]
         }
       }
+      // 解决猪舍、牧场已删除,但该页面仍不变问题
+      this.$http({
+        url: this.$http.adornUrl("/management/pasture/findAll"),
+        method: "post"
+      }).then(async ({ data }) => {
+        if (data && data.code === 0) {
+          this.pastureList = data.all
+          // 获取猪舍
+          let pighouseResult = await this.$http({
+            url: this.$http.adornUrl('/management/pigsty/findAll'),
+            method: 'post'
+          })
+          pighouseResult.data.all && (this.pighouseList = pighouseResult.data.all)
+          this.phSelectedList = this.pighouseList
+          console.log(this.pighouseList);
+        }
+      })
     },
     // 选择n个牧场
     selectionChangeHandle (val) {

+ 15 - 0
src/views/modules/basicdata/bpighouse.vue

@@ -255,6 +255,21 @@ export default {
           this.form[key] = row[key]
         }
       }
+      // 获取牧场
+      this.$http({
+        url: this.$http.adornUrl("/management/pasture/findAll"),
+        method: "post"
+      }).then(async ({ data }) => {
+        if (data && data.code === 0) {
+          this.pastureList = data.all
+          // 获取养殖员
+          let employeeResult = await this.$http({
+            url: this.$http.adornUrl("/management/employee/findAll"),
+            method: "post"
+          });
+          employeeResult.data.all && (this.employeeList = employeeResult.data.all)
+        }
+      })
     },
     // 选择n个牧场
     selectionChangeHandle(val) {

+ 17 - 0
src/views/modules/basicdata/bunit.vue

@@ -270,6 +270,23 @@ export default {
         }
         this.form.id = row.id
       }
+      // 解决猪舍、牧场已删除,但该页面仍不变问题
+      this.$http({
+        url: this.$http.adornUrl("/management/pasture/findAll"),
+        method: "post"
+      }).then(async ({ data }) => {
+        if (data && data.code === 0) {
+          this.pastureList = data.all
+          // 获取猪舍
+          let pighouseResult = await this.$http({
+            url: this.$http.adornUrl('/management/pigsty/findAll'),
+            method: 'post'
+          })
+          pighouseResult.data.all && (this.pighouseList = pighouseResult.data.all)
+          this.phSelectedList = this.pighouseList
+          console.log(this.pighouseList);
+        }
+      })
     },
     // 选择n个牧场
     selectionChangeHandle (val) {