Commit 82c1223e authored by 张伯涛's avatar 张伯涛

修改

parent a2b1392e
......@@ -725,6 +725,7 @@ export default {
optionsList: [],
// 子部门信息
deptChildren: [],
apiRoleIds: [], // 接口返回的角色
// 表单参数
form: {
deptId: '',
......@@ -1065,6 +1066,7 @@ export default {
getUser(userId).then(response => {
this.open = true
this.form = response.data
this.apiRoleIds = response.data.roleIds
if (this.form.nltStartDate) {
this.form.nltStartDate = this.form.nltStartDate.substring(0, 10)
}
......@@ -1074,7 +1076,7 @@ export default {
const list = response.data.roleIds.split(',').map(num => { return Number(num) }) // 接口返回的用户角色详情
this.optionsList = this.roleOptions.map(item => item.businessId) // 当前启用角色[]
const allList = this.allRoleOptions.map(item => item.businessId) // 所有角色[]包括停用的
this.stopUseList = allList.filter(item => {
this.stopUseList = allList.filter(item => { // 当前停用的角色
if (this.optionsList.includes(item)) {
return false
} else {
......@@ -1139,14 +1141,16 @@ export default {
this.confirmLoading = true
if (this.form.businessId !== undefined) {
console.log('form', this.form.roleList)
this.form.roleList.forEach(item => {
if (this.optionsList.includes(item)) {
console.log('1')
} else {
this.stopFlag = true
}
})
console.log('this.stopFlag',this.stopFlag)
if (this.apiRoleIds) {
this.form.roleList.forEach(item => {
if (this.optionsList.includes(item)) {
console.log('1')
} else {
this.stopFlag = true // 当前角色里有非启用的角色
}
})
}
console.log('this.stopFlag', this.stopFlag)
if (this.stopFlag === true) {
this.confirmLoading = false
this.$message({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment