提交代码

dev
胡锐 1 year ago
parent 870745d337
commit ee60233488
  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. 64
      src/app/admin/statistics/coupon-use/coupon-use.component.html
  9. 0
      src/app/admin/statistics/coupon-use/coupon-use.component.scss
  10. 25
      src/app/admin/statistics/coupon-use/coupon-use.component.spec.ts
  11. 167
      src/app/admin/statistics/coupon-use/coupon-use.component.ts
  12. 14
      src/app/admin/statistics/statistics-routing.module.ts
  13. 26
      src/app/admin/statistics/statistics.module.ts
  14. 5
      src/app/app-routing.module.ts
  15. 25
      src/app/services/coupon.service.ts
  16. 2
      src/app/services/goods/goods.service.ts
  17. 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',

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

@ -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'

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