first of many

This commit is contained in:
2025-11-20 15:10:43 +01:00
parent 0d9238d1a1
commit e269848f82
8 changed files with 466 additions and 5 deletions

View File

@@ -0,0 +1,54 @@
import { Component } from '@angular/core';
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzInputDirective} from "ng-zorro-antd/input";
import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzDatePickerComponent} from "ng-zorro-antd/date-picker";
@Component({
selector: 'app-quotation-form',
imports: [
NzFormItemComponent,
NzFormLabelComponent,
NzFormControlComponent,
NzInputDirective,
NzColDirective,
NzFlexDirective,
NzFormDirective,
ReactiveFormsModule,
NzDatePickerComponent
],
templateUrl: './quotation-form.html',
styleUrl: './quotation-form.css',
})
export class QuotationForm {
QuotationForm: FormGroup = new FormGroup({
quantity: new FormControl<number>(null, [Validators.required]),
quotationId: new FormControl<number>(null),
quotationMessage: new FormControl<string>(null),
quotationConditionsSale: new FormControl<string>(null),
productId: new FormControl<number>(null),
productReferences: new FormControl<number>(null),
productName: new FormControl<string>(null),
productDuration: new FormControl<number>(null),
productCaliber: new FormControl<number>(null),
productApprovalNumber: new FormControl<number>(null),
productWeight: new FormControl<number>(null),
productNec: new FormControl<number>(null),
productImage: new FormControl<string>(null),
productLink: new FormControl<string>(null),
productMinimalQuantity: new FormControl<number>(null)
})
submitForm() {
// Pour annuler si le formulaire est invalide
if (this.QuotationForm.invalid) return;
// Pour obtenir la valeur du formulaire
console.log(this.QuotationForm.getRawValue())
// Pour vider le formulaire
this.QuotationForm.reset()
}
}