diff --git a/src/app/core/constants/menuItems.const.ts b/src/app/core/constants/menuItems.const.ts index d616106..ad282ea 100644 --- a/src/app/core/constants/menuItems.const.ts +++ b/src/app/core/constants/menuItems.const.ts @@ -21,21 +21,21 @@ export const MENU_ITEMS = [ ], }, { - label: 'محصولات', + label: 'کالاها', icon: 'pi pi-fw pi-tags', items: [ { - label: 'لیست محصولات', + label: 'لیست کالاها', icon: 'pi pi-fw pi-list', routerLink: ['/products'], }, { - label: 'برندهای محصول', + label: 'برندهای کالا', icon: 'pi pi-fw pi-tags', routerLink: ['/product-brands'], }, { - label: 'دسته‌بندی‌های محصول', + label: 'دسته‌بندی‌های کالا', icon: 'pi pi-fw pi-list', routerLink: ['/product-categories'], }, diff --git a/src/app/modules/customers/components/select/select.component.html b/src/app/modules/customers/components/select/select.component.html index 183bade..cbff2b9 100644 --- a/src/app/modules/customers/components/select/select.component.html +++ b/src/app/modules/customers/components/select/select.component.html @@ -1,15 +1,13 @@ -
- - - - -
+ + + + diff --git a/src/app/modules/customers/components/select/select.component.ts b/src/app/modules/customers/components/select/select.component.ts index f930dcf..707025e 100644 --- a/src/app/modules/customers/components/select/select.component.ts +++ b/src/app/modules/customers/components/select/select.component.ts @@ -1,7 +1,7 @@ -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 { Component } from '@angular/core'; +import { ReactiveFormsModule } from '@angular/forms'; import { Select } from 'primeng/select'; import { ICustomerResponse } from '../../models'; import { CustomersService } from '../../services/main.service'; @@ -11,24 +11,17 @@ import { CustomersService } from '../../services/main.service'; templateUrl: './select.component.html', imports: [ReactiveFormsModule, Select, UikitFieldComponent], }) -export class CustomersSelectComponent { - @Input() control!: FormControl>; - @Input() canInsert: boolean = false; - +export class CustomersSelectComponent extends AbstractSelectComponent { constructor(private service: CustomersService) { + super(); this.getData(); } - loading = signal(false); - brands = signal>(null); - - isOpenFormDialog = signal(false); - getData() { this.loading.set(true); this.service.getAll().subscribe({ next: (res) => { - this.brands.set(res.data); + this.items.set(res.data); this.loading.set(false); }, error: () => { @@ -36,12 +29,4 @@ export class CustomersSelectComponent { }, }); } - - refresh() { - this.getData(); - } - - onOpenForm() { - // this.isOpenFormDialog.set(true); - } } diff --git a/src/app/modules/inventories/components/select/select.component.html b/src/app/modules/inventories/components/select/select.component.html index 7d981ef..4151fd3 100644 --- a/src/app/modules/inventories/components/select/select.component.html +++ b/src/app/modules/inventories/components/select/select.component.html @@ -1,15 +1,13 @@ -
- - - - -
+ + + + diff --git a/src/app/modules/inventories/components/select/select.component.ts b/src/app/modules/inventories/components/select/select.component.ts index ff75ab6..baba846 100644 --- a/src/app/modules/inventories/components/select/select.component.ts +++ b/src/app/modules/inventories/components/select/select.component.ts @@ -1,7 +1,7 @@ -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 { Component } from '@angular/core'; +import { ReactiveFormsModule } from '@angular/forms'; import { Select } from 'primeng/select'; import { IInventoryResponse } from '../../models'; import { InventoriesService } from '../../services/main.service'; @@ -11,24 +11,17 @@ import { InventoriesService } from '../../services/main.service'; templateUrl: './select.component.html', imports: [ReactiveFormsModule, Select, UikitFieldComponent], }) -export class InventoriesSelectComponent { - @Input() control!: FormControl>; - @Input() canInsert: boolean = false; - +export class InventoriesSelectComponent extends AbstractSelectComponent { constructor(private service: InventoriesService) { + super(); this.getData(); } - loading = signal(false); - brands = signal>(null); - - isOpenFormDialog = signal(false); - getData() { this.loading.set(true); this.service.getAll().subscribe({ next: (res) => { - this.brands.set(res.data); + this.items.set(res.data); this.loading.set(false); }, error: () => { @@ -36,12 +29,4 @@ export class InventoriesSelectComponent { }, }); } - - refresh() { - this.getData(); - } - - onOpenForm() { - // this.isOpenFormDialog.set(true); - } } diff --git a/src/app/modules/productBrands/components/form.component.html b/src/app/modules/productBrands/components/form.component.html index 5db6daf..ba05b4a 100644 --- a/src/app/modules/productBrands/components/form.component.html +++ b/src/app/modules/productBrands/components/form.component.html @@ -1,5 +1,5 @@ - +
+ >; - @Input() canInsert: boolean = false; - +export class ProductBrandsSelectComponent extends AbstractSelectComponent { constructor(private service: ProductBrandsService) { + super(); this.getData(); } - loading = signal(false); - brands = signal>(null); - - isOpenFormDialog = signal(false); - getData() { this.loading.set(true); this.service.getAll().subscribe({ next: (res) => { - this.brands.set(res.data); + this.items.set(res.data); this.loading.set(false); }, error: () => { @@ -38,12 +31,4 @@ export class ProductBrandsSelectComponent { }, }); } - - refresh() { - this.getData(); - } - - onOpenForm() { - this.isOpenFormDialog.set(true); - } } diff --git a/src/app/modules/productBrands/constants/routes/index.ts b/src/app/modules/productBrands/constants/routes/index.ts index cdffb33..ed8e79b 100644 --- a/src/app/modules/productBrands/constants/routes/index.ts +++ b/src/app/modules/productBrands/constants/routes/index.ts @@ -8,7 +8,7 @@ export const productBrandsNamedRoutes: NamedRoutes = { path: 'product-brands', loadComponent: () => import('../../views/list.component').then((m) => m.ProductBrandsComponent), meta: { - title: 'برندهای محصول', + title: 'برندهای کالا', pagePath: () => '/product-brands', }, }, @@ -17,7 +17,7 @@ export const productBrandsNamedRoutes: NamedRoutes = { loadComponent: () => import('../../views/single.component').then((m) => m.ProductBrandComponent), meta: { - title: 'برند محصول', + title: 'برند کالا', pagePath: () => '/product-brands/:brandId', }, }, diff --git a/src/app/modules/productBrands/views/list.component.html b/src/app/modules/productBrands/views/list.component.html index fa049fb..74db881 100644 --- a/src/app/modules/productBrands/views/list.component.html +++ b/src/app/modules/productBrands/views/list.component.html @@ -1,5 +1,5 @@ - +
+ >; - @Input() canInsert: boolean = false; - +export class ProductCategoriesSelectComponent extends AbstractSelectComponent { constructor(private service: ProductCategoriesService) { + super(); this.getData(); } - loading = signal(false); - brands = signal>(null); - - isOpenFormDialog = signal(false); - getData() { this.loading.set(true); this.service.getAll().subscribe({ next: (res) => { - this.brands.set(res.data); + this.items.set(res.data); this.loading.set(false); }, error: () => { @@ -38,12 +31,4 @@ export class ProductCategoriesSelectComponent { }, }); } - - refresh() { - this.getData(); - } - - onOpenForm() { - this.isOpenFormDialog.set(true); - } } diff --git a/src/app/modules/productCategories/constants/routes/index.ts b/src/app/modules/productCategories/constants/routes/index.ts index 72b0386..5b3c3c4 100644 --- a/src/app/modules/productCategories/constants/routes/index.ts +++ b/src/app/modules/productCategories/constants/routes/index.ts @@ -9,7 +9,7 @@ export const productCategoriesNamedRoutes: NamedRoutes import('../../views/list.component').then((m) => m.ProductCategoriesComponent), meta: { - title: 'دسته‌بندی محصولات', + title: 'دسته‌بندی کالاها', pagePath: () => '/product-categories', }, }, @@ -18,7 +18,7 @@ export const productCategoriesNamedRoutes: NamedRoutes import('../../views/single.component').then((m) => m.ProductCategoryComponent), meta: { - title: 'دسته‌بندی محصول', + title: 'دسته‌بندی کالا', pagePath: () => '/product-categories/:categoryId', }, }, diff --git a/src/app/modules/productCategories/views/list.component.html b/src/app/modules/productCategories/views/list.component.html index a1d72b1..6a6c877 100644 --- a/src/app/modules/productCategories/views/list.component.html +++ b/src/app/modules/productCategories/views/list.component.html @@ -1,5 +1,5 @@ +
diff --git a/src/app/modules/productCharges/views/list.component.ts b/src/app/modules/productCharges/views/list.component.ts index 7602fd9..62988db 100644 --- a/src/app/modules/productCharges/views/list.component.ts +++ b/src/app/modules/productCharges/views/list.component.ts @@ -28,7 +28,7 @@ export class ProductChargesComponent { { field: 'totalAmount', header: 'مبلغ کل' }, { field: 'isSettled', header: 'تسویه شده' }, { field: 'buyAt', header: 'تاریخ خرید' }, - { field: 'productId', header: 'شناسه محصول' }, + { field: 'productId', header: 'شناسه کالا' }, { field: 'inventoryId', header: 'شناسه انبار' }, { field: 'supplierId', header: 'شناسه تامین‌کننده' }, { field: 'createdAt', header: 'تاریخ ایجاد' }, diff --git a/src/app/modules/products/components/form.component.html b/src/app/modules/products/components/form.component.html index b39c873..cb2cae9 100644 --- a/src/app/modules/products/components/form.component.html +++ b/src/app/modules/products/components/form.component.html @@ -1,10 +1,10 @@ - + - + diff --git a/src/app/modules/products/components/fullForm/full-form.component.html b/src/app/modules/products/components/fullForm/full-form.component.html index 7b64565..c3e1e6c 100644 --- a/src/app/modules/products/components/fullForm/full-form.component.html +++ b/src/app/modules/products/components/fullForm/full-form.component.html @@ -2,7 +2,7 @@
-

{{ initialData ? "ویرایش محصول" : "ایجاد محصول جدید" }}

+

{{ initialData ? "ویرایش کالا" : "ایجاد کالا جدید" }}

}
}
@if (canAddOrRemoveProducts) { - + }
diff --git a/src/app/modules/purchases/components/purchase-receipt-template.component.html b/src/app/modules/purchases/components/purchase-receipt-template.component.html deleted file mode 100644 index 83bc94b..0000000 --- a/src/app/modules/purchases/components/purchase-receipt-template.component.html +++ /dev/null @@ -1,142 +0,0 @@ - - -
-

رسید خرید

-
-
-
- - - - - - - - - - - - - - - - -
-
-
- - - - - - - - - - - - - - - - -
-
-
- - - - @for (col of columns; track $index) { - - {{ col.header }} - - } - - - - - - - -
- -
-
-
-
-
-
- جمع کل: - -
-
- مالیات (۹٪): - -
-
-
-
-
-
- مبلغ قابل پرداخت: - -
-
- -
-
- -
- - -
-
-
diff --git a/src/app/modules/purchases/components/receiptTemplate/index.ts b/src/app/modules/purchases/components/receiptTemplate/index.ts new file mode 100644 index 0000000..568ebe2 --- /dev/null +++ b/src/app/modules/purchases/components/receiptTemplate/index.ts @@ -0,0 +1,2 @@ +export * from './purchase-receipt-product-row.component'; +export * from './purchase-receipt-template.component'; diff --git a/src/app/modules/purchases/components/purchase-receipt-product-row.component.html b/src/app/modules/purchases/components/receiptTemplate/purchase-receipt-product-row.component.html similarity index 90% rename from src/app/modules/purchases/components/purchase-receipt-product-row.component.html rename to src/app/modules/purchases/components/receiptTemplate/purchase-receipt-product-row.component.html index 636a682..8783bd2 100644 --- a/src/app/modules/purchases/components/purchase-receipt-product-row.component.html +++ b/src/app/modules/purchases/components/receiptTemplate/purchase-receipt-product-row.component.html @@ -13,7 +13,12 @@ /> - +