|
|
@ -6,7 +6,8 @@ import {CommonsService} from '../../../services/commons.service'; |
|
|
|
import {MerchantService} from '../../../services/merchant.service'; |
|
|
|
import {MerchantService} from '../../../services/merchant.service'; |
|
|
|
import {Router} from '@angular/router'; |
|
|
|
import {Router} from '@angular/router'; |
|
|
|
import {environment} from '../../../../environments/environment'; |
|
|
|
import {environment} from '../../../../environments/environment'; |
|
|
|
import {MerAmountService} from "../../../services/mer-amount.service"; |
|
|
|
import {MerAmountService} from '../../../services/mer-amount.service'; |
|
|
|
|
|
|
|
import {MerchantTripartitePlatformService} from '../../../services/merchant-tripartite-platform.service'; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-merchant-list', |
|
|
|
selector: 'app-merchant-list', |
|
|
@ -25,12 +26,16 @@ export class MerchantListComponent implements OnInit { |
|
|
|
rechargeModal = false; |
|
|
|
rechargeModal = false; |
|
|
|
rechargeForm: FormGroup; // 充值模态框
|
|
|
|
rechargeForm: FormGroup; // 充值模态框
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tripartitePlatformModal = false; |
|
|
|
|
|
|
|
tripartitePlatformForm: FormGroup; // 充值模态框
|
|
|
|
|
|
|
|
|
|
|
|
constructor( |
|
|
|
constructor( |
|
|
|
private form: FormBuilder, |
|
|
|
private form: FormBuilder, |
|
|
|
private merchant: MerchantService, |
|
|
|
private merchant: MerchantService, |
|
|
|
private iconService: IconService, |
|
|
|
private iconService: IconService, |
|
|
|
private message: NzMessageService, |
|
|
|
private message: NzMessageService, |
|
|
|
private merAmountService: MerAmountService, |
|
|
|
private merAmountService: MerAmountService, |
|
|
|
|
|
|
|
private tripartitePlatformService: MerchantTripartitePlatformService, |
|
|
|
private router: Router, |
|
|
|
private router: Router, |
|
|
|
private common: CommonsService, |
|
|
|
private common: CommonsService, |
|
|
|
private modal: NzModalService, |
|
|
|
private modal: NzModalService, |
|
|
@ -53,6 +58,15 @@ export class MerchantListComponent implements OnInit { |
|
|
|
merId: [null], |
|
|
|
merId: [null], |
|
|
|
amount: [null, [Validators.required]], |
|
|
|
amount: [null, [Validators.required]], |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.tripartitePlatformForm = this.form.group({ |
|
|
|
|
|
|
|
merId: [null], |
|
|
|
|
|
|
|
platformType: ['1', [Validators.required]], |
|
|
|
|
|
|
|
platformMerName: [null, [Validators.required]], |
|
|
|
|
|
|
|
platformMerNumber: [null, [Validators.required]], |
|
|
|
|
|
|
|
profitSharingStatus: ['false', [Validators.required]], |
|
|
|
|
|
|
|
profitSharingRatio: [null], |
|
|
|
|
|
|
|
}); |
|
|
|
this.getRequest(true, this.searchForm.value); |
|
|
|
this.getRequest(true, this.searchForm.value); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -145,7 +159,7 @@ export class MerchantListComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showRechargeModal(merId: number) { |
|
|
|
showRechargeModal(merId: number) { |
|
|
|
this.rechargeForm.patchValue({ merId: merId}); |
|
|
|
this.rechargeForm.patchValue({ merId}); |
|
|
|
this.rechargeModal = true; |
|
|
|
this.rechargeModal = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -182,5 +196,52 @@ export class MerchantListComponent implements OnInit { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showTripartitePlatformModal(merId: number) { |
|
|
|
|
|
|
|
this.tripartitePlatformService.getDetail(merId, 1, 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']); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.tripartitePlatformForm.patchValue( { merId: merId, platformType: '1', profitSharingStatus: 'false' }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.tripartitePlatformModal = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
closeTripartitePlatformModal() { |
|
|
|
|
|
|
|
this.tripartitePlatformForm.reset(); |
|
|
|
|
|
|
|
this.tripartitePlatformModal = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
submitTripartitePlatform() { |
|
|
|
|
|
|
|
for (const i in this.tripartitePlatformForm.controls) { |
|
|
|
|
|
|
|
this.tripartitePlatformForm.controls[i].markAsDirty(); |
|
|
|
|
|
|
|
this.tripartitePlatformForm.controls[i].updateValueAndValidity(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (this.tripartitePlatformForm.status == null || this.tripartitePlatformForm.status !== 'VALID') { |
|
|
|
|
|
|
|
this.modal.warning({ |
|
|
|
|
|
|
|
nzTitle: '提示', |
|
|
|
|
|
|
|
nzContent: '请填写所有必填项', |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.tripartitePlatformService.editTripartitePlatform(this.tripartitePlatformForm.value, data => { |
|
|
|
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
|
|
|
this.modal.success({ |
|
|
|
|
|
|
|
nzTitle: '提示', |
|
|
|
|
|
|
|
nzContent: '保存成功', |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.closeTripartitePlatformModal(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.modal.error({ |
|
|
|
|
|
|
|
nzTitle: '提示', |
|
|
|
|
|
|
|
nzContent: data['return_msg'], |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|