| | |
| | | <uni-table border stripe emptyText="暂无更多数据"> |
| | | <uni-tr> |
| | | <uni-th width="50">数量</uni-th> |
| | | <uni-th width="100">产品代号</uni-th> |
| | | <uni-th width="100">产品ID</uni-th> |
| | | <uni-th width="100">产品名称</uni-th> |
| | | </uni-tr> |
| | | <uni-tr v-for="(item, index) in matData" :key="index" @input="tabRender()"> |
| | |
| | | // 根据产品代号查询产品详情 |
| | | find(){ |
| | | let that = this |
| | | console.log(that.matNo) |
| | | let thatId = that.matNo |
| | | if(that.matNo.length===0){ |
| | | console.log(1) |
| | | return; |
| | | } |
| | | uni.request({ |
| | |
| | | }, |
| | | method:'POST', |
| | | success:function(res){ |
| | | console.log(res) |
| | | let data = res.data.data |
| | | |
| | | if(res.data.code === 200){ |
| | |
| | | matName:that.matName, |
| | | count:that.count |
| | | } |
| | | that.addTbaleData(data) |
| | | that.addTableData(data) |
| | | |
| | | }, |
| | | // 添加表格数据 |
| | | addTbaleData(data){ |
| | | console.log(data.matName) |
| | | addTableData(data){ |
| | | if(data.matName===''){ |
| | | |
| | | this.messageToggle('error') |
| | | return |
| | | } |
| | | |
| | | this.$refs.popup.close() |
| | | console.log(this.matData.length) |
| | | for(var i=0;i<this.matData.length;i++){ |
| | | if(data.matNo === this.matData[i].matNo){ |
| | | this.matData[i].count = Number(this.matData[i].count) + Number(data.count); |