feat(purchases): update terminology from "محصول" to "کالا" in purchase forms and templates

refactor(purchases): remove unused purchase receipt components and consolidate receipt template logic

fix(suppliers): enhance suppliers select component to support full data option values

style(tailwind): improve theme variables for better customization and consistency

feat(shared): introduce abstract select component for reusable select field logic

chore(purchases): clean up imports and improve component structure for better maintainability
This commit is contained in:
2025-12-10 16:54:25 +03:30
parent 50bc9a4632
commit b46b8b83f9
43 changed files with 450 additions and 391 deletions
@@ -1,9 +1,9 @@
<div class="">
<uikit-field label="تامین‌کننده">
<div class="w-full">
<uikit-field label="تامین‌کننده" [control]="control" [showLabel]="showLabel" [showErrors]="showErrors">
<p-select
[options]="items()"
optionLabel="fullname"
optionValue="id"
[optionValue]="selectOptionValue"
placeholder="انتخاب تامین‌کننده"
[formControl]="control"
[showClear]="true"
@@ -1,29 +1,21 @@
import { Maybe } from '@/core';
import { AbstractSelectComponent } from '@/shared/components';
import { UikitFieldComponent } from '@/uikit';
import { Component, Input, signal } from '@angular/core';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
import { Select } from 'primeng/select';
import { Component } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
import { ISupplierResponse } from '../../models';
import { SuppliersService } from '../../services/main.service';
@Component({
selector: 'suppliers-select-field',
templateUrl: './select.component.html',
imports: [ReactiveFormsModule, Select, UikitFieldComponent],
imports: [ReactiveFormsModule, SelectModule, UikitFieldComponent],
})
export class SuppliersSelectComponent {
@Input() control!: FormControl<Maybe<number>>;
@Input() canInsert: boolean = false;
export class SuppliersSelectComponent extends AbstractSelectComponent<ISupplierResponse> {
constructor(private service: SuppliersService) {
super();
this.getData();
}
loading = signal(false);
items = signal<Maybe<ISupplierResponse[]>>(null);
isOpenFormDialog = signal(false);
getData() {
this.loading.set(true);
this.service.getAll().subscribe({
@@ -36,12 +28,4 @@ export class SuppliersSelectComponent {
},
});
}
refresh() {
this.getData();
}
onOpenForm() {
// this.isOpenFormDialog.set(true);
}
}