Browse Source

Merge remote-tracking branch 'origin/master'

master
马景富 2 years ago
parent
commit
0a03a477c0
  1. 39
      pages/massif/pestType.vue

39
pages/massif/pestType.vue

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

Loading…
Cancel
Save