通过单击左侧的树获取员工列表,将选定的人员回显到已使用部分

原创
小哥 3年前 (2022-11-10) 阅读数 5 #大杂烩


        
{{item.realName}}
已选择
{{ item.realName }}
保 存 取 消
setReviewerVisible: false, //设置审阅者 对话框 setReviewerTitle: "", //设置审阅者标题 dynamicTags: [ //设置审阅者 选定人员显示 // { id: "1368812632591613954", realName: "张三" }, // { id: "1425622827346993153", realName: "李四" }, // { id: "1354306079344857089", realName: "王五" }, // { id: "1036465471609819137", realName: "小白" }, ], setUserstreeData: [], //设置审阅者 左侧的树 checkedUsers: [], //设置审阅者 选择右侧人员 checkboxUsers: [], //设置审阅者 右侧人员选择 filterText: "", //设置审阅者 左树组件 输入框筛选 checkboxFilterText: "", //设置审阅者 右侧输入框筛选 defaultProps: { children: "child", label: "name", }, getCurrentSelectedId: "", //设置审阅者 右侧当前选定的单位 // 设置审阅者 获取审阅者单位组织树。 getReViewOfficeTree(code) { let params = { code: code, }; //这是获取组织树的界面。 getReViewOfficeTree(params) .then((res) => { this.setUserstreeData = [res.data]; }) .catch((err) => {}); }, // 设置审阅者 左侧树 支持过滤 filterNode(value, data) { if (!value) return true; return data.name.indexOf(value) !== -1; }, //设置审阅者 左侧树 单击树的单位 获取所选单位。id setReviewerNodeClick(data) { console.log("kdsafkdsfn", data.id); this.getCurrentSelectedId = data.id; this.getCheckboxUsers(); }, // 设置审阅者 右输入框人员筛选器 inputCheckboxFilterText() { // params.name = this.checkboxFilterText; this.getCheckboxUsers(); }, // 设置审阅者 左侧选择树,右侧输入框筛选---获得最终候选人名单。 getCheckboxUsers() { let params = { id: this.getCurrentSelectedId, }; if (this.checkboxFilterText) { params.name = this.checkboxFilterText; } getComUsers(params) .then((res) => { this.checkboxUsers = res.data; }) .catch((err) => { console.log(""); }); }, // 设置审阅者 单击右侧多选框 checkboxChange(name, id, e) { console.log("checkboxChange单击右侧多选框2222", name, id, e); console.log("checkedUsers222", this.checkedUsers); if (e) { this.dynamicTags.push({ id: id, realName: name }); } else { const values = this.dynamicTags.map((item) => item.id); console.log("values.indexOf(id)", values.indexOf(id)); this.dynamicTags.splice(values.indexOf(id), 1); } }, // 设置审阅者 在右侧显示所选用户名,并支持删除。 handleClose(tag) { this.$confirm("确定要删除吗?", "删除", { confirmButtonText: "确认", cancelButtonText: "取消", }) .then(() => { console.log("tag6666666", tag); this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1); this.$message({type: "success", message: "删除成功",}); let values = JSON.parse(JSON.stringify( this.checkedUsers )); this.checkedUsers = values.filter((item) => item != tag.id); }) .catch(() => { this.$message({type: "info",message: "删除已取消",}); }); }, // 设置审阅者 呼叫查询界面 querySetReviewer(command) { this.dynamicTags = []; this.checkedUsers = []; this.getCurrentSelectedId = ""; this.checkboxUsers = []; let params = { taskId: this.ruleForm.taskId, }; //这只是进入页面 querySelectReportUsers(params) .then((res) => { console.log("res7777777", res.data); this.dynamicTags = res.data; this.checkedUsers = this.dynamicTags.map((item) => item.id); }) .catch((err) => {}); }, // 保存 设置审阅者 preserveSetReviewer(command) { if (command.substring(0, 2) == "初评") { this.projectReportUser("2"); } else { this.projectReportUser("3"); } }, // 保存 设置审阅者 呼叫保存界面 projectReportUser(val) { let ids = this.dynamicTags.map((item) => item.id); let params = { taskId: this.ruleForm.taskId, stage: val, ids: ids, }; if (ids.length == 0) { return this.$message.error("请添加审阅者"); } projectReportUser(params) .then((res) => { if (res.code == "200") { console.log("dsadsfdsfsda"); this.$message.success("设置成功" ); this.setReviewerVisible = false; this.clickQuery(); } else { this.$message.error(res.msg); } }) .catch((err) => { this.$message.error( "设置失败" ); }); }, // 取消 设置审阅者 cancelSetReviewer(command) { this.setReviewerVisible = false; },
版权声明

所有资源都来源于爬虫采集,如有侵权请联系我们,我们将立即删除