|
@@ -166,7 +166,7 @@ import ChangePassword from '@/views/platform/org/employee/change-password'
|
|
|
import UserInfo from '@/views/platform/org/employee/edit'
|
|
import UserInfo from '@/views/platform/org/employee/edit'
|
|
|
import request from '@/utils/request'
|
|
import request from '@/utils/request'
|
|
|
import { getUserInfo } from '@/api/oauth2/user'
|
|
import { getUserInfo } from '@/api/oauth2/user'
|
|
|
-
|
|
|
|
|
|
|
+import storage from '@/utils/storage'
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
ChangePassword,
|
|
ChangePassword,
|
|
@@ -305,38 +305,50 @@ export default {
|
|
|
this.$router.replace('/tenantSelect')
|
|
this.$router.replace('/tenantSelect')
|
|
|
},
|
|
},
|
|
|
handleMainChange(item) {
|
|
handleMainChange(item) {
|
|
|
- getUserInfo(this.users.account).then(async (response) => {
|
|
|
|
|
- if (!response) {
|
|
|
|
|
- reject(response)
|
|
|
|
|
- }
|
|
|
|
|
- const info = response.data
|
|
|
|
|
- info.positions.sort((a, b) => a.id - b.id)
|
|
|
|
|
- this.positions.sort((a, b) => a.id - b.id)
|
|
|
|
|
- if (info.positions.length !== this.positions.length) {
|
|
|
|
|
- this.$message.warning('部门信息更新,请在刷新后重新选择!')
|
|
|
|
|
- location.reload()
|
|
|
|
|
- return
|
|
|
|
|
- } else {
|
|
|
|
|
- info.positions.forEach((element, i) => {
|
|
|
|
|
- if (
|
|
|
|
|
- element.id !== this.positions[i].id ||
|
|
|
|
|
- element.isMainPost !== this.positions[i].isMainPost
|
|
|
|
|
- ) {
|
|
|
|
|
- this.$message.warning('部门信息更新,请在刷新后重新选择!')
|
|
|
|
|
- location.reload()
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- if (this.$utils.isEmpty(this.mainPosition)) {
|
|
|
|
|
- this.setMainPosition(item.id)
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (this.mainPosition && this.mainPosition.id === item.id) {
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- this.updateMainPosition(this.mainPosition.id, item.id)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if (!this.users.account) {
|
|
|
|
|
+ this.$message.warning(
|
|
|
|
|
+ `没有获取到用户名, 请开发人员排查!store:${
|
|
|
|
|
+ this.$store.getters?.userInfo?.user?.account
|
|
|
|
|
+ },storage:${storage.getItem('username')}`
|
|
|
|
|
+ )
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ getUserInfo(this.users.account)
|
|
|
|
|
+ .then(async (response) => {
|
|
|
|
|
+ if (!response) {
|
|
|
|
|
+ reject(response)
|
|
|
|
|
+ }
|
|
|
|
|
+ const info = response.data
|
|
|
|
|
+ info.positions.sort((a, b) => a.id - b.id)
|
|
|
|
|
+ this.positions.sort((a, b) => a.id - b.id)
|
|
|
|
|
+ if (info.positions.length !== this.positions.length) {
|
|
|
|
|
+ this.$message.warning('部门信息更新,请在刷新后重新选择!')
|
|
|
|
|
+ location.reload()
|
|
|
|
|
+ return
|
|
|
|
|
+ } else {
|
|
|
|
|
+ info.positions.forEach((element, i) => {
|
|
|
|
|
+ if (
|
|
|
|
|
+ element.id !== this.positions[i].id ||
|
|
|
|
|
+ element.isMainPost !== this.positions[i].isMainPost
|
|
|
|
|
+ ) {
|
|
|
|
|
+ this.$message.warning('部门信息更新,请在刷新后重新选择!')
|
|
|
|
|
+ location.reload()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.$utils.isEmpty(this.mainPosition)) {
|
|
|
|
|
+ this.setMainPosition(item.id)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.mainPosition && this.mainPosition.id === item.id) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.updateMainPosition(this.mainPosition.id, item.id)
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((error) => {
|
|
|
|
|
+ this.logout({ vm: this, confirm: false })
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
handleMainDutyChange(item) {
|
|
handleMainDutyChange(item) {
|
|
|
getUserInfo(this.users.account).then(async (response) => {
|
|
getUserInfo(this.users.account).then(async (response) => {
|