sortName(sortObj){
// this.addOrderData.product_list.sort(this.compare(sortObj.prop, sortObj.order))
this.addOrderData.product_list.sort((a, b)=>{
if (sortObj.order == 'ascending') {
if (a["product_name"] === b["product_name"]) {
return a["lot"] > b["lot"] ? 1 : a["lot"] < b["lot"] ? -1 : 0;
} else {
return a["product_name"] > b["product_name"] ? 1 : -1;
}
}else {
if (a["product_name"] === b["product_name"]) {
return a["lot"] > b["lot"] ? 1 : a["lot"] < b["lot"] ? -1 : 0;
} else {
return a["product_name"] < b["product_name"] ? 1 : -1;
}
}
})
},