diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java b/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java index dd3d48cb..06b5ff6e 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java @@ -176,6 +176,9 @@ public class MaterialController { if (!flag) { // 如果不是一次成功 page = ObjectFormatUtil.toInteger(map.get("page")); + if(page == null){ + page = 1; + } if (size - list.size() != size) { // 如果当前不是崭新一页 map.put("begin", 0); diff --git a/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml b/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml index 681da961..3a317fc3 100644 --- a/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml +++ b/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml @@ -633,6 +633,9 @@ from findInventory where depositoryId = #{depositoryId} + + AND mtid = #{materialTypeId} + LIMIT #{begin},#{size} diff --git a/src/main/resources/templates/pages/depository/table-stock.html b/src/main/resources/templates/pages/depository/table-stock.html index f9a25c53..6409d164 100644 --- a/src/main/resources/templates/pages/depository/table-stock.html +++ b/src/main/resources/templates/pages/depository/table-stock.html @@ -29,6 +29,15 @@ +
+ +
+ + +
+
@@ -133,6 +142,27 @@ upload = layui.upload, table = layui.table; + $('#openSonByMateralType').on('click', function () { + layer.open({ + type: 2, + title: '弹窗内容', + skin: 'layui-layer-rim', + maxmin: true, + shadeClose: true, //点击遮罩关闭层 + area: ['70%', '70%'], + move: '.layui-layer-title', + fixed: false, + content: '/selectType', + success: function (layero, index) { + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height', '100%'); + iframeChildren.css('height', '100%'); + } + }); + }); + $('#openSonByDepository').on('click', function () { layer.open({ @@ -286,6 +316,9 @@ if (data.version !== '') { req.version = data.version.trim(); } + if (data.materialTypeId !== '') { + req.materialTypeId = data.materialTypeId; + } //执行搜索重载 table.reload('currentTableId', { url: '/material/findInventory', diff --git a/src/main/resources/templates/pages/depository/table-stock_mobile.html b/src/main/resources/templates/pages/depository/table-stock_mobile.html index 57a81003..93002d0f 100644 --- a/src/main/resources/templates/pages/depository/table-stock_mobile.html +++ b/src/main/resources/templates/pages/depository/table-stock_mobile.html @@ -27,53 +27,69 @@
-
- 搜索信息 -
- -
-
-
- -
- - - +
+
+

搜索

+
+
+ + +
+
+ +
+ + + +
+
+
+ +
+ + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- -
- -
+
- +
-
+
+
    @@ -101,17 +117,21 @@ } + function updateFlow(){ + + } + let socket = null; let newIndexShade; - layui.use(['form', 'table', 'upload', 'flow'], function () { + layui.use(['form', 'upload', 'flow', 'element'], function () { var $ = layui.jquery, form = layui.form, upload = layui.upload, flow = layui.flow, - table = layui.table; + element = layui.element; let takingPre = 0; let size = 8; @@ -131,9 +151,10 @@ lis.push('
  • ' + result[i].mname + '

    '); lis.push('
    ' - +'

    ' + result[i].code + '

    ' - +'

    ' + result[i].version + '

    ' - + '

    ' + "品牌:"+result[i].brand + '

    ' + + '

    ' + result[i].code + '

    ' + + '

    ' + result[i].version + '

    ' + + '

    ' + "品牌:" + result[i].brand + '

    ' + + '

    ' + result[i].typeName + '

    ' + '
  • '); } lis.push('
    '); @@ -166,8 +187,26 @@ }); }); - - + $('#openSonByMateralType').on('click', function () { + layer.open({ + type: 2, + title: '弹窗内容', + skin: 'layui-layer-rim', + maxmin: true, + shadeClose: true, //点击遮罩关闭层 + area: ['70%', '70%'], + move: '.layui-layer-title', + fixed: false, + content: '/selectType', + success: function (layero, index) { + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height', '100%'); + iframeChildren.css('height', '100%'); + } + }); + }); // 用于进行渲染库位编码 @@ -197,10 +236,59 @@ if (data.version !== '') { req.version = data.version.trim(); } + if (data.materialTypeId !== '') { + req.materialTypeId = data.materialTypeId; + } + if(Object.keys(req).length === 0){ + updateFlow({"data":[]}) + }else{ + $.ajax({ + url: "/material/findInventory", + type: "get", + data: req, + dataType: "json", + contentType: "application/json;charset=utf-8", + success:function (res) { + takingPre = 0; + $("#LAY_Inventory").empty(); + updateFlow(res); + } + }); + } + + + //执行搜索重载 return false; }); + updateFlow = function(res){ + flow.load({ + elem: '#LAY_Inventory' //流加载容器 + , done: function (page, next) { //执行下一页的回调 + let lis = []; + let result = res.data; + lis.push("
    "); + for (let i = 0; i < result.length; i++) { + lis.push('
  • ' + result[i].mname + '

    '); + lis.push('
    ' + + '

    ' + result[i].code + '

    ' + + '

    ' + result[i].version + '

    ' + + '

    ' + "品牌:" + result[i].brand + '

    ' + + '

    ' + result[i].typeName + '

    ' + + '
  • '); + } + lis.push('
    '); + + takingPre += result.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis.join(''), takingPre < res.count); + } + }) + }; + closeShowDataMessage = function () { $("#layui-layer-shade-x" + newIndexShade).remove();