From fb8d2664da608d1cb1895c483b904c258f3b171d Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 13 四月 2021 13:52:40 +0800
Subject: [PATCH] #
---
src/main/webapp/views/pda/stockCheck.html | 80 +++++++++++++++++++++++++++-------------
1 files changed, 54 insertions(+), 26 deletions(-)
diff --git a/src/main/webapp/views/pda/stockCheck.html b/src/main/webapp/views/pda/stockCheck.html
index 2a86ad6..0262dce 100644
--- a/src/main/webapp/views/pda/stockCheck.html
+++ b/src/main/webapp/views/pda/stockCheck.html
@@ -72,7 +72,7 @@
<footer>
<div class="layui-btn-container">
<button type="button" id="reset-btn" class="layui-btn layui-btn-primary" onclick="reset()">閲嶇疆</button>
- <button type="button" id="comb-btn" class="layui-btn layui-btn-normal " onclick="comb()" style="margin-left: 20px">缁勬墭</button>
+ <button type="button" id="comb-btn" class="layui-btn layui-btn-normal " onclick="check()" style="margin-left: 20px">纭</button>
<span id="tips"></span>
</div>
</footer>
@@ -114,7 +114,7 @@
cellMinWidth: 50,
cols: [[
{fixed: 'left', align: 'center', field: 'count', title: '鏁伴噺', event: 'modify', style:'font-weight: bold;', width:50},
- {field: 'matnr', align: 'center', title: '鍟嗗搧缂栧彿', event: 'modify'},
+ // {field: 'matnr', align: 'center', title: '鍟嗗搧缂栧彿', event: 'modify'},
{field: 'maktx', align: 'center', title: '鍟嗗搧鍚嶇О', event: 'modify'}
]],
done: function (res, curr, count) {
@@ -163,7 +163,7 @@
if (res.code === 200) {
if (res.data != null) {
locDetlData = [];
- addTableData(res.data);
+ initTableData(res.data);
}
} else if (res.code === 403) {
top.location.href = baseUrl + "/pda";
@@ -176,12 +176,11 @@
// 娣诲姞琛ㄦ牸鏁版嵁
var locDetlData = [];
- function addTableData(data) {
+ function initTableData(data) {
for (var i=0;i<data.length;i++) {
var toPush = true;
for (var j=0;j<locDetlData.length;j++){
if (data[i].matnr === locDetlData[j].matnr) {
- // locDetlData[j].anfme = Number(locDetlData[j].anfme) + Number(data[i].anfme);
toPush = false;
}
}
@@ -190,7 +189,22 @@
}
}
tableIns.reload({data: locDetlData});
- // $("#comb-btn").focus();
+ }
+ function addTableData(data) {
+ if (isEmpty(data.matnr)){
+ tips("鎻愬彇澶辫触", true);
+ return;
+ }
+ var toPush = true;
+ for (var j=0;j<locDetlData.length;j++){
+ if (data.matnr === locDetlData[j].matnr) {
+ toPush = false;
+ }
+ }
+ if (toPush) {
+ locDetlData.push(data);
+ }
+ tableIns.reload({data: locDetlData});
}
/************************************* 鏁伴噺 ****************************************/
@@ -239,7 +253,24 @@
-
+ /************************************* 琛ュ厖 ****************************************/
+ var matCodeLayerIdx;
+ function replenish() {
+ matCodeLayerIdx = layer.open({
+ type: 2,
+ title: '琛ュ厖鍟嗗搧',
+ shade: [0.3,'#000'],
+ area: ['90%', '80%'],
+ content: 'matQuery.html',
+ success: function(layero, index){
+ $('.layui-layer-title').css('font-size', '16px');
+ $('.layui-layer.layui-layer-iframe').css('border-radius', '8px');
+ },
+ end: function () {
+ // $('#mat-btn').focus();
+ }
+ });
+ }
@@ -262,30 +293,27 @@
tableIns.reload({data: locDetlData});
}
- // 缁勬墭
- function comb() {
- var barcode = $('#code').val();
- if (isEmpty(barcode)) {
- tips("鎵樼洏鏉$爜涓虹┖", true);
- // document.getElementById("code").focus();
+ // 纭
+ function check() {
+ var locNo = $('#locNo').val();
+ if (isEmpty(locNo)) {
+ tips("璐т綅涓嶈兘涓虹┖", true);
return;
}
- if (barcode.length !== 7) {
- tips("鏉$爜蹇呴』涓�7浣�", true);
- return;
+ if (locDetlData.length > 0) {
+ for (var i = 0; i<locDetlData.length; i++) {
+ if (locDetlData[i].count === null || locDetlData[i].count === 0) {
+ tips(locDetlData[i].matnr + "鍟嗗搧鏁伴噺閿欒", true);
+ return;
+ }
+ }
}
- if (locDetlData.length === 0) {
- tips("璇锋彁鍙栫墿鏂�", true);
- return;
- }
- var billNo = $('#billNo').val();
$.ajax({
- url: baseUrl+"/mobile/comb/auth",
+ url: baseUrl+"/work/stock/check",
headers: {'token': localStorage.getItem('token')},
data: JSON.stringify({
- barcode: barcode,
- combMats: locDetlData,
- billNo: billNo
+ locNo: locNo,
+ dtos: locDetlData
}),
contentType:'application/json;charset=UTF-8',
method: 'POST',
@@ -293,7 +321,7 @@
success: function (res) {
if (res.code === 200) {
reset();
- tips("缁勬墭鎴愬姛")
+ tips("鐩樼偣鎴愬姛")
} else if (res.code === 403) {
top.location.href = baseUrl + "/pda";
} else {
--
Gitblit v1.9.1