Corriger les dossiers animaux et le suivi médical
This commit is contained in:
parent
a55d27935f
commit
7b89fd5dfa
34 changed files with 440 additions and 39 deletions
|
|
@ -8,7 +8,7 @@
|
|||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-4"><label class="form-label">Catégorie</label><select class="form-select"
|
||||
name="category">
|
||||
name="category" id="surgeryCategory">
|
||||
<option value="orthopedic">Orthopédie</option>
|
||||
<option value="dental">Dentaire</option>
|
||||
<option value="soft_tissue">Viscérale / tissus mous</option>
|
||||
|
|
@ -20,8 +20,9 @@
|
|||
<option value="other">Autre</option>
|
||||
</select></div>
|
||||
<div class="col-md-8"><label class="form-label">Intitulé de l’intervention *</label><input
|
||||
class="form-control" name="procedure_name" required
|
||||
class="form-control" name="procedure_name" id="surgeryProcedure" list="surgeryProcedureList" required
|
||||
placeholder="Ex. ovariectomie, détartrage, ostéosynthèse…"></div>
|
||||
<datalist id="surgeryProcedureList"></datalist>
|
||||
<div class="col-md-4"><label class="form-label">Date *</label><input class="form-control"
|
||||
type="date" name="surgery_date" value="<?= h(date('Y-m-d')) ?>" required></div>
|
||||
<div class="col-md-4"><label class="form-label">Statut</label><select class="form-select"
|
||||
|
|
@ -29,7 +30,7 @@
|
|||
<option value="completed">Réalisée</option>
|
||||
<option value="planned">Planifiée</option>
|
||||
<option value="cancelled">Annulée</option>
|
||||
</select></div>
|
||||
</select><div class="form-hint">Les tarifs affichés correspondent à la structure sélectionnée.</div></div>
|
||||
<div class="col-md-4"><label class="form-label">Montant réel (€)</label><input class="form-control"
|
||||
inputmode="decimal" name="amount" placeholder="Calculé depuis le tarif si vide"></div>
|
||||
<div class="col-md-6"><label class="form-label">Structure</label><select class="form-select"
|
||||
|
|
@ -66,3 +67,37 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const clinic = document.querySelector('select[name="clinic_contact_id"]');
|
||||
const tariff = document.querySelector('select[name="tariff_id"]');
|
||||
const category = document.getElementById('surgeryCategory');
|
||||
const list = document.getElementById('surgeryProcedureList');
|
||||
const procedures = {
|
||||
orthopedic: ['Amputation','Arthrodèse','Ostéosynthèse','Réduction de fracture','Retrait de matériel'],
|
||||
dental: ['Avulsion dentaire','Détartrage','Extraction dentaire'],
|
||||
soft_tissue: ['Cystotomie','Entérectomie','Gastrotomie','Hernie','Laparotomie','Splénectomie'],
|
||||
reproductive: ['Castration','Césarienne','Ovariectomie','Ovario-hystérectomie'],
|
||||
ophthalmology: ['Énucléation','Entropion'], oncology: ['Exérèse de masse','Mastectomie'],
|
||||
imaging_guided: ['Biopsie guidée','Ponction guidée'], wound: ['Parage de plaie','Suture','Reconstruction cutanée'],
|
||||
other: ['Autre']
|
||||
};
|
||||
const syncTariffs = () => {
|
||||
const id = clinic?.value || '';
|
||||
[...(tariff?.options || [])].forEach(option => {
|
||||
if (!option.dataset.clinic) return;
|
||||
option.hidden = !id || option.dataset.clinic !== id;
|
||||
option.disabled = option.hidden;
|
||||
});
|
||||
if (tariff?.selectedOptions[0]?.hidden) tariff.value = '';
|
||||
};
|
||||
const syncProcedures = () => {
|
||||
if (!list) return;
|
||||
list.replaceChildren(...(procedures[category?.value] || ['Autre']).map(label => {
|
||||
const option = document.createElement('option'); option.value = label; return option;
|
||||
}));
|
||||
};
|
||||
clinic?.addEventListener('change', syncTariffs); category?.addEventListener('change', syncProcedures);
|
||||
syncTariffs(); syncProcedures();
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in a new issue