Browse Source

修改基地信息赋值

master
邓宏 2 years ago
parent
commit
b8471b004b
  1. 37
      pages/home/index.vue

37
pages/home/index.vue

@ -367,15 +367,14 @@ import request,{host} from '@/common/request'
} }
}, },
onLoad() { onLoad() {
// uni.setTabBarItem({
// index:0,
// pagePath:"/pages/home/rePassword"
// })
this.getHeadImg() this.getHeadImg()
if(this.isAdmin){ if(this.isAdmin){
this.getPlantBase() this.getPlantBase()
}else{ }else{
this.getBaseName(this.$store.getters['userInfo'].plantBaseInfoId) this.$store.commit("setBaseId", {
id: this.$store.getters['userInfo'].plantBaseInfoId,
name: this.$store.getters['userInfo'].plantBaseInfoName
})
} }
this.$provise.on("updateMassif", this.getMassif) this.$provise.on("updateMassif", this.getMassif)
this.$provise.on("updateStock", this.getStock) this.$provise.on("updateStock", this.getStock)
@ -438,20 +437,20 @@ import request,{host} from '@/common/request'
} }
}, },
// //
async getBaseName(plantBaseInfoId){ // async getBaseName(plantBaseInfoId){
var res=await request("/api/purchase/purchaseUserShow",{ // var res=await request("/api/purchase/purchaseUserShow",{
params:{plantBaseInfoId} // params:{plantBaseInfoId}
}) // })
if(res.statu){ // if(res.statu){
this.$store.commit("setBaseId", {id:plantBaseInfoId,name:res.data.baseName}) // this.$store.commit("setBaseId", {id:plantBaseInfoId,name:res.data.baseName})
}else{ // }else{
uni.showModal({ // uni.showModal({
title:"提示", // title:"",
content:res.msg||"获取基地名称失败!", // content:res.msg||"",
showCancel:false, // showCancel:false,
}) // })
} // }
}, // },
async getBaseInfo(){ async getBaseInfo(){
if(this.$store.state.baseInfo.id){ if(this.$store.state.baseInfo.id){
var res=await request("/api/plantIndex/queryFarmWorkAndInput",{ var res=await request("/api/plantIndex/queryFarmWorkAndInput",{

Loading…
Cancel
Save