Browse Source

为出库申请页面添加代领按钮,为mapper文件添加创建人与代领标志

lwx_dev
erdanergou 3 years ago
parent
commit
2ce2725c7a
  1. 10
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java
  2. 5
      src/main/java/com/dreamchaser/depository_manage/controller/PageController.java
  3. 9
      src/main/java/com/dreamchaser/depository_manage/controller/UserController.java
  4. 11
      src/main/java/com/dreamchaser/depository_manage/entity/ApplicationOutRecord.java
  5. 169
      src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml
  6. 15
      src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationOutRecordP.java
  7. 2
      src/main/java/com/dreamchaser/depository_manage/service/DepositoryService.java
  8. 31
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryServiceImpl.java
  9. 134
      src/main/resources/templates/pages/application/application-out.html
  10. 2
      src/main/resources/templates/pages/applicationForStorageCenter/application-out_admin.html
  11. 4
      src/main/resources/templates/pages/material/selectDepository.html
  12. 4
      src/main/resources/templates/pages/material/selectDepositoryByCard.html

10
src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java

@ -1007,7 +1007,7 @@ public class DepositoryController {
// 构造树选择框
@GetMapping("/treeMenus")
public RestResponse InitTreeMenus(@RequestParam(value = "adminorg", required = false) Integer adminorg, HttpServletRequest request) {
public RestResponse InitTreeMenus(@RequestParam Map<String, String> map, HttpServletRequest request) {
List<Object> list = new ArrayList<>();
// 获取当前登录的用户
String token = request.getHeader("user-token");
@ -1015,10 +1015,12 @@ public class DepositoryController {
token = (String) request.getSession().getAttribute("userToken");
}
UserByPort userToken = AuthenticationTokenPool.getUserToken(token);
if (Integer.compare(0, adminorg) == 0) {
list = depositoryService.InitTreeMenus("", userToken);
String adminorg = map.get("adminorg");
String type = map.get("type");
if ("".equals(adminorg) || "0".equals(adminorg)) {
list = depositoryService.InitTreeMenus("", type, userToken);
} else {
list = depositoryService.InitTreeMenus(adminorg.toString(), userToken);
list = depositoryService.InitTreeMenus(adminorg, type, userToken);
}
return new RestResponse(list);
}

5
src/main/java/com/dreamchaser/depository_manage/controller/PageController.java

@ -484,6 +484,7 @@ public class PageController {
Integer maindeparment = userToken.getMaindeparment();
mv.addObject("adminorg", maindeparment);
}
mv.addObject("type", type);
mv.setViewName("pages/material/selectDepository");
return mv;
}
@ -561,6 +562,7 @@ public class PageController {
mv.addObject("clickObj", clickObj);
mv.addObject("flagForGroup", flagForGroup);
}
mv.addObject("type", type);
mv.setViewName("pages/material/selectDepositoryByCard");
return mv;
}
@ -1020,12 +1022,11 @@ public class PageController {
ModelAndView mv = new ModelAndView();
mv.setViewName("pages/depository/table-stock");
Integer maindeparment = userToken.getMaindeparment();
mv.addObject("type", "2");
if (PublicConfig.roleAdminorgList.contains(maindeparment)) {
mv.addObject("display", "table-cell");
mv.addObject("type", "2");
} else {
mv.addObject("display", "none");
mv.addObject("type", "1");
}
mv.addObject("number", userToken.getNumber());
String userAgent = request.getHeader("user-agent");

9
src/main/java/com/dreamchaser/depository_manage/controller/UserController.java

@ -204,6 +204,8 @@ public class UserController {
}
// 通过名称获取人员
@PostMapping("/sys/findUserByName")
public RestResponse findUserByName(@RequestBody Map<String,String> map,HttpServletRequest request){
Map<String, Object> paramForUser = new HashMap<>();
@ -214,6 +216,13 @@ public class UserController {
token = (String) request.getSession().getAttribute("userToken");
userkey = (String) request.getSession().getAttribute("userKey");
}
// 获取当前获取用户时查询范围
String scope = map.get("scope");
if("department".equals(scope)){
UserByPort userToken = AuthenticationTokenPool.getUserToken(token);
// 如果是部门级别
paramForUser.put("adminorg",userToken.getMaindeparment());
}
List<UserByPort> userByPortList = LinkInterfaceUtil.FindUserByMap(paramForUser, userkey, token);
List<UserByPortP> userByPortP = new ArrayList<>();
for (UserByPort userByPort : userByPortList) {

11
src/main/java/com/dreamchaser/depository_manage/entity/ApplicationOutRecord.java

@ -203,5 +203,16 @@ public class ApplicationOutRecord {
/**
* 创建人id
*/
private Integer createUid;
/**
* 用于标志是否为代领1是2不是
*/
private Integer flagForAgency;
}

169
src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml

@ -124,6 +124,9 @@
<result column="flagForOpenDepository" property="flagForOpenDepository" jdbcType="INTEGER"/>
<result column="editUser" property="editUser" jdbcType="VARCHAR"/>
<result column="mbrand" property="mbrand" jdbcType="VARCHAR"/>
<result column="flagForAgency" property="flagForAgency" jdbcType="INTEGER"/>
<result column="createUid" property="createUid" jdbcType="INTEGER"/>
</resultMap>
@ -151,7 +154,7 @@
</sql>
<sql id="simpleApplicationIn">
airid,applicant_id,applicant_time,applyRemark
airid,applicant_id,applicant_time,applyRemark
</sql>
<!-- 表查询字段 -->
<sql id="allColumns">
@ -177,7 +180,7 @@
<sql id="ApplicationOutRecordInfo">
aorid,mid,mname,depositoryId,dname,applicantId,applicantTime,applyRemark,aorcode,aorpirce,aorquantity,departmenthead,departmentheadPass,departmentHeadTime,departmentheadMessage,
depositoryManager,depositoryManagerPass,depositoryManagerTime,depositoryManagerMessage,aorstate,istransfer,mcode,placeId,pass,aormUnit,aorconstructionunitid,aoradminorgid,cuname,
cuintroduce,cuaddress,outTime,abstract,outType,editUser,mbrand,mversion,flagForOpenDepository
cuintroduce,cuaddress,outTime,abstract,outType,editUser,mbrand,mversion,flagForOpenDepository,createUid,flagForAgency
</sql>
<sql id="ApplicationOutRecordMinInfo">
@ -185,8 +188,7 @@
</sql>
<!-- 查询所有数据行数 -->
<select id="findCount" resultType="integer">
SELECT
count(*)
SELECT count(*)
FROM depository_record dr
</select>
<!-- 查询相应用户的任务数 -->
@ -362,9 +364,6 @@
</select>
<!--根据条件查询入库记录-->
<select id="findApplicationInRecordByDepository" parameterType="String" resultMap="applicationInRecord">
select
@ -403,19 +402,19 @@
</if>
<if test="mname != null and mname != ''">
and mname like CONCAT('%', #{mname}, '%')
and mname like CONCAT('%', #{mname}, '%')
</if>
<if test="version != null and version != ''">
and mversion like CONCAT('%', #{version}, '%')
and mversion like CONCAT('%', #{version}, '%')
</if>
<if test="mcode != null and mcode != ''">
and mcode like CONCAT('%', #{mcode}, '%')
and mcode like CONCAT('%', #{mcode}, '%')
</if>
<if test="code != null and code != ''">
and aircode like CONCAT('%', #{code}, '%')
and aircode like CONCAT('%', #{code}, '%')
</if>
<if test="startDate != null and startDate != ''">
and applicant_time &gt;= #{startDate}
and applicant_time &gt;= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
and applicant_time &lt;= #{endDate}
@ -455,19 +454,19 @@
</if>
<if test="mname != null and mname != ''">
and mname like CONCAT('%', #{mname}, '%')
and mname like CONCAT('%', #{mname}, '%')
</if>
<if test="version != null and version != ''">
and mversion like CONCAT('%', #{version}, '%')
and mversion like CONCAT('%', #{version}, '%')
</if>
<if test="mcode != null and mcode != ''">
and mcode like CONCAT('%', #{mcode}, '%')
and mcode like CONCAT('%', #{mcode}, '%')
</if>
<if test="code != null and code != ''">
and aircode like CONCAT('%', #{code}, '%')
and aircode like CONCAT('%', #{code}, '%')
</if>
<if test="startDate != null and startDate != ''">
and applicant_time &gt;= #{startDate}
and applicant_time &gt;= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
and applicant_time &lt;= #{endDate}
@ -626,14 +625,14 @@
</select>
<select id="findApplicationOutRecordPByUser" parameterType="map" resultMap="applicationOutRecord">
<select id="findApplicationOutRecordPByUser" parameterType="map" resultMap="applicationOutRecord">
select
<include refid="ApplicationOutRecordInfo"/>
from applicationOutRecordInfo
where 1 = 1
<if test="depositoryIdList != null">
and ( depositoryId
in
in
<foreach collection="depositoryIdList" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
@ -660,10 +659,10 @@
and aorcode = #{code}
</if>
<if test="startDate != null and startDate != ''">
and applicantTime &gt;= #{startDate}
and applicantTime &gt;= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
and applicantTime &lt;= #{endDate}
and applicantTime &lt;= #{endDate}
</if>
<if test="adminorgid != null and adminorgid != ''">
and adminorgid = #{adminorgid}
@ -712,10 +711,10 @@
and aorcode = #{code}
</if>
<if test="startDate != null and startDate != ''">
and applicantTime &gt;= #{startDate}
and applicantTime &gt;= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
and applicantTime &lt;= #{endDate}
and applicantTime &lt;= #{endDate}
</if>
<if test="adminorgid != null and adminorgid != ''">
and adminorgid = #{adminorgid}
@ -736,7 +735,7 @@
select
<include refid="ApplicationInRecordInfo"/>
from applicationInRecordInfo
where 1 = 1
where 1 = 1
and airid in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
@ -744,13 +743,11 @@
</select>
<select id="findApplicationInRecordPByDepositoryList" resultMap="applicationInRecord" parameterType="list">
select
<include refid="ApplicationInRecordInfo"/>
from applicationInRecordInfo
where 1 = 1
where 1 = 1
and airapproverPass in (1,4)
and did in
<foreach collection="list" index="index" item="depositoryId" open="(" separator="," close=")">
@ -760,13 +757,11 @@
</select>
<select id="findApplicationInRecordPForAPeriodOfTime" resultMap="applicationInRecord">
select
<include refid="ApplicationInRecordInfo"/>
from applicationInRecordInfo
where 1 = 1
where 1 = 1
and airapproverPass in (1,4)
and applicant_time between #{start} and #{end}
<if test="list != null">
@ -790,7 +785,7 @@
<include refid="ApplicationOutRecordInfo"/>
from applicationOutRecordInfo
where 1 = 1
and applicantTime between #{start} and #{end}
and applicantTime between #{start} and #{end}
<if test="list != null">
and depositoryId in
<foreach collection="list" index="index" item="depositoryId" open="(" separator="," close=")">
@ -813,7 +808,7 @@
select
<include refid="ApplicationOutRecordInfo"/>
from applicationOutRecordInfo
where 1 = 1
where 1 = 1
and aorid in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
@ -822,7 +817,6 @@
</select>
<select id="findApplicationOutByCode" parameterType="string" resultMap="applicationOutRecord">
select
<include refid="ApplicationOutRecordInfo"/>
@ -1048,28 +1042,28 @@
<!-- 插入一条入库记录-->
<insert id="insertApplicationInRecord" parameterType="map" useGeneratedKeys="true" keyProperty="id">
insert into application_in_record (id,mid,quantity,price,applicant_id,applicant_time,depository_id,code,applyRemark,unit,flagForGroup,placeId,approverPass,approverTime,approverId,state,approverMessage,mproducedDate,toGroupId)
values(
#{id},
#{mid},
#{quantity},
#{price},
#{applicantId},
#{applicant_time},
#{depositoryId},
#{code},
#{applyRemark},
#{unit},
#{flagForGroup},
#{placeId},
#{approverPass},
#{approverTime},
#{approverId},
#{state},
#{approverMessage},
#{producedDate},
#{toGroupId}
)
insert into application_in_record (id, mid, quantity, price, applicant_id, applicant_time, depository_id, code,
applyRemark, unit, flagForGroup, placeId, approverPass, approverTime,
approverId, state, approverMessage, mproducedDate, toGroupId)
values (#{id},
#{mid},
#{quantity},
#{price},
#{applicantId},
#{applicant_time},
#{depositoryId},
#{code},
#{applyRemark},
#{unit},
#{flagForGroup},
#{placeId},
#{approverPass},
#{approverTime},
#{approverId},
#{state},
#{approverMessage},
#{producedDate},
#{toGroupId})
</insert>
<!-- 插入一条出库记录-->
@ -1078,7 +1072,7 @@
(id,applicant_id,applicant_time,code,depository_id,price,quantity,departmenthead,departmenthead_pass,departmenthead_time,
departmenthead_messgae,depository_manager,depository_manager_pass,depository_manager_time,
depository_manager_message,apply_remark,state,istransfer,placeId,pass,constructionunitid,
adminorgid,outType,abstract,flagForOpenDepository)
adminorgid,outType,abstract,flagForOpenDepository,createUid,flagForAgency)
values(
#{id},
#{applicantId},
@ -1125,27 +1119,28 @@
#{adminorgId},
#{outType},
#{abstract},
#{flagForOpenDepository}
#{flagForOpenDepository},
#{createUid},
#{flagForAgency}
)
</insert>
<!-- 插入一条出库子订单-->
<insert id="insertApplicationOutRecordMin" parameterType="map" useGeneratedKeys="true" keyProperty="id">
insert into application_out_record_min (id,mid,quantity,code,depositoryId,placeId,checkId,parentId,transferId,trueOut,unit,project)
values(
#{id},
#{mid},
#{quantity},
#{code},
#{depositoryId},
#{placeId},
#{checkId},
#{parentId},
#{transferId},
#{trueOut},
#{unit},
#{project}
)
insert into application_out_record_min (id, mid, quantity, code, depositoryId, placeId, checkId, parentId,
transferId, trueOut, unit, project)
values (#{id},
#{mid},
#{quantity},
#{code},
#{depositoryId},
#{placeId},
#{checkId},
#{parentId},
#{transferId},
#{trueOut},
#{unit},
#{project})
</insert>
<!-- 查找子订单-->
@ -1406,8 +1401,8 @@
<if test="parentId != null ">
parentId = #{parentId},
</if>
<if test="project != null ">
project = #{project},
<if test="project != null ">
project = #{project},
</if>
<if test="trueOut != null">
trueOut = #{trueOut}
@ -1594,7 +1589,9 @@
<!-- 根据主键删除数据 -->
<delete id="deleteDepositoryRecordById" parameterType="integer">
DELETE FROM depository_record WHERE id = #{id}
DELETE
FROM depository_record
WHERE id = #{id}
</delete>
<!-- 根据主键批量删除数据 -->
@ -1747,20 +1744,18 @@
<select id="findWarehouseRecord" parameterType="map" resultType="int">
select
count(*)
from
depository_record dr
where
dr.state like '%已%'
select count(*)
from depository_record dr
where dr.state like '%已%'
and dr.check_time between #{start} and #{end}
</select>
<!-- 根据主键删除数据 -->
<delete id="deleteApplicationInRecordById" parameterType="integer">
DELETE FROM application_in_record WHERE id = #{id}
DELETE
FROM application_in_record
WHERE id = #{id}
</delete>
<!-- 根据主键批量删除数据 -->
@ -1773,7 +1768,9 @@
<!-- 根据主键删除数据 -->
<delete id="deleteApplicationOutRecordById" parameterType="integer">
DELETE FROM application_out_record WHERE id = #{id}
DELETE
FROM application_out_record
WHERE id = #{id}
</delete>
<!-- 根据主键批量删除数据 -->
@ -1785,7 +1782,9 @@
</delete>
<delete id="deleteApplicationOutRecordMinById">
delete from application_out_record_min where parentId = #{id}
delete
from application_out_record_min
where parentId = #{id}
</delete>
<delete id="deleteApplicationOutRecordMinByIds" parameterType="list">

15
src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationOutRecordP.java

@ -205,6 +205,19 @@ public class ApplicationOutRecordP {
private String mversion;
/**
* 创建人id
*/
private Integer createUid;
/**
* 用于标志是否为代领1是2不是
*/
private Integer flagForAgency;
/**
* 2代表是通过开放仓库申请1代表不是
*/
@ -249,6 +262,8 @@ public class ApplicationOutRecordP {
this.mbrand = aor.getMbrand() == null ? "" : aor.getMbrand();
this.mversion = aor.getMversion() == null ? "" : aor.getMversion();
this.flagForOpenDepository = aor.getFlagForOpenDepository();
this.flagForAgency = aor.getFlagForAgency();
this.createUid = aor.getCreateUid();
}
}

2
src/main/java/com/dreamchaser/depository_manage/service/DepositoryService.java

@ -153,7 +153,7 @@ public interface DepositoryService {
* @param adminorg
* @return
*/
List<Object> InitTreeMenus(String adminorg,UserByPort userByPort);
List<Object> InitTreeMenus(String adminorg,String type,UserByPort userByPort);
/**

31
src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryServiceImpl.java

@ -433,7 +433,7 @@ public class DepositoryServiceImpl implements DepositoryService {
depositoryIdList.add(depository.getId());
}
}
if(PublicConfig.roleAdminorgList.contains(userByPort.getMaindeparment())){
if (PublicConfig.roleAdminorgList.contains(userByPort.getMaindeparment())) {
return depositoryIdList;
}
//用于查询当前用户所拥有及所管理的仓库
@ -443,9 +443,9 @@ public class DepositoryServiceImpl implements DepositoryService {
}
@Override
public List<Object> InitTreeMenus(String adminorg, UserByPort userByPort) {
public List<Object> InitTreeMenus(String adminorg, String type, UserByPort userByPort) {
List<Object> list = new ArrayList<>();
list = buildTree_New(InitTreeMenus_New(adminorg, userByPort), 0);
list = buildTree_New(InitTreeMenus_New(adminorg, type, userByPort), 0);
return list;
}
@ -473,7 +473,7 @@ public class DepositoryServiceImpl implements DepositoryService {
return depositoryMapper.selectDepositoryByIds(ids);
}
public List<Object> InitTreeMenus_New(String adminorg, UserByPort userByPort) {
public List<Object> InitTreeMenus_New(String adminorg, String type, UserByPort userByPort) {
// 定义结果集
List<Object> list = new ArrayList<>();
@ -504,7 +504,7 @@ public class DepositoryServiceImpl implements DepositoryService {
Depository depository = depositoryAll.get(i);
if (((i + 1) % 10) == 0) { // 如果有10个开启线程进行处理
depositoryIdList.add(depository.getId());
Future<Object> future = completionService.submit(new Task(depositoryIdList, adminorg, userByPort));
Future<Object> future = completionService.submit(new Task(depositoryIdList, type, adminorg, userByPort));
openThreadSize++;
futureList.add(future); // 添加到结果集
depositoryIdList = new ArrayList<>(); // 情况列表
@ -516,7 +516,7 @@ public class DepositoryServiceImpl implements DepositoryService {
if (depositoryIdList.size() > 0) {
// 如果有剩余,开启线程进行处理
Future<Object> future = completionService.submit(new Task(depositoryIdList, adminorg, userByPort));
Future<Object> future = completionService.submit(new Task(depositoryIdList,type, adminorg, userByPort));
futureList.add(future);
openThreadSize++;
}
@ -963,11 +963,14 @@ public class DepositoryServiceImpl implements DepositoryService {
String adminorg;
// 当前登录用户
UserByPort userByPort;
// 当前选择仓库的类型
String type;
public Task(List<Integer> depositoryIdList, String adminorg, UserByPort userByPort) {
public Task(List<Integer> depositoryIdList, String type,String adminorg, UserByPort userByPort) {
this.depositoryIdList = depositoryIdList;
this.adminorg = adminorg;
this.userByPort = userByPort;
this.type = type;
}
@Override
@ -977,7 +980,17 @@ public class DepositoryServiceImpl implements DepositoryService {
*/
List<Depository> depositories = depositoryMapper.selectDepositoryByIds(depositoryIdList);
// 获取当前用户管理的仓库
List<Integer> integerList = new ArrayList<>();
if("1".equals(type)){
// 如果是因为入库、库存转移而打开的仓库列表
integerList = roleService.findDepositoryIdForUser(userByPort);
}else{
// 如果是其他
integerList = roleService.findDepositoryIdForUserHas(userByPort);
}
/* // 获取当前用户管理的仓库
List<RoleAndDepository> depositoryAndRole = roleMapper.findDepositoryAndRole(userByPort.getId());
depositoryAndRole.addAll(roleMapper.findDepositoryAndRole(userByPort.getPosition()));
Map<String, Object> paramForFindDepositoryId = new HashMap<>();
@ -998,7 +1011,7 @@ public class DepositoryServiceImpl implements DepositoryService {
if (!integerList.contains(depositoryId)) {
integerList.add(depositoryId);
}
}
}*/
// 定义树结构结果集
List<Object> list = new ArrayList<>();

134
src/main/resources/templates/pages/application/application-out.html

@ -60,6 +60,41 @@
<div carousel-item style="overflow: inherit">
<div>
<form class="layui-form layui-form-pane" style="margin: 0 auto;max-width: 460px;">
<div class="layui-card" id="agency">
<div class="layui-form-item">
<label class="layui-form-label">是否代领:</label>
<div class="layui-input-block">
<input type="checkbox" name="flagForAgency" lay-skin="switch"
lay-text="是|否">
</div>
</div>
<div id="agencyItem" style="display: none">
<div class="layui-form-item">
<label class="layui-form-label">人员:</label>
<div class="layui-input-block">
<input type="text" placeholder="请选择人员" class="layui-input"
id="agencyUser"
onblur="selectUser(this)"
/>
<input type="text" name="agencyUid" class="layui-input"
id="agencyUid"
style="display: none"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">部门:</label>
<div class="layui-input-block">
<input type="text" placeholder="请选择部门" class="layui-input"
readonly id="agencyAdminorg"
/>
<input type="text" name="adminorgId" class="layui-input"
id="adminorgId"
style="display: none"/>
</div>
</div>
</div>
</div>
<div class="layui-card" id="cardParent">
<div class="layui-card-body" id="cardItem">
<hr>
@ -346,6 +381,11 @@
function scanCodeByOut(obj) {
}
// 用于选择代领的人员
function selectUser() {
}
// 用于暂存卡片个数
var params = [];
@ -353,6 +393,9 @@
let flagForForm = false;
let GroupflagForForm = false;
// 用于打开的人员选择页
var selectUserIfame = 0;
// 用于暂存卡片个数(组合)
var params2 = [];
// 用于卡片编号
@ -372,7 +415,7 @@
elem: '#stepForm',
filter: 'stepForm',
width: '100%', //设置容器宽度
height: '600px',
height: '650px',
stepItems: [{
title: '填写信息'
}, {
@ -421,7 +464,9 @@
data.params = remove(data.params, Number(keyNumber));
}
$.ajax({
console.log(data)
/*$.ajax({
url: "/depositoryRecord/applicationOut",
type: 'post',
dataType: 'json',
@ -451,7 +496,7 @@
complete: function () {
layer.close(this.layerIndex);
}
});
});*/
}
return false;
});
@ -519,6 +564,22 @@
});
// 监听开关
form.on('switch()', function (data) {
let isAgency = data.elem.checked; //开关是否开启,true或者false
if (isAgency) {
// 如果开启了代领功能
$("#agencyItem").show();
// 添加必填
$("#agencyUid").attr("lay-verify", "required");
} else {
$("#agencyItem").hide();
// 删除必填
$("#agencyUid").removeAttr("lay-verify");
}
});
$('.pre').click(function () {
step.pre('#stepForm');
step.pre('#stepForm2');
@ -1659,6 +1720,7 @@
}
};
// 监听下拉选择框
form.on('select()', function (data) {
let id = data.elem.id;
@ -1718,6 +1780,72 @@
});
// 用于选择代领用户
selectUser = function (obj) {
let name = obj.value;
if (name !== "") {
let req = {};
req.name = name;
req.scope = "department";
$.ajax({
url: "/sys/findUserByName",
type: "post",
data: JSON.stringify(req),
dataType: 'json',
contentType: "application/json;charset=utf-8",
beforeSend: function () {
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']});
},
success: function (res) {
layer.close(this.layerIndex);
let data = res.data;
let count = res.count;
if (count === 0) {
layer.msg("部门中不存在该用户,请重试", {
icon: 0,
time: 1000
})
} else if (count > 1) {
let content = ``;
$.each(data, function (index, item) {
let listItem = `<div class="userItem">
<button type="button" onclick="SelectTheUser(this)" name=` + item.name + ` id=` + item.id + ` adminorgname=` + item.maindeparmentname + ` adminorg=` + item.maindeparment + ` class="layui-btn layui-btn-fluid">` + item.number + "-" + item.name + `</button>
</div>`;
content += listItem;
});
selectUserIfame = layer.open({
type: 1,
title: false,
area: ["70%", "70%"],
content: content
})
} else {
let user = data[0];
$("#adminorgId").val(user.maindeparment);
$("#agencyAdminorg").val(user.maindeparmentname);
$("#agencyUid").val(user.id);
$("#agencyUser").val(user.name);
}
}
})
}
};
// 用于选定人员
SelectTheUser = function (obj) {
let data = $(obj);
let adminorg = data.attr("adminorg");
let adminorgName = data.attr("adminorgname");
let id = data.attr("id");
let name = data.attr("name");
$("#adminorgId").val(adminorg);
$("#agencyAdminorg").val(adminorgName);
$("#agencyUid").val(id);
$("#agencyUser").val(name);
layer.close(selectUserIfame)
};
})
</script>

2
src/main/resources/templates/pages/applicationForStorageCenter/application-out_admin.html

@ -1877,6 +1877,7 @@
if (name !== "") {
let req = {};
req.name = name;
req.scope = "company";
$.ajax({
url: "/sys/findUserByName",
type: "post",
@ -1922,6 +1923,7 @@
};
// 用于选定人员
SelectTheUser = function (obj) {
let data = $(obj);
let adminorg = data.attr("adminorg");

4
src/main/resources/templates/pages/material/selectDepository.html

@ -11,6 +11,7 @@
</head>
<body>
<input id="adminorg" name="adminorg" th:value="${adminorg}" style="display: none">
<input id="type" name="type" th:value="${type}" style="display: none">
<div id="test2" class="demo-tree"></div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
@ -21,6 +22,7 @@
var $ = layui.jquery,
tree = layui.tree;
var adminorg = $("#adminorg").val();
var type = $("#type").val();
test = tree.render({
elem: '#test2'
,data: []
@ -60,7 +62,7 @@
}
});
$.ajax({
url: "/repository/treeMenus?adminorg=0"+adminorg,
url: "/repository/treeMenus?adminorg=0"+adminorg+"&type="+type,
type: 'get',
dataType: 'json',
contentType: "application/json;charset=utf-8",

4
src/main/resources/templates/pages/material/selectDepositoryByCard.html

@ -12,6 +12,7 @@
<body>
<input id="adminorg" name="adminorg" th:value="${adminorg}" style="display: none">
<input id="clickObj" name="clickObj" th:value="${clickObj}" style="display: none">
<input id="type" name="type" th:value="${type}" style="display: none">
<input id="flagForGroup" name="flagForGroup" th:value="${flagForGroup}" style="display: none">
<div id="test2" class="demo-tree"></div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
@ -23,6 +24,7 @@
var $ = layui.jquery,
tree = layui.tree;
var adminorg = $("#adminorg").val();
var type = $("#type").val();
var clickObj = $("#clickObj").val();
var flagForGroup = $("#flagForGroup").val();
test = tree.render({
@ -86,7 +88,7 @@
}
});
$.ajax({
url: "/repository/treeMenus?adminorg=0" + adminorg,
url: "/repository/treeMenus?adminorg=0" + adminorg+"&type="+type,
type: 'get',
dataType: 'json',
contentType: "application/json;charset=utf-8",

Loading…
Cancel
Save