1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6828,5101],{76828:function(t,e,s){s.r(e),s.d(e,{default:function(){return c}});var a=s(4942),n=s(76972);function i(t,e){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),s.push.apply(s,a)}return s}function r(t){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{};e%2?i(Object(s),!0).forEach((function(e){(0,a.Z)(t,e,s[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):i(Object(s)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))}))}return t}var o={name:"dashboard-meeting-coloc",props:{user:Object},data:function(){return{isLoadingValidation:-1,active:0,error:null,saving:!1,owner_saved:!1,owner_contact_info:{email:"",phone:""},displayEditMeetCalendar:-1,displayEditMeet:-1,isLoading:!1,meetings:[],date:new Date,typeMeet:this.$route.params.typeMeet,isAgenda:1,validateMeet:!1,cancelMeetModal:!1,showConfirmModalOnEdit:!1,pendingCancelMeet:null,dispoMeets:[],newMeetDate:"",newMeetHour:"",editMeetDate:"",editMeetHour:"",dispoHourBegin:"",dispoHourEnd:"",hasMandate:!1,editMeet:-1,config:{},showMoreMeet:!1,nextMeet:{set:!1},daysName:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],meetsBegin:Date.now(),newBlocked:[],isModale:!1,saveAgendaMsg:!1,showPropose:!1,showProposeAgenda:!1,lastDecline:"",isConfigure:!1,max:10,settingConfig:!1,unsaved:{dispoHourBegin:"",dispoHourEnd:""},meetReplacement:null,proposing:!1}},computed:{subAgendaMeetings:function(){var t=1===this.isAgenda?[1,2,3]:2===this.isAgenda?[4]:[5,6];return this.meetings.filter((function(e){return t.includes(e.status)}))},unconfirmedMeetingsCount:function(){return this.meetings.filter((function(t){return 1===t.status})).length}},mounted:function(){var t=this;"#finished"===this.$route.hash?this.isAgenda=2:"#cancelled"===this.$route.hash||"#canceled"===this.$route.hash?this.isAgenda=3:this.isAgenda=1,this.user&&this.user.home&&this.user.home.step>=3&&this.user.home.is_coloc&&this.$http.get("/api/owner_contact_info").then((function(e){e.data&&e.data.email&&(t.owner_contact_info.email=e.data.email),e.data&&e.data.phone&&(t.owner_contact_info.phone=e.data.phone)}))},methods:{lessThanTwoHours:function(t){return(0,n.Z)(t,new Date)<2},displayEditMeetCalendarFunc:function(t){this.displayEditMeetCalendar===t?this.displayEditMeetCalendar=-1:this.displayEditMeetCalendar=t},displayEditMeetFunc:function(t){this.displayEditMeet===t?this.displayEditMeet=-1:this.displayEditMeet=t},changeAgenda:function(t){this.isAgenda!==t&&(this.isAgenda=t,2===t?this.$router.push({hash:"#finished"}):3===t?this.$router.push({hash:"#cancelled"}):this.$router.push({hash:""}))},hideAgenda:function(){this.showConfirmModalOnEdit=!1,this.displayEditMeet=-1,this.displayEditMeetCalendar=-1},confirmMeet:function(t){var e=this;this.isLoadingValidation=t.id,this.$http.post("/api/meet/validate/".concat(t.id,"/tenant")).then((function(){e.lastDecline="",e.nextMeet=t,e.nextMeet.set=!0,e.nextMeet.status=3,e.validateMeet=!0,e.refreshMeets()})).catch(this.$error)},isToday:function(t){var e=new Date(this.date.getFullYear(),this.date.getMonth(),t+1),s=new Date;return e.setHours(0,0,0,0),s.setHours(0,0,0,0),e.getTime()===s.getTime()},declineMeet:function(t,e){var s=this;this.$http.post("/api/meet/cancel/".concat(t.id,"/tenant")).then((function(e){s.cancelMeetModal=!0,t.status=e.data.status,s.refreshMeets()})).catch(this.$error)},confirmDeclineMeet:function(){var t=this.pendingCancelMeet;this.pendingCancelMeet=null,t&&this.declineMeet(t,!1)},scrollTop:function(){window.scrollTo({top:0,behavior:"smooth"})},getStatusStyle:function(t){return{color:3===t.status?"#75cd31":1===t.status?"#d90f15":"#d90e15","white-space":"nowrap"}},getStatusClass:function(t){switch(t.status){case 1:return{"tag-warning":!0};case 2:case 4:return{"tag-pending":!0};case 3:return{"tag-info":!0};case 5:case 6:case 7:return{"tag-error":!0}}return{}},getStatusString:function(t){switch(t.status){case 2:return"à confirmer";case 1:return"En attente";case 3:return"Confirmé";case 4:return"Terminé";case 5:return"Annulé";case 6:return"Refusé";default:return"null"}},getInterestString:function(t){switch(t.interest){case 1:return"Intéressé";case 2:return"Pas intéressé";case 3:return"Pas visité";case 4:return"A replanifier"}return""},refreshMeets:function(){var t=this;this.isLoading=!0,this.$http.get("/api/meet/for-tenant").then((function(e){200===e.status&&e.data&&(t.meetings=e.data.map((function(t){return r(r({},t),{},{meet_date:t.meet_date?new Date(t.meet_date):null,meet_end:t.meet_end?new Date(t.meet_end):null,new_date:t.meet_new_date?new Date(t.meet_new_date):null,new_end:t.meet_new_end?new Date(t.meet_new_end):null})})))})).catch((function(t){})).finally((function(){return t.isLoading=!1}))},cancelMeet:function(t){1===this.meetings[t].status&&this.$http.post("/api/meet/cancel/".concat(this.meetings[t].id)).then(this.refreshMeets).catch((function(t){}))},changeMeetInterest:function(t,e){t.interest||this.$http.post("/api/meet/".concat(t.home_id,"/interest"),{meet_id:t.id,interest:e}).then(this.refreshMeets).catch((function(t){}))},showHomeAgenda:function(t){this.$router.push("/users/annonce/"+t.home_id+"#visits")}},created:function(){this.refreshMeets()},components:{Modal:s(81558).Z,UiButton:s(10795).default}},c=(0,s(51900).Z)(o,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"dashboard-meeting-coloc dashboard-page"},[e("div",{staticClass:"topbar"},[e("div",{class:{link:!0,"router-link-active":1===t.isAgenda},on:{click:function(e){t.changeAgenda(1),t.refreshMeets()}}},[e("h4",[t._v("Visites à venir")])]),t._v(" "),e("div",{class:{link:!0,"router-link-active":2===t.isAgenda},on:{click:function(e){t.changeAgenda(2),t.refreshMeets()}}},[e("h4",[t._v("Visites terminées")])]),t._v(" "),e("div",{class:{link:!0,"router-link-active":3===t.isAgenda},on:{click:function(e){t.changeAgenda(3),t.refreshMeets()}}},[e("h4",[t._v("Visites annulées")])]),t._v(" "),t.user&&t.user.home&&!t.user.home.is_coloc?e("div",{class:{link:!0,"router-link-active":4===t.isAgenda},on:{click:function(e){t.changeAgenda(4),t.refreshMeets()}}},[e("h4",[t._v("Agenda")])]):t._e()]),t._v(" "),t.error?e("div",[e("div",{staticClass:"info"},[t._v(t._s(t.error))])]):t._e(),t._v(" "),1===t.isAgenda?e("div",[t.unconfirmedMeetingsCount>0?e("div",{staticClass:"block block-info"},[t._v("\n Vous avez "),e("span",{staticStyle:{"font-weight":"700"}},[t._v(t._s(t.unconfirmedMeetingsCount))]),t._v(" visite"+t._s(t.unconfirmedMeetingsCount>1?"s":"")+" en attente de confirmation par le propriétaire\n ")]):t._e(),t._v(" "),e("div",{staticClass:"meet-table"},[e("table",{staticClass:"table-meet",attrs:{border:"1",frame:"void",rules:"rows"}},[t._m(0),t._v(" "),0===t.subAgendaMeetings.length?e("tbody",{staticStyle:{"text-align":"center"}},[t._m(1)]):e("tbody",[t._l(t.subAgendaMeetings,(function(s,a){return[e("tr",{key:a+"w",class:{tr_expanded:t.displayEditMeet===a}},[e("td",{staticClass:"date center"},[s.meet_date?e("span",[t._v(t._s(t._f("formatDate")(s.meet_date,"dd/MM/yyyy"))+" "),e("br"),t._v(" à "+t._s(t._f("formatDate")(s.meet_date,"HH:mm")))]):e("div",{staticClass:"tag tag-pending"},[t._v("Horaire"),e("br"),t._v("à confirmer")])]),t._v(" "),e("td",{staticClass:"contact"},[e("div",{staticClass:"person"},[s.tenant_avatar_id?e("img",{staticClass:"avatar",attrs:{src:"/image/"+s.tenant_avatar_id+"/0/0",alt:"Avatar"}}):t._e(),t._v(" "),e("div",[e("router-link",{attrs:{to:"/users/messages?id="+s.owner_id}},[t._v(t._s(s.owner_first_name)+" "+t._s(s.owner_name))]),t._v(" "),s.owner_phone?[e("br"),t._v(t._s(s.owner_phone))]:t._e()],2)])]),t._v(" "),3===s.status?e("td",{staticClass:"address"},[t._v("\n "+t._s(s.address)+" "),e("br"),t._v("\n "+t._s(s.postal_code)+", "+t._s(s.city)+" "),e("br"),e("br"),t._v(" "),e("router-link",{attrs:{to:"/users/annonce/"+s.home_id}},[t._v(t._s(s.home_name))])],1):e("td",{staticClass:"address"},[e("router-link",{attrs:{to:"/users/annonce/"+s.home_id}},[t._v(t._s(s.home_name))])],1),t._v(" "),e("td",{staticClass:"status center"},[e("div",{staticClass:"tag",class:t.getStatusClass(s)},[t._v(t._s(t.getStatusString(s)))])]),t._v(" "),e("td",{staticClass:"actions"},[e("div",{staticClass:"compact"},[e("div",{staticClass:"item"},[e("div",{staticClass:"label"},[t._v("Visite")]),t._v(" "),e("div",{staticClass:"value date"},[s.meet_date?e("span",[t._v(t._s(t._f("formatDate")(s.meet_date,"dd/MM/yyyy"))+" "),e("br"),t._v(" à "+t._s(t._f("formatDate")(s.meet_date,"HH:mm")))]):e("tag",{staticClass:"tag tag-pending"},[t._v("Horaire"),e("br"),t._v("à confirmer")])],1)]),t._v(" "),e("div",{staticClass:"item"},[e("div",{staticClass:"label"},[t._v("Contact")]),t._v(" "),e("div",{staticClass:"value contact"},[e("router-link",{attrs:{to:"/users/messages?id="+s.owner_id}},[t._v(t._s(s.owner_first_name)+" "+t._s(s.owner_name))]),t._v(" "),e("br"),t._v("\n "+t._s(s.owner_phone)+"\n ")],1)]),t._v(" "),e("div",{staticClass:"item"},[e("div",{staticClass:"label"},[t._v("Adresse")]),t._v(" "),e("div",{staticClass:"value address"},[3===s.status?e("span",[t._v("\n "+t._s(s.address)+" "),e("br"),t._v("\n "+t._s(s.postal_code)+", "+t._s(s.city)),e("br")]):t._e(),t._v(" "),e("router-link",{attrs:{to:"/users/annonce/"+s.home_id}},[t._v(t._s(s.home_name))])],1)]),t._v(" "),e("div",{staticClass:"item"},[e("div",{staticClass:"label"},[t._v("Statut")]),t._v(" "),e("div",{staticClass:"value status",style:t.getStatusStyle(s)},[t._v(t._s(t.getStatusString(s)))])])]),t._v(" "),e("div",{staticClass:"context_buttons"},[2===s.status?e("ui-button",{staticClass:"white-button",attrs:{compact:"",disabled:s.meet_date&&t.lessThanTwoHours(s.meet_date)},on:{click:function(e){t.pendingCancelMeet=s}}},[t._v("\n Refuser\n ")]):e("ui-button",{staticClass:"white-button",attrs:{compact:"",disabled:s.meet_date&&t.lessThanTwoHours(s.meet_date)},on:{click:function(e){t.pendingCancelMeet=s}}},[s.meet_date?e("span",[t._v("Annuler"),e("br"),t._v("le rendez-vous")]):e("span",[t._v("Annuler"),e("br"),t._v("la demande")])]),t._v(" "),2===s.status?e("ui-button",{attrs:{compact:""},on:{click:function(e){return t.confirmMeet(s)}}},[t.isLoadingValidation===s.id?e("div",[e("div",{staticClass:"loader small"})]):t.isLoadingValidation!==s.id?e("div",[t._v("Confirmer")]):t._e()]):t._e()],1)])])]}))],2)])])]):2===t.isAgenda?e("div",{staticClass:"agenda"},[e("div",{staticClass:"meet-table"},[e("table",{staticClass:"table-meet",attrs:{border:"1",frame:"void",rules:"rows"}},[t._m(2),t._v(" "),0===t.subAgendaMeetings.length?e("tbody",{staticStyle:{"text-align":"center"}},[t._m(3)]):e("tbody",[t._l(t.subAgendaMeetings,(function(s,a){return[e("tr",{key:a+"w"},[e("td",{staticClass:"date center"},[t._v("\n "+t._s(t._f("formatDate")(s.meet_date,"dd/MM/yyyy"))+" "),e("br"),t._v(" à "+t._s(t._f("formatDate")(s.meet_date,"HH:mm"))+"\n ")]),t._v(" "),e("td",{staticClass:"name"},[e("router-link",{attrs:{to:"/users/messages?id="+s.owner_id}},[t._v(t._s(s.owner_first_name)+" "+t._s(s.owner_name))]),t._v(" "),s.owner_phone?[e("br"),t._v(t._s(s.owner_phone))]:t._e()],2),t._v(" "),e("td",{staticClass:"address"},[t._v("\n "+t._s(s.address)),e("br"),t._v("\n "+t._s(s.postal_code)+", "+t._s(s.city)+"\n "),e("br"),e("br"),t._v(" "),e("router-link",{attrs:{to:"/users/annonce/"+s.home_id+"#visits"}},[t._v(t._s(s.home_name))])],1),t._v(" "),e("td",{staticClass:"status center"},[e("span",[t._v(t._s(t.getInterestString(s)))])]),t._v(" "),e("td",{staticClass:"actions"},[e("div",{staticClass:"compact"},[e("div",{staticClass:"item"},[e("div",{staticClass:"label"},[t._v("Visite")]),t._v(" "),e("div",{staticClass:"value date"},[t._v("\n "+t._s(t._f("formatDate")(s.meet_date,"dd/MM/yyyy"))+" "),e("br"),t._v(" à "+t._s(t._f("formatDate")(s.meet_date,"HH:mm"))+"\n ")])]),t._v(" "),e("div",{staticClass:"item"},[e("div",{staticClass:"label"},[t._v("Visité par")]),t._v(" "),e("div",{staticClass:"value contact"},[e("router-link",{attrs:{to:"/users/messages?id="+s.owner_id}},[t._v(t._s(s.owner_first_name)+" "+t._s(s.owner_name))]),t._v(" "),s.owner_phone?[e("br"),t._v(t._s(s.owner_phone))]:t._e()],2)]),t._v(" "),e("div",{staticClass:"item"},[e("div",{staticClass:"label"},[t._v("Adresse")]),t._v(" "),e("div",{staticClass:"value address"},[t._v("\n "+t._s(s.address)),e("br"),t._v("\n "+t._s(s.postal_code)+", "+t._s(s.city)+"\n "),e("br"),e("br"),t._v(" "),e("router-link",{attrs:{to:"/users/annonce/"+s.home_id+"#visits"}},[t._v(t._s(s.home_name))])],1)]),t._v(" "),e("div",{staticClass:"item"},[e("div",{staticClass:"label"}
1,[t._v("Intérêt")]),t._v(" "),e("div",{staticClass:"value status"},[e("span",[t._v(t._s(t.getInterestString(s)))])])])]),t._v(" "),s.interest?t._e():e("div",{staticClass:"context_buttons"},[e("button",{staticClass:"cancel-btn",on:{click:function(e){return t.changeMeetInterest(s,3)}}},[t._v("Pas visité")]),t._v(" "),e("button",{staticClass:"cancel-btn",on:{click:function(e){return t.changeMeetInterest(s,2)}}},[t._v("Pas intéressé")])]),t._v(" "),s.interest?t._e():e("div",{staticClass:"context_buttons"},[e("button",{staticClass:"interested-btn",on:{click:function(e){return t.changeMeetInterest(s,1)}}},[t._v("Intéressé")])]),t._v(" "),3===s.interest?e("div",{staticClass:"context_buttons"},[e("button",{staticClass:"validate-btn btn-large",on:{click:function(e){return t.showHomeAgenda(s)}}},[t._v("Reprendre rendez-vous")])]):t._e()])])]}))],2)])])]):3===t.isAgenda?e("div",{staticClass:"agenda"},[e("div",{staticClass:"meet-table"},[e("table",{staticClass:"table-meet",attrs:{border:"1",frame:"void",rules:"rows"}},[t._m(4),t._v(" "),0===t.subAgendaMeetings.length?e("tbody",[t._m(5)]):e("tbody",[t._l(t.subAgendaMeetings,(function(s,a){return[e("tr",{key:a+"w"},[e("td",{staticClass:"date center"},[s.meet_date?e("span",[t._v(t._s(t._f("formatDate")(s.meet_date,"dd/MM/yyyy"))+" "),e("br"),t._v(" à "+t._s(t._f("formatDate")(s.meet_date,"HH:mm")))]):e("span",[t._v("Horaire"),e("br"),t._v("à confirmer")])]),t._v(" "),e("td",{staticClass:"address"},[t._v("\n "+t._s(s.address)),e("br"),t._v("\n "+t._s(s.postal_code)+", "+t._s(s.city)+"\n "),e("br"),e("br"),t._v(" "),e("router-link",{attrs:{to:"/users/annonce/"+s.home_id}},[t._v(t._s(s.home_name))])],1),t._v(" "),e("td",{staticClass:"status center"},[e("div",{staticClass:"tag",class:t.getStatusClass(s)},[t._v(t._s(t.getStatusString(s)))])]),t._v(" "),e("td",{staticClass:"actions"},[e("div",{staticClass:"compact"},[e("div",{staticClass:"item"},[e("div",{staticClass:"label"},[t._v("Visite")]),t._v(" "),s.meet_date?e("div",{staticClass:"value"},[t._v(t._s(t._f("formatDate")(s.meet_date,"dd/MM/yyyy"))+" "),e("br"),t._v(" à "+t._s(t._f("formatDate")(s.meet_date,"HH:mm")))]):e("div",{staticClass:"value"},[t._v("Horaire"),e("br"),t._v("à confirmer")])]),t._v(" "),e("div",{staticClass:"item"},[e("div",{staticClass:"label"},[t._v("Co-location")]),t._v(" "),e("div",{staticClass:"value"},[t._v("\n "+t._s(s.address)),e("br"),t._v("\n "+t._s(s.postal_code)+", "+t._s(s.city)+"\n "),e("br"),e("br"),t._v(" "),e("router-link",{attrs:{to:"/users/annonce/"+s.home_id}},[t._v(t._s(s.home_name))])],1)]),t._v(" "),e("div",{staticClass:"item"},[e("div",{staticClass:"label"},[t._v("Statut")]),t._v(" "),e("div",{staticClass:"value",style:t.getStatusStyle(s)},[t._v(t._s(t.getStatusString(s)))])])])])])]}))],2)])])]):t._e(),t._v(" "),t.pendingCancelMeet?e("modal",{attrs:{title:"CONFIRMATION"},on:{close:function(e){t.pendingCancelMeet=null}},scopedSlots:t._u([{key:"buttons",fn:function(){return[e("button",{staticClass:"white-button",attrs:{type:"button"},on:{click:function(e){t.pendingCancelMeet=null}}},[t._v("Retour")]),t._v(" "),e("button",{staticClass:"white-button",attrs:{type:"button"},on:{click:t.confirmDeclineMeet}},[t._v("Confirmer")])]},proxy:!0}],null,!1,931895930)},[2===t.pendingCancelMeet.status?e("div",[t._v("Voulez-vous vraiment refuser ce rendez-vous ?")]):t.pendingCancelMeet.meet_date?e("div",[t._v("Voulez-vous vraiment annuler ce rendez-vous ?")]):e("div",[t._v("Voulez-vous vraiment annuler cette demande de visite ?")])]):t._e(),t._v(" "),t.validateMeet?e("modal",{attrs:{title:"CONFIRMATION"},on:{close:function(e){t.validateMeet=!1,t.scrollTop()}}},[e("div",[t._v("Votre rendez-vous est confirmé.")])]):t._e(),t._v(" "),t.showConfirmModalOnEdit?e("modal",{attrs:{title:"CONFIRMATION"},on:{close:function(e){return t.hideAgenda()}}},[t._v("\n Votre proposition de rendez-vous est bien prise en\n "),e("br"),t._v("\n compte et transmise au propriétaire.\n ")]):t._e(),t._v(" "),t.cancelMeetModal?e("modal",{attrs:{title:"CONFIRMATION"},on:{close:function(e){t.cancelMeetModal=!1,t.scrollTop()}}},[e("div",[t._v("\n Votre rendez-vous a été annulé."),e("br"),t._v("\n Le propriétaire recevra un message d'annulation.\n ")])]):t._e()],1)}),[function(){var t=this,e=t._self._c;return e("thead",[e("tr",[e("th",{staticClass:"date center"},[t._v("Visite")]),t._v(" "),e("th",{staticClass:"contact"},[t._v("Contact")]),t._v(" "),e("th",{staticClass:"address"},[t._v("Adresse")]),t._v(" "),e("th",{staticClass:"status center"},[t._v("Statut")]),t._v(" "),e("th")])])},function(){var t=this._self._c;return t("tr",[t("td",{staticClass:"table-empty",attrs:{colspan:"5"}},[this._v("Aucune visite à venir pour le moment")])])},function(){var t=this,e=t._self._c;return e("thead",[e("tr",[e("th",{staticClass:"date"},[t._v("Visite")]),t._v(" "),e("th",{staticClass:"name"},[t._v("Visite par")]),t._v(" "),e("th",{staticClass:"adresse"},[t._v("Adresse")]),t._v(" "),e("th",{staticClass:"status"}
1,[t._v("Intéressé")]),t._v(" "),e("th")])])},function(){var t=this._self._c;return t("tr",[t("td",{staticClass:"table-empty",attrs:{colspan:"5"}},[this._v("Aucune visite terminée pour le moment")])])},function(){var t=this,e=t._self._c;return e("thead",[e("tr",[e("th",{staticClass:"date center"},[t._v("Visite")]),t._v(" "),e("th",{staticClass:"address"},[t._v("Co-location")]),t._v(" "),e("th",{staticClass:"status center"},[t._v("Statut")]),t._v(" "),e("th")])])},function(){var t=this._self._c;return t("tr",{staticStyle:{"text-align":"center"}},[t("td",{staticClass:"table-empty",attrs:{colspan:"4"}},[this._v("Aucune visite annulée pour le moment")])])}],!1,null,null,null).exports}}]); 2//# sourceMappingURL=6828.9d9b4b04134646d5d6f8.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.