Merge remote-tracking branch 'origin/master' into 2.0-dev

# Conflicts:
#	src/app/services/coupon.service.ts
2.0-dev
袁野 1 year ago
commit c025a6fef5
  1. 4
      src/app/admin/audit/goods-audit/goods-audit.component.ts
  2. 4
      src/app/admin/config-manage/freight/freight.component.ts
  3. 4
      src/app/admin/goods/goods.module.ts
  4. 3
      src/app/admin/goods/list/list.component.ts
  5. 4
      src/app/admin/order-manage/goods-child-order/goods-child-order.component.ts
  6. 6
      src/app/admin/order-manage/goods-order/goods-order.component.ts
  7. 3
      src/app/admin/order-manage/mobile-recharge-order-list/mobile-recharge-order-list.component.ts
  8. 3
      src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.html
  9. 45
      src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.ts
  10. 6
      src/app/admin/order-manage/order-integral-recharge/order-integral-recharge.component.ts
  11. 6
      src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.ts
  12. 4
      src/app/admin/order-manage/order-refund-list/order-refund-list.component.ts
  13. 64
      src/app/admin/statistics/coupon-use/coupon-use.component.html
  14. 0
      src/app/admin/statistics/coupon-use/coupon-use.component.scss
  15. 25
      src/app/admin/statistics/coupon-use/coupon-use.component.spec.ts
  16. 167
      src/app/admin/statistics/coupon-use/coupon-use.component.ts
  17. 14
      src/app/admin/statistics/statistics-routing.module.ts
  18. 26
      src/app/admin/statistics/statistics.module.ts
  19. 5
      src/app/app-routing.module.ts
  20. 27
      src/app/services/coupon.service.ts
  21. 2
      src/app/services/goods/goods.service.ts
  22. 12
      src/app/services/order/order-coupon.service.ts
  23. 4
      src/environments/environment.ts

@ -1,9 +1,9 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms';
import {AuditService} from '../../../services/audit.service'; import {AuditService} from '../../../services/audit.service';
import {IconService} from '../../../services/icon.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 {CommonsService} from '../../../services/commons.service';
import {FormBuilder, FormGroup} from '@angular/forms';
import {NzMessageService} from 'ng-zorro-antd';
@Component({ @Component({
selector: 'app-goods-audit', selector: 'app-goods-audit',

@ -1,9 +1,9 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms';
import {environment} from '../../../../environments/environment'; 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 {CommonsService} from '../../../services/commons.service';
import {GoodsService} from '../../../services/goods/goods.service'; import {GoodsService} from '../../../services/goods/goods.service';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {NzModalService, NzNotificationService} from 'ng-zorro-antd';
@Component({ @Component({
selector: 'app-freight', selector: 'app-freight',

@ -3,13 +3,13 @@ import { CommonModule } from '@angular/common';
import { GoodsRoutingModule } from './goods-routing.module'; import { GoodsRoutingModule } from './goods-routing.module';
import { ListComponent } from './list/list.component'; 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 {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 {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import {RegionSelectorModule} from '../../common/region-selector/region-selector.module'; import {RegionSelectorModule} from '../../common/region-selector/region-selector.module';
import {AppCommonModule} from '../../app-common.module'; import {AppCommonModule} from '../../app-common.module';
import {PreviewImageModule} from '../../common/preview-image/preview-image.module'; import {PreviewImageModule} from '../../common/preview-image/preview-image.module';
import {NgZorroAntdModule} from 'ng-zorro-antd';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
@NgModule({ @NgModule({

@ -2,8 +2,7 @@ import {Component, OnInit} from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms'; import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {GoodsService} from '../../../services/goods/goods.service'; import {GoodsService} from '../../../services/goods/goods.service';
import {environment} from '../../../../environments/environment'; import {environment} from '../../../../environments/environment';
import {NzNotificationService, NzUploadFile} from 'ng-zorro-antd'; import {NzModalService, NzNotificationService, NzUploadFile} from 'ng-zorro-antd';
import {NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
import {CommonsService} from '../../../services/commons.service'; import {CommonsService} from '../../../services/commons.service';
import {AgentService} from '../../../services/agent.service'; import {AgentService} from '../../../services/agent.service';
import {CouponService} from '../../../services/coupon.service'; import {CouponService} from '../../../services/coupon.service';

@ -1,13 +1,13 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms';
import {environment} from '../../../../environments/environment'; import {environment} from '../../../../environments/environment';
import {LocalStorageService} from '../../../services/local-storage.service'; 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 {OrderThirdPartyService} from '../../../services/order/order-third-party.service';
import {GoodsService} from '../../../services/goods/goods.service'; import {GoodsService} from '../../../services/goods/goods.service';
import {CompanyService} from '../../../services/company.service'; import {CompanyService} from '../../../services/company.service';
import {CommonsService} from '../../../services/commons.service'; import {CommonsService} from '../../../services/commons.service';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {FormBuilder, FormGroup} from '@angular/forms';
import {NzMessageService, NzNotificationService} from 'ng-zorro-antd';
@Component({ @Component({
selector: 'app-goods-child-order', selector: 'app-goods-child-order',

@ -1,14 +1,14 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms';
import {environment} from '../../../../environments/environment'; import {environment} from '../../../../environments/environment';
import {LocalStorageService} from '../../../services/local-storage.service'; 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 {OrderThirdPartyService} from '../../../services/order/order-third-party.service';
import {CompanyService} from '../../../services/company.service'; import {CompanyService} from '../../../services/company.service';
import {CommonsService} from '../../../services/commons.service'; import {CommonsService} from '../../../services/commons.service';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; 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 {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({ @Component({
selector: 'app-goods-order', selector: 'app-goods-order',

@ -6,9 +6,8 @@ import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {CommonsService} from '../../../services/commons.service'; import {CommonsService} from '../../../services/commons.service';
import {OrderMobileRechargeService} from '../../../services/order/order-mobile-recharge.service'; import {OrderMobileRechargeService} from '../../../services/order/order-mobile-recharge.service';
import {FormBuilder, FormGroup} from '@angular/forms'; 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 {animate, state, style, transition, trigger} from '@angular/animations';
import {NzNotificationService} from "_ng-zorro-antd@9.3.0@ng-zorro-antd";
@Component({ @Component({
selector: 'app-mobile-recharge-order-list', selector: 'app-mobile-recharge-order-list',

@ -226,7 +226,7 @@
<td>¥{{data.deductionCouponPrice}}</td> <td>¥{{data.deductionCouponPrice}}</td>
<td>¥{{data.deductionProductPrice}}</td> <td>¥{{data.deductionProductPrice}}</td>
<td>¥{{data.payablePrice}}</td> <td>¥{{data.payablePrice}}</td>
<td>¥{{data.payGold / 100}}</td> <td>¥{{data.payGold}}</td>
<td>¥{{data.payPrice}}</td> <td>¥{{data.payPrice}}</td>
<td>{{data.payType}}</td> <td>{{data.payType}}</td>
<td>{{data.memCardNo}}</td> <td>{{data.memCardNo}}</td>
@ -240,6 +240,7 @@
<nz-dropdown-menu #menu="nzDropdownMenu"> <nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable> <ul nz-menu nzSelectable>
<li nz-menu-item (click)="showOrderDetail(data.orderNo)"><a>交易详情</a></li> <li nz-menu-item (click)="showOrderDetail(data.orderNo)"><a>交易详情</a></li>
<li *ngIf="data.exceptionStatus != '正常' && REISSUE_COUPON_BTN == true" nz-menu-item (click)="reissue(data.orderNo)"><a>补发</a></li>
<li *ngIf="data.exceptionStatus != '正常' && REFUND_COUPON_BTN == true" nz-menu-item (click)="showRefund(data.orderNo)"><a>交易退款</a></li> <li *ngIf="data.exceptionStatus != '正常' && REFUND_COUPON_BTN == true" nz-menu-item (click)="showRefund(data.orderNo)"><a>交易退款</a></li>
</ul> </ul>
</nz-dropdown-menu> </nz-dropdown-menu>

@ -48,6 +48,7 @@ export class OrderCouponListComponent implements OnInit {
companyArray = []; companyArray = [];
REFUND_COUPON_BTN = false; REFUND_COUPON_BTN = false;
REISSUE_COUPON_BTN = false;
GZ_SINOPEC_STATUS = false; GZ_SINOPEC_STATUS = false;
constructor(private modal: NzModalService, constructor(private modal: NzModalService,
private message: NzMessageService, private message: NzMessageService,
@ -112,6 +113,7 @@ export class OrderCouponListComponent implements OnInit {
}); });
this.REFUND_COUPON_BTN = this.commonsService.isBtnCompetence("BTN_REFUND_COUPON_BTN"); 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); this.requestData(1);
} }
@ -143,7 +145,7 @@ export class OrderCouponListComponent implements OnInit {
* @param whereObject * @param whereObject
*/ */
search(whereObject: object) { search(whereObject: object) {
if (whereObject['createTime'] != null) { if (whereObject['createTime'] != null && whereObject['createTime'].length > 0) {
whereObject['createTimeS'] = new Date(whereObject['createTime'][0]).getTime(); whereObject['createTimeS'] = new Date(whereObject['createTime'][0]).getTime();
whereObject['createTimeE'] = new Date(whereObject['createTime'][1]).getTime(); whereObject['createTimeE'] = new Date(whereObject['createTime'][1]).getTime();
} else { } else {
@ -151,7 +153,7 @@ export class OrderCouponListComponent implements OnInit {
whereObject['createTimeE'] = null; whereObject['createTimeE'] = null;
} }
if (whereObject['payTime'] != null) { if (whereObject['payTime'] != null && whereObject['payTime'].length > 0) {
whereObject['payTimeS'] = new Date(whereObject['payTime'][0]).getTime(); whereObject['payTimeS'] = new Date(whereObject['payTime'][0]).getTime();
whereObject['payTimeE'] = new Date(whereObject['payTime'][1]).getTime(); whereObject['payTimeE'] = new Date(whereObject['payTime'][1]).getTime();
} else { } else {
@ -159,7 +161,7 @@ export class OrderCouponListComponent implements OnInit {
whereObject['payTimeE'] = null; whereObject['payTimeE'] = null;
} }
if (whereObject['finishTime'] != null) { if (whereObject['finishTime'] != null && whereObject['finishTime'].length > 0) {
whereObject['finishTimeS'] = whereObject['finishTime'][0].getTime(); whereObject['finishTimeS'] = whereObject['finishTime'][0].getTime();
whereObject['finishTimeE'] = whereObject['finishTime'][1].getTime(); whereObject['finishTimeE'] = whereObject['finishTime'][1].getTime();
} else { } else {
@ -244,6 +246,43 @@ export class OrderCouponListComponent implements OnInit {
this.refundModal = true; this.refundModal = true;
} }
/**
* 退
* @param orderNo
*/
reissue(orderNo: string) {
this.modal.confirm({
nzTitle: '提示?',
nzContent: '<b style="color: red;">确定是否补发卡券?</b>',
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;
});
}
/** /**
* 退 * 退
*/ */

@ -100,7 +100,7 @@ export class OrderIntegralRechargeComponent implements OnInit {
* @param whereObject * @param whereObject
*/ */
search(whereObject: object) { search(whereObject: object) {
if (whereObject['createTime'] != null) { if (whereObject['createTime'] != null && whereObject['createTime'].length > 0) {
whereObject['createTimeS'] = new Date(whereObject['createTime'][0]).getTime(); whereObject['createTimeS'] = new Date(whereObject['createTime'][0]).getTime();
whereObject['createTimeE'] = new Date(whereObject['createTime'][1]).getTime(); whereObject['createTimeE'] = new Date(whereObject['createTime'][1]).getTime();
} else { } else {
@ -108,7 +108,7 @@ export class OrderIntegralRechargeComponent implements OnInit {
whereObject['createTimeE'] = null; whereObject['createTimeE'] = null;
} }
if (whereObject['payTime'] != null) { if (whereObject['payTime'] != null && whereObject['payTime'].length > 0) {
whereObject['payTimeS'] = new Date(whereObject['payTime'][0]).getTime(); whereObject['payTimeS'] = new Date(whereObject['payTime'][0]).getTime();
whereObject['payTimeE'] = new Date(whereObject['payTime'][1]).getTime(); whereObject['payTimeE'] = new Date(whereObject['payTime'][1]).getTime();
} else { } else {
@ -116,7 +116,7 @@ export class OrderIntegralRechargeComponent implements OnInit {
whereObject['payTimeE'] = null; whereObject['payTimeE'] = null;
} }
if (whereObject['finishTime'] != null) { if (whereObject['finishTime'] != null && whereObject['finishTime'].length > 0) {
whereObject['finishTimeS'] = new Date(whereObject['finishTime'][0]).getTime(); whereObject['finishTimeS'] = new Date(whereObject['finishTime'][0]).getTime();
whereObject['finishTimeE'] = new Date(whereObject['finishTime'][1]).getTime(); whereObject['finishTimeE'] = new Date(whereObject['finishTime'][1]).getTime();
} else { } else {

@ -271,7 +271,7 @@ export class OrderOilListComponent implements OnInit {
* @param whereObject * @param whereObject
*/ */
search(whereObject: object) { search(whereObject: object) {
if (whereObject['createTimeArray'] != null) { if (whereObject['createTimeArray'] != null && whereObject['createTimeArray'].length > 0) {
whereObject['createTimeS'] = new Date(whereObject['createTimeArray'][0]).getTime(); whereObject['createTimeS'] = new Date(whereObject['createTimeArray'][0]).getTime();
whereObject['createTimeE'] = new Date(whereObject['createTimeArray'][1]).getTime(); whereObject['createTimeE'] = new Date(whereObject['createTimeArray'][1]).getTime();
} else { } else {
@ -279,7 +279,7 @@ export class OrderOilListComponent implements OnInit {
whereObject['createTimeE'] = null; whereObject['createTimeE'] = null;
} }
if (whereObject['payTimeArray'] != null) { if (whereObject['payTimeArray'] != null && whereObject['payTimeArray'].length > 0) {
whereObject['payTimeS'] = new Date(whereObject['payTimeArray'][0]).getTime(); whereObject['payTimeS'] = new Date(whereObject['payTimeArray'][0]).getTime();
whereObject['payTimeE'] = new Date(whereObject['payTimeArray'][1]).getTime(); whereObject['payTimeE'] = new Date(whereObject['payTimeArray'][1]).getTime();
} else { } else {
@ -287,7 +287,7 @@ export class OrderOilListComponent implements OnInit {
whereObject['payTimeE'] = null; whereObject['payTimeE'] = null;
} }
if (whereObject['refundTimeArray'] != null) { if (whereObject['refundTimeArray'] != null && whereObject['refundTimeArray'].length > 0) {
whereObject['refundTimeS'] = new Date(whereObject['refundTimeArray'][0]).getTime(); whereObject['refundTimeS'] = new Date(whereObject['refundTimeArray'][0]).getTime();
whereObject['refundTimeE'] = new Date(whereObject['refundTimeArray'][1]).getTime(); whereObject['refundTimeE'] = new Date(whereObject['refundTimeArray'][1]).getTime();
} else { } else {

@ -98,7 +98,7 @@ export class OrderRefundListComponent implements OnInit {
* @param whereObject * @param whereObject
*/ */
search(whereObject: object) { search(whereObject: object) {
if (whereObject['createTime'] != null) { if (whereObject['createTime'] != null && whereObject['createTime'].length > 0) {
whereObject['createTimeS'] = whereObject['createTime'][0].getTime(); whereObject['createTimeS'] = whereObject['createTime'][0].getTime();
whereObject['createTimeE'] = whereObject['createTime'][1].getTime(); whereObject['createTimeE'] = whereObject['createTime'][1].getTime();
} else { } else {
@ -106,7 +106,7 @@ export class OrderRefundListComponent implements OnInit {
whereObject['createTimeE'] = null; whereObject['createTimeE'] = null;
} }
if (whereObject['refundTime'] != null) { if (whereObject['refundTime'] != null && whereObject['refundTime'].length > 0) {
whereObject['refundTimeS'] = whereObject['refundTime'][0].getTime(); whereObject['refundTimeS'] = whereObject['refundTime'][0].getTime();
whereObject['refundTimeE'] = whereObject['refundTime'][1].getTime(); whereObject['refundTimeE'] = whereObject['refundTime'][1].getTime();
} else { } else {

@ -0,0 +1,64 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">业务类型</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select ngModel="4" formControlName="couponSource" (ngModelChange)="getCouponSalesPrice()">
<nz-option *ngFor="let item of couponSourceArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">卡券销售面值</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select formControlName="salesPrice">
<nz-option nzValue="null" nzLabel="全部" ></nz-option>
<nz-option *ngFor="let item of salesPriceArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}" ></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">状态</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select formControlName="status">
<nz-option nzValue="null" nzLabel="全部"></nz-option>
<nz-option *ngFor="let item of statusArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">销售起止时间</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-date-picker formControlName="salesTimeS" style="width: 100%;"></nz-date-picker>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">销售结束时间</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-date-picker formControlName="salesTimeE" style="width: 100%;"></nz-date-picker>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>筛选</button>
</div>
</div>
</form>
</div>
<div class="inner-content">
<div echarts [options]="dataObject"></div>
</div>

@ -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<CouponUseComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CouponUseComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CouponUseComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -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();
});
}
}

@ -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 { }

@ -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 { }

@ -172,6 +172,11 @@ const routes: Routes = [
loadChildren: () => import('./admin/goods/goods.module').then(m => m.GoodsModule), loadChildren: () => import('./admin/goods/goods.module').then(m => m.GoodsModule),
canActivate: [InitGuardService] canActivate: [InitGuardService]
}, },
{
path: 'statistics',
loadChildren: () => import('./admin/statistics/statistics.module').then(m => m.StatisticsModule),
canActivate: [InitGuardService]
},
], ],
}, },
]; ];

@ -168,7 +168,7 @@ export class CouponService {
}); });
} }
/* /*
*/ */
public getBlxCouponList(params: object, callBack) { public getBlxCouponList(params: object, callBack) {
@ -179,4 +179,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);
});
}
} }

@ -1,7 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http';
import {CommonsService} from '../commons.service'; import {CommonsService} from '../commons.service';
import {environment} from '../../../environments/environment'; import {environment} from '../../../environments/environment';
import {HttpClient} from '@angular/common/http';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'

@ -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);
});
}
/** /**
* *
* *

@ -4,9 +4,9 @@
export const environment = { export const environment = {
production: false, production: false,
// baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
// orderUrl: 'http://localhost:9304/order/', // 测试环境服务器地址(请求数据地址) // orderUrl: 'http://localhost:9304/order/', // 测试环境服务器地址(请求数据地址)
baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) // baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
orderUrl: 'https://hsgcs.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) orderUrl: 'https://hsgcs.dctpay.com/order/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://hsgcs.dctpay.com/filesystem/', imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=', key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=',

Loading…
Cancel
Save