skyouc
2 天以前 4616cff3a14b81c4d488697f43fc7aad3cf3f10f
pages/stock/changePallet.vue
@@ -2,12 +2,12 @@
   <view>
      <view class="code">
         <view class="item">
            <view class="code-decs">原托盘:</view>
            <view class="code-decs">源库位:</view>
            <input type="text" placeholder=" 扫码 / 输入" v-model="barcode" :focus="barcodeFocus"
               @input="barcodeInput()">
         </view>
         <view class="item">
            <view class="code-decs">新托盘:</view>
            <view class="code-decs">目标库位:</view>
            <input type="text" placeholder=" 扫码 / 输入" v-model="tBarcode" :focus="focus" @input="checkBarcode()">
         </view>
      </view>
@@ -24,16 +24,16 @@
               <view class="list-left-item">
                  <view class="desc">编码:</view>
                  <view class="left-item">
                     <uni-tag :text="item.matnr" type="primary"></uni-tag>
                     <uni-tag :text="item.mats.matnrNo" type="primary"></uni-tag>
                  </view>
               </view>
               <view class="list-left-item">
                  <view class="desc">品名:</view>
                  <view class="left-item">{{item.maktx}}</view>
                  <view class="left-item">{{item.mats.matnrName}}</view>
               </view>
               <view class="list-left-item">
                  <view class="desc">规格:</view>
                  <view class="left-item">{{item.specs}}</view>
                  <view class="left-item">{{item.mats.tspec}}</view>
               </view>
               <view class="list-left-item">
                  <view class="desc">批号:</view>
@@ -123,37 +123,29 @@
         // barcode input 事件
         barcodeInput() {
            let that = this 
            if (this.barcode.length != 8) {
               uni.showToast({title: '托盘码长度异常,请重新扫描', icon: "none", position: 'top'})
               this.barcodeFocuss()
            }
            if (that.barcode.length == 8) {
               uni.request({
                  url: that.baseUrl + '/mobile/piking/auth',
                  header: {
                     'token':uni.getStorageSync('token')
                  },
                  data: {barcode:that.barcode},
                  success(res) {
                     res = res.data
                     if(res.code===200) {
                        that.dataList = res.data
                        that.focuss()
                     } else if (res.code == 403) {
                        uni.showToast({title: res.msg, icon: "none", position: 'top'})
                        setTimeout(() => {
                           uni.reLaunch({
                              url: '../login/login'
                           });
                        }, 1000);
                     } else {
                        that.barcodeFocuss()
                        uni.showToast({title: res.msg, icon: "none",position: 'top'})
                     }
                  }
               })
            }
            uni.request({
               url: that.baseUrl + '/pda/flat/transfer/' + that.barcode,
               header: {
                  'token':uni.getStorageSync('token')
               },
               success(res) {
                  res = res.data
                  if(res.code===200) {
                     that.dataList = res.data
                     that.focuss()
                  } else if (res.code == 403) {
                     uni.showToast({title: res.msg, icon: "none", position: 'top'})
                     setTimeout(() => {
                        uni.reLaunch({
                           url: '../login/login'
                        });
                     }, 1000);
                  } else {
                     that.barcodeFocuss()
                     uni.showToast({title: res.msg, icon: "none",position: 'top'})
                  }
               }
            })
         },
         // 托盘码有误重置
         barcodeFocuss() {
@@ -165,10 +157,11 @@
            }, 100);
         },
         checkBarcode() {
            if (this.tBarcode.length != 8) {
               uni.showToast({title: '托盘码长度异常,请重新扫描', icon: "none", position: 'top'})
               this.focuss()
            }
            // if (!this.tBarcode.indexOf("B") >= 0 || !this.tBarcode.indexOf("C") >= 0) {
            //    uni.showToast({title: '库位码异常,请重新扫描', icon: "none", position: 'top'})
            //    this.focuss()
            // }
         },
         // 商品光标清空重置
         focuss() {
@@ -214,11 +207,12 @@
         changePallet() {
            let that = this
            uni.request({
               url: that.baseUrl + '/mobile/piking/to/full',
               url: that.baseUrl + '/pda/locs/transfer',
               method:'POST',
               header: {
                  'token':uni.getStorageSync('token')
               },
               data: {sBarcode:that.barcode,tBarcode:that.tBarcode},
               data: {barcode:that.barcode, tarCode:that.tBarcode},
               success(res) {
                  res = res.data
                  if (res.code === 200) {
@@ -246,7 +240,11 @@
<style>
   @import url('../../static/css/wms.css/wms.css');
   .list:first-child {
      margin-top: 340rpx;
   }
   .code {
      width: 100%;
      position: fixed;