从陪访消息进入时固定陪访类型

This commit is contained in:
mengxiaolong
2021-03-05 15:31:49 +08:00
parent 60a9164e43
commit 068cec5fa3
2 changed files with 22 additions and 3 deletions

View File

@@ -33,6 +33,10 @@ export default {
readonly: { readonly: {
type: Boolean, type: Boolean,
default: false default: false
},
isDisabled: {
type: Boolean,
default: false
} }
}, },
data() { data() {
@@ -42,6 +46,7 @@ export default {
}, },
methods: { methods: {
showPopup() { showPopup() {
if (this.isDisabled) return
this.isShow = true this.isShow = true
}, },
closePopup() { closePopup() {

View File

@@ -27,6 +27,7 @@
:columns="visitTypes" :columns="visitTypes"
name="陪访类型" name="陪访类型"
v-validate="'required'" v-validate="'required'"
:isDisabled="isAcTypeDisabled"
/> />
<PopupSelector v-model="visitDate" label="日期" placeholder="请选择" readonly required name="日期" v-validate="'required'"> <PopupSelector v-model="visitDate" label="日期" placeholder="请选择" readonly required name="日期" v-validate="'required'">
<template v-slot:default="{ closePopup }"> <template v-slot:default="{ closePopup }">
@@ -98,6 +99,7 @@ export default {
visitAreaName: '', visitAreaName: '',
visitAddress: '', visitAddress: '',
visitType: '', visitType: '',
isAcTypeDisabled: false,
visitTypes: ['入职前陪访', '新人首单', '冲刺挑战', '参与衔训'], visitTypes: ['入职前陪访', '新人首单', '冲刺挑战', '参与衔训'],
visitDate: '', visitDate: '',
visitDuration: '', visitDuration: '',
@@ -150,9 +152,21 @@ export default {
this.init() this.init()
}, },
async init() { async init() {
this.setLeftBtn() let acType = this.$route.query.accompanyType
// 拦截右上角按钮 if (acType) {
this.setRightBtn() this.$CacheUtils.setLocItem('accompanyType', acType)
} else if (!this.$route.query.edit) {
this.$CacheUtils.removeLocItem('accompanyType')
}
acType = this.$CacheUtils.getLocItem('accompanyType')
if (acType) {
this.isAcTypeDisabled = true
this.visitType = this.visitTypes[Number(acType) - 1]
}
// this.setLeftBtn()
// // 拦截右上角按钮
// this.setRightBtn()
// 获取代理人信息 // 获取代理人信息
await this.setAgentInfo({}) await this.setAgentInfo({})
// 新增陪访记录时清空缓存数据, 编辑时从缓存取出数据回显 // 新增陪访记录时清空缓存数据, 编辑时从缓存取出数据回显