From 1648bd01b55f58dff42096be49ad65f36f141220 Mon Sep 17 00:00:00 2001 From: 南骏 池 <chiffly@163.com> Date: 星期三, 06 八月 2025 09:02:32 +0800 Subject: [PATCH] 1.调拨出库 --- H5/Js/Scll.js | 145 ++++++++++++++++++++++++++++++++++------------- 1 files changed, 104 insertions(+), 41 deletions(-) diff --git a/H5/Js/Scll.js b/H5/Js/Scll.js index 34e441b..7545889 100644 --- a/H5/Js/Scll.js +++ b/H5/Js/Scll.js @@ -14,6 +14,9 @@ port: "", oldBarInfo: [], cfBarInfo: [], + selectKey: "",//鏌ヨ鍏抽敭瀛� + actions: [],//鍒楄〃鐨勫�� + show: false,//鍒楄〃灞曠ず //isPrinterPopupVisible: false, // 鎺у埗寮圭獥鏄剧ず/闅愯棌 //selectedPrinter: '', // 褰撳墠閫夋嫨鐨勬墦鍗版満缂栧彿 //printerList: [ @@ -161,7 +164,7 @@ that.$notify({ type: 'success', message: json.message }); that.$playSound('success'); - that.sendMessage(json.data.tbBillList); + that.sendPrintMessage(json.data.tbBillList); that.$refs.barcode.focus(); that.getModel(); @@ -180,43 +183,43 @@ }, - sendMessage(tbBillList) { - const cfDetails = tbBillList.cfBarInfo.map(item => { - return "! 0 200 200 210 1\r\n" + - "PAGE - WIDTH 700 \r\n" + - "BOX 0 0 700 180 0 \r\n" + - `T 16 0 10 10 鐗╂枡缂栫爜锛歕r\n` + - `T 55 3 120 10 ${item.iteM_NO}\r\n` + - `T 16 0 310 10 ${item.item_name}\r\n` + - "T 55 2 10 42 鐗╂枡瑙勬牸锛歕r\n" + - `T 55 2 110 42 ${item.item_model}\r\n` + - "T 16 0 10 78 鏁伴噺锛歕r\n" + - `T 0 5 90 78 ${item.quantity}\r\n` + - `T 16 5 180 78 ${item.barType}\r\n` + - `BARCODE 128 1 25 35 350 130 ${item.iteM_BARCODE}\r\n` + - `T 0 1 350 130 ${item.iteM_BARCODE}\r\n` + - "T 55 0 10 125 鍒涘缓鏃堕棿锛歕r\n" + - `T 55 0 120 125 ${item.creatE_DATE}\r\n` + - "T 55 0 10 150 鎵撳嵃鏃堕棿锛歕r\n" + - `T 55 0 120 150 ${item.print_date}\r\n` + - "B QR 580 12 M 2 U 4\r\n" + - `MA,${item.iteM_BARCODE}\r\n` + - "ENDQR\r\nFORM\r\nPRINT\r\n"; - }); - //alert(cfDetails); - let sendData = { - Type: 'Bar', - Barcode: tbBillList.cfBarInfo[0].iteM_BARCODE, - Detail: cfDetails, - Ip: tbBillList.printInfo[0].ip, - Port: tbBillList.printInfo[0].port, - } - console.log('sendMessage 寮�濮�1:') - console.log('sendMessage 寮�濮�2:' + JSON.stringify(sendData)) - uni.webView.postMessage({ - data: JSON.stringify(sendData) - }) - }, + //sendMessage(tbBillList) { + // const cfDetails = tbBillList.cfBarInfo.map(item => { + // return "! 0 200 200 210 1\r\n" + + // "PAGE - WIDTH 700 \r\n" + + // "BOX 0 0 700 180 0 \r\n" + + // `T 16 0 10 10 鐗╂枡缂栫爜锛歕r\n` + + // `T 55 3 120 10 ${item.iteM_NO}\r\n` + + // `T 16 0 310 10 ${item.item_name}\r\n` + + // "T 55 2 10 42 鐗╂枡瑙勬牸锛歕r\n" + + // `T 55 2 110 42 ${item.item_model}\r\n` + + // "T 16 0 10 78 鏁伴噺锛歕r\n" + + // `T 0 5 90 78 ${item.quantity}\r\n` + + // `T 16 5 180 78 ${item.barType}\r\n` + + // `BARCODE 128 1 25 35 350 130 ${item.iteM_BARCODE}\r\n` + + // `T 0 1 350 130 ${item.iteM_BARCODE}\r\n` + + // "T 55 0 10 125 鍒涘缓鏃堕棿锛歕r\n" + + // `T 55 0 120 125 ${item.creatE_DATE}\r\n` + + // "T 55 0 10 150 鎵撳嵃鏃堕棿锛歕r\n" + + // `T 55 0 120 150 ${item.print_date}\r\n` + + // "B QR 580 12 M 2 U 4\r\n" + + // `MA,${item.iteM_BARCODE}\r\n` + + // "ENDQR\r\nFORM\r\nPRINT\r\n"; + // }); + // //alert(cfDetails); + // let sendData = { + // Type: 'Bar', + // Barcode: tbBillList.cfBarInfo[0].iteM_BARCODE, + // Detail: cfDetails, + // Ip: tbBillList.printInfo[0].ip, + // Port: tbBillList.printInfo[0].port, + // } + // console.log('sendMessage 寮�濮�1:') + // console.log('sendMessage 寮�濮�2:' + JSON.stringify(sendData)) + // uni.webView.postMessage({ + // data: JSON.stringify(sendData) + // }) + //}, //getPrintInfo() { // var that = this; @@ -244,13 +247,13 @@ // }); //}, - //printCfBar(cfBar) { + //printCfBar(cfBar) { // var that = this; // that.AxiosHttp("post", 'MesPrint/getCfInfo', { // userName: that.userInfo.loginAccount, - // cfBar: cfBar, - // oldBar: that.scanInfo.barcode + // cfBar: cfBar, + // oldBar: that.scanInfo.barcode // }, false) // .then(function (res) { // var json = res; @@ -288,5 +291,65 @@ //onPrinterSelected(value) { // console.log('褰撳墠閫変腑鐨勬墦鍗版満缂栧彿:', value); //}, + + //鑾峰彇宸ュ崟淇℃伅 + getInfo() { + this.show = true; + var that = this; + that.actions = []; + that.isLoading = true; + that.AxiosHttp("post", 'Womdaa/GetXcslDaa', { + selectKey: that.selectKey, + }, false) + .then(function (res) { + var json = res; + if (json.status == 0) { + + if (json.data.tbBillList.length <= 0) { + that.$toast.fail("娌℃湁鍙敤鐨勬暟鎹�"); + that.$playSound('error'); + } else { + that.itemInfo = json.data.tbBillList; + that.actions = json.data.tbBillList.map(item => { + return { + name: item.daaInfo // 鎷兼帴瀛楁 + + }; + }); + } + } + else { + that.$toast.fail(json.message); + that.$playSound('error'); + } + that.isLoading = false; + }) + .catch(function (error) { + that.isLoading = false; + that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); + that.$playSound('error'); + console.log(error); + }); + }, + onSelect(item) { + // 榛樿鎯呭喌涓嬬偣鍑婚�夐」鏃朵笉浼氳嚜鍔ㄦ敹璧� + // 鍙互閫氳繃 close-on-click-action 灞炴�у紑鍚嚜鍔ㄦ敹璧� + this.show = false; + console.log(item); + // 姝e垯鍖归厤绗竴涓柟鎷彿鍐呭 + const regex = /\[([^\]]+)\]/; + const matchResult = item.name.match(regex); + + if (matchResult && matchResult[1]) { + this.modeInfo.daa001 = matchResult[1]; // PPBOM00000088-1 + console.log('鎻愬彇鐨凞AA001:', this.modeInfo.daa001); + } else { + this.$toast.fail('宸ュ崟鍙锋牸寮忓紓甯�'); + this.modeInfo.daa001 = ''; + } + this.getModel(); + //this.$toast(item.name); + + }, } }) \ No newline at end of file -- Gitblit v1.9.3