parent
6ea5256ef6
commit
4fce4a95c1
@ -0,0 +1,66 @@ |
||||
<!-- start 面包屑 --> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
|
||||
|
||||
|
||||
<div class="inner-content"> |
||||
<span>共计 {{total}} 条数据</span> |
||||
|
||||
<!-- <div class="operating-button"> |
||||
<button nz-button nzType="primary" class="right-btn" [routerLink]="['/admin/coupon/coupon-edit']" ><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button> |
||||
<button nz-button nzType="primary" class="right-btn" (click)="getGuizhouSinopec()" ><i nz-icon nzType="redo" nzTheme="outline"></i>刷新中石化卡券</button> |
||||
</div> --> |
||||
<nz-table |
||||
class="table" |
||||
#ajaxTable |
||||
nzShowSizeChanger |
||||
[nzFrontPagination]="false" |
||||
[nzData]="requestData" |
||||
[nzLoading]="loading" |
||||
[nzTotal]="total" |
||||
[(nzPageIndex)]="pageNum" |
||||
[(nzPageSize)]="pageSize" |
||||
|
||||
(nzPageIndexChange)="getRequest(false , searchForm.value)" |
||||
(nzPageSizeChange)="getRequest(false , searchForm.value)"> |
||||
<thead nzSingleSort> |
||||
<tr> |
||||
<th nzWidth="80px">编号</th> |
||||
<th >优惠券编码</th> |
||||
<th >优惠券名称</th> |
||||
<th >面额</th> |
||||
<!-- <th nzWidth="100px">使用条件</th> |
||||
<th nzWidth="100px">有效类型</th> |
||||
<th nzWidth="100px">使用开始时间</th> |
||||
<th nzWidth="100px">使用结束时间</th> |
||||
<th nzWidth="100px">有效天数</th> --> |
||||
<th >优惠券状态</th> |
||||
|
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i+1}}</td> |
||||
<td>{{data.couponCode}}</td> |
||||
<td>{{data.couponName}}</td> |
||||
<td>{{data.denomination}}</td> |
||||
<!-- <td>{{data.minPrice}}</td> |
||||
<td>{{data.receiveType | receiveType}}</td> |
||||
<td>{{(data.useStartTime | date: 'yyyy-MM-dd HH:mm') || '暂无数据'}}</td> |
||||
<td>{{(data.useEndTime | date: 'yyyy-MM-dd HH:mm') || '暂无数据'}}</td> |
||||
<td>{{data.receiveDays}}</td> --> |
||||
|
||||
<td >{{data.couponStatus | blxCouponStatus}}</td> |
||||
|
||||
<!-- <td > |
||||
<span *ngIf="data.status === 2" style="color: limegreen">{{data.status | couponStatus}}</span> |
||||
<span *ngIf="data.status === 3" style="color: red">{{data.status | couponStatus}}</span> |
||||
<span *ngIf="data.status === 1 || data.status === 102 || data.status === 101">{{data.status | couponStatus}}</span> |
||||
|
||||
</td> --> |
||||
</tr> |
||||
|
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
@ -0,0 +1,6 @@ |
||||
img { |
||||
width: 60px; |
||||
} |
||||
.fontColor { |
||||
color: red; |
||||
} |
@ -0,0 +1,61 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
import { CouponService } from '../../../services/coupon.service'; |
||||
import {CommonsService} from '../../../services/commons.service'; |
||||
import { FormBuilder, FormGroup } from '@angular/forms'; |
||||
import {NzMessageService} from 'ng-zorro-antd'; |
||||
@Component({ |
||||
selector: 'app-blx-coupon', |
||||
templateUrl: './blx-coupon.component.html', |
||||
styleUrls: ['./blx-coupon.component.scss'] |
||||
}) |
||||
export class BlxCouponComponent implements OnInit { |
||||
searchForm: FormGroup; // 搜索框
|
||||
requestData = []; // 列表数据
|
||||
total: number = 0; // 总计条数
|
||||
pageNum = 1; // 页码
|
||||
pageSize = 10; // 条码
|
||||
loading = false; |
||||
|
||||
constructor( |
||||
private form: FormBuilder, |
||||
private coupon: CouponService, |
||||
private message: NzMessageService, |
||||
) { } |
||||
|
||||
ngOnInit() { |
||||
this.searchForm = this.form.group({ |
||||
// merchantId: [null],
|
||||
// couponName: [null],
|
||||
// couponType: [null],
|
||||
// goodsTypeId: [null],
|
||||
// brandId: [null],
|
||||
// displayArea: [null],
|
||||
// status: [null],
|
||||
}); |
||||
this.getRequest(true,this.searchForm.value) |
||||
} |
||||
|
||||
|
||||
// 查询列表
|
||||
public getRequest(reset: boolean = false, whereObject: object) { |
||||
|
||||
this.loading = true; |
||||
if (reset) { |
||||
this.pageNum = 1; |
||||
} |
||||
whereObject['pageNum'] = this.pageNum; |
||||
whereObject['pageSize'] = this.pageSize; |
||||
this.coupon.getBlxCouponList(whereObject, data => { |
||||
this.loading = false; |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData = data['return_data'].list; |
||||
this.total = data['return_data'].total; |
||||
} else { |
||||
this.message.error(data['return_msg']); |
||||
} |
||||
}); |
||||
|
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue