Merge branch 'feature/BETERAN-BACKEND-APP-BROWSER-init' of https://gitlab.loafle.net/bet/beteran-backend-app-browser into feature/BETERAN-BACKEND-APP-BROWSER-init
This commit is contained in:
commit
47b3333bad
|
@ -10,7 +10,7 @@
|
|||
<mat-progress-bar [mode]="'indeterminate'"></mat-progress-bar>
|
||||
</div>
|
||||
<!-- Title -->
|
||||
<div class="text-4xl font-extrabold tracking-tight">전체목록</div>
|
||||
<div class="text-4xl font-extrabold tracking-tight">{{ title }}</div>
|
||||
<!-- Actions -->
|
||||
<div class="flex shrink-0 items-center mt-6 sm:mt-0 sm:ml-4">
|
||||
<!-- Search -->
|
||||
|
@ -196,7 +196,7 @@
|
|||
[color]="'primary'"
|
||||
(click)="__onClickRegist($event, partner)"
|
||||
>
|
||||
대본등록
|
||||
{{ btnTitle }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -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<any> = new Subject<any>();
|
||||
|
||||
/**
|
||||
|
@ -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) => {
|
||||
|
@ -257,7 +291,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
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
<mat-label>사이트명</mat-label>
|
||||
|
||||
<mat-select [formControlName]="'siteName'" placeholder="사이트 선택">
|
||||
<mat-option *ngFor="let site of data.sites" [value]="site.getId()">
|
||||
<mat-option *ngFor="let site of sites" [value]="site.getId()">
|
||||
{{ site.getUrl() }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
|
@ -140,10 +140,10 @@
|
|||
<mat-label>은행명</mat-label>
|
||||
|
||||
<mat-select [formControlName]="'bankName'" placeholder="은행 선택">
|
||||
<mat-option *ngFor="let bank of data.banks" [value]="bank.getId()">
|
||||
<mat-option *ngFor="let bank of banks" [value]="bank.getId()">
|
||||
{{ bank.getName() }}
|
||||
</mat-option>
|
||||
<mat-option [value]="'0'"> 국민은행 </mat-option>
|
||||
<!-- <mat-option [value]="'0'"> 국민은행 </mat-option> -->
|
||||
</mat-select>
|
||||
<mat-error *ngIf="composeForm.get('bankName')?.hasError('required')">
|
||||
은행명은 필수 입력입니다.
|
||||
|
|
|
@ -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<RegistComposeComponent>,
|
||||
@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 {
|
||||
|
|
|
@ -3,6 +3,11 @@ import { Route } from '@angular/router';
|
|||
import { ListComponent } from './components/list.component';
|
||||
|
||||
import {
|
||||
PartnerListForBranchResolver,
|
||||
PartnerListForDivisionResolver,
|
||||
PartnerListForMainOfficeResolver,
|
||||
PartnerListForOfficeResolver,
|
||||
PartnerListForStoreResolver,
|
||||
PartnerListResolver,
|
||||
PartnersResolver,
|
||||
} from './resolvers/partner.resolver';
|
||||
|
@ -24,35 +29,35 @@ export const partnerRoutes: Route[] = [
|
|||
path: 'main-office',
|
||||
component: ListComponent,
|
||||
resolve: {
|
||||
Partners: PartnersResolver,
|
||||
listPartner: PartnerListForMainOfficeResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'branch',
|
||||
component: ListComponent,
|
||||
resolve: {
|
||||
Partners: PartnersResolver,
|
||||
listPartner: PartnerListForBranchResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'division',
|
||||
component: ListComponent,
|
||||
resolve: {
|
||||
Partners: PartnersResolver,
|
||||
listPartner: PartnerListForDivisionResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'office',
|
||||
component: ListComponent,
|
||||
resolve: {
|
||||
Partners: PartnersResolver,
|
||||
listPartner: PartnerListForOfficeResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'store',
|
||||
component: ListComponent,
|
||||
resolve: {
|
||||
Partners: PartnersResolver,
|
||||
listPartner: PartnerListForStoreResolver,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
|
@ -128,3 +128,178 @@ export class PartnerListResolver implements Resolve<any> {
|
|||
return this.__memberService.listMembers(req);
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerListForMainOfficeResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private __memberService: MemberService) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
):
|
||||
| Observable<ListMembersResponse.Result>
|
||||
| Promise<ListMembersResponse.Result>
|
||||
| ListMembersResponse.Result {
|
||||
let req = new ListMembersRequest();
|
||||
let search = new ListMembersRequest.Search();
|
||||
search.setMemberClassId('4b014ef5-3bab-4413-aaf9-b0040a70ec77');
|
||||
req.setSearch(search);
|
||||
|
||||
return this.__memberService.listMembers(req);
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerListForBranchResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private __memberService: MemberService) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
):
|
||||
| Observable<ListMembersResponse.Result>
|
||||
| Promise<ListMembersResponse.Result>
|
||||
| ListMembersResponse.Result {
|
||||
let req = new ListMembersRequest();
|
||||
let search = new ListMembersRequest.Search();
|
||||
search.setMemberClassId('ae9b874e-5d0e-4c4d-8432-f45f02691ceb');
|
||||
req.setSearch(search);
|
||||
|
||||
return this.__memberService.listMembers(req);
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerListForDivisionResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private __memberService: MemberService) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
):
|
||||
| Observable<ListMembersResponse.Result>
|
||||
| Promise<ListMembersResponse.Result>
|
||||
| ListMembersResponse.Result {
|
||||
let req = new ListMembersRequest();
|
||||
let search = new ListMembersRequest.Search();
|
||||
search.setMemberClassId('f25a17e9-5c5f-4e9c-bf80-92a9cedf829c');
|
||||
req.setSearch(search);
|
||||
|
||||
return this.__memberService.listMembers(req);
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerListForOfficeResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private __memberService: MemberService) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
):
|
||||
| Observable<ListMembersResponse.Result>
|
||||
| Promise<ListMembersResponse.Result>
|
||||
| ListMembersResponse.Result {
|
||||
let req = new ListMembersRequest();
|
||||
let search = new ListMembersRequest.Search();
|
||||
search.setMemberClassId('cac7b897-2549-4f04-8415-8868f1dcb1da');
|
||||
req.setSearch(search);
|
||||
|
||||
return this.__memberService.listMembers(req);
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerListForStoreResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private __memberService: MemberService) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
):
|
||||
| Observable<ListMembersResponse.Result>
|
||||
| Promise<ListMembersResponse.Result>
|
||||
| ListMembersResponse.Result {
|
||||
let req = new ListMembersRequest();
|
||||
let search = new ListMembersRequest.Search();
|
||||
search.setMemberClassId('e11cac11-3825-4f4e-9cd5-39367f23f973');
|
||||
req.setSearch(search);
|
||||
|
||||
return this.__memberService.listMembers(req);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user