From 81a6593430d3a8d3669012e30d7ebc0e011ea26f Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期六, 06 五月 2023 14:36:11 +0800 Subject: [PATCH] # --- pages/order/orderPutDown.vue | 95 +++++++++++++++++++++++++++++++---------------- 1 files changed, 62 insertions(+), 33 deletions(-) diff --git a/pages/order/orderPutDown.vue b/pages/order/orderPutDown.vue index 3a17edd..3094c4f 100644 --- a/pages/order/orderPutDown.vue +++ b/pages/order/orderPutDown.vue @@ -1,23 +1,16 @@ <template> <view> <view class="code"> - <!-- <view class="item"> - <view class="code-decs">璁㈠崟鍙�:</view> - <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="order" :focus="orderFocus" - @input="orderInput()" disabled> - </view> --> <view class="item"> - <view class="code-decs">鎵樼洏鐮�:</view> + <view class="code-decs">搴撲綅鐮�:</view> <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus" - @confirm="barcodeInput()"> + @input="barcodeInput()"> </view> <view class="item"> - <view class="code-decs">搴撲綅鍙�:</view> + <view class="code-decs">鐗╂枡鍙�:</view> <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="matnr" :focus="matFocus" @input="findMat()"> <view class="item-right"> <button></button> - <!-- <text style="text-align: right;color: #409EFF;" @click="selectMat()">鎻愬彇+</text> --> - <!-- <uni-icons type="right" color="#c1c1c1"></uni-icons> --> </view> </view> </view> @@ -148,7 +141,6 @@ baseUrl: '', token: '', order: '', - orderFocus: true, barcode: '', barcodeFocus: '', dataList: [], @@ -162,9 +154,10 @@ messageText: '', title: '', content: '', - barcodeFocus: false, + barcodeFocus: true, matFocus: false, - matData: '' + matData: '', + removeNum: 0 } }, onShow() { @@ -175,6 +168,28 @@ messageToggle(type) { this.msgType1 = type this.$refs.message.open() + }, + barcodeInput() { + // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏� + setTimeout(() => { + this.focuss() + }, 200) + }, + // 鎵樼洏鐮佹湁璇噸缃� + barcodeFocuss() { + let that = this; + that.barcodeFocus = false; + setTimeout(() => { + that.barcode = ''; + that.barcodeFocus = true; + }, 100); + }, + // 鍟嗗搧鍏夋爣娓呯┖閲嶇疆 + focuss() { + setTimeout(() => { + this.matnr = ''; + this.matFocus = true; + }, 100); }, // 鎼滅储鐗╂枡 findMat() { @@ -209,6 +224,7 @@ events: { matList: function(data) { that.checkMat(data.data) + that.focuss() }, }, }); @@ -240,28 +256,34 @@ var len = this.dataList.length var add = true ,sameItem = false for (var i = 0; i < len; i++) { - if (mat.matnr == this.dataList[i].matnr) { - for (var j = 0; j < len; j++) { - if (mat.batch == this.dataList[j].batch) { - sameItem = true + if (mat.orderNo != this.dataList[i].orderNo) { + add = true + break; + } else { + if (mat.matnr == this.dataList[i].matnr) { + for (var j = 0; j < len; j++) { + if (mat.batch == this.dataList[j].batch) { + sameItem = true + } } - } - // 鐩稿悓鐗╂枡 涓嶅悓鎵瑰彿 鏂板姞鍒楄〃 - if (mat.batch != this.dataList[i].batch) { - this.$forceUpdate() // 寮哄埗鍒锋柊 - if (sameItem) { - add = false + // 鐩稿悓鐗╂枡 涓嶅悓鎵瑰彿 鏂板姞鍒楄〃 + if (mat.batch != this.dataList[i].batch) { + this.$forceUpdate() // 寮哄埗鍒锋柊 + if (sameItem) { + add = false + } else { + add = true + } + } else { - add = true + // 鐩稿悓鐗╂枡鐩稿悓鎵瑰彿 鏁伴噺绱姞 + this.dataList[i].anfme += mat.anfme + this.$forceUpdate() // 寮哄埗鍒锋柊 + add = false } - - } else { - // 鐩稿悓鐗╂枡鐩稿悓鎵瑰彿 鏁伴噺绱姞 - this.dataList[i].anfme += mat.anfme - this.$forceUpdate() // 寮哄埗鍒锋柊 - add = false } } + } if (add) { this.dataList.unshift(mat) @@ -294,9 +316,9 @@ } } uni.request({ - url: that.baseUrl + '/mobile/comb/auth', + url: that.baseUrl + '/mobile/manDetl/out', data: JSON.stringify({ - locno: that.barcode, + locNo: that.barcode, combMats: that.dataList }), method: 'POST', @@ -356,6 +378,7 @@ }, // 鍒楄〃绉婚櫎鎸夐挳 remove(item, i, type) { + this.removeNum = i this.msgType = type this.title = '璀﹀憡' this.content = '鏄惁绉婚櫎褰撳墠鍟嗗搧!' @@ -365,7 +388,7 @@ removeConfirm(i) { this.messageText = "绉婚櫎鎴愬姛" this.messageToggle('success') - this.dataList.splice(i, 1) + this.dataList.splice(this.removeNum, 1) }, reviseConfirm() { this.dataList[this.rowNum].anfme = this.count @@ -381,6 +404,12 @@ changeValue(value) { this.count = value }, + // 娓呯┖ + resst() { + this.dataList = [] + this.barcode = '' + this.barcodeFocuss() + }, } } </script> -- Gitblit v1.9.1