GFRS-2618【前端】新增津贴申请的基本信息页面的部分代码。提交人--张齐

This commit is contained in:
zhangqi1
2021-09-16 22:30:05 +08:00
parent 9f8f4bc70f
commit c16e2269d7
9 changed files with 630 additions and 745 deletions

View File

@@ -1,7 +1,7 @@
import request from '@/assets/js/utils/request'
import getUrl from '@/assets/js/utils/get-url'
// 代理人客户列表
// 查询父母列表数据的接口
export function getAllowanceBaseList(data) {
return request({
url: getUrl('/agent/allowanceBase/getAllowanceBaseList', 1),
@@ -10,10 +10,10 @@ export function getAllowanceBaseList(data) {
})
}
//查询代理人客户信息
export function getAgentCustomerInfo(data) {
// 列表父母信息录入校验的接口
export function check(data) {
return request({
url: getUrl('/customer/agent/getAgentCustomerInfo', 1),
url: getUrl('/agent/allowanceBase/check', 1),
method: 'post',
data
})

View File

@@ -3616,6 +3616,7 @@ export default {
{ id: '2', text: '重新投保' }
],
// <!--------- 津贴申请专用 begin --------->
// 津贴申请-证件类型的枚举(父母津贴申请功能专用,因为父母津贴功能中证件类型没有出生证,所以在此创建一个新的枚举,供父母津贴功能专用)
allowanceIdType: [
{ id: 1, text: '居民身份证' },
@@ -3634,4 +3635,5 @@ export default {
{ id: '0', text: '父亲' },
{ id: '1', text: '母亲' }
]
// <!--------- 津贴申请专用 end --------->
}

View File

@@ -2,22 +2,15 @@
<div class='parent'>
<van-index-bar>
<div v-if='data.length > 0'>
<!-- <div class=' bg-white mt10 ' v-for='parentInfo in data' :key='parentInfo.letter'>-->
<!-- <van-index-anchor :index='parentInfo.letter' />-->
<div v-for='parent in data' :key='parent.name'
class='flex ml15 mt10 pb10 content border-b align-items-c' @click='choose(parent)'>
<img class='w40 mr15 ' src='../../../assets/images/bnf_avatar.png' />
<div class='c-gray-darker fs14'>
<div>{{ parent.name }}</div>
<div class='mt5'>{{ parent.customerPhone }}</div>
</div>
<div class='text-right' style='flex:1'>
<!-- <van-tag :color="parent.customerType == 0 ? '#7ED321' : parent.customerType == 1 ? '#5CA7DE' : '#333'" class="mr40" plain>{{-->
<!-- parent.typeName-->
<!-- }}</van-tag>-->
</div>
<!-- </div>-->
<div v-for='parent in data' :key='parent.name'
class='flex ml15 mt10 pb10 content border-b align-items-c' @click='choose(parent)'>
<img class='w40 mr15 ' src='../../../assets/images/bnf_avatar.png' />
<div class='c-gray-darker fs14'>
<div>{{ parent.name }}</div>
</div>
<div class='text-right' style='flex:1'>
<van-tag class='mr40' color='#2E4591' plain>{{ parent.typeName }}</van-tag>
</div>
</div>
</div>
<div v-else class='text-center'>
@@ -25,10 +18,21 @@
<p class='mt15'>暂无数据</p>
</div>
</van-index-bar>
<van-button
type='default'
class='bottom-btn'
size='large'
v-if='locationHashFlag !== -1'
@click='addParentInfoFunc'
v-no-more-click='1000'>
点击增加父母信息
</van-button>
</div>
</template>
<script>
import { getAllowanceBaseList, getAgentCustomerInfo } from '@/api/ebiz/parentList/parentList'
import { getAllowanceBaseList, check } from '@/api/ebiz/parentList/parentList'
import { getAllowanceBaseDetail } from '@/api/ebiz/allowance/myInfo'
import dataDictionary from '@/assets/js/utils/data-dictionary' //根据数据字典找到用户等级
import utils from '@/assets/js/business-common'
import { IndexBar, IndexAnchor, Tag, Icon } from 'vant'
@@ -39,7 +43,8 @@ export default {
return {
data: [],
isSuccess: false,
type: ['success', 'primary', 'danger', '']
type: ['success', 'primary', 'danger', ''],
locationHashFlag: ''
}
},
created() {
@@ -52,31 +57,75 @@ export default {
[Icon.name]: Icon
},
mounted() {
let str = location.hash
this.locationHashFlag = str.search(/myInfo/i)
},
methods: {
choose(data) {
let params = {
customerNumber: data.customerNumber
enjoyId: data.id
}
getAgentCustomerInfo(params).then(res => {
console.log(res, '详情')
getAllowanceBaseDetail(params).then(res => {
// console.log(res, '详情')
if (res.result == '0') {
this.isSuccess = true
let content = res.content
if (content.birthday) {
content.age = utils.jsGetAge(content.birthday)
}
this.$emit('on-choose', content)
// 获取享受人数据,然后传给父组件中的方法
this.$emit('on-choose', res.content.allowanceBaseDTO.allowanceBaseEnjoyDTO)
}
})
},
/**
* @Description: 获取父母信息数据列表的方法
* @author:zhangqi
* @Date:2021-09-08
*/
getList() {
getAllowanceBaseList({}).then(res => {
console.log(res)
// console.log(res)
if (res.result == '0') {
this.data = res.content
// 定义一个新的数组集合
let parentList = []
// 循环数据集合,整合数据
res.content.forEach(item => {
// 循环数据字典中的津贴申请-享受人角色的枚举(父母津贴申请功能专用)枚举数据,然后给数据中添加一个新的字段,表示角色(父亲或母亲)
dataDictionary.allowanceEnjoyUserRole.forEach(type => {
if (item.relationship == type.id) {
item.typeName = type.text
}
})
// 将数据对象添加进新的数组中
parentList.push(item)
})
// 将'parentList'赋值给全局变量'data'
this.data = parentList
}
})
},
/**
* @Description: 点击增加父母信息按钮,执行的方法
* @author:zhangqi
* @Date:2021-09-16
*/
async addParentInfoFunc() {
// 调用接口
let res = await check({})
if (res.result === '0') {
// 调用父组件中的方法,设置关闭选择父母列表的页面
this.$emit('close-parent-picker')
// 跳转到我的资料-基本信息页面
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/allowance/myInfo/BaseInfo'
},
routerInfo: {
path: '/allowance/myInfo/BaseInfo'
}
})
} else {
this.$toast(res.resultMessage)
}
}
}
}
@@ -96,5 +145,12 @@ export default {
.content:last-child {
border: none;
}
.bottom-btn {
background: #2E4591;
border: 1px solid #2E4591;
color: #DCB07C;
letter-spacing: 1px;
}
}
</style>

View File

@@ -11,7 +11,8 @@
:readonly='readonly'
/>
<van-popup v-model='parentShowPicker' position='bottom'>
<parent @on-choose='choose' :code='code' :name='name' :life='life' :health='health'></parent>
<parent @on-choose='choose' @close-parent-picker='closeParentPicker' :code='code' :name='name' :life='life'
:health='health'></parent>
</van-popup>
</div>
</template>
@@ -111,9 +112,13 @@ export default {
this.$emit('input', value)
},
choose(data) {
this.name = data.customerName
this.name = data.name
this.$emit('on-choose', data)
},
closeParentPicker() {
// 设置关闭当前选择数据的列表页面
this.parentShowPicker = false
},
chooseParent() {
if (this.disabled) {
return

View File

@@ -558,6 +558,6 @@ export default {
.bottom-btn {
background: #2E4591;
border: 1px solid #2E4591;
color: #FFFFFF
color: #DCB07C;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -247,7 +247,7 @@ export default {
// 将申请人数据赋值给一个新的变量,以便于在下方给变量赋值
let applyData = res.content.allowanceDTO.allowanceApplyDTO
// 将享受人数据赋值给一个新的变量,以便于在下方给变量赋值
let enjoyData = res.content.allowanceBaseDTO.allowanceEnjoyDTO
let enjoyData = res.content.allowanceDTO.allowanceEnjoyDTO
// 赋值申请人工号
this.applicantInfo.agentCode = applyData.agentCode
// 赋值申请人姓名
@@ -403,11 +403,11 @@ export default {
}
})
// 将选择的享受人的数据,赋值给对应的变量
this.enjoyUserInfo.name = data.customerName // 享受人姓名
this.enjoyUserInfo.relationship = String(data.customerSex) // 享受人角色(与申请人的关系)
this.enjoyUserInfo.idType = data.customerIdType // 享受人证件类型
this.enjoyUserInfo.idNo = data.customerIdNumber // 享受人证件号码
this.enjoyUserInfo.sex = String(data.customerSex) // 享受人性别
this.enjoyUserInfo.name = data.name // 享受人姓名
this.enjoyUserInfo.relationship = String(data.relationship) // 享受人角色(与申请人的关系)
this.enjoyUserInfo.idType = data.idType // 享受人证件类型
this.enjoyUserInfo.idNo = data.idNo // 享受人证件号码
this.enjoyUserInfo.sex = String(data.sex) // 享受人性别
this.enjoyUserInfo.birthday = data.birthday // 享受人出生日期
this.getRelatedData(this.enjoyUserInfo.idNo) // 调用校验证件号码是否合规的方法
},
@@ -634,7 +634,7 @@ export default {
.bottom-btn {
background: #2E4591;
border: 1px solid #2E4591;
color: #FFFFFF
color: #DCB07C;
}
}
</style>

View File

@@ -185,7 +185,7 @@ export default {
// 把账户信息数据对象赋值给一个新的变量
let data = res.content.allowanceBaseDTO.allowanceBaseBankDTO
// 赋值持卡人姓名(享受人)
this.accountBankInfo.accountName = data.name
this.accountBankInfo.accountName = data.accountName
// 赋值银行所在省编码
this.accountBankInfo.bankProvinceCode = data.bankProvinceCode
// 赋值银行所在地区编码
@@ -486,7 +486,7 @@ export default {
//如果从津贴申请列表编辑按钮或者新增津贴申请进入
localStorage.allowanceMyInfoPageFlag = '3'
}
// 跳转到账户信息页面
// 跳转到影像资料页面
this.$jump({
flag: 'h5',
extra: {
@@ -558,6 +558,6 @@ export default {
.bottom-btn {
background: #2E4591;
border: 1px solid #2E4591;
color: #FFFFFF
color: #DCB07C;
}
</style>

View File

@@ -398,11 +398,11 @@ export default {
}
})
// 将选择的享受人的数据,赋值给对应的变量
this.enjoyUserInfo.name = data.customerName // 享受人姓名
this.enjoyUserInfo.relationship = String(data.customerSex) // 享受人角色(与申请人的关系)
this.enjoyUserInfo.idType = data.customerIdType // 享受人证件类型
this.enjoyUserInfo.idNo = data.customerIdNumber // 享受人证件号码
this.enjoyUserInfo.sex = String(data.customerSex) // 享受人性别
this.enjoyUserInfo.name = data.name // 享受人姓名
this.enjoyUserInfo.relationship = String(data.relationship) // 享受人角色(与申请人的关系)
this.enjoyUserInfo.idType = data.idType // 享受人证件类型
this.enjoyUserInfo.idNo = data.idNo // 享受人证件号码
this.enjoyUserInfo.sex = String(data.sex) // 享受人性别
this.enjoyUserInfo.birthday = data.birthday // 享受人出生日期
this.getRelatedData(this.enjoyUserInfo.idNo) // 调用校验证件号码是否合规的方法
},
@@ -629,7 +629,7 @@ export default {
.bottom-btn {
background: #2E4591;
border: 1px solid #2E4591;
color: #FFFFFF
color: #DCB07C;
}
}
</style>