mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-10 03:26:45 +08:00
fix(beneficiary): 修复受益人列表渲染及数据处理问题
- 修改受益人列表的 key 值从 id 为 bid,避免删除时出错 - 新增生成随机 bid 逻辑,确保每个受益人唯一标识 - 处理受益人数据中的 effectiveDateType 类型转换 - 优化受益人信息加载逻辑,防止页面状态异常
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<div v-if="type === beneficiaryType.designateBeneficiary" class="fs14 beneficiary-list">
|
||||
<!-- 受益人信息-->
|
||||
<ul>
|
||||
<li v-for="(beneficiary, index) in beneficiaries" :key="beneficiary.id">
|
||||
<li v-for="(beneficiary, index) in beneficiaries" :key="beneficiary.bid">
|
||||
<div class="black flex justify-content-s mh5 mv10">
|
||||
<h5>受益人 {{ index + 1 }}</h5>
|
||||
<van-icon name="cross" @click="deleteBeneficiary(index)"></van-icon>
|
||||
@@ -80,7 +80,14 @@ export default {
|
||||
localStorage.setItem('salePageFlag', this.salePageFlag)
|
||||
}
|
||||
if (Array.isArray(res.orderDTO.insuredDTOs[0].bnfDTOs)) {
|
||||
Object.assign(this.beneficiaries, res.orderDTO.insuredDTOs[0].bnfDTOs)
|
||||
// 当内部有多个指定受益人时, 需要手动添加 bid , 防止后面删除掉的指定受益人时出现出错
|
||||
// 万恶的 vue for 循环
|
||||
for (const bnf of res.orderDTO.insuredDTOs[0].bnfDTOs) {
|
||||
bnf.bid = this.generateRandomId()
|
||||
// 什么,为什么在这加个这玩意?看到证件截至日期不对就是你的不对了~😄
|
||||
bnf.effectiveDateType = bnf.effectiveDateType === 'true'
|
||||
this.beneficiaries.push(bnf)
|
||||
}
|
||||
} else {
|
||||
localStorage.beneficiaryInfo = []
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user