From 47ae3682d3d9253331df420044e93827cf13597d Mon Sep 17 00:00:00 2001 From: 南骏 池 <chiffly@163.com> Date: 星期五, 12 九月 2025 11:21:58 +0800 Subject: [PATCH] 1.调拨入库缓存修改 --- H5/Js/Wwll.js | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 163 insertions(+), 7 deletions(-) diff --git a/H5/Js/Wwll.js b/H5/Js/Wwll.js index 105b2a4..0e89c82 100644 --- a/H5/Js/Wwll.js +++ b/H5/Js/Wwll.js @@ -9,6 +9,20 @@ }, modeInfo: { daa001: "", planNo: "" }, scanInfo: { barcodeNum: "", splitNum: "", barcode: "" }, + ItemDetail: [], + ip: "", + port: "", + oldBarInfo: [], + cfBarInfo: [], + selectKey: "",//鏌ヨ鍏抽敭瀛� + actions: [],//鍒楄〃鐨勫�� + show: false,//鍒楄〃灞曠ず + // 褰撳墠閫変腑琛岀殑绱㈠紩 + currentIndex: -1, + // 瀛樺偍閫変腑琛屾暟鎹璞� + selItem: {}, + ItemBarKw: [],//褰撳ぉ琛岀浉鍏虫潯鐮佸簱浣嶄俊鎭� + DaaInfo: {}, } }, mounted() { @@ -19,6 +33,61 @@ }; }, methods: { + /** + * 澶勭悊琛岀偣鍑讳簨浠讹紙鍗曢�夐�昏緫锛� + * @param {Object} item 褰撳墠琛屾暟鎹� + * @param {Number} index 褰撳墠琛岀储寮� + */ + handleRowClick(item, index) { + if (this.isLoading) { + return; + } + + // 閲嶇疆鎵�鏈夎鐨勯�変腑鐘舵�� + this.currentIndex = -1; + + // 璁剧疆褰撳墠閫変腑琛� + this.currentIndex = index; + this.selItem = { + itemid: item.itemId,//椹煎嘲鍛藉悕娉� + index: index + }; + + console.log('褰撳墠閫変腑椤�:', this.selItem); // 璋冭瘯鐢� + + this.GetBarKwByItem(); + }, + //鑾峰彇搴撲綅淇℃伅 + GetBarKwByItem() { + //Womdaa + //WwGd + var that = this; + that.isLoading = true; + that.AxiosHttp("post", 'Womdaa/GetBarKwByItem', { + itemId: that.selItem.itemid, + userName: that.userInfo.loginAccount + }, false) + .then(function (res) { + var json = res; + if (json.status == 0) { + that.ItemBarKw = json.data.tbBillList; + } + else { + that.$toast.fail(json.message); + that.$playSound('error'); + that.ItemBarKw = []; + } + that.isLoading = false; + }) + .catch(function (error) { + that.isLoading = false; + that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); + that.$playSound('error'); + console.log(error); + that.ItemBarKw = []; + }); + }, + getModel() { var that = this; that.isLoading = true; @@ -29,11 +98,20 @@ .then(function (res) { var json = res; if (json.status == 0) { - that.modeInfo = json.data.tbBillList; + that.ItemDetail = json.data.tbBillList; + that.DaaInfo = json.data.tbBillList.daaInfo; + that.modeInfo.planNo = json.data.tbBillList.planNo; + that.modeInfo.startTime = json.data.tbBillList.startTime; + that.$refs.barcode.focus(); } else { that.$toast.fail(json.message); + that.$playSound('error'); that.$refs.daa001.focus(); + that.modeInfo.daa001 = ""; + that.modeInfo.planNo = ""; + that.modeInfo.startTime = ""; + that.ItemDetail = []; } that.isLoading = false; }) @@ -42,12 +120,14 @@ that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); console.log(error); that.$refs.daa001.focus(); + that.modeInfo.daa001 = ""; }); }, + //鎵爜 getScan() { var that = this; if (that.modeInfo.daa001.length <= 0) { - that.$toast.fail("棰嗘枡鍗曞彿涓嶈兘涓虹┖锛�"); + that.$toast.fail("濮斿宸ュ崟涓嶈兘涓虹┖锛�"); return; } that.isLoading = true; @@ -60,13 +140,21 @@ var json = res; if (json.status == 0) { // that.scanInfo = json.data.tbBillList; + that.$notify({ type: 'success', message: json.message }); that.getModel(); + that.$refs.barcode.focus(); + that.scanInfo.barcode = null; + } + else if (json.status == 2) { + that.$refs.splitNum.focus(); + that.scanInfo.splitNum = json.data.tbBillList.splitNum; + that.scanInfo.barcodeNum = json.data.tbBillList.barcodeNum; } else { that.$toast.fail(json.message); that.$refs.barcode.focus(); } - that.$notify({ type: 'success', message: json.message }); + //that.$notify({ type: 'success', message: json.message }); that.isLoading = false; }) .catch(function (error) { @@ -76,10 +164,11 @@ that.$refs.barcode.focus(); }); }, + //鎷嗗垎 getChaiFen() { var that = this; if (that.modeInfo.daa001.length <= 0) { - that.$toast.fail("棰嗘枡鍗曞彿涓嶈兘涓虹┖锛�"); + that.$toast.fail("濮斿宸ュ崟鍙蜂笉鑳戒负绌猴紒"); return; } if (that.scanInfo.splitNum * 1 <= 0) { @@ -91,18 +180,26 @@ return; } that.isLoading = true; - that.AxiosHttp("post", 'WwGd/ScanCode', { + that.AxiosHttp("post", 'WwGd/ScanCodeCF', { daa001: that.modeInfo.daa001, userName: that.userInfo.loginAccount, - barcode: that.modeInfo.barcode, + 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.modeInfo = json.data.tbBillList; + that.$notify({ type: 'success', message: json.message }); + that.getModel(); + that.$refs.barcode.focus(); + that.scanInfo.barcode = null; + that.scanInfo.barcodeNum = ""; + that.scanInfo.splitNum = ""; } else { that.$toast.fail(json.message); + that.$refs.splitNum.focus(); } that.isLoading = false; }) @@ -110,7 +207,66 @@ that.isLoading = false; that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); console.log(error); + that.$refs.splitNum.focus(); }); }, + //鑾峰彇宸ュ崟淇℃伅 + getInfo() { + this.show = true; + var that = this; + that.actions = []; + that.isLoading = true; + that.AxiosHttp("post", 'WwGd/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, // 鎷兼帴瀛楁 + subname: item.startTime + }; + }); + } + } + 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