@amsom-habitat/cresol 0.1.2 → 0.2.1
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 +59 -14
- package/dist/cresol.js +841 -550
- package/dist/cresol.umd.cjs +1 -1
- package/package.json +10 -10
package/dist/cresol.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { AmsomModal as e, AmsomOverlay as t } from "@amsom-habitat/ui";
|
|
2
|
-
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createSlots as c, createTextVNode as l, createVNode as u, guardReactiveProps as d, inject as f, mergeProps as p, normalizeClass as m, normalizeProps as h, openBlock as g, provide as _, reactive as v, ref as y, renderList as b, renderSlot as x, resolveComponent as S, toDisplayString as C, toHandlers as ee, toRef as w, unref as T, vShow as
|
|
3
|
-
import { AmsomNavTabsHorizontal as
|
|
4
|
-
import
|
|
5
|
-
import { AmsomAutocomplete as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { library as
|
|
9
|
-
import { AmsomTextarea as
|
|
10
|
-
import { AmsomUploadFile as
|
|
2
|
+
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createSlots as c, createTextVNode as l, createVNode as u, guardReactiveProps as d, inject as f, mergeProps as p, normalizeClass as m, normalizeProps as h, openBlock as g, provide as _, reactive as v, ref as y, renderList as b, renderSlot as x, resolveComponent as S, toDisplayString as C, toHandlers as ee, toRef as w, unref as T, vShow as te, withCtx as E, withDirectives as D } from "vue";
|
|
3
|
+
import { AmsomNavTabsHorizontal as ne } from "@amsom-habitat/nav-tabs";
|
|
4
|
+
import re from "@amsom-habitat/horizontal-stepper";
|
|
5
|
+
import { AmsomAutocomplete as O } from "@amsom-habitat/amsom-autocomplete";
|
|
6
|
+
import ie from "@amsom-habitat/axios-overlay";
|
|
7
|
+
import k from "@amsom-habitat/user-manager";
|
|
8
|
+
import { library as ae } from "@fortawesome/fontawesome-svg-core";
|
|
9
|
+
import { AmsomTextarea as oe } from "@amsom-habitat/amsom-textarea";
|
|
10
|
+
import { AmsomUploadFile as se } from "@amsom-habitat/file-manager";
|
|
11
11
|
//#region src/utils/provenanceContact.js
|
|
12
|
-
var
|
|
12
|
+
var ce = [
|
|
13
13
|
{
|
|
14
14
|
id: "T",
|
|
15
15
|
libelle: "Téléphone",
|
|
@@ -40,7 +40,7 @@ var se = [
|
|
|
40
40
|
libelle: "Courrier",
|
|
41
41
|
icon: "envelope-open"
|
|
42
42
|
}
|
|
43
|
-
],
|
|
43
|
+
], le = "T", ue = Symbol("cresol:draft"), A = () => ({
|
|
44
44
|
idCommune: null,
|
|
45
45
|
commune: null,
|
|
46
46
|
idEntree: null,
|
|
@@ -55,7 +55,7 @@ var se = [
|
|
|
55
55
|
typeContratActuel: null,
|
|
56
56
|
idContratActuel: null,
|
|
57
57
|
occupantActuel: null
|
|
58
|
-
}),
|
|
58
|
+
}), j = () => ({
|
|
59
59
|
idMotif: null,
|
|
60
60
|
idCategorie: null,
|
|
61
61
|
idType: null,
|
|
@@ -72,7 +72,7 @@ var se = [
|
|
|
72
72
|
dateFaits: null,
|
|
73
73
|
dateFaitsOverride: !1,
|
|
74
74
|
fichier: null
|
|
75
|
-
}),
|
|
75
|
+
}), M = [
|
|
76
76
|
"reclamant",
|
|
77
77
|
"provenance",
|
|
78
78
|
"motif",
|
|
@@ -81,23 +81,23 @@ var se = [
|
|
|
81
81
|
"dateFaits",
|
|
82
82
|
"responsable",
|
|
83
83
|
"fichier"
|
|
84
|
-
],
|
|
84
|
+
], de = [
|
|
85
85
|
"D",
|
|
86
86
|
"U",
|
|
87
87
|
"T"
|
|
88
|
-
],
|
|
88
|
+
], N = (e = "T") => ({
|
|
89
89
|
reclamant: {
|
|
90
90
|
type: null,
|
|
91
91
|
id: null
|
|
92
92
|
},
|
|
93
93
|
provenance: e,
|
|
94
94
|
lignes: [{
|
|
95
|
-
...
|
|
95
|
+
...j(),
|
|
96
96
|
cibleMode: "contrat",
|
|
97
|
-
patrimoine:
|
|
97
|
+
patrimoine: A(),
|
|
98
98
|
description: ""
|
|
99
99
|
}]
|
|
100
|
-
}),
|
|
100
|
+
}), fe = (e) => e?.id ?? e ?? null, pe = (e) => {
|
|
101
101
|
if (!e) return "Cible non définie";
|
|
102
102
|
let t = [
|
|
103
103
|
e.commune,
|
|
@@ -105,17 +105,17 @@ var se = [
|
|
|
105
105
|
e.libelleModule
|
|
106
106
|
].filter(Boolean);
|
|
107
107
|
return e.etage != null && !e.libelleModule && t.push(`Étage ${e.etage}`), t.length ? t.join(" — ") : "Cible non définie";
|
|
108
|
-
},
|
|
108
|
+
}, me = (e) => !!e && (e.idModule != null || e.idEntree != null), he = (e, t) => e.cibleMode === "demande" || !e.cibleOverride && e.patrimoine == null ? !0 : e.cibleMode === "contrat" ? !!(e.contratReclamant && t || e.contratCible) && e.patrimoine?.idModule != null : me(e.patrimoine), ge = (e, t) => e.description == null ? !t : e.description.trim().length > 0, _e = (e = {}) => {
|
|
109
109
|
let t = {
|
|
110
|
-
...
|
|
110
|
+
...j(),
|
|
111
111
|
...e
|
|
112
112
|
};
|
|
113
113
|
return e.patrimoine && (t.patrimoine = {
|
|
114
|
-
...
|
|
114
|
+
...A(),
|
|
115
115
|
...e.patrimoine
|
|
116
116
|
}), t;
|
|
117
|
-
},
|
|
118
|
-
let t =
|
|
117
|
+
}, ve = (e) => {
|
|
118
|
+
let t = N();
|
|
119
119
|
if (!e) return t;
|
|
120
120
|
let n = Array.isArray(e.lignes) && e.lignes.length ? e.lignes : null;
|
|
121
121
|
return {
|
|
@@ -128,81 +128,88 @@ var se = [
|
|
|
128
128
|
provenance: e.provenance ?? t.provenance,
|
|
129
129
|
lignes: n ? n.map((e, n) => n === 0 ? {
|
|
130
130
|
...t.lignes[0],
|
|
131
|
-
...
|
|
132
|
-
} :
|
|
131
|
+
..._e(e)
|
|
132
|
+
} : _e(e)) : t.lignes
|
|
133
133
|
};
|
|
134
134
|
};
|
|
135
|
-
function
|
|
136
|
-
let a = v(
|
|
135
|
+
function ye({ reclamants: e, modules: t, idModulePrefere: n = y(null), readonly: i = y(!1) } = {}) {
|
|
136
|
+
let a = v(N()), o = r(() => {
|
|
137
137
|
let e = T(i);
|
|
138
|
-
return e === !0 ?
|
|
139
|
-
}), s = (e) => o.value.includes(e), c = r(() => a.lignes[0]), l = r(() => a.lignes.slice(1)), u = r(() => T(e) ?? []), d =
|
|
138
|
+
return e === !0 ? M : Array.isArray(e) ? e : [];
|
|
139
|
+
}), s = (e) => o.value.includes(e), c = r(() => a.lignes[0]), l = r(() => a.lignes.slice(1)), u = r(() => T(e) ?? []), d = y(null), f = (e, t) => e.type === t.type && String(e.id) === String(t.id), p = r(() => {
|
|
140
|
+
let e = d.value;
|
|
141
|
+
return !e || u.value.some((t) => f(t, e)) ? u.value : [...u.value, e];
|
|
142
|
+
}), m = r(() => p.value.find((e) => f(e, a.reclamant)) ?? p.value[0] ?? null), h = r(() => {
|
|
140
143
|
let e = T(t) ?? [], r = T(n);
|
|
141
144
|
return (r == null ? null : e.find((e) => String(e.idModule) === String(r))) ?? e.find((e) => e.estModulePrincipal) ?? e[0] ?? null;
|
|
142
|
-
}),
|
|
145
|
+
}), g = r(() => !!m.value && !de.includes(m.value.type)), _ = {
|
|
143
146
|
draft: a,
|
|
144
147
|
lignePrincipale: c,
|
|
145
148
|
lignesAssociees: l,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
reclamantsFournis: u,
|
|
150
|
+
reclamantsDisponibles: p,
|
|
151
|
+
reclamantSelectionne: m,
|
|
152
|
+
moduleReclamantPrincipal: h,
|
|
153
|
+
reclamantEstContrat: g,
|
|
154
|
+
ciblesValid: r(() => a.lignes.every((e) => he(e, g.value))),
|
|
155
|
+
detailsValid: r(() => a.lignes.every((e, t) => ge(e, t === 0))),
|
|
152
156
|
isReadonly: s,
|
|
153
157
|
reset(e = null) {
|
|
154
|
-
let t =
|
|
158
|
+
let t = ve(e);
|
|
155
159
|
Object.assign(a, t), a.lignes = t.lignes;
|
|
156
160
|
},
|
|
157
161
|
setProvenance(e) {
|
|
158
162
|
a.provenance = e;
|
|
159
163
|
},
|
|
160
164
|
syncReclamant() {
|
|
161
|
-
let e =
|
|
162
|
-
|
|
165
|
+
let e = m.value;
|
|
166
|
+
_.setReclamant({
|
|
163
167
|
type: e?.type ?? null,
|
|
164
168
|
id: e?.id ?? null
|
|
165
169
|
});
|
|
166
170
|
},
|
|
171
|
+
selectReclamant(e) {
|
|
172
|
+
e && (u.value.some((t) => f(t, e)) || (d.value = e), _.setReclamant(e));
|
|
173
|
+
},
|
|
167
174
|
setReclamant({ type: e, id: t }) {
|
|
168
175
|
if (a.reclamant = {
|
|
169
176
|
type: e ?? null,
|
|
170
177
|
id: t ?? null
|
|
171
178
|
}, s("cible")) return;
|
|
172
179
|
let n = a.lignes[0];
|
|
173
|
-
e === "D" ? (n.cibleMode = "demande", n.patrimoine = null) : (n.cibleMode =
|
|
180
|
+
e === "D" ? (n.cibleMode = "demande", n.patrimoine = null) : (n.cibleMode = g.value ? "contrat" : "patrimoine", n.contratReclamant = g.value, n.contratCible = null, n.reprendreLocataireActuel = !1, n.patrimoine = A(), _.prefillCiblePrincipale());
|
|
174
181
|
},
|
|
175
182
|
prefillCiblePrincipale() {
|
|
176
183
|
if (s("cible")) return;
|
|
177
|
-
let e =
|
|
178
|
-
e &&
|
|
184
|
+
let e = h.value;
|
|
185
|
+
e && _.prefillFromModule(0, e);
|
|
179
186
|
},
|
|
180
187
|
_resetAfterNomenclature() {
|
|
181
188
|
a.lignes[0].responsable = null, a.lignes.splice(1);
|
|
182
189
|
},
|
|
183
190
|
setCategorie(e) {
|
|
184
191
|
let t = a.lignes[0];
|
|
185
|
-
t.idCategorie = e, t.idType = null, t.idNature = null, t.idMotif = null,
|
|
192
|
+
t.idCategorie = e, t.idType = null, t.idNature = null, t.idMotif = null, _._resetAfterNomenclature();
|
|
186
193
|
},
|
|
187
194
|
setType(e) {
|
|
188
195
|
let t = a.lignes[0];
|
|
189
|
-
t.idType = e, t.idNature = null, t.idMotif = null,
|
|
196
|
+
t.idType = e, t.idNature = null, t.idMotif = null, _._resetAfterNomenclature();
|
|
190
197
|
},
|
|
191
198
|
setNature(e) {
|
|
192
199
|
let t = a.lignes[0];
|
|
193
|
-
t.idNature = e, t.idMotif = null,
|
|
200
|
+
t.idNature = e, t.idMotif = null, _._resetAfterNomenclature();
|
|
194
201
|
},
|
|
195
202
|
setMotif(e) {
|
|
196
|
-
a.lignes[0].idMotif = e,
|
|
203
|
+
a.lignes[0].idMotif = e, _._resetAfterNomenclature();
|
|
197
204
|
},
|
|
198
205
|
selectMotifChain(e) {
|
|
199
206
|
let t = a.lignes[0];
|
|
200
|
-
t.idCategorie = e?.idCategorie ?? null, t.idType = e?.idType ?? null, t.idNature = e?.idNature ?? null, t.idMotif = e?.id ?? null,
|
|
207
|
+
t.idCategorie = e?.idCategorie ?? null, t.idType = e?.idType ?? null, t.idNature = e?.idNature ?? null, t.idMotif = e?.id ?? null, _._resetAfterNomenclature();
|
|
201
208
|
},
|
|
202
209
|
toggleLigneAssociee(e, t = {}) {
|
|
203
210
|
let n = a.lignes.findIndex((t, n) => n > 0 && t.idMotif === e);
|
|
204
211
|
n === -1 ? a.lignes.push({
|
|
205
|
-
...
|
|
212
|
+
...j(),
|
|
206
213
|
idMotif: e,
|
|
207
214
|
...t
|
|
208
215
|
}) : a.lignes.splice(n, 1);
|
|
@@ -212,11 +219,11 @@ function _e({ reclamants: e, modules: t, idModulePrefere: n = y(null), readonly:
|
|
|
212
219
|
},
|
|
213
220
|
setCibleMode(e, t) {
|
|
214
221
|
let n = a.lignes[e];
|
|
215
|
-
n && (n.cibleMode = t, n.reprendreLocataireActuel = !1, n.contratReclamant = t === "contrat" &&
|
|
222
|
+
n && (n.cibleMode = t, n.reprendreLocataireActuel = !1, n.contratReclamant = t === "contrat" && g.value, n.contratCible = null, t === "demande" ? n.patrimoine = null : n.patrimoine ??= A());
|
|
216
223
|
},
|
|
217
224
|
toggleContratReclamant(e, t) {
|
|
218
225
|
let n = a.lignes[e];
|
|
219
|
-
n && (n.contratReclamant = t ?? !n.contratReclamant, n.contratCible = null, n.patrimoine &&
|
|
226
|
+
n && (n.contratReclamant = t ?? !n.contratReclamant, n.contratCible = null, n.patrimoine && _.setPatrimoineModule(e, null));
|
|
220
227
|
},
|
|
221
228
|
setContratCible(e, t) {
|
|
222
229
|
let n = a.lignes[e];
|
|
@@ -224,26 +231,26 @@ function _e({ reclamants: e, modules: t, idModulePrefere: n = y(null), readonly:
|
|
|
224
231
|
typeContrat: t.typeContrat,
|
|
225
232
|
idContrat: t.idContrat,
|
|
226
233
|
libelle: t.libelleContrat ?? null
|
|
227
|
-
} : null,
|
|
234
|
+
} : null, _.setPatrimoineModule(e, null));
|
|
228
235
|
},
|
|
229
236
|
setPatrimoineCommune(e, t) {
|
|
230
|
-
let n =
|
|
231
|
-
n && (n.idCommune = t?.idCommune ?? null, n.commune = t?.commune ?? null,
|
|
237
|
+
let n = _._patrimoine(e);
|
|
238
|
+
n && (n.idCommune = t?.idCommune ?? null, n.commune = t?.commune ?? null, _.setPatrimoineEntree(e, null));
|
|
232
239
|
},
|
|
233
240
|
setPatrimoineEntree(e, t) {
|
|
234
|
-
let n =
|
|
235
|
-
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,
|
|
241
|
+
let n = _._patrimoine(e);
|
|
242
|
+
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));
|
|
236
243
|
},
|
|
237
244
|
setPatrimoineEtage(e, t) {
|
|
238
|
-
let n =
|
|
239
|
-
n && (n.etage = t,
|
|
245
|
+
let n = _._patrimoine(e);
|
|
246
|
+
n && (n.etage = t, _.setPatrimoineModule(e, null));
|
|
240
247
|
},
|
|
241
248
|
setPatrimoineModule(e, t) {
|
|
242
|
-
let n =
|
|
249
|
+
let n = _._patrimoine(e);
|
|
243
250
|
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)));
|
|
244
251
|
},
|
|
245
252
|
prefillFromModule(e, t) {
|
|
246
|
-
let n =
|
|
253
|
+
let n = _._patrimoine(e);
|
|
247
254
|
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);
|
|
248
255
|
},
|
|
249
256
|
toggleCibleOverride(e) {
|
|
@@ -297,7 +304,7 @@ function _e({ reclamants: e, modules: t, idModulePrefere: n = y(null), readonly:
|
|
|
297
304
|
motif: e.idMotif,
|
|
298
305
|
description: i,
|
|
299
306
|
dateFaits: o,
|
|
300
|
-
responsable:
|
|
307
|
+
responsable: fe(e.responsable)
|
|
301
308
|
};
|
|
302
309
|
if (r.cibleMode === "demande") return {
|
|
303
310
|
...c,
|
|
@@ -305,9 +312,9 @@ function _e({ reclamants: e, modules: t, idModulePrefere: n = y(null), readonly:
|
|
|
305
312
|
idCible: a.reclamant.id,
|
|
306
313
|
deduireCible: !1
|
|
307
314
|
};
|
|
308
|
-
let l =
|
|
315
|
+
let l = _._patrimoinePayload(r.patrimoine);
|
|
309
316
|
if (r.cibleMode === "contrat" && !r.reprendreLocataireActuel) {
|
|
310
|
-
let e = r.contratReclamant &&
|
|
317
|
+
let e = r.contratReclamant && g.value ? {
|
|
311
318
|
typeContrat: a.reclamant.type,
|
|
312
319
|
idContrat: a.reclamant.id
|
|
313
320
|
} : r.contratCible;
|
|
@@ -330,10 +337,10 @@ function _e({ reclamants: e, modules: t, idModulePrefere: n = y(null), readonly:
|
|
|
330
337
|
cibleResume(e) {
|
|
331
338
|
let t = a.lignes[0], n = e !== t && !e.cibleOverride ? t : e;
|
|
332
339
|
if (n.cibleMode === "demande") return "La demande";
|
|
333
|
-
let r =
|
|
340
|
+
let r = pe(n.patrimoine);
|
|
334
341
|
if (n.cibleMode !== "contrat") return r;
|
|
335
342
|
let i = "Contrat non défini";
|
|
336
|
-
if (n.contratReclamant &&
|
|
343
|
+
if (n.contratReclamant && g.value) i = "Contrat du réclamant";
|
|
337
344
|
else if (n.contratCible) {
|
|
338
345
|
let e = n.contratCible;
|
|
339
346
|
i = `${e.libelle ?? "Contrat"} (${e.typeContrat}/${e.idContrat})`;
|
|
@@ -341,43 +348,43 @@ function _e({ reclamants: e, modules: t, idModulePrefere: n = y(null), readonly:
|
|
|
341
348
|
return `${i} — ${r}`;
|
|
342
349
|
},
|
|
343
350
|
lignesPayload() {
|
|
344
|
-
return a.lignes.map((e, t) =>
|
|
351
|
+
return a.lignes.map((e, t) => _._lignePayload(e, t));
|
|
345
352
|
},
|
|
346
353
|
creationPayload() {
|
|
347
|
-
let e =
|
|
354
|
+
let e = m.value;
|
|
348
355
|
return {
|
|
349
356
|
typeReclamant: e?.type ?? null,
|
|
350
357
|
reclamant: e?.id ?? null,
|
|
351
|
-
lignes:
|
|
358
|
+
lignes: _.lignesPayload(),
|
|
352
359
|
provenance: a.provenance
|
|
353
360
|
};
|
|
354
361
|
}
|
|
355
362
|
};
|
|
356
|
-
return v(
|
|
363
|
+
return v(_);
|
|
357
364
|
}
|
|
358
|
-
function
|
|
359
|
-
return _(
|
|
365
|
+
function be(e) {
|
|
366
|
+
return _(ue, e), e;
|
|
360
367
|
}
|
|
361
|
-
function
|
|
362
|
-
let e = f(
|
|
368
|
+
function P() {
|
|
369
|
+
let e = f(ue, null);
|
|
363
370
|
if (!e) throw Error("useSollicitationDraft() hors de <creer-sollicitation-form>");
|
|
364
371
|
return e;
|
|
365
372
|
}
|
|
366
373
|
//#endregion
|
|
367
374
|
//#region \0plugin-vue:export-helper
|
|
368
|
-
var
|
|
375
|
+
var F = (e, t) => {
|
|
369
376
|
let n = e.__vccOpts || e;
|
|
370
377
|
for (let [e, r] of t) n[e] = r;
|
|
371
378
|
return n;
|
|
372
|
-
},
|
|
379
|
+
}, xe = {
|
|
373
380
|
name: "AsideBlock",
|
|
374
|
-
components: { AmsomNavTabsHorizontal:
|
|
381
|
+
components: { AmsomNavTabsHorizontal: ne },
|
|
375
382
|
props: { nbSimilaires: {
|
|
376
383
|
type: Number,
|
|
377
384
|
default: 0
|
|
378
385
|
} },
|
|
379
386
|
setup() {
|
|
380
|
-
return { draft:
|
|
387
|
+
return { draft: P() };
|
|
381
388
|
},
|
|
382
389
|
data() {
|
|
383
390
|
return { activeTab: null };
|
|
@@ -413,11 +420,11 @@ var L = (e, t) => {
|
|
|
413
420
|
e.some((e) => e.id === this.activeTab) || (this.activeTab = e[0]?.id ?? null);
|
|
414
421
|
}
|
|
415
422
|
} }
|
|
416
|
-
},
|
|
423
|
+
}, Se = {
|
|
417
424
|
key: 0,
|
|
418
425
|
class: "badge bg-danger ms-1"
|
|
419
|
-
},
|
|
420
|
-
function
|
|
426
|
+
}, Ce = { style: { "min-height": "320px" } }, we = { key: 0 }, Te = { key: 1 };
|
|
427
|
+
function Ee(e, t, n, r, c, l) {
|
|
421
428
|
let f = S("font-awesome-icon"), p = S("amsom-nav-tabs-horizontal");
|
|
422
429
|
return l.tabs.length ? (g(), i(p, {
|
|
423
430
|
key: 0,
|
|
@@ -427,201 +434,30 @@ function we(e, t, n, r, c, l) {
|
|
|
427
434
|
"item-key": "id",
|
|
428
435
|
"tab-spacing": 1
|
|
429
436
|
}, {
|
|
430
|
-
libelle:
|
|
437
|
+
libelle: E(({ item: e }) => [
|
|
431
438
|
u(f, { icon: e.icon }, null, 8, ["icon"]),
|
|
432
439
|
s("span", null, C(e.label), 1),
|
|
433
|
-
e.id === "similarite" && n.nbSimilaires > 0 ? (g(), o("span",
|
|
440
|
+
e.id === "similarite" && n.nbSimilaires > 0 ? (g(), o("span", Se, C(n.nbSimilaires), 1)) : a("", !0)
|
|
434
441
|
]),
|
|
435
|
-
content:
|
|
442
|
+
content: E(() => [s("div", Ce, [e.$slots.similaires ? D((g(), o("div", we, [x(e.$slots, "similaires", h(d(l.scope)))], 512)), [[te, c.activeTab === "similarite"]]) : a("", !0), e.$slots.evenements ? D((g(), o("div", Te, [x(e.$slots, "evenements")], 512)), [[te, c.activeTab === "evenements"]]) : a("", !0)])]),
|
|
436
443
|
_: 3
|
|
437
444
|
}, 8, ["modelValue", "items"])) : a("", !0);
|
|
438
445
|
}
|
|
439
|
-
var
|
|
440
|
-
//#endregion
|
|
441
|
-
//#region src/utils/text.js
|
|
442
|
-
function B(e, t = !0) {
|
|
443
|
-
if (!e) return null;
|
|
444
|
-
let n = e.toString().normalize("NFD").replace(/[̀-ͯ]/g, "");
|
|
445
|
-
return t ? n.toLowerCase() : n;
|
|
446
|
-
}
|
|
447
|
-
//#endregion
|
|
448
|
-
//#region src/components/ReclamantSelecteurBlock.vue
|
|
449
|
-
var De = {
|
|
450
|
-
name: "ReclamantSelecteurBlock",
|
|
451
|
-
components: { AmsomAutocomplete: k },
|
|
452
|
-
props: {
|
|
453
|
-
mode: {
|
|
454
|
-
type: String,
|
|
455
|
-
default: null
|
|
456
|
-
},
|
|
457
|
-
inline: {
|
|
458
|
-
type: Boolean,
|
|
459
|
-
default: !0
|
|
460
|
-
}
|
|
461
|
-
},
|
|
462
|
-
setup() {
|
|
463
|
-
return {
|
|
464
|
-
draft: I(),
|
|
465
|
-
options: z()
|
|
466
|
-
};
|
|
467
|
-
},
|
|
468
|
-
computed: {
|
|
469
|
-
reclamants() {
|
|
470
|
-
return this.draft.reclamantsDisponibles;
|
|
471
|
-
},
|
|
472
|
-
reclamantSelectionne() {
|
|
473
|
-
return this.draft.reclamantSelectionne;
|
|
474
|
-
},
|
|
475
|
-
presentation() {
|
|
476
|
-
return this.mode ?? this.options.reclamantMode;
|
|
477
|
-
},
|
|
478
|
-
estFige() {
|
|
479
|
-
return this.reclamants.length <= 1 || this.draft.isReadonly("reclamant");
|
|
480
|
-
}
|
|
481
|
-
},
|
|
482
|
-
methods: {
|
|
483
|
-
reclamantId(e) {
|
|
484
|
-
let t = this.reclamants.indexOf(e);
|
|
485
|
-
return t < 0 ? null : t;
|
|
486
|
-
},
|
|
487
|
-
select(e) {
|
|
488
|
-
e && this.draft.setReclamant(e);
|
|
489
|
-
},
|
|
490
|
-
filterReclamants({ search: e, items: t }) {
|
|
491
|
-
let n = (B(e) ?? "").trim();
|
|
492
|
-
return n ? t.filter((e) => (B(e?.libelle) ?? "").includes(n)) : t;
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}, Oe = {
|
|
496
|
-
key: 0,
|
|
497
|
-
class: "fs-7 text-muted"
|
|
498
|
-
}, ke = { class: "fw-medium" }, Ae = {
|
|
499
|
-
key: 0,
|
|
500
|
-
class: "btn-group btn-group-sm",
|
|
501
|
-
role: "group"
|
|
502
|
-
}, je = ["onClick"], Me = ["value"], Ne = ["value"];
|
|
503
|
-
function Pe(e, t, r, a, c, u) {
|
|
504
|
-
let d = S("amsom-autocomplete");
|
|
505
|
-
return u.estFige ? (g(), o("div", Oe, [t[2] ||= l(" Réclamant : ", -1), s("span", ke, C(u.reclamantSelectionne?.libelle), 1)])) : (g(), o("div", {
|
|
506
|
-
key: 1,
|
|
507
|
-
class: m(r.inline ? "d-flex align-items-center justify-content-between gap-2 border-bottom pb-2" : "d-flex flex-column gap-1")
|
|
508
|
-
}, [t[3] ||= s("span", { class: "fs-7 fw-semibold text-muted text-uppercase" }, "Réclamant", -1), u.presentation === "switch" ? (g(), o("div", Ae, [(g(!0), o(n, null, b(u.reclamants, (e, t) => (g(), o("button", {
|
|
509
|
-
key: t,
|
|
510
|
-
type: "button",
|
|
511
|
-
class: m(["btn btn-sm py-0", e === u.reclamantSelectionne ? "btn-primary" : "btn-outline-primary"]),
|
|
512
|
-
onClick: (t) => u.select(e)
|
|
513
|
-
}, C(e.libelle), 11, je))), 128))])) : u.presentation === "autocomplete" ? (g(), i(d, {
|
|
514
|
-
key: 1,
|
|
515
|
-
"model-value": u.reclamantSelectionne,
|
|
516
|
-
items: u.reclamants,
|
|
517
|
-
"get-id": u.reclamantId,
|
|
518
|
-
"get-input-libelle": (e) => e?.libelle ?? "",
|
|
519
|
-
"filtering-function": u.filterReclamants,
|
|
520
|
-
placeholder: "Rechercher un réclamant…",
|
|
521
|
-
"input-size": "sm",
|
|
522
|
-
"hide-choices": "",
|
|
523
|
-
class: m(r.inline ? "" : "w-100"),
|
|
524
|
-
"onUpdate:modelValue": t[0] ||= (e) => u.select(e)
|
|
525
|
-
}, null, 8, [
|
|
526
|
-
"model-value",
|
|
527
|
-
"items",
|
|
528
|
-
"get-id",
|
|
529
|
-
"get-input-libelle",
|
|
530
|
-
"filtering-function",
|
|
531
|
-
"class"
|
|
532
|
-
])) : (g(), o("select", {
|
|
533
|
-
key: 2,
|
|
534
|
-
class: m(["form-select form-select-sm", r.inline ? "w-auto" : ""]),
|
|
535
|
-
value: u.reclamants.indexOf(u.reclamantSelectionne),
|
|
536
|
-
onChange: t[1] ||= (e) => u.select(u.reclamants[e.target.value])
|
|
537
|
-
}, [(g(!0), o(n, null, b(u.reclamants, (e, t) => (g(), o("option", {
|
|
538
|
-
key: t,
|
|
539
|
-
value: t
|
|
540
|
-
}, C(e.libelle), 9, Ne))), 128))], 42, Me))], 2));
|
|
541
|
-
}
|
|
542
|
-
var V = /*#__PURE__*/ L(De, [["render", Pe]]), Fe = {
|
|
543
|
-
name: "ProvenanceSelecteurBlock",
|
|
544
|
-
setup() {
|
|
545
|
-
return { draft: I() };
|
|
546
|
-
},
|
|
547
|
-
computed: {
|
|
548
|
-
provenances() {
|
|
549
|
-
return se;
|
|
550
|
-
},
|
|
551
|
-
selected() {
|
|
552
|
-
return this.draft.draft.provenance;
|
|
553
|
-
},
|
|
554
|
-
provenanceChoisie() {
|
|
555
|
-
return this.provenances.find((e) => e.id === this.selected) ?? null;
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
}, Ie = {
|
|
559
|
-
key: 0,
|
|
560
|
-
class: "fs-7 text-muted"
|
|
561
|
-
}, Le = { class: "fw-medium" }, Re = { key: 1 }, ze = { class: "d-flex flex-wrap gap-2" }, Be = ["onClick"], Ve = {
|
|
562
|
-
key: 0,
|
|
563
|
-
class: "fs-7 text-danger mt-1"
|
|
564
|
-
};
|
|
565
|
-
function He(e, t, r, c, d, f) {
|
|
566
|
-
let p = S("font-awesome-icon");
|
|
567
|
-
return c.draft.isReadonly("provenance") ? (g(), o("div", Ie, [t[0] ||= l(" Provenance du contact : ", -1), s("span", Le, [f.provenanceChoisie?.icon ? (g(), i(p, {
|
|
568
|
-
key: 0,
|
|
569
|
-
icon: f.provenanceChoisie.icon,
|
|
570
|
-
"fixed-width": ""
|
|
571
|
-
}, null, 8, ["icon"])) : a("", !0), l(" " + C(f.provenanceChoisie?.libelle ?? "—"), 1)])])) : (g(), o("div", Re, [
|
|
572
|
-
t[1] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, [l(" Provenance du contact "), s("span", { class: "text-danger" }, "*")], -1),
|
|
573
|
-
s("div", ze, [(g(!0), o(n, null, b(f.provenances, (e) => (g(), o("button", {
|
|
574
|
-
key: e.id,
|
|
575
|
-
type: "button",
|
|
576
|
-
class: m(["btn btn-sm d-inline-flex align-items-center gap-2", e.id === f.selected ? "btn-primary" : "btn-outline-primary"]),
|
|
577
|
-
onClick: (t) => c.draft.setProvenance(e.id)
|
|
578
|
-
}, [u(p, {
|
|
579
|
-
icon: e.icon,
|
|
580
|
-
"fixed-width": ""
|
|
581
|
-
}, null, 8, ["icon"]), s("span", null, C(e.libelle), 1)], 10, Be))), 128))]),
|
|
582
|
-
f.selected ? a("", !0) : (g(), o("div", Ve, " Sélectionnez par quel canal la sollicitation vous est parvenue. "))
|
|
583
|
-
]));
|
|
584
|
-
}
|
|
585
|
-
var Ue = /*#__PURE__*/ L(Fe, [["render", He]]), We = {
|
|
586
|
-
name: "EtapeReclamantBlock",
|
|
587
|
-
components: {
|
|
588
|
-
ReclamantSelecteurBlock: V,
|
|
589
|
-
ProvenanceSelecteurBlock: Ue
|
|
590
|
-
},
|
|
591
|
-
props: { premiere: {
|
|
592
|
-
type: Boolean,
|
|
593
|
-
default: !1
|
|
594
|
-
} }
|
|
595
|
-
}, Ge = { class: "d-flex flex-column gap-3" }, Ke = { class: "alert alert-light border py-2 px-3 mb-0 fs-7" };
|
|
596
|
-
function qe(e, t, n, r, c, d) {
|
|
597
|
-
let f = S("provenance-selecteur-block"), p = S("font-awesome-icon"), m = S("reclamant-selecteur-block");
|
|
598
|
-
return g(), o("div", Ge, [
|
|
599
|
-
n.premiere ? (g(), i(f, { key: 0 })) : a("", !0),
|
|
600
|
-
s("div", Ke, [u(p, {
|
|
601
|
-
icon: "user",
|
|
602
|
-
class: "text-primary me-2"
|
|
603
|
-
}), t[0] ||= l(" Pour qui cette sollicitation est-elle créée\xA0? ", -1)]),
|
|
604
|
-
u(m, {
|
|
605
|
-
mode: "select",
|
|
606
|
-
inline: !1
|
|
607
|
-
})
|
|
608
|
-
]);
|
|
609
|
-
}
|
|
610
|
-
var Je = /*#__PURE__*/ L(We, [["render", qe]]), Ye = {
|
|
446
|
+
var De = /*#__PURE__*/ F(xe, [["render", Ee]]), Oe = {
|
|
611
447
|
baseUrl: "",
|
|
612
|
-
getToken: () =>
|
|
613
|
-
setToken: (e) =>
|
|
614
|
-
logout: () =>
|
|
615
|
-
goToLoginPage: () =>
|
|
448
|
+
getToken: () => k.getToken(),
|
|
449
|
+
setToken: (e) => k.setToken(e),
|
|
450
|
+
logout: () => k.logout(),
|
|
451
|
+
goToLoginPage: () => k.goToLoginPage()
|
|
616
452
|
};
|
|
617
|
-
function
|
|
618
|
-
Object.assign(
|
|
453
|
+
function ke(e = {}) {
|
|
454
|
+
Object.assign(Oe, e);
|
|
619
455
|
}
|
|
620
|
-
var
|
|
456
|
+
var I = () => Oe;
|
|
621
457
|
//#endregion
|
|
622
458
|
//#region src/api/transport/axiosOverlayConnector.js
|
|
623
|
-
function
|
|
624
|
-
let n =
|
|
459
|
+
function Ae(e, t = {}) {
|
|
460
|
+
let n = I(), r = {
|
|
625
461
|
getToken: () => n.getToken?.() ?? null,
|
|
626
462
|
setToken: (e) => n.setToken?.(e),
|
|
627
463
|
logout: () => n.logout?.(),
|
|
@@ -643,40 +479,40 @@ function Ze(e, t = {}) {
|
|
|
643
479
|
}, t.functions.errorsHandlers = {
|
|
644
480
|
...r.errorsHandlers,
|
|
645
481
|
...t.functions.errorsHandlers ?? {}
|
|
646
|
-
},
|
|
482
|
+
}, ie(e, t);
|
|
647
483
|
}
|
|
648
484
|
//#endregion
|
|
649
485
|
//#region src/api/transport/httpClient.js
|
|
650
|
-
var
|
|
651
|
-
let n = t ||
|
|
486
|
+
var je = (e, t) => {
|
|
487
|
+
let n = t || I().baseUrl;
|
|
652
488
|
if (!n) throw Error("Cresol : baseUrl non renseignée (configureCresol ou prop baseUrl)");
|
|
653
489
|
return `${n}${e}`;
|
|
654
|
-
},
|
|
490
|
+
}, Me = (e = {}) => {
|
|
655
491
|
let t = new URLSearchParams();
|
|
656
492
|
Object.entries(e).forEach(([e, n]) => {
|
|
657
493
|
n != null && n !== "" && t.append(e, typeof n == "object" ? JSON.stringify(n) : n);
|
|
658
494
|
});
|
|
659
495
|
let n = t.toString();
|
|
660
496
|
return n ? `?${n}` : "";
|
|
661
|
-
},
|
|
497
|
+
}, Ne = (e = {}, t) => t ? {
|
|
662
498
|
...e,
|
|
663
499
|
functions: {
|
|
664
500
|
...e.functions ?? {},
|
|
665
501
|
getToken: () => t
|
|
666
502
|
}
|
|
667
|
-
} : e,
|
|
668
|
-
url:
|
|
503
|
+
} : e, Pe = ({ method: e, path: t, params: n, data: r, signal: i, token: a, baseUrl: o }, s = {}) => Ae({
|
|
504
|
+
url: je(`${t}${Me(n)}`, o),
|
|
669
505
|
method: e,
|
|
670
506
|
...r === void 0 ? {} : { data: r },
|
|
671
507
|
...i ? { signal: i } : {}
|
|
672
|
-
},
|
|
508
|
+
}, Ne(s, a)), L = (e, { params: t, signal: n, overlay: r, token: i, baseUrl: a } = {}) => Pe({
|
|
673
509
|
method: "GET",
|
|
674
510
|
path: e,
|
|
675
511
|
params: t,
|
|
676
512
|
signal: n,
|
|
677
513
|
token: i,
|
|
678
514
|
baseUrl: a
|
|
679
|
-
}, r).then((e) => e.data),
|
|
515
|
+
}, r).then((e) => e.data), Fe = (e, t, { params: n, signal: r, overlay: i, token: a, baseUrl: o } = {}) => Pe({
|
|
680
516
|
method: "POST",
|
|
681
517
|
path: e,
|
|
682
518
|
params: n,
|
|
@@ -684,34 +520,34 @@ var Qe = (e, t) => {
|
|
|
684
520
|
signal: r,
|
|
685
521
|
token: a,
|
|
686
522
|
baseUrl: o
|
|
687
|
-
}, i).then((e) => e.data),
|
|
523
|
+
}, i).then((e) => e.data), Ie = { mustBeAuthenticated: !1 }, R = (e, { signal: t, token: n, baseUrl: r } = {}) => L(e, {
|
|
688
524
|
signal: t,
|
|
689
525
|
token: n,
|
|
690
526
|
baseUrl: r,
|
|
691
|
-
overlay:
|
|
692
|
-
}),
|
|
527
|
+
overlay: Ie
|
|
528
|
+
}), Le = (e) => R("/v2/sollicitation/motifs", e), Re = (e) => R("/v2/sollicitation/categories", e), ze = (e) => R("/v2/sollicitation/types", e), Be = (e) => R("/v2/sollicitation/natures", e), Ve = (e) => R("/v2/sollicitation/etats", e), He = ({ signal: e, token: t, baseUrl: n } = {}) => L("/collaborateurs", {
|
|
693
529
|
params: { actif: !0 },
|
|
694
530
|
signal: e,
|
|
695
531
|
token: t,
|
|
696
532
|
baseUrl: n
|
|
697
|
-
}),
|
|
533
|
+
}), Ue = async ({ signal: e, token: t, baseUrl: n } = {}) => (await L("/v2/patrimoine/communes", {
|
|
698
534
|
signal: e,
|
|
699
535
|
token: t,
|
|
700
536
|
baseUrl: n
|
|
701
537
|
}) ?? []).map((e) => ({
|
|
702
538
|
idCommune: e.id,
|
|
703
539
|
commune: e.libelle
|
|
704
|
-
})),
|
|
540
|
+
})), We = (e, { signal: t, token: n, baseUrl: r } = {}) => L("/v2/patrimoine/entrees", {
|
|
705
541
|
params: { idCommune: e },
|
|
706
542
|
signal: t,
|
|
707
543
|
token: n,
|
|
708
544
|
baseUrl: r
|
|
709
|
-
}),
|
|
545
|
+
}), Ge = (e, { signal: t, token: n, baseUrl: r } = {}) => L("/v2/patrimoine/modules", {
|
|
710
546
|
params: { codeProgramme: e },
|
|
711
547
|
signal: t,
|
|
712
548
|
token: n,
|
|
713
549
|
baseUrl: r
|
|
714
|
-
}),
|
|
550
|
+
}), Ke = ({ idContrat: e, typeContrat: t }, { signal: n, token: r, baseUrl: i } = {}) => L("/v2/patrimoine/contrat_modules", {
|
|
715
551
|
params: {
|
|
716
552
|
idContrat: e,
|
|
717
553
|
typeContrat: t
|
|
@@ -719,7 +555,7 @@ var Qe = (e, t) => {
|
|
|
719
555
|
signal: n,
|
|
720
556
|
token: r,
|
|
721
557
|
baseUrl: i
|
|
722
|
-
}),
|
|
558
|
+
}), qe = ({ motif: e, categorie: t, type: n, nature: r }, { signal: i, token: a, baseUrl: o } = {}) => L("/v2/sollicitation/responsables", {
|
|
723
559
|
params: {
|
|
724
560
|
motif: e,
|
|
725
561
|
categorie: t,
|
|
@@ -729,19 +565,27 @@ var Qe = (e, t) => {
|
|
|
729
565
|
signal: i,
|
|
730
566
|
token: a,
|
|
731
567
|
baseUrl: o
|
|
732
|
-
}),
|
|
568
|
+
}), Je = (e, { signal: t, token: n, baseUrl: r } = {}) => L("/v2/patrimoine/contrat_module_rechercher", {
|
|
733
569
|
params: { recherche: e },
|
|
734
570
|
signal: t,
|
|
735
571
|
token: n,
|
|
736
572
|
baseUrl: r
|
|
573
|
+
}), Ye = ({ categorie: e, recherche: t }, { signal: n, token: r, baseUrl: i } = {}) => L("/v2/cresol/reclamant_rechercher", {
|
|
574
|
+
params: {
|
|
575
|
+
categorie: e,
|
|
576
|
+
recherche: t
|
|
577
|
+
},
|
|
578
|
+
signal: n,
|
|
579
|
+
token: r,
|
|
580
|
+
baseUrl: i
|
|
737
581
|
});
|
|
738
582
|
//#endregion
|
|
739
583
|
//#region src/utils/apiError.js
|
|
740
|
-
function
|
|
584
|
+
function z(e) {
|
|
741
585
|
let t = e?.response?.data;
|
|
742
586
|
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";
|
|
743
587
|
}
|
|
744
|
-
var
|
|
588
|
+
var B = (e) => e?.name === "AbortError" || e?.name === "CanceledError", V = Symbol("cresol:data"), Xe = () => ({
|
|
745
589
|
motifs: null,
|
|
746
590
|
categories: null,
|
|
747
591
|
types: null,
|
|
@@ -753,23 +597,23 @@ var gt = (e) => e?.name === "AbortError" || e?.name === "CanceledError", _t = Sy
|
|
|
753
597
|
modulesByProgramme: {},
|
|
754
598
|
modulesByContrat: {},
|
|
755
599
|
responsablesByMotif: {}
|
|
756
|
-
}),
|
|
757
|
-
function
|
|
758
|
-
|
|
600
|
+
}), H = /* @__PURE__ */ new Map(), Ze = (e) => (H.has(e) || H.set(e, v(Xe())), H.get(e)), U = /* @__PURE__ */ new Map();
|
|
601
|
+
function Qe() {
|
|
602
|
+
H.clear(), U.clear();
|
|
759
603
|
}
|
|
760
|
-
var
|
|
761
|
-
function
|
|
604
|
+
var W = (e, t, n) => e?.find((e) => e[t] === n)?.libelle ?? n, G = (e, t, n) => e?.find((e) => e[t] === n)?.icon ?? null;
|
|
605
|
+
function $e({ onError: e, token: t, baseUrl: n } = {}) {
|
|
762
606
|
let i = y(0), a = () => ({
|
|
763
607
|
token: T(t) || null,
|
|
764
608
|
baseUrl: T(n) || null
|
|
765
|
-
}), o = () => T(n) ||
|
|
609
|
+
}), o = () => T(n) || I().baseUrl || "", s = () => Ze(o()), c = (t, n) => {
|
|
766
610
|
let r = `${o()}|${t}`;
|
|
767
|
-
if (
|
|
611
|
+
if (U.has(r)) return U.get(r);
|
|
768
612
|
i.value += 1;
|
|
769
|
-
let a = Promise.resolve().then(n).catch((t) => (
|
|
770
|
-
--i.value,
|
|
613
|
+
let a = Promise.resolve().then(n).catch((t) => (B(t) || e?.(z(t)), null)).finally(() => {
|
|
614
|
+
--i.value, U.delete(r);
|
|
771
615
|
});
|
|
772
|
-
return
|
|
616
|
+
return U.set(r, a), a;
|
|
773
617
|
}, l = (e, t) => s()[e]?.length ? Promise.resolve(s()[e]) : c(`referentiel:${e}`, async () => (s()[e] = await t(a()), s()[e])), u = {
|
|
774
618
|
get cache() {
|
|
775
619
|
return s();
|
|
@@ -778,26 +622,26 @@ function xt({ onError: e, token: t, baseUrl: n } = {}) {
|
|
|
778
622
|
isLoading: r(() => i.value > 0),
|
|
779
623
|
loadNomenclature() {
|
|
780
624
|
return Promise.all([
|
|
781
|
-
l("motifs",
|
|
782
|
-
l("categories",
|
|
783
|
-
l("types",
|
|
784
|
-
l("natures",
|
|
785
|
-
l("etats",
|
|
625
|
+
l("motifs", Le),
|
|
626
|
+
l("categories", Re),
|
|
627
|
+
l("types", ze),
|
|
628
|
+
l("natures", Be),
|
|
629
|
+
l("etats", Ve)
|
|
786
630
|
]);
|
|
787
631
|
},
|
|
788
|
-
loadCollaborateurs: () => l("collaborateurs",
|
|
632
|
+
loadCollaborateurs: () => l("collaborateurs", He),
|
|
789
633
|
loadCommunes() {
|
|
790
|
-
return s().communes?.length ? Promise.resolve(s().communes) : c("communes", async () => (s().communes = await
|
|
634
|
+
return s().communes?.length ? Promise.resolve(s().communes) : c("communes", async () => (s().communes = await Ue(a()), s().communes));
|
|
791
635
|
},
|
|
792
636
|
loadAdresses(e) {
|
|
793
637
|
return e == null ? Promise.resolve([]) : s().adressesByCommune[e] ? Promise.resolve(s().adressesByCommune[e]) : c(`adresses:${e}`, async () => {
|
|
794
|
-
let t = await
|
|
638
|
+
let t = await We(e, a());
|
|
795
639
|
return s().adressesByCommune[e] = t ?? [], t;
|
|
796
640
|
});
|
|
797
641
|
},
|
|
798
642
|
loadModulesOfProgramme(e) {
|
|
799
643
|
return e == null ? Promise.resolve([]) : s().modulesByProgramme[e] ? Promise.resolve(s().modulesByProgramme[e]) : c(`modules:${e}`, async () => {
|
|
800
|
-
let t = await
|
|
644
|
+
let t = await Ge(e, a());
|
|
801
645
|
return s().modulesByProgramme[e] = t ?? [], t;
|
|
802
646
|
});
|
|
803
647
|
},
|
|
@@ -805,7 +649,7 @@ function xt({ onError: e, token: t, baseUrl: n } = {}) {
|
|
|
805
649
|
if (e == null) return Promise.resolve([]);
|
|
806
650
|
let n = `${t ?? ""}|${e}`;
|
|
807
651
|
return s().modulesByContrat[n] ? Promise.resolve(s().modulesByContrat[n]) : c(`contratModules:${n}`, async () => {
|
|
808
|
-
let r = await
|
|
652
|
+
let r = await Ke({
|
|
809
653
|
idContrat: e,
|
|
810
654
|
typeContrat: t
|
|
811
655
|
}, a());
|
|
@@ -815,7 +659,7 @@ function xt({ onError: e, token: t, baseUrl: n } = {}) {
|
|
|
815
659
|
async searchContrats(e, { signal: t } = {}) {
|
|
816
660
|
let n = (e ?? "").trim();
|
|
817
661
|
if (!n) return [];
|
|
818
|
-
let r = await
|
|
662
|
+
let r = await Je(n, {
|
|
819
663
|
...a(),
|
|
820
664
|
signal: t
|
|
821
665
|
}), i = /* @__PURE__ */ new Map();
|
|
@@ -831,9 +675,44 @@ function xt({ onError: e, token: t, baseUrl: n } = {}) {
|
|
|
831
675
|
}
|
|
832
676
|
return [...i.values()].sort((e, t) => Number(e.estSorti) - Number(t.estSorti) || (e.libelle ?? "").localeCompare(t.libelle ?? ""));
|
|
833
677
|
},
|
|
678
|
+
async searchReclamants(e, t, { signal: n } = {}) {
|
|
679
|
+
let r = (t ?? "").trim();
|
|
680
|
+
if (!r) return [];
|
|
681
|
+
let i = await Ye({
|
|
682
|
+
categorie: e,
|
|
683
|
+
recherche: r
|
|
684
|
+
}, {
|
|
685
|
+
...a(),
|
|
686
|
+
signal: n
|
|
687
|
+
}), o = /* @__PURE__ */ new Map();
|
|
688
|
+
for (let t of i ?? []) {
|
|
689
|
+
let n = `${t.typeReclamant}|${t.idReclamant}`;
|
|
690
|
+
o.has(n) || o.set(n, {
|
|
691
|
+
type: t.typeReclamant,
|
|
692
|
+
id: t.idReclamant,
|
|
693
|
+
categorie: t.categorie?.toLowerCase() ?? e,
|
|
694
|
+
libelleReclamant: t.libelleReclamant,
|
|
695
|
+
adresse: t.adresse,
|
|
696
|
+
estActif: !1,
|
|
697
|
+
individus: []
|
|
698
|
+
});
|
|
699
|
+
let r = o.get(n);
|
|
700
|
+
r.estActif ||= !!t.estActif, r.individus.push(t);
|
|
701
|
+
}
|
|
702
|
+
return [...o.values()].sort((e, t) => Number(t.estActif) - Number(e.estActif)).map((e) => {
|
|
703
|
+
let t = e.individus.map((e) => [e.nom, e.prenom].filter(Boolean).join(" ")).filter(Boolean).join(", "), n = {
|
|
704
|
+
locataire: `${e.libelleReclamant || t} — Contrat ${e.type}/${e.id}`,
|
|
705
|
+
demandeur: `${t} — ${e.libelleReclamant}`
|
|
706
|
+
}[e.categorie];
|
|
707
|
+
return {
|
|
708
|
+
...e,
|
|
709
|
+
libelle: n ?? e.libelleReclamant
|
|
710
|
+
};
|
|
711
|
+
});
|
|
712
|
+
},
|
|
834
713
|
loadResponsables({ motif: e, categorie: t, type: n, nature: r }) {
|
|
835
714
|
return e == null ? Promise.resolve([]) : s().responsablesByMotif[e] ? Promise.resolve(s().responsablesByMotif[e]) : c(`responsables:${e}`, async () => {
|
|
836
|
-
let i = await
|
|
715
|
+
let i = await qe({
|
|
837
716
|
motif: e,
|
|
838
717
|
categorie: t,
|
|
839
718
|
type: n,
|
|
@@ -857,45 +736,441 @@ function xt({ onError: e, token: t, baseUrl: n } = {}) {
|
|
|
857
736
|
libelle: l.libelleResponsable
|
|
858
737
|
};
|
|
859
738
|
},
|
|
860
|
-
motifLibelle: (e) =>
|
|
861
|
-
categorieLibelle: (e) =>
|
|
862
|
-
typeLibelle: (e) =>
|
|
863
|
-
natureLibelle: (e) =>
|
|
864
|
-
etatLibelle: (e) =>
|
|
865
|
-
motifIcon: (e) =>
|
|
866
|
-
categorieIcon: (e) =>
|
|
867
|
-
typeIcon: (e) =>
|
|
868
|
-
natureIcon: (e) =>
|
|
739
|
+
motifLibelle: (e) => W(s().motifs, "id", e),
|
|
740
|
+
categorieLibelle: (e) => W(s().categories, "id", e),
|
|
741
|
+
typeLibelle: (e) => W(s().types, "id", e),
|
|
742
|
+
natureLibelle: (e) => W(s().natures, "id", e),
|
|
743
|
+
etatLibelle: (e) => W(s().etats, "code", e),
|
|
744
|
+
motifIcon: (e) => G(s().motifs, "id", e),
|
|
745
|
+
categorieIcon: (e) => G(s().categories, "id", e),
|
|
746
|
+
typeIcon: (e) => G(s().types, "id", e),
|
|
747
|
+
natureIcon: (e) => G(s().natures, "id", e)
|
|
869
748
|
};
|
|
870
749
|
return v(u);
|
|
871
750
|
}
|
|
872
|
-
function
|
|
873
|
-
return _(
|
|
751
|
+
function et(e) {
|
|
752
|
+
return _(V, e), e;
|
|
874
753
|
}
|
|
875
|
-
function
|
|
876
|
-
let e = f(
|
|
754
|
+
function K() {
|
|
755
|
+
let e = f(V, null);
|
|
877
756
|
if (!e) throw Error("useCresolData() hors de <creer-sollicitation-form>");
|
|
878
757
|
return e;
|
|
879
758
|
}
|
|
880
759
|
//#endregion
|
|
881
760
|
//#region src/utils/fontAwesomeIcons.js
|
|
882
|
-
var
|
|
883
|
-
async function
|
|
761
|
+
var tt = (e) => "fa" + e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
|
|
762
|
+
async function nt(e) {
|
|
884
763
|
let t = await import("@fortawesome/free-solid-svg-icons");
|
|
885
764
|
[...new Set(e.filter(Boolean))].forEach((e) => {
|
|
886
|
-
let n = t[
|
|
887
|
-
n &&
|
|
765
|
+
let n = t[tt(e)];
|
|
766
|
+
n && ae.add(n);
|
|
888
767
|
});
|
|
889
768
|
}
|
|
890
769
|
//#endregion
|
|
770
|
+
//#region src/components/ReclamantRechercheBlock.vue
|
|
771
|
+
var q = [
|
|
772
|
+
{
|
|
773
|
+
key: "locataire",
|
|
774
|
+
label: "Locataire",
|
|
775
|
+
icon: "house-user",
|
|
776
|
+
recherche: "Rechercher un locataire",
|
|
777
|
+
aucun: "Aucun locataire trouvé.",
|
|
778
|
+
placeholder: "Nom, prénom, n° de contrat, adresse, téléphone ou mail…"
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
key: "demandeur",
|
|
782
|
+
label: "Demandeur",
|
|
783
|
+
icon: "hourglass-half",
|
|
784
|
+
recherche: "Rechercher un demandeur",
|
|
785
|
+
aucun: "Aucun demandeur trouvé.",
|
|
786
|
+
placeholder: "Nom, prénom, n° de demande ou unique, téléphone ou mail…"
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
key: "tiers",
|
|
790
|
+
label: "Tiers",
|
|
791
|
+
icon: "user-tie",
|
|
792
|
+
recherche: "Rechercher un tiers",
|
|
793
|
+
aucun: "Aucun tiers trouvé.",
|
|
794
|
+
placeholder: "Raison sociale, adresse, téléphone ou mail…"
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
key: "autre",
|
|
798
|
+
label: "Autre",
|
|
799
|
+
icon: "user",
|
|
800
|
+
recherche: "Rechercher un individu « Autre »",
|
|
801
|
+
aucun: "Aucun individu « Autre » trouvé.",
|
|
802
|
+
placeholder: "Nom, prénom, adresse, téléphone ou mail…"
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
key: "tout",
|
|
806
|
+
label: "Tout",
|
|
807
|
+
icon: "magnifying-glass",
|
|
808
|
+
recherche: "Rechercher parmi tous les réclamants",
|
|
809
|
+
aucun: "Aucun réclamant trouvé.",
|
|
810
|
+
placeholder: "Nom, prénom, n° de contrat ou de demande, adresse, téléphone ou mail…"
|
|
811
|
+
}
|
|
812
|
+
], rt = {
|
|
813
|
+
signataire: "Signataire",
|
|
814
|
+
occupant: "Occupant",
|
|
815
|
+
demandeur: "Demandeur"
|
|
816
|
+
}, J = (e) => e ? e.categorie ? e.categorie : {
|
|
817
|
+
D: "demandeur",
|
|
818
|
+
T: "tiers",
|
|
819
|
+
U: "autre"
|
|
820
|
+
}[e.type] ?? "locataire" : null, it = {
|
|
821
|
+
name: "ReclamantRechercheBlock",
|
|
822
|
+
components: { AmsomAutocomplete: O },
|
|
823
|
+
setup() {
|
|
824
|
+
return {
|
|
825
|
+
draft: P(),
|
|
826
|
+
data: K()
|
|
827
|
+
};
|
|
828
|
+
},
|
|
829
|
+
data() {
|
|
830
|
+
return {
|
|
831
|
+
iconsReady: !1,
|
|
832
|
+
categorie: J(this.draft.reclamantSelectionne) ?? "locataire",
|
|
833
|
+
trouves: [],
|
|
834
|
+
rechercheEnCours: !1,
|
|
835
|
+
rechercheFaite: !1
|
|
836
|
+
};
|
|
837
|
+
},
|
|
838
|
+
computed: {
|
|
839
|
+
categories() {
|
|
840
|
+
return q;
|
|
841
|
+
},
|
|
842
|
+
categorieCourante() {
|
|
843
|
+
return q.find((e) => e.key === this.categorie);
|
|
844
|
+
},
|
|
845
|
+
selectionne() {
|
|
846
|
+
return this.draft.reclamantSelectionne;
|
|
847
|
+
},
|
|
848
|
+
selectedTrouve: {
|
|
849
|
+
get() {
|
|
850
|
+
return this.categorie === "tout" || J(this.selectionne) === this.categorie ? this.selectionne : null;
|
|
851
|
+
},
|
|
852
|
+
set(e) {
|
|
853
|
+
this.select(e);
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
},
|
|
857
|
+
async created() {
|
|
858
|
+
await nt(q.map((e) => e.icon)), this.iconsReady = !0;
|
|
859
|
+
},
|
|
860
|
+
beforeUnmount() {
|
|
861
|
+
clearTimeout(this.rechercheTimeout), this.controller?.abort();
|
|
862
|
+
},
|
|
863
|
+
methods: {
|
|
864
|
+
select(e) {
|
|
865
|
+
e && (this.draft.selectReclamant(e), this.categorie !== "tout" && (this.categorie = J(e)));
|
|
866
|
+
},
|
|
867
|
+
setCategorie(e) {
|
|
868
|
+
e !== this.categorie && (this.categorie = e, clearTimeout(this.rechercheTimeout), this.controller?.abort(), this.trouves = [], this.rechercheEnCours = !1, this.rechercheFaite = !1);
|
|
869
|
+
},
|
|
870
|
+
rechercherPlusTard(e) {
|
|
871
|
+
clearTimeout(this.rechercheTimeout), this.rechercheTimeout = setTimeout(() => this.rechercher(e), 400);
|
|
872
|
+
},
|
|
873
|
+
rechercher(e) {
|
|
874
|
+
let t = (e ?? "").trim();
|
|
875
|
+
t.length < 2 ? (this.trouves = [], this.rechercheEnCours = !1, this.rechercheFaite = !1) : (this.controller?.abort(), this.controller = new AbortController(), this.rechercheEnCours = !0, this.data.searchReclamants(this.categorie, t, { signal: this.controller.signal }).then((e) => {
|
|
876
|
+
this.trouves = e ?? [], this.rechercheFaite = !0, this.rechercheEnCours = !1;
|
|
877
|
+
}).catch(() => {
|
|
878
|
+
this.rechercheEnCours = !1;
|
|
879
|
+
}));
|
|
880
|
+
},
|
|
881
|
+
cleReclamant(e) {
|
|
882
|
+
return e ? `${e.type}|${e.id}` : null;
|
|
883
|
+
},
|
|
884
|
+
categorieOf: J,
|
|
885
|
+
iconOf(e) {
|
|
886
|
+
return q.find((t) => t.key === J(e))?.icon ?? "user";
|
|
887
|
+
},
|
|
888
|
+
nomsOf(e) {
|
|
889
|
+
return (e?.individus ?? []).map((e) => [e.nom, e.prenom].filter(Boolean).join(" ")).filter(Boolean).join(", ");
|
|
890
|
+
},
|
|
891
|
+
titreOf(e) {
|
|
892
|
+
if (!e?.individus) return e?.libelle ?? "";
|
|
893
|
+
let t = J(e);
|
|
894
|
+
return t === "locataire" ? e.libelleReclamant || this.nomsOf(e) : t === "demandeur" ? this.nomsOf(e) : e.libelleReclamant;
|
|
895
|
+
},
|
|
896
|
+
referenceOf(e) {
|
|
897
|
+
if (!e?.individus) return "";
|
|
898
|
+
let t = J(e);
|
|
899
|
+
return t === "locataire" ? `Contrat ${e.type}/${e.id}` : t === "demandeur" ? e.libelleReclamant : t === "autre" ? "Individu « Autre »" : "Tiers";
|
|
900
|
+
},
|
|
901
|
+
detailOf(e) {
|
|
902
|
+
let t = e?.individus ?? [];
|
|
903
|
+
if (["tiers", "autre"].includes(J(e))) {
|
|
904
|
+
let e = t[0];
|
|
905
|
+
return e ? [e.telephone, e.mail].filter(Boolean).join(" — ") : "";
|
|
906
|
+
}
|
|
907
|
+
return t.map((e) => {
|
|
908
|
+
let t = [e.nom, e.prenom].filter(Boolean).join(" ");
|
|
909
|
+
return rt[e.role] ? `${t} (${rt[e.role].toLowerCase()})` : t;
|
|
910
|
+
}).join(", ");
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
}, at = {
|
|
914
|
+
key: 0,
|
|
915
|
+
class: "d-flex flex-column gap-3"
|
|
916
|
+
}, ot = { class: "d-flex flex-wrap gap-2" }, st = ["onClick"], ct = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, lt = { class: "min-w-0" }, ut = {
|
|
917
|
+
key: 0,
|
|
918
|
+
class: "badge bg-warning-subtle text-warning-emphasis ms-1"
|
|
919
|
+
}, dt = { class: "text-muted d-block text-truncate" }, ft = { key: 0 }, pt = {
|
|
920
|
+
key: 0,
|
|
921
|
+
class: "text-muted d-block text-truncate"
|
|
922
|
+
}, mt = {
|
|
923
|
+
key: 0,
|
|
924
|
+
class: "text-muted"
|
|
925
|
+
}, ht = {
|
|
926
|
+
key: 0,
|
|
927
|
+
class: "alert alert-primary py-2 px-3 mb-0 fs-7 d-flex align-items-start gap-2"
|
|
928
|
+
}, gt = { class: "min-w-0" }, _t = { class: "fw-semibold" }, vt = {
|
|
929
|
+
key: 0,
|
|
930
|
+
class: "text-truncate"
|
|
931
|
+
}, yt = {
|
|
932
|
+
key: 1,
|
|
933
|
+
class: "text-truncate"
|
|
934
|
+
}, bt = {
|
|
935
|
+
key: 1,
|
|
936
|
+
class: "fs-7 text-danger"
|
|
937
|
+
};
|
|
938
|
+
function xt(e, t, r, c, d, f) {
|
|
939
|
+
let p = S("font-awesome-icon"), h = S("amsom-autocomplete");
|
|
940
|
+
return d.iconsReady ? (g(), o("div", at, [
|
|
941
|
+
s("div", null, [t[1] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Le réclamant est… ", -1), s("div", ot, [(g(!0), o(n, null, b(f.categories, (e) => (g(), o("button", {
|
|
942
|
+
key: e.key,
|
|
943
|
+
type: "button",
|
|
944
|
+
class: m(["btn btn-sm d-inline-flex align-items-center gap-2", d.categorie === e.key ? "btn-primary" : "btn-outline-primary"]),
|
|
945
|
+
onClick: (t) => f.setCategorie(e.key)
|
|
946
|
+
}, [u(p, {
|
|
947
|
+
icon: e.icon,
|
|
948
|
+
"fixed-width": ""
|
|
949
|
+
}, null, 8, ["icon"]), s("span", null, C(e.label), 1)], 10, st))), 128))])]),
|
|
950
|
+
s("div", null, [
|
|
951
|
+
s("label", ct, C(f.categorieCourante.recherche), 1),
|
|
952
|
+
(g(), i(h, {
|
|
953
|
+
key: d.categorie,
|
|
954
|
+
modelValue: f.selectedTrouve,
|
|
955
|
+
"onUpdate:modelValue": t[0] ||= (e) => f.selectedTrouve = e,
|
|
956
|
+
items: d.trouves,
|
|
957
|
+
"filtering-function": ({ items: e }) => e,
|
|
958
|
+
loading: d.rechercheEnCours,
|
|
959
|
+
"get-id": f.cleReclamant,
|
|
960
|
+
"get-input-libelle": (e) => e?.libelle ?? "",
|
|
961
|
+
placeholder: f.categorieCourante.placeholder,
|
|
962
|
+
"input-size": "sm",
|
|
963
|
+
"hide-choices": "",
|
|
964
|
+
"debounce-delay": 0,
|
|
965
|
+
onSearch: f.rechercherPlusTard
|
|
966
|
+
}, {
|
|
967
|
+
options: E((e) => [s("div", lt, [
|
|
968
|
+
s("div", { class: m(["fw-medium text-truncate", e?.estActif ? "" : "text-muted"]) }, [l(C(f.titreOf(e)) + " ", 1), e?.estActif ? a("", !0) : (g(), o("span", ut, C(f.categorieOf(e) === "demandeur" ? "inactive" : "sorti"), 1))], 2),
|
|
969
|
+
s("small", dt, [l(C(f.referenceOf(e)) + " ", 1), e?.adresse ? (g(), o("span", ft, " — " + C(e.adresse), 1)) : a("", !0)]),
|
|
970
|
+
f.detailOf(e) ? (g(), o("small", pt, C(f.detailOf(e)), 1)) : a("", !0)
|
|
971
|
+
])]),
|
|
972
|
+
_: 1
|
|
973
|
+
}, 8, [
|
|
974
|
+
"modelValue",
|
|
975
|
+
"items",
|
|
976
|
+
"filtering-function",
|
|
977
|
+
"loading",
|
|
978
|
+
"get-id",
|
|
979
|
+
"get-input-libelle",
|
|
980
|
+
"placeholder",
|
|
981
|
+
"onSearch"
|
|
982
|
+
])),
|
|
983
|
+
d.rechercheFaite && !d.rechercheEnCours && !d.trouves.length ? (g(), o("small", mt, C(f.categorieCourante.aucun), 1)) : a("", !0)
|
|
984
|
+
]),
|
|
985
|
+
f.selectionne ? (g(), o("div", ht, [u(p, {
|
|
986
|
+
icon: f.iconOf(f.selectionne),
|
|
987
|
+
class: "mt-1"
|
|
988
|
+
}, null, 8, ["icon"]), s("div", gt, [
|
|
989
|
+
s("div", _t, C(f.selectionne.libelle), 1),
|
|
990
|
+
f.selectionne.adresse ? (g(), o("div", vt, C(f.selectionne.adresse), 1)) : a("", !0),
|
|
991
|
+
f.detailOf(f.selectionne) ? (g(), o("div", yt, C(f.detailOf(f.selectionne)), 1)) : a("", !0)
|
|
992
|
+
])])) : (g(), o("div", bt, "Recherchez puis sélectionnez le réclamant."))
|
|
993
|
+
])) : a("", !0);
|
|
994
|
+
}
|
|
995
|
+
var St = /*#__PURE__*/ F(it, [["render", xt]]), Ct = {
|
|
996
|
+
name: "ProvenanceSelecteurBlock",
|
|
997
|
+
setup() {
|
|
998
|
+
return { draft: P() };
|
|
999
|
+
},
|
|
1000
|
+
computed: {
|
|
1001
|
+
provenances() {
|
|
1002
|
+
return ce;
|
|
1003
|
+
},
|
|
1004
|
+
selected() {
|
|
1005
|
+
return this.draft.draft.provenance;
|
|
1006
|
+
},
|
|
1007
|
+
provenanceChoisie() {
|
|
1008
|
+
return this.provenances.find((e) => e.id === this.selected) ?? null;
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
}, wt = {
|
|
1012
|
+
key: 0,
|
|
1013
|
+
class: "fs-7 text-muted"
|
|
1014
|
+
}, Tt = { class: "fw-medium" }, Et = { key: 1 }, Dt = { class: "d-flex flex-wrap gap-2" }, Ot = ["onClick"], kt = {
|
|
1015
|
+
key: 0,
|
|
1016
|
+
class: "fs-7 text-danger mt-1"
|
|
1017
|
+
};
|
|
1018
|
+
function At(e, t, r, c, d, f) {
|
|
1019
|
+
let p = S("font-awesome-icon");
|
|
1020
|
+
return c.draft.isReadonly("provenance") ? (g(), o("div", wt, [t[0] ||= l(" Provenance du contact : ", -1), s("span", Tt, [f.provenanceChoisie?.icon ? (g(), i(p, {
|
|
1021
|
+
key: 0,
|
|
1022
|
+
icon: f.provenanceChoisie.icon,
|
|
1023
|
+
"fixed-width": ""
|
|
1024
|
+
}, null, 8, ["icon"])) : a("", !0), l(" " + C(f.provenanceChoisie?.libelle ?? "—"), 1)])])) : (g(), o("div", Et, [
|
|
1025
|
+
t[1] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, [l(" Provenance du contact "), s("span", { class: "text-danger" }, "*")], -1),
|
|
1026
|
+
s("div", Dt, [(g(!0), o(n, null, b(f.provenances, (e) => (g(), o("button", {
|
|
1027
|
+
key: e.id,
|
|
1028
|
+
type: "button",
|
|
1029
|
+
class: m(["btn btn-sm d-inline-flex align-items-center gap-2", e.id === f.selected ? "btn-primary" : "btn-outline-primary"]),
|
|
1030
|
+
onClick: (t) => c.draft.setProvenance(e.id)
|
|
1031
|
+
}, [u(p, {
|
|
1032
|
+
icon: e.icon,
|
|
1033
|
+
"fixed-width": ""
|
|
1034
|
+
}, null, 8, ["icon"]), s("span", null, C(e.libelle), 1)], 10, Ot))), 128))]),
|
|
1035
|
+
f.selected ? a("", !0) : (g(), o("div", kt, " Sélectionnez par quel canal la sollicitation vous est parvenue. "))
|
|
1036
|
+
]));
|
|
1037
|
+
}
|
|
1038
|
+
var jt = /*#__PURE__*/ F(Ct, [["render", At]]), Mt = {
|
|
1039
|
+
name: "EtapeReclamantBlock",
|
|
1040
|
+
components: {
|
|
1041
|
+
ReclamantRechercheBlock: St,
|
|
1042
|
+
ProvenanceSelecteurBlock: jt
|
|
1043
|
+
},
|
|
1044
|
+
props: { premiere: {
|
|
1045
|
+
type: Boolean,
|
|
1046
|
+
default: !1
|
|
1047
|
+
} },
|
|
1048
|
+
setup() {
|
|
1049
|
+
return { draft: P() };
|
|
1050
|
+
}
|
|
1051
|
+
}, Nt = { class: "d-flex flex-column gap-3" }, Pt = { class: "alert alert-light border py-2 px-3 mb-0 fs-7" };
|
|
1052
|
+
function Ft(e, t, n, r, c, d) {
|
|
1053
|
+
let f = S("provenance-selecteur-block"), p = S("font-awesome-icon"), m = S("reclamant-recherche-block");
|
|
1054
|
+
return g(), o("div", Nt, [n.premiere ? (g(), i(f, { key: 0 })) : a("", !0), x(e.$slots, "reclamant", {
|
|
1055
|
+
reclamant: r.draft.reclamantSelectionne,
|
|
1056
|
+
select: r.draft.selectReclamant
|
|
1057
|
+
}, () => [s("div", Pt, [u(p, {
|
|
1058
|
+
icon: "user",
|
|
1059
|
+
class: "text-primary me-2"
|
|
1060
|
+
}), t[0] ||= l(" Pour qui cette sollicitation est-elle créée\xA0? ", -1)]), u(m)])]);
|
|
1061
|
+
}
|
|
1062
|
+
var It = /*#__PURE__*/ F(Mt, [["render", Ft]]), Lt = Symbol("cresol:options"), Rt = (e) => _(Lt, e), Y = () => f(Lt, {});
|
|
1063
|
+
//#endregion
|
|
1064
|
+
//#region src/utils/text.js
|
|
1065
|
+
function X(e, t = !0) {
|
|
1066
|
+
if (!e) return null;
|
|
1067
|
+
let n = e.toString().normalize("NFD").replace(/[̀-ͯ]/g, "");
|
|
1068
|
+
return t ? n.toLowerCase() : n;
|
|
1069
|
+
}
|
|
1070
|
+
//#endregion
|
|
1071
|
+
//#region src/components/ReclamantSelecteurBlock.vue
|
|
1072
|
+
var zt = {
|
|
1073
|
+
name: "ReclamantSelecteurBlock",
|
|
1074
|
+
components: { AmsomAutocomplete: O },
|
|
1075
|
+
props: {
|
|
1076
|
+
mode: {
|
|
1077
|
+
type: String,
|
|
1078
|
+
default: null
|
|
1079
|
+
},
|
|
1080
|
+
inline: {
|
|
1081
|
+
type: Boolean,
|
|
1082
|
+
default: !0
|
|
1083
|
+
}
|
|
1084
|
+
},
|
|
1085
|
+
setup() {
|
|
1086
|
+
return {
|
|
1087
|
+
draft: P(),
|
|
1088
|
+
options: Y()
|
|
1089
|
+
};
|
|
1090
|
+
},
|
|
1091
|
+
computed: {
|
|
1092
|
+
reclamants() {
|
|
1093
|
+
return this.draft.reclamantsDisponibles;
|
|
1094
|
+
},
|
|
1095
|
+
reclamantSelectionne() {
|
|
1096
|
+
return this.draft.reclamantSelectionne;
|
|
1097
|
+
},
|
|
1098
|
+
presentation() {
|
|
1099
|
+
return this.mode ?? this.options.reclamantMode;
|
|
1100
|
+
},
|
|
1101
|
+
estFige() {
|
|
1102
|
+
return this.reclamants.length <= 1 || this.draft.isReadonly("reclamant");
|
|
1103
|
+
}
|
|
1104
|
+
},
|
|
1105
|
+
methods: {
|
|
1106
|
+
reclamantId(e) {
|
|
1107
|
+
let t = this.reclamants.indexOf(e);
|
|
1108
|
+
return t < 0 ? null : t;
|
|
1109
|
+
},
|
|
1110
|
+
select(e) {
|
|
1111
|
+
this.draft.selectReclamant(e);
|
|
1112
|
+
},
|
|
1113
|
+
filterReclamants({ search: e, items: t }) {
|
|
1114
|
+
let n = (X(e) ?? "").trim();
|
|
1115
|
+
return n ? t.filter((e) => (X(e?.libelle) ?? "").includes(n)) : t;
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
}, Bt = {
|
|
1119
|
+
key: 0,
|
|
1120
|
+
class: "fs-7 text-muted"
|
|
1121
|
+
}, Vt = { class: "fw-medium" }, Ht = {
|
|
1122
|
+
key: 0,
|
|
1123
|
+
class: "btn-group btn-group-sm",
|
|
1124
|
+
role: "group"
|
|
1125
|
+
}, Ut = ["onClick"], Wt = ["value"], Gt = ["value"];
|
|
1126
|
+
function Kt(e, t, r, a, c, u) {
|
|
1127
|
+
let d = S("amsom-autocomplete");
|
|
1128
|
+
return u.estFige ? (g(), o("div", Bt, [t[2] ||= l(" Réclamant : ", -1), s("span", Vt, C(u.reclamantSelectionne?.libelle), 1)])) : (g(), o("div", {
|
|
1129
|
+
key: 1,
|
|
1130
|
+
class: m(r.inline ? "d-flex align-items-center justify-content-between gap-2 border-bottom pb-2" : "d-flex flex-column gap-1")
|
|
1131
|
+
}, [t[3] ||= s("span", { class: "fs-7 fw-semibold text-muted text-uppercase" }, "Réclamant", -1), u.presentation === "switch" ? (g(), o("div", Ht, [(g(!0), o(n, null, b(u.reclamants, (e, t) => (g(), o("button", {
|
|
1132
|
+
key: t,
|
|
1133
|
+
type: "button",
|
|
1134
|
+
class: m(["btn btn-sm py-0", e === u.reclamantSelectionne ? "btn-primary" : "btn-outline-primary"]),
|
|
1135
|
+
onClick: (t) => u.select(e)
|
|
1136
|
+
}, C(e.libelle), 11, Ut))), 128))])) : u.presentation === "autocomplete" ? (g(), i(d, {
|
|
1137
|
+
key: 1,
|
|
1138
|
+
"model-value": u.reclamantSelectionne,
|
|
1139
|
+
items: u.reclamants,
|
|
1140
|
+
"get-id": u.reclamantId,
|
|
1141
|
+
"get-input-libelle": (e) => e?.libelle ?? "",
|
|
1142
|
+
"filtering-function": u.filterReclamants,
|
|
1143
|
+
placeholder: "Rechercher un réclamant…",
|
|
1144
|
+
"input-size": "sm",
|
|
1145
|
+
"hide-choices": "",
|
|
1146
|
+
class: m(r.inline ? "" : "w-100"),
|
|
1147
|
+
"onUpdate:modelValue": t[0] ||= (e) => u.select(e)
|
|
1148
|
+
}, null, 8, [
|
|
1149
|
+
"model-value",
|
|
1150
|
+
"items",
|
|
1151
|
+
"get-id",
|
|
1152
|
+
"get-input-libelle",
|
|
1153
|
+
"filtering-function",
|
|
1154
|
+
"class"
|
|
1155
|
+
])) : (g(), o("select", {
|
|
1156
|
+
key: 2,
|
|
1157
|
+
class: m(["form-select form-select-sm", r.inline ? "w-auto" : ""]),
|
|
1158
|
+
value: u.reclamants.indexOf(u.reclamantSelectionne),
|
|
1159
|
+
onChange: t[1] ||= (e) => u.select(u.reclamants[e.target.value])
|
|
1160
|
+
}, [(g(!0), o(n, null, b(u.reclamants, (e, t) => (g(), o("option", {
|
|
1161
|
+
key: t,
|
|
1162
|
+
value: t
|
|
1163
|
+
}, C(e.libelle), 9, Gt))), 128))], 42, Wt))], 2));
|
|
1164
|
+
}
|
|
1165
|
+
//#endregion
|
|
891
1166
|
//#region src/components/EtapeCategorieBlock.vue
|
|
892
|
-
var
|
|
1167
|
+
var qt = {
|
|
893
1168
|
name: "EtapeCategorieBlock",
|
|
894
1169
|
components: {
|
|
895
1170
|
AmsomOverlay: t,
|
|
896
|
-
AmsomAutocomplete:
|
|
897
|
-
ReclamantSelecteurBlock:
|
|
898
|
-
ProvenanceSelecteurBlock:
|
|
1171
|
+
AmsomAutocomplete: O,
|
|
1172
|
+
ReclamantSelecteurBlock: /* @__PURE__ */ F(zt, [["render", Kt]]),
|
|
1173
|
+
ProvenanceSelecteurBlock: jt
|
|
899
1174
|
},
|
|
900
1175
|
props: { premiere: {
|
|
901
1176
|
type: Boolean,
|
|
@@ -903,9 +1178,9 @@ var Tt = {
|
|
|
903
1178
|
} },
|
|
904
1179
|
setup() {
|
|
905
1180
|
return {
|
|
906
|
-
draft:
|
|
907
|
-
data:
|
|
908
|
-
options:
|
|
1181
|
+
draft: P(),
|
|
1182
|
+
data: K(),
|
|
1183
|
+
options: Y()
|
|
909
1184
|
};
|
|
910
1185
|
},
|
|
911
1186
|
data() {
|
|
@@ -1022,7 +1297,7 @@ var Tt = {
|
|
|
1022
1297
|
});
|
|
1023
1298
|
},
|
|
1024
1299
|
registerIcons() {
|
|
1025
|
-
return
|
|
1300
|
+
return nt([
|
|
1026
1301
|
...this.data.cache.categories ?? [],
|
|
1027
1302
|
...this.data.cache.types ?? [],
|
|
1028
1303
|
...this.data.cache.natures ?? [],
|
|
@@ -1030,11 +1305,11 @@ var Tt = {
|
|
|
1030
1305
|
].map((e) => e.icon));
|
|
1031
1306
|
},
|
|
1032
1307
|
filterMotifs({ search: e, items: t }) {
|
|
1033
|
-
let n = (
|
|
1308
|
+
let n = (X(e) ?? "").trim();
|
|
1034
1309
|
if (!n) return t;
|
|
1035
1310
|
let r = n.split(/\s+/);
|
|
1036
1311
|
return t.filter((e) => {
|
|
1037
|
-
let t =
|
|
1312
|
+
let t = X(`${e.libelle} ${e.categorie} ${e.type} ${e.nature}`) ?? "";
|
|
1038
1313
|
return r.every((e) => t.includes(e));
|
|
1039
1314
|
});
|
|
1040
1315
|
},
|
|
@@ -1057,40 +1332,40 @@ var Tt = {
|
|
|
1057
1332
|
return this.activeMotifs.find((t) => t.id === e)?.libelle ?? e;
|
|
1058
1333
|
}
|
|
1059
1334
|
}
|
|
1060
|
-
},
|
|
1335
|
+
}, Jt = {
|
|
1061
1336
|
key: 0,
|
|
1062
1337
|
class: "d-flex flex-column gap-3"
|
|
1063
|
-
},
|
|
1338
|
+
}, Yt = { key: 2 }, Xt = { class: "d-flex flex-wrap align-items-center gap-2" }, Zt = { class: "badge rounded-pill bg-primary d-inline-flex align-items-center gap-2" }, Qt = { key: 3 }, $t = { class: "d-flex align-items-center gap-2" }, en = { class: "min-w-0" }, tn = { class: "fw-medium text-truncate" }, nn = { class: "text-muted d-block text-truncate" }, rn = {
|
|
1064
1339
|
key: 4,
|
|
1065
1340
|
class: "d-flex align-items-center gap-2 text-muted fs-7"
|
|
1066
|
-
},
|
|
1341
|
+
}, an = {
|
|
1067
1342
|
key: 5,
|
|
1068
1343
|
class: "d-flex flex-wrap align-items-center gap-2"
|
|
1069
|
-
},
|
|
1344
|
+
}, on = ["onClick"], sn = { key: 6 }, cn = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-2" }, ln = { class: "row justify-content-around g-3" }, un = ["title", "onClick"], dn = { class: "fs-7 mt-1 lh-sm" }, fn = {
|
|
1070
1345
|
key: 0,
|
|
1071
1346
|
class: "col-12 text-muted fs-7"
|
|
1072
|
-
},
|
|
1347
|
+
}, pn = [
|
|
1073
1348
|
"id",
|
|
1074
1349
|
"checked",
|
|
1075
1350
|
"disabled",
|
|
1076
1351
|
"onChange"
|
|
1077
|
-
],
|
|
1078
|
-
function
|
|
1352
|
+
], mn = ["for"];
|
|
1353
|
+
function hn(e, t, r, c, d, f) {
|
|
1079
1354
|
let p = S("provenance-selecteur-block"), m = S("reclamant-selecteur-block"), h = S("font-awesome-icon"), _ = S("amsom-autocomplete"), v = S("amsom-overlay");
|
|
1080
1355
|
return g(), i(v, { loading: c.data.isLoading && !c.data.cache.motifs || !d.iconsReady }, {
|
|
1081
|
-
default:
|
|
1356
|
+
default: E(() => [d.iconsReady ? (g(), o("div", Jt, [
|
|
1082
1357
|
r.premiere ? (g(), i(p, { key: 0 })) : a("", !0),
|
|
1083
1358
|
c.options.reclamantMode === "step" ? a("", !0) : (g(), i(m, { key: 1 })),
|
|
1084
|
-
f.motifFige && f.selectionChain.length ? (g(), o("div",
|
|
1359
|
+
f.motifFige && f.selectionChain.length ? (g(), o("div", Yt, [t[1] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Motif", -1), s("div", Xt, [(g(!0), o(n, null, b(f.selectionChain, (e, t) => (g(), o(n, { key: e.level }, [t > 0 ? (g(), i(h, {
|
|
1085
1360
|
key: 0,
|
|
1086
1361
|
icon: "fa-solid fa-chevron-right",
|
|
1087
1362
|
class: "text-muted fs-7"
|
|
1088
|
-
})) : a("", !0), s("span",
|
|
1363
|
+
})) : a("", !0), s("span", Zt, [e.icon ? (g(), i(h, {
|
|
1089
1364
|
key: 0,
|
|
1090
1365
|
icon: e.icon,
|
|
1091
1366
|
"fixed-width": ""
|
|
1092
1367
|
}, null, 8, ["icon"])) : a("", !0), l(" " + C(e.libelle), 1)])], 64))), 128))])])) : a("", !0),
|
|
1093
|
-
f.motifFige ? a("", !0) : (g(), o("div",
|
|
1368
|
+
f.motifFige ? a("", !0) : (g(), o("div", Qt, [t[2] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Rechercher un motif ", -1), u(_, {
|
|
1094
1369
|
modelValue: f.motifRecherche,
|
|
1095
1370
|
"onUpdate:modelValue": t[0] ||= (e) => f.motifRecherche = e,
|
|
1096
1371
|
items: f.allowedMotifs,
|
|
@@ -1102,12 +1377,12 @@ function Kt(e, t, r, c, d, f) {
|
|
|
1102
1377
|
"input-size": "sm",
|
|
1103
1378
|
"hide-choices": ""
|
|
1104
1379
|
}, {
|
|
1105
|
-
options:
|
|
1380
|
+
options: E((e) => [s("div", $t, [e?.icon ? (g(), i(h, {
|
|
1106
1381
|
key: 0,
|
|
1107
1382
|
icon: e.icon,
|
|
1108
1383
|
class: "text-primary",
|
|
1109
1384
|
"fixed-width": ""
|
|
1110
|
-
}, null, 8, ["icon"])) : a("", !0), s("div",
|
|
1385
|
+
}, null, 8, ["icon"])) : a("", !0), s("div", en, [s("div", tn, C(e?.libelle), 1), s("small", nn, C(e?.categorie) + " › " + C(e?.type) + " › " + C(e?.nature), 1)])])]),
|
|
1111
1386
|
_: 1
|
|
1112
1387
|
}, 8, [
|
|
1113
1388
|
"modelValue",
|
|
@@ -1117,12 +1392,12 @@ function Kt(e, t, r, c, d, f) {
|
|
|
1117
1392
|
"get-input-libelle-from-id",
|
|
1118
1393
|
"filtering-function"
|
|
1119
1394
|
])])),
|
|
1120
|
-
f.motifFige ? a("", !0) : (g(), o("div",
|
|
1395
|
+
f.motifFige ? a("", !0) : (g(), o("div", rn, [...t[3] ||= [
|
|
1121
1396
|
s("hr", { class: "flex-grow-1 my-0" }, null, -1),
|
|
1122
1397
|
s("span", null, "ou sélection guidée", -1),
|
|
1123
1398
|
s("hr", { class: "flex-grow-1 my-0" }, null, -1)
|
|
1124
1399
|
]])),
|
|
1125
|
-
!f.motifFige && f.selectionChain.length ? (g(), o("div",
|
|
1400
|
+
!f.motifFige && f.selectionChain.length ? (g(), o("div", an, [(g(!0), o(n, null, b(f.selectionChain, (e, t) => (g(), o(n, { key: e.level }, [t > 0 ? (g(), i(h, {
|
|
1126
1401
|
key: 0,
|
|
1127
1402
|
icon: "fa-solid fa-chevron-right",
|
|
1128
1403
|
class: "text-muted fs-7"
|
|
@@ -1141,8 +1416,8 @@ function Kt(e, t, r, c, d, f) {
|
|
|
1141
1416
|
icon: "fa-solid fa-xmark",
|
|
1142
1417
|
class: "fs-7 opacity-75"
|
|
1143
1418
|
})
|
|
1144
|
-
], 8,
|
|
1145
|
-
!f.motifFige && f.currentLevel ? (g(), o("div",
|
|
1419
|
+
], 8, on)], 64))), 128))])) : a("", !0),
|
|
1420
|
+
!f.motifFige && f.currentLevel ? (g(), o("div", sn, [s("label", cn, C(f.currentLevel.title), 1), s("div", ln, [(g(!0), o(n, null, b(f.currentLevel.options, (e) => (g(), o("div", {
|
|
1146
1421
|
key: e.id,
|
|
1147
1422
|
class: "col-3 text-center"
|
|
1148
1423
|
}, [s("button", {
|
|
@@ -1154,7 +1429,7 @@ function Kt(e, t, r, c, d, f) {
|
|
|
1154
1429
|
key: 0,
|
|
1155
1430
|
icon: e.icon,
|
|
1156
1431
|
size: "lg"
|
|
1157
|
-
}, null, 8, ["icon"])) : a("", !0)], 8,
|
|
1432
|
+
}, null, 8, ["icon"])) : a("", !0)], 8, un), s("div", dn, C(e.libelle), 1)]))), 128)), f.currentLevel.options.length ? a("", !0) : (g(), o("div", fn, " Aucun choix disponible "))])])) : a("", !0),
|
|
1158
1433
|
f.motifsAssocies.length ? (g(), o(n, { key: 7 }, [t[4] ||= s("div", { class: "d-flex align-items-center gap-2 text-muted fs-7" }, [
|
|
1159
1434
|
s("hr", { class: "flex-grow-1 my-0" }),
|
|
1160
1435
|
s("span", null, "Autres motifs liés"),
|
|
@@ -1169,15 +1444,15 @@ function Kt(e, t, r, c, d, f) {
|
|
|
1169
1444
|
checked: f.isActive(e.idMotif),
|
|
1170
1445
|
disabled: f.motifFige,
|
|
1171
1446
|
onChange: (t) => f.toggleMotifAssocie(e)
|
|
1172
|
-
}, null, 40,
|
|
1447
|
+
}, null, 40, pn), s("label", {
|
|
1173
1448
|
class: "form-check-label fs-7",
|
|
1174
1449
|
for: `assoc-${e.idMotif}`
|
|
1175
|
-
}, C(e.libelle) + " ? ", 9,
|
|
1450
|
+
}, C(e.libelle) + " ? ", 9, mn)]))), 128))], 64)) : a("", !0)
|
|
1176
1451
|
])) : a("", !0)]),
|
|
1177
1452
|
_: 1
|
|
1178
1453
|
}, 8, ["loading"]);
|
|
1179
1454
|
}
|
|
1180
|
-
var
|
|
1455
|
+
var gn = /*#__PURE__*/ F(qt, [["render", hn]]), _n = {
|
|
1181
1456
|
B: "briefcase",
|
|
1182
1457
|
M: "store",
|
|
1183
1458
|
W: "dungeon",
|
|
@@ -1187,17 +1462,17 @@ var qt = /*#__PURE__*/ L(Tt, [["render", Kt]]), Jt = {
|
|
|
1187
1462
|
S: "square-parking",
|
|
1188
1463
|
V: "hands-holding"
|
|
1189
1464
|
};
|
|
1190
|
-
function
|
|
1191
|
-
return e === "L" ? t ? "building" : "house" :
|
|
1465
|
+
function vn(e, t = !1, n = "circle-question") {
|
|
1466
|
+
return e === "L" ? t ? "building" : "house" : _n[e] ?? n;
|
|
1192
1467
|
}
|
|
1193
|
-
function
|
|
1468
|
+
function yn(e) {
|
|
1194
1469
|
return e ? e.idCategorieModule === "L" ? e.estCollectif ? "Appartement" : "Maison" : e.categorieModule ?? "" : "";
|
|
1195
1470
|
}
|
|
1196
1471
|
//#endregion
|
|
1197
1472
|
//#region src/components/CiblePickerBlock.vue
|
|
1198
|
-
var
|
|
1473
|
+
var bn = 0, xn = {
|
|
1199
1474
|
name: "CiblePickerBlock",
|
|
1200
|
-
components: { AmsomAutocomplete:
|
|
1475
|
+
components: { AmsomAutocomplete: O },
|
|
1201
1476
|
props: {
|
|
1202
1477
|
patrimoine: {
|
|
1203
1478
|
type: Object,
|
|
@@ -1243,11 +1518,11 @@ var Zt = 0, Qt = {
|
|
|
1243
1518
|
"toggle-reprendre-locataire-actuel"
|
|
1244
1519
|
],
|
|
1245
1520
|
setup() {
|
|
1246
|
-
return { data:
|
|
1521
|
+
return { data: K() };
|
|
1247
1522
|
},
|
|
1248
1523
|
data() {
|
|
1249
1524
|
return {
|
|
1250
|
-
uid: ++
|
|
1525
|
+
uid: ++bn,
|
|
1251
1526
|
rechercheContrat: "",
|
|
1252
1527
|
contratsTrouves: [],
|
|
1253
1528
|
rechercheEnCours: !1,
|
|
@@ -1263,12 +1538,12 @@ var Zt = 0, Qt = {
|
|
|
1263
1538
|
aide: "Cible la demande elle-même (sans localisation)."
|
|
1264
1539
|
}] : [{
|
|
1265
1540
|
key: "contrat",
|
|
1266
|
-
label: "
|
|
1541
|
+
label: "Un contrat",
|
|
1267
1542
|
icon: "file-signature",
|
|
1268
1543
|
aide: "Cible un contrat et l’un de ses modules."
|
|
1269
1544
|
}, {
|
|
1270
1545
|
key: "patrimoine",
|
|
1271
|
-
label: "
|
|
1546
|
+
label: "Du patrimoine",
|
|
1272
1547
|
icon: "building",
|
|
1273
1548
|
aide: "Une adresse seule pour une partie commune, un module pour un logement précis."
|
|
1274
1549
|
}];
|
|
@@ -1395,16 +1670,16 @@ var Zt = 0, Qt = {
|
|
|
1395
1670
|
},
|
|
1396
1671
|
filterOn(e) {
|
|
1397
1672
|
return ({ search: t, items: n }) => {
|
|
1398
|
-
let r = (
|
|
1399
|
-
return r ? n.filter((t) => (
|
|
1673
|
+
let r = (X(t) ?? "").trim();
|
|
1674
|
+
return r ? n.filter((t) => (X(t?.[e]) ?? "").includes(r)) : n;
|
|
1400
1675
|
};
|
|
1401
1676
|
},
|
|
1402
1677
|
filterModules({ search: e, items: t }) {
|
|
1403
|
-
let n = (
|
|
1404
|
-
return n ? t.filter((e) => (
|
|
1678
|
+
let n = (X(e) ?? "").trim();
|
|
1679
|
+
return n ? t.filter((e) => (X(this.moduleInputLibelle(e)) ?? "").includes(n) || (X(e?._autreLibelle) ?? "").includes(n)) : t;
|
|
1405
1680
|
},
|
|
1406
|
-
getCategorieModuleIcon:
|
|
1407
|
-
categorieLibelle:
|
|
1681
|
+
getCategorieModuleIcon: vn,
|
|
1682
|
+
categorieLibelle: yn,
|
|
1408
1683
|
moduleLibelle(e) {
|
|
1409
1684
|
return e ? e.libelleModule ?? e.adresse ?? `Module ${e.idModule}` : "";
|
|
1410
1685
|
},
|
|
@@ -1416,40 +1691,40 @@ var Zt = 0, Qt = {
|
|
|
1416
1691
|
return !!e?.dateFin && e.dateFin < Math.floor(Date.now() / 1e3);
|
|
1417
1692
|
}
|
|
1418
1693
|
}
|
|
1419
|
-
},
|
|
1694
|
+
}, Sn = { class: "d-flex flex-column gap-3" }, Cn = {
|
|
1420
1695
|
class: "btn-group w-100",
|
|
1421
1696
|
role: "group"
|
|
1422
|
-
},
|
|
1697
|
+
}, wn = ["onClick"], Tn = { class: "text-muted d-block mt-1" }, En = {
|
|
1423
1698
|
key: 0,
|
|
1424
1699
|
class: "form-check"
|
|
1425
|
-
},
|
|
1700
|
+
}, Dn = ["id", "checked"], On = ["for"], kn = { key: 1 }, An = { class: "min-w-0" }, jn = { class: "fw-medium text-truncate text-capitalize" }, Mn = { class: "text-muted d-block text-truncate" }, Nn = { key: 0 }, Pn = {
|
|
1426
1701
|
key: 1,
|
|
1427
1702
|
class: "text-warning"
|
|
1428
|
-
},
|
|
1703
|
+
}, Fn = { class: "min-w-0" }, In = { class: "fw-medium text-truncate" }, Ln = { class: "text-muted d-block text-truncate" }, Rn = {
|
|
1429
1704
|
key: 2,
|
|
1430
1705
|
class: "row g-2"
|
|
1431
|
-
},
|
|
1706
|
+
}, zn = { class: "col-12 col-md-5" }, Bn = ["value"], Vn = { class: "col-12 col-md-5" }, Hn = ["value"], Un = { class: "col-12 col-md-2" }, Wn = ["value"], Gn = { key: 3 }, Kn = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, qn = {
|
|
1432
1707
|
key: 0,
|
|
1433
1708
|
class: "text-lowercase fw-normal"
|
|
1434
|
-
},
|
|
1709
|
+
}, Jn = { class: "d-flex flex-wrap align-items-center gap-1" }, Yn = ["title"], Xn = { class: "text-muted" }, Zn = {
|
|
1435
1710
|
key: 1,
|
|
1436
1711
|
class: "d-block text-truncate"
|
|
1437
|
-
},
|
|
1712
|
+
}, Qn = {
|
|
1438
1713
|
key: 2,
|
|
1439
1714
|
class: "text-muted d-block"
|
|
1440
|
-
},
|
|
1715
|
+
}, $n = {
|
|
1441
1716
|
key: 0,
|
|
1442
1717
|
class: "text-muted d-block"
|
|
1443
|
-
},
|
|
1718
|
+
}, er = {
|
|
1444
1719
|
key: 1,
|
|
1445
1720
|
class: "mt-2 d-flex flex-column gap-2"
|
|
1446
|
-
},
|
|
1447
|
-
function
|
|
1721
|
+
}, tr = { class: "form-check mb-0 ms-3" }, nr = ["id", "checked"], rr = ["for"];
|
|
1722
|
+
function ir(e, t, r, c, d, f) {
|
|
1448
1723
|
let p = S("font-awesome-icon"), h = S("amsom-autocomplete");
|
|
1449
|
-
return g(), o("div",
|
|
1724
|
+
return g(), o("div", Sn, [
|
|
1450
1725
|
s("div", null, [
|
|
1451
1726
|
t[7] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " La sollicitation concerne… ", -1),
|
|
1452
|
-
s("div",
|
|
1727
|
+
s("div", Cn, [(g(!0), o(n, null, b(f.availableModes, (t) => (g(), o("button", {
|
|
1453
1728
|
key: t.key,
|
|
1454
1729
|
type: "button",
|
|
1455
1730
|
class: m(["btn btn-sm", r.cibleMode === t.key ? "btn-primary" : "btn-outline-primary"]),
|
|
@@ -1457,19 +1732,19 @@ function In(e, t, r, c, d, f) {
|
|
|
1457
1732
|
}, [u(p, {
|
|
1458
1733
|
icon: t.icon,
|
|
1459
1734
|
class: "me-1"
|
|
1460
|
-
}, null, 8, ["icon"]), l(" " + C(t.label), 1)], 10,
|
|
1461
|
-
s("small",
|
|
1735
|
+
}, null, 8, ["icon"]), l(" " + C(t.label), 1)], 10, wn))), 128))]),
|
|
1736
|
+
s("small", Tn, C(f.currentMode?.aide), 1)
|
|
1462
1737
|
]),
|
|
1463
|
-
r.cibleMode === "contrat" ? (g(), o(n, { key: 0 }, [r.afficheCaseContratReclamant ? (g(), o("div",
|
|
1738
|
+
r.cibleMode === "contrat" ? (g(), o(n, { key: 0 }, [r.afficheCaseContratReclamant ? (g(), o("div", En, [s("input", {
|
|
1464
1739
|
id: `contrat-reclamant-${d.uid}`,
|
|
1465
1740
|
class: "form-check-input",
|
|
1466
1741
|
type: "checkbox",
|
|
1467
1742
|
checked: r.contratReclamant,
|
|
1468
1743
|
onChange: t[0] ||= (t) => e.$emit("toggle-contrat-reclamant", t.target.checked)
|
|
1469
|
-
}, null, 40,
|
|
1744
|
+
}, null, 40, Dn), s("label", {
|
|
1470
1745
|
class: "form-check-label fs-7",
|
|
1471
1746
|
for: `contrat-reclamant-${d.uid}`
|
|
1472
|
-
}, " Contrat du réclamant ", 8,
|
|
1747
|
+
}, " Contrat du réclamant ", 8, On)])) : a("", !0), r.contratReclamant ? a("", !0) : (g(), o("div", kn, [t[8] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Contrat ciblé ", -1), u(h, {
|
|
1473
1748
|
modelValue: f.selectedContrat,
|
|
1474
1749
|
"onUpdate:modelValue": t[1] ||= (e) => f.selectedContrat = e,
|
|
1475
1750
|
items: d.contratsTrouves,
|
|
@@ -1483,10 +1758,10 @@ function In(e, t, r, c, d, f) {
|
|
|
1483
1758
|
"debounce-delay": 0,
|
|
1484
1759
|
onSearch: f.rechercherPlusTard
|
|
1485
1760
|
}, {
|
|
1486
|
-
options:
|
|
1761
|
+
options: E((e) => [s("div", An, [s("div", jn, C(e?.libelle ?? `Contrat ${e?.idContrat}`), 1), s("small", Mn, [
|
|
1487
1762
|
l(C(e?.typeContrat) + "/" + C(e?.idContrat) + " ", 1),
|
|
1488
|
-
e?.nbModules > 1 ? (g(), o("span",
|
|
1489
|
-
e?.estSorti ? (g(), o("span",
|
|
1763
|
+
e?.nbModules > 1 ? (g(), o("span", Nn, " — " + C(e.nbModules) + " modules", 1)) : a("", !0),
|
|
1764
|
+
e?.estSorti ? (g(), o("span", Pn, " — sorti")) : a("", !0)
|
|
1490
1765
|
])])]),
|
|
1491
1766
|
_: 1
|
|
1492
1767
|
}, 8, [
|
|
@@ -1528,7 +1803,7 @@ function In(e, t, r, c, d, f) {
|
|
|
1528
1803
|
"input-size": "sm",
|
|
1529
1804
|
"hide-choices": ""
|
|
1530
1805
|
}, {
|
|
1531
|
-
options:
|
|
1806
|
+
options: E((e) => [s("div", Fn, [s("div", In, C(e?.entree), 1), s("small", Ln, C(e?.commune) + " — Programme " + C(e?.codeProgramme), 1)])]),
|
|
1532
1807
|
_: 1
|
|
1533
1808
|
}, 8, [
|
|
1534
1809
|
"modelValue",
|
|
@@ -1556,25 +1831,25 @@ function In(e, t, r, c, d, f) {
|
|
|
1556
1831
|
"disabled"
|
|
1557
1832
|
])])
|
|
1558
1833
|
], 64)) : a("", !0),
|
|
1559
|
-
r.cibleMode === "contrat" ? (g(), o("div",
|
|
1560
|
-
s("div",
|
|
1834
|
+
r.cibleMode === "contrat" ? (g(), o("div", Rn, [
|
|
1835
|
+
s("div", zn, [t[12] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Commune", -1), s("input", {
|
|
1561
1836
|
class: "form-control form-control-sm",
|
|
1562
1837
|
disabled: "",
|
|
1563
1838
|
value: r.patrimoine.commune ?? "—"
|
|
1564
|
-
}, null, 8,
|
|
1565
|
-
s("div",
|
|
1839
|
+
}, null, 8, Bn)]),
|
|
1840
|
+
s("div", Vn, [t[13] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Adresse", -1), s("input", {
|
|
1566
1841
|
class: "form-control form-control-sm",
|
|
1567
1842
|
disabled: "",
|
|
1568
1843
|
value: r.patrimoine.entree ?? "—"
|
|
1569
|
-
}, null, 8,
|
|
1570
|
-
s("div",
|
|
1844
|
+
}, null, 8, Hn)]),
|
|
1845
|
+
s("div", Un, [t[14] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Étage", -1), s("input", {
|
|
1571
1846
|
class: "form-control form-control-sm",
|
|
1572
1847
|
disabled: "",
|
|
1573
1848
|
value: r.patrimoine.etage ?? "—"
|
|
1574
|
-
}, null, 8,
|
|
1849
|
+
}, null, 8, Wn)])
|
|
1575
1850
|
])) : a("", !0),
|
|
1576
|
-
r.cibleMode === "contrat" || r.cibleMode === "patrimoine" ? (g(), o("div",
|
|
1577
|
-
s("label",
|
|
1851
|
+
r.cibleMode === "contrat" || r.cibleMode === "patrimoine" ? (g(), o("div", Gn, [
|
|
1852
|
+
s("label", Kn, [t[15] ||= l(" Module ", -1), r.cibleMode === "patrimoine" ? (g(), o("span", qn, "(facultatif)")) : a("", !0)]),
|
|
1578
1853
|
u(h, {
|
|
1579
1854
|
modelValue: f.selectedModule,
|
|
1580
1855
|
"onUpdate:modelValue": t[5] ||= (e) => f.selectedModule = e,
|
|
@@ -1587,7 +1862,7 @@ function In(e, t, r, c, d, f) {
|
|
|
1587
1862
|
"input-size": "sm",
|
|
1588
1863
|
"hide-choices": ""
|
|
1589
1864
|
}, {
|
|
1590
|
-
options:
|
|
1865
|
+
options: E((e) => [s("div", { class: m(["min-w-0 w-100 rounded position-relative", e?._autreLibelle ? "bg-yellow-subtle p-2" : ""]) }, [
|
|
1591
1866
|
e?._autreLibelle ? (g(), i(p, {
|
|
1592
1867
|
key: 0,
|
|
1593
1868
|
icon: "building",
|
|
@@ -1595,12 +1870,12 @@ function In(e, t, r, c, d, f) {
|
|
|
1595
1870
|
title: "Autre adresse ou étage du même programme"
|
|
1596
1871
|
})) : a("", !0),
|
|
1597
1872
|
s("div", { class: m(["fw-medium text-truncate", [e?._autreLibelle ? "text-muted" : "", f.isExit(e) ? "text-decoration-line-through" : ""]]) }, C(f.moduleLibelle(e)), 3),
|
|
1598
|
-
s("div",
|
|
1873
|
+
s("div", Jn, [f.categorieLibelle(e) ? (g(), o("span", {
|
|
1599
1874
|
key: 0,
|
|
1600
1875
|
class: "badge bg-info",
|
|
1601
1876
|
title: e?.categorieModule
|
|
1602
|
-
}, [u(p, { icon: f.getCategorieModuleIcon(e?.idCategorieModule, e?.estCollectif) }, null, 8, ["icon"])], 8,
|
|
1603
|
-
e?._autreLibelle ? (g(), o("small",
|
|
1877
|
+
}, [u(p, { icon: f.getCategorieModuleIcon(e?.idCategorieModule, e?.estCollectif) }, null, 8, ["icon"])], 8, Yn)) : a("", !0), s("small", Xn, "N° " + C(e?.idModule), 1)]),
|
|
1878
|
+
e?._autreLibelle ? (g(), o("small", Zn, C(e._autreLibelle), 1)) : e?.etage == null ? a("", !0) : (g(), o("small", Qn, " Étage " + C(e.etage), 1))
|
|
1604
1879
|
], 2)]),
|
|
1605
1880
|
_: 1
|
|
1606
1881
|
}, 8, [
|
|
@@ -1611,36 +1886,36 @@ function In(e, t, r, c, d, f) {
|
|
|
1611
1886
|
"filtering-function",
|
|
1612
1887
|
"disabled"
|
|
1613
1888
|
]),
|
|
1614
|
-
r.cibleMode === "patrimoine" && !r.patrimoine.idModule ? (g(), o("small",
|
|
1615
|
-
r.locataireActuelOption ? (g(), o("div",
|
|
1889
|
+
r.cibleMode === "patrimoine" && !r.patrimoine.idModule ? (g(), o("small", $n, " Sans module, la sollicitation cible la partie commune de l’adresse. ")) : a("", !0),
|
|
1890
|
+
r.locataireActuelOption ? (g(), o("div", er, [s("div", { class: m(["alert d-flex align-items-start gap-2 py-2 px-3 mt-2 mb-0 fs-7", r.locataireActuelOption.reprendre ? "alert-warning" : "alert-secondary border"]) }, [u(p, {
|
|
1616
1891
|
icon: "circle-info",
|
|
1617
1892
|
class: "mt-1"
|
|
1618
|
-
}), s("span", null, C(r.locataireActuelOption.hint), 1)], 2), s("div",
|
|
1893
|
+
}), s("span", null, C(r.locataireActuelOption.hint), 1)], 2), s("div", tr, [s("input", {
|
|
1619
1894
|
id: `locataire-actuel-${d.uid}`,
|
|
1620
1895
|
class: "form-check-input",
|
|
1621
1896
|
type: "checkbox",
|
|
1622
1897
|
checked: r.locataireActuelOption.reprendre,
|
|
1623
1898
|
onChange: t[6] ||= (t) => e.$emit("toggle-reprendre-locataire-actuel", t.target.checked)
|
|
1624
|
-
}, null, 40,
|
|
1899
|
+
}, null, 40, nr), s("label", {
|
|
1625
1900
|
class: "form-check-label fs-7",
|
|
1626
1901
|
for: `locataire-actuel-${d.uid}`
|
|
1627
|
-
}, " Rattacher au locataire actuel du module ", 8,
|
|
1902
|
+
}, " Rattacher au locataire actuel du module ", 8, rr)])])) : a("", !0)
|
|
1628
1903
|
])) : a("", !0)
|
|
1629
1904
|
]);
|
|
1630
1905
|
}
|
|
1631
1906
|
//#endregion
|
|
1632
1907
|
//#region src/components/EtapeCibleBlock.vue
|
|
1633
|
-
var
|
|
1908
|
+
var ar = {
|
|
1634
1909
|
name: "EtapeCibleBlock",
|
|
1635
1910
|
components: {
|
|
1636
1911
|
AmsomOverlay: t,
|
|
1637
|
-
CiblePickerBlock: /* @__PURE__ */
|
|
1912
|
+
CiblePickerBlock: /* @__PURE__ */ F(xn, [["render", ir]])
|
|
1638
1913
|
},
|
|
1639
1914
|
setup() {
|
|
1640
1915
|
return {
|
|
1641
|
-
draft:
|
|
1642
|
-
data:
|
|
1643
|
-
options:
|
|
1916
|
+
draft: P(),
|
|
1917
|
+
data: K(),
|
|
1918
|
+
options: Y()
|
|
1644
1919
|
};
|
|
1645
1920
|
},
|
|
1646
1921
|
computed: {
|
|
@@ -1739,32 +2014,32 @@ var Ln = {
|
|
|
1739
2014
|
e === "contrat" ? this.draft.prefillFromModule(t, this.mainModule) : this.mainModule && (this.draft.prefillFromModule(t, this.mainModule), this.mainModule.idCommune != null && await this.data.loadAdresses(this.mainModule.idCommune), this.mainModule.codeProgramme != null && await this.data.loadModulesOfProgramme(this.mainModule.codeProgramme));
|
|
1740
2015
|
}
|
|
1741
2016
|
}
|
|
1742
|
-
},
|
|
2017
|
+
}, or = { class: "d-flex flex-column gap-3" }, sr = {
|
|
1743
2018
|
key: 0,
|
|
1744
2019
|
class: "alert alert-light border py-2 px-3 mb-0 d-flex align-items-center gap-2"
|
|
1745
|
-
},
|
|
2020
|
+
}, cr = { class: "fs-7" }, lr = {
|
|
1746
2021
|
key: 1,
|
|
1747
2022
|
class: "d-flex flex-column gap-1"
|
|
1748
|
-
},
|
|
2023
|
+
}, ur = {
|
|
1749
2024
|
key: 0,
|
|
1750
2025
|
class: "text-muted me-1"
|
|
1751
|
-
},
|
|
2026
|
+
}, dr = { class: "d-flex align-items-center gap-2" }, fr = { class: "fw-medium fs-7" }, pr = { class: "form-check form-switch mb-0" }, mr = [
|
|
1752
2027
|
"id",
|
|
1753
2028
|
"checked",
|
|
1754
2029
|
"onChange"
|
|
1755
|
-
],
|
|
2030
|
+
], hr = ["for"], gr = {
|
|
1756
2031
|
key: 0,
|
|
1757
2032
|
class: "mt-2"
|
|
1758
2033
|
};
|
|
1759
|
-
function
|
|
2034
|
+
function _r(e, t, r, c, d, f) {
|
|
1760
2035
|
let m = S("font-awesome-icon"), h = S("cible-picker-block"), _ = S("amsom-overlay");
|
|
1761
2036
|
return g(), i(_, { loading: c.data.isLoading }, {
|
|
1762
|
-
default:
|
|
1763
|
-
f.motifLibelle ? (g(), o("div",
|
|
2037
|
+
default: E(() => [s("div", or, [
|
|
2038
|
+
f.motifLibelle ? (g(), o("div", sr, [u(m, {
|
|
1764
2039
|
icon: "tag",
|
|
1765
2040
|
class: "text-primary"
|
|
1766
|
-
}), s("span",
|
|
1767
|
-
f.cibleFigee ? (g(), o("div",
|
|
2041
|
+
}), s("span", cr, [t[8] ||= s("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Motif", -1), l(C(f.motifLibelle), 1)])])) : a("", !0),
|
|
2042
|
+
f.cibleFigee ? (g(), o("div", lr, [(g(!0), o(n, null, b(c.draft.draft.lignes, (e, t) => (g(), o("span", {
|
|
1768
2043
|
key: t,
|
|
1769
2044
|
class: "fs-7"
|
|
1770
2045
|
}, [
|
|
@@ -1772,7 +2047,7 @@ function Yn(e, t, r, c, d, f) {
|
|
|
1772
2047
|
icon: "location-dot",
|
|
1773
2048
|
class: "text-primary me-2"
|
|
1774
2049
|
}),
|
|
1775
|
-
f.lignesAssociees.length ? (g(), o("span",
|
|
2050
|
+
f.lignesAssociees.length ? (g(), o("span", ur, C(t === 0 ? f.motifLibelle : e.libelle) + " : ", 1)) : a("", !0),
|
|
1776
2051
|
l(" " + C(c.draft.cibleResume(e)), 1)
|
|
1777
2052
|
]))), 128))])) : (g(), i(h, p({ key: 2 }, f.pickerProps(f.lignePrincipale), {
|
|
1778
2053
|
onChangeMode: t[0] ||= (e) => f.onChangeMode(e),
|
|
@@ -1791,16 +2066,16 @@ function Yn(e, t, r, c, d, f) {
|
|
|
1791
2066
|
], -1), (g(!0), o(n, null, b(f.lignesAssociees, (e, t) => (g(), o("div", {
|
|
1792
2067
|
key: e.idMotif,
|
|
1793
2068
|
class: "border rounded p-2"
|
|
1794
|
-
}, [s("div",
|
|
2069
|
+
}, [s("div", dr, [s("span", fr, C(e.libelle), 1), s("div", pr, [s("input", {
|
|
1795
2070
|
id: `memecible-${e.idMotif}`,
|
|
1796
2071
|
class: "form-check-input",
|
|
1797
2072
|
type: "checkbox",
|
|
1798
2073
|
checked: !e.patrimoine,
|
|
1799
2074
|
onChange: (e) => c.draft.toggleCibleOverride(t + 1)
|
|
1800
|
-
}, null, 40,
|
|
2075
|
+
}, null, 40, mr), s("label", {
|
|
1801
2076
|
class: "form-check-label fs-7",
|
|
1802
2077
|
for: `memecible-${e.idMotif}`
|
|
1803
|
-
}, " Même cible que la ligne principale ", 8,
|
|
2078
|
+
}, " Même cible que la ligne principale ", 8, hr)])]), e.patrimoine ? (g(), o("div", gr, [u(h, p({ ref_for: !0 }, f.pickerProps(e), {
|
|
1804
2079
|
onChangeMode: (e) => f.onChangeMode(e, t + 1),
|
|
1805
2080
|
onSelectCommune: (e) => f.onSelectCommune(e, t + 1),
|
|
1806
2081
|
onSelectAdresse: (e) => f.onSelectAdresse(e, t + 1),
|
|
@@ -1823,9 +2098,9 @@ function Yn(e, t, r, c, d, f) {
|
|
|
1823
2098
|
_: 1
|
|
1824
2099
|
}, 8, ["loading"]);
|
|
1825
2100
|
}
|
|
1826
|
-
var
|
|
2101
|
+
var vr = /*#__PURE__*/ F(ar, [["render", _r]]), yr = {
|
|
1827
2102
|
name: "LigneDocumentBlock",
|
|
1828
|
-
components: { AmsomUploadFile:
|
|
2103
|
+
components: { AmsomUploadFile: se },
|
|
1829
2104
|
props: {
|
|
1830
2105
|
index: {
|
|
1831
2106
|
type: Number,
|
|
@@ -1842,7 +2117,7 @@ var Xn = /*#__PURE__*/ L(Ln, [["render", Yn]]), Zn = {
|
|
|
1842
2117
|
},
|
|
1843
2118
|
emits: ["update"]
|
|
1844
2119
|
};
|
|
1845
|
-
function
|
|
2120
|
+
function br(e, t, n, r, i, a) {
|
|
1846
2121
|
let c = S("amsom-upload-file");
|
|
1847
2122
|
return g(), o("div", null, [t[1] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Document", -1), u(c, {
|
|
1848
2123
|
"model-value": n.fichier,
|
|
@@ -1858,23 +2133,23 @@ function Qn(e, t, n, r, i, a) {
|
|
|
1858
2133
|
"read-only"
|
|
1859
2134
|
])]);
|
|
1860
2135
|
}
|
|
1861
|
-
var
|
|
2136
|
+
var xr = /*#__PURE__*/ F(yr, [["render", br]]);
|
|
1862
2137
|
//#endregion
|
|
1863
2138
|
//#region src/utils/date.js
|
|
1864
|
-
function
|
|
2139
|
+
function Sr(e) {
|
|
1865
2140
|
return e == null ? "" : (/* @__PURE__ */ new Date(e * 1e3)).toISOString().slice(0, 10);
|
|
1866
2141
|
}
|
|
1867
|
-
function
|
|
2142
|
+
function Cr(e) {
|
|
1868
2143
|
return e ? Math.floor(new Date(e).getTime() / 1e3) : null;
|
|
1869
2144
|
}
|
|
1870
2145
|
//#endregion
|
|
1871
2146
|
//#region src/components/LigneDetailBlock.vue
|
|
1872
|
-
var
|
|
2147
|
+
var wr = 4e3, Tr = {
|
|
1873
2148
|
name: "LigneDetailBlock",
|
|
1874
2149
|
components: {
|
|
1875
|
-
AmsomAutocomplete:
|
|
1876
|
-
AmsomTextarea:
|
|
1877
|
-
LigneDocumentBlock:
|
|
2150
|
+
AmsomAutocomplete: O,
|
|
2151
|
+
AmsomTextarea: oe,
|
|
2152
|
+
LigneDocumentBlock: xr
|
|
1878
2153
|
},
|
|
1879
2154
|
props: { index: {
|
|
1880
2155
|
type: Number,
|
|
@@ -1882,12 +2157,12 @@ var nr = 4e3, rr = {
|
|
|
1882
2157
|
} },
|
|
1883
2158
|
setup() {
|
|
1884
2159
|
return {
|
|
1885
|
-
draft:
|
|
1886
|
-
data:
|
|
2160
|
+
draft: P(),
|
|
2161
|
+
data: K()
|
|
1887
2162
|
};
|
|
1888
2163
|
},
|
|
1889
2164
|
computed: {
|
|
1890
|
-
descriptionMaxLength: () =>
|
|
2165
|
+
descriptionMaxLength: () => wr,
|
|
1891
2166
|
isPrincipale() {
|
|
1892
2167
|
return this.index === 0;
|
|
1893
2168
|
},
|
|
@@ -1905,64 +2180,64 @@ var nr = 4e3, rr = {
|
|
|
1905
2180
|
}
|
|
1906
2181
|
},
|
|
1907
2182
|
methods: {
|
|
1908
|
-
timestampToDateInput:
|
|
1909
|
-
dateInputToTimestamp:
|
|
2183
|
+
timestampToDateInput: Sr,
|
|
2184
|
+
dateInputToTimestamp: Cr,
|
|
1910
2185
|
responsableLibelle(e) {
|
|
1911
2186
|
let t = e && typeof e != "object" ? this.collaborateurs.find((t) => String(t.id) === String(e)) : e;
|
|
1912
2187
|
return t ? `${t.prenom} ${t.nom}` : "";
|
|
1913
2188
|
},
|
|
1914
2189
|
filterCollaborateurs({ search: e, items: t }) {
|
|
1915
|
-
let n = (
|
|
1916
|
-
return n ? t.filter((e) => (
|
|
2190
|
+
let n = (X(e) ?? "").trim();
|
|
2191
|
+
return n ? t.filter((e) => (X(`${e.prenom} ${e.nom} ${e.service}`) ?? "").includes(n)) : t;
|
|
1917
2192
|
}
|
|
1918
2193
|
}
|
|
1919
|
-
},
|
|
2194
|
+
}, Er = { class: "d-flex flex-column gap-2" }, Dr = { class: "d-flex align-items-center gap-2 mb-1" }, Or = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-0" }, kr = {
|
|
1920
2195
|
key: 0,
|
|
1921
2196
|
class: "ms-1 text-danger"
|
|
1922
|
-
},
|
|
2197
|
+
}, Ar = {
|
|
1923
2198
|
key: 0,
|
|
1924
2199
|
class: "form-check form-switch mb-0"
|
|
1925
|
-
},
|
|
2200
|
+
}, jr = [
|
|
1926
2201
|
"id",
|
|
1927
2202
|
"checked",
|
|
1928
2203
|
"disabled"
|
|
1929
|
-
],
|
|
2204
|
+
], Mr = ["for"], Nr = {
|
|
1930
2205
|
key: 1,
|
|
1931
2206
|
class: "text-muted d-block",
|
|
1932
2207
|
style: { "white-space": "pre-line" }
|
|
1933
|
-
},
|
|
2208
|
+
}, Pr = { class: "row g-3" }, Fr = { class: "col-6" }, Ir = { class: "d-flex align-items-center gap-2 mb-1" }, Lr = {
|
|
1934
2209
|
key: 0,
|
|
1935
2210
|
class: "form-check form-switch mb-0"
|
|
1936
|
-
},
|
|
2211
|
+
}, Rr = [
|
|
1937
2212
|
"id",
|
|
1938
2213
|
"checked",
|
|
1939
2214
|
"disabled"
|
|
1940
|
-
],
|
|
2215
|
+
], zr = ["for"], Br = ["value"], Vr = {
|
|
1941
2216
|
key: 1,
|
|
1942
2217
|
class: "text-muted d-block"
|
|
1943
|
-
},
|
|
2218
|
+
}, Hr = {
|
|
1944
2219
|
key: 0,
|
|
1945
2220
|
class: "text-muted d-block"
|
|
1946
|
-
},
|
|
2221
|
+
}, Ur = { class: "min-w-0" }, Wr = { class: "fw-medium text-truncate" }, Gr = {
|
|
1947
2222
|
key: 0,
|
|
1948
2223
|
class: "text-muted d-block"
|
|
1949
|
-
},
|
|
2224
|
+
}, Kr = {
|
|
1950
2225
|
key: 2,
|
|
1951
2226
|
class: "text-muted"
|
|
1952
|
-
},
|
|
1953
|
-
function
|
|
2227
|
+
}, qr = { class: "col-12 col-md-6" };
|
|
2228
|
+
function Jr(e, t, n, r, c, d) {
|
|
1954
2229
|
let f = S("amsom-textarea"), p = S("amsom-autocomplete"), m = S("ligne-document-block");
|
|
1955
|
-
return g(), o("div",
|
|
2230
|
+
return g(), o("div", Er, [s("div", null, [s("div", Dr, [s("label", Or, [t[6] ||= l(" Description", -1), d.isPrincipale ? (g(), o("span", kr, "*")) : a("", !0)]), d.isPrincipale ? a("", !0) : (g(), o("div", Ar, [s("input", {
|
|
1956
2231
|
id: `memedetail-${d.ligne.idMotif}`,
|
|
1957
2232
|
class: "form-check-input",
|
|
1958
2233
|
type: "checkbox",
|
|
1959
2234
|
checked: d.ligne.description == null,
|
|
1960
2235
|
disabled: r.draft.isReadonly("description"),
|
|
1961
2236
|
onChange: t[0] ||= (e) => r.draft.toggleDescriptionOverride(n.index)
|
|
1962
|
-
}, null, 40,
|
|
2237
|
+
}, null, 40, jr), s("label", {
|
|
1963
2238
|
class: "form-check-label fs-7",
|
|
1964
2239
|
for: `memedetail-${d.ligne.idMotif}`
|
|
1965
|
-
}, " Même description ", 8,
|
|
2240
|
+
}, " Même description ", 8, Mr)]))]), !r.draft.isReadonly("description") && (d.isPrincipale || d.ligne.description != null) ? (g(), i(f, {
|
|
1966
2241
|
key: 0,
|
|
1967
2242
|
"model-value": d.ligne.description,
|
|
1968
2243
|
"input-size": "sm",
|
|
@@ -1975,25 +2250,25 @@ function Er(e, t, n, r, c, d) {
|
|
|
1975
2250
|
"rows",
|
|
1976
2251
|
"maxlength",
|
|
1977
2252
|
"placeholder"
|
|
1978
|
-
])) : (g(), o("small",
|
|
2253
|
+
])) : (g(), o("small", Nr, C((d.ligne.description ?? d.lignePrincipale.description) || "—"), 1))]), s("div", Pr, [s("div", Fr, [s("div", null, [s("div", Ir, [t[7] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-0" }, " Date des faits ", -1), d.isPrincipale ? a("", !0) : (g(), o("div", Lr, [s("input", {
|
|
1979
2254
|
id: `memedate-${d.ligne.idMotif}`,
|
|
1980
2255
|
class: "form-check-input",
|
|
1981
2256
|
type: "checkbox",
|
|
1982
2257
|
checked: !d.ligne.dateFaitsOverride,
|
|
1983
2258
|
disabled: r.draft.isReadonly("dateFaits"),
|
|
1984
2259
|
onChange: t[2] ||= (e) => r.draft.toggleDateFaitsOverride(n.index)
|
|
1985
|
-
}, null, 40,
|
|
2260
|
+
}, null, 40, Rr), s("label", {
|
|
1986
2261
|
class: "form-check-label fs-7",
|
|
1987
2262
|
for: `memedate-${d.ligne.idMotif}`
|
|
1988
|
-
}, " Même date ", 8,
|
|
2263
|
+
}, " Même date ", 8, zr)]))]), !r.draft.isReadonly("dateFaits") && (d.isPrincipale || d.ligne.dateFaitsOverride) ? (g(), o("input", {
|
|
1989
2264
|
key: 0,
|
|
1990
2265
|
value: d.timestampToDateInput(d.ligne.dateFaits),
|
|
1991
2266
|
type: "date",
|
|
1992
2267
|
class: "form-control form-control-sm",
|
|
1993
2268
|
onInput: t[3] ||= (e) => r.draft.setDateFaits(n.index, d.dateInputToTimestamp(e.target.value))
|
|
1994
|
-
}, null, 40,
|
|
2269
|
+
}, null, 40, Br)) : (g(), o("small", Vr, C(d.timestampToDateInput(d.dateFaits) || "—"), 1))]), s("div", null, [
|
|
1995
2270
|
t[8] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Responsable ", -1),
|
|
1996
|
-
r.draft.isReadonly("responsable") ? (g(), o("small",
|
|
2271
|
+
r.draft.isReadonly("responsable") ? (g(), o("small", Hr, C(d.responsableLibelle(d.ligne.responsable) || "Déterminé automatiquement"), 1)) : (g(), i(p, {
|
|
1997
2272
|
key: 1,
|
|
1998
2273
|
"model-value": d.ligne.responsable,
|
|
1999
2274
|
items: d.collaborateurs,
|
|
@@ -2005,7 +2280,7 @@ function Er(e, t, n, r, c, d) {
|
|
|
2005
2280
|
"hide-choices": "",
|
|
2006
2281
|
"onUpdate:modelValue": t[4] ||= (e) => r.draft.setResponsable(n.index, e ?? null)
|
|
2007
2282
|
}, {
|
|
2008
|
-
options:
|
|
2283
|
+
options: E((e) => [s("div", Ur, [s("div", Wr, C(e?.prenom) + " " + C(e?.nom), 1), e?.service ? (g(), o("small", Gr, C(e.service), 1)) : a("", !0)])]),
|
|
2009
2284
|
_: 1
|
|
2010
2285
|
}, 8, [
|
|
2011
2286
|
"model-value",
|
|
@@ -2014,8 +2289,8 @@ function Er(e, t, n, r, c, d) {
|
|
|
2014
2289
|
"get-input-libelle",
|
|
2015
2290
|
"filtering-function"
|
|
2016
2291
|
])),
|
|
2017
|
-
d.isPrincipale && !d.ligne.responsable && !r.draft.isReadonly("responsable") ? (g(), o("small",
|
|
2018
|
-
])]), s("div",
|
|
2292
|
+
d.isPrincipale && !d.ligne.responsable && !r.draft.isReadonly("responsable") ? (g(), o("small", Kr, " Aucun paramétrage trouvé : le responsable sera déterminé automatiquement. ")) : a("", !0)
|
|
2293
|
+
])]), s("div", qr, [u(m, {
|
|
2019
2294
|
index: n.index,
|
|
2020
2295
|
fichier: d.ligne.fichier,
|
|
2021
2296
|
readonly: r.draft.isReadonly("fichier"),
|
|
@@ -2028,16 +2303,16 @@ function Er(e, t, n, r, c, d) {
|
|
|
2028
2303
|
}
|
|
2029
2304
|
//#endregion
|
|
2030
2305
|
//#region src/components/EtapeDetailsBlock.vue
|
|
2031
|
-
var
|
|
2306
|
+
var Yr = {
|
|
2032
2307
|
name: "EtapeDetailsBlock",
|
|
2033
2308
|
components: {
|
|
2034
2309
|
AmsomOverlay: t,
|
|
2035
|
-
LigneDetailBlock: /* @__PURE__ */
|
|
2310
|
+
LigneDetailBlock: /* @__PURE__ */ F(Tr, [["render", Jr]])
|
|
2036
2311
|
},
|
|
2037
2312
|
setup() {
|
|
2038
2313
|
return {
|
|
2039
|
-
draft:
|
|
2040
|
-
data:
|
|
2314
|
+
draft: P(),
|
|
2315
|
+
data: K()
|
|
2041
2316
|
};
|
|
2042
2317
|
},
|
|
2043
2318
|
computed: {
|
|
@@ -2088,22 +2363,22 @@ var Dr = {
|
|
|
2088
2363
|
}
|
|
2089
2364
|
}
|
|
2090
2365
|
}
|
|
2091
|
-
},
|
|
2366
|
+
}, Xr = { class: "d-flex flex-column gap-3" }, Zr = { class: "alert alert-light border py-2 px-3 mb-0 d-flex flex-column gap-1" }, Qr = {
|
|
2092
2367
|
key: 0,
|
|
2093
2368
|
class: "fs-7"
|
|
2094
|
-
},
|
|
2095
|
-
function
|
|
2369
|
+
}, $r = { class: "fs-7" }, ei = { class: "bg-light rounded px-2 py-1 d-flex flex-column gap-1" }, ti = { class: "fs-7" }, ni = { class: "fs-7" };
|
|
2370
|
+
function ri(e, t, r, c, d, f) {
|
|
2096
2371
|
let p = S("font-awesome-icon"), m = S("ligne-detail-block"), h = S("amsom-overlay");
|
|
2097
2372
|
return g(), i(h, { loading: c.data.isLoading && !c.data.cache.collaborateurs }, {
|
|
2098
|
-
default:
|
|
2099
|
-
s("div",
|
|
2373
|
+
default: E(() => [s("div", Xr, [
|
|
2374
|
+
s("div", Zr, [f.motifLibelle ? (g(), o("span", Qr, [
|
|
2100
2375
|
u(p, {
|
|
2101
2376
|
icon: "tag",
|
|
2102
2377
|
class: "text-primary me-2"
|
|
2103
2378
|
}),
|
|
2104
2379
|
t[0] ||= s("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Motif", -1),
|
|
2105
2380
|
l(C(f.motifLibelle), 1)
|
|
2106
|
-
])) : a("", !0), s("span",
|
|
2381
|
+
])) : a("", !0), s("span", $r, [
|
|
2107
2382
|
u(p, {
|
|
2108
2383
|
icon: "location-dot",
|
|
2109
2384
|
class: "text-primary me-2"
|
|
@@ -2119,14 +2394,14 @@ function Fr(e, t, r, c, d, f) {
|
|
|
2119
2394
|
], -1), (g(!0), o(n, null, b(f.lignesAssociees, (e, n) => (g(), o("div", {
|
|
2120
2395
|
key: e.idMotif,
|
|
2121
2396
|
class: "border rounded p-2 d-flex flex-column gap-2"
|
|
2122
|
-
}, [s("div",
|
|
2397
|
+
}, [s("div", ei, [s("span", ti, [
|
|
2123
2398
|
u(p, {
|
|
2124
2399
|
icon: "tag",
|
|
2125
2400
|
class: "text-primary me-2"
|
|
2126
2401
|
}),
|
|
2127
2402
|
t[2] ||= s("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Motif", -1),
|
|
2128
2403
|
l(" " + C(e.libelle), 1)
|
|
2129
|
-
]), s("span",
|
|
2404
|
+
]), s("span", ni, [
|
|
2130
2405
|
u(p, {
|
|
2131
2406
|
icon: "location-dot",
|
|
2132
2407
|
class: "text-primary me-2"
|
|
@@ -2140,15 +2415,15 @@ function Fr(e, t, r, c, d, f) {
|
|
|
2140
2415
|
}
|
|
2141
2416
|
//#endregion
|
|
2142
2417
|
//#region src/components/StepperBlock.vue
|
|
2143
|
-
var
|
|
2418
|
+
var ii = {
|
|
2144
2419
|
name: "StepperBlock",
|
|
2145
2420
|
components: {
|
|
2146
|
-
AmsomHorizontalStepper:
|
|
2421
|
+
AmsomHorizontalStepper: re,
|
|
2147
2422
|
AmsomOverlay: t,
|
|
2148
|
-
EtapeReclamantBlock:
|
|
2149
|
-
EtapeCategorieBlock:
|
|
2150
|
-
EtapeCibleBlock:
|
|
2151
|
-
EtapeDetailsBlock: /* @__PURE__ */
|
|
2423
|
+
EtapeReclamantBlock: It,
|
|
2424
|
+
EtapeCategorieBlock: gn,
|
|
2425
|
+
EtapeCibleBlock: vr,
|
|
2426
|
+
EtapeDetailsBlock: /* @__PURE__ */ F(Yr, [["render", ri]])
|
|
2152
2427
|
},
|
|
2153
2428
|
props: {
|
|
2154
2429
|
step: {
|
|
@@ -2167,9 +2442,9 @@ var Ir = {
|
|
|
2167
2442
|
],
|
|
2168
2443
|
setup() {
|
|
2169
2444
|
return {
|
|
2170
|
-
draft:
|
|
2171
|
-
data:
|
|
2172
|
-
options:
|
|
2445
|
+
draft: P(),
|
|
2446
|
+
data: K(),
|
|
2447
|
+
options: Y()
|
|
2173
2448
|
};
|
|
2174
2449
|
},
|
|
2175
2450
|
computed: {
|
|
@@ -2260,64 +2535,68 @@ var Ir = {
|
|
|
2260
2535
|
}));
|
|
2261
2536
|
}
|
|
2262
2537
|
}
|
|
2263
|
-
},
|
|
2538
|
+
}, ai = { class: "d-flex flex-column gap-3" }, oi = {
|
|
2264
2539
|
key: 0,
|
|
2265
2540
|
class: "w-100 fs-6 fw-medium my-3 alert alert-info",
|
|
2266
2541
|
style: { "white-space": "pre-line" }
|
|
2267
|
-
},
|
|
2268
|
-
function
|
|
2269
|
-
let
|
|
2270
|
-
return g(), i(
|
|
2271
|
-
default:
|
|
2272
|
-
u(
|
|
2273
|
-
steps:
|
|
2542
|
+
}, si = { style: { "min-height": "260px" } }, ci = { class: "d-flex justify-content-between" }, li = { key: 1 }, ui = ["disabled"], di = ["disabled"];
|
|
2543
|
+
function fi(e, t, n, r, f, p) {
|
|
2544
|
+
let m = S("amsom-horizontal-stepper"), _ = S("font-awesome-icon"), v = S("etape-reclamant-block"), y = S("etape-categorie-block"), b = S("etape-cible-block"), ee = S("etape-details-block"), w = S("amsom-overlay");
|
|
2545
|
+
return g(), i(w, { loading: n.creating }, {
|
|
2546
|
+
default: E(() => [s("div", ai, [
|
|
2547
|
+
u(m, {
|
|
2548
|
+
steps: p.stepperSteps,
|
|
2274
2549
|
size: "md",
|
|
2275
|
-
onStepClick:
|
|
2550
|
+
onStepClick: p.onStepClick
|
|
2276
2551
|
}, null, 8, ["steps", "onStepClick"]),
|
|
2277
|
-
|
|
2552
|
+
p.aideMotif ? (g(), o("div", oi, [u(_, {
|
|
2278
2553
|
icon: "circle-info",
|
|
2279
2554
|
class: "text-info-emphasis me-2"
|
|
2280
|
-
}), s("span", null, C(
|
|
2281
|
-
s("div",
|
|
2555
|
+
}), s("span", null, C(p.aideMotif), 1)])) : a("", !0),
|
|
2556
|
+
s("div", si, [p.currentKey === "reclamant" ? (g(), i(v, {
|
|
2282
2557
|
key: 0,
|
|
2283
2558
|
premiere: n.step === 1
|
|
2284
|
-
},
|
|
2559
|
+
}, c({ _: 2 }, [e.$slots.reclamant ? {
|
|
2560
|
+
name: "reclamant",
|
|
2561
|
+
fn: E((t) => [x(e.$slots, "reclamant", h(d(t)))]),
|
|
2562
|
+
key: "0"
|
|
2563
|
+
} : void 0]), 1032, ["premiere"])) : p.currentKey === "categorie" ? (g(), i(y, {
|
|
2285
2564
|
key: 1,
|
|
2286
2565
|
premiere: n.step === 1
|
|
2287
|
-
}, null, 8, ["premiere"])) :
|
|
2288
|
-
s("div",
|
|
2566
|
+
}, null, 8, ["premiere"])) : p.currentKey === "cible" ? (g(), i(b, { key: 2 })) : p.currentKey === "details" ? (g(), i(ee, { key: 3 })) : a("", !0)]),
|
|
2567
|
+
s("div", ci, [n.step > 1 ? (g(), o("button", {
|
|
2289
2568
|
key: 0,
|
|
2290
2569
|
class: "btn btn-sm btn-outline-secondary",
|
|
2291
|
-
onClick: t[0] ||= (...e) =>
|
|
2292
|
-
}, [u(
|
|
2570
|
+
onClick: t[0] ||= (...e) => p.goPrevious && p.goPrevious(...e)
|
|
2571
|
+
}, [u(_, {
|
|
2293
2572
|
icon: "chevron-left",
|
|
2294
2573
|
class: "me-1"
|
|
2295
|
-
}), t[3] ||= l(" Précédent ", -1)])) : (g(), o("span",
|
|
2574
|
+
}), t[3] ||= l(" Précédent ", -1)])) : (g(), o("span", li)), n.step < p.steps.length ? (g(), o("button", {
|
|
2296
2575
|
key: 2,
|
|
2297
2576
|
class: "btn btn-sm btn-primary",
|
|
2298
|
-
disabled: !
|
|
2299
|
-
onClick: t[1] ||= (...e) =>
|
|
2300
|
-
}, [t[4] ||= l(" Suivant ", -1), u(
|
|
2577
|
+
disabled: !p.canGoNext,
|
|
2578
|
+
onClick: t[1] ||= (...e) => p.goNext && p.goNext(...e)
|
|
2579
|
+
}, [t[4] ||= l(" Suivant ", -1), u(_, {
|
|
2301
2580
|
icon: "chevron-right",
|
|
2302
2581
|
class: "ms-1"
|
|
2303
|
-
})], 8,
|
|
2582
|
+
})], 8, ui)) : (g(), o("button", {
|
|
2304
2583
|
key: 3,
|
|
2305
2584
|
class: "btn btn-sm btn-success",
|
|
2306
|
-
disabled: !
|
|
2585
|
+
disabled: !p.canCreer || n.creating,
|
|
2307
2586
|
onClick: t[2] ||= (t) => e.$emit("submit")
|
|
2308
|
-
}, [u(
|
|
2587
|
+
}, [u(_, {
|
|
2309
2588
|
icon: "check",
|
|
2310
2589
|
class: "me-1"
|
|
2311
|
-
}), t[5] ||= l(" Créer la sollicitation ", -1)], 8,
|
|
2590
|
+
}), t[5] ||= l(" Créer la sollicitation ", -1)], 8, di))])
|
|
2312
2591
|
])]),
|
|
2313
|
-
_:
|
|
2592
|
+
_: 3
|
|
2314
2593
|
}, 8, ["loading"]);
|
|
2315
2594
|
}
|
|
2316
|
-
var
|
|
2595
|
+
var pi = /*#__PURE__*/ F(ii, [["render", fi]]), mi = (e, { signal: t, token: n, baseUrl: r } = {}) => Fe("/v2/cresol/creer_sollicitation", e, {
|
|
2317
2596
|
signal: t,
|
|
2318
2597
|
token: n,
|
|
2319
2598
|
baseUrl: r
|
|
2320
|
-
}),
|
|
2599
|
+
}), hi = ({ idSollicitation: e, pj: t }, { signal: n, token: r, baseUrl: i } = {}) => Fe("/v2/cresol/upload_sollicitation_ged", {
|
|
2321
2600
|
idSollicitation: e,
|
|
2322
2601
|
pj: t
|
|
2323
2602
|
}, {
|
|
@@ -2346,7 +2625,7 @@ var Gr = /*#__PURE__*/ L(Ir, [["render", Wr]]), Kr = (e, { signal: t, token: n,
|
|
|
2346
2625
|
readonly: {
|
|
2347
2626
|
type: [Boolean, Array],
|
|
2348
2627
|
default: !1,
|
|
2349
|
-
validator: (e) => typeof e == "boolean" || e.every((e) =>
|
|
2628
|
+
validator: (e) => typeof e == "boolean" || e.every((e) => M.includes(e))
|
|
2350
2629
|
},
|
|
2351
2630
|
modules: {
|
|
2352
2631
|
type: Array,
|
|
@@ -2376,7 +2655,7 @@ var Gr = /*#__PURE__*/ L(Ir, [["render", Wr]]), Kr = (e, { signal: t, token: n,
|
|
|
2376
2655
|
type: String,
|
|
2377
2656
|
default: null
|
|
2378
2657
|
}
|
|
2379
|
-
},
|
|
2658
|
+
}, gi = Object.keys(Z), Q = [
|
|
2380
2659
|
"update:modelValue",
|
|
2381
2660
|
"reclamantChange",
|
|
2382
2661
|
"motifChange",
|
|
@@ -2385,11 +2664,11 @@ var Gr = /*#__PURE__*/ L(Ir, [["render", Wr]]), Kr = (e, { signal: t, token: n,
|
|
|
2385
2664
|
"created",
|
|
2386
2665
|
"createError",
|
|
2387
2666
|
"error"
|
|
2388
|
-
],
|
|
2667
|
+
], _i = {
|
|
2389
2668
|
name: "CreerSollicitationForm",
|
|
2390
2669
|
components: {
|
|
2391
|
-
AsideBlock:
|
|
2392
|
-
StepperBlock:
|
|
2670
|
+
AsideBlock: De,
|
|
2671
|
+
StepperBlock: pi
|
|
2393
2672
|
},
|
|
2394
2673
|
props: { ...Z },
|
|
2395
2674
|
emits: [...Q],
|
|
@@ -2397,16 +2676,16 @@ var Gr = /*#__PURE__*/ L(Ir, [["render", Wr]]), Kr = (e, { signal: t, token: n,
|
|
|
2397
2676
|
let n = (e) => t("error", e), i = {
|
|
2398
2677
|
token: w(e, "token"),
|
|
2399
2678
|
baseUrl: w(e, "baseUrl")
|
|
2400
|
-
}, a =
|
|
2679
|
+
}, a = et($e({
|
|
2401
2680
|
onError: n,
|
|
2402
2681
|
...i
|
|
2403
|
-
})), o = y(null), s = r(() =>
|
|
2404
|
-
reclamants:
|
|
2682
|
+
})), o = y(null), s = r(() => o.value ?? e.modules ?? []), c = be(ye({
|
|
2683
|
+
reclamants: r(() => e.reclamantMode === "step" ? [] : e.reclamants),
|
|
2405
2684
|
modules: s,
|
|
2406
2685
|
idModulePrefere: w(e, "idModule"),
|
|
2407
2686
|
readonly: w(e, "readonly")
|
|
2408
2687
|
}));
|
|
2409
|
-
return
|
|
2688
|
+
return Rt(v({
|
|
2410
2689
|
nomenclatureFilter: w(e, "nomenclatureFilter"),
|
|
2411
2690
|
reclamantMode: w(e, "reclamantMode"),
|
|
2412
2691
|
modulesReclamant: s,
|
|
@@ -2449,14 +2728,22 @@ var Gr = /*#__PURE__*/ L(Ir, [["render", Wr]]), Kr = (e, { signal: t, token: n,
|
|
|
2449
2728
|
}
|
|
2450
2729
|
} },
|
|
2451
2730
|
async created() {
|
|
2452
|
-
this.draft.reset(this.modelValue), this.draft.syncReclamant()
|
|
2731
|
+
this.draft.reset(this.modelValue), this.draft.syncReclamant();
|
|
2453
2732
|
let e = this.draft.reclamantSelectionne;
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
}), this.draft.prefillCiblePrincipale());
|
|
2733
|
+
this.$watch("draft.reclamantSelectionne", async (t) => {
|
|
2734
|
+
this.$emit("reclamantChange", t), await this.chargerModulesReclamant(t, e) && this.draft.syncReclamant();
|
|
2735
|
+
}), this.$watch(() => JSON.stringify(this.motifChoisi), () => this.$emit("motifChange", this.motifChoisi)), this.data.loadNomenclature(), await this.chargerModulesReclamant(e, e) && this.draft.prefillCiblePrincipale();
|
|
2458
2736
|
},
|
|
2459
2737
|
methods: {
|
|
2738
|
+
async chargerModulesReclamant(e, t) {
|
|
2739
|
+
if (this.modules && e === t) return this.modulesCharges = null, !0;
|
|
2740
|
+
if (!this.draft.reclamantEstContrat) return this.modulesCharges = [], !0;
|
|
2741
|
+
let n = await this.data.loadModulesOfContrat({
|
|
2742
|
+
idContrat: e.id,
|
|
2743
|
+
typeContrat: e.type
|
|
2744
|
+
});
|
|
2745
|
+
return e === this.draft.reclamantSelectionne && (this.modulesCharges = n ?? [], !0);
|
|
2746
|
+
},
|
|
2460
2747
|
async creer() {
|
|
2461
2748
|
if (!this.creating) {
|
|
2462
2749
|
this.creating = !0;
|
|
@@ -2465,10 +2752,10 @@ var Gr = /*#__PURE__*/ L(Ir, [["render", Wr]]), Kr = (e, { signal: t, token: n,
|
|
|
2465
2752
|
if (!await this.autoriserCreation(e)) return;
|
|
2466
2753
|
let t;
|
|
2467
2754
|
try {
|
|
2468
|
-
t = await
|
|
2755
|
+
t = await mi(e, this.requestOptions) ?? [];
|
|
2469
2756
|
} catch (t) {
|
|
2470
|
-
if (
|
|
2471
|
-
let n =
|
|
2757
|
+
if (B(t)) return;
|
|
2758
|
+
let n = z(t);
|
|
2472
2759
|
this.$emit("createError", {
|
|
2473
2760
|
error: t,
|
|
2474
2761
|
message: n,
|
|
@@ -2518,7 +2805,7 @@ var Gr = /*#__PURE__*/ L(Ir, [["render", Wr]]), Kr = (e, { signal: t, token: n,
|
|
|
2518
2805
|
message: t
|
|
2519
2806
|
};
|
|
2520
2807
|
};
|
|
2521
|
-
return a?.id ?
|
|
2808
|
+
return a?.id ? hi({
|
|
2522
2809
|
idSollicitation: a.id,
|
|
2523
2810
|
pj: {
|
|
2524
2811
|
name: n.name,
|
|
@@ -2529,24 +2816,24 @@ var Gr = /*#__PURE__*/ L(Ir, [["render", Wr]]), Kr = (e, { signal: t, token: n,
|
|
|
2529
2816
|
...o,
|
|
2530
2817
|
ok: !0,
|
|
2531
2818
|
message: null
|
|
2532
|
-
})).catch((e) => s(
|
|
2819
|
+
})).catch((e) => s(z(e))) : Promise.resolve(s("sollicitation introuvable dans la réponse"));
|
|
2533
2820
|
});
|
|
2534
2821
|
return Promise.all(n);
|
|
2535
2822
|
}
|
|
2536
2823
|
}
|
|
2537
|
-
},
|
|
2824
|
+
}, vi = { class: "row g-3" }, yi = {
|
|
2538
2825
|
key: 0,
|
|
2539
2826
|
class: "col-12 col-lg-4"
|
|
2540
2827
|
};
|
|
2541
|
-
function
|
|
2828
|
+
function bi(e, t, n, r, i, l) {
|
|
2542
2829
|
let f = S("aside-block"), p = S("stepper-block");
|
|
2543
|
-
return g(), o("div",
|
|
2830
|
+
return g(), o("div", vi, [e.aside ? (g(), o("div", yi, [x(e.$slots, "aside", {}, () => [u(f, { "nb-similaires": e.nbSimilaires }, c({ _: 2 }, [e.$slots["aside-similaires"] ? {
|
|
2544
2831
|
name: "similaires",
|
|
2545
|
-
fn:
|
|
2832
|
+
fn: E((t) => [x(e.$slots, "aside-similaires", h(d(t)))]),
|
|
2546
2833
|
key: "0"
|
|
2547
2834
|
} : void 0, e.$slots["aside-evenements"] ? {
|
|
2548
2835
|
name: "evenements",
|
|
2549
|
-
fn:
|
|
2836
|
+
fn: E(() => [x(e.$slots, "aside-evenements")]),
|
|
2550
2837
|
key: "1"
|
|
2551
2838
|
} : void 0]), 1032, ["nb-similaires"])])])) : a("", !0), s("div", { class: m(["col-12", e.aside ? "col-lg-8" : ""]) }, [u(p, {
|
|
2552
2839
|
step: i.currentStep,
|
|
@@ -2554,13 +2841,17 @@ function Qr(e, t, n, r, i, l) {
|
|
|
2554
2841
|
creating: i.creating,
|
|
2555
2842
|
onStepChange: t[1] ||= (t) => e.$emit("stepChange", t),
|
|
2556
2843
|
onSubmit: l.creer
|
|
2557
|
-
},
|
|
2844
|
+
}, c({ _: 2 }, [e.$slots.reclamant ? {
|
|
2845
|
+
name: "reclamant",
|
|
2846
|
+
fn: E((t) => [x(e.$slots, "reclamant", h(d(t)))]),
|
|
2847
|
+
key: "0"
|
|
2848
|
+
} : void 0]), 1032, [
|
|
2558
2849
|
"step",
|
|
2559
2850
|
"creating",
|
|
2560
2851
|
"onSubmit"
|
|
2561
2852
|
])], 2)]);
|
|
2562
2853
|
}
|
|
2563
|
-
var $ = /*#__PURE__*/
|
|
2854
|
+
var $ = /*#__PURE__*/ F(_i, [["render", bi]]), xi = {
|
|
2564
2855
|
name: "CreerSollicitationModal",
|
|
2565
2856
|
components: {
|
|
2566
2857
|
AmsomModal: e,
|
|
@@ -2580,7 +2871,7 @@ var $ = /*#__PURE__*/ L(Yr, [["render", Qr]]), $r = {
|
|
|
2580
2871
|
emits: [...Q, "close"],
|
|
2581
2872
|
computed: {
|
|
2582
2873
|
formProps() {
|
|
2583
|
-
return Object.fromEntries(
|
|
2874
|
+
return Object.fromEntries(gi.map((e) => [e, this[e]]));
|
|
2584
2875
|
},
|
|
2585
2876
|
formListeners() {
|
|
2586
2877
|
return Object.fromEntries(Q.filter((e) => e !== "created").map((e) => [e, (...t) => this.$emit(e, ...t)]));
|
|
@@ -2589,24 +2880,24 @@ var $ = /*#__PURE__*/ L(Yr, [["render", Qr]]), $r = {
|
|
|
2589
2880
|
methods: { onCreated(...e) {
|
|
2590
2881
|
this.$emit("created", ...e), this.closeOnCreated && this.$emit("close");
|
|
2591
2882
|
} }
|
|
2592
|
-
},
|
|
2593
|
-
function
|
|
2883
|
+
}, Si = { class: "fw-medium fs-5" };
|
|
2884
|
+
function Ci(e, t, n, r, a, o) {
|
|
2594
2885
|
let l = S("creer-sollicitation-form"), f = S("amsom-modal");
|
|
2595
2886
|
return g(), i(f, {
|
|
2596
2887
|
"close-option": "",
|
|
2597
2888
|
size: "xl",
|
|
2598
2889
|
onClose: t[0] ||= (t) => e.$emit("close")
|
|
2599
2890
|
}, {
|
|
2600
|
-
default:
|
|
2891
|
+
default: E(() => [s("span", Si, C(n.titre), 1), u(l, p({ class: "pt-3" }, o.formProps, ee(o.formListeners), { onCreated: o.onCreated }), c({ _: 2 }, [b(e.$slots, (t, n) => ({
|
|
2601
2892
|
name: n,
|
|
2602
|
-
fn:
|
|
2893
|
+
fn: E((t) => [x(e.$slots, n, h(d(t ?? {})))])
|
|
2603
2894
|
}))]), 1040, ["onCreated"])]),
|
|
2604
2895
|
_: 3
|
|
2605
2896
|
});
|
|
2606
2897
|
}
|
|
2607
|
-
var
|
|
2608
|
-
CreerSollicitationModal:
|
|
2898
|
+
var wi = /*#__PURE__*/ F(xi, [["render", Ci]]), Ti = {
|
|
2899
|
+
CreerSollicitationModal: wi,
|
|
2609
2900
|
CreerSollicitationForm: $
|
|
2610
2901
|
};
|
|
2611
2902
|
//#endregion
|
|
2612
|
-
export { $ as CreerSollicitationForm,
|
|
2903
|
+
export { $ as CreerSollicitationForm, wi as CreerSollicitationModal, le as DEFAULT_PROVENANCE_CONTACT, ce as PROVENANCES_CONTACT, M as READONLY_FIELDS, ke as configureCresol, Ti as default, N as getDefaultDraft, j as getDefaultLigne, A as getDefaultPatrimoine, Qe as resetCresolCache };
|