pull/1/head
parent
d9302f7a5a
commit
7a679909e6
@ -0,0 +1,115 @@ |
|||||||
|
<!-- start 面包屑 --> |
||||||
|
<app-breadcrumb></app-breadcrumb> |
||||||
|
<!-- end 面包屑 --> |
||||||
|
|
||||||
|
<div class="inner-content"> |
||||||
|
<nz-card nzTitle="销售统计"> |
||||||
|
<div nz-card-grid [ngStyle]="gridStyle">销售总额: ¥{{countData['salesCountPrice']}}</div> |
||||||
|
<div nz-card-grid [ngStyle]="gridStyle">剩余总额: ¥{{countData['surplusCountPrice']}}</div> |
||||||
|
<div nz-card-grid [ngStyle]="gridStyle">今日流水: ¥{{countData['turnoverPrice']}}</div> |
||||||
|
<div nz-card-grid [ngStyle]="gridStyle">库存数量: {{countData['laveStockCount']}}</div> |
||||||
|
<div nz-card-grid [ngStyle]="gridStyle">销售数量: {{countData['soldCount']}}</div> |
||||||
|
<div nz-card-grid [ngStyle]="gridStyle">今日订单: {{countData['orderCount']}}</div> |
||||||
|
</nz-card> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="inner-content"> |
||||||
|
<nz-table #basicTable [nzData]="countData['list']"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th>卡券名称</th> |
||||||
|
<th>卡券金额</th> |
||||||
|
<th>库存数量</th> |
||||||
|
<th>销售数量</th> |
||||||
|
<th>操作</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of basicTable.data"> |
||||||
|
<td>{{data.couponName}}</td> |
||||||
|
<td>¥{{data.salesPrice}}</td> |
||||||
|
<td>{{data.stockCount}}</td> |
||||||
|
<td>{{data.salesCount}}</td> |
||||||
|
<td> |
||||||
|
<a (click)="getDetail(data.couponId)">使用情况</a> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
</div> |
||||||
|
|
||||||
|
<nz-modal [(nzVisible)]="isVisible" nzTitle="使用情况" nzWidth="1000" (nzOnCancel)="handleCancel()" (nzOnOk)="handleCancel()"> |
||||||
|
<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">消费码KEY</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="16"> |
||||||
|
<input nz-input formControlName="salesCode"/> |
||||||
|
</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 formControlName="status"> |
||||||
|
<nz-option nzValue="1" nzLabel="待销售"></nz-option> |
||||||
|
<nz-option nzValue="2" nzLabel="待使用"></nz-option> |
||||||
|
<nz-option nzValue="3" nzLabel="已使用"></nz-option> |
||||||
|
<nz-option nzValue="4" 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> |
||||||
|
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
|
||||||
|
<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="180px">消费码</th> |
||||||
|
<th nzWidth="120px">使用门店</th> |
||||||
|
<th nzWidth="120px">领取时间</th> |
||||||
|
<th nzWidth="120px">消费时间</th> |
||||||
|
<th nzWidth="120px">销售截止时间</th> |
||||||
|
<th nzWidth="120px">使用截止时间</th> |
||||||
|
<th nzWidth="120px">创建时间</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.salesCode}}</td> |
||||||
|
<td>{{data.storeName == null ? '暂无' : data.storeName}}</td> |
||||||
|
<td>{{data.receiveTime == null ? '未领取' : data.receiveTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||||
|
<td>{{data.consumeTime == null ? '未消费' : data.consumeTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||||
|
<td>{{data.salesEndTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||||
|
<td>{{data.useEndTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||||
|
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||||
|
<td nzRight="0px">{{data.status | couponCode}}</td> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
|
||||||
|
</nz-modal> |
@ -0,0 +1,91 @@ |
|||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
import {FormBuilder, FormGroup} from '@angular/forms'; |
||||||
|
import {AgentService} from '../../../services/agent.service'; |
||||||
|
import {IconService} from '../../../services/icon.service'; |
||||||
|
import {NzMessageService} from 'ng-zorro-antd'; |
||||||
|
import {LocalStorageService} from '../../../services/local-storage.service'; |
||||||
|
import {environment} from '../../../../environments/environment'; |
||||||
|
import {CouponService} from '../../../services/coupon.service'; |
||||||
|
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-order-coupon', |
||||||
|
templateUrl: './order-coupon.component.html', |
||||||
|
styleUrls: ['./order-coupon.component.scss'] |
||||||
|
}) |
||||||
|
export class OrderCouponComponent implements OnInit { |
||||||
|
gridStyle = { |
||||||
|
width: '33.3333%', |
||||||
|
textAlign: 'center' |
||||||
|
}; |
||||||
|
searchForm: FormGroup; // 搜索框
|
||||||
|
codeForm: FormGroup; // 搜索框
|
||||||
|
requestData = []; // 列表数据
|
||||||
|
total: number; // 页码
|
||||||
|
pageNum = 1; // 页码
|
||||||
|
pageSize = 10; // 条码
|
||||||
|
loading = true; |
||||||
|
isVisible = false; |
||||||
|
id; |
||||||
|
|
||||||
|
countData = {}; |
||||||
|
constructor( |
||||||
|
private form: FormBuilder, |
||||||
|
private agent: AgentService, |
||||||
|
private iconService: IconService, |
||||||
|
private message: NzMessageService, |
||||||
|
private store: LocalStorageService, // 数据请求
|
||||||
|
private coupon: CouponService |
||||||
|
) { |
||||||
|
} |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
this.agent.getAgentCount(data => { |
||||||
|
this.countData = data['return_data']; |
||||||
|
}); |
||||||
|
this.searchForm = this.form.group({ |
||||||
|
status: [null], |
||||||
|
salesCode: [null], |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
// 查询列表
|
||||||
|
public getRequest(reset: boolean = false, whereObject: object) { |
||||||
|
|
||||||
|
this.loading = false; |
||||||
|
if (reset) { |
||||||
|
this.pageNum = 1; |
||||||
|
} |
||||||
|
whereObject['couponId'] = this.id; |
||||||
|
whereObject['agentId'] = this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id; |
||||||
|
whereObject['pageNum'] = this.pageNum; |
||||||
|
whereObject['pageSize'] = this.pageSize; |
||||||
|
this.coupon.getCouponCodeList(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 getDetail(id): void { |
||||||
|
this.id = id; |
||||||
|
this.getRequest(false , this.searchForm.value); |
||||||
|
this.isVisible = true; |
||||||
|
} |
||||||
|
|
||||||
|
handleCancel(): void { |
||||||
|
this.isVisible = false; |
||||||
|
} |
||||||
|
|
||||||
|
// 重置
|
||||||
|
public resetForm(): void { |
||||||
|
this.searchForm.reset(); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue