From 1e6a3e793b1495b28006fda4b53509ddac19b4ca Mon Sep 17 00:00:00 2001 From: erdanergou Date: Thu, 6 Apr 2023 16:20:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E7=9B=98=E7=82=B9=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stockTakingForMaterial_mobile.js | 84 ++++++++++--------- .../showInventoryForMaterial.html | 2 +- 2 files changed, 45 insertions(+), 41 deletions(-) diff --git a/src/main/resources/static/js/stockTaking/stockTakingForMaterial_mobile.js b/src/main/resources/static/js/stockTaking/stockTakingForMaterial_mobile.js index 219507cc..a8c8d974 100644 --- a/src/main/resources/static/js/stockTaking/stockTakingForMaterial_mobile.js +++ b/src/main/resources/static/js/stockTaking/stockTakingForMaterial_mobile.js @@ -80,47 +80,51 @@ layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { $("#LAY_FlowForMaterial").empty(); takingPre = 0; let req = {}; - req.mid = $("#mid").val(); + let mid = $("#mid").val(); + req.mid = mid; req.size = size; - flow.load({ - elem: '#LAY_FlowForMaterial' //流加载容器 - , done: function (page, next) { //执行下一页的回调 - let result; - let lis = []; - req.page = page; - $.ajax({ - url: '/material/findMaterialByConditionForStockTaking', - data: req, - type: 'get', - dataType: 'json', - contentType: "application/json;charset=utf-8", - success: function (res) { - result = res.data; - lis.push("
"); - for (let i = 0; i < result.length; i++) { - let splitInventory = result[i].splitInventory; - let keys = Object.keys(splitInventory); - let InventoryItem = ""; - for (let j = 0; j < keys.length; j++) { - let key = keys[j]; - let item = '

' + "计量单位:" + key + ";对应库存:" + splitInventory[key] + '

'; - InventoryItem += item; + if(mid !== ""){ + flow.load({ + elem: '#LAY_FlowForMaterial' //流加载容器 + , done: function (page, next) { //执行下一页的回调 + let result; + let lis = []; + req.page = page; + $.ajax({ + url: '/material/findMaterialByConditionForStockTaking', + data: req, + type: 'get', + dataType: 'json', + contentType: "application/json;charset=utf-8", + success: function (res) { + result = res.data; + lis.push("
"); + for (let i = 0; i < result.length; i++) { + let splitInventory = result[i].splitInventory; + let keys = Object.keys(splitInventory); + let InventoryItem = ""; + for (let j = 0; j < keys.length; j++) { + let key = keys[j]; + let item = '

' + "计量单位:" + key + ";对应库存:" + splitInventory[key] + '

'; + InventoryItem += item; + } + lis.push('
  • ' + + '

    ' + "所处位置:" + result[i].dname + "-" + result[i].kingdeecode + '

    '); + lis.push('
    ' + + InventoryItem + + '
  • '); } - lis.push('
  • ' + - '

    ' + "所处位置:" + result[i].dname + "-" + result[i].kingdeecode + '

    '); - lis.push('
    ' - + InventoryItem - + '
  • '); + lis.push('
    '); + takingPre += result.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis.join(''), takingPre < res.count); } - lis.push('
    '); - takingPre += result.length; - //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 - //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 - next(lis.join(''), takingPre < res.count); - } - }); - } - }); + }); + } + }); + } + }; @@ -314,8 +318,8 @@ layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { iframeChildren.css('height', '100%'); }, end: function () { - var mid = $("#mid").val(); - if (mid !== '') { + if (mid !== "") { + console.log(mid) let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/material/findMatrialById?mid=" + mid + "&type=out", diff --git a/target/classes/templates/pages/showInventory/showInventoryForMaterial.html b/target/classes/templates/pages/showInventory/showInventoryForMaterial.html index 4054ba03..2949b697 100644 --- a/target/classes/templates/pages/showInventory/showInventoryForMaterial.html +++ b/target/classes/templates/pages/showInventory/showInventoryForMaterial.html @@ -179,7 +179,7 @@ let InventoryItem = ""; for (let j = 0; j < keys.length; j++) { let key = keys[j]; - let item = '

    ' + "计量单位:" + key + ";库存数量:" + splitInventory[key] + '

    '; + let item = '

    ' + "计量单位:" + key + ";对应库存:" + splitInventory[key] + '

    '; InventoryItem += item; } lis.push('
  • ' + "所处位置:" + result[i].dname+"-"+result[i].kingdeecode + '

    ');