#
whycq
2022-05-09 b24c91d819931fe5f2199873dfb0f0501e20b50e
pages/basics/checkout.vue
@@ -28,16 +28,20 @@
            </view>
         </view> -->
         
         <view class="square-2">
         <view class="square-3">
            <view class="square-title">
               <view class="title-sign"><view class="sign"></view></view>
               <view class="title-text"><text>货品条码</text></view>
            </view>
            <view class="square-content">
               <text>站台:</text>
               <view class="content-combox">
                  <uni-combox  emptyTips="暂无数据" :candidates="siteList" v-model="desc" placeholder="站台号" 
                  @input="choseStaNo"></uni-combox>
               </view>
            </view>
            <view class="square-content">
               <text>货品条码:</text>
               <view class="content-input-combox">
                  <input type="text" v-model="matnr" placeholder="扫码 / 输入" @input="findMat()"
                  :focus="focus" >
@@ -77,7 +81,7 @@
         <checkbox-group @change="checkbox">
            <view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" >
               <view class="data-list-left">
                  <view class="matnr">{{item.matnr}}</view>
                  <view class="matnr">{{item.matnr}}-{{item.batch}}</view>
               </view>
               <view class="data-list-right">
                  <uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons>
@@ -189,6 +193,10 @@
                        position: 'bottom',
                        duration: 1000
                     });
                     that.matList = []
                     that.barcode = ''
                     that.matnr = ''
                     that.desc = ''
                  } else if (res.code == 403) {
                     uni.showToast({title: res.msg, icon: "none", position: 'top'})
                     setTimeout(() => {
@@ -234,27 +242,19 @@
                  'token':uni.getStorageSync('token')
                },
               success(result) {
                  var res = result.data;
                  if(res.data) {
                     let add = true;
                     for(let i = 0;i<that.matList.length;i++) {
                        for (let j = 0;j < that.res.data.length; j++) {
                        for (let j = 0;j < res.data.length; j++) {
                           if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data[j])) {
                              res.data.splice(i,1)
                              // break;
                              res.data.splice(j,1)
                           }
                        }
                        // add = false;
                     }
                     that.matList = that.matList.concat(res.data)
                     // if (add) {
                     that.matList = res.data.concat(that.matList)
                     //    that.matList = that.matList.concat(res.data)
                     // }
                  }
                  // that.addMatList(res.data)
                  // that.matList = res.data
               }
            });
         },
@@ -295,24 +295,17 @@
                },
               success(result) {
                  var res = result.data;
                  console.log(res)
                  if(res.data) {
                     let add = true;
                     for(let i = 0;i<that.matList.length;i++) {
                        for (let j = 0;j < that.res.data.length; j++) {
                        for (let j = 0;j < res.data.length; j++) {
                           if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data[j])) {
                              res.data.splice(i,1)
                              // break;
                              res.data.splice(j,1)
                           }
                        }
                        // if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data[0])) {
                        //    add = false;
                        //    break;
                        // }
                     }
                     that.matList = that.matList.concat(res.data)
                     // if (add) {
                     that.matList = res.data.concat(that.matList)
                     //    that.matList = that.matList.concat(res.data)
                     // }
                  }
                  
               }
@@ -438,12 +431,7 @@
      margin-top: 5rpx;
      margin-right: 10rpx;
   }
   .combox {
      position: fixed;
      display: inline-block;
      width: 28%;
      float: right;
   }
   /* .pak-seach-box input {
      background-color: #ededed;
      border: 1rpx solid #d8d8d8;