| | |
| | | <div class="user-top"> |
| | | <div class="right-bottom"> |
| | | <el-button type="primary" @click="addPerson">新建</el-button> |
| | | <el-button type="primary" @click="addPerson">密码重置</el-button> |
| | | <el-button type="danger" plain @click="delPerson">删除</el-button> |
| | | <el-button type="primary" @click="resetPerson">密码重置</el-button> |
| | | <el-button type="danger" plain @click="delData">删除</el-button> |
| | | </div> |
| | | <div> |
| | | <el-input v-model="searchData.account" placeholder="账号" style="width: 180px;margin-right: 8px;" clearable></el-input> |
| | |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog v-model="dialogVisible" width="500" :before-close="handleClose"> |
| | | <span>确定将选择账号解锁?</span> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="dialogVisible = false">确定</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <save-dialog v-if="dialog.save" ref="saveDialog" @success="addUserSuccess" @closed="dialog.save=false"></save-dialog> |
| | | </template> |
| | | <script> |
| | |
| | | name: "bakalaka", |
| | | data(){ |
| | | return { |
| | | selection: [], |
| | | searchData: { |
| | | account: "", |
| | | realName: "", |
| | |
| | | size: "15" |
| | | }, |
| | | total: 0, |
| | | dialogVisible: false, |
| | | isSaveing: false, |
| | | groups: [], |
| | | departmentFrom: { |
| | |
| | | //取消 |
| | | }) |
| | | }, |
| | | table_unlock() { |
| | | this.dialogVisible = true; |
| | | table_unlock(row) { |
| | | this.$confirm('确定将选择账号解锁??','提示', { |
| | | type: 'warning', |
| | | }).then(() => { |
| | | this.$HTTP.post("/api/blade-user/unlock?userId="+row.id).then(res=> { |
| | | if(res.code == 200) { |
| | | this.searchclick(); |
| | | this.$message.success("操作成功"); |
| | | }else { |
| | | this.$alert(res.message, "提示", {type: 'error'}); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | //取消 |
| | | }) |
| | | }, |
| | | searchclick() { |
| | | this.searchData.current = "1"; |
| | |
| | | this.$refs.saveDialog.open('show').setData(row) |
| | | }) |
| | | }, |
| | | handleSelectionChange() {}, |
| | | delPerson() {}, |
| | | handleSelectionChange(selection) { |
| | | this.selection = selection; |
| | | }, |
| | | resetPerson() { |
| | | if(this.selection.length == 0) { |
| | | this.$message({ |
| | | message: '请选择至少一条数据', |
| | | type: 'warning' |
| | | }); |
| | | return; |
| | | } |
| | | var selStr = ""; |
| | | this.selection.map(item=> { |
| | | selStr += item.id + "," |
| | | }) |
| | | selStr = selStr.replace(/,$/, ''); |
| | | var that = this; |
| | | this.$confirm('是否确认删除选中账号?','提示', { |
| | | type: 'warning', |
| | | }).then(() => { |
| | | that.$HTTP.post("/api/blade-user/reset-password?userIds="+selStr).then(res=> { |
| | | if(res.code == 200) { |
| | | that.$message.success("操作成功"); |
| | | that.searchUser(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | //取消 |
| | | }) |
| | | }, |
| | | delData() { |
| | | if(this.selection.length == 0) { |
| | | this.$message({ |
| | | message: '请选择至少一条数据', |
| | | type: 'warning' |
| | | }); |
| | | return; |
| | | } |
| | | var selStr = ""; |
| | | this.selection.map(item=> { |
| | | selStr += item.id + "," |
| | | }) |
| | | selStr = selStr.replace(/,$/, ''); |
| | | var that = this; |
| | | this.$HTTP.get("/api/blade-user/check-user-is-bind-employee?userIds="+selStr).then(res=> { |
| | | if(res.code == 200) { |
| | | this.$confirm('是否确认删除选中账号?','提示', { |
| | | type: 'warning', |
| | | }).then(() => { |
| | | that.$HTTP.post("/api/blade-user/remove?ids="+selStr).then(res=> { |
| | | if(res.code == 200) { |
| | | that.$message.success("操作成功"); |
| | | that.searchUser(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | //取消 |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | changeDepartment() { |
| | | this.departmentVisible = true; |
| | | }, |