|
|
|
@ -31,6 +31,7 @@ export class AgentListComponent implements OnInit { |
|
|
|
|
isVisible = false; |
|
|
|
|
isVisibleDiscount = false; |
|
|
|
|
isVisibleDistribute = false; |
|
|
|
|
isVisibleList = false; |
|
|
|
|
id: number; |
|
|
|
|
isSpinning = false; |
|
|
|
|
isSpinningDistribute = false; |
|
|
|
@ -40,7 +41,11 @@ export class AgentListComponent implements OnInit { |
|
|
|
|
pageSizeDiscount = 10; // 条码
|
|
|
|
|
loadingDiscount = true; |
|
|
|
|
agentId: number; |
|
|
|
|
|
|
|
|
|
requestDataList = []; // 列表数据
|
|
|
|
|
totalList: number; // 页码
|
|
|
|
|
pageNumList = 1; // 页码
|
|
|
|
|
pageSizeList = 10; // 条码
|
|
|
|
|
loadingList = true; |
|
|
|
|
constructor( |
|
|
|
|
private form: FormBuilder, |
|
|
|
|
private agent: AgentService, |
|
|
|
@ -177,6 +182,16 @@ export class AgentListComponent implements OnInit { |
|
|
|
|
this.getRequestDiscount(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public getDistributionList(id: number): void { |
|
|
|
|
this.id = id; |
|
|
|
|
this.isVisibleList = true; |
|
|
|
|
this.getRequestList(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
handleCancelList() { |
|
|
|
|
this.isVisibleList = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
handleCancelDiscount() { |
|
|
|
|
this.isVisibleDiscount = false; |
|
|
|
|
} |
|
|
|
@ -186,7 +201,7 @@ export class AgentListComponent implements OnInit { |
|
|
|
|
// 查询列表
|
|
|
|
|
public getRequestDiscount(reset: boolean = false) { |
|
|
|
|
const whereObject = {}; |
|
|
|
|
this.loadingDiscount = false; |
|
|
|
|
this.loadingDiscount = true; |
|
|
|
|
if (reset) { |
|
|
|
|
this.pageNumDiscount = 1; |
|
|
|
|
} |
|
|
|
@ -194,6 +209,7 @@ export class AgentListComponent implements OnInit { |
|
|
|
|
whereObject['pageSize'] = this.pageSizeDiscount; |
|
|
|
|
whereObject['agentId'] = this.id; |
|
|
|
|
this.agent.getDiscountAgentList(whereObject, data => { |
|
|
|
|
this.loadingDiscount = false; |
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
this.requestDataDiscount = data['return_data'].list; |
|
|
|
|
this.totalDiscount = data['return_data'].total; |
|
|
|
@ -221,6 +237,27 @@ export class AgentListComponent implements OnInit { |
|
|
|
|
this.isVisibleDistribute = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 查询f分发列表
|
|
|
|
|
public getRequestList(reset: boolean = false) { |
|
|
|
|
const whereObject = {}; |
|
|
|
|
this.loadingList = true; |
|
|
|
|
if (reset) { |
|
|
|
|
this.pageNumList = 1; |
|
|
|
|
} |
|
|
|
|
whereObject['pageNum'] = this.pageNumList; |
|
|
|
|
whereObject['pageSize'] = this.pageSizeList; |
|
|
|
|
whereObject['agentId'] = this.id; |
|
|
|
|
this.agent.getCouponByAgent(whereObject, data => { |
|
|
|
|
this.loadingList = false; |
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
this.requestDataList = data['return_data'].list; |
|
|
|
|
this.totalList = data['return_data'].total; |
|
|
|
|
} else { |
|
|
|
|
this.message.error(data['return_msg']); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 提交分发
|
|
|
|
|
public handleOkDistribute(): void { |
|
|
|
|
// tslint:disable-next-line:forin
|
|
|
|
@ -235,6 +272,7 @@ export class AgentListComponent implements OnInit { |
|
|
|
|
this.validateFormDistribute.value['agentId'] = this.agentId; |
|
|
|
|
this.agent.assignCouponAgent(this.validateFormDistribute.value , data => { |
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
this.validateFormDistribute.reset(); |
|
|
|
|
this.message.success('分发成功'); |
|
|
|
|
this.isVisibleDistribute = false; |
|
|
|
|
} else { |
|
|
|
|