| | |
| | | </div> |
| | | <div class="addUser"> |
| | | <el-button class="addBtn" type="primary" @click="dialogCreate = true" |
| | | >新增部门</el-button |
| | | >新增部门 |
| | | </el-button |
| | | > |
| | | <el-dialog |
| | | :visible.sync="dialogCreate" |
| | |
| | | <div class="funs"> |
| | | <div class="funsItem funs-sp"> |
| | | <el-checkbox v-model="all" @change="selectAll()" |
| | | >全选</el-checkbox |
| | | >全选 |
| | | </el-checkbox |
| | | > |
| | | </div> |
| | | <div class="funsItem funs-sp"> |
| | | <el-checkbox v-model="unsame" @change="disSame(tableData)" |
| | | >反选</el-checkbox |
| | | >反选 |
| | | </el-checkbox |
| | | > |
| | | </div> |
| | | <div class="funsItem"> |
| | |
| | | <script> |
| | | import createUser from "./createUser"; |
| | | import updateUser from "./updateUser"; |
| | | |
| | | export default { |
| | | components: { |
| | | createUser, |
| | |
| | | selectChange(list) { |
| | | console.log(this.tempList); |
| | | if (this.tempList.length !== 0) { |
| | | if (list === 1) { |
| | | this.preMyIdx = list; |
| | | this.mulPut(this.tempList, list); |
| | | } |
| | | if (list === 2) { |
| | | this.preMyIdx = list; |
| | | this.mulPut(this.tempList); |
| | | } |
| | | if (list === 3) { |
| | | this.preMyIdx = list; |
| | | this.mulDelete(this.tempList); |
| | | this.mulDelete(this.tempList, list); |
| | | } |
| | | } else { |
| | | this.myIdx = this.preMyIdx; |
| | |
| | | message: "您还没选中任何数据", |
| | | }); |
| | | } |
| | | }, |
| | | mulPut(idArr, option) { |
| | | const status = option === 1 ? 1 : 0 |
| | | const tag = option === 1 ? "启用" : "禁用" |
| | | let list = JSON.parse(JSON.stringify(this.tableData)) |
| | | list = list.filter(x => idArr.indexOf(x.id) > -1) |
| | | list.forEach(x => x.status = status) |
| | | console.log(list) |
| | | this.$confirm(`您确定要批量${tag}部门吗?`) |
| | | .then((_) => { |
| | | this.$axios({ |
| | | method: "PUT", |
| | | url: "sccg/depart/batch_status", |
| | | data: list |
| | | }).then(res => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | | this.$message({ |
| | | type: "success", |
| | | message: `批量${tag}部门成功` |
| | | }) |
| | | this.getUserList() |
| | | } else { |
| | | this.$message({ |
| | | type: "error", |
| | | message: res.message, |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | // 多条数据删除 |
| | | mulDelete(idArr) { |
| | |
| | | this.getUserList(); |
| | | }); |
| | | }) |
| | | .catch((_) => {}); |
| | | .catch((_) => { |
| | | }); |
| | | }, |
| | | // 修改状态 |
| | | handleChangeStatus(obj) { |
| | |
| | | this.dialogCreate = false; |
| | | done(); |
| | | }) |
| | | .catch((_) => {}); |
| | | .catch((_) => { |
| | | }); |
| | | } else { |
| | | done(); |
| | | } |
| | |
| | | .then((_) => { |
| | | done(); |
| | | }) |
| | | .catch((_) => {}); |
| | | .catch((_) => { |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 0 20px; |
| | | |
| | | .funs-sp { |
| | | border: 1px solid #17324c; |
| | | } |
| | | |
| | | .funs { |
| | | display: flex; |
| | | |
| | |
| | | .el-table { |
| | | color: #4b9bb7; |
| | | font-size: 10px; |
| | | |
| | | .operation { |
| | | display: flex; |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // &::v-deep .switchStyle .el-switch__label { |
| | | // position: absolute; |
| | | // display: none; |