|
|
|
@ -28,6 +28,7 @@ export class AgentListComponent implements OnInit { |
|
|
|
|
tradeTakeConfigMadel = false; |
|
|
|
|
platformTypeArray = []; |
|
|
|
|
|
|
|
|
|
agentId: number; |
|
|
|
|
constructor(private modal: NzModalService, |
|
|
|
|
private message: NzMessageService, |
|
|
|
|
private agentService: AgentService, |
|
|
|
@ -48,7 +49,7 @@ export class AgentListComponent implements OnInit { |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.tradeTakeConfigForm = this.form.group({ |
|
|
|
|
platformType: ['4', [Validators.required]], |
|
|
|
|
platformType: ['1', [Validators.required]], |
|
|
|
|
receiverName: [null, [Validators.required]], |
|
|
|
|
receiverAccount: [null, [Validators.required]], |
|
|
|
|
receiverRatio: [100, [Validators.required]], |
|
|
|
@ -57,6 +58,7 @@ export class AgentListComponent implements OnInit { |
|
|
|
|
subReceiverAccount: [null, [Validators.required]], |
|
|
|
|
subReceiverRatio: [{ value: 0, disabled: true }, [Validators.required]], |
|
|
|
|
subReceiverObjectId: [null, [Validators.required]], |
|
|
|
|
agentId: [null], |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.searchForm = this.form.group({ |
|
|
|
@ -182,6 +184,7 @@ export class AgentListComponent implements OnInit { |
|
|
|
|
* 展示交易分账配置 |
|
|
|
|
*/ |
|
|
|
|
showTradeTakeConfigMadel(agentId: number) { |
|
|
|
|
this.agentId = agentId; |
|
|
|
|
this.tradeTakeConfigService.getAgentTradeTakeConfig(this.tradeTakeConfigForm.controls['platformType'].value, agentId, data => { |
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
if (data['return_data'] != null) { |
|
|
|
@ -252,4 +255,21 @@ export class AgentListComponent implements OnInit { |
|
|
|
|
this.tradeTakeConfigForm.controls['subReceiverRatio'].setValue(100 - ratio); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
platformTypeChange(number) { |
|
|
|
|
if (number != null) { |
|
|
|
|
this.tradeTakeConfigService.getAgentTradeTakeConfig(number, this.agentId, data => { |
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
if (data['return_data'] != null) { |
|
|
|
|
data['return_data']['platformType'] = String(data['return_data']['platformType']); |
|
|
|
|
data['return_data']['receiverRatio'] = data['return_data']['receiverRatio'] * 100; |
|
|
|
|
data['return_data']['subReceiverRatio'] = data['return_data']['subReceiverRatio'] * 100; |
|
|
|
|
this.tradeTakeConfigForm.patchValue(data['return_data']); |
|
|
|
|
} else { |
|
|
|
|
this.tradeTakeConfigForm.controls['subReceiverObjectId'].setValue(this.agentId); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|