@
whycq
2023-02-06 522e9183f057751f08d41cb2fd37aaac85734808
pages/basics/pakin.vue
@@ -3,13 +3,15 @@
      <scroll-view scroll-y catch:touchmove="touchmove">
         <view class="square-2">
            <view class="square-title">
               <view class="title-sign"><view class="sign"></view></view>
               <view class="title-sign">
                  <view class="sign"></view>
               </view>
               <view class="title-text"><text>托盘条码</text></view>
            </view>
            <view class="square-content">
               <view class="content-input">
                  <input v-model="barcode" type="text" placeholder="扫码 / 输入"
                  :focus="barcodeFocus" @confirm="barcodeInput()" placeholder-style="line-height:  85rpx;">
                  <input v-model="barcode" type="text" placeholder="扫码 / 输入" :focus="barcodeFocus"
                     @confirm="barcodeInput()" placeholder-style="line-height:  85rpx;">
                  <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons>
               </view>
            </view>
@@ -18,13 +20,15 @@
         
         <view class="square-2">
            <view class="square-title">
               <view class="title-sign"><view class="sign"></view></view>
               <view class="title-sign">
                  <view class="sign"></view>
               </view>
               <view class="title-text"><text>检索商品</text></view>
            </view>
            <view class="square-content">
               <view class="content-input-btn">
                  <input v-model="matnr" type="text" placeholder="扫码 / 输入" @input="findMat()"
                  :focus="focus" placeholder-style="line-height:  85rpx;">
                  <input v-model="matnr" type="text" placeholder="扫码 / 输入" @input="findMat()" :focus="focus"
                     placeholder-style="line-height:  85rpx;">
                  <uni-icons type="closeempty" size="20" color="#dadada" @click="removeMatnr()"></uni-icons>
               </view>
               <view class="content-btn">
@@ -36,7 +40,9 @@
         
         <view class="square-1">
            <view class="square-title">
               <view class="title-sign"><view class="sign"></view></view>
               <view class="title-sign">
                  <view class="sign"></view>
               </view>
               <view class="title-text"><text>商品列表</text></view>
               <!-- <label v-show="matList.length != 0" style="float: right;margin-right: 20px;margin-top: 13px;"><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove()"></uni-icons></label> -->
            </view>
@@ -47,7 +53,8 @@
         </view>
         
         <checkbox-group @change="checkbox">
            <view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" >
            <view v-for="(item,index) in matList" :key="index" class="data-list bg-false"
               :class="'bg-'+item.checked">
               <view class="data-list-left">
                  <!-- <view>
                     <checkbox :value="item.id+''" :checked="item.checked" style="display: block;" />
@@ -60,8 +67,12 @@
                  </view>
               </view>
               <view class="data-list-right">
                  <label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons></label>
                  <label><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons></label>
                  <label>
                     <uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons>
                  </label>
                  <label>
                     <uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons>
                  </label>
               </view>
            </view>
         </checkbox-group>
@@ -81,7 +92,7 @@
            <button class="cu-btn" @click="resst()">重置</button>
         </label>
         <label class="label-btn">
            <button class="cu-btn bg-blue " @click="comb()">组托</button>
            <button class="cu-btn bg-blue " @click="comb1()">组托</button>
         </label>
      </view>
      
@@ -109,6 +120,10 @@
               </view>
            </view>
         </view>
      </uni-popup>
      <uni-popup ref="alertDialog" type="dialog">
         <uni-popup-dialog :type="msgType" cancelText="取消" confirmText="确认" title="组托" content="确认是否现在组托!"
            @confirm="comb" @close="dialogClose"></uni-popup-dialog>
      </uni-popup>
   </view>
</template>
@@ -165,12 +180,19 @@
            setTimeout(()=>{
               var len = this.barcode.length
               if (len != 8) {
                  uni.showToast({title: '托盘码有误请重试', icon: "none", position: 'top'});
                  uni.showToast({
                     title: '托盘码有误请重试',
                     icon: "none",
                     position: 'top'
                  });
                  this.barcodeFocuss()
                  return;
               }
               this.focuss()
            },200)
         },
         comb1() {
            this.$refs.alertDialog.open()
         },
         // 托盘码有误重置
         barcodeFocuss() {
@@ -223,16 +245,28 @@
            uni.vibrateShort();
            let that = this;
            if (that.barcode === '') {
               uni.showToast({title: '请扫描托盘条码', icon: "none", position: 'top'});
               uni.showToast({
                  title: '请扫描托盘条码',
                  icon: "none",
                  position: 'top'
               });
               return;
            }
            if (that.matList.length === 0) {
               uni.showToast({title: '请添加商品列表', icon: "none", position: 'top'});
               uni.showToast({
                  title: '请添加商品列表',
                  icon: "none",
                  position: 'top'
               });
               return;
            }
            for (var i = 0; i < that.matList.length; i++) {
               if (that.matList[i].anfme == 0 || that.matList[i].anfme == '') {
                  uni.showToast({title: that.matList[i].matnr + '组托数量不能为0', icon: "none", position: 'top'});
                  uni.showToast({
                     title: that.matList[i].matnr + '组托数量不能为0',
                     icon: "none",
                     position: 'top'
                  });
                  return;
               }
            }
@@ -258,14 +292,22 @@
                        duration: 1000
                     });
                  } else if (res.code == 403) {
                     uni.showToast({title: res.msg, icon: "none", position: 'top'})
                     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'})
                     uni.showToast({
                        title: res.msg,
                        icon: "none",
                        position: 'top'
                     })
                  }
               }
            });
@@ -284,7 +326,9 @@
               },
               success: function(res) {
                   // 通过eventChannel向被打开页面传送数据   向另外一个页面传递值的
                   res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl })
                  res.eventChannel.emit('commonUrl', {
                     commonUrl: that.commonUrl
                  })
               },
               
            });
@@ -317,18 +361,28 @@
                        },
                        success: function(res) {
                           // 通过eventChannel向被打开页面传送数据
                           res.eventChannel.emit('matData', { data: that.matData })
                           res.eventChannel.emit('matData', {
                              data: that.matData
                           })
                        },
                     });
                  } else if (res.code == 403) {
                     uni.showToast({title: res.msg, icon: "none", position: 'top'})
                     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'})
                     uni.showToast({
                        title: res.msg,
                        icon: "none",
                        position: 'top'
                     })
                  }
                  
               }
@@ -465,21 +519,26 @@
      height: 400rpx;
      border-radius: 25px;
   }
   .revise-box-top {
      width: 400rpx;
      height: 120rpx;
      border-radius: 25px;
   }
   .changeBox {
      width: 400rpx;
      height: 100rpx;
   }
   .num-box {
      margin-left: 100rpx;
   }
   .revise-box-buttom{
      margin-left: 190rpx;
   }
   .pak-seach-box {
      background-color: #FFFFFF;
      margin: 15rpx 15rpx 0rpx 15rpx;
@@ -487,11 +546,13 @@
      height: 150rpx;
      border-radius: 20rpx;
   }
   .box-top{
      display: block;
      height: 60rpx;
      width: 720rpx;
   }
   .color-block-blue {
      background-color: #1E9FFF;
      display: inline-block;
@@ -502,6 +563,7 @@
      border: 5rpx solid #1E9FFF;
      border-radius: 20rpx;
   }
   .title {
      display: inline-block;
      float: left;
@@ -511,6 +573,7 @@
      line-height: 50rpx;
      margin-top: 10rpx;
   }
   .box-buttom {
      display: inline-block;
      background-color: #ededed;
@@ -519,11 +582,13 @@
      border-radius: 20rpx;
      margin: 15rpx 15rpx 0rpx 15rpx;
   }
   .box-buttom input {
      width: 75%;
      float: left;
      margin: 8rpx 10rpx 0rpx 25rpx;
   }
   .box-buttom .search-icon{
      width: 60rpx;
      height: 60rpx;
@@ -531,6 +596,7 @@
      margin-top: 5rpx;
      margin-right: 10rpx;
   }
   /* .pak-seach-box input {
      background-color: #ededed;
      border: 1rpx solid #d8d8d8;
@@ -553,9 +619,11 @@
      margin: 15rpx 15rpx 0rpx 15rpx;
      line-height: 60rpx;
   }
   .pakin-btn {
      background-color: #1E9FFF;
   }
   .pak-data-box {
      background-color: #F1F1F1;
      margin: 15rpx 15rpx 0rpx 15rpx;
@@ -563,29 +631,36 @@
      height: 70rpx;
      border-radius: 20rpx;
   }
   .pak-data-box .box-top {
      background-color: #FFFFFF;
      height: 70rpx;
      border-radius: 20rpx 20rpx 20rpx 20rpx;
   }
   .bg-false {
      background-color: #FFFFFF;
   }
   .bg-true {
      background-color: #ebebeb;
   }
   .data-list {
      border-bottom: 1px solid #d8d8d8;
      height: 180rpx;
      margin: 15rpx;
      border-radius: 20rpx;
   }
   .data-list:first-child {
      margin-top: 20rpx;
   }
   .data-list:last-child {
      margin-bottom: 120rpx;
   }
   /* .data-list-left {
      display: inline-block;
      float: left;
@@ -601,15 +676,18 @@
      height: 180rpx;
      color: #676767;
   }
   .matnr {
      padding-top: 10rpx;
   }
   .data-list-right {
      display: inline-block;
      float: right;
      height: 180rpx;
      line-height: 180rpx;
   }
   /* display: inline-block;
   float: right;
   width: 200rpx;