From 34e81b3d0fe9ae1e9edd4fd8bcdaf7ec69b7f239 Mon Sep 17 00:00:00 2001 From: zhang <zc857179121@qq.com> Date: 星期五, 27 六月 2025 09:00:45 +0800 Subject: [PATCH] 12 --- pages/order/orderPakin2.vue | 168 +++++++++++++++++++++++++++++++------------------------- 1 files changed, 93 insertions(+), 75 deletions(-) diff --git a/pages/order/orderPakin2.vue b/pages/order/orderPakin2.vue index 938edcf..252f9b4 100644 --- a/pages/order/orderPakin2.vue +++ b/pages/order/orderPakin2.vue @@ -6,24 +6,22 @@ <view style="flex: 1;"> <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="orderNo" :focus="orderNoFocus"> </view> - <view style="height:100%;line-height:2;width:40rpx;margin-right: 20rpx;"> - <uni-icons type="clear" color="#c1c1c1" @click="clearOrderNo()"></uni-icons> - </view> + </view> <view class="item"> <view class="code-decs">鎵樼洏鐮�:</view> <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus" @input="barcodeInput()"> </view> - <view class="item"> + <!-- <view class="item"> <view class="code-decs">鐗╂枡鐮�:</view> <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="matnr" :focus="matFocus" @input="findMat()"> - <view class="item-right"> + <!-- <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> --> + <!-- </view> --> --> </view> <view class="mat-list-title"> 鍟嗗搧鍒楄〃 @@ -65,6 +63,10 @@ <view class="desc">鏁伴噺锛�</view> <view class="left-item">{{item.anfme}}</view> </view> + <view class="list-left-item"> + <view class="desc">鐘舵�侊細</view> + <view class="left-item">{{item.review}}</view> + </view> </view> <view class="list-right"> <uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons> @@ -102,7 +104,7 @@ <view class="popup-item"> <view class="popup-item-left">鏁伴噺:</view> <view class="popup-item-right" style="border: none;justify-content: center;"> - <uni-number-box :value="count" :step='0.01' :max="9999999" color="#747474" @change="changeValue" /> + <uni-number-box :value="count" :step='0.001' :max="9999999" color="#747474" @change="changeValue" /> </view> </view> <view class="btn"> @@ -162,15 +164,22 @@ messageText: '', title: '', content: '', - orderNoFocus: true, - barcodeFocus: false, + orderNoFocus: false, + barcodeFocus: true, matFocus: false, matData: '', removeNum: 0, } }, onLoad() { - + let that = this + const eventChannel = this.getOpenerEventChannel(); + + eventChannel.on('orderItem', function(data) { + console.log(data.item) + that.orderNo = data.item.orderNo + that.checkMat(data.item) + }); }, onShow() { this.baseUrl = uni.getStorageSync('baseUrl'); @@ -201,16 +210,7 @@ barcodeInput() { // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏� setTimeout(() => { - var len = this.barcode.length - if (len != 8) { - uni.showToast({ - title: '鎵樼洏鐮佹湁璇閲嶈瘯', - icon: "none", - position: 'top' - }); - this.barcodeFocuss() - return; - } + var len = this.barcode.length this.focuss() }, 200) }, @@ -234,57 +234,68 @@ // 鎼滅储鐗╂枡 findMat() { let that = this - uni.request({ - url: that.baseUrl + '/mat/auth', - data: { - matnr: that.matnr - }, - header: { - 'token': uni.getStorageSync('token') - }, - success(result) { - result = result.data - if (result.code === 200 && result.data) { - that.matData = result.data - that.matnr = '' - that.matData['batch'] = '' - uni.navigateTo({ - url: "../mat/matSelected", - // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� - success: function(res) { - res.eventChannel.emit('mat', { - data: result.data - }) - }, - // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� - events: { - matList: function(data) { - that.checkMat(data.data) - that.focuss() - }, - }, - }); - } else if (result.code == 403) { - uni.showToast({ - title: result.msg, - icon: "none", - position: 'top' - }) - setTimeout(() => { - uni.reLaunch({ - url: '../login/login' - }); - }, 1000); - } else { - uni.showToast({ - title: result.msg, - icon: "none", - position: 'top' - }) - } - + let m = that.matnr.split(";") + let matnr1 = m[0].slice(3) + for(var i = 0;i<that.dataList.length;i++){ + if(that.dataList[i].matnr === matnr1){ + that.dataList[i].review = "宸插鏍�" } - }); + + } + setTimeout(() => { + this.matnr = ''; + }, 100); + // uni.request({ + // url: that.baseUrl + '/mat/auth', + // data: { + // matnr: matnr1 + // }, + // header: { + // 'token': uni.getStorageSync('token') + // }, + // success(result) { + // result = result.data + // if (result.code === 200 && result.data) { + // that.matData = result.data + // that.matnr = '' + // that.matData['batch'] = '' + // uni.navigateTo({ + // url: "../mat/matSelected", + // // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� + // success: function(res) { + // res.eventChannel.emit('mat', { + // data: result.data + // }) + // }, + // // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� + // events: { + // matList: function(data) { + // that.checkMat(data.data) + // that.focuss() + // }, + // }, + // }); + // } else if (result.code == 403) { + // uni.showToast({ + // title: result.msg, + // icon: "none", + // position: 'top' + // }) + // setTimeout(() => { + // uni.reLaunch({ + // url: '../login/login' + // }); + // }, 1000); + // } else { + // uni.showToast({ + // title: result.msg, + // icon: "none", + // position: 'top' + // }) + // } + + // } + // }); }, selectMat() { @@ -310,6 +321,7 @@ that.matnr = '' }, checkMat(mat) { + mat.review = "鏈鏍�" var len = this.dataList.length var add = true ,sameItem = false for (var i = 0; i < len; i++) { @@ -414,11 +426,17 @@ return; } for (var i = 0; i < that.dataList.length; i++) { + // if (that.dataList[i].review !== "宸插鏍�" ) { + // this.messageText = that.dataList[i].matnr + '鏈鏍�' + // this.messageToggle('error') + // return; + // } if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') { this.messageText = that.dataList[i].matnr + '缁勬墭鏁伴噺涓嶈兘涓�0' this.messageToggle('error') return; - } + } + } uni.request({ url: that.baseUrl + '/mobile/comb/auth', @@ -493,7 +511,7 @@ .code { width: 100%; position: fixed; - min-height: 210rpx; + min-height: 200rpx; background-color: #FFF; z-index: 10; } @@ -501,7 +519,7 @@ .item { display: flex; align-items: center; - height: 70rpx; + height: 100rpx; margin-left: 20rpx; border-bottom: 1px solid #DCDFE6; } @@ -533,7 +551,7 @@ width: 100%; background-color: white; position: fixed; - margin-top: 200rpx; + margin-top: 300rpx; z-index: 9; /* border-top: 1px solid #DCDFE6; */ text-align: center; -- Gitblit v1.9.1