@amsom-habitat/cresol 0.2.7 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +110 -59
- package/dist/cresol.js +1565 -1155
- package/dist/cresol.umd.cjs +1 -1
- package/package.json +10 -10
package/dist/cresol.js
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { library as e } from "@fortawesome/fontawesome-svg-core";
|
|
2
|
-
import { faBriefcase as t, faBuilding as n, faBuildingShield as r, faCheck as i, faChevronLeft as a, faChevronRight as o, faCircleExclamation as s, faCircleInfo as c, faCircleQuestion as l, faDungeon as u, faFileSignature as d, faHandsHolding as f, faHourglass as p, faHouse as
|
|
3
|
-
import { AmsomModal as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { AmsomNavTabsHorizontal as
|
|
6
|
-
import
|
|
7
|
-
import { AmsomAutocomplete as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
2
|
+
import { faBriefcase as t, faBuilding as n, faBuildingShield as r, faCheck as i, faChevronLeft as a, faChevronRight as o, faCircleExclamation as s, faCircleInfo as c, faCircleQuestion as l, faDungeon as u, faFileSignature as d, faHandsHolding as f, faHourglass as p, faHouse as m, faInfo as h, faLayerGroup as ee, faLocationDot as g, faMagnifyingGlass as _, faPersonShelter as te, faSquareParking as ne, faStore as re, faTag as ie, faUser as ae, faUserGraduate as oe, faXmark as se } from "@fortawesome/free-solid-svg-icons";
|
|
3
|
+
import { AmsomModal as ce, AmsomOverlay as v } from "@amsom-habitat/ui";
|
|
4
|
+
import { Fragment as y, computed as b, createBlock as x, createCommentVNode as S, createElementBlock as C, createElementVNode as w, createSlots as le, createTextVNode as T, createVNode as E, guardReactiveProps as D, inject as ue, mergeProps as de, normalizeClass as O, normalizeProps as k, openBlock as A, provide as fe, reactive as j, ref as M, renderList as N, renderSlot as P, resolveComponent as F, toDisplayString as I, toHandlers as pe, toRef as L, unref as R, vShow as me, withCtx as z, withDirectives as he } from "vue";
|
|
5
|
+
import { AmsomNavTabsHorizontal as ge } from "@amsom-habitat/nav-tabs";
|
|
6
|
+
import _e from "@amsom-habitat/horizontal-stepper";
|
|
7
|
+
import { AmsomAutocomplete as B } from "@amsom-habitat/amsom-autocomplete";
|
|
8
|
+
import ve from "@amsom-habitat/axios-overlay";
|
|
9
|
+
import ye from "@amsom-habitat/user-manager";
|
|
10
10
|
import { AmsomTextarea as be } from "@amsom-habitat/amsom-textarea";
|
|
11
11
|
import { AmsomUploadFile as xe } from "@amsom-habitat/file-manager";
|
|
12
|
-
|
|
13
|
-
e.add(t, n, r, i, a, o, s, c, l, u, d, f, p, ee,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var V = {
|
|
12
|
+
// src/icons.js
|
|
13
|
+
e.add(t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, ee, g, _, te, ne, re, ie, ae, oe, se);
|
|
14
|
+
// src/utils/provenanceContact.js
|
|
15
|
+
var Se = {
|
|
17
16
|
T: "phone",
|
|
18
17
|
M: "envelope",
|
|
19
18
|
G: "user-shield",
|
|
20
19
|
V: "building",
|
|
21
20
|
IP: "exclamation-triangle",
|
|
22
21
|
C: "envelope-open"
|
|
23
|
-
},
|
|
22
|
+
}, Ce = (e) => Se[e] ?? "comment-dots", we = Object.keys(Se), Te = "T", V = {
|
|
24
23
|
locataire: {
|
|
25
24
|
libelle: "Locataire",
|
|
26
25
|
icon: "house-user",
|
|
@@ -63,7 +62,7 @@ var V = {
|
|
|
63
62
|
U: "autre",
|
|
64
63
|
F: "fournisseur",
|
|
65
64
|
E: "personnel"
|
|
66
|
-
},
|
|
65
|
+
}, H = Object.keys(De), Oe = (e) => [...new Set(e.map((e) => De[e]))], ke = (e) => e ? V[e.categorie] ? e.categorie : De[e.type] ?? "inconnu" : null, Ae = (e) => V[ke(e)] ?? null, je = Symbol("cresol:draft"), U = () => ({
|
|
67
66
|
idCommune: null,
|
|
68
67
|
commune: null,
|
|
69
68
|
idEntree: null,
|
|
@@ -114,7 +113,7 @@ var V = {
|
|
|
114
113
|
lignes: [{
|
|
115
114
|
...Me(),
|
|
116
115
|
cibleMode: "contrat",
|
|
117
|
-
patrimoine:
|
|
116
|
+
patrimoine: U(),
|
|
118
117
|
description: ""
|
|
119
118
|
}]
|
|
120
119
|
}), Fe = (e) => e?.id ?? e ?? null, Ie = (e) => {
|
|
@@ -131,7 +130,7 @@ var V = {
|
|
|
131
130
|
...e
|
|
132
131
|
};
|
|
133
132
|
return e.patrimoine && (t.patrimoine = {
|
|
134
|
-
...
|
|
133
|
+
...U(),
|
|
135
134
|
...e.patrimoine
|
|
136
135
|
}), t;
|
|
137
136
|
}, Ve = (e) => {
|
|
@@ -152,17 +151,17 @@ var V = {
|
|
|
152
151
|
} : Be(e)) : t.lignes
|
|
153
152
|
};
|
|
154
153
|
};
|
|
155
|
-
function He({ reclamants: e, modules: t, idModulePrefere: n =
|
|
156
|
-
let i =
|
|
157
|
-
let e =
|
|
154
|
+
function He({ reclamants: e, modules: t, idModulePrefere: n = M(null), readonly: r = M(!1) } = {}) {
|
|
155
|
+
let i = j(Pe()), a = b(() => {
|
|
156
|
+
let e = R(r);
|
|
158
157
|
return e === !0 ? Ne : Array.isArray(e) ? e : [];
|
|
159
|
-
}), o = (e) => a.value.includes(e), s =
|
|
158
|
+
}), o = (e) => a.value.includes(e), s = b(() => i.lignes[0]), c = b(() => i.lignes.slice(1)), l = b(() => R(e) ?? []), u = M(null), d = (e, t) => e.type === t.type && String(e.id) === String(t.id), f = b(() => {
|
|
160
159
|
let e = u.value;
|
|
161
160
|
return !e || l.value.some((t) => d(t, e)) ? l.value : [...l.value, e];
|
|
162
|
-
}), p =
|
|
163
|
-
let e =
|
|
161
|
+
}), p = b(() => f.value.find((e) => d(e, i.reclamant)) ?? f.value[0] ?? null), m = M(!1), h = M(0), ee = b(() => {
|
|
162
|
+
let e = R(t) ?? [], r = R(n);
|
|
164
163
|
return (r == null ? null : e.find((e) => String(e.idModule) === String(r))) ?? e.find((e) => e.estModulePrincipal) ?? e[0] ?? null;
|
|
165
|
-
}),
|
|
164
|
+
}), g = b(() => !!p.value && Ee.includes(p.value.type)), _ = {
|
|
166
165
|
draft: i,
|
|
167
166
|
lignePrincipale: s,
|
|
168
167
|
lignesAssociees: c,
|
|
@@ -170,61 +169,85 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = j(null), readonly:
|
|
|
170
169
|
reclamantsDisponibles: f,
|
|
171
170
|
reclamantSelectionne: p,
|
|
172
171
|
moduleReclamantPrincipal: ee,
|
|
173
|
-
reclamantEstContrat:
|
|
174
|
-
ciblesValid:
|
|
175
|
-
detailsValid:
|
|
172
|
+
reclamantEstContrat: g,
|
|
173
|
+
ciblesValid: b(() => i.lignes.every((e) => Re(e, g.value))),
|
|
174
|
+
detailsValid: b(() => i.lignes.every((e, t) => ze(e, t === 0))),
|
|
176
175
|
isReadonly: o,
|
|
176
|
+
ciblesAssocieesReinitialisees: h,
|
|
177
|
+
ligneCibleValid(e) {
|
|
178
|
+
let t = i.lignes[e];
|
|
179
|
+
return !!t && Re(t, g.value);
|
|
180
|
+
},
|
|
177
181
|
reset(e = null) {
|
|
178
|
-
let t =
|
|
179
|
-
|
|
182
|
+
let t = e?.lignes?.[0];
|
|
183
|
+
m.value = !!t && [
|
|
184
|
+
"cibleMode",
|
|
185
|
+
"patrimoine",
|
|
186
|
+
"contratCible"
|
|
187
|
+
].some((e) => t[e] != null), h.value = 0;
|
|
188
|
+
let n = Ve(e);
|
|
189
|
+
Object.assign(i, n), i.lignes = n.lignes;
|
|
180
190
|
},
|
|
181
191
|
setProvenance(e) {
|
|
182
192
|
i.provenance = e;
|
|
183
193
|
},
|
|
194
|
+
libererCibleFournie() {
|
|
195
|
+
m.value = !1;
|
|
196
|
+
},
|
|
184
197
|
syncReclamant() {
|
|
185
198
|
let e = p.value;
|
|
186
|
-
|
|
199
|
+
_.setReclamant({
|
|
187
200
|
type: e?.type ?? null,
|
|
188
201
|
id: e?.id ?? null
|
|
189
202
|
});
|
|
190
203
|
},
|
|
191
204
|
selectReclamant(e) {
|
|
192
|
-
e && (l.value.some((t) => d(t, e)) || (u.value = e),
|
|
205
|
+
e && (d(e, i.reclamant) || (m.value = !1), l.value.some((t) => d(t, e)) || (u.value = e), _.setReclamant(e));
|
|
193
206
|
},
|
|
194
207
|
setReclamant({ type: e, id: t }) {
|
|
208
|
+
let n = !d({
|
|
209
|
+
type: e,
|
|
210
|
+
id: t
|
|
211
|
+
}, i.reclamant);
|
|
195
212
|
if (i.reclamant = {
|
|
196
213
|
type: e ?? null,
|
|
197
214
|
id: t ?? null
|
|
198
|
-
}, o("cible")) return;
|
|
199
|
-
let
|
|
200
|
-
|
|
215
|
+
}, o("cible") || m.value) return;
|
|
216
|
+
let r = i.lignes[0];
|
|
217
|
+
if (n) {
|
|
218
|
+
let e = i.lignes.filter((e, t) => t > 0 && e.cibleOverride);
|
|
219
|
+
i.lignes.forEach((e, t) => {
|
|
220
|
+
t > 0 && e.cibleOverride && _.toggleCibleOverride(t);
|
|
221
|
+
}), e.length && (h.value = e.length);
|
|
222
|
+
}
|
|
223
|
+
e === "D" ? (r.cibleMode = "demande", r.patrimoine = null) : (r.cibleMode = g.value ? "contrat" : "patrimoine", r.contratReclamant = g.value, r.contratCible = null, r.reprendreLocataireActuel = !1, r.patrimoine = U(), _.prefillCiblePrincipale());
|
|
201
224
|
},
|
|
202
225
|
prefillCiblePrincipale() {
|
|
203
|
-
if (o("cible")) return;
|
|
226
|
+
if (o("cible") || m.value) return;
|
|
204
227
|
let e = ee.value;
|
|
205
|
-
e &&
|
|
228
|
+
e && _.prefillFromModule(0, e);
|
|
206
229
|
},
|
|
207
230
|
_resetAfterNomenclature() {
|
|
208
|
-
i.lignes[0].responsable = null, i.lignes.splice(1);
|
|
231
|
+
h.value = 0, i.lignes[0].responsable = null, i.lignes.splice(1);
|
|
209
232
|
},
|
|
210
233
|
setCategorie(e) {
|
|
211
234
|
let t = i.lignes[0];
|
|
212
|
-
t.idCategorie = e, t.idType = null, t.idNature = null, t.idMotif = null,
|
|
235
|
+
t.idCategorie = e, t.idType = null, t.idNature = null, t.idMotif = null, _._resetAfterNomenclature();
|
|
213
236
|
},
|
|
214
237
|
setType(e) {
|
|
215
238
|
let t = i.lignes[0];
|
|
216
|
-
t.idType = e, t.idNature = null, t.idMotif = null,
|
|
239
|
+
t.idType = e, t.idNature = null, t.idMotif = null, _._resetAfterNomenclature();
|
|
217
240
|
},
|
|
218
241
|
setNature(e) {
|
|
219
242
|
let t = i.lignes[0];
|
|
220
|
-
t.idNature = e, t.idMotif = null,
|
|
243
|
+
t.idNature = e, t.idMotif = null, _._resetAfterNomenclature();
|
|
221
244
|
},
|
|
222
245
|
setMotif(e) {
|
|
223
|
-
i.lignes[0].idMotif = e,
|
|
246
|
+
i.lignes[0].idMotif = e, _._resetAfterNomenclature();
|
|
224
247
|
},
|
|
225
248
|
selectMotifChain(e) {
|
|
226
249
|
let t = i.lignes[0];
|
|
227
|
-
t.idCategorie = e?.idCategorie ?? null, t.idType = e?.idType ?? null, t.idNature = e?.idNature ?? null, t.idMotif = e?.id ?? null,
|
|
250
|
+
t.idCategorie = e?.idCategorie ?? null, t.idType = e?.idType ?? null, t.idNature = e?.idNature ?? null, t.idMotif = e?.id ?? null, _._resetAfterNomenclature();
|
|
228
251
|
},
|
|
229
252
|
toggleLigneAssociee(e, t = {}) {
|
|
230
253
|
let n = i.lignes.findIndex((t, n) => n > 0 && t.idMotif === e);
|
|
@@ -239,15 +262,15 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = j(null), readonly:
|
|
|
239
262
|
},
|
|
240
263
|
setCibleMode(e, t) {
|
|
241
264
|
let n = i.lignes[e];
|
|
242
|
-
n && (n.cibleMode = t, n.reprendreLocataireActuel = !1, n.modulePrecis = !0, n.contratReclamant = t === "contrat" &&
|
|
265
|
+
n && (n.cibleMode = t, n.reprendreLocataireActuel = !1, n.modulePrecis = !0, n.contratReclamant = t === "contrat" && g.value, n.contratCible = null, t === "demande" ? n.patrimoine = null : n.patrimoine ??= U());
|
|
243
266
|
},
|
|
244
267
|
setModulePrecis(e, t) {
|
|
245
268
|
let n = i.lignes[e];
|
|
246
|
-
n && (n.modulePrecis = !!t, n.modulePrecis ||
|
|
269
|
+
n && (n.modulePrecis = !!t, n.modulePrecis || _.setPatrimoineModule(e, null));
|
|
247
270
|
},
|
|
248
271
|
toggleContratReclamant(e, t) {
|
|
249
272
|
let n = i.lignes[e];
|
|
250
|
-
n && (n.contratReclamant = t ?? !n.contratReclamant, n.contratCible = null, n.patrimoine &&
|
|
273
|
+
n && (n.contratReclamant = t ?? !n.contratReclamant, n.contratCible = null, n.patrimoine && _.setPatrimoineModule(e, null));
|
|
251
274
|
},
|
|
252
275
|
setContratCible(e, t) {
|
|
253
276
|
let n = i.lignes[e];
|
|
@@ -255,31 +278,32 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = j(null), readonly:
|
|
|
255
278
|
typeContrat: t.typeContrat,
|
|
256
279
|
idContrat: t.idContrat,
|
|
257
280
|
libelle: t.libelle ?? null
|
|
258
|
-
} : null,
|
|
281
|
+
} : null, _.setPatrimoineModule(e, null));
|
|
259
282
|
},
|
|
260
283
|
setPatrimoineCommune(e, t) {
|
|
261
|
-
let n =
|
|
262
|
-
n && (n.idCommune = t?.idCommune ?? null, n.commune = t?.commune ?? null,
|
|
284
|
+
let n = _._patrimoine(e);
|
|
285
|
+
n && (n.idCommune = t?.idCommune ?? null, n.commune = t?.commune ?? null, _.setPatrimoineEntree(e, null));
|
|
263
286
|
},
|
|
264
287
|
setPatrimoineEntree(e, t) {
|
|
265
|
-
let n =
|
|
266
|
-
n && (n.idEntree = t?.idEntree ?? null, n.entree = t?.entree ?? null, n.codeProgramme = t?.codeProgramme ?? null, n.codeTranche = t?.codeTranche ?? null, n.codeBatiment = t?.codeBatiment ?? null, n.codeEscalier = t?.codeEscalier ?? null, n.etage = null,
|
|
288
|
+
let n = _._patrimoine(e);
|
|
289
|
+
n && (n.idEntree = t?.idEntree ?? null, n.entree = t?.entree ?? null, n.codeProgramme = t?.codeProgramme ?? null, n.codeTranche = t?.codeTranche ?? null, n.codeBatiment = t?.codeBatiment ?? null, n.codeEscalier = t?.codeEscalier ?? null, n.etage = null, _.setPatrimoineModule(e, null));
|
|
267
290
|
},
|
|
268
291
|
setPatrimoineEtage(e, t) {
|
|
269
|
-
let n =
|
|
270
|
-
n && (n.etage = t,
|
|
292
|
+
let n = _._patrimoine(e);
|
|
293
|
+
n && (n.etage = t, _.setPatrimoineModule(e, null));
|
|
271
294
|
},
|
|
272
295
|
setPatrimoineModule(e, t) {
|
|
273
|
-
let n =
|
|
296
|
+
let n = _._patrimoine(e);
|
|
274
297
|
n && (n.idModule = t?.idModule ?? null, n.libelleModule = t?.libelleModule ?? null, n.typeContratActuel = t?.typeContratActuel ?? null, n.idContratActuel = t?.idContratActuel ?? null, n.occupantActuel = t?.occupantActuel ?? null, t && (n.codeProgramme = t.codeProgramme ?? n.codeProgramme, n.codeTranche = t.codeTranche ?? n.codeTranche, n.codeBatiment = t.codeBatiment ?? n.codeBatiment, n.codeEscalier = t.codeEscalier ?? n.codeEscalier, t.idEntree != null && (n.idEntree = t.idEntree), t.etage != null && (n.etage = t.etage)));
|
|
275
298
|
},
|
|
276
299
|
prefillFromModule(e, t) {
|
|
277
|
-
let n =
|
|
300
|
+
let n = _._patrimoine(e);
|
|
278
301
|
n && t && (n.idCommune = t.idCommune ?? null, n.commune = t.commune ?? null, n.idEntree = t.idEntree ?? null, n.entree = t.adresse ?? t.numeroRue ?? null, n.codeProgramme = t.codeProgramme ?? null, n.codeTranche = t.codeTranche ?? null, n.codeBatiment = t.codeBatiment ?? null, n.codeEscalier = t.codeEscalier ?? null, n.etage = t.etage ?? null, n.idModule = t.idModule ?? null, n.libelleModule = t.libelleModule ?? t.adresse ?? null, n.typeContratActuel = t.typeContratActuel ?? null, n.idContratActuel = t.idContratActuel ?? null, n.occupantActuel = t.occupantActuel ?? null);
|
|
279
302
|
},
|
|
280
303
|
toggleCibleOverride(e) {
|
|
281
304
|
let t = i.lignes[e];
|
|
282
305
|
if (!t) return;
|
|
306
|
+
h.value = 0;
|
|
283
307
|
let n = i.lignes[0];
|
|
284
308
|
t.cibleOverride ? (t.cibleOverride = !1, t.cibleMode = null, t.patrimoine = null, t.reprendreLocataireActuel = !1, t.modulePrecis = !0, t.contratReclamant = !0, t.contratCible = null) : (t.cibleOverride = !0, t.cibleMode = n.cibleMode, t.patrimoine = n.cibleMode === "demande" ? null : { ...n.patrimoine }, t.reprendreLocataireActuel = n.reprendreLocataireActuel, t.modulePrecis = n.modulePrecis, t.contratReclamant = n.contratReclamant, t.contratCible = n.contratCible ? { ...n.contratCible } : null);
|
|
285
309
|
},
|
|
@@ -336,9 +360,9 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = j(null), readonly:
|
|
|
336
360
|
idCible: i.reclamant.id,
|
|
337
361
|
deduireCible: !1
|
|
338
362
|
};
|
|
339
|
-
let l =
|
|
363
|
+
let l = _._patrimoinePayload(r.patrimoine);
|
|
340
364
|
if (r.cibleMode === "contrat" && !r.reprendreLocataireActuel) {
|
|
341
|
-
let e = r.contratReclamant &&
|
|
365
|
+
let e = r.contratReclamant && g.value ? {
|
|
342
366
|
typeContrat: i.reclamant.type,
|
|
343
367
|
idContrat: i.reclamant.id
|
|
344
368
|
} : r.contratCible;
|
|
@@ -365,7 +389,7 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = j(null), readonly:
|
|
|
365
389
|
if (n.cibleMode === "patrimoine" && !n.modulePrecis) return `Parties communes — ${r}`;
|
|
366
390
|
if (n.cibleMode !== "contrat") return r;
|
|
367
391
|
let a = "Contrat non défini";
|
|
368
|
-
if (n.contratReclamant &&
|
|
392
|
+
if (n.contratReclamant && g.value) a = "Contrat du réclamant";
|
|
369
393
|
else if (n.contratCible) {
|
|
370
394
|
let e = n.contratCible;
|
|
371
395
|
a = `${e.libelle ?? "Contrat"} (${e.typeContrat}/${e.idContrat})`;
|
|
@@ -373,43 +397,42 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = j(null), readonly:
|
|
|
373
397
|
return `${a} — ${r}`;
|
|
374
398
|
},
|
|
375
399
|
lignesPayload() {
|
|
376
|
-
return i.lignes.map((e, t) =>
|
|
400
|
+
return i.lignes.map((e, t) => _._lignePayload(e, t));
|
|
377
401
|
},
|
|
378
402
|
creationPayload() {
|
|
379
403
|
let e = p.value;
|
|
380
404
|
return {
|
|
381
405
|
typeReclamant: e?.type ?? null,
|
|
382
406
|
reclamant: e?.id ?? null,
|
|
383
|
-
lignes:
|
|
407
|
+
lignes: _.lignesPayload(),
|
|
384
408
|
provenance: i.provenance
|
|
385
409
|
};
|
|
386
410
|
}
|
|
387
411
|
};
|
|
388
|
-
return
|
|
412
|
+
return j(_);
|
|
389
413
|
}
|
|
390
414
|
function Ue(e) {
|
|
391
|
-
return
|
|
415
|
+
return fe(je, e), e;
|
|
392
416
|
}
|
|
393
|
-
function
|
|
394
|
-
let e =
|
|
417
|
+
function W() {
|
|
418
|
+
let e = ue(je, null);
|
|
395
419
|
if (!e) throw Error("useSollicitationDraft() hors de <creer-sollicitation-form>");
|
|
396
420
|
return e;
|
|
397
421
|
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
var K = (e, t) => {
|
|
422
|
+
// \0plugin-vue:export-helper
|
|
423
|
+
var G = (e, t) => {
|
|
401
424
|
let n = e.__vccOpts || e;
|
|
402
425
|
for (let [e, r] of t) n[e] = r;
|
|
403
426
|
return n;
|
|
404
427
|
}, We = {
|
|
405
428
|
name: "AsideBlock",
|
|
406
|
-
components: { AmsomNavTabsHorizontal:
|
|
429
|
+
components: { AmsomNavTabsHorizontal: ge },
|
|
407
430
|
props: { nbSimilaires: {
|
|
408
431
|
type: Number,
|
|
409
432
|
default: 0
|
|
410
433
|
} },
|
|
411
434
|
setup() {
|
|
412
|
-
return { draft:
|
|
435
|
+
return { draft: W() };
|
|
413
436
|
},
|
|
414
437
|
data() {
|
|
415
438
|
return { activeTab: null };
|
|
@@ -450,8 +473,8 @@ var K = (e, t) => {
|
|
|
450
473
|
class: "badge bg-danger ms-1"
|
|
451
474
|
}, Ke = { style: { "min-height": "320px" } }, qe = { key: 0 }, Je = { key: 1 };
|
|
452
475
|
function Ye(e, t, n, r, i, a) {
|
|
453
|
-
let o =
|
|
454
|
-
return a.tabs.length ? (
|
|
476
|
+
let o = F("font-awesome-icon"), s = F("amsom-nav-tabs-horizontal");
|
|
477
|
+
return a.tabs.length ? (A(), x(s, {
|
|
455
478
|
key: 0,
|
|
456
479
|
modelValue: i.activeTab,
|
|
457
480
|
"onUpdate:modelValue": t[0] ||= (e) => i.activeTab = e,
|
|
@@ -459,30 +482,145 @@ function Ye(e, t, n, r, i, a) {
|
|
|
459
482
|
"item-key": "id",
|
|
460
483
|
"tab-spacing": 1
|
|
461
484
|
}, {
|
|
462
|
-
libelle:
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
e.id === "similarite" && n.nbSimilaires > 0 ? (
|
|
485
|
+
libelle: z(({ item: e }) => [
|
|
486
|
+
E(o, { icon: e.icon }, null, 8, ["icon"]),
|
|
487
|
+
w("span", null, I(e.label), 1),
|
|
488
|
+
e.id === "similarite" && n.nbSimilaires > 0 ? (A(), C("span", Ge, I(n.nbSimilaires), 1)) : S("", !0)
|
|
466
489
|
]),
|
|
467
|
-
content:
|
|
490
|
+
content: z(() => [w("div", Ke, [e.$slots.similaires ? he((A(), C("div", qe, [P(e.$slots, "similaires", k(D(a.scope)))], 512)), [[me, i.activeTab === "similarite"]]) : S("", !0), e.$slots.evenements ? he((A(), C("div", Je, [P(e.$slots, "evenements")], 512)), [[me, i.activeTab === "evenements"]]) : S("", !0)])]),
|
|
468
491
|
_: 3
|
|
469
|
-
}, 8, ["modelValue", "items"])) :
|
|
492
|
+
}, 8, ["modelValue", "items"])) : S("", !0);
|
|
493
|
+
}
|
|
494
|
+
var Xe = /*#__PURE__*/ G(We, [["render", Ye]]), Ze = {
|
|
495
|
+
name: "SectionComponent",
|
|
496
|
+
props: {
|
|
497
|
+
titre: {
|
|
498
|
+
type: String,
|
|
499
|
+
required: !0
|
|
500
|
+
},
|
|
501
|
+
aide: {
|
|
502
|
+
type: String,
|
|
503
|
+
default: null
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}, Qe = { class: "d-flex flex-column gap-2" }, $e = { class: "d-flex flex-wrap align-items-center justify-content-between gap-2" }, et = { class: "fs-6 fw-semibold" }, tt = {
|
|
507
|
+
key: 0,
|
|
508
|
+
class: "text-muted d-flex align-items-center gap-1"
|
|
509
|
+
};
|
|
510
|
+
function nt(e, t, n, r, i, a) {
|
|
511
|
+
let o = F("font-awesome-icon");
|
|
512
|
+
return A(), C("section", Qe, [w("div", null, [w("div", $e, [w("span", et, I(n.titre), 1), P(e.$slots, "actions")]), n.aide ? (A(), C("small", tt, [E(o, { icon: "circle-info" }), T(" " + I(n.aide), 1)])) : S("", !0)]), P(e.$slots, "default")]);
|
|
513
|
+
}
|
|
514
|
+
var rt = /*#__PURE__*/ G(Ze, [["render", nt]]), it = (e) => "fa" + e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
|
|
515
|
+
async function at(t) {
|
|
516
|
+
let n = await import("@fortawesome/free-solid-svg-icons");
|
|
517
|
+
[...new Set(t.filter(Boolean))].forEach((t) => {
|
|
518
|
+
let r = n[it(t)];
|
|
519
|
+
r && e.add(r);
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
// src/utils/text.js
|
|
523
|
+
function K(e, t = !0) {
|
|
524
|
+
if (!e) return null;
|
|
525
|
+
let n = e.toString().normalize("NFD").replace(/[̀-ͯ]/g, "");
|
|
526
|
+
return t ? n.toLowerCase() : n;
|
|
527
|
+
}
|
|
528
|
+
// src/components/IconSelectComponent.vue
|
|
529
|
+
var ot = {
|
|
530
|
+
name: "IconSelectComponent",
|
|
531
|
+
components: { AmsomAutocomplete: B },
|
|
532
|
+
props: {
|
|
533
|
+
modelValue: {
|
|
534
|
+
type: [String, Number],
|
|
535
|
+
default: null
|
|
536
|
+
},
|
|
537
|
+
items: {
|
|
538
|
+
type: Array,
|
|
539
|
+
default: () => []
|
|
540
|
+
},
|
|
541
|
+
label: {
|
|
542
|
+
type: String,
|
|
543
|
+
required: !0
|
|
544
|
+
},
|
|
545
|
+
required: {
|
|
546
|
+
type: Boolean,
|
|
547
|
+
default: !1
|
|
548
|
+
},
|
|
549
|
+
disabled: {
|
|
550
|
+
type: Boolean,
|
|
551
|
+
default: !1
|
|
552
|
+
},
|
|
553
|
+
placeholder: {
|
|
554
|
+
type: String,
|
|
555
|
+
default: "Choisir…"
|
|
556
|
+
}
|
|
557
|
+
},
|
|
558
|
+
emits: ["update:modelValue"],
|
|
559
|
+
data() {
|
|
560
|
+
return { iconsReady: !1 };
|
|
561
|
+
},
|
|
562
|
+
computed: { selected() {
|
|
563
|
+
return this.items.find((e) => e.id === this.modelValue) ?? null;
|
|
564
|
+
} },
|
|
565
|
+
watch: { items: {
|
|
566
|
+
immediate: !0,
|
|
567
|
+
async handler(e) {
|
|
568
|
+
await at(e.map((e) => e.icon)), this.iconsReady = !0;
|
|
569
|
+
}
|
|
570
|
+
} },
|
|
571
|
+
methods: { filtrer({ search: e, items: t }) {
|
|
572
|
+
let n = (K(e) ?? "").trim();
|
|
573
|
+
return n ? t.filter((e) => (K(e?.libelle) ?? "").includes(n)) : t;
|
|
574
|
+
} }
|
|
575
|
+
}, st = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, ct = {
|
|
576
|
+
key: 0,
|
|
577
|
+
class: "ms-1 text-danger"
|
|
578
|
+
}, lt = { class: "d-inline-flex align-items-center gap-2" };
|
|
579
|
+
function ut(e, t, n, r, i, a) {
|
|
580
|
+
let o = F("font-awesome-icon"), s = F("amsom-autocomplete");
|
|
581
|
+
return A(), C("div", null, [w("label", st, [T(I(n.label), 1), n.required ? (A(), C("span", ct, "*")) : S("", !0)]), i.iconsReady ? (A(), x(s, {
|
|
582
|
+
key: 0,
|
|
583
|
+
"model-value": a.selected,
|
|
584
|
+
items: n.items,
|
|
585
|
+
"get-id": (e) => e?.id ?? null,
|
|
586
|
+
"get-input-libelle": (e) => e?.libelle ?? "",
|
|
587
|
+
"filtering-function": a.filtrer,
|
|
588
|
+
disabled: n.disabled,
|
|
589
|
+
placeholder: n.placeholder,
|
|
590
|
+
required: "",
|
|
591
|
+
"input-size": "sm",
|
|
592
|
+
"onUpdate:modelValue": t[0] ||= (t) => e.$emit("update:modelValue", t?.id ?? null)
|
|
593
|
+
}, {
|
|
594
|
+
options: z((e) => [w("span", lt, [e?.icon ? (A(), x(o, {
|
|
595
|
+
key: 0,
|
|
596
|
+
icon: e.icon,
|
|
597
|
+
"fixed-width": ""
|
|
598
|
+
}, null, 8, ["icon"])) : S("", !0), T(" " + I(e?.libelle), 1)])]),
|
|
599
|
+
_: 1
|
|
600
|
+
}, 8, [
|
|
601
|
+
"model-value",
|
|
602
|
+
"items",
|
|
603
|
+
"get-id",
|
|
604
|
+
"get-input-libelle",
|
|
605
|
+
"filtering-function",
|
|
606
|
+
"disabled",
|
|
607
|
+
"placeholder"
|
|
608
|
+
])) : S("", !0)]);
|
|
470
609
|
}
|
|
471
|
-
var
|
|
610
|
+
var dt = /*#__PURE__*/ G(ot, [["render", ut]]), ft = {
|
|
472
611
|
baseUrl: "",
|
|
473
|
-
getToken: () =>
|
|
474
|
-
setToken: (e) =>
|
|
475
|
-
logout: () =>
|
|
476
|
-
goToLoginPage: () =>
|
|
612
|
+
getToken: () => ye.getToken(),
|
|
613
|
+
setToken: (e) => ye.setToken(e),
|
|
614
|
+
logout: () => ye.logout(),
|
|
615
|
+
goToLoginPage: () => ye.goToLoginPage()
|
|
477
616
|
};
|
|
478
|
-
function
|
|
479
|
-
Object.assign(
|
|
617
|
+
function pt(e = {}) {
|
|
618
|
+
Object.assign(ft, e);
|
|
480
619
|
}
|
|
481
|
-
var
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
let n = $e(), r = {
|
|
620
|
+
var mt = () => ft;
|
|
621
|
+
// src/api/transport/axiosOverlayConnector.js
|
|
622
|
+
function ht(e, t = {}) {
|
|
623
|
+
let n = mt(), r = {
|
|
486
624
|
getToken: () => n.getToken?.() ?? null,
|
|
487
625
|
setToken: (e) => n.setToken?.(e),
|
|
488
626
|
logout: () => n.logout?.(),
|
|
@@ -504,74 +642,73 @@ function et(e, t = {}) {
|
|
|
504
642
|
}, t.functions.errorsHandlers = {
|
|
505
643
|
...r.errorsHandlers,
|
|
506
644
|
...t.functions.errorsHandlers ?? {}
|
|
507
|
-
},
|
|
645
|
+
}, ve(e, t);
|
|
508
646
|
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
let n = t || $e().baseUrl;
|
|
647
|
+
// src/api/transport/httpClient.js
|
|
648
|
+
var gt = (e, t) => {
|
|
649
|
+
let n = t || mt().baseUrl;
|
|
513
650
|
if (!n) throw Error("Cresol : baseUrl non renseignée (configureCresol ou prop baseUrl)");
|
|
514
651
|
return `${n}${e}`;
|
|
515
|
-
},
|
|
652
|
+
}, _t = (e = {}) => {
|
|
516
653
|
let t = new URLSearchParams();
|
|
517
654
|
Object.entries(e).forEach(([e, n]) => {
|
|
518
655
|
n != null && n !== "" && t.append(e, typeof n == "object" ? JSON.stringify(n) : n);
|
|
519
656
|
});
|
|
520
657
|
let n = t.toString();
|
|
521
658
|
return n ? `?${n}` : "";
|
|
522
|
-
},
|
|
523
|
-
url:
|
|
659
|
+
}, vt = ({ method: e, path: t, params: n, data: r, signal: i, baseUrl: a }, o = {}) => ht({
|
|
660
|
+
url: gt(`${t}${_t(n)}`, a),
|
|
524
661
|
method: e,
|
|
525
662
|
...r === void 0 ? {} : { data: r },
|
|
526
663
|
...i ? { signal: i } : {}
|
|
527
|
-
}, o), q = (e, { params: t, signal: n, overlay: r, baseUrl: i } = {}) =>
|
|
664
|
+
}, o), q = (e, { params: t, signal: n, overlay: r, baseUrl: i } = {}) => vt({
|
|
528
665
|
method: "GET",
|
|
529
666
|
path: e,
|
|
530
667
|
params: t,
|
|
531
668
|
signal: n,
|
|
532
669
|
baseUrl: i
|
|
533
|
-
}, r).then((e) => e.data),
|
|
670
|
+
}, r).then((e) => e.data), yt = (e, t, { params: n, signal: r, overlay: i, baseUrl: a } = {}) => vt({
|
|
534
671
|
method: "POST",
|
|
535
672
|
path: e,
|
|
536
673
|
params: n,
|
|
537
674
|
data: t,
|
|
538
675
|
signal: r,
|
|
539
676
|
baseUrl: a
|
|
540
|
-
}, i).then((e) => e.data),
|
|
677
|
+
}, i).then((e) => e.data), bt = { mustBeAuthenticated: !1 }, J = (e, { signal: t, baseUrl: n } = {}) => q(e, {
|
|
541
678
|
signal: t,
|
|
542
679
|
baseUrl: n,
|
|
543
|
-
overlay:
|
|
544
|
-
}),
|
|
680
|
+
overlay: bt
|
|
681
|
+
}), xt = (e) => J("/v2/sollicitation/motifs", e), St = (e) => J("/v2/sollicitation/categories", e), Ct = (e) => J("/v2/sollicitation/types", e), wt = (e) => J("/v2/sollicitation/natures", e), Tt = (e) => J("/v2/sollicitation/etats", e), Et = ({ signal: e, baseUrl: t } = {}) => q("/v2/sollicitation/provenances", {
|
|
545
682
|
params: { estDesactive: !1 },
|
|
546
683
|
signal: e,
|
|
547
684
|
baseUrl: t,
|
|
548
|
-
overlay:
|
|
549
|
-
}),
|
|
685
|
+
overlay: bt
|
|
686
|
+
}), Dt = ({ signal: e, baseUrl: t } = {}) => q("/collaborateurs", {
|
|
550
687
|
params: { actif: !0 },
|
|
551
688
|
signal: e,
|
|
552
689
|
baseUrl: t
|
|
553
|
-
}),
|
|
690
|
+
}), Ot = async ({ signal: e, baseUrl: t } = {}) => (await q("/v2/patrimoine/communes", {
|
|
554
691
|
signal: e,
|
|
555
692
|
baseUrl: t
|
|
556
693
|
}) ?? []).map((e) => ({
|
|
557
694
|
idCommune: e.id,
|
|
558
695
|
commune: e.libelle
|
|
559
|
-
})),
|
|
696
|
+
})), kt = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/entrees", {
|
|
560
697
|
params: { idCommune: e },
|
|
561
698
|
signal: t,
|
|
562
699
|
baseUrl: n
|
|
563
|
-
}),
|
|
700
|
+
}), At = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/modules", {
|
|
564
701
|
params: { codeProgramme: e },
|
|
565
702
|
signal: t,
|
|
566
703
|
baseUrl: n
|
|
567
|
-
}),
|
|
704
|
+
}), jt = ({ idContrat: e, typeContrat: t }, { signal: n, baseUrl: r } = {}) => q("/v2/patrimoine/contrat_modules", {
|
|
568
705
|
params: {
|
|
569
706
|
idContrat: e,
|
|
570
707
|
typeContrat: t
|
|
571
708
|
},
|
|
572
709
|
signal: n,
|
|
573
710
|
baseUrl: r
|
|
574
|
-
}),
|
|
711
|
+
}), Mt = ({ motif: e, categorie: t, type: n, nature: r }, { signal: i, baseUrl: a } = {}) => q("/v2/sollicitation/responsables", {
|
|
575
712
|
params: {
|
|
576
713
|
motif: e,
|
|
577
714
|
categorie: t,
|
|
@@ -580,11 +717,11 @@ var tt = (e, t) => {
|
|
|
580
717
|
},
|
|
581
718
|
signal: i,
|
|
582
719
|
baseUrl: a
|
|
583
|
-
}),
|
|
720
|
+
}), Nt = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/contrat_module_rechercher", {
|
|
584
721
|
params: { recherche: e },
|
|
585
722
|
signal: t,
|
|
586
723
|
baseUrl: n
|
|
587
|
-
}),
|
|
724
|
+
}), Pt = ({ categorie: e, recherche: t }, { signal: n, baseUrl: r } = {}) => q("/v2/cresol/reclamant_rechercher", {
|
|
588
725
|
params: {
|
|
589
726
|
categorie: e,
|
|
590
727
|
recherche: t
|
|
@@ -592,13 +729,12 @@ var tt = (e, t) => {
|
|
|
592
729
|
signal: n,
|
|
593
730
|
baseUrl: r
|
|
594
731
|
});
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
function bt(e) {
|
|
732
|
+
// src/utils/apiError.js
|
|
733
|
+
function Ft(e) {
|
|
598
734
|
let t = e?.response?.data;
|
|
599
735
|
return t?.error ? t.error : t?.errorList ? t.errorList.map((e) => e.message).join(", ") : e?.response?.status === 500 ? "Erreur interne" : e?.response?.status === 401 ? "Non autorisé à faire cette action" : "Erreur";
|
|
600
736
|
}
|
|
601
|
-
var
|
|
737
|
+
var It = (e) => e?.name === "AbortError" || e?.name === "CanceledError", Lt = Symbol("cresol:data"), Rt = () => ({
|
|
602
738
|
motifs: null,
|
|
603
739
|
categories: null,
|
|
604
740
|
types: null,
|
|
@@ -611,17 +747,17 @@ var xt = (e) => e?.name === "AbortError" || e?.name === "CanceledError", St = Sy
|
|
|
611
747
|
modulesByProgramme: {},
|
|
612
748
|
modulesByContrat: {},
|
|
613
749
|
responsablesByMotif: {}
|
|
614
|
-
}),
|
|
615
|
-
function
|
|
616
|
-
|
|
750
|
+
}), zt = /* @__PURE__ */ new Map(), Bt = (e) => (zt.has(e) || zt.set(e, j(Rt())), zt.get(e)), Y = /* @__PURE__ */ new Map();
|
|
751
|
+
function Vt() {
|
|
752
|
+
zt.clear(), Y.clear();
|
|
617
753
|
}
|
|
618
|
-
var X = (e, t, n) => e?.find((e) => e[t] === n)?.libelle ?? n,
|
|
619
|
-
function
|
|
620
|
-
let n =
|
|
754
|
+
var X = (e, t, n) => e?.find((e) => e[t] === n)?.libelle ?? n, Ht = (e, t, n) => e?.find((e) => e[t] === n)?.icon ?? null;
|
|
755
|
+
function Ut({ onError: e, baseUrl: t } = {}) {
|
|
756
|
+
let n = M(0), r = () => ({ baseUrl: R(t) || null }), i = () => R(t) || mt().baseUrl || "", a = () => Bt(i()), o = (t, r) => {
|
|
621
757
|
let a = `${i()}|${t}`;
|
|
622
758
|
if (Y.has(a)) return Y.get(a);
|
|
623
759
|
n.value += 1;
|
|
624
|
-
let o = Promise.resolve().then(r).catch((t) => (
|
|
760
|
+
let o = Promise.resolve().then(r).catch((t) => (It(t) || e?.(Ft(t)), null)).finally(() => {
|
|
625
761
|
--n.value, Y.delete(a);
|
|
626
762
|
});
|
|
627
763
|
return Y.set(a, o), o;
|
|
@@ -630,30 +766,30 @@ function Ot({ onError: e, baseUrl: t } = {}) {
|
|
|
630
766
|
return a();
|
|
631
767
|
},
|
|
632
768
|
loading: n,
|
|
633
|
-
isLoading:
|
|
769
|
+
isLoading: b(() => n.value > 0),
|
|
634
770
|
loadNomenclature() {
|
|
635
771
|
return Promise.all([
|
|
636
|
-
s("motifs",
|
|
637
|
-
s("categories",
|
|
638
|
-
s("types",
|
|
639
|
-
s("natures",
|
|
640
|
-
s("etats",
|
|
772
|
+
s("motifs", xt),
|
|
773
|
+
s("categories", St),
|
|
774
|
+
s("types", Ct),
|
|
775
|
+
s("natures", wt),
|
|
776
|
+
s("etats", Tt)
|
|
641
777
|
]);
|
|
642
778
|
},
|
|
643
|
-
loadCollaborateurs: () => s("collaborateurs",
|
|
644
|
-
loadProvenances: () => s("provenances",
|
|
779
|
+
loadCollaborateurs: () => s("collaborateurs", Dt),
|
|
780
|
+
loadProvenances: () => s("provenances", Et),
|
|
645
781
|
loadCommunes() {
|
|
646
|
-
return a().communes?.length ? Promise.resolve(a().communes) : o("communes", async () => (a().communes = await
|
|
782
|
+
return a().communes?.length ? Promise.resolve(a().communes) : o("communes", async () => (a().communes = await Ot(r()), a().communes));
|
|
647
783
|
},
|
|
648
784
|
loadAdresses(e) {
|
|
649
785
|
return e == null ? Promise.resolve([]) : a().adressesByCommune[e] ? Promise.resolve(a().adressesByCommune[e]) : o(`adresses:${e}`, async () => {
|
|
650
|
-
let t = await
|
|
786
|
+
let t = await kt(e, r());
|
|
651
787
|
return a().adressesByCommune[e] = t ?? [], t;
|
|
652
788
|
});
|
|
653
789
|
},
|
|
654
790
|
loadModulesOfProgramme(e) {
|
|
655
791
|
return e == null ? Promise.resolve([]) : a().modulesByProgramme[e] ? Promise.resolve(a().modulesByProgramme[e]) : o(`modules:${e}`, async () => {
|
|
656
|
-
let t = await
|
|
792
|
+
let t = await At(e, r());
|
|
657
793
|
return a().modulesByProgramme[e] = t ?? [], t;
|
|
658
794
|
});
|
|
659
795
|
},
|
|
@@ -661,7 +797,7 @@ function Ot({ onError: e, baseUrl: t } = {}) {
|
|
|
661
797
|
if (e == null) return Promise.resolve([]);
|
|
662
798
|
let n = `${t ?? ""}|${e}`;
|
|
663
799
|
return a().modulesByContrat[n] ? Promise.resolve(a().modulesByContrat[n]) : o(`contratModules:${n}`, async () => {
|
|
664
|
-
let i = await
|
|
800
|
+
let i = await jt({
|
|
665
801
|
idContrat: e,
|
|
666
802
|
typeContrat: t
|
|
667
803
|
}, r());
|
|
@@ -671,7 +807,7 @@ function Ot({ onError: e, baseUrl: t } = {}) {
|
|
|
671
807
|
async searchContrats(e, { signal: t } = {}) {
|
|
672
808
|
let n = (e ?? "").trim();
|
|
673
809
|
if (!n) return [];
|
|
674
|
-
let i = await
|
|
810
|
+
let i = await Nt(n, {
|
|
675
811
|
...r(),
|
|
676
812
|
signal: t
|
|
677
813
|
}), a = /* @__PURE__ */ new Map();
|
|
@@ -693,7 +829,7 @@ function Ot({ onError: e, baseUrl: t } = {}) {
|
|
|
693
829
|
async searchReclamants(e, t, { signal: n } = {}) {
|
|
694
830
|
let i = (t ?? "").trim();
|
|
695
831
|
if (!i) return [];
|
|
696
|
-
let a = await
|
|
832
|
+
let a = await Pt({
|
|
697
833
|
categorie: e,
|
|
698
834
|
recherche: i
|
|
699
835
|
}, {
|
|
@@ -729,7 +865,7 @@ function Ot({ onError: e, baseUrl: t } = {}) {
|
|
|
729
865
|
},
|
|
730
866
|
loadResponsables({ motif: e, categorie: t, type: n, nature: i }) {
|
|
731
867
|
return e == null ? Promise.resolve([]) : a().responsablesByMotif[e] ? Promise.resolve(a().responsablesByMotif[e]) : o(`responsables:${e}`, async () => {
|
|
732
|
-
let o = await
|
|
868
|
+
let o = await Mt({
|
|
733
869
|
motif: e,
|
|
734
870
|
categorie: t,
|
|
735
871
|
type: n,
|
|
@@ -758,49 +894,84 @@ function Ot({ onError: e, baseUrl: t } = {}) {
|
|
|
758
894
|
typeLibelle: (e) => X(a().types, "id", e),
|
|
759
895
|
natureLibelle: (e) => X(a().natures, "id", e),
|
|
760
896
|
etatLibelle: (e) => X(a().etats, "code", e),
|
|
761
|
-
motifIcon: (e) =>
|
|
762
|
-
categorieIcon: (e) =>
|
|
763
|
-
typeIcon: (e) =>
|
|
764
|
-
natureIcon: (e) =>
|
|
897
|
+
motifIcon: (e) => Ht(a().motifs, "id", e),
|
|
898
|
+
categorieIcon: (e) => Ht(a().categories, "id", e),
|
|
899
|
+
typeIcon: (e) => Ht(a().types, "id", e),
|
|
900
|
+
natureIcon: (e) => Ht(a().natures, "id", e)
|
|
765
901
|
};
|
|
766
|
-
return
|
|
902
|
+
return j(c);
|
|
767
903
|
}
|
|
768
|
-
function
|
|
769
|
-
return
|
|
904
|
+
function Wt(e) {
|
|
905
|
+
return fe(Lt, e), e;
|
|
770
906
|
}
|
|
771
907
|
function Z() {
|
|
772
|
-
let e =
|
|
908
|
+
let e = ue(Lt, null);
|
|
773
909
|
if (!e) throw Error("useCresolData() hors de <creer-sollicitation-form>");
|
|
774
910
|
return e;
|
|
775
911
|
}
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
912
|
+
// src/composables/useCresolContext.js
|
|
913
|
+
var Gt = Symbol("cresol:options"), Kt = (e) => fe(Gt, e), Q = () => ue(Gt, {}), qt = {
|
|
914
|
+
name: "ProvenanceSelecteurBlock",
|
|
915
|
+
components: { IconSelectComponent: dt },
|
|
916
|
+
setup() {
|
|
917
|
+
return {
|
|
918
|
+
draft: W(),
|
|
919
|
+
data: Z(),
|
|
920
|
+
options: Q()
|
|
921
|
+
};
|
|
922
|
+
},
|
|
923
|
+
computed: {
|
|
924
|
+
provenances() {
|
|
925
|
+
return this.options.provenances;
|
|
926
|
+
},
|
|
927
|
+
loaded() {
|
|
928
|
+
return this.data.cache.provenances != null;
|
|
929
|
+
},
|
|
930
|
+
selected() {
|
|
931
|
+
return this.draft.draft.provenance;
|
|
932
|
+
},
|
|
933
|
+
libelleFige() {
|
|
934
|
+
return this.data.cache.provenances?.find((e) => e.id === this.selected)?.libelle ?? this.selected ?? "—";
|
|
935
|
+
},
|
|
936
|
+
provenanceChoisie() {
|
|
937
|
+
return this.provenances.find((e) => e.id === this.selected) ?? null;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
}, Jt = { key: 0 }, Yt = ["value"], Xt = { key: 1 }, Zt = {
|
|
941
|
+
key: 0,
|
|
942
|
+
class: "fs-7 text-danger mt-1"
|
|
943
|
+
};
|
|
944
|
+
function Qt(e, t, n, r, i, a) {
|
|
945
|
+
let o = F("icon-select-component");
|
|
946
|
+
return r.draft.isReadonly("provenance") ? (A(), C("div", Jt, [t[1] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Provenance", -1), w("input", {
|
|
947
|
+
class: "form-control form-control-sm",
|
|
948
|
+
disabled: "",
|
|
949
|
+
value: a.libelleFige
|
|
950
|
+
}, null, 8, Yt)])) : (A(), C("div", Xt, [E(o, {
|
|
951
|
+
"model-value": a.provenanceChoisie?.id ?? null,
|
|
952
|
+
items: a.provenances,
|
|
953
|
+
label: "Provenance",
|
|
954
|
+
required: "",
|
|
955
|
+
"onUpdate:modelValue": t[0] ||= (e) => r.draft.setProvenance(e)
|
|
956
|
+
}, null, 8, ["model-value", "items"]), a.loaded && !a.provenanceChoisie ? (A(), C("div", Zt, " Sélectionnez par quel canal la sollicitation vous est parvenue. ")) : S("", !0)]));
|
|
785
957
|
}
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
function
|
|
958
|
+
var $t = /*#__PURE__*/ G(qt, [["render", Qt]]);
|
|
959
|
+
// src/utils/date.js
|
|
960
|
+
function en(e) {
|
|
789
961
|
return e == null ? "" : (/* @__PURE__ */ new Date(e * 1e3)).toISOString().slice(0, 10);
|
|
790
962
|
}
|
|
791
|
-
function
|
|
963
|
+
function tn(e) {
|
|
792
964
|
return e ? Math.floor(new Date(e).getTime() / 1e3) : null;
|
|
793
965
|
}
|
|
794
|
-
function
|
|
966
|
+
function nn(e) {
|
|
795
967
|
return e == null ? "" : (/* @__PURE__ */ new Date(e * 1e3)).toLocaleDateString("fr-FR");
|
|
796
968
|
}
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
Lt.value = !0;
|
|
969
|
+
// src/components/ReclamantTypeBadgeComponent.vue
|
|
970
|
+
var rn = M(!1);
|
|
971
|
+
at(Object.values(V).map((e) => e.icon)).then(() => {
|
|
972
|
+
rn.value = !0;
|
|
802
973
|
});
|
|
803
|
-
var
|
|
974
|
+
var an = {
|
|
804
975
|
name: "ReclamantTypeBadgeComponent",
|
|
805
976
|
props: {
|
|
806
977
|
reclamant: {
|
|
@@ -813,29 +984,29 @@ var Rt = {
|
|
|
813
984
|
}
|
|
814
985
|
},
|
|
815
986
|
setup() {
|
|
816
|
-
return { iconsReady:
|
|
987
|
+
return { iconsReady: rn };
|
|
817
988
|
},
|
|
818
989
|
computed: { type() {
|
|
819
990
|
return Ae(this.reclamant);
|
|
820
991
|
} }
|
|
821
|
-
},
|
|
822
|
-
function
|
|
823
|
-
let o =
|
|
824
|
-
return a.type ? (
|
|
992
|
+
}, on = ["title"], sn = { key: 1 };
|
|
993
|
+
function cn(e, t, n, r, i, a) {
|
|
994
|
+
let o = F("font-awesome-icon");
|
|
995
|
+
return a.type ? (A(), C("span", {
|
|
825
996
|
key: 0,
|
|
826
|
-
class:
|
|
997
|
+
class: O(["badge d-inline-flex align-items-center gap-1 border flex-shrink-0", `bg-${a.type.couleur}-subtle text-${a.type.couleur}-emphasis border-${a.type.couleur}-subtle`]),
|
|
827
998
|
title: a.type.libelle
|
|
828
|
-
}, [r.iconsReady ? (
|
|
999
|
+
}, [r.iconsReady ? (A(), x(o, {
|
|
829
1000
|
key: 0,
|
|
830
1001
|
icon: a.type.icon,
|
|
831
1002
|
"fixed-width": ""
|
|
832
|
-
}, null, 8, ["icon"])) :
|
|
1003
|
+
}, null, 8, ["icon"])) : S("", !0), n.iconOnly ? S("", !0) : (A(), C("span", sn, I(a.type.libelle), 1))], 10, on)) : S("", !0);
|
|
833
1004
|
}
|
|
834
|
-
var
|
|
1005
|
+
var ln = /*#__PURE__*/ G(an, [["render", cn]]), un = [
|
|
835
1006
|
{
|
|
836
1007
|
key: "locataire",
|
|
837
1008
|
label: "Locataire",
|
|
838
|
-
icon:
|
|
1009
|
+
icon: V.locataire.icon,
|
|
839
1010
|
recherche: "Rechercher un locataire",
|
|
840
1011
|
aucun: "Aucun locataire trouvé.",
|
|
841
1012
|
placeholder: "Nom, prénom, n° de contrat ou de module, adresse, téléphone ou mail…"
|
|
@@ -843,7 +1014,7 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
|
|
|
843
1014
|
{
|
|
844
1015
|
key: "demandeur",
|
|
845
1016
|
label: "Demandeur",
|
|
846
|
-
icon:
|
|
1017
|
+
icon: V.demandeur.icon,
|
|
847
1018
|
recherche: "Rechercher un demandeur",
|
|
848
1019
|
aucun: "Aucun demandeur trouvé.",
|
|
849
1020
|
placeholder: "Nom, prénom, n° de demande ou unique, téléphone ou mail…"
|
|
@@ -851,7 +1022,7 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
|
|
|
851
1022
|
{
|
|
852
1023
|
key: "tiers",
|
|
853
1024
|
label: "Tiers",
|
|
854
|
-
icon:
|
|
1025
|
+
icon: V.tiers.icon,
|
|
855
1026
|
recherche: "Rechercher un tiers",
|
|
856
1027
|
aucun: "Aucun tiers trouvé.",
|
|
857
1028
|
placeholder: "Raison sociale, adresse, téléphone ou mail…"
|
|
@@ -859,7 +1030,7 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
|
|
|
859
1030
|
{
|
|
860
1031
|
key: "autre",
|
|
861
1032
|
label: "Autre",
|
|
862
|
-
icon:
|
|
1033
|
+
icon: V.autre.icon,
|
|
863
1034
|
recherche: "Rechercher un individu « Autre »",
|
|
864
1035
|
aucun: "Aucun individu « Autre » trouvé.",
|
|
865
1036
|
placeholder: "Nom, prénom, adresse, téléphone ou mail…"
|
|
@@ -867,7 +1038,7 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
|
|
|
867
1038
|
{
|
|
868
1039
|
key: "fournisseur",
|
|
869
1040
|
label: "Fournisseur",
|
|
870
|
-
icon:
|
|
1041
|
+
icon: V.fournisseur.icon,
|
|
871
1042
|
recherche: "Rechercher un fournisseur",
|
|
872
1043
|
aucun: "Aucun fournisseur trouvé.",
|
|
873
1044
|
placeholder: "Raison sociale, adresse, téléphone ou mail…"
|
|
@@ -875,7 +1046,7 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
|
|
|
875
1046
|
{
|
|
876
1047
|
key: "personnel",
|
|
877
1048
|
label: "Personnel",
|
|
878
|
-
icon:
|
|
1049
|
+
icon: V.personnel.icon,
|
|
879
1050
|
recherche: "Rechercher un collaborateur",
|
|
880
1051
|
aucun: "Aucun collaborateur trouvé.",
|
|
881
1052
|
placeholder: "Nom, prénom, téléphone ou mail…"
|
|
@@ -888,19 +1059,21 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
|
|
|
888
1059
|
aucun: "Aucun réclamant trouvé.",
|
|
889
1060
|
placeholder: "Nom, prénom, n° de contrat, de module ou de demande, adresse, téléphone ou mail…"
|
|
890
1061
|
}
|
|
891
|
-
],
|
|
1062
|
+
], dn = {
|
|
892
1063
|
signataire: "Signataire",
|
|
893
1064
|
occupant: "Occupant",
|
|
894
1065
|
demandeur: "Demandeur"
|
|
895
|
-
},
|
|
1066
|
+
}, fn = {
|
|
896
1067
|
name: "ReclamantRechercheBlock",
|
|
897
1068
|
components: {
|
|
898
|
-
AmsomAutocomplete:
|
|
899
|
-
|
|
1069
|
+
AmsomAutocomplete: B,
|
|
1070
|
+
AmsomOverlay: v,
|
|
1071
|
+
IconSelectComponent: dt,
|
|
1072
|
+
ReclamantTypeBadgeComponent: ln
|
|
900
1073
|
},
|
|
901
1074
|
setup() {
|
|
902
1075
|
return {
|
|
903
|
-
draft:
|
|
1076
|
+
draft: W(),
|
|
904
1077
|
data: Z(),
|
|
905
1078
|
options: Q()
|
|
906
1079
|
};
|
|
@@ -916,16 +1089,23 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
|
|
|
916
1089
|
},
|
|
917
1090
|
computed: {
|
|
918
1091
|
typesAutorises() {
|
|
919
|
-
return this.options.typesReclamant ??
|
|
1092
|
+
return this.options.typesReclamant ?? H;
|
|
920
1093
|
},
|
|
921
1094
|
autorisees() {
|
|
922
1095
|
return Oe(this.typesAutorises);
|
|
923
1096
|
},
|
|
924
1097
|
categories() {
|
|
925
|
-
return
|
|
1098
|
+
return un.filter((e) => e.key === "tout" ? this.autorisees.length > 1 : this.autorisees.includes(e.key));
|
|
1099
|
+
},
|
|
1100
|
+
categoriesItems() {
|
|
1101
|
+
return this.categories.map((e) => ({
|
|
1102
|
+
id: e.key,
|
|
1103
|
+
libelle: e.label,
|
|
1104
|
+
icon: e.icon
|
|
1105
|
+
}));
|
|
926
1106
|
},
|
|
927
1107
|
categorieCourante() {
|
|
928
|
-
return
|
|
1108
|
+
return un.find((e) => e.key === this.categorie);
|
|
929
1109
|
},
|
|
930
1110
|
selectionne() {
|
|
931
1111
|
return this.draft.reclamantSelectionne;
|
|
@@ -939,18 +1119,21 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
|
|
|
939
1119
|
}
|
|
940
1120
|
}
|
|
941
1121
|
},
|
|
1122
|
+
watch: { selectionne(e) {
|
|
1123
|
+
this.categorie !== "tout" && (this.categorie = this.categorieOf(e) ?? this.categorie);
|
|
1124
|
+
} },
|
|
942
1125
|
async created() {
|
|
943
|
-
this.categorie = this.categorieOf(this.selectionne) ?? this.categories[0]?.key ?? null, await
|
|
1126
|
+
this.categorie = this.categorieOf(this.selectionne) ?? this.categories[0]?.key ?? null, await at(un.map((e) => e.icon)), this.iconsReady = !0;
|
|
944
1127
|
},
|
|
945
1128
|
beforeUnmount() {
|
|
946
1129
|
clearTimeout(this.rechercheTimeout), this.controller?.abort();
|
|
947
1130
|
},
|
|
948
1131
|
methods: {
|
|
949
1132
|
select(e) {
|
|
950
|
-
e &&
|
|
1133
|
+
e && this.draft.selectReclamant(e);
|
|
951
1134
|
},
|
|
952
1135
|
setCategorie(e) {
|
|
953
|
-
e !== this.categorie && (this.categorie = e, clearTimeout(this.rechercheTimeout), this.controller?.abort(), this.trouves = [], this.rechercheEnCours = !1, this.rechercheFaite = !1);
|
|
1136
|
+
e && e !== this.categorie && (this.categorie = e, clearTimeout(this.rechercheTimeout), this.controller?.abort(), this.trouves = [], this.rechercheEnCours = !1, this.rechercheFaite = !1);
|
|
954
1137
|
},
|
|
955
1138
|
rechercherPlusTard(e) {
|
|
956
1139
|
clearTimeout(this.rechercheTimeout), this.rechercheTimeout = setTimeout(() => this.rechercher(e), 400);
|
|
@@ -971,7 +1154,7 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
|
|
|
971
1154
|
return this.autorisees.includes(t) ? t : null;
|
|
972
1155
|
},
|
|
973
1156
|
sortiLibelle(e) {
|
|
974
|
-
return e?.dateSortie == null ? "sorti" : `sorti le ${
|
|
1157
|
+
return e?.dateSortie == null ? "sorti" : `sorti le ${nn(e.dateSortie)}`;
|
|
975
1158
|
},
|
|
976
1159
|
nomsOf(e) {
|
|
977
1160
|
return (e?.individus ?? []).map((e) => [e.nom, e.prenom].filter(Boolean).join(" ")).filter(Boolean).join(", ");
|
|
@@ -993,192 +1176,98 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
|
|
|
993
1176
|
return e ? [e.telephone, e.mail].filter(Boolean).join(" — ") : "";
|
|
994
1177
|
}
|
|
995
1178
|
return t.map((t) => {
|
|
996
|
-
let n = [t.nom, t.prenom].filter(Boolean).join(" "), r = e.estActif && t.dateSortie != null && t.dateSortie * 1e3 < Date.now() ? `sorti le ${
|
|
1179
|
+
let n = [t.nom, t.prenom].filter(Boolean).join(" "), r = e.estActif && t.dateSortie != null && t.dateSortie * 1e3 < Date.now() ? `sorti le ${nn(t.dateSortie)}` : null, i = [dn[t.role]?.toLowerCase(), r].filter(Boolean).join(", ");
|
|
997
1180
|
return i ? `${n} (${i})` : n;
|
|
998
1181
|
}).join(", ");
|
|
999
1182
|
}
|
|
1000
1183
|
}
|
|
1001
|
-
},
|
|
1184
|
+
}, pn = { class: "row g-3" }, mn = {
|
|
1002
1185
|
key: 0,
|
|
1003
|
-
class: "
|
|
1004
|
-
},
|
|
1186
|
+
class: "col-12 col-md-6"
|
|
1187
|
+
}, hn = { class: "col-12" }, gn = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, _n = { class: "min-w-0" }, vn = {
|
|
1005
1188
|
key: 0,
|
|
1006
1189
|
class: "badge bg-warning-subtle text-warning-emphasis ms-1"
|
|
1007
|
-
},
|
|
1190
|
+
}, yn = { class: "text-muted d-block text-truncate" }, bn = { key: 0 }, xn = {
|
|
1008
1191
|
key: 0,
|
|
1009
1192
|
class: "text-muted d-block text-truncate"
|
|
1010
|
-
},
|
|
1193
|
+
}, Sn = {
|
|
1011
1194
|
key: 0,
|
|
1012
1195
|
class: "text-muted"
|
|
1013
1196
|
};
|
|
1014
|
-
function
|
|
1015
|
-
let o =
|
|
1016
|
-
return i.iconsReady ? (
|
|
1017
|
-
key: e.key,
|
|
1018
|
-
type: "button",
|
|
1019
|
-
class: D(["btn btn-sm d-inline-flex align-items-center gap-2", i.categorie === e.key ? "btn-primary" : "btn-outline-primary"]),
|
|
1020
|
-
onClick: (t) => a.setCategorie(e.key)
|
|
1021
|
-
}, [T(o, {
|
|
1022
|
-
icon: e.icon,
|
|
1023
|
-
"fixed-width": ""
|
|
1024
|
-
}, null, 8, ["icon"]), S("span", null, F(e.label), 1)], 10, Jt))), 128))])]), S("div", null, [
|
|
1025
|
-
S("label", Yt, F(a.categorieCourante.recherche), 1),
|
|
1026
|
-
(k(), y(c, {
|
|
1027
|
-
key: i.categorie,
|
|
1028
|
-
modelValue: a.selectedTrouve,
|
|
1029
|
-
"onUpdate:modelValue": t[0] ||= (e) => a.selectedTrouve = e,
|
|
1030
|
-
items: i.trouves,
|
|
1031
|
-
"filtering-function": ({ items: e }) => e,
|
|
1032
|
-
loading: i.rechercheEnCours,
|
|
1033
|
-
"get-id": a.cleReclamant,
|
|
1034
|
-
"get-input-libelle": (e) => e?.libelle ?? "",
|
|
1035
|
-
placeholder: a.categorieCourante.placeholder,
|
|
1036
|
-
"input-size": "sm",
|
|
1037
|
-
"hide-choices": "",
|
|
1038
|
-
"debounce-delay": 0,
|
|
1039
|
-
onSearch: a.rechercherPlusTard
|
|
1040
|
-
}, {
|
|
1041
|
-
options: R((e) => [S("div", Xt, [
|
|
1042
|
-
S("div", { class: D(["fw-medium text-truncate", e?.estActif ? "" : "text-muted"]) }, [
|
|
1043
|
-
T(s, {
|
|
1044
|
-
reclamant: e,
|
|
1045
|
-
"icon-only": "",
|
|
1046
|
-
class: "me-1"
|
|
1047
|
-
}, null, 8, ["reclamant"]),
|
|
1048
|
-
w(" " + F(a.titreOf(e)) + " ", 1),
|
|
1049
|
-
e?.estActif ? b("", !0) : (k(), x("span", Zt, F(a.categorieOf(e) === "demandeur" ? "inactive" : a.sortiLibelle(e)), 1))
|
|
1050
|
-
], 2),
|
|
1051
|
-
S("small", Qt, [w(F(a.referenceOf(e)) + " ", 1), e?.adresse ? (k(), x("span", $t, " — " + F(e.adresse), 1)) : b("", !0)]),
|
|
1052
|
-
a.detailOf(e) ? (k(), x("small", en, F(a.detailOf(e)), 1)) : b("", !0)
|
|
1053
|
-
])]),
|
|
1054
|
-
_: 1
|
|
1055
|
-
}, 8, [
|
|
1056
|
-
"modelValue",
|
|
1057
|
-
"items",
|
|
1058
|
-
"filtering-function",
|
|
1059
|
-
"loading",
|
|
1060
|
-
"get-id",
|
|
1061
|
-
"get-input-libelle",
|
|
1062
|
-
"placeholder",
|
|
1063
|
-
"onSearch"
|
|
1064
|
-
])),
|
|
1065
|
-
i.rechercheFaite && !i.rechercheEnCours && !i.trouves.length ? (k(), x("small", tn, F(a.categorieCourante.aucun), 1)) : b("", !0)
|
|
1066
|
-
])])) : b("", !0);
|
|
1067
|
-
}
|
|
1068
|
-
var rn = /*#__PURE__*/ K(Gt, [["render", nn]]), an = {
|
|
1069
|
-
name: "ProvenanceSelecteurBlock",
|
|
1070
|
-
setup() {
|
|
1071
|
-
return {
|
|
1072
|
-
draft: G(),
|
|
1073
|
-
data: Z(),
|
|
1074
|
-
options: Q()
|
|
1075
|
-
};
|
|
1076
|
-
},
|
|
1077
|
-
data() {
|
|
1078
|
-
return { iconsReady: !1 };
|
|
1079
|
-
},
|
|
1080
|
-
computed: {
|
|
1081
|
-
provenances() {
|
|
1082
|
-
return this.options.provenances;
|
|
1083
|
-
},
|
|
1084
|
-
loaded() {
|
|
1085
|
-
return this.data.cache.provenances != null;
|
|
1086
|
-
},
|
|
1087
|
-
selected() {
|
|
1088
|
-
return this.draft.draft.provenance;
|
|
1089
|
-
},
|
|
1090
|
-
libelleFige() {
|
|
1091
|
-
return this.data.cache.provenances?.find((e) => e.id === this.selected)?.libelle ?? this.selected ?? "—";
|
|
1092
|
-
},
|
|
1093
|
-
provenanceChoisie() {
|
|
1094
|
-
return this.provenances.find((e) => e.id === this.selected) ?? null;
|
|
1095
|
-
}
|
|
1096
|
-
},
|
|
1097
|
-
async created() {
|
|
1098
|
-
await jt([...Object.values(V), Se]), this.iconsReady = !0;
|
|
1099
|
-
},
|
|
1100
|
-
methods: { iconOf: Ce }
|
|
1101
|
-
}, on = {
|
|
1102
|
-
key: 0,
|
|
1103
|
-
class: "fs-7 text-muted"
|
|
1104
|
-
}, sn = { class: "fw-medium" }, cn = { key: 1 }, ln = { class: "d-flex flex-wrap gap-2" }, un = ["onClick"], dn = {
|
|
1105
|
-
key: 0,
|
|
1106
|
-
class: "fs-7 text-danger mt-1"
|
|
1107
|
-
};
|
|
1108
|
-
function fn(e, t, n, r, i, a) {
|
|
1109
|
-
let o = P("font-awesome-icon");
|
|
1110
|
-
return r.draft.isReadonly("provenance") ? (k(), x("div", on, [t[0] ||= w(" Provenance du contact : ", -1), S("span", sn, [i.iconsReady && a.selected ? (k(), y(o, {
|
|
1197
|
+
function Cn(e, t, n, r, i, a) {
|
|
1198
|
+
let o = F("icon-select-component"), s = F("reclamant-type-badge-component"), c = F("amsom-autocomplete"), l = F("amsom-overlay");
|
|
1199
|
+
return i.iconsReady ? (A(), x(l, {
|
|
1111
1200
|
key: 0,
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
function
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1201
|
+
loading: r.options.repriseReclamant
|
|
1202
|
+
}, {
|
|
1203
|
+
default: z(() => [w("div", pn, [
|
|
1204
|
+
e.$slots["avant-categorie"] ? (A(), C("div", mn, [P(e.$slots, "avant-categorie")])) : S("", !0),
|
|
1205
|
+
w("div", { class: O(["col-12", { "col-md-6": e.$slots["avant-categorie"] }]) }, [E(o, {
|
|
1206
|
+
"model-value": i.categorie,
|
|
1207
|
+
items: a.categoriesItems,
|
|
1208
|
+
label: "Le réclamant est…",
|
|
1209
|
+
"onUpdate:modelValue": t[0] ||= (e) => a.setCategorie(e)
|
|
1210
|
+
}, null, 8, ["model-value", "items"])], 2),
|
|
1211
|
+
w("div", hn, [
|
|
1212
|
+
w("label", gn, [T(I(a.categorieCourante.recherche), 1), t[2] ||= w("span", { class: "ms-1 text-danger" }, "*", -1)]),
|
|
1213
|
+
(A(), x(c, {
|
|
1214
|
+
key: i.categorie,
|
|
1215
|
+
modelValue: a.selectedTrouve,
|
|
1216
|
+
"onUpdate:modelValue": t[1] ||= (e) => a.selectedTrouve = e,
|
|
1217
|
+
items: i.trouves,
|
|
1218
|
+
"filtering-function": ({ items: e }) => e,
|
|
1219
|
+
loading: i.rechercheEnCours,
|
|
1220
|
+
"get-id": a.cleReclamant,
|
|
1221
|
+
"get-input-libelle": (e) => e?.libelle ?? "",
|
|
1222
|
+
placeholder: a.categorieCourante.placeholder,
|
|
1223
|
+
"input-size": "sm",
|
|
1224
|
+
"hide-choices": "",
|
|
1225
|
+
"debounce-delay": 0,
|
|
1226
|
+
onSearch: a.rechercherPlusTard
|
|
1227
|
+
}, {
|
|
1228
|
+
options: z((e) => [w("div", _n, [
|
|
1229
|
+
w("div", { class: O(["fw-medium text-truncate", e?.estActif ? "" : "text-muted"]) }, [
|
|
1230
|
+
E(s, {
|
|
1231
|
+
reclamant: e,
|
|
1232
|
+
"icon-only": "",
|
|
1233
|
+
class: "me-1"
|
|
1234
|
+
}, null, 8, ["reclamant"]),
|
|
1235
|
+
T(" " + I(a.titreOf(e)) + " ", 1),
|
|
1236
|
+
e?.estActif ? S("", !0) : (A(), C("span", vn, I(a.categorieOf(e) === "demandeur" ? "inactive" : a.sortiLibelle(e)), 1))
|
|
1237
|
+
], 2),
|
|
1238
|
+
w("small", yn, [T(I(a.referenceOf(e)) + " ", 1), e?.adresse ? (A(), C("span", bn, " — " + I(e.adresse), 1)) : S("", !0)]),
|
|
1239
|
+
a.detailOf(e) ? (A(), C("small", xn, I(a.detailOf(e)), 1)) : S("", !0)
|
|
1240
|
+
])]),
|
|
1241
|
+
_: 1
|
|
1242
|
+
}, 8, [
|
|
1243
|
+
"modelValue",
|
|
1244
|
+
"items",
|
|
1245
|
+
"filtering-function",
|
|
1246
|
+
"loading",
|
|
1247
|
+
"get-id",
|
|
1248
|
+
"get-input-libelle",
|
|
1249
|
+
"placeholder",
|
|
1250
|
+
"onSearch"
|
|
1251
|
+
])),
|
|
1252
|
+
i.rechercheFaite && !i.rechercheEnCours && !i.trouves.length ? (A(), C("small", Sn, I(a.categorieCourante.aucun), 1)) : S("", !0)
|
|
1253
|
+
])
|
|
1254
|
+
])]),
|
|
1255
|
+
_: 3
|
|
1256
|
+
}, 8, ["loading"])) : S("", !0);
|
|
1160
1257
|
}
|
|
1161
|
-
|
|
1162
|
-
//#region src/components/ReclamantSelecteurBlock.vue
|
|
1163
|
-
var yn = {
|
|
1258
|
+
var wn = /*#__PURE__*/ G(fn, [["render", Cn]]), Tn = {
|
|
1164
1259
|
name: "ReclamantSelecteurBlock",
|
|
1165
1260
|
components: {
|
|
1166
|
-
AmsomAutocomplete:
|
|
1167
|
-
ReclamantTypeBadgeComponent:
|
|
1168
|
-
},
|
|
1169
|
-
props: {
|
|
1170
|
-
mode: {
|
|
1171
|
-
type: String,
|
|
1172
|
-
default: null
|
|
1173
|
-
},
|
|
1174
|
-
inline: {
|
|
1175
|
-
type: Boolean,
|
|
1176
|
-
default: !0
|
|
1177
|
-
}
|
|
1261
|
+
AmsomAutocomplete: B,
|
|
1262
|
+
ReclamantTypeBadgeComponent: ln
|
|
1178
1263
|
},
|
|
1264
|
+
props: { mode: {
|
|
1265
|
+
type: String,
|
|
1266
|
+
default: null
|
|
1267
|
+
} },
|
|
1179
1268
|
setup() {
|
|
1180
1269
|
return {
|
|
1181
|
-
draft:
|
|
1270
|
+
draft: W(),
|
|
1182
1271
|
options: Q()
|
|
1183
1272
|
};
|
|
1184
1273
|
},
|
|
@@ -1205,30 +1294,32 @@ var yn = {
|
|
|
1205
1294
|
this.draft.selectReclamant(e);
|
|
1206
1295
|
},
|
|
1207
1296
|
filterReclamants({ search: e, items: t }) {
|
|
1208
|
-
let n = (
|
|
1209
|
-
return n ? t.filter((e) => (
|
|
1297
|
+
let n = (K(e) ?? "").trim();
|
|
1298
|
+
return n ? t.filter((e) => (K(e?.libelle) ?? "").includes(n)) : t;
|
|
1210
1299
|
}
|
|
1211
1300
|
}
|
|
1212
|
-
},
|
|
1301
|
+
}, En = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, Dn = {
|
|
1213
1302
|
key: 0,
|
|
1214
|
-
class: "
|
|
1215
|
-
},
|
|
1216
|
-
key:
|
|
1217
|
-
class: "btn-group btn-group-sm",
|
|
1303
|
+
class: "ms-1 text-danger"
|
|
1304
|
+
}, On = ["value"], kn = {
|
|
1305
|
+
key: 1,
|
|
1306
|
+
class: "btn-group btn-group-sm w-100",
|
|
1218
1307
|
role: "group"
|
|
1219
|
-
},
|
|
1220
|
-
function
|
|
1221
|
-
let o =
|
|
1222
|
-
return
|
|
1223
|
-
key:
|
|
1224
|
-
class:
|
|
1225
|
-
|
|
1308
|
+
}, An = ["onClick"], jn = ["value"], Mn = ["value"];
|
|
1309
|
+
function Nn(e, t, n, r, i, a) {
|
|
1310
|
+
let o = F("reclamant-type-badge-component"), s = F("amsom-autocomplete");
|
|
1311
|
+
return A(), C("div", null, [w("label", En, [t[2] ||= T(" Réclamant", -1), a.estFige ? S("", !0) : (A(), C("span", Dn, "*"))]), a.estFige ? (A(), C("input", {
|
|
1312
|
+
key: 0,
|
|
1313
|
+
class: "form-control form-control-sm",
|
|
1314
|
+
disabled: "",
|
|
1315
|
+
value: a.reclamantSelectionne?.libelle ?? "—"
|
|
1316
|
+
}, null, 8, On)) : a.presentation === "switch" ? (A(), C("div", kn, [(A(!0), C(y, null, N(a.reclamants, (e, t) => (A(), C("button", {
|
|
1226
1317
|
key: t,
|
|
1227
1318
|
type: "button",
|
|
1228
|
-
class:
|
|
1319
|
+
class: O(["btn d-inline-flex align-items-center justify-content-center", e === a.reclamantSelectionne ? "btn-primary" : "btn-outline-primary"]),
|
|
1229
1320
|
onClick: (t) => a.select(e)
|
|
1230
|
-
},
|
|
1231
|
-
key:
|
|
1321
|
+
}, I(e.libelle), 11, An))), 128))])) : a.presentation === "autocomplete" ? (A(), x(s, {
|
|
1322
|
+
key: 2,
|
|
1232
1323
|
"model-value": a.reclamantSelectionne,
|
|
1233
1324
|
items: a.reclamants,
|
|
1234
1325
|
"get-id": a.reclamantId,
|
|
@@ -1236,364 +1327,71 @@ function En(e, t, n, r, i, a) {
|
|
|
1236
1327
|
"filtering-function": a.filterReclamants,
|
|
1237
1328
|
placeholder: "Rechercher un réclamant…",
|
|
1238
1329
|
"input-size": "sm",
|
|
1239
|
-
|
|
1240
|
-
class: D(n.inline ? "" : "w-100"),
|
|
1330
|
+
required: "",
|
|
1241
1331
|
"onUpdate:modelValue": t[0] ||= (e) => a.select(e)
|
|
1242
1332
|
}, {
|
|
1243
|
-
options:
|
|
1333
|
+
options: z((e) => [E(o, {
|
|
1244
1334
|
reclamant: e,
|
|
1245
1335
|
"icon-only": "",
|
|
1246
1336
|
class: "me-1"
|
|
1247
|
-
}, null, 8, ["reclamant"]),
|
|
1337
|
+
}, null, 8, ["reclamant"]), T(" " + I(e?.libelle), 1)]),
|
|
1248
1338
|
_: 1
|
|
1249
1339
|
}, 8, [
|
|
1250
1340
|
"model-value",
|
|
1251
1341
|
"items",
|
|
1252
1342
|
"get-id",
|
|
1253
1343
|
"get-input-libelle",
|
|
1254
|
-
"filtering-function"
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
class: D(["form-select form-select-sm", n.inline ? "w-auto" : ""]),
|
|
1344
|
+
"filtering-function"
|
|
1345
|
+
])) : (A(), C("select", {
|
|
1346
|
+
key: 3,
|
|
1347
|
+
class: "form-select form-select-sm",
|
|
1259
1348
|
value: a.reclamants.indexOf(a.reclamantSelectionne),
|
|
1260
1349
|
onChange: t[1] ||= (e) => a.select(a.reclamants[e.target.value])
|
|
1261
|
-
}, [(
|
|
1350
|
+
}, [(A(!0), C(y, null, N(a.reclamants, (e, t) => (A(), C("option", {
|
|
1262
1351
|
key: t,
|
|
1263
1352
|
value: t
|
|
1264
|
-
},
|
|
1353
|
+
}, I(e.libelle), 9, Mn))), 128))], 40, jn))]);
|
|
1265
1354
|
}
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
computed: {
|
|
1291
|
-
mainLigne() {
|
|
1292
|
-
return this.draft.lignePrincipale;
|
|
1293
|
-
},
|
|
1294
|
-
motifFige() {
|
|
1295
|
-
return this.draft.isReadonly("motif");
|
|
1296
|
-
},
|
|
1297
|
-
activeMotifs() {
|
|
1298
|
-
return (this.data.cache.motifs ?? []).filter((e) => !e.estDesactive).slice().sort((e, t) => (e.categorie ?? "").localeCompare(t.categorie ?? "") || (e.type ?? "").localeCompare(t.type ?? "") || (e.nature ?? "").localeCompare(t.nature ?? "") || (e.libelle ?? "").localeCompare(t.libelle ?? ""));
|
|
1355
|
+
var Pn = /*#__PURE__*/ G(Tn, [["render", Nn]]), Fn = {
|
|
1356
|
+
B: "briefcase",
|
|
1357
|
+
M: "store",
|
|
1358
|
+
W: "dungeon",
|
|
1359
|
+
E: "user-graduate",
|
|
1360
|
+
K: "building-shield",
|
|
1361
|
+
F: "person-shelter",
|
|
1362
|
+
S: "square-parking",
|
|
1363
|
+
V: "hands-holding"
|
|
1364
|
+
};
|
|
1365
|
+
function In(e, t = !1, n = "circle-question") {
|
|
1366
|
+
return e === "L" ? t ? "building" : "house" : Fn[e] ?? n;
|
|
1367
|
+
}
|
|
1368
|
+
function Ln(e) {
|
|
1369
|
+
return e ? e.idCategorieModule === "L" ? e.estCollectif ? "Appartement" : "Maison" : e.categorieModule ?? "" : "";
|
|
1370
|
+
}
|
|
1371
|
+
// src/components/CiblePickerBlock.vue
|
|
1372
|
+
var Rn = 0, zn = {
|
|
1373
|
+
name: "CiblePickerBlock",
|
|
1374
|
+
components: { AmsomAutocomplete: B },
|
|
1375
|
+
props: {
|
|
1376
|
+
patrimoine: {
|
|
1377
|
+
type: Object,
|
|
1378
|
+
default: null
|
|
1299
1379
|
},
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
let t = this.draft.reclamantSelectionne;
|
|
1304
|
-
return this.activeMotifs.filter((n) => e(n, { reclamant: t }));
|
|
1380
|
+
cibleMode: {
|
|
1381
|
+
type: String,
|
|
1382
|
+
default: "contrat"
|
|
1305
1383
|
},
|
|
1306
|
-
|
|
1307
|
-
|
|
1384
|
+
reclamantModules: {
|
|
1385
|
+
type: Array,
|
|
1386
|
+
default: () => []
|
|
1308
1387
|
},
|
|
1309
|
-
|
|
1310
|
-
|
|
1388
|
+
reclamantType: {
|
|
1389
|
+
type: String,
|
|
1390
|
+
default: null
|
|
1311
1391
|
},
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
motifsList() {
|
|
1316
|
-
return this.mainLigne.idNature ? this.allowedMotifs.filter((e) => e.idNature === this.mainLigne.idNature).map((e) => ({
|
|
1317
|
-
id: e.id,
|
|
1318
|
-
libelle: e.libelle,
|
|
1319
|
-
icon: e.icon
|
|
1320
|
-
})) : [];
|
|
1321
|
-
},
|
|
1322
|
-
selectedMotif() {
|
|
1323
|
-
return this.mainLigne.idMotif ? this.activeMotifs.find((e) => e.id === this.mainLigne.idMotif) ?? null : null;
|
|
1324
|
-
},
|
|
1325
|
-
motifsAssocies() {
|
|
1326
|
-
let e = this.selectedMotif?.association;
|
|
1327
|
-
return e ? Object.entries(e).map(([e, t]) => ({
|
|
1328
|
-
libelle: e,
|
|
1329
|
-
idMotif: t
|
|
1330
|
-
})) : [];
|
|
1331
|
-
},
|
|
1332
|
-
selectionChain() {
|
|
1333
|
-
let e = [];
|
|
1334
|
-
return this.mainLigne.idCategorie && e.push({
|
|
1335
|
-
level: "categorie",
|
|
1336
|
-
libelle: this.data.categorieLibelle(this.mainLigne.idCategorie),
|
|
1337
|
-
icon: this.data.categorieIcon(this.mainLigne.idCategorie)
|
|
1338
|
-
}), this.mainLigne.idType && e.push({
|
|
1339
|
-
level: "type",
|
|
1340
|
-
libelle: this.data.typeLibelle(this.mainLigne.idType),
|
|
1341
|
-
icon: this.data.typeIcon(this.mainLigne.idType)
|
|
1342
|
-
}), this.mainLigne.idNature && e.push({
|
|
1343
|
-
level: "nature",
|
|
1344
|
-
libelle: this.data.natureLibelle(this.mainLigne.idNature),
|
|
1345
|
-
icon: this.data.natureIcon(this.mainLigne.idNature)
|
|
1346
|
-
}), this.mainLigne.idMotif && e.push({
|
|
1347
|
-
level: "motif",
|
|
1348
|
-
libelle: this.data.motifLibelle(this.mainLigne.idMotif),
|
|
1349
|
-
icon: this.data.motifIcon(this.mainLigne.idMotif)
|
|
1350
|
-
}), e;
|
|
1351
|
-
},
|
|
1352
|
-
currentLevel() {
|
|
1353
|
-
return this.mainLigne.idCategorie ? this.mainLigne.idType ? this.mainLigne.idNature ? this.mainLigne.idMotif ? null : {
|
|
1354
|
-
title: "Motif",
|
|
1355
|
-
options: this.motifsList,
|
|
1356
|
-
select: (e) => this.draft.setMotif(e)
|
|
1357
|
-
} : {
|
|
1358
|
-
title: "Nature",
|
|
1359
|
-
options: this.naturesList,
|
|
1360
|
-
select: (e) => this.draft.setNature(e)
|
|
1361
|
-
} : {
|
|
1362
|
-
title: "Type",
|
|
1363
|
-
options: this.typesList,
|
|
1364
|
-
select: (e) => this.draft.setType(e)
|
|
1365
|
-
} : {
|
|
1366
|
-
title: "Catégorie",
|
|
1367
|
-
options: this.categoriesList,
|
|
1368
|
-
select: (e) => this.draft.setCategorie(e)
|
|
1369
|
-
};
|
|
1370
|
-
},
|
|
1371
|
-
motifRecherche: {
|
|
1372
|
-
get() {
|
|
1373
|
-
return this.selectedMotif;
|
|
1374
|
-
},
|
|
1375
|
-
set(e) {
|
|
1376
|
-
let t = e && typeof e == "object" ? e : e ? this.activeMotifs.find((t) => t.id === e) : null;
|
|
1377
|
-
t ? this.draft.selectMotifChain(t) : this.draft.setCategorie(null);
|
|
1378
|
-
}
|
|
1379
|
-
}
|
|
1380
|
-
},
|
|
1381
|
-
async created() {
|
|
1382
|
-
await this.data.loadNomenclature(), await this.registerIcons(), this.iconsReady = !0;
|
|
1383
|
-
},
|
|
1384
|
-
methods: {
|
|
1385
|
-
goBackTo(e) {
|
|
1386
|
-
e === "categorie" ? this.draft.setCategorie(null) : e === "type" ? this.draft.setType(null) : e === "nature" ? this.draft.setNature(null) : e === "motif" && this.draft.setMotif(null);
|
|
1387
|
-
},
|
|
1388
|
-
isActive(e) {
|
|
1389
|
-
return this.draft.lignesAssociees.some((t) => t.idMotif === e);
|
|
1390
|
-
},
|
|
1391
|
-
toggleMotifAssocie(e) {
|
|
1392
|
-
let t = this.activeMotifs.find((t) => t.id === e.idMotif);
|
|
1393
|
-
this.draft.toggleLigneAssociee(e.idMotif, {
|
|
1394
|
-
libelle: e.libelle,
|
|
1395
|
-
idCategorie: t?.idCategorie ?? null,
|
|
1396
|
-
idType: t?.idType ?? null,
|
|
1397
|
-
idNature: t?.idNature ?? null
|
|
1398
|
-
});
|
|
1399
|
-
},
|
|
1400
|
-
registerIcons() {
|
|
1401
|
-
return jt([
|
|
1402
|
-
...this.data.cache.categories ?? [],
|
|
1403
|
-
...this.data.cache.types ?? [],
|
|
1404
|
-
...this.data.cache.natures ?? [],
|
|
1405
|
-
...this.activeMotifs
|
|
1406
|
-
].map((e) => e.icon));
|
|
1407
|
-
},
|
|
1408
|
-
filterMotifs({ search: e, items: t }) {
|
|
1409
|
-
let n = ($(e) ?? "").trim();
|
|
1410
|
-
if (!n) return t;
|
|
1411
|
-
let r = n.split(/\s+/);
|
|
1412
|
-
return t.filter((e) => {
|
|
1413
|
-
let t = $(`${e.libelle} ${e.categorie} ${e.type} ${e.nature}`) ?? "";
|
|
1414
|
-
return r.every((e) => t.includes(e));
|
|
1415
|
-
});
|
|
1416
|
-
},
|
|
1417
|
-
getMotifId(e) {
|
|
1418
|
-
return e ? e.id : null;
|
|
1419
|
-
},
|
|
1420
|
-
getMotifInputLibelle(e) {
|
|
1421
|
-
return e ? e.libelle : "";
|
|
1422
|
-
},
|
|
1423
|
-
distinct(e, t, n, r) {
|
|
1424
|
-
let i = /* @__PURE__ */ new Map();
|
|
1425
|
-
for (let a of e) a[t] != null && !i.has(a[t]) && i.set(a[t], {
|
|
1426
|
-
id: a[t],
|
|
1427
|
-
libelle: a[n] ?? a[t],
|
|
1428
|
-
icon: r ? r(a[t]) : null
|
|
1429
|
-
});
|
|
1430
|
-
return [...i.values()].sort((e, t) => (e.libelle ?? "").localeCompare(t.libelle ?? ""));
|
|
1431
|
-
},
|
|
1432
|
-
motifLibelleFromId(e) {
|
|
1433
|
-
return this.activeMotifs.find((t) => t.id === e)?.libelle ?? e;
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1436
|
-
}, On = {
|
|
1437
|
-
key: 0,
|
|
1438
|
-
class: "d-flex flex-column gap-3"
|
|
1439
|
-
}, kn = { key: 2 }, An = { class: "d-flex flex-wrap align-items-center gap-2" }, jn = { class: "badge rounded-pill bg-primary d-inline-flex align-items-center gap-2" }, Mn = { key: 3 }, Nn = { class: "d-flex align-items-center gap-2" }, Pn = { class: "min-w-0" }, Fn = { class: "fw-medium text-truncate" }, In = { class: "text-muted d-block text-truncate" }, Ln = {
|
|
1440
|
-
key: 4,
|
|
1441
|
-
class: "d-flex align-items-center gap-2 text-muted fs-7"
|
|
1442
|
-
}, Rn = {
|
|
1443
|
-
key: 5,
|
|
1444
|
-
class: "d-flex flex-wrap align-items-center gap-2"
|
|
1445
|
-
}, zn = ["onClick"], Bn = { key: 6 }, Vn = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-2" }, Hn = { class: "row justify-content-around g-3" }, Un = ["title", "onClick"], Wn = { class: "fs-7 mt-1 lh-sm" }, Gn = {
|
|
1446
|
-
key: 0,
|
|
1447
|
-
class: "col-12 text-muted fs-7"
|
|
1448
|
-
}, Kn = [
|
|
1449
|
-
"id",
|
|
1450
|
-
"checked",
|
|
1451
|
-
"disabled",
|
|
1452
|
-
"onChange"
|
|
1453
|
-
], qn = ["for"];
|
|
1454
|
-
function Jn(e, t, n, r, i, a) {
|
|
1455
|
-
let o = P("provenance-selecteur-block"), s = P("reclamant-selecteur-block"), c = P("font-awesome-icon"), l = P("amsom-autocomplete"), u = P("amsom-overlay");
|
|
1456
|
-
return k(), y(u, { loading: r.data.isLoading && !r.data.cache.motifs || !i.iconsReady }, {
|
|
1457
|
-
default: R(() => [i.iconsReady ? (k(), x("div", On, [
|
|
1458
|
-
n.premiere ? (k(), y(o, { key: 0 })) : b("", !0),
|
|
1459
|
-
r.options.reclamantMode === "step" ? b("", !0) : (k(), y(s, { key: 1 })),
|
|
1460
|
-
a.motifFige && a.selectionChain.length ? (k(), x("div", kn, [t[1] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Motif", -1), S("div", An, [(k(!0), x(_, null, M(a.selectionChain, (e, t) => (k(), x(_, { key: e.level }, [t > 0 ? (k(), y(c, {
|
|
1461
|
-
key: 0,
|
|
1462
|
-
icon: "fa-solid fa-chevron-right",
|
|
1463
|
-
class: "text-muted fs-7"
|
|
1464
|
-
})) : b("", !0), S("span", jn, [e.icon ? (k(), y(c, {
|
|
1465
|
-
key: 0,
|
|
1466
|
-
icon: e.icon,
|
|
1467
|
-
"fixed-width": ""
|
|
1468
|
-
}, null, 8, ["icon"])) : b("", !0), w(" " + F(e.libelle), 1)])], 64))), 128))])])) : b("", !0),
|
|
1469
|
-
a.motifFige ? b("", !0) : (k(), x("div", Mn, [t[2] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Rechercher un motif ", -1), T(l, {
|
|
1470
|
-
modelValue: a.motifRecherche,
|
|
1471
|
-
"onUpdate:modelValue": t[0] ||= (e) => a.motifRecherche = e,
|
|
1472
|
-
items: a.allowedMotifs,
|
|
1473
|
-
"get-id": a.getMotifId,
|
|
1474
|
-
"get-input-libelle": a.getMotifInputLibelle,
|
|
1475
|
-
"get-input-libelle-from-id": a.motifLibelleFromId,
|
|
1476
|
-
"filtering-function": a.filterMotifs,
|
|
1477
|
-
placeholder: "Rechercher (motif, catégorie, type, nature)…",
|
|
1478
|
-
"input-size": "sm",
|
|
1479
|
-
"hide-choices": ""
|
|
1480
|
-
}, {
|
|
1481
|
-
options: R((e) => [S("div", Nn, [e?.icon ? (k(), y(c, {
|
|
1482
|
-
key: 0,
|
|
1483
|
-
icon: e.icon,
|
|
1484
|
-
class: "text-primary",
|
|
1485
|
-
"fixed-width": ""
|
|
1486
|
-
}, null, 8, ["icon"])) : b("", !0), S("div", Pn, [S("div", Fn, F(e?.libelle), 1), S("small", In, F(e?.categorie) + " › " + F(e?.type) + " › " + F(e?.nature), 1)])])]),
|
|
1487
|
-
_: 1
|
|
1488
|
-
}, 8, [
|
|
1489
|
-
"modelValue",
|
|
1490
|
-
"items",
|
|
1491
|
-
"get-id",
|
|
1492
|
-
"get-input-libelle",
|
|
1493
|
-
"get-input-libelle-from-id",
|
|
1494
|
-
"filtering-function"
|
|
1495
|
-
])])),
|
|
1496
|
-
a.motifFige ? b("", !0) : (k(), x("div", Ln, [...t[3] ||= [
|
|
1497
|
-
S("hr", { class: "flex-grow-1 my-0" }, null, -1),
|
|
1498
|
-
S("span", null, "ou sélection guidée", -1),
|
|
1499
|
-
S("hr", { class: "flex-grow-1 my-0" }, null, -1)
|
|
1500
|
-
]])),
|
|
1501
|
-
!a.motifFige && a.selectionChain.length ? (k(), x("div", Rn, [(k(!0), x(_, null, M(a.selectionChain, (e, t) => (k(), x(_, { key: e.level }, [t > 0 ? (k(), y(c, {
|
|
1502
|
-
key: 0,
|
|
1503
|
-
icon: "fa-solid fa-chevron-right",
|
|
1504
|
-
class: "text-muted fs-7"
|
|
1505
|
-
})) : b("", !0), S("button", {
|
|
1506
|
-
type: "button",
|
|
1507
|
-
class: "btn btn-sm btn-primary rounded-pill d-inline-flex align-items-center gap-2",
|
|
1508
|
-
onClick: (t) => a.goBackTo(e.level)
|
|
1509
|
-
}, [
|
|
1510
|
-
e.icon ? (k(), y(c, {
|
|
1511
|
-
key: 0,
|
|
1512
|
-
icon: e.icon,
|
|
1513
|
-
"fixed-width": ""
|
|
1514
|
-
}, null, 8, ["icon"])) : b("", !0),
|
|
1515
|
-
S("span", null, F(e.libelle), 1),
|
|
1516
|
-
T(c, {
|
|
1517
|
-
icon: "fa-solid fa-xmark",
|
|
1518
|
-
class: "fs-7 opacity-75"
|
|
1519
|
-
})
|
|
1520
|
-
], 8, zn)], 64))), 128))])) : b("", !0),
|
|
1521
|
-
!a.motifFige && a.currentLevel ? (k(), x("div", Bn, [S("label", Vn, F(a.currentLevel.title), 1), S("div", Hn, [(k(!0), x(_, null, M(a.currentLevel.options, (e) => (k(), x("div", {
|
|
1522
|
-
key: e.id,
|
|
1523
|
-
class: "col-3 text-center"
|
|
1524
|
-
}, [S("button", {
|
|
1525
|
-
type: "button",
|
|
1526
|
-
class: "btn btn-lg btn-outline-primary btn-circle d-flex align-items-center justify-content-center mx-auto",
|
|
1527
|
-
title: e.libelle,
|
|
1528
|
-
onClick: (t) => a.currentLevel.select(e.id)
|
|
1529
|
-
}, [e.icon ? (k(), y(c, {
|
|
1530
|
-
key: 0,
|
|
1531
|
-
icon: e.icon,
|
|
1532
|
-
size: "lg"
|
|
1533
|
-
}, null, 8, ["icon"])) : b("", !0)], 8, Un), S("div", Wn, F(e.libelle), 1)]))), 128)), a.currentLevel.options.length ? b("", !0) : (k(), x("div", Gn, " Aucun choix disponible "))])])) : b("", !0),
|
|
1534
|
-
a.motifsAssocies.length ? (k(), x(_, { key: 7 }, [t[4] ||= S("div", { class: "d-flex align-items-center gap-2 text-muted fs-7" }, [
|
|
1535
|
-
S("hr", { class: "flex-grow-1 my-0" }),
|
|
1536
|
-
S("span", null, "Autres motifs liés"),
|
|
1537
|
-
S("hr", { class: "flex-grow-1 my-0" })
|
|
1538
|
-
], -1), (k(!0), x(_, null, M(a.motifsAssocies, (e) => (k(), x("div", {
|
|
1539
|
-
key: e.idMotif,
|
|
1540
|
-
class: "form-check form-switch"
|
|
1541
|
-
}, [S("input", {
|
|
1542
|
-
id: `assoc-${e.idMotif}`,
|
|
1543
|
-
class: "form-check-input",
|
|
1544
|
-
type: "checkbox",
|
|
1545
|
-
checked: a.isActive(e.idMotif),
|
|
1546
|
-
disabled: a.motifFige,
|
|
1547
|
-
onChange: (t) => a.toggleMotifAssocie(e)
|
|
1548
|
-
}, null, 40, Kn), S("label", {
|
|
1549
|
-
class: "form-check-label fs-7",
|
|
1550
|
-
for: `assoc-${e.idMotif}`
|
|
1551
|
-
}, F(e.libelle) + " ? ", 9, qn)]))), 128))], 64)) : b("", !0)
|
|
1552
|
-
])) : b("", !0)]),
|
|
1553
|
-
_: 1
|
|
1554
|
-
}, 8, ["loading"]);
|
|
1555
|
-
}
|
|
1556
|
-
var Yn = /*#__PURE__*/ K(Dn, [["render", Jn]]), Xn = {
|
|
1557
|
-
B: "briefcase",
|
|
1558
|
-
M: "store",
|
|
1559
|
-
W: "dungeon",
|
|
1560
|
-
E: "user-graduate",
|
|
1561
|
-
K: "building-shield",
|
|
1562
|
-
F: "person-shelter",
|
|
1563
|
-
S: "square-parking",
|
|
1564
|
-
V: "hands-holding"
|
|
1565
|
-
};
|
|
1566
|
-
function Zn(e, t = !1, n = "circle-question") {
|
|
1567
|
-
return e === "L" ? t ? "building" : "house" : Xn[e] ?? n;
|
|
1568
|
-
}
|
|
1569
|
-
function Qn(e) {
|
|
1570
|
-
return e ? e.idCategorieModule === "L" ? e.estCollectif ? "Appartement" : "Maison" : e.categorieModule ?? "" : "";
|
|
1571
|
-
}
|
|
1572
|
-
//#endregion
|
|
1573
|
-
//#region src/components/CiblePickerBlock.vue
|
|
1574
|
-
var $n = 0, er = {
|
|
1575
|
-
name: "CiblePickerBlock",
|
|
1576
|
-
components: { AmsomAutocomplete: z },
|
|
1577
|
-
props: {
|
|
1578
|
-
patrimoine: {
|
|
1579
|
-
type: Object,
|
|
1580
|
-
default: null
|
|
1581
|
-
},
|
|
1582
|
-
cibleMode: {
|
|
1583
|
-
type: String,
|
|
1584
|
-
default: "contrat"
|
|
1585
|
-
},
|
|
1586
|
-
reclamantModules: {
|
|
1587
|
-
type: Array,
|
|
1588
|
-
default: () => []
|
|
1589
|
-
},
|
|
1590
|
-
reclamantType: {
|
|
1591
|
-
type: String,
|
|
1592
|
-
default: null
|
|
1593
|
-
},
|
|
1594
|
-
contratReclamant: {
|
|
1595
|
-
type: Boolean,
|
|
1596
|
-
default: !0
|
|
1392
|
+
contratReclamant: {
|
|
1393
|
+
type: Boolean,
|
|
1394
|
+
default: !0
|
|
1597
1395
|
},
|
|
1598
1396
|
contratCible: {
|
|
1599
1397
|
type: Object,
|
|
@@ -1628,7 +1426,7 @@ var $n = 0, er = {
|
|
|
1628
1426
|
},
|
|
1629
1427
|
data() {
|
|
1630
1428
|
return {
|
|
1631
|
-
uid:
|
|
1429
|
+
uid: ++Rn,
|
|
1632
1430
|
rechercheContrat: "",
|
|
1633
1431
|
contratsTrouves: [],
|
|
1634
1432
|
rechercheEnCours: !1,
|
|
@@ -1775,7 +1573,7 @@ var $n = 0, er = {
|
|
|
1775
1573
|
clearTimeout(this.rechercheTimeout), this.controller?.abort();
|
|
1776
1574
|
},
|
|
1777
1575
|
methods: {
|
|
1778
|
-
formatDate:
|
|
1576
|
+
formatDate: nn,
|
|
1779
1577
|
rechercherPlusTard(e) {
|
|
1780
1578
|
clearTimeout(this.rechercheTimeout), this.rechercheTimeout = setTimeout(() => this.rechercherContrat(e), 400);
|
|
1781
1579
|
},
|
|
@@ -1795,16 +1593,16 @@ var $n = 0, er = {
|
|
|
1795
1593
|
},
|
|
1796
1594
|
filterOn(e) {
|
|
1797
1595
|
return ({ search: t, items: n }) => {
|
|
1798
|
-
let r = (
|
|
1799
|
-
return r ? n.filter((t) => (
|
|
1596
|
+
let r = (K(t) ?? "").trim();
|
|
1597
|
+
return r ? n.filter((t) => (K(t?.[e]) ?? "").includes(r)) : n;
|
|
1800
1598
|
};
|
|
1801
1599
|
},
|
|
1802
1600
|
filterModules({ search: e, items: t }) {
|
|
1803
|
-
let n = (
|
|
1804
|
-
return n ? t.filter((e) => String(e?.idModule ?? "").includes(n) || (
|
|
1601
|
+
let n = (K(e) ?? "").trim();
|
|
1602
|
+
return n ? t.filter((e) => String(e?.idModule ?? "").includes(n) || (K(this.moduleInputLibelle(e)) ?? "").includes(n) || (K(e?._autreLibelle) ?? "").includes(n)) : t;
|
|
1805
1603
|
},
|
|
1806
|
-
getCategorieModuleIcon:
|
|
1807
|
-
categorieLibelle:
|
|
1604
|
+
getCategorieModuleIcon: In,
|
|
1605
|
+
categorieLibelle: Ln,
|
|
1808
1606
|
moduleLibelle(e) {
|
|
1809
1607
|
return e ? e.libelleModule ?? e.adresse ?? `Module ${e.idModule}` : "";
|
|
1810
1608
|
},
|
|
@@ -1816,63 +1614,63 @@ var $n = 0, er = {
|
|
|
1816
1614
|
return !!e?.dateFin && e.dateFin < Math.floor(Date.now() / 1e3);
|
|
1817
1615
|
}
|
|
1818
1616
|
}
|
|
1819
|
-
},
|
|
1617
|
+
}, Bn = { class: "d-flex flex-column gap-3" }, Vn = {
|
|
1820
1618
|
class: "btn-group w-100",
|
|
1821
1619
|
role: "group"
|
|
1822
|
-
},
|
|
1620
|
+
}, Hn = ["onClick"], Un = { class: "text-muted d-block mt-1" }, Wn = {
|
|
1823
1621
|
key: 0,
|
|
1824
1622
|
class: "form-check"
|
|
1825
|
-
},
|
|
1623
|
+
}, Gn = ["id", "checked"], Kn = ["for"], qn = { key: 1 }, Jn = { class: "min-w-0" }, Yn = { class: "fw-medium text-truncate text-capitalize" }, Xn = { class: "d-flex flex-wrap align-items-center gap-1" }, Zn = { class: "text-muted" }, Qn = {
|
|
1826
1624
|
key: 0,
|
|
1827
1625
|
class: "badge bg-info"
|
|
1828
|
-
},
|
|
1626
|
+
}, $n = {
|
|
1829
1627
|
key: 1,
|
|
1830
1628
|
class: "badge bg-warning"
|
|
1831
|
-
},
|
|
1629
|
+
}, er = {
|
|
1832
1630
|
key: 0,
|
|
1833
1631
|
class: "text-muted d-block text-truncate"
|
|
1834
|
-
},
|
|
1632
|
+
}, tr = { key: 1 }, nr = { class: "row g-2" }, rr = ["aria-pressed", "onClick"], ir = { class: "min-w-0" }, ar = { class: "d-block fw-semibold fs-6" }, or = { class: "d-block text-muted" }, sr = {
|
|
1835
1633
|
key: 2,
|
|
1836
1634
|
class: "row g-3"
|
|
1837
|
-
},
|
|
1635
|
+
}, cr = { class: "min-w-0" }, lr = { class: "fw-medium text-truncate" }, ur = { class: "text-muted d-block text-truncate" }, dr = ["value"], fr = ["value"], pr = ["value"], mr = {
|
|
1838
1636
|
key: 0,
|
|
1839
1637
|
class: "col-12 col-md-6"
|
|
1840
|
-
},
|
|
1638
|
+
}, hr = { class: "d-flex flex-wrap align-items-center gap-1" }, gr = ["title"], _r = { class: "text-muted" }, vr = {
|
|
1841
1639
|
key: 1,
|
|
1842
1640
|
class: "d-block text-truncate"
|
|
1843
|
-
},
|
|
1641
|
+
}, yr = {
|
|
1844
1642
|
key: 2,
|
|
1845
1643
|
class: "text-muted d-block"
|
|
1846
|
-
},
|
|
1644
|
+
}, br = {
|
|
1847
1645
|
key: 0,
|
|
1848
1646
|
class: "mt-2 d-flex flex-column gap-2"
|
|
1849
|
-
},
|
|
1850
|
-
function
|
|
1851
|
-
let o =
|
|
1852
|
-
return
|
|
1853
|
-
|
|
1854
|
-
t[7] ||=
|
|
1855
|
-
|
|
1647
|
+
}, xr = { class: "form-check mb-0 ms-3" }, Sr = ["id", "checked"], Cr = ["for"];
|
|
1648
|
+
function wr(e, t, n, r, i, a) {
|
|
1649
|
+
let o = F("font-awesome-icon"), s = F("amsom-autocomplete");
|
|
1650
|
+
return A(), C("div", Bn, [
|
|
1651
|
+
w("div", null, [
|
|
1652
|
+
t[7] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " La sollicitation concerne… ", -1),
|
|
1653
|
+
w("div", Vn, [(A(!0), C(y, null, N(a.availableModes, (t) => (A(), C("button", {
|
|
1856
1654
|
key: t.key,
|
|
1857
1655
|
type: "button",
|
|
1858
|
-
class:
|
|
1656
|
+
class: O(["btn btn-sm", n.cibleMode === t.key ? "btn-primary" : "btn-outline-primary"]),
|
|
1859
1657
|
onClick: (n) => e.$emit("change-mode", t.key)
|
|
1860
|
-
}, [
|
|
1658
|
+
}, [E(o, {
|
|
1861
1659
|
icon: t.icon,
|
|
1862
1660
|
class: "me-1"
|
|
1863
|
-
}, null, 8, ["icon"]),
|
|
1864
|
-
|
|
1661
|
+
}, null, 8, ["icon"]), T(" " + I(t.label), 1)], 10, Hn))), 128))]),
|
|
1662
|
+
w("small", Un, I(a.currentMode?.aide), 1)
|
|
1865
1663
|
]),
|
|
1866
|
-
n.cibleMode === "contrat" ? (
|
|
1664
|
+
n.cibleMode === "contrat" ? (A(), C(y, { key: 0 }, [n.afficheCaseContratReclamant ? (A(), C("div", Wn, [w("input", {
|
|
1867
1665
|
id: `contrat-reclamant-${i.uid}`,
|
|
1868
1666
|
class: "form-check-input",
|
|
1869
1667
|
type: "checkbox",
|
|
1870
1668
|
checked: n.contratReclamant,
|
|
1871
1669
|
onChange: t[0] ||= (t) => e.$emit("toggle-contrat-reclamant", t.target.checked)
|
|
1872
|
-
}, null, 40,
|
|
1670
|
+
}, null, 40, Gn), w("label", {
|
|
1873
1671
|
class: "form-check-label fs-7",
|
|
1874
1672
|
for: `contrat-reclamant-${i.uid}`
|
|
1875
|
-
}, " Contrat du réclamant ", 8,
|
|
1673
|
+
}, " Contrat du réclamant ", 8, Kn)])) : S("", !0), n.contratReclamant ? S("", !0) : (A(), C("div", qn, [t[8] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Contrat ciblé ", -1), E(s, {
|
|
1876
1674
|
modelValue: a.selectedContrat,
|
|
1877
1675
|
"onUpdate:modelValue": t[1] ||= (e) => a.selectedContrat = e,
|
|
1878
1676
|
items: i.contratsTrouves,
|
|
@@ -1886,14 +1684,14 @@ function zr(e, t, n, r, i, a) {
|
|
|
1886
1684
|
"debounce-delay": 0,
|
|
1887
1685
|
onSearch: a.rechercherPlusTard
|
|
1888
1686
|
}, {
|
|
1889
|
-
options:
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
e?.nbModules > 1 ? (
|
|
1894
|
-
e?.estSorti ? (
|
|
1687
|
+
options: z((e) => [w("div", Jn, [
|
|
1688
|
+
w("div", Yn, I(e?.libelle ?? `Contrat ${e?.idContrat}`), 1),
|
|
1689
|
+
w("div", Xn, [
|
|
1690
|
+
w("small", Zn, "N° " + I(e?.typeContrat) + "/" + I(e?.idContrat), 1),
|
|
1691
|
+
e?.nbModules > 1 ? (A(), C("span", Qn, I(e.nbModules) + " modules", 1)) : S("", !0),
|
|
1692
|
+
e?.estSorti ? (A(), C("span", $n, I(e.dateSortie ? `Sorti le ${a.formatDate(e.dateSortie)}` : "Sorti"), 1)) : S("", !0)
|
|
1895
1693
|
]),
|
|
1896
|
-
a.contratAdresse(e) ? (
|
|
1694
|
+
a.contratAdresse(e) ? (A(), C("small", er, I(a.contratAdresse(e)), 1)) : S("", !0)
|
|
1897
1695
|
])]),
|
|
1898
1696
|
_: 1
|
|
1899
1697
|
}, 8, [
|
|
@@ -1904,22 +1702,22 @@ function zr(e, t, n, r, i, a) {
|
|
|
1904
1702
|
"get-id",
|
|
1905
1703
|
"get-input-libelle",
|
|
1906
1704
|
"onSearch"
|
|
1907
|
-
])]))], 64)) :
|
|
1908
|
-
n.cibleMode === "patrimoine" ? (
|
|
1705
|
+
])]))], 64)) : S("", !0),
|
|
1706
|
+
n.cibleMode === "patrimoine" ? (A(), C("div", tr, [t[9] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Le problème concerne… ", -1), w("div", nr, [(A(!0), C(y, null, N(a.portees, (t) => (A(), C("div", {
|
|
1909
1707
|
key: t.titre,
|
|
1910
1708
|
class: "col-12 col-md-6"
|
|
1911
|
-
}, [
|
|
1709
|
+
}, [w("button", {
|
|
1912
1710
|
type: "button",
|
|
1913
|
-
class:
|
|
1711
|
+
class: O(["btn w-100 h-100 text-start d-flex align-items-center gap-3 p-3 rounded border text-primary", t.modulePrecis === n.modulePrecis ? "border-primary bg-light" : "bg-white"]),
|
|
1914
1712
|
"aria-pressed": t.modulePrecis === n.modulePrecis,
|
|
1915
1713
|
onClick: (n) => e.$emit("set-module-precis", t.modulePrecis)
|
|
1916
|
-
}, [
|
|
1714
|
+
}, [E(o, {
|
|
1917
1715
|
icon: t.icon,
|
|
1918
1716
|
class: "fs-4",
|
|
1919
1717
|
"fixed-width": ""
|
|
1920
|
-
}, null, 8, ["icon"]),
|
|
1921
|
-
n.cibleMode === "contrat" || n.cibleMode === "patrimoine" ? (
|
|
1922
|
-
|
|
1718
|
+
}, null, 8, ["icon"]), w("span", ir, [w("span", ar, I(t.titre), 1), w("small", or, I(t.aide), 1)])], 10, rr)]))), 128))])])) : S("", !0),
|
|
1719
|
+
n.cibleMode === "contrat" || n.cibleMode === "patrimoine" ? (A(), C("div", sr, [w("div", { class: O(["col-12 d-flex flex-column gap-3", { "col-md-6": a.afficheModule }]) }, [n.cibleMode === "patrimoine" ? (A(), C(y, { key: 0 }, [
|
|
1720
|
+
w("div", null, [t[10] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Commune ", -1), E(s, {
|
|
1923
1721
|
modelValue: a.selectedCommune,
|
|
1924
1722
|
"onUpdate:modelValue": t[2] ||= (e) => a.selectedCommune = e,
|
|
1925
1723
|
items: r.data.cache.communes || [],
|
|
@@ -1936,7 +1734,7 @@ function zr(e, t, n, r, i, a) {
|
|
|
1936
1734
|
"get-input-libelle",
|
|
1937
1735
|
"filtering-function"
|
|
1938
1736
|
])]),
|
|
1939
|
-
|
|
1737
|
+
w("div", null, [t[11] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Adresse ", -1), E(s, {
|
|
1940
1738
|
modelValue: a.selectedAdresse,
|
|
1941
1739
|
"onUpdate:modelValue": t[3] ||= (e) => a.selectedAdresse = e,
|
|
1942
1740
|
items: a.adresses,
|
|
@@ -1948,7 +1746,7 @@ function zr(e, t, n, r, i, a) {
|
|
|
1948
1746
|
"input-size": "sm",
|
|
1949
1747
|
"hide-choices": ""
|
|
1950
1748
|
}, {
|
|
1951
|
-
options:
|
|
1749
|
+
options: z((e) => [w("div", cr, [w("div", lr, I(e?.entree), 1), w("small", ur, I(e?.commune) + " — Programme " + I(e?.codeProgramme), 1)])]),
|
|
1952
1750
|
_: 1
|
|
1953
1751
|
}, 8, [
|
|
1954
1752
|
"modelValue",
|
|
@@ -1958,7 +1756,7 @@ function zr(e, t, n, r, i, a) {
|
|
|
1958
1756
|
"filtering-function",
|
|
1959
1757
|
"disabled"
|
|
1960
1758
|
])]),
|
|
1961
|
-
|
|
1759
|
+
w("div", null, [t[12] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Étage", -1), E(s, {
|
|
1962
1760
|
modelValue: a.selectedEtage,
|
|
1963
1761
|
"onUpdate:modelValue": t[4] ||= (e) => a.selectedEtage = e,
|
|
1964
1762
|
items: a.etages,
|
|
@@ -1975,25 +1773,25 @@ function zr(e, t, n, r, i, a) {
|
|
|
1975
1773
|
"get-input-libelle",
|
|
1976
1774
|
"disabled"
|
|
1977
1775
|
])])
|
|
1978
|
-
], 64)) : (
|
|
1979
|
-
|
|
1776
|
+
], 64)) : (A(), C(y, { key: 1 }, [
|
|
1777
|
+
w("div", null, [t[13] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Commune ", -1), w("input", {
|
|
1980
1778
|
class: "form-control form-control-sm",
|
|
1981
1779
|
disabled: "",
|
|
1982
1780
|
value: n.patrimoine.commune ?? "—"
|
|
1983
|
-
}, null, 8,
|
|
1984
|
-
|
|
1781
|
+
}, null, 8, dr)]),
|
|
1782
|
+
w("div", null, [t[14] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Adresse ", -1), w("input", {
|
|
1985
1783
|
class: "form-control form-control-sm",
|
|
1986
1784
|
disabled: "",
|
|
1987
1785
|
value: n.patrimoine.entree ?? "—"
|
|
1988
|
-
}, null, 8,
|
|
1989
|
-
|
|
1786
|
+
}, null, 8, fr)]),
|
|
1787
|
+
w("div", null, [t[15] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Étage", -1), w("input", {
|
|
1990
1788
|
class: "form-control form-control-sm",
|
|
1991
1789
|
disabled: "",
|
|
1992
1790
|
value: n.patrimoine.etage ?? "—"
|
|
1993
|
-
}, null, 8,
|
|
1994
|
-
], 64))], 2), a.afficheModule ? (
|
|
1995
|
-
t[16] ||=
|
|
1996
|
-
|
|
1791
|
+
}, null, 8, pr)])
|
|
1792
|
+
], 64))], 2), a.afficheModule ? (A(), C("div", mr, [
|
|
1793
|
+
t[16] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Module", -1),
|
|
1794
|
+
E(s, {
|
|
1997
1795
|
modelValue: a.selectedModule,
|
|
1998
1796
|
"onUpdate:modelValue": t[5] ||= (e) => a.selectedModule = e,
|
|
1999
1797
|
items: a.modules,
|
|
@@ -2005,20 +1803,20 @@ function zr(e, t, n, r, i, a) {
|
|
|
2005
1803
|
"input-size": "sm",
|
|
2006
1804
|
"hide-choices": ""
|
|
2007
1805
|
}, {
|
|
2008
|
-
options:
|
|
2009
|
-
e?._autreLibelle ? (
|
|
1806
|
+
options: z((e) => [w("div", { class: O(["min-w-0 w-100 rounded position-relative", e?._autreLibelle ? "bg-yellow-subtle p-2" : ""]) }, [
|
|
1807
|
+
e?._autreLibelle ? (A(), x(o, {
|
|
2010
1808
|
key: 0,
|
|
2011
1809
|
icon: "building",
|
|
2012
1810
|
class: "position-absolute top-0 end-0 m-1 text-muted",
|
|
2013
1811
|
title: "Autre adresse ou étage du même programme"
|
|
2014
|
-
})) :
|
|
2015
|
-
|
|
2016
|
-
|
|
1812
|
+
})) : S("", !0),
|
|
1813
|
+
w("div", { class: O(["fw-medium text-truncate", [e?._autreLibelle ? "text-muted" : "", a.isExit(e) ? "text-decoration-line-through" : ""]]) }, I(a.moduleLibelle(e)), 3),
|
|
1814
|
+
w("div", hr, [a.categorieLibelle(e) ? (A(), C("span", {
|
|
2017
1815
|
key: 0,
|
|
2018
1816
|
class: "badge bg-info",
|
|
2019
1817
|
title: e?.categorieModule
|
|
2020
|
-
}, [
|
|
2021
|
-
e?._autreLibelle ? (
|
|
1818
|
+
}, [E(o, { icon: a.getCategorieModuleIcon(e?.idCategorieModule, e?.estCollectif) }, null, 8, ["icon"])], 8, gr)) : S("", !0), w("small", _r, "N° " + I(e?.idModule), 1)]),
|
|
1819
|
+
e?._autreLibelle ? (A(), C("small", vr, I(e._autreLibelle), 1)) : e?.etage == null ? S("", !0) : (A(), C("small", yr, " Étage " + I(e.etage), 1))
|
|
2022
1820
|
], 2)]),
|
|
2023
1821
|
_: 1
|
|
2024
1822
|
}, 8, [
|
|
@@ -2029,43 +1827,51 @@ function zr(e, t, n, r, i, a) {
|
|
|
2029
1827
|
"filtering-function",
|
|
2030
1828
|
"disabled"
|
|
2031
1829
|
]),
|
|
2032
|
-
n.locataireActuelOption ? (
|
|
1830
|
+
n.locataireActuelOption ? (A(), C("div", br, [w("div", { class: O(["alert d-flex align-items-start gap-2 py-2 px-3 mt-2 mb-0 fs-7", n.locataireActuelOption.reprendre ? "alert-warning" : "alert-secondary border"]) }, [E(o, {
|
|
2033
1831
|
icon: "circle-info",
|
|
2034
1832
|
class: "mt-1"
|
|
2035
|
-
}),
|
|
1833
|
+
}), w("span", null, I(n.locataireActuelOption.hint), 1)], 2), w("div", xr, [w("input", {
|
|
2036
1834
|
id: `locataire-actuel-${i.uid}`,
|
|
2037
1835
|
class: "form-check-input",
|
|
2038
1836
|
type: "checkbox",
|
|
2039
1837
|
checked: n.locataireActuelOption.reprendre,
|
|
2040
1838
|
onChange: t[6] ||= (t) => e.$emit("toggle-reprendre-locataire-actuel", t.target.checked)
|
|
2041
|
-
}, null, 40,
|
|
1839
|
+
}, null, 40, Sr), w("label", {
|
|
2042
1840
|
class: "form-check-label fs-7",
|
|
2043
1841
|
for: `locataire-actuel-${i.uid}`
|
|
2044
|
-
}, " Rattacher au locataire actuel du module ", 8,
|
|
2045
|
-
])) :
|
|
1842
|
+
}, " Rattacher au locataire actuel du module ", 8, Cr)])])) : S("", !0)
|
|
1843
|
+
])) : S("", !0)])) : S("", !0)
|
|
2046
1844
|
]);
|
|
2047
1845
|
}
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
var Br = {
|
|
2051
|
-
name: "EtapeCibleBlock",
|
|
1846
|
+
var Tr = /*#__PURE__*/ G(zn, [["render", wr]]), Er = 0, Dr = {
|
|
1847
|
+
name: "LigneCibleBlock",
|
|
2052
1848
|
components: {
|
|
2053
|
-
AmsomOverlay:
|
|
2054
|
-
CiblePickerBlock:
|
|
1849
|
+
AmsomOverlay: v,
|
|
1850
|
+
CiblePickerBlock: Tr
|
|
2055
1851
|
},
|
|
1852
|
+
props: { index: {
|
|
1853
|
+
type: Number,
|
|
1854
|
+
required: !0
|
|
1855
|
+
} },
|
|
2056
1856
|
setup() {
|
|
2057
1857
|
return {
|
|
2058
|
-
draft:
|
|
1858
|
+
draft: W(),
|
|
2059
1859
|
data: Z(),
|
|
2060
1860
|
options: Q()
|
|
2061
1861
|
};
|
|
2062
1862
|
},
|
|
1863
|
+
data() {
|
|
1864
|
+
return { uid: ++Er };
|
|
1865
|
+
},
|
|
2063
1866
|
computed: {
|
|
2064
|
-
|
|
2065
|
-
return this.
|
|
1867
|
+
isPrincipale() {
|
|
1868
|
+
return this.index === 0;
|
|
2066
1869
|
},
|
|
2067
|
-
|
|
2068
|
-
return this.draft.
|
|
1870
|
+
ligne() {
|
|
1871
|
+
return this.draft.draft.lignes[this.index];
|
|
1872
|
+
},
|
|
1873
|
+
cibleFigee() {
|
|
1874
|
+
return this.draft.isReadonly("cible");
|
|
2069
1875
|
},
|
|
2070
1876
|
reclamantModules() {
|
|
2071
1877
|
return this.options.modulesReclamant ?? [];
|
|
@@ -2073,68 +1879,18 @@ var Br = {
|
|
|
2073
1879
|
mainModule() {
|
|
2074
1880
|
return this.draft.moduleReclamantPrincipal;
|
|
2075
1881
|
},
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
},
|
|
2079
|
-
reclamantType() {
|
|
2080
|
-
return this.draft.draft.reclamant.type;
|
|
2081
|
-
},
|
|
2082
|
-
motifLibelle() {
|
|
2083
|
-
let e = this.lignePrincipale.idMotif;
|
|
2084
|
-
return e == null ? null : this.data.motifLibelle(e);
|
|
2085
|
-
}
|
|
2086
|
-
},
|
|
2087
|
-
async created() {
|
|
2088
|
-
if (this.reclamantType === "D" || this.cibleFigee) return;
|
|
2089
|
-
await this.data.loadCommunes(), !this.draft.reclamantEstContrat && this.lignePrincipale.cibleMode === "contrat" && this.draft.setCibleMode(0, "patrimoine");
|
|
2090
|
-
let e = this.lignePrincipale.patrimoine;
|
|
2091
|
-
await this.data.loadAdresses(e?.idCommune ?? null), this.lignePrincipale.cibleMode !== "contrat" && await this.data.loadModulesOfProgramme(e?.codeProgramme ?? null);
|
|
2092
|
-
},
|
|
2093
|
-
methods: {
|
|
2094
|
-
pickerProps(e) {
|
|
1882
|
+
localisation() {
|
|
1883
|
+
let e = this.ligne?.patrimoine;
|
|
2095
1884
|
return {
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
reclamantType: this.reclamantType,
|
|
2100
|
-
contratReclamant: e.contratReclamant,
|
|
2101
|
-
contratCible: e.contratCible,
|
|
2102
|
-
modulePrecis: e.modulePrecis,
|
|
2103
|
-
afficheCaseContratReclamant: this.draft.reclamantEstContrat,
|
|
2104
|
-
locataireActuelOption: this.locataireActuelOption(e)
|
|
1885
|
+
actif: !this.cibleFigee && !!e && this.ligne.cibleMode !== "demande",
|
|
1886
|
+
idCommune: e?.idCommune ?? null,
|
|
1887
|
+
codeProgramme: this.ligne?.cibleMode === "patrimoine" ? e?.codeProgramme ?? null : null
|
|
2105
1888
|
};
|
|
2106
1889
|
},
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
},
|
|
2110
|
-
onSelectCommune(e, t = 0) {
|
|
2111
|
-
this.draft.setPatrimoineCommune(t, e ?? null), e?.idCommune != null && this.data.loadAdresses(e.idCommune);
|
|
2112
|
-
},
|
|
2113
|
-
onSelectAdresse(e, t = 0) {
|
|
2114
|
-
this.draft.setPatrimoineEntree(t, e ?? null), e?.codeProgramme != null && this.data.loadModulesOfProgramme(e.codeProgramme);
|
|
2115
|
-
},
|
|
2116
|
-
onSelectEtage(e, t = 0) {
|
|
2117
|
-
this.draft.setPatrimoineEtage(t, e ?? null);
|
|
2118
|
-
},
|
|
2119
|
-
onSelectModule(e, t = 0) {
|
|
2120
|
-
let n = this.draft.draft.lignes[t];
|
|
2121
|
-
e && n?.cibleMode === "contrat" ? this.draft.prefillFromModule(t, e) : this.draft.setPatrimoineModule(t, e ?? null);
|
|
2122
|
-
},
|
|
2123
|
-
onToggleReprendre(e, t = 0) {
|
|
2124
|
-
this.draft.setReprendreLocataireActuel(t, e);
|
|
2125
|
-
},
|
|
2126
|
-
onToggleContratReclamant(e, t = 0) {
|
|
2127
|
-
this.draft.toggleContratReclamant(t, e), e && this.draft.prefillFromModule(t, this.mainModule);
|
|
2128
|
-
},
|
|
2129
|
-
onSelectContrat(e, t = 0) {
|
|
2130
|
-
this.draft.setContratCible(t, e), e && this.data.loadModulesOfContrat({
|
|
2131
|
-
idContrat: e.idContrat,
|
|
2132
|
-
typeContrat: e.typeContrat
|
|
2133
|
-
});
|
|
2134
|
-
},
|
|
2135
|
-
locataireActuelOption(e) {
|
|
1890
|
+
locataireActuelOption() {
|
|
1891
|
+
let e = this.ligne;
|
|
2136
1892
|
if (e?.cibleMode !== "contrat") return null;
|
|
2137
|
-
let t = e
|
|
1893
|
+
let t = e.patrimoine;
|
|
2138
1894
|
if (!t || t.idModule == null) return null;
|
|
2139
1895
|
let n = e.contratReclamant && this.draft.reclamantEstContrat, r = n ? {
|
|
2140
1896
|
typeContrat: this.draft.draft.reclamant.type,
|
|
@@ -2152,99 +1908,720 @@ var Br = {
|
|
|
2152
1908
|
reprendre: i,
|
|
2153
1909
|
hint: a
|
|
2154
1910
|
};
|
|
1911
|
+
}
|
|
1912
|
+
},
|
|
1913
|
+
watch: { localisation: {
|
|
1914
|
+
immediate: !0,
|
|
1915
|
+
deep: !0,
|
|
1916
|
+
handler({ actif: e, idCommune: t, codeProgramme: n }) {
|
|
1917
|
+
e && (this.data.loadCommunes(), this.data.loadAdresses(t), this.data.loadModulesOfProgramme(n));
|
|
1918
|
+
}
|
|
1919
|
+
} },
|
|
1920
|
+
created() {
|
|
1921
|
+
this.isPrincipale && !this.cibleFigee && !this.draft.reclamantEstContrat && this.ligne.cibleMode === "contrat" && this.draft.setCibleMode(0, "patrimoine");
|
|
1922
|
+
},
|
|
1923
|
+
methods: {
|
|
1924
|
+
onChangeMode(e) {
|
|
1925
|
+
this.draft.setCibleMode(this.index, e), e !== "demande" && this.draft.prefillFromModule(this.index, this.mainModule);
|
|
1926
|
+
},
|
|
1927
|
+
onSelectModule(e) {
|
|
1928
|
+
e && this.ligne.cibleMode === "contrat" ? this.draft.prefillFromModule(this.index, e) : this.draft.setPatrimoineModule(this.index, e ?? null);
|
|
2155
1929
|
},
|
|
2156
|
-
|
|
2157
|
-
|
|
1930
|
+
onToggleContratReclamant(e) {
|
|
1931
|
+
this.draft.toggleContratReclamant(this.index, e), e && this.draft.prefillFromModule(this.index, this.mainModule);
|
|
1932
|
+
},
|
|
1933
|
+
onSelectContrat(e) {
|
|
1934
|
+
this.draft.setContratCible(this.index, e), e && this.data.loadModulesOfContrat({
|
|
1935
|
+
idContrat: e.idContrat,
|
|
1936
|
+
typeContrat: e.typeContrat
|
|
1937
|
+
});
|
|
2158
1938
|
}
|
|
2159
1939
|
}
|
|
2160
|
-
},
|
|
1940
|
+
}, Or = {
|
|
2161
1941
|
key: 0,
|
|
2162
|
-
class: "
|
|
2163
|
-
},
|
|
2164
|
-
key: 1,
|
|
2165
|
-
class: "d-flex flex-column gap-1"
|
|
2166
|
-
}, Gr = {
|
|
1942
|
+
class: "d-flex flex-wrap align-items-center gap-2"
|
|
1943
|
+
}, kr = { class: "fw-medium fs-7" }, Ar = {
|
|
2167
1944
|
key: 0,
|
|
2168
|
-
class: "
|
|
2169
|
-
},
|
|
1945
|
+
class: "form-check form-switch mb-0"
|
|
1946
|
+
}, jr = ["id", "checked"], Mr = ["for"];
|
|
1947
|
+
function Nr(e, t, n, r, i, a) {
|
|
1948
|
+
let o = F("font-awesome-icon"), s = F("cible-picker-block"), c = F("amsom-overlay");
|
|
1949
|
+
return A(), C("div", { class: O({ "border rounded p-2": !a.isPrincipale }) }, [a.isPrincipale ? S("", !0) : (A(), C("div", Or, [w("span", kr, I(a.ligne.libelle), 1), a.cibleFigee ? S("", !0) : (A(), C("div", Ar, [w("input", {
|
|
1950
|
+
id: `memecible-${i.uid}`,
|
|
1951
|
+
class: "form-check-input",
|
|
1952
|
+
type: "checkbox",
|
|
1953
|
+
checked: !a.ligne.cibleOverride,
|
|
1954
|
+
onChange: t[0] ||= (e) => r.draft.toggleCibleOverride(n.index)
|
|
1955
|
+
}, null, 40, jr), w("label", {
|
|
1956
|
+
class: "form-check-label fs-7",
|
|
1957
|
+
for: `memecible-${i.uid}`
|
|
1958
|
+
}, " Même cible que la ligne principale ", 8, Mr)]))])), a.cibleFigee ? (A(), C("div", {
|
|
1959
|
+
key: 1,
|
|
1960
|
+
class: O(["fs-7", { "mt-1": !a.isPrincipale }])
|
|
1961
|
+
}, [E(o, {
|
|
1962
|
+
icon: "location-dot",
|
|
1963
|
+
class: "text-primary me-2"
|
|
1964
|
+
}), T(" " + I(r.draft.cibleResume(a.ligne)), 1)], 2)) : a.isPrincipale || a.ligne.cibleOverride ? (A(), x(c, {
|
|
1965
|
+
key: 2,
|
|
1966
|
+
loading: r.data.isLoading && !r.data.cache.communes?.length
|
|
1967
|
+
}, {
|
|
1968
|
+
default: z(() => [E(s, {
|
|
1969
|
+
class: O({ "mt-2": !a.isPrincipale }),
|
|
1970
|
+
patrimoine: a.ligne.patrimoine,
|
|
1971
|
+
"cible-mode": a.ligne.cibleMode,
|
|
1972
|
+
"reclamant-modules": a.reclamantModules,
|
|
1973
|
+
"reclamant-type": r.draft.draft.reclamant.type,
|
|
1974
|
+
"contrat-reclamant": a.ligne.contratReclamant,
|
|
1975
|
+
"contrat-cible": a.ligne.contratCible,
|
|
1976
|
+
"module-precis": a.ligne.modulePrecis,
|
|
1977
|
+
"affiche-case-contrat-reclamant": r.draft.reclamantEstContrat,
|
|
1978
|
+
"locataire-actuel-option": a.locataireActuelOption,
|
|
1979
|
+
onChangeMode: a.onChangeMode,
|
|
1980
|
+
onSelectCommune: t[1] ||= (e) => r.draft.setPatrimoineCommune(n.index, e ?? null),
|
|
1981
|
+
onSelectAdresse: t[2] ||= (e) => r.draft.setPatrimoineEntree(n.index, e ?? null),
|
|
1982
|
+
onSelectEtage: t[3] ||= (e) => r.draft.setPatrimoineEtage(n.index, e ?? null),
|
|
1983
|
+
onSelectModule: a.onSelectModule,
|
|
1984
|
+
onSelectContrat: a.onSelectContrat,
|
|
1985
|
+
onToggleContratReclamant: a.onToggleContratReclamant,
|
|
1986
|
+
onToggleReprendreLocataireActuel: t[4] ||= (e) => r.draft.setReprendreLocataireActuel(n.index, e),
|
|
1987
|
+
onSetModulePrecis: t[5] ||= (e) => r.draft.setModulePrecis(n.index, e)
|
|
1988
|
+
}, null, 8, [
|
|
1989
|
+
"class",
|
|
1990
|
+
"patrimoine",
|
|
1991
|
+
"cible-mode",
|
|
1992
|
+
"reclamant-modules",
|
|
1993
|
+
"reclamant-type",
|
|
1994
|
+
"contrat-reclamant",
|
|
1995
|
+
"contrat-cible",
|
|
1996
|
+
"module-precis",
|
|
1997
|
+
"affiche-case-contrat-reclamant",
|
|
1998
|
+
"locataire-actuel-option",
|
|
1999
|
+
"onChangeMode",
|
|
2000
|
+
"onSelectModule",
|
|
2001
|
+
"onSelectContrat",
|
|
2002
|
+
"onToggleContratReclamant"
|
|
2003
|
+
])]),
|
|
2004
|
+
_: 1
|
|
2005
|
+
}, 8, ["loading"])) : S("", !0)], 2);
|
|
2006
|
+
}
|
|
2007
|
+
var Pr = /*#__PURE__*/ G(Dr, [["render", Nr]]), Fr = {
|
|
2008
|
+
name: "EtapeReclamantCibleBlock",
|
|
2009
|
+
components: {
|
|
2010
|
+
SectionComponent: rt,
|
|
2011
|
+
ProvenanceSelecteurBlock: $t,
|
|
2012
|
+
ReclamantRechercheBlock: wn,
|
|
2013
|
+
ReclamantSelecteurBlock: Pn,
|
|
2014
|
+
LigneCibleBlock: Pr
|
|
2015
|
+
},
|
|
2016
|
+
setup() {
|
|
2017
|
+
return {
|
|
2018
|
+
draft: W(),
|
|
2019
|
+
options: Q()
|
|
2020
|
+
};
|
|
2021
|
+
}
|
|
2022
|
+
}, Ir = { class: "d-flex flex-column gap-4" }, Lr = {
|
|
2023
|
+
key: 2,
|
|
2024
|
+
class: "row g-3"
|
|
2025
|
+
}, Rr = { class: "col-12 col-md-6" }, zr = { class: "col-12 col-md-6" };
|
|
2026
|
+
function Br(e, t, n, r, i, a) {
|
|
2027
|
+
let o = F("provenance-selecteur-block"), s = F("reclamant-recherche-block"), c = F("reclamant-selecteur-block"), l = F("section-component"), u = F("ligne-cible-block");
|
|
2028
|
+
return A(), C("div", Ir, [E(l, {
|
|
2029
|
+
titre: "Réclamant",
|
|
2030
|
+
aide: "La personne à l’origine de la sollicitation : locataire, tiers, fournisseur…"
|
|
2031
|
+
}, {
|
|
2032
|
+
default: z(() => [e.$slots.reclamant ? (A(), C(y, { key: 0 }, [E(o), P(e.$slots, "reclamant", {
|
|
2033
|
+
reclamant: r.draft.reclamantSelectionne,
|
|
2034
|
+
select: r.draft.selectReclamant
|
|
2035
|
+
})], 64)) : r.options.rechercheReclamant ? (A(), x(s, { key: 1 }, {
|
|
2036
|
+
"avant-categorie": z(() => [E(o)]),
|
|
2037
|
+
_: 1
|
|
2038
|
+
})) : (A(), C("div", Lr, [w("div", Rr, [E(o)]), w("div", zr, [E(c)])]))]),
|
|
2039
|
+
_: 3
|
|
2040
|
+
}), r.draft.reclamantSelectionne ? (A(), x(l, {
|
|
2041
|
+
key: 0,
|
|
2042
|
+
titre: "Cible",
|
|
2043
|
+
aide: r.draft.draft.reclamant.type === "D" ? "Une demande de logement se cible elle-même" : "Ce sur quoi porte la sollicitation : un contrat ou un élément du patrimoine"
|
|
2044
|
+
}, {
|
|
2045
|
+
default: z(() => [E(u, { index: 0 })]),
|
|
2046
|
+
_: 1
|
|
2047
|
+
}, 8, ["aide"])) : S("", !0)]);
|
|
2048
|
+
}
|
|
2049
|
+
var Vr = /*#__PURE__*/ G(Fr, [["render", Br]]), Hr = {
|
|
2050
|
+
name: "SeparateurComponent",
|
|
2051
|
+
props: { texte: {
|
|
2052
|
+
type: String,
|
|
2053
|
+
required: !0
|
|
2054
|
+
} }
|
|
2055
|
+
}, Ur = { class: "d-flex align-items-center gap-2 text-muted fs-7" };
|
|
2056
|
+
function Wr(e, t, n, r, i, a) {
|
|
2057
|
+
return A(), C("div", Ur, [
|
|
2058
|
+
t[0] ||= w("hr", { class: "flex-grow-1 my-0" }, null, -1),
|
|
2059
|
+
w("span", null, I(n.texte), 1),
|
|
2060
|
+
t[1] ||= w("hr", { class: "flex-grow-1 my-0" }, null, -1)
|
|
2061
|
+
]);
|
|
2062
|
+
}
|
|
2063
|
+
var Gr = /*#__PURE__*/ G(Hr, [["render", Wr]]), Kr = {
|
|
2064
|
+
reclamant: {
|
|
2065
|
+
icon: "user",
|
|
2066
|
+
label: "Réclamant"
|
|
2067
|
+
},
|
|
2068
|
+
cible: {
|
|
2069
|
+
icon: "location-dot",
|
|
2070
|
+
label: "Cible"
|
|
2071
|
+
},
|
|
2072
|
+
motif: {
|
|
2073
|
+
icon: "tag",
|
|
2074
|
+
label: "Motif"
|
|
2075
|
+
}
|
|
2076
|
+
}, qr = {
|
|
2077
|
+
name: "RecapBlock",
|
|
2078
|
+
props: {
|
|
2079
|
+
index: {
|
|
2080
|
+
type: Number,
|
|
2081
|
+
default: 0
|
|
2082
|
+
},
|
|
2083
|
+
champs: {
|
|
2084
|
+
type: Array,
|
|
2085
|
+
default: () => [
|
|
2086
|
+
"reclamant",
|
|
2087
|
+
"cible",
|
|
2088
|
+
"motif"
|
|
2089
|
+
],
|
|
2090
|
+
validator: (e) => e.every((e) => Kr[e])
|
|
2091
|
+
}
|
|
2092
|
+
},
|
|
2093
|
+
setup() {
|
|
2094
|
+
return {
|
|
2095
|
+
draft: W(),
|
|
2096
|
+
data: Z()
|
|
2097
|
+
};
|
|
2098
|
+
},
|
|
2099
|
+
computed: {
|
|
2100
|
+
ligne() {
|
|
2101
|
+
return this.draft.draft.lignes[this.index];
|
|
2102
|
+
},
|
|
2103
|
+
valeurs() {
|
|
2104
|
+
return {
|
|
2105
|
+
reclamant: this.reclamant,
|
|
2106
|
+
cible: this.ligne ? this.draft.cibleResume(this.ligne) : null,
|
|
2107
|
+
motif: this.motif
|
|
2108
|
+
};
|
|
2109
|
+
},
|
|
2110
|
+
reclamant() {
|
|
2111
|
+
let e = this.draft.reclamantSelectionne?.libelle;
|
|
2112
|
+
if (!e) return null;
|
|
2113
|
+
let t = this.data.cache.provenances?.find((e) => e.id === this.draft.draft.provenance)?.libelle;
|
|
2114
|
+
return t ? `${e} · via ${t}` : e;
|
|
2115
|
+
},
|
|
2116
|
+
motif() {
|
|
2117
|
+
let e = this.ligne;
|
|
2118
|
+
return e?.idMotif ? this.index > 0 ? e.libelle ?? this.data.motifLibelle(e.idMotif) : [
|
|
2119
|
+
this.data.categorieLibelle(e.idCategorie),
|
|
2120
|
+
this.data.typeLibelle(e.idType),
|
|
2121
|
+
this.data.natureLibelle(e.idNature),
|
|
2122
|
+
this.data.motifLibelle(e.idMotif)
|
|
2123
|
+
].filter(Boolean).join(" › ") : null;
|
|
2124
|
+
},
|
|
2125
|
+
items() {
|
|
2126
|
+
return this.champs.map((e) => ({
|
|
2127
|
+
champ: e,
|
|
2128
|
+
...Kr[e],
|
|
2129
|
+
valeur: this.valeurs[e]
|
|
2130
|
+
})).filter((e) => e.valeur);
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
}, Jr = { class: "alert alert-light border py-2 px-3 mb-0 d-flex flex-column gap-1" }, Yr = { class: "text-muted text-uppercase fw-semibold text-nowrap" }, Xr = { class: "min-w-0" };
|
|
2134
|
+
function Zr(e, t, n, r, i, a) {
|
|
2135
|
+
let o = F("font-awesome-icon");
|
|
2136
|
+
return A(), C("div", Jr, [(A(!0), C(y, null, N(a.items, (e) => (A(), C("span", {
|
|
2137
|
+
key: e.champ,
|
|
2138
|
+
class: "fs-7 d-flex align-items-start gap-2"
|
|
2139
|
+
}, [
|
|
2140
|
+
E(o, {
|
|
2141
|
+
icon: e.icon,
|
|
2142
|
+
class: "text-primary mt-1",
|
|
2143
|
+
"fixed-width": ""
|
|
2144
|
+
}, null, 8, ["icon"]),
|
|
2145
|
+
w("span", Yr, I(e.label), 1),
|
|
2146
|
+
w("span", Xr, I(e.valeur), 1)
|
|
2147
|
+
]))), 128))]);
|
|
2148
|
+
}
|
|
2149
|
+
var Qr = /*#__PURE__*/ G(qr, [["render", Zr]]), $r = {
|
|
2150
|
+
name: "MotifChaineComponent",
|
|
2151
|
+
props: {
|
|
2152
|
+
chaine: {
|
|
2153
|
+
type: Array,
|
|
2154
|
+
default: () => []
|
|
2155
|
+
},
|
|
2156
|
+
readonly: {
|
|
2157
|
+
type: Boolean,
|
|
2158
|
+
default: !1
|
|
2159
|
+
}
|
|
2160
|
+
},
|
|
2161
|
+
emits: ["retirer"]
|
|
2162
|
+
}, ei = { class: "d-flex flex-wrap align-items-center gap-2" }, ti = ["onClick"], ni = {
|
|
2163
|
+
key: 2,
|
|
2164
|
+
class: "badge rounded-pill bg-primary d-inline-flex align-items-center gap-2"
|
|
2165
|
+
};
|
|
2166
|
+
function ri(e, t, n, r, i, a) {
|
|
2167
|
+
let o = F("font-awesome-icon");
|
|
2168
|
+
return A(), C("div", ei, [(A(!0), C(y, null, N(n.chaine, (t, r) => (A(), C(y, { key: t.key }, [r > 0 ? (A(), x(o, {
|
|
2169
|
+
key: 0,
|
|
2170
|
+
icon: "chevron-right",
|
|
2171
|
+
class: "text-muted fs-7"
|
|
2172
|
+
})) : S("", !0), n.readonly ? (A(), C("span", ni, [t.icon ? (A(), x(o, {
|
|
2173
|
+
key: 0,
|
|
2174
|
+
icon: t.icon,
|
|
2175
|
+
"fixed-width": ""
|
|
2176
|
+
}, null, 8, ["icon"])) : S("", !0), T(" " + I(t.libelle), 1)])) : (A(), C("button", {
|
|
2177
|
+
key: 1,
|
|
2178
|
+
type: "button",
|
|
2179
|
+
class: "btn btn-sm btn-primary rounded-pill d-inline-flex align-items-center gap-2",
|
|
2180
|
+
onClick: (n) => e.$emit("retirer", t.key)
|
|
2181
|
+
}, [
|
|
2182
|
+
t.icon ? (A(), x(o, {
|
|
2183
|
+
key: 0,
|
|
2184
|
+
icon: t.icon,
|
|
2185
|
+
"fixed-width": ""
|
|
2186
|
+
}, null, 8, ["icon"])) : S("", !0),
|
|
2187
|
+
w("span", null, I(t.libelle), 1),
|
|
2188
|
+
E(o, {
|
|
2189
|
+
icon: "xmark",
|
|
2190
|
+
class: "fs-7 opacity-75"
|
|
2191
|
+
})
|
|
2192
|
+
], 8, ti))], 64))), 128))]);
|
|
2193
|
+
}
|
|
2194
|
+
var ii = /*#__PURE__*/ G($r, [["render", ri]]), $ = [
|
|
2195
|
+
{
|
|
2196
|
+
key: "categorie",
|
|
2197
|
+
titre: "Catégorie",
|
|
2198
|
+
idKey: "idCategorie",
|
|
2199
|
+
libelleKey: "categorie"
|
|
2200
|
+
},
|
|
2201
|
+
{
|
|
2202
|
+
key: "type",
|
|
2203
|
+
titre: "Type",
|
|
2204
|
+
idKey: "idType",
|
|
2205
|
+
libelleKey: "type"
|
|
2206
|
+
},
|
|
2207
|
+
{
|
|
2208
|
+
key: "nature",
|
|
2209
|
+
titre: "Nature",
|
|
2210
|
+
idKey: "idNature",
|
|
2211
|
+
libelleKey: "nature"
|
|
2212
|
+
},
|
|
2213
|
+
{
|
|
2214
|
+
key: "motif",
|
|
2215
|
+
titre: "Motif",
|
|
2216
|
+
idKey: "idMotif",
|
|
2217
|
+
libelleKey: "libelle"
|
|
2218
|
+
}
|
|
2219
|
+
], ai = (e) => e.filter((e) => e.selectedId != null).map((e) => {
|
|
2220
|
+
let t = e.options.find((t) => t.id === e.selectedId);
|
|
2221
|
+
return {
|
|
2222
|
+
key: e.key,
|
|
2223
|
+
libelle: t?.libelle ?? e.selectedId,
|
|
2224
|
+
icon: t?.icon ?? null
|
|
2225
|
+
};
|
|
2226
|
+
}), oi = {
|
|
2227
|
+
name: "MotifBubbleBlock",
|
|
2228
|
+
components: { MotifChaineComponent: ii },
|
|
2229
|
+
props: { niveaux: {
|
|
2230
|
+
type: Array,
|
|
2231
|
+
required: !0
|
|
2232
|
+
} },
|
|
2233
|
+
emits: ["choisir", "retirer"],
|
|
2234
|
+
computed: {
|
|
2235
|
+
chaine() {
|
|
2236
|
+
return ai(this.niveaux);
|
|
2237
|
+
},
|
|
2238
|
+
courant() {
|
|
2239
|
+
return this.niveaux.find((e) => e.selectedId == null) ?? null;
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
}, si = { class: "d-flex flex-column gap-3" }, ci = { key: 1 }, li = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-2" }, ui = { class: "row justify-content-around g-3" }, di = ["title", "onClick"], fi = { class: "fs-7 mt-1 lh-sm" }, pi = {
|
|
2243
|
+
key: 0,
|
|
2244
|
+
class: "col-12 text-muted fs-7"
|
|
2245
|
+
};
|
|
2246
|
+
function mi(e, t, n, r, i, a) {
|
|
2247
|
+
let o = F("motif-chaine-component"), s = F("font-awesome-icon");
|
|
2248
|
+
return A(), C("div", si, [a.chaine.length ? (A(), x(o, {
|
|
2249
|
+
key: 0,
|
|
2250
|
+
chaine: a.chaine,
|
|
2251
|
+
onRetirer: t[0] ||= (t) => e.$emit("retirer", t)
|
|
2252
|
+
}, null, 8, ["chaine"])) : S("", !0), a.courant ? (A(), C("div", ci, [w("label", li, I(a.courant.titre), 1), w("div", ui, [(A(!0), C(y, null, N(a.courant.options, (t) => (A(), C("div", {
|
|
2253
|
+
key: t.id,
|
|
2254
|
+
class: "col-3 text-center"
|
|
2255
|
+
}, [w("button", {
|
|
2256
|
+
type: "button",
|
|
2257
|
+
class: "btn btn-lg btn-outline-primary btn-circle d-flex align-items-center justify-content-center mx-auto",
|
|
2258
|
+
title: t.libelle,
|
|
2259
|
+
onClick: (n) => e.$emit("choisir", {
|
|
2260
|
+
key: a.courant.key,
|
|
2261
|
+
id: t.id
|
|
2262
|
+
})
|
|
2263
|
+
}, [t.icon ? (A(), x(s, {
|
|
2264
|
+
key: 0,
|
|
2265
|
+
icon: t.icon,
|
|
2266
|
+
size: "lg"
|
|
2267
|
+
}, null, 8, ["icon"])) : S("", !0)], 8, di), w("div", fi, I(t.libelle), 1)]))), 128)), a.courant.options.length ? S("", !0) : (A(), C("div", pi, " Aucun choix disponible "))])])) : S("", !0)]);
|
|
2268
|
+
}
|
|
2269
|
+
var hi = /*#__PURE__*/ G(oi, [["render", mi]]), gi = {
|
|
2270
|
+
categorie: "une catégorie",
|
|
2271
|
+
type: "un type",
|
|
2272
|
+
nature: "une nature"
|
|
2273
|
+
}, _i = {
|
|
2274
|
+
name: "MotifColonnesBlock",
|
|
2275
|
+
props: { niveaux: {
|
|
2276
|
+
type: Array,
|
|
2277
|
+
required: !0
|
|
2278
|
+
} },
|
|
2279
|
+
emits: ["choisir"],
|
|
2280
|
+
methods: { article(e) {
|
|
2281
|
+
return gi[e.key] ?? e.titre.toLowerCase();
|
|
2282
|
+
} }
|
|
2283
|
+
}, vi = { class: "row g-0 border rounded overflow-hidden" }, yi = { class: "d-flex align-items-center justify-content-between bg-light border-bottom px-2 py-1" }, bi = { class: "fs-7 fw-semibold text-muted text-uppercase" }, xi = {
|
|
2284
|
+
key: 0,
|
|
2285
|
+
class: "badge bg-secondary"
|
|
2286
|
+
}, Si = {
|
|
2287
|
+
class: "list-group list-group-flush overflow-auto",
|
|
2288
|
+
style: { "max-height": "260px" }
|
|
2289
|
+
}, Ci = ["aria-pressed", "onClick"], wi = { class: "flex-grow-1 lh-sm text-start" }, Ti = {
|
|
2290
|
+
key: 0,
|
|
2291
|
+
class: "text-muted fst-italic p-2"
|
|
2292
|
+
};
|
|
2293
|
+
function Ei(e, t, n, r, i, a) {
|
|
2294
|
+
let o = F("font-awesome-icon");
|
|
2295
|
+
return A(), C("div", vi, [(A(!0), C(y, null, N(n.niveaux, (t, r) => (A(), C("div", {
|
|
2296
|
+
key: t.key,
|
|
2297
|
+
class: O(["col-6 col-md-3 d-flex flex-column", { "border-start": r > 0 }])
|
|
2298
|
+
}, [
|
|
2299
|
+
w("div", yi, [w("span", bi, I(t.titre), 1), t.options.length ? (A(), C("span", xi, I(t.options.length), 1)) : S("", !0)]),
|
|
2300
|
+
w("div", Si, [(A(!0), C(y, null, N(t.options, (i) => (A(), C("button", {
|
|
2301
|
+
key: i.id,
|
|
2302
|
+
type: "button",
|
|
2303
|
+
class: O(["list-group-item list-group-item-action d-flex align-items-center gap-2 fs-7 px-2 py-1", { active: i.id === t.selectedId }]),
|
|
2304
|
+
"aria-pressed": i.id === t.selectedId,
|
|
2305
|
+
onClick: (n) => e.$emit("choisir", {
|
|
2306
|
+
key: t.key,
|
|
2307
|
+
id: i.id
|
|
2308
|
+
})
|
|
2309
|
+
}, [
|
|
2310
|
+
i.icon ? (A(), x(o, {
|
|
2311
|
+
key: 0,
|
|
2312
|
+
icon: i.icon,
|
|
2313
|
+
"fixed-width": ""
|
|
2314
|
+
}, null, 8, ["icon"])) : S("", !0),
|
|
2315
|
+
w("span", wi, I(i.libelle), 1),
|
|
2316
|
+
r < n.niveaux.length - 1 ? (A(), x(o, {
|
|
2317
|
+
key: 1,
|
|
2318
|
+
icon: "chevron-right",
|
|
2319
|
+
class: "opacity-50"
|
|
2320
|
+
})) : i.id === t.selectedId ? (A(), x(o, {
|
|
2321
|
+
key: 2,
|
|
2322
|
+
icon: "check"
|
|
2323
|
+
})) : S("", !0)
|
|
2324
|
+
], 10, Ci))), 128))]),
|
|
2325
|
+
t.options.length ? S("", !0) : (A(), C("small", Ti, I(r > 0 ? `← Choisir ${a.article(n.niveaux[r - 1])}` : "Aucun choix disponible"), 1))
|
|
2326
|
+
], 2))), 128))]);
|
|
2327
|
+
}
|
|
2328
|
+
// src/components/EtapeMotifBlock.vue
|
|
2329
|
+
var Di = {
|
|
2330
|
+
name: "EtapeMotifBlock",
|
|
2331
|
+
components: {
|
|
2332
|
+
AmsomOverlay: v,
|
|
2333
|
+
AmsomAutocomplete: B,
|
|
2334
|
+
SectionComponent: rt,
|
|
2335
|
+
SeparateurComponent: Gr,
|
|
2336
|
+
RecapBlock: Qr,
|
|
2337
|
+
MotifChaineComponent: ii,
|
|
2338
|
+
MotifBubbleBlock: hi,
|
|
2339
|
+
MotifColonnesBlock: /* @__PURE__ */ G(_i, [["render", Ei]]),
|
|
2340
|
+
LigneCibleBlock: Pr
|
|
2341
|
+
},
|
|
2342
|
+
setup() {
|
|
2343
|
+
return {
|
|
2344
|
+
draft: W(),
|
|
2345
|
+
data: Z(),
|
|
2346
|
+
options: Q()
|
|
2347
|
+
};
|
|
2348
|
+
},
|
|
2349
|
+
data() {
|
|
2350
|
+
return { iconsReady: !1 };
|
|
2351
|
+
},
|
|
2352
|
+
computed: {
|
|
2353
|
+
mainLigne() {
|
|
2354
|
+
return this.draft.lignePrincipale;
|
|
2355
|
+
},
|
|
2356
|
+
lignesAssociees() {
|
|
2357
|
+
return this.draft.lignesAssociees;
|
|
2358
|
+
},
|
|
2359
|
+
motifFige() {
|
|
2360
|
+
return this.draft.isReadonly("motif");
|
|
2361
|
+
},
|
|
2362
|
+
activeMotifs() {
|
|
2363
|
+
return (this.data.cache.motifs ?? []).filter((e) => !e.estDesactive).slice().sort((e, t) => (e.categorie ?? "").localeCompare(t.categorie ?? "") || (e.type ?? "").localeCompare(t.type ?? "") || (e.nature ?? "").localeCompare(t.nature ?? "") || (e.libelle ?? "").localeCompare(t.libelle ?? ""));
|
|
2364
|
+
},
|
|
2365
|
+
allowedMotifs() {
|
|
2366
|
+
return this.activeMotifs.filter((e) => this.options.estMotifPropose(e));
|
|
2367
|
+
},
|
|
2368
|
+
motifBloque() {
|
|
2369
|
+
return this.options.motifNonProposeMode === "block" && !this.options.motifPrincipalPropose;
|
|
2370
|
+
},
|
|
2371
|
+
niveaux() {
|
|
2372
|
+
let e = {
|
|
2373
|
+
categorie: this.data.categorieIcon,
|
|
2374
|
+
type: this.data.typeIcon,
|
|
2375
|
+
nature: this.data.natureIcon
|
|
2376
|
+
}, t = this.allowedMotifs;
|
|
2377
|
+
return $.map((n, r) => {
|
|
2378
|
+
let i = $[r - 1], a = !i || this.mainLigne[i.idKey] != null ? t : [], o = n.key === "motif" ? a.map((e) => ({
|
|
2379
|
+
id: e.id,
|
|
2380
|
+
libelle: e.libelle,
|
|
2381
|
+
icon: e.icon
|
|
2382
|
+
})) : this.distinct(a, n.idKey, n.libelleKey, e[n.key]), s = this.mainLigne[n.idKey];
|
|
2383
|
+
return s != null && (t = t.filter((e) => e[n.idKey] === s)), {
|
|
2384
|
+
key: n.key,
|
|
2385
|
+
titre: n.titre,
|
|
2386
|
+
options: o,
|
|
2387
|
+
selectedId: s
|
|
2388
|
+
};
|
|
2389
|
+
});
|
|
2390
|
+
},
|
|
2391
|
+
chaine() {
|
|
2392
|
+
let e = this.mainLigne, t = {
|
|
2393
|
+
categorie: this.data.categorieLibelle,
|
|
2394
|
+
type: this.data.typeLibelle,
|
|
2395
|
+
nature: this.data.natureLibelle,
|
|
2396
|
+
motif: this.data.motifLibelle
|
|
2397
|
+
}, n = {
|
|
2398
|
+
categorie: this.data.categorieIcon,
|
|
2399
|
+
type: this.data.typeIcon,
|
|
2400
|
+
nature: this.data.natureIcon,
|
|
2401
|
+
motif: this.data.motifIcon
|
|
2402
|
+
};
|
|
2403
|
+
return ai($.map((r) => {
|
|
2404
|
+
let i = e[r.idKey];
|
|
2405
|
+
return {
|
|
2406
|
+
key: r.key,
|
|
2407
|
+
selectedId: i,
|
|
2408
|
+
options: i == null ? [] : [{
|
|
2409
|
+
id: i,
|
|
2410
|
+
libelle: t[r.key](i),
|
|
2411
|
+
icon: n[r.key](i)
|
|
2412
|
+
}]
|
|
2413
|
+
};
|
|
2414
|
+
}));
|
|
2415
|
+
},
|
|
2416
|
+
selectedMotif() {
|
|
2417
|
+
return this.mainLigne.idMotif ? this.activeMotifs.find((e) => e.id === this.mainLigne.idMotif) ?? null : null;
|
|
2418
|
+
},
|
|
2419
|
+
motifsAssocies() {
|
|
2420
|
+
let e = this.selectedMotif?.association;
|
|
2421
|
+
return e ? Object.entries(e).map(([e, t]) => ({
|
|
2422
|
+
libelle: e,
|
|
2423
|
+
idMotif: t
|
|
2424
|
+
})) : [];
|
|
2425
|
+
},
|
|
2426
|
+
motifRecherche: {
|
|
2427
|
+
get() {
|
|
2428
|
+
return this.selectedMotif;
|
|
2429
|
+
},
|
|
2430
|
+
set(e) {
|
|
2431
|
+
let t = e && typeof e == "object" ? e : e ? this.activeMotifs.find((t) => t.id === e) : null;
|
|
2432
|
+
t ? this.draft.selectMotifChain(t) : this.draft.setCategorie(null);
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
},
|
|
2436
|
+
async created() {
|
|
2437
|
+
await this.data.loadNomenclature(), await this.registerIcons(), this.iconsReady = !0;
|
|
2438
|
+
},
|
|
2439
|
+
methods: {
|
|
2440
|
+
setNiveau(e, t) {
|
|
2441
|
+
({
|
|
2442
|
+
categorie: this.draft.setCategorie,
|
|
2443
|
+
type: this.draft.setType,
|
|
2444
|
+
nature: this.draft.setNature,
|
|
2445
|
+
motif: this.draft.setMotif
|
|
2446
|
+
})[e](t);
|
|
2447
|
+
},
|
|
2448
|
+
choisir({ key: e, id: t }) {
|
|
2449
|
+
if (this.setNiveau(e, t), this.options.motifSelectionMode !== "columns") return;
|
|
2450
|
+
let n = $.findIndex((t) => t.key === e) + 1;
|
|
2451
|
+
for (; n < $.length;) {
|
|
2452
|
+
let e = this.niveaux[n];
|
|
2453
|
+
if (e.selectedId != null || e.options.length !== 1) break;
|
|
2454
|
+
this.setNiveau(e.key, e.options[0].id), n += 1;
|
|
2455
|
+
}
|
|
2456
|
+
},
|
|
2457
|
+
retirer(e) {
|
|
2458
|
+
this.setNiveau(e, null);
|
|
2459
|
+
},
|
|
2460
|
+
isActive(e) {
|
|
2461
|
+
return this.lignesAssociees.some((t) => t.idMotif === e);
|
|
2462
|
+
},
|
|
2463
|
+
toggleMotifAssocie(e) {
|
|
2464
|
+
let t = this.activeMotifs.find((t) => t.id === e.idMotif);
|
|
2465
|
+
this.draft.toggleLigneAssociee(e.idMotif, {
|
|
2466
|
+
libelle: e.libelle,
|
|
2467
|
+
idCategorie: t?.idCategorie ?? null,
|
|
2468
|
+
idType: t?.idType ?? null,
|
|
2469
|
+
idNature: t?.idNature ?? null
|
|
2470
|
+
});
|
|
2471
|
+
},
|
|
2472
|
+
registerIcons() {
|
|
2473
|
+
return at([
|
|
2474
|
+
...this.data.cache.categories ?? [],
|
|
2475
|
+
...this.data.cache.types ?? [],
|
|
2476
|
+
...this.data.cache.natures ?? [],
|
|
2477
|
+
...this.activeMotifs
|
|
2478
|
+
].map((e) => e.icon));
|
|
2479
|
+
},
|
|
2480
|
+
filterMotifs({ search: e, items: t }) {
|
|
2481
|
+
let n = (K(e) ?? "").trim();
|
|
2482
|
+
if (!n) return t;
|
|
2483
|
+
let r = n.split(/\s+/);
|
|
2484
|
+
return t.filter((e) => {
|
|
2485
|
+
let t = K(`${e.libelle} ${e.categorie} ${e.type} ${e.nature}`) ?? "";
|
|
2486
|
+
return r.every((e) => t.includes(e));
|
|
2487
|
+
});
|
|
2488
|
+
},
|
|
2489
|
+
distinct(e, t, n, r) {
|
|
2490
|
+
let i = /* @__PURE__ */ new Map();
|
|
2491
|
+
for (let a of e) a[t] != null && !i.has(a[t]) && i.set(a[t], {
|
|
2492
|
+
id: a[t],
|
|
2493
|
+
libelle: a[n] ?? a[t],
|
|
2494
|
+
icon: r ? r(a[t]) : null
|
|
2495
|
+
});
|
|
2496
|
+
return [...i.values()].sort((e, t) => (e.libelle ?? "").localeCompare(t.libelle ?? ""));
|
|
2497
|
+
},
|
|
2498
|
+
motifLibelleFromId(e) {
|
|
2499
|
+
return this.activeMotifs.find((t) => t.id === e)?.libelle ?? e;
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
}, Oi = {
|
|
2503
|
+
key: 0,
|
|
2504
|
+
class: "d-flex flex-column gap-4"
|
|
2505
|
+
}, ki = {
|
|
2506
|
+
key: 0,
|
|
2507
|
+
class: "alert alert-info d-flex align-items-start gap-2 py-2 px-3 mb-0 fs-7"
|
|
2508
|
+
}, Ai = {
|
|
2509
|
+
key: 1,
|
|
2510
|
+
class: "alert alert-warning d-flex align-items-start gap-2 py-2 px-3 mb-0 fs-7"
|
|
2511
|
+
}, ji = { class: "d-flex align-items-center gap-2" }, Mi = { class: "min-w-0" }, Ni = { class: "fw-medium text-truncate" }, Pi = { class: "text-muted d-block text-truncate" }, Fi = [
|
|
2170
2512
|
"id",
|
|
2171
2513
|
"checked",
|
|
2514
|
+
"disabled",
|
|
2172
2515
|
"onChange"
|
|
2173
|
-
],
|
|
2516
|
+
], Ii = ["for"], Li = {
|
|
2174
2517
|
key: 0,
|
|
2175
|
-
class: "
|
|
2518
|
+
class: "alert alert-warning d-flex align-items-start gap-2 py-2 px-3 mb-0 fs-7"
|
|
2176
2519
|
};
|
|
2177
|
-
function
|
|
2178
|
-
let o =
|
|
2179
|
-
return
|
|
2180
|
-
default:
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2520
|
+
function Ri(e, t, n, r, i, a) {
|
|
2521
|
+
let o = F("recap-block"), s = F("font-awesome-icon"), c = F("motif-chaine-component"), l = F("amsom-autocomplete"), u = F("separateur-component"), d = F("motif-colonnes-block"), f = F("motif-bubble-block"), p = F("section-component"), m = F("ligne-cible-block"), h = F("amsom-overlay");
|
|
2522
|
+
return A(), x(h, { loading: r.data.isLoading && !r.data.cache.motifs || !i.iconsReady }, {
|
|
2523
|
+
default: z(() => [i.iconsReady ? (A(), C("div", Oi, [
|
|
2524
|
+
E(o, { champs: ["reclamant", "cible"] }),
|
|
2525
|
+
E(p, { titre: "Motif" }, {
|
|
2526
|
+
default: z(() => [
|
|
2527
|
+
r.options.motifRetire ? (A(), C("div", ki, [E(s, {
|
|
2528
|
+
icon: "circle-info",
|
|
2529
|
+
class: "mt-1"
|
|
2530
|
+
}), w("span", null, [
|
|
2531
|
+
T(" Le motif « " + I(r.options.motifRetire.libelle) + " » a été retiré ", 1),
|
|
2532
|
+
r.options.motifRetire.associes.length ? (A(), C(y, { key: 0 }, [T(" avec ses motifs associés (" + I(r.options.motifRetire.associes.join(", ")) + ") ", 1)], 64)) : S("", !0),
|
|
2533
|
+
t[1] ||= T(" : il n’est pas proposé pour ce réclamant. ", -1)
|
|
2534
|
+
])])) : S("", !0),
|
|
2535
|
+
a.motifBloque ? (A(), C("div", Ai, [E(s, {
|
|
2536
|
+
icon: "circle-exclamation",
|
|
2537
|
+
class: "mt-1"
|
|
2538
|
+
}), w("span", null, " Le motif « " + I(r.data.motifLibelle(a.mainLigne.idMotif)) + " » n’est pas proposé pour ce réclamant : choisissez-en un autre pour continuer. ", 1)])) : S("", !0),
|
|
2539
|
+
a.motifFige ? (A(), x(c, {
|
|
2540
|
+
key: 2,
|
|
2541
|
+
chaine: a.chaine,
|
|
2542
|
+
readonly: ""
|
|
2543
|
+
}, null, 8, ["chaine"])) : (A(), C(y, { key: 3 }, [
|
|
2544
|
+
w("div", null, [t[2] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, [T(" Rechercher un motif"), w("span", { class: "ms-1 text-danger" }, "*")], -1), E(l, {
|
|
2545
|
+
modelValue: a.motifRecherche,
|
|
2546
|
+
"onUpdate:modelValue": t[0] ||= (e) => a.motifRecherche = e,
|
|
2547
|
+
items: a.allowedMotifs,
|
|
2548
|
+
"get-id": (e) => e?.id ?? null,
|
|
2549
|
+
"get-input-libelle": (e) => e?.libelle ?? "",
|
|
2550
|
+
"get-input-libelle-from-id": a.motifLibelleFromId,
|
|
2551
|
+
"filtering-function": a.filterMotifs,
|
|
2552
|
+
placeholder: "Rechercher (motif, catégorie, type, nature)…",
|
|
2553
|
+
"input-size": "sm",
|
|
2554
|
+
"hide-choices": ""
|
|
2555
|
+
}, {
|
|
2556
|
+
options: z((e) => [w("div", ji, [e?.icon ? (A(), x(s, {
|
|
2557
|
+
key: 0,
|
|
2558
|
+
icon: e.icon,
|
|
2559
|
+
class: "text-primary",
|
|
2560
|
+
"fixed-width": ""
|
|
2561
|
+
}, null, 8, ["icon"])) : S("", !0), w("div", Mi, [w("div", Ni, I(e?.libelle), 1), w("small", Pi, I(e?.categorie) + " › " + I(e?.type) + " › " + I(e?.nature), 1)])])]),
|
|
2562
|
+
_: 1
|
|
2563
|
+
}, 8, [
|
|
2564
|
+
"modelValue",
|
|
2565
|
+
"items",
|
|
2566
|
+
"get-id",
|
|
2567
|
+
"get-input-libelle",
|
|
2568
|
+
"get-input-libelle-from-id",
|
|
2569
|
+
"filtering-function"
|
|
2570
|
+
])]),
|
|
2571
|
+
E(u, { texte: "ou sélection guidée" }),
|
|
2572
|
+
r.options.motifSelectionMode === "columns" ? (A(), x(d, {
|
|
2573
|
+
key: 0,
|
|
2574
|
+
niveaux: a.niveaux,
|
|
2575
|
+
onChoisir: a.choisir
|
|
2576
|
+
}, null, 8, ["niveaux", "onChoisir"])) : (A(), x(f, {
|
|
2577
|
+
key: 1,
|
|
2578
|
+
niveaux: a.niveaux,
|
|
2579
|
+
onChoisir: a.choisir,
|
|
2580
|
+
onRetirer: a.retirer
|
|
2581
|
+
}, null, 8, [
|
|
2582
|
+
"niveaux",
|
|
2583
|
+
"onChoisir",
|
|
2584
|
+
"onRetirer"
|
|
2585
|
+
]))
|
|
2586
|
+
], 64))
|
|
2587
|
+
]),
|
|
2588
|
+
_: 1
|
|
2589
|
+
}),
|
|
2590
|
+
a.motifsAssocies.length ? (A(), x(p, {
|
|
2591
|
+
key: 0,
|
|
2592
|
+
titre: "Motifs complémentaires"
|
|
2593
|
+
}, {
|
|
2594
|
+
default: z(() => [
|
|
2595
|
+
(A(!0), C(y, null, N(a.motifsAssocies, (e) => (A(), C("div", {
|
|
2596
|
+
key: e.idMotif,
|
|
2597
|
+
class: "form-check form-switch"
|
|
2598
|
+
}, [w("input", {
|
|
2599
|
+
id: `assoc-${e.idMotif}`,
|
|
2600
|
+
class: "form-check-input",
|
|
2601
|
+
type: "checkbox",
|
|
2602
|
+
checked: a.isActive(e.idMotif),
|
|
2603
|
+
disabled: a.motifFige,
|
|
2604
|
+
onChange: (t) => a.toggleMotifAssocie(e)
|
|
2605
|
+
}, null, 40, Fi), w("label", {
|
|
2606
|
+
class: "form-check-label fs-7",
|
|
2607
|
+
for: `assoc-${e.idMotif}`
|
|
2608
|
+
}, I(e.libelle) + " ? ", 9, Ii)]))), 128)),
|
|
2609
|
+
r.draft.ciblesAssocieesReinitialisees && r.draft.draft.reclamant.type !== "D" ? (A(), C("div", Li, [E(s, {
|
|
2610
|
+
icon: "circle-exclamation",
|
|
2611
|
+
class: "mt-1"
|
|
2612
|
+
}), w("span", null, " Le réclamant a changé : " + I(r.draft.ciblesAssocieesReinitialisees > 1 ? `${r.draft.ciblesAssocieesReinitialisees} motifs associés reprennent` : "un motif associé reprend") + " la cible de la ligne principale. Vérifiez-la ci-dessous si elle doit être différente. ", 1)])) : S("", !0),
|
|
2613
|
+
a.lignesAssociees.length && r.draft.draft.reclamant.type !== "D" ? (A(), C(y, { key: 1 }, [E(u, { texte: "Cible des autres motifs" }), (A(!0), C(y, null, N(a.lignesAssociees, (e, t) => (A(), x(m, {
|
|
2614
|
+
key: e.idMotif,
|
|
2615
|
+
index: t + 1
|
|
2616
|
+
}, null, 8, ["index"]))), 128))], 64)) : S("", !0)
|
|
2617
|
+
]),
|
|
2618
|
+
_: 1
|
|
2619
|
+
})) : S("", !0)
|
|
2620
|
+
])) : S("", !0)]),
|
|
2244
2621
|
_: 1
|
|
2245
2622
|
}, 8, ["loading"]);
|
|
2246
2623
|
}
|
|
2247
|
-
var
|
|
2624
|
+
var zi = /*#__PURE__*/ G(Di, [["render", Ri]]), Bi = {
|
|
2248
2625
|
name: "LigneDocumentBlock",
|
|
2249
2626
|
components: { AmsomUploadFile: xe },
|
|
2250
2627
|
props: {
|
|
@@ -2263,9 +2640,9 @@ var $r = /*#__PURE__*/ K(Br, [["render", Qr]]), ei = {
|
|
|
2263
2640
|
},
|
|
2264
2641
|
emits: ["update"]
|
|
2265
2642
|
};
|
|
2266
|
-
function
|
|
2267
|
-
let o =
|
|
2268
|
-
return
|
|
2643
|
+
function Vi(e, t, n, r, i, a) {
|
|
2644
|
+
let o = F("amsom-upload-file");
|
|
2645
|
+
return A(), C("div", null, [t[1] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Document", -1), E(o, {
|
|
2269
2646
|
"model-value": n.fichier,
|
|
2270
2647
|
renameable: "",
|
|
2271
2648
|
"output-format": "object",
|
|
@@ -2279,12 +2656,12 @@ function ti(e, t, n, r, i, a) {
|
|
|
2279
2656
|
"read-only"
|
|
2280
2657
|
])]);
|
|
2281
2658
|
}
|
|
2282
|
-
var
|
|
2659
|
+
var Hi = /*#__PURE__*/ G(Bi, [["render", Vi]]), Ui = 4e3, Wi = {
|
|
2283
2660
|
name: "LigneDetailBlock",
|
|
2284
2661
|
components: {
|
|
2285
|
-
AmsomAutocomplete:
|
|
2662
|
+
AmsomAutocomplete: B,
|
|
2286
2663
|
AmsomTextarea: be,
|
|
2287
|
-
LigneDocumentBlock:
|
|
2664
|
+
LigneDocumentBlock: Hi
|
|
2288
2665
|
},
|
|
2289
2666
|
props: { index: {
|
|
2290
2667
|
type: Number,
|
|
@@ -2292,12 +2669,12 @@ var ni = /*#__PURE__*/ K(ei, [["render", ti]]), ri = 4e3, ii = {
|
|
|
2292
2669
|
} },
|
|
2293
2670
|
setup() {
|
|
2294
2671
|
return {
|
|
2295
|
-
draft:
|
|
2672
|
+
draft: W(),
|
|
2296
2673
|
data: Z()
|
|
2297
2674
|
};
|
|
2298
2675
|
},
|
|
2299
2676
|
computed: {
|
|
2300
|
-
descriptionMaxLength: () =>
|
|
2677
|
+
descriptionMaxLength: () => Ui,
|
|
2301
2678
|
isPrincipale() {
|
|
2302
2679
|
return this.index === 0;
|
|
2303
2680
|
},
|
|
@@ -2318,64 +2695,54 @@ var ni = /*#__PURE__*/ K(ei, [["render", ti]]), ri = 4e3, ii = {
|
|
|
2318
2695
|
this.isPrincipale && this.$refs.description?.$el.querySelector("textarea")?.focus();
|
|
2319
2696
|
},
|
|
2320
2697
|
methods: {
|
|
2321
|
-
timestampToDateInput:
|
|
2322
|
-
dateInputToTimestamp:
|
|
2698
|
+
timestampToDateInput: en,
|
|
2699
|
+
dateInputToTimestamp: tn,
|
|
2323
2700
|
responsableLibelle(e) {
|
|
2324
2701
|
let t = e && typeof e != "object" ? this.collaborateurs.find((t) => String(t.id) === String(e)) : e;
|
|
2325
2702
|
return t ? `${t.prenom} ${t.nom}` : "";
|
|
2326
2703
|
},
|
|
2327
2704
|
filterCollaborateurs({ search: e, items: t }) {
|
|
2328
|
-
let n = (
|
|
2329
|
-
return n ? t.filter((e) => (
|
|
2705
|
+
let n = (K(e) ?? "").trim();
|
|
2706
|
+
return n ? t.filter((e) => (K(`${e.prenom} ${e.nom} ${e.service}`) ?? "").includes(n)) : t;
|
|
2330
2707
|
}
|
|
2331
2708
|
}
|
|
2332
|
-
},
|
|
2709
|
+
}, Gi = { class: "d-flex flex-column gap-2" }, Ki = { class: "d-flex align-items-center gap-2 mb-1" }, qi = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-0" }, Ji = {
|
|
2333
2710
|
key: 0,
|
|
2334
2711
|
class: "ms-1 text-danger"
|
|
2335
|
-
},
|
|
2712
|
+
}, Yi = {
|
|
2336
2713
|
key: 0,
|
|
2337
2714
|
class: "form-check form-switch mb-0"
|
|
2338
|
-
},
|
|
2715
|
+
}, Xi = [
|
|
2339
2716
|
"id",
|
|
2340
2717
|
"checked",
|
|
2341
2718
|
"disabled"
|
|
2342
|
-
],
|
|
2343
|
-
key: 1,
|
|
2344
|
-
class: "text-muted d-block",
|
|
2345
|
-
style: { "white-space": "pre-line" }
|
|
2346
|
-
}, pi = { class: "row g-3" }, mi = { class: "col-6" }, hi = { class: "d-flex align-items-center gap-2 mb-1" }, gi = {
|
|
2719
|
+
], Zi = ["for"], Qi = ["rows", "value"], $i = { class: "row g-3" }, ea = { class: "col-6" }, ta = { class: "d-flex align-items-center gap-2 mb-1" }, na = {
|
|
2347
2720
|
key: 0,
|
|
2348
2721
|
class: "form-check form-switch mb-0"
|
|
2349
|
-
},
|
|
2722
|
+
}, ra = [
|
|
2350
2723
|
"id",
|
|
2351
2724
|
"checked",
|
|
2352
2725
|
"disabled"
|
|
2353
|
-
],
|
|
2354
|
-
key: 1,
|
|
2355
|
-
class: "text-muted d-block"
|
|
2356
|
-
}, xi = {
|
|
2726
|
+
], ia = ["for"], aa = ["value"], oa = ["value"], sa = ["value"], ca = { class: "min-w-0" }, la = { class: "fw-medium text-truncate" }, ua = {
|
|
2357
2727
|
key: 0,
|
|
2358
2728
|
class: "text-muted d-block"
|
|
2359
|
-
},
|
|
2360
|
-
key: 0,
|
|
2361
|
-
class: "text-muted d-block"
|
|
2362
|
-
}, Ti = {
|
|
2729
|
+
}, da = {
|
|
2363
2730
|
key: 2,
|
|
2364
2731
|
class: "text-muted"
|
|
2365
|
-
},
|
|
2366
|
-
function
|
|
2367
|
-
let o =
|
|
2368
|
-
return
|
|
2732
|
+
}, fa = { class: "col-12 col-md-6" };
|
|
2733
|
+
function pa(e, t, n, r, i, a) {
|
|
2734
|
+
let o = F("amsom-textarea"), s = F("amsom-autocomplete"), c = F("ligne-document-block");
|
|
2735
|
+
return A(), C("div", Gi, [w("div", null, [w("div", Ki, [w("label", qi, [t[6] ||= T(" Description", -1), a.isPrincipale ? (A(), C("span", Ji, "*")) : S("", !0)]), a.isPrincipale ? S("", !0) : (A(), C("div", Yi, [w("input", {
|
|
2369
2736
|
id: `memedetail-${a.ligne.idMotif}`,
|
|
2370
2737
|
class: "form-check-input",
|
|
2371
2738
|
type: "checkbox",
|
|
2372
2739
|
checked: a.ligne.description == null,
|
|
2373
2740
|
disabled: r.draft.isReadonly("description"),
|
|
2374
2741
|
onChange: t[0] ||= (e) => r.draft.toggleDescriptionOverride(n.index)
|
|
2375
|
-
}, null, 40,
|
|
2742
|
+
}, null, 40, Xi), w("label", {
|
|
2376
2743
|
class: "form-check-label fs-7",
|
|
2377
2744
|
for: `memedetail-${a.ligne.idMotif}`
|
|
2378
|
-
}, " Même description ", 8,
|
|
2745
|
+
}, " Même description ", 8, Zi)]))]), !r.draft.isReadonly("description") && (a.isPrincipale || a.ligne.description != null) ? (A(), x(o, {
|
|
2379
2746
|
key: 0,
|
|
2380
2747
|
ref: "description",
|
|
2381
2748
|
"model-value": a.ligne.description,
|
|
@@ -2389,25 +2756,42 @@ function Di(e, t, n, r, i, a) {
|
|
|
2389
2756
|
"rows",
|
|
2390
2757
|
"maxlength",
|
|
2391
2758
|
"placeholder"
|
|
2392
|
-
])) : (
|
|
2759
|
+
])) : (A(), C("textarea", {
|
|
2760
|
+
key: 1,
|
|
2761
|
+
class: "form-control form-control-sm",
|
|
2762
|
+
disabled: "",
|
|
2763
|
+
rows: a.isPrincipale ? 7 : 5,
|
|
2764
|
+
value: (a.ligne.description ?? a.lignePrincipale.description) || ""
|
|
2765
|
+
}, null, 8, Qi))]), w("div", $i, [w("div", ea, [w("div", null, [w("div", ta, [t[7] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-0" }, " Date des faits ", -1), a.isPrincipale ? S("", !0) : (A(), C("div", na, [w("input", {
|
|
2393
2766
|
id: `memedate-${a.ligne.idMotif}`,
|
|
2394
2767
|
class: "form-check-input",
|
|
2395
2768
|
type: "checkbox",
|
|
2396
2769
|
checked: !a.ligne.dateFaitsOverride,
|
|
2397
2770
|
disabled: r.draft.isReadonly("dateFaits"),
|
|
2398
2771
|
onChange: t[2] ||= (e) => r.draft.toggleDateFaitsOverride(n.index)
|
|
2399
|
-
}, null, 40,
|
|
2772
|
+
}, null, 40, ra), w("label", {
|
|
2400
2773
|
class: "form-check-label fs-7",
|
|
2401
2774
|
for: `memedate-${a.ligne.idMotif}`
|
|
2402
|
-
}, " Même date ", 8,
|
|
2775
|
+
}, " Même date ", 8, ia)]))]), !r.draft.isReadonly("dateFaits") && (a.isPrincipale || a.ligne.dateFaitsOverride) ? (A(), C("input", {
|
|
2403
2776
|
key: 0,
|
|
2404
2777
|
value: a.timestampToDateInput(a.ligne.dateFaits),
|
|
2405
2778
|
type: "date",
|
|
2406
2779
|
class: "form-control form-control-sm",
|
|
2407
2780
|
onInput: t[3] ||= (e) => r.draft.setDateFaits(n.index, a.dateInputToTimestamp(e.target.value))
|
|
2408
|
-
}, null, 40,
|
|
2409
|
-
|
|
2410
|
-
|
|
2781
|
+
}, null, 40, aa)) : (A(), C("input", {
|
|
2782
|
+
key: 1,
|
|
2783
|
+
value: a.timestampToDateInput(a.dateFaits),
|
|
2784
|
+
type: "date",
|
|
2785
|
+
class: "form-control form-control-sm",
|
|
2786
|
+
disabled: ""
|
|
2787
|
+
}, null, 8, oa))]), w("div", null, [
|
|
2788
|
+
t[8] ||= w("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Responsable ", -1),
|
|
2789
|
+
r.draft.isReadonly("responsable") ? (A(), C("input", {
|
|
2790
|
+
key: 0,
|
|
2791
|
+
class: "form-control form-control-sm",
|
|
2792
|
+
disabled: "",
|
|
2793
|
+
value: a.responsableLibelle(a.ligne.responsable) || "Déterminé automatiquement"
|
|
2794
|
+
}, null, 8, sa)) : (A(), x(s, {
|
|
2411
2795
|
key: 1,
|
|
2412
2796
|
"model-value": a.ligne.responsable,
|
|
2413
2797
|
items: a.collaborateurs,
|
|
@@ -2419,7 +2803,7 @@ function Di(e, t, n, r, i, a) {
|
|
|
2419
2803
|
"hide-choices": "",
|
|
2420
2804
|
"onUpdate:modelValue": t[4] ||= (e) => r.draft.setResponsable(n.index, e ?? null)
|
|
2421
2805
|
}, {
|
|
2422
|
-
options:
|
|
2806
|
+
options: z((e) => [w("div", ca, [w("div", la, I(e?.prenom) + " " + I(e?.nom), 1), e?.service ? (A(), C("small", ua, I(e.service), 1)) : S("", !0)])]),
|
|
2423
2807
|
_: 1
|
|
2424
2808
|
}, 8, [
|
|
2425
2809
|
"model-value",
|
|
@@ -2428,8 +2812,8 @@ function Di(e, t, n, r, i, a) {
|
|
|
2428
2812
|
"get-input-libelle",
|
|
2429
2813
|
"filtering-function"
|
|
2430
2814
|
])),
|
|
2431
|
-
a.isPrincipale && !a.ligne.responsable && !r.draft.isReadonly("responsable") ? (
|
|
2432
|
-
])]),
|
|
2815
|
+
a.isPrincipale && !a.ligne.responsable && !r.draft.isReadonly("responsable") ? (A(), C("small", da, " Aucun paramétrage trouvé : le responsable sera déterminé automatiquement. ")) : S("", !0)
|
|
2816
|
+
])]), w("div", fa, [E(c, {
|
|
2433
2817
|
index: n.index,
|
|
2434
2818
|
fichier: a.ligne.fichier,
|
|
2435
2819
|
readonly: r.draft.isReadonly("fichier"),
|
|
@@ -2440,17 +2824,18 @@ function Di(e, t, n, r, i, a) {
|
|
|
2440
2824
|
"readonly"
|
|
2441
2825
|
])])])]);
|
|
2442
2826
|
}
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
var Oi = {
|
|
2827
|
+
// src/components/EtapeDetailsBlock.vue
|
|
2828
|
+
var ma = {
|
|
2446
2829
|
name: "EtapeDetailsBlock",
|
|
2447
2830
|
components: {
|
|
2448
|
-
AmsomOverlay:
|
|
2449
|
-
LigneDetailBlock: /* @__PURE__ */
|
|
2831
|
+
AmsomOverlay: v,
|
|
2832
|
+
LigneDetailBlock: /* @__PURE__ */ G(Wi, [["render", pa]]),
|
|
2833
|
+
RecapBlock: Qr,
|
|
2834
|
+
SectionComponent: rt
|
|
2450
2835
|
},
|
|
2451
2836
|
setup() {
|
|
2452
2837
|
return {
|
|
2453
|
-
draft:
|
|
2838
|
+
draft: W(),
|
|
2454
2839
|
data: Z()
|
|
2455
2840
|
};
|
|
2456
2841
|
},
|
|
@@ -2463,10 +2848,6 @@ var Oi = {
|
|
|
2463
2848
|
},
|
|
2464
2849
|
collaborateurs() {
|
|
2465
2850
|
return (this.data.cache.collaborateurs ?? []).filter((e) => e.actif !== !1);
|
|
2466
|
-
},
|
|
2467
|
-
motifLibelle() {
|
|
2468
|
-
let e = this.lignePrincipale.idMotif;
|
|
2469
|
-
return e == null ? null : this.data.motifLibelle(e);
|
|
2470
2851
|
}
|
|
2471
2852
|
},
|
|
2472
2853
|
async created() {
|
|
@@ -2502,67 +2883,61 @@ var Oi = {
|
|
|
2502
2883
|
}
|
|
2503
2884
|
}
|
|
2504
2885
|
}
|
|
2505
|
-
},
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
S("hr", { class: "flex-grow-1 my-0" })
|
|
2533
|
-
], -1), (k(!0), x(_, null, M(a.lignesAssociees, (e, n) => (k(), x("div", {
|
|
2534
|
-
key: e.idMotif,
|
|
2535
|
-
class: "border rounded p-2 d-flex flex-column gap-2"
|
|
2536
|
-
}, [S("div", Ni, [S("span", Pi, [
|
|
2537
|
-
T(o, {
|
|
2538
|
-
icon: "tag",
|
|
2539
|
-
class: "text-primary me-2"
|
|
2540
|
-
}),
|
|
2541
|
-
t[2] ||= S("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Motif", -1),
|
|
2542
|
-
w(" " + F(e.libelle), 1)
|
|
2543
|
-
]), S("span", Fi, [
|
|
2544
|
-
T(o, {
|
|
2545
|
-
icon: "location-dot",
|
|
2546
|
-
class: "text-primary me-2"
|
|
2547
|
-
}),
|
|
2548
|
-
t[3] ||= S("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Cible", -1),
|
|
2549
|
-
w(" " + F(r.draft.cibleResume(e)), 1)
|
|
2550
|
-
])]), T(s, { index: n + 1 }, null, 8, ["index"])]))), 128))], 64)) : b("", !0)
|
|
2886
|
+
}, ha = { class: "d-flex flex-column gap-4" }, ga = { class: "text-muted d-flex align-items-start gap-2" };
|
|
2887
|
+
function _a(e, t, n, r, i, a) {
|
|
2888
|
+
let o = F("recap-block"), s = F("font-awesome-icon"), c = F("ligne-detail-block"), l = F("section-component"), u = F("amsom-overlay");
|
|
2889
|
+
return A(), x(u, { loading: r.data.isLoading && !r.data.cache.collaborateurs }, {
|
|
2890
|
+
default: z(() => [w("div", ha, [
|
|
2891
|
+
E(o),
|
|
2892
|
+
w("small", ga, [E(s, {
|
|
2893
|
+
icon: "circle-info",
|
|
2894
|
+
class: "mt-1"
|
|
2895
|
+
}), t[0] ||= T(" Rappel RGPD : ne saisissez que les informations nécessaires au traitement de la sollicitation, aucune donnée sensible (santé, opinions, situation judiciaire…) ni appréciation personnelle sur le réclamant. ", -1)]),
|
|
2896
|
+
E(l, { titre: a.lignesAssociees.length ? "Motif principal" : "Détails" }, {
|
|
2897
|
+
default: z(() => [E(c, { index: 0 })]),
|
|
2898
|
+
_: 1
|
|
2899
|
+
}, 8, ["titre"]),
|
|
2900
|
+
a.lignesAssociees.length ? (A(), x(l, {
|
|
2901
|
+
key: 0,
|
|
2902
|
+
titre: "Détail des autres motifs"
|
|
2903
|
+
}, {
|
|
2904
|
+
default: z(() => [(A(!0), C(y, null, N(a.lignesAssociees, (e, t) => (A(), C("div", {
|
|
2905
|
+
key: e.idMotif,
|
|
2906
|
+
class: "border rounded p-2 d-flex flex-column gap-2"
|
|
2907
|
+
}, [E(o, {
|
|
2908
|
+
index: t + 1,
|
|
2909
|
+
champs: ["motif", "cible"]
|
|
2910
|
+
}, null, 8, ["index"]), E(c, { index: t + 1 }, null, 8, ["index"])]))), 128))]),
|
|
2911
|
+
_: 1
|
|
2912
|
+
})) : S("", !0)
|
|
2551
2913
|
])]),
|
|
2552
2914
|
_: 1
|
|
2553
2915
|
}, 8, ["loading"]);
|
|
2554
2916
|
}
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2917
|
+
var va = /*#__PURE__*/ G(ma, [["render", _a]]), ya = [
|
|
2918
|
+
{
|
|
2919
|
+
key: "reclamantCible",
|
|
2920
|
+
label: "Réclamant et cible",
|
|
2921
|
+
icon: "user"
|
|
2922
|
+
},
|
|
2923
|
+
{
|
|
2924
|
+
key: "motif",
|
|
2925
|
+
label: "Motif",
|
|
2926
|
+
icon: "tag"
|
|
2927
|
+
},
|
|
2928
|
+
{
|
|
2929
|
+
key: "details",
|
|
2930
|
+
label: "Détails",
|
|
2931
|
+
icon: "info"
|
|
2932
|
+
}
|
|
2933
|
+
], ba = {
|
|
2558
2934
|
name: "StepperBlock",
|
|
2559
2935
|
components: {
|
|
2560
|
-
AmsomHorizontalStepper:
|
|
2561
|
-
AmsomOverlay:
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
EtapeDetailsBlock: /* @__PURE__ */ K(Oi, [["render", Ii]])
|
|
2936
|
+
AmsomHorizontalStepper: _e,
|
|
2937
|
+
AmsomOverlay: v,
|
|
2938
|
+
EtapeReclamantCibleBlock: Vr,
|
|
2939
|
+
EtapeMotifBlock: zi,
|
|
2940
|
+
EtapeDetailsBlock: va
|
|
2566
2941
|
},
|
|
2567
2942
|
props: {
|
|
2568
2943
|
step: {
|
|
@@ -2581,36 +2956,13 @@ var Li = {
|
|
|
2581
2956
|
],
|
|
2582
2957
|
setup() {
|
|
2583
2958
|
return {
|
|
2584
|
-
draft:
|
|
2959
|
+
draft: W(),
|
|
2585
2960
|
data: Z(),
|
|
2586
2961
|
options: Q()
|
|
2587
2962
|
};
|
|
2588
2963
|
},
|
|
2589
2964
|
computed: {
|
|
2590
|
-
steps()
|
|
2591
|
-
return [
|
|
2592
|
-
...this.options.reclamantMode === "step" ? [{
|
|
2593
|
-
key: "reclamant",
|
|
2594
|
-
label: "Réclamant",
|
|
2595
|
-
icon: "user"
|
|
2596
|
-
}] : [],
|
|
2597
|
-
{
|
|
2598
|
-
key: "categorie",
|
|
2599
|
-
label: "Catégorisation",
|
|
2600
|
-
icon: "tag"
|
|
2601
|
-
},
|
|
2602
|
-
{
|
|
2603
|
-
key: "cible",
|
|
2604
|
-
label: "Cible",
|
|
2605
|
-
icon: "location-dot"
|
|
2606
|
-
},
|
|
2607
|
-
{
|
|
2608
|
-
key: "details",
|
|
2609
|
-
label: "Détails",
|
|
2610
|
-
icon: "info"
|
|
2611
|
-
}
|
|
2612
|
-
];
|
|
2613
|
-
},
|
|
2965
|
+
steps: () => ya,
|
|
2614
2966
|
currentKey() {
|
|
2615
2967
|
return this.steps[this.step - 1]?.key ?? null;
|
|
2616
2968
|
},
|
|
@@ -2624,11 +2976,14 @@ var Li = {
|
|
|
2624
2976
|
provenanceValid() {
|
|
2625
2977
|
return this.options.provenances.some((e) => e.id === this.draft.draft.provenance);
|
|
2626
2978
|
},
|
|
2979
|
+
motifPropose() {
|
|
2980
|
+
return this.options.motifNonProposeMode !== "block" || this.options.motifPrincipalPropose;
|
|
2981
|
+
},
|
|
2627
2982
|
canGoNext() {
|
|
2628
2983
|
return this.gatePassed(this.currentKey);
|
|
2629
2984
|
},
|
|
2630
2985
|
canCreer() {
|
|
2631
|
-
return !!this.lignePrincipale.idMotif && this.provenanceValid && this.draft.ciblesValid && this.draft.detailsValid && this.draft.reclamantSelectionne != null;
|
|
2986
|
+
return !!this.lignePrincipale.idMotif && this.motifPropose && this.provenanceValid && this.draft.ciblesValid && this.draft.detailsValid && this.draft.reclamantSelectionne != null;
|
|
2632
2987
|
},
|
|
2633
2988
|
stepperSteps() {
|
|
2634
2989
|
return this.steps.map((e, t) => {
|
|
@@ -2657,7 +3012,7 @@ var Li = {
|
|
|
2657
3012
|
} },
|
|
2658
3013
|
methods: {
|
|
2659
3014
|
gatePassed(e) {
|
|
2660
|
-
return e === "
|
|
3015
|
+
return e === "reclamantCible" ? this.draft.reclamantSelectionne != null && this.provenanceValid && this.draft.ligneCibleValid(0) : e !== "motif" || !!this.lignePrincipale.idMotif && this.motifPropose && this.draft.ciblesValid;
|
|
2661
3016
|
},
|
|
2662
3017
|
onStepClick(e) {
|
|
2663
3018
|
e < this.step && this.$emit("update:step", e);
|
|
@@ -2666,7 +3021,7 @@ var Li = {
|
|
|
2666
3021
|
this.step > 1 && this.$emit("update:step", this.step - 1);
|
|
2667
3022
|
},
|
|
2668
3023
|
goNext() {
|
|
2669
|
-
this.step >= this.steps.length || !this.canGoNext || (this.currentKey === "
|
|
3024
|
+
this.step >= this.steps.length || !this.canGoNext || (this.currentKey === "motif" && this.preloadResponsables(), this.$emit("update:step", this.step + 1));
|
|
2670
3025
|
},
|
|
2671
3026
|
preloadResponsables() {
|
|
2672
3027
|
this.draft.draft.lignes.forEach((e) => this.data.loadResponsables({
|
|
@@ -2677,73 +3032,67 @@ var Li = {
|
|
|
2677
3032
|
}));
|
|
2678
3033
|
}
|
|
2679
3034
|
}
|
|
2680
|
-
},
|
|
3035
|
+
}, xa = { class: "d-flex flex-column gap-3" }, Sa = {
|
|
2681
3036
|
key: 0,
|
|
2682
3037
|
class: "w-100 fs-6 fw-medium my-3 alert alert-info",
|
|
2683
3038
|
style: { "white-space": "pre-line" }
|
|
2684
|
-
},
|
|
2685
|
-
function
|
|
2686
|
-
let o =
|
|
2687
|
-
return
|
|
2688
|
-
default:
|
|
2689
|
-
|
|
3039
|
+
}, Ca = { style: { "min-height": "260px" } }, wa = { class: "d-flex justify-content-between" }, Ta = { key: 1 }, Ea = ["disabled"], Da = ["disabled"];
|
|
3040
|
+
function Oa(e, t, n, r, i, a) {
|
|
3041
|
+
let o = F("amsom-horizontal-stepper"), s = F("font-awesome-icon"), c = F("etape-reclamant-cible-block"), l = F("etape-motif-block"), u = F("etape-details-block"), d = F("amsom-overlay");
|
|
3042
|
+
return A(), x(d, { loading: n.creating }, {
|
|
3043
|
+
default: z(() => [w("div", xa, [
|
|
3044
|
+
E(o, {
|
|
2690
3045
|
steps: a.stepperSteps,
|
|
2691
3046
|
size: "md",
|
|
2692
3047
|
onStepClick: a.onStepClick
|
|
2693
3048
|
}, null, 8, ["steps", "onStepClick"]),
|
|
2694
|
-
a.aideMotif ? (
|
|
3049
|
+
a.aideMotif ? (A(), C("div", Sa, [E(s, {
|
|
2695
3050
|
icon: "circle-info",
|
|
2696
3051
|
class: "text-info-emphasis me-2"
|
|
2697
|
-
}),
|
|
2698
|
-
|
|
2699
|
-
key: 0,
|
|
2700
|
-
premiere: n.step === 1
|
|
2701
|
-
}, C({ _: 2 }, [e.$slots.reclamant ? {
|
|
3052
|
+
}), w("span", null, I(a.aideMotif), 1)])) : S("", !0),
|
|
3053
|
+
w("div", Ca, [a.currentKey === "reclamantCible" ? (A(), x(c, { key: 0 }, le({ _: 2 }, [e.$slots.reclamant ? {
|
|
2702
3054
|
name: "reclamant",
|
|
2703
|
-
fn:
|
|
3055
|
+
fn: z((t) => [P(e.$slots, "reclamant", k(D(t)))]),
|
|
2704
3056
|
key: "0"
|
|
2705
|
-
} : void 0]),
|
|
2706
|
-
|
|
2707
|
-
premiere: n.step === 1
|
|
2708
|
-
}, null, 8, ["premiere"])) : a.currentKey === "cible" ? (k(), y(u, { key: 2 })) : a.currentKey === "details" ? (k(), y(d, { key: 3 })) : b("", !0)]),
|
|
2709
|
-
S("div", Vi, [n.step > 1 ? (k(), x("button", {
|
|
3057
|
+
} : void 0]), 1024)) : a.currentKey === "motif" ? (A(), x(l, { key: 1 })) : a.currentKey === "details" ? (A(), x(u, { key: 2 })) : S("", !0)]),
|
|
3058
|
+
w("div", wa, [n.step > 1 ? (A(), C("button", {
|
|
2710
3059
|
key: 0,
|
|
2711
3060
|
class: "btn btn-sm btn-outline-secondary",
|
|
2712
3061
|
onClick: t[0] ||= (...e) => a.goPrevious && a.goPrevious(...e)
|
|
2713
|
-
}, [
|
|
3062
|
+
}, [E(s, {
|
|
2714
3063
|
icon: "chevron-left",
|
|
2715
3064
|
class: "me-1"
|
|
2716
|
-
}), t[3] ||=
|
|
3065
|
+
}), t[3] ||= T(" Précédent ", -1)])) : (A(), C("span", Ta)), n.step < a.steps.length ? (A(), C("button", {
|
|
2717
3066
|
key: 2,
|
|
2718
3067
|
class: "btn btn-sm btn-primary",
|
|
2719
3068
|
disabled: !a.canGoNext,
|
|
2720
3069
|
onClick: t[1] ||= (...e) => a.goNext && a.goNext(...e)
|
|
2721
|
-
}, [t[4] ||=
|
|
3070
|
+
}, [t[4] ||= T(" Suivant ", -1), E(s, {
|
|
2722
3071
|
icon: "chevron-right",
|
|
2723
3072
|
class: "ms-1"
|
|
2724
|
-
})], 8,
|
|
3073
|
+
})], 8, Ea)) : (A(), C("button", {
|
|
2725
3074
|
key: 3,
|
|
2726
3075
|
class: "btn btn-sm btn-success",
|
|
2727
3076
|
disabled: !a.canCreer || n.creating,
|
|
2728
3077
|
onClick: t[2] ||= (t) => e.$emit("submit")
|
|
2729
|
-
}, [
|
|
3078
|
+
}, [E(s, {
|
|
2730
3079
|
icon: "check",
|
|
2731
3080
|
class: "me-1"
|
|
2732
|
-
}), t[5] ||=
|
|
3081
|
+
}), t[5] ||= T(" Créer la sollicitation ", -1)], 8, Da))])
|
|
2733
3082
|
])]),
|
|
2734
3083
|
_: 3
|
|
2735
3084
|
}, 8, ["loading"]);
|
|
2736
3085
|
}
|
|
2737
|
-
var
|
|
3086
|
+
var ka = /*#__PURE__*/ G(ba, [["render", Oa]]), Aa = (e, { signal: t, baseUrl: n } = {}) => yt("/v2/cresol/creer_sollicitation", e, {
|
|
2738
3087
|
signal: t,
|
|
2739
3088
|
baseUrl: n
|
|
2740
|
-
}),
|
|
3089
|
+
}), ja = ({ idSollicitation: e, pj: t }, { signal: n, baseUrl: r } = {}) => yt("/v2/cresol/upload_sollicitation_ged", {
|
|
2741
3090
|
idSollicitation: e,
|
|
2742
3091
|
pj: t
|
|
2743
3092
|
}, {
|
|
2744
3093
|
signal: n,
|
|
2745
3094
|
baseUrl: r
|
|
2746
|
-
}),
|
|
3095
|
+
}), Ma = {
|
|
2747
3096
|
modelValue: {
|
|
2748
3097
|
type: Object,
|
|
2749
3098
|
default: null
|
|
@@ -2759,18 +3108,32 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2759
3108
|
"select",
|
|
2760
3109
|
"switch",
|
|
2761
3110
|
"autocomplete",
|
|
2762
|
-
"
|
|
3111
|
+
"recherche"
|
|
3112
|
+
].includes(e)
|
|
3113
|
+
},
|
|
3114
|
+
motifSelectionMode: {
|
|
3115
|
+
type: String,
|
|
3116
|
+
default: "bubble",
|
|
3117
|
+
validator: (e) => ["bubble", "columns"].includes(e)
|
|
3118
|
+
},
|
|
3119
|
+
motifNonProposeMode: {
|
|
3120
|
+
type: String,
|
|
3121
|
+
default: "clear",
|
|
3122
|
+
validator: (e) => [
|
|
3123
|
+
"clear",
|
|
3124
|
+
"block",
|
|
3125
|
+
"ignore"
|
|
2763
3126
|
].includes(e)
|
|
2764
3127
|
},
|
|
2765
3128
|
typesReclamant: {
|
|
2766
3129
|
type: Array,
|
|
2767
3130
|
default: null,
|
|
2768
|
-
validator: (e) => e.every((e) =>
|
|
3131
|
+
validator: (e) => e.every((e) => H.includes(e))
|
|
2769
3132
|
},
|
|
2770
3133
|
typesReclamantExclus: {
|
|
2771
3134
|
type: Array,
|
|
2772
3135
|
default: () => [],
|
|
2773
|
-
validator: (e) => e.every((e) =>
|
|
3136
|
+
validator: (e) => e.every((e) => H.includes(e))
|
|
2774
3137
|
},
|
|
2775
3138
|
provenances: {
|
|
2776
3139
|
type: Array,
|
|
@@ -2809,7 +3172,7 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2809
3172
|
type: String,
|
|
2810
3173
|
default: null
|
|
2811
3174
|
}
|
|
2812
|
-
},
|
|
3175
|
+
}, Na = Object.keys(Ma), Pa = [
|
|
2813
3176
|
"update:modelValue",
|
|
2814
3177
|
"reclamantChange",
|
|
2815
3178
|
"motifChange",
|
|
@@ -2818,29 +3181,44 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2818
3181
|
"created",
|
|
2819
3182
|
"createError",
|
|
2820
3183
|
"error"
|
|
2821
|
-
],
|
|
3184
|
+
], Fa = {
|
|
2822
3185
|
name: "CreerSollicitationForm",
|
|
2823
3186
|
components: {
|
|
2824
3187
|
AsideBlock: Xe,
|
|
2825
|
-
StepperBlock:
|
|
3188
|
+
StepperBlock: ka
|
|
2826
3189
|
},
|
|
2827
|
-
props: { ...
|
|
2828
|
-
emits: [...
|
|
3190
|
+
props: { ...Ma },
|
|
3191
|
+
emits: [...Pa],
|
|
2829
3192
|
setup(e, { emit: t }) {
|
|
2830
|
-
let n = (e) => t("error", e), r = { baseUrl:
|
|
3193
|
+
let n = (e) => t("error", e), r = { baseUrl: L(e, "baseUrl") }, i = Wt(Ut({
|
|
2831
3194
|
onError: n,
|
|
2832
3195
|
...r
|
|
2833
|
-
})), a =
|
|
2834
|
-
reclamants:
|
|
2835
|
-
modules:
|
|
2836
|
-
idModulePrefere:
|
|
2837
|
-
readonly:
|
|
2838
|
-
}))
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
3196
|
+
})), a = M(null), o = M(!1), s = b(() => a.value ?? e.modules ?? []), c = b(() => e.reclamantMode === "recherche"), l = Ue(He({
|
|
3197
|
+
reclamants: b(() => c.value ? [] : e.reclamants),
|
|
3198
|
+
modules: s,
|
|
3199
|
+
idModulePrefere: L(e, "idModule"),
|
|
3200
|
+
readonly: L(e, "readonly")
|
|
3201
|
+
})), u = (t) => {
|
|
3202
|
+
if (!t || t.estDesactive) return !1;
|
|
3203
|
+
let n = e.nomenclatureFilter;
|
|
3204
|
+
return typeof n != "function" || n(t, { reclamant: l.reclamantSelectionne });
|
|
3205
|
+
}, d = b(() => {
|
|
3206
|
+
let e = l.lignePrincipale.idMotif;
|
|
3207
|
+
if (e == null || l.isReadonly("motif")) return !0;
|
|
3208
|
+
let t = i.cache.motifs?.find((t) => t.id === e);
|
|
3209
|
+
return !i.cache.motifs || u(t);
|
|
3210
|
+
}), f = M(null);
|
|
3211
|
+
return Kt(j({
|
|
3212
|
+
nomenclatureFilter: L(e, "nomenclatureFilter"),
|
|
3213
|
+
estMotifPropose: u,
|
|
3214
|
+
motifPrincipalPropose: d,
|
|
3215
|
+
motifNonProposeMode: L(e, "motifNonProposeMode"),
|
|
3216
|
+
motifRetire: f,
|
|
3217
|
+
reclamantMode: L(e, "reclamantMode"),
|
|
3218
|
+
rechercheReclamant: c,
|
|
3219
|
+
motifSelectionMode: L(e, "motifSelectionMode"),
|
|
3220
|
+
typesReclamant: b(() => (e.typesReclamant ?? H).filter((t) => !e.typesReclamantExclus.includes(t))),
|
|
3221
|
+
provenances: b(() => {
|
|
2844
3222
|
let t = i.cache.provenances ?? [];
|
|
2845
3223
|
return (e.provenances ?? t.map((e) => e.id)).filter((t) => !e.provenancesExclues.includes(t)).flatMap((e) => {
|
|
2846
3224
|
let n = t.find((t) => t.id === e);
|
|
@@ -2850,12 +3228,17 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2850
3228
|
}] : [];
|
|
2851
3229
|
});
|
|
2852
3230
|
}),
|
|
2853
|
-
modulesReclamant:
|
|
3231
|
+
modulesReclamant: s,
|
|
3232
|
+
repriseReclamant: o,
|
|
2854
3233
|
...r
|
|
2855
3234
|
})), {
|
|
2856
3235
|
data: i,
|
|
2857
|
-
draft:
|
|
3236
|
+
draft: l,
|
|
2858
3237
|
modulesCharges: a,
|
|
3238
|
+
repriseReclamant: o,
|
|
3239
|
+
rechercheReclamant: c,
|
|
3240
|
+
motifPrincipalPropose: d,
|
|
3241
|
+
motifRetire: f,
|
|
2859
3242
|
onError: n
|
|
2860
3243
|
};
|
|
2861
3244
|
},
|
|
@@ -2887,13 +3270,41 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2887
3270
|
}
|
|
2888
3271
|
} },
|
|
2889
3272
|
async created() {
|
|
2890
|
-
this.draft.reset(this.modelValue), this.draft.syncReclamant();
|
|
3273
|
+
this.data.loadNomenclature(), this.data.loadProvenances(), this.draft.reset(this.modelValue), this.rechercheReclamant && await this.reprendreReclamantFourni(), this.draft.syncReclamant();
|
|
2891
3274
|
let e = this.draft.reclamantSelectionne;
|
|
2892
3275
|
this.$watch("draft.reclamantSelectionne", async (t) => {
|
|
2893
3276
|
this.$emit("reclamantChange", t), await this.chargerModulesReclamant(t, e) && this.draft.syncReclamant();
|
|
2894
|
-
}), this.$watch(
|
|
3277
|
+
}), this.$watch("motifPrincipalPropose", this.retirerMotifNonPropose, { immediate: !0 }), this.$watch(() => this.draft.lignePrincipale.idMotif, (e) => {
|
|
3278
|
+
e != null && (this.motifRetire = null);
|
|
3279
|
+
}), this.$watch(() => JSON.stringify(this.motifChoisi), () => this.$emit("motifChange", this.motifChoisi)), await this.chargerModulesReclamant(e, e) && this.draft.prefillCiblePrincipale(), this.draft.libererCibleFournie();
|
|
2895
3280
|
},
|
|
2896
3281
|
methods: {
|
|
3282
|
+
retirerMotifNonPropose(e) {
|
|
3283
|
+
if (e || this.motifNonProposeMode !== "clear") return;
|
|
3284
|
+
let t = this.draft.lignePrincipale.idMotif, n = {
|
|
3285
|
+
libelle: this.data.motifLibelle(t),
|
|
3286
|
+
associes: this.draft.lignesAssociees.map((e) => e.libelle ?? this.data.motifLibelle(e.idMotif))
|
|
3287
|
+
};
|
|
3288
|
+
this.draft.setCategorie(null), this.motifRetire = n;
|
|
3289
|
+
},
|
|
3290
|
+
async reprendreReclamantFourni() {
|
|
3291
|
+
let { type: e, id: t } = this.draft.draft.reclamant;
|
|
3292
|
+
if (!e || t == null) return;
|
|
3293
|
+
let n = (n) => n.type === e && String(n.id) === String(t), [r] = Oe([e]), i = null;
|
|
3294
|
+
if (r) {
|
|
3295
|
+
this.repriseReclamant = !0;
|
|
3296
|
+
try {
|
|
3297
|
+
i = (await this.data.searchReclamants(r, String(t)) ?? []).find(n) ?? null;
|
|
3298
|
+
} catch {} finally {
|
|
3299
|
+
this.repriseReclamant = !1;
|
|
3300
|
+
}
|
|
3301
|
+
}
|
|
3302
|
+
n(this.draft.draft.reclamant) && this.draft.selectReclamant(i ?? {
|
|
3303
|
+
type: e,
|
|
3304
|
+
id: t,
|
|
3305
|
+
libelle: `${e}/${t}`
|
|
3306
|
+
});
|
|
3307
|
+
},
|
|
2897
3308
|
async chargerModulesReclamant(e, t) {
|
|
2898
3309
|
if (this.modules && e === t) return this.modulesCharges = null, !0;
|
|
2899
3310
|
if (!this.draft.reclamantEstContrat) return this.modulesCharges = [], !0;
|
|
@@ -2911,10 +3322,10 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2911
3322
|
if (!await this.autoriserCreation(e)) return;
|
|
2912
3323
|
let t;
|
|
2913
3324
|
try {
|
|
2914
|
-
t = await
|
|
3325
|
+
t = await Aa(e, this.requestOptions) ?? [];
|
|
2915
3326
|
} catch (t) {
|
|
2916
|
-
if (
|
|
2917
|
-
let n =
|
|
3327
|
+
if (It(t)) return;
|
|
3328
|
+
let n = Ft(t);
|
|
2918
3329
|
this.$emit("createError", {
|
|
2919
3330
|
error: t,
|
|
2920
3331
|
message: n,
|
|
@@ -2964,7 +3375,7 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2964
3375
|
message: t
|
|
2965
3376
|
};
|
|
2966
3377
|
};
|
|
2967
|
-
return a?.id ?
|
|
3378
|
+
return a?.id ? ja({
|
|
2968
3379
|
idSollicitation: a.id,
|
|
2969
3380
|
pj: {
|
|
2970
3381
|
name: n.name,
|
|
@@ -2975,34 +3386,34 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2975
3386
|
...o,
|
|
2976
3387
|
ok: !0,
|
|
2977
3388
|
message: null
|
|
2978
|
-
})).catch((e) => s(
|
|
3389
|
+
})).catch((e) => s(Ft(e))) : Promise.resolve(s("sollicitation introuvable dans la réponse"));
|
|
2979
3390
|
});
|
|
2980
3391
|
return Promise.all(n);
|
|
2981
3392
|
}
|
|
2982
3393
|
}
|
|
2983
|
-
},
|
|
3394
|
+
}, Ia = { class: "row g-3" }, La = {
|
|
2984
3395
|
key: 0,
|
|
2985
3396
|
class: "col-12 col-lg-4"
|
|
2986
3397
|
};
|
|
2987
|
-
function
|
|
2988
|
-
let o =
|
|
2989
|
-
return
|
|
3398
|
+
function Ra(e, t, n, r, i, a) {
|
|
3399
|
+
let o = F("aside-block"), s = F("stepper-block");
|
|
3400
|
+
return A(), C("div", Ia, [e.aside ? (A(), C("div", La, [P(e.$slots, "aside", {}, () => [E(o, { "nb-similaires": e.nbSimilaires }, le({ _: 2 }, [e.$slots["aside-similaires"] ? {
|
|
2990
3401
|
name: "similaires",
|
|
2991
|
-
fn:
|
|
3402
|
+
fn: z((t) => [P(e.$slots, "aside-similaires", k(D(t)))]),
|
|
2992
3403
|
key: "0"
|
|
2993
3404
|
} : void 0, e.$slots["aside-evenements"] ? {
|
|
2994
3405
|
name: "evenements",
|
|
2995
|
-
fn:
|
|
3406
|
+
fn: z(() => [P(e.$slots, "aside-evenements")]),
|
|
2996
3407
|
key: "1"
|
|
2997
|
-
} : void 0]), 1032, ["nb-similaires"])])])) :
|
|
3408
|
+
} : void 0]), 1032, ["nb-similaires"])])])) : S("", !0), w("div", { class: O(["col-12", e.aside ? "col-lg-8" : ""]) }, [E(s, {
|
|
2998
3409
|
step: i.currentStep,
|
|
2999
3410
|
"onUpdate:step": t[0] ||= (e) => i.currentStep = e,
|
|
3000
3411
|
creating: i.creating,
|
|
3001
3412
|
onStepChange: t[1] ||= (t) => e.$emit("stepChange", t),
|
|
3002
3413
|
onSubmit: a.creer
|
|
3003
|
-
},
|
|
3414
|
+
}, le({ _: 2 }, [e.$slots.reclamant ? {
|
|
3004
3415
|
name: "reclamant",
|
|
3005
|
-
fn:
|
|
3416
|
+
fn: z((t) => [P(e.$slots, "reclamant", k(D(t)))]),
|
|
3006
3417
|
key: "0"
|
|
3007
3418
|
} : void 0]), 1032, [
|
|
3008
3419
|
"step",
|
|
@@ -3010,14 +3421,14 @@ function ta(e, t, n, r, i, a) {
|
|
|
3010
3421
|
"onSubmit"
|
|
3011
3422
|
])], 2)]);
|
|
3012
3423
|
}
|
|
3013
|
-
var
|
|
3424
|
+
var za = /*#__PURE__*/ G(Fa, [["render", Ra]]), Ba = {
|
|
3014
3425
|
name: "CreerSollicitationModal",
|
|
3015
3426
|
components: {
|
|
3016
|
-
AmsomModal:
|
|
3017
|
-
CreerSollicitationForm:
|
|
3427
|
+
AmsomModal: ce,
|
|
3428
|
+
CreerSollicitationForm: za
|
|
3018
3429
|
},
|
|
3019
3430
|
props: {
|
|
3020
|
-
...
|
|
3431
|
+
...Ma,
|
|
3021
3432
|
titre: {
|
|
3022
3433
|
type: String,
|
|
3023
3434
|
default: "Nouvelle sollicitation"
|
|
@@ -3027,36 +3438,35 @@ var na = /*#__PURE__*/ K(Qi, [["render", ta]]), ra = {
|
|
|
3027
3438
|
default: !0
|
|
3028
3439
|
}
|
|
3029
3440
|
},
|
|
3030
|
-
emits: [...
|
|
3441
|
+
emits: [...Pa, "close"],
|
|
3031
3442
|
computed: {
|
|
3032
3443
|
formProps() {
|
|
3033
|
-
return Object.fromEntries(
|
|
3444
|
+
return Object.fromEntries(Na.map((e) => [e, this[e]]));
|
|
3034
3445
|
},
|
|
3035
3446
|
formListeners() {
|
|
3036
|
-
return Object.fromEntries(
|
|
3447
|
+
return Object.fromEntries(Pa.filter((e) => e !== "created").map((e) => [e, (...t) => this.$emit(e, ...t)]));
|
|
3037
3448
|
}
|
|
3038
3449
|
},
|
|
3039
3450
|
methods: { onCreated(...e) {
|
|
3040
3451
|
this.$emit("created", ...e), this.closeOnCreated && this.$emit("close");
|
|
3041
3452
|
} }
|
|
3042
|
-
},
|
|
3043
|
-
function
|
|
3044
|
-
let o =
|
|
3045
|
-
return
|
|
3453
|
+
}, Va = { class: "fw-medium fs-5" };
|
|
3454
|
+
function Ha(e, t, n, r, i, a) {
|
|
3455
|
+
let o = F("creer-sollicitation-form"), s = F("amsom-modal");
|
|
3456
|
+
return A(), x(s, {
|
|
3046
3457
|
"close-option": "",
|
|
3047
3458
|
size: "xl",
|
|
3048
3459
|
onClose: t[0] ||= (t) => e.$emit("close")
|
|
3049
3460
|
}, {
|
|
3050
|
-
default:
|
|
3461
|
+
default: z(() => [w("span", Va, I(n.titre), 1), E(o, de({ class: "pt-3" }, a.formProps, pe(a.formListeners), { onCreated: a.onCreated }), le({ _: 2 }, [N(e.$slots, (t, n) => ({
|
|
3051
3462
|
name: n,
|
|
3052
|
-
fn:
|
|
3463
|
+
fn: z((t) => [P(e.$slots, n, k(D(t ?? {})))])
|
|
3053
3464
|
}))]), 1040, ["onCreated"])]),
|
|
3054
3465
|
_: 3
|
|
3055
3466
|
});
|
|
3056
3467
|
}
|
|
3057
|
-
var
|
|
3058
|
-
CreerSollicitationModal:
|
|
3059
|
-
CreerSollicitationForm:
|
|
3468
|
+
var Ua = /*#__PURE__*/ G(Ba, [["render", Ha]]), Wa = {
|
|
3469
|
+
CreerSollicitationModal: Ua,
|
|
3470
|
+
CreerSollicitationForm: za
|
|
3060
3471
|
};
|
|
3061
|
-
|
|
3062
|
-
export { na as CreerSollicitationForm, oa as CreerSollicitationModal, Te as DEFAULT_PROVENANCE_CONTACT, we as PROVENANCES_CONTACT_DEFAUT, V as PROVENANCE_CONTACT_ICONS, Ne as READONLY_FIELDS, Qe as configureCresol, sa as default, Pe as getDefaultDraft, Me as getDefaultLigne, W as getDefaultPatrimoine, Et as resetCresolCache };
|
|
3472
|
+
export { za as CreerSollicitationForm, Ua as CreerSollicitationModal, Te as DEFAULT_PROVENANCE_CONTACT, we as PROVENANCES_CONTACT_DEFAUT, Se as PROVENANCE_CONTACT_ICONS, Ne as READONLY_FIELDS, pt as configureCresol, Wa as default, Pe as getDefaultDraft, Me as getDefaultLigne, U as getDefaultPatrimoine, Vt as resetCresolCache };
|