From 4a7a57b869c9bda62555a3c5293d56b8f39c7f44 Mon Sep 17 00:00:00 2001 From: erdanergou Date: Wed, 5 Apr 2023 09:00:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E5=BA=93=E5=AD=98=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E6=A0=B9=E6=8D=AE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/depository/table-stock_mobile.html | 83 ++++++++++--------- .../mapper/MaterialMapper.xml | 3 + .../pages/depository/table-stock.html | 33 ++++++++ 3 files changed, 79 insertions(+), 40 deletions(-) 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 93002d0f..9e1ee363 100644 --- a/src/main/resources/templates/pages/depository/table-stock_mobile.html +++ b/src/main/resources/templates/pages/depository/table-stock_mobile.html @@ -49,9 +49,11 @@
- -
@@ -117,7 +119,7 @@ } - function updateFlow(){ + function updateFlow() { } @@ -146,6 +148,7 @@ $.get('/material/findInventory?page=' + page + '&size=' + size, function (res) { result = res.data; lis.push("
"); + for (let i = 0; i < result.length; i++) { 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('
    '); + let result = []; + req.page = page; + req.size = size; + $.ajax({ + url: "/material/findInventory", + type: "get", + data: req, + dataType: "json", + contentType: "application/json;charset=utf-8", + success: function (res) { + 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); + } + }); - takingPre += result.length; - //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 - //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 - next(lis.join(''), takingPre < res.count); } }) }; @@ -315,7 +316,9 @@ }); return false; } + }); + diff --git a/target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml b/target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml index 681da961..3a317fc3 100644 --- a/target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml +++ b/target/classes/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/target/classes/templates/pages/depository/table-stock.html b/target/classes/templates/pages/depository/table-stock.html index f9a25c53..6409d164 100644 --- a/target/classes/templates/pages/depository/table-stock.html +++ b/target/classes/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',