Browse Source

地块管理 监听首页切换基地

master
邓宏 2 years ago
parent
commit
a77d847dfc
  1. 15
      pages/massif/index.vue

15
pages/massif/index.vue

@ -114,8 +114,6 @@ import request,{host} from '@/common/request'
return{ return{
host:host('imgUrl'), host:host('imgUrl'),
searchVal:{ searchVal:{
companyId:this.$store.getters.userInfo.companyId,
plantBaseInfoId:this.$store.state.plantBaseInfoId,
search:"", search:"",
pageNo:1, pageNo:1,
pageSize:5, pageSize:5,
@ -124,6 +122,13 @@ import request,{host} from '@/common/request'
total:0, total:0,
} }
}, },
watch:{
//
"$store.state.plantBaseInfoId"(n){
this.clean()
this.search()
},
},
onLoad(){ onLoad(){
this.search() this.search()
}, },
@ -149,7 +154,11 @@ import request,{host} from '@/common/request'
async search(){ async search(){
if(this.total==0 || this.list.length<this.total){ if(this.total==0 || this.list.length<this.total){
var res=await request("/api/plantPlot/list",{ var res=await request("/api/plantPlot/list",{
params: this.searchVal params: {
...this.searchVal,
companyId:this.$store.getters.userInfo.companyId,
plantBaseInfoId:this.$store.state.plantBaseInfoId,
}
}) })
if(res.statu){ if(res.statu){
this.list=this.list.concat(res.data.records) this.list=this.list.concat(res.data.records)

Loading…
Cancel
Save