Files
pyrofetes-frontend/src/app/components/supplier-table/supplier-table.html
T
2026-05-28 10:52:46 +01:00

90 lines
4.4 KiB
HTML

<nz-table [nzData]="suppliers()"
[nzLoading]="suppliersLoading()"
[nzFrontPagination]="false">
<thead>
<tr style="text-align: center">
<th>Nom</th>
<th>Téléphone</th>
<th>Email</th>
<th>Adresse</th>
<th>Code Postal</th>
<th>Ville</th>
<th>Délai moyen</th>
<th>Produits</th>
<th style="display: flex; align-items: center;">Action</th>
</tr>
</thead>
<tbody style="text-align: center">
@for (supplier of suppliers(); track supplier.id) {
<tr>
<td>{{ supplier.name }}</td>
<td>{{ supplier.phone }}</td>
<td>{{ supplier.email }}</td>
<td>{{ supplier.address }}</td>
<td>{{ supplier.zipCode }}</td>
<td>{{ supplier.city }}</td>
<td>{{ supplier.deliveryDelay }} jours</td>
<td>
<app-modal-button type="link" [name]="'Voir les produits'" size="45%">
<nz-table [nzData]="suppliers()" [nzFrontPagination]="false">
<thead>
<tr class="text-center">
<th>Produit</th>
<th>Référence</th>
<th>Prix</th>
<th>Action</th>
</tr>
</thead>
<tbody class="text-center">
@for (product of supplier.prices; track product.productId) {
<tr>
<td>{{ product.productName }}</td>
<td>{{ product.productReference }}</td>
<td>{{ product.sellingPrice }}€</td>
<td>
<div class="flex items-center justify-center space-x-2">
<nz-icon nzType="edit" nzTheme="outline"
class="cursor-pointer text-gray-600 hover:text-gray-900"
(click)="openEditProductModal(product, supplier.id)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline"
class="cursor-pointer text-red-600 hover:text-red-800"
(click)="deleteProduct(product.productId, supplier.id)"></nz-icon>
</div>
</td>
</tr>
}
</tbody>
</nz-table>
</app-modal-button>
</td>
<td>
<div style="display: flex; align-items: center;">
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(supplier)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(supplier.id)"
class="text-red-600 cursor-pointer"></nz-icon>
</div>
</td>
</tr>
}
</tbody>
</nz-table>
<div class="hidden">
<app-modal-nav #supplierModal nameIcon="edit" [name]="'Modifier'"
(ok)="onModalOk(selectedSupplier?.id, supplierForm, supplierModal)"
(cancel)="onModalCancel(supplierModal)">
<app-supplier-form #supplierForm [supplier]="selectedSupplier"></app-supplier-form>
</app-modal-nav>
</div>
<div class="hidden">
<app-modal-nav #productModal nameIcon="edit" [name]="'Modifier les prix des fournisseurs'"
(ok)="onModalProductOk(selectedProduct?.productId, selectedProductSupplierId, priceForm, productModal)"
(cancel)="onModalCancel(productModal)">
<app-price-form #priceForm [price]="selectedProduct"></app-price-form>
</app-modal-nav>
</div>