From d20bbbeed0f327a5d721e9609f8ff22ce607e3ff Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Sun, 17 Apr 2022 22:08:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oil-card-list.component.html | 6 +- .../oil-card-list/oil-card-list.component.ts | 3 + .../oil-card-op-record-list.component.html | 69 +++++++++++ .../oil-card-op-record-list.component.scss | 0 .../oil-card-op-record-list.component.spec.ts | 25 ++++ .../oil-card-op-record-list.component.ts | 102 ++++++++++++++++ .../oil-card-record-list.component.html | 112 ++++++++++++++++++ .../oil-card-record-list.component.scss | 0 .../oil-card-record-list.component.spec.ts | 25 ++++ .../oil-card-record-list.component.ts | 103 ++++++++++++++++ .../admin/oil-card/oil-card-routing.module.ts | 6 +- src/app/admin/oil-card/oil-card.module.ts | 4 +- src/app/app-common.module.ts | 10 +- src/app/pipes/index.ts | 2 + .../oil-card-record-source-type.pipe.ts | 17 +++ .../oil-card/oil-card-record-type.pipe.ts | 17 +++ src/app/services/oil-card.service.ts | 25 ++++ 17 files changed, 519 insertions(+), 7 deletions(-) create mode 100644 src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.html create mode 100644 src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.scss create mode 100644 src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.spec.ts create mode 100644 src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.ts create mode 100644 src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.html create mode 100644 src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.scss create mode 100644 src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.spec.ts create mode 100644 src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.ts create mode 100644 src/app/pipes/oil-card/oil-card-record-source-type.pipe.ts create mode 100644 src/app/pipes/oil-card/oil-card-record-type.pipe.ts diff --git a/src/app/admin/oil-card/oil-card-list/oil-card-list.component.html b/src/app/admin/oil-card/oil-card-list/oil-card-list.component.html index fdedf1c..7b5bd9d 100644 --- a/src/app/admin/oil-card/oil-card-list/oil-card-list.component.html +++ b/src/app/admin/oil-card/oil-card-list/oil-card-list.component.html @@ -180,8 +180,8 @@
  • 更换联系人
  • 禁用
  • 启用
  • -
  • 变更记录
  • -
  • 油卡流水
  • +
  • 变更记录
  • +
  • 油卡账单
  • @@ -246,7 +246,7 @@
    - +
    diff --git a/src/app/admin/oil-card/oil-card-list/oil-card-list.component.ts b/src/app/admin/oil-card/oil-card-list/oil-card-list.component.ts index 373a563..f4488f1 100644 --- a/src/app/admin/oil-card/oil-card-list/oil-card-list.component.ts +++ b/src/app/admin/oil-card/oil-card-list/oil-card-list.component.ts @@ -35,6 +35,7 @@ export class OilCardListComponent implements OnInit { rechargeModal = false; rechargeForm: FormGroup; + rechargeBtnLoading = false; orgArray = []; accountObject = { @@ -361,6 +362,7 @@ export class OilCardListComponent implements OnInit { }); return; } + this.rechargeBtnLoading = true; this.rechargeForm.value['cardNo'] = this.rechargeForm.controls['cardNo']['value']; this.oilCardService.recharge(this.rechargeForm.value, data => { if (data['return_code'] === '000000') { @@ -385,6 +387,7 @@ export class OilCardListComponent implements OnInit { nzContent: data['return_msg'], }); } + this.rechargeBtnLoading = false; }); } } diff --git a/src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.html b/src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.html new file mode 100644 index 0000000..b7f2a84 --- /dev/null +++ b/src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.html @@ -0,0 +1,69 @@ + + + + + + +
    +
    +
    + +
    + + 创建时间 + + + + +
    + +
    + +
    +
    + + +
    +
    +
    +
    + +
    + 共计 {{dataObject.total?dataObject.total:0}} 条数据 +
    +
    + + + + + + 序号 + 卡号 + 变更内容 + 操作人 + 创建时间 + + + + + {{i+1}} + {{data.cardNo}} + {{data.content}} + {{data.opUserName}} + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + + + +
    +
    diff --git a/src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.scss b/src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.spec.ts b/src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.spec.ts new file mode 100644 index 0000000..6a8f5fe --- /dev/null +++ b/src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.spec.ts @@ -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; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ OilCardOpRecordListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OilCardOpRecordListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.ts b/src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.ts new file mode 100644 index 0000000..6875cf9 --- /dev/null +++ b/src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.ts @@ -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(); + } +} diff --git a/src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.html b/src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.html new file mode 100644 index 0000000..457bd45 --- /dev/null +++ b/src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.html @@ -0,0 +1,112 @@ + + + + + + +
    +
    +
    + +
    + + 流水类型 + + + + + + + +
    + +
    + + 来源类型 + + + + + + + +
    + +
    + + 创建时间 + + + + +
    + +
    + +
    +
    + + +
    +
    +
    +
    + +
    + 共计 {{dataObject.total?dataObject.total:0}} 条数据 +
    +
    + + + + + + 序号 + 卡号 + 账单类型 + 交易金额 + 交易前金额 + 交易后金额 + 来源类型 + 来源内容 + 操作人 + 创建时间 + + + + + + {{i+1}} + {{data.cardNo}} + {{data.type | oilCardRecordType}} + ¥{{data.amount}} + ¥{{data.beforeAmount}} + ¥{{data.afterAmount}} + {{data.sourceType | oilCardRecordSourceType}} + {{data.sourceContent}} + {{data.opUserName}} + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + + + + +
    +
    diff --git a/src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.scss b/src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.spec.ts b/src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.spec.ts new file mode 100644 index 0000000..560baba --- /dev/null +++ b/src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.spec.ts @@ -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; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ OilCardRecordListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OilCardRecordListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.ts b/src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.ts new file mode 100644 index 0000000..9bd8bee --- /dev/null +++ b/src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.ts @@ -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(); + } + +} diff --git a/src/app/admin/oil-card/oil-card-routing.module.ts b/src/app/admin/oil-card/oil-card-routing.module.ts index c6122e0..92d8ba8 100644 --- a/src/app/admin/oil-card/oil-card-routing.module.ts +++ b/src/app/admin/oil-card/oil-card-routing.module.ts @@ -1,9 +1,13 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import {OilCardListComponent} from './oil-card-list/oil-card-list.component'; +import {OilCardRecordListComponent} from './oil-card-record-list/oil-card-record-list.component'; +import {OilCardOpRecordListComponent} from './oil-card-op-record-list/oil-card-op-record-list.component'; const routes: Routes = [ - { path: 'list', component: OilCardListComponent} + { path: 'list', component: OilCardListComponent}, + { path: 'record-list', component: OilCardRecordListComponent}, + { path: 'record-op-list', component: OilCardOpRecordListComponent}, ]; @NgModule({ diff --git a/src/app/admin/oil-card/oil-card.module.ts b/src/app/admin/oil-card/oil-card.module.ts index 18c129a..b9b7618 100644 --- a/src/app/admin/oil-card/oil-card.module.ts +++ b/src/app/admin/oil-card/oil-card.module.ts @@ -8,10 +8,12 @@ import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/f import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; import {AppCommonModule} from '../../app-common.module'; import {NgxEchartsModule} from '_ngx-echarts@4.2.2@ngx-echarts'; +import { OilCardRecordListComponent } from './oil-card-record-list/oil-card-record-list.component'; +import { OilCardOpRecordListComponent } from './oil-card-op-record-list/oil-card-op-record-list.component'; @NgModule({ - declarations: [OilCardListComponent], + declarations: [OilCardListComponent, OilCardRecordListComponent, OilCardOpRecordListComponent], imports: [ CommonModule, OilCardRoutingModule, diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts index 8adaaf0..86b5820 100644 --- a/src/app/app-common.module.ts +++ b/src/app/app-common.module.ts @@ -37,7 +37,11 @@ import { DiscountPackageStatusPipe, PriceShowPipe, ShowTypePipe, - EnergyTypePipe, CompanyAmountRecordTypePipe, CompanyAmountRecordSourceTypePipe, OilCardBindStatusPipe + EnergyTypePipe, + CompanyAmountRecordTypePipe, + CompanyAmountRecordSourceTypePipe, + OilCardBindStatusPipe, + OilCardRecordTypePipe, OilCardRecordSourceTypePipe } from './pipes'; import {OilCardStatusPipe} from "./pipes/oil-card/oil-card-status.pipe"; @@ -78,7 +82,9 @@ const PIPES = [ CompanyAmountRecordTypePipe, CompanyAmountRecordSourceTypePipe, OilCardStatusPipe, - OilCardBindStatusPipe + OilCardBindStatusPipe, + OilCardRecordTypePipe, + OilCardRecordSourceTypePipe, ]; diff --git a/src/app/pipes/index.ts b/src/app/pipes/index.ts index a2cdd28..7481d5f 100644 --- a/src/app/pipes/index.ts +++ b/src/app/pipes/index.ts @@ -30,3 +30,5 @@ export * from './company-amount/company-amount-record-type.pipe'; export * from './company-amount/company-amount-record-source-type.pipe'; export * from './oil-card/oil-card-status.pipe'; export * from './oil-card/oil-card-bind-status.pipe'; +export * from './oil-card/oil-card-record-type.pipe'; +export * from './oil-card/oil-card-record-source-type.pipe'; diff --git a/src/app/pipes/oil-card/oil-card-record-source-type.pipe.ts b/src/app/pipes/oil-card/oil-card-record-source-type.pipe.ts new file mode 100644 index 0000000..88bb28e --- /dev/null +++ b/src/app/pipes/oil-card/oil-card-record-source-type.pipe.ts @@ -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 '订单消费'; + } + } + +} diff --git a/src/app/pipes/oil-card/oil-card-record-type.pipe.ts b/src/app/pipes/oil-card/oil-card-record-type.pipe.ts new file mode 100644 index 0000000..f1cb372 --- /dev/null +++ b/src/app/pipes/oil-card/oil-card-record-type.pipe.ts @@ -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 '出账'; + } + } + +} diff --git a/src/app/services/oil-card.service.ts b/src/app/services/oil-card.service.ts index aa156aa..130671e 100644 --- a/src/app/services/oil-card.service.ts +++ b/src/app/services/oil-card.service.ts @@ -84,4 +84,29 @@ export class OilCardService { callBack(data); }); } + + /** + * 油卡记录列表 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public getOilCardRecordList(param: object, callBack) { + this.http.get(environment.baseUrl + 'oilCardRecord/getOilCardRecordList?' + this.common.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } + + + /** + * 油卡操作记录列表 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public getOilCardContactRecordList(param: object, callBack) { + this.http.get(environment.baseUrl + 'oilCardContactRecord/getOilCardContactRecordList?' + this.common.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } }