mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-16 05:16:44 +08:00
[NEW]【电投-桂企】增加投保人信息工作单位选择框;增加代理人售卖权限校验;增加投保人工作单位投保资格校验
This commit is contained in:
@@ -27,6 +27,15 @@ export function trial(data) {
|
||||
})
|
||||
}
|
||||
|
||||
//产品售卖权限校验
|
||||
export function productCheck(data) {
|
||||
return request({
|
||||
url: getUrl('/sale/product/check', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
//订单详情
|
||||
export function orderDetail(data) {
|
||||
return request({
|
||||
|
||||
@@ -195,3 +195,11 @@ export function getPayState(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取产品允许投保人单位列表
|
||||
export function getCompany(data) {
|
||||
return request({
|
||||
url: getUrl('/sale/product/company', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -504,6 +504,7 @@ export default {
|
||||
}
|
||||
let age = utilsAge.getAge(appntDTO.birthday, new Date())
|
||||
localStorage.saleInsuredInfo = JSON.stringify({
|
||||
workcompany: appntDTO.workcompany,
|
||||
birthday: appntDTO.birthday,
|
||||
name: appntDTO.name,
|
||||
sex: appntDTO.sex,
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { Cell, CellGroup, Tag, Radio, RadioGroup } from 'vant'
|
||||
import { mainRiskList, calculatePremium } from '@/api/ebiz/common/common'
|
||||
import { mainRiskList, calculatePremium, productCheck } from '@/api/ebiz/common/common'
|
||||
import riskRules from './risk-rules'
|
||||
export default {
|
||||
name: 'mainRiskList',
|
||||
@@ -81,6 +81,7 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//下一步
|
||||
nextStep() {
|
||||
console.log(this.result)
|
||||
@@ -110,13 +111,13 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if(resultData.productTrialInfoDTO.ruleExpression){
|
||||
let ruleExpression = localStorage.ruleExpression ? JSON.parse(localStorage.ruleExpression) : {};
|
||||
|
||||
if (resultData.productTrialInfoDTO.ruleExpression) {
|
||||
let ruleExpression = localStorage.ruleExpression ? JSON.parse(localStorage.ruleExpression) : {}
|
||||
ruleExpression[resultData.productCode] = resultData.productTrialInfoDTO.ruleExpression
|
||||
localStorage.ruleExpression = JSON.stringify(ruleExpression)
|
||||
}
|
||||
|
||||
|
||||
/********start 主险选择限制 start******/
|
||||
|
||||
if (riskRules.ageLimit(resultData, this)) {
|
||||
@@ -145,6 +146,18 @@ export default {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
let flagPermission = await riskRules.getProductSellPermissionList(resultData.productCode, this)
|
||||
if (flagPermission && localStorage.isFrom != 'proposal') {
|
||||
//校验该代理人是否有该产品的售卖权限
|
||||
return this.$toast('抱歉,您没有该产品的销售权限!')
|
||||
}
|
||||
|
||||
let flagCompany = await riskRules.checkCompany(resultData.productCode, JSON.parse(localStorage.saleInsuredInfo).workcompany, this)
|
||||
if (flagCompany && localStorage.isFrom != 'proposal') {
|
||||
//校验该投保人的工作单位是否能够投保该产品
|
||||
return this.$toast('该投保人工作单位不能投保该产品')
|
||||
}
|
||||
/********end 主险选择限制 end******/
|
||||
|
||||
//保存附加险
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import { productCheck } from '@/api/ebiz/common/common'
|
||||
import { getCompany } from '@/api/ebiz/sale/sale'
|
||||
|
||||
export default {
|
||||
//投、被保险人年龄对险种的限制
|
||||
ageLimit(resultData, vm, isApplicant) {
|
||||
@@ -10,8 +13,8 @@ export default {
|
||||
tips = '被保险人年龄不适合此款险种,请选择其他险种!'
|
||||
}
|
||||
let minAge = resultData.productTrialInfoDTO.ageRange && resultData.productTrialInfoDTO.ageRange.minAge
|
||||
let maxAge = resultData.productTrialInfoDTO.ageRange && resultData.productTrialInfoDTO.ageRange.maxAge;
|
||||
[age, minAge, maxAge] = [Number(age), Number(minAge), Number(maxAge)]
|
||||
let maxAge = resultData.productTrialInfoDTO.ageRange && resultData.productTrialInfoDTO.ageRange.maxAge
|
||||
;[age, minAge, maxAge] = [Number(age), Number(minAge), Number(maxAge)]
|
||||
if (age > maxAge || age < minAge) {
|
||||
vm.$toast(tips)
|
||||
return true
|
||||
@@ -69,5 +72,55 @@ export default {
|
||||
//获取投保人信息
|
||||
getSaleInsuredInfo() {
|
||||
return localStorage.saleInsuredInfo && JSON.parse(localStorage.saleInsuredInfo)
|
||||
},
|
||||
|
||||
//获取产品售卖权限列表
|
||||
getProductSellPermissionList(val, that) {
|
||||
let flag = true
|
||||
return new Promise((resolve, reject) => {
|
||||
productCheck({ productCodes: [val] }).then(
|
||||
res => {
|
||||
if (res.result == '0') {
|
||||
if (JSON.stringify(res.content) == '{}') {
|
||||
flag = false
|
||||
} else {
|
||||
//0-有权限 1-没权限
|
||||
flag = res.content[val] === '1' ? true : false
|
||||
}
|
||||
} else {
|
||||
that.$toast(res.resultMessage)
|
||||
}
|
||||
resolve(flag)
|
||||
},
|
||||
error => {
|
||||
reject(true)
|
||||
}
|
||||
)
|
||||
})
|
||||
},
|
||||
//校验投保人工作单位是否有权限投保该产品
|
||||
checkCompany(val, workcompany, that) {
|
||||
let flag = true
|
||||
let columns = []
|
||||
return new Promise((resolve, reject) => {
|
||||
getCompany({ productCodes: [val] }).then(
|
||||
res => {
|
||||
if (res.result == 0) {
|
||||
columns = res.content
|
||||
if (columns.length == 0) {
|
||||
flag = false
|
||||
} else {
|
||||
flag = !columns.includes(workcompany)
|
||||
}
|
||||
} else {
|
||||
that.$toast(res.resultMessage)
|
||||
}
|
||||
resolve(flag)
|
||||
},
|
||||
error => {
|
||||
reject(true)
|
||||
}
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,14 +98,19 @@ export default {
|
||||
goInsure() {
|
||||
localStorage.orderNo = ''
|
||||
localStorage.chooseProductCodes = '' //置空所选险种
|
||||
let path = `/sale/insuredInfo`
|
||||
if (this.$route.params.productDetailCode == 'GFRSPRO_M0024') {
|
||||
let specilFlag = '1'
|
||||
path = `${path}?specilFlag=${specilFlag}`
|
||||
}
|
||||
// 跳转到投保建议
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/sale/insuredInfo'
|
||||
url: location.origin + '/#' + path
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/sale/insuredInfo`
|
||||
path: path
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -134,7 +139,7 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.product-detail-container {
|
||||
/deep/.van-sticky{
|
||||
/deep/.van-sticky {
|
||||
background: #fff;
|
||||
}
|
||||
.product-detail-introduct-image {
|
||||
@@ -156,8 +161,8 @@ export default {
|
||||
border-color: transparent;
|
||||
}
|
||||
/deep/.van-button--default {
|
||||
background-color: #FEEFD8;
|
||||
color: #E9332E;
|
||||
background-color: #feefd8;
|
||||
color: #e9332e;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -300,7 +300,7 @@ import getAge from '@/assets/js/utils/age.js'
|
||||
import filters from '@/filters'
|
||||
import dataDictionary from '@/assets/js/utils/data-dictionary'
|
||||
import Layout from '../../app/layout/Layout' //使用数据字典中的险种类型
|
||||
|
||||
import riskRules from '../common/risk-rules.js'
|
||||
export default {
|
||||
data() {
|
||||
let isWeixin = this.$utils.device().isWeixin //判断环境
|
||||
@@ -601,11 +601,21 @@ export default {
|
||||
})
|
||||
},
|
||||
//转投保
|
||||
insure() {
|
||||
async insure() {
|
||||
let path = '/sale/insuredInfo?edit=1'
|
||||
if (this.mainRiskCodes) {
|
||||
if (this.mainRiskCodes.length != 1) {
|
||||
return Toast.fail('暂不支持组合产品转投保')
|
||||
}
|
||||
if (this.mainRiskCodes[0] == 'GFRS_M0024') {
|
||||
let specilFlag = '1'
|
||||
path = `${path}&specilFlag=${specilFlag}`
|
||||
let flagPermission = await riskRules.getProductSellPermissionList(this.mainRiskCodes[0], this)
|
||||
if (flagPermission) {
|
||||
//校验该代理人是否有该产品的售卖权限
|
||||
return Toast.fail('抱歉,您没有该产品的销售权限!')
|
||||
}
|
||||
}
|
||||
}
|
||||
let params = {
|
||||
proposalInfoDTO: {
|
||||
@@ -619,11 +629,11 @@ export default {
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/sale/insuredInfo?edit=1',
|
||||
url: location.origin + '/#',
|
||||
backToFirst: '1'
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/sale/insuredInfo?edit=1'
|
||||
path: path
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
@@ -250,6 +250,7 @@
|
||||
@click="toSelect('7')"
|
||||
/>
|
||||
<van-field
|
||||
v-if="specilFlag != '1'"
|
||||
v-model="userInfo.workcompany"
|
||||
required
|
||||
label="工作单位"
|
||||
@@ -259,6 +260,18 @@
|
||||
maxlength="50"
|
||||
clearable
|
||||
/>
|
||||
<van-field
|
||||
v-else
|
||||
:value="userInfo.workcompany"
|
||||
readonly
|
||||
label="工作单位"
|
||||
name="工作单位"
|
||||
required
|
||||
right-icon="arrow"
|
||||
placeholder="请选择"
|
||||
v-validate="'required'"
|
||||
@click="toSelect('9')"
|
||||
/>
|
||||
<!-- <van-field
|
||||
v-model="areaName"
|
||||
readonly
|
||||
@@ -360,7 +373,7 @@ import CustomerPicker from '@/components/ebiz/customer/CustomerPicker'
|
||||
import DataDictionary from '@/assets/js/utils/data-dictionary'
|
||||
import areaList from '@/assets/js/utils/area'
|
||||
import areaLists from '@/assets/js/utils/areaNew'
|
||||
import { saveOrUpdateOrderInfo, getAuthCode, getOrderDetail } from '@/api/ebiz/sale/sale'
|
||||
import { saveOrUpdateOrderInfo, getAuthCode, getOrderDetail, getCompany } from '@/api/ebiz/sale/sale'
|
||||
import utilsAge from '@/assets/js/utils/age'
|
||||
import getAreaName from '@/assets/js/utils/get-area-name'
|
||||
import IdentityCardScan from '@/components/ebiz/sale/IdentityCardScan'
|
||||
@@ -390,6 +403,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
specilFlag: '', //特殊显示-为桂企产品专写 1-桂企 undefind-其他
|
||||
productCodes: [], //产品编码-用于“产品允许投保人单位列表获取”接口,作为请求参数
|
||||
isScan: false, //是否显示证件扫描组件
|
||||
sexRadio: [
|
||||
{
|
||||
@@ -493,6 +508,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.specilFlag = this.$route.query.specilFlag
|
||||
localStorage.removeItem('bankCardUrlPath')
|
||||
localStorage.removeItem('bankCard')
|
||||
localStorage.removeItem('bankCardUrlInsuredPath')
|
||||
@@ -628,26 +644,78 @@ export default {
|
||||
//pickerType 1、国家地区 2、证件类型 3、文化程度 4、有无社保(弃用) 5、税收居民身份 6、婚姻状况 7、在职情况 8、收入来源
|
||||
;[this.popupShow, this.pickerType] = [true, pickerType]
|
||||
if (valueKey) this.valueKey = valueKey
|
||||
if (pickerType == '1') {
|
||||
this.columns = DataDictionary.nativeplace
|
||||
} else if (pickerType == '2') {
|
||||
this.columns = DataDictionary.insuredIdType
|
||||
} else if (pickerType == '3') {
|
||||
this.columns = DataDictionary.degree
|
||||
} else if (pickerType == '4') {
|
||||
this.columns = [
|
||||
{ id: 0, text: '有' },
|
||||
{ id: 1, text: '无' }
|
||||
]
|
||||
} else if (pickerType == '5') {
|
||||
this.columns = DataDictionary.taxIdentity
|
||||
} else if (pickerType == '6') {
|
||||
this.columns = DataDictionary.marriage
|
||||
} else if (pickerType == '7') {
|
||||
this.columns = DataDictionary.workCondition
|
||||
} else if (pickerType == '8') {
|
||||
this.columns = DataDictionary.salarySource
|
||||
|
||||
switch (pickerType) {
|
||||
case '1':
|
||||
this.columns = DataDictionary.nativeplace
|
||||
break
|
||||
case '2':
|
||||
this.columns = DataDictionary.insuredIdType
|
||||
break
|
||||
case '3':
|
||||
this.columns = DataDictionary.degree
|
||||
break
|
||||
case '4':
|
||||
this.columns = [
|
||||
{ id: 0, text: '有' },
|
||||
{ id: 1, text: '无' }
|
||||
]
|
||||
break
|
||||
case '5':
|
||||
this.columns = DataDictionary.taxIdentity
|
||||
break
|
||||
case '6':
|
||||
this.columns = DataDictionary.marriage
|
||||
break
|
||||
case '7':
|
||||
this.columns = DataDictionary.workCondition
|
||||
break
|
||||
case '8':
|
||||
this.columns = DataDictionary.salarySource
|
||||
break
|
||||
case '9':
|
||||
this.productCodes.length = 0
|
||||
this.productCodes.push('GFRS_M0024')
|
||||
getCompany({ productCodes: this.productCodes }).then(res => {
|
||||
if (res.result == 0) {
|
||||
this.columns = res.content
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
break
|
||||
}
|
||||
|
||||
// if (pickerType == '1') {
|
||||
// this.columns = DataDictionary.nativeplace
|
||||
// } else if (pickerType == '2') {
|
||||
// this.columns = DataDictionary.insuredIdType
|
||||
// } else if (pickerType == '3') {
|
||||
// this.columns = DataDictionary.degree
|
||||
// } else if (pickerType == '4') {
|
||||
// this.columns = [
|
||||
// { id: 0, text: '有' },
|
||||
// { id: 1, text: '无' }
|
||||
// ]
|
||||
// } else if (pickerType == '5') {
|
||||
// this.columns = DataDictionary.taxIdentity
|
||||
// } else if (pickerType == '6') {
|
||||
// this.columns = DataDictionary.marriage
|
||||
// } else if (pickerType == '7') {
|
||||
// this.columns = DataDictionary.workCondition
|
||||
// } else if (pickerType == '8') {
|
||||
// this.columns = DataDictionary.salarySource
|
||||
// } else if (pickerType == '9') {
|
||||
// this.productCodes.length = 0
|
||||
// this.productCodes.push('GFRS_M0024')
|
||||
// getCompany({ productCodes: this.productCodes }).then(res => {
|
||||
// if (res.result == 0) {
|
||||
// this.columns = res.content
|
||||
// } else {
|
||||
// this.$toast(res.resultMessage)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
},
|
||||
//确认选择字段
|
||||
onConfirm(value) {
|
||||
@@ -675,6 +743,8 @@ export default {
|
||||
this.userInfo.jobStatus = value.id
|
||||
} else if (this.pickerType == '8') {
|
||||
this.userInfo.salarySource = value.id
|
||||
} else if (this.pickerType == '9') {
|
||||
this.userInfo.workcompany = value
|
||||
}
|
||||
},
|
||||
//证件起始截止日期
|
||||
@@ -1115,6 +1185,7 @@ export default {
|
||||
}
|
||||
}
|
||||
let str = ''
|
||||
let specilFlag = this.$route.query.specilFlag === '1' ? 'specilFlag=1&' : ''
|
||||
params.orderDTO.appntDTO = this.userInfo
|
||||
let resultData = await saveOrUpdateOrderInfo(params)
|
||||
if (resultData.result == 0) {
|
||||
@@ -1146,10 +1217,10 @@ export default {
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/sale/insuredPerson?${str}`
|
||||
url: location.origin + `/#/sale/insuredPerson?${specilFlag}${str}`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/sale/insuredPerson?${str}`
|
||||
path: `/sale/insuredPerson?${specilFlag}${str}`
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -1157,10 +1228,10 @@ export default {
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/sale/insuredPerson?${str}`
|
||||
url: location.origin + `/#/sale/insuredPerson?${specilFlag}${str}`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/sale/insuredPerson?${str}`
|
||||
path: `/sale/insuredPerson?${specilFlag}${str}`
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user