From 1ff3526312e320509b2522a0295e95169fafcd8f Mon Sep 17 00:00:00 2001 From: cnf <3200815559@qq.com> Date: 星期二, 16 九月 2025 15:57:01 +0800 Subject: [PATCH] 修改config --- Scripts/config.js | 132 ++++++++++++++++++++++++++++++++++--------- 1 files changed, 104 insertions(+), 28 deletions(-) diff --git a/Scripts/config.js b/Scripts/config.js index 97d05c2..f5d8bf5 100644 --- a/Scripts/config.js +++ b/Scripts/config.js @@ -1,7 +1,10 @@ -锘�/*var APIURL = "http://192.168.1.145:83/api/";*/ -var APIURL = "http://localhost:5204/api/"; -/*var APIURL_PC = "http://192.168.1.145:81/";*/ -var APIURL_PC = "http://192.168.1.145:8081/";//娴嬭瘯 +锘�//var APIURL = "http://192.168.1.187:8083/api/";//PDA鍚庣鍙戝竷娴嬭瘯鍦板潃锛堝唴缃戯級 +//var APIURL = "http://192.168.1.187:83/api/";//PDA鍚庣鍙戝竷姝e紡鍦板潃锛堝唴缃戯級 +var APIURL = "http://localhost:5204/api/";//鏈湴璋冭瘯鍦板潃 + +//var APIURL_PC = "http://192.168.1.187:81/"; //PC鍚庣鐨勬寮忓湴鍧�锛堝唴缃戯級 +var APIURL_PC = "http://116.148.211.203:8081/"; //PC鍚庣鐨勬祴璇曞湴鍧�锛堝缃戯級 + var APIURL_IMAGE = APIURL_PC+"upload/"; var ISNEEDLOGIN = true; String.prototype.trim = function () { @@ -50,6 +53,7 @@ Vue.prototype.GetLoginInfor = function () { var that = this; var loginInfo = { + // 浠嶤ookies涓幏鍙栫櫥褰曟椂淇濆瓨鐨剈serGuid锛堢櫥褰曟椂瀛樺偍鐨勯敭鏄痩oginGuid锛� loginGuid: Cookies.get('loginGuid'), loginAccount: Cookies.get('loginAccount'), } @@ -82,6 +86,8 @@ url = (APIURL_PC + url); } let headers = { 'Content-Type': 'application/json', } + var orgId = Cookies.get('orgId') + headers['OrgId'] = orgId; if (isToken) { var timestamp = (new Date()).getTime(); var token = Cookies.get('loginGuid') @@ -164,31 +170,101 @@ } -// 鏂板鍏ㄥ眬鎵撳嵃鏂规硶 +//// 鏂板鍏ㄥ眬鎵撳嵃鏂规硶 +//Vue.prototype.sendPrintMessage = function (tbBillList) { +// const cfDetails = tbBillList.cfBarInfo.map(item => { +// return "! 0 200 200 210 1\r\n" + +// "PAGE - WIDTH 700 \r\n" + +// "GAP-SENSE \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"; +// }); + Vue.prototype.sendPrintMessage = function (tbBillList) { const cfDetails = tbBillList.cfBarInfo.map(item => { - return "! 0 200 200 210 1\r\n" + - "PAGE - WIDTH 700 \r\n" + - "GAP-SENSE \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"; + return "! 0 195 200 472 1\r\n" + // 鍩虹鍋忕Щ閲忓乏绉�5鍍忕礌 + "PAGE-WIDTH 545\r\n" + // 椤甸潰瀹藉害鍑忓皯5鍍忕礌 + "GAP-SENSE\r\n" + + + // 澶栨 - 鏁翠綋宸︾Щ5鍍忕礌 + "BOX -3 2 543 470 2\r\n" + + // ==================== 鐗╂枡鏉$爜锛堢涓�琛岋級==================== + "LINE -3 62 425 62 1\r\n" + + "T 55 0 8 27 鐗╂枡鏉$爜:\r\n" + + `T 55 3 120 27 ${item.iteM_BARCODE}\r\n` + // 鐗╂枡鏉$爜鍊� + + // ==================== 鐗╂枡缂栫爜锛堢浜岃锛�==================== + "LINE -3 124 543 124 1\r\n" + + "T 55 0 8 89 缂栫爜:\r\n" + + `T 55 3 120 89 ${item.iteM_NO}\r\n` + // 鐗╂枡缂栫爜鍊� + + // ==================== 渚涘簲鍟嗭紙绗笁琛岋級==================== + "LINE -3 186 543 186 1\r\n" + // 绗�3鏉″垎闅旂嚎锛堥棿闅�62锛� + "T 55 0 8 151 渚涘簲鍟�:\r\n" + + `T 55 3 120 151 ${item.supp_name || ''}\r\n` + // 渚涘簲鍟嗗�硷紙鍋囪瀛楁鍚嶏級 + + // ==================== 鐗╂枡鍚嶇О锛堢鍥涜锛�==================== + "LINE -3 248 543 248 1\r\n" + // 绗�4鏉″垎闅旂嚎锛堥棿闅�62锛� + "T 55 0 8 213 鍚嶇О:\r\n" + + `T 55 3 120 213 ${item.item_name}\r\n` + // 鐗╂枡鍚嶇О鍊� + + // ==================== 瑙勬牸鍨嬪彿锛堢浜旇锛�==================== + "LINE -3 310 543 310 1\r\n" + // 绗�5鏉″垎闅旂嚎锛堥棿闅�62锛� + "T 55 0 8 275 瑙勬牸:\r\n" + + `T 55 3 120 275 ${item.item_model}\r\n` + // 瑙勬牸鍨嬪彿鍊� + + // ==================== 浠撳簱锛堢鍏锛�==================== + "LINE -3 360 543 360 1\r\n" + // 绗�6鏉″垎闅旂嚎锛堢Щ鑷崇珫绾块《绔痀=360锛� + "T 55 0 8 335 浠撳簱:\r\n" + + `T 55 3 120 335 ${item.depot_name || ''}\r\n` + // 浠撳簱鍊硷紙鍋囪瀛楁鍚嶏級 + + // ==================== 鏁伴噺鍜屼粨绠″憳锛堢涓冭锛�==================== + "LINE -3 430 543 430 1\r\n" + // 搴曢儴妯嚎锛堜笌绔栫嚎搴曠瀵归綈锛� + "T 55 0 8 380 鏁伴噺:\r\n" + // 鏂囨湰浣嶇疆淇濇寔 + `T 55 3 120 380 ${item.quantity}\r\n` + // 鏁伴噺鍊� + "T 55 0 275 380 浠撶鍛�:\r\n" + // 鏂囨湰浣嶇疆淇濇寔 + `T 55 3 395 380 ${item.cgy || ''}\r\n` + // 浠撶鍛樺�硷紙鍋囪瀛楁鍚嶏級 + + // 涓棿绔栫嚎鍒嗛殧锛堣寖鍥碮=360-430锛屼笌涓婁笅妯嚎琛旀帴锛� + "LINE 265 430 265 360 1\r\n" + // 绔栫嚎椤剁瀵归綈浠撳簱琛屽垎闅旂嚎 + + // ==================== 搴曢儴鏃堕棿淇℃伅 ==================== + "T 55 0 395 440 鎵撳嵃鏃堕棿\r\n" + // 浣嶇疆淇濇寔 + "T 55 0 8 440 " + new Date().toLocaleString('zh-CN', { // 鏃堕棿鏍煎紡鏀逛负骞存湀鏃ユ椂鍒嗙 + year: 'numeric', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit', + second: '2-digit' + }) + "\r\n" + + + // ==================== 浜岀淮鐮佸尯鍩燂紙宸︾Щ5鍍忕礌锛�==================== + "BOX 425 3 535 113 1\r\n" + // 浣嶇疆淇濇寔 + "B QR 430 8 M 2 U 5\r\n" + // 浣嶇疆淇濇寔 + `MA,${item.iteM_BARCODE}\r\n` + // 浣跨敤鐗╂枡鏉$爜鐢熸垚浜岀淮鐮� + "ENDQR\r\n" + + + "FORM\r\n" + + "PRINT\r\n"; }); + let sendData = { Type: 'Bar', @@ -208,8 +284,8 @@ Vue.prototype.$playSound = function(type = 'success') { try { const audioMap = { - success: '/audio/OK.wav', - error: '/audio/NG.wav' + success: '/audio/YES.wav', + error: '/audio/NO.wav' }; const audio = new Audio(audioMap[type]); audio.play().catch(error => { -- Gitblit v1.9.3