|
@@ -44,7 +44,7 @@
|
|
|
<script>
|
|
|
import { mapGetters } from 'vuex'
|
|
|
import { needIdList } from '@/router/needIdList'
|
|
|
-import { desDecryptId } from '@/utils/crypto-js.js'
|
|
|
+import { EncryptId, desDecryptId } from '@/utils/crypto-js.js'
|
|
|
// import Breadcrumb from '@/components/Breadcrumb' // 面包屑
|
|
|
// import Hamburger from '@/components/Hamburger' // 导航开关
|
|
|
import { logoutUrl } from '@/apiConfig/requestIP.js'
|
|
@@ -88,7 +88,7 @@ export default {
|
|
|
return
|
|
|
}// 如果参数中bizId和bizId_id都不存在,去获取默认bizId
|
|
|
const existBizId_id = needIdList.find(item => item === to.name)
|
|
|
- existBizId_id ? this.handerIdAndBizId() : this.handerBizId()
|
|
|
+ existBizId_id ? this.handlerIdAndBizId() : this.handlerBizId()
|
|
|
},
|
|
|
immediate: true
|
|
|
}
|
|
@@ -97,17 +97,41 @@ export default {
|
|
|
this.getLoginMember()
|
|
|
},
|
|
|
methods: {
|
|
|
- handerBizId() { // 只处理bizId
|
|
|
+ handlerBizId() { // 只处理bizId
|
|
|
const bizId = Number(desDecryptId(this.$route.query.bizId))
|
|
|
- const isExistBizId = this.sumTypeArray.find(item => bizId === item.code)
|
|
|
+ const isExistBizId = this.sumTypeArray.find(item => bizId === item.code)// 业务线id是否存在
|
|
|
isExistBizId ? this.$store.dispatch('data/setBizId', bizId) : this.settingUserGetBiz()
|
|
|
},
|
|
|
- handerIdAndBizId() { // 处理bizId和id
|
|
|
+ handlerIdAndBizId() { // 处理bizId和id
|
|
|
const bizId_id = this.$route.query.bizId_id
|
|
|
const arr = Number(desDecryptId(bizId_id)).split('_')
|
|
|
- const isExistBizId = this.sumTypeArray.find(item => arr[0] === item.code)
|
|
|
+ const isExistBizId = this.sumTypeArray.find(item => arr[0] === item.code)// 业务线id是否存在
|
|
|
isExistBizId ? this.$store.dispatch('data/setBizId', arr[0]) : this.settingUserGetBiz()
|
|
|
},
|
|
|
+ async settingGetBizList() { // 获取业务线列表
|
|
|
+ const res = await settingGetBizList({})
|
|
|
+ this.sumTypeArray = res.data || []
|
|
|
+ },
|
|
|
+ async settingUserGetBiz() { // 获取人员默认业务线
|
|
|
+ const res = await settingUserGetBiz()
|
|
|
+ const nowBiz = this.sumTypeArray.find(item => res.data.bizId === item.code)
|
|
|
+ if (nowBiz) {
|
|
|
+ this.sumType = nowBiz.name
|
|
|
+ this.$store.dispatch('data/setBizId', nowBiz.code)
|
|
|
+ const existBizId_id = needIdList.find(item => item === this.$route.name)
|
|
|
+ if (!existBizId_id) {
|
|
|
+ this.$router.push({
|
|
|
+ path: this.$route.path,
|
|
|
+ query: {
|
|
|
+ ...this.$route.query,
|
|
|
+ bizId: EncryptId(nowBiz.code)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log('重定向到业务线选择页面')
|
|
|
+ }
|
|
|
+ },
|
|
|
async remoteMethod(query) {
|
|
|
if (query !== '') {
|
|
|
const res = await settingGetBizList({ bizName: query })
|
|
@@ -133,22 +157,6 @@ export default {
|
|
|
window.location.reload()
|
|
|
}
|
|
|
},
|
|
|
- async settingGetBizList() { // 获取业务线列表
|
|
|
- const res = await settingGetBizList({})
|
|
|
- this.sumTypeArray = res.data || []
|
|
|
- },
|
|
|
- async settingUserGetBiz() { // 获取人员默认业务线
|
|
|
- const res = await settingUserGetBiz()
|
|
|
- if (res.data) {
|
|
|
- const nowBiz = this.sumTypeArray.find(item => res.data.bizId === item.code)
|
|
|
- if (nowBiz) {
|
|
|
- this.sumType = nowBiz.name
|
|
|
- this.$store.dispatch('data/setBizId', nowBiz.code)
|
|
|
- } else {
|
|
|
- console.log('重定向到业务线选择页面')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
async getLoginMember() { // 获取登录人员信息
|
|
|
const res = await memberGetLoginInMemberInfoByLdap()
|
|
|
this.options = res.data
|