init
This commit is contained in:
@@ -1,55 +1,55 @@
|
||||
import { ToastService } from '@/core/services/toast.service';
|
||||
import { SupplierInvoicePayFormComponent } from '@/modules/suppliers/components/invoices/pay-form.component';
|
||||
import { Component, EventEmitter, Input, Output, signal } from '@angular/core';
|
||||
import { IPurchaseReceiptResponse } from '../../../modules/purchases/models';
|
||||
import { ConfirmationDialogService } from '../confirmationDialog/confirmation-dialog.service';
|
||||
// import { ToastService } from '@/core/services/toast.service';
|
||||
// import { SupplierInvoicePayFormComponent } from '@/modules/suppliers/components/invoices/pay-form.component';
|
||||
// import { Component, EventEmitter, Input, Output, signal } from '@angular/core';
|
||||
// import { IPurchaseReceiptResponse } from '../../../modules/purchases/models';
|
||||
// import { ConfirmationDialogService } from '../confirmationDialog/confirmation-dialog.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-purchase-receipt-payment-wrapper',
|
||||
templateUrl: './wrapper.component.html',
|
||||
imports: [SupplierInvoicePayFormComponent],
|
||||
})
|
||||
export class PurchaseReceiptPaymentWrapperComponent {
|
||||
@Input() purchaseReceipt!: IPurchaseReceiptResponse;
|
||||
// @Component({
|
||||
// selector: 'app-purchase-receipt-payment-wrapper',
|
||||
// templateUrl: './wrapper.component.html',
|
||||
// imports: [SupplierInvoicePayFormComponent],
|
||||
// })
|
||||
// export class PurchaseReceiptPaymentWrapperComponent {
|
||||
// @Input() purchaseReceipt!: IPurchaseReceiptResponse;
|
||||
|
||||
@Output() onSubmit = new EventEmitter<void>();
|
||||
// @Output() onSubmit = new EventEmitter<void>();
|
||||
|
||||
showPaymentForm = signal(false);
|
||||
constructor(
|
||||
private confirmService: ConfirmationDialogService,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
setTimeout(() => {
|
||||
this.showConfirm();
|
||||
}, 1);
|
||||
}
|
||||
// showPaymentForm = signal(false);
|
||||
// constructor(
|
||||
// private confirmService: ConfirmationDialogService,
|
||||
// private toastService: ToastService,
|
||||
// ) {
|
||||
// setTimeout(() => {
|
||||
// this.showConfirm();
|
||||
// }, 1);
|
||||
// }
|
||||
|
||||
showConfirm() {
|
||||
this.confirmService.confirm({
|
||||
message: 'آیا پرداخت فاکتور انجام شده است؟',
|
||||
header: 'وضعیت پرداخت فاکتور',
|
||||
acceptLabel: 'بله',
|
||||
rejectLabel: 'خیر',
|
||||
accept: () => {
|
||||
this.toPaymentForm();
|
||||
},
|
||||
reject: () => {
|
||||
this.toastService.info({
|
||||
text: 'میتوانید از طریق منوی پرداخت فاکتور، در آینده اقدام به پرداخت نمایید.',
|
||||
title: 'پرداخت فاکتور انجام نشد',
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
// showConfirm() {
|
||||
// this.confirmService.confirm({
|
||||
// message: 'آیا پرداخت فاکتور انجام شده است؟',
|
||||
// header: 'وضعیت پرداخت فاکتور',
|
||||
// acceptLabel: 'بله',
|
||||
// rejectLabel: 'خیر',
|
||||
// accept: () => {
|
||||
// this.toPaymentForm();
|
||||
// },
|
||||
// reject: () => {
|
||||
// this.toastService.info({
|
||||
// text: 'میتوانید از طریق منوی پرداخت فاکتور، در آینده اقدام به پرداخت نمایید.',
|
||||
// title: 'پرداخت فاکتور انجام نشد',
|
||||
// });
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
|
||||
submitted() {
|
||||
console.log('submitted');
|
||||
// submitted() {
|
||||
// console.log('submitted');
|
||||
|
||||
this.showPaymentForm.set(false);
|
||||
this.onSubmit.emit();
|
||||
}
|
||||
// this.showPaymentForm.set(false);
|
||||
// this.onSubmit.emit();
|
||||
// }
|
||||
|
||||
toPaymentForm() {
|
||||
this.showPaymentForm.set(true);
|
||||
}
|
||||
}
|
||||
// toPaymentForm() {
|
||||
// this.showPaymentForm.set(true);
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user