From f60ec480f76ed3b75e3ce6b265c9a5ec6565d9d8 Mon Sep 17 00:00:00 2001 From: erdanergou Date: Wed, 8 Mar 2023 15:09:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E7=9B=98=E7=82=B9=E6=97=B6?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E7=89=A9=E6=96=99=E7=9B=98=E7=82=B9=E4=B8=8E?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E7=9B=98=E7=82=B9=E7=9A=84=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/stockTaking/stockTaking.html | 59 ++++++++++++++++++- .../pages/stockTaking/stockTaking.html | 59 ++++++++++++++++++- 2 files changed, 116 insertions(+), 2 deletions(-) diff --git a/src/main/resources/templates/pages/stockTaking/stockTaking.html b/src/main/resources/templates/pages/stockTaking/stockTaking.html index b8d90844..31fe5587 100644 --- a/src/main/resources/templates/pages/stockTaking/stockTaking.html +++ b/src/main/resources/templates/pages/stockTaking/stockTaking.html @@ -95,7 +95,7 @@ + onclick="scanCodeForMaterial(this)"> @@ -290,6 +290,12 @@ function selectCode(obj) { } + + // 用于扫描物料码 + function scanCodeForMaterial() { + + } + // 用于计算盘点结果 function calculateForMaterial(obj) { @@ -726,6 +732,57 @@ }; + scanCodeForMaterial = function (obj) { + let wxScan = parent; + + if(wxScan.wx === undefined){ + wxScan = wxScan.parent.wx; + } + else{ + wxScan = wxScan.wx; + } + wxScan.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: "/material/qywxApplicationOutScanQrCode", + type: "post", + dataType: 'json', + data: JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (d) { + var data = d.data; + if (data === null) { + layer.msg("对于编码:" + result + ",并未发现仓库中存在对应的物料", { + icon: 0, + time: 1000 //0.5秒关闭(如果不配置,默认是3秒) + }, function () { + $("#openSonByMaterial").val(""); + $("#mid").val(""); + $("#code").val(""); + updateTableShowForMaterial(); + }) + } else { + $("#openSonByMaterial").val( data.mname); + $("#mid").val( data.id); + $("#code").val( data.code); + updateTableShowForMaterial(); + } + } + }) + } + }) + }; + + + // 通过位置盘点物料页面 diff --git a/target/classes/templates/pages/stockTaking/stockTaking.html b/target/classes/templates/pages/stockTaking/stockTaking.html index b8d90844..31fe5587 100644 --- a/target/classes/templates/pages/stockTaking/stockTaking.html +++ b/target/classes/templates/pages/stockTaking/stockTaking.html @@ -95,7 +95,7 @@ + onclick="scanCodeForMaterial(this)"> @@ -290,6 +290,12 @@ function selectCode(obj) { } + + // 用于扫描物料码 + function scanCodeForMaterial() { + + } + // 用于计算盘点结果 function calculateForMaterial(obj) { @@ -726,6 +732,57 @@ }; + scanCodeForMaterial = function (obj) { + let wxScan = parent; + + if(wxScan.wx === undefined){ + wxScan = wxScan.parent.wx; + } + else{ + wxScan = wxScan.wx; + } + wxScan.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: "/material/qywxApplicationOutScanQrCode", + type: "post", + dataType: 'json', + data: JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (d) { + var data = d.data; + if (data === null) { + layer.msg("对于编码:" + result + ",并未发现仓库中存在对应的物料", { + icon: 0, + time: 1000 //0.5秒关闭(如果不配置,默认是3秒) + }, function () { + $("#openSonByMaterial").val(""); + $("#mid").val(""); + $("#code").val(""); + updateTableShowForMaterial(); + }) + } else { + $("#openSonByMaterial").val( data.mname); + $("#mid").val( data.id); + $("#code").val( data.code); + updateTableShowForMaterial(); + } + } + }) + } + }) + }; + + + // 通过位置盘点物料页面