From 1204e1ae66a50ec99b4dea80e839c1264c36ef48 Mon Sep 17 00:00:00 2001 From: Demo <Demo@DESKTOP-CPA90BF> Date: 星期一, 19 二月 2024 13:24:30 +0800 Subject: [PATCH] 修改标签因单据条件生成重复问题,前端防止重复点击问题 --- HTML/views/ASNSetting/LabelPrint.html | 61 +++++++++++++++++------------- 1 files changed, 35 insertions(+), 26 deletions(-) diff --git a/HTML/views/ASNSetting/LabelPrint.html b/HTML/views/ASNSetting/LabelPrint.html index 7c4577e..2519584 100644 --- a/HTML/views/ASNSetting/LabelPrint.html +++ b/HTML/views/ASNSetting/LabelPrint.html @@ -119,38 +119,47 @@ var expirationTime = getQueryString('ExpirationTime'); var storeTime = getQueryString('StoreTime'); + var doing = true; // console.log(productionTime); // console.log(expirationTime); // console.log(storeTime); //鐢熸垚 $('#btnAdd').on('click', function () { - var param = { - Id: parseInt(id), - IsReset:reset, - ArriveQty:arriveQty, - ProductionTime:productionTime, - ExpirationTime:expirationTime, - StoreTime:storeTime - }; - // console.log(param); - synData(IP + "/BllAsn/AddLabelBox", param , 'post', function (res) { - if (res.code == 0) { //鎴愬姛 - layer.msg(res.msg, { - icon: 1, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { - parent.location.reload(); - parent.layer.close(layer.index); - }); - - } else { //涓嶆垚鍔� - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { }); - } - }); + if(doing){ + doing= false; + + + var param = { + Id: parseInt(id), + IsReset:reset, + ArriveQty:arriveQty, + ProductionTime:productionTime, + ExpirationTime:expirationTime, + StoreTime:storeTime + }; + // console.log(param); + synData(IP + "/BllAsn/AddLabelBox", param , 'post', function (res) { + if (res.code == 0) { //鎴愬姛 + layer.msg(res.msg, { + icon: 1, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + parent.location.reload(); + parent.layer.close(layer.index); + doing = true; + }); + + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + doing = true; + }); + } + }); + } }); //鎵撳嵃 $('#btnPrint').on('click', function () { -- Gitblit v1.8.0