mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-10 05:46:44 +08:00
提交
This commit is contained in:
270
src/views/ebiz/proposal/List.vue
Normal file
270
src/views/ebiz/proposal/List.vue
Normal file
@@ -0,0 +1,270 @@
|
||||
.
|
||||
<template>
|
||||
<div class="proposal-list-container">
|
||||
<van-sticky>
|
||||
<van-tabs :line-width="45" title-inactive-color="#999999" v-model="active" @change="tabChange" title-active-color="#E9332E">
|
||||
<van-tab title="制作中" name="1"></van-tab>
|
||||
<van-tab title="已制作" name="2"></van-tab>
|
||||
<van-tab title="转投保" name="3"></van-tab>
|
||||
</van-tabs>
|
||||
</van-sticky>
|
||||
|
||||
<van-list
|
||||
v-model="loading"
|
||||
:immediate-check="false"
|
||||
:finished="finished"
|
||||
:finished-text="finishedText"
|
||||
error-text="请求失败,点击重新加载"
|
||||
:error.sync="error"
|
||||
@load="loadMore"
|
||||
class="pb45"
|
||||
>
|
||||
<div v-if="isSuccess">
|
||||
<div v-if="proposalList.length > 0">
|
||||
<div v-for="(item, index) in proposalList" :key="index">
|
||||
<div class="fs12 mt20 mb5 text-center c-gray-dark">{{ item.orderInfoDTO.appntDateLabel }}</div>
|
||||
|
||||
<div class="bg-white radius5 mh15 pv15 pr15 pl10">
|
||||
<div class="flex justify-content-s align-items-c">
|
||||
<div>
|
||||
<div class="w45 inline-b">
|
||||
<van-tag plain color="#5CA7DE">投保</van-tag>
|
||||
</div>
|
||||
<span class="fs15 c-gray-dark">{{ item.appntDTO.name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-for="(insure, insureIndex) in item.insuredDTOs" :key="insureIndex">
|
||||
<div class="mv15">
|
||||
<div class="w45 inline-b">
|
||||
<van-tag plain color="#DD9C56">被保</van-tag>
|
||||
</div>
|
||||
<span class="fs15 c-gray-dark">{{ insure.name }}</span>
|
||||
</div>
|
||||
<div v-for="(mainRisk, riskIndex) in insure.mainRisk" :key="riskIndex">
|
||||
<div class="mv10">
|
||||
<span class="w45 inline-b">
|
||||
<van-tag plain type="danger">主险</van-tag>
|
||||
</span>
|
||||
<span class="fs15 c-gray-dark">{{ mainRisk.riskName }}</span>
|
||||
</div>
|
||||
<div class="mv10 pl45 flex" v-for="(addtion, addtionIndex) in mainRisk.addtion" :key="addtionIndex">
|
||||
<span class="mr10" style="flex-shrink: 0">
|
||||
<van-tag mark color="#DDF2EF" text-color="#4FC6B3">附加</van-tag>
|
||||
</span>
|
||||
<span class="fs13">{{ addtion.riskName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex fs15 c-gray-dark justify-content-s mt5 mb5">
|
||||
<span class="c-gray-darker fwb">首期总保费(元)</span>
|
||||
<span class="yellow fwb">{{ item.firstPrem }}</span>
|
||||
</div>
|
||||
<div class="text-right pv5">
|
||||
<van-button v-if="active == 2" round size="small" @click="toInsurance(item)" class="mr5" type="danger">转投保</van-button>
|
||||
<van-button v-if="active == 1" round @click="edit(item)" size="small" class="mr5" type="danger">编辑</van-button>
|
||||
<van-button v-if="active == 2" plain round @click="preview(item)" size="small" class="mr5" type="danger">预览</van-button>
|
||||
<van-button size="small" round :plain="active == 3 ? false : true" @click="deleteProposal(item, active, index)" type="danger">删除</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="text-center">
|
||||
<img class="mt40 w250" src="@/assets/images/pic_page-non.png" />
|
||||
<div class="fs17 c-gray-dark mt40">暂无建议书</div>
|
||||
</div>
|
||||
</van-list>
|
||||
<van-button type="danger" @click="addProposal" class="bottom-btn fs16">点我新增</van-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Tabs, Tab, Tag, Dialog, List, Sticky, Toast } from 'vant'
|
||||
import { getList, toInsurance, deleteProposal } from '@/api/ebiz/proposal/proposal.js'
|
||||
import { formatRiskList } from '@/assets/js/utils/formatRiskList.js'
|
||||
|
||||
export default {
|
||||
name: 'proposalList',
|
||||
components: {
|
||||
[Tabs.name]: Tabs,
|
||||
[Tab.name]: Tab,
|
||||
[Tag.name]: Tag,
|
||||
[List.name]: List,
|
||||
[Sticky.name]: Sticky
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
active: 1,
|
||||
proposalList: [],
|
||||
finishedText: '没有更多了',
|
||||
finished: false,
|
||||
error: false,
|
||||
loading: false,
|
||||
pageSize: 5, //每页数据条数
|
||||
morePage: 1, // 当前页数
|
||||
isSuccess: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
document.body.style.backgroundColor = '#F5F5F5'
|
||||
},
|
||||
mounted() {
|
||||
this.loadMore()
|
||||
},
|
||||
methods: {
|
||||
//获取建议书列表
|
||||
getProposalList(tabType, pageInfo) {
|
||||
let status = '0' + tabType
|
||||
let request = {
|
||||
proposalInfoDTO: {
|
||||
status
|
||||
},
|
||||
pageInfo
|
||||
}
|
||||
getList(request).then(res => {
|
||||
if (res.result == '0') {
|
||||
this.isSuccess = true
|
||||
console.log(res)
|
||||
let content = res.content
|
||||
this.morePage++
|
||||
let list = content.list
|
||||
if (list.length == 0) {
|
||||
this.finishedText = ''
|
||||
} else {
|
||||
this.finishedText = '已经全部加载'
|
||||
}
|
||||
list = formatRiskList(list, 'insuredDTOs', 'riskDTOLst') //格式化数据为本地显示结果
|
||||
|
||||
this.proposalList = this.proposalList.concat(list)
|
||||
if (this.proposalList.length == 0) {
|
||||
this.isSuccess = false
|
||||
}
|
||||
this.loading = false
|
||||
if (content.nextPage == 0) {
|
||||
//当下一页为0时 表示全部数据加载完毕
|
||||
this.finished = true
|
||||
}
|
||||
} else {
|
||||
this.finished = true
|
||||
this.loading = false
|
||||
this.finishedText = res.resultMessage
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
loadMore() {
|
||||
let pageInfo = {
|
||||
pageNum: this.morePage,
|
||||
pageSize: this.pageSize
|
||||
}
|
||||
let active = this.active
|
||||
this.getProposalList(active, pageInfo)
|
||||
},
|
||||
tabChange(index) {
|
||||
this.morePage = 1
|
||||
this.active = index
|
||||
this.proposalList = []
|
||||
this.finishedText = '正在加载...'
|
||||
this.loadMore()
|
||||
},
|
||||
//删除建议书
|
||||
deleteProposal(item) {
|
||||
let params = {
|
||||
orderDTO: {
|
||||
orderInfoDTO: {
|
||||
orderNo: item.orderInfoDTO.orderNo
|
||||
}
|
||||
},
|
||||
type: '1'
|
||||
}
|
||||
Dialog.confirm({
|
||||
className: 'dialog-delete',
|
||||
title: '提示',
|
||||
message: '确认删除建议书?',
|
||||
cancelButtonColor: '#4FC6B3',
|
||||
confirmButtonColor: '#FFFFFF'
|
||||
})
|
||||
.then(() => {
|
||||
deleteProposal(params).then(res => {
|
||||
if (res.result == '0') {
|
||||
this.proposalList = []
|
||||
this.morePage = 1
|
||||
this.loadMore()
|
||||
;[this.loading, this.finished] = [false, false]
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
//点我新增
|
||||
addProposal() {
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/proposal/appnt'
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/proposal/appnt'
|
||||
}
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
edit(item) {
|
||||
//建议书列表 编辑=》制作中的建议书跳转到选择被保人页面;
|
||||
localStorage.orderNo = item.orderInfoDTO.orderNo
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/proposal/chooseInsuredPerson',
|
||||
needRefresh: '1'
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/proposal/chooseInsuredPerson'
|
||||
}
|
||||
})
|
||||
},
|
||||
//预览 跳转至利益演示
|
||||
preview(item) {
|
||||
localStorage.orderNo = item.orderInfoDTO.orderNo
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/proposal/Exhibition'
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/proposal/Exhibition'
|
||||
}
|
||||
})
|
||||
},
|
||||
//转投保
|
||||
toInsurance(item) {
|
||||
let params = {
|
||||
proposalInfoDTO: {
|
||||
proposalNo: item.orderInfoDTO.orderNo
|
||||
}
|
||||
}
|
||||
toInsurance(params).then(res => {
|
||||
if (res.result == '0') {
|
||||
localStorage.chooseProductCodes = ''
|
||||
localStorage.orderNo = res.content.orderNo
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/sale/insuredInfo?edit=1',
|
||||
backToFirst: '1'
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/sale/insuredInfo?edit=1'
|
||||
}
|
||||
})
|
||||
} else {
|
||||
Toast.fail(res.resultMessage)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user