parent
5315c6f9f4
commit
7bd5cb0827
@ -0,0 +1,72 @@ |
|||||||
|
<!-- start 面包屑 --> |
||||||
|
<app-breadcrumb></app-breadcrumb> |
||||||
|
<!-- end 面包屑 --> |
||||||
|
<!--条件搜索--> |
||||||
|
|
||||||
|
<div class="inner-content"> |
||||||
|
<form nz-form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)"> |
||||||
|
<div nz-row> |
||||||
|
<div nz-col nzSpan="6"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="8">用户手机号</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="14"> |
||||||
|
<input nz-input formControlName="userPhone" /> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div nz-col nzSpan="6"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="8">中奖名称</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="14"> |
||||||
|
<input nz-input formControlName="awardName" /> |
||||||
|
</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: '1150px'}"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th nzWidth="150px">用户手机号</th> |
||||||
|
<th nzWidth="150px">用户昵称</th> |
||||||
|
<th nzWidth="200px">中奖名称</th> |
||||||
|
<th nzWidth="200px">中奖时间</th> |
||||||
|
<!-- <th nzWidth="80px" nzRight="0px">操作</th>--> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of basicTable.data;let i = index"> |
||||||
|
<td>{{data.userPhone}}</td> |
||||||
|
<td>{{data.userName}}</td> |
||||||
|
<td>{{data.awardName}}</td> |
||||||
|
<td>{{data.winLotteryTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||||
|
<!-- <td nzRight="0px" class="table-td-operation"> |
||||||
|
<a [routerLink]="['/admin/audit/pendingApprovedDetail']" [queryParams]="{id: data.id, entrance: 2, classId: data.classId, classType: data.classType, applyType: data.applyType,applyId:data.applyId}">详情</a> |
||||||
|
</td>--> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
</div> |
@ -0,0 +1,25 @@ |
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
|
import { ActivateLotteryRecordComponent } from './activate-lottery-record.component'; |
||||||
|
|
||||||
|
describe('ActivateLotteryRecordComponent', () => { |
||||||
|
let component: ActivateLotteryRecordComponent; |
||||||
|
let fixture: ComponentFixture<ActivateLotteryRecordComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ ActivateLotteryRecordComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(ActivateLotteryRecordComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
@ -0,0 +1,80 @@ |
|||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
import {FormBuilder, FormGroup} from "_@angular_forms@9.0.7@@angular/forms"; |
||||||
|
import {ActivateService} from "../../../services/activate.service"; |
||||||
|
import {IconService} from "../../../services/icon.service"; |
||||||
|
import {NzMessageService} from "_ng-zorro-antd@9.3.0@ng-zorro-antd"; |
||||||
|
import { Params, ActivatedRoute } from '@angular/router'; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-activate-lottery-record', |
||||||
|
templateUrl: './activate-lottery-record.component.html', |
||||||
|
styleUrls: ['./activate-lottery-record.component.scss'] |
||||||
|
}) |
||||||
|
export class ActivateLotteryRecordComponent implements OnInit { |
||||||
|
|
||||||
|
FILE_URL; |
||||||
|
dataObject: any = {}; |
||||||
|
tableLoading = true; |
||||||
|
searchForm: FormGroup; |
||||||
|
pageNum: number; |
||||||
|
whereObject: any = {}; |
||||||
|
activityId; |
||||||
|
|
||||||
|
constructor( |
||||||
|
private form: FormBuilder, |
||||||
|
private activate: ActivateService, |
||||||
|
private iconService: IconService, |
||||||
|
private activatedRoute: ActivatedRoute, |
||||||
|
private message: NzMessageService, |
||||||
|
) { |
||||||
|
} |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
this.searchForm = this.form.group({ |
||||||
|
userPhone: [null], |
||||||
|
awardName: [null], |
||||||
|
}); |
||||||
|
|
||||||
|
this.activatedRoute.queryParams.subscribe((queryParams: Params) => { |
||||||
|
if (queryParams['activityId']) { |
||||||
|
this.activityId = queryParams['activityId']; |
||||||
|
this.requestData(1); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 请求数据 |
||||||
|
*/ |
||||||
|
requestData(pageNum) { |
||||||
|
this.tableLoading = true; |
||||||
|
this.whereObject['activityId'] = this.activityId; |
||||||
|
this.whereObject['pageNum'] = pageNum; |
||||||
|
this.whereObject['pageSize'] = 10; |
||||||
|
this.activate.getWinLotteryList(this.whereObject, data => { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
this.dataObject = data['return_data']; |
||||||
|
} else { |
||||||
|
this.message.warning('获取失败!'); |
||||||
|
} |
||||||
|
this.tableLoading = false; |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 搜索 |
||||||
|
* @param whereObject |
||||||
|
*/ |
||||||
|
search(whereObject: object) { |
||||||
|
this.whereObject = whereObject; |
||||||
|
this.requestData(1); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 重置 |
||||||
|
*/ |
||||||
|
public resetForm(): void { |
||||||
|
this.searchForm.reset(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue