幼儿园新增部门管理

This commit is contained in:
sk1551 2020-04-17 07:42:54 +08:00
parent 16f4cc0d9a
commit fb937034a7
3 changed files with 31 additions and 1 deletions

View File

@ -57,6 +57,7 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
v-if="scope.row.parentId != 200"
size="mini"
type="text"
icon="el-icon-edit"
@ -64,6 +65,7 @@
v-hasPermi="['system:dept:edit']"
>修改</el-button>
<el-button
v-if="scope.row.deptId < 200"
size="mini"
type="text"
icon="el-icon-plus"
@ -71,7 +73,7 @@
v-hasPermi="['system:dept:add']"
>新增</el-button>
<el-button
v-if="scope.row.parentId != 0"
v-if="scope.row.parentId != 0 && scope.row.parentId != 200"
size="mini"
type="text"
icon="el-icon-delete"
@ -158,6 +160,7 @@ export default {
components: { Treeselect },
data() {
return {
sh: false,
//
loading: true,
//

View File

@ -147,6 +147,29 @@ public class BySchoolController extends BaseController
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
//遍历ids
for (int i=0;i<ids.length;i++)
{
//循环找出school表的id
Long bySchId = ids[i];
//用school表ID获取xxdm的值
//将值赋给dept中的schoolID
SysDept dept = new SysDept();
dept.setSchoolId(bySchoolService.selectBySchoolById(bySchId).getXxdm());
//通过dept表的schoolID来找出dept的List
deptService.deleteDeptById(deptService.selectDeptList(dept).get(0).getDeptId());
}
return toAjax(bySchoolService.deleteBySchoolByIds(ids));
}
}

View File

@ -40,6 +40,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">
AND status = #{status}
</if>
<if test="schoolId != null and schoolId != ''">
AND school_id = #{schoolId}
</if>
<!-- 数据范围过滤 -->
${dataScope}
order by d.parent_id, d.order_num
@ -152,4 +155,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update sys_dept set del_flag = '2' where dept_id = #{deptId}
</delete>
</mapper>