提交代码

pull/1/head
胡锐 3 years ago
parent 650d39e5b6
commit d20bbbeed0
  1. 6
      src/app/admin/oil-card/oil-card-list/oil-card-list.component.html
  2. 3
      src/app/admin/oil-card/oil-card-list/oil-card-list.component.ts
  3. 69
      src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.html
  4. 0
      src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.scss
  5. 25
      src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.spec.ts
  6. 102
      src/app/admin/oil-card/oil-card-op-record-list/oil-card-op-record-list.component.ts
  7. 112
      src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.html
  8. 0
      src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.scss
  9. 25
      src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.spec.ts
  10. 103
      src/app/admin/oil-card/oil-card-record-list/oil-card-record-list.component.ts
  11. 6
      src/app/admin/oil-card/oil-card-routing.module.ts
  12. 4
      src/app/admin/oil-card/oil-card.module.ts
  13. 10
      src/app/app-common.module.ts
  14. 2
      src/app/pipes/index.ts
  15. 17
      src/app/pipes/oil-card/oil-card-record-source-type.pipe.ts
  16. 17
      src/app/pipes/oil-card/oil-card-record-type.pipe.ts
  17. 25
      src/app/services/oil-card.service.ts

@ -180,8 +180,8 @@
<li nz-menu-item *ngIf="data.contactPhone" (click)="showEditContactModal(data)"><a >更换联系人</a></li> <li nz-menu-item *ngIf="data.contactPhone" (click)="showEditContactModal(data)"><a >更换联系人</a></li>
<li nz-menu-item *ngIf="data.status == 1" (click)="showDisabledConfirm(data.cardNo)"><a>禁用</a></li> <li nz-menu-item *ngIf="data.status == 1" (click)="showDisabledConfirm(data.cardNo)"><a>禁用</a></li>
<li nz-menu-item *ngIf="data.status == 2" (click)="showEnableConfirm(data.cardNo)"><a>启用</a></li> <li nz-menu-item *ngIf="data.status == 2" (click)="showEnableConfirm(data.cardNo)"><a>启用</a></li>
<li nz-menu-item><a>变更记录</a></li> <li nz-menu-item [routerLink]="['/admin/oil-card/record-op-list']" [queryParams]="{ cardNo: data.cardNo}"><a>变更记录</a></li>
<li nz-menu-item><a>油卡流水</a></li> <li nz-menu-item [routerLink]="['/admin/oil-card/record-list']" [queryParams]="{ cardNo: data.cardNo}"><a>油卡账单</a></li>
</ul> </ul>
</nz-dropdown-menu> </nz-dropdown-menu>
</td> </td>
@ -246,7 +246,7 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<div style="text-align: center;"> <div style="text-align: center;">
<button nz-button nzType="primary" style="width: 150px;" (click)="submitRecharge()">确定</button> <button nz-button nzType="primary" style="width: 150px;" [nzLoading]="rechargeBtnLoading" (click)="submitRecharge()">确定</button>
</div> </div>
</form> </form>
</nz-modal> </nz-modal>

@ -35,6 +35,7 @@ export class OilCardListComponent implements OnInit {
rechargeModal = false; rechargeModal = false;
rechargeForm: FormGroup; rechargeForm: FormGroup;
rechargeBtnLoading = false;
orgArray = []; orgArray = [];
accountObject = { accountObject = {
@ -361,6 +362,7 @@ export class OilCardListComponent implements OnInit {
}); });
return; return;
} }
this.rechargeBtnLoading = true;
this.rechargeForm.value['cardNo'] = this.rechargeForm.controls['cardNo']['value']; this.rechargeForm.value['cardNo'] = this.rechargeForm.controls['cardNo']['value'];
this.oilCardService.recharge(this.rechargeForm.value, data => { this.oilCardService.recharge(this.rechargeForm.value, data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
@ -385,6 +387,7 @@ export class OilCardListComponent implements OnInit {
nzContent: data['return_msg'], nzContent: data['return_msg'],
}); });
} }
this.rechargeBtnLoading = false;
}); });
} }
} }

@ -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();
}
}

@ -1,9 +1,13 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import {OilCardListComponent} from './oil-card-list/oil-card-list.component'; 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 = [ const routes: Routes = [
{ path: 'list', component: OilCardListComponent} { path: 'list', component: OilCardListComponent},
{ path: 'record-list', component: OilCardRecordListComponent},
{ path: 'record-op-list', component: OilCardOpRecordListComponent},
]; ];
@NgModule({ @NgModule({

@ -8,10 +8,12 @@ import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/f
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import {AppCommonModule} from '../../app-common.module'; import {AppCommonModule} from '../../app-common.module';
import {NgxEchartsModule} from '_ngx-echarts@4.2.2@ngx-echarts'; 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({ @NgModule({
declarations: [OilCardListComponent], declarations: [OilCardListComponent, OilCardRecordListComponent, OilCardOpRecordListComponent],
imports: [ imports: [
CommonModule, CommonModule,
OilCardRoutingModule, OilCardRoutingModule,

@ -37,7 +37,11 @@ import {
DiscountPackageStatusPipe, DiscountPackageStatusPipe,
PriceShowPipe, PriceShowPipe,
ShowTypePipe, ShowTypePipe,
EnergyTypePipe, CompanyAmountRecordTypePipe, CompanyAmountRecordSourceTypePipe, OilCardBindStatusPipe EnergyTypePipe,
CompanyAmountRecordTypePipe,
CompanyAmountRecordSourceTypePipe,
OilCardBindStatusPipe,
OilCardRecordTypePipe, OilCardRecordSourceTypePipe
} from './pipes'; } from './pipes';
import {OilCardStatusPipe} from "./pipes/oil-card/oil-card-status.pipe"; import {OilCardStatusPipe} from "./pipes/oil-card/oil-card-status.pipe";
@ -78,7 +82,9 @@ const PIPES = [
CompanyAmountRecordTypePipe, CompanyAmountRecordTypePipe,
CompanyAmountRecordSourceTypePipe, CompanyAmountRecordSourceTypePipe,
OilCardStatusPipe, OilCardStatusPipe,
OilCardBindStatusPipe OilCardBindStatusPipe,
OilCardRecordTypePipe,
OilCardRecordSourceTypePipe,
]; ];

@ -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 './company-amount/company-amount-record-source-type.pipe';
export * from './oil-card/oil-card-status.pipe'; export * from './oil-card/oil-card-status.pipe';
export * from './oil-card/oil-card-bind-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';

@ -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 '出账';
}
}
}

@ -84,4 +84,29 @@ export class OilCardService {
callBack(data); 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);
});
}
} }

Loading…
Cancel
Save