parent
650d39e5b6
commit
d20bbbeed0
@ -0,0 +1,69 @@ |
|||||||
|
<!-- start 面包屑 --> |
||||||
|
<app-breadcrumb></app-breadcrumb> |
||||||
|
<!-- end 面包屑 --> |
||||||
|
<!--条件搜索--> |
||||||
|
|
||||||
|
<nz-spin [nzSpinning]="loadingObject.spinning" nzTip="{{loadingObject.msg}}"> |
||||||
|
<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-range-picker |
||||||
|
formControlName="createTime" |
||||||
|
[nzShowTime]="{ nzHideDisabledOptions: true}" |
||||||
|
nzFormat="yyyy-MM-dd HH:mm:ss" |
||||||
|
></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>共计 {{dataObject.total?dataObject.total:0}} 条数据</span> |
||||||
|
<div class="operating-button"> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!--数组表格 --> |
||||||
|
<nz-table #basicTable |
||||||
|
[nzData]="dataObject.list" |
||||||
|
[nzTotal]="dataObject.total" |
||||||
|
[nzFrontPagination]="false" |
||||||
|
[nzLoading]="tableLoading" |
||||||
|
[nzPageIndex]="whereObject.pageNum" |
||||||
|
(nzPageIndexChange)="requestData($event)" |
||||||
|
[nzScroll]="{ x: '1100px'}"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th nzWidth="60px">序号</th> |
||||||
|
<th nzWidth="160px">卡号</th> |
||||||
|
<th nzWidth="400px">变更内容</th> |
||||||
|
<th nzWidth="80px">操作人</th> |
||||||
|
<th nzWidth="160px">创建时间</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of basicTable.data;let i = index"> |
||||||
|
<td>{{i+1}}</td> |
||||||
|
<td>{{data.cardNo}}</td> |
||||||
|
<td>{{data.content}}</td> |
||||||
|
<td>{{data.opUserName}}</td> |
||||||
|
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
</div> |
||||||
|
</nz-spin> |
@ -0,0 +1,25 @@ |
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
|
import { OilCardOpRecordListComponent } from './oil-card-op-record-list.component'; |
||||||
|
|
||||||
|
describe('OilCardOpRecordListComponent', () => { |
||||||
|
let component: OilCardOpRecordListComponent; |
||||||
|
let fixture: ComponentFixture<OilCardOpRecordListComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ OilCardOpRecordListComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(OilCardOpRecordListComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
@ -0,0 +1,102 @@ |
|||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
import {FormBuilder, FormGroup} from "_@angular_forms@9.0.7@@angular/forms"; |
||||||
|
import {NzMessageService, NzModalService} from "_ng-zorro-antd@9.3.0@ng-zorro-antd"; |
||||||
|
import {LocalStorageService} from "../../../services/local-storage.service"; |
||||||
|
import {OilCardService} from "../../../services/oil-card.service"; |
||||||
|
import {OrganizationService} from "../../../services/organization.service"; |
||||||
|
import {NavigationComponent} from "../../navigation/navigation.component"; |
||||||
|
import {CompanyAccountService} from "../../../services/company-account.service"; |
||||||
|
import {ActivatedRoute} from "_@angular_router@9.0.7@@angular/router"; |
||||||
|
import {ADMIN_INFO_OBJECT} from "../../../services/local-storage.namespace"; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-oil-card-op-record-list', |
||||||
|
templateUrl: './oil-card-op-record-list.component.html', |
||||||
|
styleUrls: ['./oil-card-op-record-list.component.scss'] |
||||||
|
}) |
||||||
|
export class OilCardOpRecordListComponent implements OnInit { |
||||||
|
roleType; |
||||||
|
adminFlag; |
||||||
|
loadingObject = { |
||||||
|
spinning: false, |
||||||
|
msg: '加载中' |
||||||
|
}; |
||||||
|
|
||||||
|
dataObject: any = {}; |
||||||
|
tableLoading = true; |
||||||
|
searchForm: FormGroup; |
||||||
|
pageNum: number; |
||||||
|
whereObject: any = {}; |
||||||
|
|
||||||
|
cardNo: string; |
||||||
|
|
||||||
|
constructor(private modal: NzModalService, |
||||||
|
private message: NzMessageService, |
||||||
|
private store: LocalStorageService, |
||||||
|
private oilCardService: OilCardService, |
||||||
|
private organizationService: OrganizationService, |
||||||
|
private navigationComponent: NavigationComponent, |
||||||
|
private companyAccountService: CompanyAccountService, |
||||||
|
private activatedRoute: ActivatedRoute, |
||||||
|
private form: FormBuilder) { |
||||||
|
this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType); |
||||||
|
this.adminFlag = Number(this.store.get(ADMIN_INFO_OBJECT)['secUser'].adminFlag); |
||||||
|
} |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
this.searchForm = this.form.group({ |
||||||
|
type: [null], |
||||||
|
sourceType: [null], |
||||||
|
createTime: [null], |
||||||
|
createTimeS: [null], |
||||||
|
createTimeE: [null], |
||||||
|
}); |
||||||
|
this.activatedRoute.queryParams.subscribe(queryParams => { |
||||||
|
if (queryParams['cardNo'] != null) { |
||||||
|
this.cardNo = queryParams['cardNo']; |
||||||
|
this.requestData(1); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 请求数据 |
||||||
|
*/ |
||||||
|
requestData(pageNum) { |
||||||
|
this.tableLoading = true; |
||||||
|
this.whereObject['cardNo'] = this.cardNo; |
||||||
|
this.whereObject['pageNum'] = pageNum; |
||||||
|
this.whereObject['pageSize'] = 10; |
||||||
|
this.oilCardService.getOilCardContactRecordList(this.whereObject, data => { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
this.dataObject = data['return_data']; |
||||||
|
} else { |
||||||
|
this.modal.error(data['return_msg']); |
||||||
|
} |
||||||
|
this.tableLoading = false; |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 搜索 |
||||||
|
* @param whereObject 条件 |
||||||
|
*/ |
||||||
|
search(whereObject: object) { |
||||||
|
this.whereObject = whereObject; |
||||||
|
if (this.searchForm.value.createTime != null) { |
||||||
|
this.searchForm.value.createTimeS = new Date(this.searchForm.value.createTime[0]).getTime(); |
||||||
|
this.searchForm.value.createTimeE = new Date(this.searchForm.value.createTime[1]).getTime(); |
||||||
|
} else { |
||||||
|
this.searchForm.value.createTimeS = null; |
||||||
|
this.searchForm.value.createTimeE = null; |
||||||
|
} |
||||||
|
this.requestData(1); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 重置 |
||||||
|
*/ |
||||||
|
resetForm(): void { |
||||||
|
this.searchForm.reset(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,112 @@ |
|||||||
|
<!-- start 面包屑 --> |
||||||
|
<app-breadcrumb></app-breadcrumb> |
||||||
|
<!-- end 面包屑 --> |
||||||
|
<!--条件搜索--> |
||||||
|
|
||||||
|
<nz-spin [nzSpinning]="loadingObject.spinning" nzTip="{{loadingObject.msg}}"> |
||||||
|
<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="type"> |
||||||
|
<nz-option nzValue="1" nzLabel="进账"></nz-option> |
||||||
|
<nz-option nzValue="2" nzLabel="出账"></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 nzAllowClear formControlName="sourceType"> |
||||||
|
<nz-option nzValue="1" nzLabel="充值金额"></nz-option> |
||||||
|
<nz-option nzValue="2" nzLabel="订单消费"></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-range-picker |
||||||
|
formControlName="createTime" |
||||||
|
[nzShowTime]="{ nzHideDisabledOptions: true}" |
||||||
|
nzFormat="yyyy-MM-dd HH:mm:ss" |
||||||
|
></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>共计 {{dataObject.total?dataObject.total:0}} 条数据</span> |
||||||
|
<div class="operating-button"> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!--数组表格 --> |
||||||
|
<nz-table #basicTable |
||||||
|
[nzData]="dataObject.list" |
||||||
|
[nzTotal]="dataObject.total" |
||||||
|
[nzFrontPagination]="false" |
||||||
|
[nzLoading]="tableLoading" |
||||||
|
[nzPageIndex]="whereObject.pageNum" |
||||||
|
(nzPageIndexChange)="requestData($event)" |
||||||
|
[nzScroll]="{ x: '1100px'}"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th nzWidth="60px">序号</th> |
||||||
|
<th nzWidth="160px">卡号</th> |
||||||
|
<th nzWidth="100px">账单类型</th> |
||||||
|
<th nzWidth="100px">交易金额</th> |
||||||
|
<th nzWidth="120px">交易前金额</th> |
||||||
|
<th nzWidth="120px">交易后金额</th> |
||||||
|
<th nzWidth="100px">来源类型</th> |
||||||
|
<th nzWidth="200px">来源内容</th> |
||||||
|
<th nzWidth="80px">操作人</th> |
||||||
|
<th nzWidth="160px">创建时间</th> |
||||||
|
<!-- <th nzWidth="160px" nzRight="0px">操作</th>--> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of basicTable.data;let i = index"> |
||||||
|
<td>{{i+1}}</td> |
||||||
|
<td>{{data.cardNo}}</td> |
||||||
|
<td>{{data.type | oilCardRecordType}}</td> |
||||||
|
<td>¥{{data.amount}}</td> |
||||||
|
<td>¥{{data.beforeAmount}}</td> |
||||||
|
<td>¥{{data.afterAmount}}</td> |
||||||
|
<td>{{data.sourceType | oilCardRecordSourceType}}</td> |
||||||
|
<td>{{data.sourceContent}}</td> |
||||||
|
<td>{{data.opUserName}}</td> |
||||||
|
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||||
|
<!-- <td nzRight="0px" class="table-td-operation"> |
||||||
|
<a nz-dropdown [nzDropdownMenu]="menu"> 操作列表 <i nz-icon nzType="down"></i> </a> |
||||||
|
<nz-dropdown-menu #menu="nzDropdownMenu"> |
||||||
|
<ul nz-menu nzSelectable> |
||||||
|
<li nz-menu-item><a></a></li> |
||||||
|
</ul> |
||||||
|
</nz-dropdown-menu> |
||||||
|
</td>--> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
</div> |
||||||
|
</nz-spin> |
@ -0,0 +1,25 @@ |
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
|
import { OilCardRecordListComponent } from './oil-card-record-list.component'; |
||||||
|
|
||||||
|
describe('OilCardRecordListComponent', () => { |
||||||
|
let component: OilCardRecordListComponent; |
||||||
|
let fixture: ComponentFixture<OilCardRecordListComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ OilCardRecordListComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(OilCardRecordListComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
@ -0,0 +1,103 @@ |
|||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms'; |
||||||
|
import {NzMessageService, NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; |
||||||
|
import {LocalStorageService} from '../../../services/local-storage.service'; |
||||||
|
import {OilCardService} from '../../../services/oil-card.service'; |
||||||
|
import {OrganizationService} from '../../../services/organization.service'; |
||||||
|
import {NavigationComponent} from '../../navigation/navigation.component'; |
||||||
|
import {CompanyAccountService} from '../../../services/company-account.service'; |
||||||
|
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; |
||||||
|
import {ActivatedRoute} from '_@angular_router@9.0.7@@angular/router'; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-oil-card-record-list', |
||||||
|
templateUrl: './oil-card-record-list.component.html', |
||||||
|
styleUrls: ['./oil-card-record-list.component.scss'] |
||||||
|
}) |
||||||
|
export class OilCardRecordListComponent implements OnInit { |
||||||
|
roleType; |
||||||
|
adminFlag; |
||||||
|
loadingObject = { |
||||||
|
spinning: false, |
||||||
|
msg: '加载中' |
||||||
|
}; |
||||||
|
|
||||||
|
dataObject: any = {}; |
||||||
|
tableLoading = true; |
||||||
|
searchForm: FormGroup; |
||||||
|
pageNum: number; |
||||||
|
whereObject: any = {}; |
||||||
|
|
||||||
|
cardNo: string; |
||||||
|
|
||||||
|
constructor(private modal: NzModalService, |
||||||
|
private message: NzMessageService, |
||||||
|
private store: LocalStorageService, |
||||||
|
private oilCardService: OilCardService, |
||||||
|
private organizationService: OrganizationService, |
||||||
|
private navigationComponent: NavigationComponent, |
||||||
|
private companyAccountService: CompanyAccountService, |
||||||
|
private activatedRoute: ActivatedRoute, |
||||||
|
private form: FormBuilder) { |
||||||
|
this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType); |
||||||
|
this.adminFlag = Number(this.store.get(ADMIN_INFO_OBJECT)['secUser'].adminFlag); |
||||||
|
} |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
this.searchForm = this.form.group({ |
||||||
|
type: [null], |
||||||
|
sourceType: [null], |
||||||
|
createTime: [null], |
||||||
|
createTimeS: [null], |
||||||
|
createTimeE: [null], |
||||||
|
}); |
||||||
|
this.activatedRoute.queryParams.subscribe(queryParams => { |
||||||
|
if (queryParams['cardNo'] != null) { |
||||||
|
this.cardNo = queryParams['cardNo']; |
||||||
|
this.requestData(1); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 请求数据 |
||||||
|
*/ |
||||||
|
requestData(pageNum) { |
||||||
|
this.tableLoading = true; |
||||||
|
this.whereObject['cardNo'] = this.cardNo; |
||||||
|
this.whereObject['pageNum'] = pageNum; |
||||||
|
this.whereObject['pageSize'] = 10; |
||||||
|
this.oilCardService.getOilCardRecordList(this.whereObject, data => { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
this.dataObject = data['return_data']; |
||||||
|
} else { |
||||||
|
this.modal.error(data['return_msg']); |
||||||
|
} |
||||||
|
this.tableLoading = false; |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 搜索 |
||||||
|
* @param whereObject 条件 |
||||||
|
*/ |
||||||
|
search(whereObject: object) { |
||||||
|
this.whereObject = whereObject; |
||||||
|
if (this.searchForm.value.createTime != null) { |
||||||
|
this.searchForm.value.createTimeS = new Date(this.searchForm.value.createTime[0]).getTime(); |
||||||
|
this.searchForm.value.createTimeE = new Date(this.searchForm.value.createTime[1]).getTime(); |
||||||
|
} else { |
||||||
|
this.searchForm.value.createTimeS = null; |
||||||
|
this.searchForm.value.createTimeE = null; |
||||||
|
} |
||||||
|
this.requestData(1); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 重置 |
||||||
|
*/ |
||||||
|
resetForm(): void { |
||||||
|
this.searchForm.reset(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,17 @@ |
|||||||
|
import { Pipe, PipeTransform } from '@angular/core'; |
||||||
|
|
||||||
|
@Pipe({ |
||||||
|
name: 'oilCardRecordSourceType' |
||||||
|
}) |
||||||
|
export class OilCardRecordSourceTypePipe implements PipeTransform { |
||||||
|
|
||||||
|
transform(value: number): string { |
||||||
|
switch (value) { |
||||||
|
case 1: |
||||||
|
return '充值金额'; |
||||||
|
case 2: |
||||||
|
return '订单消费'; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,17 @@ |
|||||||
|
import { Pipe, PipeTransform } from '@angular/core'; |
||||||
|
|
||||||
|
@Pipe({ |
||||||
|
name: 'oilCardRecordType' |
||||||
|
}) |
||||||
|
export class OilCardRecordTypePipe implements PipeTransform { |
||||||
|
|
||||||
|
transform(value: number): string { |
||||||
|
switch (value) { |
||||||
|
case 1: |
||||||
|
return '进账'; |
||||||
|
case 2: |
||||||
|
return '出账'; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue