if(_.startsWith(`${element.Description}`,`VESTIDO DISNEY DTR, CH, AZUL MARINO WKM`)){
element["Quantity per container"]=itemList[0].j
}
//M尺码的数量
elseif(_.startsWith(`${element.Description}`,`VESTIDO DISNEY DTR, M, AZUL MARINO WKM`)){
element["Quantity per container"]=itemList[0].k
}
//G尺码的数量
elseif(_.startsWith(`${element.Description}`,`VESTIDO DISNEY DTR, G, AZUL MARINO WKM`)){
element["Quantity per container"]=itemList[0].l
}
//EG尺码的数量
elseif(_.startsWith(`${element.Description}`,`VESTIDO DISNEY DTR, EG, AZUL MARINO WKM`)){
element["Quantity per container"]=itemList[0].m
}
}elseif(itemList.length>1){
//j:"CH"k:"M"l:"G"m:"EG"
//CH
if(_.startsWith(`${element.Description}`,`VESTIDO DISNEY DTR, CH, AZUL MARINO WKM`)){
letallCHData=_.filter(itemList,v=>Number(v.j))
letcontainerList=_.filter(sheetData,v=>v.Store===element.Store&&Number(v["Quantity per container"])&&_.startsWith(`${v.Description}`,`VESTIDO DISNEY DTR, CH, AZUL MARINO WKM`))
letisHas=!!(containerList.length)
if(!isHas){
element["Barcode"]=allCHData[0].h
//箱数为所有的箱数之和
element["Quantity of containers"]=_.sumBy(allCHData,o=>Number(o.f))
//CH尺码的数量
element["Quantity per container"]=allCHData[0].j
//todo需要判断是否已经存在
}
else{
letiteml=allCHData[containerList.length]
element["Barcode"]=iteml.h
//CH尺码的数量
element["Quantity per container"]=iteml.j
}
}
//M
elseif(_.startsWith(`${element.Description}`,`VESTIDO DISNEY DTR, M, AZUL MARINO WKM`)){
letallCHData=_.filter(itemList,v=>Number(v.k))
letcontainerList=_.filter(sheetData,v=>v.Store===element.Store&&Number(v["Quantity per container"])&&_.startsWith(`${v.Description}`,`VESTIDO DISNEY DTR, M, AZUL MARINO WKM`))
letisHas=!!(containerList.length)
if(!isHas){
element["Barcode"]=allCHData[0].h
//箱数为所有的箱数之和
element["Quantity of containers"]=_.sumBy(allCHData,o=>Number(o.f))
//M尺码的数量
element["Quantity per container"]=allCHData[0].k
}
else{
letiteml=allCHData[containerList.length]
element["Barcode"]=iteml.h
//M尺码的数量
element["Quantity per container"]=iteml.k
}
}
//G
elseif(_.startsWith(`${element.Description}`,`VESTIDO DISNEY DTR, G, AZUL MARINO WKM`)){
letallCHData=_.filter(itemList,v=>Number(v.l))
letcontainerList=_.filter(sheetData,v=>v.Store===element.Store&&Number(v["Quantity per container"])&&_.startsWith(`${v.Description}`,`VESTIDO DISNEY DTR, G, AZUL MARINO WKM`))
letisHas=!!(containerList.length)
if(!isHas){
element["Barcode"]=allCHData[0].h
//箱数为所有的箱数之和
element["Quantity of containers"]=_.sumBy(allCHData,o=>Number(o.f))
//G尺码的数量
element["Quantity per container"]=allCHData[0].l
}
else{
letiteml=allCHData[containerList.length]
element["Barcode"]=iteml.h
//G尺码的数量
element["Quantity per container"]=iteml.l
}
}
//EG
elseif(_.startsWith(`${element.Description}`,`VESTIDO DISNEY DTR, EG, AZUL MARINO WKM`)){
letallCHData=_.filter(itemList,v=>Number(v.m))
letcontainerList=_.filter(sheetData,v=>v.Store===element.Store&&Number(v["Quantity per container"])&&_.startsWith(`${v.Description}`,`VESTIDO DISNEY DTR, EG, AZUL MARINO WKM`))
letisHas=!!(containerList.length)
if(!isHas){
element["Barcode"]=allCHData[0].h
//箱数为所有的箱数之和
element["Quantity of containers"]=_.sumBy(allCHData,o=>Number(o.f))
letnewHeaders=["Order","Sku","Description","Type of merchandise","Quantity to deliver","Store","Quantity of containers","Barcode","Quantity per container","Total","Cluster","","","",""]
letlilstLocal=[]
letlilstLocal=[]
for(leti=0;i<listCopy.length;i++){
for(leti=0;i<listCopy.length;i++){
letitem=listCopy[i];
letitem=listCopy[i];
letlistItem={}
lilstLocal.push({...item,'Quantity to deliver':item["Quantity to deliver"].toFixed(3)})