From 21bdf0f6e844a1a747c616197f1427d6a7445afe Mon Sep 17 00:00:00 2001 From: 南骏 池 <chiffly@163.com> Date: 星期五, 16 五月 2025 08:23:17 +0800 Subject: [PATCH] 1.无线打印条码方法公共化 2.采购退货优化 --- H5/Js/PurchaseReturn.js | 86 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 85 insertions(+), 1 deletions(-) diff --git a/H5/Js/PurchaseReturn.js b/H5/Js/PurchaseReturn.js index c103af5..10c41d8 100644 --- a/H5/Js/PurchaseReturn.js +++ b/H5/Js/PurchaseReturn.js @@ -27,6 +27,12 @@ messageId: 0, show: false, + + scanInfo: { barcodeNum: "", splitNum: "", barcode: "" }, + ip: "", + port: "", + oldBarInfo: [], + cfBarInfo: [], } }, mounted() { @@ -55,12 +61,14 @@ that.show = true; } else { + that.$playSound('error'); that.$toast.fail(json.message); } that.isLoading = false; }) .catch(function (error) { that.isLoading = false; + that.$playSound('error'); that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); console.log(error); }); @@ -78,12 +86,14 @@ that.itemOutNoList = json.data.tbBillList; } else { + that.$playSound('error'); that.$toast.fail(json.message); } that.isLoading = false; }) .catch(function (error) { that.isLoading = false; + that.$playSound('error'); that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); console.log(error); }); @@ -125,6 +135,7 @@ that.$refs.barcode.focus(); } else { + that.$playSound('error'); that.$toast.fail(json.message); that.ItemDetail = []; } @@ -132,6 +143,7 @@ }) .catch(function (error) { that.isLoading = false; + that.$playSound('error'); that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); that.ItemDetail = []; }); @@ -164,19 +176,91 @@ that.scanFormData.barcode = null; } else { + that.$playSound('error'); that.$toast.fail(json.message); that.$refs.barcode.focus(); that.scanFormData.barcode = null; } + success that.$notify({ type: 'success', message: json.message }); that.isLoading = false; }) .catch(function (error) { that.isLoading = false; + that.$playSound('error'); that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); console.log(error); that.$refs.barcode.focus(); }); - } + }, + getChaiFen() { + //this.isPrinterPopupVisible = true; // 鏄剧ず寮圭獥 + + if (this.isLoading) { + return; + } + + var that = this; + if (that.scanFormData.itemOutNo.length <= 0) { + that.$playSound('error'); + that.$toast.fail("鐢宠鍗曞彿涓嶈兘涓虹┖锛�"); + return; + } + if (that.scanInfo.splitNum * 1 <= 0) { + that.$playSound('error'); + that.$toast.fail("鎷嗗垎鏁伴噺涓嶈兘涓虹┖锛�"); + return; + } + if (that.scanInfo.barcode.length * 1 <= 0) { + that.$playSound('error'); + that.$toast.fail("鐗╂枡鏉$爜涓嶈兘涓虹┖锛�"); + return; + } + //that.ip = ""; + //that.prot = ""; + //that.getPrintInfo(); + + //if (that.ip.length <= 0 || that.prot.length <= 0) { + // alert(that.ip); + // alert(that.prot); + // return; + //} + + that.isLoading = true; + that.AxiosHttp("post", 'Womdaa/ScanCodeCF', { + daa001: that.modeInfo.daa001, + userName: that.userInfo.loginAccount, + barcode: that.scanInfo.barcode, + Num: that.scanInfo.splitNum, + }, false) + .then(function (res) { + var json = res; + if (json.status == 0) { + // that.modeInfo = json.data.tbBillList; + that.scanInfo.splitNum = null; + that.scanInfo.barcodeNum = null; + that.scanInfo.barcode = null; + that.$notify({ type: 'success', message: json.message }); + that.$playSound('success'); + + that.sendMessage(json.data.tbBillList); + + that.$refs.barcode.focus(); + that.getModel(); + } + else { + that.$playSound('error'); + that.$toast.fail(json.message); + that.$playSound('error'); + } + that.isLoading = false; + }) + .catch(function (error) { + that.isLoading = false; + + that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); + that.$playSound('error'); + }); + }, } }) \ No newline at end of file -- Gitblit v1.9.3