From 6332aba37af20b12b8c3c768ac1416f7e1a5fa8c Mon Sep 17 00:00:00 2001 From: lsh <lsh@163.com> Date: 星期二, 15 四月 2025 15:52:36 +0800 Subject: [PATCH] # --- pages/basics/order.vue | 54 +++++++++++++++++++++++++++++++++--------------------- 1 files changed, 33 insertions(+), 21 deletions(-) diff --git a/pages/basics/order.vue b/pages/basics/order.vue index 752f385..79649a5 100644 --- a/pages/basics/order.vue +++ b/pages/basics/order.vue @@ -9,7 +9,7 @@ <view class="square-content"> <view class="content-input"> <input v-model="barcode" type="text" placeholder="鎵爜 / 杈撳叆" maxlength="10" - :focus="barcodeFocus" @input="barcodeInput"> + :focus="barcodeFocus" @input="barcodeInput" placeholder-style="line-height: 85rpx;"> <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons> </view> </view> @@ -23,7 +23,7 @@ <view class="square-content"> <view class="content-input"> <input v-model="order" type="text" placeholder="鎵爜 / 杈撳叆" @input="findOrder()" - :focus="focus"> + :focus="focus" placeholder-style="line-height: 85rpx;"> <uni-icons type="closeempty" size="20" color="#dadada" @click="removeOrder()"></uni-icons> </view> </view> @@ -57,8 +57,9 @@ <checkbox :value="item.id+''" :checked="item.checked" style="display: block;" /> </label> <view class="data-list-left"> - <view class="matnr"><text style="width: 700rpx;">缂栫爜锛歿{item.matnr}}</text></view> + <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.sku}}</text></view> <view><text style="width: 700rpx;">鎵瑰彿锛歿{item.batch}}</text></view> <view> <text style="width: 700rpx;">鏁伴噺锛歿{item.anfme}}</text> @@ -125,6 +126,7 @@ export default { data() { return { + commonUrl:null, barcode: '', barcodeFocus:true, focus:false, @@ -150,8 +152,15 @@ this.baseIP = UIP; const UPORT = uni.getStorageSync('UPORT'); this.basePORT = UPORT + const PROJ = uni.getStorageSync('UPROJ'); + this.baseUrl = PROJ + this.getUrl() }, methods: { + // 鑾峰彇url + getUrl() { + this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl + }, // barcode input 浜嬩欢 barcodeInput() { var len = this.barcode.length @@ -214,7 +223,6 @@ this.$refs.revise.open(type) }, initAnfme() { - for (var i = 0; i < this.matList.length; i++) { this.matList[i].anfme = 0 } @@ -283,7 +291,7 @@ } uni.showLoading(); uni.request({ - url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/comb/auth', + url: that.commonUrl + '/mobile/comb/auth', data: JSON.stringify({ orderNo: that.orderNo, barcode: that.barcode, @@ -299,13 +307,10 @@ if (res.code === 200) { uni.showToast({ title: res.msg, - position: 'bottom', + position: 'top', duration: 1000 }); - that.barcode = '' - that.orderNo = '' - that.order = '' - that.matList = [] + that.resst() } else if (res.code == 403) { uni.showToast({title: res.msg, icon: "none", position: 'top'}) setTimeout(() => { @@ -322,7 +327,7 @@ findOrder() { let that = this uni.request({ - url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/order/search/orderNo/auth', + url: that.commonUrl + '/mobile/order/search/orderNo/auth', data: { orderNo: that.order }, @@ -330,16 +335,23 @@ 'token':uni.getStorageSync('token') }, success(result) { + console.log("result锛�"); console.log(result) let res = result.data - if (res.code === 200) { - if(res.data) { - uni.showLoading(); - that.matList = res.data; - that.orderNo = that.order - that.initAnfme() - console.log(that.matList) - } + if (res.code === 200 && res.data) { + uni.showLoading(); + that.orderNo = that.order + // that.matList = res.data.map(item => ({ + // ...item, + // combMats: typeof item.combMats === 'string' ? + // JSON.parse(item.combMats) : item.combMats // 纭繚瀵硅薄缁撴瀯[1,2](@ref) + // })); + that.matList = res.data.combMats + that.initAnfme(); + + console.log("that.matList锛�"); + console.log(that.matList) + } else if (res.code == 403) { uni.showToast({title: res.msg, icon: "none", position: 'top'}) setTimeout(() => { @@ -537,8 +549,8 @@ } .data-list { border-bottom: 1px solid #d8d8d8; - height: 180rpx; - margin: 15rpx; + height: 210rpx; + margin: 15rpx auto auto auto; border-radius: 20rpx; } .data-list:first-child { -- Gitblit v1.9.1