#
whycq
2023-11-02 f6c98ec61385b470cda75c672a50e8d9ac3d3525
pages/tzsk/AGV/AGVPick.vue
@@ -100,6 +100,10 @@
               @confirm="resetConfirm" @close="resetClose"></uni-popup-dialog>
         </uni-popup>
      </view>
      <view class="keyboard" :class="hidebg" mode="aspectFit" @click="hideKeyboard">
         <image src="@/static/img/keyboard1.png" style="height: 70%;width: 70%;"></image>
      </view>
   </view>
</template>
@@ -134,16 +138,122 @@
            floor: "",
            devNo: [],
            btnText: '全选',
            hide: true,
            hidebg: 'kb-bgtr'
         }
      },
      onLoad() {
         // #ifdef APP
         setInterval(()=>{
            if (this.hide) {
               uni.hideKeyboard()
            } else {
            }
         },20)
         // #endif
      },
      onBackPress() {
         this.hide = false
      },
      onShow() {
         this.baseUrl = uni.getStorageSync('baseUrl');
         this.token = uni.getStorageSync('token');
      },
      methods: {
         containerPick() {
            let _this = this
            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.dataList = []
                     _this.devNo = []
                     _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
            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/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.dataList = []
                     _this.devNo = []
                     _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) {
               this.hidebg = 'kb-bgtr'
            } else {
               this.hidebg = 'kb-bgfa'
            }
         },
         stationCodeInput() {
            setTimeout(() => {
               var len = this.stationCode.length
@@ -519,6 +629,18 @@
<style>
   @import url('../../../static/css/wms.css/wms.css');
   .keyboard{
      width: 40px;height: 40px;background-size: 100%;position: absolute;z-index: 99;
         top: 5px;right: 5px; border-radius: 50%;
         display: flex;align-items: center;justify-content: center;
   }
   .kb-bgtr {
      background-color: #55557f;
   }
   .kb-bgfa {
      background-color: #00aeec;
   }
   .bg-red {
      background-color: #e54d42;
      color: #ffffff;
@@ -528,7 +650,7 @@
      color: #666666;
   }
   .list:first-child {
      margin-top: 360rpx;
      margin-top: 320rpx;
   }
   .aside {
      width: 100rpx;