|
|
@@ -130,6 +130,8 @@ import setting from '@/setting.js'
|
|
|
import ChangePassword from '@/views/platform/org/employee/change-password'
|
|
|
import UserInfo from '@/views/platform/org/employee/edit'
|
|
|
import request from '@/utils/request'
|
|
|
+import { getUserInfo } from '@/api/oauth2/user'
|
|
|
+
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -149,6 +151,7 @@ export default {
|
|
|
locationName,
|
|
|
roleName,
|
|
|
positions: userInfo.positions || [],
|
|
|
+ users: userInfo.user || [],
|
|
|
mainPosition,
|
|
|
tenants: this.$store.getters.tenants,
|
|
|
tenantid: this.$store.getters.tenantid,
|
|
|
@@ -256,14 +259,37 @@ export default {
|
|
|
this.$router.replace('/tenantSelect')
|
|
|
},
|
|
|
handleMainChange (item) {
|
|
|
- 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)
|
|
|
+ console.log(this.positions,this.users.account)
|
|
|
+ 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)
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
setMainPosition (mid) {
|
|
|
let sql = `select * from ibps_party_rel where biz_ = 'mainPost' and SUB_PID_ = '${this.userId}'`
|