From 7e77d7d84c7c796008e299b3f03973cd18830e53 Mon Sep 17 00:00:00 2001
From: hurui <177768073@qq.com>
Date: Mon, 13 Dec 2021 12:56:39 +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
---
...discount-use-condition-list.component.html | 137 ++++++++++++++++++
...discount-use-condition-list.component.scss | 0
...count-use-condition-list.component.spec.ts | 25 ++++
.../discount-use-condition-list.component.ts | 113 +++++++++++++++
.../order-coupons.component.html | 5 +-
src/app/admin/order/order-routing.module.ts | 4 +-
src/app/admin/order/order.module.ts | 27 ++--
src/app/pipes/discount-code-status.pipe.ts | 2 +
src/app/services/discount.service.ts | 12 ++
9 files changed, 310 insertions(+), 15 deletions(-)
create mode 100644 src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.html
create mode 100644 src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.scss
create mode 100644 src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.spec.ts
create mode 100644 src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.ts
diff --git a/src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.html b/src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.html
new file mode 100644
index 0000000..f52c6e7
--- /dev/null
+++ b/src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.html
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+
+
共计 {{dataObject.total?dataObject.total:0}} 条数据
+
+
+
+
+
+
+
+
+
+ 优惠券编码 |
+ 优惠券名称 |
+ 优惠券状态 |
+ 领取时间 |
+ 领取人 |
+ 领取手机号 |
+ 使用时间 |
+ 使用门店 |
+
+
+
+
+
+ {{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/discount-use-condition-list/discount-use-condition-list.component.scss b/src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.spec.ts b/src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.spec.ts
new file mode 100644
index 0000000..1ba441f
--- /dev/null
+++ b/src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { DiscountUseConditionListComponent } from './discount-use-condition-list.component';
+
+describe('DiscountUseConditionListComponent', () => {
+ let component: DiscountUseConditionListComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ DiscountUseConditionListComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(DiscountUseConditionListComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.ts b/src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.ts
new file mode 100644
index 0000000..03bcdc4
--- /dev/null
+++ b/src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.ts
@@ -0,0 +1,113 @@
+import { Component, OnInit } from '@angular/core';
+import {environment} from '../../../../environments/environment';
+import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms';
+import {RechargeService} from '../../../services/recharge.service';
+import {DiscountService} from '../../../services/discount.service';
+import {CouponService} from '../../../services/coupon.service';
+import {LocalStorageService} from '../../../services/local-storage.service';
+import {IconService} from '../../../services/icon.service';
+import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
+import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
+import {NzModalService} from "ng-zorro-antd";
+import {AgentService} from "../../../services/agent.service";
+
+@Component({
+ selector: 'app-discount-use-condition-list',
+ templateUrl: './discount-use-condition-list.component.html',
+ styleUrls: ['./discount-use-condition-list.component.scss']
+})
+export class DiscountUseConditionListComponent implements OnInit {
+
+
+ dataObject: any = {};
+ tableLoading = true;
+ searchForm: FormGroup;
+ pageNum: number;
+ whereObject: any = {};
+
+ discountArray = [];
+
+ constructor(private modal: NzModalService,
+ private message: NzMessageService,
+ private agentService: AgentService,
+ private discountService: DiscountService,
+ private store: LocalStorageService,
+ private form: FormBuilder) { }
+
+ ngOnInit(): void {
+ this.searchForm = this.form.group({
+ discountId: [null],
+ status: [null],
+ storeName: [null],
+ receiveTime: [[]],
+ useTime: [[]],
+ idS: [null],
+ idE: [null],
+ });
+ this.requestAgentDiscount();
+ this.requestData(1);
+ }
+
+ /**
+ * 请求数据
+ */
+ requestData(pageNum) {
+ this.tableLoading = true;
+ this.whereObject['pageNum'] = pageNum;
+ this.whereObject['pageSize'] = 10;
+ this.discountService.getDiscountUseConditionList(this.whereObject, data => {
+ this.dataObject = data['return_data'];
+ this.tableLoading = false;
+ });
+ }
+
+ /**
+ * 查询代理商优惠券数据
+ */
+ requestAgentDiscount() {
+ const param = {
+ agentId: this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id,
+ pageNum: 1,
+ pageSize: 9999,
+ };
+ this.agentService.getDiscountAgentList(param, data => {
+ if (data['return_code'] === '000000') {
+ this.discountArray = data['return_data'].list;
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ }
+
+ /**
+ * 搜索
+ * @param whereObject
+ */
+ search(whereObject: object) {
+ if (whereObject['receiveTime'] != null && whereObject['receiveTime'].length > 0) {
+ whereObject['receiveTimeS'] = new Date(whereObject['receiveTime'][0]).getTime();
+ whereObject['receiveTimeE'] = new Date(whereObject['receiveTime'][1]).getTime();
+ } else {
+ whereObject['receiveTimeS'] = null;
+ whereObject['receiveTimeE'] = null;
+ }
+
+ if (whereObject['useTime'] != null && whereObject['useTime'].length > 0) {
+ whereObject['useTimeS'] = new Date(whereObject['useTime'][0]).getTime();
+ whereObject['useTimeE'] = new Date(whereObject['useTime'][1]).getTime();
+ } else {
+ whereObject['useTimeS'] = null;
+ whereObject['useTimeE'] = null;
+ }
+ this.whereObject = whereObject;
+ this.requestData(1);
+ }
+
+ /**
+ * 重置
+ */
+ resetForm(): void {
+ this.searchForm.reset();
+ }
+
+}
diff --git a/src/app/admin/order/order-coupons/order-coupons.component.html b/src/app/admin/order/order-coupons/order-coupons.component.html
index e26dc6a..b4c8439 100644
--- a/src/app/admin/order/order-coupons/order-coupons.component.html
+++ b/src/app/admin/order/order-coupons/order-coupons.component.html
@@ -20,8 +20,8 @@
编号 |
- 优惠券KEY |
- 优惠券名称 |
+ 优惠券KEY |
+ 优惠券名称 |
优惠券类型 |
优惠内容 |
有效天数 |
@@ -72,6 +72,7 @@
+
diff --git a/src/app/admin/order/order-routing.module.ts b/src/app/admin/order/order-routing.module.ts
index 146f7c0..f894dc4 100644
--- a/src/app/admin/order/order-routing.module.ts
+++ b/src/app/admin/order/order-routing.module.ts
@@ -10,7 +10,8 @@ import {OrderKListComponent} from './order-k-list/order-k-list.component';
import {OrderHListComponent} from './order-h-list/order-h-list.component';
import {OrderAgentComponent} from './order-agent/order-agent.component';
import {PreOrderComponent} from './pre-order/pre-order.component';
-import {PackageRecordListComponent} from "./package-record-list/package-record-list.component";
+import {PackageRecordListComponent} from './package-record-list/package-record-list.component';
+import {DiscountUseConditionListComponent} from './discount-use-condition-list/discount-use-condition-list.component';
const routes: Routes = [
@@ -25,6 +26,7 @@ const routes: Routes = [
{ path: 'order-agent', component: OrderAgentComponent },
{ path: 'pre-order', component: PreOrderComponent },
{ path: 'package-record-list', component: PackageRecordListComponent },
+ { path: 'discount-use-condition-list', component: DiscountUseConditionListComponent },
];
@NgModule({
diff --git a/src/app/admin/order/order.module.ts b/src/app/admin/order/order.module.ts
index b92ed5f..fa98261 100644
--- a/src/app/admin/order/order.module.ts
+++ b/src/app/admin/order/order.module.ts
@@ -19,20 +19,23 @@ import { OrderHListComponent } from './order-h-list/order-h-list.component';
import { OrderAgentComponent } from './order-agent/order-agent.component';
import { PreOrderComponent } from './pre-order/pre-order.component';
import { PackageRecordListComponent } from './package-record-list/package-record-list.component';
+import { DiscountUseConditionListComponent } from './discount-use-condition-list/discount-use-condition-list.component';
+import {NzSpaceModule} from "_ng-zorro-antd@9.3.0@ng-zorro-antd/space";
@NgModule({
- declarations: [OrderListComponent, OrderDetailComponent, OrderCouponsComponent, OrderCouponComponent , OrderTListComponent, OrderKListComponent , OrderCListComponent, OrderHListComponent, OrderAgentComponent, PreOrderComponent, PackageRecordListComponent],
- imports: [
- CommonModule,
- OrderRoutingModule,
- NgZorroAntdModule,
- SeparateModule,
- ReactiveFormsModule,
- FormsModule,
- BreadcrumbModule,
- RegionSelectorModule,
- AppCommonModule
- ]
+ declarations: [OrderListComponent, OrderDetailComponent, OrderCouponsComponent, OrderCouponComponent , OrderTListComponent, OrderKListComponent , OrderCListComponent, OrderHListComponent, OrderAgentComponent, PreOrderComponent, PackageRecordListComponent, DiscountUseConditionListComponent],
+ imports: [
+ CommonModule,
+ OrderRoutingModule,
+ NgZorroAntdModule,
+ SeparateModule,
+ ReactiveFormsModule,
+ FormsModule,
+ BreadcrumbModule,
+ RegionSelectorModule,
+ AppCommonModule,
+ NzSpaceModule
+ ]
})
export class OrderModule { }
diff --git a/src/app/pipes/discount-code-status.pipe.ts b/src/app/pipes/discount-code-status.pipe.ts
index 2fc1341..ac390ef 100644
--- a/src/app/pipes/discount-code-status.pipe.ts
+++ b/src/app/pipes/discount-code-status.pipe.ts
@@ -15,6 +15,8 @@ export class DiscountCodeStatusPipe implements PipeTransform {
return '已使用';
case 4:
return '已过期';
+ case 5:
+ return '已分配';
}
}
diff --git a/src/app/services/discount.service.ts b/src/app/services/discount.service.ts
index 98ef801..ad54f81 100644
--- a/src/app/services/discount.service.ts
+++ b/src/app/services/discount.service.ts
@@ -105,6 +105,18 @@ export class DiscountService {
});
}
+ /**
+ * 代理商查询优惠券使用情况
+ *
+ * @param id 用户id
+ * @param callBack 返回参数
+ */
+ public getDiscountUseConditionList(param: object, callBack) {
+ this.http.get(environment.baseUrl + 'discountAgentRel/getDiscountUseConditionList?' + this.common.getWhereCondition(param)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
/**
* 删除
*