|
@@ -160,13 +160,14 @@ class OrderService extends CrudService {
|
|
|
* 发货,添加记录及修改状态
|
|
|
* @param {Array} goods 发货的货物列表
|
|
|
* @param {String} no 运输单号
|
|
|
+ * @param {String} time 发货日期
|
|
|
*/
|
|
|
- async sendGoods(goods, no) {
|
|
|
+ async sendGoods(goods, no, time) {
|
|
|
for (const g of goods) {
|
|
|
const { split_id, name, number, weight, volume } = g;
|
|
|
const order = await this.model.findOne({ 'split._id': ObjectId(split_id) });
|
|
|
if (!order) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, `未找到该${name}所在的订单信息`);
|
|
|
- const obj = { split_id, name, number, weight, volume, no };
|
|
|
+ const obj = { split_id, name, number, weight, volume, no, time };
|
|
|
// 添加该货物的发货记录
|
|
|
order.send_time.push(obj);
|
|
|
// 修改该货物的状态
|