| | |
| | | events: { |
| | | // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 |
| | | matList: function(data) { |
| | | that.matList.push(data.data) |
| | | that.checkMat(data.data) |
| | | // that.matList.push(data.data) |
| | | }, |
| | | }, |
| | | success: function(res) { |
| | |
| | | }); |
| | | |
| | | }, |
| | | |
| | | // 添加商品 |
| | | addMat(mat) { |
| | | this.matList.unshift(mat) |
| | | }, |
| | | checkMat(mat) { |
| | | var len = this.matList.length |
| | | var add = true |
| | | for (var i = 0; i < len; i++) { |
| | | console.log(mat.matnr === this.matList[i].matnr); |
| | | if (mat.matnr === this.matList[i].matnr) { |
| | | this.matList[i].anfme += mat.anfme |
| | | this.$forceUpdate() // 强制刷新 |
| | | add = false |
| | | } |
| | | } |
| | | if (add) { |
| | | this.matList.unshift(mat) |
| | | } |
| | | }, |
| | | change(e) { |
| | | console.log('当前模式:' + e.type + ',状态:' + e.show); |
| | | }, |