diff --git a/src/views/system/employee/index.vue b/src/views/system/employee/index.vue index fa26eff..343fbef 100644 --- a/src/views/system/employee/index.vue +++ b/src/views/system/employee/index.vue @@ -165,22 +165,16 @@ - - + + + + 全部数据 + 部门数据 + 个人数据 + + + + @@ -210,7 +204,7 @@ import editor from '@/components/Editor'; export default { name: 'Employee', components: { Treeselect, editor }, - data () { + data() { return { // 遮罩层 loading: true, @@ -292,11 +286,11 @@ export default { }, watch: { // 根据名称筛选部门树 - deptName (val) { + deptName(val) { this.$refs.tree.filter(val); } }, - created () { + created() { this.getList(); this.getDeptTree(); this._getRoleOptions(); @@ -328,7 +322,7 @@ export default { }, methods: { /** 查询用户列表 */ - getList () { + getList() { this.loading = true; empAPi.pageList(this.queryParams).then((response) => { this.userList = response.rows; @@ -336,29 +330,29 @@ export default { this.loading = false; }); }, - _getRoleOptions () { + _getRoleOptions() { getRoleOptions().then((resp) => { this.roleOptions = resp.data; }); }, /** 查询部门下拉树结构 */ - getDeptTree () { + getDeptTree() { deptTreeSelect().then((response) => { this.deptOptions = response.data; }); }, // 筛选节点 - filterNode (value, data) { + filterNode(value, data) { if (!value) return true; return data.label.indexOf(value) !== -1; }, // 节点单击事件 - handleNodeClick (data) { + handleNodeClick(data) { this.queryParams.orgId = data.id; this.getList(); }, // 用户状态修改 - handleStatusChange (row) { + handleStatusChange(row) { const text = row.status === '0' ? '启用' : '停用'; this.$confirm('确认要"' + text + '""' + row.userName + '"用户吗?', '警告', { confirmButtonText: '确定', @@ -380,12 +374,12 @@ export default { }); }, // 取消按钮 - cancel () { + cancel() { this.open = false; this.reset(); }, // 表单重置 - reset () { + reset() { this.form = { orgId: undefined, employeeName: undefined, @@ -402,29 +396,30 @@ export default { areaList: [], weight: undefined, count: true, - signPlace: undefined + signPlace: undefined, + dataScope: 3// 默认个人数据 }; this.resetForm('form'); }, /** 搜索按钮操作 */ - handleQuery () { + handleQuery() { this.queryParams.page = 1; this.getList(); }, /** 重置按钮操作 */ - resetQuery () { + resetQuery() { this.resetForm('queryForm'); this.handleQuery(); }, /** 新增按钮操作 */ - handleAdd () { + handleAdd() { this.reset(); this.getDeptTree(); this.open = true; this.title = '添加员工'; }, /** 修改按钮操作 */ - handleUpdate (row) { + handleUpdate(row) { this.reset(); this.getDeptTree(); this.form = Object.assign({}, row); @@ -432,7 +427,7 @@ export default { this.title = '修改员工'; }, /** 重置密码按钮操作 */ - handleReset (row) { + handleReset(row) { resetUserPwd({ employeeId: row.employeeId }).then((response) => { if (response.code === 200) { this.msgSuccess('重置密码成功!'); @@ -440,7 +435,7 @@ export default { }); }, /** 提交按钮 */ - submitForm () { + submitForm() { this.$refs['form'].validate((valid) => { if (valid) { this.$set(this.form, 'deptId', this.$store.getters.schoolId); @@ -464,7 +459,7 @@ export default { } }); }, - handleLogoff (row) { + handleLogoff(row) { this.$confirm('注销后将立即释放线索,并禁用该员工,是否确认注销?', '警告', { confirmButtonText: '确定', cancelButtonText: '取消', @@ -475,7 +470,7 @@ export default { this.msgSuccess('注销成功!'); }); }, - handleRelease (row) { + handleRelease(row) { this.$confirm('是否立刻释放该员工拥有的线索?', '警告', { confirmButtonText: '确定', cancelButtonText: '取消', @@ -486,7 +481,7 @@ export default { this.msgSuccess('释放成功!'); }); }, - handleRemove (row) { + handleRemove(row) { this.$confirm('是否删除该员工,建议只在数据错误时删除?', '警告', { confirmButtonText: '确定', cancelButtonText: '取消',