#
whycq
2023-10-23 539793abe15129501ec01739c33ad6474fe05661
pages/tzsk/AGV/AGVPick.vue
@@ -161,6 +161,92 @@
         this.token = uni.getStorageSync('token');
      },
      methods: {
         containerPick() {
            let _this = this
            this.devNo = []
            uni.vibrateShort();
            for (var i = 0; i < this.dataList.length; i++) {
               if (this.dataList[i].checked) {
                  this.devNo.push(this.dataList[i].devNo)
               }
            }
            uni.request({
               url: _this.baseUrl + '/agv/basDevp/visualized/container/pickIn',
               header: {'token': uni.getStorageSync('token')},
               data: JSON.stringify({devNo: _this.devNo}),
               method: 'POST',
               success(res) {
                  res = res.data
                  console.log(res);
                  if (res.code === 200) {
                     _this.pickCode = ''
                     _this.messageText = "盘点 / 拣货成功"
                     _this.messageToggle('success')
                  } else if (res.code == 403) {
                     uni.showToast({
                        title: res.msg,
                        icon: "none",
                        position: 'top'
                     })
                     setTimeout(() => {
                        uni.reLaunch({
                           url: '../login/login'
                        });
                     }, 1000);
                  } else {
                     uni.showToast({
                        title: res.msg,
                        icon: "none",
                        position: 'top'
                     })
                  }
               }
            })
         },
         // 容器离场
         containerMove() {
            let _this = this
            this.devNo = []
            uni.vibrateShort();
            for (var i = 0; i < this.dataList.length; i++) {
               if (this.dataList[i].checked) {
                  this.devNo.push(this.dataList[i].devNo)
               }
            }
            var param = {'devNo' : _this.pickCode}
            uni.request({
               url: _this.baseUrl + '/agv/basDevp/visualized/container/moveOut',
               header: {'token': uni.getStorageSync('token')},
               data: JSON.stringify({devNo: _this.devNo}),
               method: 'POST',
               success(res) {
                  res = res.data
                  console.log(res);
                  if (res.code === 200) {
                     _this.pickCode = ''
                     _this.messageText = "离场成功"
                     _this.messageToggle('success')
                  } else if (res.code == 403) {
                     uni.showToast({
                        title: res.msg,
                        icon: "none",
                        position: 'top'
                     })
                     setTimeout(() => {
                        uni.reLaunch({
                           url: '../login/login'
                        });
                     }, 1000);
                  } else {
                     uni.showToast({
                        title: res.msg,
                        icon: "none",
                        position: 'top'
                     })
                  }
               }
            })
         },
         hideKeyboard() {
            this.hide = this.hide ? false : true
            if (this.hide) {