Browse Source

农资规格 修改异步搜索规格

master
邓宏 2 years ago
parent
commit
b417dcfb7a
  1. 16
      pages/purchase/specs.vue

16
pages/purchase/specs.vue

@ -213,7 +213,7 @@ import request from '@/common/request'
export default{ export default{
data(){ data(){
return{ return{
specList:[[]], specList:[],
specStr:"", specStr:"",
dressingUnit:"", dressingUnit:"",
show:false, show:false,
@ -239,11 +239,14 @@ export default{
async onLoad(options){ async onLoad(options){
this.intoPage=options.intoPage this.intoPage=options.intoPage
this.eventChannel=this.getOpenerEventChannel() this.eventChannel=this.getOpenerEventChannel()
this.eventChannel.on("detail", detail=>{ await new Promise(resolve=>{
this.formData.goodsName=detail.goodsName this.eventChannel.on("detail", detail=>{
this.formData.detailedType=detail.detailedType this.formData.goodsName=detail.goodsName
this.formData.detailedParentName=detail.detailedParentName this.formData.detailedType=detail.detailedType
this.formData.supplier=detail.supplier this.formData.detailedParentName=detail.detailedParentName
this.formData.supplier=detail.supplier
resolve()
})
}) })
this.formData.goodsId=options.goodsId this.formData.goodsId=options.goodsId
this.setGoodsVal() this.setGoodsVal()
@ -258,6 +261,7 @@ export default{
} }
}) })
if(res.statu){ if(res.statu){
console.log(res.data,'---111----')
this.specList=[res.data.map(v=>({label:v.goodsSpecification,value:v.goodsSpecification,id:v.id}))] this.specList=[res.data.map(v=>({label:v.goodsSpecification,value:v.goodsSpecification,id:v.id}))]
this.formData.goodsSpecification='' this.formData.goodsSpecification=''
this.specStr='' this.specStr=''

Loading…
Cancel
Save