Commit 49f71edf by wangchunyang
parents 74f4fe3d 7b94a2b4
......@@ -370,3 +370,11 @@ export const getVisitRecordDetail = (param) => {
data: param
})
}
// 获取回访按钮权限
export const getVisitButtonPower = (param) => {
return axios.request({
url: '/api/ac/jilinsscgsdp/keyPersonRating/getVisitButtonPower',
method: 'post',
data: param
})
}
......@@ -63,7 +63,7 @@
<span>{{ renderVisitStatus(row.visit_status) }}</span>
</template>
<template slot="action" slot-scope="{ row }">
<Button size="small" type="primary" style="margin-right: 10px" @click="openVisitModal(row)">回访</Button>
<Button v-if="canShowVisitButton(row)" size="small" type="primary" style="margin-right: 10px" @click="openVisitModal(row)">回访</Button>
<Button size="small" @click="openHistoryModal(row)">回访历史</Button>
</template>
</Table>
......@@ -151,7 +151,8 @@ import {
findVisitRecordList,
getPersonInfoForVisit,
saveVisitRecord,
selectCurrentUserInfo
selectCurrentUserInfo,
getVisitButtonPower
} from '@/api/key-person'
import VisitHistoryModal from './components/VisitHistoryModal.vue'
......@@ -244,7 +245,9 @@ export default {
},
currentRatingDictType: '',
uploadAction: '/api/uc/mzsc/uploadService/uploadPic',
uploadHeaders: {}
uploadHeaders: {},
visitButtonPower: {},
severUserInfo: {}
}
},
created () {
......@@ -253,12 +256,15 @@ export default {
if (routeQuery.visit_status) {
this.filters.visit_status = routeQuery.visit_status
}
// 获取用户信息
this.severUserInfo = this.$store.state.user.otherUserInfo || {}
this.init()
},
methods: {
async init () {
await this.loadCityOptions()
await this.loadDicts()
await this.fetchVisitButtonPower()
this.loadList()
},
async loadCityOptions () {
......@@ -366,6 +372,33 @@ export default {
path: '/keyPerson/statistics'
})
},
async fetchVisitButtonPower () {
const payload = {}
try {
const ret = await getVisitButtonPower(payload)
if (ret && ret.data && ret.data.errcode === 0) {
this.visitButtonPower = ret.data.data || {}
} else {
this.visitButtonPower = {}
}
} catch (e) {
console.error('获取回访按钮权限失败', e)
this.visitButtonPower = {}
}
},
canShowVisitButton (row) {
const isAdmin = (this.severUserInfo.loginName === 'admin')
const power = this.visitButtonPower || {}
// 优先使用 sys_type,如果没有则使用 rating_dict_type 或 category
const type = String(row.sys_type || row.rating_dict_type || this.category || '')
if (isAdmin) return true
if (type === '2') return !!power['rucs_visit']
if (type === '3') return !!power['psmd_visit']
if (type === '6') return !!power['km_visit']
return false
},
async loadList () {
this.loading = true
try {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论