|  |  | 
 |  |  |    <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> | 
 |  |  | 
 |  |  |       <!-- 底部操作按钮 --> | 
 |  |  |       <view class="buttom"> | 
 |  |  |          <button size="mini" @click="reset('warn')">重置</button> | 
 |  |  |          <button size="mini" type="primary" @click="combConfirm('warn','pakout')">出库</button> | 
 |  |  |          <!-- <button size="mini" type="primary" @click="combConfirm('warn','pakout')">出库</button> --> | 
 |  |  |          <button size="mini" type="primary" @click="combConfirm('warn','pakin')">入库</button> | 
 |  |  |       </view> | 
 |  |  |       <!-- 弹窗 --> | 
 |  |  | 
 |  |  |             removeNum: 0, | 
 |  |  |             hide: true, | 
 |  |  |             hidebg: 'kb-bgtr', | 
 |  |  |             kind: '' | 
 |  |  |             kind: '', | 
 |  |  |             containerType: 0 | 
 |  |  |          } | 
 |  |  |       }, | 
 |  |  |       onLoad() { | 
 |  |  | 
 |  |  |          stationCodeInput() { | 
 |  |  |             setTimeout(() => { | 
 |  |  |                var len = this.stationCode.length | 
 |  |  |                if (len != 15) { | 
 |  |  |                if (len != 7) { | 
 |  |  |                   this.stationCode = '' | 
 |  |  |                   this.stationCodeFocus = true | 
 |  |  |                   uni.showToast({ | 
 |  |  | 
 |  |  |          }, | 
 |  |  |          // 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", | 
 |  |  | 
 |  |  |                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) | 
 |  |  |             } |