From a2019ade7b884799e639150021c3cdeef27eea72 Mon Sep 17 00:00:00 2001 From: Junjie <xjj@123> Date: 星期六, 09 十一月 2024 11:40:52 +0800 Subject: [PATCH] 增加工号ui修改 --- pages/project/jmAGV/home.vue | 518 +++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 449 insertions(+), 69 deletions(-) diff --git a/pages/project/jmAGV/home.vue b/pages/project/jmAGV/home.vue index 62594b9..77e5bfb 100644 --- a/pages/project/jmAGV/home.vue +++ b/pages/project/jmAGV/home.vue @@ -1,115 +1,430 @@ <template> <view class="container"> - <!-- 宸� --> + <uni-icons type="bars" size="30" color="#b1b3b8" class="select" @click="jump()"></uni-icons> + <view class="zcard"> <view class="zcard-flex"> <view class="button-nk" v-for="item in groundSiteList" @click="click(item,'left')">{{item.name}}</view> </view> </view> - <!-- 鍙� --> + <view class="zcard"> <view class="zcard-flex"> - <view class="button-nk" style="background-color: brown;" v-for="item in traySiteList" @click="click(item,'right')">{{item.name}}</view> + <view class="button-nk" style="background-color: brown;" v-for="item in cacheSiteList" + @click="click(item,'right')">{{item.name}}</view> </view> </view> - + <view> <uni-popup ref="revise" type="dialog"> - <view class="popup"> - <view>{{text}}</view> - <view class="button-nk" @click="upTray()">{{btnTitle1}}</view> - <view class="button-nk" @click="downTray">{{btnTitle2}}</view> + <view v-if="outType" class="popup"> + <view class="popup3-input-title">{{text}}</view> + <view class="button-nk" @click="upPallet()">鐩樺ご涓婃灦</view> + </view> + <view v-else class="popup"> + <view class="popup3-input-title">{{text}}</view> + <view class="button-nk" @click="downPallet()">鐩樺ご涓嬫灦</view> </view> </uni-popup> </view> - - <!-- <view> - <uni-popup ref="revise2" type="dialog"> + + <view> + <uni-popup ref="downPalletPopup" type="dialog"> <view class="popup2"> - <view>123</view> - <view class="button-nk" @click="inHouse">鎵樼洏-浠撳簱(鍏ュ簱)</view> - <view class="button-nk" @click="outHouse">浠撳簱-鎵樼洏(鍑哄簱)</view> + <view class="popup3-input-title">鐩樺ご涓嬫灦</view> + <uni-data-select v-model="groundSite" :localdata="groundEmptySiteList"></uni-data-select> + <view class="button-nk" @click="goDown(2)">2涓�</view> + <view class="button-nk" @click="goDown(4)">4涓�</view> </view> </uni-popup> - </view> --> + </view> + + <view> + <uni-popup ref="upPalletPopup" type="dialog"> + <scroll-view scroll-y="true" style="height: 100%;background: #eee;border-radius: 10rpx;padding: 0 1vw;"> + <view class="popup3-input-title">鐩樺ご涓婃灦</view> + <view class="popup3-input-box"> + <uni-data-select v-model="chooseCacheSite" :localdata="chooseCacheSiteList" + placeholder="璇烽�夋嫨绔欑偣"></uni-data-select> + </view> + <view class="popup3-input-box"> + <uni-data-select v-model="chooseMat" :localdata="emptyMatList" + placeholder="璇烽�夋嫨鐗╂枡"></uni-data-select> + </view> + <view class="popup3-input-box"> + <text>璁㈠崟鍙�:</text> + <view style="margin-left: 3rpx;"> + <input type="text" v-model="code" /> + </view> + </view> + <view class="popup3-input-box"> + <text>绫虫暟:</text> + <view style="margin-left: 3rpx;"> + <input type="text" v-model="meter" /> + </view> + </view> + <view class="popup3-input-box"> + <text>宸ュ彿:</text> + <view style="margin-left: 3rpx;"> + <input type="text" v-model="workNumber" /> + </view> + </view> + <view class="button-nk" @click="goUp(2)">2涓�</view> + <view class="button-nk" @click="goUp(4)">4涓�</view> + </scroll-view> + </uni-popup> + </view> + + </view> </template> <script> + import code from '../../../uni_modules/uview-ui/libs/config/props/code'; export default { data() { return { baseUrl: '', token: '', - groundSiteList: [ - {name: '1鍙峰湴闈㈢珯',code:'1-C1',traget: '1-A1',type: 'foolr'}, - {name: '2鍙峰湴闈㈢珯',code:'2-C1',traget: '2-A1',type: 'foolr'}, - {name: '3鍙峰湴闈㈢珯',code:'3-C1',traget: '3-A1',type: 'foolr'}, - {name: '4鍙峰湴闈㈢珯',code:'4-C1',traget: '4-A1',type: 'foolr'}, - {name: '5鍙峰湴闈㈢珯',code:'5-C1',traget: '5-A1',type: 'foolr'}, - {name: '6鍙峰湴闈㈢珯',code:'6-C1',traget: '6-A1',type: 'foolr'}, - {name: '7鍙峰湴闈㈢珯',code:'7-C1',traget: '7-A1',type: 'foolr'}, - {name: '8鍙峰湴闈㈢珯',code:'8-C1',traget: '8-A1',type: 'foolr'}, - {name: '9鍙峰湴闈㈢珯',code:'9-C1',traget: '9-A1',type: 'foolr'}, - {name: '10鍙峰湴闈㈢珯',code:'10-C1',traget: '10-A1',type: 'foolr'} + groundSiteList: [{ + name: 'A-C-K-1', + code: 'A-C-K-1', + type: 'ground-k' + }, + { + name: 'A-C-M-1', + code: 'A-C-M-1', + type: 'ground-m' + }, + { + name: 'A-C-K-2', + code: 'A-C-K-2', + type: 'ground-k' + }, + { + name: 'A-C-M-2', + code: 'A-C-M-2', + type: 'ground-m' + }, + { + name: 'A-C-K-3', + code: 'A-C-K-3', + type: 'ground-k' + }, + { + name: 'A-C-M-3', + code: 'A-C-M-3', + type: 'ground-m' + }, ], - traySiteList: [ - {name: '1鍙锋墭鐩樼珯',code:'1-A1',inTraget: '1-C1',type: 'tray'}, - {name: '2鍙锋墭鐩樼珯',code:'2-A1',inTraget: '1-C1',type: 'tray'}, - {name: '3鍙锋墭鐩樼珯',code:'3-A1',inTraget: '1-C1',type: 'tray'}, - {name: '4鍙锋墭鐩樼珯',code:'4-A1',inTraget: '1-C1',type: 'tray'}, - {name: '5鍙锋墭鐩樼珯',code:'5-A1',inTraget: '1-C1',type: 'tray'}, - {name: '6鍙锋墭鐩樼珯',code:'6-A1',inTraget: '1-C1',type: 'tray'}, - {name: '7鍙锋墭鐩樼珯',code:'7-A1',inTraget: '1-C1',type: 'tray'}, - {name: '8鍙锋墭鐩樼珯',code:'8-A1',inTraget: '1-C1',type: 'tray'}, - {name: '9鍙锋墭鐩樼珯',code:'9-A1',inTraget: '1-C1',type: 'tray'}, - {name: '10鍙锋墭鐩樼珯',code:'10-A1',inTraget: '1-C1',type: 'tray'} + cacheSiteList: [{ + name: 'A-H-1', + code: 'A-H-1', + type: 'cache' + }, + { + name: 'A-H-2', + code: 'A-H-2', + type: 'cache' + }, + { + name: 'A-H-3', + code: 'A-H-3', + type: 'cache' + }, + { + name: 'A-H-4', + code: 'A-H-4', + type: 'cache' + }, + { + name: 'A-H-5', + code: 'A-H-5', + type: 'cache' + }, + { + name: 'A-H-6', + code: 'A-H-6', + type: 'cache' + }, + { + name: 'A-H-7', + code: 'A-H-7', + type: 'cache' + }, + { + name: 'A-H-8', + code: 'A-H-8', + type: 'cache' + }, + { + name: 'A-H-9', + code: 'A-H-9', + type: 'cache' + }, + { + name: 'A-H-10', + code: 'A-H-10', + type: 'cache' + }, + { + name: 'A-H-11', + code: 'A-H-11', + type: 'cache' + }, + { + name: 'A-H-12', + code: 'A-H-12', + type: 'cache' + }, + { + name: 'A-H-13', + code: 'A-H-13', + type: 'cache' + }, + { + name: 'A-H-14', + code: 'A-H-14', + type: 'cache' + }, + { + name: 'A-H-15', + code: 'A-H-15', + type: 'cache' + }, + { + name: 'A-H-16', + code: 'A-H-16', + type: 'cache' + }, + { + name: 'A-H-17', + code: 'A-H-17', + type: 'cache' + }, ], + emptyMatList: [], + chooseMat: '', + groundSite: '', + groundEmptySiteList: [], + chooseCacheSite: '', + chooseCacheSiteList: [], item: '', text: '', btnTitle1: '', btnTitle2: '', - stationType: 'load' + btnTitle3: '', + outType: '', + stationType: 'load', + type: '', + originLocal: '', + targetLocal: '', + code: '', + meter: '', + meterShow: '', + desc: '', + tipsTitle: '', + workNumber: '' } }, onShow() { let network = uni.getStorageSync('Network') - this.baseUrl = `http://${network[0].ip}:${network[0].port}/${network[0].address}` + this.baseUrl = `http://${network[0].ip}:${network[0].port}/${network[0].address}` this.token = uni.getStorageSync('token'); + + this.getEmptyMatList() + + uni.onNetworkStatusChange(function(res) { + if (!res.isConnected) { + uni.showLoading({ + title: '缃戠粶鏂紑...' + }); + } else { + uni.hideLoading(); + } + }); }, methods: { - click(item,type) { + jump() { + uni.redirectTo({ + url: '/pages/project/jmAGV/floorOne' + }) + }, + click(item, type) { this.item = item this.text = item.name if (type == 'left') { - this.btnTitle1 = '鍦伴潰绔欐斁缃墭鐩�(涓婃灦)' - this.btnTitle2 = '鎵樼洏绔欏彇缃墭鐩�(涓嬫灦)' + this.outType = true } else { - this.btnTitle1 = '鎵樼洏-浠撳簱(鍏ュ簱)' - this.btnTitle2 = '浠撳簱-鎵樼洏(鍑哄簱)' + this.outType = false } this.$refs.revise.open(type) }, - upTray() { - let _this = this + getEmptyMatList() { + let that = this uni.request({ - url: `${_this.baseUrl}/agv/inBound`, - data: { - originLocal: _this.item.code, - targetLocal: _this.item.traget, - type: 'load' + url: `${that.baseUrl}/agv/getEmptyMat`, + header: { + 'token': uni.getStorageSync('token') }, - header: { 'token': uni.getStorageSync('token') }, - method: 'POST', + method: 'GET', success(res) { - console.log(res); + res = res.data + if (res.code === 200) { + let tmp = [] + res.data.forEach((item) => { + tmp.push({ + text: item.maktx, + value: item.matnr + }) + }) + that.emptyMatList = tmp + } } }) }, - downTray() { - + upPallet() { + let tmp = []; + this.cacheSiteList.forEach((item) => { + tmp.push({ + text: item.name, + value: item.code + }) + }) + + this.chooseCacheSiteList = tmp; + this.upPalletPopup() + }, + downPallet() { + let tmp = []; + this.groundSiteList.forEach((item) => { + if (item.type == 'ground-k') { + tmp.push({ + text: item.name, + value: item.code + }) + } + }) + + this.groundEmptySiteList = tmp; + this.downPalletPopup() + }, + upPalletPopup() { + this.$refs.upPalletPopup.open('center') + }, + downPalletPopup() { + this.$refs.downPalletPopup.open('center') + }, + goUp(num) { + let data = {} + + if (this.chooseCacheSite == '') { + uni.showToast({ + title: '璇烽�夋嫨绔欑偣', + icon: "none", + position: 'top' + }) + return; + } + + if (this.chooseMat == '') { + uni.showToast({ + title: '璇烽�夋嫨鐗╂枡', + icon: "none", + position: 'top' + }) + return; + } + + if (this.code == '') { + uni.showToast({ + title: '璇疯緭鍏ヨ鍗曞彿', + icon: "none", + position: 'top' + }) + return; + } + + if (this.meter == '') { + uni.showToast({ + title: '璇疯緭鍏ョ背鏁�', + icon: "none", + position: 'top' + }) + return; + } + + data = { + originLocal: this.item.code, + targetLocal: this.chooseCacheSite, + type: 'load', + anfme: num, + matnr: this.chooseMat, + orderNo: this.code, + meter: this.meter, + workNumber: this.workNumber, + } + this.webServer(data) + setTimeout(() => { + this.$refs.upPalletPopup.close() + this.chooseMat = '' + this.code = '' + this.meter = '' + this.chooseCacheSite = '' + }, 300) + }, + goDown(num) { + let data = {} + + if (this.groundSite == '') { + uni.showToast({ + title: '璇烽�夋嫨绔欑偣', + icon: "none", + position: 'top' + }) + return; + } + + data = { + originLocal: this.item.code, + targetLocal: this.groundSite, + type: 'unload', + anfme: num, + } + this.webServer(data) + setTimeout(() => { + this.$refs.downPalletPopup.close() + }, 300) + }, + // 鎵�鏈夋湇鍔� + 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) { + uni.showToast({ + title: '鎿嶄綔鎴愬姛', + icon: "none", + position: 'top' + }) + this.$refs.revise.close() + } else { + uni.showToast({ + title: res.msg, + icon: "none", + position: 'top' + }) + } + } + }) } - } } </script> @@ -118,38 +433,47 @@ .container { height: 100%; /* background-color: aqua; */ - display: grid; - grid-template-columns: 50% 50%; + /* display: grid; + grid-template-columns: 50% 50%; */ + width: 100%; } + .btn-box { /* margin: 1%; */ background-color: azure; } + .zcard { - margin: 10px 100px; - /* background-color: blanchedalmond; */ + display: flex; + flex-wrap: wrap; + margin-top: 20px; } + .zcard-flex { /* background-color: coral; */ + /* flex-direction: column; */ + margin-top: 20rpx; width: 100%; height: 100%; display: flex; flex-wrap: wrap; - /* flex-direction: column; */ justify-content: space-around; align-items: center; + margin-right: 20px; + margin-left: 20px; } + .button-nk { - margin: 10rpx; - padding: 20rpx 70rpx; + margin: 30rpx 50rpx; + /* 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; @@ -157,12 +481,14 @@ inset -4px -4px 4px rgba(255, 255, 255, .4), -4px -4px 5px rgba(0, 0, 0, .4); } + .button-nk:active { transform: translateY(2px) scale(0.99, 0.99); box-shadow: inset 4px 4px 4px rgba(0, 0, 0, .3), inset -4px -4px 8px rgba(255, 255, 255, .7), -5px -5px 5px rgba(0, 0, 0, .3); } + .popup { background-color: #eee; width: 30vw; @@ -172,6 +498,7 @@ flex-direction: column; justify-content: space-around; } + .popup2 { background-color: #eee; width: 30vw; @@ -180,5 +507,58 @@ display: flex; flex-direction: column; justify-content: space-around; + border-radius: 10rpx; } -</style> + + .popup3 { + background-color: #eee; + max-height: 80vw; + width: 50vw; + padding: 0 10vw; + display: flex; + flex-direction: column; + justify-content: space-around; + border-radius: 10rpx; + color: #565656; + } + + .popup3-input-title { + text-align: center; + margin: 10rpx; + font-size: 18px; + font-weight: bold; + } + + .popup3-input-box { + display: flex; + border: 1px solid #cecece; + border-radius: 5rpx; + padding: 2rpx 10rpx; + margin: 20rpx; + } + + .popup3-input-box2 { + display: flex; + border: 1px solid #cecece; + border-radius: 5rpx; + padding: 2rpx 10rpx; + margin: 10rpx; + background-color: #FFF; + } + + .chosed { + background-color: #67C23A; + color: #e8e8e8; + } + + .select { + position: absolute; + bottom: 12px; + right: 16px; + border-radius: 10px; + padding: 4px 10px; + box-shadow: inset 2px 2px 2px rgba(0, 0, 0, .3), + inset -2px -2px 2px rgba(255, 255, 255, .7), + -2px -2px 2px rgba(0, 0, 0, .4); + } +</style> \ No newline at end of file -- Gitblit v1.9.1