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

View File

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

View File

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