From d3cb74c577d7254fe0f879ce77694e5d51d77ae4 Mon Sep 17 00:00:00 2001 From: whycq <123456> Date: 星期三, 28 九月 2022 13:19:53 +0800 Subject: [PATCH] # --- pages/basics/manStoCheck.vue | 75 +++++++++++++++++++++++++++++++++---- 1 files changed, 66 insertions(+), 9 deletions(-) diff --git a/pages/basics/manStoCheck.vue b/pages/basics/manStoCheck.vue index afaf9cb..edd76cc 100644 --- a/pages/basics/manStoCheck.vue +++ b/pages/basics/manStoCheck.vue @@ -8,8 +8,8 @@ </view> <view class="square-content"> <view class="content-input"> - <input type="text" v-model="locno" placeholder="鎵爜 / 杈撳叆" :focus="locnoFocus"> - <uni-icons v-show="locno" type="closeempty" size="20" color="#dadada" @click="remove('locno')"></uni-icons> + <input type="text" v-model="locNo" placeholder="鎵爜 / 杈撳叆" :focus="locnoFocus"> + <uni-icons v-show="locNo" type="closeempty" size="20" color="#dadada" @click="remove('locno')"></uni-icons> </view> </view> </view> @@ -113,7 +113,7 @@ data() { return { commonUrl:null, - locno: '', + locNo: '', locnoFocus: true, matnr: '', matnrFocus: true, @@ -238,15 +238,15 @@ }, resst() { this.matList = [] - this.locno = '' - this.barcodeFocuss() + this.locNo = '' + // this.barcodeFocuss() uni.vibrateShort(); }, comb() { uni.vibrateShort(); let that = this; - if (that.barcode === '') { - uni.showToast({title: '璇锋壂鎻忔墭鐩樻潯鐮�', icon: "none", position: 'top'}); + if (that.locNo === '') { + uni.showToast({title: '璇锋壂鎻忓簱浣嶆潯鐮�', icon: "none", position: 'top'}); return; } if (that.matList.length === 0) { @@ -261,9 +261,9 @@ } uni.showLoading(); uni.request({ - url: that.commonUrl + '/mobile/comb/auth', + url: that.commonUrl + '/locCheck/pda', data: JSON.stringify({ - barcode: that.barcode, + locNo: that.locNo, combMats: that.matList }), method: 'POST', @@ -293,6 +293,63 @@ } }); }, + // 鎻愬彇鍟嗗搧 + selectMat() { + let that = this + uni.vibrateShort(); + uni.navigateTo({ + url: "matSelect", + events: { + // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� 鍙﹀涓�涓〉闈紶杩囨潵鐨� + acceptDataFromOpenedPage: function(data) { + that.matnr = data.data + that.findMat(that.matnr) + }, + }, + success: function(res) { + // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� 鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑 + res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl }) + }, + + }); + that.matnr = '' + }, + findMat() { + let that = this + uni.request({ + url: that.commonUrl + '/mat/auth', + data: { + matnr:that.matnr + }, + header: { + 'token':uni.getStorageSync('token') + }, + success(result) { + uni.vibrateShort(); + let res = result.data + if (res.code === 200 && res.data) { + that.matData = res.data + that.matnr = '' + uni.navigateTo({ + url: "matQuery", + events: { + // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� + matList: function(data) { + console.log(data) + that.matList.push(data.data) + }, + }, + success: function(res) { + // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� + res.eventChannel.emit('matData', { data: that.matData }) + }, + }); + } + + } + }); + + }, } } </script> -- Gitblit v1.9.1