hotfix:内外勤判断调整 --提交人:阳华祥

This commit is contained in:
yang.huaxiang
2020-11-27 10:59:00 +08:00
parent aa0b3e2c38
commit e28aa13d3e
2 changed files with 32 additions and 14 deletions

View File

@@ -126,7 +126,8 @@ export default {
async checkModelFilter() { async checkModelFilter() {
const agentInfoRes = await getCheckModelAgentInfo({}) const agentInfoRes = await getCheckModelAgentInfo({})
if (agentInfoRes.result == 0) { if (agentInfoRes.result == 0) {
if (!/^N{1}/.test(agentInfoRes.branchType)) { if (/^[0-9][0-9]*$/.test(agentInfoRes.branchType)) {
// 内勤 并且手机号码正确
this.checkModel.mobile = agentInfoRes.phoneNo this.checkModel.mobile = agentInfoRes.phoneNo
this.checkModel.show = true this.checkModel.show = true
this.isShowSms = false this.isShowSms = false

View File

@@ -2,6 +2,7 @@
<div class="insured-info-container"> <div class="insured-info-container">
<van-cell-group> <van-cell-group>
<van-field <van-field
v-if="clickMobileDisabled"
:value="logoutDTO.mobile | dataMaskingMobile" :value="logoutDTO.mobile | dataMaskingMobile"
clearable clearable
required required
@@ -11,7 +12,16 @@
v-validate="'required|mobile'" v-validate="'required|mobile'"
:disabled="true" :disabled="true"
/> />
<van-field v-model="logoutDTO.smsCode" required center label="验证码" clearable placeholder="请输入短信验证码" @input="validateNext"> <van-field
v-if="clickMobileDisabled"
v-model="logoutDTO.smsCode"
required
center
label="验证码"
clearable
placeholder="请输入短信验证码"
@input="validateNext"
>
<van-button type="danger" slot="button" size="small" @click="getCode" :disabled="codeDisabled" v-no-more-click="1000"> <van-button type="danger" slot="button" size="small" @click="getCode" :disabled="codeDisabled" v-no-more-click="1000">
{{ codeDisabled ? `${countDown}s后重新获取` : '获取验证码' }} {{ codeDisabled ? `${countDown}s后重新获取` : '获取验证码' }}
</van-button> </van-button>
@@ -65,7 +75,8 @@ export default {
countDown: 60, // 倒计时 countDown: 60, // 倒计时
codeDisabled: true, // 获取验证码按钮是否禁用 codeDisabled: true, // 获取验证码按钮是否禁用
branchType: null, branchType: null,
checkNextDisabled: true // 禁用修改 checkNextDisabled: true, // 禁用修改
clickMobileDisabled: false // 手机号是否存在
} }
}, },
async mounted() { async mounted() {
@@ -73,10 +84,11 @@ export default {
// 获取代理人信息 // 获取代理人信息
const res = await getAgentInfo({ '89': '890' }) const res = await getAgentInfo({ '89': '890' })
if (res.result == 0) { if (res.result == 0) {
this.branchType = /^N{1}/.test(res.branchType) ? '1' : '0' //res.branchType 以N打头的是内勤 其他是外勤 if (/^[0-9][0-9]*$/.test(res.branchType)) {
if (this.branchType == '0') { // 内勤 手机号格式正确
this.logoutDTO.mobile = res.phoneNo this.logoutDTO.mobile = res.phoneNo
this.codeDisabled = false this.codeDisabled = false
this.clickMobileDisabled = true
} }
} else { } else {
return this.$toast(res.resultMessage) return this.$toast(res.resultMessage)
@@ -127,9 +139,11 @@ export default {
}, },
//操作下一步按钮状态 //操作下一步按钮状态
validateNext() { validateNext() {
if (!this.logoutDTO.smsCode || this.logoutDTO.smsCode == '') { if (this.clickMobileDisabled) {
this.checkNextDisabled = true if (!this.logoutDTO.smsCode || this.logoutDTO.smsCode == '') {
return this.checkNextDisabled = true
return
}
} }
// 2、判断密码是否一致 // 2、判断密码是否一致
if (!this.logoutDTO.pwd || this.logoutDTO.pwd == '') { if (!this.logoutDTO.pwd || this.logoutDTO.pwd == '') {
@@ -150,12 +164,14 @@ export default {
// 注销 // 注销
logoutAgent() { logoutAgent() {
// 1、判断计时器 // 1、判断计时器
if (!this.codeDisabled) { if (this.clickMobileDisabled) {
return this.$toast('请先获取验证码') if (!this.codeDisabled) {
} return this.$toast('请先获取验证码')
// }
if (!this.logoutDTO.smsCode || this.logoutDTO.smsCode == '') { //
return this.$toast('请输入短信验证码') if (!this.logoutDTO.smsCode || this.logoutDTO.smsCode == '') {
return this.$toast('请输入短信验证码')
}
} }
// 2、判断密码是否一致 // 2、判断密码是否一致
if (!this.logoutDTO.pwd || this.logoutDTO.pwd == '') { if (!this.logoutDTO.pwd || this.logoutDTO.pwd == '') {
@@ -185,6 +201,7 @@ export default {
this.$toast('用户注销成功') this.$toast('用户注销成功')
// 跳转登陆页面 // 跳转登陆页面
this.$CacheUtils.removeLocItem('token') this.$CacheUtils.removeLocItem('token')
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('bridge', { flag: 'login' }) EWebBridge.webCallAppInJs('bridge', { flag: 'login' })
} else { } else {
this.$toast(res.resultMessage) this.$toast(res.resultMessage)