From b8ef6f8946de7dc00d9711eb6ba9d1aefe24cde1 Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Wed, 31 Aug 2022 11:09:28 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhny_web

---
 src/views/farm/stockUseInfo.vue                     |    2 
 src/views/wel/index.vue                             |   62 +++
 vue.config.js                                       |   10 
 src/page/index/index.vue                            |    1 
 src/views/farmplant/salelist.vue                    |    6 
 src/views/remote/remote.vue                         |   12 
 src/api/remote/remote.js                            |   22 +
 src/util/store.js                                   |   11 
 src/views/statistics/farmplantarea.vue              |    2 
 src/page/login/userlogin.vue                        |   23 +
 src/api/farmplant/farmplant.js                      |   11 
 src/util/eventBus.js                                |    2 
 src/store/modules/user.js                           |   36 +
 src/views/land/cs.vue                               |   20 
 src/api/user.js                                     |    5 
 src/components/map/plotMap.vue                      |    3 
 src/views/farmplant/processlist.vue                 |    2 
 src/router/axios.js                                 |    5 
 src/views/farmplant/retrievallist.vue               |    2 
 src/views/statistics/stock.vue                      |    2 
 src/views/mapPattern/index.vue                      |    7 
 src/views/recovery/recovery.vue                     |    8 
 src/views/statistics/farmproductstockstatistics.vue |    2 
 src/main.js                                         |    3 
 src/views/farmplant/inventorylist.vue               |    5 
 src/views/farmplant/farmplant.vue                   |    1 
 src/views/land/LandDetail.vue                       |  608 +++++++++++++++++----------------
 src/page/index/top/index.vue                        |    2 
 src/views/wel/plant.vue                             |   57 ++
 src/api/land/land.js                                |   10 
 src/page/index/top/top-search2.vue                  |  135 ++++---
 31 files changed, 668 insertions(+), 409 deletions(-)

diff --git a/src/api/farmplant/farmplant.js b/src/api/farmplant/farmplant.js
index e46b041..ebd381c 100644
--- a/src/api/farmplant/farmplant.js
+++ b/src/api/farmplant/farmplant.js
@@ -22,6 +22,17 @@
         }
     })
 }
+export const getStrainCountYM = (current, size, params) => {
+    return request({
+        url: '/api/farmPlant/strainCountYM',
+        method: 'get',
+        params: {
+            ...params,
+            current,
+            size,
+        }
+    })
+}
 export const remove = (ids) => {
     return request({
         url: '/api/farmPlant/remove',
diff --git a/src/api/land/land.js b/src/api/land/land.js
index e5076fd..c316e40 100644
--- a/src/api/land/land.js
+++ b/src/api/land/land.js
@@ -20,6 +20,16 @@
   })
 }
 
+export const getLandListNoPage = (params) => {
+  return request({
+    url: '/api/land/land/getLandList',
+    method: 'get',
+    params: {
+      ...params,
+    }
+  })
+}
+
 export const getDetail = (id) => {
   return request({
     url: '/api/land/land/details',
diff --git a/src/api/remote/remote.js b/src/api/remote/remote.js
index 91a100f..beacd89 100644
--- a/src/api/remote/remote.js
+++ b/src/api/remote/remote.js
@@ -12,6 +12,28 @@
   })
 }
 
+export const getPage = (current, size, params) => {
+  return request({
+    url: '/api/remote/remote/page',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const getSensing = (type) => {
+  return request({
+    url: '/api/remote/remote/getSensings',
+    method: 'get',
+    params:{
+      type:type
+    }
+  })
+}
+
 export const getDetail = (id) => {
   return request({
     url: '/api/remote/remote/detail',
diff --git a/src/api/user.js b/src/api/user.js
index ae41c7c..d60fb3b 100644
--- a/src/api/user.js
+++ b/src/api/user.js
@@ -1,6 +1,11 @@
 import request from '@/router/axios';
 import website from "@/config/website";
 
+export const loginInfoByToken = () => request({
+  url: '/api/blade-auth/getuser/token',
+  method: 'get',
+});
+
 export const loginByUsername = (tenantId, deptId, roleId, username, password, type, key, code) => request({
   url: '/api/blade-auth/oauth/token',
   method: 'post',
diff --git a/src/components/map/plotMap.vue b/src/components/map/plotMap.vue
index 632c6b5..ec98f0f 100644
--- a/src/components/map/plotMap.vue
+++ b/src/components/map/plotMap.vue
@@ -242,7 +242,7 @@
                 position += `${item[0]}, ${item[1]};`
             })
 
-            console.log(position, 565656)
+            // console.log(position, 565656)
 
             const polyline = new global.DC.Polyline(position)
             polyline.setStyle({
@@ -323,7 +323,6 @@
                 that.drawLandPolyLine(positions)
             })
 
-            console.log(item, 123)
 
             plotRegionLayer.addOverlay(polygon)
             addPlotLayers.push({ center, name: item.landName, id: item.id })
diff --git a/src/main.js b/src/main.js
index 6ed828e..af24080 100644
--- a/src/main.js
+++ b/src/main.js
@@ -89,6 +89,9 @@
     loadStyle(iconfontUrl.replace('$key', ele))
 })
 
+
+Vue.prototype.$EventBus = new Vue()
+
 Vue.config.productionTip = false
 
 new Vue({
diff --git a/src/page/index/index.vue b/src/page/index/index.vue
index 7e1ad9e..088601c 100644
--- a/src/page/index/index.vue
+++ b/src/page/index/index.vue
@@ -38,6 +38,7 @@
   import {validatenull} from "@/util/validate";
   import {calcDate} from "@/util/date.js";
   import {getStore} from "@/util/store.js";
+  import {Message} from "element-ui";
 
   export default {
     components: {
diff --git a/src/page/index/top/index.vue b/src/page/index/top/index.vue
index f6a128b..20bcf5a 100644
--- a/src/page/index/top/index.vue
+++ b/src/page/index/top/index.vue
@@ -87,7 +87,7 @@
                     ></i>
                 </div>
             </el-tooltip>
-            <img class="top-bar__img" :src="userInfo.avatar" />
+            <img class="top-bar__img" :src="'/zhny-web/' + userInfo.avatar" />
             <el-dropdown>
                 <span class="el-dropdown-link">
                     {{userInfo.userName}}
diff --git a/src/page/index/top/top-search2.vue b/src/page/index/top/top-search2.vue
index a71fafc..8642f57 100644
--- a/src/page/index/top/top-search2.vue
+++ b/src/page/index/top/top-search2.vue
@@ -1,86 +1,95 @@
 <template>
-  <el-select class="top-search" v-model="farm.id" placeholder="请选择所属农场" filterable @change="farmChange">
+  <el-select
+    class="top-search"
+    v-model="farm.id"
+    placeholder="请选择所属农场"
+    filterable
+    @change="farmChange"
+  >
     <el-option
       v-for="item in farmList"
       :key="item.id"
       :label="item.farmName"
-      :value="item.id">
+      :value="item.id"
+    >
     </el-option>
   </el-select>
 </template>
 
 <script>
-  import config from "../sidebar/config.js";
-  import {mapGetters} from "vuex";
-  import {getFarmList} from "@/api/farm/farm";
+import config from "../sidebar/config.js";
+import { mapGetters } from "vuex";
+import { getFarmList } from "@/api/farm/farm";
 
-  export default {
-    data() {
-      return {
-        config: config,
-        value: "",
-        farm:{id:11},
-        farmList:[]
-      };
-    },
-    created() {
-      let ids = ''
-      if (this.userInfo.role_name != "administrator") {
-        ids = this.userInfo.farmId
-      }
-      let params = {
-        ids : ids
-      }
-      getFarmList(params).then(res => {
-        this.farmList = res.data.data
-      })
-      this.$nextTick(() => {
-        this.farm.id = parseInt(this.userInfo.farmId.split(',')[0])
-        this.$store.commit("SET_FARMID", this.farm.id )
-      })
-    },
-    computed: {
-      ...mapGetters(['userInfo', '$farmId'])
-    },
-    methods: {
+export default {
+  name: "top-search",
+  data() {
+    return {
+      config: config,
+      value: "",
+      farm: { id: 11 },
+      farmList: [],
+    };
+  },
+  created() {
+    this.$EventBus.$on("setFarmId", this.farmChange);
 
-      farmChange(data) {
-        this.farm.id = data
-        this.$store.commit("SET_FARMID", data)
-      }
+    let ids = "";
+    if (this.userInfo.role_name != "administrator") {
+      ids = this.userInfo.farmId;
     }
-  };
+    let params = {
+      ids: ids,
+    };
+    getFarmList(params).then((res) => {
+      this.farmList = res.data.data;
+    });
+    this.$nextTick(() => {
+      this.farm.id = parseInt(this.userInfo.farmId.split(",")[0]);
+      this.$store.commit("SET_FARMID", this.farm.id);
+    });
+  },
+  computed: {
+    ...mapGetters(["userInfo", "$farmId"]),
+  },
+  methods: {
+    farmChange(data) {
+      this.farm.id = data;
+      this.$store.commit("SET_FARMID", data);
+    },
+  },
+};
 </script>
 
 <style lang="scss">
-  .my-autocomplete {
-    li {
-      line-height: normal;
-      padding: 7px;
+.my-autocomplete {
+  li {
+    line-height: normal;
+    padding: 7px;
 
-      .icon {
-        margin-right: 5px;
-        display: inline-block;
-        vertical-align: middle;
-      }
+    .icon {
+      margin-right: 5px;
+      display: inline-block;
+      vertical-align: middle;
+    }
 
-      .name {
-        display: inline-block;
-        text-overflow: ellipsis;
-        overflow: hidden;
-        vertical-align: middle;
-      }
+    .name {
+      display: inline-block;
+      text-overflow: ellipsis;
+      overflow: hidden;
+      vertical-align: middle;
+    }
 
-      .addr {
-        padding-top: 5px;
-        width: 100%;
-        font-size: 12px;
-        color: #b4b4b4;
-      }
+    .addr {
+      padding-top: 5px;
+      width: 100%;
+      font-size: 12px;
+      color: #b4b4b4;
+    }
 
-      .highlighted .addr {
-        color: #ddd;
-      }
+    .highlighted .addr {
+      color: #ddd;
     }
   }
+}
 </style>
diff --git a/src/page/login/userlogin.vue b/src/page/login/userlogin.vue
index ac3c33b..2a1c180 100644
--- a/src/page/login/userlogin.vue
+++ b/src/page/login/userlogin.vue
@@ -72,8 +72,9 @@
 <script>
   import {mapGetters} from "vuex";
   import {info} from "@/api/system/tenant";
-  import {getCaptcha} from "@/api/user";
+  import {getCaptcha, loginInfoByToken} from "@/api/user";
   import {getTopUrl} from "@/util/util";
+  import {Message} from "element-ui";
 
   export default {
     name: "userlogin",
@@ -170,6 +171,11 @@
       this.refreshCode();
     },
     mounted() {
+      //统一登录有没有登录
+      const token = window.sessionStorage.getItem('token')
+      if (token) {
+        this.loginInfoByToken();
+      }
     },
     watch: {
       'loginForm.deptId'() {
@@ -263,6 +269,21 @@
             this.$parent.$refs.login.style.backgroundImage = `url(${data.data.backgroundUrl})`;
           }
         })
+      },
+      // 统一登陆获取用户
+      loginInfoByToken() {
+        const loading = this.$loading({
+          lock: true,
+          text: '登录中,请稍后。。。',
+          spinner: "el-icon-loading"
+        });
+        this.$store.dispatch("loginInfoByToken").then(() => {
+          this.$router.push({path: this.tagWel.value});
+          loading.close();
+        }).catch(() => {
+          loading.close();
+          this.refreshCode();
+        });
       }
     }
   };
diff --git a/src/router/axios.js b/src/router/axios.js
index 7b0a00d..101fa8a 100644
--- a/src/router/axios.js
+++ b/src/router/axios.js
@@ -39,6 +39,11 @@
   if (getToken() && !isToken) {
     config.headers[website.tokenHeader] = 'bearer ' + getToken()
   }
+  // 获取统一登录携带的token
+  const tokensso = window.sessionStorage.getItem('token')
+  if (tokensso) {
+    config.headers[website.tokenHeader] = 'bearer ' + tokensso
+  }
   //headers中配置text请求
   if (config.text === true) {
     config.headers["Content-Type"] = "text/plain";
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 857110c..2fdc3b8 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -4,7 +4,15 @@
 import {isURL, validatenull} from '@/util/validate'
 import {deepClone} from '@/util/util'
 import website from '@/config/website'
-import {loginByUsername, loginBySocial, getUserInfo, logout, refreshToken, getButtons} from '@/api/user'
+import {
+  loginByUsername,
+  loginBySocial,
+  getUserInfo,
+  logout,
+  refreshToken,
+  getButtons,
+  loginInfoByToken
+} from '@/api/user'
 import {getTopMenu, getRoutes} from '@/api/system/menu'
 import md5 from 'js-md5'
 
@@ -46,6 +54,30 @@
     $farmId: 0
   },
   actions: {
+    loginInfoByToken({commit}) {
+      return new Promise((resolve,reject) => {
+        loginInfoByToken().then(res => {
+          const data = res.data
+          if (data.code == 200) {
+            commit('SET_TOKEN', data.data.access_token)
+            commit('SET_REFRESH_TOKEN', data.data.refresh_token)
+            commit('SET_TENANT_ID', data.data.tenant_id)
+            commit('SET_USER_INFO', data.data)
+            commit('DEL_ALL_TAG')
+            commit('CLEAR_LOCK')
+
+          } else {
+            Message({
+              message: data.error_description,
+              type: 'error'
+            })
+          }
+          resolve();
+        }).catch(error => {
+          reject(error);
+        })
+      })
+    },
     //根据用户名登录
     LoginByUsername({commit}, userInfo) {
       return new Promise((resolve, reject) => {
@@ -244,7 +276,7 @@
     },
     SET_USER_INFO: (state, userInfo) => {
       if (validatenull(userInfo.avatar)) {
-        userInfo.avatar = "/img/bg/mg.png";
+        userInfo.avatar = "/zhny-web/img/bg/mg.png";
       }
       state.userInfo = userInfo;
       setStore({name: 'userInfo', content: state.userInfo})
diff --git a/src/util/eventBus.js b/src/util/eventBus.js
new file mode 100644
index 0000000..b8baaeb
--- /dev/null
+++ b/src/util/eventBus.js
@@ -0,0 +1,2 @@
+import Vue from 'vue'
+export const EventBus = new Vue()
\ No newline at end of file
diff --git a/src/util/store.js b/src/util/store.js
index 6388ec2..a63a21e 100644
--- a/src/util/store.js
+++ b/src/util/store.js
@@ -13,6 +13,14 @@
         content,
         type,
     } = params;
+    if (name == 'token') {
+        window.sessionStorage.setItem('token', content);
+        window.localStorage.setItem('token', content);
+    }
+    if (name == 'refreshToken') {
+        window.sessionStorage.setItem('refresh_token', content);
+        window.localStorage.setItem('refresh_token', content);
+    }
     name = keyName + name
     let obj = {
         dataType: typeof (content),
@@ -26,7 +34,6 @@
 /**
  * 获取localStorage
  */
-
 export const getStore = (params = {}) => {
     let {
         name,
@@ -118,4 +125,4 @@
         window.localStorage.clear()
     }
 
-}
\ No newline at end of file
+}
diff --git a/src/views/farm/stockUseInfo.vue b/src/views/farm/stockUseInfo.vue
index 5f93b3a..8b7ed17 100644
--- a/src/views/farm/stockUseInfo.vue
+++ b/src/views/farm/stockUseInfo.vue
@@ -211,13 +211,11 @@
             this.onLoad(this.page, this.query)
         },
         onLoad (page, params = {}) {
-            console.log(params)
             this.loading = true
             var datas = this.$route.query.id
             params.landId = datas
             params['tenantId'] = this.userInfo.tenant_id
             params['farmId'] = this.$farmId
-            console.log(params)
             if (this.landId) {
                 params['landId'] = this.landId
             }
diff --git a/src/views/farmplant/farmplant.vue b/src/views/farmplant/farmplant.vue
index a5d0707..16db0fa 100644
--- a/src/views/farmplant/farmplant.vue
+++ b/src/views/farmplant/farmplant.vue
@@ -675,6 +675,7 @@
     methods: {
         //初始化数据
         initData () {
+            console.log(this.$farmId,66666666666)
             var that = this
             //获取农地数据
             getLandList(this.$farmId).then((res) => {
diff --git a/src/views/farmplant/inventorylist.vue b/src/views/farmplant/inventorylist.vue
index 1808e3b..c3b356b 100644
--- a/src/views/farmplant/inventorylist.vue
+++ b/src/views/farmplant/inventorylist.vue
@@ -65,7 +65,7 @@
                         hide: true,
                         display: true,
                         type: "select",
-                        dicUrl: 'api/strain/strain-tree',
+                        dicUrl: '/api/strain/strain-tree',
                         props: {
                             label: "strainName",
                             value: "id"
@@ -126,6 +126,9 @@
                      //单位处理
                     this.data.forEach((e)=>{
                         e.saleNum = e.saleNum + " 公斤"
+                        if(e.type == 1){
+                            e.proName = e.proName+"("+e.strainName+")"
+                        }
                     })
                     this.page.total = res.data.data.total
                     this.loading = false
diff --git a/src/views/farmplant/processlist.vue b/src/views/farmplant/processlist.vue
index 6a576f3..095e90b 100644
--- a/src/views/farmplant/processlist.vue
+++ b/src/views/farmplant/processlist.vue
@@ -67,7 +67,7 @@
                         hide: true,
                         display: false,
                         type: "select",
-                        dicUrl: 'api/strain/strain-tree',
+                        dicUrl: '/api/strain/strain-tree',
                         props: {
                             label: "strainName",
                             value: "id"
diff --git a/src/views/farmplant/retrievallist.vue b/src/views/farmplant/retrievallist.vue
index a63f6f7..3f0d04a 100644
--- a/src/views/farmplant/retrievallist.vue
+++ b/src/views/farmplant/retrievallist.vue
@@ -65,7 +65,7 @@
                         hide: true,
                         display: true,
                         type: "select",
-                        dicUrl: 'api/strain/strain-tree',
+                        dicUrl: '/api/strain/strain-tree',
                         props: {
                             label: "strainName",
                             value: "id"
diff --git a/src/views/farmplant/salelist.vue b/src/views/farmplant/salelist.vue
index 90f808b..bc3d4f3 100644
--- a/src/views/farmplant/salelist.vue
+++ b/src/views/farmplant/salelist.vue
@@ -65,7 +65,7 @@
                         hide: true,
                         display: false,
                         type: "select",
-                        dicUrl: 'api/strain/strain-tree',
+                        dicUrl: '/api/strain/strain-tree',
                         props: {
                             label: "strainName",
                             value: "id"
@@ -126,12 +126,16 @@
             this.loading = true
             params['farmId'] = this.$farmId
             getPage(page.currentPage, page.pageSize, Object.assign(params, this.query)).then((res) => {
+                console.log(res)
                 if (res.data.code == 200) {
                     this.data = res.data.data.records
                     //单位处理
                     this.data.forEach((e)=>{
                         e.saleNum = e.saleNum + " 公斤"
                         e.salePrice = e.salePrice + " 元/公斤"
+                        if(e.type == 1){
+                            e.proName = e.proName+"("+e.strainName+")"
+                        }
                     })
                     this.page.total = res.data.data.total
                     this.loading = false
diff --git a/src/views/land/LandDetail.vue b/src/views/land/LandDetail.vue
index c33c5e9..1512e32 100644
--- a/src/views/land/LandDetail.vue
+++ b/src/views/land/LandDetail.vue
@@ -1,357 +1,369 @@
 <template>
-    <div class="wraaper-box farming-detail-box">
-        <div class="dd">
-            <div class="da">
-                <!--                <div class="land-img" @click="mod(usePolygons)">-->
-                <div class="land-img">
-                    <img v-if="url" :src="url" class="landimg" />
-                    <img v-else src="../../../public/img/bg/noimage.jpg" class="landimg" />
-                </div>
-                <div class="cent">
-                    <div class="l">{{ landName }}</div>
-                    <div class="ln">{{ dic }}</div>
-                </div>
-                <div class="dc">占地面积:{{ landArea }}{{ dica }}</div>
-                <div class="dck">所属农场:{{ deptname }}</div>
-
-                <div class="edit">
-                    <el-button @click="btnGrounpShow = !btnGrounpShow" icon="el-icon-menu"></el-button>
-
-                    <div v-show="btnGrounpShow" class="btn-grounp">
-                        <el-button size="small" @click="DelLand(delId)">删除地块</el-button>
-                        <el-button size="small" @click="land">编辑地块</el-button>
-                    </div>
-                </div>
-            </div>
-            <div class="dv">
-                <el-tabs v-model="activeName" @tab-click="handleClick">
-                    <!-- 种植记录 -->
-                    <el-tab-pane label="种养品种" name="tab1">
-                        <farmplant></farmplant>
-                    </el-tab-pane>
-                    <!-- 农事记录 -->
-                    <el-tab-pane label="农事记录" name="tab2">
-                        <farming></farming>
-                    </el-tab-pane>
-                    <!-- 采收记录 -->
-                    <el-tab-pane label="采收记录" name="tab3">
-                        <recovery></recovery>
-                    </el-tab-pane>
-                    <!-- 农资记录 -->
-                    <el-tab-pane label="农资使用记录" name="tab4">
-                        <stockUseInfo></stockUseInfo>
-                    </el-tab-pane>
-                </el-tabs>
-            </div>
+  <div class="wraaper-box farming-detail-box">
+    <div class="dd">
+      <div class="da">
+        <!--                <div class="land-img" @click="mod(usePolygons)">-->
+        <div class="land-img">
+          <img v-if="url" :src="url" class="landimg" />
+          <img
+            v-else
+            src="../../../public/img/bg/noimage.jpg"
+            class="landimg"
+          />
         </div>
+        <div class="cent">
+          <div class="l">{{ landName }}</div>
+          <div class="ln">{{ dic }}</div>
+        </div>
+        <div class="dc">占地面积:{{ landArea }}{{ dica }}</div>
+        <div class="dck">所属农场:{{ deptname }}</div>
 
-        <!--        <el-dialog-->
-        <!--            title="地块位置"-->
-        <!--            class="current-map-box"-->
-        <!--            :visible.sync="gradeBoxVisible1"-->
-        <!--            :modal="true"-->
-        <!--            :modal-append-to-body="true"-->
-        <!--            :append-to-body="true"-->
-        <!--            :close-on-click-modal="false"-->
-        <!--            :close-on-press-escape="false"-->
-        <!--            :before-close="dialogBeforeClose"-->
-        <!--        >-->
-        <!--            <getMapDataInThere ref="getMapData" id="getMapData" @setMapData="setMapData"></getMapDataInThere>-->
-        <!--            <el-button class="save" type="success" @click="upLand()">保存</el-button>-->
-        <!--        </el-dialog>-->
-        <landUpdate v-if="landVisible" ref="landUpdate" id="landUpdate"></landUpdate>
+        <div class="edit">
+          <el-button
+            @click="btnGrounpShow = !btnGrounpShow"
+            icon="el-icon-menu"
+          ></el-button>
+
+          <div v-show="btnGrounpShow" class="btn-grounp">
+            <el-button size="small" @click="DelLand(delId)">删除地块</el-button>
+            <el-button style="margin-left:0px" size="small" @click="land">编辑地块</el-button>
+          </div>
+        </div>
+      </div>
+      <div class="dv">
+        <el-tabs v-model="activeName" @tab-click="handleClick">
+          <!-- 种植记录 -->
+          <el-tab-pane label="种养品种" name="tab1">
+            <farmplant></farmplant>
+          </el-tab-pane>
+          <!-- 农事记录 -->
+          <el-tab-pane label="农事记录" name="tab2">
+            <farming></farming>
+          </el-tab-pane>
+          <!-- 采收记录 -->
+          <el-tab-pane label="采收记录" name="tab3">
+            <recovery></recovery>
+          </el-tab-pane>
+          <!-- 农资记录 -->
+          <el-tab-pane label="农资使用记录" name="tab4">
+            <stockUseInfo></stockUseInfo>
+          </el-tab-pane>
+        </el-tabs>
+      </div>
     </div>
+
+    <!--        <el-dialog-->
+    <!--            title="地块位置"-->
+    <!--            class="current-map-box"-->
+    <!--            :visible.sync="gradeBoxVisible1"-->
+    <!--            :modal="true"-->
+    <!--            :modal-append-to-body="true"-->
+    <!--            :append-to-body="true"-->
+    <!--            :close-on-click-modal="false"-->
+    <!--            :close-on-press-escape="false"-->
+    <!--            :before-close="dialogBeforeClose"-->
+    <!--        >-->
+    <!--            <getMapDataInThere ref="getMapData" id="getMapData" @setMapData="setMapData"></getMapDataInThere>-->
+    <!--            <el-button class="save" type="success" @click="upLand()">保存</el-button>-->
+    <!--        </el-dialog>-->
+    <landUpdate
+      v-if="landVisible"
+      ref="landUpdate"
+      id="landUpdate"
+    ></landUpdate>
+  </div>
 </template>
 
 <script>
-import { mapGetters } from "vuex"
-import farmplant from "@/views/farmplant/farmplant.vue"
-import farming from "@/views/farm/farmingrecord.vue"
-import recovery from "@/views/recovery/recovery.vue"
-import stockUseInfo from "@/views/farm/stockUseInfo.vue"
-import getMapDataInThere from "./getMapDataInThere.vue"
-import { getList, remove, update } from "@/api/land/land"
-import landUpdate from "./landUpdate"
+import { mapGetters } from "vuex";
+import farmplant from "@/views/farmplant/farmplant.vue";
+import farming from "@/views/farm/farmingrecord.vue";
+import recovery from "@/views/recovery/recovery.vue";
+import stockUseInfo from "@/views/farm/stockUseInfo.vue";
+import getMapDataInThere from "./getMapDataInThere.vue";
+import { getList, remove, update } from "@/api/land/land";
+import landUpdate from "./landUpdate";
+import topSearch2Vue from "../../page/index/top/top-search2.vue";
 
 export default {
-    components: {
-        farmplant,
-        farming,
-        recovery,
-        stockUseInfo,
-        landUpdate,
-        getMapDataInThere
+  components: {
+    farmplant,
+    farming,
+    recovery,
+    stockUseInfo,
+    landUpdate,
+    getMapDataInThere,
+  },
+  data() {
+    return {
+      farmId: "",
+      activeName: "tab1",
+      url: "",
+      dica: "",
+      deptname: "",
+      landUnit: "",
+      delId: "",
+      landArea: "",
+      usePolygons: "",
+      dic: "",
+      formC: {},
+      gradeBoxVisible1: false,
+      landVisible: false,
+      option2: {
+        index: true,
+        tip: false,
+        searchMenuSpan: 6,
+        height: 583,
+        menuWidth: 300,
+        border: true,
+        align: "center",
+        selection: true,
+        column: [
+          {
+            label: "路线展示",
+            labelWidth: "0",
+            prop: "line",
+            className: "mapClass",
+            hide: true,
+            display: true,
+            span: 24,
+            formslot: true,
+            addDisplay: true,
+          },
+        ],
+      },
+      btnGrounpShow: false,
+    };
+  },
+  computed: {
+    ...mapGetters(["userInfo", "permission", "polygons", "$farmId"]),
+  },
+  created() {
+    this.$nextTick(() => {
+        this.$EventBus.$emit("setFarmId", this.$route.query.farmId-0);
+    });
+  },
+  methods: {
+    //圈地
+    land() {
+      this.landVisible = true;
+      this.$nextTick(() => {
+        this.$refs.landUpdate.init();
+      });
     },
-    data () {
-        return {
-            farmId: "",
-            activeName: "tab1",
-            url: "",
-            dica: "",
-            deptname: "",
-            landUnit: "",
-            delId: "",
-            landArea: "",
-            usePolygons: "",
-            dic: "",
-            formC: {},
-            gradeBoxVisible1: false,
-            landVisible: false,
-            option2: {
-                index: true,
-                tip: false,
-                searchMenuSpan: 6,
-                height: 583,
-                menuWidth: 300,
-                border: true,
-                align: "center",
-                selection: true,
-                column: [
-                    {
-                        label: "路线展示",
-                        labelWidth: "0",
-                        prop: "line",
-                        className: "mapClass",
-                        hide: true,
-                        display: true,
-                        span: 24,
-                        formslot: true,
-                        addDisplay: true
-                    }
-                ],
-            },
-            btnGrounpShow: false
-        }
+    openLandUpdate(page, params = {}) {
+      // getList(1, 10, Object.assign(params, this.query)).then(res => {
+      //   const data = res.data.data
+      //
+      //   this.farmPlanList = data.records
+      // })
     },
-    computed: {
-        ...mapGetters(["userInfo", "permission", "polygons"]),
+    mod(usePolygons) {
+      this.gradeBoxVisible1 = true;
+      this.$refs.getMapData.draw(usePolygons);
     },
-    created () {
-
+    setMapData(val) {
+      this.LineData = val[0];
+      this.PointData = val[1];
     },
-    methods: {
-        //圈地
-        land () {
-            this.landVisible = true
-            this.$nextTick(() => {
-                this.$refs.landUpdate.init()
-            })
-        },
-        openLandUpdate (page, params = {}) {
-            console.log('11111111111refreshOnLoad')
-            // getList(1, 10, Object.assign(params, this.query)).then(res => {
-            //   const data = res.data.data
-            //
-            //   this.farmPlanList = data.records
-            // })
-        },
-        mod (usePolygons) {
-            this.gradeBoxVisible1 = true
-            this.$refs.getMapData.draw(usePolygons)
-        },
-        setMapData (val) {
-            this.LineData = val[0]
-            this.PointData = val[1]
-        },
-        //删除地块
-        DelLand (delId) {
-            this.$confirm("确定将选择数据删除?", {
-                confirmButtonText: "确定",
-                cancelButtonText: "取消",
-                type: "warning"
-            })
-                .then(() => {
-                    return remove(delId)
-                })
-                .then(() => {
-                    this.$message({
-                        type: "success",
-                        message: "操作成功!"
-                    })
-                    var arr = [];
-                    this.$store.state.tags.tagList.forEach((item) => {
-                      if (item.label != "地块详情") {
-                        arr.push(item);
-                      }
-                    });
-                    this.$store.state.tags.tagList = arr;
-                    this.$router.back()
-                })
-        },
-        //修改地块
-        upLand () {
-            var params = {}
-            if (this.polygons.length == 0) {
-                //没有面的数据
-                this.$refs.getMapData.isCheck = true
-                // loading()
-            } else {
-                //如果有值,空间坐标转换
-                let pol = this.polygons
-                let polLength = this.polygons.length - 1
-                let usePolygons = ""
-                for (let k in pol) {
-                    usePolygons += pol[k].lng + "," + pol[k].lat
-                    if (k != polLength) {
-                        usePolygons += ";"
-                    }
-                }
-                //设置坐标点
-                params.userId = this.userInfo.user_id
-                params.landRange = usePolygons
-                params.id = this.delId,
-                    params.landUnit = this.landUnit
+    //删除地块
+    DelLand(delId) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(delId);
+        })
+        .then(() => {
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          var arr = [];
+          this.$store.state.tags.tagList.forEach((item) => {
+            if (item.label != "地块详情") {
+              arr.push(item);
             }
-            // update(params).then(() => {
-            //   that.$refs.form.resetFields();
-            //   that.visible = false;
-            //   this.$message({
-            //     type: "success",
-            //     message: "操作成功!"
-            //   });
-            //   done();
-            // }, error => {
-            //   loading();
-            //   window.console.log(error);
-            // });
-        }
+          });
+          this.$store.state.tags.tagList = arr;
+          this.$router.back();
+        });
     },
-    watch: {
-        '$route.query': {
-            immediate: true,
-            handler (newData, oldData) {
-                this.url = this.$route.query.url
-                this.landName = this.$route.query.landName
-                this.dic = this.$route.query.dic
-                this.landArea = this.$route.query.landArea
-                this.dica = this.$route.query.dica
-                this.deptname = this.$route.query.deptname
-                this.delId = this.$route.query.id
-                this.landUnit = this.$route.query.landUnit
-                // this.form = res.data.data;
-                this.usePolygons = this.$route.query.landRange
-                    .split("POLYGON((")[1]
-                    .split("))")[0]
-                    .split(",")
-            }
+    //修改地块
+    upLand() {
+      var params = {};
+      if (this.polygons.length == 0) {
+        //没有面的数据
+        this.$refs.getMapData.isCheck = true;
+        // loading()
+      } else {
+        //如果有值,空间坐标转换
+        let pol = this.polygons;
+        let polLength = this.polygons.length - 1;
+        let usePolygons = "";
+        for (let k in pol) {
+          usePolygons += pol[k].lng + "," + pol[k].lat;
+          if (k != polLength) {
+            usePolygons += ";";
+          }
         }
+        //设置坐标点
+        params.userId = this.userInfo.user_id;
+        params.landRange = usePolygons;
+        (params.id = this.delId), (params.landUnit = this.landUnit);
+      }
+      // update(params).then(() => {
+      //   that.$refs.form.resetFields();
+      //   that.visible = false;
+      //   this.$message({
+      //     type: "success",
+      //     message: "操作成功!"
+      //   });
+      //   done();
+      // }, error => {
+      //   loading();
+      //   window.console.log(error);
+      // });
     },
-}
+  },
+  watch: {
+    "$route.query": {
+      immediate: true,
+      handler(newData, oldData) {
+        this.url = this.$route.query.url;
+        this.landName = this.$route.query.landName;
+        this.dic = this.$route.query.dic;
+        this.landArea = this.$route.query.landArea;
+        this.dica = this.$route.query.dica;
+        this.deptname = this.$route.query.deptname;
+        this.delId = this.$route.query.id;
+        this.landUnit = this.$route.query.landUnit;
+        // this.form = res.data.data;
+        this.usePolygons = this.$route.query.landRange
+          // .split("POLYGON((")[1]
+          // .split("))")[0]
+          .split(",");
+      },
+    },
+  },
+};
 </script>
 
 <style scoped lang="scss">
 #getMapData {
-    position: absolute;
-    top: 0;
-    left: 0;
-    right: 0;
-    bottom: 0;
-    margin: auto;
-    width: 100%;
-    height: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  margin: auto;
+  width: 100%;
+  height: 100%;
 }
 
 .wraaper-box {
-    padding: 0 !important;
-    position: absolute;
-    top: 40px;
-    left: 0;
-    width: 100%;
-    height: calc(100% - 40px);
+  padding: 0 !important;
+  position: absolute;
+  top: 40px;
+  left: 0;
+  width: 100%;
+  height: calc(100% - 40px);
 }
 
 .land-img {
-    width: 200px;
-    height: 200px;
-    margin-top: 25px;
-    margin-left: 60px;
-    float: left;
+  width: 200px;
+  height: 200px;
+  margin-top: 25px;
+  margin-left: 60px;
+  float: left;
 }
 
 .cent {
-    width: 250px;
-    height: 40px;
-    margin-top: 25px;
-    margin-left: 40px;
-    float: left;
-    text-align: center;
-    line-height: 40px;
+  width: 250px;
+  height: 40px;
+  margin-top: 25px;
+  margin-left: 40px;
+  float: left;
+  text-align: center;
+  line-height: 40px;
 }
 
 .l {
-    width: 120px;
-    height: 40px;
-    float: left;
-    text-align: center;
-    line-height: 40px;
+  width: 120px;
+  height: 40px;
+  float: left;
+  text-align: center;
+  line-height: 40px;
 }
 
 .ln {
-    width: 120px;
-    height: 40px;
-    margin-left: 2px;
-    float: left;
-    text-align: center;
-    line-height: 40px;
-    display: inline-block;
-    vertical-align: 1px;
-    border-radius: 3px;
+  width: 120px;
+  height: 40px;
+  margin-left: 2px;
+  float: left;
+  text-align: center;
+  line-height: 40px;
+  display: inline-block;
+  vertical-align: 1px;
+  border-radius: 3px;
 }
 
 .dc {
-    width: 151px;
-    margin-top: 20px;
-    margin-left: 340px;
-    width: 175px;
+  width: 151px;
+  margin-top: 20px;
+  margin-left: 340px;
+  width: 175px;
 }
 
 .dck {
-    width: 151px;
-    margin-left: 340px;
-    width: 175px;
+  width: 151px;
+  margin-left: 340px;
+  width: 175px;
 }
 
 .landimg {
-    width: 200px;
-    height: 200px;
+  width: 200px;
+  height: 200px;
 }
 
 .dd {
-    padding: 10px;
-    wdith: 100%;
-    height: 100%;
-    display: flex;
-    flex-direction: column;
-    box-sizing: border-box;
+  padding: 10px;
+  wdith: 100%;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  box-sizing: border-box;
 }
 
 .da {
-    position: relative;
-    width: 100%;
-    line-height: 60px;
-    background: #fff;
+  position: relative;
+  width: 100%;
+  line-height: 60px;
+  background: #fff;
 
-    .edit {
-        position: absolute;
-        top: 25px;
-        right: 60px;
+  .edit {
+    position: absolute;
+    top: 25px;
+    right: 60px;
 
-        .btn-grounp {
-            padding: 0 10px;
-            position: absolute;
-            top: 40px;
-            right: 60px;
-            background: #fff;
-            box-shadow: 0 0 10px 1px #ccc;
-        }
+    .btn-grounp {
+      padding: 0 10px;
+      position: absolute;
+      top: 40px;
+      right: 60px;
+      background: #fff;
+      box-shadow: 0 0 10px 1px #ccc;
     }
+  }
 }
 
 .dv {
-    flex: 1;
-    line-height: 60px;
-    background: #fff;
-    width: 100%;
-    overflow: hidden;
+  flex: 1;
+  line-height: 60px;
+  background: #fff;
+  width: 100%;
+  overflow: hidden;
 }
 </style>
diff --git a/src/views/land/cs.vue b/src/views/land/cs.vue
index b6ca830..0e0d4a9 100644
--- a/src/views/land/cs.vue
+++ b/src/views/land/cs.vue
@@ -143,14 +143,24 @@
     watch: {
         '$farmId': {
             handler (newName, oldName) {
-                this.farm.id = newName
+                // this.farm.id = newName
                 //地块页面
-                this.onLoad()
+                setTimeout(() => {
+                    this.onLoad()
+                }, 100);
+
             }
         }
     },
     created () {
-        this.farm.id = this.$farmId
+        this.$EventBus.$on('getFarmObj', (farmObj)=>{
+            // this.$nextTick(() => {
+            //     this.$EventBus.$emit("setFarmId", farmObj.id);
+            // });
+            setTimeout(() => {
+                this.$EventBus.$emit("setFarmId", farmObj.id);
+            }, 100);
+        })
         this.onLoad(this.page)
     },
     methods: {
@@ -204,7 +214,7 @@
             if (typeof (page) == "undefined") {
                 page = this.page
             }
-            Object.assign(params, { farmId: this.farm.id })
+            Object.assign(params, { farmId: this.$farmId })
             getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                 const data = res.data.data
                 this.page.total = data.total
@@ -322,7 +332,7 @@
                     left: 1;
                     bottom: 0;
                     margin: auto;
-                    width: 80px;
+                    width: 120px;
                     height: 24px;
                     line-height: 24px;
                     border: 1px solid #64c3a4;
diff --git a/src/views/mapPattern/index.vue b/src/views/mapPattern/index.vue
index 385204d..ffa60d6 100644
--- a/src/views/mapPattern/index.vue
+++ b/src/views/mapPattern/index.vue
@@ -255,8 +255,11 @@
                     }
                 })
 
-                this.plotPlantBreed = arr
+                arr.forEach((e)=>{
+                    e.area = e.area.toFixed(3)
+                })
 
+                this.plotPlantBreed = arr
 
                 this.loading = false
 
@@ -300,6 +303,7 @@
         },
         //返回上一页
         goToBack () {
+            this.$EventBus.$emit("getFarmObj", this.farmInfo);
             this.$router.go(-1)
         },
         //获取农场信息
@@ -352,7 +356,6 @@
             }
 
             if (this.$refs.showCP) {
-                console.log(1)
                 let isSelf = this.$refs.showCP.contains(e.target)
                 if (!isSelf) {
                     this.plotClickNum = 0
diff --git a/src/views/recovery/recovery.vue b/src/views/recovery/recovery.vue
index e6b9f84..21e91b3 100644
--- a/src/views/recovery/recovery.vue
+++ b/src/views/recovery/recovery.vue
@@ -85,6 +85,7 @@
                         span: 12,
                         type: "tree",
                         dicData: [],
+                        hide:true,
                         props: {
                             label: "strainName",
                             value: "id"
@@ -100,6 +101,13 @@
                         disabled: true,
                     },
                     {
+                        label: "采收品种",
+                        prop: "strainName",
+                        span: 12,
+                        labelWidth: 145,
+                        disabled: true,
+                    },
+                    {
                         label: "采收地块",
                         span: 12,
                         labelWidth: 145,
diff --git a/src/views/remote/remote.vue b/src/views/remote/remote.vue
index 0ee9bce..10d8a74 100644
--- a/src/views/remote/remote.vue
+++ b/src/views/remote/remote.vue
@@ -35,7 +35,7 @@
 </template>
 
 <script>
-import { getList, getDetail, add, update, remove } from "@/api/remote/remote"
+import { getList,getPage, getDetail, add, update, remove } from "@/api/remote/remote"
 import { mapGetters } from "vuex"
 
 export default {
@@ -116,13 +116,17 @@
                                 value: 1
                             },
                             {
-                                label: "有机基地",
+                                label: "有机种植基地",
                                 value: 2
                             },
                             {
-                                label: "绿色基地",
+                                label: "田南村绿色基地",
                                 value: 3
                             },
+                            {
+                                label:"育秧中心",
+                                value: 4
+                            }
                         ],
                         rules: [{
                             required: true,
@@ -175,7 +179,7 @@
                         }]
                     },
                     {
-                        label: "是否展示",
+                        label: "默认展示",
                         prop: "reType",
                         type: "select",
                         searchSpan: 4,
diff --git a/src/views/statistics/farmplantarea.vue b/src/views/statistics/farmplantarea.vue
index 59f51f3..8f58797 100644
--- a/src/views/statistics/farmplantarea.vue
+++ b/src/views/statistics/farmplantarea.vue
@@ -112,7 +112,7 @@
                         span: 12,
                         hide: true,
                         search: true,
-                        searchSpan: 6,
+                        searchSpan: 7,
                         searchLabelWidth: 110,
                         searchRange: true,
                         searchValue: [this.getStartTime(), this.getEndTime()],
diff --git a/src/views/statistics/farmproductstockstatistics.vue b/src/views/statistics/farmproductstockstatistics.vue
index e88d776..1adf28e 100644
--- a/src/views/statistics/farmproductstockstatistics.vue
+++ b/src/views/statistics/farmproductstockstatistics.vue
@@ -192,7 +192,7 @@
             span: 12,
             hide: true,
             search: true,
-            searchSpan: 6,
+            searchSpan: 7,
             searchLabelWidth: 110,
             searchRange: true,
             searchValue: [this.getStartTime(), this.getEndTime()],
diff --git a/src/views/statistics/stock.vue b/src/views/statistics/stock.vue
index 3592f5b..7b9c706 100644
--- a/src/views/statistics/stock.vue
+++ b/src/views/statistics/stock.vue
@@ -130,7 +130,7 @@
             span: 12,
             hide: true,
             search: true,
-            searchSpan: 6,
+            searchSpan: 7,
             searchLabelWidth: 110,
             searchRange: true,
             searchValue: [this.getStartTime(), this.getEndTime()],
diff --git a/src/views/wel/index.vue b/src/views/wel/index.vue
index cf012de..6a05abb 100644
--- a/src/views/wel/index.vue
+++ b/src/views/wel/index.vue
@@ -53,8 +53,8 @@
                             </div>
                         </div>
                     </div>
-                    <div class="map-view">
-                        <img src="../../../public/img/map.png" />
+                    <div class="map-view" @click="goToMapModel">
+                        <img src="../../../public/img/map.png"  />
                         <div class="title">农场地图→</div>
                     </div>
                 </div>
@@ -74,6 +74,24 @@
                         <div class="btn">
                             <el-button plain size="small" @click="recovery(item)">
                                 <span style="color: #5abf78">采收</span>
+                            </el-button>
+                            <!-- <el-button plain size="small" @click="over(item.id)">结束</el-button> -->
+                            <el-button plain size="small" @click="over(item)">结束</el-button>
+                        </div>
+                    </div>
+                    <!-- 秧苗 -->
+                    <div class="farm" v-for="(item, index) in farmPlanListYM" :key="index">
+                        <div class="farm-img" @click="recoveryDetail(item)">
+                            <img :src="item.url" class="img" />
+                        </div>
+                        <div class="cai">{{ item.strainName }}(秧苗)</div>
+                        <div class="area">
+                            种植面积:
+                            <span>{{ item.area }}</span>亩
+                        </div>
+                        <div class="btn">
+                            <el-button plain size="small" @click="plant(item)">
+                                <span style="color: #5abf78">移栽</span>
                             </el-button>
                             <!-- <el-button plain size="small" @click="over(item.id)">结束</el-button> -->
                             <el-button plain size="small" @click="over(item)">结束</el-button>
@@ -184,7 +202,7 @@
 
 <script>
 import { mapGetters } from "vuex"
-import { getList, update,getStrainCount } from "@/api/farmplant/farmplant"
+import { getList, update,getStrainCount,getStrainCountYM } from "@/api/farmplant/farmplant"
 import { getFarmingCount, getFarmingStatis } from "@/api/farm/farmingrecord"
 import { selectCount } from "@/api/land/land"
 import { StockCount } from "@/api/stock/stock"
@@ -219,6 +237,7 @@
             total: 0,
             farmingCount: 0,
             farmPlanList: [],
+            farmPlanListYM:[],
             recoveryVisible: false,
             overVisible:false,
             landVisible: false,
@@ -235,6 +254,17 @@
         ...mapGetters(["userInfo","$farmId"]),
     },
   created () {
+                
+        this.$EventBus.$on('getFarmObj', (farmObj)=>{
+            // this.$nextTick(() => {
+            //     this.$EventBus.$emit("setFarmId", farmObj.id);
+            // });
+            setTimeout(() => {
+                this.$EventBus.$emit("setFarmId", farmObj.id);
+            }, 100);
+        })
+
+
         //初始化农场信息
         // let farmId = this.userInfo.$farmId
         this.farm.id = this.$farmId
@@ -248,12 +278,15 @@
         //本年农事操作记录,分组
         this.getFarmingStatis()
         this.StockCount()
+
     },
   watch: {
     '$farmId':{
       handler (newName, oldName) {
         this.farm.id = newName
-          //农场概览 地块使用率
+
+        setTimeout(() => {
+        //农场概览 地块使用率
         this.getCountStatis ()
         //本年农事操作记录
         this.getFarmingCount()
@@ -262,6 +295,8 @@
         this.StockCount()
         //当前农场种养品种
         this.onLoad()
+        }, 100);
+
       }
     }
   },
@@ -356,6 +391,14 @@
                     e.area = fixed.fixedNum(e.area)
                 })
             })
+
+            getStrainCountYM(1, 100, Object.assign(params)).then((res) => {
+                const data = res.data.data.records
+                this.farmPlanListYM = data
+                this.farmPlanListYM.forEach((e)=>{
+                    e.area = fixed.fixedNum(e.area)
+                })
+            })
         },
         //采收
         recovery (data) {
@@ -402,10 +445,10 @@
             })
         },
         //种植
-        plant () {
+        plant (item) {
             this.plantVisible = true
             this.$nextTick(() => {
-                this.$refs.plant.init()
+                this.$refs.plant.init(item)
             })
         },
         //农事操作
@@ -484,6 +527,13 @@
                 query: data,
             })
         },
+        //进入地图模式
+        goToMapModel () {
+            this.$router.push({
+                path: `/mapPattern`,
+                // query: row,
+            })
+        }
     },
 };
 </script>
diff --git a/src/views/wel/plant.vue b/src/views/wel/plant.vue
index 0c07615..2722cdc 100644
--- a/src/views/wel/plant.vue
+++ b/src/views/wel/plant.vue
@@ -15,9 +15,9 @@
 <script>
 
 import { mapState } from "vuex";
-import { getLandList } from "@/api/land/land";
+import { getLandList,getLandListNoPage } from "@/api/land/land";
 import { getStrainList } from "@/api/farmplant/strain";
-import { save } from "@/api/farmplant/farmplant";
+import { save,getList } from "@/api/farmplant/farmplant";
 import { getFarmList } from "../../api/farm/farm";
 export default {
   data() {
@@ -30,7 +30,7 @@
         gutter: 30,
         column: [
           {
-            label: "品种",
+            label: "种类",
             prop: "strainId",
             labelWidth:110,
             type:"tree",
@@ -48,7 +48,7 @@
             ],
           },
           {
-            label: "品种描述",
+            label: "品种",
             prop: "varieties",
             labelWidth:110,
             // rules: [
@@ -170,7 +170,7 @@
               },
             ],
           },
-                    {
+          {
             label: "秧苗来源农场",
             prop: "farmId",
             type: "tree",
@@ -296,9 +296,8 @@
     }),
   },
   watch: {
-  "form.plantingWay": {
+    "form.plantingWay": {
       handler(val) {
-        console.log("plantingWay",val)
         var farmColumn = this.findObject(this.option.column,"farmId")
         var landColumn = this.findObject(this.option.column,"otherLandId")
         if(val != 0 ){
@@ -312,6 +311,19 @@
       },
       immediate: true,
     },
+    "$farmId":{
+      handler(val){
+        this.form.farmId = this.$farmId
+        //获取农地数据
+        getLandList(this.$farmId).then((res)=>{
+            if(res.data.code==200){
+              var landIdcolumn = this.findObject(this.option.column,"landId");
+              this.landList = res.data.data;
+              landIdcolumn.dicData = res.data.data;
+            }
+        })
+      }
+    }
   },
   methods: {
     //计算当前时间
@@ -330,7 +342,7 @@
         //秒 getSeconds():(0 ~ 59)
         var second = date.getSeconds();
         //赋值
-        this.form['time'] = year + '-'
+        this.form['transplanTime'] = year + '-'
                           + this.addZero(month) + '-'
                           + this.addZero(day) + ' '
                           + this.addZero(hour) + ':'
@@ -341,12 +353,37 @@
       return s < 10 ? ('0' + s) : s;
     },
     //初始化
-    init() {
+    init(item) {
+      var that = this;
       this.form['operator'] = this.userInfo.user_id;
       //计算当前时间
       this.getNowTime();
+      var strainColumn = that.findObject(that.option.column,"strainId");
+      var otherLandColumn = that.findObject(that.option.column,"otherLandId");
+      if(item.strainId){
+        that.form.strainId = item.strainId
+        strainColumn.disabled = true
+        
+      }else{
+        strainColumn.disabled = false
+        that.form.farmId = that.$farmId
+      }
+      var params = {}
+        params['tenantId'] = this.userInfo.tenant_id
+        params['farmId'] = this.$farmId
+        params['strainId'] = item.strainId
+        // params['plantingWay'] = "2"
+        getLandListNoPage(params).then((res)=>{
+          var landArr = []
+          res.data.data.forEach(e => {
+            landArr.push({
+              id:e.landId,
+              landName:e.landName
+            })
+          });
+          otherLandColumn.dicData = landArr
+        })
       this.visible = true;
-      var that = this;
       //获取农地数据
       getLandList(this.$farmId).then((res)=>{
           if(res.data.code==200){
diff --git a/vue.config.js b/vue.config.js
index 88ddef0..c43e127 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -4,7 +4,7 @@
 
 module.exports = {
     //路径前缀
-    publicPath: "/",
+    publicPath: "/zhny-web",
     lintOnSave: true,
     productionSourceMap: false,
     chainWebpack: (config) => {
@@ -39,13 +39,15 @@
     },
     //开发模式反向代理配置,生产模式请使用Nginx部署并配置反向代理
     devServer: {
+        // 本地配置host生效
+        disableHostCheck:true,
         port: 1888,
         proxy: {
             '/api': {
                 //本地服务接口地址
-                // target: 'http://192.168.0.126:89',
+                target: 'http://192.168.0.207:89',
                 //远程演示服务地址,可用于直接启动项目
-                target: 'http://182.106.212.58:8013/api',
+                // target: 'http://182.106.212.58:8013/api',
                 ws: true,
                 pathRewrite: {
                     '^/api': '/'
@@ -53,4 +55,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}

--
Gitblit v1.9.3