parent
c99bf126ba
commit
943853cd9e
@ -0,0 +1,190 @@ |
|||||||
|
<!-- start 面包屑 --> |
||||||
|
<app-breadcrumb></app-breadcrumb> |
||||||
|
<!-- end 面包屑 --> |
||||||
|
|
||||||
|
|
||||||
|
<!-- start 搜索条件 --> |
||||||
|
<div [@openClose]="isCollapse ? 'open' : 'closed'"> |
||||||
|
<div class="inner-content"> |
||||||
|
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , 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"> |
||||||
|
<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="memPhone" /> |
||||||
|
</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 formControlName="status" nzAllowClear> |
||||||
|
<nz-option *ngFor="let item of orderStatusArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option> |
||||||
|
</nz-select> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div nz-row *ngIf="isCollapse"> |
||||||
|
<div nz-col nzSpan="8" *ngIf="roleType == 0 || roleType == 1"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="8">分公司</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="14"> |
||||||
|
<nz-select nzShowSearch formControlName="companyId" nzAllowClear> |
||||||
|
<nz-option *ngFor="let item of companyArray" nzValue="{{item['id']}}" nzLabel="{{item['name']}}"></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="payType"> |
||||||
|
<nz-option nzValue="1" nzLabel="支付宝"></nz-option> |
||||||
|
<nz-option nzValue="2" nzLabel="微信"></nz-option> |
||||||
|
<nz-option nzValue="3" nzLabel="积分抵扣"></nz-option> |
||||||
|
<nz-option nzValue="4" nzLabel="汇联通工会卡"></nz-option> |
||||||
|
<nz-option nzValue="5" nzLabel="银联"></nz-option> |
||||||
|
<nz-option nzValue="6" nzLabel="银联分期"></nz-option> |
||||||
|
<nz-option nzValue="7" 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"> |
||||||
|
<input nz-input formControlName="memCardNo" /> |
||||||
|
</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 |
||||||
|
[nzShowTime]="{ nzHideDisabledOptions: true }" |
||||||
|
formControlName="payTimeArray" |
||||||
|
nzFormat="yyyy-MM-dd HH:mm:ss" |
||||||
|
></nz-range-picker> |
||||||
|
</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 |
||||||
|
[nzShowTime]="{ nzHideDisabledOptions: true }" |
||||||
|
formControlName="createTimeArray" |
||||||
|
nzFormat="yyyy-MM-dd HH:mm:ss" |
||||||
|
></nz-range-picker> |
||||||
|
</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 |
||||||
|
[nzShowTime]="{ nzHideDisabledOptions: true }" |
||||||
|
formControlName="refundTimeArray" |
||||||
|
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)="searchForm.reset();"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button> |
||||||
|
<a class="collapse" (click)="isCollapse = !isCollapse;">{{!isCollapse ? '更多条件' : '隐藏条件'}}<i nz-icon [nzType]="!isCollapse ? 'down' : 'up'"></i></a> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<!-- end 搜索条件 --> |
||||||
|
|
||||||
|
<!--列表数据--> |
||||||
|
<div class="inner-content"> |
||||||
|
<span>共计 {{total?total:0}} 条数据</span> |
||||||
|
<div class="operating-button"> |
||||||
|
<!-- <button nz-button nzType="primary" class="right-btn" (click)="exportExcel()" ><i nz-icon nzType="export" nzTheme="outline"></i>导出Excel</button>--> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!--数组表格 --> |
||||||
|
<nz-table #basicTable |
||||||
|
nzShowPagination |
||||||
|
nzShowSizeChanger |
||||||
|
nzBordered |
||||||
|
[nzData]="requestData" |
||||||
|
[nzTotal]="total" |
||||||
|
[nzLoading]="loading" |
||||||
|
[nzFrontPagination]="false" |
||||||
|
[(nzPageIndex)]="pageNum" |
||||||
|
[(nzPageSize)]="pageSize" |
||||||
|
(nzPageIndexChange)="getRequest(false , searchForm.value)" |
||||||
|
(nzPageSizeChange)="getRequest(false , searchForm.value)" |
||||||
|
[nzPageSizeOptions]="[10,20,50,100]" |
||||||
|
[nzScroll]="{ x: '1200px'}"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th nzWidth="200px">交易单号</th> |
||||||
|
<th nzWidth="130px">客户电话</th> |
||||||
|
<th nzWidth="200px">订单名称</th> |
||||||
|
<th nzWidth="100px">订单金额</th> |
||||||
|
<th nzWidth="100px">支付金额</th> |
||||||
|
<th nzWidth="100px">支付方式</th> |
||||||
|
<th nzWidth="140px">支付卡号</th> |
||||||
|
<th nzWidth="100px">订单状态</th> |
||||||
|
<th nzWidth="180px">创建时间</th> |
||||||
|
<th nzWidth="110px" nzRight="0px">操作</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of basicTable.data;let i = index"> |
||||||
|
<td>{{data.orderNo}}</td> |
||||||
|
<td>{{data.memPhone}}</td> |
||||||
|
<td>{{data.title}}</td> |
||||||
|
<td>¥{{data.totalPrice}}</td> |
||||||
|
<td>¥{{data.payPrice}}</td> |
||||||
|
<td>{{data.orderStatus == 1 || data.orderStatus == 5 ? '未支付' : data.payType | orderPayType}}</td> |
||||||
|
<td>{{data.memCardNo}}</td> |
||||||
|
<td>{{data.orderStatus | orderStatus}}</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 (click)="showOrderDetail(data.orderNo)"><a>详情</a></li>--> |
||||||
|
</ul> |
||||||
|
</nz-dropdown-menu> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
</div> |
||||||
|
|
@ -0,0 +1,118 @@ |
|||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
import {FormBuilder, FormGroup} from '@angular/forms'; |
||||||
|
import {ADMIN_INFO_OBJECT} from '../../../../services/local-storage.namespace'; |
||||||
|
import {LocalStorageService} from '../../../../services/local-storage.service'; |
||||||
|
import {CompanyService} from '../../../../services/company.service'; |
||||||
|
import {CommonsService} from '../../../../services/commons.service'; |
||||||
|
import {animate, state, style, transition, trigger} from '@angular/animations'; |
||||||
|
import {OrderKfcService} from '../../../../services/order/order-kfc.service'; |
||||||
|
import {NzMessageService} from 'ng-zorro-antd'; |
||||||
|
|
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-kfc-order-list', |
||||||
|
animations: [ |
||||||
|
trigger('openClose', [ |
||||||
|
state('open', style({ |
||||||
|
height: '260px', |
||||||
|
opacity: 1, |
||||||
|
backgroundColor: 'white' |
||||||
|
})), |
||||||
|
state('closed', style({ |
||||||
|
opacity: 1, |
||||||
|
backgroundColor: 'white' |
||||||
|
})), |
||||||
|
transition('open => closed', [ |
||||||
|
animate('0.3s') |
||||||
|
]), |
||||||
|
transition('closed => open', [ |
||||||
|
animate('0.3s') |
||||||
|
]), |
||||||
|
]), |
||||||
|
], |
||||||
|
templateUrl: './kfc-order-list.component.html', |
||||||
|
styleUrls: ['./kfc-order-list.component.scss'] |
||||||
|
}) |
||||||
|
export class KfcOrderListComponent implements OnInit { |
||||||
|
|
||||||
|
// 搜索框
|
||||||
|
searchForm: FormGroup; |
||||||
|
// 搜索框折叠
|
||||||
|
isCollapse = false; |
||||||
|
// 订单状态数据
|
||||||
|
orderStatusArray = []; |
||||||
|
// 公司数据
|
||||||
|
companyArray = []; |
||||||
|
// 角色类型
|
||||||
|
roleType: number; |
||||||
|
// 列表相关参数
|
||||||
|
// 总条数
|
||||||
|
total: number; |
||||||
|
// 页码
|
||||||
|
pageNum = 1; |
||||||
|
// 条码
|
||||||
|
pageSize = 10; |
||||||
|
// 列表数据
|
||||||
|
requestData = []; |
||||||
|
// 列表加载
|
||||||
|
loading = true; |
||||||
|
constructor( |
||||||
|
private form: FormBuilder, |
||||||
|
private store: LocalStorageService, |
||||||
|
private message: NzMessageService, |
||||||
|
private kfcOrder: OrderKfcService, |
||||||
|
private companyService: CompanyService, |
||||||
|
private commonsService: CommonsService, |
||||||
|
) { } |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
// 搜索表单初始化
|
||||||
|
this.searchForm = this.form.group({ |
||||||
|
orderNo: [null], |
||||||
|
memPhone: [null], |
||||||
|
payTimeArray: [null], |
||||||
|
status: [null], |
||||||
|
createTimeArray: [null], |
||||||
|
refundTimeArray: [null], |
||||||
|
companyId: [null], |
||||||
|
payType: [null], |
||||||
|
memCardNo: [null], |
||||||
|
}); |
||||||
|
// 角色类型初始化
|
||||||
|
this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType); |
||||||
|
// 查询公司列表
|
||||||
|
if (this.roleType === 0 || this.roleType === 1) { |
||||||
|
this.companyService.selectCompanyList({ pageNum: 1, pageSize: 999 }, data => { |
||||||
|
this.companyArray = data['return_data']['list']; |
||||||
|
}); |
||||||
|
} |
||||||
|
// 查询订单状态数据
|
||||||
|
this.commonsService.getDictionary('ORDER_OIL_STATUS', data => { |
||||||
|
this.orderStatusArray = data['return_data']; |
||||||
|
}); |
||||||
|
this.getRequest(true, this.searchForm.value); |
||||||
|
} |
||||||
|
|
||||||
|
// 查询列表
|
||||||
|
public getRequest(reset: boolean = false, whereObject: object) { |
||||||
|
this.loading = true; |
||||||
|
if (reset) { |
||||||
|
this.pageNum = 1; |
||||||
|
} |
||||||
|
whereObject['pageNum'] = this.pageNum; |
||||||
|
whereObject['pageSize'] = this.pageSize; |
||||||
|
this.kfcOrder.getOrderKfcList(whereObject, data => { |
||||||
|
this.loading = false; |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
console.log(data); |
||||||
|
this.requestData = data['return_data'].list; |
||||||
|
this.total = data['return_data'].total; |
||||||
|
} else { |
||||||
|
this.message.error(data['return_msg']); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
@ -0,0 +1,20 @@ |
|||||||
|
import { Pipe, PipeTransform } from '@angular/core'; |
||||||
|
|
||||||
|
@Pipe({ |
||||||
|
name: 'productType' |
||||||
|
}) |
||||||
|
export class ProductTypePipe implements PipeTransform { |
||||||
|
|
||||||
|
array = { |
||||||
|
1: ['星巴克'], |
||||||
|
2: ['', '肯德基'], |
||||||
|
3: ['', '', '第三方产品'], |
||||||
|
4: ['中石化', '消费券', '其他卡券' , '贵州中石化' , '重庆中石油'], |
||||||
|
5: ['', '', '', '', '在线加油'], |
||||||
|
}; |
||||||
|
|
||||||
|
transform(type: number , product: number): string { |
||||||
|
return this.array[type][product - 1]; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,29 @@ |
|||||||
|
import { Injectable } from '@angular/core'; |
||||||
|
import {HttpClient} from '@angular/common/http'; |
||||||
|
import {CommonsService} from '../commons.service'; |
||||||
|
import {environment} from "../../../environments/environment"; |
||||||
|
|
||||||
|
|
||||||
|
@Injectable({ |
||||||
|
providedIn: 'root' |
||||||
|
}) |
||||||
|
export class OrderKfcService { |
||||||
|
|
||||||
|
constructor( |
||||||
|
private http: HttpClient, |
||||||
|
private common: CommonsService |
||||||
|
) { } |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author Sum1Dream |
||||||
|
* @methodName getOrderKfcList |
||||||
|
* @Description // 查询肯德基订单
|
||||||
|
* @Date 17:20 2022/10/27 |
||||||
|
* @Param param |
||||||
|
*/ |
||||||
|
public getOrderKfcList(param: object, callBack) { |
||||||
|
this.http.get(environment.orderUrl + 'thirdParty/getOrderKfcList?' + this.common.getWhereCondition(param)).subscribe(data => { |
||||||
|
callBack(data); |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue