(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["mydepot-list"],{6792:function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("OptionMenu",{attrs:{id:e.$appNavigation.currentOptionMenuId,defaultMenu:e.$appNavigation.currentOptionMenu}}),n("PageHeaderTitleNavigation",{attrs:{id:e.$appNavigation.currentOptionMenuId,title:"MyDepot - Musterdepotverwaltung",defaultMenu:e.customOptionMenu,actions:e.headerActions},on:{"action-CREATE":function(t){return e.handleAction({key:"CREATE"})},"action-FILES":e.onFileChange}}),n("div",{staticClass:"box__container",attrs:{tid:e._generateTidFromString("box__container")}},[e.rows.length?n("DragnDropArea",{attrs:{hoverText:"Hochladen"},on:{files:e.onFileChange}},[n("Table",{attrs:{headers:e.headers,rows:e.rows,headerActions:e.tableHeaderActions,selected:e.selectedRowsByModus,sortableRows:""},on:{selected:e.selectRow,"click-label":e.openMusterdepot,action:e.handleAction,"action-DELETE":function(t){return e.deleteMusterdepots([t])},"headerAction-BULK_DELETE":function(t){return e.deleteMusterdepots(e.allSelectedRows)},orderChanged:e.orderChanged},scopedSlots:e._u([{key:"struktur",fn:function(t){return[t.owner?n("InputToggleSwitch",{attrs:{disabled:e.loading,value:t.struktur,inLineLabel:""},on:{input:function(n){return e.setStrukturBeratung({row:t,key:"STRUKTUR",value:n,objKey:"struktur"})}}}):n("span")]}},{key:"beratung",fn:function(t){return[n("ComboBox",{attrs:{value:t.beratung,values:e.beratungValues,disabled:e.loading},on:{change:function(n){return e.setStrukturBeratung({row:t,key:"BERATUNG",value:n,objKey:"beratung"})}}})]}}],null,!1,2718151861)})],1):e.loading?n("GhostLoading",{attrs:{type:"table",config:{table:{rows:10}}}}):n("NoData")],1),e._m(0),n("BaseModal",{ref:"createOrEditMusterdepotModal",attrs:{labelButtonConfirm:e.labelButtonConfirm,modalTitle:e.modalTitle},on:{onConfirmButton:function(t){return e.handleActionConfirmed()}}},[n("InputField",{attrs:{label:"Bezeichnung"},model:{value:e.createMusterdepotData.label,callback:function(t){e.$set(e.createMusterdepotData,"label",t)},expression:"createMusterdepotData.label"}}),n("ComboBox",{attrs:{label:"Typ",values:e.typeValues},model:{value:e.createMusterdepotData.type,callback:function(t){e.$set(e.createMusterdepotData,"type",t)},expression:"createMusterdepotData.type"}})],1),n("BaseModal",{ref:"errorModal",attrs:{labelButtonConfirm:"Ok",showCancelButton:!1,modalTitle:"Hinweise und Fehler"}},e._l(e.errorMessages,(function(t,a){return n("div",{key:a,staticClass:"row"},[n("div",{staticClass:"col-12",class:e.getStatusClass(t.status)},[e._v(" "+e._s(e.getDescription(t))+" ")])])})),0)],1)},r=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"box__container"},[n("div",[n("p",[e._v("Mit MyDepot können Sie Ihre eigenen Musterdepots (Einmalanlagen und Sparpläne separat) mit verschiedenen Anlagebeträgen zusammenstellen.")]),n("p",[e._v("Diese Muster-Depots können beim Kunden unter Beratung/Anlageempfehlung aufgerufen und weiterverarbeitet werden.")]),n("p",[e._v(" - Mit der Einstellung „Für Struktur freigeschaltet“ legen Sie fest, welche Ihrer MyDepots an Ihre Unterstruktur vererbt wird. ")]),n("p",[e._v(" - Mit der Einstellung „Für Beratung verwendet“ entscheiden Sie, welche der MyDepots Ihnen in der Anlageempfehlung angezeigt werden. Bitte beachten Sie, dass wenn Sie kein Musterdepot aktivieren, Ihnen keines in den jeweiligen Tools angezeigt wird. ")])])])}],o=n("1da1"),i=n("2909"),s=n("3835"),l=n("ade3"),u=n("5530"),c=(n("96cf"),n("99af"),n("d81d"),n("d3b7"),n("ac1f"),n("1276"),n("b0c0"),n("a15b"),n("4de4"),n("c740"),n("13d5"),n("e6cf"),n("a79d"),n("64c5")),d=n("5a29"),p=n("8103"),h=n("c704"),f=n("b967"),b=n("cee4"),g=n("9aaa"),m=n("6eb5"),M=n("689f"),v=n("a871"),w=n("d53f"),S=n("b1a7"),A=n("3931"),E=n("9131"),k=n("00cb"),O=n("11e7"),C=n("2f62"),R=n("c17d"),L=n("4e5f"),y={defaultSpinner:!0},D={mixins:[f["a"]],components:{PageHeaderTitleNavigation:p["a"],Table:M["a"],InputField:h["default"],InputToggleSwitch:g["default"],GhostLoading:m["a"],BaseModal:v["a"],NoData:S["a"],OptionMenu:A["a"],ComboBox:E["default"],BaseFileSelect:k["a"],DragnDropArea:O["a"],DownloadLink:d["default"]},data:function(){return{selectedMusterdepot:{},currentAction:"",selectedRowsEinmal:[],selectedRowsSpar:[],loading:!1,createMusterdepotData:{label:"",type:null},modus:"EINMALANLAGE",typeValues:[{label:"Einmalanlage",value:"EINMALANLAGE"},{label:"Sparplan",value:"SPARPLAN"}],einmalanlageValues:[],sparplaeneValues:[],modalTitle:"",labelButtonConfirm:"",headers:{lockedLeft:[Object(w["TextColumn"])("label","Bezeichnung").makeLink(),Object(w["SlotColumn"])("struktur","Für Struktur freigeschaltet",80,1),Object(w["SlotColumn"])("beratung","Für Beratung verwendet",80,1),Object(w["DateColumn"])("dateCreated","Erstellt am",80,1),Object(w["DateColumn"])("dateLastModified","Zuletzt geändert am",80,1)],center:[],lockedRight:[Object(w["ActionColumn"])("actions","Aktionen")]},errorMessages:[],beratungValues:[{label:"Ja",value:"JA"},{label:"Ja (inkl. Struktur)",value:"JA_STRUKTUR"},{label:"Nein",value:"NEIN"}],orderHasChanged:!1,orderedRows:[]}},computed:Object(u["a"])(Object(u["a"])({},Object(C["b"])({token:c["default"].GETTERS.GET_TOKEN})),{},{headerActions:function(){var e=this;return[Object(L["h"])("CREATE","Musterdepot erstellen").withDisabled((function(){return e.loading})),Object(L["d"])("FILES","Musterdepots importieren",".csv, .xlsx").withDisabled((function(){return e.loading}))]},selectedRowsByModus:function(){return"SPARPLAN"===this.modus?this.selectedRowsSpar:this.selectedRowsEinmal},allSelectedRows:function(){return this.selectedRowsSpar.concat(this.selectedRowsEinmal)||[]},rows:function(){var e=this,t="SPARPLAN"===this.modus?this.sparplaeneValues:this.einmalanlageValues;if(!t||!t.length)return[];var n=t.map((function(t){var n=Object(u["a"])({data:t},t),a=e.makeActions(n);return Object(u["a"])(Object(u["a"])({},n),{},{actions:a})}));return n},tableHeaderActions:function(){var e=this;return[Object(L["a"])("BULK_DELETE","Markierte löschen","Sollen die markierten Einträge wirklich gelöscht werden?","Markierte löschen","Löschen").withDisabled((function(){return e.loading||!e.allSelectedRows.some((function(e){return e.owner}))})),Object(L["c"])("DOWNLOAD","Markierte exportieren","musterdepots",this.linkmaker()).withDisabled((function(){return e.loading||!e.allSelectedRows.length}))]},customOptionMenu:function(){var e=this;return[{label:"Einmalanlagen",textBold:function(){return"EINMALANLAGE"===e.modus},action:function(){e.saveOrder().finally((function(){return e.modus="EINMALANLAGE"}))}},{label:"Sparpläne",textBold:function(){return"SPARPLAN"===e.modus},action:function(){e.saveOrder().finally((function(){return e.modus="SPARPLAN"}))}}]}}),mounted:function(){this.retrieveMusterdepotList()},methods:{getDescription:function(e){return e?this.getErrorMessage(e.title,e.message):""},getErrorMessage:function(e,t){return(e?"".concat(e,": "):"")+(t||"")},getStatusClass:function(e){switch(e){case"HINWEIS":return{"color-text":!0};case"WARNUNG":return{"color-warning":!0};case"FEHLER":return{"color-danger":!0}}},selectRow:function(e){"SPARPLAN"===this.modus?this.selectedRowsSpar=e:this.selectedRowsEinmal=e},onFileChange:function(e){var t=this;this.loading=!0;var n=new FileReader;n.onload=function(a){var r=n.result.split(",").pop();t.doImport({fileName:e[0].name,data:r})},n.readAsDataURL(e[0])},doImport:function(e){var t=this;b["a"].post("".concat("/MSC3/restful","/musterdepotService/import?modus=").concat(this.modus),e,y).then((function(e){e&&e.data&&e.data.length&&(t.errorMessages=e.data,t.$refs.errorModal.open()),t.retrieveMusterdepotList()})).catch((function(){return t.loading=!1}))},createOrEditMusterdepot:function(){var e=this;this.loading=!0;var t=Object(u["a"])(Object(u["a"])({},this.createMusterdepotData),{},{id:this.selectedMusterdepot.id});b["a"].post("".concat("/MSC3/restful","/musterdepotService/createOrEdit"),t,y).then((function(){return e.retrieveMusterdepotList()})).catch((function(){return e.loading=!1}))},copyMusterdepot:function(){var e=this;this.loading=!0;var t=Object(u["a"])({id:this.selectedMusterdepot.id},this.createMusterdepotData);b["a"].post("".concat("/MSC3/restful","/musterdepotService/copy"),t,y).then((function(){return e.retrieveMusterdepotList()})).catch((function(){return e.loading=!1}))},openMusterdepot:function(e){this.$addBreadcrumb({label:"zurück zu MyDepot",fullPath:this.$route.fullPath}),this.$router.push("/intern/mydepot/wertpapiere/".concat(e.id))},handleAction:function(e){switch(this.selectedMusterdepot=e.row||{},this.currentAction=e.key,e.key){case"CREATE":this.modalTitle="Musterdepot erstellen",this.labelButtonConfirm="Erstellen",this.createMusterdepotData={label:"",type:this.modus},this.$refs.createOrEditMusterdepotModal.open();break;case"EDIT":this.modalTitle="Musterdepot bearbeiten",this.labelButtonConfirm="Speichern",this.createMusterdepotData={label:this.selectedMusterdepot.label,type:this.selectedMusterdepot.type},this.$refs.createOrEditMusterdepotModal.open();break;case"COPY":this.modalTitle="Musterdepot kopieren",this.labelButtonConfirm="Kopieren",this.createMusterdepotData={label:this.selectedMusterdepot.label,type:this.selectedMusterdepot.type},this.$refs.createOrEditMusterdepotModal.open();break;default:break}},handleActionConfirmed:function(){switch(this.currentAction){case"CREATE":case"EDIT":this.createOrEditMusterdepot();break;case"COPY":this.copyMusterdepot();default:break}},linkmaker:function(){var e=this.token,t=this.allSelectedRows.map((function(e){return"musterdepotIdList=".concat(e.id)})).join("&"),n=Object(R["q"])({token:e});return"".concat("/MSC3/restful","/musterdepotService/get_export_link?").concat(t,"&").concat(n)},deleteMusterdepots:function(e){var t=this,n=e.filter((function(e){return e.owner})).map((function(e){return"musterdepotIdList=".concat(e.id)})).join("&");n&&n.length&&(this.loading=!0,b["a"].delete("".concat("/MSC3/restful","/musterdepotService/delete?").concat(n),y).then((function(){t.selectedRowsSpar=[],t.selectedRowsEinmal=[],t.retrieveMusterdepotList()})).catch((function(){return t.loading=!1})))},setStrukturBeratung:function(e){var t=this,n=e.row,a=e.key,r=e.value,o=e.objKey;this.loading=!0;var i="SPARPLAN"===this.modus?this.sparplaeneValues:this.einmalanlageValues,s=Object(l["a"])({id:n.id},o,r);b["a"].post("".concat("/MSC3/restful","/musterdepotService/executeAction?action=").concat(a),s,y).then((function(e){var n=i.findIndex((function(t){return t.id===e.data.id}));n>-1&&t.$set(i,n,e.data)})).finally((function(){return t.loading=!1}))},makeActions:function(e){var t=[Object(w["SimpleAction"])("COPY","PhCopy","Musterdepot kopieren")];return e.owner&&(t.push(Object(w["SimpleAction"])("EDIT","PhPencilLine","Musterdepot bearbeiten")),t.push(Object(w["ConfirmedAction"])("DELETE","PhTrash","Musterdepot löschen",'Wollen Sie das Musterdepot "'.concat(e.label,'" wirklich löschen?'),"Musterdepot löschen","Löschen"))),t},retrieveMusterdepotList:function(){var e=this;this.loading=!0,b["a"].get("".concat("/MSC3/restful","/musterdepotService/list"),y).then((function(t){if(t&&t.data){var n=t.data.reduce((function(e,t){var n=Object(s["a"])(e,2),a=n[0],r=n[1];return"SPARPLAN"===t.type?[a,[].concat(Object(i["a"])(r),[t])]:[[].concat(Object(i["a"])(a),[t]),r]}),[[],[]]),a=Object(s["a"])(n,2);e.einmalanlageValues=a[0],e.sparplaeneValues=a[1]}})).finally((function(){return e.loading=!1}))},orderChanged:function(e){this.orderHasChanged=!0,this.orderedRows=e,"SPARPLAN"===this.modus?this.sparplaeneValues=e.map((function(e){return Object(u["a"])({},e.data)})):this.einmalanlageValues=e.map((function(e){return Object(u["a"])({},e.data)}))},saveOrder:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.orderedRows;if(!this.orderHasChanged)return new Promise((function(e){e()}));this.loading=!0;var n=Object(R["q"])({musterdepotId:t.map((function(e){return e.id}))});return b["a"].post("".concat("/MSC3/restful","/musterdepotService/saveOrder?").concat(n),void 0,y).then((function(){e.orderHasChanged=!1,e.orderedRows=[]})).finally((function(){e.loading=!1}))}},beforeRouteLeave:function(e,t,n){var a=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,a.saveOrder();case 2:n();case 3:case"end":return e.stop()}}),e)})))()}},T=D,j=n("2877"),N=Object(j["a"])(T,a,r,!1,null,null,null);t["default"]=N.exports}}]);