From 8e9dc0c2f960c1606935c9b1745d7ba109e2ae7c Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Fri, 10 Feb 2023 18:48:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9B=B6=E7=94=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 2 ++ pages/home/index.vue | 28 +++++++++++++++++----------- pages/massif/collectList.vue | 2 +- pages/massif/info.vue | 4 ++++ pages/warehouse/info.vue | 4 ++++ 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/main.js b/main.js index b89cab9..feddb48 100644 --- a/main.js +++ b/main.js @@ -3,12 +3,14 @@ import App from './App' import store from './store' import uView from 'uview-ui'; import {defineObj,defineArray} from 'black-knight/lib/config/custom' +import {provise} from 'black-knight/lib/config/tools' Vue.use(uView) Vue.prototype.$store=store Vue.prototype.$defineArray=defineArray Vue.config.productionTip = false +Vue.prototype.$provise=new provise() App.mpType = 'app' const app = new Vue({ ...App, diff --git a/pages/home/index.vue b/pages/home/index.vue index c867c38..c3a701e 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -305,7 +305,7 @@ - 地块管理 更多>> + 地块管理 更多>> {{v.plotName}} {{v.realityArea}}亩 @@ -391,9 +391,9 @@ import request,{host} from '@/common/request.js' }, watch:{ "$store.state.plantBaseInfoId"(n){ - this.getMassif(n) - this.getBaseInfo(n) - this.getStock(n) + this.getMassif() + this.getBaseInfo() + this.getStock() } }, onLoad() { @@ -403,6 +403,8 @@ import request,{host} from '@/common/request.js' }else{ this.$store.commit("setBaseId", this.$store.getters['userInfo'].plantBaseInfoId) } + this.$provise.on("updateMassif", this.getMassif()) + this.$provise.on("updateStock", this.getStock()) }, methods: { async getHeadImg(){ @@ -412,9 +414,9 @@ import request,{host} from '@/common/request.js' } }, //获取地块信息 - async getMassif(plantBaseId){ + async getMassif(){ var res=await request("/api/plantIndex/queryPlot",{ - params:{plantBaseId} + params:{plantBaseId: this.$store.state.plantBaseInfoId} }) if(res.statu){ this.massif=res.data @@ -442,9 +444,9 @@ import request,{host} from '@/common/request.js' }) } }, - async getBaseInfo(plantBaseId){ + async getBaseInfo(){ var res=await request("/api/plantIndex/queryFarmWorkAndInput",{ - params:{plantBaseId} + params:{plantBaseId: this.$store.state.plantBaseInfoId} }) if(res.statu){ this.baseInfo=res.data @@ -457,9 +459,9 @@ import request,{host} from '@/common/request.js' } }, // 获取仓库 - async getStock(baseId){ + async getStock(){ var res=await request("/api/plantIndex/queryWarehouse",{ - params:{baseId} + params:{baseId: this.$store.state.plantBaseInfoId} }) if(res.statu){ this.stockList=res.data @@ -471,6 +473,10 @@ import request,{host} from '@/common/request.js' }) } }, - } + }, + onUnload(){ + this.$provise.off("updateMassif") + this.$provise.off("updateStock") + }, } diff --git a/pages/massif/collectList.vue b/pages/massif/collectList.vue index 0ce2ca4..a4e4064 100644 --- a/pages/massif/collectList.vue +++ b/pages/massif/collectList.vue @@ -52,7 +52,7 @@