add getall and delete function from purchase order page

This commit is contained in:
2025-11-30 12:32:27 +01:00
parent a76b184dc1
commit aad637c9c9
7 changed files with 66 additions and 201 deletions

View File

@@ -1,4 +1,7 @@
<nz-table #basicTable [nzData]="purchaseOrders" class="mr-7">
<nz-table [nzData]="purchaseOrders()"
[nzLoading]="purchaseOrdersLoading()"
[nzFrontPagination]="false"
class="mr-7">
<thead>
<tr class="text-center">
<th>Numéro</th>
@@ -9,37 +12,36 @@
</tr>
</thead>
<tbody class="text-center">
@for (data of basicTable.data; track data) {
@for (purchaseOrder of purchaseOrders(); track purchaseOrder.id) {
<tr>
<td></td>
<td></td>
<td></td>
<td>{{ purchaseOrder.id }}</td>
<td>{{purchaseOrder.purchaseConditions}}</td>
<td>Fournisseur ???</td>
<td>
<app-modal-button type="link" name="Voir les produits">
<div style="max-height: 400px; overflow-y: auto;">
<nz-table [nzData]="data.productOrder">
<nz-table [nzData]="purchaseOrders()"
[nzFrontPagination]="false">
<thead>
<tr class="text-center">
<th>Nom</th>
<th>Reférence</th>
<th>Prix</th>
<th>Quantité</th>
<th>Action</th>
</tr>
</thead>
<tbody class="text-center">
@for (product of data.productOrder; track product) {
@for (product of purchaseOrder.getPurchaseProductDto; track product.productId) {
<tr>
<td>{{product.product.name}}</td>
<td>{{product.price}}</td>
<td>{{product.productName}}</td>
<td>{{product.productReferences}}</td>
<td>Prix €€€€</td>
<td>{{product.quantity}}</td>
<td>
<div style="justify-content: center; display: flex">
<app-modal-nav nameIcon="edit" name="Modification des conditions de vente" class="cursor-pointer">
<app-product-form></app-product-form>
</app-modal-nav>
<nz-divider nzType="vertical"></nz-divider>
<div>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete()" class="cursor-pointer text-red-700"/>
<nz-icon nzType="delete" nzTheme="outline" class="cursor-pointer text-red-700"/>
</div>
</div>
</td>
@@ -52,12 +54,16 @@
</td>
<td>
<div style="justify-content: center; display: flex">
<div>
<nz-icon nzType="plus-circle" nzTheme="outline" (click)="delete(purchaseOrder.id)" class="cursor-pointer text-green-700"/>
</div>
<nz-divider nzType="vertical"></nz-divider>
<app-modal-nav nameIcon="edit" name="Modification des conditions de vente" class="cursor-pointer">
<app-purchase-order-form></app-purchase-order-form>
</app-modal-nav>
<nz-divider nzType="vertical"></nz-divider>
<div>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete()" class="cursor-pointer text-red-700"/>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(purchaseOrder.id)" class="cursor-pointer text-red-700"/>
</div>
<nz-divider nzType="vertical"></nz-divider>
<div>
@@ -65,7 +71,7 @@
</div>
<nz-divider nzType="vertical"></nz-divider>
<div>
<nz-icon nzType="interaction" nzTheme="outline" (click)="transfert()" class="cursor-pointer text-blue-700"/>
<nz-icon nzType="interaction" nzTheme="outline" (click)="transfer()" class="cursor-pointer text-blue-700"/>
</div>
</div>
</td>