#
whycq
2022-04-29 c1e688c8a52dd517a2b10125ff9fd1ede7499ce3
pages/basics/checkout.vue
@@ -8,7 +8,8 @@
            </view>
            <view class="square-content">
               <view class="content-input">
                  <input v-model="barcode" type="text" placeholder="扫码 / 输入" maxlength="8" @input="findBarcode()">
                  <input v-model="barcode" type="text" placeholder="扫码 / 输入" maxlength="8"
                  @input="findBarcode()" :focus="barcodeFocus" @focus="focuss">
                  <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons>
               </view>
            </view>
@@ -36,7 +37,8 @@
                  <uni-combox  emptyTips="暂无数据" :candidates="staNoList" v-model="staNo" placeholder="站台号"></uni-combox>
               </view>
               <view class="content-input-combox">
                  <input type="text" v-model="matnr" placeholder="扫码 / 输入" @input="findMat()">
                  <input type="text" v-model="matnr" placeholder="扫码 / 输入" @input="findMat()"
                  :focus="focus" @focus="focuss">
                  <uni-icons type="closeempty" size="20" color="#dadada" @click="removeMatnr()"></uni-icons>
               </view>
            </view>
@@ -72,10 +74,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"><text style="width: 400rpx;">编码:{{item.matnr}}</text></view>
                  <view><text style="width: 400rpx;">品名:{{item.maktx}}</text></view>
                  <view><text style="width: 400rpx;">批号:{{item.batch}}</text></view>
                  <view><text style="width: 400rpx;">数量:{{item.anfme}}</text></view>
                  <view class="matnr">{{item.barcode}}</view>
               </view>
               <view class="data-list-right">
                  <uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons>
@@ -100,11 +99,13 @@
      data() {
         return {
            barcode: '',
            barcodeFocus:true,
            focus:false,
            type: 'center',
            searchBox: 'hide',
            pick:'hide',
            matnr:'',
            matList:[],
            matList:[{barcode:'92992929292'}],
            result: '',
            staNoList:[],
            staNo:'',
@@ -118,6 +119,9 @@
         this.getOutBound();
      },
      methods: {
         focuss() {
            uni.hideKeyboard()
         },
         resst() {
            this.matList = []
            this.barcode = ''
@@ -127,10 +131,18 @@
         removeBarcode() {
            this.barcode = ''
            uni.vibrateShort();
            this.barcodeFocus = false;
            this.$nextTick(function() {
               this.barcodeFocus = true;
            });
         },
         removeMatnr() {
            this.matnr = ''
            uni.vibrateShort();
            this.focus = false;
            this.$nextTick(function() {
               this.focus = true;
            });
         },
         remove(item,index) {
            this.matList.splice(index,1)
@@ -216,6 +228,20 @@
                  
               }
            });
         },
         addMatList(mat) {
            let barcode = this.mat.barcode
            let toUnshift = true
            for (var i = 0; i < this.matList.length; i++) {
               if (barcode === this.matList[i].barcode) {
                  this.messageToggle('warn')
                  this.messageText = barcode + '已经扫描,请勿重复扫描'
                  toUnshift = false
               }
            }
            if (toUnshift) {
               this.matList.unshift(mat)
            }
         },
         findBarcode() {
            let that = this
@@ -402,7 +428,7 @@
   }
   .data-list {
      border-bottom: 1px solid #d8d8d8;
      height: 180rpx;
      height: 130rpx;
      margin: 15rpx;
      border-radius: 20rpx;
   }
@@ -421,20 +447,28 @@
      line-height: 180rpx;
   } */
   .data-list-left {
      width: 550rpx;
      /* background-color: #007AFF; */
      display: inline-block;
      float: left;
      margin-left: 6%;
      height: 180rpx;
      margin-left: 4%;
      height: 130rpx;
      color: #676767;
   }
   .matnr {
      padding-top: 10rpx;
      display: inline-block;
      width: 100%;
      font-size: 16px;
      font-weight: 700;
      height: 130rpx;
      line-height: 130rpx;
   }
   .data-list-right {
      /* background-color: #6739B6; */
      display: inline-block;
      float: right;
      height: 180rpx;
      line-height: 180rpx;
      margin-right: 10%;
      width: 100rpx;
      height: 130rpx;
      line-height: 130rpx;
   }
</style>