"use strict";(self["webpackChunkcarabi_x2"]=self["webpackChunkcarabi_x2"]||[]).push([[6418],{7655:function(t,e,s){s.r(e),s.d(e,{default:function(){return h}});var i=function(){var t=this,e=t._self._c;return e("Modal",{ref:"modal",attrs:{title:"История",autoOpen:!0,fullHeight:!0},on:{closed:function(e){return t.$emit("closed")}}},[e("ul",{staticClass:"uk-subnav uk-subnav-pill",staticStyle:{margin:"0 5px 5px 5px"}},t._l(t.historyTypes,(function(s){return e("li",{key:s.name,class:{"uk-active":s===t.historyType}},[e("a",{attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.historyType=s}}},[t._v(t._s(s.title))])])})),0),e("div",{staticClass:"uk-padding-small",staticStyle:{"flex-grow":"1","min-height":"1px",overflow:"auto"}},[null===t.result?e("div",{staticStyle:{position:"relative",height:"150px"}},[e("loader")],1):t.result.length?e("ul",{staticClass:"pos-list"},t._l(t.result,(function(s,i){return e("list-item",{key:i+"_"+s.DOC_ID,attrs:{footer:t.resultFooter(s),cover:!0},on:{click:function(e){return t.openDocument(s)}}},[e("span",{staticClass:"uk-margin-remove"},[t._v(t._s(s.DOC_DESCR))])])})),1):e("div",{staticClass:"uk-h3 uk-text-center"},[t._v(" История пустая ")])])])},l=[],n=s(3216),a=s(5512),o={name:"ModalHistory",components:{Modal:()=>s.e(8362).then(s.bind(s,2215)),listItem:()=>s.e(8110).then(s.bind(s,6250)),Loader:()=>s.e(8326).then(s.bind(s,1259))},data(){return{result:null,historyTypes:[{name:"lists",title:"Списки"},{name:"documents",title:"Документы"}],historyType:null}},computed:{},watch:{historyType(){this.loadHistory()}},mounted(){null===this.historyType?this.historyType=this.historyTypes[0]:this.loadHistory()},methods:{async loadHistory(){let t=await n.vd.select("CRM_GET_RECENTS",{IS_DOC_LIST:"lists"===this.historyType.name?1:0},20);this.result=t},resultFooter(t){return[{value:t.INSERT_DATE},{name:"тип",value:t.DOC_TYPE_RUS},{name:"id",value:t.DOC_ID}]},openDocument(t){"CARABI_DOCLIST"==t.DOC_TYPE?a.A.addView({viewType:"doclist",params:[t.DOC_ID]}):a.A.openDocument(t.DOC_ID),this.$refs.modal.close()}}},r=o,u=s(1656),c=(0,u.A)(r,i,l,!1,null,null,null),h=c.exports}}]);
//# sourceMappingURL=ModalHistory.7aff0f3e.js.map