parent
33b64fdeec
commit
d5369747d6
@ -0,0 +1,122 @@ |
|||||||
|
<!-- 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" *ngIf="adminFlag == 1 && roleType == 5"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="8">代理公司</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="14"> |
||||||
|
<input nz-input formControlName="orgName" /> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</div> |
||||||
|
<div nz-col nzSpan="8" *ngIf="roleType == 5"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="8">代理商</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="14"> |
||||||
|
<input nz-input formControlName="agentName" /> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</div> |
||||||
|
<div nz-col nzSpan="8" *ngIf="roleType == 8 || roleType == 5"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="8">业务员</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="14"> |
||||||
|
<input nz-input formControlName="salesmanName" /> |
||||||
|
</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="orderNo" /> |
||||||
|
</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> |
||||||
|
|
||||||
|
<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: '1150px'}"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th nzWidth="100px" *ngIf="adminFlag == 1 && roleType == 5">代理公司</th> |
||||||
|
<th nzWidth="100px" *ngIf="roleType == 5">代理商</th> |
||||||
|
<th nzWidth="100px" *ngIf="roleType == 8 || roleType == 5">业务员</th> |
||||||
|
<th nzWidth="200px">加油站</th> |
||||||
|
<th nzWidth="200px">订单号</th> |
||||||
|
<th nzWidth="100px">支付类型</th> |
||||||
|
<th nzWidth="100px">加油金额</th> |
||||||
|
<th nzWidth="100px">优惠金额</th> |
||||||
|
<th nzWidth="100px">实付金额</th> |
||||||
|
<th nzWidth="80px">油号</th> |
||||||
|
<th nzWidth="80px">枪号</th> |
||||||
|
<th nzWidth="100px">平台枪价</th> |
||||||
|
<th nzWidth="100px">团油枪价</th> |
||||||
|
<th nzWidth="170px">创建时间</th> |
||||||
|
<th nzWidth="170px">支付时间</th> |
||||||
|
<th nzWidth="110px" nzRight="0px">操作</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of basicTable.data;let i = index"> |
||||||
|
<td *ngIf="adminFlag == 1 && roleType == 5">{{data.orgName}}</td> |
||||||
|
<td *ngIf="roleType == 5">{{data.agentName}}</td> |
||||||
|
<td *ngIf="roleType == 8 || roleType == 5">{{data.salesmanName}}</td> |
||||||
|
<td>{{data.goodsName}}</td> |
||||||
|
<td>{{data.orderNo}}</td> |
||||||
|
<td>{{data.payType}}</td> |
||||||
|
<td>{{data.totalPrice}}元</td> |
||||||
|
<td>{{data.deductionPrice}}元</td> |
||||||
|
<td>{{data.payRealPrice}}元</td> |
||||||
|
<td>{{data.gasOilNo}}</td> |
||||||
|
<td>{{data.gasGunNo}}号</td> |
||||||
|
<td>{{data.platformPrice}}元</td> |
||||||
|
<td>{{data.gasPriceGun}}元</td> |
||||||
|
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||||
|
<td>{{data.payTime | 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 nzDisabled>暂无操作</li> |
||||||
|
</ul> |
||||||
|
</nz-dropdown-menu> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
</div> |
@ -0,0 +1,25 @@ |
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
|
import { TyOrderListComponent } from './ty-order-list.component'; |
||||||
|
|
||||||
|
describe('TyOrderListComponent', () => { |
||||||
|
let component: TyOrderListComponent; |
||||||
|
let fixture: ComponentFixture<TyOrderListComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ TyOrderListComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(TyOrderListComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
@ -0,0 +1,75 @@ |
|||||||
|
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 {TyAgentOilStationService} from '../../../../services/ty-agent-oil-station.service'; |
||||||
|
import {ADMIN_INFO_OBJECT} from "../../../../services/local-storage.namespace"; |
||||||
|
import {LocalStorageService} from "../../../../services/local-storage.service"; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-ty-order-list', |
||||||
|
templateUrl: './ty-order-list.component.html', |
||||||
|
styleUrls: ['./ty-order-list.component.scss'] |
||||||
|
}) |
||||||
|
export class TyOrderListComponent implements OnInit { |
||||||
|
roleType; |
||||||
|
adminFlag; |
||||||
|
|
||||||
|
dataObject: any = {}; |
||||||
|
tableLoading = true; |
||||||
|
searchForm: FormGroup; |
||||||
|
pageNum: number; |
||||||
|
whereObject: any = {}; |
||||||
|
|
||||||
|
constructor(private modal: NzModalService, |
||||||
|
private message: NzMessageService, |
||||||
|
private store: LocalStorageService, |
||||||
|
private tyAgentOilStationService: TyAgentOilStationService, |
||||||
|
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({ |
||||||
|
orderNo: [null], |
||||||
|
goodsName: [null], |
||||||
|
orgName: [null], |
||||||
|
agentName: [null], |
||||||
|
salesmanName: [null], |
||||||
|
}); |
||||||
|
this.requestData(1); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 请求数据 |
||||||
|
*/ |
||||||
|
requestData(pageNum) { |
||||||
|
this.tableLoading = true; |
||||||
|
this.whereObject['pageNum'] = pageNum; |
||||||
|
this.whereObject['pageSize'] = 10; |
||||||
|
this.tyAgentOilStationService.getOrderList(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; |
||||||
|
this.requestData(1); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 重置 |
||||||
|
*/ |
||||||
|
resetForm(): void { |
||||||
|
this.searchForm.reset(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,37 @@ |
|||||||
|
import { Injectable } from '@angular/core'; |
||||||
|
import {HttpClient} from "_@angular_common@9.0.7@@angular/common/http"; |
||||||
|
import {CommonsService} from "./commons.service"; |
||||||
|
import {environment} from "../../environments/environment"; |
||||||
|
|
||||||
|
@Injectable({ |
||||||
|
providedIn: 'root' |
||||||
|
}) |
||||||
|
export class TyAgentPriceService { |
||||||
|
|
||||||
|
constructor( |
||||||
|
private http: HttpClient, |
||||||
|
private common: CommonsService |
||||||
|
) { } |
||||||
|
|
||||||
|
/** |
||||||
|
* 编辑价格 |
||||||
|
* @param paramObject 参数 |
||||||
|
* @param callBack |
||||||
|
*/ |
||||||
|
editPrice(paramObject: object, callBack) { |
||||||
|
this.http.post(environment.baseUrl + 'tyAgentPrice/editPrice', paramObject).subscribe(data => { |
||||||
|
callBack(data); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 油站价格 |
||||||
|
* @param paramObject 参数 |
||||||
|
* @param callBack |
||||||
|
*/ |
||||||
|
getOilStationPrice(oilStationId: number, callBack) { |
||||||
|
this.http.get(environment.baseUrl + 'tyAgentPrice/getOilStationPrice?oilStationId=' + oilStationId).subscribe(data => { |
||||||
|
callBack(data); |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue