Browse Source

联调

master
邓宏 2 years ago
parent
commit
aeafc67e4c
  1. 26
      pages/purchase/specs.vue

26
pages/purchase/specs.vue

@ -190,27 +190,17 @@ export default{
return this.goodsList.findIndex(v=>v.id==this.purchaseId) return this.goodsList.findIndex(v=>v.id==this.purchaseId)
}, },
}, },
onLoad(options){ async onLoad(options){
this.eventChannel=this.getOpenerEventChannel() this.eventChannel=this.getOpenerEventChannel()
this.formData.specificationId=options.id this.formData.specificationId=options.id
this.init(options.id) await this.searchGoods()
this.searchGoods() this.goodsList.forEach(v=>{
if(v.id==options.id){
this.setGoodsVal(v)
}
})
}, },
methods:{ methods:{
async init(id){
var res=await request("/api/goods/goodsList",{
params:{id}
})
if(res.statu && res.data.records[0]){
this.setGoodsVal(res.data.records[0])
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取农资详情失败!",
showCancel:false,
})
}
},
async setGoodsVal(val){ async setGoodsVal(val){
this.purchaseId=val.id this.purchaseId=val.id
this.formData.goodsName=val.goodsName this.formData.goodsName=val.goodsName
@ -269,7 +259,7 @@ export default{
}, },
async searchGoods(){ async searchGoods(){
var res=await request("/api/goods/goodsList",{ var res=await request("/api/goods/goodsList",{
params: { goodsName:"",pageNo:1,pageSize:30 } params: { goodsName:"",pageNo:1,pageSize:50 }
}) })
if(res.statu){ if(res.statu){
this.goodsList=res.data.records this.goodsList=res.data.records

Loading…
Cancel
Save