fix bijoux photo , wip numero de serie

This commit is contained in:
Tiavina 2025-01-29 16:21:45 +03:00
parent 1ec5af483c
commit 7dc7b556af
4 changed files with 8 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@ -73,7 +73,6 @@ window.addEventListener("DOMContentLoaded", function () {
var rapportSoinBtn = document.getElementById("rapportSoinBtn"); var rapportSoinBtn = document.getElementById("rapportSoinBtn");
var exportCareCertificateButton = document.getElementById("exportCareCertificate"); var exportCareCertificateButton = document.getElementById("exportCareCertificate");
var setDefuntCoverButton = this.document.getElementById("coverProductsRadioButton"); var setDefuntCoverButton = this.document.getElementById("coverProductsRadioButton");
var exportBijouxRapport = this.document.getElementById("exportBijouxRapport");
var showRapportBijouxExportModalButton = this.document.getElementById("showRapportBijouxExportModal"); var showRapportBijouxExportModalButton = this.document.getElementById("showRapportBijouxExportModal");
var closeRapportBijouxModalButton = this.document.getElementById("closeRapportBijouxModal"); var closeRapportBijouxModalButton = this.document.getElementById("closeRapportBijouxModal");
@ -85,8 +84,8 @@ window.addEventListener("DOMContentLoaded", function () {
$('#saveRapportBijouxModal').show(); $('#saveRapportBijouxModal').show();
}) })
exportBijouxRapport.addEventListener("click",function(){ $(document).on("click", "#exportBijouxRapport", function () {
const rapportWithPhotosRadio = document.getElementsByName('withProducts'); const rapportWithPhotosRadio = document.getElementsByName('withPhotos');
let selectedValue = "0"; let selectedValue = "0";
for (const radio of rapportWithPhotosRadio) { for (const radio of rapportWithPhotosRadio) {
if (radio.checked) { if (radio.checked) {
@ -99,7 +98,6 @@ window.addEventListener("DOMContentLoaded", function () {
withPhotos: selectedValue withPhotos: selectedValue
}); });
$('#saveRapportBijouxModal').hide(); $('#saveRapportBijouxModal').hide();
}); });
setDefuntCoverButton.addEventListener("click",function(){ setDefuntCoverButton.addEventListener("click",function(){
@ -128,13 +126,12 @@ window.addEventListener("DOMContentLoaded", function () {
saveRapportSoin({ numdefunt: defuntid }); saveRapportSoin({ numdefunt: defuntid });
}); });
$(".photoBijouUpload").on("change", function () { $(document).on("change", ".photoBijouUpload", function () {
let fileInput = this; let fileInput = this;
let file = fileInput.files[0]; let file = fileInput.files[0];
let bijouxId = $(this).data("id"); let bijouxId = $(this).data("id");
setBijouxPhoto(bijouxId,file); setBijouxPhoto(bijouxId,file);
getBijouxById(); });
})
}); });
function loadBibliotheques(response) { function loadBibliotheques(response) {

View File

@ -859,6 +859,7 @@ export function setBijouxPhoto(bijouxId,file) {
}).done(function (response) { }).done(function (response) {
if(response != null) { if(response != null) {
showSuccess('Sauvegardé dans' + response); showSuccess('Sauvegardé dans' + response);
getBijouxById();
return; return;
} }
showError(t('gestion', "Erreur dans l'assignation de photo sur ce bijou")); showError(t('gestion', "Erreur dans l'assignation de photo sur ce bijou"));

View File

@ -478,10 +478,10 @@
<div class="modal-body"> <div class="modal-body">
<div class="radio-group"> <div class="radio-group">
<label> <label>
<input type="radio" name="withProducts" value="1"> Avec photos <input type="radio" name="withPhotos" value="1"> Avec photos
</label> </label>
<label> <label>
<input type="radio" name="withProducts" value="0"> Sans photos <input type="radio" name="withPhotos" value="0"> Sans photos
</label> </label>
</div> </div>
</div> </div>