pull/1/head
袁野 3 years ago
parent 3119cecb82
commit 31715635f4
  1. 2
      src/app/admin/recharge-order/order-list/order-list.component.html
  2. 5
      src/app/admin/recharge-order/order-list/order-list.component.scss
  3. 15
      src/app/admin/recharge-order/order-list/order-list.component.ts
  4. 64
      src/app/admin/recharge-order/order-statistical/order-statistical.component.html
  5. 0
      src/app/admin/recharge-order/order-statistical/order-statistical.component.scss
  6. 63
      src/app/admin/recharge-order/order-statistical/order-statistical.component.ts
  7. 7
      src/app/admin/recharge-order/recharge-order-routing.module.ts
  8. 4
      src/app/admin/recharge-order/recharge-order.module.ts
  9. 1
      src/app/admin/recharge-order/user-statistical/user-statistical.component.html
  10. 0
      src/app/admin/recharge-order/user-statistical/user-statistical.component.scss
  11. 15
      src/app/admin/recharge-order/user-statistical/user-statistical.component.ts
  12. 24
      src/app/services/recharge.service.ts

@ -117,7 +117,7 @@
<td nzRight>{{data.status | rechargeStatus}}</td>
<td nzRight class="table-td-operation">
<a (click)="getDetail(data.id)">详情</a>
<a *ngIf="data.status === 2" (click)="getDetail(data.id)">退款</a>
<a *ngIf="data.status === 2" (click)="orderToRefund(data.id)">退款</a>
</td>
</tbody>
</nz-table>

@ -0,0 +1,5 @@
.table-td-operation {
a {
margin-left: 8px;
}
}

@ -143,4 +143,19 @@ export class OrderListComponent implements OnInit , OnDestroy {
}
public orderToRefund(id): void {
this.common.showConfirm('确认订单是否退款', item => {
if (item) {
this.recharge.orderToRefund(id, data => {
if (data['return_code'] === '000000') {
this.getRequest(false, this.searchForm.value);
this.message.success('退款成功');
} else {
this.message.error(data['return_msg']);
}
});
}
});
}
}

@ -0,0 +1,64 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">时间区间</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" formControlName="finishTime"></nz-range-picker>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col nzSpan="24" class="search-button">
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button>
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button>
</div>
</div>
</form>
</div>
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<div class="operating-button">
<!-- <button nz-button nzType="primary" class="right-btn" (click)="downloadTemplate(searchForm.value)" ><i nz-icon nzType="download" nzTheme="outline"></i>导出订单</button>-->
</div>
<nz-table
class="table"
#ajaxTable
nzShowSizeChanger
[nzFrontPagination]="false"
[nzData]="requestData"
[nzLoading]="loading"
[nzTotal]="total"
[(nzPageIndex)]="pageNum"
[(nzPageSize)]="pageSize"
(nzPageIndexChange)="getRequest(false , searchForm.value)"
(nzPageSizeChange)="getRequest(false , searchForm.value)">
<thead nzSingleSort>
<tr>
<th nzWidth="50px">编号</th>
<th nzWidth="180px">时间</th>
<th nzWidth="180px">数量</th>
<th nzWidth="180px">支付金额</th>
<th nzWidth="180px">充值金额</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i+1}}</td>
<td>{{data.day}}</td>
<td>{{data.count}}</td>
<td>{{data.payPrice}}</td>
<td>{{data.orderPrice}}</td>
</tbody>
</nz-table>
</div>

@ -0,0 +1,63 @@
import { Component, OnInit } from '@angular/core';
import {RechargeService} from '../../../services/recharge.service';
import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms';
import {NzMessageService} from 'ng-zorro-antd';
@Component({
selector: 'app-order-statistical',
templateUrl: './order-statistical.component.html',
styleUrls: ['./order-statistical.component.scss']
})
export class OrderStatisticalComponent implements OnInit {
searchForm: FormGroup; // 搜索框
requestData = []; // 列表数据
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
constructor(
private recharge: RechargeService,
private form: FormBuilder,
private message: NzMessageService,
) { }
ngOnInit(): void {
this.searchForm = this.form.group({
finishTime: [null],
});
this.getRequest(true, this.searchForm.value);
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
if (whereObject['finishTime'] != null && whereObject['finishTime'].length !== 0) {
whereObject['finishTimeS'] = whereObject['finishTime'][0].getTime();
whereObject['finishTimeE'] = whereObject['finishTime'][1].getTime();
}
this.loading = false;
if (reset) {
this.pageNum = 1;
}
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
this.recharge.getOrderCountList(whereObject, data => {
console.log(data);
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
}
});
}
// 重置
public resetForm(): void {
this.searchForm.reset();
}
}

@ -2,12 +2,15 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {OrderListComponent} from './order-list/order-list.component';
import {PriceListComponent} from './price-list/price-list.component';
import {OrderStatisticalComponent} from './order-statistical/order-statistical.component';
import {UserStatisticalComponent} from './user-statistical/user-statistical.component';
const routes: Routes = [
{ path: 'order-list', component: OrderListComponent },
{ path: 'price-list', component: PriceListComponent},
{ path: 'price-list', component: PriceListComponent},
{ path: 'order-statistical', component: OrderStatisticalComponent},
{ path: 'user-statistical', component: UserStatisticalComponent},
];
@NgModule({

@ -10,10 +10,12 @@ import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/f
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import {RegionSelectorModule} from '../../common/region-selector/region-selector.module';
import {AppCommonModule} from '../../app-common.module';
import { OrderStatisticalComponent } from './order-statistical/order-statistical.component';
import { UserStatisticalComponent } from './user-statistical/user-statistical.component';
@NgModule({
declarations: [OrderListComponent, PriceListComponent],
declarations: [OrderListComponent, PriceListComponent, OrderStatisticalComponent, UserStatisticalComponent],
imports: [
CommonModule,
RechargeOrderRoutingModule,

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-user-statistical',
templateUrl: './user-statistical.component.html',
styleUrls: ['./user-statistical.component.scss']
})
export class UserStatisticalComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

@ -112,6 +112,18 @@ export class RechargeService {
});
}
/**
* id完成退款
*
* @param id id
* @param callBack
*/
public orderToRefund(id: number, callBack) {
this.http.get(environment.baseUrl + 'outRechargeOrder/orderToRefund?orderId=' + id).subscribe(data => {
callBack(data);
});
}
/**
*
*
@ -124,4 +136,16 @@ export class RechargeService {
});
}
/**
*
*
* @param paramsObject
* @param callBack
*/
public getOrderCountList(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'outRechargeOrder/getOrderCountList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
}

Loading…
Cancel
Save