Skip to content

Commit

Permalink
Merge pull request #729 from rufener/preavis
Browse files Browse the repository at this point in the history
Preavis
  • Loading branch information
rufener authored Mar 29, 2023
2 parents 4b04e10 + 3d6b9ca commit f72ed6b
Show file tree
Hide file tree
Showing 18 changed files with 458 additions and 151 deletions.
36 changes: 36 additions & 0 deletions back/infolica/alembic/versions/20230321_3a451b565980.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""update preavis formulaire decision
Revision ID: 3a451b565980
Revises: 4f5057ef6dd2
Create Date: 2023-03-21 12:00:58.619347
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '3a451b565980'
down_revision = '4f5057ef6dd2'
branch_labels = None
depends_on = None

def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('preavis_decision', 'remarque', new_column_name='remarque_contexte')
op.add_column('preavis_decision', sa.Column('remarque_limite_fictive_gabarits', sa.Text(), nullable=True))
op.add_column('preavis_decision', sa.Column('remarque_transfert_droit_batir', sa.Text(), nullable=True))
op.add_column('preavis_decision', sa.Column('remarque_stationnement_art29', sa.Text(), nullable=True))
op.add_column('preavis_decision', sa.Column('remarque_autre', sa.Text(), nullable=True))
op.add_column('preavis_glossaire', sa.Column('chapitre', sa.String(length=40), nullable=True))
# ### end Alembic commands ###

def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('preavis_decision', 'remarque_contexte', new_column_name='remarque')
op.drop_column('preavis_glossaire', 'chapitre')
op.drop_column('preavis_decision', 'remarque_autre')
op.drop_column('preavis_decision', 'remarque_stationnement_art29')
op.drop_column('preavis_decision', 'remarque_transfert_droit_batir')
op.drop_column('preavis_decision', 'remarque_limite_fictive_gabarits')
# ### end Alembic commands ###
7 changes: 6 additions & 1 deletion back/infolica/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,11 @@ class PreavisDecision(Base):
preavis_id = Column(BigInteger, ForeignKey(Preavis.id), nullable=False)
preavis_type_id = Column(BigInteger, ForeignKey(PreavisType.id))
operateur_service_id = Column(BigInteger, ForeignKey(Operateur.id))
remarque = Column(Text)
remarque_contexte = Column(Text)
remarque_limite_fictive_gabarits = Column(Text)
remarque_transfert_droit_batir = Column(Text)
remarque_stationnement_art29 = Column(Text)
remarque_autre = Column(Text)
date = Column(Date)
definitif = Column(Boolean)
version = Column(Integer)
Expand All @@ -981,6 +985,7 @@ class PreavisGlossaire(Base):
ordre = Column(Integer)
titre = Column(Text, nullable=False)
texte = Column(Text, nullable=False)
chapitre = Column(String(40))


class GeosBalance(Base):
Expand Down
5 changes: 1 addition & 4 deletions back/infolica/scripts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,7 @@ def generate_file_from_template(cls, request, template, data, output_file_name,


@classmethod
def newAffaireEtape(cls, request, affaire_id, etape_id, remarque=None, operateur_id=None, datetime_=None):

if datetime_ is None:
datetime_ = datetime.now()
def newAffaireEtape(cls, request, affaire_id, etape_id, remarque=None, operateur_id=None, datetime_=datetime.now()):

if operateur_id is None:
operateur_id = cls.getOperateurFromUser(request).id,
Expand Down
262 changes: 182 additions & 80 deletions back/infolica/views/affaire_preavis.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
max-height: 610px;
}

#emolumentsDialog th, td {
#emolumentsDialog th, #emolumentsDialog td {
width: 150px !important;
}

Expand Down
4 changes: 2 additions & 2 deletions front/src/components/Affaires/Preavis/preavis.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.preavis {
#preavis .preavis {
width: 100%;
float: left;
}

.preavis .md-table {
#preavis .md-table {
width: 70%;
}
2 changes: 1 addition & 1 deletion front/src/components/Affaires/Preavis/preavis.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="preavis">
<div id="preavis" class="preavis">
<md-card>
<!-- Results Header -->
<md-card-header class="justifyTitleBtn">
Expand Down
2 changes: 1 addition & 1 deletion front/src/components/PreavisExternes/PreavisExternes.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<style src="./preavisExternes.css" scoped></style>
<style src="./preavisExternes.css"></style>
<template src="./preavisExternes.html"></template>


Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
<style src="./preavisExternesEditDecision.css" scoped></style>
<style src="./preavisExternesEditDecision.css"></style>
<template src="./preavisExternesEditDecision.html"></template>


<script>
import { handleException } from "@/services/exceptionsHandler";
import PreavisExtComment from "@/components/Utils/PreavisExtComment/PreavisExtComment.vue";
export default {
name: "PreavisEditDecision",
props: {
preavis_id: Number,
showAddDecision: Boolean
},
components: {},
components: {
PreavisExtComment
},
data() {
return {
decisions_liste: [],
decision: {
id: null,
preavis_type_id: null,
remarque: null,
remarque_contexte: null,
remarque_limite_fictive_gabarits: null,
remarque_transfert_droit_batir: null,
remarque_stationnement_art29: null,
remarque_autre: null,
disabled: true,
show: false,
},
glossaire: [],
hasRightAddDecision: false,
lastDecisionVersion: -1,
selected_glossaire: {},
showGlossaire: false,
};
},
Expand All @@ -46,7 +52,11 @@ export default {
// reset decision
resetDecision() {
this.decision.preavis_type_id = null;
this.decision.remarque = null;
this.decision.remarque_contexte = null;
this.decision.remarque_limite_fictive_gabarits = null;
this.decision.remarque_transfert_droit_batir = null;
this.decision.remarque_stationnement_art29 = null;
this.decision.remarque_autre = null;
this.decision.operateur = null;
this.decision.date = null;
},
Expand Down Expand Up @@ -85,7 +95,7 @@ export default {
});
}
}
).catch(err => handleException(err));
).catch(err => handleException(err, this));
},
Expand All @@ -104,7 +114,8 @@ export default {
}
this.$root.$emit('setPreavisDecisionDraft');
}
).catch(err => handleException(err));
).catch(err => handleException(err))
.finally(() => this.getGlossaire());
},
Expand All @@ -113,7 +124,11 @@ export default {
let formData = new FormData();
formData.append('preavis_id', this.preavis_id);
formData.append('preavis_type_id', this.decision.preavis_type_id);
formData.append('remarque', this.decision.remarque);
formData.append('remarque_contexte', this.decision.remarque_contexte);
formData.append('remarque_limite_fictive_gabarits', this.decision.remarque_limite_fictive_gabarits);
formData.append('remarque_transfert_droit_batir', this.decision.remarque_transfert_droit_batir);
formData.append('remarque_stationnement_art29', this.decision.remarque_stationnement_art29);
formData.append('remarque_autre', this.decision.remarque_autre);
formData.append('definitif', definitif);
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -160,7 +175,11 @@ export default {
// copy text from old preavis
copyText(preavis) {
this.decision.remarque = preavis.remarque;
this.decision.remarque_contexte = preavis.remarque_contexte;
this.decision.remarque_limite_fictive_gabarits = preavis.remarque_limite_fictive_gabarits;
this.decision.remarque_transfert_droit_batir = preavis.remarque_transfert_droit_batir;
this.decision.remarque_stationnement_art29 = preavis.remarque_stationnement_art29;
this.decision.remarque_autre = preavis.remarque_autre;
},
// get service glossaire
Expand All @@ -176,15 +195,6 @@ export default {
}
}).catch(err => handleException(err));
},
addGlossaireText(data) {
if (!this.decision.remarque) {
this.decision.remarque = data;
} else {
this.decision.remarque += '\n\n' + data;
}
}
},
mounted: function() {
Expand Down
8 changes: 4 additions & 4 deletions front/src/components/PreavisExternes/preavisExternes.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
.preavis {
#preavisExterne.preavisExterne {
width: 90%;
margin: auto;
height: calc(100vh - 80px);
}

ul {
#preavisExterne ul {
padding: 0;
margin: 0;
list-style: none;
}

li {
#preavisExterne li {
padding: 0;
}

.pendingRow {
#preavisExterne .pendingRow {
font-style: italic;
color: grey;
}
5 changes: 3 additions & 2 deletions front/src/components/PreavisExternes/preavisExternes.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="preavis" class="preavis">
<div id="preavisExterne" class="preavisExterne">
<md-toolbar class="justifyTitleBtn">
<h1>Préavis</h1>
</md-toolbar>
Expand Down Expand Up @@ -42,7 +42,7 @@ <h1 class="md-title">Demandes en cours</h1>
<md-divider></md-divider>
<br>

<md-table v-model="liste_preavis_old" md-sort="date_demande" md-sort-order="desc" md-card>
<md-table v-model="liste_preavis_old" md-sort="preavis_date_reponse_int" md-sort-order="desc" md-card>
<md-table-toolbar>
<div class="md-toolbar-section-start">
<h1 class="md-title">Demandes réalisées</h1>
Expand All @@ -61,6 +61,7 @@ <h1 class="md-title">Demandes réalisées</h1>

<md-table-row slot="md-table-row" slot-scope="{ item }">
<md-table-cell md-label="Date demande" md-sort-by="preavis_date_demande_int" md-numeric>{{ item.preavis_date_demande }}</md-table-cell>
<md-table-cell md-label="Date réponse" md-sort-by="preavis_date_reponse_int" md-numeric>{{ item.preavis_date_reponse }}</md-table-cell>
<md-table-cell md-label="Affaire_id" md-sort-by="preavis_affaire_id" md-numeric>{{ item.preavis_affaire_id }}</md-table-cell>
<md-table-cell md-label="Cadastre" md-sort-by="affaire_cadastre">{{ item.affaire_cadastre }}</md-table-cell>
<md-table-cell md-label="Description">{{ item.affaire_description }}</md-table-cell>
Expand Down
14 changes: 7 additions & 7 deletions front/src/components/PreavisExternes/preavisExternesEdit.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@
position: relative; top: 70px;
}

#preavisEdit .title {
#preavisEdit .table_infogen .title {
font-weight: bold;
width: 180px !important;
width: 180px;
}

#preavisEdit .content {
width: 400px !important;
#preavisEdit .table_infogen .content {
width: 400px;
}

#preavisEdit .tg {
#preavisEdit .table_infogen {
border-collapse: collapse;
border-spacing: 0;
}

#preavisEdit .tg tr {
#preavisEdit .table_infogen tr {
height: 45px;
}

#preavisEdit .tg td {
#preavisEdit .table_infogen td {
border-color: black;
border-style: solid;
border-width: 1px;
Expand Down
6 changes: 3 additions & 3 deletions front/src/components/PreavisExternes/preavisExternesEdit.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<md-toolbar class="justifyTitleBtn preavisHeader">
<h1>Saisie de préavis pour l'affaire {{ affaire.id }}</h1>
<div>
<md-button class="md-raised md-primary" @click="savePreavisDefinitively" v-if="preavisDecisionReady && affaire.preavis_etape === 'externe'" :disabled="$refs.ped.decision.preavis_type_id === null || $refs.ped.decision.remarque === null || $refs.ped.decision.remarque === ''"><md-icon>save</md-icon> Enregistrer définitivement</md-button>
<md-button class="md-raised md-primary" @click="savePreavisDefinitively" v-if="preavisDecisionReady && affaire.preavis_etape === 'externe'" :disabled="$refs.ped.decision.preavis_type_id === null"><md-icon>save</md-icon> Enregistrer définitivement</md-button>
<md-button class="md-raised md-primary" @click="$router.push({name: 'Preavis'})"><md-icon>arrow_back</md-icon> Retour au tableau de préavis</md-button>
</div>
</md-toolbar>
Expand All @@ -31,7 +31,7 @@ <h1>Saisie de préavis pour l'affaire {{ affaire.id }}</h1>
<div class="md-layout-item md-size-50">
<div class="md-title">Informations générales</div>
<br>
<table class="tg">
<table class="table_infogen">
<tbody>
<tr>
<td class="title">Numéro d'affaire</td>
Expand All @@ -55,7 +55,7 @@ <h1>Saisie de préavis pour l'affaire {{ affaire.id }}</h1>
</tr>
<tr>
<td class="title">Client</td>
<td class="content" style="white-space: pre-wrap;">{{ affaire.client }}</td>
<td class="content" style="white-space: pre-line;">{{ affaire.client }}</td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,34 @@
#preavisEditDecision .table_glossaire_add {
width: 50px !important;
}

#preavisEditDecision .table_glossaire_text {
width: 1400px !important;
}
}

#preavisEditDecision .remarque_contexte_situation .md-textarea {
min-height: 250px;
}

#preavisEditDecision .title {
width: 400px;
font-weight: bold;
font-size: 15pt;
color: black;
opacity: 0.8;
padding-bottom: 15px;
}

#preavisEditDecision .subtitle {
font-weight: bold;
color: black;
opacity: 0.7;
font-size: 12pt;
padding-bottom: 10px;
}

#preavisEditDecision .subtitle::before {
content: '-';
padding-right: 10px;
padding-left: 5px;
}
Loading

0 comments on commit f72ed6b

Please sign in to comment.