<template>
|
<view class="box">
|
<view class="box_head">
|
<view class="box_head_info">
|
<view class="box_head_info_title">{{info.solutionsName}}</view>
|
<view class="box_head_info_list">
|
<image src="@/static/icon/ic_toubao@2x.png" mode="widthFix"></image>
|
<view class="box_head_info_list_item">
|
<view class="label">保单号:</view>
|
<view class="value">{{code}}</view>
|
</view>
|
<view class="box_head_info_list_item">
|
<view class="label">保单生效期:</view>
|
<view class="value">{{info.startTime}}~{{info.endTime}}</view>
|
</view>
|
<view class="box_head_info_list_item">
|
<view class="label">批单生效期:</view>
|
<view class="value">{{startDate}}</view>
|
</view>
|
<view class="box_head_info_list_item">
|
<view class="label">投保年龄:</view>
|
<view class="value">{{info.minAge}}至{{info.maxAge}}周岁</view>
|
</view>
|
<view class="box_head_info_list_item" v-if="info.solutionType !== 1">
|
<view class="label">费用:</view>
|
<view class="value">
|
{{info.price}}元
|
<text v-if="info.timeUnit === 0">/天</text>
|
<text v-if="info.timeUnit === 1">/半月</text>
|
<text v-if="info.timeUnit === 2">/月</text>
|
<text v-if="info.timeUnit === 3">/年</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
<view class="box_head_cate">
|
<u-tabs :list="cate" lineWidth="40" lineColor="#437CB3" :activeStyle="{color: '#222222',fontWeight: '500'}" @click="clickCate"></u-tabs>
|
<text @click="jump">+添加人员</text>
|
</view>
|
<view class="box_head_list">
|
<view class="box_head_list_item" v-for="(item, index) in (type === 1 ? del : add)" :key="index">
|
<view class="dele" @click="dele(index)">
|
<image src="@/static/icon/ic_delete@2x.png" mode="widthFix"></image>
|
</view>
|
<view class="top">
|
<view class="top_a">
|
<text>{{item.name}}</text>
|
<text>{{IdCard(item.idCard, 2)}}|{{IdCard(item.idCard, 3)}}岁</text>
|
<view class="top_a_tips1" v-if="type === 1">减保</view>
|
<view class="top_a_tips" v-else>加保</view>
|
</view>
|
<view class="top_b">身份证号:{{item.idCard}}</view>
|
</view>
|
<view class="center"></view>
|
<view class="bottom">
|
<view class="bottom_item">
|
<view class="bottom_item_label">派遣单位:</view>
|
<view class="bottom_item_val">{{item.pqName}}</view>
|
</view>
|
<view class="bottom_item">
|
<view class="bottom_item_label">所属工种:</view>
|
<view class="bottom_item_val">{{item.gzName}}</view>
|
</view>
|
</view>
|
</view>
|
<view class="box_head_list_add" @click="jump">
|
<view class="box_head_list_add_yuan">
|
<view class="add_icon">+</view>
|
</view>
|
<text>添加人员信息</text>
|
</view>
|
</view>
|
<view style="width: 100%; height: calc(230rpx + env(safe-area-inset-bottom));"></view>
|
</view>
|
<view class="box_footer">
|
<view class="box_footer_xy">
|
<image src="@/static/icon/ic_tips@2x.png" mode="widthFix"></image>
|
<text>请阅读《投保须知》</text>
|
</view>
|
<view class="box_footer_info">
|
<view class="left">
|
<view class="box_footer_info_top">
|
<view class="box_footer_info_top_item">
|
<view class="top_item_label">加保人数:</view>
|
<view class="top_item_val">{{add.length}}人</view>
|
</view>
|
<view class="box_footer_info_top_item">
|
<view class="top_item_label">减保人数:</view>
|
<view class="top_item_val">{{del.length}}人</view>
|
</view>
|
</view>
|
<view class="box_footer_info_bottom">
|
<view class="box_footer_info_bottom_label">总费用:</view>
|
<view class="box_footer_info_bottom_val">{{totalPrice}}元</view>
|
</view>
|
</view>
|
<view class="right">
|
<u-button type="primary" shape="circle" color="#437CB3" text="投保申请" @click="submit"></u-button>
|
</view>
|
</view>
|
<view style="width: 100%; height: env(safe-area-inset-bottom); background-color: #ffffff;"></view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
id: null,
|
codeId: null,
|
code: null,
|
startDate: null,
|
cyclePrice: null,
|
info: null,
|
add: [],
|
del: [],
|
type: 0,
|
cate: [ {name: '加保人员'}, {name: '减保人员'} ]
|
};
|
},
|
onLoad(options) {
|
this.id = options.id
|
this.codeId = options.codeId
|
this.code = options.code
|
this.startDate = options.startDate
|
this.cyclePrice = options.cyclePrice
|
this.getDetails()
|
uni.$on('add', (res) => {
|
this.add.unshift(res.model)
|
})
|
uni.$on('del', (res) => {
|
this.del.unshift(...res)
|
})
|
},
|
computed: {
|
// 总金额
|
totalPrice() {
|
// return (this.cyclePrice * (this.add.length + this.del.length)).toFixed(2)
|
return ((this.cyclePrice * this.add.length) - (this.cyclePrice * this.del.length)).toFixed(2)
|
}
|
},
|
methods: {
|
dele(index) {
|
if (this.type === 1) {
|
this.del.splice(index, 1)
|
} else {
|
this.add.splice(index, 1)
|
}
|
},
|
submit() {
|
if (this.add.length === 0 && this.del.length === 0) return uni.showToast({
|
title: '至少选择一名人员',
|
icon: 'none'
|
})
|
let addDetailList = this.add.map(item => {
|
return {
|
duId: item.pqId,
|
duName: item.pqName,
|
idcardNo: item.idCard,
|
memberName: item.name,
|
workTypeName: item.gzName,
|
worktypeId: item.gzId,
|
fee: this.cyclePrice
|
}
|
})
|
let delDetailList = this.del.map(item => {
|
return {
|
duId: item.pqId,
|
duName: item.pqName,
|
idcardNo: item.idCard,
|
memberName: item.name,
|
workTypeName: item.gzName,
|
worktypeId: item.gzId,
|
fee: this.cyclePrice
|
}
|
})
|
this.$u.api.applyChangeCreate({
|
applyId: this.codeId,
|
addDetailList,
|
delDetailList,
|
validTime: this.startDate,
|
type: 0
|
}).then(res => {
|
if (res.code === 200) {
|
uni.showToast({
|
title: '提交成功',
|
icon: 'success'
|
})
|
setTimeout(() => {
|
uni.navigateBack({
|
delta: 2
|
})
|
}, 1500)
|
}
|
})
|
},
|
IdCard(UUserCard, num) {
|
let idcard = UUserCard.toString();
|
if (num == 1) {
|
//获取出生日期
|
birth = idcard.substring(6, 10) + "-" + idcard.substring(10, 12) + "-" + idcard.substring(12, 14);
|
return birth;
|
}
|
if (num == 2) {
|
//获取性别
|
if (parseInt(idcard.substr(16, 1)) % 2 == 1) {
|
//男
|
return "男";
|
} else {
|
//女
|
return "女";
|
}
|
}
|
if (num == 3) {
|
//获取年龄
|
var myDate = new Date();
|
var month = myDate.getMonth() + 1;
|
var day = myDate.getDate();
|
var age = myDate.getFullYear() - idcard.substring(6, 10) - 1;
|
if (idcard.substring(10, 12) < month || idcard.substring(10, 12) == month && idcard.substring(12, 14) <= day) {
|
age++;
|
}
|
return age;
|
}
|
},
|
getDetails() {
|
this.$u.api.insuranceApplyById(this.codeId)
|
.then(res => {
|
this.info = res.data
|
})
|
},
|
jump() {
|
if (this.type === 0) {
|
uni.navigateTo({
|
url: `/pages/add_insured_personnel/add_insured_personnel?solutionId=${this.id}`
|
})
|
} else {
|
uni.navigateTo({
|
url: `/pages/selectPersonnel/selectPersonnel?insuranceApplyId=${this.codeId}&validTime=${this.startDate}`
|
})
|
}
|
},
|
clickCate(i) {
|
this.type = i.index
|
}
|
}
|
}
|
</script>
|
<style>
|
page {
|
background-color: #f7f7f7;
|
}
|
</style>
|
<style lang="scss" scoped>
|
.box {
|
width: 100%;
|
.box_footer {
|
width: 100%;
|
position: fixed;
|
bottom: 0;
|
left: 0;
|
.box_footer_xy {
|
width: 100%;
|
height: 80rpx;
|
display: flex;
|
align-items: center;
|
background: #FFF7E7;
|
padding: 0 30rpx;
|
box-sizing: border-box;
|
image {
|
width: 32rpx;
|
height: 32rpx;
|
margin-right: 16rpx;
|
}
|
text {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #437CB3;
|
font-style: normal;
|
}
|
}
|
.box_footer_info {
|
width: 100%;
|
height: 120rpx;
|
padding: 0 30rpx;
|
box-sizing: border-box;
|
background-color: #FFFFFF;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
.left {
|
flex: 1;
|
height: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
flex-direction: column;
|
.box_footer_info_top {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
.box_footer_info_top_item {
|
flex: 1;
|
display: flex;
|
align-content: center;
|
.top_item_label {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #666666;
|
font-style: normal;
|
}
|
.top_item_val {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #333333;
|
font-style: normal;
|
}
|
}
|
}
|
.box_footer_info_bottom {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
margin-top: 8rpx;
|
.box_footer_info_bottom_label {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #666666;
|
font-style: normal;
|
}
|
.box_footer_info_bottom_val {
|
font-weight: 500;
|
font-size: 32rpx;
|
color: #222222;
|
font-style: normal;
|
}
|
}
|
}
|
.right {
|
flex-shrink: 0;
|
}
|
}
|
}
|
.box_head {
|
width: 100%;
|
height: 240rpx;
|
padding: 30rpx;
|
box-sizing: border-box;
|
background: linear-gradient( 180deg, #437CB3 0%, #F7F7F7 100%);
|
.box_head_info {
|
width: 100%;
|
padding: 32rpx 30rpx;
|
box-sizing: border-box;
|
background-color: rgba(255, 255, 255, 0.7);
|
border-radius: 16rpx;
|
.box_head_info_title {
|
font-weight: 500;
|
font-size: 40rpx;
|
color: #222222;
|
font-style: normal;
|
}
|
.box_head_info_list {
|
width: 100%;
|
margin-top: 24rpx;
|
position: relative;
|
image {
|
width: 200rpx;
|
height: 202rpx;
|
position: absolute;
|
bottom: 0;
|
right: 0;
|
}
|
.box_head_info_list_item {
|
width: 100%;
|
display: flex;
|
align-items: flex-start;
|
margin-bottom: 20rpx;
|
&:last-child {
|
margin: 0 !important;
|
}
|
.label {
|
flex-shrink: 0;
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #777777;
|
font-style: normal;
|
}
|
.value {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #222222;
|
font-style: normal;
|
}
|
}
|
}
|
}
|
.box_head_cate {
|
width: 100%;
|
border-bottom: 1rpx solid #E5E5E5;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
text {
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #437CB3;
|
font-style: normal;
|
}
|
}
|
.box_head_list {
|
width: 100%;
|
margin-top: 30rpx;
|
.box_head_list_item {
|
width: 100%;
|
padding: 24rpx 30rpx;
|
box-sizing: border-box;
|
background-color: #FFFFFF;
|
position: relative;
|
border-radius: 16rpx;
|
margin-bottom: 20rpx;
|
.dele {
|
width: 56rpx;
|
height: 56rpx;
|
position: absolute;
|
right: 0;
|
top: 0;
|
image {
|
width: 100%;
|
height: 100%;
|
}
|
}
|
.top {
|
width: 100%;
|
display: flex;
|
flex-direction: column;
|
.top_a {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
.top_a_tips1 {
|
width: 64rpx;
|
height: 38rpx;
|
line-height: 38rpx;
|
text-align: center;
|
border-radius: 4rpx;
|
border: 1rpx solid #FF971D;
|
font-weight: 400;
|
font-size: 24rpx;
|
color: #FF971D;
|
font-style: normal;
|
margin-left: 8rpx;
|
}
|
.top_a_tips {
|
width: 64rpx;
|
height: 38rpx;
|
line-height: 38rpx;
|
text-align: center;
|
border-radius: 4rpx;
|
border: 1rpx solid #26BE89;
|
font-weight: 400;
|
font-size: 24rpx;
|
color: #26BE89;
|
font-style: normal;
|
margin-left: 8rpx;
|
}
|
text {
|
&:first-child {
|
font-weight: 500;
|
font-size: 30rpx;
|
color: #222222;
|
font-style: normal;
|
margin-right: 30rpx;
|
}
|
&:last-child {
|
font-weight: 400;
|
font-size: 24rpx;
|
color: #777777;
|
font-style: normal;
|
}
|
}
|
}
|
.top_b {
|
width: 100%;
|
font-weight: 400;
|
font-size: 24rpx;
|
color: #777777;
|
font-style: normal;
|
margin-top: 8rpx;
|
}
|
}
|
.center {
|
width: 100%;
|
margin: 20rpx 0;
|
border-bottom: 1rpx dashed #E5E5E5;
|
}
|
.bottom {
|
width: 100%;
|
display: flex;
|
flex-direction: column;
|
.bottom_item {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
margin-bottom: 16rpx;
|
&:last-child {
|
margin: 0 !important;
|
}
|
.bottom_item_label {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #777777;
|
font-style: normal;
|
}
|
.bottom_item_val {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #222222;
|
font-style: normal;
|
}
|
}
|
}
|
}
|
.box_head_list_add {
|
width: 100%;
|
height: 280rpx;
|
background: #FFFFFF;
|
border-radius: 16rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
flex-direction: column;
|
.box_head_list_add_yuan {
|
width: 68rpx;
|
height: 68rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
border-radius: 36rpx;
|
border: 4rpx solid #437CB3;
|
.add_icon {
|
font-size: 55rpx;
|
color: #437CB3;
|
}
|
}
|
text {
|
font-weight: 400;
|
font-size: 30rpx;
|
color: #437CB3;
|
font-style: normal;
|
margin-top: 24rpx;
|
}
|
}
|
}
|
}
|
}
|
</style>
|