|  |  | 
 |  |  | <template> | 
 |  |  |    <view> | 
 |  |  |       <view class="code"> | 
 |  |  |          <!-- <view class="item"> | 
 |  |  |             <view class="code-decs">托盘码:</view> | 
 |  |  |             <input type="text" placeholder=" 扫码 / 输入" v-model="barcode" :focus="barcodeFocus" | 
 |  |  |                @input="barcodeInput()"> | 
 |  |  |          </view> --> | 
 |  |  |          <!-- <view class="item"> | 
 |  |  |             <view class="code-decs">暂存位:</view> | 
 |  |  |             <input type="text" placeholder=" 扫码 / 输入" v-model="stationCode" :focus="matFocus" @input="stationCodeInput()"> | 
 |  |  |             <view class="item-right"> | 
 |  |  |                <button></button> --> | 
 |  |  |                <!-- <text style="text-align: right;color: #409EFF;" @click="selectMat()">提取+</text> --> | 
 |  |  |                <!-- <uni-icons type="right" color="#c1c1c1"></uni-icons> --> | 
 |  |  |             <!-- </view> | 
 |  |  |          </view> --> | 
 |  |  |       <view class="code">			 | 
 |  |  |          <view class="item"> | 
 |  |  |             <view class="code-decs">楼号:</view> | 
 |  |  |             <uni-combox :candidates="floorList" placeholder="请选择楼号" v-model="floor" @input="getFloor"></uni-combox> | 
 |  |  |             <view class="code-decs">源站点:</view> | 
 |  |  |             <input type="text" placeholder=" 扫码 / 输入" v-model="stationCode" :focus="stationCodeFocus" | 
 |  |  |             @input="stationCodeInput()"   > | 
 |  |  |          </view> | 
 |  |  |          <view class="item"> | 
 |  |  |             <view class="code-decs">目标站:</view> | 
 |  |  |             <uni-combox :candidates="staList" placeholder="请选择站点"  v-model="sta"></uni-combox> | 
 |  |  |          </view> | 
 |  |  |       </view> | 
 |  |  | 		 | 
 |  |  |       <view class="mat-list-title"> | 
 |  |  |          <view style="width: 200rpx;"></view> | 
 |  |  |          <view style="-webkit-flex: 1;flex: 1;">商品列表</view> | 
 |  |  |          <view style="width: 200rpx;"><button size="mini" type="primary" @click="getChecked">提取</button></view> | 
 |  |  |          <view style="-webkit-flex: 1;flex: 1;"></view> | 
 |  |  |       </view> | 
 |  |  |       <scroll-view> | 
 |  |  |          <view class="list" v-for="(item,i) in dataList" :key="i" :class="'bg-'+item.color"> | 
 |  |  | 
 |  |  |             token: '', | 
 |  |  |             barcode: '', | 
 |  |  |             stationCode: '', | 
 |  |  |             stationCodeFocus: true, | 
 |  |  |             dataList: [], | 
 |  |  |             count: 0, | 
 |  |  |             rowNum: '', | 
 |  |  | 
 |  |  |             removeNum: 0, | 
 |  |  |             floorList: [1,3], | 
 |  |  |             floor: "", | 
 |  |  |             devNo: [] | 
 |  |  |             devNo: [], | 
 |  |  |             staList:[], | 
 |  |  |             sta:'',	 | 
 |  |  |          } | 
 |  |  |       }, | 
 |  |  |       onLoad() { | 
 |  |  | 
 |  |  |          this.token = uni.getStorageSync('token'); | 
 |  |  |       }, | 
 |  |  |       methods: { | 
 |  |  |          stationCodeInput() { | 
 |  |  |             let that = this; | 
 |  |  |             that.staList = [] | 
 |  |  |             uni.request({ | 
 |  |  |                url: that.baseUrl + '/mobile/AGVSite?locNo='+that.stationCode, | 
 |  |  | 					 | 
 |  |  |                header: { | 
 |  |  |                   'token': uni.getStorageSync('token') | 
 |  |  |                },					 | 
 |  |  |                success(res) { | 
 |  |  |                   res = res.data | 
 |  |  |                   if (res.code === 200) { | 
 |  |  |                      let list = [] | 
 |  |  |                      Object.entries(res.data).forEach((value, key) => {								 | 
 |  |  |                        list.push(value[1]) | 
 |  |  |                      }); | 
 |  |  |                      that.staList = list | 
 |  |  |                   }else{ | 
 |  |  |                      that.messageText = res.msg | 
 |  |  |                      that.messageToggle('error') | 
 |  |  |                   } | 
 |  |  |                } | 
 |  |  |             }); | 
 |  |  |          }, | 
 |  |  |          pushDevNo() { | 
 |  |  |             var devNo = {"devNo":this.stationCode} | 
 |  |  |             if (this.dataList.length == 0) { | 
 |  |  |                this.dataList.push(devNo) | 
 |  |  |                return | 
 |  |  |             } | 
 |  |  |             var flag = false | 
 |  |  |             for(var i = 0; i < this.dataList.length; i++ ) { | 
 |  |  |                if (this.dataList[i].devNo == devNo.devNo) { | 
 |  |  |                   this.messageText = "站点重复" | 
 |  |  |                   this.messageToggle('warn') | 
 |  |  |                   return | 
 |  |  |                } else { | 
 |  |  |                   flag = true | 
 |  |  |                } | 
 |  |  |             } | 
 |  |  |             if(flag) { | 
 |  |  |                this.dataList.push(devNo) | 
 |  |  |             } | 
 |  |  | 				 | 
 |  |  |          }, | 
 |  |  |          stationCodeFocuss() { | 
 |  |  |             let that = this; | 
 |  |  |             this.stationCode = '' | 
 |  |  |             that.stationCodeFocus = false; | 
 |  |  |             setTimeout(() => { | 
 |  |  |                that.stationCodeFocus = true; | 
 |  |  |             }, 100); | 
 |  |  |          }, | 
 |  |  |          getChecked() { | 
 |  |  |             var checkedList = [] | 
 |  |  |             for(var i = 0; i < this.dataList.length; i++) { | 
 |  |  | 
 |  |  |          }, | 
 |  |  |          getFloor() { | 
 |  |  |             let that = this | 
 |  |  |             if (this.floor == '') { | 
 |  |  |                return | 
 |  |  |             } | 
 |  |  |             uni.request({ | 
 |  |  |                url: that.baseUrl + '/agvMobile/getBasDevp/auth', | 
 |  |  |                data: { | 
 |  |  | 
 |  |  |                   res = res.data | 
 |  |  |                   for(var i = 0; i < res.data.length; i++) { | 
 |  |  |                      if (res.data[i].locSts === 'F') { | 
 |  |  |                         res.data[i]["color"] = "red" | 
 |  |  |                         // res.data[i]["color"] = "red" | 
 |  |  |                         that.dataList.push(res.data[i]) | 
 |  |  |                      } | 
 |  |  |                   } | 
 |  |  |                   that.dataList = res.data | 
 |  |  |                   console.log(that.dataList); | 
 |  |  |                } | 
 |  |  |             }); | 
 |  |  |          }, | 
 |  |  |          messageToggle(type) { | 
 |  |  |             this.msgType1 = type | 
 |  |  |             this.$refs.message.open() | 
 |  |  |          }, | 
 |  |  |          stationCodeInput() { | 
 |  |  |             this.dataList.push(this.stationCode) | 
 |  |  |          }, | 
 |  |  |          // barcode input 事件 | 
 |  |  |          barcodeInput() { | 
 |  |  | 
 |  |  |          combClose() { | 
 |  |  |             this.$refs.combConfirm.close() | 
 |  |  |          }, | 
 |  |  |          comb() { | 
 |  |  |             uni.vibrateShort(); | 
 |  |  |          comb() {				 | 
 |  |  |             let that = this; | 
 |  |  |             for (var i = 0; i < that.dataList.length; i++) { | 
 |  |  |                that.devNo.push(that.dataList[i].devNo) | 
 |  |  |             if (that.stationCode === '') { | 
 |  |  |                this.messageText = "请扫描暂存位条码" | 
 |  |  |                this.messageToggle('error') | 
 |  |  |                return; | 
 |  |  |             } | 
 |  |  |             let newSta =  that.sta.split("-") | 
 |  |  | 				 | 
 |  |  |             uni.request({ | 
 |  |  |                url: that.baseUrl + '/agvMobile/pakin/auth', | 
 |  |  |                data: JSON.stringify({ | 
 |  |  |                   devNo: that.devNo | 
 |  |  |                }), | 
 |  |  |                method: 'POST', | 
 |  |  |                url: that.baseUrl + '/mobile/AGVMove?sourceStaNo='+that.stationCode+'&staNo='+newSta[0],					 | 
 |  |  |                header: { | 
 |  |  |                   'token': uni.getStorageSync('token') | 
 |  |  |                }, | 
 |  |  | 
 |  |  |                   var res = result.data | 
 |  |  |                   if (res.code === 200) { | 
 |  |  |                      that.resst(); | 
 |  |  |                      that.messageText = "启动成功" | 
 |  |  |                      that.messageText = "移动成功" | 
 |  |  |                      that.messageToggle('success') | 
 |  |  |                      // const innerAudioContext = uni.createInnerAudioContext(); | 
 |  |  |                      // innerAudioContext.src = '/static/music/pakinOk.mp3'; | 
 |  |  |                      // innerAudioContext.play() | 
 |  |  |                   } else if (res.code == 403) { | 
 |  |  |                      that.messageText = res.msg | 
 |  |  |                      that.messageToggle('error') | 
 |  |  | 
 |  |  |          }, | 
 |  |  |          // 清空 | 
 |  |  |          resst() { | 
 |  |  |             this.dataList = [] | 
 |  |  |             this.barcode = '' | 
 |  |  |             this.staList = [] | 
 |  |  |             this.sta = '' | 
 |  |  |             this.stationCode = '' | 
 |  |  |             this.floor = '' | 
 |  |  |             this.barcodeFocuss() | 
 |  |  | 
 |  |  |       color: #666666; | 
 |  |  |    } | 
 |  |  |    .list:first-child { | 
 |  |  |       margin-top: 260rpx; | 
 |  |  |       margin-top: 360rpx; | 
 |  |  |    } | 
 |  |  |    .aside { | 
 |  |  |       width: 100rpx; | 
 |  |  | 
 |  |  |    .mat-list-title { | 
 |  |  |       display: flex; | 
 |  |  |       align-items: center; | 
 |  |  |       height: 80rpx; | 
 |  |  |       height: 30rpx; | 
 |  |  |       width: 100%; | 
 |  |  |       background-color: white; | 
 |  |  |       position: fixed; | 
 |  |  |       margin-top: 100rpx; | 
 |  |  |       margin-top: 200rpx; | 
 |  |  |       z-index: 9; | 
 |  |  |       /* border-top: 1px solid #DCDFE6; */ | 
 |  |  |       text-align: center; |