bug fix
This commit is contained in:
parent
62278134f6
commit
6d4ab2bb43
|
@ -36,12 +36,22 @@
|
|||
|
||||
<div class="flex items-center mt-2 mb-2 ml-6">
|
||||
<div>
|
||||
<button mat-flat-button class="bet-mat-small-8" [color]="'primary'">
|
||||
<button
|
||||
mat-flat-button
|
||||
class="bet-mat-small-8"
|
||||
[color]="'primary'"
|
||||
(click)="onClickDeposit(0)"
|
||||
>
|
||||
입금처리
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<button mat-flat-button class="bet-mat-small-8" [color]="'primary'">
|
||||
<button
|
||||
mat-flat-button
|
||||
class="bet-mat-small-8"
|
||||
[color]="'primary'"
|
||||
(click)="onClickDeposit(1)"
|
||||
>
|
||||
대기처리
|
||||
</button>
|
||||
</div>
|
||||
|
@ -141,7 +151,9 @@
|
|||
class="deposit-grid z-10 sticky top-0 grid gap-4 py-4 px-6 md:px-8 shadow text-md font-semibold text-secondary bg-gray-50 dark:bg-black dark:bg-opacity-5"
|
||||
>
|
||||
<div>
|
||||
<mat-checkbox></mat-checkbox>
|
||||
<mat-checkbox
|
||||
(change)="__onChangeChkDepositsAll($event)"
|
||||
></mat-checkbox>
|
||||
</div>
|
||||
<div>구분</div>
|
||||
<div>
|
||||
|
@ -198,7 +210,11 @@
|
|||
class="deposit-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b"
|
||||
>
|
||||
<div>
|
||||
<mat-checkbox></mat-checkbox>
|
||||
<mat-checkbox
|
||||
#chkDeposits
|
||||
[value]="deposit.getId()"
|
||||
(change)="__onChangeChkDeposits($event)"
|
||||
></mat-checkbox>
|
||||
</div>
|
||||
<!-- 구분 -->
|
||||
<div>
|
||||
|
|
|
@ -5,7 +5,9 @@ import {
|
|||
Component,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
QueryList,
|
||||
ViewChild,
|
||||
ViewChildren,
|
||||
ViewEncapsulation,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
|
@ -14,7 +16,7 @@ import {
|
|||
FormGroup,
|
||||
Validators,
|
||||
} from '@angular/forms';
|
||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||
import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatSort } from '@angular/material/sort';
|
||||
import {
|
||||
|
@ -34,7 +36,10 @@ import { Deposit } from '../models/deposit';
|
|||
import { DepositPagination } from '../models/deposit-pagination';
|
||||
import { DepositService } from '../services/deposit.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ListMemberBankDepositsResponse } from 'app/modules/proto/c2se/member_bank_deposit_pb';
|
||||
import {
|
||||
ListMemberBankDepositsResponse,
|
||||
UpdateMemberBankDepositForStateRequest,
|
||||
} from 'app/modules/proto/c2se/member_bank_deposit_pb';
|
||||
import {
|
||||
MemberBankDeposit,
|
||||
MemberBankDepositState,
|
||||
|
@ -43,6 +48,7 @@ import { MemberModel } from 'app/modules/proto/models/member_pb';
|
|||
import { ListMembersResponse } from 'app/modules/proto/c2se/member_pb';
|
||||
import { ListMemberClassesResponse } from 'app/modules/proto/c2se/member_class_pb';
|
||||
import { MemberClass } from 'app/modules/proto/models/member_class_pb';
|
||||
import { MemberBankDepositService } from 'app/modules/polyglot/member_bank_deposit/services/member_bank_deposit.service';
|
||||
|
||||
@Component({
|
||||
selector: 'deposit-list',
|
||||
|
@ -79,9 +85,12 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
|
||||
@ViewChild(MatSort) private _sort!: MatSort;
|
||||
|
||||
@ViewChildren('chkDeposits') chkDeposits!: QueryList<MatCheckbox>;
|
||||
|
||||
listMember!: MemberModel[];
|
||||
memberClasses!: MemberClass[];
|
||||
bankDeposit$!: Observable<MemberBankDeposit[] | undefined>;
|
||||
__checkedDeposits: string[] = [];
|
||||
|
||||
__isSearchOpened = false;
|
||||
isLoading = false;
|
||||
|
@ -100,7 +109,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
private _fuseConfirmationService: FuseConfirmationService,
|
||||
private _formBuilder: FormBuilder,
|
||||
private _depositService: DepositService,
|
||||
private router: Router
|
||||
private router: Router,
|
||||
private _bankDepositService: MemberBankDepositService
|
||||
) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
@ -239,6 +249,46 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
return item.id || index;
|
||||
}
|
||||
|
||||
onClickDeposit(type: number): void {
|
||||
if (this.__checkedDeposits.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
let req: UpdateMemberBankDepositForStateRequest;
|
||||
|
||||
this.__checkedDeposits.map((v) => {
|
||||
req = new UpdateMemberBankDepositForStateRequest();
|
||||
req.setId(v);
|
||||
req.setState(2);
|
||||
this._bankDepositService
|
||||
.updateMemberBankDepositForState()
|
||||
.then((result) => {
|
||||
console.log(result);
|
||||
})
|
||||
.catch((reson) => console.log(reson));
|
||||
});
|
||||
}
|
||||
|
||||
__onChangeChkDepositsAll(event: MatCheckboxChange): void {
|
||||
let checked = event.checked;
|
||||
this.chkDeposits.forEach((c, i) => {
|
||||
c.checked = checked;
|
||||
});
|
||||
this.__updateCheckedDeposits();
|
||||
}
|
||||
__onChangeChkDeposits(event: MatCheckboxChange): void {
|
||||
this.__updateCheckedDeposits();
|
||||
}
|
||||
|
||||
__updateCheckedDeposits(): void {
|
||||
this.__checkedDeposits = [];
|
||||
this.chkDeposits.forEach((c, i) => {
|
||||
if (c.checked) {
|
||||
this.__checkedDeposits.push(c.value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
__getMemberRefferByMemberId(memberId: string): string | undefined {
|
||||
const member = this.__getMemberById(memberId);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user