commit
70ef06a959
@ -0,0 +1,85 @@ |
||||
<!-- start 面包屑 --> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
<!-- start 搜索条件 --> |
||||
<div > |
||||
<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]="8">优惠券名称</nz-form-label> |
||||
<nz-form-control [nzSpan]="14"> |
||||
<input nz-input formControlName="discountName" /> |
||||
</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 formControlName="status" nzAllowClear> |
||||
<nz-option [nzValue]="0" nzLabel="已过期"></nz-option> |
||||
<nz-option [nzValue]="1" nzLabel="未使用"></nz-option> |
||||
<nz-option [nzValue]="2" nzLabel="已使用"></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> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
<!-- end 搜索条件 --> |
||||
|
||||
<!--列表数据--> |
||||
<div class="inner-content"> |
||||
<span>共计 {{total?total:0}} 条数据</span> |
||||
<!--数组表格 --> |
||||
<nz-table #basicTable |
||||
nzShowPagination |
||||
nzShowSizeChanger |
||||
nzBordered |
||||
[nzData]="requestData" |
||||
[nzTotal]="total" |
||||
[nzLoading]="loading" |
||||
[nzFrontPagination]="false" |
||||
[(nzPageIndex)]="pageNum" |
||||
[(nzPageSize)]="pageSize" |
||||
(nzPageIndexChange)="getRequest(false , searchForm.value)" |
||||
(nzPageSizeChange)="getRequest(false , searchForm.value)" |
||||
[nzPageSizeOptions]="[10,20,50,100]" |
||||
[nzScroll]="{ x: '1200px'}"> |
||||
<thead> |
||||
<tr> |
||||
<th >优惠券名称</th> |
||||
<th >优惠券类型</th> |
||||
<!-- <th >优惠金额</th> --> |
||||
<th>用户手机号</th> |
||||
<th>状态</th> |
||||
<th >使用时间</th> |
||||
<th>创建时间</th> |
||||
<th>使用截止时间</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of basicTable.data;let i = index"> |
||||
<td>{{data.discountName}}</td> |
||||
<td>{{data.discountType | discountType}}</td> |
||||
<!-- <td>{{data.discountPrice}}</td> --> |
||||
<td>{{data.ext3 | phoneTranslate}}</td> |
||||
<td>{{data.status | discountCodeStatus2}}</td> |
||||
<td>{{data.useTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||
<td>{{data.useEndTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
|
||||
|
@ -0,0 +1,7 @@ |
||||
img { |
||||
width: 60px; |
||||
} |
||||
.fontColor { |
||||
color: red; |
||||
} |
||||
|
@ -0,0 +1,28 @@ |
||||
/* tslint:disable:no-unused-variable */ |
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
import { By } from '@angular/platform-browser'; |
||||
import { DebugElement } from '@angular/core'; |
||||
|
||||
import { GiveCouponsComponent } from './give-coupons.component'; |
||||
|
||||
describe('GiveCouponsComponent', () => { |
||||
let component: GiveCouponsComponent; |
||||
let fixture: ComponentFixture<GiveCouponsComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ GiveCouponsComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(GiveCouponsComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,90 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
|
||||
import {environment} from '../../../../environments/environment'; |
||||
import {CompanyService} from '../../../services/company.service'; |
||||
import {LocalStorageService} from '../../../services/local-storage.service'; |
||||
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; |
||||
import {CommonsService} from '../../../services/commons.service'; |
||||
import {OrderMobileRechargeService} from '../../../services/order/order-mobile-recharge.service'; |
||||
import {FormBuilder, FormGroup} from '@angular/forms'; |
||||
import {NzMessageService, NzNotificationService} from 'ng-zorro-antd'; |
||||
|
||||
import {animate, state, style, transition, trigger} from '@angular/animations'; |
||||
import { OrderService } from 'src/app/services/order.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-give-coupons', |
||||
templateUrl: './give-coupons.component.html', |
||||
styleUrls: ['./give-coupons.component.scss'] |
||||
}) |
||||
export class GiveCouponsComponent implements OnInit { |
||||
|
||||
// 搜索框
|
||||
searchForm: FormGroup; |
||||
|
||||
// 列表相关参数
|
||||
// 总条数
|
||||
total: number; |
||||
// 页码
|
||||
pageNum = 1; |
||||
// 条码
|
||||
pageSize = 10; |
||||
// 列表数据
|
||||
requestData = []; |
||||
// 列表加载
|
||||
loading = true; |
||||
|
||||
// 数据加载中参数
|
||||
loadingObject = { |
||||
title: '加载中...', |
||||
status: false, |
||||
}; |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
constructor( |
||||
private form: FormBuilder, |
||||
private store: LocalStorageService, |
||||
private message: NzMessageService, |
||||
private orderMobileRechargeService: OrderMobileRechargeService, |
||||
private orderService: OrderService, |
||||
private commonsService: CommonsService, |
||||
private notification: NzNotificationService, |
||||
) { } |
||||
|
||||
ngOnInit(): void { |
||||
// 搜索表单初始化
|
||||
this.searchForm = this.form.group({ |
||||
discountName: [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.orderService.getAgentDiscountList(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