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