skyouc
2025-08-08 087b9f6cea5b4d2eb1c9fa3959ac0dc5b09cf254
pages/pakin/pakin.vue
@@ -126,6 +126,12 @@
            <uni-popup-dialog :type="msgType" cancelText="取消" confirmText="确认" :title="title" :content="content"
               @confirm="resetConfirm" @close="resetClose"></uni-popup-dialog>
         </uni-popup>
      </view>
      <!-- 平库库位推荐 -->
      <view>
         <uni-popup ref="recommend" type="dialog">
            <uni-popup-dialog :type="msgType"  mode="base"  :cancelText="null"  confirmText="确认" title="推荐库位" :content="recomLoc"></uni-popup-dialog>
         </uni-popup>
      </view>
   </view>
</template>
@@ -143,7 +149,8 @@
            msgType1: 'success',
            msgType: 'success',
            messageText: '',
            title: '',
            title: '',
            recomLoc: '',
            content: '',
            barcodeFocus: true,
            matFocus: false,
@@ -175,15 +182,15 @@
            // 不设置定时器 会出现扫入的字符串不全
            setTimeout(() => {
               var len = this.barcode.length
               if (len != 8) {
                  uni.showToast({
                     title: '托盘码有误请重试',
                     icon: "none",
                     position: 'top'
                  });
                  // this.barcodeFocuss()
                  return;
               }
               // if (len != 8) {
               //    uni.showToast({
               //       title: '托盘码有误请重试',
               //       icon: "none",
               //       position: 'top'
               //    });
               //    // this.barcodeFocuss()
               //    return;
               // }
               // this.focuss()
            }, 200)
         },
@@ -207,18 +214,23 @@
         // 搜索物料
         findMat() {
            let that = this
            if (that.matnr == null && that.matnr == '') {
            if (that.matnr == null || that.matnr == '') {
               uni.showToast({
                  title: "物料码不能为空!!",
                  title: "订单号不能为空!!",
                  icon: "none",
                  position: "top"
               })
               return;
            } else {
            }
               uni.navigateTo({
                  url: "../pakin/pakinSelector?barcode=" + that.matnr,
                  success:function(res){
                     let matnrs = that.dataList.map(data => data.matnr);
                     console.log(matnrs);
                     res.eventChannel.emit('acceptOpenPager', matnrs)
                  }
               });
            }
         },
      
         checkMat(mat) {
@@ -340,7 +352,8 @@
                  this.messageToggle('error')
                  return;
               }
            }
            }
            uni.request({
               url: that.baseUrl + '/pda/comb/auth',
               data: JSON.stringify({
@@ -355,12 +368,15 @@
               success(result) {
                  var res = result.data
                  if (res.code === 200) {
                     that.resst();
                     that.messageText = "组托成功"
                     that.messageToggle('success')
                     const innerAudioContext = uni.createInnerAudioContext();
                     innerAudioContext.src = '/static/music/pakinOk.mp3';
                     innerAudioContext.play()
                     innerAudioContext.play()
                     if (that.barcode.indexOf('PK') >= 0) {
                        that.recommendLocs(that)
                     }
                     that.resst();
                  } else if (res.code == 403) {
                     that.messageText = res.msg
                     that.messageToggle('error')
@@ -375,7 +391,38 @@
                  }
               }
            });
         },
         },
         recommendLocs(that) {
            uni.request({
               url: that.baseUrl + '/pda/recommend/locs',
               method: 'GET',
               header: {
                  'token': uni.getStorageSync('token')
               },
               success(result) {
                  var res = result.data
                  if (res.code === 200) {
                     if (res.data != null && res.data != undefined ) {
                        that.recomLoc = '系统推荐将货物放至:' + res.data.locNo
                        that.$refs.recommend.open()
                     }
                  } 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')
                  }
               }
            });
         },
         reset(type) {
            this.msgType = type
            this.title = '警告'
@@ -396,6 +443,7 @@
         resst() {
            this.dataList = []
            this.barcode = ''
            this.matnr = ''
            this.barcodeFocuss()
         },
      }