From 05ef86b63ff0003c3b80c3790622949bc6038c68 Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Tue, 14 Feb 2023 16:20:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=86=9C=E8=B5=84=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=90=9C=E7=B4=A2=E4=BE=9B=E5=BA=94=E5=95=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/purchase/search.vue | 43 ++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/pages/purchase/search.vue b/pages/purchase/search.vue index 300bb43..ef4c9a3 100644 --- a/pages/purchase/search.vue +++ b/pages/purchase/search.vue @@ -16,9 +16,10 @@ @@ -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