| | |
| | | <template> |
| | | <view> |
| | | <view class="code"> |
| | | <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> |
| | | <input type="text" placeholder=" 扫码 / 输入" v-model="stationCode" :focus="stationCodeFocus" |
| | | @input="stationCodeInput()"> |
| | | <view class="code-decs">目标站:</view> |
| | | <uni-combox :candidates="staList" placeholder="请选择站点" v-model="sta"></uni-combox> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="mat-list-title"> |
| | | <view style="-webkit-flex: 1;flex: 1;">站点列表</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"> |
| | |
| | | removeNum: 0, |
| | | floorList: [1,3], |
| | | floor: "", |
| | | devNo: [] |
| | | devNo: [], |
| | | staList:[], |
| | | sta:'', |
| | | } |
| | | }, |
| | | onLoad() { |
| | |
| | | }, |
| | | methods: { |
| | | stationCodeInput() { |
| | | setTimeout(() => { |
| | | var len = this.stationCode.length |
| | | if (len != 15) { |
| | | this.stationCode = '' |
| | | this.stationCodeFocus = true |
| | | uni.showToast({ |
| | | title: '暂存码有误请重试', |
| | | icon: "none", |
| | | position: 'top' |
| | | }); |
| | | return; |
| | | 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') |
| | | } |
| | | } |
| | | this.pushDevNo() |
| | | this.stationCodeFocuss() |
| | | }, 200) |
| | | }); |
| | | }, |
| | | pushDevNo() { |
| | | var devNo = {"devNo":this.stationCode} |
| | |
| | | combClose() { |
| | | this.$refs.combConfirm.close() |
| | | }, |
| | | comb() { |
| | | this.devNo = [] |
| | | uni.vibrateShort(); |
| | | comb() { |
| | | let that = this; |
| | | for (var i = 0; i < this.dataList.length; i++) { |
| | | if (this.dataList[i].checked) { |
| | | this.devNo.push(this.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') |
| | | } else if (res.code == 403) { |
| | | that.messageText = res.msg |
| | |
| | | }, |
| | | // 清空 |
| | | resst() { |
| | | this.dataList = [] |
| | | this.barcode = '' |
| | | this.staList = [] |
| | | this.sta = '' |
| | | this.stationCode = '' |
| | | this.floor = '' |
| | | this.barcodeFocuss() |
| | |
| | | .mat-list-title { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 80rpx; |
| | | height: 30rpx; |
| | | width: 100%; |
| | | background-color: white; |
| | | position: fixed; |