|
|
@ -3,7 +3,7 @@ import {NzMessageService, NzModalService} from 'ng-zorro-antd'; |
|
|
|
import {LocalStorageService} from '../../../../services/local-storage.service'; |
|
|
|
import {LocalStorageService} from '../../../../services/local-storage.service'; |
|
|
|
import {CommonsService} from '../../../../services/commons.service'; |
|
|
|
import {CommonsService} from '../../../../services/commons.service'; |
|
|
|
import {Router} from '@angular/router'; |
|
|
|
import {Router} from '@angular/router'; |
|
|
|
import {FormBuilder, FormGroup} from '@angular/forms'; |
|
|
|
import {FormBuilder, FormGroup, Validators} from '@angular/forms'; |
|
|
|
import {ADMIN_INFO_OBJECT} from '../../../../services/local-storage.namespace'; |
|
|
|
import {ADMIN_INFO_OBJECT} from '../../../../services/local-storage.namespace'; |
|
|
|
import {environment} from '../../../../../environments/environment'; |
|
|
|
import {environment} from '../../../../../environments/environment'; |
|
|
|
import {OrderManageService} from '../../../../services/order/order-manage.service'; |
|
|
|
import {OrderManageService} from '../../../../services/order/order-manage.service'; |
|
|
@ -40,9 +40,15 @@ export class OrderCouponListComponent implements OnInit { |
|
|
|
gasOrder: {}, |
|
|
|
gasOrder: {}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
refundModal = false; |
|
|
|
|
|
|
|
refundForm: FormGroup; |
|
|
|
|
|
|
|
refundRecordModal = false; |
|
|
|
|
|
|
|
|
|
|
|
couponSourceArray = []; |
|
|
|
couponSourceArray = []; |
|
|
|
companyArray = []; |
|
|
|
companyArray = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
REFUND_COUPON_BTN = false; |
|
|
|
|
|
|
|
|
|
|
|
constructor(private modal: NzModalService, |
|
|
|
constructor(private modal: NzModalService, |
|
|
|
private message: NzMessageService, |
|
|
|
private message: NzMessageService, |
|
|
|
private store: LocalStorageService, |
|
|
|
private store: LocalStorageService, |
|
|
@ -82,6 +88,12 @@ export class OrderCouponListComponent implements OnInit { |
|
|
|
createTime: [[createTimeS,createTimeE]], |
|
|
|
createTime: [[createTimeS,createTimeE]], |
|
|
|
payTime: [null], |
|
|
|
payTime: [null], |
|
|
|
finishTime: [null], |
|
|
|
finishTime: [null], |
|
|
|
|
|
|
|
exceptionStatus: [null], |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.refundForm = this.form.group({ |
|
|
|
|
|
|
|
orderNo: [{ value: null, disabled: true}, [Validators.required]], |
|
|
|
|
|
|
|
remarks: [null], |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.companyService.selectCompanyList({pageNum: 1, pageSize: 100}, data => { |
|
|
|
this.companyService.selectCompanyList({pageNum: 1, pageSize: 100}, data => { |
|
|
@ -91,6 +103,8 @@ export class OrderCouponListComponent implements OnInit { |
|
|
|
this.couponSourceArray = data['return_data']; |
|
|
|
this.couponSourceArray = data['return_data']; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.REFUND_COUPON_BTN = this.commonsService.isBtnCompetence("BTN_REFUND_COUPON_BTN"); |
|
|
|
|
|
|
|
|
|
|
|
this.requestData(1); |
|
|
|
this.requestData(1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -104,6 +118,11 @@ export class OrderCouponListComponent implements OnInit { |
|
|
|
this.orderCouponService.getOrderList(this.whereObject, data => { |
|
|
|
this.orderCouponService.getOrderList(this.whereObject, data => { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
this.dataObject = data['return_data']; |
|
|
|
this.dataObject = data['return_data']; |
|
|
|
|
|
|
|
for (let data of this.dataObject['list']) { |
|
|
|
|
|
|
|
if (data['exceptionStatus'] !== '正常') { |
|
|
|
|
|
|
|
data['color'] = 'red'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.modal.error(data['return_msg']); |
|
|
|
this.modal.error(data['return_msg']); |
|
|
|
} |
|
|
|
} |
|
|
@ -207,4 +226,70 @@ export class OrderCouponListComponent implements OnInit { |
|
|
|
this.pageSize = pageSize; |
|
|
|
this.pageSize = pageSize; |
|
|
|
this.requestData(1) |
|
|
|
this.requestData(1) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 打开退款模态框 |
|
|
|
|
|
|
|
* @param orderNo |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
showRefund(orderNo: string) { |
|
|
|
|
|
|
|
this.refundForm.patchValue({ orderNo: orderNo}) |
|
|
|
|
|
|
|
this.refundModal = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 提交退款确认框 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
submitRefundConfirm() { |
|
|
|
|
|
|
|
for (const i in this.refundForm.controls) { |
|
|
|
|
|
|
|
this.refundForm.controls[i].markAsDirty(); |
|
|
|
|
|
|
|
this.refundForm.controls[i].updateValueAndValidity(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (this.refundForm.status == null || this.refundForm.status !== 'VALID') { |
|
|
|
|
|
|
|
this.modal.warning({ |
|
|
|
|
|
|
|
nzTitle: '提示', |
|
|
|
|
|
|
|
nzContent: '请填写所有必填项', |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.modal.confirm({ |
|
|
|
|
|
|
|
nzTitle: '提示', |
|
|
|
|
|
|
|
nzContent: '确定对交易订号('+this.refundForm.controls.orderNo.value+')进行退款吗?', |
|
|
|
|
|
|
|
nzOnOk: () => this.submitRefund() |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 提交退款 |
|
|
|
|
|
|
|
* @param orderNo |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
submitRefund() { |
|
|
|
|
|
|
|
this.loadingObject.spinning = true; |
|
|
|
|
|
|
|
this.loadingObject.msg = '处理中...'; |
|
|
|
|
|
|
|
this.orderManageService.refundOrder(this.refundForm.controls.orderNo.value,this.refundForm.controls.remarks.value, data => { |
|
|
|
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
|
|
|
this.modal.success({ |
|
|
|
|
|
|
|
nzTitle: '提示', |
|
|
|
|
|
|
|
nzContent: '操作成功', |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.requestData(this.whereObject.pageNum); |
|
|
|
|
|
|
|
this.closeRefund(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.modal.error({ |
|
|
|
|
|
|
|
nzTitle: '提示', |
|
|
|
|
|
|
|
nzContent: data['return_msg'], |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.loadingObject.spinning = false; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.refundModal = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 关闭退款模态框 |
|
|
|
|
|
|
|
* @param orderNo |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
closeRefund() { |
|
|
|
|
|
|
|
this.refundModal = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|