添加搜索,loading

This commit is contained in:
mengxiaolong
2020-08-13 18:15:26 +08:00
parent 266e4fa962
commit 3bda286aba

View File

@@ -3,7 +3,11 @@
<div>
<van-sticky>
<div class="list-header">
<van-search placeholder="请输入保单号/投保人" v-model="searchVal" @search="search" />
<van-search placeholder="请输入保单号/投保人" v-model="searchVal" show-action>
<template slot="action">
<div @click="search">搜索</div>
</template>
</van-search>
</div>
<FieldDatePicter
@confirm="onDateConfirm"
@@ -78,7 +82,6 @@ export default {
// 搜索内容
searchVal: '',
list: [],
searchList: [],
active: 0,
isShow: false,
maxDate: new Date(),
@@ -99,14 +102,14 @@ export default {
otherNo: this.searchVal,
payFlag: this.active
}
this.$toast.loading('加载中...')
let result = await getList(param)
this.list.splice(0)
this.list = result.list ? result.list : []
},
// 搜索
search(val) {
this.searchVal = val
this.searchList = this.NewItems(this.active)
search() {
this.getpolicyList()
},
// 选定日期
onDateConfirm(val) {
@@ -127,33 +130,9 @@ export default {
},
// 切换扣款状态tab
tabChange(name) {
console.log(name)
this.searchVal = ''
this.active = name
this.getpolicyList()
},
// 筛选排序list
NewItems(name) {
let _this = this
let type = ''
switch (name) {
case 'wait':
type = '0'
break
case 'success':
type = '1'
break
case 'fail':
type = '2'
}
var NewItems = []
this.list.renewallist.map(function(item) {
if (item.contNo.search(_this.searchVal) != -1 || item.applicant.search(_this.searchVal) != -1) {
if (item.deductionStatus === type) {
NewItems.push(item)
}
}
})
return NewItems
}
}
}