+
共计 {{dataObject.total?dataObject.total:0}} 条数据
-
-
共计 {{dataObject.total?dataObject.total:0}} 条数据
+
+
+
-
-
+
+
+
+
+ 优惠券编码 |
+ 优惠券名称 |
+ 优惠券类型 |
+ 优惠券金额 |
+ 优惠券 |
+ 客户电话 |
+ 领取时间 |
+ 过期时间 |
+ 使用时间 |
+ 交易订单号 |
+ 交易金额 |
+ 交易优惠 |
+ 交易实付 |
+
+
+
+
+
+ {{data.discountAgentCodeId}} |
+ {{data.discountName}} |
+ {{data.discountType}} |
+ {{data.discountPrice}} |
+ {{data.discountUseStatus}} |
+ {{data.userPhone}} |
+ {{data.receiveTime | date:'yyyy-MM-dd HH:mm:ss'}} |
+ {{data.useEndTime | date:'yyyy-MM-dd HH:mm:ss'}} |
+ {{data.useTime | date:'yyyy-MM-dd HH:mm:ss'}} |
+ {{data.orderNo}} |
+ {{data.orderTotalPrice}} |
+ {{data.orderDiscountPrice}} |
+ {{data.orderPayPrice}} |
+
+
+
+
-
-
-
-
-
- 优惠券编码 |
- 优惠券名称 |
- 优惠券状态 |
- 领取时间 |
- 领取人 |
- 领取手机号 |
- 使用时间 |
- 使用门店 |
-
-
-
-
-
- {{data.id}} |
- {{data.discountName}} |
- {{data.status | discountCodeStatus}} |
- {{data.receiveTime | date : 'yyyy-MM-dd HH:mm:ss'}} |
- {{data.userName}} |
- {{data.userPhone}} |
- {{data.useTime | date : 'yyyy-MM-dd HH:mm:ss'}} |
- {{data.storeName}} |
-
-
-
-
-
+
diff --git a/src/app/admin/order-manage/discount-use-condition-list/discount-use-condition-list.component.ts b/src/app/admin/order-manage/discount-use-condition-list/discount-use-condition-list.component.ts
index f2de52d..5222707 100644
--- a/src/app/admin/order-manage/discount-use-condition-list/discount-use-condition-list.component.ts
+++ b/src/app/admin/order-manage/discount-use-condition-list/discount-use-condition-list.component.ts
@@ -10,6 +10,7 @@ import {NzMessageService} from 'ng-zorro-antd';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {NzModalService} from "ng-zorro-antd";
import {AgentService} from "../../../services/agent.service";
+import {ActivatedRoute} from '@angular/router';
@Component({
selector: 'app-discount-use-condition-list',
@@ -18,32 +19,45 @@ import {AgentService} from "../../../services/agent.service";
})
export class DiscountUseConditionListComponent implements OnInit {
-
+ FILE_URL = environment.imageUrl;
dataObject: any = {};
tableLoading = true;
searchForm: FormGroup;
pageNum: number;
whereObject: any = {};
-
discountArray = [];
+ loadingObject = {
+ title: "加载中...",
+ status: false,
+ };
+ agentId = this.store.get(ADMIN_INFO_OBJECT)['highAgent']!=null?this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id: null;
constructor(private modal: NzModalService,
private message: NzMessageService,
private agentService: AgentService,
private discountService: DiscountService,
private store: LocalStorageService,
+ private activatedRoute: ActivatedRoute,
private form: FormBuilder) { }
ngOnInit(): void {
this.searchForm = this.form.group({
+ agentId: [null],
discountId: [null],
status: [null],
- storeName: [null],
+ userPhone: [null],
receiveTime: [[]],
useTime: [[]],
idS: [null],
idE: [null],
});
+
+ this.activatedRoute.queryParams.subscribe(queryParams => {
+ if (queryParams.agentId != null) {
+ this.agentId = queryParams.agentId;
+ }
+ });
+
this.requestAgentDiscount();
this.requestData(1);
}
@@ -53,6 +67,7 @@ export class DiscountUseConditionListComponent implements OnInit {
*/
requestData(pageNum) {
this.tableLoading = true;
+ this.whereObject['agentId'] = this.agentId;
this.whereObject['pageNum'] = pageNum;
this.whereObject['pageSize'] = 10;
this.discountService.getDiscountUseConditionList(this.whereObject, data => {
@@ -66,7 +81,7 @@ export class DiscountUseConditionListComponent implements OnInit {
*/
requestAgentDiscount() {
const param = {
- agentId: this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id,
+ agentId: this.agentId,
pageNum: 1,
pageSize: 9999,
};
@@ -110,4 +125,20 @@ export class DiscountUseConditionListComponent implements OnInit {
this.searchForm.reset();
}
+ /**
+ * 导出使用情况
+ */
+ exportDiscountUseCondition() {
+ this.loadingObject.status = true;
+ this.loadingObject.title = '导出中...';
+ this.discountService.exportDiscountUseCondition(this.whereObject, data => {
+ if (data['return_code'] === '000000') {
+ window.location.href = this.FILE_URL + data['return_data'];
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ this.loadingObject.status = false;
+ });
+ }
+
}
diff --git a/src/app/services/discount.service.ts b/src/app/services/discount.service.ts
index ad54f81..dd5e92b 100644
--- a/src/app/services/discount.service.ts
+++ b/src/app/services/discount.service.ts
@@ -117,6 +117,18 @@ export class DiscountService {
});
}
+ /**
+ * 代理商查询优惠券使用情况
+ *
+ * @param id 用户id
+ * @param callBack 返回参数
+ */
+ public exportDiscountUseCondition(param: object, callBack) {
+ this.http.get(environment.baseUrl + 'discountAgentRel/exportDiscountUseCondition?' + this.common.getWhereCondition(param)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
/**
* 删除
*