|
@@ -66,7 +66,7 @@ class BillService extends CrudService {
|
|
|
from: 'orderDetail',
|
|
|
localField: 'orderDetail_id',
|
|
|
foreignField: '_id',
|
|
|
- pipeline: [{ $project: { no: 1 } }],
|
|
|
+ pipeline: [{ $project: { no: 1, _id: 1 } }],
|
|
|
as: 'orderDetailInfo',
|
|
|
},
|
|
|
});
|
|
@@ -79,6 +79,7 @@ class BillService extends CrudService {
|
|
|
spec: '$goods.name',
|
|
|
end_time: 1,
|
|
|
money: { $toString: '$money' },
|
|
|
+ rowKey: { $concat: [{ $toString: '$_id' }, '_', '$goods.goods._id', '_', '$goods._id', '_', '$apply_time' ] },
|
|
|
},
|
|
|
});
|
|
|
const afterSaleList = await this.afterSaleModel.aggregate(pipline);
|
|
@@ -110,7 +111,7 @@ class BillService extends CrudService {
|
|
|
freight: 1,
|
|
|
group_config: { money: 1 },
|
|
|
name: 1,
|
|
|
- goods: { name: 1 },
|
|
|
+ goods: { name: 1, _id: 1 },
|
|
|
},
|
|
|
};
|
|
|
pipline.push({ $project });
|
|
@@ -129,7 +130,7 @@ class BillService extends CrudService {
|
|
|
no: _.get(o, 'no'),
|
|
|
type: _.get(type, 'label'),
|
|
|
pay_time: _.get(o, 'pay_time'),
|
|
|
- goods_id: _.get(o, 'goods.goods._id'),
|
|
|
+ goods_id: _.get(o, 'goods._id'),
|
|
|
goods: _.get(o, 'goods.goods.name'),
|
|
|
spec: _.get(o, 'goods.name'),
|
|
|
spec_id: _.get(o, 'goods._id'),
|
|
@@ -137,6 +138,7 @@ class BillService extends CrudService {
|
|
|
price: o.type === '1' ? _.get(o, 'goods.group_config.money') : _.get(o, 'goods.sell_money'),
|
|
|
discount: _.get(moneyDetail, 'dt'),
|
|
|
total: o.type === '1' ? _.get(moneyDetail, 'ggrp') : _.get(moneyDetail, 'grp'),
|
|
|
+ rowKey: `${_.get(o, '_id')}_${_.get(o, 'goods.goods._id')}_${_.get(o, 'goods._id')}`,
|
|
|
};
|
|
|
list.push(obj);
|
|
|
}
|