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

Loading…
Cancel
Save