提交代码

master
袁野 11 months ago
parent d5fad21c6c
commit b250808596
  1. 55
      src/app/admin/agent/agent-list/agent-list.component.html
  2. 67
      src/app/admin/agent/agent-list/agent-list.component.ts
  3. 2
      src/app/admin/coupon/printer-list/printer-list.component.html
  4. 12
      src/app/admin/discount-package/discount-package-edit/discount-package-edit.component.html
  5. 1
      src/app/admin/discount-package/discount-package-edit/discount-package-edit.component.ts
  6. 1
      src/app/admin/order-manage/discount-use-condition-list/discount-use-condition-list.component.ts
  7. 2
      src/app/pipes/api-coupon/sc-printer.pipe.ts
  8. 5
      src/app/pipes/third-product/product-type.pipe.ts
  9. 12
      src/app/services/agent.service.ts
  10. 2
      src/environments/environment.ts

@ -1,7 +1,7 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<nz-spin [nzSpinning]="loadingObject.status" [nzTip]="loadingObject.title">
<!--条件搜索-->
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)">
@ -109,11 +109,14 @@
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li class="li-a" nz-menu-item><a (click)="getDistribution(data.id)">分发卡券</a></li>
<li class="li-a" nz-menu-item><a (click)="getDistributeCoupons(data.id)">分发优惠券包</a></li>
<li class="li-a" nz-menu-item><a (click)="getDistributeCoupons(data.id ,1)">分发优惠券包</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)="getDiscountList(data.id)">优惠券列表</a></li>
<li class="li-a" nz-menu-item><a (click)="getDistributeCouponsList(data.id)">优惠券包分发列表</a></li>
<li class="li-a" nz-menu-item><a (click)="getDistributeCoupons(data.id , 2)">绑定优惠券包</a></li>
<!-- <li class="li-a" nz-menu-item><a (click)="getDiscountPackageList(data.id)">优惠券列表</a></li>-->
<li class="li-a" nz-menu-item><a (click)="getDistributeCouponsList(data.id , 2)">优惠券包绑定列表</a></li>
<li class="li-a" nz-menu-item><a (click)="getDistributeCouponsList(data.id , 1)">优惠券包分发列表</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)='getForbiddenUser(data.id , data.status)'>{{data.status === 1 ? '禁用': '启用'}}</a></li>
@ -124,13 +127,14 @@
</nz-table>
</div>
</nz-spin>
<nz-modal [(nzVisible)]="isVisible" nzTitle="分配优惠券" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()">
<form nz-form [formGroup]="validateForm" class="login-form">
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>优惠券</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择优惠券!">
<nz-select nzShowSearch nzAllowClear formControlName="discountId" nzPlaceHolder="请选择优惠券">
<nz-option *ngFor="let item of discountList" nzLabel="{{item.discountName}}"
<nz-option *ngFor="let item of discountList" nzLabel="{{item.discountName}}-{{item.discountKey}}"
nzValue="{{item.id}}"></nz-option>
</nz-select>
</nz-form-control>
@ -144,6 +148,27 @@
</form>
</nz-modal>
<nz-modal [(nzVisible)]="isVisibleDiscountPackage" nzTitle="绑定优惠券包" (nzOnCancel)="isVisibleDiscountPackage = false" (nzOnOk)="addDisCoupon(2)">
<form nz-form [formGroup]="validateFormDiscountPackage" class="login-form">
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>优惠券包</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择优惠券包!">
<nz-select nzShowSearch nzAllowClear formControlName="discountPackageId" nzPlaceHolder="请选择优惠券包">
<nz-option *ngFor="let item of discountPackageList" nzLabel="【{{item['title']}}】--(有效库存: {{item['surplusStock']}} )"
nzValue="{{item.id}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>数量</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="绑定数量不能小于1!">
<input [type]="'number'" nz-input formControlName="num" nzPlaceHolder="请填写绑定数量" />
</nz-form-control>
</nz-form-item>
</form>
</nz-modal>
<nz-modal [(nzVisible)]="isVisibleDiscount" nzWidth="1000" nzTitle="代理商优惠券列表" (nzOnCancel)="handleCancelDiscount()"
(nzOnOk)="handleCancelDiscount()" [nzFooter]="null">
<nz-table
@ -233,14 +258,14 @@
</nz-spin>
</nz-modal>
<nz-modal [(nzVisible)]="isVisibleDistributeCoupons" nzTitle="分发优惠券" (nzOnCancel)="isVisibleDistributeCoupons=false" [nzOkLoading]="isOkCouponsLoading" (nzOnOk)="addDisCoupon()">
<nz-modal [(nzVisible)]="isVisibleDistributeCoupons" nzTitle="分发优惠券" (nzOnCancel)="isVisibleDistributeCoupons=false" [nzOkLoading]="isOkCouponsLoading" (nzOnOk)="addDisCoupon(1)">
<nz-spin [nzSpinning]="isSpinningDistributeCoupons">
<form nz-form [formGroup]="validateFormDiscountPackage" class="login-form">
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>优惠券包</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择优惠券包!">
<nz-select nzShowSearch nzAllowClear formControlName="discountPackageId" nzPlaceHolder="请选择优惠券包">
<nz-option *ngFor="let item of discountPackageList" nzLabel="【{{item['title']}}】"
<nz-option *ngFor="let item of discountPackageList" nzLabel="【{{item['title']}}】--(有效库存: {{item['surplusStock']}} )"
nzValue="{{item.id}}"></nz-option>
</nz-select>
</nz-form-control>
@ -296,7 +321,7 @@
</nz-table>
</nz-modal>
<nz-modal [(nzVisible)]="isVisibleDistributeCouponsList" nzWidth="1000" nzTitle="优惠券包分发列表" (nzOnCancel)="isVisibleDistributeCouponsList=false" (nzOnOk)="isVisibleDistributeCouponsList=false">
<nz-modal [(nzVisible)]="isVisibleDistributeCouponsList" nzWidth="1000" nzTitle="优惠券包{{type == 1 ? '分发':'分配'}}列表" (nzOnCancel)="isVisibleDistributeCouponsList=false" (nzOnOk)="isVisibleDistributeCouponsList=false">
<nz-table #basicTable1 [nzData]="distributeCouponsList" [nzLoading]="loadingCouponsList" [nzPageSize]="10" [nzScroll]="{ y: '500px' }">
<thead>
@ -319,7 +344,7 @@
<td>{{data.salesCount}}</td>
<td>{{data['createTime'] | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>
<a (click)="getRecordList(data['discountPackageId'])">分发历史</a>
<a (click)="getRecordList(data['discountPackageId'])">{{type == 1 ? '分发':'分配'}}历史</a>
</td>
</tr>
</tbody>
@ -329,16 +354,16 @@
<nz-modal [(nzVisible)]="isVisibleAgentRecordList" nzWidth="900" nzTitle="分发记录列表" (nzOnCancel)="isVisibleAgentRecordList=false" (nzOnOk)="isVisibleAgentRecordList=false">
<nz-modal [(nzVisible)]="isVisibleAgentRecordList" nzWidth="900" nzTitle="{{type == 1 ? '分发':'分配'}}记录列表" (nzOnCancel)="isVisibleAgentRecordList=false" (nzOnOk)="isVisibleAgentRecordList=false">
<nz-table #basicTable2 [nzData]="packageAgentRecordList" [nzPageSize]="10" [nzScroll]="{ y: '500px' }">
<thead>
<tr>
<th>优惠券包名称</th>
<th>代理商名称</th>
<th>分发数量</th>
<th>分发前数量</th>
<th>分发后数量</th>
<th>分发时间</th>
<th>{{type == 1 ? '分发':'分配'}}数量</th>
<th>{{type == 1 ? '分发':'分配'}}前数量</th>
<th>{{type == 1 ? '分发':'分配'}}后数量</th>
<th>{{type == 1 ? '分发':'分配'}}时间</th>
</tr>
</thead>
<tbody>
@ -376,3 +401,7 @@
</tbody>
</nz-table>
</nz-modal>
<nz-modal [(nzVisible)]="isVisiblePercent" nzTitle="生成版本({{this.validateFormDiscountPackage.value['serialNumber']}})正在生成" [nzFooter]="null">
<nz-progress [nzPercent]="percent" ></nz-progress>
</nz-modal>

@ -37,6 +37,7 @@ export class AgentListComponent implements OnInit {
pageSize = 10; // 条码
loading = true;
isVisible = false;
isVisibleDiscountPackage = false;
isVisibleDiscount = false;
isVisibleDistribute = false;
isVisibleDistributeCoupons=false;
@ -62,14 +63,21 @@ export class AgentListComponent implements OnInit {
isOkLoading = false;
isOkCouponsLoading=false;
isVisibleShow = false;
isVisiblePercent = false;
percent = 0;
dataSet;
type: number;
processRateInterval;
loadingObject = {
title: '加载中...',
status: false,
};
constructor(
private form: FormBuilder,
private agent: AgentService,
private audit: AuditService,
private discount: DiscountService,
private coupon: CouponService,
private iconService: IconService,
private message: NzMessageService,
private router: Router,
private clipboardService: ClipboardService,
@ -88,6 +96,7 @@ export class AgentListComponent implements OnInit {
status: [null],
type: [null],
});
this.validateForm = this.form.group({
discountId: [null, [Validators.required]],
stockCount: [null, [Validators.required]],
@ -217,6 +226,7 @@ export class AgentListComponent implements OnInit {
this.getRequestDiscount(true);
}
public getDistributionList(id: number): void {
this.id = id;
this.isVisibleList = true;
@ -359,8 +369,9 @@ export class AgentListComponent implements OnInit {
}
// 获取优惠券包列表
public getDistributeCoupons(id: number): void{
public getDistributeCoupons(id: number , type: number): void{
this.validateFormDiscountPackage.reset();
this.isSpinningDistributeCoupons = true;
this.agentId = id;
const whereObject = {};
@ -375,11 +386,19 @@ export class AgentListComponent implements OnInit {
}
this.isSpinningDistributeCoupons=false;
})
if (type == 1) {
this.isVisibleDistributeCoupons=true;
} else {
this.isVisibleDiscountPackage = true;
}
}
//分发优惠券包 确定
public addDisCoupon(): void{
public addDisCoupon(type: number): void{
for (const i in this.validateFormDiscountPackage.controls) {
this.validateFormDiscountPackage.controls[i].markAsDirty();
this.validateFormDiscountPackage.controls[i].updateValueAndValidity();
@ -390,6 +409,9 @@ export class AgentListComponent implements OnInit {
}
this.isOkCouponsLoading=true;
this.validateFormDiscountPackage.value['agentId'] = this.agentId;
if (type == 1) {
this.agent.distribute(this.validateFormDiscountPackage.value,(data)=>{
this.isOkCouponsLoading=false;
if (data['return_code'] === '000000') {
@ -401,17 +423,36 @@ export class AgentListComponent implements OnInit {
}
})
} else {
this.percent = 0;
this.validateFormDiscountPackage.value['serialNumber'] = new Date().getTime();
this.processRate(this.validateFormDiscountPackage.value['serialNumber']);
this.isVisiblePercent = true;
this.agent.generateDiscountPackageAgentCode(this.validateFormDiscountPackage.value,(data)=>{
this.isOkCouponsLoading=false;
this.loadingObject.status = false;
if (data['return_code'] === '000000') {
this.validateFormDiscountPackage.reset();
this.isVisibleDiscountPackage = false;
} else {
this.message.error(data['return_msg']);
}
})
}
}
// 优惠券包分发列表
public getDistributeCouponsList(id:number):void{
public getDistributeCouponsList(id:number , type: number):void{
this.agentId = id;
this.isVisibleDistributeCouponsList=true;
this.loadingCouponsList=true;
this.distributeCouponsList=[];
this.agent.getDiscountPackageAgentRelList(this.agentId,(data)=>{
this.type = type;
this.agent.getDiscountPackageAgentRelList(this.agentId, type ,(data)=>{
this.loadingCouponsList=false;
if (data['return_code'] === '000000') {
this.distributeCouponsList = data['return_data'];
@ -429,6 +470,7 @@ export class AgentListComponent implements OnInit {
const params={};
params["discountPackageId"]=discountPackageId;
params["agentId"]=this.agentId;
params["type"]= this.type;
this.isVisibleAgentRecordList=true;
this.packageAgentRecordList=[];
@ -484,5 +526,20 @@ export class AgentListComponent implements OnInit {
});
}
// 获取导出百分比
processRate(key: string) {
this.processRateInterval = setInterval(() => this.common.getRedisValueByType(key, data => {
this.percent = data['return_data'];
if (this.percent === 100) {
clearTimeout(this.processRateInterval);
this.message.success('生成成功!');
this.loadingObject.status = false;
this.isVisiblePercent = false;
}
}), 100);
}
}

@ -46,7 +46,7 @@
<tr *ngFor="let data of basicTable.data">
<td>{{ data.request_code }}</td>
<td>{{ data.ticket_name }}</td>
<td>{{ data.face_amount }}</td>
<td>{{ data.face_amount/100 }}</td>
<td>{{ data.goods_type | scPrinter}}</td>
<td>{{ data.effective_days}}</td>
<td>{{ data.total_num}}</td>

@ -16,11 +16,21 @@
</nz-steps>
<form style="margin-top: 30px;" *ngIf="current === 0" nz-form [formGroup]="validateForm">
<div nz-row>
<div nz-col class="gutter-row" [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>优惠券包标题</nz-form-label>
<nz-form-control [nzSpan]="8" nzErrorTip="请输入优惠券包标题">
<input nz-input type="text" formControlName="title" placeholder="请输入优惠券包标题标题" />
<input nz-input type="text" formControlName="title" placeholder="请输入优惠券包标题" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col class="gutter-row" [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>优惠券包标签</nz-form-label>
<nz-form-control [nzSpan]="8" nzErrorTip="请输入优惠券包标签">
<input nz-input type="text" formControlName="showLabel" placeholder="请输入优惠券包标签" />
</nz-form-control>
</nz-form-item>
</div>

@ -87,6 +87,7 @@ export class DiscountPackageEditComponent implements OnInit {
usingAttribution: [null],
salesType: [null, [Validators.required]],
price: [null],
showLabel: [null],
purchaseNum: [null],
});

@ -88,6 +88,7 @@ export class DiscountUseConditionListComponent implements OnInit {
this.agentService.getDiscountAgentList(param, data => {
if (data['return_code'] === '000000') {
this.discountArray = data['return_data'].list;
console.log(this.discountArray);
} else {
this.message.error(data['return_msg']);
}

@ -23,3 +23,5 @@ export class ScPrinterPipe implements PipeTransform {
}
}

@ -10,11 +10,12 @@ export class ProductTypePipe implements PipeTransform {
2: ['肯德基'],
3: ['第三方产品'],
4: ['积分充值'],
5: ['中石化', '消费券', '其他卡券' , '贵州中石化' , '重庆中石油'],
6: [''],
5: ['中石化', '消费券', '其他卡券' , '贵州中石化' , '重庆中石油','停车券','四川中石油','贵州中石油'],
6: ['在线加油'],
7: ['优惠券包'],
8: ['汇联通充值'],
10: ['实物购买'],
16: ['个人油卡充值'],
17: ['团购套餐'],
};

@ -203,6 +203,14 @@ export class AgentService {
}
public generateDiscountPackageAgentCode(params: object, callBack) {
this.http.post(environment.baseUrl + 'discountPackageAgent/generateDiscountPackageAgentCode', params).subscribe(data => {
callBack(data);
});
}
/*
*/
@ -213,8 +221,8 @@ export class AgentService {
}
/* 获取优惠券包代理商关联列表 */
public getDiscountPackageAgentRelList(agentId: number, callBack) {
this.http.get(environment.baseUrl + 'discountPackageAgent/getDiscountPackageAgentRelList?agentId=' + agentId).subscribe(data => {
public getDiscountPackageAgentRelList(agentId: number, type: number , callBack) {
this.http.get(environment.baseUrl + 'discountPackageAgent/getDiscountPackageAgentRelList?agentId=' + agentId + '&type=' + type).subscribe(data => {
callBack(data);
});
}

@ -6,7 +6,7 @@ export const environment = {
production: false,
// baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
// orderUrl: 'http://localhost:9304/order/', // 测试环境服务器地址(请求数据地址)
baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
// orderUrl: 'https://hsg.dctpay.com/order/', // 测试环境服务器地址(请求数据地址)
orderUrl: 'https://hsgcs.dctpay.com/order/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://hsgcs.dctpay.com/filesystem/',

Loading…
Cancel
Save