| | |
| | | <el-table-column prop="mobile" label="联系方式" min-width="7"> |
| | | </el-table-column> |
| | | <el-table-column prop="note" label="所属角色" min-width="8"> |
| | | <template slot-scope="scope"> |
| | | <span>{{filterRole(scope.row.roles)}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="departName" label="所属部门" min-width="8"> |
| | | </el-table-column> |
| | |
| | | if (list === 3) { |
| | | await this.mulDelte(this.tempList); |
| | | } else if (list === 2) { |
| | | await this.mulUpdateStatus(this.tempList,0); |
| | | await this.mulUpdateStatus(this.tempList, 0); |
| | | } else { |
| | | await this.mulUpdateStatus(this.tempList,1); |
| | | await this.mulUpdateStatus(this.tempList, 1); |
| | | } |
| | | this.myIdx = 0; |
| | | } else { |
| | |
| | | .catch(err => { console.log(err) }) |
| | | }, |
| | | // 批量修改账号 |
| | | mulUpdateStatus(idArr,flag) { |
| | | mulUpdateStatus(idArr, flag) { |
| | | console.log(flag); |
| | | this.$confirm( flag === 1 ? "您确定要进行批量启用用户吗?" :'您确定要进行批量禁用用户吗?' ) |
| | | this.$confirm(flag === 1 ? "您确定要进行批量启用用户吗?" : '您确定要进行批量禁用用户吗?') |
| | | .then(_ => { |
| | | this.$axios({ |
| | | method: 'post', |
| | | url: 'sccg/admin/updateStatusBatch?ids=' + idArr + '&status='+flag, |
| | | url: 'sccg/admin/updateStatusBatch?ids=' + idArr + '&status=' + flag, |
| | | }) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | |
| | | }, |
| | | selectAll() { |
| | | this.$refs.multipleTable.toggleAllSelection(); |
| | | |
| | | }, |
| | | disSame(list) { |
| | | // console.log(this.$refs.multipleTable); |
| | | // const row = this.$refs.table.data |
| | | list.forEach(row => { |
| | | this.$refs.multipleTable.toggleRowSelection(row) |
| | | }) |
| | |
| | | this.getUserList(); |
| | | }, |
| | | handleClose(done) { |
| | | this.$confirm('确认关闭?') |
| | | .then(_ => { |
| | | this.dialogUpdate = false |
| | | done(); |
| | | }) |
| | | .catch(_ => { }); |
| | | if (this.updateFlag) { |
| | | this.$confirm('确认关闭?') |
| | | .then(_ => { |
| | | this.dialogUpdate = false; |
| | | this.updateFlag = false; |
| | | done(); |
| | | }) |
| | | .catch(_ => { }); |
| | | }else{ |
| | | done(); |
| | | } |
| | | }, |
| | | // 当前页改变触发事件 |
| | | changeCurrentPage(page) { |
| | |
| | | this.$axios.get(`sccg/admin/list?keyword=${search}¤t=${currentPage}&pageSize=${pageSize}`).then(res => { |
| | | if (res.code === 200) { |
| | | res.data.records.forEach(item => { |
| | | // item.createTime = helper(item.createTime); |
| | | item.status == 1 ? item.status = true : item.status = false; |
| | | }) |
| | | that.totalNum = res.data.pages * pageSize; |
| | | that.totalNum = res.data.total; |
| | | that.tableData = res.data.records; |
| | | this.renderFlag = true; |
| | | } |
| | |
| | | } |
| | | return ''; |
| | | }, |
| | | // 处理用户所属角色 |
| | | filterRole(arr){ |
| | | let str = ''; |
| | | if(arr.length === 0){ |
| | | return; |
| | | } |
| | | arr.forEach((item,index)=>{ |
| | | if(item!==null){ |
| | | if(index<arr.length-1){ |
| | | str+=item.name +','; |
| | | }else{ |
| | | str+=item.name; |
| | | } |
| | | } |
| | | }) |
| | | return str; |
| | | } |
| | | }, |
| | | props: ['refresh', 'keyword', 'resetFresh'], |
| | | watch: { |