* dev_yy: 提交代理商订单页面 提交代理商订单页面 1 提交抽奖内容 提交代码 1 # Conflicts: # src/app/admin/index/index.module.ts # src/app/app-common.module.ts # src/app/pipes/index.ts # src/app/services/index.service.ts # src/environments/environment.tspull/1/head
commit
5b56b8dcca
@ -0,0 +1,19 @@ |
||||
import { NgModule } from '@angular/core'; |
||||
import { Routes, RouterModule } from '@angular/router'; |
||||
import {PhoneOrderComponent} from './phone-order/phone-order.component'; |
||||
import {VipTopUpOrderComponent} from './vip-top-up-order/vip-top-up-order.component'; |
||||
import {KfcOrderComponent} from './kfc-order/kfc-order.component'; |
||||
import {ListComponent} from './starbucks-order/list/list.component'; |
||||
|
||||
const routes: Routes = [ |
||||
{ path: 'phone-order', component: PhoneOrderComponent }, |
||||
{ path: 'vip-top-up-order', component: VipTopUpOrderComponent }, |
||||
{ path: 'kfc-order', component: KfcOrderComponent }, |
||||
{ path: 'starbuck-order', component: ListComponent } |
||||
]; |
||||
|
||||
@NgModule({ |
||||
imports: [RouterModule.forChild(routes)], |
||||
exports: [RouterModule] |
||||
}) |
||||
export class ApiOrderRoutingModule { } |
@ -0,0 +1,40 @@ |
||||
import { NgModule } from '@angular/core'; |
||||
import { CommonModule } from '@angular/common'; |
||||
import { PhoneOrderComponent } from './phone-order/phone-order.component'; |
||||
import {SystemRoutingModule} from '../system/system-routing.module'; |
||||
import {NgZorroAntdModule} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; |
||||
import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/forms'; |
||||
import {NgxNeditorModule} from '_@notadd_ngx-neditor@1.0.2@@notadd/ngx-neditor'; |
||||
import {RichtextModule} from '../../common/richtext/richtext.module'; |
||||
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; |
||||
import {RegionSelectorModule} from '../../common/region-selector/region-selector.module'; |
||||
import {NgxEchartsModule} from '_ngx-echarts@4.2.2@ngx-echarts'; |
||||
import {IndexRoutingModule} from '../index/index-routing.module'; |
||||
import {AppCommonModule} from '../../app-common.module'; |
||||
import {NzSpaceModule} from '_ng-zorro-antd@9.3.0@ng-zorro-antd/space'; |
||||
import {ApiOrderRoutingModule} from './api-order-routing.module'; |
||||
import { ListComponent } from './starbucks-order/list/list.component'; |
||||
import { KfcOrderComponent } from './kfc-order/kfc-order.component'; |
||||
import { VipTopUpOrderComponent } from './vip-top-up-order/vip-top-up-order.component'; |
||||
|
||||
|
||||
|
||||
@NgModule({ |
||||
declarations: [PhoneOrderComponent, ListComponent, KfcOrderComponent, VipTopUpOrderComponent], |
||||
imports: [ |
||||
CommonModule, |
||||
ApiOrderRoutingModule, |
||||
NgZorroAntdModule, |
||||
FormsModule, |
||||
ReactiveFormsModule, |
||||
NgxNeditorModule, |
||||
RichtextModule, |
||||
BreadcrumbModule, |
||||
RegionSelectorModule, |
||||
NgxEchartsModule, |
||||
IndexRoutingModule, |
||||
AppCommonModule, |
||||
NzSpaceModule |
||||
] |
||||
}) |
||||
export class ApiOrderModule { } |
@ -0,0 +1,127 @@ |
||||
<!-- start 面包屑 --> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
|
||||
<!--条件搜索--> |
||||
<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]="6">平台订单号</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input placeholder="请输入平台订单号..." [formControlName]="'orderNo'"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">第三方订单号</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input placeholder="请输入第三方订单号..." [formControlName]="'sourceOrderNo'"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">订单状态</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-select nzShowSearch nzAllowClear formControlName="orderStatus" nzPlaceHolder="请选择订单状态"> |
||||
<nz-option nzLabel="待支付" nzValue="1"></nz-option> |
||||
<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="5"></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]="6">回调状态</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-select nzShowSearch nzAllowClear formControlName="callbackStatus" nzPlaceHolder="请选择回调状态"> |
||||
<nz-option nzLabel="未回调" nzValue="100"></nz-option> |
||||
<nz-option nzLabel="已回调" nzValue="101"></nz-option> |
||||
<nz-option nzLabel="回调未响应" nzValue="102"></nz-option> |
||||
<nz-option nzLabel="预备回调" nzValue="103"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">支付时间</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" |
||||
formControlName="payTime"></nz-range-picker> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">创建时间</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" |
||||
formControlName="createTime"></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>共计 {{total}} 条数据</span> |
||||
<nz-table |
||||
class="table" |
||||
#ajaxTable |
||||
nzBordered |
||||
nzShowSizeChanger |
||||
[nzFrontPagination]="false" |
||||
[nzData]="requestData" |
||||
[nzLoading]="loading" |
||||
[nzTotal]="total" |
||||
[(nzPageIndex)]="pageNum" |
||||
[(nzPageSize)]="pageSize" |
||||
[nzScroll]="{ x: '1200px' }" |
||||
(nzPageIndexChange)="getRequest(false , searchForm.value)" |
||||
(nzPageSizeChange)="getRequest(false , searchForm.value)"> |
||||
<thead nzSingleSort> |
||||
<tr> |
||||
<th nzWidth="80px">编号</th> |
||||
<th nzWidth="160px">平台订单号</th> |
||||
<th nzWidth="160px">第三方订单号</th> |
||||
<th nzWidth="110px">订单金额</th> |
||||
<th nzWidth="110px">下单金额</th> |
||||
<th nzWidth="140px">生成时间</th> |
||||
<th nzWidth="140px">支付时间</th> |
||||
<th nzWidth="90px" nzRight>订单状态</th> |
||||
<th nzWidth="100px" nzRight>支付状态</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i + 1}}</td> |
||||
<td>{{data.orderNo}}</td> |
||||
<td>{{data.sourceOrderNo}}</td> |
||||
<td>¥{{data.orderPrice}}</td> |
||||
<td>¥{{data.payPrice}}</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>{{data.callbackStatus | callbackStatus}}</td> |
||||
<td nzRight>{{data.orderStatus | payCouponStatus}}</td> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
@ -0,0 +1,5 @@ |
||||
.table-td-operation { |
||||
a { |
||||
margin-left: 8px; |
||||
} |
||||
} |
@ -0,0 +1,25 @@ |
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { KfcOrderComponent } from './kfc-order.component'; |
||||
|
||||
describe('KfcOrderComponent', () => { |
||||
let component: KfcOrderComponent; |
||||
let fixture: ComponentFixture<KfcOrderComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ KfcOrderComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(KfcOrderComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,91 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; |
||||
import {RechargeService} from '../../../services/recharge.service'; |
||||
import {DiscountService} from '../../../services/discount.service'; |
||||
import {ApiMerchantsService} from '../../../services/api-merchants.service'; |
||||
import {NzMessageService, NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; |
||||
import {CouponService} from '../../../services/coupon.service'; |
||||
import {IconService} from '../../../services/icon.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-kfc-order', |
||||
templateUrl: './kfc-order.component.html', |
||||
styleUrls: ['./kfc-order.component.scss'] |
||||
}) |
||||
export class KfcOrderComponent implements OnInit { |
||||
|
||||
FILE_URL = environment.imageUrl; |
||||
WEB_SERVE_URL = environment.baseUrl; |
||||
searchForm: FormGroup; // 搜索框
|
||||
validateForm: FormGroup; // 添加框
|
||||
requestData = []; // 列表数据
|
||||
total: number; // 页码
|
||||
pageNum = 1; // 页码
|
||||
pageSize = 10; // 条码
|
||||
loading = true; |
||||
isVisible = false; |
||||
constructor( |
||||
private form: FormBuilder, |
||||
private recharge: RechargeService, |
||||
private discount: DiscountService, |
||||
private apiMerchant: ApiMerchantsService, |
||||
private modal: NzModalService, |
||||
private coupon: CouponService, |
||||
private iconService: IconService, |
||||
private message: NzMessageService, |
||||
|
||||
) { |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.init(); |
||||
} |
||||
|
||||
public init(): void { |
||||
this.searchForm = this.form.group({ |
||||
orderStatus: [null], // 订单状态
|
||||
orderNo: [null], // 订单号
|
||||
productType: [2], // 产品类型
|
||||
sourceOrderNo: [null], // 第三方订单号
|
||||
callbackStatus: [null], // 回调状态
|
||||
payTime: [null], // 支付时间
|
||||
createTime: [null], // 创建时间
|
||||
}); |
||||
|
||||
this.getRequest(true, this.searchForm.value); |
||||
} |
||||
|
||||
// 查询列表
|
||||
public getRequest(reset: boolean = false, whereObject: object) { |
||||
if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) { |
||||
whereObject['payTimeS'] = whereObject['payTime'][0].getTime(); |
||||
whereObject['payTimeE'] = whereObject['payTime'][1].getTime(); |
||||
} |
||||
|
||||
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) { |
||||
whereObject['createTimeS'] = whereObject['createTime'][0].getTime(); |
||||
whereObject['createTimeE'] = whereObject['createTime'][1].getTime(); |
||||
} |
||||
this.loading = false; |
||||
if (reset) { |
||||
this.pageNum = 1; |
||||
} |
||||
whereObject['pageNum'] = this.pageNum; |
||||
whereObject['pageSize'] = this.pageSize; |
||||
this.apiMerchant.getApiThirdOrderByList(whereObject, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData = data['return_data'].list; |
||||
this.total = data['return_data'].total; |
||||
} else { |
||||
this.message.error(data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
// 重置
|
||||
public resetForm(): void { |
||||
this.searchForm.reset(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,159 @@ |
||||
<!-- start 面包屑 --> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
|
||||
<!--条件搜索--> |
||||
<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]="6">充值号码</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input placeholder="请输入充值号码..." [formControlName]="'rechargeNumber'"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">平台订单号</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input placeholder="请输入平台订单号..." [formControlName]="'orderNo'"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">第三方订单号</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input placeholder="请输入第三方订单号..." [formControlName]="'sourceOrderNo'"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">运营商</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input placeholder="请输入运营商..." [formControlName]="'operators'"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">支付状态</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-select nzShowSearch nzAllowClear formControlName="payStatus" nzPlaceHolder="请选择订单状态"> |
||||
<nz-option nzLabel="待支付" nzValue="101"></nz-option> |
||||
<nz-option nzLabel="已支付" nzValue="102"></nz-option> |
||||
<nz-option nzLabel="已完成" nzValue="100"></nz-option> |
||||
<nz-option nzLabel="已取消" nzValue="104"></nz-option> |
||||
<nz-option nzLabel="已退款" nzValue="105"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">充值状态</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-select nzShowSearch nzAllowClear formControlName="rechargeStatus" nzPlaceHolder="请选择充值状态"> |
||||
<nz-option nzLabel="充值中" nzValue="201"></nz-option> |
||||
<nz-option nzLabel="充值成功" nzValue="202"></nz-option> |
||||
<nz-option nzLabel="充值失败" nzValue="203"></nz-option> |
||||
<nz-option nzLabel="未充值" nzValue="204"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">回调状态</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-select nzShowSearch nzAllowClear formControlName="callbackStatus" nzPlaceHolder="请选择回调状态"> |
||||
<nz-option nzLabel="未回调" nzValue="100"></nz-option> |
||||
<nz-option nzLabel="已回调" nzValue="101"></nz-option> |
||||
<nz-option nzLabel="回调未响应" nzValue="102"></nz-option> |
||||
<nz-option nzLabel="预备回调" nzValue="103"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">支付时间</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" |
||||
formControlName="payTime"></nz-range-picker> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">创建时间</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" |
||||
formControlName="createTime"></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>共计 {{total}} 条数据</span> |
||||
<nz-table |
||||
class="table" |
||||
#ajaxTable |
||||
nzBordered |
||||
nzShowSizeChanger |
||||
[nzFrontPagination]="false" |
||||
[nzData]="requestData" |
||||
[nzLoading]="loading" |
||||
[nzTotal]="total" |
||||
[(nzPageIndex)]="pageNum" |
||||
[(nzPageSize)]="pageSize" |
||||
[nzScroll]="{ x: '1200px' }" |
||||
(nzPageIndexChange)="getRequest(false , searchForm.value)" |
||||
(nzPageSizeChange)="getRequest(false , searchForm.value)"> |
||||
<thead nzSingleSort> |
||||
<tr> |
||||
<th nzWidth="80px">编号</th> |
||||
<th nzWidth="160px">平台订单号</th> |
||||
<th nzWidth="160px">第三方订单号</th> |
||||
<th nzWidth="100px">运营商</th> |
||||
<th nzWidth="140px">充值号码</th> |
||||
<th nzWidth="110px">充值金额</th> |
||||
<th nzWidth="110px">下单金额</th> |
||||
<th nzWidth="140px">生成时间</th> |
||||
<th nzWidth="140px">支付时间</th> |
||||
<th nzWidth="100px" nzRight>支付方式</th> |
||||
<th nzWidth="90px" nzRight>充值状态</th> |
||||
<th nzWidth="100px" nzRight>支付状态</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i + 1}}</td> |
||||
<td>{{data.orderNo}}</td> |
||||
<td>{{data.sourceOrderNo}}</td> |
||||
<td>{{data.operators}}</td> |
||||
<td>{{data.rechargeNumber}}</td> |
||||
<td>¥{{data.rechargePrice}}</td> |
||||
<td>¥{{data.payPrice}}</td> |
||||
<td>{{data.createTimed | date: 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||
<td>{{data.payTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||
<td nzRight>{{data.callbackStatus | callbackStatus}}</td> |
||||
<td nzRight>{{data.rechargeStatus | rechargeStatus}}</td> |
||||
<td nzRight>{{data.payStatus | payStatus}}</td> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
@ -0,0 +1,5 @@ |
||||
.table-td-operation { |
||||
a { |
||||
margin-left: 8px; |
||||
} |
||||
} |
@ -0,0 +1,96 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; |
||||
import {RechargeService} from '../../../services/recharge.service'; |
||||
import {DiscountService} from '../../../services/discount.service'; |
||||
import {NzMessageService, NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; |
||||
import {CouponService} from '../../../services/coupon.service'; |
||||
import {IconService} from '../../../services/icon.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-phone-order', |
||||
templateUrl: './phone-order.component.html', |
||||
styleUrls: ['./phone-order.component.scss'] |
||||
}) |
||||
export class PhoneOrderComponent implements OnInit { |
||||
|
||||
FILE_URL = environment.imageUrl; |
||||
WEB_SERVE_URL = environment.baseUrl; |
||||
searchForm: FormGroup; // 搜索框
|
||||
validateForm: FormGroup; // 添加框
|
||||
requestData = []; // 列表数据
|
||||
total: number; // 页码
|
||||
pageNum = 1; // 页码
|
||||
pageSize = 10; // 条码
|
||||
loading = true; |
||||
isVisible = false; |
||||
constructor( |
||||
private form: FormBuilder, |
||||
private recharge: RechargeService, |
||||
private discount: DiscountService, |
||||
private modal: NzModalService, |
||||
private coupon: CouponService, |
||||
private iconService: IconService, |
||||
private message: NzMessageService, |
||||
|
||||
) { |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.init(); |
||||
|
||||
} |
||||
|
||||
|
||||
public init(): void { |
||||
this.searchForm = this.form.group({ |
||||
rechargeNumber: [null], // 充值号码
|
||||
orderNo: [null], // 订单号
|
||||
sourceOrderNo: [null], // 第三方订单号
|
||||
operators: [null], // 运营商
|
||||
payStatus: [null], // 支付状态
|
||||
rechargeStatus: [null], // 充值状态
|
||||
callbackStatus: [null], // 回调状态
|
||||
payTime: [null], // 支付时间
|
||||
createTime: [null], // 创建时间
|
||||
}); |
||||
|
||||
this.getRequest(true, this.searchForm.value); |
||||
} |
||||
|
||||
// 查询列表
|
||||
public getRequest(reset: boolean = false, whereObject: object) { |
||||
if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) { |
||||
whereObject['payTimeS'] = whereObject['payTime'][0].getTime(); |
||||
whereObject['payTimeE'] = whereObject['payTime'][1].getTime(); |
||||
} |
||||
|
||||
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) { |
||||
whereObject['createTimeS'] = whereObject['createTime'][0].getTime(); |
||||
whereObject['createTimeE'] = whereObject['createTime'][1].getTime(); |
||||
} |
||||
this.loading = false; |
||||
if (reset) { |
||||
this.pageNum = 1; |
||||
} |
||||
whereObject['pageNum'] = this.pageNum; |
||||
whereObject['pageSize'] = this.pageSize; |
||||
this.recharge.getApiRechargePhoneByList(whereObject, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData = data['return_data'].list; |
||||
this.total = data['return_data'].total; |
||||
} else { |
||||
this.message.error(data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
// 重置
|
||||
public resetForm(): void { |
||||
this.searchForm.reset(); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,127 @@ |
||||
<!-- start 面包屑 --> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
|
||||
<!--条件搜索--> |
||||
<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]="6">平台订单号</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input placeholder="请输入平台订单号..." [formControlName]="'orderNo'"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">第三方订单号</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input placeholder="请输入第三方订单号..." [formControlName]="'sourceOrderNo'"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">订单状态</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-select nzShowSearch nzAllowClear formControlName="orderStatus" nzPlaceHolder="请选择订单状态"> |
||||
<nz-option nzLabel="待支付" nzValue="1"></nz-option> |
||||
<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="5"></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]="6">回调状态</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-select nzShowSearch nzAllowClear formControlName="callbackStatus" nzPlaceHolder="请选择回调状态"> |
||||
<nz-option nzLabel="未回调" nzValue="100"></nz-option> |
||||
<nz-option nzLabel="已回调" nzValue="101"></nz-option> |
||||
<nz-option nzLabel="回调未响应" nzValue="102"></nz-option> |
||||
<nz-option nzLabel="预备回调" nzValue="103"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">支付时间</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" |
||||
formControlName="payTime"></nz-range-picker> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">创建时间</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" |
||||
formControlName="createTime"></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>共计 {{total}} 条数据</span> |
||||
<nz-table |
||||
class="table" |
||||
#ajaxTable |
||||
nzBordered |
||||
nzShowSizeChanger |
||||
[nzFrontPagination]="false" |
||||
[nzData]="requestData" |
||||
[nzLoading]="loading" |
||||
[nzTotal]="total" |
||||
[(nzPageIndex)]="pageNum" |
||||
[(nzPageSize)]="pageSize" |
||||
[nzScroll]="{ x: '1200px' }" |
||||
(nzPageIndexChange)="getRequest(false , searchForm.value)" |
||||
(nzPageSizeChange)="getRequest(false , searchForm.value)"> |
||||
<thead nzSingleSort> |
||||
<tr> |
||||
<th nzWidth="80px">编号</th> |
||||
<th nzWidth="160px">平台订单号</th> |
||||
<th nzWidth="160px">第三方订单号</th> |
||||
<th nzWidth="110px">订单金额</th> |
||||
<th nzWidth="110px">下单金额</th> |
||||
<th nzWidth="140px">生成时间</th> |
||||
<th nzWidth="140px">支付时间</th> |
||||
<th nzWidth="90px" nzRight>订单状态</th> |
||||
<th nzWidth="100px" nzRight>支付状态</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i + 1}}</td> |
||||
<td>{{data.orderNo}}</td> |
||||
<td>{{data.sourceOrderNo}}</td> |
||||
<td>¥{{data.orderPrice}}</td> |
||||
<td>¥{{data.payPrice}}</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>{{data.callbackStatus | callbackStatus}}</td> |
||||
<td nzRight>{{data.orderStatus | payCouponStatus}}</td> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
@ -0,0 +1,5 @@ |
||||
.table-td-operation { |
||||
a { |
||||
margin-left: 8px; |
||||
} |
||||
} |
@ -0,0 +1,92 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {environment} from '../../../../../environments/environment'; |
||||
import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; |
||||
import {RechargeService} from '../../../../services/recharge.service'; |
||||
import {DiscountService} from '../../../../services/discount.service'; |
||||
import {NzMessageService, NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; |
||||
import {CouponService} from '../../../../services/coupon.service'; |
||||
import {IconService} from '../../../../services/icon.service'; |
||||
import {ApiMerchantsService} from '../../../../services/api-merchants.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-list', |
||||
templateUrl: './list.component.html', |
||||
styleUrls: ['./list.component.scss'] |
||||
}) |
||||
export class ListComponent implements OnInit { |
||||
|
||||
FILE_URL = environment.imageUrl; |
||||
WEB_SERVE_URL = environment.baseUrl; |
||||
searchForm: FormGroup; // 搜索框
|
||||
validateForm: FormGroup; // 添加框
|
||||
requestData = []; // 列表数据
|
||||
total: number; // 页码
|
||||
pageNum = 1; // 页码
|
||||
pageSize = 10; // 条码
|
||||
loading = true; |
||||
isVisible = false; |
||||
constructor( |
||||
private form: FormBuilder, |
||||
private recharge: RechargeService, |
||||
private discount: DiscountService, |
||||
private apiMerchant: ApiMerchantsService, |
||||
private modal: NzModalService, |
||||
private coupon: CouponService, |
||||
private iconService: IconService, |
||||
private message: NzMessageService, |
||||
|
||||
) { |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.init(); |
||||
} |
||||
|
||||
public init(): void { |
||||
this.searchForm = this.form.group({ |
||||
orderStatus: [null], // 订单状态
|
||||
orderNo: [null], // 订单号
|
||||
productType: [1], // 产品类型
|
||||
sourceOrderNo: [null], // 第三方订单号
|
||||
rechargeStatus: [null], // 充值状态
|
||||
callbackStatus: [null], // 回调状态
|
||||
payTime: [null], // 支付时间
|
||||
createTime: [null], // 创建时间
|
||||
}); |
||||
|
||||
this.getRequest(true, this.searchForm.value); |
||||
} |
||||
|
||||
// 查询列表
|
||||
public getRequest(reset: boolean = false, whereObject: object) { |
||||
if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) { |
||||
whereObject['payTimeS'] = whereObject['payTime'][0].getTime(); |
||||
whereObject['payTimeE'] = whereObject['payTime'][1].getTime(); |
||||
} |
||||
|
||||
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) { |
||||
whereObject['createTimeS'] = whereObject['createTime'][0].getTime(); |
||||
whereObject['createTimeE'] = whereObject['createTime'][1].getTime(); |
||||
} |
||||
this.loading = false; |
||||
if (reset) { |
||||
this.pageNum = 1; |
||||
} |
||||
whereObject['pageNum'] = this.pageNum; |
||||
whereObject['pageSize'] = this.pageSize; |
||||
this.apiMerchant.getApiThirdOrderByList(whereObject, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData = data['return_data'].list; |
||||
this.total = data['return_data'].total; |
||||
} else { |
||||
this.message.error(data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
// 重置
|
||||
public resetForm(): void { |
||||
this.searchForm.reset(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,127 @@ |
||||
<!-- start 面包屑 --> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
|
||||
<!--条件搜索--> |
||||
<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]="6">平台订单号</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input placeholder="请输入平台订单号..." [formControlName]="'orderNo'"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">第三方订单号</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input placeholder="请输入第三方订单号..." [formControlName]="'sourceOrderNo'"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">订单状态</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-select nzShowSearch nzAllowClear formControlName="orderStatus" nzPlaceHolder="请选择订单状态"> |
||||
<nz-option nzLabel="待支付" nzValue="1"></nz-option> |
||||
<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="5"></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]="6">回调状态</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-select nzShowSearch nzAllowClear formControlName="callbackStatus" nzPlaceHolder="请选择回调状态"> |
||||
<nz-option nzLabel="未回调" nzValue="100"></nz-option> |
||||
<nz-option nzLabel="已回调" nzValue="101"></nz-option> |
||||
<nz-option nzLabel="回调未响应" nzValue="102"></nz-option> |
||||
<nz-option nzLabel="预备回调" nzValue="103"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">支付时间</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" |
||||
formControlName="payTime"></nz-range-picker> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">创建时间</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" |
||||
formControlName="createTime"></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>共计 {{total}} 条数据</span> |
||||
<nz-table |
||||
class="table" |
||||
#ajaxTable |
||||
nzBordered |
||||
nzShowSizeChanger |
||||
[nzFrontPagination]="false" |
||||
[nzData]="requestData" |
||||
[nzLoading]="loading" |
||||
[nzTotal]="total" |
||||
[(nzPageIndex)]="pageNum" |
||||
[(nzPageSize)]="pageSize" |
||||
[nzScroll]="{ x: '1200px' }" |
||||
(nzPageIndexChange)="getRequest(false , searchForm.value)" |
||||
(nzPageSizeChange)="getRequest(false , searchForm.value)"> |
||||
<thead nzSingleSort> |
||||
<tr> |
||||
<th nzWidth="80px">编号</th> |
||||
<th nzWidth="160px">平台订单号</th> |
||||
<th nzWidth="160px">第三方订单号</th> |
||||
<th nzWidth="110px">订单金额</th> |
||||
<th nzWidth="110px">下单金额</th> |
||||
<th nzWidth="140px">生成时间</th> |
||||
<th nzWidth="140px">支付时间</th> |
||||
<th nzWidth="90px" nzRight>订单状态</th> |
||||
<th nzWidth="100px" nzRight>支付状态</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i + 1}}</td> |
||||
<td>{{data.orderNo}}</td> |
||||
<td>{{data.sourceOrderNo}}</td> |
||||
<td>¥{{data.orderPrice}}</td> |
||||
<td>¥{{data.payPrice}}</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>{{data.callbackStatus | callbackStatus}}</td> |
||||
<td nzRight>{{data.orderStatus | payCouponStatus}}</td> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
@ -0,0 +1,5 @@ |
||||
.table-td-operation { |
||||
a { |
||||
margin-left: 8px; |
||||
} |
||||
} |
@ -0,0 +1,93 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; |
||||
import {RechargeService} from '../../../services/recharge.service'; |
||||
import {DiscountService} from '../../../services/discount.service'; |
||||
import {ApiMerchantsService} from '../../../services/api-merchants.service'; |
||||
import {NzMessageService, NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; |
||||
import {CouponService} from '../../../services/coupon.service'; |
||||
import {IconService} from '../../../services/icon.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-vip-top-up-order', |
||||
templateUrl: './vip-top-up-order.component.html', |
||||
styleUrls: ['./vip-top-up-order.component.scss'] |
||||
}) |
||||
export class VipTopUpOrderComponent implements OnInit { |
||||
|
||||
FILE_URL = environment.imageUrl; |
||||
WEB_SERVE_URL = environment.baseUrl; |
||||
searchForm: FormGroup; // 搜索框
|
||||
validateForm: FormGroup; // 添加框
|
||||
requestData = []; // 列表数据
|
||||
total: number; // 页码
|
||||
pageNum = 1; // 页码
|
||||
pageSize = 10; // 条码
|
||||
loading = true; |
||||
isVisible = false; |
||||
constructor( |
||||
private form: FormBuilder, |
||||
private recharge: RechargeService, |
||||
private discount: DiscountService, |
||||
private apiMerchant: ApiMerchantsService, |
||||
private modal: NzModalService, |
||||
private coupon: CouponService, |
||||
private iconService: IconService, |
||||
private message: NzMessageService, |
||||
|
||||
) { |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.init(); |
||||
} |
||||
|
||||
public init(): void { |
||||
this.searchForm = this.form.group({ |
||||
orderStatus: [null], // 订单状态
|
||||
orderNo: [null], // 订单号
|
||||
productType: [3], // 产品类型
|
||||
sourceOrderNo: [null], // 第三方订单号
|
||||
rechargeStatus: [null], // 充值状态
|
||||
callbackStatus: [null], // 回调状态
|
||||
payTime: [null], // 支付时间
|
||||
createTime: [null], // 创建时间
|
||||
}); |
||||
|
||||
this.getRequest(true, this.searchForm.value); |
||||
} |
||||
|
||||
// 查询列表
|
||||
public getRequest(reset: boolean = false, whereObject: object) { |
||||
if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) { |
||||
whereObject['payTimeS'] = whereObject['payTime'][0].getTime(); |
||||
whereObject['payTimeE'] = whereObject['payTime'][1].getTime(); |
||||
} |
||||
|
||||
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) { |
||||
whereObject['createTimeS'] = whereObject['createTime'][0].getTime(); |
||||
whereObject['createTimeE'] = whereObject['createTime'][1].getTime(); |
||||
} |
||||
this.loading = false; |
||||
if (reset) { |
||||
this.pageNum = 1; |
||||
} |
||||
whereObject['pageNum'] = this.pageNum; |
||||
whereObject['pageSize'] = this.pageSize; |
||||
this.apiMerchant.getApiThirdOrderByList(whereObject, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData = data['return_data'].list; |
||||
this.total = data['return_data'].total; |
||||
} else { |
||||
this.message.error(data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
// 重置
|
||||
public resetForm(): void { |
||||
this.searchForm.reset(); |
||||
} |
||||
|
||||
|
||||
} |
@ -1,213 +1,228 @@ |
||||
<!--面包屑--> |
||||
<nz-breadcrumb> |
||||
<nz-breadcrumb-item> |
||||
内容管理 |
||||
</nz-breadcrumb-item> |
||||
<nz-breadcrumb-item> |
||||
内容发布 |
||||
</nz-breadcrumb-item> |
||||
<nz-breadcrumb-item> |
||||
内容管理 |
||||
</nz-breadcrumb-item> |
||||
<nz-breadcrumb-item> |
||||
内容发布 |
||||
</nz-breadcrumb-item> |
||||
</nz-breadcrumb> |
||||
|
||||
<!--条件搜索--> |
||||
<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]="6">内容分类</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-tree-select |
||||
nzPlaceHolder="请选择内容分类" |
||||
[nzNodes]="nodes" |
||||
nzShowSearch |
||||
formControlName="categoryId" |
||||
> |
||||
</nz-tree-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">内容标题</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input formControlName="title" name="title" nz-input placeholder="请输入内容标题" nzSize="default"> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">内容状态</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-select class="width_input_chlid" nzShowSearch nzAllowClear nzPlaceHolder="请选择状态" formControlName="status"> |
||||
<nz-option nzLabel="请选择状态" nzValue=""></nz-option> |
||||
<nz-option nzLabel="编辑中" nzValue="1"></nz-option> |
||||
<nz-option nzLabel="已发布" nzValue="2"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">展示平台</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-select class="width_input_chlid" nzShowSearch nzAllowClear nzPlaceHolder="请选择展示平台" formControlName="platform"> |
||||
<nz-option nzLabel="请选择展示平台" nzValue=""></nz-option> |
||||
<nz-option nzLabel="微信小程序" [nzValue]="1"></nz-option> |
||||
<nz-option nzLabel="H5" [nzValue]="2"></nz-option> |
||||
<nz-option nzLabel="银联小程序" [nzValue]="3"></nz-option> |
||||
</nz-select> |
||||
</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 class="inner-content" nz-row> |
||||
<!--条件搜索--> |
||||
<div style="margin-bottom: 24px; margin-top: 24px;"> |
||||
<!--分类--> |
||||
<nz-tree-select |
||||
nzPlaceHolder="请选择分类" |
||||
style="width: 250px" |
||||
[nzNodes]="nodes" |
||||
nzShowSearch |
||||
nzPlaceHolder="请选择内容分类" |
||||
[(ngModel)]="searchCategoryId" |
||||
> |
||||
</nz-tree-select> |
||||
<input class="width_input_chlid" [(ngModel)]="searchTitle" name="searchTitle" nz-input placeholder="请输入内容标题" nzSize="default"> |
||||
<nz-select class="width_input_chlid" nzShowSearch nzAllowClear nzPlaceHolder="请选择状态" [(ngModel)]="searchStatus"> |
||||
<nz-option nzLabel="请选择状态" nzValue=""></nz-option> |
||||
<nz-option nzLabel="编辑中" nzValue="1"></nz-option> |
||||
<nz-option nzLabel="已发布" nzValue="2"></nz-option> |
||||
<!--<nz-option nzLabel="已下线" nzValue="3"></nz-option>--> |
||||
</nz-select> |
||||
<button style="margin-left: 10px;" nz-button nzType="primary" (click)="getSearch()" [nzLoading]="isLoadingSearch">搜索</button> |
||||
<button nz-button (click)="resetSearch()">重置</button> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="inner-content" nz-row> |
||||
<nz-layout> |
||||
<nz-sider style="background: #ffffff;"><div class="gaopin-data-toalt" style="width: 300px;">共搜索到 {{total}} 条数据</div></nz-sider> |
||||
<nz-content style="text-align: right;background: #ffffff;"> |
||||
<button *ngIf="BTN_cmscontent_add == 1" class="funcBnt" nz-button nzType="primary" (click)="getAdd()">添加</button> |
||||
</nz-content> |
||||
</nz-layout> |
||||
|
||||
<div class="inner-content"> |
||||
<span>共计 {{total}} 条数据</span> |
||||
<div class="operating-button"> |
||||
<button nz-button nzType="primary" class="right-btn" (click)="getAdd()" ><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button> |
||||
</div> |
||||
<!--数组表格 --> |
||||
<nz-table |
||||
class="table" |
||||
style="margin-top: 30px;width: 100%;" |
||||
#ajaxTable |
||||
nzShowSizeChanger |
||||
[nzFrontPagination]="false" |
||||
[nzData]="requestData" |
||||
[nzLoading]="loading" |
||||
[nzTotal]="total" |
||||
[(nzPageIndex)]="pageNum" |
||||
[(nzPageIndex)]="pageIndex" |
||||
[(nzPageSize)]="pageSize" |
||||
[nzScroll]="{ x: '1200px' }" |
||||
(nzPageIndexChange)="getRequest(false , searchForm.value)" |
||||
(nzPageSizeChange)="getRequest(false , searchForm.value)"> |
||||
<thead nzSingleSort> |
||||
(nzPageIndexChange)="getRequest()" |
||||
(nzPageSizeChange)="getRequest(true)" |
||||
[nzScroll]="{ x: '1150px'}"> |
||||
<thead nzSingleSort> |
||||
<tr> |
||||
<th nzWidth="80px">序号</th> |
||||
<th nzWidth="100px">分类名称</th> |
||||
<th nzWidth="100px">内容标题</th> |
||||
<th nzWidth="80px">展示平台</th> |
||||
<th nzWidth="80px">状态</th> |
||||
<th nzWidth="240px">分类名称</th> |
||||
<th nzWidth="240px">内容标题</th> |
||||
<th nzWidth="300px">简要描述</th> |
||||
<th nzWidth="120px">访问总量</th> |
||||
<th nzWidth="120px">是否推荐</th> |
||||
<th nzWidth="120px">状态</th> |
||||
<th nzWidth="120px">创建时间</th> |
||||
<th nzRight="0px" nzAlign="left" nzWidth="100px">操作</th> |
||||
<th nzRight="0px" nzAlign="left" nzWidth="300px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i+1}}</td> |
||||
<td>{{data.tag}}</td> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index;"> |
||||
<td>{{i+ 1}}</td> |
||||
<td>{{data.categoryName}}</td> |
||||
<td>{{data.title}}</td> |
||||
<td>{{data.platform | showType}}</td> |
||||
<td>{{data.description}}</td> |
||||
<td>{{data.visitCount}}</td> |
||||
<td> |
||||
{{data.status == 1 ? '编辑中': '已发布'}} |
||||
<span style="color: #1890ff;" *ngIf="data.recommend">是</span> |
||||
<span style="color: darkgray;" *ngIf="!data.recommend">否</span> |
||||
</td> |
||||
<td>{{data.createTime | date:'yyyy-MM-dd hh:mm:ss' }}</td> |
||||
<td nzRight 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 *ngIf="data.status == 1 && 'BTN_cmscontent_edit' | button" nz-menu-item><a (click)="getEdit(data)">编辑</a></li> |
||||
<li *ngIf="'BTN_cmscontent_up_down' | button" nz-menu-item><a (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 2 ? '下架': '上架'}}</a></li> |
||||
<li *ngIf="data.status == 1 && 'BTN_cmscontent_delete' | button" nz-menu-item><a (click)='showDeleteConfirmDelete(data.id)'>删除</a></li> |
||||
</ul> |
||||
</nz-dropdown-menu> |
||||
<td> |
||||
<span *ngIf="data.status == 1">编辑中</span> |
||||
<span *ngIf="data.status == 2">已发布</span> |
||||
</td> |
||||
<td>{{data.createTime | date:'yyyy-MM-dd' }}</td> |
||||
<td nzRight="0px" style="font-size: 16px;"> |
||||
<a><span nz-tooltip nzTitle="详情" (click)='getContentView(data.id)'><i nz-icon nzType="unordered-list" nzTheme="outline"></i></span></a> |
||||
<span *ngIf="BTN_cmscontent_edit"> |
||||
<nz-divider nzType="vertical"></nz-divider> |
||||
<a *ngIf="data.status == 1"><span nz-tooltip nzTitle="编辑" (click)='getEdit(data.id)'><i nz-icon nzType="edit" nzTheme="outline"></i></span></a> |
||||
</span> |
||||
<span *ngIf="BTN_cmscontent_up_down == 1"> |
||||
<nz-divider *ngIf="data.status == 1" nzType="vertical"></nz-divider> |
||||
<a *ngIf="data.status == 2"><span nz-tooltip nzTitle="下线" (click)='showDown(data.id)'><i nz-icon nzType="down-square" nzTheme="outline"></i></span></a> |
||||
<a *ngIf="data.status == 1"><span nz-tooltip nzTitle="发布" (click)='addPush(data.id, data.categoryId)'><i nz-icon nzType="up-square" nzTheme="outline"></i></span></a> |
||||
</span> |
||||
<span *ngIf="BTN_cmscontent_delete == 1"> |
||||
<nz-divider *ngIf="data.status == 1" nzType="vertical"></nz-divider> |
||||
<a *ngIf="data.status == 1"><span nz-tooltip nzTitle="删除" (click)='showDeleteConfirmDelete(data.id)'><i nz-icon nzType="delete" nzTheme="outline"></i></span></a> |
||||
</span> |
||||
<span *ngIf="BTN_cmscontent_patch == 1"> |
||||
<nz-divider *ngIf="data.status == 1" nzType="vertical"></nz-divider> |
||||
<a *ngIf="data.status == 1"><span nz-tooltip nzTitle="附件" (click)='findPatchByContent(data.id)'><i nz-icon nzType="file" nzTheme="outline"></i></span></a> |
||||
</span> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
<nz-layout *ngIf="showPatch == 1" style="margin-bottom: 10px;"> |
||||
<nz-content style="text-align: right;background: #ffffff;"> |
||||
<button class="funcBnt" nz-button nzType="primary" (click)="addPatch()">添加附件</button> |
||||
</nz-content> |
||||
</nz-layout> |
||||
<nz-table style="width: 100%" [nzShowPagination]="false" #basicTable [nzData]="patchList" *ngIf="showPatch == 1"> |
||||
<thead> |
||||
<tr> |
||||
<th>附件名称</th> |
||||
<th>附件类型</th> |
||||
<th>附件描述</th> |
||||
<th>排序</th> |
||||
<th>添加时间</th> |
||||
<th>操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of patchList"> |
||||
<td>{{ data.patchName }}</td> |
||||
<td *ngIf="data.patchType == 1">图片</td> |
||||
<td *ngIf="data.patchType == 2">音频</td> |
||||
<td *ngIf="data.patchType == 3">视频</td> |
||||
<td *ngIf="data.patchType == 4">文档</td> |
||||
<td *ngIf="data.patchType == 5">其他</td> |
||||
<td>{{data.patchDesc}}</td> |
||||
<td>{{data.sort}}</td> |
||||
<td>{{data.addTime | date:'yyyy-MM-dd'}}</td> |
||||
<td> |
||||
<a><span nz-tooltip nzTitle="删除附件" (click)='showDeletePatch(data.id)'><i nz-icon nzType="delete" nzTheme="outline"></i></span></a> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
|
||||
|
||||
<nz-modal [(nzVisible)]="isVisible" nzTitle="编辑内容" nzWidth="700" (nzOnCancel)="isVisible = false" (nzOnOk)="handleOk()"> |
||||
<form nz-form [formGroup]="validateForm" class="login-form"> |
||||
<!--添加附件弹出层--> |
||||
<nz-modal [(nzVisible)]="isVisible" nzTitle="添加附件" (nzOnCancel)="handleCancel()" (nzOnOk)="handlePatchOk(annexForm.value)" [nzOkLoading]="isOkLoading"> |
||||
<form nz-form [formGroup]="annexForm" style="margin-left: 5%;"> |
||||
<!--附件名称--> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>分类</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="内容分类"> |
||||
<nz-tree-select |
||||
style="width: 250px" |
||||
[nzNodes]="nodes" |
||||
nzShowSearch |
||||
nzPlaceHolder="请选择内容分类" |
||||
formControlName="categoryId" |
||||
> |
||||
</nz-tree-select> |
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="patchName" nzRequired> |
||||
<span>附件名称<i nz-icon nz-tooltip nzTitle="附件名称" type="question-circle" nzTheme="outline"></i></span> |
||||
</nz-form-label> |
||||
<nz-form-control [nzSm]="14" [nzXs]="24"> |
||||
<input nz-input formControlName="patchName" placeholder="请输入附件名称..." /> |
||||
<!--<nz-form-explain *ngIf="annexForm.get('patchName')?.dirty && annexForm.get('patchName')?.errors">请输入附件名称!</nz-form-explain>--> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<!--附件描述--> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>内容标题</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请输入内容标题"> |
||||
<input nz-input formControlName="title" placeholder="请输入内容标题!" /> |
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="patchDesc"> |
||||
<span>附件描述<i nz-icon nz-tooltip nzTitle="附件描述" type="question-circle" nzTheme="outline"></i></span> |
||||
</nz-form-label> |
||||
<nz-form-control [nzSm]="14" [nzXs]="24"> |
||||
<input nz-input formControlName="patchDesc" placeholder="请输入附件描述..." /> |
||||
<!--<nz-form-explain *ngIf="annexForm.get('patchDesc')?.dirty && annexForm.get('patchDesc')?.errors">请输入附件描述!</nz-form-explain>--> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<!--附件排序--> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>展示平台</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请选择展示平台"> |
||||
<nz-select *ngIf="!editFlag" nzMode="multiple" nzShowSearch nzAllowClear nzPlaceHolder="请选择展示平台" formControlName="platformArray"> |
||||
<nz-option nzLabel="微信小程序" [nzValue]="1"></nz-option> |
||||
<nz-option nzLabel="H5" [nzValue]="2"></nz-option> |
||||
<nz-option nzLabel="银联小程序" [nzValue]="3"></nz-option> |
||||
</nz-select> |
||||
<nz-select *ngIf="editFlag" nzShowSearch nzAllowClear nzPlaceHolder="请选择展示平台" formControlName="platform"> |
||||
<nz-option nzLabel="微信小程序" [nzValue]="1"></nz-option> |
||||
<nz-option nzLabel="H5" [nzValue]="2"></nz-option> |
||||
<nz-option nzLabel="银联小程序" [nzValue]="3"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>优先级</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请输入优先级"> |
||||
<nz-input-number style="width: 240px;" nzPlaceHolder="请输入优先级,越小越靠前..." formControlName="sortId" [nzMin]="1" [nzMax]="100" [nzStep]="1"></nz-input-number> |
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="sort" nzRequired> |
||||
<span>附件排序<i nz-icon nz-tooltip nzTitle="附件排序" type="question-circle" nzTheme="outline"></i></span> |
||||
</nz-form-label> |
||||
<nz-form-control [nzSm]="14" [nzXs]="24"> |
||||
<input nz-input type="number" formControlName="sort" placeholder="请输入附件排序,越小越靠前..." oninput="if(value.length>5) value=value.slice(0,5)"/> |
||||
<!--<nz-form-explain *ngIf="annexForm.get('sort')?.dirty && annexForm.get('sort')?.errors">请输入附件排序!</nz-form-explain>--> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired>内容描述</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请输入内容描述"> |
||||
<input nz-input formControlName="description" placeholder="请输入内容描述!" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" >跳转类型</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请输入跳转类型"> |
||||
<nz-select nzShowSearch nzAllowClear nzPlaceHolder="请选择跳转类型" formControlName="jumpType"> |
||||
<nz-option nzLabel="外链" [nzValue]="1"></nz-option> |
||||
<nz-option nzLabel="内链" [nzValue]="2"></nz-option> |
||||
<!--附件类型--> |
||||
<nz-form-item > |
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="patchType" nzRequired> |
||||
<span>附件类型</span> |
||||
</nz-form-label> |
||||
<nz-form-control [nzSm]="14" [nzXs]="24"> |
||||
<nz-select style="width: 80%;" formControlName="patchType" (ngModelChange)="getChange($event)" nzShowSearch nzAllowClear nzPlaceHolder="请选择附件类型"> |
||||
<nz-option nzLabel="图片" nzValue="1" ></nz-option> |
||||
<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="5" ></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" >跳转路径</nz-form-label> |
||||
<nz-form-control [nzSpan]="16" nzErrorTip="请输入跳转路径"> |
||||
<input nz-input formControlName="jumpUrl" placeholder="请输入跳转链接(轮播图必填)" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">封面图片</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<!--附件上传--> |
||||
<nz-form-item *ngIf="patchTypeCheck != '0' && patchTypeCheck != null && patchTypeCheck != ''"> |
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="patchPath" nzRequired> |
||||
<span>附件上传<i nz-icon nz-tooltip nzTitle="附件上传" type="question-circle" nzTheme="outline"></i></span> |
||||
</nz-form-label> |
||||
<nz-form-control [nzSm]="14" [nzXs]="24"> |
||||
<nz-upload |
||||
nzAction="{{POST_URL}}/fileUpload/uploadfile" |
||||
nzListType="picture-card" |
||||
[(nzFileList)]="imgFile" |
||||
[nzShowButton]="imgFile.length < 1" |
||||
[nzPreview]="handlePreview" |
||||
nzAction="{{WEB_SERVE_URL}}/fileUpload/fileUpload" |
||||
[(nzFileList)]="fileList" |
||||
[nzCustomRequest]="customReq" |
||||
[nzShowButton]="fileList.length < 1" |
||||
> |
||||
<i nz-icon nzType="plus"></i> |
||||
<div class="ant-upload-text">上传图片</div> |
||||
<button nz-button ><i nz-icon nzType="upload"></i><span>点击上传</span></button> |
||||
</nz-upload> |
||||
<nz-modal [nzVisible]="previewVisible" [nzContent]="modalContent" [nzFooter]="null" (nzOnCancel)="previewVisible = false"> |
||||
<ng-template #modalContent> |
||||
<img [src]="previewImage" [ngStyle]="{ width: '100%' }" /> |
||||
</ng-template> |
||||
</nz-modal> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<button nz-button id="reset" style="display: none;" (click)="emptyForm($event)">清空</button> |
||||
</form> |
||||
</nz-modal> |
||||
<!--发布弹出层--> |
||||
<nz-modal [(nzVisible)]="isPublish" nzTitle="发布内容" (nzOnCancel)="handleCancelPush()" (nzOnOk)="handlePushOk(pushForm.value)" [nzOkLoading]="isPushOkLoading"> |
||||
<form nz-form [formGroup]="pushForm" style="margin-left: 5%;"> |
||||
<!--附件名称--> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="moduleId"> |
||||
<span>发布模板<i nz-icon nz-tooltip nzTitle="发布模板" type="question-circle" nzTheme="outline"></i></span> |
||||
</nz-form-label> |
||||
<nz-form-control [nzSm]="14" [nzXs]="24"> |
||||
<nz-select formControlName="moduleId" nzShowSearch nzAllowClear nzPlaceHolder="选择发布模板,也可不选择" [(ngModel)]="moduleId"> |
||||
<nz-option *ngFor="let data of selectModule" nzLabel="{{data.moduleName}}" nzValue="{{data.id}}"></nz-option> |
||||
</nz-select> |
||||
<!--<input nz-input formControlName="moduleId" placeholder="请输入附件名称..." />--> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<button nz-button id="resetPush" style="display: none;" (click)="emptyPushForm($event)">清空</button> |
||||
</form> |
||||
</nz-modal> |
||||
|
@ -0,0 +1,27 @@ |
||||
.width_input { |
||||
width: 200px; |
||||
} |
||||
.width_input_chlid { |
||||
width: 200px; |
||||
margin-left: 10px; |
||||
} |
||||
[nz-form] { |
||||
max-width: 600px; |
||||
} |
||||
button { |
||||
margin-left: 8px; |
||||
} |
||||
:host ::ng-deep .upload-list-inline .ant-upload-list-item { |
||||
float: left; |
||||
width: 200px; |
||||
margin-right: 8px; |
||||
} |
||||
.search-result-list { |
||||
margin-top: 16px; |
||||
border: 1px dashed #e9e9e9; |
||||
border-radius: 6px; |
||||
background-color: #fafafa; |
||||
min-height: 200px; |
||||
text-align: center; |
||||
padding-top: 80px; |
||||
} |
@ -0,0 +1,118 @@ |
||||
<!-- 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"> |
||||
<input nz-input formControlName="contactName" /> |
||||
</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="contactPhone" /> |
||||
</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)="downloadTemplate()"><i nz-icon nzType="vertical-align-bottom" nzTheme="outline"></i>下载导入模板</button> |
||||
|
||||
<nz-upload |
||||
[nzAccept]="'.xls,.xlsx'" |
||||
nzAction="{{WEB_SERVE_URL}}fleetOilCardCar/importData?cardNo={{fleetCardNo}}" |
||||
[nzHeaders]="{ authorization: 'authorization-text' }" |
||||
(nzChange)="handleChange($event)" |
||||
[nzShowUploadList]="false" |
||||
> |
||||
<button nz-button nzType="primary" class="right-btn"><i nz-icon nzType="import" nzTheme="outline"></i>导入车辆</button> |
||||
</nz-upload> |
||||
</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="110px">车辆车牌</th> |
||||
<th nzWidth="110px">车主姓名</th> |
||||
<th nzWidth="110px">车主电话</th> |
||||
<th nzWidth="120px">创建时间</th> |
||||
<th nzWidth="110px">创建人</th> |
||||
<th nzWidth="110px" nzRight="0px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of basicTable.data;let i = index"> |
||||
<td>{{i+1}}</td> |
||||
<td>{{data.carLicensePlate}}</td> |
||||
<td>{{data.contactName}}</td> |
||||
<td>{{data.contactPhone}}</td> |
||||
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||
<td>{{data.opUserName}}</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)="showDelConfirm(data.id)"><a>删除</a></li> |
||||
<li nz-menu-item [routerLink]="['/admin/fleet-oil-card/order-list']" [queryParams]="{ cardNo: data.fleetOilCardNo, carLicensePlate: data.carLicensePlate }"><a>消费订单</a></li> |
||||
</ul> |
||||
</nz-dropdown-menu> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
</nz-spin> |
||||
|
||||
|
||||
<nz-modal [(nzVisible)]="importErrorDataModal" nzTitle="导入失败数据" (nzOnCancel)="closeImportErrorDataModal()" nzWidth="900px" [nzFooter]="null"> |
||||
<nz-table #errorStudentTable [nzData]="errorDataArray"> |
||||
<thead> |
||||
<tr> |
||||
<th nzWidth="80px">序号</th> |
||||
<th nzWidth="150px">客户姓名</th> |
||||
<th nzWidth="150px">客户电话</th> |
||||
<th nzWidth="300px">失败原因</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of errorStudentTable.data;let i = index"> |
||||
<td>{{ i + 1}}</td> |
||||
<td>{{data.contactName}}</td> |
||||
<td>{{data.contactPhone}}</td> |
||||
<td>{{data.errMsg}}</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
</nz-modal> |
@ -0,0 +1,3 @@ |
||||
.table-td-operation a { |
||||
padding: 0px 5px; |
||||
} |
@ -0,0 +1,25 @@ |
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { FleetOilCardCarComponent } from './fleet-oil-card-car.component'; |
||||
|
||||
describe('FleetOilCardCarComponent', () => { |
||||
let component: FleetOilCardCarComponent; |
||||
let fixture: ComponentFixture<FleetOilCardCarComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ FleetOilCardCarComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(FleetOilCardCarComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,252 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
import {FormBuilder, FormGroup, Validators} from '@angular/forms'; |
||||
import {NzMessageService, NzModalService, NzUploadChangeParam} from 'ng-zorro-antd'; |
||||
import {LocalStorageService} from '../../../services/local-storage.service'; |
||||
import {FleetOilCardUserService} from '../../../services/fleet-oil-card-user.service'; |
||||
import {OrganizationService} from '../../../services/organization.service'; |
||||
import {CompanyAccountService} from '../../../services/company-account.service'; |
||||
import {ActivatedRoute, Router} from '@angular/router'; |
||||
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; |
||||
import {FleetOilCardCarService} from '../../../services/fleet-oil-card-car.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-fleet-oil-card-car', |
||||
templateUrl: './fleet-oil-card-car.component.html', |
||||
styleUrls: ['./fleet-oil-card-car.component.scss'] |
||||
}) |
||||
export class FleetOilCardCarComponent implements OnInit { |
||||
WEB_SERVE_URL = environment.baseUrl; |
||||
FILE_URL = environment.imageUrl; |
||||
roleType; |
||||
adminFlag; |
||||
loadingObject = { |
||||
spinning: false, |
||||
msg: '加载中' |
||||
}; |
||||
dataObject: any = {}; |
||||
tableLoading = true; |
||||
searchForm: FormGroup; |
||||
pageNum: number; |
||||
whereObject: any = {}; |
||||
|
||||
fleetCardNo: string; |
||||
|
||||
rechargeModal = false; |
||||
rechargeForm: FormGroup; |
||||
rechargeBtnLoading = false; |
||||
|
||||
orgArray = []; |
||||
accountObject = { |
||||
amounts: 0 |
||||
}; |
||||
|
||||
importErrorDataModal = false; |
||||
errorDataArray = []; |
||||
|
||||
constructor(private modal: NzModalService, |
||||
private message: NzMessageService, |
||||
private store: LocalStorageService, |
||||
private fleetOilCardCarService: FleetOilCardCarService, |
||||
private organizationService: OrganizationService, |
||||
private companyAccountService: CompanyAccountService, |
||||
private activatedRoute: ActivatedRoute, |
||||
private router: Router, |
||||
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.activatedRoute.queryParams.subscribe(queryParams => { |
||||
if (queryParams.cardNo != null) { |
||||
this.fleetCardNo = queryParams.cardNo; |
||||
} |
||||
}); |
||||
|
||||
this.searchForm = this.form.group({ |
||||
contactName: [null], |
||||
contactPhone: [null], |
||||
}); |
||||
|
||||
this.rechargeForm = this.form.group({ |
||||
cardNo: [{ value: null, disabled: true }, [Validators.required]], |
||||
price: [100, [Validators.required]], |
||||
twoPwd: [null, [Validators.required]], |
||||
}); |
||||
|
||||
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; |
||||
this.whereObject['fleetOilCardNo'] = this.fleetCardNo; |
||||
this.whereObject['pageNum'] = pageNum; |
||||
this.whereObject['pageSize'] = 10; |
||||
this.fleetOilCardCarService.getCarList(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(); |
||||
} |
||||
|
||||
/** |
||||
* 弹出删除对话框 |
||||
*/ |
||||
showDelConfirm(id: number): void { |
||||
this.modal.confirm({ |
||||
nzTitle: '警告', |
||||
nzContent: '是否删除该数据?', |
||||
nzOkText: '是', |
||||
nzCancelText: '否', |
||||
nzOkType: 'danger', |
||||
nzOnOk: () => this.delData(id) |
||||
}); |
||||
} |
||||
|
||||
delData(id: number) { |
||||
this.fleetOilCardCarService.delete({ id: id }, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData(this.whereObject['pageNum']); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'] |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 弹出禁用对话框 |
||||
*/ |
||||
showDisabledConfirm(cardNo: string): void { |
||||
this.modal.confirm({ |
||||
nzTitle: '警告', |
||||
nzContent: '是否禁用油卡', |
||||
nzOkText: '是', |
||||
nzCancelText: '否', |
||||
nzOkType: 'danger', |
||||
nzOnOk: () => this.disabledData(cardNo) |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 禁用数据 |
||||
*/ |
||||
disabledData(cardNo: string) { |
||||
/* this.fleetOilCardService.disabled({ cardNo: cardNo}, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData(this.whereObject['pageNum']); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'] |
||||
}); |
||||
} |
||||
});*/ |
||||
} |
||||
|
||||
/** |
||||
* 弹出启用对话框 |
||||
*/ |
||||
showEnableConfirm(cardNo: string): void { |
||||
this.modal.confirm({ |
||||
nzTitle: '警告', |
||||
nzContent: '是否启用油卡', |
||||
nzOkText: '是', |
||||
nzCancelText: '否', |
||||
nzOkType: 'danger', |
||||
nzOnOk: () => this.enableData(cardNo) |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 启用数据 |
||||
*/ |
||||
enableData(cardNo: string) { |
||||
/* this.fleetOilCardService.enable({ cardNo: cardNo}, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData(this.whereObject['pageNum']); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'] |
||||
}); |
||||
} |
||||
});*/ |
||||
} |
||||
|
||||
handleChange(info: NzUploadChangeParam): void { |
||||
if (info.file.status === 'done') { |
||||
if (info.file.response.return_code === '000000') { |
||||
if (info.file.response.return_data == null || info.file.response.return_data.errorTotal === 0) { |
||||
|
||||
this.requestData(1); |
||||
this.message.success('导入成功'); |
||||
|
||||
} else { |
||||
this.modal.warning({ |
||||
nzTitle: '提示', |
||||
nzOkText: '查看失败数据', |
||||
nzContent: '只有部分数据导入成功', |
||||
nzOnOk: () => this.showImportErrorDataModal(info.file.response.return_data) |
||||
}); |
||||
} |
||||
} else { |
||||
this.message.error(info.file.response.return_msg); |
||||
} |
||||
} else if (info.file.status === 'error') { |
||||
this.message.error('上传错误'); |
||||
} |
||||
} |
||||
|
||||
// 打开模态框
|
||||
showImportErrorDataModal(data: []) { |
||||
this.errorDataArray = data['errorData']; |
||||
this.importErrorDataModal = true; |
||||
} |
||||
|
||||
closeImportErrorDataModal() { |
||||
this.importErrorDataModal = false; |
||||
} |
||||
|
||||
downloadTemplate() { |
||||
window.location.href = this.FILE_URL + "template/导入车辆模板.xlsx"; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,241 @@ |
||||
<!-- 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 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"> |
||||
<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="contactName" /> |
||||
</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="contactPhone" /> |
||||
</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="status"> |
||||
<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"> |
||||
<div *ngIf="roleType == 5 && adminFlag == 0" style="width: 100%;text-align: center;"> |
||||
<nz-row [nzGutter]="16"> |
||||
<nz-col [nzSpan]="24"> |
||||
<nz-statistic [nzValue]="'¥' + accountObject['amounts']" [nzTitle]="'账户余额'"></nz-statistic> |
||||
</nz-col> |
||||
</nz-row> |
||||
</div> |
||||
<span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span> |
||||
<div class="operating-button"> |
||||
<button nz-button nzType="primary" class="right-btn" (click)="showGenerateCardModal()" ><i nz-icon nzType="plus" nzTheme="outline"></i>生成油卡</button> |
||||
<!-- <button nz-button nzType="primary" class="right-btn" (click)="excelCard()" ><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 nzWidth="120px" *ngIf="roleType == 5 && adminFlag == 1">所属部门</th> |
||||
<th nzWidth="160px">卡号</th> |
||||
<th nzWidth="110px">余额</th> |
||||
<th nzWidth="110px">消费金额</th> |
||||
<th nzWidth="100px">联系人</th> |
||||
<th nzWidth="120px">联系电话</th> |
||||
<th nzWidth="100px">油卡状态</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 *ngIf="roleType == 5 && adminFlag == 1">{{data.orgName}}</td> |
||||
<td>{{data.cardNo}}</td> |
||||
<td>¥{{data.amount}}</td> |
||||
<td>¥{{data.amountConsume}}</td> |
||||
<td>{{data.contactName?data.contactName:'未设置'}}</td> |
||||
<td>{{data.contactPhone?data.contactPhone:'未设置'}}</td> |
||||
<td>{{data.status | oilCardStatus}}</td> |
||||
<!-- <td>{{data.opUserName}}</td>--> |
||||
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||
<td nzRight="0px" class="table-td-operation"> |
||||
<a (click)="showRechargeModal(data.cardNo)"> 充值 </a> |
||||
<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 [routerLink]="['/admin/fleet-oil-card/user-list']" [queryParams]="{ cardNo: data.cardNo}"><a>客户列表</a></li> |
||||
<li nz-menu-item [routerLink]="['/admin/fleet-oil-card/car-list']" [queryParams]="{ cardNo: data.cardNo}"><a>车辆列表</a></li> |
||||
<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 == 2" (click)="showEnableConfirm(data.cardNo)"><a>启用</a></li> |
||||
<li nz-menu-item [routerLink]="['/admin/fleet-oil-card/record-list']" [queryParams]="{ cardNo: data.cardNo}"><a>油卡账单</a></li> |
||||
<li nz-menu-item [routerLink]="['/admin/fleet-oil-card/order-list']" [queryParams]="{ cardNo: data.cardNo}"><a>消费订单</a></li> |
||||
<li nz-menu-item (click)="showRecycleAmountModal(data)"><a>回收余额</a></li> |
||||
</ul> |
||||
</nz-dropdown-menu> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
</nz-spin> |
||||
|
||||
<nz-modal [(nzVisible)]="generateCardModal" nzTitle="生成油卡" (nzOnCancel)="closeGenerateCardModal()" nzWidth="500px" [nzFooter]="null"> |
||||
<form nz-form [formGroup]="generateCardForm"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired >生成数量</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<nz-input-number style="width: 100%" formControlName="generateNum" [nzMin]="1" [nzMax]="1000" [nzStep]="1"></nz-input-number> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<div style="text-align: center;"> |
||||
<button nz-button nzType="primary" style="width: 150px;" (click)="submitGenerateCard()">确定</button> |
||||
</div> |
||||
</form> |
||||
</nz-modal> |
||||
|
||||
<nz-modal [(nzVisible)]="editContactModal" nzTitle="设置联系人" (nzOnCancel)="closeEditContactModal()" nzWidth="500px" [nzFooter]="null"> |
||||
<form nz-form [formGroup]="editContactForm"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired >联系人</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<input nz-input formControlName="contactName" placeholder="请输入联系姓名" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired >联系电话</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<input nz-input formControlName="contactPhone" placeholder="请输入联系电话" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<div style="text-align: center;"> |
||||
<button nz-button nzType="primary" style="width: 150px;" (click)="submitEditContactData()">确定</button> |
||||
</div> |
||||
</form> |
||||
</nz-modal> |
||||
|
||||
<nz-modal [(nzVisible)]="rechargeModal" nzTitle="充值" (nzOnCancel)="closeRechargeModal()" nzWidth="500px" [nzFooter]="null"> |
||||
<form nz-form [formGroup]="rechargeForm"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired >卡号</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<input nz-input formControlName="cardNo" disabled /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired >充值金额</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<nz-input-number style="width: 100%" formControlName="price" [nzMin]="0.01" [nzMax]="9999999" [nzStep]="1" [nzPrecision]="2"></nz-input-number> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired >支付密码</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<input type="password" formControlName="twoPwd" nz-input placeholder="请输入支付密码" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<div style="text-align: center;"> |
||||
<button nz-button nzType="primary" style="width: 150px;" [nzLoading]="rechargeBtnLoading" (click)="submitRecharge()">确定</button> |
||||
</div> |
||||
</form> |
||||
</nz-modal> |
||||
|
||||
<nz-modal [(nzVisible)]="recycleAmountModal" nzTitle="油卡余额回收" (nzOnCancel)="closeRecycleAmountModal()" nzWidth="500px" [nzFooter]="null"> |
||||
<form nz-form [formGroup]="recycleAmountForm"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired >卡号</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<input nz-input formControlName="cardNo" disabled /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired >回收余额</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<nz-input-number style="width: 100%" formControlName="amount"></nz-input-number> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6" nzRequired >支付密码</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<input type="password" formControlName="twoPwd" nz-input placeholder="请输入支付密码" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
<div style="text-align: center;"> |
||||
<button nz-button nzType="primary" style="width: 150px;" [nzLoading]="recycleAmountBtnLoading" (click)="submitRecycleAmount()">确定</button> |
||||
</div> |
||||
</form> |
||||
</nz-modal> |
@ -0,0 +1,3 @@ |
||||
.table-td-operation a { |
||||
padding: 0px 5px; |
||||
} |
@ -0,0 +1,25 @@ |
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { FleetOilCardListComponent } from './fleet-oil-card-list.component'; |
||||
|
||||
describe('FleetOilCardListComponent', () => { |
||||
let component: FleetOilCardListComponent; |
||||
let fixture: ComponentFixture<FleetOilCardListComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ FleetOilCardListComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(FleetOilCardListComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,467 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
import {FormBuilder, FormGroup, Validators} from '@angular/forms'; |
||||
import {NzMessageService, NzModalService} from 'ng-zorro-antd'; |
||||
import {LocalStorageService} from '../../../services/local-storage.service'; |
||||
import {OrganizationService} from '../../../services/organization.service'; |
||||
import {CompanyAccountService} from '../../../services/company-account.service'; |
||||
import {Router} from '@angular/router'; |
||||
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; |
||||
import {ValidatorsService} from '../../../services/validators.service'; |
||||
import {FleetOilCardService} from '../../../services/fleet-oil-card.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-fleet-oil-card-list', |
||||
templateUrl: './fleet-oil-card-list.component.html', |
||||
styleUrls: ['./fleet-oil-card-list.component.scss'] |
||||
}) |
||||
export class FleetOilCardListComponent implements OnInit { |
||||
FILE_URL = environment.imageUrl; |
||||
roleType; |
||||
adminFlag; |
||||
loadingObject = { |
||||
spinning: false, |
||||
msg: '加载中' |
||||
}; |
||||
|
||||
dataObject: any = {}; |
||||
tableLoading = true; |
||||
searchForm: FormGroup; |
||||
pageNum: number; |
||||
whereObject: any = {}; |
||||
|
||||
generateCardModal = false; |
||||
generateCardForm: FormGroup; |
||||
|
||||
editContactModal = false; |
||||
editContactForm: FormGroup; |
||||
editContactData = {}; |
||||
|
||||
rechargeModal = false; |
||||
rechargeForm: FormGroup; |
||||
rechargeBtnLoading = false; |
||||
|
||||
recycleAmountModal = false; |
||||
recycleAmountForm: FormGroup; |
||||
recycleAmountBtnLoading = false; |
||||
|
||||
orgArray = []; |
||||
accountObject = { |
||||
amounts: 0 |
||||
}; |
||||
|
||||
constructor(private modal: NzModalService, |
||||
private message: NzMessageService, |
||||
private store: LocalStorageService, |
||||
private fleetOilCardService: FleetOilCardService, |
||||
private organizationService: OrganizationService, |
||||
private companyAccountService: CompanyAccountService, |
||||
private router: Router, |
||||
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], |
||||
contactName: [null], |
||||
contactPhone: [null], |
||||
createTime: [null], |
||||
createTimeS: [null], |
||||
createTimeE: [null], |
||||
bindTime: [null], |
||||
bindTimeS: [null], |
||||
bindTimeE: [null], |
||||
isConfigContact: [null], |
||||
status: [null], |
||||
bindStatus: [null], |
||||
}); |
||||
|
||||
this.editContactForm = this.form.group({ |
||||
cardNo: [null, [Validators.required]], |
||||
contactName: [null, [Validators.required]], |
||||
contactPhone: [null, [Validators.required, ValidatorsService.mobile]], |
||||
}); |
||||
|
||||
this.generateCardForm = this.form.group({ |
||||
generateNum: [1, [Validators.required]], |
||||
}); |
||||
|
||||
this.rechargeForm = this.form.group({ |
||||
cardNo: [{ value: null, disabled: true }, [Validators.required]], |
||||
price: [100, [Validators.required]], |
||||
twoPwd: [null, [Validators.required]], |
||||
}); |
||||
|
||||
this.recycleAmountForm = this.form.group({ |
||||
cardNo: [{ value: null, disabled: true }, [Validators.required]], |
||||
amount: [{ value: null, disabled: true }, [Validators.required]], |
||||
twoPwd: [null, [Validators.required]], |
||||
}); |
||||
|
||||
if (this.roleType === 5 && this.adminFlag === 1) { |
||||
this.organizationService.getOrganizationList(this.store.get(ADMIN_INFO_OBJECT)['bsCompany']['id'], data => { |
||||
this.orgArray = data['return_data']; |
||||
}); |
||||
} |
||||
|
||||
if (this.roleType === 5 && this.adminFlag === 0) { |
||||
this.getAccount(); |
||||
} |
||||
this.requestData(1); |
||||
} |
||||
|
||||
/** |
||||
* 请求数据 |
||||
*/ |
||||
requestData(pageNum) { |
||||
this.tableLoading = true; |
||||
this.whereObject['pageNum'] = pageNum; |
||||
this.whereObject['pageSize'] = 10; |
||||
this.fleetOilCardService.getCardList(this.whereObject, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.dataObject = data['return_data']; |
||||
} else { |
||||
this.modal.error(data['return_msg']); |
||||
} |
||||
this.tableLoading = false; |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询账户 |
||||
*/ |
||||
getAccount() { |
||||
this.companyAccountService.getAccount(data => { |
||||
this.accountObject = data['return_data']; |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 搜索 |
||||
* @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; |
||||
} |
||||
if (this.searchForm.value.bindTime != null) { |
||||
this.searchForm.value.bindTimeS = new Date(this.searchForm.value.bindTime[0]).getTime(); |
||||
this.searchForm.value.bindTimeE = new Date(this.searchForm.value.bindTime[1]).getTime(); |
||||
} else { |
||||
this.searchForm.value.bindTimeS = null; |
||||
this.searchForm.value.bindTimeE = null; |
||||
} |
||||
this.requestData(1); |
||||
} |
||||
|
||||
/** |
||||
* 重置 |
||||
*/ |
||||
resetForm(): void { |
||||
this.searchForm.reset(); |
||||
} |
||||
|
||||
/** |
||||
* 展示生成油卡模态框 |
||||
*/ |
||||
showGenerateCardModal() { |
||||
this.generateCardModal = true; |
||||
} |
||||
|
||||
/** |
||||
* 关闭生成油卡模态框 |
||||
*/ |
||||
closeGenerateCardModal() { |
||||
this.generateCardModal = false; |
||||
} |
||||
|
||||
/** |
||||
* 提交生成数量 |
||||
*/ |
||||
submitGenerateCard() { |
||||
for (const i in this.generateCardForm.controls) { |
||||
this.generateCardForm.controls[i].markAsDirty(); |
||||
this.generateCardForm.controls[i].updateValueAndValidity(); |
||||
} |
||||
if (this.generateCardForm.status == null || this.generateCardForm.status !== 'VALID') { |
||||
this.modal.warning({ |
||||
nzTitle: '提示', |
||||
nzContent: '请填写所有必填项', |
||||
}); |
||||
return; |
||||
} |
||||
|
||||
this.loadingObject.spinning = true; |
||||
this.loadingObject.msg = '生成油卡中...'; |
||||
this.closeGenerateCardModal(); |
||||
|
||||
this.fleetOilCardService.generateCard(this.generateCardForm.value, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.modal.success({ |
||||
nzTitle: '提示', |
||||
nzContent: '生成成功', |
||||
}); |
||||
this.requestData(this.whereObject['pageNum']); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'], |
||||
}); |
||||
} |
||||
this.loadingObject.spinning = false; |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 展示编辑联系人模态框 |
||||
*/ |
||||
showEditContactModal(data: object) { |
||||
this.editContactForm.patchValue(data); |
||||
this.editContactData = data; |
||||
this.editContactModal = true; |
||||
} |
||||
|
||||
/** |
||||
* 关闭编辑联系人模态框 |
||||
*/ |
||||
closeEditContactModal() { |
||||
this.editContactForm.reset(); |
||||
this.editContactModal = false; |
||||
} |
||||
|
||||
/** |
||||
* 提交编辑联系人数据 |
||||
*/ |
||||
submitEditContactData() { |
||||
for (const i in this.editContactForm.controls) { |
||||
this.editContactForm.controls[i].markAsDirty(); |
||||
this.editContactForm.controls[i].updateValueAndValidity(); |
||||
} |
||||
if (this.editContactForm.status == null || this.editContactForm.status !== 'VALID') { |
||||
this.modal.warning({ |
||||
nzTitle: '提示', |
||||
nzContent: '请填写所有必填项', |
||||
}); |
||||
return; |
||||
} |
||||
this.fleetOilCardService.setContact(this.editContactForm.value, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.modal.success({ |
||||
nzTitle: '提示', |
||||
nzContent: '设置成功', |
||||
}); |
||||
this.closeEditContactModal(); |
||||
this.requestData(this.whereObject['pageNum']); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'], |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 弹出禁用对话框 |
||||
*/ |
||||
showDisabledConfirm(cardNo: string): void { |
||||
this.modal.confirm({ |
||||
nzTitle: '警告', |
||||
nzContent: '是否禁用油卡', |
||||
nzOkText: '是', |
||||
nzCancelText: '否', |
||||
nzOkType: 'danger', |
||||
nzOnOk: () => this.disabledData(cardNo) |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 禁用数据 |
||||
*/ |
||||
disabledData(cardNo: string) { |
||||
this.fleetOilCardService.disabled({ cardNo: cardNo}, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData(this.whereObject['pageNum']); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'] |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 弹出启用对话框 |
||||
*/ |
||||
showEnableConfirm(cardNo: string): void { |
||||
this.modal.confirm({ |
||||
nzTitle: '警告', |
||||
nzContent: '是否启用油卡', |
||||
nzOkText: '是', |
||||
nzCancelText: '否', |
||||
nzOkType: 'danger', |
||||
nzOnOk: () => this.enableData(cardNo) |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 启用数据 |
||||
*/ |
||||
enableData(cardNo: string) { |
||||
this.fleetOilCardService.enable({ cardNo: cardNo}, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData(this.whereObject['pageNum']); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'] |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 展示充值模态框 |
||||
*/ |
||||
showRechargeModal(cardNo: string) { |
||||
this.rechargeForm.patchValue({cardNo: cardNo}); |
||||
this.rechargeModal = true; |
||||
} |
||||
|
||||
/** |
||||
* 关闭充值模态框 |
||||
*/ |
||||
closeRechargeModal() { |
||||
this.rechargeModal = false; |
||||
} |
||||
|
||||
/** |
||||
* 提交充值 |
||||
*/ |
||||
submitRecharge() { |
||||
for (const i in this.rechargeForm.controls) { |
||||
this.rechargeForm.controls[i].markAsDirty(); |
||||
this.rechargeForm.controls[i].updateValueAndValidity(); |
||||
} |
||||
if (this.rechargeForm.status == null || this.rechargeForm.status !== 'VALID') { |
||||
this.modal.warning({ |
||||
nzTitle: '提示', |
||||
nzContent: '请填写所有必填项', |
||||
}); |
||||
return; |
||||
} |
||||
this.rechargeBtnLoading = true; |
||||
this.rechargeForm.value['cardNo'] = this.rechargeForm.controls['cardNo']['value']; |
||||
this.fleetOilCardService.recharge(this.rechargeForm.value, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.modal.success({ |
||||
nzTitle: '提示', |
||||
nzContent: '充值成功', |
||||
}); |
||||
this.closeRechargeModal(); |
||||
this.getAccount(); |
||||
this.requestData(this.whereObject['pageNum']); |
||||
|
||||
} else if (data['return_code'] === '102136') { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'], |
||||
}); |
||||
this.router.navigateByUrl('admin/company-amount/pay-pwd-config'); |
||||
this.closeRechargeModal(); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'], |
||||
}); |
||||
} |
||||
this.rechargeBtnLoading = false; |
||||
}); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 展示充值模态框 |
||||
*/ |
||||
showRecycleAmountModal(cardData: object) { |
||||
this.recycleAmountForm.patchValue(cardData); |
||||
this.recycleAmountModal = true; |
||||
} |
||||
|
||||
/** |
||||
* 关闭充值模态框 |
||||
*/ |
||||
closeRecycleAmountModal() { |
||||
this.recycleAmountModal = false; |
||||
} |
||||
|
||||
/** |
||||
* 提交回收余额 |
||||
*/ |
||||
submitRecycleAmount() { |
||||
for (const i in this.recycleAmountForm.controls) { |
||||
this.recycleAmountForm.controls[i].markAsDirty(); |
||||
this.recycleAmountForm.controls[i].updateValueAndValidity(); |
||||
} |
||||
if (this.recycleAmountForm.status == null || this.recycleAmountForm.status !== 'VALID') { |
||||
this.modal.warning({ |
||||
nzTitle: '提示', |
||||
nzContent: '请填写所有必填项', |
||||
}); |
||||
return; |
||||
} |
||||
this.recycleAmountBtnLoading = true; |
||||
this.recycleAmountForm.value['cardNo'] = this.recycleAmountForm.controls['cardNo']['value']; |
||||
this.fleetOilCardService.recycleAmount(this.recycleAmountForm.value, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.modal.success({ |
||||
nzTitle: '提示', |
||||
nzContent: '回收成功', |
||||
}); |
||||
this.closeRecycleAmountModal(); |
||||
this.getAccount(); |
||||
this.requestData(this.whereObject['pageNum']); |
||||
|
||||
} else if (data['return_code'] === '102136') { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'], |
||||
}); |
||||
this.router.navigateByUrl('admin/company-amount/pay-pwd-config'); |
||||
this.closeRecycleAmountModal(); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'], |
||||
}); |
||||
} |
||||
this.recycleAmountBtnLoading = false; |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 导出油卡 |
||||
*/ |
||||
excelCard() { |
||||
this.fleetOilCardService.exportCard(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'] |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,167 @@ |
||||
<!-- 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" *ngIf="this.phone == null"> |
||||
<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" *ngIf="this.carLicensePlate == null"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="8">车牌</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<input nz-input formControlName="carLicensePlate" /> |
||||
</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 nzWidth="120px">客户电话</th> |
||||
<th nzWidth="100px">车牌</th> |
||||
<th nzWidth="160px">油卡卡号</th> |
||||
<th nzWidth="200px">交易单号</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>{{data.merPhone}}</td> |
||||
<td>{{data.carLicensePlate!=null?data.carLicensePlate:'未知'}}</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 { FleetOilCardOrderComponent } from './fleet-oil-card-order.component'; |
||||
|
||||
describe('FleetOilCardOrderComponent', () => { |
||||
let component: FleetOilCardOrderComponent; |
||||
let fixture: ComponentFixture<FleetOilCardOrderComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ FleetOilCardOrderComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(FleetOilCardOrderComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,147 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
import {FormBuilder, FormGroup} from '@angular/forms'; |
||||
import {NzMessageService, NzModalService} from 'ng-zorro-antd'; |
||||
import {LocalStorageService} from '../../../services/local-storage.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'; |
||||
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; |
||||
import {FleetOilCardService} from '../../../services/fleet-oil-card.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-fleet-oil-card-order', |
||||
templateUrl: './fleet-oil-card-order.component.html', |
||||
styleUrls: ['./fleet-oil-card-order.component.scss'] |
||||
}) |
||||
export class FleetOilCardOrderComponent implements OnInit { |
||||
FILE_URL = environment.imageUrl; |
||||
roleType; |
||||
adminFlag; |
||||
loadingObject = { |
||||
spinning: false, |
||||
msg: '加载中' |
||||
}; |
||||
|
||||
dataObject: any = {}; |
||||
tableLoading = true; |
||||
searchForm: FormGroup; |
||||
pageNum: number; |
||||
whereObject: any = {}; |
||||
|
||||
cardNo: string; |
||||
phone: string; |
||||
carLicensePlate: string; |
||||
orgArray = []; |
||||
|
||||
constructor(private modal: NzModalService, |
||||
private message: NzMessageService, |
||||
private store: LocalStorageService, |
||||
private oilCardService: FleetOilCardService, |
||||
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], |
||||
memPhone: [null], |
||||
carLicensePlate: [null], |
||||
status: [null], |
||||
payTime: [null], |
||||
payTimeS: [null], |
||||
payTimeE: [null], |
||||
}); |
||||
this.activatedRoute.queryParams.subscribe(queryParams => { |
||||
if (queryParams['cardNo'] != null) { |
||||
this.cardNo = queryParams['cardNo']; |
||||
} |
||||
if (queryParams['phone'] != null) { |
||||
this.phone = queryParams['phone']; |
||||
} |
||||
if (queryParams['carLicensePlate'] != null) { |
||||
this.carLicensePlate = queryParams['carLicensePlate']; |
||||
} |
||||
}); |
||||
|
||||
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; |
||||
} |
||||
if (this.phone != null) { |
||||
this.whereObject['phone'] = this.phone; |
||||
} |
||||
if (this.carLicensePlate != null) { |
||||
this.whereObject['carLicensePlate'] = this.carLicensePlate; |
||||
} |
||||
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'] |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
} |
@ -0,0 +1,145 @@ |
||||
<!-- 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-option nzValue="3" nzLabel="订单退款"></nz-option> |
||||
<nz-option nzValue="4" 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="sourceOrderNo" /> |
||||
</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="opUserType"> |
||||
<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="400px">来源内容</th> |
||||
<th nzWidth="120px">操作人类型</th> |
||||
<th nzWidth="120px">操作人名称</th> |
||||
<th nzWidth="120px">操作人电话</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.fleetOilCardNo}}</td> |
||||
<td>{{data.type | oilCardRecordType}}</td> |
||||
<td>¥{{data.transactionAmount}}</td> |
||||
<td>¥{{data.beforeAmount}}</td> |
||||
<td>¥{{data.afterAmount}}</td> |
||||
<td>{{data.sourceType | oilCardRecordSourceType}}</td> |
||||
<td>{{data.sourceOrderNo}}</td> |
||||
<td>{{data.sourceContent}}</td> |
||||
<td> |
||||
<span *ngIf="data.opUserType == 0">未知</span> |
||||
<span *ngIf="data.opUserType == 1">管理员</span> |
||||
<span *ngIf="data.opUserType == 2">客户</span> |
||||
</td> |
||||
<td>{{data.opUserName}}</td> |
||||
<td>{{data.opUserPhone}}</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,3 @@ |
||||
.table-td-operation a { |
||||
padding: 0px 5px; |
||||
} |
@ -0,0 +1,25 @@ |
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { FleetOilCardRecordComponent } from './fleet-oil-card-record.component'; |
||||
|
||||
describe('FleetOilCardRecordComponent', () => { |
||||
let component: FleetOilCardRecordComponent; |
||||
let fixture: ComponentFixture<FleetOilCardRecordComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ FleetOilCardRecordComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(FleetOilCardRecordComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,100 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
import {FormBuilder, FormGroup, Validators} from '@angular/forms'; |
||||
import {NzMessageService, NzModalService} from 'ng-zorro-antd'; |
||||
import {LocalStorageService} from '../../../services/local-storage.service'; |
||||
import {FleetOilCardService} from '../../../services/fleet-oil-card.service'; |
||||
import {ActivatedRoute, Router} from '@angular/router'; |
||||
|
||||
@Component({ |
||||
selector: 'app-fleet-oil-card-record', |
||||
templateUrl: './fleet-oil-card-record.component.html', |
||||
styleUrls: ['./fleet-oil-card-record.component.scss'] |
||||
}) |
||||
export class FleetOilCardRecordComponent implements OnInit { |
||||
FILE_URL = environment.imageUrl; |
||||
roleType; |
||||
adminFlag; |
||||
loadingObject = { |
||||
spinning: false, |
||||
msg: '加载中' |
||||
}; |
||||
|
||||
dataObject: any = {}; |
||||
tableLoading = true; |
||||
searchForm: FormGroup; |
||||
pageNum: number; |
||||
whereObject: any = {}; |
||||
|
||||
fleetOilCardNo: string; |
||||
|
||||
constructor(private modal: NzModalService, |
||||
private message: NzMessageService, |
||||
private store: LocalStorageService, |
||||
private fleetOilCardService: FleetOilCardService, |
||||
private activatedRoute: ActivatedRoute, |
||||
private router: Router, |
||||
private form: FormBuilder) { |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.searchForm = this.form.group({ |
||||
fleetOilCardNo: [null], |
||||
type: [null], |
||||
sourceOrderNo: [null], |
||||
sourceType: [null], |
||||
opUserPhone: [null], |
||||
opUserType: [null], |
||||
}); |
||||
|
||||
this.activatedRoute.queryParams.subscribe(queryParams => { |
||||
if (queryParams.cardNo != null) { |
||||
this.fleetOilCardNo = queryParams.cardNo; |
||||
this.requestData(1); |
||||
} |
||||
}); |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 请求数据 |
||||
*/ |
||||
requestData(pageNum) { |
||||
this.tableLoading = true; |
||||
this.whereObject['fleetOilCardNo'] = this.fleetOilCardNo; |
||||
this.whereObject['pageNum'] = pageNum; |
||||
this.whereObject['pageSize'] = 10; |
||||
this.fleetOilCardService.getRecordList(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,22 @@ |
||||
import { NgModule } from '@angular/core'; |
||||
import { Routes, RouterModule } from '@angular/router'; |
||||
import {FleetOilCardListComponent} from './fleet-oil-card-list/fleet-oil-card-list.component'; |
||||
import {FleetOilCardUserListComponent} from './fleet-oil-card-user-list/fleet-oil-card-user-list.component'; |
||||
import {FleetOilCardCarComponent} from './fleet-oil-card-car/fleet-oil-card-car.component'; |
||||
import {FleetOilCardRecordComponent} from './fleet-oil-card-record/fleet-oil-card-record.component'; |
||||
import {FleetOilCardOrderComponent} from './fleet-oil-card-order/fleet-oil-card-order.component'; |
||||
|
||||
|
||||
const routes: Routes = [ |
||||
{ path: 'list', component: FleetOilCardListComponent }, |
||||
{ path: 'user-list', component: FleetOilCardUserListComponent }, |
||||
{ path: 'car-list', component: FleetOilCardCarComponent }, |
||||
{ path: 'record-list', component: FleetOilCardRecordComponent }, |
||||
{ path: 'order-list', component: FleetOilCardOrderComponent }, |
||||
]; |
||||
|
||||
@NgModule({ |
||||
imports: [RouterModule.forChild(routes)], |
||||
exports: [RouterModule] |
||||
}) |
||||
export class FleetOilCardRoutingModule { } |
@ -0,0 +1,123 @@ |
||||
<!-- 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"> |
||||
<input nz-input formControlName="contactName" /> |
||||
</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="contactPhone" /> |
||||
</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)="downloadTemplate()"><i nz-icon nzType="vertical-align-bottom" nzTheme="outline"></i>下载导入模板</button> |
||||
|
||||
<nz-upload |
||||
[nzAccept]="'.xls,.xlsx'" |
||||
nzAction="{{WEB_SERVE_URL}}fleetOilCardUser/importData?cardNo={{fleetCardNo}}" |
||||
[nzHeaders]="{ authorization: 'authorization-text' }" |
||||
(nzChange)="handleChange($event)" |
||||
[nzShowUploadList]="false" |
||||
> |
||||
<button nz-button nzType="primary" class="right-btn"><i nz-icon nzType="import" nzTheme="outline"></i>导入客户</button> |
||||
</nz-upload> |
||||
</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="110px">客户姓名</th> |
||||
<th nzWidth="110px">客户电话</th> |
||||
<th nzWidth="110px">消费总额</th> |
||||
<th nzWidth="120px">最近消费</th> |
||||
<th nzWidth="120px">创建时间</th> |
||||
<th nzWidth="110px">创建人</th> |
||||
<th nzWidth="110px" nzRight="0px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of basicTable.data;let i = index"> |
||||
<td>{{i+1}}</td> |
||||
<td>{{data.contactName}}</td> |
||||
<td>{{data.contactPhone}}</td> |
||||
<td>¥{{data.amountConsume}}</td> |
||||
<td> |
||||
<span *ngIf="data.latelyConsumeTime == null">未消费</span> |
||||
<span *ngIf="data.latelyConsumeTime != null">{{data.latelyConsumeTime | date : 'yyyy-MM-dd HH:mm:ss'}}</span> |
||||
</td> |
||||
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||
<td>{{data.opUserName}}</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)="showDelConfirm(data.id)"><a>删除</a></li> |
||||
<li nz-menu-item [routerLink]="['/admin/fleet-oil-card/order-list']" [queryParams]="{ cardNo: data.fleetOilCardNo, phone: data.contactPhone }"><a>消费订单</a></li> |
||||
</ul> |
||||
</nz-dropdown-menu> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
</nz-spin> |
||||
|
||||
|
||||
<nz-modal [(nzVisible)]="importErrorDataModal" nzTitle="导入失败数据" (nzOnCancel)="closeImportErrorDataModal()" nzWidth="900px" [nzFooter]="null"> |
||||
<nz-table #errorStudentTable [nzData]="errorDataArray"> |
||||
<thead> |
||||
<tr> |
||||
<th nzWidth="80px">序号</th> |
||||
<th nzWidth="150px">客户姓名</th> |
||||
<th nzWidth="150px">客户电话</th> |
||||
<th nzWidth="300px">失败原因</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of errorStudentTable.data;let i = index"> |
||||
<td>{{ i + 1}}</td> |
||||
<td>{{data.contactName}}</td> |
||||
<td>{{data.contactPhone}}</td> |
||||
<td>{{data.errMsg}}</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
</nz-modal> |
@ -0,0 +1,3 @@ |
||||
.table-td-operation a { |
||||
padding: 0px 5px; |
||||
} |
@ -0,0 +1,25 @@ |
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { FleetOilCardUserListComponent } from './fleet-oil-card-user-list.component'; |
||||
|
||||
describe('FleetOilCardUserListComponent', () => { |
||||
let component: FleetOilCardUserListComponent; |
||||
let fixture: ComponentFixture<FleetOilCardUserListComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ FleetOilCardUserListComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(FleetOilCardUserListComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,251 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
import {FormBuilder, FormGroup, Validators} from '@angular/forms'; |
||||
import {NzMessageService, NzModalService, NzUploadChangeParam} from 'ng-zorro-antd'; |
||||
import {LocalStorageService} from '../../../services/local-storage.service'; |
||||
import {OrganizationService} from '../../../services/organization.service'; |
||||
import {CompanyAccountService} from '../../../services/company-account.service'; |
||||
import {ActivatedRoute, Router} from '@angular/router'; |
||||
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; |
||||
import {FleetOilCardUserService} from '../../../services/fleet-oil-card-user.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-fleet-oil-card-user-list', |
||||
templateUrl: './fleet-oil-card-user-list.component.html', |
||||
styleUrls: ['./fleet-oil-card-user-list.component.scss'] |
||||
}) |
||||
export class FleetOilCardUserListComponent implements OnInit { |
||||
WEB_SERVE_URL = environment.baseUrl; |
||||
FILE_URL = environment.imageUrl; |
||||
roleType; |
||||
adminFlag; |
||||
loadingObject = { |
||||
spinning: false, |
||||
msg: '加载中' |
||||
}; |
||||
dataObject: any = {}; |
||||
tableLoading = true; |
||||
searchForm: FormGroup; |
||||
pageNum: number; |
||||
whereObject: any = {}; |
||||
|
||||
fleetCardNo: string; |
||||
|
||||
rechargeModal = false; |
||||
rechargeForm: FormGroup; |
||||
rechargeBtnLoading = false; |
||||
|
||||
orgArray = []; |
||||
accountObject = { |
||||
amounts: 0 |
||||
}; |
||||
|
||||
importErrorDataModal = false; |
||||
errorDataArray = []; |
||||
|
||||
constructor(private modal: NzModalService, |
||||
private message: NzMessageService, |
||||
private store: LocalStorageService, |
||||
private fleetOilCardUserService: FleetOilCardUserService, |
||||
private organizationService: OrganizationService, |
||||
private companyAccountService: CompanyAccountService, |
||||
private activatedRoute: ActivatedRoute, |
||||
private router: Router, |
||||
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.activatedRoute.queryParams.subscribe(queryParams => { |
||||
if (queryParams.cardNo != null) { |
||||
this.fleetCardNo = queryParams.cardNo; |
||||
} |
||||
}); |
||||
|
||||
this.searchForm = this.form.group({ |
||||
contactName: [null], |
||||
contactPhone: [null], |
||||
}); |
||||
|
||||
this.rechargeForm = this.form.group({ |
||||
cardNo: [{ value: null, disabled: true }, [Validators.required]], |
||||
price: [100, [Validators.required]], |
||||
twoPwd: [null, [Validators.required]], |
||||
}); |
||||
|
||||
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; |
||||
this.whereObject['fleetOilCardNo'] = this.fleetCardNo; |
||||
this.whereObject['pageNum'] = pageNum; |
||||
this.whereObject['pageSize'] = 10; |
||||
this.fleetOilCardUserService.getUserList(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(); |
||||
} |
||||
|
||||
/** |
||||
* 弹出删除对话框 |
||||
*/ |
||||
showDelConfirm(id: number): void { |
||||
this.modal.confirm({ |
||||
nzTitle: '警告', |
||||
nzContent: '是否删除该用户?删除后用户无法使用车队油卡!', |
||||
nzOkText: '是', |
||||
nzCancelText: '否', |
||||
nzOkType: 'danger', |
||||
nzOnOk: () => this.delData(id) |
||||
}); |
||||
} |
||||
|
||||
delData(id: number) { |
||||
this.fleetOilCardUserService.delete({ id: id }, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData(this.whereObject['pageNum']); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'] |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 弹出禁用对话框 |
||||
*/ |
||||
showDisabledConfirm(cardNo: string): void { |
||||
this.modal.confirm({ |
||||
nzTitle: '警告', |
||||
nzContent: '是否禁用油卡', |
||||
nzOkText: '是', |
||||
nzCancelText: '否', |
||||
nzOkType: 'danger', |
||||
nzOnOk: () => this.disabledData(cardNo) |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 禁用数据 |
||||
*/ |
||||
disabledData(cardNo: string) { |
||||
/* this.fleetOilCardService.disabled({ cardNo: cardNo}, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData(this.whereObject['pageNum']); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'] |
||||
}); |
||||
} |
||||
});*/ |
||||
} |
||||
|
||||
/** |
||||
* 弹出启用对话框 |
||||
*/ |
||||
showEnableConfirm(cardNo: string): void { |
||||
this.modal.confirm({ |
||||
nzTitle: '警告', |
||||
nzContent: '是否启用油卡', |
||||
nzOkText: '是', |
||||
nzCancelText: '否', |
||||
nzOkType: 'danger', |
||||
nzOnOk: () => this.enableData(cardNo) |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 启用数据 |
||||
*/ |
||||
enableData(cardNo: string) { |
||||
/* this.fleetOilCardService.enable({ cardNo: cardNo}, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData(this.whereObject['pageNum']); |
||||
} else { |
||||
this.modal.error({ |
||||
nzTitle: '提示', |
||||
nzContent: data['return_msg'] |
||||
}); |
||||
} |
||||
});*/ |
||||
} |
||||
|
||||
handleChange(info: NzUploadChangeParam): void { |
||||
if (info.file.status === 'done') { |
||||
if (info.file.response.return_code === '000000') { |
||||
if (info.file.response.return_data == null || info.file.response.return_data.errorTotal === 0) { |
||||
|
||||
this.requestData(1); |
||||
this.message.success('导入成功'); |
||||
|
||||
} else { |
||||
this.modal.warning({ |
||||
nzTitle: '提示', |
||||
nzOkText: '查看失败数据', |
||||
nzContent: '只有部分数据导入成功', |
||||
nzOnOk: () => this.showImportErrorDataModal(info.file.response.return_data) |
||||
}); |
||||
} |
||||
} else { |
||||
this.message.error(info.file.response.return_msg); |
||||
} |
||||
} else if (info.file.status === 'error') { |
||||
this.message.error('上传错误'); |
||||
} |
||||
} |
||||
|
||||
// 打开模态框
|
||||
showImportErrorDataModal(data: []) { |
||||
this.errorDataArray = data['errorData']; |
||||
this.importErrorDataModal = true; |
||||
} |
||||
|
||||
closeImportErrorDataModal() { |
||||
this.importErrorDataModal = false; |
||||
} |
||||
|
||||
downloadTemplate() { |
||||
window.location.href = this.FILE_URL + "template/导入客户模板.xlsx"; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,29 @@ |
||||
import { NgModule } from '@angular/core'; |
||||
import { CommonModule } from '@angular/common'; |
||||
|
||||
import { FleetOilCardRoutingModule } from './fleet-oil-card-routing.module'; |
||||
import { FleetOilCardListComponent } from './fleet-oil-card-list/fleet-oil-card-list.component'; |
||||
import {NgZorroAntdModule} from 'ng-zorro-antd'; |
||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; |
||||
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; |
||||
import {AppCommonModule} from '../../app-common.module'; |
||||
import {NgxEchartsModule} from 'ngx-echarts'; |
||||
import { FleetOilCardUserListComponent } from './fleet-oil-card-user-list/fleet-oil-card-user-list.component'; |
||||
import { FleetOilCardCarComponent } from './fleet-oil-card-car/fleet-oil-card-car.component'; |
||||
import { FleetOilCardRecordComponent } from './fleet-oil-card-record/fleet-oil-card-record.component'; |
||||
import { FleetOilCardOrderComponent } from './fleet-oil-card-order/fleet-oil-card-order.component'; |
||||
|
||||
@NgModule({ |
||||
declarations: [FleetOilCardListComponent, FleetOilCardUserListComponent, FleetOilCardCarComponent, FleetOilCardRecordComponent, FleetOilCardOrderComponent], |
||||
imports: [ |
||||
CommonModule, |
||||
FleetOilCardRoutingModule, |
||||
NgZorroAntdModule, |
||||
ReactiveFormsModule, |
||||
FormsModule, |
||||
BreadcrumbModule, |
||||
AppCommonModule, |
||||
NgxEchartsModule, |
||||
] |
||||
}) |
||||
export class FleetOilCardModule { } |
@ -0,0 +1,39 @@ |
||||
<div class="content"> |
||||
<div class="top-title"> |
||||
<h3>账户信息</h3> |
||||
</div> |
||||
<div nz-row class="content-data"> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-statistic [nzValue]="(apiMerchants['amounts'] | number)" [nzTitle]="'账户余额(元)'"></nz-statistic> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-statistic [nzValue]="apiMerchants['phone']" [nzTitle]="'用户名'"></nz-statistic> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-statistic [nzValue]="apiMerchants['merchantName']" [nzTitle]="'商户名称'"></nz-statistic> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="content"> |
||||
<div class="top-title"> |
||||
<h3>接口信息</h3> |
||||
</div> |
||||
<div nz-row class="content-data"> |
||||
<div nz-col nzSpan="24"> |
||||
<p>商户号(mchId):{{apiMerchants['mchId']}}</p> |
||||
<p>密钥(apiKey):{{apiMerchants['apiKey']}}</p> |
||||
<p>IP白名单:{{apiMerchants['ext1']}}</p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="content"> |
||||
<div class="top-title"> |
||||
<h3>已开通产品</h3> |
||||
</div> |
||||
<div nz-row class="content-data"> |
||||
<div nz-col nzSpan="6" *ngFor="let item of productConfig; let i = index"> |
||||
<div class="product cp ml mt">{{item['codeType'] | productConfig}}</div> |
||||
</div> |
||||
</div> |
||||
</div> |
@ -0,0 +1,25 @@ |
||||
.content { |
||||
background: #fff; |
||||
margin-bottom: 20px; |
||||
margin-top: 20px; |
||||
} |
||||
.top-title { |
||||
padding: 16px; |
||||
border-bottom: 1px solid #e8e8e8 |
||||
} |
||||
.content-data { |
||||
padding: 24px; |
||||
.title { |
||||
color: rgba(0, 0, 0, 0.45); |
||||
font-size: 14px; |
||||
} |
||||
} |
||||
.product { |
||||
text-align: center; |
||||
font-size: 18px; |
||||
padding: 20px; |
||||
border: 1px solid #e8e8e8; |
||||
} |
||||
.product:hover { |
||||
box-shadow: #e8e8e8 0 0 4px 2px; |
||||
} |
@ -0,0 +1,34 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {LocalStorageService} from '../../../services/local-storage.service'; |
||||
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; |
||||
import {CommonsService} from "../../../services/commons.service"; |
||||
import {ApiMerchantsService} from "../../../services/api-merchants.service"; |
||||
|
||||
@Component({ |
||||
selector: 'app-api-merchant', |
||||
templateUrl: './api-merchant.component.html', |
||||
styleUrls: ['./api-merchant.component.scss'] |
||||
}) |
||||
export class ApiMerchantComponent implements OnInit { |
||||
|
||||
// API商户信息
|
||||
apiMerchants; |
||||
productConfig; |
||||
|
||||
constructor( |
||||
private store: LocalStorageService, // 数据缓存
|
||||
private apiMerchantService: ApiMerchantsService, |
||||
private common: CommonsService |
||||
) { } |
||||
|
||||
ngOnInit(): void { |
||||
this.apiMerchants = this.store.get(ADMIN_INFO_OBJECT)['apiMerchants']; |
||||
|
||||
this.apiMerchantService.getSecConfigList(this.apiMerchants['mchId'] , data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.productConfig = data['return_data']; |
||||
} |
||||
}); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,15 @@ |
||||
<!-- start 面包屑 --> |
||||
<nz-breadcrumb> |
||||
<nz-breadcrumb-item> |
||||
订单统计汇总 |
||||
</nz-breadcrumb-item> |
||||
</nz-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
|
||||
|
||||
<div class="inner-content"> |
||||
<div class="orderStatisticsByYMDData"> |
||||
<div echarts [options]="orderStatisticsByYMDData"></div> |
||||
</div> |
||||
|
||||
</div> |
@ -0,0 +1,48 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
@Component({ |
||||
selector: 'app-order-statistics', |
||||
templateUrl: './order-statistics.component.html', |
||||
styleUrls: ['./order-statistics.component.scss'] |
||||
}) |
||||
export class OrderStatisticsComponent implements OnInit { |
||||
|
||||
// 根据年月日查询总交易金额
|
||||
orderStatisticsByYMDData: any; |
||||
|
||||
constructor() { } |
||||
|
||||
ngOnInit(): void { |
||||
this.orderStatisticsByYMD(3); |
||||
} |
||||
|
||||
public orderStatisticsByYMD(dateType: number): void { |
||||
this.orderStatisticsByYMDData = { |
||||
xAxis: { |
||||
type: 'category', |
||||
|
||||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] |
||||
}, |
||||
yAxis: { |
||||
type: 'value' |
||||
}, |
||||
series: [ |
||||
{ |
||||
data: [120, 200, 150, 80, 70, 110, 130], |
||||
label: { |
||||
show: true, |
||||
color: 'black', |
||||
position: 'top' |
||||
}, |
||||
type: 'bar', |
||||
showBackground: true, |
||||
color: '#1890ff', |
||||
backgroundStyle: { |
||||
color: 'rgba(180, 180, 180, 0.2)' |
||||
} |
||||
} |
||||
] |
||||
}; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,21 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'callbackStatus' |
||||
}) |
||||
export class CallbackStatusPipe implements PipeTransform { |
||||
|
||||
transform(value: number): string { |
||||
switch (value) { |
||||
case 100: |
||||
return '未回调'; |
||||
case 101: |
||||
return '已回调'; |
||||
case 102: |
||||
return '回调未响应'; |
||||
case 103: |
||||
return '预备回调'; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,23 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'productConfig' |
||||
}) |
||||
export class ProductConfigPipe implements PipeTransform { |
||||
|
||||
transform(value: string): string { |
||||
switch (value) { |
||||
case 'CQ_SHELL': |
||||
return '重庆壳牌接口'; |
||||
case 'KFC_CONFIG': |
||||
return '肯德基接口'; |
||||
case 'MEMBER_RECHARGE_CONFIG': |
||||
return '会员充值接口'; |
||||
case 'PHONE_CONFIG': |
||||
return '话费接口'; |
||||
case 'STARBUCKS_CONFIG': |
||||
return '星巴克接口'; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,26 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'payCouponStatus' |
||||
}) |
||||
export class PayCouponStatusPipe implements PipeTransform { |
||||
|
||||
transform(value: number): string { |
||||
switch (value) { |
||||
case 1: |
||||
return '待支付'; |
||||
case 2: |
||||
return '已支付'; |
||||
case 3: |
||||
return '已完成'; |
||||
case 4: |
||||
return '已退款'; |
||||
case 5: |
||||
return '已取消'; |
||||
case 6: |
||||
return '退款中'; |
||||
case 7: |
||||
return '拒绝退款'; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,39 @@ |
||||
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 FleetOilCardCarService { |
||||
|
||||
constructor( |
||||
private http: HttpClient, |
||||
private common: CommonsService |
||||
) { } |
||||
|
||||
/** |
||||
* 删除用户 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public delete(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'fleetOilCardCar/delete', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询车辆列表 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getCarList(param: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'fleetOilCardCar/getCarList?' + this.common.getWhereCondition(param)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
} |
@ -0,0 +1,39 @@ |
||||
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 FleetOilCardUserService { |
||||
|
||||
constructor( |
||||
private http: HttpClient, |
||||
private common: CommonsService |
||||
) { } |
||||
|
||||
/** |
||||
* 删除用户 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public delete(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'fleetOilCardUser/delete', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询用户列表 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getUserList(param: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'fleetOilCardUser/getUserList?' + this.common.getWhereCondition(param)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
} |
@ -0,0 +1,148 @@ |
||||
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 FleetOilCardService { |
||||
|
||||
constructor( |
||||
private http: HttpClient, |
||||
private common: CommonsService |
||||
) { } |
||||
|
||||
/** |
||||
* 车队油卡生成 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public generateCard(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'fleetOilCard/generateCard', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 油卡充值 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public recharge(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'fleetOilCard/recharge', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 回收余额 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public recycleAmount(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'fleetOilCard/recycleAmount', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询油卡列表 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getCardList(param: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'fleetOilCard/getCardList?' + this.common.getWhereCondition(param)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询油卡记录列表 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getRecordList(param: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'fleetOilCard/getRecordList?' + this.common.getWhereCondition(param)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 查询订单列表 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getCardOrderList(param: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'fleetOilCard/getCardOrderList?' + this.common.getWhereCondition(param)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 导出油卡订单 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public exportCardOrder(param: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'fleetOilCard/exportCardOrder' + this.common.getWhereCondition(param)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 设置联系人 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public setContact(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'fleetOilCard/setContact', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 禁用 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public disabled(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'fleetOilCard/disabled', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 启用 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public enable(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'fleetOilCard/enable', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 导出油卡 |
||||
* |
||||
* @param param 参数对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public exportCard(param: object, callBack) { |
||||
this.http.post(environment.baseUrl + 'fleetOilCard/exportCard', param).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue