diff --git a/src/main/resources/static/js/stockTaking/stockTakingForLocation_mobile.js b/src/main/resources/static/js/stockTaking/stockTakingForLocation_mobile.js new file mode 100644 index 00000000..81dff5cc --- /dev/null +++ b/src/main/resources/static/js/stockTaking/stockTakingForLocation_mobile.js @@ -0,0 +1,284 @@ + +// 用于扫描条形码或二维码 +function scanCode(obj) { +} + + +// 用于计算盘点结果 +function calculateForLocation(obj) { + +} + + +function updateFlowShowForLocation() { + +} + + +layui.use(['form', 'step', 'flow', 'inputTag'], function () { + var $ = layui.$, + form = layui.form, + flow = layui.flow, + inputTag = layui.inputTag, + dropdown = layui.dropdown, //下拉菜单 + step = layui.step; + departmentManagerIdForLocation = $("#departmentManagerIdForLocation").val(); + + let takingPre = 0; + + + let tagData = []; + let tempData = $("#departmentManagerForLocation").val().split(","); + $.each(tempData, function (index, item) { + if (item !== "") { + tagData.push(item) + } + }); + $("#departmentManagerForLocation").val(""); + + + + + let tagLabel1 = inputTag.render({ + elem: '#departmentManagerForLocation', + data: tagData,//初始值 + removeKeyNum: 8,//删除按键编号 默认,BackSpace 键 + createKeyNum: 13,//创建按键编号 默认,Enter 键 + onChange: function (data, value, type, index) { + if (type === "remove") { + let split = departmentManagerIdForLocation.split(","); + split.splice(index, 1); + departmentManagerIdForLocation = split.toString(); + $("#departmentManagerIdForLocation").val(departmentManagerIdForLocation); + } + } + }); + + // 用于打开负责人树形菜单 + $("#selectdepartmentManagerForLocation").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: '/selectManager?type=Location', + end: function () { + departmentManagerIdForLocation = $("#departmentManagerIdForLocation").val(); + tagLabel1.createItem(); + }, + success: function (layero, index) { + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height', '100%'); + iframeChildren.css('height', '100%'); + } + }); + }); + + + + + // 扫码盘点位置 + scanCode = function () { + parent.wx.scanQRCode({ + desc: 'scanQRCode desc', + needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, + scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 + success: function (res) { + // 回调 + var result = res.resultStr;//当needResult为1时返回处理结果 + var req = {}; + req.qrCode = result; + req.codeFlag = 2; + $.ajax({ + url: "/place/qywxApplicationInScanQrCode", + type: "post", + dataType: 'json', + data: JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (d) { + var data = d.data; + var flag = data["flag"]; + if (flag === 0) { + // 如果没有获取到位置 + layer.msg("并未查询到对应位置,请重新扫描", { + icon: 0, + time: 1000 + }, function () { + depositoryId = -1; + placeId = -1; + + }); + } else if (flag === 1) { + // 如果获取到的是库位 + var place = data["place"]; + $("#placeId").val(place.id); + $("#openSonByDepository").val(place.depositoryName); + $("#depositoryId").val(place.did); + + depositoryId = place.did; + placeId = place.id; + } else if (flag === 2) { + // 如果获取到的是仓库 + var depository = data["depository"]; + $("#placeId").val("0"); + $("#openSonByDepository").val(depository.dname); + $("#depositoryId").val(depository.id); + + depositoryId = depository.id; + placeId = "0"; + + } + updateTableShow(); + } + }) + } + }) + }; + + + + + // 用于计算盘点结果 + calculateForLocation = function (obj) { + let oldInventory = Number(obj.tr[0].childNodes[6].childNodes[0].innerText); + let nowInventory = Number(obj.value); + let number = 0; + let takingResult = ''; + let takingResultString = ''; + let req = {}; + if ((oldInventory) > (nowInventory)) { + number = oldInventory - nowInventory; + takingResult = "Inventory_down"; + takingResultString = "盘亏"; + } else if ((oldInventory) < (nowInventory)) { + number = nowInventory - oldInventory; + takingResult = "Inventory_up"; + takingResultString = "盘盈"; + } else { + takingResult = "Inventory_normal"; + takingResultString = "正常"; + } + obj.tr[0].childNodes[8].childNodes[0].innerText = takingResultString; + obj.tr[0].childNodes[9].childNodes[0].innerText = number; + obj.update({takingResult: takingResult}); + obj.update({takingInventory: number}); + req.number = number + ""; + req.takingResult = takingResult; + req.takingResultString = takingResultString; + req.id = obj.data.id + ""; + req.unit = obj.tr[0].childNodes[5].childNodes[0].innerText; + req.oldInventory = oldInventory + ""; + $.ajax({ + url: "/stockTaking/temporaryStorageForTakingResult", + dataType: "json", + data: JSON.stringify(req), + type: "POST", + contentType: "application/json;charset=utf-8" + }); + }; + + + // 用于打开仓库树形菜单 + $('#openSonByDepository').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: '/selectDepository?type=2', + success: function (layero, index) { + var children = layero.children(); + var content = $(children[1]); + var iframeChildren = $(content.children()); + content.css('height', '100%'); + iframeChildren.css('height', '100%'); + }, + end: function () { + var nowDepositoryId = $("#depositoryId").val(); + var nowPlaceId = $("#placeId").val(); + if (nowDepositoryId !== depositoryId || nowPlaceId !== placeId) { + // 如果重新选择盘点位置 + var nowDepositoryName = $("#openSonByDepository").val(); + $("#form1")[0].reset(); + $("#depositoryId").val(nowDepositoryId); + $("#placeId").val(nowPlaceId); + $("#openSonByDepository").val(nowDepositoryName); + form.render(); + } + if (nowDepositoryId !== null && nowDepositoryId !== "") { + depositoryId = nowDepositoryId; + placeId = nowPlaceId; + updateFlowShowForLocation(); + } + } + }); + }); + + + updateFlowShowForLocation = function () { + $("#LAY_FlowForLocation").empty(); + takingPre = 0; + let req = {}; + req.depositoryId = depositoryId; + req.placeId = placeId; + req.size = size; + flow.load({ + elem: '#LAY_FlowForLocation' //流加载容器 + , done: function (page, next) { //执行下一页的回调 + let result; + let lis = []; + req.page = page; + $.ajax({ + url: '/material/findInventoryForStockTaking', + 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; + } + let brandItem ='

' + "物料品牌:"+result[i].mbrand + '

'; + if(result[i].mbrand === ""){ + brandItem = ""; + } + lis.push('
  • ' + + '

    ' + "物料名称:" + result[i].mname + '

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

    ' + "物料编码:" + result[i].mcode + '

    ' + +'

    ' + "物料型号:" + result[i].version + '

    ' + + brandItem + +'

    ' + "所处库位:" + result[i].kingdeecode + '

    ' + + InventoryItem + + '
  • '); + } + lis.push('
    '); + takingPre += result.length; + //执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页 + //pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多 + next(lis.join(''), takingPre < res.count); + } + }); + } + }); + }; + +}); \ No newline at end of file diff --git a/src/main/resources/static/js/stockTaking/stockTakingForMaterial_mobile.js b/src/main/resources/static/js/stockTaking/stockTakingForMaterial_mobile.js index 5eab6e18..219507cc 100644 --- a/src/main/resources/static/js/stockTaking/stockTakingForMaterial_mobile.js +++ b/src/main/resources/static/js/stockTaking/stockTakingForMaterial_mobile.js @@ -77,6 +77,8 @@ layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { updateFlowShowForMaterial = function () { + $("#LAY_FlowForMaterial").empty(); + takingPre = 0; let req = {}; req.mid = $("#mid").val(); req.size = size; @@ -101,7 +103,7 @@ layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { 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('
  • ' + diff --git a/src/main/resources/templates/pages/showInventory/showInventoryForLocation.html b/src/main/resources/templates/pages/showInventory/showInventoryForLocation.html index f0e6fe30..3efc4a56 100644 --- a/src/main/resources/templates/pages/showInventory/showInventoryForLocation.html +++ b/src/main/resources/templates/pages/showInventory/showInventoryForLocation.html @@ -175,7 +175,7 @@ } 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].mname + '

    '); diff --git a/src/main/resources/templates/pages/showInventory/showInventoryForMaterial.html b/src/main/resources/templates/pages/showInventory/showInventoryForMaterial.html index 4054ba03..2949b697 100644 --- a/src/main/resources/templates/pages/showInventory/showInventoryForMaterial.html +++ b/src/main/resources/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 + '

    '); diff --git a/src/main/resources/templates/pages/stockTaking/stockTaking_mobile.html b/src/main/resources/templates/pages/stockTaking/stockTaking_mobile.html index 8ba6aa3b..2d2f6533 100644 --- a/src/main/resources/templates/pages/stockTaking/stockTaking_mobile.html +++ b/src/main/resources/templates/pages/stockTaking/stockTaking_mobile.html @@ -243,188 +243,21 @@
    -
    -
    -
    - -
    -
    - -
    +
      + + +
      +
      +
      -
      -
      -
      - 盘点明细 - -
      -
      - -
      - - -
      -
      - - -
      - -
      -
      -
      - -
      -
      - - -
      -
      -
      -
      - -
      - - - -
      -
      -
      - -
      - -
      -
      -
      - -
      - -
      -
      -
      - -
      - -
      -
      - -
      - -
      - -
      -
      -
      - -
      - -
      -
      -
      - -
      - -
      -
      - -
      - -
      - -
      -
      - -
      -
      -
      - -
      -
      -
      -
      -
      @@ -462,6 +295,7 @@ +