Browse Source

修改害虫选择页面数据显示

master
邓宏 2 years ago
parent
commit
33ed65df13
  1. 39
      pages/massif/pestType.vue

39
pages/massif/pestType.vue

@ -139,7 +139,7 @@ export default {
params:{code:"B09"}
})
if(res.statu){
this.cropList=res.data.map(v=>({...v,children:v?.children?.length>0?v.children:[{label:"全部",value:'all'}]}))
this.cropList=res.data.map(v=>({...v,children:v?.children?.length>0?v.children:[{label:"全部",value:v.pest}]}))
this.agrSearch(res.data[0]?.children?.[0]?.value||"")
}else{
uni.showModal({
@ -172,26 +172,29 @@ export default {
}
}
},
async agrSearch(id){
if(id){
this.searchVal={ value:id, search:"" }
async agrSearch(e){
if(e){
this.searchVal={ value:e, search:"" }
this.select=""
var res=await request("/api/plantFarming/getPestByLike",{
params: {
value: id,//
search:"",
if(typeof e=='string'){
var res=await request("/api/plantFarming/getPestByLike",{
params: {
value: e,//
search:"",
}
})
if(res.statu){
this.list=res.data
}else{
this.list=[]
uni.showModal({
title:"提示",
content:res.msg||"获取种植计划选项失败!",
showCancel:false,
})
}
})
if(res.statu){
this.list=res.data
}else{
this.list=[]
uni.showModal({
title:"提示",
content:res.msg||"获取种植计划选项失败!",
showCancel:false,
})
this.list=e
}
}
},

Loading…
Cancel
Save