| | |
| | | callback(); |
| | | } |
| | | }; |
| | | const validateId = (rule, value, callback) => { |
| | | if (!value) { |
| | | callback(new Error("请填写部门id")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | const validatePass = (rule, value, callback) => { |
| | | if (!value) { |
| | | callback(); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | const validatePhone = (rule, value, callback) => { |
| | | if (!value) { |
| | | callback(); |
| | | } else { |
| | |
| | | departType: "", |
| | | }, |
| | | createUserRules: { |
| | | id: [{ required: true, trigger: "blur", validator: validateId }], |
| | | departName: [ |
| | | { required: true, trigger: "blur", validator: validateNickname }, |
| | | ], |
| | |
| | | this.user = JSON.parse(JSON.stringify(that.userInfo)); |
| | | console.log(this.user); |
| | | this.user.parentId = this.user.parentId === 0 ? '暂无上级部门' : this.user.parentId; |
| | | console.log(this.user.parentId); |
| | | this.checkedList = this.user.userInfoDTOS; |
| | | this.checkedList.forEach((e) => { |
| | | this.checkedUser.push(e.userId); |
| | | }); |
| | | console.log(this.checkedUser) |
| | | this.$axios({ |
| | | method: "get", |
| | | url: "sccg/depart/tree", |
| | | }).then((res) => { |
| | | that.departList = res.data; |
| | | }); |
| | | this.getUserList(); |
| | | this.getUserList(this.user.id); |
| | | // 获取部门类型 |
| | | this.getDepartType(); |
| | | }, |
| | |
| | | const { user, checkedList } = this; |
| | | const arr = []; |
| | | checkedList.forEach((item) => { |
| | | arr.push({ leader: item.leader, userId: item.userId }); |
| | | arr.push({ leader: item.leader, userId: item.id ? item.id : item.userId }); |
| | | }); |
| | | console.log(arr); |
| | | this.$axios |
| | | .post("sccg/depart/update", { |
| | | id: user.id, |
| | | departName: user.departName, |
| | | parentId: user.parentId, |
| | | departDes: user.departDes, |
| | | departManagerList: arr, |
| | | }) |
| | | .then((res) => { |
| | | this.$message({ |
| | | message: res.message, |
| | | type: res.code === 200 ? "success" : "warning", |
| | | // if (arr.length === 0) { |
| | | // this.$message({ |
| | | // type: 'warning', |
| | | // message: '请选择部门人员', |
| | | // }) |
| | | // } else { |
| | | this.$axios |
| | | .post("sccg/depart/update", { |
| | | id: user.id, |
| | | departName: user.departName, |
| | | parentId: user.parentId === '暂无上级部门' ? 0 : user.parentId, |
| | | departDes: user.departDes, |
| | | departManagerList: arr, |
| | | departType: user.departType |
| | | }) |
| | | .then((res) => { |
| | | this.$message({ |
| | | message: res.message, |
| | | type: res.code === 200 ? "success" : "warning", |
| | | }); |
| | | this.$emit("changeDialog", { flag: false }); |
| | | this.getDepartList(); |
| | | }); |
| | | this.$emit("changeDialog", { flag: false }); |
| | | this.getDepartList(); |
| | | }); |
| | | // } |
| | | } else { |
| | | return false; |
| | | } |
| | |
| | | }, |
| | | |
| | | // 获取所有用户信息 |
| | | getUserList() { |
| | | getUserList(id) { |
| | | // 获取所有用户信息、用户查询(暂时支持电话号码) |
| | | this.$axios.get(`sccg/admin/list`).then((res) => { |
| | | this.$axios.get(`/sccg/depart/query_surplus_exist_user?id=`+id).then((res) => { |
| | | if (res.code === 200) { |
| | | this.userList = res.data.records; |
| | | this.userList = res.data; |
| | | } |
| | | }); |
| | | }, |
| | |
| | | }); |
| | | }); |
| | | this.checkedList[0].leader = true; |
| | | console.log(this.checkedList); |
| | | this.openUser = false; |
| | | }, |
| | | }, |
| | |
| | | <style lang="scss" scoped> |
| | | .updateUser { |
| | | border-radius: 1px; |
| | | background-color: #09152f; |
| | | // background-color: #09152f; |
| | | |
| | | main { |
| | | // border: 1px solid #fff; |
| | | text-align: left; |
| | | padding: 0 55px; |
| | | background-color: #09152f; |
| | | // background-color: #09152f; |
| | | padding-bottom: 50px; |
| | | |
| | | // .mainTitle { |
| | |
| | | } |
| | | |
| | | .updateUser::v-deep .el-form-item__label { |
| | | color: #4b9bb7; |
| | | // color: #4b9bb7; |
| | | } |
| | | |
| | | .updateUser::v-deep .el-input__inner { |
| | | background-color: #09152f; |
| | | border: 1px solid #17324c; |
| | | // background-color: #09152f; |
| | | // border: 1px solid #17324c; |
| | | } |
| | | |
| | | .addPerson { |
| | |
| | | right: 0; |
| | | |
| | | .box-card { |
| | | max-height: 200px; |
| | | min-height: 240px; |
| | | max-height: 260px; |
| | | overflow: hidden; |
| | | background-color: #09152f; |
| | | // background-color: #09152f; |
| | | position: relative; |
| | | max-width: 220px; |
| | | |
| | | .scrollWrap { |
| | | overflow: scroll; |
| | | height: 160px; |
| | | height: 180px; |
| | | position: relative; |
| | | color: #4b9bb7; |
| | | |
| | |
| | | top: 77px; |
| | | right: 20px; |
| | | width: 20px; |
| | | height: 160px; |
| | | background-color: #09152f; |
| | | height: 180px; |
| | | // background-color: #09152f; |
| | | } |
| | | |
| | | .item { |