修复虚拟订单逻辑

This commit is contained in:
huangdeliang 2021-02-03 18:55:52 +08:00
parent 8effa650d8
commit d3c93b0aef
2 changed files with 6 additions and 6 deletions

View File

@ -130,14 +130,14 @@ export default {
this.orderList = res.rows.reduce((arr, cur) => { this.orderList = res.rows.reduce((arr, cur) => {
const tarOrder = arr.find((ord) => ord.startTime === cur.startTime); const tarOrder = arr.find((ord) => ord.startTime === cur.startTime);
if (tarOrder) { if (tarOrder) {
const firstObj = JSON.parse(JSON.stringify(tarOrder)); if (!tarOrder.children) {
tarOrder.children = [ const firstObj = JSON.parse(JSON.stringify(tarOrder));
{ ...firstObj, orderType: "main" }, tarOrder.children = [{ ...firstObj, orderType: "main" }];
{ ...cur, orderType: "main" }, }
];
tarOrder.amount += cur.amount; tarOrder.amount += cur.amount;
tarOrder.orderId += cur.orderId; tarOrder.orderId += cur.orderId;
tarOrder.orderType = "virtual"; tarOrder.orderType = "virtual";
tarOrder.children.push({ ...cur, orderType: "main" });
} else { } else {
cur.orderType = "main"; cur.orderType = "main";
arr.push(cur); arr.push(cur);

View File

@ -111,7 +111,7 @@
label="创建时间" label="创建时间"
align="center" align="center"
prop="createTime" prop="createTime"
width="160" width="166"
/> />
<el-table-column <el-table-column
label="进粉时间" label="进粉时间"