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

main
15036302109 10 months ago
parent ff310a4c25
commit 6f9d7e9acc

@ -1,18 +1,5 @@
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.constant.UserConstants;
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.utils.StringUtils;
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);
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;
/**

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

@ -128,4 +128,9 @@ public interface ISysDeptService
* @return
*/
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.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -345,4 +346,16 @@ public class SysDeptServiceImpl implements ISysDeptService
public List<SysDept> selectAllDeptList(SysDept 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>
order by d.parent_id, d.order_num
</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 d.dept_id,d.dept_name
from sys_dept d

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

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

Loading…
Cancel
Save