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

This commit is contained in:
zhangqi1
2021-09-14 19:02:32 +08:00
parent b8d2743f3c
commit b67d44d432
7 changed files with 376 additions and 62 deletions

View File

@@ -103,6 +103,7 @@ export default {
if (localStorage.allowancePageFlag == '-10' && pageIndex != 4) {
this.$toast('已到达签名确认流程,不可以回到前面的流程')
}
if (!localStorage.allowancePageFlag) return
if (Number(localStorage.allowancePageFlag) < Number(pageIndex)) return
switch (pageIndex) {
case 1: //跳到基本信息页面
@@ -127,7 +128,7 @@ export default {
.confirm({
className: 'dialog-blue',
title: '提示',
message: '离开此页可能会丢失部分数据,是否确认离开?',
message: '离开此页可能会丢失部分数据,是否确认离开?'
// cancelButtonColor: '#E9332E',
// confirmButtonColor: '#FFFFFF'
})

View File

@@ -0,0 +1,113 @@
<template>
<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 parentInfo.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.customerName }}</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>
</div>
<div v-else class="text-center">
<img class="mt40 w200" src="../../../../assets/images/pic_page-non.png"/>
<p class="mt15">暂无数据</p>
</div>
</van-index-bar>
</div>
</template>
<script>
import { getCustomersList, getAgentCustomerInfo } from '@/api/ebiz/customer/customer'
import dataDictionary from '@/assets/js/utils/data-dictionary' //根据数据字典找到用户等级
import utils from '@/assets/js/business-common'
import { IndexBar, IndexAnchor, Tag, Icon } from 'vant'
export default {
name: 'Parent',
data() {
return {
data: [],
isSuccess: false,
type: ['success', 'primary', 'danger', '']
}
},
created() {
this.getList()
},
components: {
[IndexBar.name]: IndexBar,
[IndexAnchor.name]: IndexAnchor,
[Tag.name]: Tag,
[Icon.name]: Icon
},
mounted() {},
methods: {
choose(data) {
let params = {
customerNumber: data.customerNumber
}
getAgentCustomerInfo(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)
}
})
},
getList() {
getCustomersList({}).then(res => {
debugger
console.log(res)
if (res.result == '0') {
let customerList = []
//根据数据字典中的客户等级 展示
for (var key in res.agentCustomerList) {
// res.agentCustomerList[key].forEach(current => {
// dataDictionary.customerType.forEach(type => {
// if (current.customerType == type.id) {
// current.typeName = type.text
// }
// })
// })
let current = {
data: res.agentCustomerList[key],
letter: key
}
customerList.push(current)
}
this.data = customerList
}
})
}
}
}
</script>
<style lang="scss">
.parent {
.van-index-anchor {
padding-top: 2px;
padding-bottom: 2px;
border-bottom: 1px solid #d6d6d6;
}
.border-b {
border-bottom: 1px solid #d6d6d6;
}
.content:last-child {
border: none;
}
}
</style>

View File

@@ -0,0 +1,168 @@
<template>
<div id='parent-picker'>
<van-field
:label='label'
v-model='name'
@input='onChange'
:placeholder='placeholder'
:required='required'
:right-icon="$assetsUrl + 'images/allowance/avatar.png'"
@click-right-icon='chooseParent'
:readonly='readonly'
/>
<van-popup v-model='parentShowPicker' position='bottom'>
<parent @on-choose='choose' :code='code' :name='name' :life='life' :health='health'></parent>
</van-popup>
</div>
</template>
<script>
import { Field, Popup, Icon, Sticky } from 'vant'
import Parent from './Parent'
export default {
name: 'ParentPicker',
props: {
label: {
type: String,
default: '11'
},
value: {
type: String,
default: ''
},
chooseName: {
type: String,
default: ''
},
placeholder: {
type: String,
default: '请选择'
},
required: {
type: Boolean,
default: false
},
data: {
type: Array,
default: () => {
}
},
//选项对象中,文字对应的 key
valueKey: {
type: String,
default: 'text'
},
keyId: {},
lifeGrade: {
type: String,
default: ''
},
healthGrade: {
type: String,
default: ''
},
parentShowPicker: {
type: Boolean,
default: false
},
readonly: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
}
},
data() {
return {
name: '',
code: '',
life: '',
health: '',
showPicker: false
}
},
components: {
[Field.name]: Field,
[Popup.name]: Popup,
[Icon.name]: Icon,
[Sticky.name]: Sticky,
Parent
},
mounted() {
this.showPicker = this.parentShowPicker
},
watch: {
value: {
handler() {
this.name = this.value
},
immediate: true
}
},
methods: {
onChange(value) {
let regExp = /\s+/
value = value.replace(regExp, '')
this.name = value
this.$emit('input', value)
},
choose(data) {
this.name = data.customerName
this.$emit('on-choose', data)
},
chooseParent() {
if (this.disabled) {
return
}
this.showPicker = true
this.$emit('on-click')
},
cancel() {
this.showPicker = false
this.$emit('cancel', '')
}
}
}
</script>
<style lang='scss' scoped>
#parent-picker {
.van-popup--bottom {
height: 100%;
}
.van-popup {
background: #f5f5f5;
}
/deep/ .van-cell:not(:last-child)::after {
position: absolute;
box-sizing: border-box;
content: ' ';
pointer-events: none;
right: 0;
bottom: 0;
left: 4.26667vw;
border-bottom: 1px solid transparent;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
}
}
#parent-picker:not(:last-child)::after {
position: absolute;
z-index: 99;
box-sizing: border-box;
content: ' ';
pointer-events: none;
right: 0;
// bottom: 0;
// top: 0;
left: 4.26667vw;
border-bottom: 1px solid #dadada;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
}
</style>