|
@@ -132,7 +132,6 @@ 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'
|
|
|
|
|
|
|
|
-
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
ChangePassword,
|
|
ChangePassword,
|
|
@@ -259,7 +258,6 @@ export default {
|
|
|
this.$router.replace('/tenantSelect')
|
|
this.$router.replace('/tenantSelect')
|
|
|
},
|
|
},
|
|
|
handleMainChange (item) {
|
|
handleMainChange (item) {
|
|
|
- console.log(this.positions,this.users.account)
|
|
|
|
|
getUserInfo(this.users.account).then(async response => {
|
|
getUserInfo(this.users.account).then(async response => {
|
|
|
if (!response) {
|
|
if (!response) {
|
|
|
reject(response)
|
|
reject(response)
|
|
@@ -267,18 +265,18 @@ export default {
|
|
|
const info = response.data
|
|
const info = response.data
|
|
|
info.positions.sort((a, b) => a.id - b.id)
|
|
info.positions.sort((a, b) => a.id - b.id)
|
|
|
this.positions.sort((a, b) => a.id - b.id)
|
|
this.positions.sort((a, b) => a.id - b.id)
|
|
|
- if(info.positions.length!==this.positions.length){
|
|
|
|
|
|
|
+ if (info.positions.length !== this.positions.length) {
|
|
|
this.$message.warning('部门信息更新,请在刷新后重新选择!')
|
|
this.$message.warning('部门信息更新,请在刷新后重新选择!')
|
|
|
location.reload()
|
|
location.reload()
|
|
|
return
|
|
return
|
|
|
- }else{
|
|
|
|
|
- info.positions.forEach((element,i) => {
|
|
|
|
|
- if(element.id!==this.positions[i].id || element.isMainPost!==this.positions[i].isMainPost){
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ info.positions.forEach((element, i) => {
|
|
|
|
|
+ if (element.id !== this.positions[i].id || element.isMainPost !== this.positions[i].isMainPost) {
|
|
|
this.$message.warning('部门信息更新,请在刷新后重新选择!')
|
|
this.$message.warning('部门信息更新,请在刷新后重新选择!')
|
|
|
location.reload()
|
|
location.reload()
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
if (this.$utils.isEmpty(this.mainPosition)) {
|
|
if (this.$utils.isEmpty(this.mainPosition)) {
|
|
|
this.setMainPosition(item.id)
|
|
this.setMainPosition(item.id)
|
|
@@ -289,12 +287,11 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.updateMainPosition(this.mainPosition.id, item.id)
|
|
this.updateMainPosition(this.mainPosition.id, item.id)
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
setMainPosition (mid) {
|
|
setMainPosition (mid) {
|
|
|
- let sql = `select * from ibps_party_rel where biz_ = 'mainPost' and SUB_PID_ = '${this.userId}'`
|
|
|
|
|
- this.$common.request('sql', sql).then((r)=>{
|
|
|
|
|
- if(r.variables.data.length===0){
|
|
|
|
|
|
|
+ const sql = `select * from ibps_party_rel where biz_ = 'mainPost' and SUB_PID_ = '${this.userId}'`
|
|
|
|
|
+ this.$common.request('sql', sql).then((r) => {
|
|
|
|
|
+ if (r.variables.data.length === 0) {
|
|
|
request({
|
|
request({
|
|
|
url: '/platform/v3/rel/save',
|
|
url: '/platform/v3/rel/save',
|
|
|
method: 'post',
|
|
method: 'post',
|
|
@@ -310,7 +307,7 @@ export default {
|
|
|
this.$message.success('设置主部门成功!')
|
|
this.$message.success('设置主部门成功!')
|
|
|
location.reload()
|
|
location.reload()
|
|
|
})
|
|
})
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
this.$message.warning('部门信息更新,请在刷新后重新选择!')
|
|
this.$message.warning('部门信息更新,请在刷新后重新选择!')
|
|
|
location.reload()
|
|
location.reload()
|
|
|
}
|
|
}
|