From 26830a50994820f15ddacd15c045271186d08d1c Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Tue, 28 Mar 2023 18:05:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4diam?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agent-list/agent-list.component.html | 18 +- .../agent/agent-list/agent-list.component.ts | 1 + ...discount-use-condition-list.component.html | 261 +++++++++--------- .../discount-use-condition-list.component.ts | 39 ++- src/app/services/discount.service.ts | 12 + 5 files changed, 192 insertions(+), 139 deletions(-) diff --git a/src/app/admin/agent/agent-list/agent-list.component.html b/src/app/admin/agent/agent-list/agent-list.component.html index c908197..47bc361 100644 --- a/src/app/admin/agent/agent-list/agent-list.component.html +++ b/src/app/admin/agent/agent-list/agent-list.component.html @@ -112,6 +112,7 @@
  • 生成二维码
  • 绑定优惠券
  • 优惠券列表
  • +
  • 优惠券使用
  • 分发列表
  • {{data.status === 1 ? '禁用': '启用'}}
  • @@ -160,12 +161,11 @@ 优惠券KEY 优惠券名称 - 优惠券类型 - 优惠内容 - 有效天数 - 截止日期 - 库存数量 - 操作 + 优惠券类型 + 优惠金额 + 截止日期 + 库存数量 + 操作 @@ -175,16 +175,15 @@ {{data['highDiscount'].discountType | discountType}} - 满{{data['highDiscount'].discountCondition}}抵扣{{data['highDiscount'].discountPrice}} + 满{{data['highDiscount'].discountCondition}}减{{data['highDiscount'].discountPrice}} - 抵扣{{data['highDiscount'].discountPrice}} + {{data['highDiscount'].discountPrice}} {{data['highDiscount'].discountPrice}}折 - {{data['highDiscount'].effectiveDay}} {{data['highDiscount'].salesEndTime | date: 'yyyy-MM-dd HH:mm'}} {{data.stockCount}} @@ -232,7 +231,6 @@ - + +
    +
    +
    +
    + + 优惠券 + + + + + + +
    +
    + + 状态 + + + + + + + + + + +
    +
    + + 客户电话 + + + + +
    +
    + + 领取时间 + + + + +
    +
    + + 使用时间 + + + + +
    -
    - -
    -
    - - 优惠券 - - - - - - -
    -
    - - 状态 - - - - - - - - - - -
    -
    - - 使用门店 - - - - -
    -
    - - 领取时间 - - - - -
    -
    - - 使用时间 - - - - +
    + + 优惠券编码 + + + + + + + + + + + +
    -
    - - 编码范围 - - - - - - - - - - - +
    +
    + + +
    -
    + +
    -
    -
    - - -
    -
    - -
    +
    + 共计 {{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); + }); + } + /** * 删除 *