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

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: {
type: Boolean,
default: false
},
isDisabled: {
type: Boolean,
default: false
}
},
data() {
@@ -42,6 +46,7 @@ export default {
},
methods: {
showPopup() {
if (this.isDisabled) return
this.isShow = true
},
closePopup() {

View File

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