lrf 2 năm trước cách đây
mục cha
commit
bed3a4002b
1 tập tin đã thay đổi với 6 bổ sung3 xóa
  1. 6 3
      app/service/trade/afterSale.js

+ 6 - 3
app/service/trade/afterSale.js

@@ -76,6 +76,7 @@ class AfterSaleService extends CrudService {
       let refundInfo;
       // 要修改成的状态
       const uStatus = _.get(update, 'status');
+      console.log(type);
       // 根据类型不同,处理的函数不一样.
       if (type === '1') {
         // 仅退款,退优惠券,退款
@@ -116,11 +117,13 @@ class AfterSaleService extends CrudService {
           update.status = '-3';
           update.end_time = moment().format('YYYY-MM-DD HH:mm:ss');
         }
-      } else if (type === '4' && uStatus === '4') {
+      } else if (type === '4') {
         // 取消订单: 退钱,退货(退库存)----不过不需要有快递信息,没发货,退优惠券
         // 没有商品,只有拆分的订单号,用这个去退
-        refundInfo = await this.returnOrder(entity, this.tran);
-        update.status = '-4';
+        if (uStatus === '4') {
+          refundInfo = await this.returnOrder(entity, this.tran);
+          update.status = '-4';
+        }
         update.end_time = moment().format('YYYY-MM-DD HH:mm:ss');
       } else if (type === '5') {
         // 拒收: 退钱, 退货