From f64f96dcedf61d564f4c33b5bc52be0653cf6001 Mon Sep 17 00:00:00 2001 From: JUNG YI DAM Date: Tue, 6 Sep 2022 12:51:06 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EC=B6=9C=EA=B8=88=EC=8B=A0=EC=B2=AD=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../compose/withdraw-compose.component.html | 169 ++++++++++-------- .../compose/withdraw-compose.component.ts | 91 ++++++---- 2 files changed, 155 insertions(+), 105 deletions(-) diff --git a/src/app/modules/beteran/compose/compose/withdraw-compose.component.html b/src/app/modules/beteran/compose/compose/withdraw-compose.component.html index 4789dc2..c105217 100644 --- a/src/app/modules/beteran/compose/compose/withdraw-compose.component.html +++ b/src/app/modules/beteran/compose/compose/withdraw-compose.component.html @@ -3,7 +3,7 @@
-
Withdraw
+
출금신청
+ + {{ alert.message }} +
- To - -
- - Cc - - - Bcc - -
+ 은행명 + + + 국민은행 + +
- - - - Cc - + + 은행명은 필수 입력입니다. + + + 예금주 + - - - - Bcc - + + 예금주는 필수 입력입니다. + + + 계좌번호 + + + + 계좌번호는 필수 입력입니다. + + + 보유금액 + - Subject - + 출금금액 + + + 출금금액은 필수 입력입니다. + - - -
-
- - - - - - - - +
+
-
- - + + 출금비밀번호 + + + 출금비밀번호는 필수 입력입니다. + + +
+
- +
diff --git a/src/app/modules/beteran/compose/compose/withdraw-compose.component.ts b/src/app/modules/beteran/compose/compose/withdraw-compose.component.ts index 51a1295..cf89a98 100644 --- a/src/app/modules/beteran/compose/compose/withdraw-compose.component.ts +++ b/src/app/modules/beteran/compose/compose/withdraw-compose.component.ts @@ -1,6 +1,9 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { MatDialogRef } from '@angular/material/dialog'; +import { FuseAlertType } from '@fuse/components/alert'; +import { MemberBankWithdrawService } from 'app/modules/polyglot/member_bank_withdraw/services/member_bank_withdraw.service'; +import { CreateMemberBankWithdrawRequest } from 'app/modules/proto/c2se/member_bank_withdraw_pb'; @Component({ selector: 'withdraw-compose', @@ -9,24 +12,18 @@ import { MatDialogRef } from '@angular/material/dialog'; }) export class WithdrawComposeComponent implements OnInit { composeForm!: FormGroup; - copyFields: { cc: boolean; bcc: boolean } = { - cc: false, - bcc: false, + alert: { type: FuseAlertType; message: string } = { + type: 'success', + message: '출금신청이 완료 되었습니다.', }; - quillModules: any = { - toolbar: [ - ['bold', 'italic', 'underline'], - [{ align: [] }, { list: 'ordered' }, { list: 'bullet' }], - ['clean'], - ], - }; - + showAlert: boolean = false; /** * Constructor */ constructor( public matDialogRef: MatDialogRef, - private _formBuilder: FormBuilder + private _formBuilder: FormBuilder, + private _memberBankWithdrawService: MemberBankWithdrawService ) {} // ----------------------------------------------------------------------------------------------------- @@ -39,11 +36,8 @@ export class WithdrawComposeComponent implements OnInit { ngOnInit(): void { // Create the form this.composeForm = this._formBuilder.group({ - to: ['', [Validators.required, Validators.email]], - cc: ['', [Validators.email]], - bcc: ['', [Validators.email]], - subject: [''], - body: ['', [Validators.required]], + accountHolder: ['', [Validators.required]], + amount: ['', [Validators.required]], }); } @@ -51,21 +45,6 @@ export class WithdrawComposeComponent implements OnInit { // @ Public methods // ----------------------------------------------------------------------------------------------------- - /** - * Show the copy field with the given field name - * - * @param name - */ - showCopyField(name: string): void { - // Return if the name is not one of the available names - if (name !== 'cc' && name !== 'bcc') { - return; - } - - // Show the field - this.copyFields[name] = true; - } - /** * Save and close */ @@ -90,5 +69,51 @@ export class WithdrawComposeComponent implements OnInit { /** * Send the message */ - send(): void {} + send(): void { + if (!this.composeForm.valid) { + return; + } + + this.composeForm?.disable(); + + const req = new CreateMemberBankWithdrawRequest(); + const amount = this.composeForm.get('amount')?.value as number; + const holder = this.composeForm.get('accountHolder')?.value as string; + req.setAmount(amount); + req.setName(holder); + req.setMemo('test'); + + this._memberBankWithdrawService + .createMemberBankWithdraw( + // req - 에러나서 지워둠. 이담 + ) + .then(() => { + console.log(); + this.showAlert = true; + }) + .catch((e) => { + this.showAlert = true; + this.alert = { type: 'error', message: '출금신청이 실패 하였습니다.' }; + // Re-enable the form + this.composeForm?.enable(); + + // Reset the form + }) + .finally(() => + setTimeout(() => { + this.matDialogRef.close(); + }, 2000) + ); + // req.set + } + + __changeAmount(amount: string): void { + const amountInput = this.composeForm.get('amount'); + + if (amount === '0') { + amountInput?.setValue(''); + return; + } + amountInput?.setValue(amount); + } } From e15e05943a98368be3e977d58cb8a3163fe6bf10 Mon Sep 17 00:00:00 2001 From: JUNG YI DAM Date: Tue, 6 Sep 2022 04:08:05 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=EC=BD=A4=ED=94=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../compose/comp-compose.component.html | 110 ++++-------------- .../compose/compose/comp-compose.component.ts | 30 +---- 2 files changed, 28 insertions(+), 112 deletions(-) diff --git a/src/app/modules/beteran/compose/compose/comp-compose.component.html b/src/app/modules/beteran/compose/compose/comp-compose.component.html index a8b20be..a44b7ba 100644 --- a/src/app/modules/beteran/compose/compose/comp-compose.component.html +++ b/src/app/modules/beteran/compose/compose/comp-compose.component.html @@ -3,7 +3,7 @@
-
Comp
+
콤프
+ + {{ alert.message }} + - + - To - -
- - Cc - - - Bcc - -
+ 닉네임 +
+ + 닉네임은 필수 입력입니다. + - - - Cc - - - - - - Bcc - - - - + - Subject - + 보유콤프 + - - - - -
-
- - - - - - - - -
- -
- - - - +
+
diff --git a/src/app/modules/beteran/compose/compose/comp-compose.component.ts b/src/app/modules/beteran/compose/compose/comp-compose.component.ts index 4e4171d..0525fe7 100644 --- a/src/app/modules/beteran/compose/compose/comp-compose.component.ts +++ b/src/app/modules/beteran/compose/compose/comp-compose.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { MatDialogRef } from '@angular/material/dialog'; +import { FuseAlertType } from '@fuse/components/alert'; @Component({ selector: 'comp-compose', @@ -9,17 +10,11 @@ import { MatDialogRef } from '@angular/material/dialog'; }) export class CompComposeComponent implements OnInit { composeForm!: FormGroup; - copyFields: { cc: boolean; bcc: boolean } = { - cc: false, - bcc: false, - }; - quillModules: any = { - toolbar: [ - ['bold', 'italic', 'underline'], - [{ align: [] }, { list: 'ordered' }, { list: 'bullet' }], - ['clean'], - ], + alert: { type: FuseAlertType; message: string } = { + type: 'success', + message: '출금신청이 완료 되었습니다.', }; + showAlert: boolean = false; /** * Constructor @@ -51,21 +46,6 @@ export class CompComposeComponent implements OnInit { // @ Public methods // ----------------------------------------------------------------------------------------------------- - /** - * Show the copy field with the given field name - * - * @param name - */ - showCopyField(name: string): void { - // Return if the name is not one of the available names - if (name !== 'cc' && name !== 'bcc') { - return; - } - - // Show the field - this.copyFields[name] = true; - } - /** * Save and close */