This commit is contained in:
Park Byung Eun 2022-08-23 07:22:59 +00:00
parent b7ae4f425a
commit f888299684
3 changed files with 19 additions and 7 deletions

View File

@ -29,6 +29,14 @@
<button mat-flat-button class="bet-mat-small-8" [color]="'primary'">
카지노머니확인
</button>
<button
mat-flat-button
class="bet-mat-small-8"
[color]="'primary'"
(click)="__onClickRegist($event)"
>
본사등록
</button>
</div>
</div>
<hr style="margin: 7px 0px" />

View File

@ -130,7 +130,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
case '/member/partner/all':
this.title = '전체목록';
this.btnTitle = '대본등록';
this.memberClassId = 'ae9b874e-5d0e-4c4d-8432-f45f02691ceb';
this.memberClassId = '4b014ef5-3bab-4413-aaf9-b0040a70ec77';
break;
case '/member/partner/main-office':
this.title = '본사목록';
@ -304,7 +304,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
return item.id || index;
}
__onClickRegist(event: MouseEvent, partner: MemberModel): void {
__onClickRegist(event: MouseEvent, partner?: MemberModel): void {
const dialogRef = this._matDialog.open(RegistComposeComponent, {
data: {
title: this.btnTitle,

View File

@ -23,7 +23,7 @@ import { BankService } from 'app/modules/polyglot/bank/services/bank.service';
export interface RegistComposeData {
title: string;
parent: MemberModel;
parent?: MemberModel;
classId: string;
}
export interface RegistComposeResult {
@ -72,7 +72,7 @@ export class RegistComposeComponent implements OnInit {
ngOnInit(): void {
// Create the form
this.composeForm = this._formBuilder.group({
partnerId: [{ value: this.data.parent.getUsername(), disabled: true }],
partnerId: [{ value: this.data.parent?.getUsername(), disabled: true }],
siteId: ['', [Validators.required]],
username: ['', [Validators.required]],
password: ['beteran', [Validators.required]],
@ -159,6 +159,9 @@ export class RegistComposeComponent implements OnInit {
const member = new CreateMemberRequest();
const site = new Site();
const parentUsername = !!this.data.parent?.getUsername()
? this.data.parent?.getUsername()
: '';
site.setId(siteId);
member.setSiteId(siteId);
@ -166,7 +169,7 @@ export class RegistComposeComponent implements OnInit {
member.setPassword(password);
member.setMemberClassId(this.data.classId);
member.setMemberLevelId('c56231ac-2120-4a81-a30a-5d41fafb6c57');
member.setReferrerMemberUsername(this.data.parent.getUsername());
member.setReferrerMemberUsername(parentUsername);
member.setNickname(nickname);
member.setMobilePhoneNumber(mobilePhoneNumber);
member.setBankAccount(bank_account);
@ -177,11 +180,12 @@ export class RegistComposeComponent implements OnInit {
console.log(res.getMember());
this.showAlert = true;
})
.then(() => setTimeout(() => this.close(), 5000))
.catch((e) => {
this.showAlert = true;
this.alert = { type: 'error', message: '등록에 실패하였습니다.' };
})
.finally(() => setTimeout(() => this.close(), 5000));
this.isSendDisable = false;
});
}
close(): void {