@amsom-habitat/cresol 0.2.8 → 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 +105 -59
- package/dist/cresol.js +1540 -1141
- package/dist/cresol.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/cresol.js
CHANGED
|
@@ -1,25 +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
|
|
10
|
-
import { AmsomTextarea as
|
|
11
|
-
import { AmsomUploadFile as
|
|
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
|
+
import { AmsomTextarea as be } from "@amsom-habitat/amsom-textarea";
|
|
11
|
+
import { AmsomUploadFile as xe } from "@amsom-habitat/file-manager";
|
|
12
12
|
// src/icons.js
|
|
13
|
-
e.add(t, n, r, i, a, o, s, c, l, u, d, f, p, ee,
|
|
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
14
|
// src/utils/provenanceContact.js
|
|
15
|
-
var
|
|
15
|
+
var Se = {
|
|
16
16
|
T: "phone",
|
|
17
17
|
M: "envelope",
|
|
18
18
|
G: "user-shield",
|
|
19
19
|
V: "building",
|
|
20
20
|
IP: "exclamation-triangle",
|
|
21
21
|
C: "envelope-open"
|
|
22
|
-
}, Ce =
|
|
22
|
+
}, Ce = (e) => Se[e] ?? "comment-dots", we = Object.keys(Se), Te = "T", V = {
|
|
23
23
|
locataire: {
|
|
24
24
|
libelle: "Locataire",
|
|
25
25
|
icon: "house-user",
|
|
@@ -55,14 +55,14 @@ var B = {
|
|
|
55
55
|
icon: "circle-question",
|
|
56
56
|
couleur: "danger"
|
|
57
57
|
}
|
|
58
|
-
},
|
|
59
|
-
...Object.fromEntries(
|
|
58
|
+
}, Ee = ["L", "P"], De = {
|
|
59
|
+
...Object.fromEntries(Ee.map((e) => [e, "locataire"])),
|
|
60
60
|
D: "demandeur",
|
|
61
61
|
T: "tiers",
|
|
62
62
|
U: "autre",
|
|
63
63
|
F: "fournisseur",
|
|
64
64
|
E: "personnel"
|
|
65
|
-
}, H = Object.keys(
|
|
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 = () => ({
|
|
66
66
|
idCommune: null,
|
|
67
67
|
commune: null,
|
|
68
68
|
idEntree: null,
|
|
@@ -77,7 +77,7 @@ var B = {
|
|
|
77
77
|
typeContratActuel: null,
|
|
78
78
|
idContratActuel: null,
|
|
79
79
|
occupantActuel: null
|
|
80
|
-
}),
|
|
80
|
+
}), Me = () => ({
|
|
81
81
|
idMotif: null,
|
|
82
82
|
idCategorie: null,
|
|
83
83
|
idType: null,
|
|
@@ -111,7 +111,7 @@ var B = {
|
|
|
111
111
|
},
|
|
112
112
|
provenance: e,
|
|
113
113
|
lignes: [{
|
|
114
|
-
...
|
|
114
|
+
...Me(),
|
|
115
115
|
cibleMode: "contrat",
|
|
116
116
|
patrimoine: U(),
|
|
117
117
|
description: ""
|
|
@@ -126,7 +126,7 @@ var B = {
|
|
|
126
126
|
return e.etage != null && !e.libelleModule && t.push(`Étage ${e.etage}`), t.length ? t.join(" — ") : "Cible non définie";
|
|
127
127
|
}, Le = (e) => !!e && (e.idModule != null || e.idEntree != null), Re = (e, t) => e.cibleMode === "demande" || !e.cibleOverride && e.patrimoine == null ? !0 : e.cibleMode === "contrat" ? !!(e.contratReclamant && t || e.contratCible) && e.patrimoine?.idModule != null : e.modulePrecis ? e.patrimoine?.idModule != null : Le(e.patrimoine), ze = (e, t) => e.description == null ? !t : e.description.trim().length > 0, Be = (e = {}) => {
|
|
128
128
|
let t = {
|
|
129
|
-
...
|
|
129
|
+
...Me(),
|
|
130
130
|
...e
|
|
131
131
|
};
|
|
132
132
|
return e.patrimoine && (t.patrimoine = {
|
|
@@ -151,17 +151,17 @@ var B = {
|
|
|
151
151
|
} : Be(e)) : t.lignes
|
|
152
152
|
};
|
|
153
153
|
};
|
|
154
|
-
function He({ reclamants: e, modules: t, idModulePrefere: n =
|
|
155
|
-
let i =
|
|
156
|
-
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);
|
|
157
157
|
return e === !0 ? Ne : Array.isArray(e) ? e : [];
|
|
158
|
-
}), 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(() => {
|
|
159
159
|
let e = u.value;
|
|
160
160
|
return !e || l.value.some((t) => d(t, e)) ? l.value : [...l.value, e];
|
|
161
|
-
}), p =
|
|
162
|
-
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);
|
|
163
163
|
return (r == null ? null : e.find((e) => String(e.idModule) === String(r))) ?? e.find((e) => e.estModulePrincipal) ?? e[0] ?? null;
|
|
164
|
-
}),
|
|
164
|
+
}), g = b(() => !!p.value && Ee.includes(p.value.type)), _ = {
|
|
165
165
|
draft: i,
|
|
166
166
|
lignePrincipale: s,
|
|
167
167
|
lignesAssociees: c,
|
|
@@ -169,66 +169,90 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
|
|
|
169
169
|
reclamantsDisponibles: f,
|
|
170
170
|
reclamantSelectionne: p,
|
|
171
171
|
moduleReclamantPrincipal: ee,
|
|
172
|
-
reclamantEstContrat:
|
|
173
|
-
ciblesValid:
|
|
174
|
-
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))),
|
|
175
175
|
isReadonly: o,
|
|
176
|
+
ciblesAssocieesReinitialisees: h,
|
|
177
|
+
ligneCibleValid(e) {
|
|
178
|
+
let t = i.lignes[e];
|
|
179
|
+
return !!t && Re(t, g.value);
|
|
180
|
+
},
|
|
176
181
|
reset(e = null) {
|
|
177
|
-
let t =
|
|
178
|
-
|
|
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;
|
|
179
190
|
},
|
|
180
191
|
setProvenance(e) {
|
|
181
192
|
i.provenance = e;
|
|
182
193
|
},
|
|
194
|
+
libererCibleFournie() {
|
|
195
|
+
m.value = !1;
|
|
196
|
+
},
|
|
183
197
|
syncReclamant() {
|
|
184
198
|
let e = p.value;
|
|
185
|
-
|
|
199
|
+
_.setReclamant({
|
|
186
200
|
type: e?.type ?? null,
|
|
187
201
|
id: e?.id ?? null
|
|
188
202
|
});
|
|
189
203
|
},
|
|
190
204
|
selectReclamant(e) {
|
|
191
|
-
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));
|
|
192
206
|
},
|
|
193
207
|
setReclamant({ type: e, id: t }) {
|
|
208
|
+
let n = !d({
|
|
209
|
+
type: e,
|
|
210
|
+
id: t
|
|
211
|
+
}, i.reclamant);
|
|
194
212
|
if (i.reclamant = {
|
|
195
213
|
type: e ?? null,
|
|
196
214
|
id: t ?? null
|
|
197
|
-
}, o("cible")) return;
|
|
198
|
-
let
|
|
199
|
-
|
|
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());
|
|
200
224
|
},
|
|
201
225
|
prefillCiblePrincipale() {
|
|
202
|
-
if (o("cible")) return;
|
|
226
|
+
if (o("cible") || m.value) return;
|
|
203
227
|
let e = ee.value;
|
|
204
|
-
e &&
|
|
228
|
+
e && _.prefillFromModule(0, e);
|
|
205
229
|
},
|
|
206
230
|
_resetAfterNomenclature() {
|
|
207
|
-
i.lignes[0].responsable = null, i.lignes.splice(1);
|
|
231
|
+
h.value = 0, i.lignes[0].responsable = null, i.lignes.splice(1);
|
|
208
232
|
},
|
|
209
233
|
setCategorie(e) {
|
|
210
234
|
let t = i.lignes[0];
|
|
211
|
-
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();
|
|
212
236
|
},
|
|
213
237
|
setType(e) {
|
|
214
238
|
let t = i.lignes[0];
|
|
215
|
-
t.idType = e, t.idNature = null, t.idMotif = null,
|
|
239
|
+
t.idType = e, t.idNature = null, t.idMotif = null, _._resetAfterNomenclature();
|
|
216
240
|
},
|
|
217
241
|
setNature(e) {
|
|
218
242
|
let t = i.lignes[0];
|
|
219
|
-
t.idNature = e, t.idMotif = null,
|
|
243
|
+
t.idNature = e, t.idMotif = null, _._resetAfterNomenclature();
|
|
220
244
|
},
|
|
221
245
|
setMotif(e) {
|
|
222
|
-
i.lignes[0].idMotif = e,
|
|
246
|
+
i.lignes[0].idMotif = e, _._resetAfterNomenclature();
|
|
223
247
|
},
|
|
224
248
|
selectMotifChain(e) {
|
|
225
249
|
let t = i.lignes[0];
|
|
226
|
-
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();
|
|
227
251
|
},
|
|
228
252
|
toggleLigneAssociee(e, t = {}) {
|
|
229
253
|
let n = i.lignes.findIndex((t, n) => n > 0 && t.idMotif === e);
|
|
230
254
|
n === -1 ? i.lignes.push({
|
|
231
|
-
...
|
|
255
|
+
...Me(),
|
|
232
256
|
idMotif: e,
|
|
233
257
|
...t
|
|
234
258
|
}) : i.lignes.splice(n, 1);
|
|
@@ -238,15 +262,15 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
|
|
|
238
262
|
},
|
|
239
263
|
setCibleMode(e, t) {
|
|
240
264
|
let n = i.lignes[e];
|
|
241
|
-
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());
|
|
242
266
|
},
|
|
243
267
|
setModulePrecis(e, t) {
|
|
244
268
|
let n = i.lignes[e];
|
|
245
|
-
n && (n.modulePrecis = !!t, n.modulePrecis ||
|
|
269
|
+
n && (n.modulePrecis = !!t, n.modulePrecis || _.setPatrimoineModule(e, null));
|
|
246
270
|
},
|
|
247
271
|
toggleContratReclamant(e, t) {
|
|
248
272
|
let n = i.lignes[e];
|
|
249
|
-
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));
|
|
250
274
|
},
|
|
251
275
|
setContratCible(e, t) {
|
|
252
276
|
let n = i.lignes[e];
|
|
@@ -254,31 +278,32 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
|
|
|
254
278
|
typeContrat: t.typeContrat,
|
|
255
279
|
idContrat: t.idContrat,
|
|
256
280
|
libelle: t.libelle ?? null
|
|
257
|
-
} : null,
|
|
281
|
+
} : null, _.setPatrimoineModule(e, null));
|
|
258
282
|
},
|
|
259
283
|
setPatrimoineCommune(e, t) {
|
|
260
|
-
let n =
|
|
261
|
-
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));
|
|
262
286
|
},
|
|
263
287
|
setPatrimoineEntree(e, t) {
|
|
264
|
-
let n =
|
|
265
|
-
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));
|
|
266
290
|
},
|
|
267
291
|
setPatrimoineEtage(e, t) {
|
|
268
|
-
let n =
|
|
269
|
-
n && (n.etage = t,
|
|
292
|
+
let n = _._patrimoine(e);
|
|
293
|
+
n && (n.etage = t, _.setPatrimoineModule(e, null));
|
|
270
294
|
},
|
|
271
295
|
setPatrimoineModule(e, t) {
|
|
272
|
-
let n =
|
|
296
|
+
let n = _._patrimoine(e);
|
|
273
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)));
|
|
274
298
|
},
|
|
275
299
|
prefillFromModule(e, t) {
|
|
276
|
-
let n =
|
|
300
|
+
let n = _._patrimoine(e);
|
|
277
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);
|
|
278
302
|
},
|
|
279
303
|
toggleCibleOverride(e) {
|
|
280
304
|
let t = i.lignes[e];
|
|
281
305
|
if (!t) return;
|
|
306
|
+
h.value = 0;
|
|
282
307
|
let n = i.lignes[0];
|
|
283
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);
|
|
284
309
|
},
|
|
@@ -335,9 +360,9 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
|
|
|
335
360
|
idCible: i.reclamant.id,
|
|
336
361
|
deduireCible: !1
|
|
337
362
|
};
|
|
338
|
-
let l =
|
|
363
|
+
let l = _._patrimoinePayload(r.patrimoine);
|
|
339
364
|
if (r.cibleMode === "contrat" && !r.reprendreLocataireActuel) {
|
|
340
|
-
let e = r.contratReclamant &&
|
|
365
|
+
let e = r.contratReclamant && g.value ? {
|
|
341
366
|
typeContrat: i.reclamant.type,
|
|
342
367
|
idContrat: i.reclamant.id
|
|
343
368
|
} : r.contratCible;
|
|
@@ -364,7 +389,7 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
|
|
|
364
389
|
if (n.cibleMode === "patrimoine" && !n.modulePrecis) return `Parties communes — ${r}`;
|
|
365
390
|
if (n.cibleMode !== "contrat") return r;
|
|
366
391
|
let a = "Contrat non défini";
|
|
367
|
-
if (n.contratReclamant &&
|
|
392
|
+
if (n.contratReclamant && g.value) a = "Contrat du réclamant";
|
|
368
393
|
else if (n.contratCible) {
|
|
369
394
|
let e = n.contratCible;
|
|
370
395
|
a = `${e.libelle ?? "Contrat"} (${e.typeContrat}/${e.idContrat})`;
|
|
@@ -372,42 +397,42 @@ function He({ reclamants: e, modules: t, idModulePrefere: n = A(null), readonly:
|
|
|
372
397
|
return `${a} — ${r}`;
|
|
373
398
|
},
|
|
374
399
|
lignesPayload() {
|
|
375
|
-
return i.lignes.map((e, t) =>
|
|
400
|
+
return i.lignes.map((e, t) => _._lignePayload(e, t));
|
|
376
401
|
},
|
|
377
402
|
creationPayload() {
|
|
378
403
|
let e = p.value;
|
|
379
404
|
return {
|
|
380
405
|
typeReclamant: e?.type ?? null,
|
|
381
406
|
reclamant: e?.id ?? null,
|
|
382
|
-
lignes:
|
|
407
|
+
lignes: _.lignesPayload(),
|
|
383
408
|
provenance: i.provenance
|
|
384
409
|
};
|
|
385
410
|
}
|
|
386
411
|
};
|
|
387
|
-
return
|
|
412
|
+
return j(_);
|
|
388
413
|
}
|
|
389
414
|
function Ue(e) {
|
|
390
|
-
return
|
|
415
|
+
return fe(je, e), e;
|
|
391
416
|
}
|
|
392
|
-
function
|
|
393
|
-
let e =
|
|
417
|
+
function W() {
|
|
418
|
+
let e = ue(je, null);
|
|
394
419
|
if (!e) throw Error("useSollicitationDraft() hors de <creer-sollicitation-form>");
|
|
395
420
|
return e;
|
|
396
421
|
}
|
|
397
422
|
// \0plugin-vue:export-helper
|
|
398
|
-
var
|
|
423
|
+
var G = (e, t) => {
|
|
399
424
|
let n = e.__vccOpts || e;
|
|
400
425
|
for (let [e, r] of t) n[e] = r;
|
|
401
426
|
return n;
|
|
402
427
|
}, We = {
|
|
403
428
|
name: "AsideBlock",
|
|
404
|
-
components: { AmsomNavTabsHorizontal:
|
|
429
|
+
components: { AmsomNavTabsHorizontal: ge },
|
|
405
430
|
props: { nbSimilaires: {
|
|
406
431
|
type: Number,
|
|
407
432
|
default: 0
|
|
408
433
|
} },
|
|
409
434
|
setup() {
|
|
410
|
-
return { draft:
|
|
435
|
+
return { draft: W() };
|
|
411
436
|
},
|
|
412
437
|
data() {
|
|
413
438
|
return { activeTab: null };
|
|
@@ -448,8 +473,8 @@ var K = (e, t) => {
|
|
|
448
473
|
class: "badge bg-danger ms-1"
|
|
449
474
|
}, Ke = { style: { "min-height": "320px" } }, qe = { key: 0 }, Je = { key: 1 };
|
|
450
475
|
function Ye(e, t, n, r, i, a) {
|
|
451
|
-
let o =
|
|
452
|
-
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, {
|
|
453
478
|
key: 0,
|
|
454
479
|
modelValue: i.activeTab,
|
|
455
480
|
"onUpdate:modelValue": t[0] ||= (e) => i.activeTab = e,
|
|
@@ -457,29 +482,145 @@ function Ye(e, t, n, r, i, a) {
|
|
|
457
482
|
"item-key": "id",
|
|
458
483
|
"tab-spacing": 1
|
|
459
484
|
}, {
|
|
460
|
-
libelle:
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
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)
|
|
464
489
|
]),
|
|
465
|
-
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)])]),
|
|
466
491
|
_: 3
|
|
467
|
-
}, 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)]);
|
|
468
609
|
}
|
|
469
|
-
var
|
|
610
|
+
var dt = /*#__PURE__*/ G(ot, [["render", ut]]), ft = {
|
|
470
611
|
baseUrl: "",
|
|
471
|
-
getToken: () =>
|
|
472
|
-
setToken: (e) =>
|
|
473
|
-
logout: () =>
|
|
474
|
-
goToLoginPage: () =>
|
|
612
|
+
getToken: () => ye.getToken(),
|
|
613
|
+
setToken: (e) => ye.setToken(e),
|
|
614
|
+
logout: () => ye.logout(),
|
|
615
|
+
goToLoginPage: () => ye.goToLoginPage()
|
|
475
616
|
};
|
|
476
|
-
function
|
|
477
|
-
Object.assign(
|
|
617
|
+
function pt(e = {}) {
|
|
618
|
+
Object.assign(ft, e);
|
|
478
619
|
}
|
|
479
|
-
var
|
|
620
|
+
var mt = () => ft;
|
|
480
621
|
// src/api/transport/axiosOverlayConnector.js
|
|
481
|
-
function
|
|
482
|
-
let n =
|
|
622
|
+
function ht(e, t = {}) {
|
|
623
|
+
let n = mt(), r = {
|
|
483
624
|
getToken: () => n.getToken?.() ?? null,
|
|
484
625
|
setToken: (e) => n.setToken?.(e),
|
|
485
626
|
logout: () => n.logout?.(),
|
|
@@ -501,73 +642,73 @@ function et(e, t = {}) {
|
|
|
501
642
|
}, t.functions.errorsHandlers = {
|
|
502
643
|
...r.errorsHandlers,
|
|
503
644
|
...t.functions.errorsHandlers ?? {}
|
|
504
|
-
},
|
|
645
|
+
}, ve(e, t);
|
|
505
646
|
}
|
|
506
647
|
// src/api/transport/httpClient.js
|
|
507
|
-
var
|
|
508
|
-
let n = t ||
|
|
648
|
+
var gt = (e, t) => {
|
|
649
|
+
let n = t || mt().baseUrl;
|
|
509
650
|
if (!n) throw Error("Cresol : baseUrl non renseignée (configureCresol ou prop baseUrl)");
|
|
510
651
|
return `${n}${e}`;
|
|
511
|
-
},
|
|
652
|
+
}, _t = (e = {}) => {
|
|
512
653
|
let t = new URLSearchParams();
|
|
513
654
|
Object.entries(e).forEach(([e, n]) => {
|
|
514
655
|
n != null && n !== "" && t.append(e, typeof n == "object" ? JSON.stringify(n) : n);
|
|
515
656
|
});
|
|
516
657
|
let n = t.toString();
|
|
517
658
|
return n ? `?${n}` : "";
|
|
518
|
-
},
|
|
519
|
-
url:
|
|
659
|
+
}, vt = ({ method: e, path: t, params: n, data: r, signal: i, baseUrl: a }, o = {}) => ht({
|
|
660
|
+
url: gt(`${t}${_t(n)}`, a),
|
|
520
661
|
method: e,
|
|
521
662
|
...r === void 0 ? {} : { data: r },
|
|
522
663
|
...i ? { signal: i } : {}
|
|
523
|
-
}, o), q = (e, { params: t, signal: n, overlay: r, baseUrl: i } = {}) =>
|
|
664
|
+
}, o), q = (e, { params: t, signal: n, overlay: r, baseUrl: i } = {}) => vt({
|
|
524
665
|
method: "GET",
|
|
525
666
|
path: e,
|
|
526
667
|
params: t,
|
|
527
668
|
signal: n,
|
|
528
669
|
baseUrl: i
|
|
529
|
-
}, r).then((e) => e.data),
|
|
670
|
+
}, r).then((e) => e.data), yt = (e, t, { params: n, signal: r, overlay: i, baseUrl: a } = {}) => vt({
|
|
530
671
|
method: "POST",
|
|
531
672
|
path: e,
|
|
532
673
|
params: n,
|
|
533
674
|
data: t,
|
|
534
675
|
signal: r,
|
|
535
676
|
baseUrl: a
|
|
536
|
-
}, i).then((e) => e.data),
|
|
677
|
+
}, i).then((e) => e.data), bt = { mustBeAuthenticated: !1 }, J = (e, { signal: t, baseUrl: n } = {}) => q(e, {
|
|
537
678
|
signal: t,
|
|
538
679
|
baseUrl: n,
|
|
539
|
-
overlay:
|
|
540
|
-
}),
|
|
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", {
|
|
541
682
|
params: { estDesactive: !1 },
|
|
542
683
|
signal: e,
|
|
543
684
|
baseUrl: t,
|
|
544
|
-
overlay:
|
|
545
|
-
}),
|
|
685
|
+
overlay: bt
|
|
686
|
+
}), Dt = ({ signal: e, baseUrl: t } = {}) => q("/collaborateurs", {
|
|
546
687
|
params: { actif: !0 },
|
|
547
688
|
signal: e,
|
|
548
689
|
baseUrl: t
|
|
549
|
-
}),
|
|
690
|
+
}), Ot = async ({ signal: e, baseUrl: t } = {}) => (await q("/v2/patrimoine/communes", {
|
|
550
691
|
signal: e,
|
|
551
692
|
baseUrl: t
|
|
552
693
|
}) ?? []).map((e) => ({
|
|
553
694
|
idCommune: e.id,
|
|
554
695
|
commune: e.libelle
|
|
555
|
-
})),
|
|
696
|
+
})), kt = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/entrees", {
|
|
556
697
|
params: { idCommune: e },
|
|
557
698
|
signal: t,
|
|
558
699
|
baseUrl: n
|
|
559
|
-
}),
|
|
700
|
+
}), At = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/modules", {
|
|
560
701
|
params: { codeProgramme: e },
|
|
561
702
|
signal: t,
|
|
562
703
|
baseUrl: n
|
|
563
|
-
}),
|
|
704
|
+
}), jt = ({ idContrat: e, typeContrat: t }, { signal: n, baseUrl: r } = {}) => q("/v2/patrimoine/contrat_modules", {
|
|
564
705
|
params: {
|
|
565
706
|
idContrat: e,
|
|
566
707
|
typeContrat: t
|
|
567
708
|
},
|
|
568
709
|
signal: n,
|
|
569
710
|
baseUrl: r
|
|
570
|
-
}),
|
|
711
|
+
}), Mt = ({ motif: e, categorie: t, type: n, nature: r }, { signal: i, baseUrl: a } = {}) => q("/v2/sollicitation/responsables", {
|
|
571
712
|
params: {
|
|
572
713
|
motif: e,
|
|
573
714
|
categorie: t,
|
|
@@ -576,11 +717,11 @@ var tt = (e, t) => {
|
|
|
576
717
|
},
|
|
577
718
|
signal: i,
|
|
578
719
|
baseUrl: a
|
|
579
|
-
}),
|
|
720
|
+
}), Nt = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/contrat_module_rechercher", {
|
|
580
721
|
params: { recherche: e },
|
|
581
722
|
signal: t,
|
|
582
723
|
baseUrl: n
|
|
583
|
-
}),
|
|
724
|
+
}), Pt = ({ categorie: e, recherche: t }, { signal: n, baseUrl: r } = {}) => q("/v2/cresol/reclamant_rechercher", {
|
|
584
725
|
params: {
|
|
585
726
|
categorie: e,
|
|
586
727
|
recherche: t
|
|
@@ -589,11 +730,11 @@ var tt = (e, t) => {
|
|
|
589
730
|
baseUrl: r
|
|
590
731
|
});
|
|
591
732
|
// src/utils/apiError.js
|
|
592
|
-
function
|
|
733
|
+
function Ft(e) {
|
|
593
734
|
let t = e?.response?.data;
|
|
594
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";
|
|
595
736
|
}
|
|
596
|
-
var
|
|
737
|
+
var It = (e) => e?.name === "AbortError" || e?.name === "CanceledError", Lt = Symbol("cresol:data"), Rt = () => ({
|
|
597
738
|
motifs: null,
|
|
598
739
|
categories: null,
|
|
599
740
|
types: null,
|
|
@@ -606,17 +747,17 @@ var xt = (e) => e?.name === "AbortError" || e?.name === "CanceledError", St = Sy
|
|
|
606
747
|
modulesByProgramme: {},
|
|
607
748
|
modulesByContrat: {},
|
|
608
749
|
responsablesByMotif: {}
|
|
609
|
-
}),
|
|
610
|
-
function
|
|
611
|
-
|
|
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();
|
|
612
753
|
}
|
|
613
|
-
var X = (e, t, n) => e?.find((e) => e[t] === n)?.libelle ?? n,
|
|
614
|
-
function
|
|
615
|
-
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) => {
|
|
616
757
|
let a = `${i()}|${t}`;
|
|
617
758
|
if (Y.has(a)) return Y.get(a);
|
|
618
759
|
n.value += 1;
|
|
619
|
-
let o = Promise.resolve().then(r).catch((t) => (
|
|
760
|
+
let o = Promise.resolve().then(r).catch((t) => (It(t) || e?.(Ft(t)), null)).finally(() => {
|
|
620
761
|
--n.value, Y.delete(a);
|
|
621
762
|
});
|
|
622
763
|
return Y.set(a, o), o;
|
|
@@ -625,30 +766,30 @@ function Ot({ onError: e, baseUrl: t } = {}) {
|
|
|
625
766
|
return a();
|
|
626
767
|
},
|
|
627
768
|
loading: n,
|
|
628
|
-
isLoading:
|
|
769
|
+
isLoading: b(() => n.value > 0),
|
|
629
770
|
loadNomenclature() {
|
|
630
771
|
return Promise.all([
|
|
631
|
-
s("motifs",
|
|
632
|
-
s("categories",
|
|
633
|
-
s("types",
|
|
634
|
-
s("natures",
|
|
635
|
-
s("etats",
|
|
772
|
+
s("motifs", xt),
|
|
773
|
+
s("categories", St),
|
|
774
|
+
s("types", Ct),
|
|
775
|
+
s("natures", wt),
|
|
776
|
+
s("etats", Tt)
|
|
636
777
|
]);
|
|
637
778
|
},
|
|
638
|
-
loadCollaborateurs: () => s("collaborateurs",
|
|
639
|
-
loadProvenances: () => s("provenances",
|
|
779
|
+
loadCollaborateurs: () => s("collaborateurs", Dt),
|
|
780
|
+
loadProvenances: () => s("provenances", Et),
|
|
640
781
|
loadCommunes() {
|
|
641
|
-
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));
|
|
642
783
|
},
|
|
643
784
|
loadAdresses(e) {
|
|
644
785
|
return e == null ? Promise.resolve([]) : a().adressesByCommune[e] ? Promise.resolve(a().adressesByCommune[e]) : o(`adresses:${e}`, async () => {
|
|
645
|
-
let t = await
|
|
786
|
+
let t = await kt(e, r());
|
|
646
787
|
return a().adressesByCommune[e] = t ?? [], t;
|
|
647
788
|
});
|
|
648
789
|
},
|
|
649
790
|
loadModulesOfProgramme(e) {
|
|
650
791
|
return e == null ? Promise.resolve([]) : a().modulesByProgramme[e] ? Promise.resolve(a().modulesByProgramme[e]) : o(`modules:${e}`, async () => {
|
|
651
|
-
let t = await
|
|
792
|
+
let t = await At(e, r());
|
|
652
793
|
return a().modulesByProgramme[e] = t ?? [], t;
|
|
653
794
|
});
|
|
654
795
|
},
|
|
@@ -656,7 +797,7 @@ function Ot({ onError: e, baseUrl: t } = {}) {
|
|
|
656
797
|
if (e == null) return Promise.resolve([]);
|
|
657
798
|
let n = `${t ?? ""}|${e}`;
|
|
658
799
|
return a().modulesByContrat[n] ? Promise.resolve(a().modulesByContrat[n]) : o(`contratModules:${n}`, async () => {
|
|
659
|
-
let i = await
|
|
800
|
+
let i = await jt({
|
|
660
801
|
idContrat: e,
|
|
661
802
|
typeContrat: t
|
|
662
803
|
}, r());
|
|
@@ -666,7 +807,7 @@ function Ot({ onError: e, baseUrl: t } = {}) {
|
|
|
666
807
|
async searchContrats(e, { signal: t } = {}) {
|
|
667
808
|
let n = (e ?? "").trim();
|
|
668
809
|
if (!n) return [];
|
|
669
|
-
let i = await
|
|
810
|
+
let i = await Nt(n, {
|
|
670
811
|
...r(),
|
|
671
812
|
signal: t
|
|
672
813
|
}), a = /* @__PURE__ */ new Map();
|
|
@@ -688,7 +829,7 @@ function Ot({ onError: e, baseUrl: t } = {}) {
|
|
|
688
829
|
async searchReclamants(e, t, { signal: n } = {}) {
|
|
689
830
|
let i = (t ?? "").trim();
|
|
690
831
|
if (!i) return [];
|
|
691
|
-
let a = await
|
|
832
|
+
let a = await Pt({
|
|
692
833
|
categorie: e,
|
|
693
834
|
recherche: i
|
|
694
835
|
}, {
|
|
@@ -724,7 +865,7 @@ function Ot({ onError: e, baseUrl: t } = {}) {
|
|
|
724
865
|
},
|
|
725
866
|
loadResponsables({ motif: e, categorie: t, type: n, nature: i }) {
|
|
726
867
|
return e == null ? Promise.resolve([]) : a().responsablesByMotif[e] ? Promise.resolve(a().responsablesByMotif[e]) : o(`responsables:${e}`, async () => {
|
|
727
|
-
let o = await
|
|
868
|
+
let o = await Mt({
|
|
728
869
|
motif: e,
|
|
729
870
|
categorie: t,
|
|
730
871
|
type: n,
|
|
@@ -753,46 +894,84 @@ function Ot({ onError: e, baseUrl: t } = {}) {
|
|
|
753
894
|
typeLibelle: (e) => X(a().types, "id", e),
|
|
754
895
|
natureLibelle: (e) => X(a().natures, "id", e),
|
|
755
896
|
etatLibelle: (e) => X(a().etats, "code", e),
|
|
756
|
-
motifIcon: (e) =>
|
|
757
|
-
categorieIcon: (e) =>
|
|
758
|
-
typeIcon: (e) =>
|
|
759
|
-
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)
|
|
760
901
|
};
|
|
761
|
-
return
|
|
902
|
+
return j(c);
|
|
762
903
|
}
|
|
763
|
-
function
|
|
764
|
-
return
|
|
904
|
+
function Wt(e) {
|
|
905
|
+
return fe(Lt, e), e;
|
|
765
906
|
}
|
|
766
907
|
function Z() {
|
|
767
|
-
let e =
|
|
908
|
+
let e = ue(Lt, null);
|
|
768
909
|
if (!e) throw Error("useCresolData() hors de <creer-sollicitation-form>");
|
|
769
910
|
return e;
|
|
770
911
|
}
|
|
771
|
-
// src/
|
|
772
|
-
var
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
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)]));
|
|
779
957
|
}
|
|
958
|
+
var $t = /*#__PURE__*/ G(qt, [["render", Qt]]);
|
|
780
959
|
// src/utils/date.js
|
|
781
|
-
function
|
|
960
|
+
function en(e) {
|
|
782
961
|
return e == null ? "" : (/* @__PURE__ */ new Date(e * 1e3)).toISOString().slice(0, 10);
|
|
783
962
|
}
|
|
784
|
-
function
|
|
963
|
+
function tn(e) {
|
|
785
964
|
return e ? Math.floor(new Date(e).getTime() / 1e3) : null;
|
|
786
965
|
}
|
|
787
|
-
function
|
|
966
|
+
function nn(e) {
|
|
788
967
|
return e == null ? "" : (/* @__PURE__ */ new Date(e * 1e3)).toLocaleDateString("fr-FR");
|
|
789
968
|
}
|
|
790
|
-
// src/
|
|
791
|
-
var
|
|
792
|
-
|
|
793
|
-
|
|
969
|
+
// src/components/ReclamantTypeBadgeComponent.vue
|
|
970
|
+
var rn = M(!1);
|
|
971
|
+
at(Object.values(V).map((e) => e.icon)).then(() => {
|
|
972
|
+
rn.value = !0;
|
|
794
973
|
});
|
|
795
|
-
var
|
|
974
|
+
var an = {
|
|
796
975
|
name: "ReclamantTypeBadgeComponent",
|
|
797
976
|
props: {
|
|
798
977
|
reclamant: {
|
|
@@ -805,25 +984,25 @@ var Rt = {
|
|
|
805
984
|
}
|
|
806
985
|
},
|
|
807
986
|
setup() {
|
|
808
|
-
return { iconsReady:
|
|
987
|
+
return { iconsReady: rn };
|
|
809
988
|
},
|
|
810
989
|
computed: { type() {
|
|
811
|
-
return
|
|
990
|
+
return Ae(this.reclamant);
|
|
812
991
|
} }
|
|
813
|
-
},
|
|
814
|
-
function
|
|
815
|
-
let o =
|
|
816
|
-
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", {
|
|
817
996
|
key: 0,
|
|
818
|
-
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`]),
|
|
819
998
|
title: a.type.libelle
|
|
820
|
-
}, [r.iconsReady ? (
|
|
999
|
+
}, [r.iconsReady ? (A(), x(o, {
|
|
821
1000
|
key: 0,
|
|
822
1001
|
icon: a.type.icon,
|
|
823
1002
|
"fixed-width": ""
|
|
824
|
-
}, 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);
|
|
825
1004
|
}
|
|
826
|
-
var
|
|
1005
|
+
var ln = /*#__PURE__*/ G(an, [["render", cn]]), un = [
|
|
827
1006
|
{
|
|
828
1007
|
key: "locataire",
|
|
829
1008
|
label: "Locataire",
|
|
@@ -880,20 +1059,21 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
|
|
|
880
1059
|
aucun: "Aucun réclamant trouvé.",
|
|
881
1060
|
placeholder: "Nom, prénom, n° de contrat, de module ou de demande, adresse, téléphone ou mail…"
|
|
882
1061
|
}
|
|
883
|
-
],
|
|
1062
|
+
], dn = {
|
|
884
1063
|
signataire: "Signataire",
|
|
885
1064
|
occupant: "Occupant",
|
|
886
1065
|
demandeur: "Demandeur"
|
|
887
|
-
},
|
|
1066
|
+
}, fn = {
|
|
888
1067
|
name: "ReclamantRechercheBlock",
|
|
889
1068
|
components: {
|
|
890
|
-
AmsomAutocomplete:
|
|
891
|
-
AmsomOverlay:
|
|
892
|
-
|
|
1069
|
+
AmsomAutocomplete: B,
|
|
1070
|
+
AmsomOverlay: v,
|
|
1071
|
+
IconSelectComponent: dt,
|
|
1072
|
+
ReclamantTypeBadgeComponent: ln
|
|
893
1073
|
},
|
|
894
1074
|
setup() {
|
|
895
1075
|
return {
|
|
896
|
-
draft:
|
|
1076
|
+
draft: W(),
|
|
897
1077
|
data: Z(),
|
|
898
1078
|
options: Q()
|
|
899
1079
|
};
|
|
@@ -912,13 +1092,20 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
|
|
|
912
1092
|
return this.options.typesReclamant ?? H;
|
|
913
1093
|
},
|
|
914
1094
|
autorisees() {
|
|
915
|
-
return
|
|
1095
|
+
return Oe(this.typesAutorises);
|
|
916
1096
|
},
|
|
917
1097
|
categories() {
|
|
918
|
-
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
|
+
}));
|
|
919
1106
|
},
|
|
920
1107
|
categorieCourante() {
|
|
921
|
-
return
|
|
1108
|
+
return un.find((e) => e.key === this.categorie);
|
|
922
1109
|
},
|
|
923
1110
|
selectionne() {
|
|
924
1111
|
return this.draft.reclamantSelectionne;
|
|
@@ -936,7 +1123,7 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
|
|
|
936
1123
|
this.categorie !== "tout" && (this.categorie = this.categorieOf(e) ?? this.categorie);
|
|
937
1124
|
} },
|
|
938
1125
|
async created() {
|
|
939
|
-
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;
|
|
940
1127
|
},
|
|
941
1128
|
beforeUnmount() {
|
|
942
1129
|
clearTimeout(this.rechercheTimeout), this.controller?.abort();
|
|
@@ -946,7 +1133,7 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
|
|
|
946
1133
|
e && this.draft.selectReclamant(e);
|
|
947
1134
|
},
|
|
948
1135
|
setCategorie(e) {
|
|
949
|
-
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);
|
|
950
1137
|
},
|
|
951
1138
|
rechercherPlusTard(e) {
|
|
952
1139
|
clearTimeout(this.rechercheTimeout), this.rechercheTimeout = setTimeout(() => this.rechercher(e), 400);
|
|
@@ -963,11 +1150,11 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
|
|
|
963
1150
|
return e ? `${e.type}|${e.id}` : null;
|
|
964
1151
|
},
|
|
965
1152
|
categorieOf(e) {
|
|
966
|
-
let t =
|
|
1153
|
+
let t = ke(e);
|
|
967
1154
|
return this.autorisees.includes(t) ? t : null;
|
|
968
1155
|
},
|
|
969
1156
|
sortiLibelle(e) {
|
|
970
|
-
return e?.dateSortie == null ? "sorti" : `sorti le ${
|
|
1157
|
+
return e?.dateSortie == null ? "sorti" : `sorti le ${nn(e.dateSortie)}`;
|
|
971
1158
|
},
|
|
972
1159
|
nomsOf(e) {
|
|
973
1160
|
return (e?.individus ?? []).map((e) => [e.nom, e.prenom].filter(Boolean).join(" ")).filter(Boolean).join(", ");
|
|
@@ -980,202 +1167,107 @@ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
|
|
|
980
1167
|
referenceOf(e) {
|
|
981
1168
|
if (!e?.individus) return "";
|
|
982
1169
|
let t = this.categorieOf(e);
|
|
983
|
-
return t === "locataire" ? [`Contrat ${e.type}/${e.id}`, e.idModule && `Module ${e.idModule}`].filter(Boolean).join(" — ") : t === "demandeur" ? e.libelleReclamant : t === "autre" ? "Individu « Autre »" :
|
|
1170
|
+
return t === "locataire" ? [`Contrat ${e.type}/${e.id}`, e.idModule && `Module ${e.idModule}`].filter(Boolean).join(" — ") : t === "demandeur" ? e.libelleReclamant : t === "autre" ? "Individu « Autre »" : Ae(e).libelle;
|
|
984
1171
|
},
|
|
985
1172
|
detailOf(e) {
|
|
986
1173
|
let t = e?.individus ?? [];
|
|
987
|
-
if (!["locataire", "demandeur"].includes(
|
|
1174
|
+
if (!["locataire", "demandeur"].includes(ke(e))) {
|
|
988
1175
|
let e = t[0];
|
|
989
1176
|
return e ? [e.telephone, e.mail].filter(Boolean).join(" — ") : "";
|
|
990
1177
|
}
|
|
991
1178
|
return t.map((t) => {
|
|
992
|
-
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(", ");
|
|
993
1180
|
return i ? `${n} (${i})` : n;
|
|
994
1181
|
}).join(", ");
|
|
995
1182
|
}
|
|
996
1183
|
}
|
|
997
|
-
},
|
|
1184
|
+
}, pn = { class: "row g-3" }, mn = {
|
|
1185
|
+
key: 0,
|
|
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 = {
|
|
998
1188
|
key: 0,
|
|
999
1189
|
class: "badge bg-warning-subtle text-warning-emphasis ms-1"
|
|
1000
|
-
},
|
|
1190
|
+
}, yn = { class: "text-muted d-block text-truncate" }, bn = { key: 0 }, xn = {
|
|
1001
1191
|
key: 0,
|
|
1002
1192
|
class: "text-muted d-block text-truncate"
|
|
1003
|
-
},
|
|
1193
|
+
}, Sn = {
|
|
1004
1194
|
key: 0,
|
|
1005
1195
|
class: "text-muted"
|
|
1006
1196
|
};
|
|
1007
|
-
function
|
|
1008
|
-
let o =
|
|
1009
|
-
return i.iconsReady ? (
|
|
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, {
|
|
1010
1200
|
key: 0,
|
|
1011
1201
|
loading: r.options.repriseReclamant
|
|
1012
1202
|
}, {
|
|
1013
|
-
default:
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
"
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
}
|
|
1067
|
-
var rn = /*#__PURE__*/ K(Gt, [["render", nn]]), an = {
|
|
1068
|
-
name: "ProvenanceSelecteurBlock",
|
|
1069
|
-
setup() {
|
|
1070
|
-
return {
|
|
1071
|
-
draft: G(),
|
|
1072
|
-
data: Z(),
|
|
1073
|
-
options: Q()
|
|
1074
|
-
};
|
|
1075
|
-
},
|
|
1076
|
-
data() {
|
|
1077
|
-
return { iconsReady: !1 };
|
|
1078
|
-
},
|
|
1079
|
-
computed: {
|
|
1080
|
-
provenances() {
|
|
1081
|
-
return this.options.provenances;
|
|
1082
|
-
},
|
|
1083
|
-
loaded() {
|
|
1084
|
-
return this.data.cache.provenances != null;
|
|
1085
|
-
},
|
|
1086
|
-
selected() {
|
|
1087
|
-
return this.draft.draft.provenance;
|
|
1088
|
-
},
|
|
1089
|
-
libelleFige() {
|
|
1090
|
-
return this.data.cache.provenances?.find((e) => e.id === this.selected)?.libelle ?? this.selected ?? "—";
|
|
1091
|
-
},
|
|
1092
|
-
provenanceChoisie() {
|
|
1093
|
-
return this.provenances.find((e) => e.id === this.selected) ?? null;
|
|
1094
|
-
}
|
|
1095
|
-
},
|
|
1096
|
-
async created() {
|
|
1097
|
-
await jt([...Object.values(B), Ce]), this.iconsReady = !0;
|
|
1098
|
-
},
|
|
1099
|
-
methods: { iconOf: we }
|
|
1100
|
-
}, on = {
|
|
1101
|
-
key: 0,
|
|
1102
|
-
class: "fs-7 text-muted"
|
|
1103
|
-
}, sn = { class: "fw-medium" }, cn = { key: 1 }, ln = { class: "d-flex flex-wrap gap-2" }, un = ["onClick"], dn = {
|
|
1104
|
-
key: 0,
|
|
1105
|
-
class: "fs-7 text-danger mt-1"
|
|
1106
|
-
};
|
|
1107
|
-
function fn(e, t, n, r, i, a) {
|
|
1108
|
-
let o = N("font-awesome-icon");
|
|
1109
|
-
return r.draft.isReadonly("provenance") ? (O(), x("div", on, [t[0] ||= C(" Provenance du contact : ", -1), S("span", sn, [i.iconsReady && a.selected ? (O(), y(o, {
|
|
1110
|
-
key: 0,
|
|
1111
|
-
icon: a.iconOf(a.selected),
|
|
1112
|
-
"fixed-width": ""
|
|
1113
|
-
}, null, 8, ["icon"])) : b("", !0), C(" " + P(a.libelleFige), 1)])])) : (O(), x("div", cn, [
|
|
1114
|
-
t[1] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, [C(" Provenance du contact "), S("span", { class: "text-danger" }, "*")], -1),
|
|
1115
|
-
S("div", ln, [(O(!0), x(_, null, j(a.provenances, (e) => (O(), x("button", {
|
|
1116
|
-
key: e.id,
|
|
1117
|
-
type: "button",
|
|
1118
|
-
class: E(["btn btn-sm d-inline-flex align-items-center gap-2", e.id === a.selected ? "btn-primary" : "btn-outline-primary"]),
|
|
1119
|
-
onClick: (t) => r.draft.setProvenance(e.id)
|
|
1120
|
-
}, [i.iconsReady ? (O(), y(o, {
|
|
1121
|
-
key: 0,
|
|
1122
|
-
icon: e.icon,
|
|
1123
|
-
"fixed-width": ""
|
|
1124
|
-
}, null, 8, ["icon"])) : b("", !0), S("span", null, P(e.libelle), 1)], 10, un))), 128))]),
|
|
1125
|
-
a.loaded && !a.provenanceChoisie ? (O(), x("div", dn, " Sélectionnez par quel canal la sollicitation vous est parvenue. ")) : b("", !0)
|
|
1126
|
-
]));
|
|
1127
|
-
}
|
|
1128
|
-
var pn = /*#__PURE__*/ K(an, [["render", fn]]), mn = {
|
|
1129
|
-
name: "EtapeReclamantBlock",
|
|
1130
|
-
components: {
|
|
1131
|
-
ReclamantRechercheBlock: rn,
|
|
1132
|
-
ProvenanceSelecteurBlock: pn
|
|
1133
|
-
},
|
|
1134
|
-
props: { premiere: {
|
|
1135
|
-
type: Boolean,
|
|
1136
|
-
default: !1
|
|
1137
|
-
} },
|
|
1138
|
-
setup() {
|
|
1139
|
-
return { draft: G() };
|
|
1140
|
-
}
|
|
1141
|
-
}, hn = { class: "d-flex flex-column gap-3" }, gn = { class: "alert alert-light border py-2 px-3 mb-0 fs-7" };
|
|
1142
|
-
function _n(e, t, n, r, i, a) {
|
|
1143
|
-
let o = N("provenance-selecteur-block"), s = N("font-awesome-icon"), c = N("reclamant-recherche-block");
|
|
1144
|
-
return O(), x("div", hn, [n.premiere ? (O(), y(o, { key: 0 })) : b("", !0), M(e.$slots, "reclamant", {
|
|
1145
|
-
reclamant: r.draft.reclamantSelectionne,
|
|
1146
|
-
select: r.draft.selectReclamant
|
|
1147
|
-
}, () => [S("div", gn, [w(s, {
|
|
1148
|
-
icon: "user",
|
|
1149
|
-
class: "text-primary me-2"
|
|
1150
|
-
}), t[0] ||= C(" Pour qui cette sollicitation est-elle créée\xA0? ", -1)]), w(c)])]);
|
|
1151
|
-
}
|
|
1152
|
-
var vn = /*#__PURE__*/ K(mn, [["render", _n]]);
|
|
1153
|
-
// src/utils/text.js
|
|
1154
|
-
function $(e, t = !0) {
|
|
1155
|
-
if (!e) return null;
|
|
1156
|
-
let n = e.toString().normalize("NFD").replace(/[̀-ͯ]/g, "");
|
|
1157
|
-
return t ? n.toLowerCase() : n;
|
|
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);
|
|
1158
1257
|
}
|
|
1159
|
-
|
|
1160
|
-
var yn = {
|
|
1258
|
+
var wn = /*#__PURE__*/ G(fn, [["render", Cn]]), Tn = {
|
|
1161
1259
|
name: "ReclamantSelecteurBlock",
|
|
1162
1260
|
components: {
|
|
1163
|
-
AmsomAutocomplete:
|
|
1164
|
-
ReclamantTypeBadgeComponent:
|
|
1165
|
-
},
|
|
1166
|
-
props: {
|
|
1167
|
-
mode: {
|
|
1168
|
-
type: String,
|
|
1169
|
-
default: null
|
|
1170
|
-
},
|
|
1171
|
-
inline: {
|
|
1172
|
-
type: Boolean,
|
|
1173
|
-
default: !0
|
|
1174
|
-
}
|
|
1261
|
+
AmsomAutocomplete: B,
|
|
1262
|
+
ReclamantTypeBadgeComponent: ln
|
|
1175
1263
|
},
|
|
1264
|
+
props: { mode: {
|
|
1265
|
+
type: String,
|
|
1266
|
+
default: null
|
|
1267
|
+
} },
|
|
1176
1268
|
setup() {
|
|
1177
1269
|
return {
|
|
1178
|
-
draft:
|
|
1270
|
+
draft: W(),
|
|
1179
1271
|
options: Q()
|
|
1180
1272
|
};
|
|
1181
1273
|
},
|
|
@@ -1202,30 +1294,32 @@ var yn = {
|
|
|
1202
1294
|
this.draft.selectReclamant(e);
|
|
1203
1295
|
},
|
|
1204
1296
|
filterReclamants({ search: e, items: t }) {
|
|
1205
|
-
let n = (
|
|
1206
|
-
return n ? t.filter((e) => (
|
|
1297
|
+
let n = (K(e) ?? "").trim();
|
|
1298
|
+
return n ? t.filter((e) => (K(e?.libelle) ?? "").includes(n)) : t;
|
|
1207
1299
|
}
|
|
1208
1300
|
}
|
|
1209
|
-
},
|
|
1301
|
+
}, En = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, Dn = {
|
|
1210
1302
|
key: 0,
|
|
1211
|
-
class: "
|
|
1212
|
-
},
|
|
1213
|
-
key:
|
|
1214
|
-
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",
|
|
1215
1307
|
role: "group"
|
|
1216
|
-
},
|
|
1217
|
-
function
|
|
1218
|
-
let o =
|
|
1219
|
-
return
|
|
1220
|
-
key:
|
|
1221
|
-
class:
|
|
1222
|
-
|
|
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", {
|
|
1223
1317
|
key: t,
|
|
1224
1318
|
type: "button",
|
|
1225
|
-
class:
|
|
1319
|
+
class: O(["btn d-inline-flex align-items-center justify-content-center", e === a.reclamantSelectionne ? "btn-primary" : "btn-outline-primary"]),
|
|
1226
1320
|
onClick: (t) => a.select(e)
|
|
1227
|
-
},
|
|
1228
|
-
key:
|
|
1321
|
+
}, I(e.libelle), 11, An))), 128))])) : a.presentation === "autocomplete" ? (A(), x(s, {
|
|
1322
|
+
key: 2,
|
|
1229
1323
|
"model-value": a.reclamantSelectionne,
|
|
1230
1324
|
items: a.reclamants,
|
|
1231
1325
|
"get-id": a.reclamantId,
|
|
@@ -1233,366 +1327,75 @@ function En(e, t, n, r, i, a) {
|
|
|
1233
1327
|
"filtering-function": a.filterReclamants,
|
|
1234
1328
|
placeholder: "Rechercher un réclamant…",
|
|
1235
1329
|
"input-size": "sm",
|
|
1236
|
-
|
|
1237
|
-
class: E(n.inline ? "" : "w-100"),
|
|
1330
|
+
required: "",
|
|
1238
1331
|
"onUpdate:modelValue": t[0] ||= (e) => a.select(e)
|
|
1239
1332
|
}, {
|
|
1240
|
-
options:
|
|
1333
|
+
options: z((e) => [E(o, {
|
|
1241
1334
|
reclamant: e,
|
|
1242
1335
|
"icon-only": "",
|
|
1243
1336
|
class: "me-1"
|
|
1244
|
-
}, null, 8, ["reclamant"]),
|
|
1337
|
+
}, null, 8, ["reclamant"]), T(" " + I(e?.libelle), 1)]),
|
|
1245
1338
|
_: 1
|
|
1246
1339
|
}, 8, [
|
|
1247
1340
|
"model-value",
|
|
1248
1341
|
"items",
|
|
1249
1342
|
"get-id",
|
|
1250
1343
|
"get-input-libelle",
|
|
1251
|
-
"filtering-function"
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
class: E(["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",
|
|
1256
1348
|
value: a.reclamants.indexOf(a.reclamantSelectionne),
|
|
1257
1349
|
onChange: t[1] ||= (e) => a.select(a.reclamants[e.target.value])
|
|
1258
|
-
}, [(
|
|
1350
|
+
}, [(A(!0), C(y, null, N(a.reclamants, (e, t) => (A(), C("option", {
|
|
1259
1351
|
key: t,
|
|
1260
1352
|
value: t
|
|
1261
|
-
},
|
|
1353
|
+
}, I(e.libelle), 9, Mn))), 128))], 40, jn))]);
|
|
1262
1354
|
}
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
},
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
mainLigne() {
|
|
1288
|
-
return this.draft.lignePrincipale;
|
|
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
|
|
1289
1379
|
},
|
|
1290
|
-
|
|
1291
|
-
|
|
1380
|
+
cibleMode: {
|
|
1381
|
+
type: String,
|
|
1382
|
+
default: "contrat"
|
|
1292
1383
|
},
|
|
1293
|
-
|
|
1294
|
-
|
|
1384
|
+
reclamantModules: {
|
|
1385
|
+
type: Array,
|
|
1386
|
+
default: () => []
|
|
1295
1387
|
},
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
let t = this.draft.reclamantSelectionne;
|
|
1300
|
-
return this.activeMotifs.filter((n) => e(n, { reclamant: t }));
|
|
1388
|
+
reclamantType: {
|
|
1389
|
+
type: String,
|
|
1390
|
+
default: null
|
|
1301
1391
|
},
|
|
1302
|
-
|
|
1303
|
-
|
|
1392
|
+
contratReclamant: {
|
|
1393
|
+
type: Boolean,
|
|
1394
|
+
default: !0
|
|
1304
1395
|
},
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
naturesList() {
|
|
1309
|
-
return this.mainLigne.idType ? this.distinct(this.allowedMotifs.filter((e) => e.idType === this.mainLigne.idType), "idNature", "nature", (e) => this.data.natureIcon(e)) : [];
|
|
1310
|
-
},
|
|
1311
|
-
motifsList() {
|
|
1312
|
-
return this.mainLigne.idNature ? this.allowedMotifs.filter((e) => e.idNature === this.mainLigne.idNature).map((e) => ({
|
|
1313
|
-
id: e.id,
|
|
1314
|
-
libelle: e.libelle,
|
|
1315
|
-
icon: e.icon
|
|
1316
|
-
})) : [];
|
|
1317
|
-
},
|
|
1318
|
-
selectedMotif() {
|
|
1319
|
-
return this.mainLigne.idMotif ? this.activeMotifs.find((e) => e.id === this.mainLigne.idMotif) ?? null : null;
|
|
1320
|
-
},
|
|
1321
|
-
motifsAssocies() {
|
|
1322
|
-
let e = this.selectedMotif?.association;
|
|
1323
|
-
return e ? Object.entries(e).map(([e, t]) => ({
|
|
1324
|
-
libelle: e,
|
|
1325
|
-
idMotif: t
|
|
1326
|
-
})) : [];
|
|
1327
|
-
},
|
|
1328
|
-
selectionChain() {
|
|
1329
|
-
let e = [];
|
|
1330
|
-
return this.mainLigne.idCategorie && e.push({
|
|
1331
|
-
level: "categorie",
|
|
1332
|
-
libelle: this.data.categorieLibelle(this.mainLigne.idCategorie),
|
|
1333
|
-
icon: this.data.categorieIcon(this.mainLigne.idCategorie)
|
|
1334
|
-
}), this.mainLigne.idType && e.push({
|
|
1335
|
-
level: "type",
|
|
1336
|
-
libelle: this.data.typeLibelle(this.mainLigne.idType),
|
|
1337
|
-
icon: this.data.typeIcon(this.mainLigne.idType)
|
|
1338
|
-
}), this.mainLigne.idNature && e.push({
|
|
1339
|
-
level: "nature",
|
|
1340
|
-
libelle: this.data.natureLibelle(this.mainLigne.idNature),
|
|
1341
|
-
icon: this.data.natureIcon(this.mainLigne.idNature)
|
|
1342
|
-
}), this.mainLigne.idMotif && e.push({
|
|
1343
|
-
level: "motif",
|
|
1344
|
-
libelle: this.data.motifLibelle(this.mainLigne.idMotif),
|
|
1345
|
-
icon: this.data.motifIcon(this.mainLigne.idMotif)
|
|
1346
|
-
}), e;
|
|
1347
|
-
},
|
|
1348
|
-
currentLevel() {
|
|
1349
|
-
return this.mainLigne.idCategorie ? this.mainLigne.idType ? this.mainLigne.idNature ? this.mainLigne.idMotif ? null : {
|
|
1350
|
-
title: "Motif",
|
|
1351
|
-
options: this.motifsList,
|
|
1352
|
-
select: (e) => this.draft.setMotif(e)
|
|
1353
|
-
} : {
|
|
1354
|
-
title: "Nature",
|
|
1355
|
-
options: this.naturesList,
|
|
1356
|
-
select: (e) => this.draft.setNature(e)
|
|
1357
|
-
} : {
|
|
1358
|
-
title: "Type",
|
|
1359
|
-
options: this.typesList,
|
|
1360
|
-
select: (e) => this.draft.setType(e)
|
|
1361
|
-
} : {
|
|
1362
|
-
title: "Catégorie",
|
|
1363
|
-
options: this.categoriesList,
|
|
1364
|
-
select: (e) => this.draft.setCategorie(e)
|
|
1365
|
-
};
|
|
1366
|
-
},
|
|
1367
|
-
motifRecherche: {
|
|
1368
|
-
get() {
|
|
1369
|
-
return this.selectedMotif;
|
|
1370
|
-
},
|
|
1371
|
-
set(e) {
|
|
1372
|
-
let t = e && typeof e == "object" ? e : e ? this.activeMotifs.find((t) => t.id === e) : null;
|
|
1373
|
-
t ? this.draft.selectMotifChain(t) : this.draft.setCategorie(null);
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
},
|
|
1377
|
-
async created() {
|
|
1378
|
-
await this.data.loadNomenclature(), await this.registerIcons(), this.iconsReady = !0;
|
|
1379
|
-
},
|
|
1380
|
-
methods: {
|
|
1381
|
-
goBackTo(e) {
|
|
1382
|
-
e === "categorie" ? this.draft.setCategorie(null) : e === "type" ? this.draft.setType(null) : e === "nature" ? this.draft.setNature(null) : e === "motif" && this.draft.setMotif(null);
|
|
1383
|
-
},
|
|
1384
|
-
isActive(e) {
|
|
1385
|
-
return this.draft.lignesAssociees.some((t) => t.idMotif === e);
|
|
1386
|
-
},
|
|
1387
|
-
toggleMotifAssocie(e) {
|
|
1388
|
-
let t = this.activeMotifs.find((t) => t.id === e.idMotif);
|
|
1389
|
-
this.draft.toggleLigneAssociee(e.idMotif, {
|
|
1390
|
-
libelle: e.libelle,
|
|
1391
|
-
idCategorie: t?.idCategorie ?? null,
|
|
1392
|
-
idType: t?.idType ?? null,
|
|
1393
|
-
idNature: t?.idNature ?? null
|
|
1394
|
-
});
|
|
1395
|
-
},
|
|
1396
|
-
registerIcons() {
|
|
1397
|
-
return jt([
|
|
1398
|
-
...this.data.cache.categories ?? [],
|
|
1399
|
-
...this.data.cache.types ?? [],
|
|
1400
|
-
...this.data.cache.natures ?? [],
|
|
1401
|
-
...this.activeMotifs
|
|
1402
|
-
].map((e) => e.icon));
|
|
1403
|
-
},
|
|
1404
|
-
filterMotifs({ search: e, items: t }) {
|
|
1405
|
-
let n = ($(e) ?? "").trim();
|
|
1406
|
-
if (!n) return t;
|
|
1407
|
-
let r = n.split(/\s+/);
|
|
1408
|
-
return t.filter((e) => {
|
|
1409
|
-
let t = $(`${e.libelle} ${e.categorie} ${e.type} ${e.nature}`) ?? "";
|
|
1410
|
-
return r.every((e) => t.includes(e));
|
|
1411
|
-
});
|
|
1412
|
-
},
|
|
1413
|
-
getMotifId(e) {
|
|
1414
|
-
return e ? e.id : null;
|
|
1415
|
-
},
|
|
1416
|
-
getMotifInputLibelle(e) {
|
|
1417
|
-
return e ? e.libelle : "";
|
|
1418
|
-
},
|
|
1419
|
-
distinct(e, t, n, r) {
|
|
1420
|
-
let i = /* @__PURE__ */ new Map();
|
|
1421
|
-
for (let a of e) a[t] != null && !i.has(a[t]) && i.set(a[t], {
|
|
1422
|
-
id: a[t],
|
|
1423
|
-
libelle: a[n] ?? a[t],
|
|
1424
|
-
icon: r ? r(a[t]) : null
|
|
1425
|
-
});
|
|
1426
|
-
return [...i.values()].sort((e, t) => (e.libelle ?? "").localeCompare(t.libelle ?? ""));
|
|
1427
|
-
},
|
|
1428
|
-
motifLibelleFromId(e) {
|
|
1429
|
-
return this.activeMotifs.find((t) => t.id === e)?.libelle ?? e;
|
|
1430
|
-
}
|
|
1431
|
-
}
|
|
1432
|
-
}, On = {
|
|
1433
|
-
key: 0,
|
|
1434
|
-
class: "d-flex flex-column gap-3"
|
|
1435
|
-
}, 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 = {
|
|
1436
|
-
key: 4,
|
|
1437
|
-
class: "d-flex align-items-center gap-2 text-muted fs-7"
|
|
1438
|
-
}, Rn = {
|
|
1439
|
-
key: 5,
|
|
1440
|
-
class: "d-flex flex-wrap align-items-center gap-2"
|
|
1441
|
-
}, 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 = {
|
|
1442
|
-
key: 0,
|
|
1443
|
-
class: "col-12 text-muted fs-7"
|
|
1444
|
-
}, Kn = [
|
|
1445
|
-
"id",
|
|
1446
|
-
"checked",
|
|
1447
|
-
"disabled",
|
|
1448
|
-
"onChange"
|
|
1449
|
-
], qn = ["for"];
|
|
1450
|
-
function Jn(e, t, n, r, i, a) {
|
|
1451
|
-
let o = N("provenance-selecteur-block"), s = N("reclamant-selecteur-block"), c = N("font-awesome-icon"), l = N("amsom-autocomplete"), u = N("amsom-overlay");
|
|
1452
|
-
return O(), y(u, { loading: r.data.isLoading && !r.data.cache.motifs || !i.iconsReady }, {
|
|
1453
|
-
default: L(() => [i.iconsReady ? (O(), x("div", On, [
|
|
1454
|
-
n.premiere ? (O(), y(o, { key: 0 })) : b("", !0),
|
|
1455
|
-
r.options.reclamantMode === "step" ? b("", !0) : (O(), y(s, { key: 1 })),
|
|
1456
|
-
a.motifFige && a.selectionChain.length ? (O(), 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, [(O(!0), x(_, null, j(a.selectionChain, (e, t) => (O(), x(_, { key: e.level }, [t > 0 ? (O(), y(c, {
|
|
1457
|
-
key: 0,
|
|
1458
|
-
icon: "fa-solid fa-chevron-right",
|
|
1459
|
-
class: "text-muted fs-7"
|
|
1460
|
-
})) : b("", !0), S("span", jn, [e.icon ? (O(), y(c, {
|
|
1461
|
-
key: 0,
|
|
1462
|
-
icon: e.icon,
|
|
1463
|
-
"fixed-width": ""
|
|
1464
|
-
}, null, 8, ["icon"])) : b("", !0), C(" " + P(e.libelle), 1)])], 64))), 128))])])) : b("", !0),
|
|
1465
|
-
a.motifFige ? b("", !0) : (O(), x("div", Mn, [t[2] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Rechercher un motif ", -1), w(l, {
|
|
1466
|
-
modelValue: a.motifRecherche,
|
|
1467
|
-
"onUpdate:modelValue": t[0] ||= (e) => a.motifRecherche = e,
|
|
1468
|
-
items: a.allowedMotifs,
|
|
1469
|
-
"get-id": a.getMotifId,
|
|
1470
|
-
"get-input-libelle": a.getMotifInputLibelle,
|
|
1471
|
-
"get-input-libelle-from-id": a.motifLibelleFromId,
|
|
1472
|
-
"filtering-function": a.filterMotifs,
|
|
1473
|
-
placeholder: "Rechercher (motif, catégorie, type, nature)…",
|
|
1474
|
-
"input-size": "sm",
|
|
1475
|
-
"hide-choices": ""
|
|
1476
|
-
}, {
|
|
1477
|
-
options: L((e) => [S("div", Nn, [e?.icon ? (O(), y(c, {
|
|
1478
|
-
key: 0,
|
|
1479
|
-
icon: e.icon,
|
|
1480
|
-
class: "text-primary",
|
|
1481
|
-
"fixed-width": ""
|
|
1482
|
-
}, null, 8, ["icon"])) : b("", !0), S("div", Pn, [S("div", Fn, P(e?.libelle), 1), S("small", In, P(e?.categorie) + " › " + P(e?.type) + " › " + P(e?.nature), 1)])])]),
|
|
1483
|
-
_: 1
|
|
1484
|
-
}, 8, [
|
|
1485
|
-
"modelValue",
|
|
1486
|
-
"items",
|
|
1487
|
-
"get-id",
|
|
1488
|
-
"get-input-libelle",
|
|
1489
|
-
"get-input-libelle-from-id",
|
|
1490
|
-
"filtering-function"
|
|
1491
|
-
])])),
|
|
1492
|
-
a.motifFige ? b("", !0) : (O(), x("div", Ln, [...t[3] ||= [
|
|
1493
|
-
S("hr", { class: "flex-grow-1 my-0" }, null, -1),
|
|
1494
|
-
S("span", null, "ou sélection guidée", -1),
|
|
1495
|
-
S("hr", { class: "flex-grow-1 my-0" }, null, -1)
|
|
1496
|
-
]])),
|
|
1497
|
-
!a.motifFige && a.selectionChain.length ? (O(), x("div", Rn, [(O(!0), x(_, null, j(a.selectionChain, (e, t) => (O(), x(_, { key: e.level }, [t > 0 ? (O(), y(c, {
|
|
1498
|
-
key: 0,
|
|
1499
|
-
icon: "fa-solid fa-chevron-right",
|
|
1500
|
-
class: "text-muted fs-7"
|
|
1501
|
-
})) : b("", !0), S("button", {
|
|
1502
|
-
type: "button",
|
|
1503
|
-
class: "btn btn-sm btn-primary rounded-pill d-inline-flex align-items-center gap-2",
|
|
1504
|
-
onClick: (t) => a.goBackTo(e.level)
|
|
1505
|
-
}, [
|
|
1506
|
-
e.icon ? (O(), y(c, {
|
|
1507
|
-
key: 0,
|
|
1508
|
-
icon: e.icon,
|
|
1509
|
-
"fixed-width": ""
|
|
1510
|
-
}, null, 8, ["icon"])) : b("", !0),
|
|
1511
|
-
S("span", null, P(e.libelle), 1),
|
|
1512
|
-
w(c, {
|
|
1513
|
-
icon: "fa-solid fa-xmark",
|
|
1514
|
-
class: "fs-7 opacity-75"
|
|
1515
|
-
})
|
|
1516
|
-
], 8, zn)], 64))), 128))])) : b("", !0),
|
|
1517
|
-
!a.motifFige && a.currentLevel ? (O(), x("div", Bn, [S("label", Vn, P(a.currentLevel.title), 1), S("div", Hn, [(O(!0), x(_, null, j(a.currentLevel.options, (e) => (O(), x("div", {
|
|
1518
|
-
key: e.id,
|
|
1519
|
-
class: "col-3 text-center"
|
|
1520
|
-
}, [S("button", {
|
|
1521
|
-
type: "button",
|
|
1522
|
-
class: "btn btn-lg btn-outline-primary btn-circle d-flex align-items-center justify-content-center mx-auto",
|
|
1523
|
-
title: e.libelle,
|
|
1524
|
-
onClick: (t) => a.currentLevel.select(e.id)
|
|
1525
|
-
}, [e.icon ? (O(), y(c, {
|
|
1526
|
-
key: 0,
|
|
1527
|
-
icon: e.icon,
|
|
1528
|
-
size: "lg"
|
|
1529
|
-
}, null, 8, ["icon"])) : b("", !0)], 8, Un), S("div", Wn, P(e.libelle), 1)]))), 128)), a.currentLevel.options.length ? b("", !0) : (O(), x("div", Gn, " Aucun choix disponible "))])])) : b("", !0),
|
|
1530
|
-
a.motifsAssocies.length ? (O(), x(_, { key: 7 }, [t[4] ||= S("div", { class: "d-flex align-items-center gap-2 text-muted fs-7" }, [
|
|
1531
|
-
S("hr", { class: "flex-grow-1 my-0" }),
|
|
1532
|
-
S("span", null, "Autres motifs liés"),
|
|
1533
|
-
S("hr", { class: "flex-grow-1 my-0" })
|
|
1534
|
-
], -1), (O(!0), x(_, null, j(a.motifsAssocies, (e) => (O(), x("div", {
|
|
1535
|
-
key: e.idMotif,
|
|
1536
|
-
class: "form-check form-switch"
|
|
1537
|
-
}, [S("input", {
|
|
1538
|
-
id: `assoc-${e.idMotif}`,
|
|
1539
|
-
class: "form-check-input",
|
|
1540
|
-
type: "checkbox",
|
|
1541
|
-
checked: a.isActive(e.idMotif),
|
|
1542
|
-
disabled: a.motifFige,
|
|
1543
|
-
onChange: (t) => a.toggleMotifAssocie(e)
|
|
1544
|
-
}, null, 40, Kn), S("label", {
|
|
1545
|
-
class: "form-check-label fs-7",
|
|
1546
|
-
for: `assoc-${e.idMotif}`
|
|
1547
|
-
}, P(e.libelle) + " ? ", 9, qn)]))), 128))], 64)) : b("", !0)
|
|
1548
|
-
])) : b("", !0)]),
|
|
1549
|
-
_: 1
|
|
1550
|
-
}, 8, ["loading"]);
|
|
1551
|
-
}
|
|
1552
|
-
var Yn = /*#__PURE__*/ K(Dn, [["render", Jn]]), Xn = {
|
|
1553
|
-
B: "briefcase",
|
|
1554
|
-
M: "store",
|
|
1555
|
-
W: "dungeon",
|
|
1556
|
-
E: "user-graduate",
|
|
1557
|
-
K: "building-shield",
|
|
1558
|
-
F: "person-shelter",
|
|
1559
|
-
S: "square-parking",
|
|
1560
|
-
V: "hands-holding"
|
|
1561
|
-
};
|
|
1562
|
-
function Zn(e, t = !1, n = "circle-question") {
|
|
1563
|
-
return e === "L" ? t ? "building" : "house" : Xn[e] ?? n;
|
|
1564
|
-
}
|
|
1565
|
-
function Qn(e) {
|
|
1566
|
-
return e ? e.idCategorieModule === "L" ? e.estCollectif ? "Appartement" : "Maison" : e.categorieModule ?? "" : "";
|
|
1567
|
-
}
|
|
1568
|
-
// src/components/CiblePickerBlock.vue
|
|
1569
|
-
var $n = 0, er = {
|
|
1570
|
-
name: "CiblePickerBlock",
|
|
1571
|
-
components: { AmsomAutocomplete: R },
|
|
1572
|
-
props: {
|
|
1573
|
-
patrimoine: {
|
|
1574
|
-
type: Object,
|
|
1575
|
-
default: null
|
|
1576
|
-
},
|
|
1577
|
-
cibleMode: {
|
|
1578
|
-
type: String,
|
|
1579
|
-
default: "contrat"
|
|
1580
|
-
},
|
|
1581
|
-
reclamantModules: {
|
|
1582
|
-
type: Array,
|
|
1583
|
-
default: () => []
|
|
1584
|
-
},
|
|
1585
|
-
reclamantType: {
|
|
1586
|
-
type: String,
|
|
1587
|
-
default: null
|
|
1588
|
-
},
|
|
1589
|
-
contratReclamant: {
|
|
1590
|
-
type: Boolean,
|
|
1591
|
-
default: !0
|
|
1592
|
-
},
|
|
1593
|
-
contratCible: {
|
|
1594
|
-
type: Object,
|
|
1595
|
-
default: null
|
|
1396
|
+
contratCible: {
|
|
1397
|
+
type: Object,
|
|
1398
|
+
default: null
|
|
1596
1399
|
},
|
|
1597
1400
|
afficheCaseContratReclamant: {
|
|
1598
1401
|
type: Boolean,
|
|
@@ -1623,7 +1426,7 @@ var $n = 0, er = {
|
|
|
1623
1426
|
},
|
|
1624
1427
|
data() {
|
|
1625
1428
|
return {
|
|
1626
|
-
uid:
|
|
1429
|
+
uid: ++Rn,
|
|
1627
1430
|
rechercheContrat: "",
|
|
1628
1431
|
contratsTrouves: [],
|
|
1629
1432
|
rechercheEnCours: !1,
|
|
@@ -1770,7 +1573,7 @@ var $n = 0, er = {
|
|
|
1770
1573
|
clearTimeout(this.rechercheTimeout), this.controller?.abort();
|
|
1771
1574
|
},
|
|
1772
1575
|
methods: {
|
|
1773
|
-
formatDate:
|
|
1576
|
+
formatDate: nn,
|
|
1774
1577
|
rechercherPlusTard(e) {
|
|
1775
1578
|
clearTimeout(this.rechercheTimeout), this.rechercheTimeout = setTimeout(() => this.rechercherContrat(e), 400);
|
|
1776
1579
|
},
|
|
@@ -1790,16 +1593,16 @@ var $n = 0, er = {
|
|
|
1790
1593
|
},
|
|
1791
1594
|
filterOn(e) {
|
|
1792
1595
|
return ({ search: t, items: n }) => {
|
|
1793
|
-
let r = (
|
|
1794
|
-
return r ? n.filter((t) => (
|
|
1596
|
+
let r = (K(t) ?? "").trim();
|
|
1597
|
+
return r ? n.filter((t) => (K(t?.[e]) ?? "").includes(r)) : n;
|
|
1795
1598
|
};
|
|
1796
1599
|
},
|
|
1797
1600
|
filterModules({ search: e, items: t }) {
|
|
1798
|
-
let n = (
|
|
1799
|
-
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;
|
|
1800
1603
|
},
|
|
1801
|
-
getCategorieModuleIcon:
|
|
1802
|
-
categorieLibelle:
|
|
1604
|
+
getCategorieModuleIcon: In,
|
|
1605
|
+
categorieLibelle: Ln,
|
|
1803
1606
|
moduleLibelle(e) {
|
|
1804
1607
|
return e ? e.libelleModule ?? e.adresse ?? `Module ${e.idModule}` : "";
|
|
1805
1608
|
},
|
|
@@ -1811,63 +1614,63 @@ var $n = 0, er = {
|
|
|
1811
1614
|
return !!e?.dateFin && e.dateFin < Math.floor(Date.now() / 1e3);
|
|
1812
1615
|
}
|
|
1813
1616
|
}
|
|
1814
|
-
},
|
|
1617
|
+
}, Bn = { class: "d-flex flex-column gap-3" }, Vn = {
|
|
1815
1618
|
class: "btn-group w-100",
|
|
1816
1619
|
role: "group"
|
|
1817
|
-
},
|
|
1620
|
+
}, Hn = ["onClick"], Un = { class: "text-muted d-block mt-1" }, Wn = {
|
|
1818
1621
|
key: 0,
|
|
1819
1622
|
class: "form-check"
|
|
1820
|
-
},
|
|
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 = {
|
|
1821
1624
|
key: 0,
|
|
1822
1625
|
class: "badge bg-info"
|
|
1823
|
-
},
|
|
1626
|
+
}, $n = {
|
|
1824
1627
|
key: 1,
|
|
1825
1628
|
class: "badge bg-warning"
|
|
1826
|
-
},
|
|
1629
|
+
}, er = {
|
|
1827
1630
|
key: 0,
|
|
1828
1631
|
class: "text-muted d-block text-truncate"
|
|
1829
|
-
},
|
|
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 = {
|
|
1830
1633
|
key: 2,
|
|
1831
1634
|
class: "row g-3"
|
|
1832
|
-
},
|
|
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 = {
|
|
1833
1636
|
key: 0,
|
|
1834
1637
|
class: "col-12 col-md-6"
|
|
1835
|
-
},
|
|
1638
|
+
}, hr = { class: "d-flex flex-wrap align-items-center gap-1" }, gr = ["title"], _r = { class: "text-muted" }, vr = {
|
|
1836
1639
|
key: 1,
|
|
1837
1640
|
class: "d-block text-truncate"
|
|
1838
|
-
},
|
|
1641
|
+
}, yr = {
|
|
1839
1642
|
key: 2,
|
|
1840
1643
|
class: "text-muted d-block"
|
|
1841
|
-
},
|
|
1644
|
+
}, br = {
|
|
1842
1645
|
key: 0,
|
|
1843
1646
|
class: "mt-2 d-flex flex-column gap-2"
|
|
1844
|
-
},
|
|
1845
|
-
function
|
|
1846
|
-
let o =
|
|
1847
|
-
return
|
|
1848
|
-
|
|
1849
|
-
t[7] ||=
|
|
1850
|
-
|
|
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", {
|
|
1851
1654
|
key: t.key,
|
|
1852
1655
|
type: "button",
|
|
1853
|
-
class:
|
|
1656
|
+
class: O(["btn btn-sm", n.cibleMode === t.key ? "btn-primary" : "btn-outline-primary"]),
|
|
1854
1657
|
onClick: (n) => e.$emit("change-mode", t.key)
|
|
1855
|
-
}, [
|
|
1658
|
+
}, [E(o, {
|
|
1856
1659
|
icon: t.icon,
|
|
1857
1660
|
class: "me-1"
|
|
1858
|
-
}, null, 8, ["icon"]),
|
|
1859
|
-
|
|
1661
|
+
}, null, 8, ["icon"]), T(" " + I(t.label), 1)], 10, Hn))), 128))]),
|
|
1662
|
+
w("small", Un, I(a.currentMode?.aide), 1)
|
|
1860
1663
|
]),
|
|
1861
|
-
n.cibleMode === "contrat" ? (
|
|
1664
|
+
n.cibleMode === "contrat" ? (A(), C(y, { key: 0 }, [n.afficheCaseContratReclamant ? (A(), C("div", Wn, [w("input", {
|
|
1862
1665
|
id: `contrat-reclamant-${i.uid}`,
|
|
1863
1666
|
class: "form-check-input",
|
|
1864
1667
|
type: "checkbox",
|
|
1865
1668
|
checked: n.contratReclamant,
|
|
1866
1669
|
onChange: t[0] ||= (t) => e.$emit("toggle-contrat-reclamant", t.target.checked)
|
|
1867
|
-
}, null, 40,
|
|
1670
|
+
}, null, 40, Gn), w("label", {
|
|
1868
1671
|
class: "form-check-label fs-7",
|
|
1869
1672
|
for: `contrat-reclamant-${i.uid}`
|
|
1870
|
-
}, " 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, {
|
|
1871
1674
|
modelValue: a.selectedContrat,
|
|
1872
1675
|
"onUpdate:modelValue": t[1] ||= (e) => a.selectedContrat = e,
|
|
1873
1676
|
items: i.contratsTrouves,
|
|
@@ -1881,14 +1684,14 @@ function zr(e, t, n, r, i, a) {
|
|
|
1881
1684
|
"debounce-delay": 0,
|
|
1882
1685
|
onSearch: a.rechercherPlusTard
|
|
1883
1686
|
}, {
|
|
1884
|
-
options:
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
e?.nbModules > 1 ? (
|
|
1889
|
-
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)
|
|
1890
1693
|
]),
|
|
1891
|
-
a.contratAdresse(e) ? (
|
|
1694
|
+
a.contratAdresse(e) ? (A(), C("small", er, I(a.contratAdresse(e)), 1)) : S("", !0)
|
|
1892
1695
|
])]),
|
|
1893
1696
|
_: 1
|
|
1894
1697
|
}, 8, [
|
|
@@ -1899,22 +1702,22 @@ function zr(e, t, n, r, i, a) {
|
|
|
1899
1702
|
"get-id",
|
|
1900
1703
|
"get-input-libelle",
|
|
1901
1704
|
"onSearch"
|
|
1902
|
-
])]))], 64)) :
|
|
1903
|
-
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", {
|
|
1904
1707
|
key: t.titre,
|
|
1905
1708
|
class: "col-12 col-md-6"
|
|
1906
|
-
}, [
|
|
1709
|
+
}, [w("button", {
|
|
1907
1710
|
type: "button",
|
|
1908
|
-
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"]),
|
|
1909
1712
|
"aria-pressed": t.modulePrecis === n.modulePrecis,
|
|
1910
1713
|
onClick: (n) => e.$emit("set-module-precis", t.modulePrecis)
|
|
1911
|
-
}, [
|
|
1714
|
+
}, [E(o, {
|
|
1912
1715
|
icon: t.icon,
|
|
1913
1716
|
class: "fs-4",
|
|
1914
1717
|
"fixed-width": ""
|
|
1915
|
-
}, null, 8, ["icon"]),
|
|
1916
|
-
n.cibleMode === "contrat" || n.cibleMode === "patrimoine" ? (
|
|
1917
|
-
|
|
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, {
|
|
1918
1721
|
modelValue: a.selectedCommune,
|
|
1919
1722
|
"onUpdate:modelValue": t[2] ||= (e) => a.selectedCommune = e,
|
|
1920
1723
|
items: r.data.cache.communes || [],
|
|
@@ -1931,7 +1734,7 @@ function zr(e, t, n, r, i, a) {
|
|
|
1931
1734
|
"get-input-libelle",
|
|
1932
1735
|
"filtering-function"
|
|
1933
1736
|
])]),
|
|
1934
|
-
|
|
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, {
|
|
1935
1738
|
modelValue: a.selectedAdresse,
|
|
1936
1739
|
"onUpdate:modelValue": t[3] ||= (e) => a.selectedAdresse = e,
|
|
1937
1740
|
items: a.adresses,
|
|
@@ -1943,7 +1746,7 @@ function zr(e, t, n, r, i, a) {
|
|
|
1943
1746
|
"input-size": "sm",
|
|
1944
1747
|
"hide-choices": ""
|
|
1945
1748
|
}, {
|
|
1946
|
-
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)])]),
|
|
1947
1750
|
_: 1
|
|
1948
1751
|
}, 8, [
|
|
1949
1752
|
"modelValue",
|
|
@@ -1953,7 +1756,7 @@ function zr(e, t, n, r, i, a) {
|
|
|
1953
1756
|
"filtering-function",
|
|
1954
1757
|
"disabled"
|
|
1955
1758
|
])]),
|
|
1956
|
-
|
|
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, {
|
|
1957
1760
|
modelValue: a.selectedEtage,
|
|
1958
1761
|
"onUpdate:modelValue": t[4] ||= (e) => a.selectedEtage = e,
|
|
1959
1762
|
items: a.etages,
|
|
@@ -1970,25 +1773,25 @@ function zr(e, t, n, r, i, a) {
|
|
|
1970
1773
|
"get-input-libelle",
|
|
1971
1774
|
"disabled"
|
|
1972
1775
|
])])
|
|
1973
|
-
], 64)) : (
|
|
1974
|
-
|
|
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", {
|
|
1975
1778
|
class: "form-control form-control-sm",
|
|
1976
1779
|
disabled: "",
|
|
1977
1780
|
value: n.patrimoine.commune ?? "—"
|
|
1978
|
-
}, null, 8,
|
|
1979
|
-
|
|
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", {
|
|
1980
1783
|
class: "form-control form-control-sm",
|
|
1981
1784
|
disabled: "",
|
|
1982
1785
|
value: n.patrimoine.entree ?? "—"
|
|
1983
|
-
}, null, 8,
|
|
1984
|
-
|
|
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", {
|
|
1985
1788
|
class: "form-control form-control-sm",
|
|
1986
1789
|
disabled: "",
|
|
1987
1790
|
value: n.patrimoine.etage ?? "—"
|
|
1988
|
-
}, null, 8,
|
|
1989
|
-
], 64))], 2), a.afficheModule ? (
|
|
1990
|
-
t[16] ||=
|
|
1991
|
-
|
|
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, {
|
|
1992
1795
|
modelValue: a.selectedModule,
|
|
1993
1796
|
"onUpdate:modelValue": t[5] ||= (e) => a.selectedModule = e,
|
|
1994
1797
|
items: a.modules,
|
|
@@ -2000,20 +1803,20 @@ function zr(e, t, n, r, i, a) {
|
|
|
2000
1803
|
"input-size": "sm",
|
|
2001
1804
|
"hide-choices": ""
|
|
2002
1805
|
}, {
|
|
2003
|
-
options:
|
|
2004
|
-
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, {
|
|
2005
1808
|
key: 0,
|
|
2006
1809
|
icon: "building",
|
|
2007
1810
|
class: "position-absolute top-0 end-0 m-1 text-muted",
|
|
2008
1811
|
title: "Autre adresse ou étage du même programme"
|
|
2009
|
-
})) :
|
|
2010
|
-
|
|
2011
|
-
|
|
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", {
|
|
2012
1815
|
key: 0,
|
|
2013
1816
|
class: "badge bg-info",
|
|
2014
1817
|
title: e?.categorieModule
|
|
2015
|
-
}, [
|
|
2016
|
-
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))
|
|
2017
1820
|
], 2)]),
|
|
2018
1821
|
_: 1
|
|
2019
1822
|
}, 8, [
|
|
@@ -2024,42 +1827,51 @@ function zr(e, t, n, r, i, a) {
|
|
|
2024
1827
|
"filtering-function",
|
|
2025
1828
|
"disabled"
|
|
2026
1829
|
]),
|
|
2027
|
-
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, {
|
|
2028
1831
|
icon: "circle-info",
|
|
2029
1832
|
class: "mt-1"
|
|
2030
|
-
}),
|
|
1833
|
+
}), w("span", null, I(n.locataireActuelOption.hint), 1)], 2), w("div", xr, [w("input", {
|
|
2031
1834
|
id: `locataire-actuel-${i.uid}`,
|
|
2032
1835
|
class: "form-check-input",
|
|
2033
1836
|
type: "checkbox",
|
|
2034
1837
|
checked: n.locataireActuelOption.reprendre,
|
|
2035
1838
|
onChange: t[6] ||= (t) => e.$emit("toggle-reprendre-locataire-actuel", t.target.checked)
|
|
2036
|
-
}, null, 40,
|
|
1839
|
+
}, null, 40, Sr), w("label", {
|
|
2037
1840
|
class: "form-check-label fs-7",
|
|
2038
1841
|
for: `locataire-actuel-${i.uid}`
|
|
2039
|
-
}, " Rattacher au locataire actuel du module ", 8,
|
|
2040
|
-
])) :
|
|
1842
|
+
}, " Rattacher au locataire actuel du module ", 8, Cr)])])) : S("", !0)
|
|
1843
|
+
])) : S("", !0)])) : S("", !0)
|
|
2041
1844
|
]);
|
|
2042
1845
|
}
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
name: "EtapeCibleBlock",
|
|
1846
|
+
var Tr = /*#__PURE__*/ G(zn, [["render", wr]]), Er = 0, Dr = {
|
|
1847
|
+
name: "LigneCibleBlock",
|
|
2046
1848
|
components: {
|
|
2047
|
-
AmsomOverlay:
|
|
2048
|
-
CiblePickerBlock:
|
|
1849
|
+
AmsomOverlay: v,
|
|
1850
|
+
CiblePickerBlock: Tr
|
|
2049
1851
|
},
|
|
1852
|
+
props: { index: {
|
|
1853
|
+
type: Number,
|
|
1854
|
+
required: !0
|
|
1855
|
+
} },
|
|
2050
1856
|
setup() {
|
|
2051
1857
|
return {
|
|
2052
|
-
draft:
|
|
1858
|
+
draft: W(),
|
|
2053
1859
|
data: Z(),
|
|
2054
1860
|
options: Q()
|
|
2055
1861
|
};
|
|
2056
1862
|
},
|
|
1863
|
+
data() {
|
|
1864
|
+
return { uid: ++Er };
|
|
1865
|
+
},
|
|
2057
1866
|
computed: {
|
|
2058
|
-
|
|
2059
|
-
return this.
|
|
1867
|
+
isPrincipale() {
|
|
1868
|
+
return this.index === 0;
|
|
2060
1869
|
},
|
|
2061
|
-
|
|
2062
|
-
return this.draft.
|
|
1870
|
+
ligne() {
|
|
1871
|
+
return this.draft.draft.lignes[this.index];
|
|
1872
|
+
},
|
|
1873
|
+
cibleFigee() {
|
|
1874
|
+
return this.draft.isReadonly("cible");
|
|
2063
1875
|
},
|
|
2064
1876
|
reclamantModules() {
|
|
2065
1877
|
return this.options.modulesReclamant ?? [];
|
|
@@ -2067,68 +1879,18 @@ var Br = {
|
|
|
2067
1879
|
mainModule() {
|
|
2068
1880
|
return this.draft.moduleReclamantPrincipal;
|
|
2069
1881
|
},
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
},
|
|
2073
|
-
reclamantType() {
|
|
2074
|
-
return this.draft.draft.reclamant.type;
|
|
2075
|
-
},
|
|
2076
|
-
motifLibelle() {
|
|
2077
|
-
let e = this.lignePrincipale.idMotif;
|
|
2078
|
-
return e == null ? null : this.data.motifLibelle(e);
|
|
2079
|
-
}
|
|
2080
|
-
},
|
|
2081
|
-
async created() {
|
|
2082
|
-
if (this.reclamantType === "D" || this.cibleFigee) return;
|
|
2083
|
-
await this.data.loadCommunes(), !this.draft.reclamantEstContrat && this.lignePrincipale.cibleMode === "contrat" && this.draft.setCibleMode(0, "patrimoine");
|
|
2084
|
-
let e = this.lignePrincipale.patrimoine;
|
|
2085
|
-
await this.data.loadAdresses(e?.idCommune ?? null), this.lignePrincipale.cibleMode !== "contrat" && await this.data.loadModulesOfProgramme(e?.codeProgramme ?? null);
|
|
2086
|
-
},
|
|
2087
|
-
methods: {
|
|
2088
|
-
pickerProps(e) {
|
|
1882
|
+
localisation() {
|
|
1883
|
+
let e = this.ligne?.patrimoine;
|
|
2089
1884
|
return {
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
reclamantType: this.reclamantType,
|
|
2094
|
-
contratReclamant: e.contratReclamant,
|
|
2095
|
-
contratCible: e.contratCible,
|
|
2096
|
-
modulePrecis: e.modulePrecis,
|
|
2097
|
-
afficheCaseContratReclamant: this.draft.reclamantEstContrat,
|
|
2098
|
-
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
|
|
2099
1888
|
};
|
|
2100
1889
|
},
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
},
|
|
2104
|
-
onSelectCommune(e, t = 0) {
|
|
2105
|
-
this.draft.setPatrimoineCommune(t, e ?? null), e?.idCommune != null && this.data.loadAdresses(e.idCommune);
|
|
2106
|
-
},
|
|
2107
|
-
onSelectAdresse(e, t = 0) {
|
|
2108
|
-
this.draft.setPatrimoineEntree(t, e ?? null), e?.codeProgramme != null && this.data.loadModulesOfProgramme(e.codeProgramme);
|
|
2109
|
-
},
|
|
2110
|
-
onSelectEtage(e, t = 0) {
|
|
2111
|
-
this.draft.setPatrimoineEtage(t, e ?? null);
|
|
2112
|
-
},
|
|
2113
|
-
onSelectModule(e, t = 0) {
|
|
2114
|
-
let n = this.draft.draft.lignes[t];
|
|
2115
|
-
e && n?.cibleMode === "contrat" ? this.draft.prefillFromModule(t, e) : this.draft.setPatrimoineModule(t, e ?? null);
|
|
2116
|
-
},
|
|
2117
|
-
onToggleReprendre(e, t = 0) {
|
|
2118
|
-
this.draft.setReprendreLocataireActuel(t, e);
|
|
2119
|
-
},
|
|
2120
|
-
onToggleContratReclamant(e, t = 0) {
|
|
2121
|
-
this.draft.toggleContratReclamant(t, e), e && this.draft.prefillFromModule(t, this.mainModule);
|
|
2122
|
-
},
|
|
2123
|
-
onSelectContrat(e, t = 0) {
|
|
2124
|
-
this.draft.setContratCible(t, e), e && this.data.loadModulesOfContrat({
|
|
2125
|
-
idContrat: e.idContrat,
|
|
2126
|
-
typeContrat: e.typeContrat
|
|
2127
|
-
});
|
|
2128
|
-
},
|
|
2129
|
-
locataireActuelOption(e) {
|
|
1890
|
+
locataireActuelOption() {
|
|
1891
|
+
let e = this.ligne;
|
|
2130
1892
|
if (e?.cibleMode !== "contrat") return null;
|
|
2131
|
-
let t = e
|
|
1893
|
+
let t = e.patrimoine;
|
|
2132
1894
|
if (!t || t.idModule == null) return null;
|
|
2133
1895
|
let n = e.contratReclamant && this.draft.reclamantEstContrat, r = n ? {
|
|
2134
1896
|
typeContrat: this.draft.draft.reclamant.type,
|
|
@@ -2146,101 +1908,722 @@ var Br = {
|
|
|
2146
1908
|
reprendre: i,
|
|
2147
1909
|
hint: a
|
|
2148
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);
|
|
2149
1929
|
},
|
|
2150
|
-
|
|
2151
|
-
|
|
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
|
+
});
|
|
2152
1938
|
}
|
|
2153
1939
|
}
|
|
2154
|
-
},
|
|
1940
|
+
}, Or = {
|
|
2155
1941
|
key: 0,
|
|
2156
|
-
class: "
|
|
2157
|
-
},
|
|
2158
|
-
key:
|
|
2159
|
-
class: "
|
|
2160
|
-
},
|
|
1942
|
+
class: "d-flex flex-wrap align-items-center gap-2"
|
|
1943
|
+
}, kr = { class: "fw-medium fs-7" }, Ar = {
|
|
1944
|
+
key: 0,
|
|
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 = {
|
|
2161
2506
|
key: 0,
|
|
2162
|
-
class: "
|
|
2163
|
-
},
|
|
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 = [
|
|
2164
2512
|
"id",
|
|
2165
2513
|
"checked",
|
|
2514
|
+
"disabled",
|
|
2166
2515
|
"onChange"
|
|
2167
|
-
],
|
|
2516
|
+
], Ii = ["for"], Li = {
|
|
2168
2517
|
key: 0,
|
|
2169
|
-
class: "
|
|
2518
|
+
class: "alert alert-warning d-flex align-items-start gap-2 py-2 px-3 mb-0 fs-7"
|
|
2170
2519
|
};
|
|
2171
|
-
function
|
|
2172
|
-
let o =
|
|
2173
|
-
return
|
|
2174
|
-
default:
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
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
|
-
|
|
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)]),
|
|
2238
2621
|
_: 1
|
|
2239
2622
|
}, 8, ["loading"]);
|
|
2240
2623
|
}
|
|
2241
|
-
var
|
|
2624
|
+
var zi = /*#__PURE__*/ G(Di, [["render", Ri]]), Bi = {
|
|
2242
2625
|
name: "LigneDocumentBlock",
|
|
2243
|
-
components: { AmsomUploadFile:
|
|
2626
|
+
components: { AmsomUploadFile: xe },
|
|
2244
2627
|
props: {
|
|
2245
2628
|
index: {
|
|
2246
2629
|
type: Number,
|
|
@@ -2257,9 +2640,9 @@ var $r = /*#__PURE__*/ K(Br, [["render", Qr]]), ei = {
|
|
|
2257
2640
|
},
|
|
2258
2641
|
emits: ["update"]
|
|
2259
2642
|
};
|
|
2260
|
-
function
|
|
2261
|
-
let o =
|
|
2262
|
-
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, {
|
|
2263
2646
|
"model-value": n.fichier,
|
|
2264
2647
|
renameable: "",
|
|
2265
2648
|
"output-format": "object",
|
|
@@ -2273,12 +2656,12 @@ function ti(e, t, n, r, i, a) {
|
|
|
2273
2656
|
"read-only"
|
|
2274
2657
|
])]);
|
|
2275
2658
|
}
|
|
2276
|
-
var
|
|
2659
|
+
var Hi = /*#__PURE__*/ G(Bi, [["render", Vi]]), Ui = 4e3, Wi = {
|
|
2277
2660
|
name: "LigneDetailBlock",
|
|
2278
2661
|
components: {
|
|
2279
|
-
AmsomAutocomplete:
|
|
2280
|
-
AmsomTextarea:
|
|
2281
|
-
LigneDocumentBlock:
|
|
2662
|
+
AmsomAutocomplete: B,
|
|
2663
|
+
AmsomTextarea: be,
|
|
2664
|
+
LigneDocumentBlock: Hi
|
|
2282
2665
|
},
|
|
2283
2666
|
props: { index: {
|
|
2284
2667
|
type: Number,
|
|
@@ -2286,12 +2669,12 @@ var ni = /*#__PURE__*/ K(ei, [["render", ti]]), ri = 4e3, ii = {
|
|
|
2286
2669
|
} },
|
|
2287
2670
|
setup() {
|
|
2288
2671
|
return {
|
|
2289
|
-
draft:
|
|
2672
|
+
draft: W(),
|
|
2290
2673
|
data: Z()
|
|
2291
2674
|
};
|
|
2292
2675
|
},
|
|
2293
2676
|
computed: {
|
|
2294
|
-
descriptionMaxLength: () =>
|
|
2677
|
+
descriptionMaxLength: () => Ui,
|
|
2295
2678
|
isPrincipale() {
|
|
2296
2679
|
return this.index === 0;
|
|
2297
2680
|
},
|
|
@@ -2312,64 +2695,54 @@ var ni = /*#__PURE__*/ K(ei, [["render", ti]]), ri = 4e3, ii = {
|
|
|
2312
2695
|
this.isPrincipale && this.$refs.description?.$el.querySelector("textarea")?.focus();
|
|
2313
2696
|
},
|
|
2314
2697
|
methods: {
|
|
2315
|
-
timestampToDateInput:
|
|
2316
|
-
dateInputToTimestamp:
|
|
2698
|
+
timestampToDateInput: en,
|
|
2699
|
+
dateInputToTimestamp: tn,
|
|
2317
2700
|
responsableLibelle(e) {
|
|
2318
2701
|
let t = e && typeof e != "object" ? this.collaborateurs.find((t) => String(t.id) === String(e)) : e;
|
|
2319
2702
|
return t ? `${t.prenom} ${t.nom}` : "";
|
|
2320
2703
|
},
|
|
2321
2704
|
filterCollaborateurs({ search: e, items: t }) {
|
|
2322
|
-
let n = (
|
|
2323
|
-
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;
|
|
2324
2707
|
}
|
|
2325
2708
|
}
|
|
2326
|
-
},
|
|
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 = {
|
|
2327
2710
|
key: 0,
|
|
2328
2711
|
class: "ms-1 text-danger"
|
|
2329
|
-
},
|
|
2712
|
+
}, Yi = {
|
|
2330
2713
|
key: 0,
|
|
2331
2714
|
class: "form-check form-switch mb-0"
|
|
2332
|
-
},
|
|
2715
|
+
}, Xi = [
|
|
2333
2716
|
"id",
|
|
2334
2717
|
"checked",
|
|
2335
2718
|
"disabled"
|
|
2336
|
-
],
|
|
2337
|
-
key: 1,
|
|
2338
|
-
class: "text-muted d-block",
|
|
2339
|
-
style: { "white-space": "pre-line" }
|
|
2340
|
-
}, 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 = {
|
|
2341
2720
|
key: 0,
|
|
2342
2721
|
class: "form-check form-switch mb-0"
|
|
2343
|
-
},
|
|
2722
|
+
}, ra = [
|
|
2344
2723
|
"id",
|
|
2345
2724
|
"checked",
|
|
2346
2725
|
"disabled"
|
|
2347
|
-
],
|
|
2348
|
-
key: 1,
|
|
2349
|
-
class: "text-muted d-block"
|
|
2350
|
-
}, xi = {
|
|
2726
|
+
], ia = ["for"], aa = ["value"], oa = ["value"], sa = ["value"], ca = { class: "min-w-0" }, la = { class: "fw-medium text-truncate" }, ua = {
|
|
2351
2727
|
key: 0,
|
|
2352
2728
|
class: "text-muted d-block"
|
|
2353
|
-
},
|
|
2354
|
-
key: 0,
|
|
2355
|
-
class: "text-muted d-block"
|
|
2356
|
-
}, Ti = {
|
|
2729
|
+
}, da = {
|
|
2357
2730
|
key: 2,
|
|
2358
2731
|
class: "text-muted"
|
|
2359
|
-
},
|
|
2360
|
-
function
|
|
2361
|
-
let o =
|
|
2362
|
-
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", {
|
|
2363
2736
|
id: `memedetail-${a.ligne.idMotif}`,
|
|
2364
2737
|
class: "form-check-input",
|
|
2365
2738
|
type: "checkbox",
|
|
2366
2739
|
checked: a.ligne.description == null,
|
|
2367
2740
|
disabled: r.draft.isReadonly("description"),
|
|
2368
2741
|
onChange: t[0] ||= (e) => r.draft.toggleDescriptionOverride(n.index)
|
|
2369
|
-
}, null, 40,
|
|
2742
|
+
}, null, 40, Xi), w("label", {
|
|
2370
2743
|
class: "form-check-label fs-7",
|
|
2371
2744
|
for: `memedetail-${a.ligne.idMotif}`
|
|
2372
|
-
}, " Même description ", 8,
|
|
2745
|
+
}, " Même description ", 8, Zi)]))]), !r.draft.isReadonly("description") && (a.isPrincipale || a.ligne.description != null) ? (A(), x(o, {
|
|
2373
2746
|
key: 0,
|
|
2374
2747
|
ref: "description",
|
|
2375
2748
|
"model-value": a.ligne.description,
|
|
@@ -2383,25 +2756,42 @@ function Di(e, t, n, r, i, a) {
|
|
|
2383
2756
|
"rows",
|
|
2384
2757
|
"maxlength",
|
|
2385
2758
|
"placeholder"
|
|
2386
|
-
])) : (
|
|
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", {
|
|
2387
2766
|
id: `memedate-${a.ligne.idMotif}`,
|
|
2388
2767
|
class: "form-check-input",
|
|
2389
2768
|
type: "checkbox",
|
|
2390
2769
|
checked: !a.ligne.dateFaitsOverride,
|
|
2391
2770
|
disabled: r.draft.isReadonly("dateFaits"),
|
|
2392
2771
|
onChange: t[2] ||= (e) => r.draft.toggleDateFaitsOverride(n.index)
|
|
2393
|
-
}, null, 40,
|
|
2772
|
+
}, null, 40, ra), w("label", {
|
|
2394
2773
|
class: "form-check-label fs-7",
|
|
2395
2774
|
for: `memedate-${a.ligne.idMotif}`
|
|
2396
|
-
}, " Même date ", 8,
|
|
2775
|
+
}, " Même date ", 8, ia)]))]), !r.draft.isReadonly("dateFaits") && (a.isPrincipale || a.ligne.dateFaitsOverride) ? (A(), C("input", {
|
|
2397
2776
|
key: 0,
|
|
2398
2777
|
value: a.timestampToDateInput(a.ligne.dateFaits),
|
|
2399
2778
|
type: "date",
|
|
2400
2779
|
class: "form-control form-control-sm",
|
|
2401
2780
|
onInput: t[3] ||= (e) => r.draft.setDateFaits(n.index, a.dateInputToTimestamp(e.target.value))
|
|
2402
|
-
}, null, 40,
|
|
2403
|
-
|
|
2404
|
-
|
|
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, {
|
|
2405
2795
|
key: 1,
|
|
2406
2796
|
"model-value": a.ligne.responsable,
|
|
2407
2797
|
items: a.collaborateurs,
|
|
@@ -2413,7 +2803,7 @@ function Di(e, t, n, r, i, a) {
|
|
|
2413
2803
|
"hide-choices": "",
|
|
2414
2804
|
"onUpdate:modelValue": t[4] ||= (e) => r.draft.setResponsable(n.index, e ?? null)
|
|
2415
2805
|
}, {
|
|
2416
|
-
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)])]),
|
|
2417
2807
|
_: 1
|
|
2418
2808
|
}, 8, [
|
|
2419
2809
|
"model-value",
|
|
@@ -2422,8 +2812,8 @@ function Di(e, t, n, r, i, a) {
|
|
|
2422
2812
|
"get-input-libelle",
|
|
2423
2813
|
"filtering-function"
|
|
2424
2814
|
])),
|
|
2425
|
-
a.isPrincipale && !a.ligne.responsable && !r.draft.isReadonly("responsable") ? (
|
|
2426
|
-
])]),
|
|
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, {
|
|
2427
2817
|
index: n.index,
|
|
2428
2818
|
fichier: a.ligne.fichier,
|
|
2429
2819
|
readonly: r.draft.isReadonly("fichier"),
|
|
@@ -2435,15 +2825,17 @@ function Di(e, t, n, r, i, a) {
|
|
|
2435
2825
|
])])])]);
|
|
2436
2826
|
}
|
|
2437
2827
|
// src/components/EtapeDetailsBlock.vue
|
|
2438
|
-
var
|
|
2828
|
+
var ma = {
|
|
2439
2829
|
name: "EtapeDetailsBlock",
|
|
2440
2830
|
components: {
|
|
2441
|
-
AmsomOverlay:
|
|
2442
|
-
LigneDetailBlock: /* @__PURE__ */
|
|
2831
|
+
AmsomOverlay: v,
|
|
2832
|
+
LigneDetailBlock: /* @__PURE__ */ G(Wi, [["render", pa]]),
|
|
2833
|
+
RecapBlock: Qr,
|
|
2834
|
+
SectionComponent: rt
|
|
2443
2835
|
},
|
|
2444
2836
|
setup() {
|
|
2445
2837
|
return {
|
|
2446
|
-
draft:
|
|
2838
|
+
draft: W(),
|
|
2447
2839
|
data: Z()
|
|
2448
2840
|
};
|
|
2449
2841
|
},
|
|
@@ -2456,10 +2848,6 @@ var Oi = {
|
|
|
2456
2848
|
},
|
|
2457
2849
|
collaborateurs() {
|
|
2458
2850
|
return (this.data.cache.collaborateurs ?? []).filter((e) => e.actif !== !1);
|
|
2459
|
-
},
|
|
2460
|
-
motifLibelle() {
|
|
2461
|
-
let e = this.lignePrincipale.idMotif;
|
|
2462
|
-
return e == null ? null : this.data.motifLibelle(e);
|
|
2463
2851
|
}
|
|
2464
2852
|
},
|
|
2465
2853
|
async created() {
|
|
@@ -2495,66 +2883,61 @@ var Oi = {
|
|
|
2495
2883
|
}
|
|
2496
2884
|
}
|
|
2497
2885
|
}
|
|
2498
|
-
},
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
S("hr", { class: "flex-grow-1 my-0" })
|
|
2526
|
-
], -1), (O(!0), x(_, null, j(a.lignesAssociees, (e, n) => (O(), x("div", {
|
|
2527
|
-
key: e.idMotif,
|
|
2528
|
-
class: "border rounded p-2 d-flex flex-column gap-2"
|
|
2529
|
-
}, [S("div", Ni, [S("span", Pi, [
|
|
2530
|
-
w(o, {
|
|
2531
|
-
icon: "tag",
|
|
2532
|
-
class: "text-primary me-2"
|
|
2533
|
-
}),
|
|
2534
|
-
t[2] ||= S("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Motif", -1),
|
|
2535
|
-
C(" " + P(e.libelle), 1)
|
|
2536
|
-
]), S("span", Fi, [
|
|
2537
|
-
w(o, {
|
|
2538
|
-
icon: "location-dot",
|
|
2539
|
-
class: "text-primary me-2"
|
|
2540
|
-
}),
|
|
2541
|
-
t[3] ||= S("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Cible", -1),
|
|
2542
|
-
C(" " + P(r.draft.cibleResume(e)), 1)
|
|
2543
|
-
])]), w(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)
|
|
2544
2913
|
])]),
|
|
2545
2914
|
_: 1
|
|
2546
2915
|
}, 8, ["loading"]);
|
|
2547
2916
|
}
|
|
2548
|
-
|
|
2549
|
-
|
|
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 = {
|
|
2550
2934
|
name: "StepperBlock",
|
|
2551
2935
|
components: {
|
|
2552
|
-
AmsomHorizontalStepper:
|
|
2553
|
-
AmsomOverlay:
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
EtapeDetailsBlock: /* @__PURE__ */ K(Oi, [["render", Ii]])
|
|
2936
|
+
AmsomHorizontalStepper: _e,
|
|
2937
|
+
AmsomOverlay: v,
|
|
2938
|
+
EtapeReclamantCibleBlock: Vr,
|
|
2939
|
+
EtapeMotifBlock: zi,
|
|
2940
|
+
EtapeDetailsBlock: va
|
|
2558
2941
|
},
|
|
2559
2942
|
props: {
|
|
2560
2943
|
step: {
|
|
@@ -2573,36 +2956,13 @@ var Li = {
|
|
|
2573
2956
|
],
|
|
2574
2957
|
setup() {
|
|
2575
2958
|
return {
|
|
2576
|
-
draft:
|
|
2959
|
+
draft: W(),
|
|
2577
2960
|
data: Z(),
|
|
2578
2961
|
options: Q()
|
|
2579
2962
|
};
|
|
2580
2963
|
},
|
|
2581
2964
|
computed: {
|
|
2582
|
-
steps()
|
|
2583
|
-
return [
|
|
2584
|
-
...this.options.reclamantMode === "step" ? [{
|
|
2585
|
-
key: "reclamant",
|
|
2586
|
-
label: "Réclamant",
|
|
2587
|
-
icon: "user"
|
|
2588
|
-
}] : [],
|
|
2589
|
-
{
|
|
2590
|
-
key: "categorie",
|
|
2591
|
-
label: "Catégorisation",
|
|
2592
|
-
icon: "tag"
|
|
2593
|
-
},
|
|
2594
|
-
{
|
|
2595
|
-
key: "cible",
|
|
2596
|
-
label: "Cible",
|
|
2597
|
-
icon: "location-dot"
|
|
2598
|
-
},
|
|
2599
|
-
{
|
|
2600
|
-
key: "details",
|
|
2601
|
-
label: "Détails",
|
|
2602
|
-
icon: "info"
|
|
2603
|
-
}
|
|
2604
|
-
];
|
|
2605
|
-
},
|
|
2965
|
+
steps: () => ya,
|
|
2606
2966
|
currentKey() {
|
|
2607
2967
|
return this.steps[this.step - 1]?.key ?? null;
|
|
2608
2968
|
},
|
|
@@ -2616,11 +2976,14 @@ var Li = {
|
|
|
2616
2976
|
provenanceValid() {
|
|
2617
2977
|
return this.options.provenances.some((e) => e.id === this.draft.draft.provenance);
|
|
2618
2978
|
},
|
|
2979
|
+
motifPropose() {
|
|
2980
|
+
return this.options.motifNonProposeMode !== "block" || this.options.motifPrincipalPropose;
|
|
2981
|
+
},
|
|
2619
2982
|
canGoNext() {
|
|
2620
2983
|
return this.gatePassed(this.currentKey);
|
|
2621
2984
|
},
|
|
2622
2985
|
canCreer() {
|
|
2623
|
-
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;
|
|
2624
2987
|
},
|
|
2625
2988
|
stepperSteps() {
|
|
2626
2989
|
return this.steps.map((e, t) => {
|
|
@@ -2649,7 +3012,7 @@ var Li = {
|
|
|
2649
3012
|
} },
|
|
2650
3013
|
methods: {
|
|
2651
3014
|
gatePassed(e) {
|
|
2652
|
-
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;
|
|
2653
3016
|
},
|
|
2654
3017
|
onStepClick(e) {
|
|
2655
3018
|
e < this.step && this.$emit("update:step", e);
|
|
@@ -2658,7 +3021,7 @@ var Li = {
|
|
|
2658
3021
|
this.step > 1 && this.$emit("update:step", this.step - 1);
|
|
2659
3022
|
},
|
|
2660
3023
|
goNext() {
|
|
2661
|
-
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));
|
|
2662
3025
|
},
|
|
2663
3026
|
preloadResponsables() {
|
|
2664
3027
|
this.draft.draft.lignes.forEach((e) => this.data.loadResponsables({
|
|
@@ -2669,73 +3032,67 @@ var Li = {
|
|
|
2669
3032
|
}));
|
|
2670
3033
|
}
|
|
2671
3034
|
}
|
|
2672
|
-
},
|
|
3035
|
+
}, xa = { class: "d-flex flex-column gap-3" }, Sa = {
|
|
2673
3036
|
key: 0,
|
|
2674
3037
|
class: "w-100 fs-6 fw-medium my-3 alert alert-info",
|
|
2675
3038
|
style: { "white-space": "pre-line" }
|
|
2676
|
-
},
|
|
2677
|
-
function
|
|
2678
|
-
let o =
|
|
2679
|
-
return
|
|
2680
|
-
default:
|
|
2681
|
-
|
|
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, {
|
|
2682
3045
|
steps: a.stepperSteps,
|
|
2683
3046
|
size: "md",
|
|
2684
3047
|
onStepClick: a.onStepClick
|
|
2685
3048
|
}, null, 8, ["steps", "onStepClick"]),
|
|
2686
|
-
a.aideMotif ? (
|
|
3049
|
+
a.aideMotif ? (A(), C("div", Sa, [E(s, {
|
|
2687
3050
|
icon: "circle-info",
|
|
2688
3051
|
class: "text-info-emphasis me-2"
|
|
2689
|
-
}),
|
|
2690
|
-
|
|
2691
|
-
key: 0,
|
|
2692
|
-
premiere: n.step === 1
|
|
2693
|
-
}, de({ _: 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 ? {
|
|
2694
3054
|
name: "reclamant",
|
|
2695
|
-
fn:
|
|
3055
|
+
fn: z((t) => [P(e.$slots, "reclamant", k(D(t)))]),
|
|
2696
3056
|
key: "0"
|
|
2697
|
-
} : void 0]),
|
|
2698
|
-
|
|
2699
|
-
premiere: n.step === 1
|
|
2700
|
-
}, null, 8, ["premiere"])) : a.currentKey === "cible" ? (O(), y(u, { key: 2 })) : a.currentKey === "details" ? (O(), y(d, { key: 3 })) : b("", !0)]),
|
|
2701
|
-
S("div", Vi, [n.step > 1 ? (O(), 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", {
|
|
2702
3059
|
key: 0,
|
|
2703
3060
|
class: "btn btn-sm btn-outline-secondary",
|
|
2704
3061
|
onClick: t[0] ||= (...e) => a.goPrevious && a.goPrevious(...e)
|
|
2705
|
-
}, [
|
|
3062
|
+
}, [E(s, {
|
|
2706
3063
|
icon: "chevron-left",
|
|
2707
3064
|
class: "me-1"
|
|
2708
|
-
}), t[3] ||=
|
|
3065
|
+
}), t[3] ||= T(" Précédent ", -1)])) : (A(), C("span", Ta)), n.step < a.steps.length ? (A(), C("button", {
|
|
2709
3066
|
key: 2,
|
|
2710
3067
|
class: "btn btn-sm btn-primary",
|
|
2711
3068
|
disabled: !a.canGoNext,
|
|
2712
3069
|
onClick: t[1] ||= (...e) => a.goNext && a.goNext(...e)
|
|
2713
|
-
}, [t[4] ||=
|
|
3070
|
+
}, [t[4] ||= T(" Suivant ", -1), E(s, {
|
|
2714
3071
|
icon: "chevron-right",
|
|
2715
3072
|
class: "ms-1"
|
|
2716
|
-
})], 8,
|
|
3073
|
+
})], 8, Ea)) : (A(), C("button", {
|
|
2717
3074
|
key: 3,
|
|
2718
3075
|
class: "btn btn-sm btn-success",
|
|
2719
3076
|
disabled: !a.canCreer || n.creating,
|
|
2720
3077
|
onClick: t[2] ||= (t) => e.$emit("submit")
|
|
2721
|
-
}, [
|
|
3078
|
+
}, [E(s, {
|
|
2722
3079
|
icon: "check",
|
|
2723
3080
|
class: "me-1"
|
|
2724
|
-
}), t[5] ||=
|
|
3081
|
+
}), t[5] ||= T(" Créer la sollicitation ", -1)], 8, Da))])
|
|
2725
3082
|
])]),
|
|
2726
3083
|
_: 3
|
|
2727
3084
|
}, 8, ["loading"]);
|
|
2728
3085
|
}
|
|
2729
|
-
var
|
|
3086
|
+
var ka = /*#__PURE__*/ G(ba, [["render", Oa]]), Aa = (e, { signal: t, baseUrl: n } = {}) => yt("/v2/cresol/creer_sollicitation", e, {
|
|
2730
3087
|
signal: t,
|
|
2731
3088
|
baseUrl: n
|
|
2732
|
-
}),
|
|
3089
|
+
}), ja = ({ idSollicitation: e, pj: t }, { signal: n, baseUrl: r } = {}) => yt("/v2/cresol/upload_sollicitation_ged", {
|
|
2733
3090
|
idSollicitation: e,
|
|
2734
3091
|
pj: t
|
|
2735
3092
|
}, {
|
|
2736
3093
|
signal: n,
|
|
2737
3094
|
baseUrl: r
|
|
2738
|
-
}),
|
|
3095
|
+
}), Ma = {
|
|
2739
3096
|
modelValue: {
|
|
2740
3097
|
type: Object,
|
|
2741
3098
|
default: null
|
|
@@ -2751,7 +3108,21 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2751
3108
|
"select",
|
|
2752
3109
|
"switch",
|
|
2753
3110
|
"autocomplete",
|
|
2754
|
-
"
|
|
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"
|
|
2755
3126
|
].includes(e)
|
|
2756
3127
|
},
|
|
2757
3128
|
typesReclamant: {
|
|
@@ -2766,7 +3137,7 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2766
3137
|
},
|
|
2767
3138
|
provenances: {
|
|
2768
3139
|
type: Array,
|
|
2769
|
-
default: () => [...
|
|
3140
|
+
default: () => [...we]
|
|
2770
3141
|
},
|
|
2771
3142
|
provenancesExclues: {
|
|
2772
3143
|
type: Array,
|
|
@@ -2801,7 +3172,7 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2801
3172
|
type: String,
|
|
2802
3173
|
default: null
|
|
2803
3174
|
}
|
|
2804
|
-
},
|
|
3175
|
+
}, Na = Object.keys(Ma), Pa = [
|
|
2805
3176
|
"update:modelValue",
|
|
2806
3177
|
"reclamantChange",
|
|
2807
3178
|
"motifChange",
|
|
@@ -2810,35 +3181,50 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2810
3181
|
"created",
|
|
2811
3182
|
"createError",
|
|
2812
3183
|
"error"
|
|
2813
|
-
],
|
|
3184
|
+
], Fa = {
|
|
2814
3185
|
name: "CreerSollicitationForm",
|
|
2815
3186
|
components: {
|
|
2816
3187
|
AsideBlock: Xe,
|
|
2817
|
-
StepperBlock:
|
|
3188
|
+
StepperBlock: ka
|
|
2818
3189
|
},
|
|
2819
|
-
props: { ...
|
|
2820
|
-
emits: [...
|
|
3190
|
+
props: { ...Ma },
|
|
3191
|
+
emits: [...Pa],
|
|
2821
3192
|
setup(e, { emit: t }) {
|
|
2822
|
-
let n = (e) => t("error", e), r = { baseUrl:
|
|
3193
|
+
let n = (e) => t("error", e), r = { baseUrl: L(e, "baseUrl") }, i = Wt(Ut({
|
|
2823
3194
|
onError: n,
|
|
2824
3195
|
...r
|
|
2825
|
-
})), a =
|
|
2826
|
-
reclamants:
|
|
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),
|
|
2827
3198
|
modules: s,
|
|
2828
|
-
idModulePrefere:
|
|
2829
|
-
readonly:
|
|
2830
|
-
}))
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
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(() => {
|
|
2836
3222
|
let t = i.cache.provenances ?? [];
|
|
2837
3223
|
return (e.provenances ?? t.map((e) => e.id)).filter((t) => !e.provenancesExclues.includes(t)).flatMap((e) => {
|
|
2838
3224
|
let n = t.find((t) => t.id === e);
|
|
2839
3225
|
return n ? [{
|
|
2840
3226
|
...n,
|
|
2841
|
-
icon:
|
|
3227
|
+
icon: Ce(e)
|
|
2842
3228
|
}] : [];
|
|
2843
3229
|
});
|
|
2844
3230
|
}),
|
|
@@ -2847,9 +3233,12 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2847
3233
|
...r
|
|
2848
3234
|
})), {
|
|
2849
3235
|
data: i,
|
|
2850
|
-
draft:
|
|
3236
|
+
draft: l,
|
|
2851
3237
|
modulesCharges: a,
|
|
2852
3238
|
repriseReclamant: o,
|
|
3239
|
+
rechercheReclamant: c,
|
|
3240
|
+
motifPrincipalPropose: d,
|
|
3241
|
+
motifRetire: f,
|
|
2853
3242
|
onError: n
|
|
2854
3243
|
};
|
|
2855
3244
|
},
|
|
@@ -2881,17 +3270,27 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2881
3270
|
}
|
|
2882
3271
|
} },
|
|
2883
3272
|
async created() {
|
|
2884
|
-
this.data.loadNomenclature(), this.data.loadProvenances(), this.draft.reset(this.modelValue), this.
|
|
3273
|
+
this.data.loadNomenclature(), this.data.loadProvenances(), this.draft.reset(this.modelValue), this.rechercheReclamant && await this.reprendreReclamantFourni(), this.draft.syncReclamant();
|
|
2885
3274
|
let e = this.draft.reclamantSelectionne;
|
|
2886
3275
|
this.$watch("draft.reclamantSelectionne", async (t) => {
|
|
2887
3276
|
this.$emit("reclamantChange", t), await this.chargerModulesReclamant(t, e) && this.draft.syncReclamant();
|
|
2888
|
-
}), 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();
|
|
2889
3280
|
},
|
|
2890
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
|
+
},
|
|
2891
3290
|
async reprendreReclamantFourni() {
|
|
2892
3291
|
let { type: e, id: t } = this.draft.draft.reclamant;
|
|
2893
3292
|
if (!e || t == null) return;
|
|
2894
|
-
let n = (n) => n.type === e && String(n.id) === String(t), [r] =
|
|
3293
|
+
let n = (n) => n.type === e && String(n.id) === String(t), [r] = Oe([e]), i = null;
|
|
2895
3294
|
if (r) {
|
|
2896
3295
|
this.repriseReclamant = !0;
|
|
2897
3296
|
try {
|
|
@@ -2923,10 +3322,10 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2923
3322
|
if (!await this.autoriserCreation(e)) return;
|
|
2924
3323
|
let t;
|
|
2925
3324
|
try {
|
|
2926
|
-
t = await
|
|
3325
|
+
t = await Aa(e, this.requestOptions) ?? [];
|
|
2927
3326
|
} catch (t) {
|
|
2928
|
-
if (
|
|
2929
|
-
let n =
|
|
3327
|
+
if (It(t)) return;
|
|
3328
|
+
let n = Ft(t);
|
|
2930
3329
|
this.$emit("createError", {
|
|
2931
3330
|
error: t,
|
|
2932
3331
|
message: n,
|
|
@@ -2976,7 +3375,7 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2976
3375
|
message: t
|
|
2977
3376
|
};
|
|
2978
3377
|
};
|
|
2979
|
-
return a?.id ?
|
|
3378
|
+
return a?.id ? ja({
|
|
2980
3379
|
idSollicitation: a.id,
|
|
2981
3380
|
pj: {
|
|
2982
3381
|
name: n.name,
|
|
@@ -2987,34 +3386,34 @@ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n
|
|
|
2987
3386
|
...o,
|
|
2988
3387
|
ok: !0,
|
|
2989
3388
|
message: null
|
|
2990
|
-
})).catch((e) => s(
|
|
3389
|
+
})).catch((e) => s(Ft(e))) : Promise.resolve(s("sollicitation introuvable dans la réponse"));
|
|
2991
3390
|
});
|
|
2992
3391
|
return Promise.all(n);
|
|
2993
3392
|
}
|
|
2994
3393
|
}
|
|
2995
|
-
},
|
|
3394
|
+
}, Ia = { class: "row g-3" }, La = {
|
|
2996
3395
|
key: 0,
|
|
2997
3396
|
class: "col-12 col-lg-4"
|
|
2998
3397
|
};
|
|
2999
|
-
function
|
|
3000
|
-
let o =
|
|
3001
|
-
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"] ? {
|
|
3002
3401
|
name: "similaires",
|
|
3003
|
-
fn:
|
|
3402
|
+
fn: z((t) => [P(e.$slots, "aside-similaires", k(D(t)))]),
|
|
3004
3403
|
key: "0"
|
|
3005
3404
|
} : void 0, e.$slots["aside-evenements"] ? {
|
|
3006
3405
|
name: "evenements",
|
|
3007
|
-
fn:
|
|
3406
|
+
fn: z(() => [P(e.$slots, "aside-evenements")]),
|
|
3008
3407
|
key: "1"
|
|
3009
|
-
} : 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, {
|
|
3010
3409
|
step: i.currentStep,
|
|
3011
3410
|
"onUpdate:step": t[0] ||= (e) => i.currentStep = e,
|
|
3012
3411
|
creating: i.creating,
|
|
3013
3412
|
onStepChange: t[1] ||= (t) => e.$emit("stepChange", t),
|
|
3014
3413
|
onSubmit: a.creer
|
|
3015
|
-
},
|
|
3414
|
+
}, le({ _: 2 }, [e.$slots.reclamant ? {
|
|
3016
3415
|
name: "reclamant",
|
|
3017
|
-
fn:
|
|
3416
|
+
fn: z((t) => [P(e.$slots, "reclamant", k(D(t)))]),
|
|
3018
3417
|
key: "0"
|
|
3019
3418
|
} : void 0]), 1032, [
|
|
3020
3419
|
"step",
|
|
@@ -3022,14 +3421,14 @@ function ta(e, t, n, r, i, a) {
|
|
|
3022
3421
|
"onSubmit"
|
|
3023
3422
|
])], 2)]);
|
|
3024
3423
|
}
|
|
3025
|
-
var
|
|
3424
|
+
var za = /*#__PURE__*/ G(Fa, [["render", Ra]]), Ba = {
|
|
3026
3425
|
name: "CreerSollicitationModal",
|
|
3027
3426
|
components: {
|
|
3028
|
-
AmsomModal:
|
|
3029
|
-
CreerSollicitationForm:
|
|
3427
|
+
AmsomModal: ce,
|
|
3428
|
+
CreerSollicitationForm: za
|
|
3030
3429
|
},
|
|
3031
3430
|
props: {
|
|
3032
|
-
...
|
|
3431
|
+
...Ma,
|
|
3033
3432
|
titre: {
|
|
3034
3433
|
type: String,
|
|
3035
3434
|
default: "Nouvelle sollicitation"
|
|
@@ -3039,35 +3438,35 @@ var na = /*#__PURE__*/ K(Qi, [["render", ta]]), ra = {
|
|
|
3039
3438
|
default: !0
|
|
3040
3439
|
}
|
|
3041
3440
|
},
|
|
3042
|
-
emits: [...
|
|
3441
|
+
emits: [...Pa, "close"],
|
|
3043
3442
|
computed: {
|
|
3044
3443
|
formProps() {
|
|
3045
|
-
return Object.fromEntries(
|
|
3444
|
+
return Object.fromEntries(Na.map((e) => [e, this[e]]));
|
|
3046
3445
|
},
|
|
3047
3446
|
formListeners() {
|
|
3048
|
-
return Object.fromEntries(
|
|
3447
|
+
return Object.fromEntries(Pa.filter((e) => e !== "created").map((e) => [e, (...t) => this.$emit(e, ...t)]));
|
|
3049
3448
|
}
|
|
3050
3449
|
},
|
|
3051
3450
|
methods: { onCreated(...e) {
|
|
3052
3451
|
this.$emit("created", ...e), this.closeOnCreated && this.$emit("close");
|
|
3053
3452
|
} }
|
|
3054
|
-
},
|
|
3055
|
-
function
|
|
3056
|
-
let o =
|
|
3057
|
-
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, {
|
|
3058
3457
|
"close-option": "",
|
|
3059
3458
|
size: "xl",
|
|
3060
3459
|
onClose: t[0] ||= (t) => e.$emit("close")
|
|
3061
3460
|
}, {
|
|
3062
|
-
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) => ({
|
|
3063
3462
|
name: n,
|
|
3064
|
-
fn:
|
|
3463
|
+
fn: z((t) => [P(e.$slots, n, k(D(t ?? {})))])
|
|
3065
3464
|
}))]), 1040, ["onCreated"])]),
|
|
3066
3465
|
_: 3
|
|
3067
3466
|
});
|
|
3068
3467
|
}
|
|
3069
|
-
var
|
|
3070
|
-
CreerSollicitationModal:
|
|
3071
|
-
CreerSollicitationForm:
|
|
3468
|
+
var Ua = /*#__PURE__*/ G(Ba, [["render", Ha]]), Wa = {
|
|
3469
|
+
CreerSollicitationModal: Ua,
|
|
3470
|
+
CreerSollicitationForm: za
|
|
3072
3471
|
};
|
|
3073
|
-
export {
|
|
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 };
|