lrf 2 年之前
父节点
当前提交
bed3a4002b
共有 1 个文件被更改,包括 6 次插入3 次删除
  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') {
         // 拒收: 退钱, 退货