2.0-dev
胡锐 2 years ago
parent 27d878f5dc
commit 26830a5099
  1. 18
      src/app/admin/agent/agent-list/agent-list.component.html
  2. 1
      src/app/admin/agent/agent-list/agent-list.component.ts
  3. 61
      src/app/admin/order-manage/discount-use-condition-list/discount-use-condition-list.component.html
  4. 39
      src/app/admin/order-manage/discount-use-condition-list/discount-use-condition-list.component.ts
  5. 12
      src/app/services/discount.service.ts

@ -112,6 +112,7 @@
<li class="li-a" nz-menu-item><a (click)="generateAgentQrCode(data.id)">生成二维码</a></li> <li class="li-a" nz-menu-item><a (click)="generateAgentQrCode(data.id)">生成二维码</a></li>
<li class="li-a" nz-menu-item><a (click)="getDiscount(data.id)">绑定优惠券</a></li> <li class="li-a" nz-menu-item><a (click)="getDiscount(data.id)">绑定优惠券</a></li>
<li class="li-a" nz-menu-item><a (click)="getDiscountList(data.id)">优惠券列表</a></li> <li class="li-a" nz-menu-item><a (click)="getDiscountList(data.id)">优惠券列表</a></li>
<li class="li-a" nz-menu-item><a [routerLink]="['/admin/order-manage/discount-use-condition-list']" [queryParams]="{agentId: data.id}">优惠券使用</a></li>
<li class="li-a" nz-menu-item><a (click)="getDistributionList(data.id)">分发列表</a></li> <li class="li-a" nz-menu-item><a (click)="getDistributionList(data.id)">分发列表</a></li>
<li class="li-a" nz-menu-item><a (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 1 ? '禁用': '启用'}}</a></li> <li class="li-a" nz-menu-item><a (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 1 ? '禁用': '启用'}}</a></li>
</ul> </ul>
@ -160,12 +161,11 @@
<tr> <tr>
<th nzWidth="80px">优惠券KEY</th> <th nzWidth="80px">优惠券KEY</th>
<th nzWidth="80px">优惠券名称</th> <th nzWidth="80px">优惠券名称</th>
<th nzWidth="80px">优惠券类型</th> <th nzWidth="60px">优惠券类型</th>
<th nzWidth="70px">优惠内容</th> <th nzWidth="50px">优惠金额</th>
<th nzWidth="70px">有效天数</th> <th nzWidth="80px">截止日期</th>
<th nzWidth="100px">截止日期</th> <th nzWidth="50px">库存数量</th>
<th nzWidth="100px">库存数量</th> <th nzWidth="50px">操作</th>
<th nzWidth="100px">操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -175,16 +175,15 @@
<td>{{data['highDiscount'].discountType | discountType}}</td> <td>{{data['highDiscount'].discountType | discountType}}</td>
<td> <td>
<span *ngIf="data['highDiscount'].discountType === 1"> <span *ngIf="data['highDiscount'].discountType === 1">
满{{data['highDiscount'].discountCondition}}抵扣{{data['highDiscount'].discountPrice}} 满{{data['highDiscount'].discountCondition}}{{data['highDiscount'].discountPrice}}
</span> </span>
<span *ngIf="data['highDiscount'].discountType === 2"> <span *ngIf="data['highDiscount'].discountType === 2">
抵扣{{data['highDiscount'].discountPrice}} {{data['highDiscount'].discountPrice}}
</span> </span>
<span *ngIf="data['highDiscount'].discountType === 3"> <span *ngIf="data['highDiscount'].discountType === 3">
{{data['highDiscount'].discountPrice}}折 {{data['highDiscount'].discountPrice}}折
</span> </span>
</td> </td>
<td>{{data['highDiscount'].effectiveDay}}</td>
<td>{{data['highDiscount'].salesEndTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data['highDiscount'].salesEndTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.stockCount}}</td> <td>{{data.stockCount}}</td>
<td> <td>
@ -232,7 +231,6 @@
</nz-spin> </nz-spin>
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="isVisibleList" nzWidth="1000" nzTitle="分发卡券列表" (nzOnCancel)="handleCancelList()" (nzOnOk)="handleCancelList()"> <nz-modal [(nzVisible)]="isVisibleList" nzWidth="1000" nzTitle="分发卡券列表" (nzOnCancel)="handleCancelList()" (nzOnOk)="handleCancelList()">
<nz-table <nz-table
class="table" class="table"

@ -381,5 +381,6 @@ export class AgentListComponent implements OnInit {
} }
}); });
} }
} }

@ -2,8 +2,8 @@
<app-breadcrumb></app-breadcrumb> <app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 --> <!-- end 面包屑 -->
<!--条件搜索--> <!--条件搜索-->
<nz-spin [nzSpinning]="loadingObject.status" [nzTip]="loadingObject.title">
<div class="inner-content"> <div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)"> <form nz-form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)">
<div nz-row> <div nz-row>
<div nz-col nzSpan="8"> <div nz-col nzSpan="8">
@ -21,20 +21,20 @@
<nz-form-label [nzSpan]="8">状态</nz-form-label> <nz-form-label [nzSpan]="8">状态</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
<nz-select nzAllowClear formControlName="status"> <nz-select nzAllowClear formControlName="status">
<nz-option nzLabel="待领取" nzValue="1"></nz-option> <nz-option nzLabel="待领取" nzValue="待领取"></nz-option>
<nz-option nzLabel="待使用" nzValue="2"></nz-option> <nz-option nzLabel="待使用" nzValue="待使用"></nz-option>
<nz-option nzLabel="已使用" nzValue="3"></nz-option> <nz-option nzLabel="已使用" nzValue="已使用"></nz-option>
<nz-option nzLabel="已过期" nzValue="4"></nz-option> <nz-option nzLabel="已过期" nzValue="已过期"></nz-option>
<nz-option nzLabel="已分配" nzValue="5"></nz-option> <nz-option nzLabel="已分配" nzValue="已分配"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col nzSpan="8"> <div nz-col nzSpan="8">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="8">使用门店</nz-form-label> <nz-form-label [nzSpan]="8">客户电话</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
<input nz-input formControlName="storeName" /> <input nz-input formControlName="userPhone" />
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
@ -65,7 +65,7 @@
<div nz-col nzSpan="8"> <div nz-col nzSpan="8">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="8">编码范围</nz-form-label> <nz-form-label [nzSpan]="8">优惠券编码</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
<nz-space> <nz-space>
<nz-space-item> <nz-space-item>
@ -87,13 +87,13 @@
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<div class="inner-content"> <div class="inner-content">
<span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span> <span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>
<div class="operating-button"> <div class="operating-button">
<!-- <button nz-button nzType="primary" class="right-btn"><i nz-icon nzType="plus" nzTheme="outline"></i></button>--> <button nz-button nzType="primary" class="right-btn" (click)="exportDiscountUseCondition()"><i nz-icon nzType="plus" nzTheme="outline"></i>导出数据</button>
</div> </div>
<!--数组表格 --> <!--数组表格 -->
@ -107,31 +107,42 @@
[nzScroll]="{ x: '1150px'}"> [nzScroll]="{ x: '1150px'}">
<thead> <thead>
<tr> <tr>
<th nzWidth="100px">优惠券编码</th> <th nzWidth="120px">优惠券编码</th>
<th nzWidth="200px">优惠券名称</th> <th nzWidth="200px">优惠券名称</th>
<th nzWidth="120px">优惠券状态</th> <th nzWidth="120px">优惠券类型</th>
<th nzWidth="120px">优惠券金额</th>
<th nzWidth="120px">优惠券</th>
<th nzWidth="160px">客户电话</th>
<th nzWidth="160px">领取时间</th> <th nzWidth="160px">领取时间</th>
<th nzWidth="120px">领取人</th> <th nzWidth="160px">过期时间</th>
<th nzWidth="120px">领取手机号</th>
<th nzWidth="160px">使用时间</th> <th nzWidth="160px">使用时间</th>
<th nzWidth="160px">使用门店</th> <th nzWidth="200px">交易订单号</th>
<th nzWidth="100px">交易金额</th>
<th nzWidth="100px">交易优惠</th>
<th nzWidth="100px">交易实付</th>
<!--<th nzWidth="10 0px" nzRight="0px">操作</th>--> <!--<th nzWidth="10 0px" nzRight="0px">操作</th>-->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let data of basicTable.data;let i = index"> <tr *ngFor="let data of basicTable.data;let i = index">
<td>{{data.id}}</td> <td>{{data.discountAgentCodeId}}</td>
<td>{{data.discountName}}</td> <td>{{data.discountName}}</td>
<td>{{data.status | discountCodeStatus}}</td> <td>{{data.discountType}}</td>
<td>{{data.receiveTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> <td>{{data.discountPrice}}</td>
<td>{{data.userName}}</td> <td>{{data.discountUseStatus}}</td>
<td>{{data.userPhone}}</td> <td>{{data.userPhone}}</td>
<td>{{data.useTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> <td>{{data.receiveTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.storeName}}</td> <td>{{data.useEndTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.useTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.orderNo}}</td>
<td>{{data.orderTotalPrice}}</td>
<td>{{data.orderDiscountPrice}}</td>
<td>{{data.orderPayPrice}}</td>
<!--<td nzRight="0px" class="table-td-operation"> <!--<td nzRight="0px" class="table-td-operation">
<a [routerLink]="['/admin/testManager/details']" [queryParams]="{examId: data.id}">详情</a> <a [routerLink]="['/admin/testManager/details']" [queryParams]="{examId: data.id}">详情</a>
</td>--> </td>-->
</tr> </tr>
</tbody> </tbody>
</nz-table> </nz-table>
</div> </div>
</nz-spin>

@ -10,6 +10,7 @@ import {NzMessageService} from 'ng-zorro-antd';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {NzModalService} from "ng-zorro-antd"; import {NzModalService} from "ng-zorro-antd";
import {AgentService} from "../../../services/agent.service"; import {AgentService} from "../../../services/agent.service";
import {ActivatedRoute} from '@angular/router';
@Component({ @Component({
selector: 'app-discount-use-condition-list', selector: 'app-discount-use-condition-list',
@ -18,32 +19,45 @@ import {AgentService} from "../../../services/agent.service";
}) })
export class DiscountUseConditionListComponent implements OnInit { export class DiscountUseConditionListComponent implements OnInit {
FILE_URL = environment.imageUrl;
dataObject: any = {}; dataObject: any = {};
tableLoading = true; tableLoading = true;
searchForm: FormGroup; searchForm: FormGroup;
pageNum: number; pageNum: number;
whereObject: any = {}; whereObject: any = {};
discountArray = []; discountArray = [];
loadingObject = {
title: "加载中...",
status: false,
};
agentId = this.store.get(ADMIN_INFO_OBJECT)['highAgent']!=null?this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id: null;
constructor(private modal: NzModalService, constructor(private modal: NzModalService,
private message: NzMessageService, private message: NzMessageService,
private agentService: AgentService, private agentService: AgentService,
private discountService: DiscountService, private discountService: DiscountService,
private store: LocalStorageService, private store: LocalStorageService,
private activatedRoute: ActivatedRoute,
private form: FormBuilder) { } private form: FormBuilder) { }
ngOnInit(): void { ngOnInit(): void {
this.searchForm = this.form.group({ this.searchForm = this.form.group({
agentId: [null],
discountId: [null], discountId: [null],
status: [null], status: [null],
storeName: [null], userPhone: [null],
receiveTime: [[]], receiveTime: [[]],
useTime: [[]], useTime: [[]],
idS: [null], idS: [null],
idE: [null], idE: [null],
}); });
this.activatedRoute.queryParams.subscribe(queryParams => {
if (queryParams.agentId != null) {
this.agentId = queryParams.agentId;
}
});
this.requestAgentDiscount(); this.requestAgentDiscount();
this.requestData(1); this.requestData(1);
} }
@ -53,6 +67,7 @@ export class DiscountUseConditionListComponent implements OnInit {
*/ */
requestData(pageNum) { requestData(pageNum) {
this.tableLoading = true; this.tableLoading = true;
this.whereObject['agentId'] = this.agentId;
this.whereObject['pageNum'] = pageNum; this.whereObject['pageNum'] = pageNum;
this.whereObject['pageSize'] = 10; this.whereObject['pageSize'] = 10;
this.discountService.getDiscountUseConditionList(this.whereObject, data => { this.discountService.getDiscountUseConditionList(this.whereObject, data => {
@ -66,7 +81,7 @@ export class DiscountUseConditionListComponent implements OnInit {
*/ */
requestAgentDiscount() { requestAgentDiscount() {
const param = { const param = {
agentId: this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id, agentId: this.agentId,
pageNum: 1, pageNum: 1,
pageSize: 9999, pageSize: 9999,
}; };
@ -110,4 +125,20 @@ export class DiscountUseConditionListComponent implements OnInit {
this.searchForm.reset(); this.searchForm.reset();
} }
/**
* 使
*/
exportDiscountUseCondition() {
this.loadingObject.status = true;
this.loadingObject.title = '导出中...';
this.discountService.exportDiscountUseCondition(this.whereObject, data => {
if (data['return_code'] === '000000') {
window.location.href = this.FILE_URL + data['return_data'];
} else {
this.message.error(data['return_msg']);
}
this.loadingObject.status = false;
});
}
} }

@ -117,6 +117,18 @@ export class DiscountService {
}); });
} }
/**
* 使
*
* @param id id
* @param callBack
*/
public exportDiscountUseCondition(param: object, callBack) {
this.http.get(environment.baseUrl + 'discountAgentRel/exportDiscountUseCondition?' + this.common.getWhereCondition(param)).subscribe(data => {
callBack(data);
});
}
/** /**
* *
* *

Loading…
Cancel
Save