投保数据提交

This commit is contained in:
pangxingyue
2021-03-22 14:05:40 +08:00
parent 4f407ccabc
commit 0f4a11dace
3 changed files with 71 additions and 124 deletions

View File

@@ -1,29 +1,29 @@
<template>
<div>
<van-search v-model="searchName" placeholder="请输入保单号/投保人姓名/被保险人姓名" @change="searchList" @keyup.enter="searchList" />
<van-search v-model="searchName" placeholder="请输入保单号/投保人姓名/被保险人姓名"/>
<van-sticky>
<van-tabs v-model="active" @change="tabChange">
<van-tab name="uncommit" title="未提交" />
<van-tab name="commit" title="已提交" />
</van-tabs>
</van-sticky>
<div class="container">
<van-pull-refresh v-model="isLoading" @refresh="onRefresh">
<van-list ref="uncommitted" v-model="loading" :finished="finished" :finished-text="finishedText" :immediate-check="false" @load="loadMore">
<div v-if="insureList.length>0">
<Order v-for="(order,index) in insureList" :key="index" :order="order">
<div class="container" v-if="isShow">
<van-pull-refresh @refresh="onRefresh" v-model="isLoading">
<div v-if="NewItems.length>0">
<Order v-for="(order,index) in NewItems" :key="index" :order="order">
<p v-if="active === 'uncommit'" class="name mb8">
<van-tag plain color="#999999">保单保障日截止日期</van-tag>
<span class="ml5 span">{{ order.orderInfoDTO.orderNo }}</span>
<span class="ml5 span">{{ order.cvaliDate }}</span>
</p>
<div v-if="active === 'commit'">
<p class="name mb8">
<van-tag plain color="#999999">重新投保单号</van-tag>
<span class="ml5 span">{{ order.orderInfoDTO.orderNo }}</span>
<span class="ml5 span">{{ order.policyNo }}</span>
</p>
<p class="name">
<van-tag plain color="#999999">状态</van-tag>
<span class="ml5 span">{{ order.stateName }}</span>
<span class="ml5 span">{{ order.orderStatus }}</span>
</p>
</div>
@@ -38,7 +38,7 @@
</template>
</Order>
</div>
</van-list>
</van-pull-refresh>
<van-popup v-model="isAgreementShow" position="right" :style="{ height: '100vh', width: '100vw' }">
<ReadingAgreement :needTime="false">
@@ -71,11 +71,12 @@
<script>
import { Search, Sticky, PullRefresh, list, Tag, Popup, Radio, RadioGroup } from 'vant'
import { orderList } from '@/api/ebiz/insureAgain/insureAgain'
import { getPolicyListAgent } from '@/api/ebiz/insureAgain/insureAgain'
import { formatRiskList } from '@/assets/js/utils/formatRiskList.js'
import dataDictionary from '@/assets/js/utils/data-dictionary' //根据数据字典找到用户等级
import Order from '@/components/ebiz/insureAgain/Order'
import ReadingAgreement from '@/components/ebiz/insureAgain/ReadingAgreement'
import CacheUtils from '@/assets/js/utils/cacheUtils'
export default {
name: 'InsureAgain',
components: {
@@ -94,30 +95,36 @@ export default {
return {
searchName: '', //搜索名
active: 'uncommit',
insureList: [],
currentPage: 1, //当前页数
isLoading: false,
loading: false,
finished: false,
finishedText: '没有更多了',
pageSize: 5,
policyListDTOList: [],
isAgreementShow: false,
radio: ''
radio: '',
isLoading: false,
isShow: false
}
},
computed:{
NewItems() {
var NewItems = []
this.policyListDTOList.map(item => {
if (item.riskName.search(this.searchName) != -1 || item.policyNo.search(this.searchName) != -1 || item.appntName.search(this.searchName) != -1) {
// if (this.active === 'uncommit' && item.reInsuranceFlag === '3' && item.reInsuranceState === '0') {
// NewItems.push(item)
// } else if(this.active === 'commit' && item.reInsuranceFlag === '3' && (item.reInsuranceState === '1' || item.reInsuranceState === '2' || item.reInsuranceState === '3')){
// NewItems.push(item)
// }
NewItems.push(item)
}
})
console.log(NewItems, '======================NewItems===================')
return NewItems
}
},
created() {
let pageInfo = {
pageNum: this.currentPage,
pageSize: this.pageSize,
orderType: this.active,
name: this.searchName,
desensitizType: this.active === 'uncommit' ? 1 : 0
}
this.getOrderList(pageInfo)
let data = {}
this.getPolicyListAgent(data)
},
mounted() {
setTimeout(() => {
// eslint-disable-next-line no-undef
setTimeout(() => {
window.EWebBridge.webCallAppInJs('webview_left_button', {
intercept: '1' //是否拦截原生返回事件 1是 其他否
})
@@ -141,71 +148,23 @@ export default {
}
}
},
tabChange(name) {
this.currentPage = 1
this.active = name
this.saleList = []
;[this.loading, this.finished] = [true, false]
this.loadMore()
},
searchList() {
this.currentPage = 1
this.insureList = []
;[this.loading, this.finished] = [true, false]
// this.finishedText = '正在加载...'
let pageInfo = {
pageNum: this.currentPage,
pageSize: this.pageSize,
orderType: this.active,
name: this.searchName,
desensitizType: this.active === 'uncommit' ? 1 : 0
}
this.getOrderList(pageInfo)
tabChange(name) {
this.active = name
},
//初始化保单列表
getOrderList(pageInfo) {
orderList(pageInfo).then(res => {
if (res.result == '0') {
this.currentPage++
if (!res.orderDTOPageInfo && res.orderDTOPageInfo !== {}) {
this.finished = true
this.loading = false
this.finishedText = ''
return
}
let list = res.orderDTOPageInfo.list
if (list.length == 0) {
this.finishedText = ''
} else {
this.finishedText = '已经全部加载'
}
list = formatRiskList(list, 'insuredDTOs', 'riskDTOLst') //根据后面两个参数 来格式化数据
dataDictionary.policyState.forEach(state => {
list.forEach(order => {
if (state.id == order.orderInfoDTO.orderStatus) {
order.stateName = state.text
}
})
})
this.insureList = this.insureList.concat(list)
// if (this.insureList.length == 0) {
// this.isSuccess = false
// }
this.loading = false
if (res.orderDTOPageInfo.nextPage == 0) {
//当下一页为0时 表示全部数据加载完毕
this.finished = true
}
} else {
this.finished = true
this.loading = false
this.finishedText = res.resultMessage
getPolicyListAgent(pageInfo) {
getPolicyListAgent(pageInfo).then(res => {
if (res.result == '0') {
this.policyListDTOList = res.policyListDTOList
console.log(this.policyListDTOList, '===================this.policyListDTOList====================')
this.isShow = true
} else {
this.errMessage = res.resultMessage || '暂无保单'
}
})
},
insureAgain(order) {
localStorage.setItem('orderNo', order.orderInfoDTO.orderNo)
insureAgain(order) {
CacheUtils.setLocItem('orderNo', '')
setTimeout(() => {
window.EWebBridge.webCallAppInJs('webview_left_button', {
img: this.$assetsUrl + 'images/del-close-btn@3x.png',
@@ -215,7 +174,7 @@ export default {
this.isAgreementShow = true
},
uncommitInsureDetail(order) {
localStorage.setItem('orderNo', order.orderInfoDTO.orderNo)
CacheUtils.setLocItem('orderNo', '')
this.$jump({
flag: 'h5',
extra: {
@@ -226,8 +185,7 @@ export default {
}
})
},
commitInsureDetail(order) {
localStorage.setItem('orderNo', order.orderInfoDTO.orderNo)
commitInsureDetail(order) {
this.$jump({
flag: 'h5',
extra: {
@@ -250,31 +208,12 @@ export default {
})
},
onRefresh() {
let pageInfo = {
pageNum: 1,
pageSize: this.pageSize,
orderType: this.active,
name: '',
desensitizType: this.active === 'uncommit' ? 1 : 0
}
this.isLoading = false
this.insureList = []
this.getOrderList(pageInfo)
console.log(345435)
this.policyListDTOList = []
let data = {}
this.getPolicyListAgent(data)
},
//分页用
loadMore() {
if (this.showFlag) {
return
}
let pageInfo = {
pageNum: this.currentPage,
pageSize: this.pageSize,
orderType: this.active,
name: this.searchName,
desensitizType: this.active === 'uncommit' ? 1 : 0
}
this.getOrderList(pageInfo)
}
}
}
</script>