diff --git a/src/app/modules/admin/member/partner/components/list.component.html b/src/app/modules/admin/member/partner/components/list.component.html index 1f6f706..25b87b8 100644 --- a/src/app/modules/admin/member/partner/components/list.component.html +++ b/src/app/modules/admin/member/partner/components/list.component.html @@ -10,7 +10,7 @@ -
전체목록
+
{{ title }}
@@ -191,7 +191,7 @@ [color]="'primary'" (click)="__onClickRegist($event, partner)" > - 대본등록 + {{ btnTitle }}
diff --git a/src/app/modules/admin/member/partner/components/list.component.ts b/src/app/modules/admin/member/partner/components/list.component.ts index 9c5fefd..3e5d5d4 100644 --- a/src/app/modules/admin/member/partner/components/list.component.ts +++ b/src/app/modules/admin/member/partner/components/list.component.ts @@ -100,9 +100,13 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { searchInputControl = new FormControl(); selectedPartner?: Partner; pagination?: PartnerPagination; - sites!: Site[]; + __members: MemberModel[] = []; + title: string = ''; + btnTitle: string = ''; + memberClassId = ''; + private _unsubscribeAll: Subject = new Subject(); /** @@ -115,10 +119,46 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { private _activatedRoute: ActivatedRoute, private _partnerService: PartnerService, private __memberService: MemberService, - private _siteService: SiteService, + private router: Router, private _matDialog: MatDialog - ) {} + ) { + switch (this.router.url) { + case '/member/partner/all': + this.title = '전체목록'; + this.btnTitle = '대본등록'; + this.memberClassId = 'ae9b874e-5d0e-4c4d-8432-f45f02691ceb'; + break; + case '/member/partner/main-office': + this.title = '본사목록'; + this.btnTitle = '대본등록'; + this.memberClassId = 'ae9b874e-5d0e-4c4d-8432-f45f02691ceb'; + break; + case '/member/partner/branch': + this.title = '대본목록'; + this.btnTitle = '부본등록'; + this.memberClassId = 'f25a17e9-5c5f-4e9c-bf80-92a9cedf829c'; + break; + case '/member/partner/division': + this.title = '부본목록'; + this.btnTitle = '총판등록'; + this.memberClassId = 'cac7b897-2549-4f04-8415-8868f1dcb1da'; + break; + case '/member/partner/office': + this.title = '총판목록'; + this.btnTitle = '매장등록'; + this.memberClassId = 'e11cac11-3825-4f4e-9cd5-39367f23f973'; + break; + case '/member/partner/store': + this.title = '매장목록'; + this.btnTitle = '회원등록'; + this.memberClassId = '4598f07a-86d1-42a4-b038-25706683a7cd'; + break; + default: + console.log(this.router.url); + break; + } + } // ----------------------------------------------------------------------------------------------------- // @ Lifecycle hooks @@ -139,12 +179,6 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { this._changeDetectorRef.markForCheck(); }); - this._siteService - .listSites() - .then((result) => { - this.sites = result.getSitesList(); - }) - .catch((reson) => console.log(reson)); // Get the products this._activatedRoute.data.subscribe((data) => { @@ -252,7 +286,11 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { __onClickRegist(event: MouseEvent, partner: MemberModel): void { const dialogRef = this._matDialog.open(RegistComposeComponent, { - data: { title: '대본 등록', parent: partner, sites: this.sites }, + data: { + title: this.btnTitle, + parent: partner, + classId: this.memberClassId, + }, }); dialogRef diff --git a/src/app/modules/admin/member/partner/compose/regist-compose.component.html b/src/app/modules/admin/member/partner/compose/regist-compose.component.html index 12b7408..bd37d22 100644 --- a/src/app/modules/admin/member/partner/compose/regist-compose.component.html +++ b/src/app/modules/admin/member/partner/compose/regist-compose.component.html @@ -48,7 +48,7 @@ 사이트명 - + {{ site.getUrl() }} @@ -140,10 +140,10 @@ 은행명 - + {{ bank.getName() }} - 국민은행 + 은행명은 필수 입력입니다. diff --git a/src/app/modules/admin/member/partner/compose/regist-compose.component.ts b/src/app/modules/admin/member/partner/compose/regist-compose.component.ts index 2c9b083..dbfef41 100644 --- a/src/app/modules/admin/member/partner/compose/regist-compose.component.ts +++ b/src/app/modules/admin/member/partner/compose/regist-compose.component.ts @@ -19,12 +19,12 @@ import { Bank } from 'app/modules/proto/models/bank_pb'; import { Site } from 'app/modules/proto/models/site_pb'; import { MemberModel } from 'app/modules/proto/models/member_pb'; import { fuseAnimations } from '@fuse/animations'; +import { BankService } from 'app/modules/polyglot/bank/services/bank.service'; export interface RegistComposeData { title: string; parent: MemberModel; - sites: Site[]; - banks: Bank[]; + classId: string; } export interface RegistComposeResult { choice: boolean; @@ -38,6 +38,8 @@ export interface RegistComposeResult { }) export class RegistComposeComponent implements OnInit { composeForm!: FormGroup; + sites!: Site[]; + banks!: Bank[]; alert: { type: FuseAlertType; message: string } = { type: 'success', @@ -50,12 +52,14 @@ export class RegistComposeComponent implements OnInit { * Constructor */ constructor( + private _changeDetectorRef: ChangeDetectorRef, public matDialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: RegistComposeData, private _formBuilder: FormBuilder, private _identityService: IdentityService, private _memberService: MemberService, - private _changeDetectorRef: ChangeDetectorRef + private _siteService: SiteService, + private _bankService: BankService ) {} // ----------------------------------------------------------------------------------------------------- @@ -71,7 +75,7 @@ export class RegistComposeComponent implements OnInit { partnerId: [{ value: this.data.parent.getUsername(), disabled: true }], siteName: ['', [Validators.required]], signinId: ['', [Validators.required]], - password: ['', [Validators.required]], + password: ['beteran', [Validators.required]], exchangePw: ['', [Validators.required]], nickname: ['', [Validators.required]], calculateType: ['', [Validators.required]], @@ -80,6 +84,20 @@ export class RegistComposeComponent implements OnInit { accountNumber: ['', [Validators.required]], accountHolder: ['', [Validators.required]], }); + + this._siteService + .listSites() + .then((result) => { + this.sites = result.getSitesList(); + }) + .catch((reson) => console.log(reson)); + + this._bankService + .listBanks() + .then((result) => { + this.banks = result.getBanksList(); + }) + .catch((reson) => console.log(reson)); } // ----------------------------------------------------------------------------------------------------- @@ -140,7 +158,7 @@ export class RegistComposeComponent implements OnInit { member.setSiteId(siteName); member.setUsername(signinId); member.setPassword('beteran'); - member.setMemberClassId('ae9b874e-5d0e-4c4d-8432-f45f02691ceb'); + member.setMemberClassId(this.data.classId); member.setMemberLevelId('c56231ac-2120-4a81-a30a-5d41fafb6c57'); member.setReferrerMemberUsername(this.data.parent.getUsername()); member.setNickname(nickname); @@ -156,7 +174,7 @@ export class RegistComposeComponent implements OnInit { this.showAlert = true; this.alert = { type: 'error', message: '등록에 실패하였습니다.' }; }) - .finally(() => (this.showAlert = false)); + .finally(() => setTimeout(() => this.close(), 5000)); } private close(): void {