diff --git a/src/app/admin/agent/agent-list/agent-list.component.html b/src/app/admin/agent/agent-list/agent-list.component.html index 417408a..9175c75 100644 --- a/src/app/admin/agent/agent-list/agent-list.component.html +++ b/src/app/admin/agent/agent-list/agent-list.component.html @@ -127,7 +127,7 @@ 平台类型 - + diff --git a/src/app/admin/agent/agent-list/agent-list.component.ts b/src/app/admin/agent/agent-list/agent-list.component.ts index 1957af1..d1186f0 100644 --- a/src/app/admin/agent/agent-list/agent-list.component.ts +++ b/src/app/admin/agent/agent-list/agent-list.component.ts @@ -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); + } + } + }); + } + } } diff --git a/src/environments/environment.ts b/src/environments/environment.ts index a67d196..842ae3e 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -5,8 +5,11 @@ export const environment = { production: false, // baseUrl: 'https://gratia-pay.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - baseUrl: 'https://gratia-pay.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'https://gratia-pay.dctpay.com/filesystem/', + // baseUrl: 'https://gratia-pay.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) + // imageUrl: 'https://gratia-pay.dctpay.com/filesystem/', + // obsUrl: 'https://gratia-pay-test.obs.cn-southwest-2.myhuaweicloud.com', + baseUrl: 'http://localhost:9602/brest/', // 测试环境服务器地址(请求数据地址) + imageUrl: 'http://localhost:9602/filesystem/', obsUrl: 'https://gratia-pay-test.obs.cn-southwest-2.myhuaweicloud.com', };