| | |
| | | <!-- <button class="uni-button" size="mini" type="warn" @click="remove(index,item)">删除</button> --> |
| | | </uni-td> |
| | | <uni-td align="center">{{item.size}}</uni-td> |
| | | <uni-td align="center">{{item.matNo}}</uni-td> |
| | | <uni-td align="center">{{item.matnr}}</uni-td> |
| | | <uni-td align="center">{{item.matName}}</uni-td> |
| | | <uni-td align="center">{{item.seqNo}}</uni-td> |
| | | <uni-td align="center">{{item.itemBatch}}</uni-td> |
| | |
| | | minCount:0, |
| | | maxCount:1, |
| | | rowNum:'', |
| | | value:'', |
| | | couChange:true, |
| | | value:0, |
| | | couChange:false, |
| | | baseIP:'', |
| | | basePORT:'', |
| | | selectArr : [], |
| | |
| | | if(res.data.data != null){ |
| | | that.addTableData(res.data.data) |
| | | }else if(res.data.code === 403){ |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }) |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../login/login' |
| | | }); |
| | | }, 1000); |
| | | }else { |
| | | that.messageToggle('error') |
| | | that.messageText = res.data.msg |
| | |
| | | if(res.data.data != null){ |
| | | that.addTableData(res.data.data) |
| | | }else if(res.data.code === 403){ |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }) |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../login/login' |
| | | }); |
| | | }, 1000); |
| | | }else { |
| | | that.messageToggle('error') |
| | | that.messageText = res.data.msg |
| | |
| | | }, |
| | | addTableData(data){ |
| | | this.matData=[]; |
| | | for(var i=0;i<data.length;i++){ |
| | | var toPush = true; |
| | | for(var j=0;j<this.matData.length;j++){ |
| | | if(data[i].matNo ===this.matData[j].matNo && data[i].itemBatch === this.matData[j].itemBatch && data[i].specs === this.matData[j].specs){ |
| | | this.matData[j].count = Number(this.matData[j].count) + Number(data[i].count); |
| | | toPush = false; |
| | | } |
| | | } |
| | | if(toPush) { |
| | | this.matData.push(data[i]); |
| | | } |
| | | // for(var i=0;i<data.length;i++){ |
| | | // var toPush = true; |
| | | // for(var j=0;j<this.matData.length;j++){ |
| | | // if(data[i].matnr ===this.matData[j].matnr && data[i].itemBatch === this.matData[j].itemBatch && data[i].specs === this.matData[j].specs){ |
| | | // this.matData[j].count = Number(this.matData[j].count) + Number(data[i].count); |
| | | // toPush = false; |
| | | // } |
| | | // } |
| | | // if(toPush) { |
| | | // // data[i].count = 0 |
| | | // this.matData.push(data[i]); |
| | | // } |
| | | // } |
| | | for (let k of data) { |
| | | this.matData.push(k); |
| | | } |
| | | }, |
| | | |
| | |
| | | that.messageText = '托盘码必须为8位' |
| | | return; |
| | | } |
| | | if(that.couChange){ |
| | | that.messageToggle('error') |
| | | that.messageText = '请先确认入库数量' |
| | | return; |
| | | } |
| | | // if(that.couChange){ |
| | | // that.messageToggle('error') |
| | | // that.messageText = '请先确认入库数量' |
| | | // return; |
| | | // } |
| | | for (var i = 0; i < that.matData.length; i++){ |
| | | if (that.matData[i].count === 0) { |
| | | that.messageToggle('error') |
| | |
| | | } |
| | | } |
| | | |
| | | for (let item of that.matData) { |
| | | item['anfme'] = item.count |
| | | } |
| | | uni.request({ |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + "/mobile/comb/auth", |
| | | header: {'token':uni.getStorageSync('token')}, |
| | | data:{ |
| | | barcode:barcode, |
| | | combMats:that.matData, |
| | | billNo: billNo, |
| | | }, |
| | | method:'POST', |
| | | success(res) { |
| | | if(res.data.code === 200){ |
| | | that.reset() |
| | | that.matData = [] |
| | | that.couChange=true |
| | | that.messageToggle('success') |
| | | that.messageText = '组托成功' |
| | | that.getFocus('firstFocus') |
| | | } else if(res.data.code === 403){ |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../login/login' |
| | | }); |
| | | }, 1000); |
| | | } else { |
| | | that.messageToggle('error') |
| | | that.messageText = res.data.msg |
| | | } |
| | | } |
| | | }) |
| | | return |
| | | // 一期的如下 |
| | | for (var i = 0; i < that.matData.length; i++) { |
| | | var sad = that.matData[i].qty - that.value |
| | | if (sad <= 5 && sad > 0) { |
| | |
| | | that.couChange=true |
| | | that.messageToggle('success') |
| | | that.messageText = '组托成功' |
| | | this.getFocus('firstFocus') |
| | | that.getFocus('firstFocus') |
| | | } else if(res.data.code === 403){ |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | |
| | | that.couChange=true |
| | | that.messageToggle('success') |
| | | that.messageText = '组托成功' |
| | | this.getFocus('firstFocus') |
| | | that.getFocus('firstFocus') |
| | | } else if(res.data.code === 403){ |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | |
| | | that.couChange=true |
| | | that.messageToggle('success') |
| | | that.messageText = '组托成功' |
| | | this.getFocus('firstFocus') |
| | | that.getFocus('firstFocus') |
| | | } else if(res.data.code === 403){ |
| | | uni.navigateBack({ |
| | | delta: 1 |