From 1340ce90ce3405315ed18954d1c581e053b63ac5 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期一, 30 十月 2023 16:09:49 +0800 Subject: [PATCH] # --- pages/tzsk/pakin/locChage.vue | 136 ++++++++++++++++++++++++++++++++------------ 1 files changed, 98 insertions(+), 38 deletions(-) diff --git a/pages/tzsk/pakin/locChage.vue b/pages/tzsk/pakin/locChage.vue index 674b392..8f768ab 100644 --- a/pages/tzsk/pakin/locChage.vue +++ b/pages/tzsk/pakin/locChage.vue @@ -8,7 +8,8 @@ </view> <view class="item"> <view class="code-decs">鏂板簱浣�:</view> - <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="targetLoc" :focus="targetLocFocus"> + <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="targetLoc" :focus="targetLocFocus" + @input="barcodeInput2()"> <view class="item-right"> <button></button> </view> @@ -51,20 +52,14 @@ </view> </view> <view class="list-left-item"> - <view class="desc">閲嶉噺锛�</view> - <view class="left-item"> - <uni-tag :text="item.weight" type="warning"></uni-tag> - </view> - </view> - <view class="list-left-item"> <view class="desc">鏁伴噺锛�</view> <view class="left-item">{{item.anfme}}</view> </view> </view> - <view class="list-right"> + <!-- <view class="list-right"> <uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons> <uni-icons type="trash" color="#f58a8a" size="24" @click="remove(item,i,'warn')"></uni-icons> - </view> + </view> --> </view> </scroll-view> <!-- 搴曢儴鎿嶄綔鎸夐挳 --> @@ -90,10 +85,6 @@ <view class="popup-item-left">鎵瑰彿:</view> <view class="popup-item-right"><input type="text" v-model="batch"></view> </view> --> - <view class="popup-item"> - <view class="popup-item-left">閲嶉噺:</view> - <view class="popup-item-right"><input type="text" v-model="weight"></view> - </view> <view class="popup-item"> <view class="popup-item-left">鏁伴噺:</view> <view class="popup-item-right" style="border: none;justify-content: center;"> @@ -205,12 +196,81 @@ }, // barcode input 浜嬩欢 barcodeInput() { - // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏� - setTimeout(() => { - var len = this.barcode.length - this.focuss() - }, 200) + let that = this + that.dataList = [] + uni.request({ + url: `${that.baseUrl}/manLocDetl/list/auth`, + header: { 'token': uni.getStorageSync('token') }, + data: { loc_no: that.sourceLoc }, + success(res) { + res = res.data + console.log(res); + if (res.code === 200) { + if (res.data.records.length > 0) { + for (let k of res.data.records) { + console.log(k.status); + if (k.status != 1) { + that.messageText = '褰撳墠搴撲笉鍦ㄧ姸鎬�' + that.messageToggle('error') + that.dataList = [] + that.sourceLoc = '' + that.sourceLocRE() + break + } else { + that.dataList.push(k) + that.sourceLocFocus = false + that.targetLoc = '' + that.targetLocFocus = true + } + } + } else { + that.messageText = '褰撳墠搴撲綅鏆傛棤鏁版嵁' + that.messageToggle('error') + that.sourceLocRE() + } + + + } + } + + }) }, + barcodeInput2() { + let that = this + uni.request({ + url: `${that.baseUrl}/manLocDetl/list/auth`, + header: { 'token': uni.getStorageSync('token') }, + data: { loc_no: that.targetLoc}, + success(res) { + res = res.data + if (res.code === 200) { + if (res.data.records != 0) { + that.messageText = '鏂板簱浣嶆湁璐�' + that.messageToggle('error') + that.targetLocRE() + } + } + } + + }) + }, + // 婧愬簱浣嶉噸缃� + sourceLocRE() { + this.sourceLocFocus = false + setTimeout(()=>{ + this.sourceLoc = '' + this.sourceLocFocus = true + },100) + }, + // 婧愬簱浣嶉噸缃� + targetLocRE() { + this.targetLocFocus = false + setTimeout(()=>{ + this.targetLoc = '' + this.targetLocFocus = true + },100) + }, + // 鎵樼洏鐮佹湁璇噸缃� barcodeFocuss() { let that = this; @@ -326,35 +386,33 @@ } }, combConfirm(type) { + if (this.sourceLoc == '') { + this.messageText = '璇锋壂鎻�/娣诲姞婧愬簱浣�' + this.messageToggle('error') + return + } + if (this.targetLoc == '') { + this.messageText = '璇锋壂鎻�/娣诲姞杞Щ搴撲綅' + this.messageToggle('error') + return + } this.msgType = type this.title = '璀﹀憡' this.content = '鏄惁鐜板湪缁勬墭!' this.$refs.combConfirm.open() }, comb() { - uni.vibrateShort(); let that = this; - if (that.barcode === '') { - this.messageText = "璇锋壂鎻忔墭鐩樻潯鐮�" - this.messageToggle('error') - return; - } - uni.request({ - url: that.baseUrl + '/mobile/manDetl/in/barcode', - data: JSON.stringify({ - locNo: that.locno, - barcode: that.barcode - }), - method: 'POST', - header: { - 'token': uni.getStorageSync('token') - }, + url: `${that.baseUrl}/node/move/start`, + data: {sourceLocNo: that.sourceLoc, + targetLocNo: that.targetLoc}, + header: { 'token': uni.getStorageSync('token') }, success(result) { var res = result.data if (res.code === 200) { that.resst(); - that.messageText = "缁勬墭鎴愬姛" + that.messageText = "绉诲簱鎴愬姛" that.messageToggle('success') } else if (res.code == 403) { that.messageText = res.msg @@ -382,6 +440,8 @@ this.dataList = [] this.order = '' this.barcode = '' + this.sourceLoc = '' + this.targetLoc = '' this.messageText = "閲嶇疆瀹屾垚" this.messageToggle('success') }, @@ -434,8 +494,8 @@ // 娓呯┖ resst() { this.dataList = [] - this.locno = '' - this.barcode = '' + this.sourceLoc = '' + this.targetLoc = '' this.barcodeFocuss() }, combClose() { @@ -455,7 +515,7 @@ display: flex; min-height: 80rpx; background-color: #FFF; - margin: auto 20rpx; + margin: 20rpx 20rpx; border-radius: 20rpx; box-shadow: 0px 0px 30px 0px rgba(0,0,0,0.2); } -- Gitblit v1.9.1