From 77a2d94762f81da09be82aeab75cdabbf95d2926 Mon Sep 17 00:00:00 2001 From: 南骏 池 <chiffly@163.com> Date: 星期一, 25 八月 2025 10:28:10 +0800 Subject: [PATCH] 1.核对送检优化 2.样式优化 --- H5/Js/Cpbdsj.js | 231 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 216 insertions(+), 15 deletions(-) diff --git a/H5/Js/Cpbdsj.js b/H5/Js/Cpbdsj.js index ed2086c..e2fa8a3 100644 --- a/H5/Js/Cpbdsj.js +++ b/H5/Js/Cpbdsj.js @@ -1,4 +1,5 @@ -锘縱ar vm = new Vue({ +锘� +var vm = new Vue({ el: '#app', data: function () { return { @@ -15,8 +16,23 @@ KbBarMxInfo: [], GX: "G007:鏍稿閫佹", Xvalue:4, - XbarInfo: [], + XbarInfo: [ + //{ + // iteM_BARCODE: "", // 鏉$爜 + // item_no: "", // 鐗╂枡缂栧彿 + // item_name: "", // 鐗╂枡鍚嶇О + // item_model: "", // 瑙勬牸鍨嬪彿 + // quantity: 0, // 鏁伴噺 + // is_hedui: "0", // 鏄惁鏍稿(1:宸叉牳瀵� 0:鏈牳瀵�), + // weight: "" // 浜у搧閲嶉噺 + //} + ], DAA001: [], + show: false,//鍒楄〃灞曠ず + actions: [],//鍒楄〃鐨勫�� + xtName: "",//绾夸綋鍚嶇О + xtNum: "",//绾夸綋缂栧彿 + agvChecked: false,//鏄惁鍕鹃�堿GV } }, mounted() { @@ -87,7 +103,7 @@ } //寰呰鏁� - var Dvalue = (that.KbBarInfo.oldqty || 0) - +(that.KbBarInfo.ySum || 0) + var Dvalue = (that.KbBarInfo.quantity || 0) - +(that.KbBarInfo.ySum || 0) // 妫�鏌ユ槸鍚﹁秴杩囪绠辨暟 if (that.Xvalue > Dvalue) { that.$playSound('error'); @@ -116,23 +132,30 @@ var json = res; if (json.status == 0) { that.XbarInfo.push(json.data.tbBillList.xBarInfo[0]); + that.$playSound('success'); that.$refs.XBar.focus(); that.XBar = ""; + + // 妫�鏌ユ槸鍚﹁秴杩囪绠辨暟 + if (that.XbarInfo.length >= that.Xvalue) { + that.$refs.LsBar.focus(); + } + } else { that.$playSound('error'); + that.XBar = ""; that.$toast.fail(json.message); } that.isLoading = false; }) .catch(function (error) { that.isLoading = false; + that.XBar = ""; that.$playSound('error'); that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); }); }, - - productBinding() { if (this.isLoading) { @@ -204,15 +227,37 @@ if (matchedItem.is_hedui === "1") { that.$toast("宸叉牳瀵�"); } else { - that.$set(matchedItem, 'is_hedui', "1"); - that.$playSound('success'); - that.$notify({ type: 'success', message: "鏍稿鎴愬姛" }); - that.LsBar = ""; - // 妫�鏌ユ槸鍚︽墍鏈夎閮藉凡鏍稿 - const allChecked = that.XbarInfo.every(item => item.is_hedui === "1"); - if (allChecked && that.XbarInfo.length > 0) { - that.submitAllChecked(); - } + + that.AxiosHttp("post", 'Womdaa/GetWeightByXt', { + LsBar: that.LsBar, + userName: that.userInfo.loginAccount + }, false) + .then(function (res) { + var json = res; + if (json.status == 0) { + var weigth = json.data.tbBillList.weight; + that.$set(matchedItem, 'is_hedui', "1"); + that.$set(matchedItem, 'weight', weigth); + that.$playSound('success'); + that.$notify({ type: 'success', message: "鏍稿鎴愬姛" }); + that.LsBar = ""; + // 妫�鏌ユ槸鍚︽墍鏈夎閮藉凡鏍稿 + const allChecked = that.XbarInfo.every(item => item.is_hedui === "1"); + if (allChecked && that.XbarInfo.length > 0 && that.XbarInfo.length === that.Xvalue) { + that.submitAllChecked(); + } + } + else { + that.$playSound('error'); + that.$toast.fail(json.message); + } + that.isLoading = false; + }) + .catch(function (error) { + that.isLoading = false; + that.$playSound('error'); + that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); + }); } } else { that.$playSound('error'); @@ -220,6 +265,15 @@ } that.LsBar = ""; // 娓呯┖杈撳叆妗� + }, + + handleClear() { + this.KbBar = ""; + this.XBar = ""; + this.LsBar = ""; + this.DAA001 = []; + this.XbarInfo = []; + }, // 鏂板鏂规硶锛氭彁浜ゆ墍鏈夊凡鏍稿鐨勬暟鎹� @@ -273,7 +327,7 @@ } // 璁$畻鍙鏁板拰宸茶鏁� - const oldqty = +(that.KbBarInfo.oldqty || 0); + const oldqty = +(that.KbBarInfo.quantity || 0); const ySum = +(that.KbBarInfo.ySum || 0); if (oldqty !== ySum) { @@ -310,5 +364,152 @@ that.$refs.KbBar.focus(); }); }, + + onSelect(action) { + this.xtNum = action.lineNo; // 缁戝畾line_no鍒皒tNum瀛楁 + console.log("閫夋嫨鐨勭嚎浣撶紪鍙凤細", this.xtNum); + this.xtName = action.name; // 缁戝畾name鍒皒tName瀛楁 + this.show = false; + }, + //鑾峰彇鍙懠鍙獳GV鐨勭嚎浣� + selectXt() { + this.show = true; + var that = this; + that.actions = []; + that.isLoading = true; + that.AxiosHttp("post", 'Womdaa/GetAgvXt', { + 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.name, + lineNo: item.line_no // 鏂板 + }; + }); + } + } + 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); + }); + }, + + //AGV閫佹 + handleAGVInspection() { + + //this.$toast.fail("鍔熻兘寮�鍙戞祴璇曚腑锛�"); + //return; + + if (this.isLoading) { + return; + } + + + var that = this; + if (that.agvChecked === false) + { + that.$playSound('error'); + that.$toast.fail("AGV閫佹璇峰厛鍕鹃�� AGV"); + return; + } + + if (!that.KbBar) { + that.$playSound('error'); + that.$toast.fail("璇峰厛鎵弿鍗℃澘鏉$爜"); + return; + } + + // 璁$畻鍙鏁板拰宸茶鏁� + const oldqty = +(that.KbBarInfo.quantity || 0); + const ySum = +(that.KbBarInfo.ySum || 0); + + if (oldqty !== ySum) { + that.$playSound('error'); + that.$toast.fail(`瑁呮澘鏈畬鎴愶紝寰呰鏁帮細${oldqty - ySum}`); + return; + } + + that.isLoading = true; + that.AxiosHttp("post", 'Womdaa/handleAGVInspection', { + KbBar: that.KbBar, + userAccount: that.userInfo.loginAccount + }, false) + .then(function (res) { + var json = res; + if (json.status == 0) { + that.$playSound('success'); + that.$notify({ type: 'success', message: json.message }); + } else { + that.$playSound('error'); + that.$toast.fail(json.message); + } + that.isLoading = false; + }) + .catch(function (error) { + that.isLoading = false; + that.$playSound('error'); + that.$toast.fail("AGV閫佹澶辫触锛岃閲嶈瘯锛�"); + that.$refs.KbBar.focus(); + }); + }, + + //AGV鍛煎彨 + handleAGVCall() { + //this.$toast.fail("鍔熻兘寮�鍙戞祴璇曚腑锛�"); + //return; + + if (this.isLoading) { + return; + } + + var that = this; + if (!that.xtNum) { + that.$playSound('error'); + that.$toast.fail("璇峰厛閫夋嫨绾夸綋"); + return; + } + + that.isLoading = true; + that.AxiosHttp("post", 'Womdaa/handleAGVCall', { + XtNum: that.xtNum, + userAccount: that.userInfo.loginAccount + }, false) + .then(function (res) { + var json = res; + if (json.status == 0) { + that.$playSound('success'); + that.$notify({ type: 'success', message: json.message }); + } else { + that.$playSound('error'); + that.$toast.fail(json.message); + } + that.isLoading = false; + }) + .catch(function (error) { + that.isLoading = false; + that.$playSound('error'); + that.$toast.fail("AGV鍛煎彨澶辫触锛岃閲嶈瘯锛�"); + that.$refs.KbBar.focus(); + }); + } + + } }) \ No newline at end of file -- Gitblit v1.9.3