1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| let obj = {}; let temp = row.Details.reduce((pre, cur) => { if (!obj[cur.WareCode]) { obj[cur.WareCode] = true; return [ ...pre, { WareCode: cur.WareCode, SupplierName: cur.SupplierName, OrderIds: [], PickerId: "", }, ]; } else { return pre; } }, []); temp.map((item, index) => { row.Details.map((item1,index1)=>{ if (item.WareCode==item1.WareCode) { temp[index].OrderIds.push(item1.OrderId) } }) }); classified.data=temp
|