队伍新增时,县直单位、街道及乡镇账号应将添加救援队伍时的“所属单位”默认为本单位名称,局端账号录入时才可选择单位。

main
15036302109 8 months ago
parent ff310a4c25
commit 6f9d7e9acc

@ -1,18 +1,5 @@
package com.ruoyi.web.controller.system; package com.ruoyi.web.controller.system;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
@ -21,6 +8,13 @@ import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysDeptService; import com.ruoyi.system.service.ISysDeptService;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* *
@ -141,4 +135,13 @@ public class SysDeptController extends BaseController
List<SysDept> depts = deptService.selectAllDeptList(dept); List<SysDept> depts = deptService.selectAllDeptList(dept);
return success(depts); return success(depts);
} }
/**
* ,
*/
@GetMapping("/getPartDeptInfo")
public AjaxResult getPartDeptInfo(SysDept dept)
{
List<SysDept> depts = deptService.getPartDeptInfo(dept);
return success(depts);
}
} }

@ -40,7 +40,7 @@ public class EhsRescueTeam extends BaseEntity {
/** /**
* *
*/ */
@Excel(name = "队伍级别") @Excel(name = "队伍级别", dictType = "team_level")
private String teamLevel; private String teamLevel;
/** /**

@ -123,4 +123,6 @@ public interface SysDeptMapper
* @return * @return
*/ */
public List<SysDept> selectAllDeptList(SysDept dept); public List<SysDept> selectAllDeptList(SysDept dept);
public List<SysDept> getPartDeptInfo(SysDept dept);
} }

@ -128,4 +128,9 @@ public interface ISysDeptService
* @return * @return
*/ */
public List<SysDept> selectAllDeptList(SysDept dept); public List<SysDept> selectAllDeptList(SysDept dept);
/**
* ,
*/
public List<SysDept> getPartDeptInfo(SysDept dept);
} }

@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -345,4 +346,16 @@ public class SysDeptServiceImpl implements ISysDeptService
public List<SysDept> selectAllDeptList(SysDept dept){ public List<SysDept> selectAllDeptList(SysDept dept){
return deptMapper.selectAllDeptList(dept); return deptMapper.selectAllDeptList(dept);
} }
/**
* ,
*/
public List<SysDept> getPartDeptInfo(SysDept dept) {
Long deptId = SecurityUtils.getLoginUser().getDeptId();// 当前登录用户部门
// 如果不是局端,那么查询当前登录用户的部门信息,否则查询全部信息
if (!Objects.equals(100L, deptId)){
dept.setDeptId(deptId);
}
return deptMapper.getPartDeptInfo(dept);
}
} }

@ -60,6 +60,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
order by d.parent_id, d.order_num order by d.parent_id, d.order_num
</select> </select>
<select id="getPartDeptInfo" parameterType="SysDept" resultMap="SysDeptResult">
select d.dept_id,d.dept_name
from sys_dept d
<where>
<if test="parentId == 0">
and parent_id!=0
</if>
<if test="deptId != null">
and dept_id = #{deptId}
</if>
</where>
order by d.order_num
</select>
<select id="selectAllDeptList" parameterType="SysDept" resultMap="SysDeptResult"> <select id="selectAllDeptList" parameterType="SysDept" resultMap="SysDeptResult">
select d.dept_id,d.dept_name select d.dept_id,d.dept_name
from sys_dept d from sys_dept d

@ -58,6 +58,14 @@ export function listAllDept() {
method: 'get' method: 'get'
}) })
} }
//根据客户需求,查询部分部门数据
export function selectPartDept() {
return request({
url: '/system/dept/getPartDeptInfo',
method: 'get'
})
}
//查询二级部门数据的id和name //查询二级部门数据的id和name
export function listAllDept2() { export function listAllDept2() {
return request({ return request({

@ -205,7 +205,7 @@
</el-form-item> </el-form-item>
<el-form-item label="队伍级别" prop="teamLevel"> <el-form-item label="队伍级别" prop="teamLevel">
<!--<el-input v-model="form.teamLevel" placeholder="请输入队伍级别" />--> <!--<el-input v-model="form.teamLevel" placeholder="请输入队伍级别" />-->
<el-select v-model="form.teamLevel" allow-create filterable placeholder="请选择所属单位" clearable> <el-select v-model="form.teamLevel" allow-create filterable placeholder="请选择队伍级别" clearable>
<el-option <el-option
v-for="dict in dict.type.team_level" v-for="dict in dict.type.team_level"
:key="dict.label" :key="dict.label"
@ -225,7 +225,7 @@
<el-form-item label="所属单位" prop="unit"> <el-form-item label="所属单位" prop="unit">
<el-select v-model="form.unit" allow-create filterable placeholder="请选择所属单位" clearable> <el-select v-model="form.unit" allow-create filterable placeholder="请选择所属单位" clearable>
<el-option <el-option
v-for="dict in allDeptList" v-for="dict in partDeptInfo"
:key="dict.deptName" :key="dict.deptName"
:label="dict.deptName" :label="dict.deptName"
:value="dict.deptName" :value="dict.deptName"
@ -281,7 +281,7 @@ import { listEhsRescueTeam, getEhsRescueTeam, delEhsRescueTeam, addEhsRescueTeam
import { listEhsRescueTeamWorker, getEhsRescueTeamWorker, delEhsRescueTeamWorker, addEhsRescueTeamWorker, updateEhsRescueTeamWorker } from "@/api/ehs/ehsRescueTeamWorker"; import { listEhsRescueTeamWorker, getEhsRescueTeamWorker, delEhsRescueTeamWorker, addEhsRescueTeamWorker, updateEhsRescueTeamWorker } from "@/api/ehs/ehsRescueTeamWorker";
import importUpload from "@/components/upload/upload"; import importUpload from "@/components/upload/upload";
import tdh from "../ehsRescueTeamWorker/index.vue" import tdh from "../ehsRescueTeamWorker/index.vue"
import {listAllDept } from "@/api/system/dept"; import {listAllDept,selectPartDept } from "@/api/system/dept";
export default { export default {
name: "EhsRescueTeam", name: "EhsRescueTeam",
dicts: ['team_property','team_level'], dicts: ['team_property','team_level'],
@ -310,6 +310,8 @@ export default {
deptShow: false, deptShow: false,
// //
allDeptList: [], allDeptList: [],
// ()
partDeptInfo: [],
// //
title: "", title: "",
// //
@ -346,6 +348,7 @@ export default {
created() { created() {
this.getList(); this.getList();
this.getListAllDept(); this.getListAllDept();
this.getPartDeptInfo();
this.deptShow = this.$store.state.user.parentId==0 ?true :false; this.deptShow = this.$store.state.user.parentId==0 ?true :false;
this.curDeptId = this.$store.state.user.deptId; this.curDeptId = this.$store.state.user.deptId;
}, },
@ -362,7 +365,7 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
/** 单位信息列表 */ /** 单位信息列表,查询所有部门的数据 */
getListAllDept() { getListAllDept() {
console.log(this.$store.state.user.deptId); console.log(this.$store.state.user.deptId);
this.loading = true; this.loading = true;
@ -372,6 +375,16 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
/** 部分部门数据(根据客户需求查询部分部门的数据) */
getPartDeptInfo() {
// console.log(this.$store.state.user.deptId);
this.loading = true;
selectPartDept().then(response => {
this.partDeptInfo = response.data;
this.loading = false;
});
},
// //
cancel() { cancel() {
this.open = false; this.open = false;
@ -421,6 +434,10 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加应急救援队伍管理"; this.title = "添加应急救援队伍管理";
if (this.curDeptId != 100){
console.log("hello:"+this.partDeptInfo[0]);
this.form.unit = this.partDeptInfo[0].deptName;
}
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {

Loading…
Cancel
Save