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); + }); + } + /** * 查询订单详情 *