parent
0b02da68cc
commit
f67efef973
@ -0,0 +1,148 @@ |
||||
<!-- 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"> |
||||
<nz-select nzShowSearch nzAllowClear formControlName="status" nzPlaceHolder="请选择订单状态"> |
||||
<nz-option nzLabel="退款驳回" nzValue="0"></nz-option> |
||||
<nz-option nzLabel="退款通过" nzValue="2"></nz-option> |
||||
<nz-option nzLabel="退款中" nzValue="3"></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="payType" nzPlaceHolder="支付方式"> |
||||
<nz-option nzLabel="微信" nzValue="1"></nz-option> |
||||
<nz-option nzLabel="工会卡" nzValue="2"></nz-option> |
||||
<nz-option nzLabel="积分" nzValue="3"></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"> |
||||
<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"> |
||||
<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> |
||||
<div class="operating-button"> |
||||
<button nz-button nzType="primary" class="right-btn" (click)="downloadTemplate(searchForm.value)" ><i nz-icon nzType="download" nzTheme="outline"></i>导出订单</button> |
||||
</div> |
||||
<nz-table |
||||
class="table" |
||||
#ajaxTable |
||||
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="180px">退款来源</th> |
||||
<th nzWidth="180px">订单号</th> |
||||
<th nzWidth="100px">退款金额</th> |
||||
<th nzWidth="120px">提交人</th> |
||||
<th nzWidth="140px">创建时间</th> |
||||
<th nzWidth="100px" nzRight>支付方式</th> |
||||
<th nzWidth="100px" nzRight>状态</th> |
||||
<th nzWidth="200px" nzRight>操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i+1}}</td> |
||||
<td>{{data.refundSource | refundSource}}</td> |
||||
<td>{{data.sourceOrderNo}}</td> |
||||
<td>{{data.payPrice}}</td> |
||||
<td>{{data.createdUserName == null ? '暂无': data.createdUserName}}</td> |
||||
<td>{{data.createdTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||
<td nzRight>{{data.payType | rechargePayType}}</td> |
||||
<td nzRight>{{data.status | refundStatus}}</td> |
||||
<td nzRight class="table-td-operation"> |
||||
<a (click)="getDetail(data.ext1)">详情</a> |
||||
<nz-divider *ngIf="data['status'] === 0" nzType="vertical"></nz-divider> |
||||
<a (click)="orderToRefund(data.ext1)" *ngIf="data['status'] === 0">通过</a> |
||||
<nz-divider *ngIf="data['status'] === 0" nzType="vertical"></nz-divider> |
||||
<a (click)="getRefundReject(data.id)" *ngIf="data['status'] === 0">驳回</a> |
||||
</td> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
|
||||
<nz-modal [(nzVisible)]="isVisible" nzTitle="订单详情" nzWidth="1200"> |
||||
<nz-descriptions nzBordered [nzColumn]="{ xxl: 4, xl: 3, lg: 3, md: 3, sm: 2, xs: 1 }"> |
||||
<nz-descriptions-item nzTitle="订单名称">{{data['remarks']}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="订单类型">{{data['rechargeModel'] | rechargePrice}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="订单号">{{data['orderNo']}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="客户名称">{{data['userName'] == null ? '暂无': data['userName']}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="充值号码">{{data['rechargeContent'] == null ? '暂无': data['rechargeContent']}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="身份证号" *ngIf="data['rechargeModel'] === 3 ">{{data['idCard']}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="充值姓名" *ngIf="data['rechargeModel'] === 3 ">{{data['rechargeName']}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="充值金额">{{data['orderPrice']}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="支付金额">{{data['payPrice']}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="退款金额" *ngIf="data['refundFee'] != null">{{data['refundFee']}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="生成时间">{{data['createTimed'] | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item> |
||||
<nz-descriptions-item *ngIf="data['cancelTime'] != null" nzTitle="取消时间">{{data['cancelTime'] | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item> |
||||
<nz-descriptions-item *ngIf="data['finishTime'] != null" nzTitle="完成时间">{{data['finishTime'] | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item> |
||||
<nz-descriptions-item *ngIf="data['payTime'] != null" nzTitle="支付时间">{{data['payTime'] | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item> |
||||
<nz-descriptions-item *ngIf="data['refundTime'] != null" nzTitle="退款时间">{{data['refundTime'] | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item> |
||||
<nz-descriptions-item nzTitle="状态">{{data['status'] | rechargeStatus}}</nz-descriptions-item> |
||||
</nz-descriptions> |
||||
<div *nzModalFooter> |
||||
<button nz-button nzType="default" (click)="handleCancel()">取消</button> |
||||
</div> |
||||
</nz-modal> |
||||
|
@ -0,0 +1,5 @@ |
||||
.table-td-operation { |
||||
a { |
||||
margin-left: 8px; |
||||
} |
||||
} |
@ -0,0 +1,203 @@ |
||||
import {Component, OnDestroy, OnInit} from '@angular/core'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
|
||||
import {DiscountService} from '../../../services/discount.service'; |
||||
import {CouponService} from '../../../services/coupon.service'; |
||||
import {IconService} from '../../../services/icon.service'; |
||||
|
||||
import {CommonsService} from '../../../services/commons.service'; |
||||
import {RechargeService} from '../../../services/recharge.service'; |
||||
import {NzMessageService, NzNotificationService} from 'ng-zorro-antd'; |
||||
import {FormBuilder, FormGroup, Validators} from '@angular/forms'; |
||||
import {Router} from '@angular/router'; |
||||
import {AuditService} from "../../../services/audit.service"; |
||||
|
||||
@Component({ |
||||
selector: 'app-refund-audit', |
||||
templateUrl: './refund-audit.component.html', |
||||
styleUrls: ['./refund-audit.component.scss'] |
||||
}) |
||||
export class RefundAuditComponent implements OnInit { |
||||
|
||||
FILE_URL = environment.imageUrl; |
||||
searchForm: FormGroup; // 搜索框
|
||||
validateForm: FormGroup; // 添加框
|
||||
requestData = []; // 列表数据
|
||||
|
||||
total: number; // 页码
|
||||
pageNum = 1; // 页码
|
||||
pageSize = 10; // 条码
|
||||
loading = true; |
||||
isVisible = false; |
||||
id: number; |
||||
edit = false; |
||||
data = {}; |
||||
private timer; // 定时器
|
||||
constructor( |
||||
private form: FormBuilder, |
||||
private recharge: RechargeService, |
||||
private discount: DiscountService, |
||||
private coupon: CouponService, |
||||
private audit: AuditService, |
||||
private iconService: IconService, |
||||
private message: NzMessageService, |
||||
private router: Router, |
||||
private notification: NzNotificationService, |
||||
private common: CommonsService |
||||
) { |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.init(); |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
public init(): void { |
||||
this.searchForm = this.form.group({ |
||||
status: [null], |
||||
orderNo: [null], |
||||
rechargeModel: [null], |
||||
rechargeContent: [null], |
||||
userPhone: [null], |
||||
payTime: [null], |
||||
payType: [null], |
||||
createTime: [null], |
||||
}); |
||||
this.validateForm = this.form.group({ |
||||
type: [null, [Validators.required]], |
||||
price: [null, [Validators.required]], |
||||
realPrice: [null, [Validators.required]], |
||||
}); |
||||
|
||||
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.audit.getOrderList(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(); |
||||
} |
||||
|
||||
// 详情
|
||||
public getDetail(id: number): void { |
||||
this.id = id; |
||||
this.recharge.getOrderById(id , data => { |
||||
if (data['return_code'] === '000000') { |
||||
console.log(data); |
||||
this.data = data['return_data']; |
||||
} else { |
||||
this.message.error(data['return_msg']); |
||||
} |
||||
}); |
||||
|
||||
this.isVisible = true; |
||||
} |
||||
|
||||
|
||||
handleCancel(): void { |
||||
this.isVisible = false; |
||||
} |
||||
|
||||
|
||||
|
||||
public orderToRefund(id): void { |
||||
this.common.showConfirm('确认订单是否退款', item => { |
||||
if (item) { |
||||
this.recharge.orderToRefund(id, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.message.success('退款成功'); |
||||
this.getRequest(false, this.searchForm.value); |
||||
} else { |
||||
this.message.error(data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
public getRefundReject(id): void { |
||||
this.common.showConfirm('确认订单拒绝退款', item => { |
||||
if (item) { |
||||
this.audit.getRefundReject(id, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.message.success('操作成功'); |
||||
this.getRequest(false, this.searchForm.value); |
||||
} else { |
||||
this.message.error(data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
|
||||
|
||||
public postRefund(orderNo): void { |
||||
this.common.showConfirm('确认订单申请退款', item => { |
||||
if (item) { |
||||
this.recharge.postRefund({ |
||||
refundSource: 1 , |
||||
sourceOrderNo: orderNo |
||||
}, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.message.success('退款成功'); |
||||
this.getRequest(false, this.searchForm.value); |
||||
} else { |
||||
this.message.error(data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
|
||||
|
||||
// 下载模板
|
||||
downloadTemplate(whereObject) { |
||||
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['createTimeS'][0].getTime(); |
||||
whereObject['createTimeE'] = whereObject['createTimeE'][1].getTime(); |
||||
} |
||||
this.recharge.exportOrderList(whereObject, data => { |
||||
if (data['return_code'] === '000000') { |
||||
window.location.href = this.FILE_URL + data['return_data']; |
||||
} else { |
||||
this.message.error(data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,15 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'refundSource' |
||||
}) |
||||
export class RefundSourcePipe implements PipeTransform { |
||||
|
||||
transform(value: number): string { |
||||
switch (value) { |
||||
case 1: |
||||
return '话费退款'; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@ |
||||
import { RefundStatusPipe } from './refund-status.pipe'; |
||||
|
||||
describe('RefundStatusPipe', () => { |
||||
it('create an instance', () => { |
||||
const pipe = new RefundStatusPipe(); |
||||
expect(pipe).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,19 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'refundStatus' |
||||
}) |
||||
export class RefundStatusPipe implements PipeTransform { |
||||
|
||||
transform(value: number): string { |
||||
switch (value) { |
||||
case 1: |
||||
return '退款通过'; |
||||
case 2: |
||||
return '退款驳回'; |
||||
case 0: |
||||
return '退款中'; |
||||
} |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue