@@ -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"
>
@@ -198,7 +210,11 @@
class="deposit-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b"
>
-
+
diff --git a/src/app/modules/admin/bank/deposit/components/list.component.ts b/src/app/modules/admin/bank/deposit/components/list.component.ts
index 7675b8f..cfd07f7 100644
--- a/src/app/modules/admin/bank/deposit/components/list.component.ts
+++ b/src/app/modules/admin/bank/deposit/components/list.component.ts
@@ -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;
+
listMember!: MemberModel[];
memberClasses!: MemberClass[];
bankDeposit$!: Observable;
+ __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);