Browse Source

修改各移动端页面的搜索功能

lwx_dev
erdanergou 3 years ago
parent
commit
7cfbaaf667
  1. 6
      src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml
  2. 4
      src/main/java/com/dreamchaser/depository_manage/mapper/GroupMapper.xml
  3. 34
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  4. 62
      src/main/resources/templates/pages/depository/table-in_mobile.html
  5. 51
      src/main/resources/templates/pages/depository/table-out_mobile.html
  6. 1
      src/main/resources/templates/pages/depository/table-stock_mobile.html
  7. 50
      src/main/resources/templates/pages/group/group-out_mobile.html
  8. 44
      src/main/resources/templates/pages/material/material-out_mobile.html
  9. 51
      src/main/resources/templates/pages/split/split-out_mobile.html
  10. 6
      target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml

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

@ -612,8 +612,9 @@
#{id}
</foreach>
<if test="applicantId != null and applicantId != ''">
or applicantId = #{applicantId} )
or applicantId = #{applicantId}
</if>
)
</if>
<if test="depositoryIdList == null">
<if test="applicantId != null and applicantId != ''">
@ -663,8 +664,9 @@
#{id}
</foreach>
<if test="applicantId != null and applicantId != ''">
or applicantId = #{applicantId} )
or applicantId = #{applicantId}
</if>
)
</if>
<if test="depositoryIdList == null">
<if test="applicantId != null and applicantId != ''">

4
src/main/java/com/dreamchaser/depository_manage/mapper/GroupMapper.xml

@ -129,8 +129,12 @@
<if test="state != null and state != ''">
and state = #{state}
</if>
<if test="gname != null and gname != ''">
and gname like concat('%',#{gname},'%')
</if>
</select>
<select id="findGroupById" resultMap="groupInfoMap" parameterType="int">
select
<include refid="allColumnsForView"/>

34
src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java

@ -2013,8 +2013,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
result = depositoryRecordMapper.updateApplicationOutRecordMin(outRecordMin);
}
}
else {
} else {
// 如果未开始出库的
// 设置新数量
@ -2043,8 +2042,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
outRecord.setPrice(outRecord.getPrice() - inventoryById.getPrice() * (outQuantity / 100) + inventoryById.getPrice() * quantity);
}
}
else {
} else {
// 如果是拆单单位
if (inventoryById.getPrice() != null) {
@ -2076,7 +2074,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
depositoryRecordMapper.updateApplicationOutRecord(updateOutRecord);
return result;
}
@ -4083,8 +4080,16 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
String applyTime = (String) map.get("applyTime");
map.put("applicantTime", DateUtil.DateTimeByDayToTimeStamp(applyTime));
}
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userByPort.getId());
List<Integer> depositoryIdList = new ArrayList<>();
if(map.size() <= 2){
map.put("applicantId", userByPort.getId());
}
if (map.containsKey("depositoryId")) {
depositoryIdList.add(ObjectFormatUtil.toInteger(map.get("depositoryId")));
}
else {
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userByPort.getId());
for (RoleAndDepository depository : depositoryAndRole
) {
depositoryIdList.add(depository.getDepositoryId());
@ -4092,8 +4097,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
if (depositoryIdList.size() == 0) {
depositoryIdList = null;
}
}
map.put("depositoryIdList", depositoryIdList);
map.put("applicantId", userByPort.getId());
List<ApplicationOutRecord> list = depositoryRecordMapper.findApplicationOutRecordPByUser(map);
List<ApplicationOutRecordP> result = new ArrayList<>();
for (ApplicationOutRecord record : list) {
@ -4120,8 +4127,16 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
String applyTime = (String) map.get("applyTime");
map.put("applicantTime", DateUtil.DateTimeByDayToTimeStamp(applyTime));
}
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userByPort.getId());
List<Integer> depositoryIdList = new ArrayList<>();
if(map.size() <= 2){
map.put("applicantId", userByPort.getId());
}
if (map.containsKey("depositoryId")) {
depositoryIdList.add(ObjectFormatUtil.toInteger(map.get("depositoryId")));
}
else {
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userByPort.getId());
for (RoleAndDepository depository : depositoryAndRole
) {
depositoryIdList.add(depository.getDepositoryId());
@ -4129,8 +4144,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
if (depositoryIdList.size() == 0) {
depositoryIdList = null;
}
}
map.put("depositoryIdList", depositoryIdList);
map.put("applicantId", userByPort.getId());
return depositoryRecordMapper.findApplicationOutRecordPCountByUser(map);
}

62
src/main/resources/templates/pages/depository/table-in_mobile.html

@ -83,8 +83,6 @@
function openDepositoryTree(obj) {
}
function selectMaterialByName(obj) {
}
function showDetail(){
}
@ -103,7 +101,6 @@
, done: function (page, next) { //执行下一页的回调
let result;
let lis = [];
$.get('/depositoryRecord/applicationInView?page=' + page + '&size=' + size, function (res) {
result = res.data;
lis.push("<div class='clearfix'>");
@ -182,26 +179,53 @@
req.version = data.version.trim();
}
updateFlow(req);
//执行搜索重载
return false;
});
//用于实现物料名称搜索
selectMaterialByName = function (obj) {
// 输入code
var data = obj.value;
// 获取对应元素
var req = {};
layer.open({
type: 2,
title: '弹窗内容',
skin: 'layui-layer-rim',
maxmin: true,
shadeClose: true, //点击遮罩关闭层
area: ['70%', '70%'],
content: '/getMaterialAll?type=1&mname=""',
move: '.layui-layer-title',
fixed: false
updateFlow = function(req) {
$("#LAY_applicationIn").empty();
takingPre = 0;
flow.load({
elem: '#LAY_applicationIn' //流加载容器
, done: function (page, next) { //执行下一页的回调
let result = [];
let lis = [];
req.page = page;
req.size = size;
$.ajax({
url:"/depositoryRecord/applicationInView",
type:"get",
data: req,
dataType: "json",
contentType: "application/json;charset=utf-8",
success: function (res) {
result = res.data;
lis.push("<div class='clearfix'>");
for (let i = 0; i < result.length; i++) {
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail('
+ result[i].id + ')"><div class="layui-card-header"><h2>' + result[i].applicantName+"的入库申请" + '</h2></div>');
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">'
+'<p style="font-size: large">' + result[i].mname + '</p>'
+'<p>' + result[i].mversion + '</p>'
+'<p>' + result[i].mbrand + '</p>'
+'<p>' + result[i].quantity+" : "+result[i].airUnit + '</p>'
+ '<p>' +result[i].depositoryName + '</p>'
+ '<p style="text-align: right">' +result[i].applicantTime + '</p>'
+ '</div></div></li>');
}
lis.push('</div>');
takingPre += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), takingPre < res.count);
}
});
}
});
};

51
src/main/resources/templates/pages/depository/table-out_mobile.html

@ -220,16 +220,53 @@
req.version = data.version.trim();
}
//执行搜索重载
table.reload('currentTableId', {
url: '/depositoryRecord/applicationOutView',
page: {
curr: 1
}
, where: req
}, 'data');
updateFlow(req);
return false;
});
updateFlow = function(req) {
$("#LAY_applicationOut").empty();
takingPre = 0;
flow.load({
elem: '#LAY_applicationOut' //流加载容器
, done: function (page, next) { //执行下一页的回调
let result = [];
let lis = [];
req.page = page;
req.size = size;
$.ajax({
url:"/depositoryRecord/applicationOutView",
type:"get",
data: req,
dataType: "json",
contentType: "application/json;charset=utf-8",
success: function (res) {
result = res.data;
lis.push("<div class='clearfix'>");
for (let i = 0; i < result.length; i++) {
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail('
+ result[i].id + ')"><div class="layui-card-header"><h2>' + result[i].applicantName+"的出库申请" + '</h2></div>');
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">'
+'<p style="font-size: large">' + result[i].mname + '</p>'
+'<p>' + result[i].mversion + '</p>'
+'<p>' + result[i].mbrand + '</p>'
+ '<p>' +result[i].depositoryName + '</p>'
+ '<p style="text-align: right">' +result[i].applicantTime + '</p>'
+ '</div></div></li>');
}
lis.push('</div>');
takingPre += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), takingPre < res.count);
}
});
}
});
};
showDetail = function(obj){
var index = layer.open({
title: '出库信息详情',

1
src/main/resources/templates/pages/depository/table-stock_mobile.html

@ -131,7 +131,6 @@
layui.use(['form', 'upload', 'flow', 'element'], function () {
var $ = layui.jquery,
form = layui.form,
upload = layui.upload,
flow = layui.flow,
element = layui.element;

50
src/main/resources/templates/pages/group/group-out_mobile.html

@ -132,17 +132,51 @@
req.gname = data.name;
}
//执行搜索重载
table.reload('currentTableId', {
url: '/group/findAllGroup',
page: {
curr: 1
},
where: req
}, 'data');
updateFlow(req);
return false;
});
updateFlow = function(req) {
$("#LAY_group").empty();
takingPre = 0;
flow.load({
elem: '#LAY_group' //流加载容器
, done: function (page, next) { //执行下一页的回调
let result;
let lis = [];
req.page = page;
req.size = size;
$.ajax({
url:"/group/findAllGroup",
type:"get",
data: req,
dataType: "json",
contentType: "application/json;charset=utf-8",
success: function (res) {
result = res.data;
lis.push("<div class='clearfix'>");
for (let i = 0; i < result.length; i++) {
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail('
+ result[i].id + ')"><div class="layui-card-header"><h2>' + result[i].gname + '</h2></div>');
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">'
+'<p style="font-size: large">' + result[i].code + '</p>'
+'<p>' + Object.keys(result[i].materialSimple).toString() + '</p>'
+ '<p>' +result[i].remark + '</p>'
+ '<p style="text-align: right">' +result[i].createTime + '</p>'
+ '</div></div></li>');
}
lis.push('</div>');
takingPre += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), takingPre < res.count);
}
});
}
});
};
//用于查看并修改组合中的物料信息
showDetail = function (obj) {

44
src/main/resources/templates/pages/material/material-out_mobile.html

@ -192,10 +192,52 @@
if (data.code !== '') {
req.code = data.code
}
updateFlow(req);
return false;
});
updateFlow = function(req) {
$("#LAY_material").empty();
takingPre = 0;
flow.load({
elem: '#LAY_material' //流加载容器
, done: function (page, next) { //执行下一页的回调
let result;
let lis = [];
req.page = page;
req.size = size;
$.ajax({
url:"/material/material",
type:"get",
data: req,
dataType: "json",
contentType: "application/json;charset=utf-8",
success: function (res) {
result = res.data;
lis.push("<div class='clearfix'>");
for (let i = 0; i < result.length; i++) {
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail('
+ result[i].id + ')"><div class="layui-card-header"><h2>' + result[i].mname + '</h2></div>');
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">'
+'<p>' + result[i].code + '</p>'
+'<p>' + result[i].version + '</p>'
+ '<p>' + "品牌:"+result[i].brand + '</p>'
+ '</div></div></li>');
}
lis.push('</div>');
takingPre += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), takingPre < res.count);
}
});
}
});
};
showDetail = function (obj) {
var index = layer.open({
title: '物料信息详情',

51
src/main/resources/templates/pages/split/split-out_mobile.html

@ -95,14 +95,7 @@
req.version = data.version
}
//执行搜索重载
table.reload('currentTableId', {
url: '/split/split_out',
page: {
curr: 1
},
where: req
}, 'data');
updateFlow(req);
return false;
});
@ -136,6 +129,48 @@
}
});
updateFlow = function(req) {
$("#LAY_splitInfo").empty();
takingPre = 0;
flow.load({
elem: '#LAY_splitInfo' //流加载容器
, done: function (page, next) { //执行下一页的回调
let result;
let lis = [];
req.page = page;
req.size = size;
$.ajax({
url:"/split/split_out",
type:"get",
data: req,
dataType: "json",
contentType: "application/json;charset=utf-8",
success: function (res) {
result = res.data;
lis.push("<div class='clearfix'>");
for (let i = 0; i < result.length; i++) {
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail('
+ result[i].id + ')"><div class="layui-card-header"><h2>' + result[i].mname + '</h2></div>');
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">'
+'<p style="font-size: large">' + result[i].mcode + '</p>'
+'<p>' + result[i].version + '</p>'
+ '<p>' +result[i].brand + '</p>'
+ '<p>' +"旧单位:"+result[i].oldUnit + '</p>'
+ '<p>' +"新单位:"+result[i].quantity+" : "+result[i].newUnit + '</p>'
+ '</div></div></li>');
}
lis.push('</div>');
takingPre += result.length;
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next(lis.join(''), takingPre < res.count);
}
});
}
});
};
showDetail = function (obj) {

6
target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml

@ -612,8 +612,9 @@
#{id}
</foreach>
<if test="applicantId != null and applicantId != ''">
or applicantId = #{applicantId} )
or applicantId = #{applicantId}
</if>
)
</if>
<if test="depositoryIdList == null">
<if test="applicantId != null and applicantId != ''">
@ -663,8 +664,9 @@
#{id}
</foreach>
<if test="applicantId != null and applicantId != ''">
or applicantId = #{applicantId} )
or applicantId = #{applicantId}
</if>
)
</if>
<if test="depositoryIdList == null">
<if test="applicantId != null and applicantId != ''">

Loading…
Cancel
Save