修改代码

pull/1/head
袁野 3 years ago
parent 52d1710bbe
commit 12eeb6630a
  1. 65
      src/app/admin/recharge-order/order-list/order-list.component.html
  2. 38
      src/app/admin/recharge-order/order-list/order-list.component.ts
  3. 22
      src/app/admin/recharge-order/price-list/price-list.component.html
  4. 2
      src/app/admin/recharge-order/price-list/price-list.component.ts

@ -35,6 +35,18 @@
</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="rechargeType" nzPlaceHolder="请选择充值类型">
<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>
@ -113,6 +125,15 @@
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<div class="operating-button">
<nz-upload
[nzAccept]="'.xls,.xlsx'"
nzAction="{{WEB_SERVE_URL}}outRechargeOrder/importRechargeOrder"
[nzHeaders]="{ authorization: 'authorization-text' }"
(nzChange)="handleChange($event)"
[nzShowUploadList]="false"
>
<button nz-button nzType="primary" ><i nz-icon nzType="import" nzTheme="outline"></i>导入充值订单</button>
</nz-upload>
<button nz-button nzType="primary" class="right-btn" (click)="downloadTemplate(searchForm.value)" ><i nz-icon nzType="download" nzTheme="outline"></i>导出订单</button>
</div>
<nz-table
@ -161,9 +182,9 @@
<td nzRight>{{data.status | rechargeStatus}}</td>
<td nzRight class="table-td-operation">
<a (click)="getDetail(data.id)">详情</a>
<a *ngIf="data.status === 2" (click)="finishOrder(data.id)">完成充值</a>
<!-- <a *ngIf="data.status === 2 && data.payType !== 3" (click)="orderToRefund(data.id)">退款</a>-->
<a *ngIf="data.status === 2 && data.payType !== 3" (click)="postRefund(data.orderNo)">申请退款</a>
<!-- <a *ngIf="data.status === 2" (click)="finishOrder(data.id)">完成充值</a>-->
<!--&lt;!&ndash; <a *ngIf="data.status === 2 && data.payType !== 3" (click)="orderToRefund(data.id)">退款</a>&ndash;&gt;-->
<!-- <a *ngIf="data.status === 2 && data.payType !== 3" (click)="postRefund(data.orderNo)">申请退款</a>-->
</td>
</tbody>
</nz-table>
@ -194,3 +215,41 @@
</div>
</nz-modal>
<nz-modal [(nzVisible)]="errorStudentVisible" nzTitle="导入失败数据" (nzOnCancel)="errorStudentVisible = false" nzWidth="1200px" [nzFooter]="null">
<nz-table #errorStudentTable [nzData]="importErrorStudentArray" [nzScroll]="{ x: '1200px' }">
<thead>
<tr>
<th nzWidth="80px">序号</th>
<th nzWidth="150px">订单号</th>
<th nzWidth="150px">用户昵称</th>
<th nzWidth="150px">用户联系方式</th>
<th nzWidth="150px">充值类型</th>
<th nzWidth="150px">充值内容</th>
<th nzWidth="150px">支付方式</th>
<th nzWidth="150px">卡号</th>
<th nzWidth="150px">订单金额</th>
<th nzWidth="150px">应付金额</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.orderNo}}</td>
<td>{{data.userName}}</td>
<td>{{data.userPhone}}</td>
<td>{{data.rechargeModelName}}</td>
<td>{{data.rechargeContent}}</td>
<td>{{data.payTypeName}}</td>
<td>{{data.cardNo}}</td>
<td>{{data.orderPrice}}</td>
<td>{{data.payRealPrice}}</td>
<td>{{data.statusName}}</td>
<td>{{data.payTime}}</td>
<td>{{data.errorMessage}}</td>
</tr>
</tbody>
</nz-table>
</nz-modal>

@ -7,7 +7,7 @@ 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 {NzMessageService, NzModalService, NzNotificationService, NzUploadChangeParam} from 'ng-zorro-antd';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {Router} from '@angular/router';
@ -18,10 +18,12 @@ import {Router} from '@angular/router';
})
export class OrderListComponent implements OnInit , OnDestroy {
FILE_URL = environment.imageUrl;
WEB_SERVE_URL = environment.baseUrl;
searchForm: FormGroup; // 搜索框
validateForm: FormGroup; // 添加框
requestData = []; // 列表数据
importErrorStudentArray = [];
errorStudentVisible = false;
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
@ -35,6 +37,7 @@ export class OrderListComponent implements OnInit , OnDestroy {
private form: FormBuilder,
private recharge: RechargeService,
private discount: DiscountService,
private modal: NzModalService,
private coupon: CouponService,
private iconService: IconService,
private message: NzMessageService,
@ -77,6 +80,7 @@ export class OrderListComponent implements OnInit , OnDestroy {
idCard: [null],
rechargeContent: [null],
userPhone: [null],
rechargeType: [null],
payTime: [null],
payType: [null],
createTime: [null],
@ -214,5 +218,35 @@ export class OrderListComponent implements OnInit , OnDestroy {
});
}
handleChange(info: NzUploadChangeParam): void {
if (info.file.status === 'done') {
if (info.file.response.return_code === '000000') {
this.loading = false;
if (info.file.response.return_data == null || info.file.response.return_data.errorTotal === 0) {
this.message.success('导入成功');
this.getRequest(true, this.searchForm.value);
} else {
this.modal.warning({
nzTitle: '提示',
nzOkText: '查看失败数据',
nzContent: '只有部分数据导入成功',
nzOnOk: () => this.showErrorStudentModal(info.file.response.return_data)
});
}
} else {
this.loading = false;
this.message.error(info.file.response.return_msg);
}
} else if (info.file.status === 'error') {
this.message.error('上传错误');
}
}
// 打开模态框
showErrorStudentModal(data: []) {
this.getRequest(true, this.searchForm.value);
this.importErrorStudentArray = data['errorData'];
this.errorStudentVisible = true;
}
}

@ -19,6 +19,17 @@
</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="rechargeType" nzPlaceHolder="请选择充值类型">
<nz-option nzLabel="快充" nzValue="1"></nz-option>
<nz-option nzLabel="慢充" nzValue="2"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
@ -56,6 +67,7 @@
<tr>
<th>编号</th>
<th>金额类型</th>
<th>充值类型</th>
<!-- <th>供货商编号</th>-->
<!-- <th>商品ID</th>-->
<th>充值金额</th>
@ -68,6 +80,7 @@
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i + 1}}</td>
<td>{{data.type | rechargePrice}}</td>
<td>{{data.rechargeType== 1? '快充':'慢充'}}</td>
<!-- <td>{{data.channel}}</td>-->
<!-- <td>{{data.goodsId}}</td>-->
<td>{{data.price}}</td>
@ -94,6 +107,15 @@
</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-select nzShowSearch nzAllowClear formControlName="rechargeType" nzPlaceHolder="请选择充值类型">
<nz-option nzLabel="快充" [nzValue] ="1"></nz-option>
<nz-option nzLabel="慢充" [nzValue]="2"></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="请输入商品排序!">

@ -50,10 +50,12 @@ export class PriceListComponent implements OnInit {
public init(): void {
this.searchForm = this.form.group({
type: [null],
rechargeType: [null],
});
this.validateForm = this.form.group({
type: [null, [Validators.required]],
price: [null, [Validators.required]],
rechargeType: [null, [Validators.required]],
realPrice: [{value: null, disabled: true}, [Validators.required]],
// goodsId: [null, [Validators.required]],
discount: [null, [Validators.required]],

Loading…
Cancel
Save