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

修改

parent a2b1392e
...@@ -725,6 +725,7 @@ export default { ...@@ -725,6 +725,7 @@ export default {
optionsList: [], optionsList: [],
// 子部门信息 // 子部门信息
deptChildren: [], deptChildren: [],
apiRoleIds: [], // 接口返回的角色
// 表单参数 // 表单参数
form: { form: {
deptId: '', deptId: '',
...@@ -1065,6 +1066,7 @@ export default { ...@@ -1065,6 +1066,7 @@ export default {
getUser(userId).then(response => { getUser(userId).then(response => {
this.open = true this.open = true
this.form = response.data this.form = response.data
this.apiRoleIds = response.data.roleIds
if (this.form.nltStartDate) { if (this.form.nltStartDate) {
this.form.nltStartDate = this.form.nltStartDate.substring(0, 10) this.form.nltStartDate = this.form.nltStartDate.substring(0, 10)
} }
...@@ -1074,7 +1076,7 @@ export default { ...@@ -1074,7 +1076,7 @@ export default {
const list = response.data.roleIds.split(',').map(num => { return Number(num) }) // 接口返回的用户角色详情 const list = response.data.roleIds.split(',').map(num => { return Number(num) }) // 接口返回的用户角色详情
this.optionsList = this.roleOptions.map(item => item.businessId) // 当前启用角色[] this.optionsList = this.roleOptions.map(item => item.businessId) // 当前启用角色[]
const allList = this.allRoleOptions.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)) { if (this.optionsList.includes(item)) {
return false return false
} else { } else {
...@@ -1139,14 +1141,16 @@ export default { ...@@ -1139,14 +1141,16 @@ export default {
this.confirmLoading = true this.confirmLoading = true
if (this.form.businessId !== undefined) { if (this.form.businessId !== undefined) {
console.log('form', this.form.roleList) console.log('form', this.form.roleList)
this.form.roleList.forEach(item => { if (this.apiRoleIds) {
if (this.optionsList.includes(item)) { this.form.roleList.forEach(item => {
console.log('1') if (this.optionsList.includes(item)) {
} else { console.log('1')
this.stopFlag = true } else {
} this.stopFlag = true // 当前角色里有非启用的角色
}) }
console.log('this.stopFlag',this.stopFlag) })
}
console.log('this.stopFlag', this.stopFlag)
if (this.stopFlag === true) { if (this.stopFlag === true) {
this.confirmLoading = false this.confirmLoading = false
this.$message({ 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