From e4928d5fc25f699960c93d5161dfc1acce87f77d Mon Sep 17 00:00:00 2001
From: hurui <177768073@qq.com>
Date: Fri, 21 Jul 2023 11:20:17 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../order-coupon-list.component.html | 1 +
.../order-coupon-list.component.ts | 39 +++++++++++++++++++
.../services/order/order-coupon.service.ts | 12 ++++++
3 files changed, 52 insertions(+)
diff --git a/src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.html b/src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.html
index 4036737..55e3795 100644
--- a/src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.html
+++ b/src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.html
@@ -240,6 +240,7 @@
diff --git a/src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.ts b/src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.ts
index 7a97800..058a81f 100644
--- a/src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.ts
+++ b/src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.ts
@@ -48,6 +48,7 @@ export class OrderCouponListComponent implements OnInit {
companyArray = [];
REFUND_COUPON_BTN = false;
+ REISSUE_COUPON_BTN = false;
GZ_SINOPEC_STATUS = false;
constructor(private modal: NzModalService,
private message: NzMessageService,
@@ -112,6 +113,7 @@ export class OrderCouponListComponent implements OnInit {
});
this.REFUND_COUPON_BTN = this.commonsService.isBtnCompetence("BTN_REFUND_COUPON_BTN");
+ this.REISSUE_COUPON_BTN = this.commonsService.isBtnCompetence("BTN_REISSUE_COUPON_BTN");
this.requestData(1);
}
@@ -244,6 +246,43 @@ export class OrderCouponListComponent implements OnInit {
this.refundModal = true;
}
+ /**
+ * 打开退款模态框
+ * @param orderNo
+ */
+ reissue(orderNo: string) {
+ this.modal.confirm({
+ nzTitle: '提示?',
+ nzContent: '确定是否补发卡券?',
+ nzOkText: '是',
+ nzOkType: 'danger',
+ nzOnOk: () => this.submitReissue(orderNo),
+ nzCancelText: '否',
+ });
+ }
+
+ submitReissue(orderNo: string) {
+ this.loadingObject.spinning = true;
+ this.loadingObject.msg = '处理中...';
+
+ this.orderCouponService.reissue(orderNo, data => {
+ this.loadingObject.spinning = false;
+
+ if (data['return_code'] === '000000') {
+ this.modal.success({
+ nzTitle: '提示',
+ nzContent: '操作成功',
+ });
+ } else {
+ this.modal.error({
+ nzTitle: '提示',
+ nzContent: data['return_msg'],
+ });
+ }
+ this.loadingObject.spinning = false;
+ });
+ }
+
/**
* 提交退款确认框
*/
diff --git a/src/app/services/order/order-coupon.service.ts b/src/app/services/order/order-coupon.service.ts
index 087486a..cf14489 100644
--- a/src/app/services/order/order-coupon.service.ts
+++ b/src/app/services/order/order-coupon.service.ts
@@ -25,6 +25,18 @@ export class OrderCouponService {
});
}
+ /**
+ * 补发
+ *
+ * @param orderNo 对象
+ * @param callBack 回调
+ */
+ public reissue(orderNo: string, callBack) {
+ this.http.get(environment.orderUrl + 'coupon/reissue?orderNo=' + orderNo).subscribe(data => {
+ callBack(data);
+ });
+ }
+
/**
* 查询订单详情
*