提交代码

dev
胡锐 3 days ago
parent 2c1cbc4273
commit ea6121a2be
  1. 36
      src/app/pages/trade/gas-order-count/gas-order-count.component.html
  2. 3
      src/app/pages/trade/gas-order-count/gas-order-count.component.less
  3. 136
      src/app/pages/trade/gas-order-count/gas-order-count.component.ts
  4. 6
      src/app/pages/trade/order-oil-list/order-oil-list.component.html
  5. 2
      src/app/pages/trade/order-oil-list/order-oil-list.component.ts
  6. 2
      src/app/pages/trade/trade.routes.ts
  7. 12
      src/app/services/trade/order-oil.service.ts

@ -0,0 +1,36 @@
<nz-spin [nzSpinning]="loadingObject.status" nzTip="{{loadingObject.title}}">
<form nz-form [formGroup]="searchForm" class="search_form">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="5">
<nz-form-item>
<nz-form-label>渠道</nz-form-label>
<nz-form-control>
<nz-select formControlName="channelType" [nzPlaceHolder]="'请选择'">
<nz-option nzValue="" nzLabel="全部"></nz-option>
<nz-option *ngFor="let item of channelTypeArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="5">
<nz-form-item>
<nz-form-label>时间</nz-form-label>
<nz-form-control>
<nz-date-picker formControlName="startTime" [nzDisabledDate]="disabledDate" [nzShowToday]="false" [nzAllowClear]="false"></nz-date-picker>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="4">
<nz-form-item>
<nz-form-label [nzNoColon]="true"></nz-form-label>
<nz-form-control>
<button nz-button [nzType]="'primary'" (click)="export()">下载导出</button>
</nz-form-control>
</nz-form-item>
</div>
</div>
</form>
</nz-spin>

@ -0,0 +1,136 @@
import { Component } from '@angular/core';
import {DatePipe, NgForOf, NgIf} from "@angular/common";
import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe";
import {NzButtonComponent} from "ng-zorro-antd/button";
import {
NzCellFixedDirective,
NzTableCellDirective,
NzTableComponent,
NzTbodyComponent, NzTheadComponent,
NzThMeasureDirective, NzTrDirective
} from "ng-zorro-antd/table";
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid";
import {NzDatePickerComponent, NzRangePickerComponent} from "ng-zorro-antd/date-picker";
import {NzDescriptionsComponent, NzDescriptionsItemComponent} from "ng-zorro-antd/descriptions";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzInputDirective} from "ng-zorro-antd/input";
import {NzModalComponent, NzModalModule, NzModalService} from "ng-zorro-antd/modal";
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {NzRadioButtonDirective, NzRadioComponent, NzRadioGroupComponent} from "ng-zorro-antd/radio";
import {NzTabComponent, NzTabSetComponent} from "ng-zorro-antd/tabs";
import {FormGroup, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms";
import {NzDropDownDirective, NzDropdownMenuComponent, NzDropDownModule} from "ng-zorro-antd/dropdown";
import {NzIconModule} from "ng-zorro-antd/icon";
import {NzCardModule} from "ng-zorro-antd/card";
import {NzSpinComponent} from "ng-zorro-antd/spin";
import {NzTimelineComponent, NzTimelineItemComponent} from "ng-zorro-antd/timeline";
import {NzBadgeComponent} from "ng-zorro-antd/badge";
import {NzTooltipDirective} from "ng-zorro-antd/tooltip";
import {DateMinutesDiffPipe} from "../../../pipes/common/date-minutes-diff.pipe";
import {NzDividerComponent} from "ng-zorro-antd/divider";
import {NzTypographyComponent} from "ng-zorro-antd/typography";
import {NzUploadModule} from "ng-zorro-antd/upload";
import {OrderOilService} from "../../../services/trade/order-oil.service";
import {environment} from "../../../../environments/environment";
import { differenceInCalendarDays } from 'date-fns';
@Component({
selector: 'app-gas-order-count',
standalone: true,
imports: [
DatePipe,
DictionaryPipe,
NgForOf,
NgIf,
NzButtonComponent,
NzCellFixedDirective,
NzColDirective,
NzDatePickerComponent,
NzDescriptionsComponent,
NzDescriptionsItemComponent,
NzFormControlComponent,
NzFormDirective,
NzFormItemComponent,
NzFormLabelComponent,
NzInputDirective,
NzModalComponent,
NzOptionComponent,
NzRadioButtonDirective,
NzRadioComponent,
NzRadioGroupComponent,
NzRangePickerComponent,
NzRowDirective,
NzSelectComponent,
NzTabComponent,
NzTabSetComponent,
NzTableCellDirective,
NzTableComponent,
NzTbodyComponent,
NzThMeasureDirective,
NzTheadComponent,
NzTrDirective,
ReactiveFormsModule,
NzModalModule,
NzDropdownMenuComponent,
NzDropDownDirective,
NzDropDownModule,
NzIconModule,
NzCardModule,
NzSpinComponent,
NzTimelineItemComponent,
NzTimelineComponent,
NzBadgeComponent,
NzTooltipDirective,
DateMinutesDiffPipe,
NzDividerComponent,
NzTypographyComponent,
NzUploadModule
],
templateUrl: './gas-order-count.component.html',
styleUrl: './gas-order-count.component.less'
})
export class GasOrderCountComponent {
imageUrl = environment.imageUrl;
loadingObject = {
title: "处理中...",
status: false,
};
// 表单数据
tableData: any = {
total: 0,
list: [],
};
// 搜索表单
searchForm: FormGroup;
// 渠道
channelTypeArray = new DictionaryPipe().getDictionaryList('MER_SOURCE_TYPE');
disabledDate = (current: Date): boolean =>
differenceInCalendarDays(current, new Date().setDate(new Date().getDate() - 1)) > 0 ;
constructor(private fb: NonNullableFormBuilder,
private modal: NzModalService,
private orderOilService : OrderOilService) {
// 初始化搜索框
this.searchForm = this.fb.group({
channelType: ['3'],
startTime: [new Date().setDate(new Date().getDate() - 1)],
});
}
/**
*
*/
export() {
this.loadingObject.status = true;
this.searchForm.controls['startTime'].setValue(new Date(this.searchForm.controls['startTime'].value).getTime());
this.orderOilService.exportOilOrderCount(this.searchForm.value, (data:any) => {
if (data['return_code'] == '000000') {
window.location.href = this.imageUrl + data['return_data'];
} else {
this.modal.error(data['return_msg'])
}
this.loadingObject.status = false;
});
}
}

@ -151,7 +151,11 @@
<span>加油升数:</span>
<span class="csp-text-primary" style="margin-right: 50px;">{{totalData.totalOilLiters}}升</span>
<span>实付金额:</span>
<span class="csp-text-primary">{{totalData.totalActualPayPrice}}元</span>
<span class="csp-text-primary" style="margin-right: 50px;">{{totalData.totalActualPayPrice}}元</span>
<span>优惠券笔数:</span>
<span class="csp-text-primary" style="margin-right: 50px;">{{totalData.deductionCouponCount}}笔</span>
<span>优惠券占比:</span>
<span class="csp-text-primary">{{totalData.deductionCouponRate}}%</span>
</div>
</div>
<nz-table #basicTable

@ -118,6 +118,8 @@ export class OrderOilListComponent {
totalRefuelPrice: 0,
totalOilLiters: 0,
totalActualPayPrice: 0,
deductionCouponCount: 0,
deductionCouponRate: 0,
};
// 搜索表单
searchForm: FormGroup;

@ -2,9 +2,11 @@ import { Routes } from '@angular/router';
import {OrderRefundComponent} from "./order-refund/order-refund.component";
import {OrderOilListComponent} from "./order-oil-list/order-oil-list.component";
import {GasOrderReceiptComponent} from "./gas-order-receipt/gas-order-receipt.component";
import {GasOrderCountComponent} from "./gas-order-count/gas-order-count.component";
export const TRADE_ROUTES: Routes = [
{ path: 'order-refund', component: OrderRefundComponent },
{ path: 'order-oil', component: OrderOilListComponent },
{ path: 'gas-order', component: GasOrderReceiptComponent },
{ path: 'gas-order-count', component: GasOrderCountComponent },
];

@ -34,6 +34,18 @@ export class OrderOilService {
});
}
/**
*
* @param param
* @param callBack
*/
public exportOilOrderCount(param: any, callBack:any) {
param.tm = new Date().getTime();
this.http.get(environment.baseUrl + 'gasOrderCount/countOilData?'+ObjectData.objectByString(param)).subscribe(data => {
callBack(data);
});
}
/**
*
* @param param

Loading…
Cancel
Save