数据权限

caozong
qsh 1 year ago
parent ac798f3f94
commit 72d19bfb02
  1. 67
      src/views/system/employee/index.vue

@ -165,22 +165,16 @@
</el-col> </el-col>
</el-row> </el-row>
<!-- <el-col :span="12"> <el-row>
<el-form-item label="小程序权限"> <el-col :span="12">
<el-radio-group v-model="form.hasStudent"> <el-radio-group v-model="form.dataScope">
<el-radio :label="true">开通</el-radio> <el-radio :label="1">全部数据</el-radio>
<el-radio :label="false">关闭</el-radio> <el-radio :label="2">部门数据</el-radio>
</el-radio-group> <el-radio :label="3">个人数据</el-radio>
</el-form-item>
</el-col> -->
<!-- <el-col :span="12">
<el-form-item label="管理系统权限">
<el-radio-group v-model="form.hasSys">
<el-radio :label="true">开通</el-radio>
<el-radio :label="false">关闭</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-col>
</el-col> --> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注"> <el-form-item label="备注">
@ -210,7 +204,7 @@ import editor from '@/components/Editor';
export default { export default {
name: 'Employee', name: 'Employee',
components: { Treeselect, editor }, components: { Treeselect, editor },
data () { data() {
return { return {
// //
loading: true, loading: true,
@ -292,11 +286,11 @@ export default {
}, },
watch: { watch: {
// //
deptName (val) { deptName(val) {
this.$refs.tree.filter(val); this.$refs.tree.filter(val);
} }
}, },
created () { created() {
this.getList(); this.getList();
this.getDeptTree(); this.getDeptTree();
this._getRoleOptions(); this._getRoleOptions();
@ -328,7 +322,7 @@ export default {
}, },
methods: { methods: {
/** 查询用户列表 */ /** 查询用户列表 */
getList () { getList() {
this.loading = true; this.loading = true;
empAPi.pageList(this.queryParams).then((response) => { empAPi.pageList(this.queryParams).then((response) => {
this.userList = response.rows; this.userList = response.rows;
@ -336,29 +330,29 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
_getRoleOptions () { _getRoleOptions() {
getRoleOptions().then((resp) => { getRoleOptions().then((resp) => {
this.roleOptions = resp.data; this.roleOptions = resp.data;
}); });
}, },
/** 查询部门下拉树结构 */ /** 查询部门下拉树结构 */
getDeptTree () { getDeptTree() {
deptTreeSelect().then((response) => { deptTreeSelect().then((response) => {
this.deptOptions = response.data; this.deptOptions = response.data;
}); });
}, },
// //
filterNode (value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
return data.label.indexOf(value) !== -1; return data.label.indexOf(value) !== -1;
}, },
// //
handleNodeClick (data) { handleNodeClick(data) {
this.queryParams.orgId = data.id; this.queryParams.orgId = data.id;
this.getList(); this.getList();
}, },
// //
handleStatusChange (row) { handleStatusChange(row) {
const text = row.status === '0' ? '启用' : '停用'; const text = row.status === '0' ? '启用' : '停用';
this.$confirm('确认要"' + text + '""' + row.userName + '"用户吗?', '警告', { this.$confirm('确认要"' + text + '""' + row.userName + '"用户吗?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -380,12 +374,12 @@ export default {
}); });
}, },
// //
cancel () { cancel() {
this.open = false; this.open = false;
this.reset(); this.reset();
}, },
// //
reset () { reset() {
this.form = { this.form = {
orgId: undefined, orgId: undefined,
employeeName: undefined, employeeName: undefined,
@ -402,29 +396,30 @@ export default {
areaList: [], areaList: [],
weight: undefined, weight: undefined,
count: true, count: true,
signPlace: undefined signPlace: undefined,
dataScope: 3//
}; };
this.resetForm('form'); this.resetForm('form');
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery () { handleQuery() {
this.queryParams.page = 1; this.queryParams.page = 1;
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery () { resetQuery() {
this.resetForm('queryForm'); this.resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd () { handleAdd() {
this.reset(); this.reset();
this.getDeptTree(); this.getDeptTree();
this.open = true; this.open = true;
this.title = '添加员工'; this.title = '添加员工';
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate (row) { handleUpdate(row) {
this.reset(); this.reset();
this.getDeptTree(); this.getDeptTree();
this.form = Object.assign({}, row); this.form = Object.assign({}, row);
@ -432,7 +427,7 @@ export default {
this.title = '修改员工'; this.title = '修改员工';
}, },
/** 重置密码按钮操作 */ /** 重置密码按钮操作 */
handleReset (row) { handleReset(row) {
resetUserPwd({ employeeId: row.employeeId }).then((response) => { resetUserPwd({ employeeId: row.employeeId }).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess('重置密码成功!'); this.msgSuccess('重置密码成功!');
@ -440,7 +435,7 @@ export default {
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm () { submitForm() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
this.$set(this.form, 'deptId', this.$store.getters.schoolId); this.$set(this.form, 'deptId', this.$store.getters.schoolId);
@ -464,7 +459,7 @@ export default {
} }
}); });
}, },
handleLogoff (row) { handleLogoff(row) {
this.$confirm('注销后将立即释放线索,并禁用该员工,是否确认注销?', '警告', { this.$confirm('注销后将立即释放线索,并禁用该员工,是否确认注销?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -475,7 +470,7 @@ export default {
this.msgSuccess('注销成功!'); this.msgSuccess('注销成功!');
}); });
}, },
handleRelease (row) { handleRelease(row) {
this.$confirm('是否立刻释放该员工拥有的线索?', '警告', { this.$confirm('是否立刻释放该员工拥有的线索?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -486,7 +481,7 @@ export default {
this.msgSuccess('释放成功!'); this.msgSuccess('释放成功!');
}); });
}, },
handleRemove (row) { handleRemove(row) {
this.$confirm('是否删除该员工,建议只在数据错误时删除?', '警告', { this.$confirm('是否删除该员工,建议只在数据错误时删除?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',

Loading…
Cancel
Save