parent
5137406d0f
commit
09fa8f3e73
@ -0,0 +1,179 @@ |
|||||||
|
<!-- 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 nzAllowClear formControlName="merNo" [nzDropdownMatchSelectWidth]="false"> |
||||||
|
<nz-option *ngFor="let item of merArray" nzLabel="({{item.merNo}}){{item.merName}}" nzValue="{{item.merNo}}"></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 style="width: 100%;" (ngModelChange)="searchSettleTime(1, $event)" [nzDisabledDate]="disabledDate" [nzShowToday]="false" [nzAllowClear]="false" [nzFormat]="'yyyy-MM-dd'" formControlName="settleTimeS"></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 style="width: 100%;" (ngModelChange)="searchSettleTime(2, $event)"[nzDisabledDate]="disabledDate" [nzShowToday]="false" [nzAllowClear]="false" [nzFormat]="'yyyy-MM-dd'" formControlName="settleTimeE"></nz-date-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"> |
||||||
|
<article nz-typography> |
||||||
|
<p> |
||||||
|
<span nz-typography nzType="warning"><strong>汇总:</strong></span> |
||||||
|
笔数 <span nz-typography nzType="warning"><strong>{{dataObject.totalTradeNum}}</strong></span>、 |
||||||
|
交易金额 <span nz-typography nzType="warning"><strong>{{dataObject.totalTradeAmount}}</strong></span> 元、 |
||||||
|
手续费 <span nz-typography nzType="warning"><strong>{{dataObject.totalShdFeeAmount}}</strong></span> 元、 |
||||||
|
应结算金额 <span nz-typography nzType="warning"><strong>{{dataObject.totalSettleAmount}}</strong></span> 元 |
||||||
|
<button nz-button nzType="primary" style="float: right;" (click)="showPrint()">打印</button> |
||||||
|
</p> |
||||||
|
</article> |
||||||
|
<!--数组表格 --> |
||||||
|
<nz-table #basicTable |
||||||
|
nzBordered |
||||||
|
nzShowSizeChanger |
||||||
|
nzSize="middle" |
||||||
|
[nzData]="dataObject.settleDetailList" |
||||||
|
[nzTotal]="dataObject.settleDetailList.length" |
||||||
|
[nzLoading]="tableLoading" |
||||||
|
[nzScroll]="{ x: '595px'}"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th nzWidth="90px">清算日期</th> |
||||||
|
<th nzWidth="100px">商户号</th> |
||||||
|
<th nzWidth="130px">商户名称</th> |
||||||
|
<th nzWidth="80px">交易金额</th> |
||||||
|
<th nzWidth="80px">清算金额</th> |
||||||
|
<th nzWidth="80px">手续费</th> |
||||||
|
<th nzWidth="80px">交易笔数</th> |
||||||
|
<!-- <th nzWidth="40px" nzRight="0px">操作</th>--> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of basicTable.data;let i = index"> |
||||||
|
<td>{{data.settleDay}}</td> |
||||||
|
<td>{{data.merNo}}</td> |
||||||
|
<td>{{data.merName}}</td> |
||||||
|
<td>{{data.tradeAmount}}</td> |
||||||
|
<td>{{data.settleAmount}}</td> |
||||||
|
<td>{{data.shdFeeAmount}}</td> |
||||||
|
<td>{{data.tradeNum}}</td> |
||||||
|
<!-- <td nzRight="0px" class="table-td-operation"> |
||||||
|
<a (click)="showDetailModal(data.settleDay)">明细</a> |
||||||
|
</td>--> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
</div> |
||||||
|
|
||||||
|
<nz-modal [nzVisible]="dataDetailModal" nzWidth="1000px" nzTitle="明细" [nzFooter]="null" (nzOnCancel)="closeDetailModal()"> |
||||||
|
<nz-table #detailTable nzSize="middle" [nzData]="dataObject.settleDetailList"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th>Name</th> |
||||||
|
<th>Age</th> |
||||||
|
<th>Address</th> |
||||||
|
<th>Action</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of detailTable.data"> |
||||||
|
<td>{{data.name}}</td> |
||||||
|
<td>{{data.age}}</td> |
||||||
|
<td>{{data.address}}</td> |
||||||
|
<td> |
||||||
|
<a>Action 一 {{data.name}}</a> |
||||||
|
<nz-divider nzType="vertical"></nz-divider> |
||||||
|
<a>Delete</a> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
</nz-modal> |
||||||
|
|
||||||
|
|
||||||
|
<!--startprint--> |
||||||
|
<div id="print-content" style="display: none"> |
||||||
|
<div class="inner-content"> |
||||||
|
<article nz-typography> |
||||||
|
<p> |
||||||
|
<span nz-typography><strong>清算日期: {{this.searchForm.value.settleTimeS | date: 'yyyy-MM-dd'}} 至 {{this.searchForm.value.settleTimeE | date: 'yyyy-MM-dd'}}</strong></span> |
||||||
|
</p> |
||||||
|
</article> |
||||||
|
<article nz-typography> |
||||||
|
<p> |
||||||
|
<span nz-typography nzType="warning"><strong>汇总:</strong></span> |
||||||
|
笔数 <span nz-typography nzType="warning"><strong>{{dataObject.totalTradeNum}}</strong></span>、 |
||||||
|
交易金额 <span nz-typography nzType="warning"><strong>{{dataObject.totalTradeAmount}}</strong></span> 元、 |
||||||
|
手续费 <span nz-typography nzType="warning"><strong>{{dataObject.totalShdFeeAmount}}</strong></span> 元、 |
||||||
|
应结算金额 <span nz-typography nzType="warning"><strong>{{dataObject.totalSettleAmount}}</strong></span> 元 |
||||||
|
</p> |
||||||
|
</article> |
||||||
|
<!--数组表格 --> |
||||||
|
<nz-table #basicTable |
||||||
|
nzBordered |
||||||
|
nzSize="middle" |
||||||
|
[nzData]="dataObject.settleDetailList" |
||||||
|
[nzTotal]="dataObject.settleDetailList.length" |
||||||
|
[nzLoading]="tableLoading" |
||||||
|
[nzScroll]="{ x: '595px'}"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th nzWidth="90px">清算日期</th> |
||||||
|
<th nzWidth="100px">商户号</th> |
||||||
|
<th nzWidth="130px">商户名称</th> |
||||||
|
<th nzWidth="80px">交易金额</th> |
||||||
|
<th nzWidth="80px">清算金额</th> |
||||||
|
<th nzWidth="80px">手续费</th> |
||||||
|
<th nzWidth="80px">交易笔数</th> |
||||||
|
<!-- <th nzWidth="40px" nzRight="0px">操作</th>--> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of basicTable.data;let i = index"> |
||||||
|
<td>{{data.settleDay}}</td> |
||||||
|
<td>{{data.merNo}}</td> |
||||||
|
<td>{{data.merName}}</td> |
||||||
|
<td>{{data.tradeAmount}}</td> |
||||||
|
<td>{{data.settleAmount}}</td> |
||||||
|
<td>{{data.shdFeeAmount}}</td> |
||||||
|
<td>{{data.tradeNum}}</td> |
||||||
|
<!--<td nzRight="0px" class="table-td-operation"> |
||||||
|
<a [routerLink]="['/admin/agent/detail']" [queryParams]="{agentId: data.id}">明细</a> |
||||||
|
</td>--> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
</div> |
||||||
|
<img style="z-index: 0;margin: -70px 0px 0px 500px; position: absolute;" src="https://pay.dctpay.com/filesystem/b6b7e8860b6135101334aa840eb7e17d.png"> |
||||||
|
</div> |
||||||
|
<!--endprint--> |
||||||
|
|
@ -0,0 +1,25 @@ |
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
|
import { TradeCheckingDetailComponent } from './trade-checking-detail.component'; |
||||||
|
|
||||||
|
describe('TradeCheckingDetailComponent', () => { |
||||||
|
let component: TradeCheckingDetailComponent; |
||||||
|
let fixture: ComponentFixture<TradeCheckingDetailComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ TradeCheckingDetailComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(TradeCheckingDetailComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
@ -0,0 +1,161 @@ |
|||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
import {FormBuilder, FormGroup} from '@angular/forms'; |
||||||
|
import {NzMessageService, NzModalService} from 'ng-zorro-antd'; |
||||||
|
import {PlatformService} from '../../../services/platform.service'; |
||||||
|
import {MerService} from '../../../services/mer.service'; |
||||||
|
import {TradeCheckingService} from '../../../services/trade-checking.service'; |
||||||
|
import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-trade-checking-detail', |
||||||
|
templateUrl: './trade-checking-detail.component.html', |
||||||
|
styleUrls: ['./trade-checking-detail.component.scss'] |
||||||
|
}) |
||||||
|
export class TradeCheckingDetailComponent implements OnInit { |
||||||
|
tableLoading = true; |
||||||
|
searchForm: FormGroup; |
||||||
|
pageNum: number; |
||||||
|
whereObject: any = {}; |
||||||
|
|
||||||
|
merArray = []; |
||||||
|
|
||||||
|
dataObject = { |
||||||
|
totalTradeNum: 0, |
||||||
|
totalTradeAmount: 0, |
||||||
|
totalSettleAmount: 0, |
||||||
|
totalShdFeeAmount: 0, |
||||||
|
settleDetailList: [] |
||||||
|
}; |
||||||
|
dataDetailModal = false; |
||||||
|
dataDetailObject = false; |
||||||
|
currentDate = new Date(); |
||||||
|
constructor(private modal: NzModalService, |
||||||
|
private message: NzMessageService, |
||||||
|
private form: FormBuilder, |
||||||
|
private platformService: PlatformService, |
||||||
|
private merService: MerService, |
||||||
|
private tradeCheckingService: TradeCheckingService) { |
||||||
|
} |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
this.currentDate.setDate(this.currentDate.getDate() - 1); |
||||||
|
this.searchForm = this.form.group({ |
||||||
|
merNo: [null], |
||||||
|
settleTimeS: [ this.currentDate.getTime() ], |
||||||
|
settleTimeE: [ this.currentDate.getTime() ], |
||||||
|
}); |
||||||
|
|
||||||
|
this.merService.getMerList({ merStatus: 1, pageNum: 1, pageSize: 9999}, data => { |
||||||
|
this.merArray = data['return_data']['list']; |
||||||
|
if (this.merArray.length > 0) { |
||||||
|
this.searchForm.controls['merNo'].setValue(this.merArray[0]['merNo']); |
||||||
|
this.requestData(); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 请求数据 |
||||||
|
*/ |
||||||
|
requestData() { |
||||||
|
this.tableLoading = true; |
||||||
|
this.tradeCheckingService.queryCheckingDetail(this.searchForm.value, data => { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
this.dataObject = data['return_data']; |
||||||
|
} else { |
||||||
|
this.modal.error({ |
||||||
|
nzTitle: '提示', |
||||||
|
nzContent: data['return_msg'] |
||||||
|
}); |
||||||
|
} |
||||||
|
this.tableLoading = false; |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 搜索 |
||||||
|
* @param whereObject 条件 |
||||||
|
*/ |
||||||
|
search(whereObject: object) { |
||||||
|
whereObject['settleTimeS'] = new Date(whereObject['settleTimeS']).getTime(); |
||||||
|
whereObject['settleTimeE'] = new Date(whereObject['settleTimeE']).getTime(); |
||||||
|
this.whereObject = whereObject; |
||||||
|
this.requestData(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 重置 |
||||||
|
*/ |
||||||
|
resetForm(): void { |
||||||
|
this.searchForm.reset(); |
||||||
|
this.searchForm.controls['merNo'].setValue(this.merArray.length > 0 ? this.merArray[0]['merNo'] : null); |
||||||
|
this.searchForm.controls['settleTimeS'].setValue(this.currentDate.getTime()); |
||||||
|
this.searchForm.controls['settleTimeE'].setValue(this.currentDate.getTime()); |
||||||
|
} |
||||||
|
|
||||||
|
showDetailModal(settleDay: string) { |
||||||
|
this.dataDetailModal = true; |
||||||
|
} |
||||||
|
|
||||||
|
closeDetailModal() { |
||||||
|
this.dataDetailModal = false; |
||||||
|
} |
||||||
|
|
||||||
|
disabledDate = (current: Date): boolean => { |
||||||
|
// Can not select days before today and today
|
||||||
|
return differenceInCalendarDays(current, new Date()) > 0; |
||||||
|
}; |
||||||
|
|
||||||
|
|
||||||
|
searchSettleTime(dateType: number, selectDate: Date) { |
||||||
|
if (new Date().getDate() === selectDate.getDate()) { |
||||||
|
this.modal.error({ |
||||||
|
nzTitle: '提示', |
||||||
|
nzContent: '无法选择当日,当日还未清算' |
||||||
|
}); |
||||||
|
// 起始时间
|
||||||
|
if (dateType === 1) { |
||||||
|
this.searchForm.controls['settleTimeS'].setValue(this.currentDate.getTime()); |
||||||
|
// 终止时间
|
||||||
|
} else if (dateType === 2) { |
||||||
|
this.searchForm.controls['settleTimeE'].setValue(this.currentDate.getTime()); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
showPrint() { |
||||||
|
console.log(document.getElementById('print-content').innerHTML); |
||||||
|
const oblHtml = window.document.body.innerHTML; |
||||||
|
const bdhtml = document.getElementById('print-content').innerHTML; |
||||||
|
window.document.body.innerHTML = bdhtml; |
||||||
|
window.print(); |
||||||
|
document.body.innerHTML = oblHtml; |
||||||
|
window.location.reload(); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
// 此处为图文打印
|
||||||
|
printQrCode(idstr) { |
||||||
|
/* const imgUrlStr = 'https://weiliicimg9.pstatp.com/weili/l/905526294583705654.jpg'; |
||||||
|
let iframe = document.createElement('IFRAME'), |
||||||
|
doc = null, |
||||||
|
img = new Image(); |
||||||
|
img.src = imgUrlStr; |
||||||
|
iframe.setAttribute('style', 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;'); |
||||||
|
document.body.appendChild(iframe); |
||||||
|
doc = iframe.contentWindow.document; |
||||||
|
doc.write('<h2>Print Pictures and Words</h2>'); |
||||||
|
doc.body.append(img); |
||||||
|
console.log(doc.body.innerHTML); |
||||||
|
doc.close(); |
||||||
|
const newWindow = window.open('', ''); |
||||||
|
newWindow.document.write(doc.body.innerHTML); |
||||||
|
newWindow.print(); |
||||||
|
newWindow.close();*/ |
||||||
|
|
||||||
|
/* iframe.onload = function() { //解决图片显示不了的问题 |
||||||
|
iframe.contentWindow.focus(); |
||||||
|
iframe.contentWindow.print(); |
||||||
|
document.body.removeChild(iframe); |
||||||
|
};*/ |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
import { NgModule } from '@angular/core'; |
||||||
|
import { Routes, RouterModule } from '@angular/router'; |
||||||
|
import {TradeCheckingComponent} from './trade-checking/trade-checking.component'; |
||||||
|
import {TradeCheckingDetailComponent} from './trade-checking-detail/trade-checking-detail.component'; |
||||||
|
|
||||||
|
|
||||||
|
const routes: Routes = [ |
||||||
|
{ path: 'tradeChecking', component: TradeCheckingComponent }, |
||||||
|
{ path: 'tradeCheckingDetail', component: TradeCheckingDetailComponent }, |
||||||
|
]; |
||||||
|
|
||||||
|
@NgModule({ |
||||||
|
imports: [RouterModule.forChild(routes)], |
||||||
|
exports: [RouterModule] |
||||||
|
}) |
||||||
|
export class TradeCheckingRoutingModule { } |
@ -0,0 +1,25 @@ |
|||||||
|
import { NgModule } from '@angular/core'; |
||||||
|
import { CommonModule } from '@angular/common'; |
||||||
|
|
||||||
|
import { TradeCheckingRoutingModule } from './trade-checking-routing.module'; |
||||||
|
import { TradeCheckingComponent } from './trade-checking/trade-checking.component'; |
||||||
|
import { TradeCheckingDetailComponent } from './trade-checking-detail/trade-checking-detail.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'; |
||||||
|
|
||||||
|
|
||||||
|
@NgModule({ |
||||||
|
declarations: [TradeCheckingComponent, TradeCheckingDetailComponent], |
||||||
|
imports: [ |
||||||
|
CommonModule, |
||||||
|
TradeCheckingRoutingModule, |
||||||
|
NgZorroAntdModule, |
||||||
|
ReactiveFormsModule, |
||||||
|
FormsModule, |
||||||
|
BreadcrumbModule, |
||||||
|
AppCommonModule, |
||||||
|
] |
||||||
|
}) |
||||||
|
export class TradeCheckingModule { } |
@ -0,0 +1,132 @@ |
|||||||
|
<!-- 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 nzAllowClear formControlName="merNo" [nzDropdownMatchSelectWidth]="false"> |
||||||
|
<nz-option *ngFor="let item of merArray" nzLabel="({{item.merNo}}){{item.merName}}" nzValue="{{item.merNo}}"></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 style="width: 100%;" (ngModelChange)="searchSettleTime(1, $event)" [nzDisabledDate]="disabledDate" [nzShowToday]="false" [nzAllowClear]="false" [nzFormat]="'yyyy-MM-dd'" formControlName="settleTimeS"></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 style="width: 100%;" (ngModelChange)="searchSettleTime(2, $event)"[nzDisabledDate]="disabledDate" [nzShowToday]="false" [nzAllowClear]="false" [nzFormat]="'yyyy-MM-dd'" formControlName="settleTimeE"></nz-date-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"> |
||||||
|
<article nz-typography> |
||||||
|
<p> |
||||||
|
<span nz-typography><strong>清算日期: {{this.searchForm.value.settleTimeS | date: 'yyyy-MM-dd'}} 至 {{this.searchForm.value.settleTimeE | date: 'yyyy-MM-dd'}}</strong></span> |
||||||
|
|
||||||
|
<button nz-button nzType="primary" style="float: right;" (click)="showPrint()">打印</button> |
||||||
|
</p> |
||||||
|
</article> |
||||||
|
<!--数组表格 --> |
||||||
|
<nz-table #basicTable |
||||||
|
nzBordered |
||||||
|
nzShowSizeChanger |
||||||
|
nzSize="middle" |
||||||
|
[nzData]="dataObjectArray" |
||||||
|
[nzTotal]="dataObjectArray.length" |
||||||
|
[nzLoading]="tableLoading" |
||||||
|
[nzShowPagination]="false" |
||||||
|
[nzScroll]="{ x: '595px'}"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th nzWidth="100px">商户号</th> |
||||||
|
<th nzWidth="130px">商户名称</th> |
||||||
|
<th nzWidth="80px">交易金额</th> |
||||||
|
<th nzWidth="80px">清算金额</th> |
||||||
|
<th nzWidth="80px">手续费</th> |
||||||
|
<th nzWidth="80px">交易笔数</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of basicTable.data;let i = index"> |
||||||
|
<td>{{data.merNo}}</td> |
||||||
|
<td>{{data.merName}}</td> |
||||||
|
<td>{{data.totalTradeAmount}}</td> |
||||||
|
<td>{{data.totalSettleAmount}}</td> |
||||||
|
<td>{{data.totalShdFeeAmount}}</td> |
||||||
|
<td>{{data.totalTradeNum}}</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
</div> |
||||||
|
|
||||||
|
|
||||||
|
<!--startprint--> |
||||||
|
<div id="print-content" style="display: none"> |
||||||
|
<div class="inner-content"> |
||||||
|
<article nz-typography> |
||||||
|
<p> |
||||||
|
<span nz-typography><strong>清算日期: {{this.searchForm.value.settleTimeS | date: 'yyyy-MM-dd'}} 至 {{this.searchForm.value.settleTimeE | date: 'yyyy-MM-dd'}}</strong></span> |
||||||
|
</p> |
||||||
|
</article> |
||||||
|
<!--数组表格 --> |
||||||
|
<nz-table #basicTable2 |
||||||
|
nzBordered |
||||||
|
nzShowSizeChanger |
||||||
|
nzSize="middle" |
||||||
|
[nzData]="dataObjectArray" |
||||||
|
[nzTotal]="dataObjectArray.length" |
||||||
|
[nzLoading]="tableLoading" |
||||||
|
[nzShowPagination]="false" |
||||||
|
[nzScroll]="{ x: '550px'}"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th nzWidth="100px">商户号</th> |
||||||
|
<th nzWidth="130px">商户名称</th> |
||||||
|
<th nzWidth="80px">交易金额</th> |
||||||
|
<th nzWidth="80px">清算金额</th> |
||||||
|
<th nzWidth="80px">手续费</th> |
||||||
|
<th nzWidth="80px">交易笔数</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of basicTable2.data;let i = index"> |
||||||
|
<td>{{data.merNo}}</td> |
||||||
|
<td>{{data.merName}}</td> |
||||||
|
<td>{{data.totalTradeAmount}}</td> |
||||||
|
<td>{{data.totalSettleAmount}}</td> |
||||||
|
<td>{{data.totalShdFeeAmount}}</td> |
||||||
|
<td>{{data.totalTradeNum}}</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
</div> |
||||||
|
<img style="z-index: 0;margin: -100px 0px 0px 500px; position: absolute;" src="https://pay.dctpay.com/filesystem/b6b7e8860b6135101334aa840eb7e17d.png"> |
||||||
|
</div> |
||||||
|
<!--endprint--> |
@ -0,0 +1,25 @@ |
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
|
import { TradeCheckingComponent } from './trade-checking.component'; |
||||||
|
|
||||||
|
describe('TradeCheckingComponent', () => { |
||||||
|
let component: TradeCheckingComponent; |
||||||
|
let fixture: ComponentFixture<TradeCheckingComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ TradeCheckingComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(TradeCheckingComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
@ -0,0 +1,121 @@ |
|||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
import {FormBuilder, FormGroup} from '@angular/forms'; |
||||||
|
import {NzMessageService, NzModalService} from 'ng-zorro-antd'; |
||||||
|
import {PlatformService} from '../../../services/platform.service'; |
||||||
|
import {TradeCheckingService} from '../../../services/trade-checking.service'; |
||||||
|
import {MerService} from '../../../services/mer.service'; |
||||||
|
import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; |
||||||
|
@Component({ |
||||||
|
selector: 'app-trade-checking', |
||||||
|
templateUrl: './trade-checking.component.html', |
||||||
|
styleUrls: ['./trade-checking.component.scss'] |
||||||
|
}) |
||||||
|
export class TradeCheckingComponent implements OnInit { |
||||||
|
tableLoading = true; |
||||||
|
searchForm: FormGroup; |
||||||
|
pageNum: number; |
||||||
|
whereObject: any = {}; |
||||||
|
|
||||||
|
merArray = []; |
||||||
|
|
||||||
|
dataObjectArray = []; |
||||||
|
dataObject = {}; |
||||||
|
currentDate = new Date(); |
||||||
|
constructor(private modal: NzModalService, |
||||||
|
private message: NzMessageService, |
||||||
|
private form: FormBuilder, |
||||||
|
private platformService: PlatformService, |
||||||
|
private merService: MerService, |
||||||
|
private tradeCheckingService: TradeCheckingService) { |
||||||
|
} |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
this.currentDate.setDate(this.currentDate.getDate() - 1); |
||||||
|
this.searchForm = this.form.group({ |
||||||
|
merNo: [null], |
||||||
|
settleTimeS: [ this.currentDate.getTime() ], |
||||||
|
settleTimeE: [ this.currentDate.getTime() ], |
||||||
|
}); |
||||||
|
|
||||||
|
this.merService.getMerList({ merStatus: 1, pageNum: 1, pageSize: 9999}, data => { |
||||||
|
this.merArray = data['return_data']['list']; |
||||||
|
if (this.merArray.length > 0) { |
||||||
|
this.searchForm.controls['merNo'].setValue(this.merArray[0]['merNo']); |
||||||
|
this.requestData(); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 请求数据 |
||||||
|
*/ |
||||||
|
requestData() { |
||||||
|
this.tableLoading = true; |
||||||
|
this.tradeCheckingService.queryChecking(this.searchForm.value, data => { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
this.dataObjectArray = Array(data['return_data']); |
||||||
|
} else { |
||||||
|
this.modal.error({ |
||||||
|
nzTitle: '提示', |
||||||
|
nzContent: data['return_msg'] |
||||||
|
}); |
||||||
|
} |
||||||
|
this.tableLoading = false; |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 搜索 |
||||||
|
* @param whereObject 条件 |
||||||
|
*/ |
||||||
|
search(whereObject: object) { |
||||||
|
whereObject['settleTimeS'] = new Date(whereObject['settleTimeS']).getTime(); |
||||||
|
whereObject['settleTimeE'] = new Date(whereObject['settleTimeE']).getTime(); |
||||||
|
this.whereObject = whereObject; |
||||||
|
this.requestData(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 重置 |
||||||
|
*/ |
||||||
|
resetForm(): void { |
||||||
|
this.searchForm.reset(); |
||||||
|
this.searchForm.controls['merNo'].setValue(this.merArray.length > 0 ? this.merArray[0]['merNo'] : null); |
||||||
|
this.searchForm.controls['settleTimeS'].setValue(this.currentDate.getTime()); |
||||||
|
this.searchForm.controls['settleTimeE'].setValue(this.currentDate.getTime()); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
disabledDate = (current: Date): boolean => { |
||||||
|
// Can not select days before today and today
|
||||||
|
return differenceInCalendarDays(current, new Date()) > 0; |
||||||
|
}; |
||||||
|
|
||||||
|
|
||||||
|
searchSettleTime(dateType: number, selectDate: Date) { |
||||||
|
if (new Date().getDate() === selectDate.getDate()) { |
||||||
|
this.modal.error({ |
||||||
|
nzTitle: '提示', |
||||||
|
nzContent: '无法选择当日,当日还未清算' |
||||||
|
}); |
||||||
|
// 起始时间
|
||||||
|
if (dateType === 1) { |
||||||
|
this.searchForm.controls['settleTimeS'].setValue(this.currentDate.getTime()); |
||||||
|
// 终止时间
|
||||||
|
} else if (dateType === 2) { |
||||||
|
this.searchForm.controls['settleTimeE'].setValue(this.currentDate.getTime()); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
showPrint() { |
||||||
|
console.log(document.getElementById('print-content').innerHTML); |
||||||
|
const oblHtml = window.document.body.innerHTML; |
||||||
|
const bdhtml = document.getElementById('print-content').innerHTML; |
||||||
|
window.document.body.innerHTML = bdhtml; |
||||||
|
window.print(); |
||||||
|
document.body.innerHTML = oblHtml; |
||||||
|
window.location.reload(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
import { Pipe, PipeTransform } from '@angular/core'; |
||||||
|
|
||||||
|
@Pipe({ |
||||||
|
name: 'createType' |
||||||
|
}) |
||||||
|
export class CreateTypePipe implements PipeTransform { |
||||||
|
|
||||||
|
transform(createType: number): unknown { |
||||||
|
switch (createType) { |
||||||
|
case 1: |
||||||
|
return '扫一扫'; |
||||||
|
case 2: |
||||||
|
return '被扫'; |
||||||
|
case 3: |
||||||
|
return 'API'; |
||||||
|
default: |
||||||
|
return '未知'; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
import { Injectable } from '@angular/core'; |
||||||
|
import {HttpClient} from '@angular/common/http'; |
||||||
|
import {CommonsService} from './commons.service'; |
||||||
|
import {environment} from '../../environments/environment'; |
||||||
|
|
||||||
|
@Injectable({ |
||||||
|
providedIn: 'root' |
||||||
|
}) |
||||||
|
export class TradeCheckingService { |
||||||
|
|
||||||
|
constructor( |
||||||
|
private http: HttpClient, |
||||||
|
private commonsService: CommonsService |
||||||
|
) { } |
||||||
|
|
||||||
|
queryChecking(paramObject: object, callBack) { |
||||||
|
this.http.get(environment.baseUrl + 'tradeOrder/queryChecking?' + this.commonsService.getWhereCondition(paramObject)).subscribe(data => { |
||||||
|
callBack(data); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
queryCheckingDetail(paramObject: object, callBack) { |
||||||
|
this.http.get(environment.baseUrl + 'tradeOrder/queryCheckingDetail?' + this.commonsService.getWhereCondition(paramObject)).subscribe(data => { |
||||||
|
callBack(data); |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue