| | |
| | | <el-form-item class="optionItem add" label="添加人员:"> |
| | | <ul class="addPerson"> |
| | | <li |
| | | v-for="(item, index) in cehckedList" |
| | | v-for="(item, index) in checkedList" |
| | | :key="index" |
| | | @click="setLeader(index)" |
| | | > |
| | |
| | | <i |
| | | :class="[ |
| | | 'el-icon-user-solid', |
| | | item.checked ? 'leader' : '', |
| | | item.leader ? 'leader' : '', |
| | | ]" |
| | | ></i> |
| | | </div> |
| | | <label |
| | | style="font-size: 12px" |
| | | :class="[item.checked ? 'leader' : '']" |
| | | :class="[item.leader ? 'leader' : '']" |
| | | >{{ item.username }}</label |
| | | > |
| | | </div> |
| | |
| | | :label="user.id" |
| | | :key="user.id" |
| | | > |
| | | {{ user.username }} |
| | | {{ user.username}} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | </div> |
| | |
| | | </el-card> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <label style="color:#ff0000ab">红色代表部门领导,点击头像可设置部门领导</label> |
| | | <el-form-item style="margin-top: -40px"> |
| | | <label style="color: #ff0000ab" |
| | | >红色代表部门领导,点击头像可设置部门领导</label |
| | | > |
| | | </el-form-item> |
| | | <!-- 部门描述 --> |
| | | <el-form-item class="optionItem" label="部门描述:" prop="departDes"> |
| | |
| | | userList: [], |
| | | departList: [], |
| | | checkedUser: [], |
| | | cehckedList: [], |
| | | checkedList: [], |
| | | openUser: false, |
| | | departTypeList: [], |
| | | selectOrg: { |
| | |
| | | handleUser() { |
| | | this.$refs.user.validate((valid) => { |
| | | if (valid) { |
| | | const { depart, cehckedList, selectOrg } = this; |
| | | const { depart, checkedList, selectOrg } = this; |
| | | const arr = []; |
| | | cehckedList.forEach((item) => { |
| | | arr.push({ isLeader: item.isLeader, userId: item.id }); |
| | | checkedList.forEach((item) => { |
| | | arr.push({ leader: item.leader, userId: item.id }); |
| | | }); |
| | | console.log(arr); |
| | | this.$axios({ |
| | |
| | | method: "get", |
| | | url: "sccg/depart/tree", |
| | | }).then((res) => { |
| | | console.log(res); |
| | | res.data.unshift({ id: 0, departName: "顶级菜单" }); |
| | | // console.log(res); |
| | | // res.data.unshift({ id: 0, departName: "顶级菜单" }); |
| | | this.departList = res.data; |
| | | }); |
| | | }, |
| | | // 获取所有用户信息 |
| | | getUserList() { |
| | | // 获取所有用户信息、用户查询(暂时支持电话号码) |
| | | this.$axios.get(`sccg/admin/list`).then((res) => { |
| | | this.$axios.get(`/sccg/depart/query_surplus_user`).then((res) => { |
| | | if (res.code === 200) { |
| | | this.userList = res.data.records; |
| | | this.userList = res.data; |
| | | } |
| | | }); |
| | | }, |
| | | addUser() { |
| | | console.log(this.checkedUser); |
| | | console.log(this.userList); |
| | | this.cehckedList = []; |
| | | this.checkedList = []; |
| | | this.userList.forEach((item) => { |
| | | this.checkedUser.forEach((child) => { |
| | | if (item.id == child) { |
| | | this.cehckedList.push({ |
| | | this.checkedList.push({ |
| | | id: item.id, |
| | | username: item.username, |
| | | isLeader: 0, |
| | | checked: false, |
| | | leader: false, |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | this.cehckedList[0].isLeader = 1; |
| | | this.cehckedList[0].checked = true; |
| | | this.checkedList[0].leader = true; |
| | | this.openUser = false; |
| | | }, |
| | | handleClose() { |
| | |
| | | }, |
| | | // 设置领导 |
| | | setLeader(idx) { |
| | | this.cehckedList.forEach((item, index) => { |
| | | if (index === idx) { |
| | | item.checked = true; |
| | | item.isLeader = 1; |
| | | } else { |
| | | item.checked = false; |
| | | item.isLeader = 0; |
| | | } |
| | | this.checkedList.forEach((item, index) => { |
| | | item.leader = index === idx; |
| | | }); |
| | | }, |
| | | }, |
| | |
| | | right: 0; |
| | | |
| | | .box-card { |
| | | max-height: 200px; |
| | | min-height: 240px; |
| | | max-height: 260px; |
| | | overflow: hidden; |
| | | background-color: #09152f; |
| | | position: relative; |
| | |
| | | |
| | | .scrollWrap { |
| | | overflow: scroll; |
| | | height: 160px; |
| | | height: 180px; |
| | | position: relative; |
| | | color: #4b9bb7; |
| | | |
| | |
| | | top: 77px; |
| | | right: 20px; |
| | | width: 20px; |
| | | height: 160px; |
| | | height: 180px; |
| | | background-color: #09152f; |
| | | } |
| | | |