mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-11 19:06:43 +08:00
Merge branch 'nbs' into release/0401
# Conflicts: # src/assets/js/utils/data-dictionary.js # src/config/index.js # src/router/ebiz/index.js # src/views/app/Home.vue
This commit is contained in:
75
src/api/ebiz/nbs/index.js
Normal file
75
src/api/ebiz/nbs/index.js
Normal file
@@ -0,0 +1,75 @@
|
||||
import request from '@/assets/js/utils/request'
|
||||
import getUrl from '@/assets/js/utils/get-url'
|
||||
|
||||
//事件列表
|
||||
export function getList(data) {
|
||||
return request({
|
||||
url: getUrl('/proposal/nbs/getProposalNbsList', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function saveForm(data) {
|
||||
return request({
|
||||
url: getUrl('/proposal/nbs/saveOrUpdateProposalNbs', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function delNbs(data) {
|
||||
return request({
|
||||
url: getUrl('/proposal/nbs/deleteProposalNbs', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function completeNbs(data) {
|
||||
return request({
|
||||
url: getUrl('/proposal/nbs/modifyProposalNbsState', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function nbsDetail(data) {
|
||||
return request({
|
||||
url: getUrl('/proposal/nbs/getProposalNbsDemo', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function nbsChart(data) {
|
||||
return request({
|
||||
url: getUrl('/proposal/nbs/getProposalNbsStatistics', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function nbsTable(data) {
|
||||
return request({
|
||||
url: getUrl('/proposal/nbs/getProposalNbsStatisticsDetail', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
//NBS智能分析报告生成PDF
|
||||
export function makePDF(data) {
|
||||
return request({
|
||||
url: getUrl('/proposal/nbs/getPdfInfo', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
//NBS客户清单列表pdf生成
|
||||
export function makeCustomerPDF(data) {
|
||||
return request({
|
||||
url: getUrl('/proposal/nbs/getProposalNbsStatisticsDetailDownLoad', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
BIN
src/assets/images/nbs/chart.png
Normal file
BIN
src/assets/images/nbs/chart.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 291 B |
BIN
src/assets/images/nbs/dot.png
Normal file
BIN
src/assets/images/nbs/dot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 675 B |
BIN
src/assets/images/nbs/empty.png
Normal file
BIN
src/assets/images/nbs/empty.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
src/assets/images/nbs/nav.png
Normal file
BIN
src/assets/images/nbs/nav.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
BIN
src/assets/images/share@2x.png
Normal file
BIN
src/assets/images/share@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 573 B |
@@ -206,5 +206,18 @@ export default {
|
||||
isWeixin: ua.match(/MicroMessenger/i),
|
||||
isDC: ua.match(/guofulife/i) //app环境
|
||||
}
|
||||
},
|
||||
|
||||
deepCopy: function deepCopy(source) {
|
||||
let result
|
||||
if (Array.isArray(source)) {
|
||||
result = source.map(v => deepCopy(v))
|
||||
} else if (typeof source === 'object' && source !== null) {
|
||||
result = {}
|
||||
Object.keys(source).forEach(v => (result[v] = deepCopy(source[v])))
|
||||
} else {
|
||||
result = source
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
29
src/assets/sass/nbs.scss
Normal file
29
src/assets/sass/nbs.scss
Normal file
@@ -0,0 +1,29 @@
|
||||
@mixin container {
|
||||
box-sizing: border-box;
|
||||
min-height: 100vh;
|
||||
padding-bottom: 50px;
|
||||
background: #fff;
|
||||
}
|
||||
.nbs-del,
|
||||
.nbs-add {
|
||||
height: 32px;
|
||||
width: 347px;
|
||||
margin: 10px auto 0 auto;
|
||||
line-height: 32px;
|
||||
}
|
||||
.nbs-del {
|
||||
border: 1px solid #f2f2f2;
|
||||
background-color: #f2f2f2;
|
||||
font-size: 20px;
|
||||
text-align: right;
|
||||
/deep/ i {
|
||||
position: relative;
|
||||
top: 6px;
|
||||
right: 5px;
|
||||
}
|
||||
}
|
||||
.nbs-add {
|
||||
border: 1px solid #e3e3e3;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
@@ -29,6 +29,12 @@ export default {
|
||||
return new Date('2040-12-31')
|
||||
}
|
||||
},
|
||||
minDate: {
|
||||
type: Date,
|
||||
default: () => {
|
||||
return new Date('1900-01-01')
|
||||
}
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
@@ -77,8 +83,8 @@ export default {
|
||||
currentDate: beforeDate.getBeforeYear(30), //当前时间的30年前
|
||||
showDataPicker: false,
|
||||
data: '', //时间插件绑定的值
|
||||
date: '', //field显示的值
|
||||
minDate: new Date('1900-01-01') //因为VANT组件默认是十年前
|
||||
date: '' //field显示的值
|
||||
//minDate: new Date('1900-01-01') //因为VANT组件默认是十年前
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
||||
@@ -11,7 +11,7 @@ let apiDomain, imgDomain, assetsUrl, mainUrl, payUrl, zssqUrl // 保融支付的
|
||||
console.log('环境:', process.env.VUE_APP_FLAG)
|
||||
switch (process.env.VUE_APP_FLAG) {
|
||||
case 'dev':
|
||||
apiDomain = 'http://139.199.50.151:7000/api/v1' // 国富api
|
||||
apiDomain = 'http://139.199.50.151:7000/api/v1' // 国富api ///api/v1
|
||||
imgDomain = 'http://211.159.248.123:7012/updown' // dev
|
||||
// 静态服务资源
|
||||
assetsUrl = 'http://139.199.50.151:8000/app/'
|
||||
|
||||
@@ -133,6 +133,11 @@ export default {
|
||||
// }
|
||||
|
||||
// return str
|
||||
|
||||
//摘自国富群:这个在报文转换的时候,核心返回“—”的时候,直接返回空。 @于维琦(于维琦) 前端如果保额为空,直接展示“—”@皮伟(皮伟) 你跟她碰一下怎么改
|
||||
if (moneyStr === null) {
|
||||
return '—'
|
||||
}
|
||||
let str = ''
|
||||
if (flag) {
|
||||
str = (moneyStr + '').replace(/\d{1,3}(?=(\d{3})+$)/g, '$&,')
|
||||
|
||||
@@ -11,4 +11,5 @@ import milestone from './milestone'
|
||||
import poster from './poster'
|
||||
import report from './report'
|
||||
import survey from './survey'
|
||||
export default [...proposal, ...sale, ...customer, ...my, ...serve, ...common, ...product, ...agentEenter, ...milestone, ...poster, ...report, ...survey] //根据需要进行删减
|
||||
import nbs from './nbs'
|
||||
export default [...proposal, ...sale, ...customer, ...my, ...serve, ...common, ...product, ...agentEenter, ...milestone, ...poster, ...report, ...survey, ...nbs] //根据需要进行删减
|
||||
|
||||
102
src/router/ebiz/nbs.js
Normal file
102
src/router/ebiz/nbs.js
Normal file
@@ -0,0 +1,102 @@
|
||||
let nbsList = () => import('@/views/ebiz/nbs/List')
|
||||
let nbsNav = () => import('@/views/ebiz/nbs/Nav')
|
||||
let nbsChart = () => import('@/views/ebiz/nbs/Chart')
|
||||
let nbsResult = () => import('@/views/ebiz/nbs/Result')
|
||||
let nbsCrewList = () => import('@/views/ebiz/nbs/CrewList')
|
||||
let nbsBase = () => import('@/views/ebiz/nbs/Base')
|
||||
let nbsNecessary = () => import('@/views/ebiz/nbs/Necessary')
|
||||
let nbsPrepared = () => import('@/views/ebiz/nbs/Prepared')
|
||||
let nbsDetail = () => import('@/views/ebiz/nbs/Detail')
|
||||
let nbsPDF = () => import('@/views/ebiz/nbs/PDF')
|
||||
export default [
|
||||
{
|
||||
path: '/nbs/list',
|
||||
name: 'nbsList',
|
||||
component: nbsList,
|
||||
meta: {
|
||||
title: 'NBS智能分析',
|
||||
index: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/nbs/nav/:id?',
|
||||
name: 'nbsNav',
|
||||
component: nbsNav,
|
||||
meta: {
|
||||
title: 'NBS智能分析',
|
||||
index: 2
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/nbs/chart',
|
||||
name: 'nbsChart',
|
||||
component: nbsChart,
|
||||
meta: {
|
||||
title: 'NBS智能分析统计',
|
||||
index: 3
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/nbs/result/:id/:half/:nbsState',
|
||||
name: 'nbsResult',
|
||||
component: nbsResult,
|
||||
meta: {
|
||||
title: 'NBS智能分析结果',
|
||||
index: 4
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/nbs/crew-list/:code',
|
||||
name: 'nbsCrewList',
|
||||
component: nbsCrewList,
|
||||
meta: {
|
||||
title: '客户清单',
|
||||
index: 5
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/nbs/base',
|
||||
name: 'nbsBase',
|
||||
component: nbsBase,
|
||||
meta: {
|
||||
title: '基本资料',
|
||||
index: 6
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/nbs/necessary',
|
||||
name: 'nbsNecessary',
|
||||
component: nbsNecessary,
|
||||
meta: {
|
||||
title: '应备费用',
|
||||
index: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/nbs/prepared',
|
||||
name: 'nbsPrepared',
|
||||
component: nbsPrepared,
|
||||
meta: {
|
||||
title: '已备费用',
|
||||
index: 8
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/nbs/detail/:id/:state',
|
||||
name: 'nbsDetail',
|
||||
component: nbsDetail,
|
||||
meta: {
|
||||
title: '资料',
|
||||
index: 9
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/nbs/pdf/:content',
|
||||
name: 'nbsPDF',
|
||||
component: nbsPDF,
|
||||
meta: {
|
||||
title: 'NBS智能分析报告',
|
||||
index: 10
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -28,6 +28,7 @@
|
||||
<li><router-link to="/agentEenter/agentEenterBasicInfor">自助入司</router-link></li>
|
||||
<li><router-link to="/agentEenter/approve/ApproveList">入司审批列表</router-link></li>
|
||||
<li><router-link to="/survey/surveyList">问卷调查</router-link></li>
|
||||
<li><router-link to="/nbs/list">nbs列表</router-link></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
367
src/views/ebiz/nbs/Base.vue
Normal file
367
src/views/ebiz/nbs/Base.vue
Normal file
@@ -0,0 +1,367 @@
|
||||
<template>
|
||||
<div class="base-container">
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">基本信息</p>
|
||||
<van-field required clearable label="姓名" name="姓名" v-validate="'required|name'" v-model="form.customerName" placeholder="请输入"></van-field>
|
||||
<select-radio required :radios="sexRadio" label="性别" name="性别" v-validate="'required'" :value.sync="form.customerSex"></select-radio>
|
||||
<FieldDatePicter
|
||||
v-validate="'required'"
|
||||
required
|
||||
label="出生日期"
|
||||
name="出生日期"
|
||||
type="date"
|
||||
:flag="true"
|
||||
:value.sync="form.birthday"
|
||||
@confirm="onSelectBirth"
|
||||
></FieldDatePicter>
|
||||
<van-field required label="年龄" name="年龄" v-validate="'required'" v-model="form.age" readonly placeholder="请选择出生日期"></van-field>
|
||||
<occupation-picker
|
||||
:value.sync="form.professionCode"
|
||||
:chooseName.sync="form.professionName"
|
||||
:lifeGrade.sync="form.lifeRiskGrade"
|
||||
:healthGrade.sync="form.medicalRiskGrade"
|
||||
clearable
|
||||
label="职业"
|
||||
name="职业"
|
||||
required
|
||||
v-validate="'required'"
|
||||
placeholder="请选择"
|
||||
@on-click="handleOccupationPickerClick"
|
||||
@on-choose="handleOccupationPickerChoose"
|
||||
:parentShowPicker.sync="isOccupationPickerPopupShow"
|
||||
/>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">家庭信息</p>
|
||||
<div class="relation">
|
||||
<div v-for="(item, index) in form.proposalNbsFamilyDTOLst" :key="index">
|
||||
<template v-if="item">
|
||||
<van-field
|
||||
readonly
|
||||
clearable
|
||||
label="关系"
|
||||
name="关系"
|
||||
right-icon="arrow"
|
||||
placeholder="请选择"
|
||||
@click="relationFieldClick(index)"
|
||||
:value="getRelationText(item.relation)"
|
||||
></van-field>
|
||||
<van-field clearable label="姓名" name="姓名" v-model="item.familyName" placeholder="请输入"></van-field>
|
||||
<select-radio :radios="sexRadio" label="性别" name="性别" :value.sync="item.familySex" :required="false"></select-radio>
|
||||
<FieldDatePicter
|
||||
label="出生日期"
|
||||
name="出生日期"
|
||||
type="date"
|
||||
:flag="true"
|
||||
:value.sync="item.familyBirthday"
|
||||
@confirm="onListSelectBirth(arguments, index)"
|
||||
></FieldDatePicter>
|
||||
<van-field label="年龄" name="年龄" v-model="item.familyAge" readonly placeholder="请选择出生日期"></van-field>
|
||||
<occupation-picker
|
||||
:value.sync="item.familyProfessionCode"
|
||||
:chooseName.sync="item.familyProfessionName"
|
||||
:lifeGrade.sync="item.lifeRiskGrade"
|
||||
:healthGrade.sync="item.medicalRiskGrade"
|
||||
clearable
|
||||
label="职业"
|
||||
name="职业"
|
||||
placeholder="请选择"
|
||||
@on-click="item.isOccupationPickerPopupShow = true"
|
||||
@on-choose="item.isOccupationPickerPopupShow = false"
|
||||
:parentShowPicker.sync="item.isOccupationPickerPopupShow"
|
||||
/>
|
||||
<div class="nbs-del" @click="delRelation(index)"><van-icon name="delete"></van-icon></div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div class="nbs-add" @click="addRelation">+ 添加家庭成员</div>
|
||||
<van-button type="danger" class="bottom-btn" @click="submit" v-no-more-click="1000">完成</van-button>
|
||||
<!-- 关系选择 -->
|
||||
<van-popup v-model="isRelationPickerShow" position="bottom">
|
||||
<van-picker show-toolbar :columns="relationNameArr" @confirm="onConfirm" @cancel="onCancel" />
|
||||
</van-popup>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { Field, Popup, Picker } from 'vant'
|
||||
import SelectRadio from '@/components/ebiz/SelectRadio'
|
||||
import FieldDatePicter from '@/components/ebiz/FieldDatePicter'
|
||||
import ageUtil from '@/assets/js/utils/age'
|
||||
import OccupationPicker from '@/components/ebiz/occipation/OccupationPicker'
|
||||
import { saveForm, nbsDetail } from '@/api/ebiz/nbs'
|
||||
import utils from '@/assets/js/common'
|
||||
import utils2 from '@/assets/js/business-common'
|
||||
import dataDictionary from '@/assets/js/utils/data-dictionary'
|
||||
|
||||
//关系字典
|
||||
let relationDictionary = dataDictionary.nbsRelation
|
||||
//拿出所有name,用于van-picker的column属性
|
||||
let relationNameArr = relationDictionary.map(v => v.name)
|
||||
|
||||
//新增的家庭成员包含的属性
|
||||
let relationItem = {
|
||||
relation: '',
|
||||
familyName: '',
|
||||
familySex: '',
|
||||
familyBirthday: '',
|
||||
familyAge: '',
|
||||
familyProfessionCode: '',
|
||||
familyProfessionName: '',
|
||||
lifeRiskGrade: '',
|
||||
medicalRiskGrade: '',
|
||||
isDelete: '0',
|
||||
familyId: '',
|
||||
//下面的属性 保存时不需要传
|
||||
isOccupationPickerPopupShow: false
|
||||
}
|
||||
|
||||
//数组验证规则
|
||||
//包含在此对象中的,只要填了一项就需要做验证
|
||||
//required: false表示可以不填
|
||||
let valiRules = {
|
||||
relation: {
|
||||
msg: '关系不能为空'
|
||||
},
|
||||
familyName: {
|
||||
msg: '姓名不能为空'
|
||||
},
|
||||
familySex: {
|
||||
msg: '性别不能为空'
|
||||
},
|
||||
familyBirthday: {
|
||||
msg: '出生日期不能为空'
|
||||
},
|
||||
familyAge: {
|
||||
msg: '年龄不能为空'
|
||||
},
|
||||
familyProfessionCode: {
|
||||
required: false
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
components: {
|
||||
[Field.name]: Field,
|
||||
[Popup.name]: Popup,
|
||||
[Picker.name]: Picker,
|
||||
SelectRadio,
|
||||
FieldDatePicter,
|
||||
OccupationPicker
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
maxDate: new Date('2105-12-31'),
|
||||
sexRadio: [
|
||||
{
|
||||
label: '男',
|
||||
value: '0'
|
||||
},
|
||||
{
|
||||
label: '女',
|
||||
value: '1'
|
||||
}
|
||||
],
|
||||
form: {
|
||||
customerName: '',
|
||||
customerSex: '',
|
||||
birthday: '',
|
||||
age: '',
|
||||
professionCode: '',
|
||||
professionName: '',
|
||||
lifeRiskGrade: '',
|
||||
medicalRiskGrade: '',
|
||||
proposalNbsFamilyDTOLst: [{ ...relationItem }],
|
||||
isDelete: '0',
|
||||
customerId: ''
|
||||
},
|
||||
isOccupationPickerPopupShow: false,
|
||||
relationNameArr,
|
||||
|
||||
isRelationPickerShow: false,
|
||||
relationItemIndexJustClick: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
//回填
|
||||
let id = localStorage.getItem('nbsId')
|
||||
let state = localStorage.getItem('nbsState')
|
||||
if (id && state) {
|
||||
nbsDetail({
|
||||
orderNo: id,
|
||||
nbsState: state
|
||||
}).then(res => {
|
||||
let keys = Object.keys(this.form)
|
||||
let obj = res.content
|
||||
for (let i in obj) {
|
||||
if (!keys.includes(i)) {
|
||||
delete obj[i]
|
||||
}
|
||||
}
|
||||
|
||||
if (!obj.proposalNbsFamilyDTOLst) obj.proposalNbsFamilyDTOLst = [{ ...relationItem }]
|
||||
//加上程序中需要的属性,这些属性提交时会删掉
|
||||
obj.proposalNbsFamilyDTOLst.forEach(v => {
|
||||
v.isOccupationPickerPopupShow = false
|
||||
})
|
||||
|
||||
this.form = obj
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSelectBirth(v) {
|
||||
this.form.age = String(ageUtil.getAgeByBirth(v, new Date()))
|
||||
},
|
||||
onListSelectBirth(args, index) {
|
||||
let v = args[0]
|
||||
this.form.proposalNbsFamilyDTOLst[index].familyAge = String(ageUtil.getAgeByBirth(v, new Date()))
|
||||
},
|
||||
handleOccupationPickerClick() {
|
||||
this.isOccupationPickerPopupShow = true
|
||||
},
|
||||
handleOccupationPickerChoose() {
|
||||
this.isOccupationPickerPopupShow = false
|
||||
},
|
||||
onConfirm(value, index) {
|
||||
let clickIndex = this.relationItemIndexJustClick,
|
||||
selectedVal = relationDictionary[index].value
|
||||
|
||||
//每个关系新增数量有限制
|
||||
let selectCount = 0
|
||||
this.form.proposalNbsFamilyDTOLst.forEach(v => {
|
||||
if (v && selectedVal === v.relation) selectCount++
|
||||
})
|
||||
if ((selectedVal === '01' && selectCount === 3) || (selectedVal !== '01' && selectCount === 1)) {
|
||||
this.$toast('超出数量限制')
|
||||
return
|
||||
}
|
||||
|
||||
//保存用户选择的关系
|
||||
this.form.proposalNbsFamilyDTOLst[clickIndex].relation = selectedVal
|
||||
this.isRelationPickerShow = false
|
||||
},
|
||||
onCancel() {
|
||||
this.isRelationPickerShow = false
|
||||
},
|
||||
relationFieldClick(index) {
|
||||
this.isRelationPickerShow = true
|
||||
this.relationItemIndexJustClick = index
|
||||
},
|
||||
getRelationText(value) {
|
||||
for (let item of relationDictionary) {
|
||||
if (item.value === value) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
addRelation() {
|
||||
this.form.proposalNbsFamilyDTOLst.push({ ...relationItem })
|
||||
},
|
||||
delRelation(index) {
|
||||
this.$set(this.form.proposalNbsFamilyDTOLst, index, null)
|
||||
},
|
||||
submit() {
|
||||
this.$validator.validateAll().then(res => {
|
||||
if (res) {
|
||||
let familyList = this.form.proposalNbsFamilyDTOLst
|
||||
//本人和配偶性别不能相同、父母性别验证
|
||||
for (let i = 0; i < familyList.length; i++) {
|
||||
let familyItem = familyList[i]
|
||||
if (!familyItem) continue
|
||||
if (familyItem.relation === '00' && familyItem.familySex === this.form.customerSex) {
|
||||
this.$toast('本人和配偶性别不能相同')
|
||||
return
|
||||
} else if ((familyItem.relation === '02' || familyItem.relation === '04') && familyItem.familySex !== '0') {
|
||||
this.$toast('父亲的性别必须是男')
|
||||
return
|
||||
} else if ((familyItem.relation === '03' || familyItem.relation === '05') && familyItem.familySex !== '1') {
|
||||
this.$toast('母亲的性别必须是女')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
//验证家庭信息
|
||||
for (let i = 0; i < familyList.length; i++) {
|
||||
let familyItem = familyList[i]
|
||||
if (!familyItem) continue
|
||||
|
||||
//填了任何一项,才需要验证
|
||||
let needVali = false
|
||||
for (let j in valiRules) {
|
||||
let defaultValue = valiRules[j].default || ''
|
||||
if (familyItem[j] !== defaultValue) {
|
||||
needVali = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (needVali) {
|
||||
for (let j in valiRules) {
|
||||
let item = valiRules[j]
|
||||
let defaultValue = item.default || ''
|
||||
let required
|
||||
if (typeof item.required === 'undefined') {
|
||||
required = true
|
||||
} else {
|
||||
required = false
|
||||
}
|
||||
if (familyItem[j] === defaultValue && required) {
|
||||
this.$toast(item.msg)
|
||||
return
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//如果不需要验证,说明这一项全部是空的,需要删掉
|
||||
//这里设置成null 后面会删掉
|
||||
familyList[i] = null
|
||||
}
|
||||
}
|
||||
|
||||
let id = localStorage.getItem('nbsId')
|
||||
|
||||
let form = utils.deepCopy(this.form)
|
||||
delete form.occupationName
|
||||
form.proposalNbsFamilyDTOLst = form.proposalNbsFamilyDTOLst.filter(v => v)
|
||||
form.proposalNbsFamilyDTOLst.forEach(v => {
|
||||
delete v.isOccupationPickerPopupShow
|
||||
})
|
||||
|
||||
if (id) form.orderNo = id
|
||||
form.type = '0'
|
||||
form.dateOfEntry = utils2.formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')
|
||||
form.isDelete = '0'
|
||||
form.nbsState = localStorage.getItem('nbsState')
|
||||
saveForm(form).then(res => {
|
||||
if (res.result === '0') {
|
||||
this.$toast('保存成功')
|
||||
|
||||
//如果是新建,id存在本地存储
|
||||
if (!id) {
|
||||
localStorage.setItem('nbsId', res.content.orderNo)
|
||||
localStorage.setItem('nbsState', '01')
|
||||
}
|
||||
|
||||
this.$jump({
|
||||
flag: 'goBack',
|
||||
extra: {
|
||||
refresh: '1',
|
||||
index: '-1'
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/nbs/nav`
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$toast(this.errors.items[0].msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '../../../assets/sass/nbs';
|
||||
.base-container {
|
||||
@include container;
|
||||
}
|
||||
</style>
|
||||
158
src/views/ebiz/nbs/Chart.vue
Normal file
158
src/views/ebiz/nbs/Chart.vue
Normal file
@@ -0,0 +1,158 @@
|
||||
<template>
|
||||
<div class="nbs-chart-container">
|
||||
<div class="chart" v-show="isShow"></div>
|
||||
<div class="sum" v-show="sum !== 0">{{ sum }}</div>
|
||||
<div class="list" v-show="isShow">
|
||||
<ul>
|
||||
<li v-for="item in data" @click="entryList(item.code)" :key="item.name">
|
||||
<div class="list-name">{{ item.name }}</div>
|
||||
<div class="list-num">{{ item.value }}</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="text-center" v-if="!isShow">
|
||||
<img class="mt100 w150" src="@/assets/images/pic_page-non.png" />
|
||||
<div class="fs15 c-gray-dark mt40">暂无数据</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { nbsChart } from '@/api/ebiz/nbs'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isShow: true,
|
||||
data: [],
|
||||
sum: 0
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let chart = window.echarts.init(document.querySelector('.chart'))
|
||||
let option = {
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['40%', '70%'],
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
position: 'inner',
|
||||
formatter: '{c}'
|
||||
// formatter: '{b}:{c}'
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color({ dataIndex }) {
|
||||
return ['#66cc00', '#3399ff', '#ffcc00'][dataIndex]
|
||||
}
|
||||
}
|
||||
},
|
||||
data: [{ value: 0, name: '' }]
|
||||
}
|
||||
]
|
||||
}
|
||||
nbsChart({}).then(res => {
|
||||
this.isShow = res.content.proposalNbsCustomerDTOLst.length > 0 ? true : false
|
||||
let data = res.content.proposalNbsCustomerDTOLst
|
||||
data = data.map(v => {
|
||||
let name = ''
|
||||
switch (v.nbsState) {
|
||||
case '01':
|
||||
name = '录入数据'
|
||||
break
|
||||
case '02':
|
||||
name = '生成报告'
|
||||
break
|
||||
case '03':
|
||||
name = '销售成功'
|
||||
break
|
||||
}
|
||||
let num = Number(v.amount)
|
||||
this.sum += num
|
||||
return {
|
||||
name,
|
||||
value: num,
|
||||
code: v.nbsState
|
||||
}
|
||||
})
|
||||
option.series[0].data = data
|
||||
this.data = data
|
||||
chart.setOption(option)
|
||||
chart.resize() //不加会出现高度为0
|
||||
console.log(document.querySelector('.sum'))
|
||||
document.querySelector('.sum').style.height = document.querySelector('.chart').clientHeight + 'px'
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
entryList(code) {
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/nbs/crew-list/${code}`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/nbs/crew-list/${code}`
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.nbs-chart-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
}
|
||||
.chart {
|
||||
position: relative;
|
||||
flex-grow: 1;
|
||||
}
|
||||
.sum {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
.list {
|
||||
height: 207px;
|
||||
li {
|
||||
position: relative;
|
||||
height: 68px;
|
||||
line-height: 68px;
|
||||
border-top: 1px solid #c9c9c9;
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 27px;
|
||||
left: 26px;
|
||||
height: 15px;
|
||||
width: 15px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
&:nth-child(1)::before {
|
||||
background-color: #66cc00;
|
||||
}
|
||||
&:nth-child(2)::before {
|
||||
background-color: #3399ff;
|
||||
}
|
||||
&:nth-child(3)::before {
|
||||
background-color: #ffcc00;
|
||||
}
|
||||
}
|
||||
&-name {
|
||||
float: left;
|
||||
margin-left: 57px;
|
||||
font-size: 14px;
|
||||
}
|
||||
&-num {
|
||||
float: right;
|
||||
margin-right: 22px;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
162
src/views/ebiz/nbs/CrewList.vue
Normal file
162
src/views/ebiz/nbs/CrewList.vue
Normal file
@@ -0,0 +1,162 @@
|
||||
<template>
|
||||
<div class="crew-list-container">
|
||||
<van-sticky>
|
||||
<table class="top-table">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="status">状态</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="name">客户姓名</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="date">录入时间</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</van-sticky>
|
||||
<table class="main-table">
|
||||
<tr v-for="item in data" @click="entryResult(item)">
|
||||
<td>
|
||||
<div class="status">{{ getTypeText(code) }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="name">{{ item.customerName }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="date">{{ item.dateOfEntry }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { Sticky } from 'vant'
|
||||
import { nbsTable, makeCustomerPDF } from '@/api/ebiz/nbs'
|
||||
import config from '@/config'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
[Sticky.name]: Sticky
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
code: this.$route.params.code,
|
||||
pdfUrl: '',
|
||||
downLoadUrl: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
setTimeout(() => {
|
||||
this.filterBtn() // 初始化下载按钮
|
||||
window.appCallBack = this.appCallBack //app回调
|
||||
}, 1000)
|
||||
nbsTable({
|
||||
nbsState: this.code
|
||||
}).then(res => {
|
||||
let data = res.content.proposalNbsCustomerDTOLst
|
||||
this.data = data
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 下载按钮
|
||||
filterBtn() {
|
||||
window.EWebBridge.webCallAppInJs('webview_right_button', {
|
||||
btns: [
|
||||
{
|
||||
img: this.$assetsUrl + 'images/share@2x.png'
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
appCallBack(data) {
|
||||
if (data.trigger == 'right_button_click') {
|
||||
let params = { nbsState: this.$route.params.code }
|
||||
makeCustomerPDF(params).then(res => {
|
||||
if (res.result == '0') {
|
||||
if (res.content.length > 0) {
|
||||
this.downLoadUrl = config.imgDomain + '/returnDirectStream?imgPath=' + res.content
|
||||
console.log('this.downLoadUrl == ', this.downLoadUrl)
|
||||
}
|
||||
} else return this.$toast(res.resultMessage)
|
||||
})
|
||||
setTimeout(() => {
|
||||
// eslint-disable-next-line no-undef
|
||||
EWebBridge.webCallAppInJs('download', {
|
||||
name: '客户清单.pdf',
|
||||
url: this.downLoadUrl
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
},
|
||||
getTypeText(code) {
|
||||
let name = ''
|
||||
switch (code) {
|
||||
case '01':
|
||||
name = '录入数据'
|
||||
break
|
||||
case '02':
|
||||
name = '生成报告'
|
||||
break
|
||||
case '03':
|
||||
name = '销售成功'
|
||||
break
|
||||
}
|
||||
return name
|
||||
},
|
||||
entryResult(item) {
|
||||
let { orderNo, flag, nbsState } = item
|
||||
if (nbsState === '01') return
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/nbs/result/${orderNo}/${flag}/${nbsState}`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/nbs/result/${orderNo}/${flag}/${nbsState}`
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.crew-list-container {
|
||||
overflow: hidden;
|
||||
padding-top: 10px;
|
||||
}
|
||||
.top-table,
|
||||
.main-table {
|
||||
margin: 0 auto;
|
||||
border-collapse: collapse;
|
||||
td {
|
||||
border: 2px solid transparent;
|
||||
}
|
||||
.status,
|
||||
.name,
|
||||
.date {
|
||||
height: 27px;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
line-height: 27px;
|
||||
}
|
||||
.status,
|
||||
.name {
|
||||
width: 99px;
|
||||
}
|
||||
.date {
|
||||
width: 151px;
|
||||
}
|
||||
}
|
||||
.top-table {
|
||||
div {
|
||||
background: #ffb3b3;
|
||||
}
|
||||
}
|
||||
.main-table {
|
||||
tr:nth-child(even) div {
|
||||
background: #ffe6e6;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
201
src/views/ebiz/nbs/Detail.vue
Normal file
201
src/views/ebiz/nbs/Detail.vue
Normal file
@@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<div>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">基本信息</p>
|
||||
<van-field readonly label="姓名" name="姓名" v-model="form.customerName"></van-field>
|
||||
<van-field readonly label="性别" name="性别" :value="getSex(form.customerSex)"></van-field>
|
||||
<van-field readonly label="出生日期" name="出生日期" v-model="form.birthday"></van-field>
|
||||
<van-field label="年龄" name="年龄" v-model="form.age" readonly></van-field>
|
||||
<!-- 为了让职业可以换行 -->
|
||||
<!-- <van-field label="职业" name="职业" v-model="form.professionName" readonly></van-field> -->
|
||||
<div class="van-cell van-field">
|
||||
<div class="van-cell__title van-field__label">
|
||||
<span>职业</span>
|
||||
</div>
|
||||
<div class="van-cell__value">
|
||||
<div class="van-field__body" style="color: #323233;text-align: left">
|
||||
{{ form.professionName }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">家庭信息</p>
|
||||
<div class="relation">
|
||||
<div v-for="(item, index) in form.proposalNbsFamilyDTOLst" :key="index">
|
||||
<template v-if="item">
|
||||
<van-field readonly label="关系" name="关系" placeholder="暂无数据" :value="getRelationText(item.relation)"></van-field>
|
||||
<van-field readonly label="姓名" name="姓名" v-model="item.familyName"></van-field>
|
||||
<van-field readonly label="性别" name="性别" :value="getSex(item.familySex)"></van-field>
|
||||
<van-field readonly label="出生日期" name="出生日期" v-model="item.familyBirthday"></van-field>
|
||||
<van-field label="年龄" name="年龄" v-model="item.familyAge" readonly></van-field>
|
||||
<!-- 为了让职业可以换行 -->
|
||||
<!-- <van-field label="职业" name="职业" v-model="item.familyProfessionName" readonly></van-field> -->
|
||||
<div class="van-cell van-field">
|
||||
<div class="van-cell__title van-field__label">
|
||||
<span>职业</span>
|
||||
</div>
|
||||
<div class="van-cell__value">
|
||||
<div class="van-field__body" style="color: #323233;text-align: left">
|
||||
{{ item.familyProfessionName }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">需求顺位</p>
|
||||
<van-field readonly label="第一顺位需求" name="第一顺位需求" placeholder="暂无数据" :value="getNecessaryText(form.firstCostRequirements)"></van-field>
|
||||
<van-field readonly label="第二顺位需求" name="第二顺位需求" placeholder="暂无数据" :value="getNecessaryText(form.secondCostRequirements)"></van-field>
|
||||
<van-field readonly label="第三顺位需求" name="第三顺位需求" placeholder="暂无数据" :value="getNecessaryText(form.thirdCostRequirements)"></van-field>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">生活费用</p>
|
||||
<van-field readonly label="每月生活费(元)" name="每月生活费(元)" placeholder="暂无数据" v-model="form.livingCosts"></van-field>
|
||||
<van-field readonly label="子女抚养至(岁)" name="子女抚养至(岁)" placeholder="暂无数据" v-model="form.raisingAge"></van-field>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">房贷/房租费用</p>
|
||||
<van-field readonly label="贷款余额(万元)" name="贷款余额(万元)" placeholder="暂无数据" v-model="form.loanBalance"></van-field>
|
||||
<van-field readonly label="剩余还款期间(年)" name="剩余还款期间(年)" placeholder="暂无数据" v-model="form.remainRepaymentTime"></van-field>
|
||||
<van-field readonly label="租金(元/月)" name="租金(元/月)" placeholder="暂无数据" v-model="form.charterMoney"></van-field>
|
||||
<van-field readonly label="租屋年数(年)" name="租屋年数(年)" placeholder="暂无数据" v-model="form.rentHouseNumber"></van-field>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">父母孝养金</p>
|
||||
<van-field readonly label="本人父亲年龄" name="本人父亲年龄" placeholder="暂无数据" v-model="form.myParentsAge"></van-field>
|
||||
<van-field readonly label="本人母亲年龄" name="本人母亲年龄" placeholder="暂无数据" v-model="form.myMotherAge"></van-field>
|
||||
<van-field readonly label="孝养金(元/月)" name="孝养金(元/月)" placeholder="暂无数据" v-model="form.myParentsRaisemoney"></van-field>
|
||||
<van-field readonly label="配偶父亲年龄" name="配偶父亲年龄" placeholder="暂无数据" v-model="form.wifeParentsAge"></van-field>
|
||||
<van-field readonly label="配偶母亲年龄" name="配偶母亲年龄" placeholder="暂无数据" v-model="form.wifeMotherAge"></van-field>
|
||||
<van-field readonly label="孝养金(元/月)" name="孝养金(元/月)" placeholder="暂无数据" v-model="form.wifeParentsRaisemoney"></van-field>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">教育费用</p>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl15 pv12">子女1</p>
|
||||
<van-field readonly label="费用总计(万元)" name="费用总计(万元)" placeholder="暂无数据" v-model="form.educationalCostOne"></van-field>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl15 pv12">子女2</p>
|
||||
<van-field readonly label="费用总计(万元)" name="费用总计(万元)" placeholder="暂无数据" v-model="form.educationalCostTwo"></van-field>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl15 pv12">子女3</p>
|
||||
<van-field readonly label="费用总计(万元)" name="费用总计(万元)" placeholder="暂无数据" v-model="form.educationalCostThree"></van-field>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl15 pv12">医疗费用</p>
|
||||
<van-field readonly label="往来医院" name="往来医院" placeholder="暂无数据" v-model="form.hospitalizationCost"></van-field>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl15 pv12">最后费用</p>
|
||||
<van-field readonly label="本人身故丧葬费用(万元)" name="本人身故丧葬费用(万元)" placeholder="暂无数据" v-model="form.myFuneralExpenses"></van-field>
|
||||
<van-field readonly label="配偶身故丧葬费用(万元)" name="配偶身故丧葬费用(万元)" placeholder="暂无数据" v-model="form.wifeFuneralExpenses"></van-field>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl15 pv12">资产传承</p>
|
||||
<van-field
|
||||
readonly
|
||||
label="本人预估资产总额(万元)"
|
||||
name="本人预估资产总额(万元)"
|
||||
placeholder="暂无数据"
|
||||
v-model="form.myEstimateTotalassets"
|
||||
></van-field>
|
||||
<van-field
|
||||
readonly
|
||||
label="配偶预估资产总额(万元)"
|
||||
name="配偶预估资产总额(万元)"
|
||||
placeholder="暂无数据"
|
||||
v-model="form.wifeEstimateTotalassets"
|
||||
></van-field>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">其它费用</p>
|
||||
<div v-for="(item, index) in form.proposalNbsProjectCostInfoDTOLst" :key="index">
|
||||
<template v-if="item">
|
||||
<van-field readonly label="对象" name="对象" placeholder="暂无数据" :value="getTargetText(item.object)"></van-field>
|
||||
<van-field readonly label="项目" name="项目" placeholder="暂无数据" v-model="item.projectName"></van-field>
|
||||
<van-field readonly label="金额(元/月)" name="金额(元/月)" placeholder="暂无数据" v-model="item.projectCost"></van-field>
|
||||
<van-field readonly label="起始年月" name="起始年月" placeholder="暂无数据" v-model="item.startDate"></van-field>
|
||||
<van-field readonly label="终止年月" name="终止年月" placeholder="暂无数据" v-model="item.endDate"></van-field>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">已投保保险</p>
|
||||
<div v-for="(item, index) in form.proposalNbsInsuredInfoDTOLst" :key="index">
|
||||
<template v-if="item">
|
||||
<van-field readonly label="对象" name="对象" placeholder="暂无数据" :value="getTargetText(item.haveiNsurance)"></van-field>
|
||||
<van-field readonly label="险种类型" name="险种类型" placeholder="暂无数据" :value="getInsuranceText(item.plantType)"></van-field>
|
||||
<van-field readonly label="满期岁" name="满期岁" placeholder="暂无数据" v-model="item.ageofMaturity"></van-field>
|
||||
<van-field readonly label="保险金额(万元)" name="保险金额(万元)" placeholder="暂无数据" v-model="item.insuredAmount"></van-field>
|
||||
</template>
|
||||
</div>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">收入及储蓄</p>
|
||||
<van-field readonly label="目前年收入(万元)" name="目前年收入(万元)" placeholder="暂无数据" v-model="form.myAnnualIncome"></van-field>
|
||||
<van-field readonly label="预计工作至(岁)" name="预计工作至(岁)" placeholder="暂无数据" v-model="form.myFutureWorkinglife"></van-field>
|
||||
<van-field readonly label="其它收入(万元/年)" name="其它收入(万元/年)" placeholder="暂无数据" v-model="form.myOtherRevenue"></van-field>
|
||||
<van-field readonly label="预计可收年数(年)" name="预计可收年数(年)" placeholder="暂无数据" v-model="form.myOtherRevenueExpectedyear"></van-field>
|
||||
<van-field readonly label="现有储蓄(万元)" name="现有储蓄(万元)" placeholder="暂无数据" v-model="form.myAssets"></van-field>
|
||||
<van-field readonly label="配偶目前年收入(万元)" name="配偶目前年收入(万元)" placeholder="暂无数据" v-model="form.wifeAnnualIncome"></van-field>
|
||||
<van-field readonly label="配偶预计工作至(岁)" name="配偶预计工作至(岁)" placeholder="暂无数据" v-model="form.wifeFutureWorkinglife"></van-field>
|
||||
<van-field readonly label="配偶其它收入(万元/年)" name="配偶其它收入(万元/年)" placeholder="暂无数据" v-model="form.wifeOtherRevenue"></van-field>
|
||||
<van-field
|
||||
readonly
|
||||
label="配偶预计可收年数(年)"
|
||||
name="配偶预计可收年数(年)"
|
||||
placeholder="暂无数据"
|
||||
v-model="form.wifeOtherRevenueExpectedyear"
|
||||
></van-field>
|
||||
<van-field readonly label="配偶现有储蓄(万元)" name="配偶现有储蓄(万元)" placeholder="暂无数据" v-model="form.wifeAssets"></van-field>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { Field } from 'vant'
|
||||
import { nbsDetail } from '@/api/ebiz/nbs'
|
||||
import dataDictionary from '@/assets/js/utils/data-dictionary'
|
||||
|
||||
//关系字典
|
||||
let relationDictionary = dataDictionary.nbsRelation
|
||||
let sexDictionary = dataDictionary.sex
|
||||
let targetDictionary = dataDictionary.targetDictionary
|
||||
let necessaryDictionary = dataDictionary.necessaryDictionary
|
||||
let insuranceDictionary = dataDictionary.insuranceDictionary
|
||||
|
||||
export default {
|
||||
components: {
|
||||
[Field.name]: Field
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
let id = this.$route.params.id
|
||||
let state = this.$route.params.state
|
||||
nbsDetail({
|
||||
orderNo: id,
|
||||
nbsState: state
|
||||
}).then(res => {
|
||||
this.form = res.content
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getRelationText(value) {
|
||||
for (let item of relationDictionary) {
|
||||
if (item.value === value) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
getSex(code) {
|
||||
let text = ''
|
||||
sexDictionary.forEach(v => {
|
||||
if (v.id === code) {
|
||||
text = v.text
|
||||
}
|
||||
})
|
||||
return text
|
||||
},
|
||||
getTargetText(code) {
|
||||
for (let v of targetDictionary) {
|
||||
if (v.code === code) {
|
||||
return v.value
|
||||
}
|
||||
}
|
||||
},
|
||||
getNecessaryText(code) {
|
||||
for (let i of necessaryDictionary) {
|
||||
if (i.code === code) {
|
||||
return i.value
|
||||
}
|
||||
}
|
||||
},
|
||||
getInsuranceText(code) {
|
||||
for (let v of insuranceDictionary) {
|
||||
if (v.code === code) {
|
||||
return v.value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
244
src/views/ebiz/nbs/List.vue
Normal file
244
src/views/ebiz/nbs/List.vue
Normal file
@@ -0,0 +1,244 @@
|
||||
<template>
|
||||
<div class="nbs-list-container">
|
||||
<van-sticky>
|
||||
<van-tabs v-model="activeTab" @change="tabChange">
|
||||
<van-tab title="制作中"></van-tab>
|
||||
<van-tab title="已制作"></van-tab>
|
||||
<van-tab title="销售成功"></van-tab>
|
||||
</van-tabs>
|
||||
</van-sticky>
|
||||
<van-list class="pb45" v-model="loading" :finished="finished" @load="getList" v-if="list.length > 0">
|
||||
<div v-for="(item, index) in list" :key="item.orderNo">
|
||||
<div class="text-center fs12 mv15">{{ item.dateOfEntry }}</div>
|
||||
<div class="bg-white m15 p15">
|
||||
<div class="fs14">{{ item.customerName }}的智能分析</div>
|
||||
<div class="text-right mt5">
|
||||
<template v-if="params.nbsState === '01'">
|
||||
<van-button class="ml5" type="danger" size="small" round @click="edit(item.orderNo)">编辑</van-button>
|
||||
<van-button class="ml5" type="danger" size="small" round plain @click="del(item.orderNo, index)">删除</van-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<van-button class="ml5" type="danger" size="small" round v-if="params.nbsState === '02'" @click="edit(item.orderNo, item.flag)">编辑</van-button>
|
||||
<van-button class="ml5" type="danger" size="small" round v-if="params.nbsState === '02'" @click="complete(item.orderNo, index)"
|
||||
>销售成功</van-button
|
||||
>
|
||||
<van-button class="ml5" type="danger" size="small" round @click="entryDetail(item.orderNo)">资料</van-button>
|
||||
<van-button class="ml5" type="danger" size="small" round @click="entryReport(item.orderNo, item.flag)">报告</van-button>
|
||||
<van-button class="ml5 mt5" type="danger" size="small" round plain @click="del(item.orderNo, index)">删除</van-button>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
<div v-else class="text-center">
|
||||
<img class="mt40 w250" src="@/assets/images/pic_page-non.png" />
|
||||
<div class="fs15 c-gray-dark mt40">暂无数据</div>
|
||||
</div>
|
||||
<!-- <div class="empty" v-else>暂无数据</div> -->
|
||||
<van-button type="danger" class="bottom-btn" @click="add" v-no-more-click="1000">点我新增</van-button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { Tabs, Tab, List, Sticky, Dialog } from 'vant'
|
||||
import { getList, delNbs, completeNbs } from '@/api/ebiz/nbs'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
activeTab: 0,
|
||||
params: {
|
||||
pageSize: 20,
|
||||
pageNum: 1,
|
||||
nbsState: '01'
|
||||
},
|
||||
list: [],
|
||||
finished: false,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
setTimeout(() => {
|
||||
// eslint-disable-next-line no-undef
|
||||
EWebBridge.webCallAppInJs('webview_right_button', {
|
||||
btns: [
|
||||
{
|
||||
img: this.$assetsUrl + 'images/nbs/chart.png',
|
||||
route: { flag: '', extra: {} }
|
||||
}
|
||||
]
|
||||
})
|
||||
}, 1000)
|
||||
this.getList()
|
||||
},
|
||||
mounted() {
|
||||
window.appCallBack = this.appCallBack
|
||||
},
|
||||
methods: {
|
||||
appCallBack(data) {
|
||||
if (data.trigger == 'right_button_click') {
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/nbs/chart`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/nbs/chart`
|
||||
}
|
||||
})
|
||||
}
|
||||
if (data.trigger == 'left_button_click') {
|
||||
this.$jump({
|
||||
flag: 'home'
|
||||
})
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
this.$toast.loading({
|
||||
duration: 0, // 持续展示 toast
|
||||
forbidClick: true, // 禁用背景点击
|
||||
loadingType: 'spinner',
|
||||
message: '加载中……'
|
||||
})
|
||||
//保存下来目前的tab标签,接口调用成功以后如果标签页切换了,就不修改列表
|
||||
let currentTab = this.activeTab
|
||||
|
||||
let params = this.params
|
||||
this.loading = true
|
||||
getList(params).then(res => {
|
||||
this.$toast.clear()
|
||||
if (currentTab !== this.activeTab) {
|
||||
return
|
||||
}
|
||||
this.loading = false
|
||||
if (res.content && res.content.list.length !== 0) {
|
||||
let list = res.content.list
|
||||
this.list = this.list.concat(list)
|
||||
params.pageNum++
|
||||
} else {
|
||||
this.finished = true
|
||||
}
|
||||
})
|
||||
},
|
||||
add() {
|
||||
localStorage.setItem('nbsId', '')
|
||||
localStorage.setItem('nbsState', '01')
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/nbs/nav`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/nbs/nav`
|
||||
}
|
||||
})
|
||||
},
|
||||
tabChange(name) {
|
||||
this.finished = false
|
||||
this.list = []
|
||||
let params = this.params
|
||||
params.pageNum = 1
|
||||
switch (name) {
|
||||
case 0:
|
||||
params.nbsState = '01'
|
||||
break
|
||||
case 1:
|
||||
params.nbsState = '02'
|
||||
break
|
||||
case 2:
|
||||
params.nbsState = '03'
|
||||
break
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
del(id, index) {
|
||||
Dialog.confirm({
|
||||
message: '确认要删除吗'
|
||||
}).then(() => {
|
||||
delNbs({
|
||||
orderNo: id,
|
||||
nbsState: this.params.nbsState
|
||||
}).then(res => {
|
||||
if (res.result === '0') {
|
||||
this.$toast('删除成功')
|
||||
this.list.splice(index, 1)
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
complete(id, index) {
|
||||
Dialog.confirm({
|
||||
message: '确认要操作吗'
|
||||
}).then(() => {
|
||||
completeNbs({
|
||||
orderNo: id
|
||||
}).then(res => {
|
||||
if (res.result === '0') {
|
||||
this.$toast('操作成功')
|
||||
this.list.splice(index, 1)
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
edit(id) {
|
||||
//详情接口需要传状态
|
||||
localStorage.setItem('nbsState', this.params.nbsState)
|
||||
localStorage.setItem('nbsId', id)
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/nbs/nav`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/nbs/nav`
|
||||
}
|
||||
})
|
||||
},
|
||||
entryDetail(id) {
|
||||
let state = this.params.nbsState
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/nbs/detail/${id}/${state}`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/nbs/detail/${id}/${state}`
|
||||
}
|
||||
})
|
||||
},
|
||||
entryReport(id, flag) {
|
||||
const state = this.params.nbsState
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/nbs/result/${id}/${flag}/${state}`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/nbs/result/${id}/${flag}/${state}`
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
components: {
|
||||
[Tabs.name]: Tabs,
|
||||
[Tab.name]: Tab,
|
||||
[List.name]: List,
|
||||
[Sticky.name]: Sticky
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.empty {
|
||||
margin: 106px auto 0 auto;
|
||||
width: 195px;
|
||||
height: 20px;
|
||||
padding-top: 211px;
|
||||
font-size: 14px;
|
||||
line-height: 14px;
|
||||
text-align: center;
|
||||
background: url(../../../assets/images/nbs/empty.png) no-repeat;
|
||||
background-size: 100%;
|
||||
}
|
||||
</style>
|
||||
215
src/views/ebiz/nbs/Nav.vue
Normal file
215
src/views/ebiz/nbs/Nav.vue
Normal file
@@ -0,0 +1,215 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="pic"></div>
|
||||
<div class="text">专业解析<span>智能分析</span>量身定制</div>
|
||||
<div class="flow mt100 mb100">
|
||||
<div class="flow-item" :class="{ active: getButtonStatus(-1) }">
|
||||
<div class="flow-button pt8 pb8 mb6 mt6" @click="getButtonStatus(-1) && entry(-1)">基本资料</div>
|
||||
</div>
|
||||
<div class="flow-item" :class="{ active: getButtonStatus(0) }">
|
||||
<div class="flow-arrow" style="position:relative">
|
||||
<van-icon name="arrow-down" size="15" />
|
||||
<div style="position:absolute;top:5px;width:100%"><van-icon name="arrow-down" size="15" /></div>
|
||||
</div>
|
||||
<div class="flow-button pt8 pb8 mb6 mt6" @click="getButtonStatus(0) && entry(0)">应备费用</div>
|
||||
</div>
|
||||
<div class="flow-item" :class="{ active: getButtonStatus(1) }">
|
||||
<div class="flow-arrow" style="position:relative">
|
||||
<van-icon name="arrow-down" size="15" />
|
||||
<div style="position:absolute;top:5px;width:100%"><van-icon name="arrow-down" size="15" /></div>
|
||||
</div>
|
||||
<div class="flow-button pt8 pb8 mb6 mt6" @click="getButtonStatus(1) && entry(1)">已备费用</div>
|
||||
</div>
|
||||
<div class="flow-item" :class="{ active: getButtonStatus(2) }">
|
||||
<div class="flow-arrow" style="position:relative">
|
||||
<van-icon name="arrow-down" size="15" />
|
||||
<div style="position:absolute;top:6px;width:100%"><van-icon name="arrow-down" size="15" /></div>
|
||||
</div>
|
||||
<div class="flow-button pt8 pb8 mb6 mt6" @click="getButtonStatus(2) && entry(2)">生成报告</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { nbsDetail, saveForm } from '@/api/ebiz/nbs'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
status: -1, //-1还未填写 0填完基本信息 1填完应备费用 2填完已备费用
|
||||
half: null //这个值表示是否添加了配偶
|
||||
}
|
||||
},
|
||||
created() {
|
||||
window.appCallBack = this.appCallBack
|
||||
let id = localStorage.getItem('nbsId')
|
||||
//获取到了哪一步
|
||||
if (id) {
|
||||
nbsDetail({
|
||||
orderNo: id,
|
||||
nbsState: localStorage.getItem('nbsState')
|
||||
}).then(res => {
|
||||
if (res.result === '0') {
|
||||
const content = res.content
|
||||
this.status = localStorage.getItem('nbsState') == '02' ? '2' : Number(content.type)
|
||||
this.half = content.flag
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/nbs/list`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/nbs/list`
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
appCallBack(data) {
|
||||
if (data.trigger == 'left_button_click') {
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
backToFirst: '1', //返回到入口第一个webview
|
||||
needRefresh: '1', //返回到这个页面时,1:需要刷新
|
||||
url: location.origin + `/#/nbs/list`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/nbs/list`
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getButtonStatus(buttonStatus) {
|
||||
//当status大于buttonStatus时,可以点击按钮
|
||||
let status = this.status
|
||||
if (status >= buttonStatus) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
entry(buttonStatus) {
|
||||
let name = ''
|
||||
switch (buttonStatus) {
|
||||
case -1:
|
||||
name = 'base'
|
||||
break
|
||||
case 0:
|
||||
name = 'necessary'
|
||||
break
|
||||
case 1:
|
||||
name = 'prepared'
|
||||
break
|
||||
case 2:
|
||||
name = 'result'
|
||||
break
|
||||
}
|
||||
if (buttonStatus === 2) {
|
||||
saveForm({
|
||||
type: '3',
|
||||
orderNo: localStorage.getItem('nbsId'),
|
||||
nbsState: localStorage.getItem('nbsState')
|
||||
}).then(res => {
|
||||
if (res.result === '0') {
|
||||
let id = localStorage.getItem('nbsId')
|
||||
this.half = res.content.flag
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/nbs/result/${id}/${this.half}/02`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/nbs/result/${id}/${this.half}/02`
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/nbs/${name}`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/nbs/${name}`
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
van-icon {
|
||||
display: block !important;
|
||||
}
|
||||
.pic {
|
||||
// width: 272px;
|
||||
width: 200px;
|
||||
// height: 195px;
|
||||
height: 143px;
|
||||
margin: 40px auto 0 auto;
|
||||
background: url(../../../assets/images/nbs/nav.png) no-repeat;
|
||||
background-size: 100%;
|
||||
}
|
||||
.text {
|
||||
margin-top: 22px;
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
text-align: center;
|
||||
span {
|
||||
position: relative;
|
||||
margin: 0 40px;
|
||||
&::before,
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
height: 14px;
|
||||
width: 14px;
|
||||
border-radius: 50%;
|
||||
background: url(../../../assets/images/nbs/dot.png) no-repeat;
|
||||
background-size: 100%;
|
||||
}
|
||||
&::before {
|
||||
left: -24px;
|
||||
}
|
||||
&::after {
|
||||
right: -24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.flow {
|
||||
position: absolute;
|
||||
// bottom: 30px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
&-item {
|
||||
color: #797979;
|
||||
}
|
||||
&-button {
|
||||
width: 325px;
|
||||
height: 32px; //38
|
||||
margin: 0 auto;
|
||||
border: 1px solid #797979;
|
||||
border-radius: 20px;
|
||||
line-height: 32px;
|
||||
text-align: center;
|
||||
}
|
||||
&-arrow {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.flow-item.active {
|
||||
color: #e5162d;
|
||||
.flow-button {
|
||||
border-color: #e5162d;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
509
src/views/ebiz/nbs/Necessary.vue
Normal file
509
src/views/ebiz/nbs/Necessary.vue
Normal file
@@ -0,0 +1,509 @@
|
||||
<template>
|
||||
<div class="necessary-container">
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">基本信息</p>
|
||||
<van-field
|
||||
readonly
|
||||
label="第一顺位需求"
|
||||
name="第一顺位需求"
|
||||
right-icon="arrow"
|
||||
placeholder="请选择"
|
||||
@click="necessaryFieldClick(1)"
|
||||
:value="getNecessaryText(form.firstCostRequirements)"
|
||||
></van-field>
|
||||
<van-field
|
||||
readonly
|
||||
label="第二顺位需求"
|
||||
name="第二顺位需求"
|
||||
right-icon="arrow"
|
||||
placeholder="请选择"
|
||||
@click="necessaryFieldClick(2)"
|
||||
:value="getNecessaryText(form.secondCostRequirements)"
|
||||
></van-field>
|
||||
<van-field
|
||||
readonly
|
||||
label="第三顺位需求"
|
||||
name="第三顺位需求"
|
||||
right-icon="arrow"
|
||||
placeholder="请选择"
|
||||
@click="necessaryFieldClick(3)"
|
||||
:value="getNecessaryText(form.thirdCostRequirements)"
|
||||
></van-field>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">生活费用</p>
|
||||
<van-field clearable label="每月生活费(元)" name="每月生活费(元)" placeholder="请输入" v-validate="'onlyNumber'" v-model="form.livingCosts"></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="子女抚养至(岁)"
|
||||
name="子女抚养至(岁)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.raisingAge"
|
||||
v-if="childNum > 0"
|
||||
></van-field>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">房贷/房租费用</p>
|
||||
<van-field clearable label="贷款余额(万元)" name="贷款余额(万元)" placeholder="请输入" v-validate="'onlyNumber'" v-model="form.loanBalance"></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="剩余还款期间(年)"
|
||||
name="剩余还款期间(年)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.remainRepaymentTime"
|
||||
></van-field>
|
||||
<van-field clearable label="租金(元/月)" name="租金(元/月)" placeholder="请输入" v-validate="'onlyNumber'" v-model="form.charterMoney"></van-field>
|
||||
<van-field clearable label="租屋年数(年)" name="租屋年数(年)" placeholder="请输入" v-validate="'onlyNumber'" v-model="form.rentHouseNumber"></van-field>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">父母孝养金</p>
|
||||
<van-field clearable label="本人父亲年龄" name="本人父亲年龄" placeholder="请输入" v-validate="'onlyNumber'" v-model="form.myParentsAge"></van-field>
|
||||
<van-field clearable label="本人母亲年龄" name="本人母亲年龄" placeholder="请输入" v-validate="'onlyNumber'" v-model="form.myMotherAge"></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="孝养金(元/月)"
|
||||
name="孝养金(元/月)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.myParentsRaisemoney"
|
||||
></van-field>
|
||||
<template v-if="hasWife">
|
||||
<van-field clearable label="配偶父亲年龄" name="配偶父亲年龄" placeholder="请输入" v-validate="'onlyNumber'" v-model="form.wifeParentsAge"></van-field>
|
||||
<van-field clearable label="配偶母亲年龄" name="配偶母亲年龄" placeholder="请输入" v-validate="'onlyNumber'" v-model="form.wifeMotherAge"></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="孝养金(元/月)"
|
||||
name="孝养金(元/月)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.wifeParentsRaisemoney"
|
||||
></van-field>
|
||||
</template>
|
||||
<template v-if="childNum >= 1">
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">教育费用</p>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl15 pv12">子女1({{ children[0].familyName }})</p>
|
||||
<van-field
|
||||
clearable
|
||||
label="费用总计(万元)"
|
||||
name="费用总计(万元)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.educationalCostOne"
|
||||
></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="教育年龄(岁)"
|
||||
name="教育年龄(岁)"
|
||||
placeholder="请输入子女受教育年龄至多少岁"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.educationalAgeOne"
|
||||
@change="eduAge(form.educationalAgeOne, children[0].familyAge)"
|
||||
></van-field>
|
||||
</template>
|
||||
<template v-if="childNum >= 2">
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl15 pv12">子女2({{ children[1].familyName }})</p>
|
||||
<van-field
|
||||
clearable
|
||||
label="费用总计(万元)"
|
||||
name="费用总计(万元)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.educationalCostTwo"
|
||||
></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="教育年龄(岁)"
|
||||
name="教育年龄(岁)"
|
||||
placeholder="请输入子女受教育年龄至多少岁"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.educationalAgeTwo"
|
||||
@change="eduAge(form.educationalCostTwo, children[1].familyAge)"
|
||||
></van-field>
|
||||
</template>
|
||||
<template v-if="childNum === 3">
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl15 pv12">子女3({{ children[2].familyName }})</p>
|
||||
<van-field
|
||||
clearable
|
||||
label="费用总计(万元)"
|
||||
name="费用总计(万元)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.educationalCostThree"
|
||||
></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="教育年龄(岁)"
|
||||
name="教育年龄(岁)"
|
||||
placeholder="请输入子女受教育年龄至多少岁"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.educationalAgeThree"
|
||||
@change="eduAge(form.educationalCostThree, children[2].familyAge)"
|
||||
></van-field>
|
||||
</template>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl15 pv12">医疗费用</p>
|
||||
<van-field clearable label="往来医院" name="往来医院" placeholder="请输入" v-model="form.hospitalizationCost"></van-field>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl15 pv12">最后费用</p>
|
||||
<van-field
|
||||
clearable
|
||||
label="本人身故丧葬费用(万元)"
|
||||
name="本人身故丧葬费用(万元)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.myFuneralExpenses"
|
||||
></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="配偶身故丧葬费用(万元)"
|
||||
name="配偶身故丧葬费用(万元)"
|
||||
placeholder="请输入"
|
||||
v-model="form.wifeFuneralExpenses"
|
||||
v-if="hasWife"
|
||||
v-validate="'onlyNumber'"
|
||||
></van-field>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl15 pv12">资产传承</p>
|
||||
<van-field
|
||||
clearable
|
||||
label="本人预估资产总额(万元)"
|
||||
name="本人预估资产总额(万元)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.myEstimateTotalassets"
|
||||
></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="配偶预估资产总额(万元)"
|
||||
name="配偶预估资产总额(万元)"
|
||||
placeholder="请输入"
|
||||
v-model="form.wifeEstimateTotalassets"
|
||||
v-if="hasWife"
|
||||
v-validate="'onlyNumber'"
|
||||
></van-field>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">其它费用</p>
|
||||
<div v-for="(item, index) in form.proposalNbsProjectCostInfoDTOLst" :key="index">
|
||||
<template v-if="item">
|
||||
<van-field
|
||||
clearable
|
||||
readonly
|
||||
label="对象"
|
||||
name="对象"
|
||||
right-icon="arrow"
|
||||
placeholder="请选择"
|
||||
@click="targetFieldClick(index)"
|
||||
:value="getTargetText(item.object)"
|
||||
></van-field>
|
||||
<van-field clearable label="项目" name="项目" placeholder="请输入" v-model="item.projectName"></van-field>
|
||||
<van-field clearable label="金额(元/月)" name="金额(元/月)" placeholder="请输入" v-validate="'onlyNumber'" v-model="item.projectCost"></van-field>
|
||||
<!-- 起始年月和终止年月只能选择本月及以后 -->
|
||||
<FieldDatePicter
|
||||
label="起始年月"
|
||||
name="起始年月"
|
||||
type="year-month"
|
||||
:flag="true"
|
||||
:value.sync="item.startDate"
|
||||
:formatter="dateFormatter"
|
||||
:min-date="new Date()"
|
||||
:max-date="maxDate"
|
||||
></FieldDatePicter>
|
||||
<FieldDatePicter
|
||||
label="终止年月"
|
||||
name="终止年月"
|
||||
type="year-month"
|
||||
:flag="true"
|
||||
:value.sync="item.endDate"
|
||||
:formatter="dateFormatter"
|
||||
:min-date="new Date()"
|
||||
:max-date="maxDate"
|
||||
></FieldDatePicter>
|
||||
<div class="nbs-del" @click="del(index)"><van-icon name="delete"></van-icon></div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="nbs-add" @click="add">+ 添加其它费用</div>
|
||||
<van-button type="danger" class="bottom-btn" @click="submit" v-no-more-click="1000">完成</van-button>
|
||||
|
||||
<!-- 顺位需求选择 -->
|
||||
<van-popup v-model="isNecessaryPickerShow" position="bottom">
|
||||
<van-picker show-toolbar :columns="necessaryArr" @confirm="onNecessaryConfirm" @cancel="onNecessaryCancel" />
|
||||
</van-popup>
|
||||
<!-- 对象选择 -->
|
||||
<van-popup v-model="isTargetPickerShow" position="bottom">
|
||||
<van-picker show-toolbar :columns="targetArr" @confirm="onTargetConfirm" @cancel="onTargetCancel" />
|
||||
</van-popup>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { Field, Popup, Picker } from 'vant'
|
||||
import FieldDatePicter from '@/components/ebiz/FieldDatePicter'
|
||||
import dataDictionary from '@/assets/js/utils/data-dictionary'
|
||||
import { saveForm, nbsDetail } from '@/api/ebiz/nbs'
|
||||
import utils from '@/assets/js/common'
|
||||
import utils2 from '@/assets/js/business-common'
|
||||
|
||||
//顺位需求字典
|
||||
let necessaryDictionary = dataDictionary.necessaryDictionary
|
||||
|
||||
//对象字典
|
||||
let targetDictionary = dataDictionary.targetDictionary
|
||||
|
||||
//其它费用
|
||||
let otherCost = {
|
||||
object: '',
|
||||
projectName: '',
|
||||
projectCost: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
//这两个必传,写死
|
||||
isDelete: '0',
|
||||
projectinfoId: ''
|
||||
}
|
||||
|
||||
export default {
|
||||
components: {
|
||||
[Field.name]: Field,
|
||||
[Popup.name]: Popup,
|
||||
[Picker.name]: Picker,
|
||||
FieldDatePicter
|
||||
},
|
||||
created() {
|
||||
//回填
|
||||
let id = localStorage.getItem('nbsId')
|
||||
let state = localStorage.getItem('nbsState')
|
||||
if (id && state) {
|
||||
nbsDetail({
|
||||
orderNo: id,
|
||||
nbsState: state
|
||||
}).then(res => {
|
||||
let obj = res.content
|
||||
|
||||
//取得有无配偶、子女数量
|
||||
let hasWife = false,
|
||||
childNum = 0
|
||||
obj.proposalNbsFamilyDTOLst.forEach(v => {
|
||||
if (v.relation === '00') hasWife = true
|
||||
else if (v.relation === '01') {
|
||||
this.children.push(v)
|
||||
childNum++
|
||||
}
|
||||
})
|
||||
this.hasWife = hasWife
|
||||
this.childNum = childNum
|
||||
|
||||
//如果没有填配偶,其他费用的对象不能选择配偶
|
||||
if (!hasWife) {
|
||||
targetDictionary.forEach((v, i) => {
|
||||
if (v.code === '01') targetDictionary.splice(i, 1)
|
||||
})
|
||||
this.targetArr = targetDictionary.map(v => v.value)
|
||||
}
|
||||
|
||||
let keys = Object.keys(this.form)
|
||||
for (let i in obj) {
|
||||
if (!keys.includes(i)) {
|
||||
delete obj[i]
|
||||
}
|
||||
}
|
||||
|
||||
if (!obj.proposalNbsProjectCostInfoDTOLst) obj.proposalNbsProjectCostInfoDTOLst = [{ ...otherCost }]
|
||||
|
||||
this.form = obj
|
||||
this.filterSelectedList()
|
||||
})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
maxDate: new Date('2105-12-31'),
|
||||
necessaryArr: necessaryDictionary.map(v => v.value),
|
||||
targetArr: targetDictionary.map(v => v.value),
|
||||
isNecessaryPickerShow: false,
|
||||
clickedNecessaryIndex: null,
|
||||
isTargetPickerShow: false,
|
||||
clickedTargetIndex: null,
|
||||
form: {
|
||||
firstCostRequirements: '',
|
||||
secondCostRequirements: '',
|
||||
thirdCostRequirements: '',
|
||||
livingCosts: '',
|
||||
raisingAge: '',
|
||||
loanBalance: '',
|
||||
remainRepaymentTime: '',
|
||||
charterMoney: '',
|
||||
rentHouseNumber: '',
|
||||
myParentsAge: '',
|
||||
myMotherAge: '',
|
||||
myParentsRaisemoney: '',
|
||||
wifeParentsAge: '',
|
||||
wifeMotherAge: '',
|
||||
wifeParentsRaisemoney: '',
|
||||
educationalCostOne: '',
|
||||
educationalCostTwo: '',
|
||||
educationalCostThree: '',
|
||||
educationalAgeOne: '',
|
||||
educationalAgeTwo: '',
|
||||
educationalAgeThree: '',
|
||||
hospitalizationCost: '',
|
||||
myFuneralExpenses: '',
|
||||
wifeFuneralExpenses: '',
|
||||
myEstimateTotalassets: '',
|
||||
wifeEstimateTotalassets: '',
|
||||
proposalNbsProjectCostInfoDTOLst: [{ ...otherCost }],
|
||||
isDelete: '0',
|
||||
customerId: ''
|
||||
},
|
||||
children: [],
|
||||
hasWife: false,
|
||||
childNum: 0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
necessaryFieldClick(index) {
|
||||
this.isNecessaryPickerShow = true
|
||||
this.clickedNecessaryIndex = index
|
||||
},
|
||||
onNecessaryConfirm(v) {
|
||||
this.isNecessaryPickerShow = false
|
||||
|
||||
let form = this.form
|
||||
//van-picker不能传字符串数组,所以这里根据选择的项的文本,找到它的code码来保存
|
||||
let selectedCode
|
||||
necessaryDictionary.forEach(value => {
|
||||
if (value.value === v) {
|
||||
selectedCode = value.code
|
||||
}
|
||||
})
|
||||
switch (this.clickedNecessaryIndex) {
|
||||
case 1:
|
||||
form.firstCostRequirements = selectedCode
|
||||
break
|
||||
case 2:
|
||||
form.secondCostRequirements = selectedCode
|
||||
break
|
||||
case 3:
|
||||
form.thirdCostRequirements = selectedCode
|
||||
break
|
||||
}
|
||||
|
||||
//已经选过的,就不能再次选了。所以每当选择时,把所有已选过的剔除出列表
|
||||
this.filterSelectedList()
|
||||
},
|
||||
filterSelectedList() {
|
||||
//已经选过的,就不能再次选了。把所有已选过的剔除出列表
|
||||
let form = this.form
|
||||
let selectedArr = [form.firstCostRequirements, form.secondCostRequirements, form.thirdCostRequirements]
|
||||
let necessaryArr = []
|
||||
necessaryDictionary.forEach(v => {
|
||||
if (selectedArr.indexOf(v.code) === -1) {
|
||||
necessaryArr.push(v.value)
|
||||
}
|
||||
})
|
||||
this.necessaryArr = necessaryArr
|
||||
},
|
||||
onNecessaryCancel() {
|
||||
this.isNecessaryPickerShow = false
|
||||
},
|
||||
getNecessaryText(code) {
|
||||
for (let i of necessaryDictionary) {
|
||||
if (i.code === code) {
|
||||
return i.value
|
||||
}
|
||||
}
|
||||
},
|
||||
add() {
|
||||
this.form.proposalNbsProjectCostInfoDTOLst.push({ ...otherCost })
|
||||
},
|
||||
del(index) {
|
||||
this.$set(this.form.proposalNbsProjectCostInfoDTOLst, index, null)
|
||||
},
|
||||
dateFormatter(type, value) {
|
||||
if (type === 'year') {
|
||||
return `${value}年`
|
||||
} else if (type === 'month') {
|
||||
return `${value}月`
|
||||
}
|
||||
return value
|
||||
},
|
||||
targetFieldClick(index) {
|
||||
this.clickedTargetIndex = index
|
||||
this.isTargetPickerShow = true
|
||||
},
|
||||
getTargetText(code) {
|
||||
for (let v of targetDictionary) {
|
||||
if (v.code === code) {
|
||||
return v.value
|
||||
}
|
||||
}
|
||||
},
|
||||
onTargetConfirm(v, index) {
|
||||
this.isTargetPickerShow = false
|
||||
|
||||
let list = this.form.proposalNbsProjectCostInfoDTOLst,
|
||||
value = targetDictionary[index].code
|
||||
this.$set(list[this.clickedTargetIndex], 'object', value)
|
||||
},
|
||||
onTargetCancel() {
|
||||
this.isTargetPickerShow = false
|
||||
},
|
||||
submit() {
|
||||
this.$validator.validate().then(valid => {
|
||||
if (true === valid) {
|
||||
//终止年月必须大于起始年月
|
||||
if (
|
||||
this.form.proposalNbsProjectCostInfoDTOLst.some(v => {
|
||||
return v && v.startDate > v.endDate
|
||||
})
|
||||
) {
|
||||
this.$toast('终止年月必须大于起始年月')
|
||||
return
|
||||
}
|
||||
if (this.children[0] != undefined && this.eduAge(this.form.educationalAgeOne, this.children[0].familyAge)) {
|
||||
return false
|
||||
}
|
||||
if (this.children[1] != undefined && this.eduAge(this.form.educationalAgeTwo, this.children[1].familyAge)) {
|
||||
return false
|
||||
}
|
||||
if (this.children[2] != undefined && this.eduAge(this.form.educationalAgeThree, this.children[2].familyAge)) {
|
||||
return false
|
||||
}
|
||||
let form = utils.deepCopy(this.form)
|
||||
form.orderNo = localStorage.getItem('nbsId')
|
||||
form.type = '1'
|
||||
form.proposalNbsProjectCostInfoDTOLst = form.proposalNbsProjectCostInfoDTOLst.filter(v => v)
|
||||
form.dateOfEntry = utils2.formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')
|
||||
form.isDelete = '0'
|
||||
form.nbsState = localStorage.getItem('nbsState')
|
||||
saveForm(form).then(res => {
|
||||
if (res.result === '0') {
|
||||
this.$toast('保存成功')
|
||||
|
||||
this.$jump({
|
||||
flag: 'goBack',
|
||||
extra: {
|
||||
refresh: '1',
|
||||
index: '-1'
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/nbs/nav`
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$toast(this.$validator.errors.all()[0])
|
||||
}
|
||||
})
|
||||
},
|
||||
eduAge(num, age) {
|
||||
if (num == undefined || num == '') {
|
||||
return false
|
||||
}
|
||||
num = num - 0
|
||||
if (num < age || num > 85) {
|
||||
this.$toast('您子女的教育年龄不能小于他的年龄,且不能超过85岁')
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '../../../assets/sass/nbs';
|
||||
.necessary-container {
|
||||
@include container;
|
||||
}
|
||||
</style>
|
||||
64
src/views/ebiz/nbs/PDF.vue
Normal file
64
src/views/ebiz/nbs/PDF.vue
Normal file
@@ -0,0 +1,64 @@
|
||||
<template>
|
||||
<iframe style="width:100vw;height:100vh" :src="pdfUrl"></iframe>
|
||||
</template>
|
||||
<script>
|
||||
import config from '@/config'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pdfUrl: '',
|
||||
downLoadUrl: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const pdfUrl = encodeURIComponent(config.imgDomain + '/returnDirectStream?imgPath=' + encodeURIComponent(this.$route.params.content)) //id被转换了一下,所以要转换回去
|
||||
this.downLoadUrl = config.imgDomain + '/returnDirectStream?imgPath=' + encodeURIComponent(this.$route.params.content)
|
||||
this.pdfUrl = location.origin + '/pdfjs/web/viewer.html?file=' + pdfUrl
|
||||
setTimeout(() => {
|
||||
EWebBridge.webCallAppInJs('webview_left_button', {
|
||||
intercept: '1' //是否拦截原生返回事件 1是 其他否
|
||||
})
|
||||
this.filterBtn() // 初始化下载按钮
|
||||
window.appCallBack = this.appCallBack //app回调
|
||||
}, 1000)
|
||||
},
|
||||
mounted() {
|
||||
console.log('11=== ', this.downLoadUrl)
|
||||
},
|
||||
methods: {
|
||||
// 下载按钮
|
||||
filterBtn() {
|
||||
window.EWebBridge.webCallAppInJs('webview_right_button', {
|
||||
btns: [
|
||||
{
|
||||
img: this.$assetsUrl + 'images/share@2x.png'
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
appCallBack(data) {
|
||||
if (data.trigger == 'right_button_click') {
|
||||
// eslint-disable-next-line no-undef
|
||||
EWebBridge.webCallAppInJs('download', {
|
||||
name: 'NBS智能分析报告.pdf',
|
||||
url: this.downLoadUrl
|
||||
})
|
||||
}
|
||||
if (data.trigger == 'left_button_click') {
|
||||
this.$jump({
|
||||
flag: 'goBack',
|
||||
extra: {
|
||||
refresh: '1',
|
||||
index: '-1'
|
||||
},
|
||||
routerInfo: {
|
||||
type: 2,
|
||||
index: -1,
|
||||
path: `/nbs/result`
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
335
src/views/ebiz/nbs/Prepared.vue
Normal file
335
src/views/ebiz/nbs/Prepared.vue
Normal file
@@ -0,0 +1,335 @@
|
||||
<template>
|
||||
<div class="prepared-container">
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">已投保保险</p>
|
||||
<div v-for="(item, index) in form.proposalNbsInsuredInfoDTOLst" :key="index">
|
||||
<template v-if="item">
|
||||
<van-field
|
||||
clearable
|
||||
readonly
|
||||
label="对象"
|
||||
name="对象"
|
||||
right-icon="arrow"
|
||||
placeholder="请选择"
|
||||
@click="targetFieldClick(index)"
|
||||
:value="getTargetText(item.haveiNsurance)"
|
||||
></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
readonly
|
||||
label="险种类型"
|
||||
name="险种类型"
|
||||
right-icon="arrow"
|
||||
placeholder="请选择"
|
||||
@click="insuranceFieldClick(index)"
|
||||
:value="getInsuranceText(item.plantType)"
|
||||
></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="满期岁"
|
||||
name="满期岁"
|
||||
placeholder="请输入"
|
||||
:value="item.ageofMaturity"
|
||||
@input="ageInput(item, arguments)"
|
||||
:disabled="item.isLifelong"
|
||||
></van-field>
|
||||
<div class="fs14 p10 flex align-center border-bt relative">
|
||||
<van-checkbox style="margin-left: auto;margin-right: 5px" v-model="item.isLifelong" @change="lifelongChange(item, arguments)"></van-checkbox>终身
|
||||
</div>
|
||||
<van-field
|
||||
clearable
|
||||
label="保险金额(万元)"
|
||||
name="保险金额(万元)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="item.insuredAmount"
|
||||
></van-field>
|
||||
<div class="nbs-del" @click="del(index)"><van-icon name="delete"></van-icon></div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="nbs-add" @click="add">+ 添加已投保保险</div>
|
||||
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">收入及储蓄</p>
|
||||
<van-field
|
||||
clearable
|
||||
label="目前年收入(万元)"
|
||||
name="目前年收入(万元)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.myAnnualIncome"
|
||||
></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="预计工作至(岁)"
|
||||
name="预计工作至(岁)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.myFutureWorkinglife"
|
||||
></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="其它收入(万元/年)"
|
||||
name="其它收入(万元/年)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.myOtherRevenue"
|
||||
></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="预计可收年数(年)"
|
||||
name="预计可收年数(年)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.myOtherRevenueExpectedyear"
|
||||
></van-field>
|
||||
<van-field clearable label="现有储蓄(万元)" name="现有储蓄(万元)" placeholder="请输入" v-validate="'onlyNumber'" v-model="form.myAssets"></van-field>
|
||||
<template v-if="hasWife">
|
||||
<van-field
|
||||
clearable
|
||||
label="配偶目前年收入(万元)"
|
||||
name="配偶目前年收入(万元)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.wifeAnnualIncome"
|
||||
></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="配偶预计工作至(岁)"
|
||||
name="配偶预计工作至(岁)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.wifeFutureWorkinglife"
|
||||
></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="配偶其它收入(万元/年)"
|
||||
name="配偶其它收入(万元/年)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.wifeOtherRevenue"
|
||||
></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="配偶预计可收年数(年)"
|
||||
name="配偶预计可收年数(年)"
|
||||
placeholder="请输入"
|
||||
v-model="form.wifeOtherRevenueExpectedyear"
|
||||
v-validate="'onlyNumber'"
|
||||
></van-field>
|
||||
<van-field
|
||||
clearable
|
||||
label="配偶现有储蓄(万元)"
|
||||
name="配偶现有储蓄(万元)"
|
||||
placeholder="请输入"
|
||||
v-validate="'onlyNumber'"
|
||||
v-model="form.wifeAssets"
|
||||
></van-field>
|
||||
</template>
|
||||
<van-button type="danger" class="bottom-btn" @click="submit" v-no-more-click="1000">完成</van-button>
|
||||
|
||||
<!-- 对象选择 -->
|
||||
<van-popup v-model="isTargetPickerShow" position="bottom">
|
||||
<van-picker show-toolbar :columns="targetArr" @confirm="onTargetConfirm" @cancel="onTargetCancel" />
|
||||
</van-popup>
|
||||
<!-- 险种类型选择 -->
|
||||
<van-popup v-model="isInsurancePickerShow" position="bottom">
|
||||
<van-picker show-toolbar :columns="insuranceArr" @confirm="onInsuranceConfirm" @cancel="onInsuranceCancel" />
|
||||
</van-popup>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { Field, Popup, Picker, Checkbox } from 'vant'
|
||||
import dataDictionary from '@/assets/js/utils/data-dictionary'
|
||||
import utils from '@/assets/js/common'
|
||||
import { saveForm, nbsDetail } from '@/api/ebiz/nbs'
|
||||
import utils2 from '@/assets/js/business-common'
|
||||
|
||||
//对象字典
|
||||
let targetDictionary = dataDictionary.targetDictionary
|
||||
//险种类型字典
|
||||
let insuranceDictionary = dataDictionary.insuranceDictionary
|
||||
|
||||
let insuredItem = {
|
||||
haveiNsurance: '',
|
||||
plantType: '',
|
||||
insuredAmount: '',
|
||||
ageofMaturity: '',
|
||||
|
||||
//这两项必填写死
|
||||
insuredinfoId: '',
|
||||
isDelete: '0',
|
||||
|
||||
//不传
|
||||
isLifelong: false
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
proposalNbsInsuredInfoDTOLst: [{ ...insuredItem }],
|
||||
myAnnualIncome: '',
|
||||
myFutureWorkinglife: '',
|
||||
myOtherRevenue: '',
|
||||
myOtherRevenueExpectedyear: '',
|
||||
myAssets: '',
|
||||
wifeAnnualIncome: '',
|
||||
wifeFutureWorkinglife: '',
|
||||
wifeOtherRevenue: '',
|
||||
wifeOtherRevenueExpectedyear: '',
|
||||
wifeAssets: '',
|
||||
isDelete: '0',
|
||||
customerId: ''
|
||||
},
|
||||
targetArr: ['本人'],
|
||||
// targetArr: targetDictionary.map(v => v.value),
|
||||
isTargetPickerShow: false,
|
||||
clickedTargetIndex: null,
|
||||
insuranceArr: insuranceDictionary.map(v => v.value),
|
||||
isInsurancePickerShow: false,
|
||||
clickedInsurancetIndex: null,
|
||||
hasWife: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
insuranceFieldClick(index) {
|
||||
this.clickedInsurancetIndex = index
|
||||
this.isInsurancePickerShow = true
|
||||
},
|
||||
onInsuranceConfirm(value, index) {
|
||||
let code = insuranceDictionary[index].code
|
||||
this.$set(this.form.proposalNbsInsuredInfoDTOLst[this.clickedInsurancetIndex], 'plantType', code)
|
||||
this.isInsurancePickerShow = false
|
||||
},
|
||||
onInsuranceCancel() {
|
||||
this.isInsurancePickerShow = false
|
||||
},
|
||||
getInsuranceText(code) {
|
||||
for (let v of insuranceDictionary) {
|
||||
if (v.code === code) {
|
||||
return v.value
|
||||
}
|
||||
}
|
||||
},
|
||||
targetFieldClick(index) {
|
||||
this.clickedTargetIndex = index
|
||||
this.isTargetPickerShow = true
|
||||
},
|
||||
onTargetConfirm(value, index) {
|
||||
let code = targetDictionary[index].code
|
||||
this.$set(this.form.proposalNbsInsuredInfoDTOLst[this.clickedTargetIndex], 'haveiNsurance', code)
|
||||
this.isTargetPickerShow = false
|
||||
},
|
||||
onTargetCancel() {
|
||||
this.isTargetPickerShow = false
|
||||
},
|
||||
getTargetText(code) {
|
||||
for (let v of targetDictionary) {
|
||||
if (v.code === code) {
|
||||
return v.value
|
||||
}
|
||||
}
|
||||
},
|
||||
add() {
|
||||
this.form.proposalNbsInsuredInfoDTOLst.push({ ...insuredItem })
|
||||
},
|
||||
del(index) {
|
||||
this.$set(this.form.proposalNbsInsuredInfoDTOLst, index, null)
|
||||
},
|
||||
ageInput(item, args) {
|
||||
item.ageofMaturity = args[0]
|
||||
},
|
||||
lifelongChange(item, args) {
|
||||
const v = args[0]
|
||||
if (v) item.ageofMaturity = '终身'
|
||||
else {
|
||||
//取消终身时置空
|
||||
if (item.ageofMaturity === '终身') item.ageofMaturity = ''
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
this.$validator.validate().then(valid => {
|
||||
if (true === valid) {
|
||||
let form = utils.deepCopy(this.form)
|
||||
form.proposalNbsInsuredInfoDTOLst = form.proposalNbsInsuredInfoDTOLst.filter(v => v)
|
||||
form.proposalNbsInsuredInfoDTOLst.forEach(v => delete v.isLifelong)
|
||||
form.orderNo = localStorage.getItem('nbsId')
|
||||
form.type = '2'
|
||||
form.dateOfEntry = utils2.formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')
|
||||
form.nbsState = localStorage.getItem('nbsState')
|
||||
saveForm(form).then(res => {
|
||||
if (res.result === '0') {
|
||||
this.$toast('保存成功')
|
||||
this.$jump({
|
||||
flag: 'goBack',
|
||||
extra: {
|
||||
refresh: '1',
|
||||
index: '-1'
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/nbs/nav`
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$toast(this.$validator.errors.all()[0])
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
//回填
|
||||
let id = localStorage.getItem('nbsId')
|
||||
let state = localStorage.getItem('nbsState')
|
||||
if (id && state) {
|
||||
nbsDetail({
|
||||
orderNo: id,
|
||||
nbsState: state
|
||||
}).then(res => {
|
||||
let obj = res.content
|
||||
|
||||
//取得有无配偶、子女数量
|
||||
this.targetArr = ['本人']
|
||||
let hasWife = false
|
||||
obj.proposalNbsFamilyDTOLst.forEach(v => {
|
||||
if (v.relation === '00') {
|
||||
hasWife = true
|
||||
this.targetArr = ['本人', '配偶']
|
||||
}
|
||||
})
|
||||
this.hasWife = hasWife
|
||||
|
||||
let keys = Object.keys(this.form)
|
||||
|
||||
for (let i in obj) {
|
||||
if (!keys.includes(i)) {
|
||||
delete obj[i]
|
||||
}
|
||||
}
|
||||
|
||||
if (!obj.proposalNbsInsuredInfoDTOLst) {
|
||||
obj.proposalNbsInsuredInfoDTOLst = [{ ...insuredItem }]
|
||||
} else {
|
||||
obj.proposalNbsInsuredInfoDTOLst.forEach(v => {
|
||||
if (v.ageofMaturity === '终身') v.isLifelong = true
|
||||
})
|
||||
}
|
||||
|
||||
this.form = obj
|
||||
})
|
||||
}
|
||||
},
|
||||
components: {
|
||||
[Field.name]: Field,
|
||||
[Popup.name]: Popup,
|
||||
[Picker.name]: Picker,
|
||||
[Checkbox.name]: Checkbox
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import '../../../assets/sass/nbs';
|
||||
.prepared-container {
|
||||
@include container;
|
||||
}
|
||||
</style>
|
||||
95
src/views/ebiz/nbs/Result.vue
Normal file
95
src/views/ebiz/nbs/Result.vue
Normal file
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="mt60 text-center success-icon">
|
||||
<van-icon name="passed"></van-icon>
|
||||
</div>
|
||||
<div class="mt50 fs18 text-center">报告已生成,点击查看</div>
|
||||
<div>
|
||||
<div class="result-button" @click="makePDF('00')">经济支柱为客户本人</div>
|
||||
<div class="result-button" :class="{ 'result-button-disabled': !isHalfActive }" @click="isHalfActive && makePDF('01')">
|
||||
经济支柱为客户配偶
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { makePDF } from '@/api/ebiz/nbs'
|
||||
export default {
|
||||
created() {
|
||||
window.appCallBack = this.appCallBack //app回调
|
||||
},
|
||||
mounted() {
|
||||
console.log(111)
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isHalfActive: this.$route.params.half === '0',
|
||||
canClick: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
appCallBack(data) {
|
||||
if (data.trigger == 'left_button_click') {
|
||||
// eslint-disable-next-line no-undef
|
||||
this.$jump({
|
||||
flag: 'goBack',
|
||||
extra: {
|
||||
refresh: '1',
|
||||
index: '-1'
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/nbs/nav`
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
makePDF(type) {
|
||||
console.log('this.canClick == ', this.canClick)
|
||||
if (!this.canClick) return
|
||||
this.canClick = false
|
||||
makePDF({
|
||||
nbsState: this.$route.params.nbsState,
|
||||
orderNo: this.$route.params.id,
|
||||
nbsCalculusResDTO: {
|
||||
type
|
||||
}
|
||||
}).then(res => {
|
||||
let content = res.content
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/nbs/pdf/${content}`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/nbs/pdf/${content}`
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.success-icon {
|
||||
font-size: 100px;
|
||||
line-height: 100px;
|
||||
color: #7ac067;
|
||||
}
|
||||
.result-button {
|
||||
box-sizing: border-box;
|
||||
margin: 28px auto 0 auto;
|
||||
width: 327px;
|
||||
height: 40px;
|
||||
line-height: 38px;
|
||||
border: 1px solid #66cc00;
|
||||
border-radius: 20px;
|
||||
text-align: center;
|
||||
&:first-child {
|
||||
margin-top: 200px;
|
||||
}
|
||||
&-disabled {
|
||||
color: #666;
|
||||
border-color: #666;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user