| | |
| | | console.log(this.filterList,'fis') |
| | | this.totalLength = this.filterList.reduce((x, y) => x + y.carNum,0); |
| | | this.totalTon = this.filterList.reduce((x, y) => new BigNumber(x).plus( y.weight),0).toFixed(2); |
| | | this.tmNum = this.filterList.reduce((x, y) => x + y.number,0); |
| | | this.tmNum = this.filterList.reduce((x, y) =>new BigNumber(x).plus(new BigNumber(y.number)),0); |
| | | let coalTemp,customerTemp,bunnkerTemp = []; |
| | | coalTemp = res.data.map(item=>item.tmTaskCoalList.map(val=>{ |
| | | return { |
| | |
| | | customerName: this.customerList.filter(v => v.active == true).map(item => item.name), |
| | | bunkerName:this.bunnkerList.filter(v => v.active == true).map(item => item.name), |
| | | }; |
| | | console.log(this.coalList,this.bunnkerList,this.customerList,'list') |
| | | |
| | | const mapping = { |
| | | productName: validateFn('productName'), |
| | |
| | | return item; |
| | | }) |
| | | console.log(tempArr,'temp') |
| | | this.totalLength = tempArr.reduce((x, y) => x + y.carNum,0); |
| | | this.totalTon = tempArr.reduce((x, y) => new BigNumber(x).plus( y.weight),0).toFixed(2); |
| | | this.tmNum = tempArr.reduce((x, y) => x + y.number,0); |
| | | // this.totalLength = tempArr.reduce((x, y) => x + y.carNum,0); |
| | | // this.totalTon = tempArr.reduce((x, y) => new BigNumber(x).plus( y.weight),0).toFixed(2); |
| | | // this.tmNum = tempArr.reduce((x, y) => x + y.number,0); |
| | | |
| | | // this.totalTon = this.filterList.map(v => |
| | | // v.taskCoalList.reduce((prev, cur) => { |
| | |
| | | // return cleanvalue + prev |
| | | // }, 0) |
| | | // ); |
| | | this.totalLength = this.filterList.map(v => v.tmTaskCoalList.length).reduce((x, y) => x + y); // 车数 |
| | | const tonList = this.filterList.map(item=>item.tmTaskCoalList.filter(item=>item.isWeight === 1)).flat(1); |
| | | const tmNumList = this.filterList.map(item=>item.tmTaskCoalList.filter(item=>item.isWeight !== 1)).flat(1); |
| | | this.totalTon = tonList.reduce((x,y)=>new BigNumber(x).plus(new BigNumber(y.clean)).toFixed(2),0) |
| | | this.tmNum = tmNumList.reduce((x,y)=>new BigNumber(x).plus(new BigNumber(y.productQuantity)),0) |
| | | console.log(this.filterList,this.totalTon,'totalTon') |
| | | // this.totalTon = this.filterList.map(item=>) |
| | | // this.totalTon = this.filterList.map(v=>v.tmTaskCoalList.filter(item=>item.isWeight === 1).reduce((x,y)=>x.weight + y.weight)); |
| | | |
| | |
| | | return uni.getStorageSync('userId') |
| | | }, |
| | | bunkerIds(){ |
| | | return uni.getStorageSync('bunkerIds') |
| | | return Array.from(new Set(uni.getStorageSync('bunkerIds').split(',') || [])).join(",") |
| | | }, |
| | | // totalLength(){ |
| | | // console.log(this.filterList,'filterList') |