deleted notifs components

This commit is contained in:
2026-05-25 10:40:08 +01:00
parent cb4686765b
commit b03196ce0f
144 changed files with 3346 additions and 2057 deletions
@@ -1,6 +1,6 @@
import { Component } from '@angular/core';
import {Component} from '@angular/core';
import {FormBuilder, FormGroup, FormArray, Validators, ReactiveFormsModule, FormControl} from '@angular/forms';
import { GetProductDto } from '../../services/api';
import {GetProductDto} from '../../services/api';
import {NzTableComponent} from "ng-zorro-antd/table";
import {NzInputNumberComponent} from "ng-zorro-antd/input-number";
import {NzColDirective} from "ng-zorro-antd/grid";
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import {Component} from '@angular/core';
import {
FormArray,
FormBuilder,
@@ -17,7 +17,7 @@ import {NzTableComponent} from "ng-zorro-antd/table";
import {GetProductDto} from "../../services/api";
@Component({
selector: 'app-create-quotation-form',
selector: 'app-create-quotation-form',
imports: [
FormsModule,
NzColDirective,
@@ -30,8 +30,8 @@ import {GetProductDto} from "../../services/api";
NzTableComponent,
ReactiveFormsModule
],
templateUrl: './create-quotation-form.html',
styleUrl: './create-quotation-form.css',
templateUrl: './create-quotation-form.html',
styleUrl: './create-quotation-form.css',
})
export class CreateQuotationForm {
createQuotationForm: FormGroup
@@ -7,7 +7,7 @@ import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/
import {GetDelivererDto} from "../../services/api";
@Component({
selector: 'app-deliverer-form',
selector: 'app-deliverer-form',
imports: [
NzColDirective,
NzFlexDirective,
@@ -18,15 +18,16 @@ import {GetDelivererDto} from "../../services/api";
NzInputDirective,
ReactiveFormsModule
],
templateUrl: './deliverer-form.html',
styleUrl: './deliverer-form.css',
templateUrl: './deliverer-form.html',
styleUrl: './deliverer-form.css',
})
export class DelivererForm {
delivererForm: FormGroup = new FormGroup({
transporter: new FormControl<string>(null, [Validators.required])
})
deliverer= input<GetDelivererDto>();
deliverer = input<GetDelivererDto>();
constructor() {
effect(() => {
if (this.deliverer()) {
@@ -6,7 +6,7 @@ nz-table {
background: #fff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
@@ -66,18 +66,21 @@ nz-table tbody td p {
nz-table thead {
display: none;
}
nz-table tbody tr {
display: block;
margin-bottom: 16px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
border-radius: 8px;
padding: 12px;
}
nz-table tbody td {
display: flex;
justify-content: space-between;
padding: 6px 12px;
}
nz-table tbody td::before {
content: attr(data-label);
font-weight: 600;
@@ -1,6 +1,6 @@
<nz-table [nzData]="deliverers()"
[nzFrontPagination]="false"
[nzLoading]="deliverersLoading()">
<nz-table [nzData]="deliverers()"
[nzFrontPagination]="false"
[nzLoading]="deliverersLoading()">
<thead>
<tr class="text-center">
<th>Transporteur</th>
@@ -11,12 +11,12 @@
<tbody class="text-center">
@for (deliverer of deliverers(); track deliverer.id) {
<tr>
<td>{{deliverer.transporter}}</td>
<td>{{ deliverer.transporter }}</td>
<td>
<app-modal-button type="link" name="Voir tout les bons de livraison" size="50%">
<div style="max-height: 400px; overflow-y: auto;">
<nz-table [nzData]="deliverers()"
[nzFrontPagination]="false">
[nzFrontPagination]="false">
<thead>
<tr class="text-center">
<th>Numéro de livraison</th>
@@ -28,10 +28,10 @@
<tbody class="text-center">
@for (deliveryInfo of deliverer.deliveryNotes; track deliveryInfo.id) {
<tr>
<td>{{deliveryInfo.trackingNumber}}</td>
<td>{{deliveryInfo.expeditionDate | date: 'dd/MM/yyyy'}}</td>
<td>{{deliveryInfo.estimateDeliveryDate | date: 'dd/MM/yyyy'}}</td>
<td>{{deliveryInfo.realDeliveryDate | date: 'dd/MM/yyyy'}}</td>
<td>{{ deliveryInfo.trackingNumber }}</td>
<td>{{ deliveryInfo.expeditionDate | date: 'dd/MM/yyyy' }}</td>
<td>{{ deliveryInfo.estimateDeliveryDate | date: 'dd/MM/yyyy' }}</td>
<td>{{ deliveryInfo.realDeliveryDate | date: 'dd/MM/yyyy' }}</td>
</tr>
}
</tbody>
@@ -41,9 +41,11 @@
</td>
<td>
<div style="justify-content: center; display: flex">
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" (click)="openEditModal(deliverer)"></nz-icon>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(deliverer)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(deliverer.id)" class="text-red-600 cursor-pointer"></nz-icon>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(deliverer.id)"
class="text-red-600 cursor-pointer"></nz-icon>
</div>
</td>
</tr>
@@ -52,7 +54,8 @@
</nz-table>
<div class="hidden">
<app-modal-nav #modalNav nameIcon="edit" [name]="'Modifier'" (ok)="onModalOk(selectedDeliverer.id, delivererForm, modalNav)" (cancel)="onModalCancel(modalNav)">
<app-modal-nav #modalNav nameIcon="edit" [name]="'Modifier'"
(ok)="onModalOk(selectedDeliverer.id, delivererForm, modalNav)" (cancel)="onModalCancel(modalNav)">
<app-deliverer-form #delivererForm [deliverer]="selectedDeliverer"></app-deliverer-form>
</app-modal-nav>
</div>
@@ -12,7 +12,7 @@ import {firstValueFrom} from "rxjs";
import {SupplierForm} from "../supplier-form/supplier-form";
@Component({
selector: 'app-deliverer-table',
selector: 'app-deliverer-table',
imports: [
ModalNav,
NzDividerComponent,
@@ -22,8 +22,8 @@ import {SupplierForm} from "../supplier-form/supplier-form";
DatePipe,
DelivererForm,
],
templateUrl: './deliverer-table.html',
styleUrl: './deliverer-table.css',
templateUrl: './deliverer-table.html',
styleUrl: './deliverer-table.css',
})
export class DelivererTable implements OnInit {
@@ -53,7 +53,7 @@ export class DelivererTable implements OnInit {
this.deliverersLoading.set(false)
}
async delete(deliverer:number) {
async delete(deliverer: number) {
try {
await firstValueFrom(this.deliverersService.deleteDelivererEndpoint(deliverer))
this.notificationService.success(
@@ -89,8 +89,9 @@ export class DelivererTable implements OnInit {
}
selectedDeliverer: GetDelivererDto | null = null;
openEditModal(supplier: GetSupplierDto) {
this.selectedDeliverer = { ...supplier };
this.selectedDeliverer = {...supplier};
this.modal().showModal();
}
@@ -5,7 +5,8 @@
</nz-form-label>
<nz-form-control nzSpan="9" nzErrorTip="Ce champ est requis">
<nz-select formControlName="delivererId" [nzPlaceHolder]="'Choisir un transporteur'" nzShowSearch [nzFilterOption]="filter">
<nz-select formControlName="delivererId" [nzPlaceHolder]="'Choisir un transporteur'" nzShowSearch
[nzFilterOption]="filter">
@for (deliverer of deliverers(); track deliverer.id) {
<nz-option [nzValue]="deliverer.id" [nzLabel]="deliverer.transporter"></nz-option>
}
@@ -10,7 +10,7 @@ import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs";
@Component({
selector: 'app-deliverery-note-form',
selector: 'app-deliverery-note-form',
imports: [
NzFormItemComponent,
NzFormLabelComponent,
@@ -23,14 +23,14 @@ import {firstValueFrom} from "rxjs";
NzSelectComponent,
NzOptionComponent,
],
templateUrl: './deliverery-note-form.html',
styleUrl: './deliverery-note-form.css',
templateUrl: './deliverery-note-form.html',
styleUrl: './deliverery-note-form.css',
})
export class DelivereryNoteForm implements OnInit {
deliveryNoteForm: FormGroup = new FormGroup({
trackingNumber: new FormControl<string>(null),
delivererId: new FormControl<number>(null,[Validators.required]),
expeditionDate: new FormControl(null,[Validators.required]),
delivererId: new FormControl<number>(null, [Validators.required]),
expeditionDate: new FormControl(null, [Validators.required]),
estimatedDate: new FormControl(null),
realDeliveryDate: new FormControl(null)
})
@@ -56,7 +56,8 @@ export class DelivereryNoteForm implements OnInit {
return option.nzLabel.toLowerCase().includes(input.toLowerCase());
}
deliveryNote= input<GetDeliveryNoteDto>();
deliveryNote = input<GetDeliveryNoteDto>();
constructor() {
effect(() => {
if (this.deliveryNote()) {
@@ -6,7 +6,7 @@ nz-table {
background: #fff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
@@ -66,18 +66,21 @@ nz-table tbody td p {
nz-table thead {
display: none;
}
nz-table tbody tr {
display: block;
margin-bottom: 16px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
border-radius: 8px;
padding: 12px;
}
nz-table tbody td {
display: flex;
justify-content: space-between;
padding: 6px 12px;
}
nz-table tbody td::before {
content: attr(data-label);
font-weight: 600;
@@ -1,34 +1,38 @@
<nz-table [nzData]="deliveryNotes()"
class="mr-7"
[nzFrontPagination]="false"
[nzLoading]="deliveryNotesLoading()">
<nz-table [nzData]="deliveryNotes()"
class="mr-7"
[nzFrontPagination]="false"
[nzLoading]="deliveryNotesLoading()">
<thead>
<tr class="text-center">
<th>Numéro de livraison</th>
<th>Transporteur</th>
<th>Date d'expédition</th>
<th>Date de livraison estimée</th>
<th>Date de livraison réelle</th>
<th>Action</th>
</tr>
</thead >
<tr class="text-center">
<th>Numéro de livraison</th>
<th>Transporteur</th>
<th>Date d'expédition</th>
<th>Date de livraison estimée</th>
<th>Date de livraison réelle</th>
<th>Action</th>
</tr>
</thead>
<tbody class="text-center">
@for (deliveryNote of deliveryNotes(); track deliveryNote.id) {
<tr>
<td>{{deliveryNote.trackingNumber}}</td>
<td>{{deliveryNote.delivererTransporter}}</td>
<td>{{deliveryNote.expeditionDate | date: 'dd/MM/yyyy'}}</td>
<td>{{deliveryNote.estimateDeliveryDate | date: 'dd/MM/yyyy'}}</td>
<td>{{deliveryNote.realDeliveryDate | date: 'dd/MM/yyyy'}}</td>
<td>{{ deliveryNote.trackingNumber }}</td>
<td>{{ deliveryNote.delivererTransporter }}</td>
<td>{{ deliveryNote.expeditionDate | date: 'dd/MM/yyyy' }}</td>
<td>{{ deliveryNote.estimateDeliveryDate | date: 'dd/MM/yyyy' }}</td>
<td>{{ deliveryNote.realDeliveryDate | date: 'dd/MM/yyyy' }}</td>
<td>
<div style="justify-content: center; display: flex">
<nz-icon nzType="check" nzTheme="outline" (click)="validate(deliveryNote.id)" class="cursor-pointer text-green-700"/>
<nz-icon nzType="check" nzTheme="outline" (click)="validate(deliveryNote.id)"
class="cursor-pointer text-green-700"/>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" (click)="openEditModal(deliveryNote)"></nz-icon>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(deliveryNote)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(deliveryNote.id)" class="cursor-pointer text-red-700"/>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(deliveryNote.id)"
class="cursor-pointer text-red-700"/>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="export" nzTheme="outline" (click)="export(deliveryNote.id)" class="cursor-pointer text-green-700"/>
<nz-icon nzType="export" nzTheme="outline" (click)="export(deliveryNote.id)"
class="cursor-pointer text-green-700"/>
</div>
</td>
</tr>
@@ -37,7 +41,9 @@
</nz-table>
<div class="hidden">
<app-modal-nav #modalNav nameIcon="edit" [name]="'Modifier un bon de livraison'" (ok)="onModalOk(selectedDeliveryNote.id, deliveryNoteForm, modalNav)" (cancel)="onModalCancel(modalNav)">
<app-modal-nav #modalNav nameIcon="edit" [name]="'Modifier un bon de livraison'"
(ok)="onModalOk(selectedDeliveryNote.id, deliveryNoteForm, modalNav)"
(cancel)="onModalCancel(modalNav)">
<app-deliverery-note-form #deliveryNoteForm [deliveryNote]="selectedDeliveryNote"></app-deliverery-note-form>
</app-modal-nav>
</div>
@@ -12,7 +12,7 @@ import {format} from "date-fns";
import {FileService} from "../../services/file.service";
@Component({
selector: 'app-deliverery-note-table',
selector: 'app-deliverery-note-table',
imports: [
ModalNav,
NzDividerComponent,
@@ -21,8 +21,8 @@ import {FileService} from "../../services/file.service";
DelivereryNoteForm,
DatePipe,
],
templateUrl: './deliverery-note-table.html',
styleUrl: './deliverery-note-table.css',
templateUrl: './deliverery-note-table.html',
styleUrl: './deliverery-note-table.css',
})
export class DelivereryNoteTable implements OnInit {
private deliveryNotesService = inject(DeliverynotesService);
@@ -50,7 +50,7 @@ export class DelivereryNoteTable implements OnInit {
this.deliveryNotesLoading.set(false)
}
async delete(deliveryNote:number) {
async delete(deliveryNote: number) {
this.deliveryNotesLoading.set(true)
try {
await firstValueFrom(this.deliveryNotesService.deleteDeliveryNoteEndpoint(deliveryNote));
@@ -68,7 +68,7 @@ export class DelivereryNoteTable implements OnInit {
await this.fetchDeliveryNotes();
}
async validate(deliveryNote:number) {
async validate(deliveryNote: number) {
this.deliveryNotesLoading.set(true)
try {
const PatchRealDate = {
@@ -156,8 +156,9 @@ export class DelivereryNoteTable implements OnInit {
}
selectedDeliveryNote: GetDeliveryNoteDto | null = null;
openEditModal(deliveryNote: GetDeliveryNoteDto) {
this.selectedDeliveryNote = { ...deliveryNote };
this.selectedDeliveryNote = {...deliveryNote};
this.modal().showModal();
}
@@ -12,10 +12,9 @@
align-items: flex-start;
/* Box shadow pour effet superposition */
box-shadow:
0 4px 8px rgba(0, 0, 0, 0.06),
0 8px 20px rgba(0, 0, 0, 0.08),
0 16px 40px rgba(0, 0, 0, 0.06);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06),
0 8px 20px rgba(0, 0, 0, 0.08),
0 16px 40px rgba(0, 0, 0, 0.06);
}
@@ -32,7 +31,7 @@
.search-input:focus {
border-color: #3b82f6;
box-shadow: 0 0 8px rgba(59,130,246,0.2);
box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
outline: none;
}
@@ -40,7 +39,7 @@
.livraisons-list {
width: 100%;
max-height: 350px; /* hauteur max de la liste */
overflow-y: auto; /* scroll vertical activé */
overflow-y: auto; /* scroll vertical activé */
padding-right: 10px; /* pour le scrollbar */
}
@@ -63,7 +62,7 @@
background: #ffffff;
padding: 20px 22px;
border-radius: 14px;
box-shadow: 0 6px 16px rgba(0,0,0,0.05);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
display: flex;
justify-content: space-between;
align-items: center;
@@ -74,7 +73,7 @@
.livraison-card:hover {
transform: translateY(-3px);
box-shadow: 0 10px 22px rgba(0,0,0,0.08);
box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}
/* Infos livraison */
@@ -1,5 +1,6 @@
<div class="livraisons-container">
<input type="text" placeholder="Rechercher une livraison" class="search-input" (input)="search.set($any($event.target).value)"/>
<input type="text" placeholder="Rechercher une livraison" class="search-input"
(input)="search.set($any($event.target).value)"/>
<div class="livraisons-list">
@for (deliveryItem of filteredLivraisons(); track deliveryItem.id) {
@@ -11,7 +12,7 @@
</div>
<button nz-button nzType="primary" [nzSize]="size" nzShape="round" (click)="validate(deliveryItem.id)">
<nz-icon nzType="check" />
<nz-icon nzType="check"/>
Valider
</button>
</div>
@@ -3,31 +3,31 @@ import {NzButtonComponent, NzButtonSize} from "ng-zorro-antd/button";
import {NzIconDirective} from "ng-zorro-antd/icon";
@Component({
selector: 'app-delivery-validator',
selector: 'app-delivery-validator',
imports: [
NzButtonComponent,
NzIconDirective
],
templateUrl: './delivery-validator.html',
styleUrl: './delivery-validator.css',
templateUrl: './delivery-validator.html',
styleUrl: './delivery-validator.css',
})
export class DeliveryValidator {
size: NzButtonSize = 'large';
search = signal('');
livraisons = signal([
{ id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12 },
{ id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8 },
{ id: 3, client: 'Auchan', date: '2025-02-05', produits: 23 },
{ id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12 },
{ id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8 },
{ id: 3, client: 'Auchan', date: '2025-02-05', produits: 23 },
{ id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12 },
{ id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8 },
{ id: 3, client: 'Auchan', date: '2025-02-05', produits: 23 },
{ id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12 },
{ id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8 },
{ id: 3, client: 'Auchan', date: '2025-02-05', produits: 23 }
{id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12},
{id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8},
{id: 3, client: 'Auchan', date: '2025-02-05', produits: 23},
{id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12},
{id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8},
{id: 3, client: 'Auchan', date: '2025-02-05', produits: 23},
{id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12},
{id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8},
{id: 3, client: 'Auchan', date: '2025-02-05', produits: 23},
{id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12},
{id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8},
{id: 3, client: 'Auchan', date: '2025-02-05', produits: 23}
]);
filteredLivraisons = computed(() => {
+2 -2
View File
@@ -1,7 +1,7 @@
<div class="card-content">
<div class="card-top">
<nz-icon [ngStyle]="{ 'color': color() }" [nzType]="icon()" nzTheme="outline"></nz-icon>
<p class="card-number">{{value()}}</p>
<p class="card-number">{{ value() }}</p>
</div>
<p class="card-text">{{description()}}</p>
<p class="card-text">{{ description() }}</p>
</div>
+3 -3
View File
@@ -3,13 +3,13 @@ import {NzIconDirective} from "ng-zorro-antd/icon";
import {NgStyle} from "@angular/common";
@Component({
selector: 'app-info-card',
selector: 'app-info-card',
imports: [
NzIconDirective,
NgStyle
],
templateUrl: './info-card.html',
styleUrl: './info-card.css',
templateUrl: './info-card.html',
styleUrl: './info-card.css',
})
export class InfoCard {
icon = input.required<string>()
+5 -6
View File
@@ -26,10 +26,9 @@
gap: 16px;
padding: 30px 15px;
border-radius: 20px;
box-shadow:
0 4px 8px rgba(0, 0, 0, 0.06),
0 8px 20px rgba(0, 0, 0, 0.08),
0 16px 40px rgba(0, 0, 0, 0.06);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06),
0 8px 20px rgba(0, 0, 0, 0.08),
0 16px 40px rgba(0, 0, 0, 0.06);
max-height: 390px;
overflow-y: auto;
}
@@ -46,14 +45,14 @@
background: #ffffff;
border-radius: 14px;
cursor: pointer;
box-shadow: 0 6px 16px rgba(0,0,0,0.08);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
transition: all 0.2s ease;
text-align: center;
}
.content > div:hover {
transform: translateY(-3px);
box-shadow: 0 10px 22px rgba(0,0,0,0.12);
box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}
.content img {
+25 -25
View File
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import {Component} from '@angular/core';
interface PurchaseOrder {
id: number;
@@ -12,30 +12,30 @@ interface PurchaseOrder {
})
export class InfoTable {
docs: PurchaseOrder[] = [
{ id: 1, name: 'Bon de commande'},
{ id: 2, name: 'Bon de commande'},
{ id: 3, name: 'Bon de commande'},
{ id: 1, name: 'Bon de commande'},
{ id: 2, name: 'Bon de commande'},
{ id: 3, name: 'Bon de commande'},
{ id: 1, name: 'Bon de commande'},
{ id: 2, name: 'Bon de commande'},
{ id: 3, name: 'Bon de commande'},
{ id: 1, name: 'Bon de commande'},
{ id: 2, name: 'Bon de commande'},
{ id: 3, name: 'Bon de commande'},
{ id: 1, name: 'Bon de commande'},
{ id: 2, name: 'Bon de commande'},
{ id: 3, name: 'Bon de commande'},
{ id: 1, name: 'Bon de commande'},
{ id: 2, name: 'Bon de commande'},
{ id: 3, name: 'Bon de commande'},
{ id: 1, name: 'Bon de commande'},
{ id: 2, name: 'Bon de commande'},
{ id: 3, name: 'Bon de commande'},
{ id: 1, name: 'Bon de commande'},
{ id: 2, name: 'Bon de commande'},
{ id: 3, name: 'Bon de commande'},
{id: 1, name: 'Bon de commande'},
{id: 2, name: 'Bon de commande'},
{id: 3, name: 'Bon de commande'},
{id: 1, name: 'Bon de commande'},
{id: 2, name: 'Bon de commande'},
{id: 3, name: 'Bon de commande'},
{id: 1, name: 'Bon de commande'},
{id: 2, name: 'Bon de commande'},
{id: 3, name: 'Bon de commande'},
{id: 1, name: 'Bon de commande'},
{id: 2, name: 'Bon de commande'},
{id: 3, name: 'Bon de commande'},
{id: 1, name: 'Bon de commande'},
{id: 2, name: 'Bon de commande'},
{id: 3, name: 'Bon de commande'},
{id: 1, name: 'Bon de commande'},
{id: 2, name: 'Bon de commande'},
{id: 3, name: 'Bon de commande'},
{id: 1, name: 'Bon de commande'},
{id: 2, name: 'Bon de commande'},
{id: 3, name: 'Bon de commande'},
{id: 1, name: 'Bon de commande'},
{id: 2, name: 'Bon de commande'},
{id: 3, name: 'Bon de commande'},
];
purchaseOrder(): PurchaseOrder[] {
@@ -1,4 +1,4 @@
<button nz-button [nzType]="type()" (click)="showModal()">{{name()}}</button>
<button nz-button [nzType]="type()" (click)="showModal()">{{ name() }}</button>
<ng-template #modalContent>
<ng-content></ng-content>
+2 -2
View File
@@ -1,6 +1,6 @@
import {Component, Input, input, output} from '@angular/core';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzModalModule } from 'ng-zorro-antd/modal';
import {NzButtonModule} from 'ng-zorro-antd/button';
import {NzModalModule} from 'ng-zorro-antd/modal';
import {NzIconDirective} from "ng-zorro-antd/icon";
@Component({
@@ -1,34 +0,0 @@
<div class="ml-90">
<p class="cursor-pointer text-red-700" (click)="delete()">
<nz-icon nzType="delete" nzTheme="outline"/> Tout supprimer
</p>
</div>
<nz-list nzItemLayout="vertical" class="max-w-xl mx-auto max-h-[400px] overflow-y-auto border border-gray-200 rounded-lg">
@for (item of notifList; track item) {
<nz-list-item class="flex items-start p-4 border-b border-gray-200">
<nz-list-item-meta class="flex-1">
<nz-list-item-meta-avatar>
<img src="https://cdn-icons-png.flaticon.com/512/1/1176.png" alt="info" class="w-10 h-10 rounded-full mt-10 mr-2 w-10">
</nz-list-item-meta-avatar>
<nz-list-item-meta-title>
<p class="font-semibold mb-1">{{item.title}}</p>
<p class="text-gray-500 mb-1">{{item.author}}</p>
</nz-list-item-meta-title>
<nz-list-item-meta-description>
<p>{{item.content}}</p>
</nz-list-item-meta-description>
</nz-list-item-meta>
<nz-list-item-extra>
<img src="https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png"
alt="logo"
class="w-35 object-contain mt-4">
</nz-list-item-extra>
</nz-list-item>
}
</nz-list>
@@ -1,92 +0,0 @@
import { Component } from '@angular/core';
import {NotifInfo} from "../../interfaces/notif.interface";
import {
NzListComponent,
NzListItemComponent,
NzListItemExtraComponent, NzListItemMetaAvatarComponent,
NzListItemMetaComponent, NzListItemMetaDescriptionComponent, NzListItemMetaTitleComponent
} from "ng-zorro-antd/list";
import {NzIconDirective} from "ng-zorro-antd/icon";
@Component({
selector: 'app-notif-list',
imports: [
NzListComponent,
NzListItemComponent,
NzListItemMetaComponent,
NzListItemExtraComponent,
NzListItemMetaDescriptionComponent,
NzListItemMetaAvatarComponent,
NzListItemMetaTitleComponent,
NzIconDirective
],
templateUrl: './notif-list.html',
styleUrl: './notif-list.css',
})
export class NotifList {
notifList: NotifInfo[] = [
{
author: 'Admin',
title: 'Information system',
content: 'L\'utilisateur à bien été crée.'
},
{
author: 'Admin',
title: 'Information system',
content: 'L\'utilisateur à bien été crée.'
},
{
author: 'Admin',
title: 'Information system',
content: 'L\'utilisateur à bien été crée.'
},
{
author: 'Admin',
title: 'Information system',
content: 'L\'utilisateur à bien été crée.'
},
{
author: 'Admin',
title: 'Information system',
content: 'L\'utilisateur à bien été crée.'
},
{
author: 'Admin',
title: 'Information system',
content: 'L\'utilisateur à bien été crée.'
},
{
author: 'Admin',
title: 'Information system',
content: 'L\'utilisateur à bien été crée.'
},
{
author: 'Admin',
title: 'Information system',
content: 'L\'utilisateur à bien été crée.'
},
{
author: 'Admin',
title: 'Information system',
content: 'L\'utilisateur à bien été crée.'
},
{
author: 'Admin',
title: 'Information system',
content: 'L\'utilisateur à bien été crée.'
},
{
author: 'Admin',
title: 'Information system',
content: 'L\'utilisateur à bien été crée.'
}
];
delete() {
this.notifList = [];
}
addContent(author: string, title: string, content: string) {
this.notifList.push({ author, title, content });
}
}
+5 -4
View File
@@ -7,7 +7,7 @@ import {NzInputDirective} from "ng-zorro-antd/input";
import {GetPriceDto, GetSupplierDto} from "../../services/api";
@Component({
selector: 'app-price-form',
selector: 'app-price-form',
imports: [
FormsModule,
NzColDirective,
@@ -19,15 +19,16 @@ import {GetPriceDto, GetSupplierDto} from "../../services/api";
NzInputDirective,
ReactiveFormsModule
],
templateUrl: './price-form.html',
styleUrl: './price-form.css',
templateUrl: './price-form.html',
styleUrl: './price-form.css',
})
export class PriceForm {
priceForm: FormGroup = new FormGroup({
price: new FormControl<string>(null, [Validators.required]),
})
price= input<GetPriceDto>();
price = input<GetPriceDto>();
constructor() {
effect(() => {
if (this.price()) {
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import {Component} from '@angular/core';
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms";
import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFlexDirective} from "ng-zorro-antd/flex";
@@ -6,7 +6,7 @@ import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabe
import {NzInputDirective} from "ng-zorro-antd/input";
@Component({
selector: 'app-product-form',
selector: 'app-product-form',
imports: [
FormsModule,
NzColDirective,
@@ -18,8 +18,8 @@ import {NzInputDirective} from "ng-zorro-antd/input";
NzInputDirective,
ReactiveFormsModule
],
templateUrl: './product-form.html',
styleUrl: './product-form.css',
templateUrl: './product-form.html',
styleUrl: './product-form.css',
})
export class ProductForm {
productForm: FormGroup = new FormGroup({
@@ -1,9 +1,10 @@
import { Component } from '@angular/core';
import {Component} from '@angular/core';
@Component({
selector: 'app-product-table',
imports: [],
templateUrl: './product-table.html',
styleUrl: './product-table.css',
selector: 'app-product-table',
imports: [],
templateUrl: './product-table.html',
styleUrl: './product-table.css',
})
export class ProductTable {}
export class ProductTable {
}
@@ -8,7 +8,7 @@ import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {GetUserDto} from "../../services/api";
@Component({
selector: 'app-profil-form',
selector: 'app-profil-form',
imports: [
FormsModule,
NzColDirective,
@@ -22,8 +22,8 @@ import {GetUserDto} from "../../services/api";
NzSelectComponent,
NzOptionComponent
],
templateUrl: './profil-form.html',
styleUrl: './profil-form.css',
templateUrl: './profil-form.html',
styleUrl: './profil-form.css',
})
export class ProfilForm {
profilForm: FormGroup = new FormGroup({
@@ -34,6 +34,7 @@ export class ProfilForm {
})
user = input<GetUserDto>();
constructor() {
effect(() => {
if (this.user()) {
+3 -3
View File
@@ -9,7 +9,7 @@
</div>
<div class="mt-6">
<p class="text-3xl festive2 mx-auto flex items-center justify-center">{{data.name}}</p>
<p class="text-xl festive2 mt-0 flex items-center justify-center">{{data.email}}</p>
<p class="text-xl festive2 mt-0 flex items-center justify-center">{{data.fonction}}</p>
<p class="text-3xl festive2 mx-auto flex items-center justify-center">{{ data.name }}</p>
<p class="text-xl festive2 mt-0 flex items-center justify-center">{{ data.email }}</p>
<p class="text-xl festive2 mt-0 flex items-center justify-center">{{ data.fonction }}</p>
</div>
+9 -9
View File
@@ -1,24 +1,24 @@
import { Component } from '@angular/core';
import {Component} from '@angular/core';
import {UserInfo} from "../../interfaces/user.interface";
import {ProfilForm} from "../profil-form/profil-form";
import {ModalNav} from "../modal-nav/modal-nav";
@Component({
selector: 'app-profil',
selector: 'app-profil',
imports: [
ProfilForm,
ModalNav
],
templateUrl: './profil.html',
styleUrl: './profil.css',
templateUrl: './profil.html',
styleUrl: './profil.css',
})
export class Profil {
data: UserInfo =
{
name: 'Mathys Sanchez Vendé',
email: 'mathys.sanchez@vende.fr',
fonction: 'admin',
};
{
name: 'Mathys Sanchez Vendé',
email: 'mathys.sanchez@vende.fr',
fonction: 'admin',
};
getInitial(name: string): string {
if (!name || name.trim() === '') return '?';
@@ -7,7 +7,7 @@ import {NzInputDirective} from "ng-zorro-antd/input";
import {GetPurchaseOrderDto} from "../../services/api";
@Component({
selector: 'app-purchase-order-form',
selector: 'app-purchase-order-form',
imports: [
FormsModule,
NzColDirective,
@@ -19,15 +19,16 @@ import {GetPurchaseOrderDto} from "../../services/api";
NzInputDirective,
ReactiveFormsModule
],
templateUrl: './purchase-order-form.html',
styleUrl: './purchase-order-form.css',
templateUrl: './purchase-order-form.html',
styleUrl: './purchase-order-form.css',
})
export class PurchaseOrderForm {
purchaseOrderForm: FormGroup = new FormGroup({
purchaseConditions: new FormControl<string>(null,[Validators.required])
purchaseConditions: new FormControl<string>(null, [Validators.required])
})
purchaseOrder= input<GetPurchaseOrderDto>();
purchaseOrder = input<GetPurchaseOrderDto>();
constructor() {
effect(() => {
if (this.purchaseOrder()) {
@@ -6,7 +6,7 @@ nz-table {
background: #fff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
@@ -66,18 +66,21 @@ nz-table tbody td p {
nz-table thead {
display: none;
}
nz-table tbody tr {
display: block;
margin-bottom: 16px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
border-radius: 8px;
padding: 12px;
}
nz-table tbody td {
display: flex;
justify-content: space-between;
padding: 6px 12px;
}
nz-table tbody td::before {
content: attr(data-label);
font-weight: 600;
@@ -15,7 +15,7 @@
@for (purchaseOrder of purchaseOrders(); track purchaseOrder.id) {
<tr>
<td>{{ purchaseOrder.id }}</td>
<td>{{purchaseOrder.purchaseConditions}}</td>
<td>{{ purchaseOrder.purchaseConditions }}</td>
<td>Fournisseur ???</td>
<td>
<app-modal-button type="link" name="Voir les produits" size="45%">
@@ -34,15 +34,18 @@
<tbody class="text-center">
@for (product of purchaseOrder.products; track product.productId) {
<tr>
<td>{{product.productName}}</td>
<td>{{product.productReferences}}</td>
<td>{{ product.productName }}</td>
<td>{{ product.productReferences }}</td>
<td>Prix €€€€</td>
<td>{{product.quantity}}</td>
<td>{{ product.quantity }}</td>
<td>
<div style="justify-content: center; display: flex">
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" (click)="openEditQuantityModal(product)"></nz-icon>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditQuantityModal(product)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" class="cursor-pointer text-red-700" (click)="deleteProduct(product.productId, purchaseOrder.id)"/>
<nz-icon nzType="delete" nzTheme="outline"
class="cursor-pointer text-red-700"
(click)="deleteProduct(product.productId, purchaseOrder.id)"/>
</div>
</td>
</tr>
@@ -56,13 +59,17 @@
<div style="justify-content: center; display: flex">
<nz-icon nzType="plus-circle" nzTheme="outline" class="cursor-pointer text-green-700"/>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" (click)="openEditModal(purchaseOrder)"></nz-icon>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(purchaseOrder)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(purchaseOrder.id)" class="cursor-pointer text-red-700"/>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(purchaseOrder.id)"
class="cursor-pointer text-red-700"/>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="export" nzTheme="outline" (click)="export(purchaseOrder.id)" class="cursor-pointer text-green-700"/>
<nz-icon nzType="export" nzTheme="outline" (click)="export(purchaseOrder.id)"
class="cursor-pointer text-green-700"/>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="interaction" nzTheme="outline" (click)="transfer(purchaseOrder)" class="cursor-pointer text-blue-700"/>
<nz-icon nzType="interaction" nzTheme="outline" (click)="transfer(purchaseOrder)"
class="cursor-pointer text-blue-700"/>
</div>
</td>
</tr>
@@ -71,13 +78,17 @@
</nz-table>
<div class="hidden">
<app-modal-nav #modalNav nameIcon="edit" [name]="'Modification des conditions de vente'" (ok)="onModalOk(selectedPurchaseOrder.id, purchaseOrderForm, modalNav)" (cancel)="onModalCancel(modalNav)">
<app-modal-nav #modalNav nameIcon="edit" [name]="'Modification des conditions de vente'"
(ok)="onModalOk(selectedPurchaseOrder.id, purchaseOrderForm, modalNav)"
(cancel)="onModalCancel(modalNav)">
<app-purchase-order-form #purchaseOrderForm [purchaseOrder]="selectedPurchaseOrder"></app-purchase-order-form>
</app-modal-nav>
</div>
<div class="hidden">
<app-modal-nav #modalQuantity nameIcon="edit" [name]="'Modification de la quantité'" (ok)="onModalQuantityOk(selectedQuantity.productId, selectedQuantity.purchaseOrderId, quantityForm, modalQuantity)" (cancel)="onModalCancel(modalQuantity)">
<app-modal-nav #modalQuantity nameIcon="edit" [name]="'Modification de la quantité'"
(ok)="onModalQuantityOk(selectedQuantity.productId, selectedQuantity.purchaseOrderId, quantityForm, modalQuantity)"
(cancel)="onModalCancel(modalQuantity)">
<app-quantity-form #quantityForm [quantity]="selectedQuantity"></app-quantity-form>
</app-modal-nav>
</div>
@@ -21,7 +21,7 @@ import {QuantityForm} from "../quantity-form/quantity-form";
import {PurchaseOrder} from "../../pages/purchase-order/purchase-order";
@Component({
selector: 'app-purchase-order-table',
selector: 'app-purchase-order-table',
imports: [
ModalNav,
NzDividerComponent,
@@ -31,8 +31,8 @@ import {PurchaseOrder} from "../../pages/purchase-order/purchase-order";
ModalButton,
QuantityForm,
],
templateUrl: './purchase-order-table.html',
styleUrl: './purchase-order-table.css',
templateUrl: './purchase-order-table.html',
styleUrl: './purchase-order-table.css',
})
export class PurchaseOrderTable implements OnInit {
private purchaseOrdersService = inject(PurchaseordersService);
@@ -64,7 +64,7 @@ export class PurchaseOrderTable implements OnInit {
this.purchaseOrdersLoading.set(false)
}
async delete(purchaseOrderId:number) {
async delete(purchaseOrderId: number) {
this.purchaseOrdersLoading.set(true)
try {
await firstValueFrom(this.purchaseOrdersService.deletePurchaseOrderEndpoint(purchaseOrderId))
@@ -82,7 +82,7 @@ export class PurchaseOrderTable implements OnInit {
await this.fetchPurchaseOrder();
}
async export(purchaseOrderId: number){
async export(purchaseOrderId: number) {
this.purchaseOrdersLoading.set(true)
try {
const pdf = await firstValueFrom(
@@ -119,7 +119,7 @@ export class PurchaseOrderTable implements OnInit {
const productQuantities: Record<number, number> = {};
purchaseOrder.products?.forEach(p => {
if(p.productId != null && p.quantity != null) {
if (p.productId != null && p.quantity != null) {
productQuantities[p.productId] = p.quantity;
}
});
@@ -199,8 +199,9 @@ export class PurchaseOrderTable implements OnInit {
}
selectedPurchaseOrder: GetPurchaseOrderDto | null = null;
openEditModal(purchaseOrder: GetPurchaseOrderDto) {
this.selectedPurchaseOrder = { ...purchaseOrder };
this.selectedPurchaseOrder = {...purchaseOrder};
this.modal().showModal();
}
@@ -218,8 +219,9 @@ export class PurchaseOrderTable implements OnInit {
}
selectedQuantity: GetPurchaseProductDto | null = null;
openEditQuantityModal(quantity: GetPurchaseProductDto) {
this.selectedQuantity = { ...quantity };
this.selectedQuantity = {...quantity};
this.modalQuantity().showModal();
}
@@ -7,7 +7,7 @@ import {NzInputDirective} from "ng-zorro-antd/input";
import {GetDelivererDto, GetPurchaseProductDto} from "../../services/api";
@Component({
selector: 'app-quantity-form',
selector: 'app-quantity-form',
imports: [
FormsModule,
NzColDirective,
@@ -19,15 +19,16 @@ import {GetDelivererDto, GetPurchaseProductDto} from "../../services/api";
NzInputDirective,
ReactiveFormsModule
],
templateUrl: './quantity-form.html',
styleUrl: './quantity-form.css',
templateUrl: './quantity-form.html',
styleUrl: './quantity-form.css',
})
export class QuantityForm {
quantityForm: FormGroup = new FormGroup({
quantity: new FormControl<number>(null, [Validators.required])
})
quantity= input<GetPurchaseProductDto>();
quantity = input<GetPurchaseProductDto>();
constructor() {
effect(() => {
if (this.quantity()) {
@@ -27,7 +27,8 @@ export class QuotationForm {
conditionsSale: new FormControl<string>(null, [Validators.required]),
})
quotation= input<GetQuotationDto>();
quotation = input<GetQuotationDto>();
constructor() {
effect(() => {
if (this.quotation()) {
@@ -6,7 +6,7 @@ nz-table {
background: #fff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
@@ -66,18 +66,21 @@ nz-table tbody td p {
nz-table thead {
display: none;
}
nz-table tbody tr {
display: block;
margin-bottom: 16px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
border-radius: 8px;
padding: 12px;
}
nz-table tbody td {
display: flex;
justify-content: space-between;
padding: 6px 12px;
}
nz-table tbody td::before {
content: attr(data-label);
font-weight: 600;
@@ -11,13 +11,13 @@
<th>Produit</th>
<th>Action</th>
</tr>
</thead >
</thead>
<tbody class="text-center">
@for (quotation of quotations(); track quotation.id) {
<tr>
<td>{{quotation.id}}</td>
<td>{{quotation.message}}</td>
<td>{{quotation.conditionsSale}}</td>
<td>{{ quotation.id }}</td>
<td>{{ quotation.message }}</td>
<td>{{ quotation.conditionsSale }}</td>
<td>
<app-modal-button type="link" name="Voir les produits" size="45%">
<div style="max-height: 400px; overflow-y: auto;">
@@ -40,9 +40,12 @@
<td>{{ product.quantity }}</td>
<td>
<div style="justify-content: center; display: flex">
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" (click)="openEditQuantityModal(product)"></nz-icon>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditQuantityModal(product)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" class="cursor-pointer text-red-700" (click)="deleteProduct(product.productId, quotation.id)"/>
<nz-icon nzType="delete" nzTheme="outline"
class="cursor-pointer text-red-700"
(click)="deleteProduct(product.productId, quotation.id)"/>
</div>
</td>
</tr>
@@ -54,13 +57,16 @@
</td>
<td>
<div style="justify-content: center; display: flex">
<nz-icon nzType="plus-circle" nzTheme="outline" class="cursor-pointer text-green-700" />
<nz-icon nzType="plus-circle" nzTheme="outline" class="cursor-pointer text-green-700"/>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" (click)="openEditModal(quotation)"></nz-icon>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(quotation)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" class="cursor-pointer text-red-700" (click)="delete(quotation.id)"/>
<nz-icon nzType="delete" nzTheme="outline" class="cursor-pointer text-red-700"
(click)="delete(quotation.id)"/>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="export" (click)="export(quotation.id)" nzTheme="outline" class="cursor-pointer text-green-700"/>
<nz-icon nzType="export" (click)="export(quotation.id)" nzTheme="outline"
class="cursor-pointer text-green-700"/>
</div>
</td>
</tr>
@@ -69,13 +75,16 @@
</nz-table>
<div class="hidden">
<app-modal-nav #modalNav nameIcon="edit" [name]="'Modification du devis'" (ok)="onModalOk(selectedQuotation.id, quotationForm, modalNav)" (cancel)="onModalCancel(modalNav)">
<app-modal-nav #modalNav nameIcon="edit" [name]="'Modification du devis'"
(ok)="onModalOk(selectedQuotation.id, quotationForm, modalNav)" (cancel)="onModalCancel(modalNav)">
<app-quotation-form #quotationForm [quotation]="selectedQuotation"></app-quotation-form>
</app-modal-nav>
</div>
<div class="hidden">
<app-modal-nav #modalQuantity nameIcon="edit" [name]="'Modification de la quantité'" (ok)="onModalQuantityOk(selectedQuantity.productId, selectedQuantity.quotationId, quantityForm, modalQuantity)" (cancel)="onModalCancel(modalQuantity)">
<app-modal-nav #modalQuantity nameIcon="edit" [name]="'Modification de la quantité'"
(ok)="onModalQuantityOk(selectedQuantity.productId, selectedQuantity.quotationId, quantityForm, modalQuantity)"
(cancel)="onModalCancel(modalQuantity)">
<app-quantity-form #quantityForm [quantity]="selectedQuantity"></app-quantity-form>
</app-modal-nav>
</div>
@@ -60,7 +60,7 @@ export class QuotationTable implements OnInit {
this.quotationsLoading.set(false)
}
async delete(quotation:number) {
async delete(quotation: number) {
this.quotationsLoading.set(true)
try {
await firstValueFrom(this.quotationsService.deleteQuotationEndpoint(quotation))
@@ -78,7 +78,7 @@ export class QuotationTable implements OnInit {
await this.fetchQuotations();
}
async export(quotationId: number){
async export(quotationId: number) {
this.quotationsLoading.set(true)
try {
const pdf = await firstValueFrom(
@@ -149,8 +149,9 @@ export class QuotationTable implements OnInit {
}
selectedQuotation: GetQuotationDto | null = null;
openEditModal(quotation: GetQuotationDto) {
this.selectedQuotation = { ...quotation };
this.selectedQuotation = {...quotation};
this.modal().showModal();
}
@@ -168,8 +169,9 @@ export class QuotationTable implements OnInit {
}
selectedQuantity: GetQuotationProductDto | null = null;
openEditQuantityModal(quantity: GetQuotationProductDto) {
this.selectedQuantity = { ...quantity };
this.selectedQuantity = {...quantity};
this.modalQuantity().showModal();
}
+4 -4
View File
@@ -1,4 +1,4 @@
import { Component, output } from '@angular/core';
import {Component, output} from '@angular/core';
import {NzIconDirective} from "ng-zorro-antd/icon";
import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFlexDirective} from "ng-zorro-antd/flex";
@@ -6,7 +6,7 @@ import {NzFormControlComponent, NzFormDirective, NzFormItemComponent} from "ng-z
import {FormControl, FormGroup, ReactiveFormsModule} from "@angular/forms";
@Component({
selector: 'app-search',
selector: 'app-search',
imports: [
NzIconDirective,
NzColDirective,
@@ -16,8 +16,8 @@ import {FormControl, FormGroup, ReactiveFormsModule} from "@angular/forms";
NzFormItemComponent,
ReactiveFormsModule
],
templateUrl: './search.html',
styleUrl: './search.css',
templateUrl: './search.html',
styleUrl: './search.css',
})
export class Search {
searchForm: FormGroup = new FormGroup({
@@ -10,7 +10,7 @@
<nz-form-item>
<nz-form-label nzSpan="9">Logo</nz-form-label>
<nz-form-control nzSpan="25">
<input nz-input type="file" formControlName="logo" />
<input nz-input type="file" formControlName="logo"/>
</nz-form-control>
</nz-form-item>
</div>
@@ -26,7 +26,7 @@
<nz-form-item>
<nz-form-label nzSpan="9">Signature</nz-form-label>
<nz-form-control nzSpan="25">
<input nz-input type="file" formControlName="signature" />
<input nz-input type="file" formControlName="signature"/>
</nz-form-control>
</nz-form-item>
</div>
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import {Component} from '@angular/core';
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from "@angular/forms";
import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
@@ -6,7 +6,7 @@ import {NzInputDirective} from "ng-zorro-antd/input";
import {SettingInfo} from "../../interfaces/setting.interface";
@Component({
selector: 'app-setting-form',
selector: 'app-setting-form',
imports: [
FormsModule,
NzColDirective,
@@ -17,8 +17,8 @@ import {SettingInfo} from "../../interfaces/setting.interface";
NzInputDirective,
ReactiveFormsModule
],
templateUrl: './setting-form.html',
styleUrl: './setting-form.css',
templateUrl: './setting-form.html',
styleUrl: './setting-form.css',
})
export class SettingForm {
settingForm: FormGroup = new FormGroup({
+5 -4
View File
@@ -7,7 +7,7 @@ import {NzFlexDirective} from "ng-zorro-antd/flex";
import {GetProductDto} from "../../services/api";
@Component({
selector: 'app-stock-form',
selector: 'app-stock-form',
imports: [
NzFormItemComponent,
NzFormLabelComponent,
@@ -18,8 +18,8 @@ import {GetProductDto} from "../../services/api";
ReactiveFormsModule,
NzFlexDirective
],
templateUrl: './stock-form.html',
styleUrl: './stock-form.css',
templateUrl: './stock-form.html',
styleUrl: './stock-form.css',
})
export class StockForm {
stockForm = new FormGroup({
@@ -27,7 +27,8 @@ export class StockForm {
minimalQuantity: new FormControl<number>(null, [Validators.required])
})
product= input<GetProductDto>();
product = input<GetProductDto>();
constructor() {
effect(() => {
if (this.product()) {
@@ -6,7 +6,7 @@ nz-table {
background: #fff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
@@ -66,18 +66,21 @@ nz-table tbody td p {
nz-table thead {
display: none;
}
nz-table tbody tr {
display: block;
margin-bottom: 16px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
border-radius: 8px;
padding: 12px;
}
nz-table tbody td {
display: flex;
justify-content: space-between;
padding: 6px 12px;
}
nz-table tbody td::before {
content: attr(data-label);
font-weight: 600;
@@ -1,8 +1,8 @@
<nz-table
[nzData]="filteredProducts()"
[nzFrontPagination]="false"
[nzLoading]="productsLoading()"
(nzCurrentPageDataChange)="onCurrentPageDataChange($event)"
[nzData]="filteredProducts()"
[nzFrontPagination]="false"
[nzLoading]="productsLoading()"
(nzCurrentPageDataChange)="onCurrentPageDataChange($event)"
>
<thead>
<tr class="text-center">
@@ -47,9 +47,11 @@
<td>{{ product.minimalQuantity }}</td>
<td>
<div style="justify-content: center; display: flex">
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" (click)="openEditModal(product)"></nz-icon>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(product)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(product.id)" class="text-red-600 cursor-pointer"></nz-icon>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(product.id)"
class="text-red-600 cursor-pointer"></nz-icon>
</div>
</td>
</tr>
@@ -58,7 +60,8 @@
</nz-table>
<div class="hidden">
<app-modal-nav #modalNav nameIcon="edit" [name]="'Modifier'" (ok)="onModalOk(selectedProduct.id, stockForm, modalNav)" (cancel)="onModalCancel(modalNav)">
<app-modal-nav #modalNav nameIcon="edit" [name]="'Modifier'"
(ok)="onModalOk(selectedProduct.id, stockForm, modalNav)" (cancel)="onModalCancel(modalNav)">
<app-stock-form #stockForm [product]="selectedProduct"></app-stock-form>
</app-modal-nav>
</div>
@@ -61,6 +61,7 @@ export class StockTable implements OnInit {
applySearch(query: string) {
this.searchQuery.set(query);
}
get hasSelection(): boolean {
return this.setOfCheckedId.size > 0;
}
@@ -122,7 +123,7 @@ export class StockTable implements OnInit {
const products = await firstValueFrom(this.productsService.getAllProductsEndpoint());
// transforme chaque produit en ProductWithQuantity
const productsWithQuantity: ProductWithQuantity[] = products.map(p => ({ ...p }));
const productsWithQuantity: ProductWithQuantity[] = products.map(p => ({...p}));
this.products.set(productsWithQuantity);
@@ -140,7 +141,7 @@ export class StockTable implements OnInit {
this.productsLoading.set(false);
}
async delete(productId:number) {
async delete(productId: number) {
try {
await firstValueFrom(this.productsService.deleteProductEndpoint(productId))
this.notificationService.success(
@@ -184,8 +185,9 @@ export class StockTable implements OnInit {
}
selectedProduct: GetProductDto | null = null;
openEditModal(product: GetProductDto) {
this.selectedProduct = { ...product};
this.selectedProduct = {...product};
this.modal().showModal();
}
@@ -33,7 +33,8 @@ export class SupplierForm {
})
supplier= input<GetSupplierDto>();
supplier = input<GetSupplierDto>();
constructor() {
effect(() => {
if (this.supplier()) {
@@ -6,7 +6,7 @@ nz-table {
background: #fff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
@@ -66,18 +66,21 @@ nz-table tbody td p {
nz-table thead {
display: none;
}
nz-table tbody tr {
display: block;
margin-bottom: 16px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
border-radius: 8px;
padding: 12px;
}
nz-table tbody td {
display: flex;
justify-content: space-between;
padding: 6px 12px;
}
nz-table tbody td::before {
content: attr(data-label);
font-weight: 600;
@@ -47,7 +47,8 @@
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"
<nz-icon nzType="delete" nzTheme="outline"
class="cursor-pointer text-red-600 hover:text-red-800"
(click)="deleteProduct(product.productId, product.supplierId)"></nz-icon>
</div>
</td>
@@ -96,12 +96,12 @@ export class SupplierTable implements OnInit {
}
openEditModal(supplier: GetSupplierDto) {
this.selectedSupplier = { ...supplier };
this.selectedSupplier = {...supplier};
this.supplierModal().showModal();
}
openEditProductModal(product: GetPriceDto, supplierId: number) {
this.selectedProduct = { ...product };
this.selectedProduct = {...product};
this.selectedProductSupplierId = supplierId;
this.productModal().showModal();
}
+5 -2
View File
@@ -6,7 +6,7 @@ nz-table {
background: #fff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
@@ -66,18 +66,21 @@ nz-table tbody td p {
nz-table thead {
display: none;
}
nz-table tbody tr {
display: block;
margin-bottom: 16px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
border-radius: 8px;
padding: 12px;
}
nz-table tbody td {
display: flex;
justify-content: space-between;
padding: 6px 12px;
}
nz-table tbody td::before {
content: attr(data-label);
font-weight: 600;
+10 -7
View File
@@ -2,7 +2,7 @@
[nzLoading]="usersLoading()"
[nzFrontPagination]="false"
class="mr-7">
<thead>
<thead>
<tr class="text-center">
<th>Prénom</th>
<th>Email</th>
@@ -13,15 +13,17 @@
<tbody class="text-center">
@for (user of users(); track user.id) {
<tr>
<td>{{user.name}}</td>
<td>{{user.email}}</td>
<td>{{user.fonction}}</td>
<td>{{ user.name }}</td>
<td>{{ user.email }}</td>
<td>{{ user.fonction }}</td>
<td>
<div style="justify-content: center; display: flex">
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" (click)="openEditModal(user)"></nz-icon>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(user)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<div>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(user.id)" class="cursor-pointer text-red-700"/>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(user.id)"
class="cursor-pointer text-red-700"/>
</div>
</div>
</td>
@@ -31,7 +33,8 @@
</nz-table>
<div class="hidden">
<app-modal-nav #modalNav nameIcon="edit" [name]="'Modifier'" (ok)="onModalOk(selectedUser.id, updateUser, modalNav)" (cancel)="onModalCancel(modalNav)">
<app-modal-nav #modalNav nameIcon="edit" [name]="'Modifier'" (ok)="onModalOk(selectedUser.id, updateUser, modalNav)"
(cancel)="onModalCancel(modalNav)">
<app-profil-form #updateUser [user]="selectedUser"></app-profil-form>
</app-modal-nav>
</div>
+8 -5
View File
@@ -9,7 +9,7 @@ import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs";
@Component({
selector: 'app-user-table',
selector: 'app-user-table',
imports: [
ModalNav,
NzIconDirective,
@@ -17,8 +17,8 @@ import {firstValueFrom} from "rxjs";
ProfilForm,
NzDividerComponent
],
templateUrl: './user-table.html',
styleUrl: './user-table.css',
templateUrl: './user-table.html',
styleUrl: './user-table.css',
})
export class UserTable implements OnInit {
private usersService = inject(UsersService);
@@ -47,7 +47,7 @@ export class UserTable implements OnInit {
this.usersLoading.set(false)
}
async delete(user:number) {
async delete(user: number) {
try {
await firstValueFrom(this.usersService.deleteUserEndpoint(user))
this.notificationService.success(
@@ -89,8 +89,9 @@ export class UserTable implements OnInit {
}
selectedUser: GetUserDto | null = null;
openEditModal(user: GetUserDto) {
this.selectedUser = { ...user };
this.selectedUser = {...user};
this.modal().showModal();
}
@@ -102,9 +103,11 @@ export class UserTable implements OnInit {
modal.isVisible = false;
await this.fetchUsers();
}
onModalCancel(modal: ModalNav) {
modal.isVisible = false;
}
filterUser(input: string, option: any) {
return option.nzLabel.toLowerCase().includes(input.toLowerCase());
}