| | |
| | | </view> |
| | | <view class="item"> |
| | | <view class="code-decs">物料码:</view> |
| | | <input type="text" placeholder=" 扫码 / 输入" v-model="matnr" :focus="matFocus" @input="findMat()"> |
| | | <input type="text" placeholder=" 扫码 / 输入" v-model="matNo" :focus="matFocus" @input="findMat()"> |
| | | <view class="item-right"> |
| | | <button></button> |
| | | <text style="text-align: right;color: #409EFF;" @click="selectMat()">提取+</text> |
| | |
| | | <view class="popup-item"> |
| | | <view class="popup-item-left">编码:</view> |
| | | <view class="popup-item-right"> |
| | | <input type="text" v-model="matnr" disabled="true" |
| | | <input type="text" v-model="matNo" disabled="true" |
| | | style="background-color: #f7f7f7;padding: 0;color: #d5d5d5;"> |
| | | </view> |
| | | </view> |
| | |
| | | dataList: [], |
| | | count: 0, |
| | | rowNum: '', |
| | | matnr: '', |
| | | matNo: '', |
| | | batch: '', |
| | | weight: '', |
| | | msgType1: 'success', |
| | |
| | | focuss() { |
| | | this.focus = false; |
| | | setTimeout(() => { |
| | | this.matnr = ''; |
| | | this.matNo = ''; |
| | | this.matFocus = true; |
| | | }, 100); |
| | | }, |
| | |
| | | uni.request({ |
| | | url: that.baseUrl + '/matCode/list/auth', |
| | | data: { |
| | | mat_no: that.matnr |
| | | mat_no: that.matNo |
| | | }, |
| | | header: { |
| | | 'token': uni.getStorageSync('token') |
| | |
| | | result = result.data |
| | | if (result.code === 200 && result.data) { |
| | | that.matData = result.data |
| | | that.matnr = '' |
| | | that.matNo = '' |
| | | that.matData['batch'] = '' |
| | | uni.navigateTo({ |
| | | url: "../mat/matSelected", |
| | |
| | | events: { |
| | | // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 另外一个页面传过来的 |
| | | acceptDataFromOpenedPage: function(data) { |
| | | that.matnr = data.data |
| | | that.findMat(that.matnr) |
| | | that.matNo = data.data |
| | | that.findMat(that.matNo) |
| | | }, |
| | | }, |
| | | |
| | | |
| | | }); |
| | | that.matnr = '' |
| | | 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 |
| | | for (var i = 0; i < len; i++) { |
| | | if (mat.matnr == this.dataList[i].matnr) { |
| | | console.log(i); |
| | | console.log(mat); |
| | | console.log(this.dataList[i].matNo); |
| | | if (mat.matNo == this.dataList[i].matNo) { |
| | | for (var j = 0; j < len; j++) { |
| | | if (mat.batch == this.dataList[j].batch) { |
| | | sameItem = true |
| | |
| | | }, |
| | | // 修改批号 |
| | | revise(item, i) { |
| | | this.matnr = this.dataList[i].matnr |
| | | this.matNo = this.dataList[i].matNo |
| | | this.count = this.dataList[i].anfme |
| | | this.batch = this.dataList[i].batch |
| | | this.weight = this.dataList[i].weight |
| | |
| | | this.dataList[this.rowNum].batch = this.batch |
| | | this.dataList[this.rowNum].weight = this.weight |
| | | this.dataList[this.rowNum].appeTime$ = this.appeTime$ |
| | | this.matnr = '' |
| | | this.matNo = '' |
| | | this.messageText = "修改成功" |
| | | this.messageToggle('success') |
| | | this.$refs.revise.close() |
| | |
| | | } |
| | | for (var i = 0; i < that.dataList.length; i++) { |
| | | if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') { |
| | | this.messageText = that.dataList[i].matnr + '组托数量不能为0' |
| | | this.messageText = that.dataList[i].matNo + '组托数量不能为0' |
| | | this.messageToggle('error') |
| | | return; |
| | | } |