数据权限

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

@ -165,22 +165,16 @@
</el-col>
</el-row>
<!-- <el-col :span="12">
<el-form-item label="小程序权限">
<el-radio-group v-model="form.hasStudent">
<el-radio :label="true">开通</el-radio>
<el-radio :label="false">关闭</el-radio>
</el-radio-group>
</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-form-item>
</el-col> -->
<el-row>
<el-col :span="12">
<el-radio-group v-model="form.dataScope">
<el-radio :label="1">全部数据</el-radio>
<el-radio :label="2">部门数据</el-radio>
<el-radio :label="3">个人数据</el-radio>
</el-radio-group>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注">
@ -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: '取消',

Loading…
Cancel
Save