#
whycq
2024-03-29 4bfbbe389310fdea9b140e3551c116db85c63249
pages/phyz/AGV/emptyPakin.vue
@@ -2,13 +2,11 @@
   <view>
      <view class="code">
         <view class="item">
            <view class="code-decs">料箱码:</view>
            <input type="text" placeholder=" 扫码 / 输入" v-model="barcode" :focus="barcodeFocus"
            <input type="text" placeholder=" 扫码 / 输入 货架码" v-model="barcode" :focus="barcodeFocus"
               @input="barcodeInput()" readonly>
         </view>
         <view class="item">
            <view class="code-decs">暂存位:</view>
            <input type="text" placeholder=" 扫码 / 输入" v-model="stationCode" :focus="stationCodeFocus"
            <input type="text" placeholder=" 扫码 / 输入 暂存位" v-model="stationCode" :focus="stationCodeFocus"
               @input="stationCodeInput()" readonly>
            <view class="item-right">
               <button></button>
@@ -152,7 +150,8 @@
            removeNum: 0,
            hide: true,
            hidebg: 'kb-bgtr',
            kind: ''
            kind: '',
            containerType: 0
         }
      },
      onLoad() {
@@ -189,7 +188,7 @@
         stationCodeInput() {
            setTimeout(() => {
               var len = this.stationCode.length
               if (len != 15) {
               if (len != 7) {
                  this.stationCode = ''
                  this.stationCodeFocus = true
                  uni.showToast({
@@ -224,13 +223,19 @@
         },
         // barcode input 事件
         barcodeInput() {
            // 不设置定时器 会出现扫入的字符串不全
            if (this.barcode.split('_')[1]) {
               this.barcode = this.barcode.split('_')[1]
            }
            let val = this.barcode.substring(0,2)
            if (val == '10') {
               this.containerType = 1
            } else if(val == '20') {
               this.containerType = 2
            } else if (val == '21') {
               this.containerType = 3
            } else if (val == '30') {
               this.containerType = 4
            }
            setTimeout(() => {
               var len = this.barcode.length
               if (len != 10) {
               if (len != 6) {
                  uni.showToast({
                     title: '料箱码有误请重试',
                     icon: "none",
@@ -444,13 +449,13 @@
               let param = {
                  devNo: this.dataList[0].devNo,
                  containerCode: this.barcode,
                  containerType: this.dataList[0].locType1,
                  containerType: this.containerType,
                  }
               params.push(param)
            } else {
               let param = {
                  devNo: this.dataList[0].devNo,
                  containerType: this.dataList[0].locType1,
                  containerType: this.containerType,
                  }
               params.push(param)
            }