| | |
| | | <!-- 底部操作按钮 --> |
| | | <view class="buttom"> |
| | | <button size="mini" @click="reset('warn')">重置</button> |
| | | <button size="mini" type="primary" @click="combConfirm('warn')">启动</button> |
| | | <button size="mini" type="primary" @click="combConfirm('warn')" :disabled="isDisabled">启动</button> |
| | | </view> |
| | | <!-- 弹窗 --> |
| | | <!-- 修改数量 --> |
| | |
| | | floor: "", |
| | | devNo: [], |
| | | staList:[], |
| | | sta:'' |
| | | sta:'', |
| | | isDisabled:false |
| | | } |
| | | }, |
| | | onLoad() { |
| | |
| | | }else if(this.stationCode.substring(0,1) == 'd'){ |
| | | this.staList.push(2000) |
| | | this.sta = 2000 |
| | | |
| | | }else if(this.stationCode.substring(0,1) == 'e'){ |
| | | this.staList.push(1000) |
| | | this.staList.push(1035) |
| | | this.sta = 1035 |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | }); |
| | | }, |
| | | messageToggle(type) { |
| | | messageToggle(type) { |
| | | this.msgType1 = type |
| | | this.$refs.message.open() |
| | | }, |
| | |
| | | }, |
| | | comb() { |
| | | let that = this; |
| | | that.isDisabled = true |
| | | if (that.stationCode === '') { |
| | | this.messageText = "请扫描暂存位条码" |
| | | this.messageToggle('error') |
| | | that.isDisabled = false |
| | | return; |
| | | } |
| | | uni.request({ |
| | | url: that.baseUrl + '/mobile/agv/start', |
| | | data: JSON.stringify({ |
| | | sta: that.stationCode, |
| | | inSta: that.sta |
| | | }), |
| | | method: 'POST', |
| | | header: { |
| | | 'token': uni.getStorageSync('token') |
| | | }, |
| | | success(result) { |
| | | var res = result.data |
| | | if (res.code === 200) { |
| | | that.resst(); |
| | | that.messageText = "启动成功" |
| | | that.messageToggle('success') |
| | | } else if (res.code == 403) { |
| | | that.messageText = res.msg |
| | | |
| | | uni.request({ |
| | | url: that.baseUrl + '/mobile/agv/start', |
| | | data: JSON.stringify({ |
| | | sta: that.stationCode, |
| | | inSta: that.sta |
| | | }), |
| | | method: 'POST', |
| | | header: { |
| | | 'token': uni.getStorageSync('token') |
| | | }, |
| | | success(result) { |
| | | var res = result.data |
| | | if (res.code === 200) { |
| | | that.resst(); |
| | | that.messageText = "启动成功" |
| | | that.messageToggle('success') |
| | | } else if (res.code == 403) { |
| | | that.messageText = res.msg |
| | | that.messageToggle('error') |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../login/login' |
| | | }); |
| | | }, 1000); |
| | | } else { |
| | | that.messageText = res.msg |
| | | that.messageToggle('error') |
| | | } |
| | | }, |
| | | fail: () => { |
| | | that.messageText = "接口超时" |
| | | that.messageToggle('error') |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../login/login' |
| | | }); |
| | | }, 1000); |
| | | } else { |
| | | that.messageText = res.msg |
| | | that.messageToggle('error') |
| | | }, |
| | | complete(){ |
| | | that.isDisabled = false |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }, |
| | | reset(type) { |
| | | this.msgType = type |