508 lines
19 KiB
PHP
508 lines
19 KiB
PHP
<div class="modal fade" id="partsModal" tabindex="-1" aria-labelledby="partsModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-xl" style="max-width: 95vw !important;">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="partsModalLabel">Parti per TRF: <span id="trfHeader"></span></h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="row parts-row">
|
|
<div class="col-md-9">
|
|
<!-- Prima riga: Elenco Parti, Rinumera, Voce -->
|
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
|
|
<h6 style="margin: 0;">Elenco Parti</h6>
|
|
<div style="display: flex; align-items: center;">
|
|
<button type="button" class="btn btn-info btn-sm" id="renumberPartsBtn" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">Rinumera Parti</button>
|
|
<button type="button" class="btn btn-secondary btn-sm ms-2" id="toggleVoiceBtn" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;"><i class="fas fa-microphone"></i> Voce</button>
|
|
<button type="button" class="btn btn-info btn-sm ms-2 d-none" id="quotationeBtn" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">Add Quotation</button>
|
|
<button type="button" class="btn btn-primary btn-sm ms-2" id="showHideImageBtn" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">
|
|
<i class="fas fa-eye-slash" style="font-size: 0.8rem;"></i>
|
|
<i class="fas fa-image ms-1" style="font-size: 0.8rem;"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<!-- Seconda riga: +, M, MacroMatrice, Matrice globale, Propaga -->
|
|
<div style="display: flex; align-items: center; margin-bottom: 10px;">
|
|
<button type="button" class="btn btn-success btn-sm add-row-global" style="padding: 0.1rem 0.3rem; font-size: 0.8rem; margin-right: 5px;"><i class="fas fa-plus"></i></button>
|
|
<button type="button" class="btn btn-primary btn-sm add-mix-global" style="padding: 0.1rem 0.3rem; font-size: 0.8rem; margin-right: 10px;">M</button>
|
|
<select id="macro-matrice-filter" class="form-control form-control-sm ms-2" style="width: 200px !important; min-width: 200px !important; margin-right: 10px;">
|
|
<option value="">Tutte le MacroMatrici</option>
|
|
</select>
|
|
<select id="global-matrice" class="form-control form-control-sm" style="width: 350px !important; margin-right: 10px;"></select>
|
|
<button type="button" class="btn btn-primary btn-sm propagate-all-btn" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;"><i class="fas fa-arrow-right"></i> Propaga a tutte</button>
|
|
</div>
|
|
<table class="table table-striped table-sm" id="partsTable">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 55px;">Num</th>
|
|
<th>Descrizione</th>
|
|
<th style="width: 200px;">Matrice</th>
|
|
<th style="width: 150px;">
|
|
<input type="date" class="form-control form-control-sm propagate-date-input" style="width: 130px; margin-left: 5px; display: inline-block;" title="Propaga data a tutte le parti">
|
|
</th>
|
|
<th style="width: 200px;">
|
|
<button type="button" class="btn btn-light btn-sm propagate-note-btn" style="padding: 0.2rem 0.4rem; font-size: 0.9rem; margin-left: 5px;" title="Propaga nota a tutte le parti">
|
|
<i class="fas fa-sticky-note"></i>
|
|
</button>
|
|
Azioni
|
|
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="partsTableBody">
|
|
<tr data-part-id="new">
|
|
<td><input type="number" class="form-control form-control-sm part-number" value="1" style="width: 55px;"></td>
|
|
<td><input type="text" class="form-control form-control-sm part-description" placeholder="Inserisci descrizione"></td>
|
|
<td>
|
|
<div style="display: flex; align-items: center;">
|
|
<button type="button" class="btn btn-primary btn-sm propagate-matrice-btn" style="padding: 0.1rem 0.3rem; font-size: 0.8rem; margin-right: 3px;"><i class="fas fa-arrow-right"></i></button>
|
|
<select class="part-matrice form-control form-control-sm" style="width: 150px;"></select>
|
|
</div>
|
|
</td>
|
|
<td><input type="date" class="form-control form-control-sm part-dateexpiry" style="width: 130px;"></td>
|
|
<td>
|
|
<button type="button" class="btn btn-light btn-sm note-btn" style="padding: 0.2rem 0.4rem; font-size: 0.9rem;" title="Aggiungi/Modifica nota"><i class="fas fa-sticky-note"></i></button>
|
|
<button type="button" class="btn btn-warning btn-sm add-mix-row" style="padding: 0.1rem 0.3rem; font-size: 0.8rem;">M+</button>
|
|
<button type="button" class="btn btn-danger btn-sm remove-row" style="padding: 0.1rem 0.3rem; font-size: 0.8rem; display: none;"><i class="fas fa-trash"></i></button>
|
|
<span class="save-status text-success" style="display: none; margin-left: 5px;"><i class="fas fa-check"></i></span>
|
|
<span class="save-loading text-warning" style="display: none; margin-left: 5px;"><i class="fas fa-spinner fa-spin"></i></span>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<h6>Foto del Campione</h6>
|
|
<div style="display: flex; align-items: center; margin-bottom: 10px;">
|
|
<button type="button" class="btn btn-primary btn-sm" id="downloadPhotoBtn" style="padding: 0.1rem 0.5rem; font-size: 0.8rem; margin-right: 10px;"><i class="fas fa-download"></i></button>
|
|
<div id="photoSelectorContainer" style="display: none;"></div>
|
|
</div>
|
|
<div style="position: relative; width: 100%; min-height: 400px;">
|
|
<img id="samplePhoto" src="" alt="Foto del campione" style="max-width: 100%; max-height: 400px; object-fit: contain;">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-primary btn-sm" id="openAnnotationsBtn">Apri Annotazioni</button>
|
|
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Chiudi</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modale per la nota -->
|
|
<div class="modal fade" id="noteModal" tabindex="-1" aria-labelledby="noteModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-md">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="noteModalLabel">Nota per Parte</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<textarea class="form-control part-note" rows="5" placeholder="Inserisci una nota"></textarea>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Annulla</button>
|
|
<button type="button" class="btn btn-primary btn-sm save-note-btn">Salva</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="commonNoteModal" tabindex="-1" aria-labelledby="commonNoteModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="commonNoteModalLabel">Nota comune per tutte le parti</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<textarea class="form-control part-note" rows="4" placeholder="Inserisci nota comune"></textarea>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Chiudi</button>
|
|
<button type="button" class="btn btn-primary save-common-note-btn">Salva</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modale di conferma per l'eliminazione -->
|
|
<div class="modal fade" id="confirmDeleteModal" tabindex="-1" aria-labelledby="confirmDeleteModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-sm">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="confirmDeleteModalLabel">Conferma Eliminazione</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
Sei sicuro di voler eliminare questa parte?
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Annulla</button>
|
|
<button type="button" class="btn btn-danger btn-sm" id="confirmDeleteBtn">Elimina</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- Finestra modale "Aggiungi preventivo" -->
|
|
<div class="modal fade" id="addQuotationModal" tabindex="-1" aria-labelledby="addQuotationModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-md">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="addQuotationModalLabel">Choose a quotation</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<select id="addQuotationSelect" class="form-control form-control-sm" style="width: 100% !important; min-width: 100% !important"></select>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Annulla</button>
|
|
<button type="button" class="btn btn-primary btn-sm" id="addQuotationBtn">Confirm</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
/* --- Base --- */
|
|
#partsModal {
|
|
z-index: 1060 !important
|
|
}
|
|
|
|
#partsModal .modal-backdrop {
|
|
z-index: 1055 !important
|
|
}
|
|
|
|
#partsModal .modal-content {
|
|
width: 100% !important;
|
|
max-width: 100% !important
|
|
}
|
|
|
|
#addQuotationModal {
|
|
z-index: 1060 !important
|
|
}
|
|
|
|
#addQuotationModal .modal-backdrop {
|
|
z-index: 1055 !important
|
|
}
|
|
|
|
/* Fix: app.css sets .btn i { margin-top:-1em; margin-bottom:-1em; font-size:1.3rem } which collapses small icon buttons */
|
|
#partsModal .btn i {
|
|
margin-top: 0 !important;
|
|
margin-bottom: 0 !important;
|
|
font-size: 0.8rem !important;
|
|
margin-right: 2px !important;
|
|
}
|
|
|
|
/* Tabelle */
|
|
#partsTable tr {
|
|
display: table-row !important
|
|
}
|
|
|
|
#partsTable tr:hover {
|
|
background: #f5f5f5
|
|
}
|
|
|
|
#partsTable td,
|
|
#partsTable th {
|
|
padding: .2rem;
|
|
vertical-align: middle
|
|
}
|
|
|
|
#partsTable input,
|
|
#partsTable select {
|
|
height: 24px;
|
|
padding: .1rem .3rem
|
|
}
|
|
|
|
#partsTable button {
|
|
padding: .1rem .3rem;
|
|
margin: 0 2px
|
|
}
|
|
|
|
#partsTable i {
|
|
font-size: .6rem !important
|
|
}
|
|
|
|
/* --- Larghezze fisse header --- */
|
|
/* MacroMatrici = 250px */
|
|
#macro-matrice-filter {
|
|
width: 250px !important;
|
|
min-width: 250px !important;
|
|
max-width: 250px !important;
|
|
flex: 0 0 250px !important;
|
|
box-sizing: border-box;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
#macro-matrice-filter.select2-hidden-accessible+.select2 {
|
|
width: 250px !important;
|
|
min-width: 250px !important;
|
|
max-width: 250px !important;
|
|
flex: 0 0 250px !important;
|
|
}
|
|
|
|
#macro-matrice-filter.select2-hidden-accessible+.select2 .select2-selection__rendered {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* Matrice globale = 450px */
|
|
#global-matrice {
|
|
width: 450px !important;
|
|
min-width: 450px !important;
|
|
max-width: 450px !important;
|
|
flex: 0 0 450px !important;
|
|
box-sizing: border-box;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
#global-matrice.select2-hidden-accessible+.select2 {
|
|
width: 450px !important;
|
|
min-width: 450px !important;
|
|
max-width: 450px !important;
|
|
flex: 0 0 450px !important;
|
|
}
|
|
|
|
#global-matrice.select2-hidden-accessible+.select2 .select2-selection__rendered {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* Select delle righe (colonna Matrice) = 150px */
|
|
.part-matrice {
|
|
width: 300px !important;
|
|
min-width: 300px !important;
|
|
max-width: 300px !important;
|
|
flex: 0 0 300px !important;
|
|
}
|
|
|
|
.part-matrice.select2-hidden-accessible+.select2 {
|
|
width: 300px !important;
|
|
min-width: 300px !important;
|
|
max-width: 300px !important;
|
|
flex: 0 0 300px !important;
|
|
}
|
|
|
|
/* Colonna Descrizione (2ª colonna) = 420px */
|
|
#partsTable th:nth-child(2),
|
|
#partsTable td:nth-child(2) {
|
|
width: 300px !important;
|
|
min-width: 300px !important;
|
|
max-width: 300px !important;
|
|
}
|
|
|
|
#partsTable .part-number {
|
|
text-align: center;
|
|
}
|
|
|
|
#partsTable td:nth-child(2) .part-description {
|
|
width: 100% !important;
|
|
max-width: 100% !important;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* Aspetto Select2 */
|
|
.select2-container--default .select2-selection--single {
|
|
height: 24px !important;
|
|
padding: .1rem .3rem !important;
|
|
font-size: .8rem !important;
|
|
border: 1px solid #ced4da !important;
|
|
}
|
|
|
|
.select2-container--default .select2-selection__arrow {
|
|
height: 24px !important
|
|
}
|
|
|
|
.select2-container--open .select2-dropdown {
|
|
z-index: 1061 !important;
|
|
border: 1px solid #aaa !important;
|
|
border-radius: 4px !important;
|
|
background: #fff !important;
|
|
max-height: 200px !important;
|
|
overflow-y: auto !important;
|
|
}
|
|
|
|
/* Evita stretching del flex nella riga dei filtri */
|
|
#partsModal .modal-body>.row .col-md-9>div[style*="display: flex"]>* {
|
|
flex: 0 0 auto;
|
|
}
|
|
|
|
/* Altri modali e pulsanti */
|
|
.propagate-matrice-btn,
|
|
.propagate-all-btn {
|
|
padding: .1rem .3rem !important;
|
|
font-size: .8rem !important
|
|
}
|
|
|
|
.save-status,
|
|
.save-loading {
|
|
margin-left: 5px
|
|
}
|
|
|
|
#confirmDeleteModal {
|
|
z-index: 1070 !important
|
|
}
|
|
|
|
#confirmDeleteModal .modal-backdrop {
|
|
z-index: 1065 !important
|
|
}
|
|
|
|
.note-btn {
|
|
padding: .2rem .4rem !important;
|
|
font-size: .9rem !important
|
|
}
|
|
|
|
.note-btn.has-note {
|
|
color: #dc3545 !important
|
|
}
|
|
|
|
#noteModal {
|
|
z-index: 1090 !important
|
|
}
|
|
|
|
#noteModal .modal-backdrop {
|
|
z-index: 1085 !important
|
|
}
|
|
|
|
#noteModal .modal-dialog {
|
|
position: relative;
|
|
z-index: 1090 !important
|
|
}
|
|
|
|
#noteModal textarea,
|
|
#commonNoteModal textarea {
|
|
resize: vertical
|
|
}
|
|
|
|
#commonNoteModal {
|
|
z-index: 1095 !important
|
|
}
|
|
|
|
#commonNoteModal .modal-backdrop {
|
|
z-index: 1090 !important
|
|
}
|
|
|
|
#commonNoteModal .modal-dialog {
|
|
position: relative;
|
|
z-index: 1095 !important
|
|
}
|
|
|
|
/* Evidenza salvataggio riga nel parts table */
|
|
/* Aumenta la specificità per le classi di flash */
|
|
table#partsTable tr.row-saving {
|
|
background-color: #f0ad4e !important;
|
|
/* Arancione per salvataggio in corso */
|
|
transition: background-color 0.3s ease;
|
|
}
|
|
|
|
table#partsTable tr.row-success {
|
|
background-color: #5cb85c !important;
|
|
/* Verde per successo */
|
|
transition: background-color 0.3s ease;
|
|
}
|
|
|
|
table#partsTable tr.row-error {
|
|
background-color: #d9534f !important;
|
|
/* Rosso per errore */
|
|
transition: background-color 0.3s ease;
|
|
}
|
|
|
|
/* Stato base: nascosti (verrà sovrascritto dallo style inline di jQuery) */
|
|
#partsModal .save-loading,
|
|
#partsModal .save-status {
|
|
display: none;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 2px 8px;
|
|
border-radius: 999px;
|
|
font-weight: 700;
|
|
font-size: 12px;
|
|
line-height: 1.2;
|
|
margin-left: 5px;
|
|
}
|
|
|
|
/* Quando NON sono nascosti via style inline (jQuery .show()), forzali a inline-flex */
|
|
#partsModal .save-loading:not([style*="display: none"]),
|
|
#partsModal .save-status:not([style*="display: none"]) {
|
|
display: inline-flex;
|
|
}
|
|
|
|
/* Loading (giallo) */
|
|
/* Loading (giallo) */
|
|
#partsModal .save-loading {
|
|
background: #ffd753ff;
|
|
border: 1px solid #ffd042ff;
|
|
color: #111;
|
|
/* testo nero */
|
|
}
|
|
|
|
#partsModal .save-loading i {
|
|
color: #111;
|
|
}
|
|
|
|
/* icona nera */
|
|
|
|
#partsModal .save-loading::after {
|
|
content: " Salvataggio…";
|
|
color: #111;
|
|
}
|
|
|
|
/* Salvato (verde) */
|
|
#partsModal .save-status {
|
|
background: #5dff83ff;
|
|
border: 1px solid #4effafff;
|
|
color: #111;
|
|
/* testo nero */
|
|
}
|
|
|
|
#partsModal .save-status i {
|
|
color: #111;
|
|
}
|
|
|
|
/* icona nera */
|
|
#partsModal .save-status::after {
|
|
content: " Salvato";
|
|
color: #111;
|
|
}
|
|
|
|
/* Animazioni */
|
|
@keyframes pulse {
|
|
|
|
0%,
|
|
100% {
|
|
transform: scale(1);
|
|
opacity: .9
|
|
}
|
|
|
|
50% {
|
|
transform: scale(1.05);
|
|
opacity: 1
|
|
}
|
|
}
|
|
|
|
@keyframes pop {
|
|
0% {
|
|
transform: scale(.85);
|
|
opacity: 0
|
|
}
|
|
|
|
100% {
|
|
transform: scale(1);
|
|
opacity: 1
|
|
}
|
|
}
|
|
|
|
|
|
/* rosso */
|
|
</style> |