From fbbbc66329808249c7a0689f2efca6c79a6bf892 Mon Sep 17 00:00:00 2001 From: lty <876263681@qq.com> Date: 星期四, 28 八月 2025 08:37:11 +0800 Subject: [PATCH] # --- pages/basics/order.vue | 127 +++++++++++++++++++++++++++++++++++++---- 1 files changed, 113 insertions(+), 14 deletions(-) diff --git a/pages/basics/order.vue b/pages/basics/order.vue index fb3f973..e04b1fe 100644 --- a/pages/basics/order.vue +++ b/pages/basics/order.vue @@ -15,19 +15,36 @@ </view> </view> - <view class="square-2"> - <view class="square-title"> - <view class="title-sign"><view class="sign"></view></view> - <view class="title-text"><text>鍗曟嵁缂栧彿</text></view> + <view class="square-3"> + <!-- 鏍囬閮ㄥ垎 --> + <view class="square-title"> + <view class="title-sign"><view class="sign"></view></view> + <view class="title-text"><text>鍗曟嵁缂栧彿</text></view> + </view> + + <!-- 鍐呭鍖哄煙 --> + <view class="square-content" style="display: flex; align-items: center;"> + <!-- 涓嬫媺杈撳叆妗� --> + <view class="content-input" style="flex: 1;"> + <uni-combox + v-model="orderNo" + :candidates="orderNoList" + placeholder="璇疯緭鍏� / 閫夋嫨璁㈠崟鍙�" + placeholderStyle="line-height: 60rpx; font-size: 30rpx; color: #999;" + @input="getOrderDet" + @change="onOrderSelect" + /> </view> - <view class="square-content"> - <view class="content-input"> - <input v-model="order" type="text" placeholder="鎵爜 / 杈撳叆" @input="findOrder()" - :focus="focus" placeholder-style="line-height: 85rpx;"> - <uni-icons type="closeempty" size="20" color="#dadada" @click="removeOrder()"></uni-icons> - </view> + + <!-- 妫�绱㈡寜閽� --> + <view style="width: 80px; display: flex; align-items: center; justify-content: center; margin-left: 10rpx;"> + <button size="mini" type="primary" @click="getOrderDetlByOrderNo()">妫�绱�</button> </view> + </view> </view> + + + <view class="square-1"> <view class="square-title"> @@ -59,7 +76,7 @@ <view class="data-list-left"> <view class="matnr"><text style="width: 700rpx;">缂栫爜锛歿{item.matnr}}</text></view> <view><text style="width: 700rpx;">鍝佸悕锛歿{item.maktx}}</text></view> - <view><text style="width: 700rpx;">鎵瑰彿锛歿{item.batch}}</text></view> + <view><text style="width: 700rpx;">瑙勬牸锛歿{item.specs}}</text></view> <view> <text style="width: 700rpx;">鏁伴噺锛歿{item.anfme}}</text> </view> @@ -133,7 +150,6 @@ searchBox: 'hide', pick:'hide', order:null, - orderNo:null, matList:[], result: '', count:'', @@ -144,6 +160,9 @@ check:false, checkText:'鍏ㄩ��', checkedData:[], + orderNo: '', + orderNoList: [], + showDropdown: false } }, mounted(){ @@ -156,6 +175,76 @@ this.getUrl() }, methods: { + getOrderDet(orderNo) { + if (!orderNo || orderNo.trim() === '') return; + uni.request({ + url: this.commonUrl + '/mobile/order/search/orderNoList/auth', + method: 'GET', + data: { orderNo }, + header: { + token: uni.getStorageSync('token') + }, + success: res => { + const list = res.data.data || []; + this.orderNoList = list.map(o => o.orderNo); + } + }); + }, + + onOrderSelect(order) { + this.orderNo = order; + // 鍙�夛細鑷姩瑙﹀彂鏌ヨ + // this.getOrderDetlByOrderNo(); + }, + getOrderDetlByOrderNo() { + if (!this.orderNo) { + uni.showToast({ title: '璇烽�夋嫨璁㈠崟', icon: 'none' }); + return; + } + let that = this; + uni.request({ + url: that.commonUrl + '/mobile/order/search/orderNo/auth', + data: { + orderNo: that.orderNo + }, + header: { + token: uni.getStorageSync('token') + }, + success(result) { + let res = result.data; + console.log(res.data[0]); + if (res.code === 200) { + if (res.data) { + uni.showLoading(); + that.matList = res.data[0].combMats; + that.initAnfme(); + console.log(that.matList); + } + } else if (res.code == 403) { + uni.showToast({ title: res.msg, icon: "none", position: 'top' }); + setTimeout(() => { + uni.reLaunch({ + url: '../login/login' + }); + }, 1000); + } else { + uni.showToast({ title: res.msg, icon: "none", position: 'top' }); + } + } + }); + }, + + + + selectOrder(orderNo) { + this.order = orderNo + this.showDropdown = false + }, + removeOrder() { + this.order = '' + this.orderSuggestions = [] + this.showDropdown = false + }, // 鑾峰彇url getUrl() { this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl @@ -197,6 +286,7 @@ this.matList = [] this.barcode = '' this.order = '' + this.orderNo = ''; this.barcodeFocuss() uni.vibrateShort(); }, @@ -224,6 +314,7 @@ initAnfme() { for (var i = 0; i < this.matList.length; i++) { + this.matList[i].enableQty = this.matList[i].anfme this.matList[i].anfme = 0 } uni.hideLoading(); @@ -293,6 +384,7 @@ uni.request({ url: that.commonUrl + '/mobile/comb/auth', data: JSON.stringify({ + billNo: that.orderNo, orderNo: that.orderNo, barcode: that.barcode, combMats: that.matList @@ -335,12 +427,12 @@ 'token':uni.getStorageSync('token') }, success(result) { - console.log(result) let res = result.data + console.log(res.data[0]) if (res.code === 200) { if(res.data) { uni.showLoading(); - that.matList = res.data; + that.matList = res.data[0].combMats; that.orderNo = that.order that.initAnfme() console.log(that.matList) @@ -639,5 +731,12 @@ bottom: 0; text-align: center; } + + + + + + + </style> -- Gitblit v1.9.1