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

View File

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

View File

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