提交代码

dev
胡锐 12 months ago
parent 83f987b755
commit 94cee27e1c
  1. 16
      src/app/admin/merchant/merchant-list/merchant-list.component.html
  2. 44
      src/app/admin/merchant/merchant-list/merchant-list.component.ts

@ -118,7 +118,7 @@
<a (click)='jumpMerAccountRecord(data.id)'>余额充值记录</a>
</li>
<li nz-menu-item>
<a (click)='showTripartitePlatformModal(data.id)'>商户平台配置</a>
<a (click)='showTripartitePlatformModal(data.id, 1)'>商户平台配置</a>
</li>
</ul>
</nz-dropdown-menu>
@ -203,10 +203,11 @@
<nz-modal [(nzVisible)]="tripartitePlatformModal" nzTitle="商户配置" (nzOnCancel)="closeTripartitePlatformModal()" nzWidth="500px" [nzFooter]="null">
<form nz-form [formGroup]="tripartitePlatformForm">
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired >第三方平台</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select formControlName="platformType">
<nz-form-label [nzSpan]="6" nzRequired>第三方平台</nz-form-label>
<nz-form-control [nzSpan]="14" >
<nz-select formControlName="platformType" (ngModelChange)="getPlatformDetail(tripartitePlatformForm.controls['merId'].value, $event)">
<nz-option nzValue="1" nzLabel="微信"></nz-option>
<nz-option nzValue="2" nzLabel="惠支付"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
@ -225,6 +226,13 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6">商户KEY</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="请输入第三方平台商户KEY" formControlName="platformMerKey" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired >是否分账</nz-form-label>
<nz-form-control [nzSpan]="14">

@ -73,6 +73,7 @@ export class MerchantListComponent implements OnInit {
platformType: ['1', [Validators.required]],
platformMerName: [null, [Validators.required]],
platformMerNumber: [null, [Validators.required]],
platformMerKey: [null],
profitSharingStatus: ['false', [Validators.required]],
profitSharingRatio: [null],
profitSharingReceiversNumber: [null],
@ -260,21 +261,48 @@ export class MerchantListComponent implements OnInit {
}
showTripartitePlatformModal(merId: number) {
this.tripartitePlatformService.getDetail(merId, 1, data => {
showTripartitePlatformModal(merId: number, platformType: number) {
this.getPlatformDetail(merId, platformType);
this.tripartitePlatformModal = true;
}
getPlatformDetail(merId: number, platformType: number) {
if (merId != null) {
this.tripartitePlatformService.getDetail(merId, platformType, data => {
if (data['return_data'] != null) {
data['return_data']['platformType'] = String(data['return_data']['platformType']);
data['return_data']['profitSharingStatus'] = String(data['return_data']['profitSharingStatus']);
this.tripartitePlatformForm.patchValue(data['return_data']);
const dataObj = data['return_data'];
this.tripartitePlatformForm.controls['merId'].setValue(dataObj['merId']);
this.tripartitePlatformForm.controls['platformMerName'].setValue(dataObj['platformMerName']);
this.tripartitePlatformForm.controls['platformMerNumber'].setValue(dataObj['platformMerNumber']);
this.tripartitePlatformForm.controls['platformMerKey'].setValue(dataObj['platformMerKey']);
this.tripartitePlatformForm.controls['profitSharingStatus'].setValue(String(dataObj['profitSharingStatus']));
this.tripartitePlatformForm.controls['profitSharingRatio'].setValue(dataObj['profitSharingRatio']);
this.tripartitePlatformForm.controls['profitSharingReceiversNumber'].setValue(dataObj['profitSharingReceiversNumber']);
this.tripartitePlatformForm.controls['profitSharingReceiversName'].setValue(dataObj['profitSharingReceiversName']);
} else {
this.tripartitePlatformForm.patchValue( { merId: merId, platformType: '1', profitSharingStatus: 'false' });
this.tripartitePlatformForm.controls['merId'].setValue(merId);
this.tripartitePlatformForm.controls['platformMerName'].setValue(null);
this.tripartitePlatformForm.controls['platformMerNumber'].setValue(null);
this.tripartitePlatformForm.controls['platformMerKey'].setValue(null);
this.tripartitePlatformForm.controls['profitSharingStatus'].setValue('false');
this.tripartitePlatformForm.controls['profitSharingRatio'].setValue(null);
this.tripartitePlatformForm.controls['profitSharingReceiversNumber'].setValue(null);
this.tripartitePlatformForm.controls['profitSharingReceiversName'].setValue(null);
}
});
this.tripartitePlatformModal = true;
}
}
closeTripartitePlatformModal() {
this.tripartitePlatformForm.reset();
this.tripartitePlatformForm.controls['merId'].setValue(null);
this.tripartitePlatformForm.controls['platformMerName'].setValue(null);
this.tripartitePlatformForm.controls['platformMerNumber'].setValue(null);
this.tripartitePlatformForm.controls['platformType'].setValue(String(1));
this.tripartitePlatformForm.controls['platformMerKey'].setValue(null);
this.tripartitePlatformForm.controls['profitSharingStatus'].setValue('false');
this.tripartitePlatformForm.controls['profitSharingRatio'].setValue(null);
this.tripartitePlatformForm.controls['profitSharingReceiversNumber'].setValue(null);
this.tripartitePlatformForm.controls['profitSharingReceiversName'].setValue(null);
this.tripartitePlatformModal = false;
}

Loading…
Cancel
Save