| | |
| | | <view class="item"> |
| | | <view class="code-decs">托盘码:</view> |
| | | <input type="text" placeholder=" 扫码 / 输入" v-model="barcode" :focus="barcodeFocus" |
| | | @input="barcodeInput()"> |
| | | @input="checkedBarcode()"> |
| | | </view> |
| | | <view class="item"> |
| | | <view class="code-decs">物料码:</view> |
| | |
| | | this.token = uni.getStorageSync('token'); |
| | | }, |
| | | methods: { |
| | | checkedBarcode() { |
| | | let that = this |
| | | uni.request({ |
| | | url: that.baseUrl + '/barcode/auth', |
| | | data: { |
| | | barcode: that.barcode, |
| | | }, |
| | | header: { |
| | | 'token':uni.getStorageSync('token') |
| | | }, |
| | | success(result) { |
| | | console.log(result); |
| | | var res = result.data |
| | | if (res.code === 500) { |
| | | that.barcodeFocuss() |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}); |
| | | } else if(res.code === 200) { |
| | | that.barcodeInput() |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | messageToggle(type) { |
| | | this.msgType1 = type |
| | | this.$refs.message.open() |
| | |
| | | }); |
| | | that.matNo = '' |
| | | }, |
| | | // checkMat(mat) { |
| | | // var len = this.dataList.length |
| | | // var add = true ,sameItem = false |
| | | // for (var i = 0; i < len; i++) { |
| | | // if (mat.matno == this.dataList[i].matno) { |
| | | // for (var j = 0; j < len; j++) { |
| | | // if (mat.batch == this.dataList[j].batch) { |
| | | // sameItem = true |
| | | // } |
| | | // } |
| | | // // 相同物料 不同批号 新加列表 |
| | | // if (mat.batch != this.dataList[i].batch) { |
| | | // this.$forceUpdate() // 强制刷新 |
| | | // if (sameItem) { |
| | | // add = false |
| | | // } else { |
| | | // add = true |
| | | // } |
| | | |
| | | // } else { |
| | | // // 相同物料相同批号 数量累加 |
| | | // this.dataList[i].anfme += mat.anfme |
| | | // this.$forceUpdate() // 强制刷新 |
| | | // add = false |
| | | // } |
| | | // } |
| | | // } |
| | | // if (add) { |
| | | // this.dataList.unshift(mat) |
| | | // } |
| | | // }, |
| | | checkMat(mat) { |
| | | var len = this.dataList.length |
| | | var add = true ,sameItem = false |