From 790d5f4ed220eb76f28682b057799a57c62c9c94 Mon Sep 17 00:00:00 2001 From: 南骏 池 <chiffly@163.com> Date: 星期五, 30 五月 2025 08:45:31 +0800 Subject: [PATCH] 1.流量*水温表格生成,可输入 --- H5/Js/PurchaseReturn.js | 179 +++++++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 123 insertions(+), 56 deletions(-) diff --git a/H5/Js/PurchaseReturn.js b/H5/Js/PurchaseReturn.js index 409bdfa..406b4b5 100644 --- a/H5/Js/PurchaseReturn.js +++ b/H5/Js/PurchaseReturn.js @@ -14,7 +14,7 @@ quantity:0 }, formData: {}, - tableData: [], + ItemDetail: [], codeTableData: [], itemOutNoList: [], itemOutNoStr: [], @@ -27,6 +27,12 @@ messageId: 0, show: false, + + scanInfo: { barcodeNum: "", splitNum: "", barcode: "" }, + ip: "", + port: "", + oldBarInfo: [], + cfBarInfo: [], } }, mounted() { @@ -35,6 +41,8 @@ loginGuid: this.GetLoginInfor().loginGuid, loginAccount: this.GetLoginInfor().loginAccount, }; + that.beginload(); + //that.show = false; }, methods: { getItemOutNo() { @@ -53,12 +61,39 @@ 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); + }); + + }, + beginload() { + var that = this; + + that.isLoading = true; + that.AxiosHttp("post", 'MesCgthSq/GetMesCgthSq', { + }, false) + .then(function (res) { + var json = res; + if (json.status == 0) { + 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); }); @@ -79,37 +114,15 @@ this.getItem(); - //var that = this; - - //that.isLoading = true; - //that.AxiosHttp("post", 'MesInvItemOuts/GetPage', { - // billNo: this.scanFormData.itemOutNo, - // pageIndex: 1, - // limit: 1, - //}, false) - // .then(function (res) { - // var json = res; - // if (json.status == 0) { - // that.formData = json.data.tbBillList[0]; - // that.formData.billTypeName = "鍑哄簱鍗�"; - - // that.getScanBarcode(); - // } - // else { - // that.$toast.fail(json.message); - // } - // that.isLoading = false; - // }) - // .catch(function (error) { - // that.isLoading = false; - // that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); - // console.log(error); - // }); - }, getItem() { var that = this; that.isLoading = true; + + let itemOut = this.itemOutNoList.filter(it => it.billNo == that.scanFormData.itemOutNo); + + this.invItemOutId = itemOut[0].id; + that.AxiosHttp("post", 'MesCgthSq/GetSumItem', { id: that.invItemOutId, billNo: that.scanFormData.itemOutNo, @@ -118,45 +131,24 @@ .then(function (res) { var json = res; if (json.status == 0) { - that.tableData = json.data.tbBillList.sumItem; - that.scanFormData.itemNo = json.data.tbBillList.itemNo - //that.scanFormData.quantity = json.data.tbBillList.quantity - console.log(json); + that.ItemDetail = json.data.tbBillList; + that.$refs.barcode.focus(); } else { + that.$playSound('error'); that.$toast.fail(json.message); + that.ItemDetail = []; } that.isLoading = false; }) .catch(function (error) { that.isLoading = false; + that.$playSound('error'); that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); - console.log(error); + that.ItemDetail = []; }); }, - //getScanBarcode() { - // var that = this; - // that.isLoading = true; - // that.AxiosHttp("post", 'MesInvItemOuts/GetScanBarcode', { - // id: that.formData.guid - // }, false) - // .then(function (res) { - // var json = res; - // if (json.status == 0) { - // that.codeTableData = res.data.tbBillList; - // } - // else { - // that.$toast.fail(json.message); - // } - // that.isLoading = false; - // }) - // .catch(function (error) { - // that.isLoading = false; - // that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); - // console.log(error); - // }); - //}, SaveBarCodes() { //if (!this.scanFormData.barcode) { @@ -180,20 +172,95 @@ //} that.scanFormData.quantity = json.data.tbBillList.barcodeNum that.getItem(); + that.$refs.barcode.focus(); + that.scanFormData.barcode = null; } else { + that.$playSound('error'); that.$toast.fail(json.message); that.$refs.barcode.focus(); + that.scanFormData.barcode = null; } + that.$playSound('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