You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
221 lines
9.0 KiB
221 lines
9.0 KiB
<template>
|
|
<div>
|
|
<div v-if="show">
|
|
<div class="policyTop">
|
|
<span v-if="tips1" style="display: block;margin-bottom: 10px;" v-html="replacementRagEmoticon(tips1)"></span>
|
|
<span v-if="tips2">{{ tips2.split('%s')[0] }}
|
|
<b v-if="tips2.indexOf('%s') > -1" class="name">{{ customerName }}</b>
|
|
{{ tips2.indexOf('%s') > -1 ? tips2.split('%s')[1] : '' }}
|
|
</span>
|
|
</div>
|
|
<div class="policyShow" v-for="(item, index) in policyList" :key="index">
|
|
<div v-for="(showItem) in showMap" :key="showItem.name + index" style="margin-bottom: 10px;">
|
|
<p style="display: inline;" v-html="replacementRagEmoticon(showItem.name)"></p>
|
|
<p style="display: inline;">{{ `:${item[showItem.code]}` }}</p>
|
|
</div>
|
|
<div v-for="(loanItem) in loanMap" :key="loanItem.name" style="margin-bottom: 10px;">
|
|
<div v-if="!!item['ff9010134Dto']">
|
|
<p style="display: inline;" v-html="replacementRagEmoticon(loanItem.name)"></p>
|
|
<p style="display: inline;">{{ `:${item['ff9010134Dto'][loanItem.code]}` }}</p>
|
|
</div>
|
|
</div>
|
|
<div v-for="(fxItem) in fxMap" :key="fxItem.name" style="margin-bottom: 10px;">
|
|
<div v-if="!!item.bdzx0100541Dto">
|
|
<div v-if="fxItem.code === 'infoList'">
|
|
<p>被保人列表:</p>
|
|
<div v-for="(item1, index1) in item.bdzx0100541Dto[fxItem.code]" :key="index1">
|
|
<div v-if="!!item1.iidnum || !!item1.iname">
|
|
<p style="padding-left: 5px">{{ ` 被保人姓名:${item1.iname}` }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div v-else-if="yonCodeList.includes(fxItem.code)">
|
|
<p style="display: inline;" v-html="replacementRagEmoticon(fxItem.name)"></p>
|
|
<p style="display: inline;">{{ `:${fxtypeMap[item.bdzx0100541Dto[fxItem.code]]}` }}</p>
|
|
</div>
|
|
<div v-else-if="fxItem.code === 'xztype'">
|
|
<p style="display: inline;" v-html="replacementRagEmoticon(fxItem.name)"></p>
|
|
<p style="display: inline;">{{ `:${xztypeMap[item.bdzx0100541Dto[fxItem.code]]}` }}</p>
|
|
</div>
|
|
<div v-else-if="fxItem.code === 'appf'">
|
|
<p style="display: inline;" v-html="replacementRagEmoticon(fxItem.name)"></p>
|
|
<p style="display: inline;">{{ `:${appfMap[item.bdzx0100541Dto[fxItem.code]]}` }}</p>
|
|
</div>
|
|
<div v-else>
|
|
<p style="display: inline;" v-html="replacementRagEmoticon(fxItem.name)"></p>
|
|
<p style="display: inline;">{{ `:${item.bdzx0100541Dto[fxItem.code]}` }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div v-for="(zhjsItem) in zhjsMap" :key="zhjsItem.name" style="margin-bottom: 10px;">
|
|
<div v-if="!!item.ff0100414Dto">
|
|
<p style="display: inline;" v-html="replacementRagEmoticon(zhjsItem.name)"></p>
|
|
<p style="display: inline;">{{ `:${item['ff0100414Dto'][zhjsItem.code]}` }}</p>
|
|
</div>
|
|
</div>
|
|
<div v-for="(hlItem) in hlMap" :key="hlItem.name" style="margin-bottom: 10px;">
|
|
<div v-if="!!item.ff0100412Dto">
|
|
<div v-if="hlItem.code !== 'acctinfo'">
|
|
<p style="display: inline;" v-html="replacementRagEmoticon(hlItem.name)"></p>
|
|
<p style="display: inline;">{{ `:${item['ff0100412Dto'][hlItem.code]}` }}</p>
|
|
</div>
|
|
<div v-else>
|
|
<p style="display: inline;" v-html="replacementRagEmoticon(hlItem.name) + ':'"></p>
|
|
<div style="margin-bottom:15px" v-for="(item2, index2) in item.ff0100412Dto.acctinfo" :key="index2">
|
|
<div v-for="(acctItem) in acctinfoMap" :key="acctItem.name">
|
|
<p style="display: inline;padding-left:10px" v-html="replacementRagEmoticon(acctItem.name)"></p>
|
|
<p style="display: inline;">{{ `:${item2[acctItem.code]}` }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div v-for="(scjzhItem) in scjzhMap" :key="scjzhItem.name" style="margin-bottom: 10px;">
|
|
<div v-if="!!item.ff01006582Dto">
|
|
<p style="display: inline;" v-html="replacementRagEmoticon(scjzhItem.name)"></p>
|
|
<p style="display: inline;">{{ `:${item['ff01006582Dto'][scjzhItem.code]}` }}</p>
|
|
</div>
|
|
</div>
|
|
<div v-for="(lqItem) in lqMap" :key="lqItem.name" style="margin-bottom: 10px;">
|
|
<div v-if="!!item.ff0100511Dto">
|
|
<div v-if="lqItem.code !== 'cvrginfo'">
|
|
<p style="display: inline;" v-html="replacementRagEmoticon(lqItem.name)"></p>
|
|
<p style="display: inline;">{{ `:${item['ff0100511Dto'][lqItem.code]}` }}</p>
|
|
</div>
|
|
<div v-else>
|
|
<p style="display: inline;" v-html="replacementRagEmoticon(lqItem.name) + ':'"></p>
|
|
<div style="margin-bottom:15px" v-for="(item3, index3) in item.ff0100511Dto.cvrginfo" :key="index3">
|
|
<div v-for="(cvrgItem) in cvrginfoMap" :key="cvrgItem.name">
|
|
<p style="display: inline;padding-left:10px" v-html="replacementRagEmoticon(cvrgItem.name)"></p>
|
|
<p style="display: inline;">{{ `:${item3[cvrgItem.code]}` }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="policyBottom">
|
|
<span v-if="tips3" v-html="replacementRagEmoticon(tips3)"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref, onMounted } from 'vue'
|
|
import _ from 'lodash'
|
|
import { SJHLCmdList } from '@/utils/constant'
|
|
|
|
const props = defineProps({
|
|
data: { type: Object, default: () => ({}) }
|
|
})
|
|
|
|
const policyList = ref([])
|
|
const customerName = ref('')
|
|
const tips1 = ref('')
|
|
const tips2 = ref('')
|
|
const tips3 = ref('')
|
|
const show = ref(false)
|
|
const showMap = ref([])
|
|
const loanMap = ref([])
|
|
const fxMap = ref([])
|
|
const zhjsMap = ref([])
|
|
const hlMap = ref([])
|
|
const acctinfoMap = ref([])
|
|
const scjzhMap = ref([])
|
|
const lqMap = ref([])
|
|
const cvrginfoMap = ref([])
|
|
const yonCodeList = ['iask', 'nedchk', 'waiverflag', 'freelxflag', 'atrisalone', 'zjtqflag', 'isaccout']
|
|
const fxtypeMap = { '0': '否', '1': '是' }
|
|
const xztypeMap = { '0': '其他', '1': '年金', '2': '意外', '3': '重疾' }
|
|
const appfMap = { '0': '主险', '1': '附加险' }
|
|
|
|
onMounted(() => {
|
|
const cmd = _.get(props, 'data.cmd', '')
|
|
if (!SJHLCmdList.includes(cmd)) return
|
|
|
|
policyList.value = _.get(props, 'data.specialData.data', [])
|
|
if (_.isEmpty(policyList.value)) return
|
|
|
|
customerName.value = _.get(props, 'data.specialData.name', '')
|
|
const msgText = _.get(props, 'data.msgText', '')
|
|
|
|
if (msgText.indexOf('|$|') !== -1 && msgText.split('|$|').length > 1) {
|
|
const contentMap = msgText.split('|$|')
|
|
const huashu = contentMap[1]
|
|
if (huashu.indexOf('||') !== -1 && huashu.split('||').length > 3) {
|
|
const huashuMap = huashu.split('||')
|
|
tips1.value = huashuMap[1] || ''
|
|
tips2.value = huashuMap[2] || ''
|
|
tips3.value = huashuMap[3] || ''
|
|
}
|
|
}
|
|
|
|
if (msgText.indexOf('|#|') !== -1 && msgText.split('|#|').length > 1) {
|
|
const contentMap = msgText.split('|#|')
|
|
let showMapStr = contentMap[1]
|
|
showMapStr = _.replace(showMapStr, /<span style="letter-spacing: 0.4px;">/g, '')
|
|
if (showMapStr.indexOf('||') !== -1 && showMapStr.split('||').length > 0) {
|
|
showMap.value = _.map(showMapStr.split('||'), (item) => {
|
|
if (item.indexOf(':') !== -1) {
|
|
const itemMap = item.split(':')
|
|
const code = _.replace(itemMap[itemMap.length - 1], '</span>', '')
|
|
const name = item.replace(`:${code}`, '').replace(`:</span>${code}`, '')
|
|
return { name, code }
|
|
}
|
|
}).filter(Boolean)
|
|
}
|
|
show.value = true
|
|
}
|
|
|
|
parseFieldMap(msgText, '|~|', loanMap)
|
|
parseFieldMap(msgText, '|!|', fxMap)
|
|
parseFieldMap(msgText, '|~!|', zhjsMap)
|
|
parseFieldMap(msgText, '|&|', hlMap)
|
|
parseFieldMap(msgText, '|*|', scjzhMap)
|
|
parseFieldMap(msgText, '|+|', lqMap)
|
|
})
|
|
|
|
function parseFieldMap(msgText, separator, targetRef) {
|
|
if (msgText.indexOf(separator) !== -1 && msgText.split(separator).length > 1) {
|
|
const ruleMap = msgText.split(separator)
|
|
let ruleMapStr = ruleMap[1]
|
|
ruleMapStr = _.replace(ruleMapStr, /<span style="letter-spacing: 0.4px;">/g, '')
|
|
if (!!ruleMapStr) {
|
|
targetRef.value = _.map(ruleMapStr.split('||'), (item) => {
|
|
if (item.indexOf(':') !== -1) {
|
|
const itemMap = item.split(':')
|
|
const code = _.replace(itemMap[itemMap.length - 1], '</span>', '')
|
|
const name = item.replace(`:${code}`, '').replace(`:</span>${code}`, '')
|
|
return { name, code }
|
|
}
|
|
}).filter(Boolean)
|
|
}
|
|
}
|
|
}
|
|
|
|
function replacementRagEmoticon(str) {
|
|
str = str || ''
|
|
return str.replace(/\\n/gm, '<br/>')
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.policyShow {
|
|
margin: 10px 0;
|
|
padding-bottom: 10px;
|
|
}
|
|
|
|
.policyShow p {
|
|
line-height: 0.6rem;
|
|
}
|
|
|
|
.policyTop {
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.name {
|
|
display: inline-block;
|
|
color: #0059d1;
|
|
}
|
|
</style>
|
|
|