| | |
| | | }, |
| | | 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].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(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.couChange=true |
| | | that.messageToggle('success') |
| | | that.messageText = '组托成功' |
| | | this.getFocus('firstFocus') |
| | | that.getFocus('firstFocus') |
| | | } else if(res.data.code === 403){ |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | |
| | | 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 |