Browse Source

新增农资 修改搜索供应商

master
邓宏 2 years ago
parent
commit
05ef86b63f
  1. 43
      pages/purchase/search.vue

43
pages/purchase/search.vue

@ -16,9 +16,10 @@
</style>
<template>
<view class="container flex">
<d-search v-model="searchVal" @search="search"/>
<scroll-view scroll-y>
<d-search v-model="searchVal.supplier" @search="clean();search()"/>
<scroll-view scroll-y @scrolltoloer="search">
<view v-for="(v,k) in list" :key="k" @click="select(v)">{{v}}</view>
<u-empty v-if="list.length<=0" text=" " width="70%" icon="/static/noData.png"/>
</scroll-view>
</view>
</template>
@ -27,29 +28,43 @@ import request from '@/common/request'
export default {
data(){
return{
searchVal:"",
searchVal:{
supplier:"",
pageNo:1,
pageSize:20
},
list:[],
total:0,
eventChannel:null,
}
},
onLoad(options){
this.eventChannel=this.getOpenerEventChannel()
this.searchVal=options.data
this.searchVal.supplier=options.data||""
this.search()
},
methods:{
clean(){
this.searchVal.pageNo=1
this.list=[]
this.total=0
},
async search(){
var res=await request("/api/goods/supplierShow",{
params:{supplier: this.searchVal}
})
if(res.statu){
this.list=res.data
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取供应商列表失败!",
showCancel:false,
if(this.total==0 || this.list.length<this.total){
var res=await request("/api/goods/supplierShow",{
params: this.searchVal
})
if(res.statu){
this.list=res.data.list
this.total=res.data.total
this.searchVal.pageNo++
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取供应商列表失败!",
showCancel:false,
})
}
}
},
select(e){

Loading…
Cancel
Save