From fb4d55b06f787696c781e3585f9798cd24205b0e Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 19 Apr 2023 09:43:48 +0800 Subject: [PATCH 1/4] =?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 --- .../order-coupon-list/order-coupon-list.component.ts | 6 +++--- .../order-integral-recharge.component.ts | 6 +++--- .../order-oil/order-oil-list/order-oil-list.component.ts | 6 +++--- .../order-refund-list/order-refund-list.component.ts | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) 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 a673c0c..7a97800 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 @@ -143,7 +143,7 @@ export class OrderCouponListComponent implements OnInit { * @param whereObject 条件 */ search(whereObject: object) { - if (whereObject['createTime'] != null) { + if (whereObject['createTime'] != null && whereObject['createTime'].length > 0) { whereObject['createTimeS'] = new Date(whereObject['createTime'][0]).getTime(); whereObject['createTimeE'] = new Date(whereObject['createTime'][1]).getTime(); } else { @@ -151,7 +151,7 @@ export class OrderCouponListComponent implements OnInit { whereObject['createTimeE'] = null; } - if (whereObject['payTime'] != null) { + if (whereObject['payTime'] != null && whereObject['payTime'].length > 0) { whereObject['payTimeS'] = new Date(whereObject['payTime'][0]).getTime(); whereObject['payTimeE'] = new Date(whereObject['payTime'][1]).getTime(); } else { @@ -159,7 +159,7 @@ export class OrderCouponListComponent implements OnInit { whereObject['payTimeE'] = null; } - if (whereObject['finishTime'] != null) { + if (whereObject['finishTime'] != null && whereObject['finishTime'].length > 0) { whereObject['finishTimeS'] = whereObject['finishTime'][0].getTime(); whereObject['finishTimeE'] = whereObject['finishTime'][1].getTime(); } else { diff --git a/src/app/admin/order-manage/order-integral-recharge/order-integral-recharge.component.ts b/src/app/admin/order-manage/order-integral-recharge/order-integral-recharge.component.ts index 15e640c..4f2d638 100644 --- a/src/app/admin/order-manage/order-integral-recharge/order-integral-recharge.component.ts +++ b/src/app/admin/order-manage/order-integral-recharge/order-integral-recharge.component.ts @@ -100,7 +100,7 @@ export class OrderIntegralRechargeComponent implements OnInit { * @param whereObject 条件 */ search(whereObject: object) { - if (whereObject['createTime'] != null) { + if (whereObject['createTime'] != null && whereObject['createTime'].length > 0) { whereObject['createTimeS'] = new Date(whereObject['createTime'][0]).getTime(); whereObject['createTimeE'] = new Date(whereObject['createTime'][1]).getTime(); } else { @@ -108,7 +108,7 @@ export class OrderIntegralRechargeComponent implements OnInit { whereObject['createTimeE'] = null; } - if (whereObject['payTime'] != null) { + if (whereObject['payTime'] != null && whereObject['payTime'].length > 0) { whereObject['payTimeS'] = new Date(whereObject['payTime'][0]).getTime(); whereObject['payTimeE'] = new Date(whereObject['payTime'][1]).getTime(); } else { @@ -116,7 +116,7 @@ export class OrderIntegralRechargeComponent implements OnInit { whereObject['payTimeE'] = null; } - if (whereObject['finishTime'] != null) { + if (whereObject['finishTime'] != null && whereObject['finishTime'].length > 0) { whereObject['finishTimeS'] = new Date(whereObject['finishTime'][0]).getTime(); whereObject['finishTimeE'] = new Date(whereObject['finishTime'][1]).getTime(); } else { diff --git a/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.ts b/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.ts index 19ffbe5..f114ef9 100644 --- a/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.ts +++ b/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.ts @@ -271,7 +271,7 @@ export class OrderOilListComponent implements OnInit { * @param whereObject 条件 */ search(whereObject: object) { - if (whereObject['createTimeArray'] != null) { + if (whereObject['createTimeArray'] != null && whereObject['createTimeArray'].length > 0) { whereObject['createTimeS'] = new Date(whereObject['createTimeArray'][0]).getTime(); whereObject['createTimeE'] = new Date(whereObject['createTimeArray'][1]).getTime(); } else { @@ -279,7 +279,7 @@ export class OrderOilListComponent implements OnInit { whereObject['createTimeE'] = null; } - if (whereObject['payTimeArray'] != null) { + if (whereObject['payTimeArray'] != null && whereObject['payTimeArray'].length > 0) { whereObject['payTimeS'] = new Date(whereObject['payTimeArray'][0]).getTime(); whereObject['payTimeE'] = new Date(whereObject['payTimeArray'][1]).getTime(); } else { @@ -287,7 +287,7 @@ export class OrderOilListComponent implements OnInit { whereObject['payTimeE'] = null; } - if (whereObject['refundTimeArray'] != null) { + if (whereObject['refundTimeArray'] != null && whereObject['refundTimeArray'].length > 0) { whereObject['refundTimeS'] = new Date(whereObject['refundTimeArray'][0]).getTime(); whereObject['refundTimeE'] = new Date(whereObject['refundTimeArray'][1]).getTime(); } else { diff --git a/src/app/admin/order-manage/order-refund-list/order-refund-list.component.ts b/src/app/admin/order-manage/order-refund-list/order-refund-list.component.ts index f3bc154..50ee503 100644 --- a/src/app/admin/order-manage/order-refund-list/order-refund-list.component.ts +++ b/src/app/admin/order-manage/order-refund-list/order-refund-list.component.ts @@ -98,7 +98,7 @@ export class OrderRefundListComponent implements OnInit { * @param whereObject 条件 */ search(whereObject: object) { - if (whereObject['createTime'] != null) { + if (whereObject['createTime'] != null && whereObject['createTime'].length > 0) { whereObject['createTimeS'] = whereObject['createTime'][0].getTime(); whereObject['createTimeE'] = whereObject['createTime'][1].getTime(); } else { @@ -106,7 +106,7 @@ export class OrderRefundListComponent implements OnInit { whereObject['createTimeE'] = null; } - if (whereObject['refundTime'] != null) { + if (whereObject['refundTime'] != null && whereObject['refundTime'].length > 0) { whereObject['refundTimeS'] = whereObject['refundTime'][0].getTime(); whereObject['refundTimeE'] = whereObject['refundTime'][1].getTime(); } else { From 870745d33775a9d4943f7c9ed100de9b85dbf40c Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Fri, 7 Jul 2023 17:56:36 +0800 Subject: [PATCH 2/4] =?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 --- .../order-coupon-list/order-coupon-list.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 0b6d7f8..4036737 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 @@ -226,7 +226,7 @@ ¥{{data.deductionCouponPrice}} ¥{{data.deductionProductPrice}} ¥{{data.payablePrice}} - ¥{{data.payGold / 100}} + ¥{{data.payGold}} ¥{{data.payPrice}} {{data.payType}} {{data.memCardNo}} From ee6023348870ccd5eb936c27af33bc8a01565559 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Fri, 14 Jul 2023 14:56:39 +0800 Subject: [PATCH 3/4] =?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 --- .../goods-audit/goods-audit.component.ts | 4 +- .../freight/freight.component.ts | 4 +- src/app/admin/goods/goods.module.ts | 4 +- src/app/admin/goods/list/list.component.ts | 3 +- .../goods-child-order.component.ts | 4 +- .../goods-order/goods-order.component.ts | 6 +- .../mobile-recharge-order-list.component.ts | 3 +- .../coupon-use/coupon-use.component.html | 64 +++++++ .../coupon-use/coupon-use.component.scss | 0 .../coupon-use/coupon-use.component.spec.ts | 25 +++ .../coupon-use/coupon-use.component.ts | 167 ++++++++++++++++++ .../statistics/statistics-routing.module.ts | 14 ++ src/app/admin/statistics/statistics.module.ts | 26 +++ src/app/app-routing.module.ts | 5 + src/app/services/coupon.service.ts | 25 +++ src/app/services/goods/goods.service.ts | 2 +- src/environments/environment.ts | 4 +- 17 files changed, 342 insertions(+), 18 deletions(-) create mode 100644 src/app/admin/statistics/coupon-use/coupon-use.component.html create mode 100644 src/app/admin/statistics/coupon-use/coupon-use.component.scss create mode 100644 src/app/admin/statistics/coupon-use/coupon-use.component.spec.ts create mode 100644 src/app/admin/statistics/coupon-use/coupon-use.component.ts create mode 100644 src/app/admin/statistics/statistics-routing.module.ts create mode 100644 src/app/admin/statistics/statistics.module.ts diff --git a/src/app/admin/audit/goods-audit/goods-audit.component.ts b/src/app/admin/audit/goods-audit/goods-audit.component.ts index d2abdfd..a506a9f 100644 --- a/src/app/admin/audit/goods-audit/goods-audit.component.ts +++ b/src/app/admin/audit/goods-audit/goods-audit.component.ts @@ -1,9 +1,9 @@ import { Component, OnInit } from '@angular/core'; -import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; import {AuditService} from '../../../services/audit.service'; import {IconService} from '../../../services/icon.service'; -import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; import {CommonsService} from '../../../services/commons.service'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {NzMessageService} from 'ng-zorro-antd'; @Component({ selector: 'app-goods-audit', diff --git a/src/app/admin/config-manage/freight/freight.component.ts b/src/app/admin/config-manage/freight/freight.component.ts index ca321ca..0970046 100644 --- a/src/app/admin/config-manage/freight/freight.component.ts +++ b/src/app/admin/config-manage/freight/freight.component.ts @@ -1,9 +1,9 @@ import { Component, OnInit } from '@angular/core'; -import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms'; import {environment} from '../../../../environments/environment'; -import {NzModalService, NzNotificationService, NzUploadFile} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; import {CommonsService} from '../../../services/commons.service'; import {GoodsService} from '../../../services/goods/goods.service'; +import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {NzModalService, NzNotificationService} from 'ng-zorro-antd'; @Component({ selector: 'app-freight', diff --git a/src/app/admin/goods/goods.module.ts b/src/app/admin/goods/goods.module.ts index f011a5e..50d50fb 100644 --- a/src/app/admin/goods/goods.module.ts +++ b/src/app/admin/goods/goods.module.ts @@ -3,13 +3,13 @@ import { CommonModule } from '@angular/common'; import { GoodsRoutingModule } from './goods-routing.module'; import { ListComponent } from './list/list.component'; -import {NgZorroAntdModule} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; import {SeparateModule} from '../../common/separate/separate.module'; -import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/forms'; import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; import {RegionSelectorModule} from '../../common/region-selector/region-selector.module'; import {AppCommonModule} from '../../app-common.module'; import {PreviewImageModule} from '../../common/preview-image/preview-image.module'; +import {NgZorroAntdModule} from 'ng-zorro-antd'; +import {FormsModule, ReactiveFormsModule} from '@angular/forms'; @NgModule({ diff --git a/src/app/admin/goods/list/list.component.ts b/src/app/admin/goods/list/list.component.ts index 148090f..adb2072 100644 --- a/src/app/admin/goods/list/list.component.ts +++ b/src/app/admin/goods/list/list.component.ts @@ -2,8 +2,7 @@ import {Component, OnInit} from '@angular/core'; import {FormBuilder, FormGroup, Validators} from '@angular/forms'; import {GoodsService} from '../../../services/goods/goods.service'; import {environment} from '../../../../environments/environment'; -import {NzNotificationService, NzUploadFile} from 'ng-zorro-antd'; -import {NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {NzModalService, NzNotificationService, NzUploadFile} from 'ng-zorro-antd'; import {CommonsService} from '../../../services/commons.service'; import {AgentService} from '../../../services/agent.service'; import {CouponService} from '../../../services/coupon.service'; diff --git a/src/app/admin/order-manage/goods-child-order/goods-child-order.component.ts b/src/app/admin/order-manage/goods-child-order/goods-child-order.component.ts index df26d67..807fa21 100644 --- a/src/app/admin/order-manage/goods-child-order/goods-child-order.component.ts +++ b/src/app/admin/order-manage/goods-child-order/goods-child-order.component.ts @@ -1,13 +1,13 @@ import { Component, OnInit } from '@angular/core'; -import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; import {environment} from '../../../../environments/environment'; import {LocalStorageService} from '../../../services/local-storage.service'; -import {NzMessageService, NzNotificationService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; import {OrderThirdPartyService} from '../../../services/order/order-third-party.service'; import {GoodsService} from '../../../services/goods/goods.service'; import {CompanyService} from '../../../services/company.service'; import {CommonsService} from '../../../services/commons.service'; import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {NzMessageService, NzNotificationService} from 'ng-zorro-antd'; @Component({ selector: 'app-goods-child-order', diff --git a/src/app/admin/order-manage/goods-order/goods-order.component.ts b/src/app/admin/order-manage/goods-order/goods-order.component.ts index 8ad7875..88ace19 100644 --- a/src/app/admin/order-manage/goods-order/goods-order.component.ts +++ b/src/app/admin/order-manage/goods-order/goods-order.component.ts @@ -1,14 +1,14 @@ import { Component, OnInit } from '@angular/core'; -import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; import {environment} from '../../../../environments/environment'; import {LocalStorageService} from '../../../services/local-storage.service'; -import {NzMessageService, NzNotificationService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; import {OrderThirdPartyService} from '../../../services/order/order-third-party.service'; import {CompanyService} from '../../../services/company.service'; import {CommonsService} from '../../../services/commons.service'; import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; -import {animate, state, style, transition, trigger} from '_@angular_animations@9.0.7@@angular/animations'; import {GoodsService} from "../../../services/goods/goods.service"; +import {animate, state, style, transition, trigger} from '@angular/animations'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {NzMessageService, NzNotificationService} from 'ng-zorro-antd'; @Component({ selector: 'app-goods-order', diff --git a/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts b/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts index 4240ac3..5eb2c00 100644 --- a/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts +++ b/src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts @@ -6,9 +6,8 @@ import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; import {CommonsService} from '../../../services/commons.service'; import {OrderMobileRechargeService} from '../../../services/order/order-mobile-recharge.service'; import {FormBuilder, FormGroup} from '@angular/forms'; -import {NzMessageService} from 'ng-zorro-antd'; +import {NzMessageService, NzNotificationService} from 'ng-zorro-antd'; import {animate, state, style, transition, trigger} from '@angular/animations'; -import {NzNotificationService} from "_ng-zorro-antd@9.3.0@ng-zorro-antd"; @Component({ selector: 'app-mobile-recharge-order-list', diff --git a/src/app/admin/statistics/coupon-use/coupon-use.component.html b/src/app/admin/statistics/coupon-use/coupon-use.component.html new file mode 100644 index 0000000..9e5761d --- /dev/null +++ b/src/app/admin/statistics/coupon-use/coupon-use.component.html @@ -0,0 +1,64 @@ + + + + +
+
+
+
+ + 业务类型 + + + + + + +
+
+ + 卡券销售面值 + + + + + + + +
+
+ + 状态 + + + + + + + +
+
+ + 销售起止时间 + + + + +
+
+ + 销售结束时间 + + + + +
+
+ +
+
+
+
+
+
+
diff --git a/src/app/admin/statistics/coupon-use/coupon-use.component.scss b/src/app/admin/statistics/coupon-use/coupon-use.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/admin/statistics/coupon-use/coupon-use.component.spec.ts b/src/app/admin/statistics/coupon-use/coupon-use.component.spec.ts new file mode 100644 index 0000000..6c6ca67 --- /dev/null +++ b/src/app/admin/statistics/coupon-use/coupon-use.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CouponUseComponent } from './coupon-use.component'; + +describe('CouponUseComponent', () => { + let component: CouponUseComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CouponUseComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CouponUseComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/statistics/coupon-use/coupon-use.component.ts b/src/app/admin/statistics/coupon-use/coupon-use.component.ts new file mode 100644 index 0000000..7684dd6 --- /dev/null +++ b/src/app/admin/statistics/coupon-use/coupon-use.component.ts @@ -0,0 +1,167 @@ +import { Component, OnInit } from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {CouponService} from '../../../services/coupon.service'; + +@Component({ + selector: 'app-coupon-use', + templateUrl: './coupon-use.component.html', + styleUrls: ['./coupon-use.component.scss'] +}) +export class CouponUseComponent implements OnInit { + + dataObject: {}; + couponSourceArray = [ + { codeValue: 4, codeName: '贵州中石化'}, + { codeValue: 5, codeName: '重庆中石油'}, + ] + statusArray = [ + { codeValue: 20, codeName: '未使用'}, + { codeValue: 40, codeName: '已使用'}, + ] + salesPriceArray = []; + searchForm: FormGroup; + whereObject: any = {}; + constructor(private form: FormBuilder, + private couponService: CouponService) { } + + ngOnInit(): void { + let salesTimeS = new Date(); + salesTimeS.setDate(salesTimeS.getDate() - 7) + salesTimeS.setHours(0); + salesTimeS.setMinutes(0); + salesTimeS.setSeconds(0); + + let salesTimeE = new Date(); + salesTimeE.setHours(23); + salesTimeE.setMinutes(59); + salesTimeE.setSeconds(59); + + this.searchForm = this.form.group({ + couponSource: [String(this.couponSourceArray[0].codeValue)], + salesPrice: ['null'], + status: ['null'], + salesTimeS: [salesTimeS.getTime()], + salesTimeE: [salesTimeE.getTime()], + }); + this.getCouponSalesPrice(); + } + + + getData() { + const param = this.searchForm.value; + if (this.searchForm.controls['salesPrice'].value == 'null') { + param['salesPrice'] = null; + } + if (this.searchForm.controls['status'].value == 'null') { + param['status'] = null; + } + this.couponService.useCouponStatistics(param, response => { + let returnData = response['return_data']; + var dataArray = []; + for (let obj of returnData['salesPriceList']) { + dataArray.push({ + value: obj['count'], + name: obj['salesPrice'] + '【' + (obj['status']===20?'未使用':'已使用') + '】', + }); + } + this.dataObject = { + title: { + text: this.couponSourceArray.find(o => o.codeValue == this.searchForm.controls['couponSource']['value']).codeName, + left: 'center' + }, + tooltip: { + trigger: 'item' + }, + legend: { + orient: 'vertical', + left: 'left' + }, + series: [ + { + name: '', + type: 'pie', + radius: '50%', + data: dataArray, + emphasis: { + itemStyle: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + }, + /*label: { + formatter: '{a|{a}}{abg|}\n{hr|}\n {b|{b}:}{c} {per|{d}%} ', + backgroundColor: '#F6F8FC', + borderColor: '#8C8D8E', + borderWidth: 1, + borderRadius: 4, + rich: { + a: { + color: '#6E7079', + lineHeight: 22, + align: 'center' + }, + hr: { + borderColor: '#8C8D8E', + width: '100%', + borderWidth: 1, + height: 0 + }, + b: { + color: '#4C5058', + fontSize: 14, + fontWeight: 'bold', + lineHeight: 33 + }, + per: { + color: '#fff', + backgroundColor: '#4C5058', + padding: [3, 4], + borderRadius: 4 + } + } + },*/ + } + ] + }; + }); + + } + + + /** + * 搜索 + * @param whereObject 条件 + */ + search(whereObject: object) { + if (this.searchForm.controls['salesTimeS'].value != null) { + this.searchForm.controls['salesTimeS'].setValue(new Date(this.searchForm.controls['salesTimeS'].value).getTime()); + } + if (this.searchForm.controls['salesTimeE'].value != null) { + this.searchForm.controls['salesTimeE'].setValue(new Date(this.searchForm.controls['salesTimeE'].value).getTime()); + } + this.getData(); + } + + /** + * 重置 + */ + resetForm(): void { + this.searchForm.reset(); + this.searchForm.controls['couponSource'].setValue(String(this.couponSourceArray[0].codeValue)); + } + + /** + * 查询卡券销售面值 + */ + getCouponSalesPrice() { + this.salesPriceArray = []; + this.couponService.getCouponSalesPrice({couponSource : this.searchForm.controls['couponSource'].value}, data => { + for (let obj of data['return_data']) { + this.salesPriceArray.push({ codeValue: obj, codeName: obj}); + } + this.searchForm.controls['salesPrice'].setValue('null'); + this.getData(); + }); + } +} diff --git a/src/app/admin/statistics/statistics-routing.module.ts b/src/app/admin/statistics/statistics-routing.module.ts new file mode 100644 index 0000000..1557d9b --- /dev/null +++ b/src/app/admin/statistics/statistics-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import {CouponUseComponent} from './coupon-use/coupon-use.component'; + + +const routes: Routes = [ + { path: 'coupon-use', component: CouponUseComponent} +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class StatisticsRoutingModule { } diff --git a/src/app/admin/statistics/statistics.module.ts b/src/app/admin/statistics/statistics.module.ts new file mode 100644 index 0000000..eb3a02a --- /dev/null +++ b/src/app/admin/statistics/statistics.module.ts @@ -0,0 +1,26 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { StatisticsRoutingModule } from './statistics-routing.module'; +import { CouponUseComponent } from './coupon-use/coupon-use.component'; +import {NgZorroAntdModule} from 'ng-zorro-antd'; +import {FormsModule, ReactiveFormsModule} from '@angular/forms'; +import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; +import {AppCommonModule} from '../../app-common.module'; +import {NgxEchartsModule} from 'ngx-echarts'; + + +@NgModule({ + declarations: [CouponUseComponent], + imports: [ + CommonModule, + StatisticsRoutingModule, + NgZorroAntdModule, + ReactiveFormsModule, + FormsModule, + BreadcrumbModule, + AppCommonModule, + NgxEchartsModule, + ] +}) +export class StatisticsModule { } diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index f237673..8ac3f1f 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -172,6 +172,11 @@ const routes: Routes = [ loadChildren: () => import('./admin/goods/goods.module').then(m => m.GoodsModule), canActivate: [InitGuardService] }, + { + path: 'statistics', + loadChildren: () => import('./admin/statistics/statistics.module').then(m => m.StatisticsModule), + canActivate: [InitGuardService] + }, ], }, ]; diff --git a/src/app/services/coupon.service.ts b/src/app/services/coupon.service.ts index 5c085d9..ba2bd36 100644 --- a/src/app/services/coupon.service.ts +++ b/src/app/services/coupon.service.ts @@ -168,4 +168,29 @@ export class CouponService { }); } + + /** + * 卡券销售面值 + * + * @param id 用户id + * @param callBack 返回参数 + */ + public getCouponSalesPrice(params: object, callBack) { + this.http.get(environment.baseUrl + 'coupon/getCouponSalesPrice?' + this.common.getWhereCondition(params)).subscribe(data => { + callBack(data); + }); + } + + /** + * 使用卡券统计 + * + * @param id 用户id + * @param callBack 返回参数 + */ + public useCouponStatistics(params: object, callBack) { + this.http.get(environment.baseUrl + 'couponStatistics/useCouponStatistics?' + this.common.getWhereCondition(params)).subscribe(data => { + callBack(data); + }); + } + } diff --git a/src/app/services/goods/goods.service.ts b/src/app/services/goods/goods.service.ts index e52fbf7..eb8280f 100644 --- a/src/app/services/goods/goods.service.ts +++ b/src/app/services/goods/goods.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; -import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http'; import {CommonsService} from '../commons.service'; import {environment} from '../../../environments/environment'; +import {HttpClient} from '@angular/common/http'; @Injectable({ providedIn: 'root' diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 0f718ac..5e3fc2a 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,9 +4,9 @@ export const environment = { production: false, - // baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) +baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) // orderUrl: 'http://localhost:9304/order/', // 测试环境服务器地址(请求数据地址) - baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) + // baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) orderUrl: 'https://hsgcs.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) imageUrl: 'https://hsgcs.dctpay.com/filesystem/', key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=', From e4928d5fc25f699960c93d5161dfc1acce87f77d Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Fri, 21 Jul 2023 11:20:17 +0800 Subject: [PATCH 4/4] =?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 --- .../order-coupon-list.component.html | 1 + .../order-coupon-list.component.ts | 39 +++++++++++++++++++ .../services/order/order-coupon.service.ts | 12 ++++++ 3 files changed, 52 insertions(+) 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); + }); + } + /** * 查询订单详情 *