|
|
@ -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 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|