|  |  | 
 |  |  | <template> | 
 |  |  |    <view  class="container"> | 
 |  |  |    <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" @click="click('left')">上架</view> | 
 |  |  |             <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;" @click="click('right')">下架</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  class="popup3-input-title">{{text}}</view> | 
 |  |  |                <view class="button-nk" @click="option(item)" v-for="item in btns">{{item.name}}</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="numberPopup" type="dialog"> | 
 |  |  |          <uni-popup ref="downPalletPopup" type="dialog"> | 
 |  |  |             <view class="popup2"> | 
 |  |  |                <view  class="popup3-input-title">{{tipsTitle}}</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> | 
 |  |  |          <uni-popup ref="upPalletPopup" type="dialog"> | 
 |  |  |             <view class="popup2"> | 
 |  |  |                <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="button-nk" @click="goUp(2)">2个</view> | 
 |  |  |                <view class="button-nk" @click="goUp(4)">4个</view> | 
 |  |  |             </view> | 
 |  |  |          </uni-popup> | 
 |  |  |       </view> | 
 |  |  | 		 | 
 |  |  | 		 | 
 |  |  |    </view> | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | <script> | 
 |  |  |    import code from '../../../uni_modules/uview-ui/libs/config/props/code'; | 
 |  |  |    export default { | 
 |  |  |       data() { | 
 |  |  |          return { | 
 |  |  |             baseUrl: '', | 
 |  |  |             token: '', | 
 |  |  |             onBtns: [ | 
 |  |  |                {name: '1号空盘位上架',code:'1-Q1',traget: '12-F1',type: 'foolr'}, | 
 |  |  |                {name: '2号空盘位上架',code:'1-Q1',traget: '12-F1',type: 'foolr'}, | 
 |  |  |             groundSiteList: [{ | 
 |  |  |                   name: 'B-C-K-1', | 
 |  |  |                   code: 'B-C-K-1', | 
 |  |  |                   type: 'ground-k' | 
 |  |  |                }, | 
 |  |  |                { | 
 |  |  |                   name: 'B-C-M-1', | 
 |  |  |                   code: 'B-C-M-1', | 
 |  |  |                   type: 'ground-m' | 
 |  |  |                }, | 
 |  |  |                { | 
 |  |  |                   name: 'B-C-K-2', | 
 |  |  |                   code: 'B-C-K-2', | 
 |  |  |                   type: 'ground-k' | 
 |  |  |                }, | 
 |  |  |                { | 
 |  |  |                   name: 'B-C-M-2', | 
 |  |  |                   code: 'B-C-M-2', | 
 |  |  |                   type: 'ground-m' | 
 |  |  |                }, | 
 |  |  |             ], | 
 |  |  |             outBtns: [ | 
 |  |  |                {name: '下架至1号位',code:'11-Q1',traget: '1-F1',type: 'foolr'}, | 
 |  |  |                {name: '下架至2号位',code:'11-Q1',traget: '2-F1',type: 'foolr'}, | 
 |  |  |                {name: '下架至3号位',code:'11-Q1',traget: '3-F1',type: 'foolr'}, | 
 |  |  |             cacheSiteList: [{ | 
 |  |  |                   name: 'B-H-1', | 
 |  |  |                   code: 'B-H-1', | 
 |  |  |                   type: 'cache' | 
 |  |  |                }, | 
 |  |  |                { | 
 |  |  |                   name: 'B-H-2', | 
 |  |  |                   code: 'B-H-2', | 
 |  |  |                   type: 'cache' | 
 |  |  |                }, | 
 |  |  |                { | 
 |  |  |                   name: 'B-H-3', | 
 |  |  |                   code: 'B-H-3', | 
 |  |  |                   type: 'cache' | 
 |  |  |                }, | 
 |  |  |                { | 
 |  |  |                   name: 'B-H-4', | 
 |  |  |                   code: 'B-H-4', | 
 |  |  |                   type: 'cache' | 
 |  |  |                }, | 
 |  |  |                { | 
 |  |  |                   name: 'B-H-5', | 
 |  |  |                   code: 'B-H-5', | 
 |  |  |                   type: 'cache' | 
 |  |  |                }, | 
 |  |  |                { | 
 |  |  |                   name: 'B-H-6', | 
 |  |  |                   code: 'B-H-6', | 
 |  |  |                   type: 'cache' | 
 |  |  |                }, | 
 |  |  |                { | 
 |  |  |                   name: 'B-H-7', | 
 |  |  |                   code: 'B-H-7', | 
 |  |  |                   type: 'cache' | 
 |  |  |                }, | 
 |  |  |             ], | 
 |  |  |             btns: [], | 
 |  |  |             outType: '', | 
 |  |  |             emptyMatList: [], | 
 |  |  |             chooseMat: '', | 
 |  |  |             groundSite: '', | 
 |  |  |             groundEmptySiteList: [], | 
 |  |  |             chooseCacheSite: '', | 
 |  |  |             chooseCacheSiteList: [], | 
 |  |  |             item: '', | 
 |  |  |             text: '', | 
 |  |  |             btnTitle: '', | 
 |  |  |             btnTitle1: '', | 
 |  |  |             btnTitle2: '', | 
 |  |  |             btnTitle3: '', | 
 |  |  |             outType: '', | 
 |  |  |             stationType: 'load', | 
 |  |  |             type: '', | 
 |  |  |             originLocal: '', | 
 |  |  |             targetLocal: '', | 
 |  |  |             code: '', | 
 |  |  |             meter: '', | 
 |  |  |             meterShow: '', | 
 |  |  |             desc: '', | 
 |  |  |             tipsTitle: '', | 
 |  |  |             item: {} | 
 |  |  | 				 | 
 |  |  |          } | 
 |  |  |       }, | 
 |  |  |       onShow() { | 
 |  |  |          if (uni.getStorageSync('Network')) { | 
 |  |  |             let network = uni.getStorageSync('Network') | 
 |  |  |             this.baseUrl = `http://${network[0].ip}:${network[0].port}/${network[0].address}` | 
 |  |  |             this.token = uni.getStorageSync('token'); | 
 |  |  |          } | 
 |  |  |          let network = uni.getStorageSync('Network') | 
 |  |  |          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: { | 
 |  |  |          jump() { | 
 |  |  | 
 |  |  |                url: '/pages/project/jmAGV/home' | 
 |  |  |             }) | 
 |  |  |          }, | 
 |  |  |          click(type) { | 
 |  |  |          click(item, type) { | 
 |  |  |             this.item = item | 
 |  |  |             this.text = item.name | 
 |  |  |             if (type == 'left') { | 
 |  |  |                this.btns = this.onBtns | 
 |  |  |                this.text = '上架' | 
 |  |  |                this.type = 'load' | 
 |  |  |                this.tipsTitle = '上架数量' | 
 |  |  |                this.outType = true | 
 |  |  |             } else { | 
 |  |  |                this.btns = this.outBtns | 
 |  |  |                this.type = 'unload' | 
 |  |  |                this.text = '下架' | 
 |  |  |                this.tipsTitle = '下架数量' | 
 |  |  |                this.outType = false | 
 |  |  |             } | 
 |  |  |             this.$refs.revise.open(type) | 
 |  |  |          }, | 
 |  |  |          option(item) { | 
 |  |  |             this.item = item | 
 |  |  |             this.$refs.numberPopup.open('center') | 
 |  |  |          getEmptyMatList() { | 
 |  |  |             let that = this | 
 |  |  |             uni.request({ | 
 |  |  |                url: `${that.baseUrl}/agv/getEmptyMat`, | 
 |  |  |                header: { 'token': uni.getStorageSync('token') }, | 
 |  |  |                method: 'GET', | 
 |  |  |                success(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 | 
 |  |  |                   } | 
 |  |  |                } | 
 |  |  |             }) | 
 |  |  |          }, | 
 |  |  |          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 _this = this | 
 |  |  |             let data = { | 
 |  |  |             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.item.traget, | 
 |  |  |                type: this.type, | 
 |  |  |                anfme: num | 
 |  |  |                targetLocal: this.chooseCacheSite, | 
 |  |  |                type: 'load', | 
 |  |  |                anfme: num, | 
 |  |  |                matnr: this.chooseMat, | 
 |  |  |                orderNo: this.code, | 
 |  |  |                meter: this.meter | 
 |  |  |             } | 
 |  |  |             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) { | 
 |  |  | 
 |  |  |             uni.request({ | 
 |  |  |                url: `${_this.baseUrl}/agv/requestTask`, | 
 |  |  |                data: data, | 
 |  |  |                header: { 'token': uni.getStorageSync('token') }, | 
 |  |  |                header: { | 
 |  |  |                   'token': uni.getStorageSync('token') | 
 |  |  |                }, | 
 |  |  |                method: 'POST', | 
 |  |  |                success(res) { | 
 |  |  |                   res = res.data | 
 |  |  |                   if (res.code === 200) { | 
 |  |  |                      setTimeout(()=>{ | 
 |  |  |                         this.$refs.revise.close() | 
 |  |  |                      },300) | 
 |  |  |                      uni.showToast({ title: '操作成功', icon: "none", position: 'top' }) | 
 |  |  |                      uni.showToast({ | 
 |  |  |                         title: '操作成功', | 
 |  |  |                         icon: "none", | 
 |  |  |                         position: 'top' | 
 |  |  |                      }) | 
 |  |  |                      _this.$refs.revise.close() | 
 |  |  |                   } else { | 
 |  |  |                      uni.showToast({ title: res.msg, icon: "none", position: 'top' }) | 
 |  |  |                      uni.showToast({ | 
 |  |  |                         title: res.msg, | 
 |  |  |                         icon: "none", | 
 |  |  |                         position: 'top' | 
 |  |  |                      }) | 
 |  |  |                   } | 
 |  |  |                } | 
 |  |  |             }) | 
 |  |  | 
 |  |  | <style> | 
 |  |  |    .container { | 
 |  |  |       height: 100%; | 
 |  |  |       display: grid; | 
 |  |  |       grid-template-columns: 50% 50%; | 
 |  |  |       /* background-color: aqua; */ | 
 |  |  |       /* display: grid; | 
 |  |  |       grid-template-columns: 50% 50%; */ | 
 |  |  |       width: 100%; | 
 |  |  |  | 
 |  |  |    } | 
 |  |  |  | 
 |  |  |    .btn-box { | 
 |  |  |       /* margin: 1%; */ | 
 |  |  |       background-color: azure; | 
 |  |  |    } | 
 |  |  |  | 
 |  |  |    .zcard { | 
 |  |  |       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 0rpx; | 
 |  |  |       margin: 30rpx 50rpx; | 
 |  |  |       /* padding: 20rpx 70rpx; */ | 
 |  |  |       /* background-color: azure; */ | 
 |  |  |       min-width: 150rpx; | 
 |  |  | 
 |  |  |          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; | 
 |  |  | 
 |  |  |       flex-direction: column; | 
 |  |  |       justify-content: space-around; | 
 |  |  |    } | 
 |  |  |  | 
 |  |  |    .popup2 { | 
 |  |  |       background-color: #eee; | 
 |  |  |       width: 30vw; | 
 |  |  | 
 |  |  |       justify-content: space-around; | 
 |  |  |       border-radius: 10rpx; | 
 |  |  |    } | 
 |  |  |  | 
 |  |  |    .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; | 
 |  |  | 
 |  |  |          inset -2px -2px 2px rgba(255, 255, 255, .7), | 
 |  |  |          -2px -2px 2px rgba(0, 0, 0, .4); | 
 |  |  |    } | 
 |  |  | </style> | 
 |  |  | </style> |