处理暂停日期
This commit is contained in:
@ -166,14 +166,13 @@ export default {
|
||||
fetchOrderList() {
|
||||
this.loading = true;
|
||||
listOrder({ cusId: this.data.id }).then((res) => {
|
||||
this.orderList = res.rows.reduce((arr, cur) => {
|
||||
this.orderList = res.rows.reduce((arr, cur, idx) => {
|
||||
const tarOrder = arr.find((ord) => ord.startTime === cur.startTime);
|
||||
if (tarOrder) {
|
||||
if (!tarOrder.children) {
|
||||
const firstObj = JSON.parse(JSON.stringify(tarOrder));
|
||||
tarOrder.children = [{ ...firstObj, type: "main" }];
|
||||
}
|
||||
tarOrder.amount += cur.afterSaleCommissOrder == 0 ? cur.amount : 0;
|
||||
tarOrder.orderId += cur.orderId;
|
||||
tarOrder.type = "virtual";
|
||||
tarOrder.children.push({ ...cur, type: "main" });
|
||||
@ -181,6 +180,13 @@ export default {
|
||||
cur.type = "main";
|
||||
arr.push(cur);
|
||||
}
|
||||
if (idx === res.rows.length - 1 && arr.children) {
|
||||
arr.forEach((obj) => {
|
||||
obj.amount = arr.children.reduce((a, c) => {
|
||||
return a + c.afterSaleCommissOrder === 0 ? c.amount : 0;
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
return arr;
|
||||
}, []);
|
||||
// console.log(this.orderList);
|
||||
|
Reference in New Issue
Block a user