【修改】:提交信息时,给参数中增加一个参数

This commit is contained in:
zhangqi1
2021-07-19 10:14:34 +08:00
committed by dwq
parent 3498febd44
commit 0ff19893af

View File

@@ -1,69 +1,74 @@
<template> <template>
<div class="insured-info-container pb50"> <div class='insured-info-container pb50'>
<!-- 基本信息 --> <!-- 基本信息 -->
<van-cell-group class="mt10"> <van-cell-group class='mt10'>
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">推荐人信息</p> <p style='border-bottom: 1px solid #ebedf0' class='fs15 fwb pl10 pv12'>推荐人信息</p>
<van-field v-model="recommender.name" label="推荐人姓名" name="推荐人姓名" readonly /> <van-field v-model='recommender.name' label='推荐人姓名' name='推荐人姓名' readonly />
<van-field :value="getAgentGrade(recommender.agentGrade)" label="推荐人职级" name="推荐人职级" readonly /> <van-field :value='getAgentGrade(recommender.agentGrade)' label='推荐人职级' name='推荐人职级' readonly />
<!-- <van-field v-model="recommender.applyNo" label="推荐人工号" name="推荐人工号" readonly /> --> <!-- <van-field v-model="recommender.applyNo" label="推荐人工号" name="推荐人工号" readonly /> -->
<van-field v-model="recommender.unitName" label="销售机构" name="销售机构" readonly /> <van-field v-model='recommender.unitName' label='销售机构' name='销售机构' readonly />
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">个人信息</p> <p style='border-bottom: 1px solid #ebedf0' class='fs15 fwb pl10 pv12'>个人信息</p>
<van-field v-model="userInfo.name" label="姓名" name="姓名" placeholder="请输入" v-validate="'required|name'" clearable /> <van-field v-model='userInfo.name' label='姓名' name='姓名' placeholder='请输入' v-validate="'required|name'"
clearable />
<van-field <van-field
:value="userInfo.idType | idToText('idType')" :value="userInfo.idType | idToText('idType')"
v-validate="'required'" v-validate="'required'"
readonly readonly
label="证件类型" label='证件类型'
name="证件类型" name='证件类型'
right-icon="arrow" right-icon='arrow'
placeholder="请选择证件类型" placeholder='请选择证件类型'
@click="toSelect('1')" @click="toSelect('1')"
/> />
<van-field <van-field
v-model="userInfo.idNo" v-model='userInfo.idNo'
placeholder="请输入证件号码" placeholder='请输入证件号码'
label="证件号码" label='证件号码'
name="证件号码" name='证件号码'
v-validate="'required'" v-validate="'required'"
maxlength="18" maxlength='18'
clearable clearable
@blur="getRelatedData(userInfo.idNo)" @blur='getRelatedData(userInfo.idNo)'
/> />
<select-radio :radios="sexRadio" label="性别" name="性别" v-validate="'required'" :required="false" :value.sync="userInfo.sex"></select-radio> <select-radio :radios='sexRadio' label='性别' name='性别' v-validate="'required'" :required='false'
<van-field v-model="userInfo.mobile" label="手机号" name="手机号" placeholder="请输入手机号" v-validate="'required|mobile'" maxlength="11" clearable /> :value.sync='userInfo.sex'></select-radio>
<van-field v-model="userInfo.authCode" center clearable label name="短信验证码" placeholder="请输入短信验证码" v-validate="'required'" maxlength="6"> <van-field v-model='userInfo.mobile' label='手机号' name='手机号' placeholder='请输入手机号' v-validate="'required|mobile'"
<van-button slot="button" size="small" type="danger" @click="getCode" :disabled="codeDisabled" v-no-more-click="1000"> maxlength='11' clearable />
<van-field v-model='userInfo.authCode' center clearable label name='短信验证码' placeholder='请输入短信验证码'
v-validate="'required'" maxlength='6'>
<van-button slot='button' size='small' type='danger' @click='getCode' :disabled='codeDisabled'
v-no-more-click='1000'>
{{ codeDisabled ? `${countDown}s后重新获取` : '获取验证码' }} {{ codeDisabled ? `${countDown}s后重新获取` : '获取验证码' }}
</van-button> </van-button>
</van-field> </van-field>
</van-cell-group> </van-cell-group>
<van-button type="danger" class="bottom-btn" @click="nextStep" v-no-more-click="1000">提交信息</van-button> <van-button type='danger' class='bottom-btn' @click='nextStep' v-no-more-click='1000'>提交信息</van-button>
<!-- 字段选择 --> <!-- 字段选择 -->
<van-popup v-model="popupShow" position="bottom"> <van-popup v-model='popupShow' position='bottom'>
<van-picker show-toolbar :columns="columns" @confirm="onConfirm" @cancel="popupShow = false" /> <van-picker show-toolbar :columns='columns' @confirm='onConfirm' @cancel='popupShow = false' />
</van-popup> </van-popup>
</div> </div>
</template> </template>
<script> <script>
import { Field, CellGroup, Checkbox, Popup, Picker, Area, RadioGroup, Radio, Dialog } from 'vant' import { Field, CellGroup, Checkbox, Popup, Picker, Area, RadioGroup, Radio, Dialog } from 'vant';
import SelectRadio from '@/components/ebiz/SelectRadio' import SelectRadio from '@/components/ebiz/SelectRadio';
import FieldDatePicter from '@/components/ebiz/FieldDatePicter' import FieldDatePicter from '@/components/ebiz/FieldDatePicter';
import OccupationPicker from '@/components/ebiz/occipation/OccupationPicker' import OccupationPicker from '@/components/ebiz/occipation/OccupationPicker';
import CustomerPicker from '@/components/ebiz/customer/CustomerPicker' import CustomerPicker from '@/components/ebiz/customer/CustomerPicker';
import DataDictionary from '@/assets/js/utils/data-dictionary' import DataDictionary from '@/assets/js/utils/data-dictionary';
import areaList from '@/assets/js/utils/area' import areaList from '@/assets/js/utils/area';
import { getTokenForAgent, agentInfowxSubmit, getTokenForUserModel } from '@/api/ebiz/agentEenter/agentEenter' import { getTokenForAgent, agentInfowxSubmit, getTokenForUserModel } from '@/api/ebiz/agentEenter/agentEenter';
import utilsAge from '@/assets/js/utils/age' import utilsAge from '@/assets/js/utils/age';
import getAreaName from '@/assets/js/utils/get-area-name' import getAreaName from '@/assets/js/utils/get-area-name';
import IdentityCardScan from '@/components/ebiz/sale/IdentityCardScan' import IdentityCardScan from '@/components/ebiz/sale/IdentityCardScan';
import idNoCheck from '@/assets/js/utils/idNoCheck' import idNoCheck from '@/assets/js/utils/idNoCheck';
import beforeDate from '@/assets/js/utils/getBeforeDate.js' import beforeDate from '@/assets/js/utils/getBeforeDate.js';
import { idToData } from '@/assets/js/utils/verification' import { idToData } from '@/assets/js/utils/verification';
import { weixinShare } from '@/assets/js/utils/wxShare.js' import { weixinShare } from '@/assets/js/utils/wxShare.js';
import axios from 'axios' import axios from 'axios';
import index from '@/config/index' import index from '@/config/index';
import { getAuthCode } from '@/api/ebiz/sale/sale' import { getAuthCode } from '@/api/ebiz/sale/sale';
export default { export default {
@@ -114,7 +119,8 @@ export default {
sex: '0', //投保人性别 sex: '0', //投保人性别
idType: '1', //证件类型 idType: '1', //证件类型
idNo: '', //证件号码 idNo: '', //证件号码
mobile: '' //手机号 mobile: '',//手机号
agentGrade: ''
}, },
areaList: areaList, areaList: areaList,
token: '', token: '',
@@ -122,51 +128,52 @@ export default {
codeDisabled: false, //获取验证码按钮是否禁用 codeDisabled: false, //获取验证码按钮是否禁用
countDown: 60, //获取短信验证码倒计时 countDown: 60, //获取短信验证码倒计时
sessionId: '' //后台返回的 id sessionId: '' //后台返回的 id
} };
}, },
mounted() { mounted() {
if (this.$route.query.content) { if (this.$route.query.content) {
window.localStorage.setItem('wxShareDesc', this.$route.query.content) window.localStorage.setItem('wxShareDesc', this.$route.query.content);
} }
weixinShare({ weixinShare({
title: '国富人寿欢迎你!', title: '国富人寿欢迎你!',
imgUrl: this.$assetsUrl + 'images/logo.png', imgUrl: this.$assetsUrl + 'images/logo.png',
desc: localStorage.wxShareDesc, desc: localStorage.wxShareDesc,
link: location.origin + '/#/agentEenter/ShareInfo?token=' + localStorage.token link: location.origin + '/#/agentEenter/ShareInfo?token=' + localStorage.token
}) });
}, },
created() { created() {
if (this.$route.query.token) { if (this.$route.query.token) {
// this.token = this.$route.query.token // this.token = this.$route.query.token
window.localStorage.setItem('token', this.$route.query.token) window.localStorage.setItem('token', this.$route.query.token);
} else { } else {
this.$toast.fail('链接已失效,请联系代理人重新分享!') this.$toast.fail('链接已失效,请联系代理人重新分享!');
} }
this.getData() this.getData();
}, },
methods: { methods: {
getData: function() { getData: function() {
let self = this let self = this;
self.$toast.loading({ self.$toast.loading({
duration: 0, // 持续展示 toast duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击 forbidClick: true, // 禁用背景点击
loadingType: 'spinner', loadingType: 'spinner',
message: '加载中……' message: '加载中……'
}) });
getTokenForUserModel({ getTokenForUserModel({
token: this.$CacheUtils.getLocItem('token') token: this.$CacheUtils.getLocItem('token')
}).then(function(response) { }).then(function(response) {
self.$toast.clear() self.$toast.clear();
console.log('response', response) console.log('response', response);
if (response.result == '0') { if (response.result == '0') {
self.recommender = response self.recommender = response;
this.userInfo.agentGrade = response.agentGrade;
} else { } else {
this.$toast.fail(response.resultMessage) this.$toast.fail(response.resultMessage);
} }
}) })
.catch(function(error) { .catch(function(error) {
// this.$toast.fail(error) // this.$toast.fail(error)
}) });
// var self = this // var self = this
// //获取推荐人信息 // //获取推荐人信息
// let data = { // let data = {
@@ -186,49 +193,49 @@ export default {
// }) // })
}, },
getAgentGrade(agentGrade) { getAgentGrade(agentGrade) {
let result = '' let result = '';
DataDictionary.agentGrade.map((item, index) => { DataDictionary.agentGrade.map((item, index) => {
for (var key in item) { for (var key in item) {
if (key == agentGrade) { if (key == agentGrade) {
result = item[agentGrade] result = item[agentGrade];
} }
} }
}) });
return result return result;
}, },
// 下一步 // 下一步
nextStep() { nextStep() {
var self = this var self = this;
self.$toast.loading({ self.$toast.loading({
duration: 0, // 持续展示 toast duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击 forbidClick: true, // 禁用背景点击
loadingType: 'spinner', loadingType: 'spinner',
message: '加载中……' message: '加载中……'
}) });
this.$validator.validate().then(valid => { this.$validator.validate().then(valid => {
if (true === valid) { if (true === valid) {
self.$toast.clear() self.$toast.clear();
if (this.userInfo.idType == '1') { if (this.userInfo.idType == '1') {
//身份证 //身份证
// 证件号码规则校验 // 证件号码规则校验
if (!idNoCheck.isIdno(this.userInfo.idNo)) { if (!idNoCheck.isIdno(this.userInfo.idNo)) {
return this.$toast('请录入正确的身份证') return this.$toast('请录入正确的身份证');
} }
if (this.userInfo.idNo.length == '18') { if (this.userInfo.idNo.length == '18') {
//18位身份证第17位是性别位, 奇男偶女 //18位身份证第17位是性别位, 奇男偶女
let sexSign = this.userInfo.idNo.substr(16, 1) let sexSign = this.userInfo.idNo.substr(16, 1);
if ((parseInt(sexSign) % 2 == 0 && this.userInfo.sex != 1) || (parseInt(sexSign) % 2 != 0 && this.userInfo.sex != 0)) { if ((parseInt(sexSign) % 2 == 0 && this.userInfo.sex != 1) || (parseInt(sexSign) % 2 != 0 && this.userInfo.sex != 0)) {
return this.$toast('性别录入与身份证不符') return this.$toast('性别录入与身份证不符');
} }
} }
self.save() self.save();
} else { } else {
self.save() self.save();
} }
} else { } else {
this.$toast(this.$validator.errors.all()[0]) this.$toast(this.$validator.errors.all()[0]);
} }
}) });
}, },
save() { save() {
Dialog.confirm({ Dialog.confirm({
@@ -243,21 +250,21 @@ export default {
ebizEnterCustomerDto: this.userInfo, ebizEnterCustomerDto: this.userInfo,
smsCodeDTO: { smsId: this.sessionId, code: this.userInfo.authCode } smsCodeDTO: { smsId: this.sessionId, code: this.userInfo.authCode }
// ebizReferrerDto: this.recommender // ebizReferrerDto: this.recommender
} };
console.log(data) console.log(data);
let that = this let that = this;
that.$toast.loading({ that.$toast.loading({
duration: 0, // 持续展示 toast duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击 forbidClick: true, // 禁用背景点击
loadingType: 'spinner', loadingType: 'spinner',
message: '加载中……' message: '加载中……'
}) });
agentInfowxSubmit(data) agentInfowxSubmit(data)
.then(res => { .then(res => {
// console.log(res) // console.log(res)
if (res.result == '0') { if (res.result == '0') {
this.$store.commit('updateAgentEnterApplyMsg', this.userInfo) this.$store.commit('updateAgentEnterApplyMsg', this.userInfo);
that.$toast.clear() that.$toast.clear();
this.$jump({ this.$jump({
flag: 'h5', flag: 'h5',
extra: { extra: {
@@ -268,77 +275,77 @@ export default {
routerInfo: { routerInfo: {
path: `/agentEenter/ShareInfoSuccess` path: `/agentEenter/ShareInfoSuccess`
} }
}) });
} else { } else {
this.$toast(res.resultMessage) this.$toast(res.resultMessage);
} }
}) })
.then(function(err) { .then(function(err) {
console.log(err) console.log(err);
}) });
}) });
}, },
//弹框选择 //弹框选择
toSelect(pickerType, valueKey) { toSelect(pickerType, valueKey) {
;[this.popupShow, this.pickerType] = [true, pickerType] ;[this.popupShow, this.pickerType] = [true, pickerType];
if (valueKey) this.valueKey = valueKey if (valueKey) this.valueKey = valueKey;
if (pickerType == '1') { if (pickerType == '1') {
this.columns = DataDictionary.idType this.columns = DataDictionary.idType;
} }
}, },
// //确认选择字段 // //确认选择字段
onConfirm(value) { onConfirm(value) {
this.popupShow = false this.popupShow = false;
if (this.pickerType == '1') { if (this.pickerType == '1') {
this.userInfo.idType = value.id this.userInfo.idType = value.id;
} }
}, },
getRelatedData(val) { getRelatedData(val) {
if (this.userInfo.idType != '1') { if (this.userInfo.idType != '1') {
return return;
} }
this.userInfo.sex = idToData(val).sex this.userInfo.sex = idToData(val).sex;
}, },
//获取验证码 //获取验证码
getCode() { getCode() {
if (this.userInfo.mobile == '') { if (this.userInfo.mobile == '') {
return this.$toast('请填写手机号') return this.$toast('请填写手机号');
} }
this.codeDisabled = true this.codeDisabled = true;
//倒计时 //倒计时
this.timeId = setInterval(() => { this.timeId = setInterval(() => {
this.countDown-- this.countDown--;
if (this.countDown <= 0) { if (this.countDown <= 0) {
window.clearInterval(this.timeId) window.clearInterval(this.timeId);
this.codeDisabled = false this.codeDisabled = false;
this.countDown = 60 this.countDown = 60;
} }
}, 1000) }, 1000);
let data = { let data = {
operateType: 'appntInfoEntry', operateType: 'appntInfoEntry',
type: 'H5', type: 'H5',
operateCode: this.userInfo.mobile, operateCode: this.userInfo.mobile,
system: 'agentApp', system: 'agentApp',
operateCodeType: '0' operateCodeType: '0'
} };
//获取验证码 //获取验证码
getAuthCode(data).then(res => { getAuthCode(data).then(res => {
console.log(res) console.log(res);
if (res.result == 0) { if (res.result == 0) {
this.sessionId = res.sessionId this.sessionId = res.sessionId;
} else { } else {
this.$toast(res.resultMessage) this.$toast(res.resultMessage);
} }
}) });
} }
} }
} };
</script> </script>
<style lang="scss" scoped> <style lang='scss' scoped>
.insured-info-container { .insured-info-container {
.referrerW { .referrerW {
/deep/.van-cell__title { /deep/ .van-cell__title {
width: 110px; width: 110px;
} }
} }