parent
387a765008
commit
0acfbc7a94
@ -0,0 +1,148 @@ |
|||||||
|
<!-- 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" *ngIf="roleType == 5 && adminFlag == 1"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="8">部门</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="14"> |
||||||
|
<nz-select nzShowSearch nzAllowClear formControlName="orgId"> |
||||||
|
<nz-option *ngFor="let item of orgArray" nzLabel="{{item.name}}" nzValue="{{item.id}}"></nz-option> |
||||||
|
</nz-select> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div nz-col nzSpan="8" *ngIf="this.cardNo == null"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="8">油卡卡号</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="14"> |
||||||
|
<input nz-input formControlName="cardNo" /> |
||||||
|
</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"> |
||||||
|
<input nz-input formControlName="goodsName" /> |
||||||
|
</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 nzShowSearch nzAllowClear formControlName="status"> |
||||||
|
<nz-option nzLabel="已支付" nzValue="2"></nz-option> |
||||||
|
<nz-option nzLabel="已完成" nzValue="3"></nz-option> |
||||||
|
<nz-option nzLabel="已退款" nzValue="4"></nz-option> |
||||||
|
<nz-option nzLabel="退款中" nzValue="6"></nz-option> |
||||||
|
<nz-option nzLabel="退款失败" nzValue="7"></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="payTime" |
||||||
|
[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"> |
||||||
|
<button nz-button nzType="primary" class="right-btn" (click)="excelCardOrder()"><i nz-icon nzType="import" nzTheme="outline"></i>导出订单</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 *ngIf="roleType == 5 && adminFlag == 1" nzWidth="150px">所属部门</th> |
||||||
|
<th *ngIf="roleType == 5 && adminFlag == 1" nzWidth="120px">用户手机号</th> |
||||||
|
<th nzWidth="160px">油卡卡号</th> |
||||||
|
<th nzWidth="200px">平台订单号</th> |
||||||
|
<th nzWidth="230px">团油订单号</th> |
||||||
|
<th nzWidth="100px">加油金额</th> |
||||||
|
<th nzWidth="100px">优惠金额</th> |
||||||
|
<th nzWidth="100px">实付金额</th> |
||||||
|
<th nzWidth="200px">加油站</th> |
||||||
|
<th nzWidth="70px">油号</th> |
||||||
|
<th nzWidth="80px">油枪号</th> |
||||||
|
<th nzWidth="110px">团油油枪价</th> |
||||||
|
<th nzWidth="120px">平台油枪价格</th> |
||||||
|
<th nzWidth="100px">订单状态</th> |
||||||
|
<th nzWidth="160px">创建时间</th> |
||||||
|
<th nzWidth="160px">支付时间</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 *ngIf="roleType == 5 && adminFlag == 1">{{data.orgName}}</td> |
||||||
|
<td *ngIf="roleType == 5 && adminFlag == 1">{{data.merPhone}}</td> |
||||||
|
<td>{{data.memCardNo}}</td> |
||||||
|
<td>{{data.orderNo}}</td> |
||||||
|
<td>{{data.gasOrderNo}}</td> |
||||||
|
<td>¥{{data.totalPrice}}</td> |
||||||
|
<td>¥{{data.deductionPrice}}</td> |
||||||
|
<td>¥{{data.payRealPrice}}</td> |
||||||
|
<td>{{data.goodsName}}</td> |
||||||
|
<td>{{data.gasOilNo}}</td> |
||||||
|
<td>{{data.gasGunNo}}</td> |
||||||
|
<td>{{data.gasPriceGun}}</td> |
||||||
|
<td>{{data.platformPriceGun}}</td> |
||||||
|
<td>{{data.statusName}}</td> |
||||||
|
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||||
|
<td>{{data.payTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||||
|
<td>{{data.refundTime | 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 { OilCardOrderComponent } from './oil-card-order.component'; |
||||||
|
|
||||||
|
describe('OilCardOrderComponent', () => { |
||||||
|
let component: OilCardOrderComponent; |
||||||
|
let fixture: ComponentFixture<OilCardOrderComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ OilCardOrderComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(OilCardOrderComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
@ -0,0 +1,131 @@ |
|||||||
|
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'; |
||||||
|
import {environment} from "../../../../environments/environment"; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-oil-card-order', |
||||||
|
templateUrl: './oil-card-order.component.html', |
||||||
|
styleUrls: ['./oil-card-order.component.scss'] |
||||||
|
}) |
||||||
|
export class OilCardOrderComponent implements OnInit { |
||||||
|
FILE_URL = environment.imageUrl; |
||||||
|
roleType; |
||||||
|
adminFlag; |
||||||
|
loadingObject = { |
||||||
|
spinning: false, |
||||||
|
msg: '加载中' |
||||||
|
}; |
||||||
|
|
||||||
|
dataObject: any = {}; |
||||||
|
tableLoading = true; |
||||||
|
searchForm: FormGroup; |
||||||
|
pageNum: number; |
||||||
|
whereObject: any = {}; |
||||||
|
|
||||||
|
cardNo: string; |
||||||
|
orgArray = []; |
||||||
|
|
||||||
|
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({ |
||||||
|
orgId: [null], |
||||||
|
cardNo: [null], |
||||||
|
goodsName: [null], |
||||||
|
status: [null], |
||||||
|
payTime: [null], |
||||||
|
payTimeS: [null], |
||||||
|
payTimeE: [null], |
||||||
|
}); |
||||||
|
this.activatedRoute.queryParams.subscribe(queryParams => { |
||||||
|
if (queryParams['cardNo'] != null) { |
||||||
|
this.cardNo = queryParams['cardNo']; |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
if (this.roleType === 5 && this.adminFlag === 1) { |
||||||
|
this.organizationService.getOrganizationList(this.store.get(ADMIN_INFO_OBJECT)['bsCompany']['id'], data => { |
||||||
|
this.orgArray = data['return_data']; |
||||||
|
}); |
||||||
|
} |
||||||
|
this.requestData(1); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 请求数据 |
||||||
|
*/ |
||||||
|
requestData(pageNum) { |
||||||
|
this.tableLoading = true; |
||||||
|
if (this.cardNo != null) { |
||||||
|
this.whereObject['cardNo'] = this.cardNo; |
||||||
|
} |
||||||
|
this.whereObject['pageNum'] = pageNum; |
||||||
|
this.whereObject['pageSize'] = 10; |
||||||
|
this.oilCardService.getCardOrderList(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.payTime != null) { |
||||||
|
this.searchForm.value.payTimeS = new Date(this.searchForm.value.payTime[0]).getTime(); |
||||||
|
this.searchForm.value.payTimeE = new Date(this.searchForm.value.payTime[1]).getTime(); |
||||||
|
} else { |
||||||
|
this.searchForm.value.payTimeS = null; |
||||||
|
this.searchForm.value.payTimeE = null; |
||||||
|
} |
||||||
|
this.requestData(1); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 重置 |
||||||
|
*/ |
||||||
|
resetForm(): void { |
||||||
|
this.searchForm.reset(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 导出油卡订单 |
||||||
|
*/ |
||||||
|
excelCardOrder() { |
||||||
|
this.oilCardService.exportCardOrder(this.whereObject, data => { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
window.location.href = this.FILE_URL + 'temporary/' + data['return_data']; |
||||||
|
} else { |
||||||
|
this.modal.error({ |
||||||
|
nzTitle: '提示', |
||||||
|
nzContent: data['return_msg'] |
||||||
|
}); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue