| | |
| | | this.getUserList(); |
| | | }, |
| | | methods: { |
| | | selectChange(list) { |
| | | async selectChange(list) { |
| | | console.log(this.tempList); |
| | | if (this.tempList.length !== 0) { |
| | | this.preMyIdx = list; |
| | | if (list === 3) { |
| | | this.preMyIdx = list; |
| | | this.handleDelete(this.tempList); |
| | | await this.handleDelete(this.tempList); |
| | | } else if (list === 2) { |
| | | await this.mulUpdateStatus(this.tempList, 0); |
| | | } else { |
| | | await this.mulUpdateStatus(this.tempList, 1); |
| | | } |
| | | this.myIdx = 0; |
| | | } else { |
| | | this.myIdx = this.preMyIdx; |
| | | this.$message({ |
| | |
| | | message: '您还没选中任何数据', |
| | | }) |
| | | } |
| | | }, |
| | | mulUpdateStatus(idArr, flag) { |
| | | this.$confirm(flag === 1 ? "您确定要进行批量启用角色吗?" : '您确定要进行批量禁用角色吗?') |
| | | .then(_ => { |
| | | this.$axios({ |
| | | method: 'post', |
| | | url: 'sccg/role/updateStatusBatch?ids=' + idArr + '&status=' + flag, |
| | | }) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '更改用户状态成功', |
| | | }) |
| | | this.getUserList(); |
| | | } else { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: res.message |
| | | }) |
| | | } |
| | | console.log(res); |
| | | }) |
| | | }) |
| | | .catch(err => { console.log(err) }) |
| | | }, |
| | | tableChange(list) { |
| | | this.tempList = []; |
| | |
| | | }, |
| | | changeDialog(val) { |
| | | this.dialogUpdate = val.dialogUpdate; |
| | | this.$message({ |
| | | type:'success', |
| | | message:'更改成功', |
| | | }) |
| | | }, |
| | | handleClose(done) { |
| | | this.$confirm('确认关闭?') |