Commit 1e3c13c4 by caowenda

添加组织 添加人员流程修改 页面修改

parent abcb2e34
package com.bbd.bpm.controller.user; package com.bbd.bpm.controller.user;
import com.bbd.bpm.base.PageBean; import com.bbd.bpm.base.PageBean;
import com.bbd.bpm.result.RespCode;
import com.bbd.bpm.result.Result; import com.bbd.bpm.result.Result;
import com.bbd.bpm.result.ResultUtil;
import com.bbd.bpm.service.UserInfoService; import com.bbd.bpm.service.UserInfoService;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -58,14 +60,14 @@ public class userController { ...@@ -58,14 +60,14 @@ public class userController {
**/ **/
@RequestMapping(value = "getOrganization") @RequestMapping(value = "getOrganization")
@ResponseBody @ResponseBody
public Result getOrganization(PageBean pageBean,Integer id,Integer pId){ public Result getOrganization(PageBean pageBean,Integer id,Integer pId,String name){
if(pageBean.getPageNum()==0){ if(pageBean.getPageNum()==0){
pageBean.setPageNum(1); pageBean.setPageNum(1);
} }
if (pageBean.getPageSize()==0) { if (pageBean.getPageSize()==0) {
pageBean.setPageSize(10); pageBean.setPageSize(10);
} }
Result result= userInfoService.getOrganization(pageBean,id,pId); Result result= userInfoService.getOrganization(pageBean,id,pId,name);
return result; return result;
} }
...@@ -110,9 +112,9 @@ public class userController { ...@@ -110,9 +112,9 @@ public class userController {
**/ **/
@RequestMapping(value = "addOrganizationMember") @RequestMapping(value = "addOrganizationMember")
@ResponseBody @ResponseBody
public Result addOrganizationMember(String name, String position, Long pId, Integer id){ public Result addOrganizationMember(String name, String position, Long pId, Integer id,Integer department,Integer type){
//获取session中的值 //获取session中的值
Result result = userInfoService.addOrganizationMember(name,position,pId,id); Result result = userInfoService.addOrganizationMember(name,position,pId,id,department,type);
return result; return result;
} }
...@@ -131,4 +133,32 @@ public class userController { ...@@ -131,4 +133,32 @@ public class userController {
return result; return result;
} }
/**
* 删除组织及下级
* @param id
* @param pId
* @return
*/
@RequestMapping(value = "deleteOrganization")
@ResponseBody
public Result deleteOrganization(Long id,Integer pId){
Result result = userInfoService.deleteOrganization(id,pId);
return result;
}
/**
* 获取下级部门信息
* @return
*/
@RequestMapping(value = "getAreaAll")
@ResponseBody
public Result getAreaAll(Integer id){
Result areaList = userInfoService.getAreaAll(id);
return areaList;
}
} }
...@@ -14,5 +14,13 @@ import java.util.Map; ...@@ -14,5 +14,13 @@ import java.util.Map;
@Repository @Repository
public interface MemberMapper extends BaseMapper<BpmEmployee>{ public interface MemberMapper extends BaseMapper<BpmEmployee>{
List<BpmCompanyVo> getMemberList(@Param("id") Integer id); List<BpmCompanyVo> getMemberList(@Param("id") Integer id, @Param("name") String name);
void deletedMember(@Param("id") Long id);
void deletedMembers(@Param("id") Long id);
List<BpmCompanyVo> getAllMemberList(@Param("id") Integer id, @Param("name") String name);
List<Map<String,Object>> getAreaAll(@Param("id") Integer id);
} }
...@@ -18,5 +18,48 @@ ...@@ -18,5 +18,48 @@
LEFT JOIN bpm_company c ON c.id = a.code_id LEFT JOIN bpm_company c ON c.id = a.code_id
WHERE WHERE
a.`status` = 0 and department=#{id} a.`status` = 0 and department=#{id}
<if test="name!=null">
and a.name LIKE CONCAT('%',#{name},'%')
</if>
</select> </select>
<select id="getAllMemberList" resultType="com.bbd.bpm.vo.BpmEmployeeVo">
SELECT
a.id,
a.created_time createdTime,
a.update_time updateTime,
a.`name`,
a.position,
b.`name` department,
c.`code`
FROM
bpm_employee a
LEFT JOIN bpm_company b ON b.id = a.department
LEFT JOIN bpm_company c ON c.id = a.code_id
WHERE
a.`status` = 0 and code_id=#{id}
<if test="name!=null">
and a.name LIKE CONCAT('%',#{name},'%')
</if>
</select>
<update id="deletedMember">
update bpm_employee set status=2 where code_id=#{id}
</update>
<update id="deletedMembers">
update bpm_employee set status=2 where department=#{id}
</update>
<select id="getAreaAll" resultType="map">
SELECT
id,
`name`
FROM
bpm_company
WHERE
parent_id=#{id}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -4,7 +4,6 @@ package com.bbd.bpm.dao; ...@@ -4,7 +4,6 @@ package com.bbd.bpm.dao;
import com.bbd.bpm.base.BaseMapper; import com.bbd.bpm.base.BaseMapper;
import com.bbd.bpm.domain.BpmCompany; import com.bbd.bpm.domain.BpmCompany;
import com.bbd.bpm.vo.BpmCompanyVo; import com.bbd.bpm.vo.BpmCompanyVo;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -14,7 +13,7 @@ import java.util.Map; ...@@ -14,7 +13,7 @@ import java.util.Map;
@Repository @Repository
public interface UserInfoMapper extends BaseMapper<BpmCompany>{ public interface UserInfoMapper extends BaseMapper<BpmCompany>{
List<BpmCompanyVo> getOrganization(@Param("id") Integer id); List<BpmCompanyVo> getOrganization(@Param("id") Integer id, @Param("name") String name);
List<Map<String,Object>> getOrganizationList(); List<Map<String,Object>> getOrganizationList();
...@@ -23,4 +22,8 @@ public interface UserInfoMapper extends BaseMapper<BpmCompany>{ ...@@ -23,4 +22,8 @@ public interface UserInfoMapper extends BaseMapper<BpmCompany>{
String getOrganizationRelation(@Param("id") Integer id); String getOrganizationRelation(@Param("id") Integer id);
Map<String,Object> getOrganizationInfo(@Param("id") Integer id); Map<String,Object> getOrganizationInfo(@Param("id") Integer id);
void deleteDepartment(@Param("id") Long id);
void deleteDepartments(@Param("id") Long id);
} }
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
<if test="id!=null"> <if test="id!=null">
and parent_id=#{id} and parent_id=#{id}
</if> </if>
<if test="name!=null">
and name LIKE CONCAT('%',#{name},'%')
</if>
</select> </select>
<!--组织架构菜单--> <!--组织架构菜单-->
...@@ -63,4 +66,12 @@ ...@@ -63,4 +66,12 @@
id = #{id} id = #{id}
</select> </select>
<update id="deleteDepartment">
update bpm_company set status=2 where parent_id=#{id}
</update>
<update id="deleteDepartments">
update bpm_company set status=2 where id=#{id}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -6,12 +6,12 @@ import com.bbd.bpm.result.Result; ...@@ -6,12 +6,12 @@ import com.bbd.bpm.result.Result;
public interface UserInfoService { public interface UserInfoService {
/** /**
* @Author:cwd * @Author:cwd
* @Description:获取组织列表 * @Description:获取组织列表
* @Date: 2019/03/04 22:53 * @Date: 2019/03/04 22:53
* @Param: * @Param:
* @return * @return
**/ **/
Result getOrganization(PageBean pageBean, Integer id, Integer pId); Result getOrganization(PageBean pageBean, Integer id, Integer pId, String name);
/** /**
* @Author:cwd * @Author:cwd
* @Description:加载ztree * @Description:加载ztree
...@@ -35,7 +35,7 @@ public interface UserInfoService { ...@@ -35,7 +35,7 @@ public interface UserInfoService {
* @Param: * @Param:
* @return * @return
**/ **/
Result addOrganizationMember(String name, String position, Long pId, Integer id); Result addOrganizationMember(String name, String position, Long pId, Integer id, Integer department, Integer type);
/** /**
* @Author:cwd * @Author:cwd
* @Description:获取组织详情 * @Description:获取组织详情
...@@ -52,4 +52,18 @@ public interface UserInfoService { ...@@ -52,4 +52,18 @@ public interface UserInfoService {
* @return * @return
**/ **/
Result editOrganization(String name, String abbreviationName, Integer id); Result editOrganization(String name, String abbreviationName, Integer id);
/**
* 删除组织及下级
* @param id
* @param pId
* @return
*/
Result deleteOrganization(Long id, Integer pId);
/**
* 获取组织下级部门
* @param id
* @param pId
* @return
*/
Result getAreaAll(Integer id);
} }
...@@ -33,7 +33,7 @@ public class UserInfoServiceImpl implements UserInfoService{ ...@@ -33,7 +33,7 @@ public class UserInfoServiceImpl implements UserInfoService{
* @return * @return
**/ **/
@Override @Override
public Result getOrganization(PageBean pageBean, Integer id, Integer pId) { public Result getOrganization(PageBean pageBean, Integer id, Integer pId, String name) {
try{ try{
if(pId==null){ if(pId==null){
...@@ -41,7 +41,7 @@ public class UserInfoServiceImpl implements UserInfoService{ ...@@ -41,7 +41,7 @@ public class UserInfoServiceImpl implements UserInfoService{
if(id==null){ if(id==null){
id=1; id=1;
} }
List<BpmCompanyVo> list = userInfoMapper.getOrganization(id); List<BpmCompanyVo> list = userInfoMapper.getOrganization(id,name);
BpmCompanyVo bpmCompanyVo; BpmCompanyVo bpmCompanyVo;
for (int i=0;i<list.size();i++){ for (int i=0;i<list.size();i++){
Integer pIds = list.get(i).getPId(); Integer pIds = list.get(i).getPId();
...@@ -56,22 +56,15 @@ public class UserInfoServiceImpl implements UserInfoService{ ...@@ -56,22 +56,15 @@ public class UserInfoServiceImpl implements UserInfoService{
return ResultUtil.getResult(RespCode.Code.SUCCESS, map); return ResultUtil.getResult(RespCode.Code.SUCCESS, map);
}else if(pId==1){ }else if(pId==1){
PageHelper.startPage(pageBean.getPageNum(), pageBean.getPageSize()); PageHelper.startPage(pageBean.getPageNum(), pageBean.getPageSize());
List<BpmCompanyVo> list = userInfoMapper.getOrganization(id); List<BpmCompanyVo> list = memberMapper.getAllMemberList(id,name);
BpmCompanyVo bpmCompanyVo;
for (int i=0;i<list.size();i++){
Integer pIds = list.get(i).getPId();
bpmCompanyVo=userInfoMapper.getParentName(pIds);
//根据pid获取上级组织名称
list.get(i).setParentName(bpmCompanyVo.getName());
}
PageInfo<BpmCompanyVo> pageInfo = new PageInfo<>(list); PageInfo<BpmCompanyVo> pageInfo = new PageInfo<>(list);
Map<String, Object> map = new HashMap<>(16); Map<String, Object> map = new HashMap<>(16);
map.put("pageInfo", pageInfo); map.put("pageInfo", pageInfo);
map.put("type", 1); map.put("type", 2);
return ResultUtil.getResult(RespCode.Code.SUCCESS, map); return ResultUtil.getResult(RespCode.Code.SUCCESS, map);
}else{ }else{
PageHelper.startPage(pageBean.getPageNum(), pageBean.getPageSize()); PageHelper.startPage(pageBean.getPageNum(), pageBean.getPageSize());
List<BpmCompanyVo> list = memberMapper.getMemberList(id); List<BpmCompanyVo> list = memberMapper.getMemberList(id,name);
PageInfo<BpmCompanyVo> pageInfo = new PageInfo<>(list); PageInfo<BpmCompanyVo> pageInfo = new PageInfo<>(list);
Map<String, Object> map = new HashMap<>(16); Map<String, Object> map = new HashMap<>(16);
map.put("pageInfo", pageInfo); map.put("pageInfo", pageInfo);
...@@ -151,14 +144,20 @@ public class UserInfoServiceImpl implements UserInfoService{ ...@@ -151,14 +144,20 @@ public class UserInfoServiceImpl implements UserInfoService{
* @return * @return
**/ **/
@Override @Override
public Result addOrganizationMember(String name, String position, Long pId, Integer id) { public Result addOrganizationMember(String name, String position, Long pId, Integer id, Integer department, Integer type) {
try { try {
BpmEmployee bpmEmployee=new BpmEmployee(); BpmEmployee bpmEmployee=new BpmEmployee();
bpmEmployee.setCreateTime(new Date()); bpmEmployee.setCreateTime(new Date());
bpmEmployee.setUpdateTime(new Date()); bpmEmployee.setUpdateTime(new Date());
bpmEmployee.setName(name); bpmEmployee.setName(name);
bpmEmployee.setCodeId(pId.intValue()); if(type!=null){
bpmEmployee.setDepartment(id); bpmEmployee.setDepartment(department);
bpmEmployee.setCodeId(id);
}else {
bpmEmployee.setDepartment(id);
bpmEmployee.setCodeId(pId.intValue());
}
bpmEmployee.setPosition(position); bpmEmployee.setPosition(position);
bpmEmployee.setStatus(0); bpmEmployee.setStatus(0);
memberMapper.insert(bpmEmployee); memberMapper.insert(bpmEmployee);
...@@ -207,4 +206,49 @@ public class UserInfoServiceImpl implements UserInfoService{ ...@@ -207,4 +206,49 @@ public class UserInfoServiceImpl implements UserInfoService{
return ResultUtil.getResult(RespCode.Code.INTERNAL_SERVER_ERROR); return ResultUtil.getResult(RespCode.Code.INTERNAL_SERVER_ERROR);
} }
} }
/**
* 删除组织及下级
* @param id
* @param pId
* @return
*/
@Override
public Result deleteOrganization(Long id, Integer pId) {
try{
//pId为0删除的是组织,部门,人员 为1删除的是部门和人员
if(pId==0){
//通过id删除组织,下级部门,人员
BpmCompany bpmCompany=new BpmCompany();
bpmCompany.setId(id);
bpmCompany.setStatus(2);
//删除当前组织
userInfoMapper.updateByPrimaryKeySelective(bpmCompany);
//删除组织下的部门
userInfoMapper.deleteDepartment(id);
//删除人员(人员所属组织编码id 放的组织的id可以直接删除 status为2)
memberMapper.deletedMember(id);
}else if(pId==1){
//删除部门
userInfoMapper.deleteDepartments(id);
//删除部门人员
memberMapper.deletedMembers(id);
}
return ResultUtil.getResult(RespCode.Code.SUCCESS);
}catch (Exception e){
e.printStackTrace();
return ResultUtil.getResult(RespCode.Code.INTERNAL_SERVER_ERROR);
}
}
@Override
public Result getAreaAll(Integer id) {
try {
List<Map<String,Object>> list=this.memberMapper.getAreaAll(id);
return ResultUtil.getResult(RespCode.Code.SUCCESS,list);
}catch (Exception e){
e.printStackTrace();
return ResultUtil.getResult(RespCode.Code.INTERNAL_SERVER_ERROR);
}
}
} }
...@@ -82,8 +82,8 @@ ...@@ -82,8 +82,8 @@
<p class="search_pro" style="height: auto;overflow: hidden;display: block; padding: 0;"> <p class="search_pro" style="height: auto;overflow: hidden;display: block; padding: 0;">
<span ><b id="spanB">组织名称:</b><input type="text" value="" placeholder="请输入" name="name" style="color: black"/></span> <span ><b id="spanB">组织名称:</b><input type="text" value="" placeholder="请输入" name="name" style="color: black"/></span>
<span style="width: 200px;"><button style=" border: 1px solid #000000;background-color: #2b2b2b;width: 64px;height: 35px;color: white;border-radius: 0px;text-align: center;line-height: 30px;" onclick="queryDeviceRecords()">查询</button></span><span style="width: 67px;float: right" id="add"> <span style="width: 200px;"><button style=" border: 1px solid #000000;background-color: #2b2b2b;width: 64px;height: 35px;color: white;border-radius: 0px;text-align: center;line-height: 30px;" onclick="queryDeviceRecords()">查询</button></span><span style="width: 67px;float: right" id="add">
<button id="addOr" style=" border: 1px solid #000000;background-color: #2b2b2b;width: 64px;height: 35px;color: white;border-radius: 0px;text-align: center;line-height: 30px;" onclick="add()">添加</button></span> <button id="addOr" style=" border: 1px solid #000000;background-color: #2b2b2b;width: 70px;height: 35px;color: white;border-radius: 0px;text-align: center;line-height: 30px;margin-left: -1px;" onclick="add(1)">添加组织</button></span>
<button id="addMe" style="float: right;margin-top: 7px; border: 1px solid #000000;background-color: #2b2b2b;width: 64px;height: 35px;color: white;border-radius: 0px;text-align: center;line-height: 30px;" onclick="add()">添加</button></span> <button id="addMe" style="float: right;margin-top: 7px; border: 1px solid #000000;background-color: #2b2b2b;width: 70px;height: 35px;color: white;border-radius: 0px;text-align: center;line-height: 30px;" onclick="add(2)">添加人员</button></span>
</p> </p>
</div> </div>
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
var content = ''; var content = '';
if (type == 2){ if (type == 2){
$("#addMe").show(); $("#addMe").show();
$("#addOr").hide(); $("#addOr").show();
$("#spanB").html("人员信息:") $("#spanB").html("人员信息:")
$("#type").val(1); $("#type").val(1);
content += "<tr><th>人员编号</th><th>人员名称</th><th>职位</th><th>部门</th><th>所属组织编码</th><th>加入时间</th><th >操作</th></tr>"; content += "<tr><th>人员编号</th><th>人员名称</th><th>职位</th><th>部门</th><th>所属组织编码</th><th>加入时间</th><th >操作</th></tr>";
...@@ -301,7 +301,7 @@ ...@@ -301,7 +301,7 @@
if(data!=null){ if(data!=null){
if (type==2) { if (type==2) {
for (var i in data) { for (var i in data) {
content += "<tr><td>"+ data[i].id + "</td><td>" + data[i].name + "</td><td>" + data[i].position + "</td><td>" + data[i].department + "</td><td>" + data[i].code +"</td><td>" + data[i].createdTime + "</td><td><a href='#' onclick='toTeamInfo(" + data[i].id + ")'>查看</a></td></tr>"; content += "<tr><td>"+ data[i].id + "</td><td>" + data[i].name + "</td><td>" + data[i].position + "</td><td>" + data[i].department + "</td><td>" + data[i].code +"</td><td>" + data[i].createdTime + "</td><td>" + "<a href='#' onclick='gotoDetails(\"" + data[i].name + "\",\"" + data[i].position + "\",\"" + data[i].department + "\",\"" + data[i].code + "\",\"" + data[i].createdTime + "\")'>查看</a></td></tr>";
} }
}else{ }else{
for (var i in data) { for (var i in data) {
...@@ -322,14 +322,15 @@ ...@@ -322,14 +322,15 @@
$('table').html(content); $('table').html(content);
} }
function toTeamInfo(teamId) { function gotoDetails(name,position,department,code,createdTime){
location.href="/teamManage/goTeamInfo?teamId="+teamId+"&status="+status; var content = '<div><p>人员名称:'+name+'</p><p>职位:'+position+'</p><p>部门:'+department+'</p><p>所属组织编码:'+code+'</p><p>加入时间:'+createdTime+'</p></div>';
layer.alert(content)
} }
/*条件查询砍价商品*/ /*条件查询*/
/*
function queryDeviceRecords() { function queryDeviceRecords() {
var id = $("#pid").val(); var pId = $("#pid").val();
var id = $("#id").val();
var type = $("#type").val(); var type = $("#type").val();
var name = $("[name='name']").val(); var name = $("[name='name']").val();
$.post( $.post(
...@@ -337,6 +338,7 @@ ...@@ -337,6 +338,7 @@
{ {
pageSize:10, pageSize:10,
pageNum:1, pageNum:1,
pId:pId,
id:id, id:id,
name:name, name:name,
type:type type:type
...@@ -346,7 +348,7 @@ ...@@ -346,7 +348,7 @@
if (!data.data.pageInfo.pages){ if (!data.data.pageInfo.pages){
size = 0; size = 0;
} }
/!*分页*!/ /*分页*/
$(".pagediv").createPage({ $(".pagediv").createPage({
pageNum: size,//总页码 pageNum: size,//总页码
current: 1,//当前页 current: 1,//当前页
...@@ -359,11 +361,12 @@ ...@@ -359,11 +361,12 @@
}); });
},'json') },'json')
} }
*/
function dele(id,name) { function dele(id,name) {
var pId = $("#pid").val(); var pId = $("#pid").val();
alert(pId) if(pId==''){
pId=0;
}
layer.open({ layer.open({
id:1, id:1,
type: 1, type: 1,
...@@ -376,8 +379,9 @@ ...@@ -376,8 +379,9 @@
btn1: function (index,layero) { btn1: function (index,layero) {
$.post( $.post(
"/bpm/user/deleteOrganization", "/bpm/user/deleteOrganization",
{"id":id}, {"id":id,"pId":pId},
function (data) { function (data) {
console.log(data)
if (data.code==200){ if (data.code==200){
layer.msg('操作成功',{icon:1,time:1000},function () { layer.msg('操作成功',{icon:1,time:1000},function () {
location.reload(); location.reload();
...@@ -526,15 +530,18 @@ ...@@ -526,15 +530,18 @@
} }
function add() { function add(type) {
var pId = $("#pid").val(); var pId = $("#pid").val();
var id = $("#id").val(); var id = $("#id").val();
alert(id); if (type==1){
alert(pId)
if (pId==1 || pId==''){
var content = '<div style="margin-top: 13px;margin-left: 27px;"><span ><b>组织名称:</b><input type="text" value="" placeholder="请输入组织名称" name="oName" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px;margin-left: 26px;"/></span><br>\n' + var content = '<div style="margin-top: 13px;margin-left: 27px;"><span ><b>组织名称:</b><input type="text" value="" placeholder="请输入组织名称" name="oName" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px;margin-left: 26px;"/></span><br>\n' +
'\t\t<span ><b>组织简写(英):</b><input type="text" value="" placeholder="请输入组织简写" name="abbreviationName" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px;"/></span><br>\n'; '\t\t<span ><b>组织简写(英):</b><input type="text" value="" placeholder="请输入组织简写" name="abbreviationName" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px;"/></span><br>\n';
}else { }else if (pId==1&& type==2){
var content = '<div style="margin-top: 13px;margin-left: 27px;"><span ><b>人员名称:</b><input type="text" value="" placeholder="请输入人员名称" name="oName" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px;margin-left: 16px;"/></span><br>\n' +
'\t\t<span ><b>所在部门:</b><select name="areaId" id="areaId" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px;margin-left: 16px;width: 159px;"></select></span><br>\n' +
'\t\t<span ><b style="margin-left: 32px;">职位:</b><input type="text" value="" placeholder="请输入职位" name="position" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px; margin-left: 16px;"/></span><br>\n';
}
else {
var content = '<div style="margin-top: 13px;margin-left: 27px;"><span ><b>人员名称:</b><input type="text" value="" placeholder="请输入人员名称" name="oName" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px;margin-left: 16px;"/></span><br>\n' + var content = '<div style="margin-top: 13px;margin-left: 27px;"><span ><b>人员名称:</b><input type="text" value="" placeholder="请输入人员名称" name="oName" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px;margin-left: 16px;"/></span><br>\n' +
'\t\t<span ><b style="margin-left: 32px;">职位:</b><input type="text" value="" placeholder="请输入职位" name="position" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px; margin-left: 16px;"/></span><br>\n'; '\t\t<span ><b style="margin-left: 32px;">职位:</b><input type="text" value="" placeholder="请输入职位" name="position" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px; margin-left: 16px;"/></span><br>\n';
} }
...@@ -542,7 +549,25 @@ ...@@ -542,7 +549,25 @@
var tel=/^[1][3,4,5,6,7,8,9][0-9]{9}$/; var tel=/^[1][3,4,5,6,7,8,9][0-9]{9}$/;
var phones=/^(\d3,4\d3,4|\d{3,4}-)?\d{7,8}$/; var phones=/^(\d3,4\d3,4|\d{3,4}-)?\d{7,8}$/;
if(pId==1 || pId==''){ if (pId==1){
var desc = "<option value=''>"+'请选择'+"</option>";
$.post(
"/bpm/user/getAreaAll",
{
"id":id
},
function (data) {
data=data.data
for(var i in data){
desc+="<option value='"+data[i].id+"'>"+data[i].name+"</option>";
}
$("#areaId").html(desc)
},'json'
)
}
if(type==1){
layer.open({ layer.open({
id:1, id:1,
type: 1, type: 1,
...@@ -585,6 +610,53 @@ ...@@ -585,6 +610,53 @@
layer.close(index); layer.close(index);
} }
}); });
}
else if(pId==1 && type==2){
layer.open({
id:1,
type: 1,
title:'添加部门人员',
skin:'layui-layer-rim',
area:['360px', '330px'],
content: content
,
btn:['保存','取消'],
btn1: function (index,layero) {
var name = $("[name='oName']").val();
var position = $("[name='position']").val();
var areaId = $("[name='areaId']").val();
if (name==''){
layer.msg("人员名称不能为空");
}else if (position==''){
layer.msg("职位");
}else {
$.post(
"/bpm/user/addOrganizationMember",
{
"type":1,
"department":areaId,
"name":name,
"position":position,
"pId":pId,
"id":id
},
function (data) {
if (data.code==200){
layer.msg('操作成功',{icon:1,time:1000},function () {
location.reload();
})
}else{
layer.msg(data.message,{icon:2,time:1000});
}
},'json'
)
}
},
btn2:function (index,layero) {
layer.close(index);
}
});
}else{ }else{
layer.open({ layer.open({
id:1, id:1,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment