#
zjj
昨天 a3ffaec9c9a81626c34989c7026988cc07b3c3d3
pages/AGV/AGVStart.vue
@@ -32,7 +32,7 @@
      <!-- 底部操作按钮 -->
      <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>
      <!-- 弹窗 -->
      <!-- 修改数量 -->
@@ -128,7 +128,8 @@
            floor: "",
            devNo: [],
            staList:[],
            sta:''
            sta:'',
            isDisabled:false
         }
      },
      onLoad() {
@@ -156,6 +157,11 @@
               }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
                  
               }
               
@@ -229,7 +235,7 @@
               }
            });
         },
         messageToggle(type) {
         messageToggle(type) {
            this.msgType1 = type
            this.$refs.message.open()
         },
@@ -433,41 +439,56 @@
         },
         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