From 1a3d4450cfcde83cb430d955f48fdf1775b539ca Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期四, 14 三月 2024 10:34:17 +0800 Subject: [PATCH] # --- pages/project/jmAGV/home.vue | 171 +++++++++++++++++++++++++++++++------------------------- 1 files changed, 95 insertions(+), 76 deletions(-) diff --git a/pages/project/jmAGV/home.vue b/pages/project/jmAGV/home.vue index 6533e3e..45bfd9d 100644 --- a/pages/project/jmAGV/home.vue +++ b/pages/project/jmAGV/home.vue @@ -18,21 +18,32 @@ <view class="popup"> <view>{{text}}</view> <view class="button-nk" @click="upTray()">{{btnTitle1}}</view> - <view class="button-nk" @click="downTray">{{btnTitle2}}</view> - <view v-show="outType" class="button-nk" @click="downTray1">{{btnTitle3}}</view> + <view class="button-nk" @click="downTray()">{{btnTitle2}}</view> + <view v-show="outType" class="button-nk" @click="downTray1()">{{btnTitle3}}</view> </view> </uni-popup> </view> - <!-- <view> - <uni-popup ref="revise2" type="dialog"> + <view> + <uni-popup ref="numberPopup" type="dialog"> <view class="popup2"> - <view>123</view> - <view class="button-nk" @click="inHouse">鎵樼洏-浠撳簱(鍏ュ簱)</view> - <view class="button-nk" @click="outHouse">浠撳簱-鎵樼洏(鍑哄簱)</view> + <view>涓婃灦鏁伴噺</view> + <view class="button-nk" @click="goUp(2)">2涓�</view> + <view class="button-nk" @click="goUp(4)">4涓�</view> </view> </uni-popup> - </view> --> + </view> + + <view> + <uni-popup ref="numberPopup" type="dialog"> + <view class="popup2"> + <view>涓婃灦鏁伴噺</view> + <view class="button-nk" @click="goUp(2)">2涓�</view> + <view class="button-nk" @click="goUp(4)">4涓�</view> + </view> + </uni-popup> + </view> + </view> </template> @@ -72,7 +83,10 @@ btnTitle2: '', btnTitle3: '', outType: '', - stationType: 'load' + stationType: 'load', + type: '' , + originLocal: '', + targetLocal: '', } }, onShow() { @@ -96,72 +110,31 @@ } this.$refs.revise.open(type) }, + // 鍦伴潰绔欎笂鏋� / 鎵樼洏绔欏叆搴撴寜閽� upTray() { - let _this = this - let type = '',originLocal = '',targetLocal = ''; if (this.item.type == 'foolr') { - type = 'load', // 涓婃灦 - originLocal = this.item.code, - targetLocal = this.item.traget + this.type = 'load', // 涓婃灦 + this.originLocal = this.item.code, + this.targetLocal = this.item.traget + this.numberPopup() } else { - type = 'in' // 鍏ュ簱 - originLocal = this.item.code, - targetLocal = 'KW-J' + this.type = 'in' // 鍏ュ簱 + this.originLocal = this.item.code, + this.targetLocal = 'KW-J' + this.pakin() } - // this.text = originLocal + targetLocal - uni.request({ - url: `${_this.baseUrl}/agv/requestTask`, - data: { - originLocal: originLocal, - targetLocal: targetLocal, - type: type - }, - header: { 'token': uni.getStorageSync('token') }, - method: 'POST', - success(res) { - res = res.data - if (res.code === 200) { - this.$refs.revise.close() - uni.showToast({ title: '鎿嶄綔鎴愬姛', icon: "none", position: 'top' }) - } else { - uni.showToast({ title: res.msg, icon: "none", position: 'top' }) - } - - } - }) }, downTray() { - let _this = this - let type = '',originLocal = '',targetLocal = ''; if (this.item.type == 'foolr') { - type = 'unload', // 涓嬫灦 - originLocal = this.item.traget, - targetLocal = this.item.code + this.type = 'unload', // 涓嬫灦 + this.originLocal = this.item.traget, + this.targetLocal = this.item.code + this.numberPopup() } else { - type = 'out1' // 鍑哄簱 - originLocal = 'KW-C' - targetLocal = this.item.code + this.type = 'out1' // 鍑哄簱 + this.originLocal = 'KW-C' + this.targetLocal = this.item.code } - // this.text = originLocal + targetLocal - uni.request({ - url: `${_this.baseUrl}/agv/requestTask`, - data: { - originLocal: originLocal, - targetLocal: targetLocal, - type: type - }, - header: { 'token': uni.getStorageSync('token') }, - method: 'POST', - success(res) { - res = res.data - if (res.code === 200) { - this.$refs.revise.close() - uni.showToast({ title: '鎿嶄綔鎴愬姛', icon: "none", position: 'top' }) - } else { - uni.showToast({ title: res.msg, icon: "none", position: 'top' }) - } - } - }) }, downTray1() { let _this = this @@ -195,8 +168,53 @@ } } }) + }, + numberPopup() { + this.$refs.numberPopup.open('center') + }, + // 涓� / 涓� 鏋舵暟閲� + goUp(num) { + let data = {} + data = { + originLocal: this.originLocal, + targetLocal: this.targetLocal, + type: this.type, + anfme: num, + } + this.webServer(data) + setTimeout(()=>{ + this.$refs.numberPopup.close() + },300) + }, + pakin() { + let data = {} + data = { + originLocal: this.originLocal, + targetLocal: this.targetLocal, + type: this.type, + } + this.webServer(data) + }, + // 鎵�鏈夋湇鍔� + webServer(data) { + let _this = this + uni.request({ + url: `${_this.baseUrl}/agv/requestTask`, + data: data, + header: { 'token': uni.getStorageSync('token') }, + method: 'POST', + success(res) { + res = res.data + if (res.code === 200) { + this.$refs.revise.close() + uni.showToast({ title: '鎿嶄綔鎴愬姛', icon: "none", position: 'top' }) + } else { + uni.showToast({ title: res.msg, icon: "none", position: 'top' }) + } + + } + }) } - } } </script> @@ -213,12 +231,13 @@ /* margin: 1%; */ background-color: azure; } - .zcard { + /* .zcard { margin: 10px 100px; - /* background-color: blanchedalmond; */ - } + background-color: #409EFF; + } */ .zcard-flex { /* background-color: coral; */ + margin-top: 20rpx; width: 100%; height: 100%; display: flex; @@ -228,15 +247,15 @@ align-items: center; } .button-nk { - margin: 10rpx; - padding: 20rpx 70rpx; + margin: 10rpx 0rpx; + /* padding: 20rpx 70rpx; */ /* background-color: azure; */ - min-width: 200rpx; + min-width: 150rpx; /* margin: 0 auto; */ - height: 50px; + height: 50rpx; text-align: center; - line-height: 50px; - font-size: 20px; + line-height: 50rpx; + font-size: 20rpx; background-color: #409EFF; color: #ECF0F1; border-radius: 7px; -- Gitblit v1.9.1