pull/1/head
parent
a9141bc3d8
commit
c3ad89e1c8
@ -0,0 +1,123 @@ |
||||
<!-- start 面包屑 --> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
|
||||
<div class="inner-content"> |
||||
<span>共计 {{total}} 条数据</span> |
||||
<nz-table |
||||
class="table" |
||||
#ajaxTable |
||||
nzShowSizeChanger |
||||
[nzFrontPagination]="false" |
||||
[nzData]="requestData" |
||||
[nzLoading]="loading" |
||||
[nzTotal]="total" |
||||
[(nzPageIndex)]="pageNum" |
||||
[(nzPageSize)]="pageSize" |
||||
[nzScroll]="{ x: '1200px' }" |
||||
(nzPageIndexChange)="getRequest(false , {})" |
||||
(nzPageSizeChange)="getRequest(false , {})"> |
||||
<thead nzSingleSort> |
||||
<tr> |
||||
<th nzWidth="50px">编号</th> |
||||
<th nzWidth="80px">优惠券KEY</th> |
||||
<th nzWidth="80px">优惠券名称</th> |
||||
<th nzWidth="80px">优惠券类型</th> |
||||
<th nzWidth="70px">优惠内容</th> |
||||
<th nzWidth="70px">有效天数</th> |
||||
<th nzWidth="100px">截止日期</th> |
||||
<th nzWidth="100px">创建时间</th> |
||||
<th nzWidth="100px">状态</th> |
||||
<th nzWidth="80px" nzRight="0px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i + 1}}</td> |
||||
<td>{{data['highDiscount'].discountKey}}</td> |
||||
<td>{{data['highDiscount'].discountName}}</td> |
||||
<td>{{data['highDiscount'].discountType | discountType}}</td> |
||||
<td> |
||||
<span *ngIf="data['highDiscount'].discountType === 1"> |
||||
满{{data['highDiscount'].discountCondition}}抵扣{{data['highDiscount'].discountPrice}} |
||||
</span> |
||||
<span *ngIf="data['highDiscount'].discountType === 2"> |
||||
抵扣{{data['highDiscount'].discountPrice}} |
||||
</span> |
||||
<span *ngIf="data['highDiscount'].discountType === 3"> |
||||
{{data['highDiscount'].discountPrice}}折 |
||||
</span> |
||||
</td> |
||||
<td>{{data['highDiscount'].effectiveDay}}</td> |
||||
<td>{{data['highDiscount'].salesEndTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td>{{data['highDiscount'].createTime}}</td> |
||||
<td>{{data['highDiscount'].status | discountStatus}}</td> |
||||
<td nzRight="0px" class="table-td-operation"> |
||||
<a (click)="getDetail(data.id)">使用情况</a> |
||||
|
||||
</td> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
|
||||
<nz-modal [(nzVisible)]="isVisible" nzTitle="使用情况" nzWidth="1000" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"> |
||||
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequestCode(true , searchForm.value)"> |
||||
<div nz-row> |
||||
<div nz-col nzSpan="9"> |
||||
<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="1"></nz-option> |
||||
<nz-option nzLabel="待使用" nzValue="2"></nz-option> |
||||
<nz-option nzLabel="已使用" nzValue="3"></nz-option> |
||||
<nz-option nzLabel="已过期" nzValue="4"></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> |
||||
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
|
||||
<span>共计 {{totalCode}} 条数据</span> |
||||
<nz-table |
||||
class="table" |
||||
#ajaxTableCode |
||||
nzShowSizeChanger |
||||
[nzFrontPagination]="false" |
||||
[nzData]="requestDataCode" |
||||
[nzLoading]="loadingCode" |
||||
[nzTotal]="totalCode" |
||||
[(nzPageIndex)]="pageNumCode" |
||||
[(nzPageSize)]="pageSizeCode" |
||||
(nzPageIndexChange)="getRequestCode(false , searchForm.value)" |
||||
(nzPageSizeChange)="getRequestCode(false , searchForm.value)"> |
||||
<thead nzSingleSort> |
||||
<tr> |
||||
<th nzWidth="50px">编号</th> |
||||
<th nzWidth="70px">优惠券名称</th> |
||||
<th nzWidth="70px">用户名称</th> |
||||
<th nzWidth="70px">二维码生成时间</th> |
||||
<th nzWidth="50px">状态</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTableCode.data; let i = index"> |
||||
<td>{{i+1}}</td> |
||||
<td>{{data['highDiscount'].discountName}}</td> |
||||
<td> |
||||
{{data['highUser'] == null ? '暂无': data['highUser'].name}} |
||||
</td> |
||||
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td>{{data.status | couponCode}}</td> |
||||
</tbody> |
||||
</nz-table> |
||||
|
||||
</nz-modal> |
||||
|
@ -0,0 +1,4 @@ |
||||
.head_img { |
||||
height: 60px; |
||||
width: 60px; |
||||
} |
@ -0,0 +1,114 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
import {FormBuilder, FormGroup} from '@angular/forms'; |
||||
import {UserService} from '../../../services/user.service'; |
||||
import {IconService} from '../../../services/icon.service'; |
||||
import {NzMessageService} from 'ng-zorro-antd'; |
||||
import {CommonsService} from '../../../services/commons.service'; |
||||
import {AgentService} from '../../../services/agent.service'; |
||||
import {DiscountService} from '../../../services/discount.service'; |
||||
import {LocalStorageService} from '../../../services/local-storage.service'; |
||||
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; |
||||
|
||||
@Component({ |
||||
selector: 'app-order-coupons', |
||||
templateUrl: './order-coupons.component.html', |
||||
styleUrls: ['./order-coupons.component.scss'] |
||||
}) |
||||
export class OrderCouponsComponent implements OnInit { |
||||
|
||||
IMAGE_URL = environment.imageUrl; |
||||
searchForm: FormGroup; // 搜索框
|
||||
requestData = []; // 列表数据
|
||||
total: number; // 页码
|
||||
pageNum = 1; // 页码
|
||||
pageSize = 10; // 条码
|
||||
loading = true; |
||||
|
||||
requestDataCode = []; // 列表数据
|
||||
totalCode: number; // 页码
|
||||
pageNumCode = 1; // 页码
|
||||
pageSizeCode = 10; // 条码
|
||||
loadingCode = true; |
||||
isVisible = false; |
||||
id: number; |
||||
constructor( |
||||
private form: FormBuilder, |
||||
private agent: AgentService, |
||||
private iconService: IconService, |
||||
private message: NzMessageService, |
||||
private store: LocalStorageService, // 数据请求
|
||||
) { |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.init(); |
||||
} |
||||
|
||||
public init(): void { |
||||
this.searchForm = this.form.group({ |
||||
status: [null], |
||||
}); |
||||
this.getRequest(true, {}); |
||||
} |
||||
|
||||
// 查询列表
|
||||
public getRequest(reset: boolean = false, whereObject: object) { |
||||
this.loading = false; |
||||
if (reset) { |
||||
this.pageNum = 1; |
||||
} |
||||
whereObject['agentId'] = this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id; |
||||
whereObject['pageNum'] = this.pageNum; |
||||
whereObject['pageSize'] = this.pageSize; |
||||
this.agent.getDiscountAgentList(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.getRequestCode(false , this.searchForm.value); |
||||
this.isVisible = true; |
||||
} |
||||
|
||||
// 查询列表
|
||||
public getRequestCode(reset: boolean = false, whereObject: object) { |
||||
this.loadingCode = true; |
||||
if (reset) { |
||||
this.pageNumCode = 1; |
||||
} |
||||
this.searchForm.value['discountAgentId'] = this.id; |
||||
whereObject['pageNum'] = this.pageNumCode; |
||||
whereObject['pageSize'] = this.pageSizeCode; |
||||
this.agent.getDiscountCodeList(whereObject, data => { |
||||
this.loadingCode = false; |
||||
if (data['return_code'] === '000000') { |
||||
this.requestDataCode = data['return_data'].list; |
||||
this.totalCode = data['return_data'].total; |
||||
} else { |
||||
this.message.error(data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
handleOk(): void { |
||||
this.isVisible = false; |
||||
} |
||||
|
||||
handleCancel(): void { |
||||
this.isVisible = false; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,72 @@ |
||||
<!-- 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="goldType" 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> |
||||
|
||||
<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> |
||||
<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="50px">编号</th> |
||||
<th nzWidth="80px">用户名称</th> |
||||
<th nzWidth="100px">用户电话</th> |
||||
<th nzWidth="100px">金币类型</th> |
||||
<th nzWidth="100px">来源类型</th> |
||||
<th nzWidth="100px">金币数</th> |
||||
<th nzWidth="100px">产生时间</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i+1}}</td> |
||||
<td>{{data['highUser'].name}}</td> |
||||
<td>{{data['highUser'].phone}}</td> |
||||
<td>{{data.goldType === 1 ? '收入' : '支出'}}</td> |
||||
<td>{{data.resType === 1 ? '充值' : '订单'}}</td> |
||||
<td>{{data.gold}}</td> |
||||
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
|
||||
|
||||
|
@ -0,0 +1,4 @@ |
||||
.head_img { |
||||
height: 50px; |
||||
width: 50px; |
||||
} |
@ -0,0 +1,69 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
import {FormBuilder, FormGroup} from '@angular/forms'; |
||||
import {UserService} from '../../../services/user.service'; |
||||
import {IconService} from '../../../services/icon.service'; |
||||
import {NzMessageService} from 'ng-zorro-antd'; |
||||
import {CommonsService} from '../../../services/commons.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-user-gold', |
||||
templateUrl: './user-gold.component.html', |
||||
styleUrls: ['./user-gold.component.scss'] |
||||
}) |
||||
export class UserGoldComponent implements OnInit { |
||||
|
||||
searchForm: FormGroup; // 搜索框
|
||||
requestData = []; // 列表数据
|
||||
total: number; // 页码
|
||||
pageNum = 1; // 页码
|
||||
pageSize = 10; // 条码
|
||||
loading = true; |
||||
|
||||
constructor( |
||||
private form: FormBuilder, |
||||
private user: UserService, |
||||
private iconService: IconService, |
||||
private message: NzMessageService, |
||||
private common: CommonsService |
||||
) { |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.init(); |
||||
} |
||||
|
||||
public init(): void { |
||||
this.searchForm = this.form.group({ |
||||
goldType: [null], |
||||
}); |
||||
this.getRequest(true, this.searchForm.value); |
||||
} |
||||
|
||||
// 查询列表
|
||||
public getRequest(reset: boolean = false, whereObject: object) { |
||||
|
||||
this.loading = false; |
||||
if (reset) { |
||||
this.pageNum = 1; |
||||
} |
||||
whereObject['pageNum'] = this.pageNum; |
||||
whereObject['pageSize'] = this.pageSize; |
||||
this.user.getGoldRecList(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(); |
||||
} |
||||
|
||||
|
||||
|
||||
} |
@ -1,4 +1,4 @@ |
||||
.head_img { |
||||
height: 60px; |
||||
height: 50px; |
||||
width: 60px; |
||||
} |
||||
|
Loading…
Reference in new issue