/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/isogd-document@1.0.83/dist/isogdDocument.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("oasi-widgets/dist/index.css"),require("cadesplugin-api/dist/cadesplugin_api.js"),require("angular"),require("angular-animate"),require("angular-cookies"),require("angular-touch"),require("angular-sanitize"),require("angular-messages"),require("angular-aria"),require("angular-resource"),require("angular-ui-bootstrap"),require("angular-ui-router"),require("isogd-dossier-rest"),require("isogd-document-link-rest"),require("angular-filter"),require("oasi-widgets"),require("oasi-cryptopro"),require("oasi-bpm-rest"),require("oasi-nsi-rest"),require("isogd-solar-rest"),require("isogd-file-rest"),require("isogd-gis-rest"),require("isogd-document-rest"),require("jquery"),require("ng-file-upload"),require("oasi-main-theme/dist/oasi-main-theme.css"),require("lodash")):"function"==typeof define&&define.amd?define(["oasi-widgets/dist/index.css","cadesplugin-api/dist/cadesplugin_api.js","angular","angular-animate","angular-cookies","angular-touch","angular-sanitize","angular-messages","angular-aria","angular-resource","angular-ui-bootstrap","angular-ui-router","isogd-dossier-rest","isogd-document-link-rest","angular-filter","oasi-widgets","oasi-cryptopro","oasi-bpm-rest","oasi-nsi-rest","isogd-solar-rest","isogd-file-rest","isogd-gis-rest","isogd-document-rest","jquery","ng-file-upload","oasi-main-theme/dist/oasi-main-theme.css","lodash"],e):"object"==typeof exports?exports["isogd-document"]=e(require("oasi-widgets/dist/index.css"),require("cadesplugin-api/dist/cadesplugin_api.js"),require("angular"),require("angular-animate"),require("angular-cookies"),require("angular-touch"),require("angular-sanitize"),require("angular-messages"),require("angular-aria"),require("angular-resource"),require("angular-ui-bootstrap"),require("angular-ui-router"),require("isogd-dossier-rest"),require("isogd-document-link-rest"),require("angular-filter"),require("oasi-widgets"),require("oasi-cryptopro"),require("oasi-bpm-rest"),require("oasi-nsi-rest"),require("isogd-solar-rest"),require("isogd-file-rest"),require("isogd-gis-rest"),require("isogd-document-rest"),require("jquery"),require("ng-file-upload"),require("oasi-main-theme/dist/oasi-main-theme.css"),require("lodash")):t["isogd-document"]=e(t["oasi-widgets/dist/index.css"],t["cadesplugin-api/dist/cadesplugin_api.js"],t.angular,t["angular-animate"],t["angular-cookies"],t["angular-touch"],t["angular-sanitize"],t["angular-messages"],t["angular-aria"],t["angular-resource"],t["angular-ui-bootstrap"],t["angular-ui-router"],t["isogd-dossier-rest"],t["isogd-document-link-rest"],t["angular-filter"],t["oasi-widgets"],t["oasi-cryptopro"],t["oasi-bpm-rest"],t["oasi-nsi-rest"],t["isogd-solar-rest"],t["isogd-file-rest"],t["isogd-gis-rest"],t["isogd-document-rest"],t.jquery,t["ng-file-upload"],t["oasi-main-theme/dist/oasi-main-theme.css"],t.lodash)}(this,(function(t,e,n,i,s,o,c,r,a,l,d,u,m,p,h,g,f,v,y,b,$,k,S,D,I,w,R){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=8)}([function(t,e){t.exports=R},function(t,e){t.exports=g},function(t,e){t.exports=S},function(t,e){t.exports=n},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return s}));var i=function(t,e,n){this.name=t,this.value=e,this.text=n},s={controller:function(){function t(){}return t.prototype.change=function(t){this.update(t.name),this.onSortingsChanged({sorting:t})},t.prototype.update=function(t){this.sortings.forEach((function(e){if(e.name===t)if("desc"===e.value)e.value="asc";else e.value="desc"}))},t}(),template:n(90),bindings:{sortings:"<",onSortingsChanged:"&"}}},function(t,e){t.exports=D},function(t,e){t.exports=b},function(t,e){t.exports='<div class=inmodal> <div class=modal-header> <h3 class=modal-title><i class="fa fa-exclamation-triangle text-warning" aria-hidden=true></i>&nbsp;{{ctrl.title}}</h3> </div> <div class=modal-body style=background:#fff> <h4>{{ctrl.message}}</h4> </div> <div class=modal-footer> <button type=button class="btn btn-primary" ng-click=ctrl.ok()>{{ctrl.btnOk}}</button> <button type=button class="btn btn-white" ng-click=ctrl.cancel()>Отмена</button> </div> </div>'},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9),s=(n.n(i),n(10)),o=(n.n(s),n(11)),c=(n.n(o),n(12)),r=(n.n(c),n(3)),a=(n.n(r),n(13)),l=(n.n(a),n(14)),d=(n.n(l),n(15)),u=(n.n(d),n(16)),m=(n.n(u),n(17)),p=(n.n(m),n(18)),h=(n.n(p),n(19)),g=(n.n(h),n(20)),f=(n.n(g),n(21)),v=(n.n(f),n(22)),y=(n.n(v),n(23)),b=(n.n(y),n(24)),$=(n.n(b),n(1)),k=(n.n($),n(25)),S=(n.n(k),n(26)),D=(n.n(S),n(27)),I=(n.n(D),n(6)),w=(n.n(I),n(28)),R=(n.n(w),n(29)),x=(n.n(R),n(2)),C=(n.n(x),n(5)),N=(n.n(C),n(30)),E=(n.n(N),n(31)),L=n(32),T=n(34),j=n(36),q=n(38),U=n(40),A=n(42),O=n(44),B=n(46),F=n(48),z=n(50),M=n(52),V=n(54),P=n(56),_=n(58),W=n(60),G=n(62),H=n(64),Q=n(66),K=n(68),J=n(70),Z=n(73),X=n(75),Y=n(77),tt=n(79),et=n(81),nt=n(83),it=n(85),st=n(87),ot=n(89),ct=n(92),rt=n(94),at=n(96),lt=n(98),dt=n(100),ut=n(4),mt=n(102),pt=n(104),ht=n(105),gt=n(107),ft=n(111),vt=n(113),yt=n(116),bt=n(117),$t=n(118),kt=n(119),St=n(121),Dt=n(122),It=n(124),wt=n(126),Rt=n(128),xt=n(130),Ct=n(131),Nt=n(134),Et=n(136),Lt=n(138);r.module("isogd.document",["ngAnimate","ngCookies","ngTouch","ngSanitize","ngMessages","ngAria","ngResource","ui.bootstrap","ui.router","angular.filter","isogd.solar.rest","isogd.dossier.rest","isogd.document.link.rest","oasi.bpm.rest","oasi.nsi.rest","isogd.file.rest","isogd.gis.rest","isogd.document.rest","oasi.cryptopro","oasi.widgets","ngFileUpload"]).config(["blockUIConfig",function(t){t.autoBlock=!1,t.message=""}]).service("documentService",E.a).service("linkedDocumentService",Lt.a).service("fileService",pt.a).component("certificateInfo",ht.a).component("file",gt.a).component("folder",ft.a).component("navigator",vt.a).component("documentRequisitesEdit",L.a).component("documentRequisitesView",T.a).component("documentRegistrationEdit",j.a).component("documentRegistrationView",q.a).component("documentTerritoryEdit",U.a).component("documentTerritoryView",A.a).component("documentObjectEdit",O.a).component("documentObjectView",B.a).component("documentSpecificEdit",F.a).component("documentSpecificView",z.a).component("documentRequestEdit",M.a).component("documentRequestView",V.a).component("documentApproveEdit",P.a).component("documentApproveView",_.a).component("documentLinkEdit",W.a).component("documentLinkView",G.a).component("documentTepEdit",H.a).component("documentTepView",Q.a).component("documentView",K.a).component("documentEdit",J.a).component("documentOrganizationEdit",Z.a).component("documentOrganizationView",X.a).component("dossierCandidates",Y.a).component("dossierEdit",tt.a).component("dossierView",et.a).component("linkedDossiers",nt.a).component("newDossier",it.a).component("searchDossiers",st.a).component("linkedDocumentsEdit",ot.a).component("linkedDocumentsView",ct.a).component("linkedDocuments",rt.a).component("searchCandidates",at.a).component("searchFilter",lt.a).component("searchPagination",dt.a).component("searchResultSorting",ut.a).component("searchResult",mt.a).controller("SelectObjectTypeController",yt.a).controller("SignFileController",bt.a).controller("VerifyController",$t.a).component("filesView",kt.a).component("filesEdit",Dt.a).controller("ConfirmController",St.a).component("history",It.a).component("gisEdit",wt.a).component("gisView",Rt.a).controller("LogFileGldController",xt.a).component("logFiles",Ct.a).component("registrationStatus",Nt.a).component("documentHeader",Et.a)},function(t,e){t.exports=w},function(e,n){e.exports=t},function(t,e){},function(t,n){t.exports=e},function(t,e){t.exports=i},function(t,e){t.exports=s},function(t,e){t.exports=o},function(t,e){t.exports=c},function(t,e){t.exports=r},function(t,e){t.exports=a},function(t,e){t.exports=l},function(t,e){t.exports=d},function(t,e){t.exports=u},function(t,e){t.exports=m},function(t,e){t.exports=p},function(t,e){t.exports=h},function(t,e){t.exports=f},function(t,e){t.exports=v},function(t,e){t.exports=y},function(t,e){t.exports=$},function(t,e){t.exports=k},function(t,e){t.exports=I},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(3),s=(n.n(i),function(){function t(t){this.dateFilter=t}return t.prototype.parseResponseDates=function(t){return this.parseDates(t),t},t.prototype.formatRequestDates=function(t,e){var n=i.copy(t);return this.formatDates(n,e),i.toJson(n)},t.prototype.formatDate=function(t){return this.dateFilter(t,"yyyy-MM-dd")},t.prototype.formatDateTime=function(t){return this.dateFilter(t,"yyyy-MM-ddTHH:mm:ss")},t.prototype.formatDates=function(t,e){for(var n in t)if(t.hasOwnProperty(n))if(i.isDate(t[n])){var s=t[n];e&&e[n]?t[n]=this.formatDateTime(s):t[n]=this.formatDate(s)}else"object"==typeof t[n]&&this.formatDates(t[n],e)},t.prototype.parseDates=function(t){for(var e in t)if(t.hasOwnProperty(e))if("object"==typeof t[e])this.parseDates(t[e]);else{var n=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.*$/.exec(t[e]);if("string"==typeof t[e]&&n&&(t[e]=new Date(t[e])),n=/^\d{4}-\d{2}-\d{2}$/.exec(t[e]),"string"==typeof t[e]&&n){var i=new Date(t[e]);i.setHours(0),t[e]=i}}},t.$inject=["dateFilter"],t}())},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){function t(){}return t.prototype.$onInit=function(){this.selectedDocumentOrgs=this.documentOrgs,this.selectedDocumentType&&this.onDocumentTypeChange()},t.prototype.onChapterChange=function(){this.document.reestr=this.selectedChapter.code,this.selectedChapter&&this.selectedChapter.doc&&this.selectedChapter.doc.length>0?this.selectedDocumentTypes=this.selectedChapter.doc:this.selectedDocumentTypes=this.documentTypes,this.selectedDocumentType=void 0,this.selectedDocumentOrgs=this.documentOrgs},t.prototype.onDocumentTypeChange=function(){var t=this;this.document.documentType=this.selectedDocumentType.docCode,this.document.documentTypeValue=this.selectedDocumentType.docName,this.selectedDocumentOrgs=[],this.documentOrgs.forEach((function(e){t.selectedDocumentType.org&&~t.selectedDocumentType.org.indexOf(e.orgCode)&&t.selectedDocumentOrgs.push(e)})),this.documentTypeChanged({type:this.selectedDocumentType})},t.prototype.isChangeQueue=function(){return"CHANGE_QUEUE"===(this.document.registration?this.document.registration.registrationStatus:null)},t.prototype.changeDocumentOrganization=function(){this.document.documentRequisites.documentOrganizationCode=void 0,this.selectedDocumentOrg=void 0},t.prototype.onDocumentOrgChange=function(){this.document.documentRequisites.documentOrganization=this.selectedDocumentOrg?this.selectedDocumentOrg.shortName:null,this.document.documentRequisites.documentOrganizationCode=this.selectedDocumentOrg?this.selectedDocumentOrg.orgCode:null},t.prototype.onDocumentStatusChange=function(){this.document.documentRequisites.documentStatusCode=this.selectedDocumentStatus.statusCode,this.document.documentRequisites.documentStatusValue=this.selectedDocumentStatus.statusName,this.document.documentRequisites.documentStatusColor=this.selectedDocumentStatus.statusColor[0]},t}(),template:n(33),bindings:{document:"<",chapters:"<",selectedChapter:"<",documentTypes:"<",selectedDocumentType:"<",selectedDocumentTypes:"<",documentOrgs:"<",selectedDocumentOrg:"<",documentStatuses:"<",selectedDocumentStatus:"<",notFoundDocStatuses:"<",documentTypeChanged:"&"}}},function(t,e){t.exports='<div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Реестр <span ng-show=!$ctrl.selectedChapter class=text-danger>*</span></label> <div class="col-lg-7 col-md-8 col-sm-9"> <ui-select ng-model=$ctrl.selectedChapter theme=bootstrap ng-change=$ctrl.onChapterChange()> <ui-select-match placeholder=Реестр...>{{$select.selected.name}}</ui-select-match> <ui-select-choices group-by="\'parent\'" repeat="chapter in $ctrl.chapters | filter: $select.search"> <span style=font-size:13px title={{chapter.name}} ng-bind-html="chapter.name | highlight: $select.search"></span> </ui-select-choices> </ui-select> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> Тип документа <span ng-show=!$ctrl.selectedDocumentType class=text-danger>*</span></label> <div class="col-lg-7 col-md-8 col-sm-9"> <select class=form-control ng-change=$ctrl.onDocumentTypeChange() ng-model=$ctrl.selectedDocumentType ng-options="item as item.docName for item in $ctrl.selectedDocumentTypes"> </select> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> Номер документа <span ng-show=!$ctrl.document.documentRequisites.documentNumber class=text-danger>*</span></label> <div class="col-lg-7 col-md-8 col-sm-9"> <input type=text class=form-control ng-model=$ctrl.document.documentRequisites.documentNumber ng-disabled=$ctrl.isChangeQueue()> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> Дата документа <span ng-show=!$ctrl.document.documentRequisites.documentDate class=text-danger>*</span></label> <div class="col-lg-7 col-md-8 col-sm-9"> <date-selector ng-model=$ctrl.document.documentRequisites.documentDate disabled=$ctrl.isChangeQueue()> </date-selector> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> Наименование документа </label> <div class="col-lg-7 col-md-8 col-sm-9"> <textarea class=form-control rows=2 ng-model=$ctrl.document.documentRequisites.documentName></textarea> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> Организация, выдавшая документ </label> <div class="col-lg-7 col-md-8 col-sm-9"> <select class=form-control ng-change=$ctrl.onDocumentOrgChange() ng-model=$ctrl.selectedDocumentOrg ng-options="item as item.shortName for item in $ctrl.selectedDocumentOrgs"></select> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"></label> <div class="col-lg-7 col-md-8 col-sm-9"> <input type=text ng-change=$ctrl.changeDocumentOrganization() class=form-control ng-model=$ctrl.document.documentRequisites.documentOrganization> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> Лицо, утвердившее документ (ФИО) </label> <div class="col-lg-7 col-md-8 col-sm-9"> <input type=text class=form-control ng-model=$ctrl.document.documentRequisites.documentApproverFIO> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> Лицо, утвердившее документ (должность) </label> <div class="col-lg-7 col-md-8 col-sm-9"> <input type=text class=form-control ng-model=$ctrl.document.documentRequisites.documentApproverPost> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> Статус действия документа </label> <div class="col-lg-7 col-md-8 col-sm-9"> <select name=documentStatus class="form-control our-select" ng-change=$ctrl.onDocumentStatusChange() ng-model=$ctrl.selectedDocumentStatus ng-options="item as item.statusName for item in $ctrl.documentStatuses"> </select> <div class=m-t-sm ng-if="$ctrl.notFoundDocStatuses && $ctrl.notFoundDocStatuses.length > 0"> <span class=text-danger>Следующие значения из документа отсутствуют в справочнике: {{$ctrl.notFoundDocStatuses.join(\', \')}}</span> </div> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> Срок действия документа </label> <div class="col-lg-7 col-md-8 col-sm-9"> <date-selector ng-model=$ctrl.document.documentRequisites.documentExpireDate> </date-selector> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){},template:n(35),bindings:{document:"<"}}},function(t,e){t.exports="<div class=description> <dl class=\"dl-horizontal m-l-md\"> <dt><span>Номер документа</span></dt> <dd>{{$ctrl.document.documentRequisites.documentNumber}}</dd> <dt><span>Дата документа</span></dt> <dd>{{$ctrl.document.documentRequisites.documentDate | date: 'dd.MM.yyyy'}}</dd> <dt ng-if=$ctrl.document.documentRequisites.documentName><span>Наименование документа</span></dt> <dd ng-if=$ctrl.document.documentRequisites.documentName>{{$ctrl.document.documentRequisites.documentName}}</dd> <dt ng-if=$ctrl.document.documentRequisites.documentOrganization><span>Организация, выдавшая документ</span></dt> <dd ng-if=$ctrl.document.documentRequisites.documentOrganization>{{$ctrl.document.documentRequisites.documentOrganization}}</dd> <dt ng-if=$ctrl.document.documentRequisites.documentApproverFIO><span>Лицо, утвердившее документ</span></dt> <dd ng-if=$ctrl.document.documentRequisites.documentApproverFIO> {{$ctrl.document.documentRequisites.documentApproverFIO}} <span ng-if=$ctrl.document.documentRequisites.documentApproverPost>{{$ctrl.document.documentRequisites.documentApproverPost}}</span> </dd> <dt ng-if=$ctrl.document.documentRequisites.documentStatusValue><span>Статус действия документа</span></dt> <dd ng-if=$ctrl.document.documentRequisites.documentStatusValue>{{$ctrl.document.documentRequisites.documentStatusValue}}</dd> <dt ng-if=$ctrl.document.documentRequisites.documentExpireDate><span>Срок действия документа</span></dt> <dd ng-if=$ctrl.document.documentRequisites.documentExpireDate>{{$ctrl.document.documentRequisites.documentExpireDate | date: 'dd.MM.yyyy'}}</dd> </dl> </div>"},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){},template:n(37),bindings:{document:"<"}}},function(t,e){t.exports='<div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Номер регистрации в ИАИС ОГД </label> <div class="col-lg-7 col-md-8 col-sm-9" style=margin-top:7px>{{$ctrl.document.registration.registrationNumber}}</div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Дата регистрации в ИАИС ОГД </label> <div class="col-lg-7 col-md-8 col-sm-9" style=margin-top:7px>{{$ctrl.document.registration.registrationDate | date: \'dd.MM.yyyy\'}}</div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Примечание</label> <div class="col-lg-7 col-md-8 col-sm-9"> <textarea class="form-control our-control" rows=2 ng-model=$ctrl.document.registration.remark></textarea> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Дополнительная информация </label> <div class="col-lg-7 col-md-8 col-sm-9"> <textarea class="form-control our-control" rows=2 ng-model=$ctrl.document.registration.addInfo></textarea> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){},template:n(39),bindings:{document:"<"}}},function(t,e){t.exports="<div class=description> <dl class=\"dl-horizontal m-l-md\"> <dt ng-if=$ctrl.document.registration.registrationNumber><span>Номер регистрации в ИАИС ОГД</span></dt> <dd ng-if=$ctrl.document.registration.registrationNumber>{{$ctrl.document.registration.registrationNumber}}</dd> <dt ng-if=$ctrl.document.registration.registrationDate><span>Дата регистрации в ИАИС ОГД</span></dt> <dd ng-if=$ctrl.document.registration.registrationDate>{{$ctrl.document.registration.registrationDate | date: 'dd.MM.yyyy'}}</dd> <dt ng-if=$ctrl.document.registration.remark><span>Примечание</span></dt> <dd ng-if=$ctrl.document.registration.remark><span>{{$ctrl.document.registration.remark}}</span></dd> <dt ng-if=$ctrl.document.registration.addInfo><span>Дополнительная информация</span></dt> <dd ng-if=$ctrl.document.registration.addInfo><span>{{$ctrl.document.registration.addInfo}}</span></dd> </dl> </div>"},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(0),s=(n.n(i),n(2)),o=(n.n(s),{controller:function(){function t(t,e){this.nsiRestService=t,this.toastr=e}return t.prototype.solicitorSearch=function(t,e){var n=this;t&&t.length>2&&this.nsiRestService.getByStartwith("TabletNumbers",{nickAttr:"list",values:[t]}).then((function(t){t&&t.length>0&&(n.workSheetNumbers=i.map(t,(function(t){return t.list})))})).catch((function(t){n.toastr.error("Ошибка при получении информации из справочника!")}))},t.prototype.onWorkSheetNumbersChange=function(){this.document.territory.workSheetNumber=this.selectedWorkSheetNumbers},t.prototype.onCadastralNumberChange=function(t,e){this.document.territory.cadastralNumber[t]=e,this._hasEmptyCadastralNumber()||this._addNewCadastralNumber(),""===e&&this.document.territory.cadastralNumber.length>1&&this._deleteCadastralNumber(t)},t.prototype._addNewCadastralNumber=function(){this.document.territory.cadastralNumber.push("")},t.prototype._hasEmptyCadastralNumber=function(){return this.document.territory.cadastralNumber.some((function(t){return""===t}))},t.prototype._deleteCadastralNumber=function(t){this.document.territory.cadastralNumber.splice(t,1)},t.prototype.onAreaChange=function(){var t=this,e=[];if(this.selectedAreas.forEach((function(t){var n=new s.DocumentTerritoryArea;n.areaName=t.name,n.areaCode=t.code,e.push(n)})),this.document.territory.area=e,this.selectedAreas.length>0){var n=[];this.districts.forEach((function(e){t.selectedAreas.forEach((function(t){e.perfectId&&e.perfectId.length>0&&e.perfectId.forEach((function(i){i.code===t.code&&n.push(e)}))}))})),this.districtsByArea=n}else this.districtsByArea=this.districts;var i=[];this.selectedDistricts.forEach((function(e){t.districtsByArea.forEach((function(t){e.code===t.code&&i.push(e)}))})),this.selectedDistricts=i;var o=[];this.selectedDistricts.forEach((function(t){o.push({districtName:t.name,districtCode:t.code})})),this.document.territory.district=o},t.prototype.onDocTerritoryChange=function(){this.document.territory.docTerritory=this.selectedDocTerritory},t.prototype.onDistrictChange=function(){var t=[];this.selectedDistricts.forEach((function(e){t.push({districtName:e.name,districtCode:e.code})})),this.document.territory.district=t},t.$inject=["nsiRestService","toastr"],t}(),template:n(41),bindings:{document:"<",areas:"<",selectedAreas:"<",districts:"<",districtsByArea:"<",selectedDistricts:"<",docTerritories:"<",selectedDocTerritory:"<",notFoundAreas:"<",notFoundDistricts:"<",workSheetNumbers:"<",selectedWorkSheetNumbers:"<"}})},function(t,e){t.exports='<div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Округ</label> <div class="col-lg-7 col-md-8 col-sm-9"> <ui-select multiple=multiple ng-model=$ctrl.selectedAreas theme=bootstrap ng-change=$ctrl.onAreaChange()> <ui-select-match placeholder=Округ>{{$item.name}}</ui-select-match> <ui-select-choices repeat="item in $ctrl.areas track by item.code"> {{item.name}} </ui-select-choices> </ui-select> <div class=m-t-sm ng-if="$ctrl.notFoundAreas && $ctrl.notFoundAreas.length > 0"> <span class=text-danger>Следующие значения из документа отсутствуют в справочнике: {{$ctrl.notFoundAreas.join(\', \')}}</span> </div> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Район </label> <div class="col-lg-7 col-md-8 col-sm-9"> <ui-select multiple=multiple ng-model=$ctrl.selectedDistricts theme=bootstrap ng-change=$ctrl.onDistrictChange()> <ui-select-match placeholder=Район>{{$item.name}}</ui-select-match> <ui-select-choices repeat="item in $ctrl.districtsByArea track by item.code"> {{item.name}} </ui-select-choices> </ui-select> <div class=m-t-sm ng-if="$ctrl.notFoundDistricts && $ctrl.notFoundDistricts.length > 0"> <span class=text-danger>Следующие значения из документа отсутствуют в справочнике: {{$ctrl.notFoundDistricts.join(\', \')}}</span> </div> </div> </div> <div class=form-group ng-repeat="cadastralNumber in $ctrl.document.territory.cadastralNumber track by $index"> <label class="col-lg-3 col-md-3 col-sm-3 control-label"><span ng-if=$first>Кадастровый номер</span> </label> <div class="col-lg-7 col-md-8 col-sm-9"> <div> <input name="{{\'cadastralNumber\' + $index}}" type=text class=form-control ng-model=cadastralNumber ng-change="$ctrl.onCadastralNumberChange($index, cadastralNumber)" pattern=[\\d:]*> </div> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"><span>Номер планшета</span> </label> <div class="col-lg-7 col-md-8 col-sm-9"> <ui-select multiple=multiple ng-model=$ctrl.selectedWorkSheetNumbers theme=bootstrap ng-change=$ctrl.onWorkSheetNumbersChange()> <ui-select-match placeholder="Номер планшета">{{$item}}</ui-select-match> <ui-select-choices repeat="wn in $ctrl.workSheetNumbers | filter: $select.search" refresh="$ctrl.solicitorSearch($select.search, $select)" refresh-delay=100> {{wn}} </ui-select-choices> </ui-select> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Территория действия документа</label> <div class="col-lg-7 col-md-8 col-sm-9"> <ui-select ng-model=$ctrl.selectedDocTerritory theme=bootstrap ng-change=$ctrl.onDocTerritoryChange()> <ui-select-match>{{$select.selected.name}}</ui-select-match> <ui-select-choices repeat="item in $ctrl.docTerritories track by item.code"> {{item.name}} </ui-select-choices> </ui-select> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(0),s=(n.n(i),{controller:function(){function t(){}return t.prototype.getAreaString=function(t){if(t)return i.map(t,(function(t){return t.areaName})).join(", ")},t.prototype.getDistrictString=function(t){if(t)return i.map(t,(function(t){return t.districtName})).join(", ")},t}(),template:n(43),bindings:{document:"<"}})},function(t,e){t.exports='<div class=description> <dl class="dl-horizontal m-l-md"> <dt ng-if="$ctrl.document.territory.area && $ctrl.document.territory.area.length > 0"><span>Округ</span></dt> <dd ng-if="$ctrl.document.territory.area && $ctrl.document.territory.area.length > 0">{{$ctrl.getAreaString($ctrl.document.territory.area)}}</dd> <dt ng-if="$ctrl.document.territory.district && $ctrl.document.territory.district.length > 0"><span>Район</span></dt> <dd ng-if="$ctrl.document.territory.district && $ctrl.document.territory.district.length > 0">{{$ctrl.getDistrictString($ctrl.document.territory.district)}}</dd> <dt ng-if="$ctrl.document.territory.cadastralNumber && $ctrl.document.territory.cadastralNumber.length > 0"><span>Кадастровый номер</span></dt> <dd ng-if="$ctrl.document.territory.cadastralNumber && $ctrl.document.territory.cadastralNumber.length > 0">{{$ctrl.document.territory.cadastralNumber.join(\', \')}}</dd> <dt ng-if="$ctrl.document.territory.workSheetNumber && $ctrl.document.territory.workSheetNumber.length > 0"><span>Номер планшета</span></dt> <dd ng-if="$ctrl.document.territory.workSheetNumber && $ctrl.document.territory.workSheetNumber.length > 0"> <div ng-repeat="w in $ctrl.document.territory.workSheetNumber">{{w}}</div> </dd> <dt ng-if=$ctrl.document.territory.docTerritory><span>Территория действия документа</span></dt> <dd ng-if=$ctrl.document.territory.docTerritory>{{$ctrl.document.territory.docTerritory.name}}</dd> </dl> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(2),s=(n.n(i),{controller:function(){function t(t){this.$uibModal=t}return t.prototype.onObjectFinanceChange=function(){this.document.object.objectFinanceCode=this.selectedFinance.financeCode,this.document.object.objectFinanceValue=this.selectedFinance.financeName},t.prototype.clearFNO=function(){delete this.document.object.objectTypeCode,delete this.document.object.objectTypeName},t.prototype.chooseFNO=function(){var t=this,e=this.buildSelectedTree(this.fnos);this.$uibModal.open({component:"dictionary-modal",size:"lg",resolve:{name:function(){return"Выбор функционального назначения (306-ПП)"},multiple:function(){return!1},tree:function(){return e},selectedItems:function(){var e=t.document.object;return e?[e.objectTypeCode]:[]}}}).result.then((function(e){if(e&&e.length>0){var n=t.findInDictByCode(t.fnos,e[0]);t.document.object=new i.DocumentObject(t.document.object),t.document.object.objectTypeCode=n.fnoCode,t.document.object.objectTypeName=n.fnoName}}))},t.prototype.findInDictByCode=function(t,e){var n=this,i=null;return t.forEach((function(t){if(t.fnoCode===e&&(i=t),void 0!==t.children&&null!==t.children){var s=n.findInDictByCode(t.children,e);null!==s&&(i=s)}})),i},t.prototype.buildSelectedTree=function(t){var e=this,n=null;return t.forEach((function(t){null===n&&(n=[]);var i=void 0===t.children||null===t.children?null:e.buildSelectedTree(t.children),s=t.fnoName+" ["+t.fnoCode+"]",o={parent:null,id:t.fnoCode,template:s,children:i,expanded:!1,checked:!1,disabled:!1,selectable:!0};i&&i.forEach((function(t){t.parent=o})),n.push(o)})),n},t.$inject=["$uibModal"],t}(),template:n(45),bindings:{document:"<",finance:"<",selectedFinance:"<",fnos:"<",notFoundFinance:"<"}})},function(t,e){t.exports='<div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Строительный адрес</label> <div class="col-lg-7 col-md-8 col-sm-9"> <input type=text class=form-control ng-model=$ctrl.document.object.objectAddress> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Присвоенный адрес</label> <div class="col-lg-7 col-md-8 col-sm-9"> <input type=text class=form-control ng-model=$ctrl.document.object.postAddress> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Наименование объекта</label> <div class="col-lg-7 col-md-8 col-sm-9"> <input type=text class=form-control ng-model=$ctrl.document.object.objectName> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Функциональное назначение</label> <div class="col-lg-7 col-md-8 col-sm-9"> <input type=text class=form-control ng-model=$ctrl.document.object.objectTypeDoc> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> Функциональное назначение (306-ПП) </label> <div class="col-lg-7 col-md-8 col-sm-9"> <div ng-show=$ctrl.document.object.objectTypeCode> <label class=control-label>{{$ctrl.document.object.objectTypeName}}&nbsp; <button ng-show=$ctrl.document.object.objectTypeCode ng-click=$ctrl.clearFNO() type=button class="btn btn-link" style=padding:0><i class="fa fa-trash text-danger" aria-hidden=true></i></button> </label> </div> <button ng-show=!$ctrl.document.object.objectTypeCode ng-click=$ctrl.chooseFNO() type=button class="btn btn-primary"><i class="fa fa-bars"></i> &nbsp;Выбрать из справочника</button> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Источник финансирования</label> <div class="col-lg-7 col-md-8 col-sm-9"> <select class="form-control our-select" ng-model=$ctrl.selectedFinance ng-change=$ctrl.onObjectFinanceChange() ng-options="item as item.financeName for item in $ctrl.finance"> </select> <div class=m-t-sm ng-if="$ctrl.notFoundFinance && $ctrl.notFoundFinance.length > 0"> <span class=text-danger>Следующие значения из документа отсутствуют в справочнике: {{$ctrl.notFoundFinance.join(\', \')}}</span> </div> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){},template:n(47),bindings:{document:"<"}}},function(t,e){t.exports='<div class=description> <dl class="dl-horizontal m-l-md"> <dt ng-if=$ctrl.document.object.objectAddress><span>Строительный адрес</span></dt> <dd ng-if=$ctrl.document.object.objectAddress>{{$ctrl.document.object.objectAddress}}</dd> <dt ng-if=$ctrl.document.object.postAddress><span>Присвоенный адрес</span></dt> <dd ng-if=$ctrl.document.object.postAddress>{{$ctrl.document.object.postAddress}}</dd> <dt ng-if=$ctrl.document.object.objectName><span>Наименование объекта</span></dt> <dd ng-if=$ctrl.document.object.objectName>{{$ctrl.document.object.objectName}}</dd> <dt ng-if=$ctrl.document.object.objectTypeDoc><span>Функциональное назначение</span></dt> <dd ng-if=$ctrl.document.object.objectTypeDoc>{{$ctrl.document.object.objectTypeDoc}}</dd> <dt ng-if=$ctrl.document.object.objectTypeName><span>Функциональное назначение (306-ПП)</span></dt> <dd ng-if=$ctrl.document.object.objectTypeName>{{$ctrl.document.object.objectTypeName}}</dd> <dt ng-if=$ctrl.document.object.objectFinanceValue><span>Источник финансирования</span></dt> <dd ng-if=$ctrl.document.object.objectFinanceValue>{{$ctrl.document.object.objectFinanceValue}}</dd> </dl> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(0),s=(n.n(i),n(2)),o=(n.n(s),{controller:function(){function t(){}return t.prototype._addNewSpecific=function(){var t=new s.DocumentSpecific;t.specificCode=this.specifics[0].code,t.specificName=this.specifics[0].name,t.specificValue="",this.document.specific||(this.document.specific=[]),this.document.specific.push(t)},t.prototype._deleteSpecific=function(t){this.document.specific.splice(t,1)},t.prototype._hasEmptySpecific=function(){return this.document.specific.some((function(t){return""===t.specificValue}))},t.prototype.onSpecificTypeChanged=function(t){var e=this,n=i.find(this.specifics,(function(n){return n.specificCode==e.document.specific[t].specificCode}));this.document.specific[t].specificName=n.specificName},t.prototype.onSpecificValueChange=function(t,e){this._hasEmptySpecific()||this._addNewSpecific(),""===e&&this._deleteSpecific(t)},t}(),template:n(49),bindings:{document:"<",specifics:"<"}})},function(t,e){t.exports='<div class=m-l-md> <table class=table> <thead> <tr> <th class="col-lg-3 col-md-3">Атрибут</th> <th>Значение</th> </tr> </thead> <tbody> <tr ng-repeat="specific in $ctrl.document.specific"> <td> <select class="form-control our-select" ng-model=specific.specificCode ng-change=$ctrl.onSpecificTypeChanged($index) ng-options="item.specificCode as item.specificName for item in $ctrl.specifics"></select> </td> <td> <input type=text class=form-control ng-model=specific.specificValue ng-change="$ctrl.onSpecificValueChange($index, specific.specificValue)"> </td> </tr> </tbody> </table> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){},template:n(51),bindings:{document:"<"}}},function(t,e){t.exports='<dl class="dl-horizontal m-l-md"> <dt ng-repeat-start="item in $ctrl.document.specific"><span>{{item.specificName}}</span></dt> <dd ng-repeat-end>{{item.specificValue}}</dd> </dl>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){},template:n(53),bindings:{document:"<"}}},function(t,e){t.exports='<div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Регистрационный номер заявления</label> <div class="col-lg-7 col-md-8 col-sm-9"> <input type=text class=form-control ng-model=$ctrl.document.request.requestNumber> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Дата регистрации заявления</label> <div class="col-lg-7 col-md-8 col-sm-9"> <date-selector ng-model=$ctrl.document.request.requestDate></date-selector> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Номер заявления ПГУ</label> <div class="col-lg-7 col-md-8 col-sm-9"> <input type=text class=form-control ng-model=$ctrl.document.request.pguRequestNumber> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Дата заявления ПГУ</label> <div class="col-lg-7 col-md-8 col-sm-9"> <date-selector ng-model=$ctrl.document.request.pguRequestDate></date-selector> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Единый номер обращения ПГУ</label> <div class="col-lg-7 col-md-8 col-sm-9"> <input type=text class=form-control ng-model=$ctrl.document.request.eno> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){},template:n(55),bindings:{document:"<"}}},function(t,e){t.exports='<div class=description> <dl class="dl-horizontal m-l-md"> <dt ng-if="$ctrl.document.request.requestNumber || $ctrl.document.request.requestDate"><span>Заявление</span></dt> <dd ng-if="$ctrl.document.request.requestNumber || $ctrl.document.request.requestDate"> <span ng-if=$ctrl.document.request.requestNumber>№ {{$ctrl.document.request.requestNumber}}</span> <span ng-if=$ctrl.document.request.requestDate>от {{$ctrl.document.request.requestDate | date: \'dd.MM.yyyy\'}}</span> </dd> <dt ng-if="$ctrl.document.request.pguRequestNumber || $ctrl.document.request.pguRequestDate"><span>Заявление ПГУ</span></dt> <dd ng-if="$ctrl.document.request.pguRequestNumber || $ctrl.document.request.pguRequestDate"> <span ng-if=$ctrl.document.request.pguRequestNumber>№ {{$ctrl.document.request.pguRequestNumber}}</span> <span ng-if=$ctrl.document.request.pguRequestDate>от {{$ctrl.document.request.pguRequestDate | date: \'dd.MM.yyyy\'}}</span> </dd> <dt ng-if=$ctrl.document.request.eno><span>Единый номер обращения ПГУ</span></dt> <dd ng-if=$ctrl.document.request.eno>{{$ctrl.document.request.eno}}</dd> </dl> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){function t(){}return t.prototype.changeDocumentOrganization=function(){this.document.approveDocument.approveOrganizationCode=void 0,this.selectedDocumentOrg=void 0},t.prototype.onDocumentOrgChange=function(){this.document.approveDocument.approveOrganization=this.selectedDocumentOrg.shortName,this.document.approveDocument.approveOrganizationCode=this.selectedDocumentOrg.orgCode},t.prototype.onApproveDocumentTypeChange=function(){this.document.approveDocument.approveDocumentValue=this.selectedApprovedocType.approvedocName,this.document.approveDocument.approveDocumentType=this.selectedApprovedocType.approvedocCode},t}(),template:n(57),bindings:{document:"<",selectedDocumentOrg:"<",documentOrgs:"<",approvedocTypes:"<",selectedApprovedocType:"<"}}},function(t,e){t.exports='<div class=form-group> <label class="col-md-3 control-label"> Тип утверждающего документа </label> <div class=col-md-9> <select class=form-control ng-model=$ctrl.selectedApprovedocType ng-change=$ctrl.onApproveDocumentTypeChange() ng-options="item as item.approvedocName for item in $ctrl.approvedocTypes"></select> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> Номер утверждающего документа </label> <div class="col-lg-7 col-md-8 col-sm-9"> <input type=text class=form-control ng-model=$ctrl.document.approveDocument.approveDocumentNumber> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> Дата утверждающего документа </label> <div class="col-lg-7 col-md-8 col-sm-9"> <date-selector ng-model=$ctrl.document.approveDocument.approveDocumentDate></date-selector> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> Организация, выдавшая утверждающий документ </label> <div class="col-lg-7 col-md-8 col-sm-9"> <select class=form-control ng-change=$ctrl.onDocumentOrgChange() ng-model=$ctrl.selectedDocumentOrg ng-options="item as item.shortName for item in $ctrl.documentOrgs"></select> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"></label> <div class="col-lg-7 col-md-8 col-sm-9"> <input type=text ng-change=$ctrl.changeDocumentOrganization() class=form-control ng-model=$ctrl.document.approveDocument.approveOrganization> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){},template:n(59),bindings:{approveDocument:"<"}}},function(t,e){t.exports='<div class=description> <dl class="dl-horizontal m-l-md"> <dt ng-if="$ctrl.approveDocument.approveDocumentNumber || $ctrl.approveDocument.approveDocumentDate"><span>Утверждающий документ</span> </dt> <dd ng-if="$ctrl.approveDocument.approveDocumentNumber || $ctrl.approveDocument.approveDocumentDate"> <span>{{$ctrl.approveDocument.approveDocumentValue}}</span> <span ng-if=$ctrl.approveDocument.approveDocumentNumber>№ {{$ctrl.approveDocument.approveDocumentNumber}}</span> <span ng-if=$ctrl.approveDocument.approveDocumentDate>от {{$ctrl.approveDocument.approveDocumentDate | date: \'dd.MM.yyyy\'}}</span> </dd> <dt ng-if=$ctrl.approveDocument.approveOrganization><span>Организация, выдавшая утверждающий документ</span></dt> <dd ng-if=$ctrl.approveDocument.approveOrganization>{{$ctrl.approveDocument.approveOrganization}}</dd> </dl> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(2),s=(n.n(i),{controller:function(){function t(){}return t.prototype.addLinkDocument=function(){this.document.linkDocument||(this.document.linkDocument=[]);var t=new i.DocumentLinkDocument;t.linkDocumentNumber="",this.document.linkDocument.push(t)},t.prototype.linkDocChange=function(t,e){var n=this;this.documentTypes.forEach((function(i){i.docCode===e&&(n.document.linkDocument[t].linkDocumentTypeName=i.docName)}))},t.prototype.deleteLinkDocument=function(t){this.document.linkDocument.splice(t,1)},t}(),template:n(61),bindings:{document:"<",documentTypes:"<"}})},function(t,e){t.exports='<div class=m-l-md> <table class=table> <thead> <tr> <th style=vertical-align:bottom>Тип документа</th> <th style=vertical-align:bottom>Номер</th> <th style=vertical-align:bottom;width:220px>Дата</th> <th style=width:50px> <button ng-click=$ctrl.addLinkDocument() class="btn btn-primary"><i class="fa fa-plus" aria-hidden=true></i></button> </th> </tr> </thead> <tbody> <tr ng-if="$ctrl.document.linkDocument && $ctrl.document.linkDocument.length > 0" ng-repeat="l in $ctrl.document.linkDocument"> <td> <select class=form-control ng-change="$ctrl.linkDocChange($index, l.linkDocumentTypeCode)" ng-model=l.linkDocumentTypeCode ng-options="item.docCode as item.docName for item in $ctrl.documentTypes"></select> </td> <td> <input type=text class=form-control ng-model=l.linkDocumentNumber> </td> <td> <date-selector ng-model=l.linkDocumentDate></date-selector> </td> <td> <button ng-click=$ctrl.deleteLinkDocument($index) class="btn btn-danger"><i class="fa fa-trash" aria-hidden=true></i></button> </td> </tr> <tr ng-if="!($ctrl.document.linkDocument && $ctrl.document.linkDocument.length > 0)"> <td colspan=4 style=text-align:center> данные отсутствуют </td> </tr> </tbody> </table> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){},template:n(63),bindings:{document:"<"}}},function(t,e){t.exports='<div class=description> <dl class="dl-horizontal m-l-md"> <dt ng-repeat-start="item in $ctrl.document.linkDocument"><span>{{item.linkDocumentTypeName}}</span></dt> <dd ng-repeat-end> <span ng-if=item.linkDocumentNumber>№ {{item.linkDocumentNumber}}</span> <span ng-if=item.linkDocumentDate>от {{item.linkDocumentDate | date: \'dd.MM.yyyy\'}}</span> </dd> </dl> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(0),s=(n.n(i),n(2)),o=(n.n(s),{controller:function(){function t(){}return t.prototype.tepCodeChanged=function(t){if(t.tepCode){var e=this.getTepByCode(t.tepCode);t.tepName=e.tepName}else t.tepName=""},t.prototype.tepValueChanged=function(t,e){this.hasEmptyTep()||this.addNewTep(),""===e&&(this.document.teps,this.document.teps.splice(t,1))},t.prototype.getTepByCode=function(t){return i.find(this.teps,(function(e){return e.tepCode==t}))},t.prototype.addNewTep=function(){var t=new s.TEP;this.document.teps.push(t)},t.prototype.hasEmptyTep=function(){return i.some(this.document.teps,(function(t){return""===t.tepValue}))},t}(),template:n(65),bindings:{document:"<",teps:"<"}})},function(t,e){t.exports='<table class=table> <thead> <tr> <th class="col-lg-4 col-md-4">Классификатор ТЭПов</th> <th>Наименование показателя</th> <th class="col-lg-3 col-md-3">Значение</th> </tr> </thead> <tbody> <tr ng-repeat="tep in $ctrl.document.teps"> <td> <select name=tepCode class="form-control our-select" ng-model=tep.tepCode ng-change=$ctrl.tepCodeChanged(tep) ng-init=tep ng-options="item.tepCode as (item.tepCode + \' \' + item.tepName) for item in $ctrl.teps"></select> </td> <td> <input type=text class=form-control ng-disabled=tep.tepCode ng-model=tep.tepName>  </td> <td> <input type=text class=form-control ng-disabled="!tep.tepCode && !tep.tepName" ng-model=tep.tepValue ng-change="$ctrl.tepValueChanged($index, tep.tepValue)"> </td> </tr> </tbody> </table> <div class="form-group m-t-md"> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Дополнительная информация </label> <div class="col-lg-9 col-md-9 col-sm-9"> <textarea type=text class=form-control ng-model=$ctrl.document.tepsAddInfo></textarea> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){},template:n(67),bindings:{document:"<"}}},function(t,e){t.exports='<div ng-if=$ctrl.document.teps class="table-responsive m-l-md"> <table class=table> <thead> <tr> <th class="col-lg-2 col-md-2">Код</th> <th>Наименование показателя</th> <th class="col-lg-3 col-md-3">Значение</th> </tr> </thead> <tbody> <tr ng-repeat="tep in $ctrl.document.teps"> <td>{{tep.tepCode}}</td> <td>{{tep.tepName}}</td> <td>{{tep.tepValue}}</td> </tr> </tbody> </table> </div> <div ng-if=$ctrl.document.tepsAddInfo class=description> <dl class="dl-horizontal m-l-md"> <dt><span>Дополнительная информация</span></dt> <dd>{{$ctrl.document.tepsAddInfo}}</dd> </dl> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){this.documentRequisitesShow=!0,this.registrationShow=!0,this.territoryShow=!0,this.objectShow=!0,this.specificShow=!0,this.requestShow=!0,this.approveDocumentShow=!0,this.linkDocumentShow=!0,this.organizationsShow=!0,this.tepShow=!0,this.operatorShow=!0},template:n(69),bindings:{document:"<"}}},function(t,e){t.exports=' <expanded-section show=$ctrl.document.documentRequisites expand=$ctrl.documentRequisitesShow> <header style=display:inline>Реквизиты документа</header> <content> <document-requisites-view document=$ctrl.document></document-requisites-view> </content> </expanded-section> <expanded-section show="$ctrl.document.registration && ($ctrl.document.registration.registrationNumber || $ctrl.document.registration.registrationDate)" expand=$ctrl.registrationShow> <header style=display:inline>Регистрация в ИАИС ОГД</header> <content> <document-registration-view document=$ctrl.document></document-registration-view> </content> </expanded-section> <expanded-section show=$ctrl.document.territory expand=$ctrl.territoryShow> <header style=display:inline>Территория</header> <content> <document-territory-view document=$ctrl.document></document-territory-view> </content> </expanded-section> <expanded-section show=$ctrl.document.object expand=$ctrl.objectShow> <header style=display:inline>Объект капитального строительства</header> <content> <document-object-view document=$ctrl.document></document-object-view> </content> </expanded-section> <expanded-section show=$ctrl.document.specific expand=$ctrl.specificShow> <header style=display:inline>Атрибуты документа</header> <content> <div class=description> <document-specific-view document=$ctrl.document specifics=$ctrl.specifics></document-specific-view> </div> </content> </expanded-section> <expanded-section show=$ctrl.document.request expand=$ctrl.requestShow> <header style=display:inline>Заявление на подготовку документа</header> <content> <document-request-view document=$ctrl.document></document-request-view> </content> </expanded-section> <expanded-section show=$ctrl.document.approveDocument expand=$ctrl.approveDocumentShow> <header style=display:inline>Утверждающий документ</header> <content> <document-approve-view approve-document=$ctrl.document.approveDocument></document-approve-view> </content> </expanded-section> <expanded-section show=$ctrl.document.linkDocument expand=$ctrl.linkDocumentShow> <header style=display:inline>Связанные документы</header> <content> <document-link-view document=$ctrl.document></document-link-view> </content> </expanded-section> <expanded-section show=$ctrl.document.organizations expand=$ctrl.organizationsShow> <header style=display:inline>Организации</header> <content> <document-organization-view document=$ctrl.document></document-organization-view> </content> </expanded-section> <expanded-section show="$ctrl.document.teps || $ctrl.document.tepsAddInfo" expand=$ctrl.tepShow> <header style=display:inline>ТЭПы</header> <content> <document-tep-view document=$ctrl.document></document-tep-view> </content> </expanded-section> <expanded-section show=$ctrl.document.operator expand=$ctrl.operatorShow> <header style=display:inline>Оператор</header> <content> <div class=description> <dl class="dl-horizontal m-l-md"> <dt><span>ФИО оператора</span></dt> <dd><span>{{$ctrl.document.operator.operatorFIO}}</span></dd> <dt><span>Взято в работу</span></dt> <dd><span>{{$ctrl.document.operator.operatorDate | date: \'dd.MM.yyyy\'}}</span></dd> </dl> </div> </content> </expanded-section> '},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(0),s=(n.n(i),n(71)),o=n(1),c=(n.n(o),n(2)),r=(n.n(c),{controller:function(){function t(t,e){this.nsiRestService=t,this.documentService=e,this.loadingStatus=o.LoadingStatus.LOADING,this.documentRequisitesShow=!0,this.registrationShow=!0,this.territoryShow=!0,this.objectShow=!0,this.specificShow=!0,this.requestShow=!0,this.approveDocumentShow=!0,this.linkDocumentShow=!0,this.organizationsShow=!0,this.tepShow=!0,this.operatorShow=!0,this.selectedDocumentType=null,this.selectedWorkSheetNumbers=[],this.selectedAreas=[],this.districtsByArea=[],this.selectedDistricts=[],this.finance=[],this.notFoundAreas=[],this.notFoundDistricts=[],this.notFoundFinance=[],this.notFoundDocStatuses=[]}return t.prototype.$onChanges=function(t){t.selectedDocumentType&&t.selectedDocumentType.currentValue&&this.showSections()},t.prototype.hideSection=function(t){var e=this,n=!1;return this.selectedDocumentType&&this.fieldsDocumentISOGD.forEach((function(s){s.xPath===t&&s.hideDoc&&s.hideDoc.length&&s.hideDoc.length>0&&i.find(s.hideDoc,(function(t){return t===e.selectedDocumentType.docCode}))&&(n=!0)})),n},t.prototype.documentTypeChanged=function(t){this.selectedDocumentType=t,this.showSections()},t.prototype.showSections=function(){this.showRegistration=!(this.hideSection("registration")&&this.isEmptyObject(this.document.registration)),this.showTerritory=!(this.hideSection("territory")&&this.isEmptyObject(this.document.territory)),this.showObject=!(this.hideSection("object")&&this.isEmptyObject(this.document.object)),this.showSpecific=!(this.hideSection("specific")&&this.isEmptyObject(this.document.specific)),this.showRequest=!(this.hideSection("request")&&this.isEmptyObject(this.document.request)),this.showApproveDocument=!(this.hideSection("approveDocument")&&this.isEmptyObject(this.document.approveDocument)),this.showLinkDocument=!(this.hideSection("linkDocument")&&this.isEmptyObject(this.document.linkDocument)),this.showOrganizations=!(this.hideSection("organizations")&&this.isEmptyObject(this.document.organizations)),this.showTeps=!(this.hideSection("teps")&&this.isEmptyObject(this.document.teps))},t.prototype.$onInit=function(){var t=this;this.nsiRestService.get("OldChapters").then((function(e){return t.chapters=s.a.transform(e),t.copy&&(t.chapters=i.filter(t.chapters,(function(t){return"8400"===t.code||"8599"===t.code}))),t.chapters.forEach((function(e){e.code===t.document.reestr&&(t.selectedChapter=e)})),t.nsiRestService.get("DocumentTypes")})).then((function(e){return t.documentTypes=e,t.selectedChapter&&t.selectedChapter.doc&&t.selectedChapter.doc.length>0?t.selectedDocumentTypes=t.selectedChapter.doc:t.selectedDocumentTypes=t.documentTypes,t.selectedDocumentTypes.forEach((function(e){e.docCode===t.document.documentType&&(t.selectedDocumentType=e)})),t.nsiRestService.get("fieldsDocumentISOGD")})).then((function(e){return t.fieldsDocumentISOGD=e,t.nsiRestService.get("DocumentOrg")})).then((function(e){return t.documentOrgs=e,t.document.documentRequisites&&t.document.documentRequisites.documentOrganizationCode&&t.documentOrgs.forEach((function(e){e.orgCode===t.document.documentRequisites.documentOrganizationCode&&(t.selectedDocumentOrg=e)})),t.document.approveDocument&&t.document.approveDocument.approveOrganizationCode&&t.documentOrgs.forEach((function(e){e.orgCode===t.document.approveDocument.approveOrganizationCode&&(t.selectedDocumentOrg1=e)})),t.document.territory&&t.document.territory.workSheetNumber&&t.document.territory.workSheetNumber.length>0&&(t.selectedWorkSheetNumbers=t.document.territory.workSheetNumber),t.nsiRestService.get("DocumentStatus")})).then((function(e){var n;(t.documentStatuses=e,t.document.documentRequisites)&&(t.document.documentRequisites.documentStatusCode?t.documentStatuses.forEach((function(e){e.statusCode===t.document.documentRequisites.documentStatusCode&&(t.selectedDocumentStatus=e)})):t.document.documentRequisites.documentStatusValue&&(t.documentStatuses.forEach((function(e){e.synonym&&e.synonym.length>0&&e.synonym.forEach((function(i){i===t.document.documentRequisites.documentStatusValue&&(n=e)}))})),n?(t.selectedDocumentStatus=n,t.document.documentRequisites.documentStatusCode=t.selectedDocumentStatus.statusCode,t.document.documentRequisites.documentStatusColor=t.selectedDocumentStatus.statusColor[0],t.document.documentRequisites.documentStatusValue=t.selectedDocumentStatus.statusValue):t.notFoundDocStatuses.push(t.document.documentRequisites.documentStatusValue)));return t.nsiRestService.get("Prefect")})).then((function(e){return t.areas=e,t.document.territory&&t.document.territory.area&&t.document.territory.area.length>0&&t.document.territory.area.forEach((function(e){var n;e.areaCode?t.areas.forEach((function(n){n.code===e.areaCode&&t.selectedAreas.push(n)})):e.areaName&&(t.areas.forEach((function(t){t.synonyms&&t.synonyms.length>0&&t.synonyms.forEach((function(i){i===e.areaName&&(n=t)}))})),n?(e.areaCode=n.code,e.areaName=n.name,t.selectedAreas.push(n)):t.notFoundAreas.push(e.areaName))})),t.nsiRestService.get("District")})).then((function(e){if(t.districts=e,t.document.territory&&t.document.territory.district&&t.document.territory.district.length>0&&t.document.territory.district.forEach((function(e){var n;e.districtCode?t.districts.forEach((function(n){n.code===e.districtCode&&t.selectedDistricts.push(n)})):e.districtName&&(t.districts.forEach((function(t){t.synonyms&&t.synonyms.length>0&&t.synonyms.forEach((function(i){i===e.districtName&&(n=t)}))})),n?(e.districtCode=n.code,e.districtName=n.name,t.selectedDistricts.push(n)):t.notFoundDistricts.push(e.districtName))})),t.selectedAreas.length>0){var n=[];t.districts.forEach((function(e){t.selectedAreas.forEach((function(t){e.perfectId&&e.perfectId.length>0&&e.perfectId.forEach((function(i){i.code===t.code&&n.push(e)}))}))})),t.districtsByArea=n}else t.districtsByArea=t.districts;return t.nsiRestService.get("Finance")})).then((function(e){var n;(t.finance=e,t.document.object)&&(t.document.object.objectFinanceCode?t.finance.forEach((function(e){e.financeCode===t.document.object.objectFinanceCode&&(t.selectedFinance=e)})):t.document.object.objectFinanceValue&&(t.finance.forEach((function(e){e.synonyms&&e.synonyms.length>0&&e.synonyms.forEach((function(i){i===t.document.object.objectFinanceValue&&(n=e)}))})),n?(t.selectedFinance=n,t.document.object.objectFinanceCode=t.selectedFinance.financeCode,t.document.object.objectFinanceValue=t.selectedFinance.financeName):t.notFoundFinance.push(t.document.object.objectFinanceValue)));return t.nsiRestService.get("Specific")})).then((function(e){return t.specifics=e,t.nsiRestService.get("DocTerritory")})).then((function(e){return t.docTerritories=e,t.document.territory&&t.document.territory.docTerritory&&t.docTerritories.forEach((function(e){e.code===t.document.territory.docTerritory.code&&(t.selectedDocTerritory=e)})),t.nsiRestService.get("ApprovedocTypes")})).then((function(e){return t.approvedocTypes=e,t.document.approveDocument&&t.document.approveDocument.approveDocumentType&&t.approvedocTypes.forEach((function(e){e.approvedocCode===t.document.approveDocument.approveDocumentType&&(t.selectedApprovedocType=e)})),t.nsiRestService.get("OrgRoles")})).then((function(e){return t.orgRoles=e,t.nsiRestService.get("OrgTypes")})).then((function(e){return t.orgTypes=e,t.nsiRestService.get("TEP")})).then((function(e){return t.teps=i.concat([{tepCode:"",tepName:""}],e),t.nsiRestService.get("FNO")})).then((function(e){t.fnos=e,t.document.approveDocument||(t.document.approveDocument=new c.DocumentApproveDocument),t.document.territory||(t.document.territory=new c.DocumentTerritory),t.document.territory&&(t.document.territory.cadastralNumber||(t.document.territory.cadastralNumber=[]),t.document.territory.cadastralNumber&&0===t.document.territory.cadastralNumber.length&&t.document.territory.cadastralNumber.push(""),t.document.territory.workSheetNumber||(t.document.territory.workSheetNumber=[]),t.document.territory.workSheetNumber&&0===t.document.territory.workSheetNumber.length&&t.document.territory.workSheetNumber.push(""));var n=new c.DocumentSpecific;n.specificCode=t.specifics[0].code,n.specificName=t.specifics[0].name,n.specificValue="",t.document.specific||(t.document.specific=[]),t.document.specific.push(n);var i=new c.TEP;i.tepName="",i.tepValue="",i.tepCode="",t.document.teps||(t.document.teps=[]),t.document.teps.push(i),t.showSections(),t.loadingStatus=o.LoadingStatus.SUCCESS})).catch((function(e){console.log(e),t.loadingStatus=o.LoadingStatus.ERROR}))},t.prototype.isEmptyObject=function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0},t.$inject=["nsiRestService","documentService"],t}(),template:n(72),bindings:{document:"<",copy:"="},transclude:{actionsSlot:"?actions"}})},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(t,e,n,i,s){this.type=t,this.code=e,this.name=n,this.parent=i,s&&(this.doc=s)}return t.transform=function(e){var n=[];return e.forEach((function(e){e.children&&e.children.forEach((function(i){n.push(new t(e.name,i.chapterCode,i.name,e.name,i.doc))}))})),n},t}()},function(t,e){t.exports='<loading-block loading-status=$ctrl.loadingStatus> <success> <form class=form-horizontal> <expanded-section expand=$ctrl.documentRequisitesShow show=true> <header style=display:inline>Реквизиты документа</header> <content> <document-requisites-edit document-type-changed=$ctrl.documentTypeChanged(type) not-found-doc-statuses=$ctrl.notFoundDocStatuses document=$ctrl.document chapters=$ctrl.chapters selected-chapter=$ctrl.selectedChapter document-types=$ctrl.documentTypes selected-document-type=$ctrl.selectedDocumentType document-orgs=$ctrl.documentOrgs selected-document-org=$ctrl.selectedDocumentOrg selected-document-types=$ctrl.selectedDocumentTypes document-statuses=$ctrl.documentStatuses selected-document-status=$ctrl.selectedDocumentStatus></document-requisites-edit> </content> </expanded-section> <expanded-section expand=$ctrl.registrationShow show=true ng-if=$ctrl.showRegistration> <header style=display:inline>Регистрация в ИАИС ОГД</header> <content> <document-registration-edit document=$ctrl.document></document-registration-edit> </content> </expanded-section> <expanded-section expand=$ctrl.territoryShow show=true ng-if=$ctrl.showTerritory> <header style=display:inline>Территория</header> <content> <document-territory-edit not-found-areas=$ctrl.notFoundAreas work-sheet-numbers=$ctrl.workSheetNumbers selected-work-sheet-numbers=$ctrl.selectedWorkSheetNumbers not-found-districts=$ctrl.notFoundDistricts document=$ctrl.document areas=$ctrl.areas selected-areas=$ctrl.selectedAreas districts=$ctrl.districts districts-by-area=$ctrl.districtsByArea selected-districts=$ctrl.selectedDistricts doc-territories=$ctrl.docTerritories selected-doc-territory=$ctrl.selectedDocTerritory></document-territory-edit> </content> </expanded-section> <expanded-section expand=$ctrl.objectShow show=true ng-if=$ctrl.showObject> <header style=display:inline>Объект капитального строительства</header> <content> <document-object-edit not-found-finance=$ctrl.notFoundFinance document=$ctrl.document finance=$ctrl.finance selected-finance=$ctrl.selectedFinance fnos=$ctrl.fnos></document-object-edit> </content> </expanded-section> <expanded-section expand=$ctrl.specificShow show=true ng-if=$ctrl.showSpecific> <header style=display:inline>Атрибуты документа</header> <content> <document-specific-edit document=$ctrl.document specifics=$ctrl.specifics></document-specific-edit> </content> </expanded-section> <expanded-section expand=$ctrl.requestShow show=true ng-if=$ctrl.showRequest> <header style=display:inline>Заявление на подготовку документа</header> <content> <document-request-edit document=$ctrl.document></document-request-edit> </content> </expanded-section> <expanded-section expand=$ctrl.approveDocumentShow show=true ng-if=$ctrl.showApproveDocument> <header style=display:inline>Утверждающий документ</header> <content> <document-approve-edit document=$ctrl.document selected-document-org=$ctrl.selectedDocumentOrg1 document-orgs=$ctrl.documentOrgs approvedoc-types=$ctrl.approvedocTypes selected-approvedoc-type=$ctrl.selectedApprovedocType></document-approve-edit> </content> </expanded-section> <expanded-section expand=$ctrl.linkDocumentShow show=true ng-if=$ctrl.showLinkDocument> <header style=display:inline>Связанные документы</header> <content> <document-link-edit document=$ctrl.document document-types=$ctrl.documentTypes></document-link-edit> </content> </expanded-section> <expanded-section expand=$ctrl.organizationsShow show=true ng-if=$ctrl.showOrganizations> <header style=display:inline>Организации</header> <content> <document-organization-edit document=$ctrl.document org-roles=$ctrl.orgRoles org-types=$ctrl.orgTypes></document-organization-edit> </content> </expanded-section> <expanded-section expand=$ctrl.tepShow show=true ng-if=$ctrl.showTeps> <header style=display:inline>ТЭПы</header> <content> <document-tep-edit document=$ctrl.document teps=$ctrl.teps></document-tep-edit> </content> </expanded-section> <div class="form-group row"> <label class="col-lg-3 col-md-3 col-sm-3 control-label"></label> <div class="col-lg-7 col-md-8 col-sm-9"> <div ng-transclude=actionsSlot></div> </div> </div> </form> </success> <loading> <div style=height:200px;padding-top:70px> <spinner style=margin:5px type="\'three-bounce\'"></spinner> </div> </loading> </loading-block>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(0),s=(n.n(i),n(2)),o=(n.n(s),{controller:function(){function t(){}return t.prototype.onOrganizationRoleChange=function(t){var e=this,n=i.find(this.orgRoles,(function(n){return n.roleCode==e.document.organizations[t].organizationRoleCode}));this.document.organizations[t].organizationRole=n.roleName},t.prototype.onOrganizationTypeChange=function(t){var e=this,n=i.find(this.orgTypes,(function(n){return n.typeCode==e.document.organizations[t].organizationTypeCode}));this.document.organizations[t].organizationType=n.typeName},t.prototype.onAddOrganizationClick=function(){var t=new s.DocumentOrganization;this.document.organizations||(this.document.organizations=[]),this.document.organizations.push(t)},t.prototype.onRemoveOrganizationClick=function(t){this.document.organizations.splice(t,1)},t}(),template:n(74),bindings:{document:"<",orgRoles:"<",orgTypes:"<"}})},function(t,e){t.exports='<div ng-repeat="organization in $ctrl.document.organizations"> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label">Роль организации </label> <div class="col-lg-7 col-md-8 col-sm-9"> <select class="form-control our-select" ng-model=organization.organizationRoleCode ng-change=$ctrl.onOrganizationRoleChange($index) ng-options="item.roleCode as item.roleName for item in $ctrl.orgRoles"></select> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> Тип организации </label> <div class="col-lg-7 col-md-8 col-sm-9"> <select class="form-control our-select" ng-model=organization.organizationTypeCode ng-change=$ctrl.onOrganizationTypeChange($index) ng-options="item.typeCode as item.typeName for item in $ctrl.orgTypes"></select> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> Полное наименование для ЮЛ, ФИО для ФЛ </label> <div class="col-lg-7 col-md-8 col-sm-9"> <input type=text class=form-control ng-model=organization.organizationName> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> ОГРН </label> <div class="col-lg-7 col-md-8 col-sm-9"> <input name="{{\'orgOgrn\' + $index}}" type=text class=form-control ng-model=organization.ogrn> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> ИНН </label> <div class="col-lg-7 col-md-8 col-sm-9"> <input name="{{\'orgInn\' + $index}}" type=text class=form-control ng-model=organization.inn> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> КПП </label> <div class="col-lg-7 col-md-8 col-sm-9"> <input name="{{\'orgKpp\' + $index}}" type=text class=form-control ng-model=organization.kpp> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"> СНИЛС </label> <div class="col-lg-7 col-md-8 col-sm-9"> <input name="{{\'orgSnils\' + $index}}" type=text class=form-control ng-model=organization.snils> </div> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"></label> <div class="col-lg-7 col-md-8 col-sm-9"> <button class="btn btn-sm btn-danger" ng-click=$ctrl.onRemoveOrganizationClick($index)><i class="fa fa-trash-o m-r-xs"></i>Удалить организацию</button> </div> </div> <hr> </div> <div class=form-group> <label class="col-lg-3 col-md-3 col-sm-3 control-label"></label> <div class="col-lg-7 col-md-8 col-sm-9"> <button class="btn btn-sm btn-primary" ng-click=$ctrl.onAddOrganizationClick()><i class="fa fa-plus m-r-xs"></i>Добавить организацию</button> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){},template:n(76),bindings:{document:"<"}}},function(t,e){t.exports='<div class=m-l-md ng-repeat="item in $ctrl.document.organizations"> <h5>{{item.organizationRole}}</h5> <div class=description> <dl class="dl-horizontal m-l-md"> <dt ng-if=item.organizationName><span>Наименование</span></dt> <dd ng-if=item.organizationName>{{item.organizationName}}</dd> <dt ng-if=item.ogrn><span>ОГРН</span></dt> <dd ng-if=item.ogrn>{{item.ogrn}}</dd> <dt ng-if=item.inn><span>ИНН</span></dt> <dd ng-if=item.inn>{{item.inn}}</dd> <dt ng-if=item.kpp><span>КПП</span></dt> <dd ng-if=item.kpp>{{item.kpp}}</dd> <dt ng-if=item.snils><span>СНИЛС</span></dt> <dd ng-if=item.snils>{{item.snils}}</dd> </dl> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(0),s=(n.n(i),{controller:function(){function t(t,e,n,i,s,o,c,r,a,l){this.linkedDocumentService=t,this.toastr=e,this.$timeout=n,this.documentLinkRestService=i,this.blockUI=s,this.nsiRestService=o,this.$q=c,this.dossierRestService=r,this.dossierLinkRestService=a,this.documentRestService=l,this.selectAll=!1,this.disabledAll=!0}return t.prototype.$onInit=function(){this.myBlockUI=this.blockUI.instances.get("dossierCandidates")},t.prototype.$onDestroy=function(){this.myBlockUI.reset()},t.prototype.$onChanges=function(t){t.dossiers&&t.dossiers.currentValue&&(this.dossiers.forEach((function(t){t.checked=!1})),this.selectAll=!1,this.disabledAll=!0)},t.prototype.selectAllLinks=function(){var t=this;this.dossiers.forEach((function(e){e.checked=t.selectAll})),this.disabledAll=!this.selectAll},t.prototype.changeSelection=function(){var t=!0,e=!1;this.dossiers.forEach((function(n){!1===n.checked&&(t=!1),!0===n.checked&&(e=!0)})),this.selectAll=t,this.disabledAll=!e},t.prototype.addLink=function(t){var e=this;this.myBlockUI.start(),this.$timeout(1500).then((function(n){e.dossierLinkRestService.create({dossierId:t.parcelDossier.dossierId,docId:e.document.documentID}).then((function(t){e.toastr.success("Связь успешно установлена!"),e.myBlockUI.stop(),e.onUpdate()})).catch((function(t){e.toastr.error("Ошибка при установлении связи!"),e.myBlockUI.stop()}))}))},t.prototype.addSelectedLinks=function(){var t=this,e=[];this.dossiers.forEach((function(n){!0===n.checked&&e.push(t.dossierLinkRestService.create({dossierId:n.parcelDossier.dossierId,docId:t.document.documentID}))})),this.myBlockUI.start(),this.$q.all(e).then((function(e){t.myBlockUI.stop(),t.onUpdate(),t.toastr.success("Выделенные связи успешно добавлены!","Успех")})).catch((function(e){t.myBlockUI.stop(),t.toastr.error("Ошибка при добавлении выделенных связей!","Ошибка")}))},t.prototype.dossierToString=function(t){var e="";return t.parcelDossier.cadastralNumber&&(e+=t.parcelDossier.cadastralNumber,e+=" "),(e+=this.getAddress(t)).trim()},t.prototype.getAddress=function(t){var e="";t&&t.parcelDossier&&t.parcelDossier.address&&(e+=t.parcelDossier.address,e+=" ");var n="";t&&t.parcelDossier&&t.parcelDossier.area&&t.parcelDossier.area.areaName&&(n=t.parcelDossier.area.areaName);var i="";t&&t.parcelDossier&&t.parcelDossier.district&&t.parcelDossier.district.districtName&&(i=t.parcelDossier.district.districtName);var s="";return n&&(s+=n),i&&(s+=n?", ":"",s+=i),s&&(s=" ("+s+")"),e+=s},t.prototype.getAddressString=function(t){if(!t.territory)return"";var e=this.getTerritoryValues(t.territory);if(t.object&&t.object.objectAddress){var n=t.object.objectAddress;return e&&e.length>0&&(n+=" ("+e.join(", ")+")"),n}return e&&e.length>0?e.join(", "):void 0},t.prototype.getTerritoryValues=function(t){var e=t?i.map(t.area,(function(t){return t.areaName})):[],n=t?i.map(t.district,(function(t){return t.districtName})):[];return e.concat(n)},t.$inject=["linkedDocumentService","toastr","$timeout","documentLinkRestService","blockUI","nsiRestService","$q","dossierRestService","dossierLinkRestService","documentRestService"],t}(),template:n(78),bindings:{document:"<",chapters:"<",dossiers:"<",onUpdate:"&"}})},function(t,e){t.exports='<div ng-class=dossierCandidatesClass class=m-t-lg block-ui=dossierCandidates> <div ng-if="$ctrl.dossiers.length > 0" class=m-t-lg> <div ng-repeat="dossier in $ctrl.dossiers"> <h4 ng-init="cycleShow = true" style=outline:0 class="m-t-sm m-b-xs clearfix"> <div class=pull-left ng-click="cycleShow = !cycleShow" style=outline:0> <i style=width:15px class="fa fa-caret-right" ng-show="cycleShow === false"></i> <i style=width:15px class="fa fa-angle-down" ng-show="cycleShow === true"></i> <label style=margin-bottom:0> <input icheck type=checkbox ng-model=dossier.checked ng-change=$ctrl.changeSelection()> </label> {{$ctrl.dossierToString(dossier)}} </div> <div class=pull-right> <button type=button ng-click=$ctrl.addLink(dossier) title="Привязать документ к делу" class="btn btn-default"><i class="fa fa-chain" aria-hidden=true></i></button> </div> </h4> <div ng-show=cycleShow class="m-b-md m-t-md" style=margin-left:20px> <div class=description> <dl class=dl-horizontal> <dt ng-if=dossier.parcelDossier.cadastralNumber><span>Кадастровый номер</span></dt> <dd ng-if=dossier.parcelDossier.cadastralNumber>{{dossier.parcelDossier.cadastralNumber}}</dd> <dt ng-if=dossier.parcelDossier.area.areaName><span>Округ</span></dt> <dd ng-if=dossier.parcelDossier.area.areaName>{{dossier.parcelDossier.area.areaName}}</dd> <dt ng-if=dossier.parcelDossier.district.districtName><span>Район</span></dt> <dd ng-if=dossier.parcelDossier.district.districtName>{{dossier.parcelDossier.district.districtName}}</dd> <dt ng-if=dossier.parcelDossier.address><span>Адрес</span></dt> <dd ng-if=dossier.parcelDossier.address>{{dossier.parcelDossier.address}}</dd> </dl> </div> <loading-block loading-status=dossier.loading> <success> <table ng-show="dossier.documents.length > 0" class="table animated fadeIn m-b-md"> <thead> <tr> <th width=25% style=vertical-align:bottom>Тип документа</th> <th width=15% style=vertical-align:bottom>Номер</th> <th width=10% style=vertical-align:bottom>Дата</th> <th width=50% style=vertical-align:bottom>Содержание</th> </tr> </thead> <tbody> <tr ng-repeat="doc in dossier.documents"> <td style=white-space:pre-wrap ng-init="name = $ctrl.linkedDocumentService.findChapterByCode($ctrl.chapters, doc.reestr)">{{name}}</td> <td style=white-space:pre-wrap><a ng-class="{\'red-link\': (doc.documentRequisites && doc.documentRequisites.documentStatusCode && doc.documentRequisites.documentStatusCode === \'CANCELED\')}" ui-sref="app.isogd.card({id: doc.documentID})">{{doc.documentRequisites.documentNumber}}</a></td> <td style=white-space:pre-wrap>{{doc.documentRequisites.documentDate | date:"dd.MM.yyyy"}}</td> <td ng-init="addressString = $ctrl.getAddressString(doc)"> <b ng-if=doc.documentRequisites.documentName>{{doc.documentRequisites.documentName}}<br></b> <b ng-if=addressString>{{addressString}}<br/></b> <span ng-if=doc.object.objectName>{{doc.object.objectName}}</span> </td> </tr> </tbody> </table> </success> <error> <span class="text-danger fa fa-times-circle"></span> <span> Ошибка при получении информации о документах</span> </error> </loading-block> </div> </div> <div class=pull-right> <label style=margin-bottom:0;margin-right:20px> <input icheck type=checkbox ng-model=$ctrl.selectAll ng-change=$ctrl.selectAllLinks()> Выделить все </label> <button type=button ng-click=$ctrl.addSelectedLinks() ng-disabled=$ctrl.disabledAll title="Привязать выбраные связи" class="btn btn-default"><i class="fa fa-chain" aria-hidden=true></i></button> </div> </div> <div ng-if="$ctrl.dossiers.length === 0" class=m-t-lg> <span> <i class="text-warning fa fa-exclamation-triangle" aria-hidden=true></i> <span> Кандидаты на привязку отсутствуют</span></span> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(1),s=(n.n(i),n(0)),o=(n.n(s),{controller:function(){function t(t,e,n,s,o,c,r,a,l){this.linkedDocumentService=t,this.$timeout=e,this.documentLinkRestService=n,this.blockUI=s,this.nsiRestService=o,this.$q=c,this.dossierRestService=r,this.dossierLinkRestService=a,this.documentRestService=l,this.dossiers=[],this.dossierCandidates=[],this.loadingStatus=i.LoadingStatus.LOADING,this.chapters=[]}return t.prototype.update=function(){var t=this;this.myBlockUI.start(),this.$timeout(1500).then((function(e){t.getDossiersByDocumentId(t.document.documentID).then((function(e){t.dossiers=e,t.documentLinkRestService.getAll(t.document.documentID).then((function(e){var n=s.map(e,(function(e){return e.doc1Id===t.document.documentID?e.doc2Id:e.doc1Id})),i=[];n.forEach((function(e){i.push(t.getDossiersByDocumentId(e))})),t.document.territory&&t.document.territory.cadastralNumber&&t.document.territory.cadastralNumber.length>0&&i.push(t.getDossiersByCadastrals(t.document.territory.cadastralNumber)),t.$q.all(i).then((function(e){e.forEach((function(e){e.forEach((function(e){t.dossierCandidates.push(e)}))})),t.dossierCandidates=s.uniqBy(t.dossierCandidates,(function(t){return t.parcelDossier.dossierId}));var n=[];t.dossierCandidates.forEach((function(e){var i=!1;t.dossiers.forEach((function(t){t.parcelDossier.dossierId===e.parcelDossier.dossierId&&(i=!0)})),i||n.push(e)})),t.dossierCandidates=n,t.myBlockUI.stop()})).catch((function(e){t.myBlockUI.stop()}))})).catch((function(e){t.myBlockUI.stop()}))})).catch((function(e){t.myBlockUI.stop()}))}))},t.prototype.getDossiersByDocumentId=function(t){var e=this,n=this.$q.defer(),o=[];return this.dossierLinkRestService.getToDocument(t).then((function(t){var c=t;if(t.length>0){var r=s.map(t,(function(t){return t.dossierId}));e.dossierRestService.getDossiers(r).then((function(t){(o=t).forEach((function(t){c.forEach((function(e){t.parcelDossier.dossierId===e.dossierId&&(t.link=e)}))})),o.forEach((function(t){t.documents=[],t.loading=i.LoadingStatus.LOADING,e.dossierLinkRestService.getFromDossier(t.parcelDossier.dossierId).then((function(n){var o=[];n.forEach((function(t){o.push(e.documentRestService.getDocument(t.docId))})),e.$q.all(o).then((function(e){t.documents=s.map(e,(function(t){return t.document})),t.documents=s.orderBy(t.documents,(function(t){return t.documentRequisites.documentDate}),["asc"]),t.loading=i.LoadingStatus.SUCCESS})).catch((function(e){t.loading=i.LoadingStatus.ERROR}))})).catch((function(t){n.reject(t)}))})),n.resolve(o)})).catch((function(t){n.reject(t)}))}else n.resolve(o)})).catch((function(t){n.reject(t)})),n.promise},t.prototype.getDossiersByCadastrals=function(t){var e=this,n=this.$q.defer(),o=[];return this.dossierRestService.findDossiersByCadastralNumbers(t).then((function(t){(o=t).forEach((function(t){t.documents=[],t.loading=i.LoadingStatus.LOADING,e.dossierLinkRestService.getFromDossier(t.parcelDossier.dossierId).then((function(n){var o=[];n.forEach((function(t){o.push(e.documentRestService.getDocument(t.docId))})),e.$q.all(o).then((function(e){t.documents=s.map(e,(function(t){return t.document})),t.documents=s.orderBy(t.documents,(function(t){return t.documentRequisites.documentDate}),["asc"]),t.loading=i.LoadingStatus.SUCCESS})).catch((function(e){t.loading=i.LoadingStatus.ERROR}))})).catch((function(t){n.reject(t)}))})),n.resolve(o)})).catch((function(t){n.reject(t)})),n.promise},t.prototype.$onInit=function(){var t=this;this.myBlockUI=this.blockUI.instances.get("dossierEdit"),this.loadingStatus=i.LoadingStatus.LOADING,this.nsiRestService.get("District").then((function(e){return t.districts=e,t.nsiRestService.get("Prefect")})).then((function(e){return t.prefects=e,t.nsiRestService.get("OldChapters")})).then((function(e){return t.chapters=e,t.getDossiersByDocumentId(t.document.documentID)})).then((function(e){t.dossiers=e,t.loadingStatus=i.LoadingStatus.SUCCESS,t.documentLinkRestService.getAll(t.document.documentID).then((function(e){var n=s.map(e,(function(e){return e.doc1Id===t.document.documentID?e.doc2Id:e.doc1Id})),o=[];n.forEach((function(e){o.push(t.getDossiersByDocumentId(e))})),t.document.territory&&t.document.territory.cadastralNumber&&t.document.territory.cadastralNumber.length>0&&o.push(t.getDossiersByCadastrals(t.document.territory.cadastralNumber)),t.$q.all(o).then((function(e){e.forEach((function(e){e.forEach((function(e){t.dossierCandidates.push(e)}))})),t.dossierCandidates=s.uniqBy(t.dossierCandidates,(function(t){return t.parcelDossier.dossierId}));var n=[];t.dossierCandidates.forEach((function(e){var i=!1;t.dossiers.forEach((function(t){t.parcelDossier.dossierId===e.parcelDossier.dossierId&&(i=!0)})),i||n.push(e)})),t.dossierCandidates=n,t.loadingStatus=i.LoadingStatus.SUCCESS})).catch((function(e){t.loadingStatus=i.LoadingStatus.ERROR}))})).catch((function(e){t.loadingStatus=i.LoadingStatus.ERROR}))})).catch((function(e){t.loadingStatus=i.LoadingStatus.ERROR}))},t.prototype.$onDestroy=function(){this.myBlockUI.reset()},t.$inject=["linkedDocumentService","$timeout","documentLinkRestService","blockUI","nsiRestService","$q","dossierRestService","dossierLinkRestService","documentRestService"],t}(),template:n(80),bindings:{document:"<"}})},function(t,e){t.exports='<div class=dossierEdit block-ui=dossierEdit> <loading-block loading-status=$ctrl.loadingStatus> <success> <uib-tabset class=our-nav-tab active=0> <uib-tab index=0> <uib-tab-heading> <i class="fa fa-chain" aria-hidden=true></i> Связанные дела </uib-tab-heading> <linked-dossiers chapters=$ctrl.chapters dossiers=$ctrl.dossiers on-update=$ctrl.update() document=$ctrl.document></linked-dossiers> </uib-tab> <uib-tab index=1> <uib-tab-heading> Кандидаты на привязку </uib-tab-heading> <dossier-candidates chapters=$ctrl.chapters dossiers=$ctrl.dossierCandidates on-update=$ctrl.update() document=$ctrl.document></dossier-candidates> </uib-tab> <uib-tab index=2> <uib-tab-heading> <i class="fa fa-search" aria-hidden=true></i> Поиск кандидатов </uib-tab-heading> <search-dossiers chapters=$ctrl.chapters dossiers=$ctrl.dossiers on-update=$ctrl.update() document=$ctrl.document></search-dossiers> </uib-tab> <uib-tab index=3> <uib-tab-heading> <i class="fa fa-plus" aria-hidden=true></i> Создание нового дела </uib-tab-heading> <new-dossier on-update=$ctrl.update() document=$ctrl.document districts=$ctrl.districts prefects=$ctrl.prefects chapters=$ctrl.chapters></new-dossier> </uib-tab> </uib-tabset> </success> <error> <span class="text-danger fa fa-times-circle"></span> <span> Ошибка при получении информации о делах</span> </error> <loading> <div class=m-t-sm> <div style=height:200px;padding-top:45px> <spinner style=margin:5px type="\'three-bounce\'"></spinner> </div> </div> </loading> </loading-block> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(1),s=(n.n(i),n(0)),o=(n.n(s),{controller:function(){function t(t,e,n,s,o,c,r,a,l){this.linkedDocumentService=t,this.$timeout=e,this.documentLinkRestService=n,this.blockUI=s,this.nsiRestService=o,this.$q=c,this.dossierRestService=r,this.dossierLinkRestService=a,this.documentRestService=l,this.dossiers=[],this.chapters=[],this.loadingStatus=i.LoadingStatus.LOADING}return t.prototype.$onInit=function(){var t=this;this.loadingStatus=i.LoadingStatus.LOADING,this.dossierLinkRestService.getToDocument(this.document.documentID).then((function(e){t.hasDoc=e.length>0,t.hasDoc?t.nsiRestService.get("OldChapters").then((function(n){t.chapters=n;var o=s.map(e,(function(t){return t.dossierId}));t.dossierRestService.getDossiers(o).then((function(e){t.dossiers=e,t.dossiers.forEach((function(e){e.documents=[],e.loading=i.LoadingStatus.LOADING,t.dossierLinkRestService.getFromDossier(e.parcelDossier.dossierId).then((function(n){var o=[];n.forEach((function(e){o.push(t.documentRestService.getDocument(e.docId))})),t.$q.all(o).then((function(t){e.documents=s.map(t,(function(t){return t.document})),e.documents=s.orderBy(e.documents,(function(t){return t.documentRequisites.documentDate}),["asc"]),e.loading=i.LoadingStatus.SUCCESS})).catch((function(t){e.loading=i.LoadingStatus.ERROR}))})).catch((function(t){e.loading=i.LoadingStatus.ERROR}))})),t.loadingStatus=i.LoadingStatus.SUCCESS})).catch((function(e){t.loadingStatus=i.LoadingStatus.ERROR,console.log(e)}))})).catch((function(e){t.loadingStatus=i.LoadingStatus.ERROR,console.log(e)})):t.loadingStatus=i.LoadingStatus.SUCCESS})).catch((function(e){t.loadingStatus=i.LoadingStatus.ERROR,console.log(e)}))},t.prototype.dossierToString=function(t){var e="";return t.parcelDossier.cadastralNumber&&(e+=t.parcelDossier.cadastralNumber,e+=" "),(e+=this.getAddress(t)).trim()},t.prototype.getAddress=function(t){var e="";t&&t.parcelDossier&&t.parcelDossier.address&&(e+=t.parcelDossier.address,e+=" ");var n="";t&&t.parcelDossier&&t.parcelDossier.area&&t.parcelDossier.area.areaName&&(n=t.parcelDossier.area.areaName);var i="";t&&t.parcelDossier&&t.parcelDossier.district&&t.parcelDossier.district.districtName&&(i=t.parcelDossier.district.districtName);var s="";return n&&(s+=n),i&&(s+=n?", ":"",s+=i),s&&(s=" ("+s+")"),e+=s},t.prototype._findChapterByCode=function(t,e){var n=this,i=null;return t.forEach((function(t){if(t.chapterCode===e&&(i=t),t.children&&t.children.length>0){var s=n._findChapterByCode(t.children,e);null!==s&&(i=s)}})),i},t.prototype.findChapterByCode=function(t,e){var n=this._findChapterByCode(t,e);return n?n.name:""},t.prototype.getAddressString=function(t){if(!t.territory)return"";var e=this.getTerritoryValues(t.territory);if(t.object&&t.object.objectAddress){var n=t.object.objectAddress;return e&&e.length>0&&(n+=" ("+e.join(", ")+")"),n}return e&&e.length>0?e.join(", "):void 0},t.prototype.getTerritoryValues=function(t){var e=t?s.map(t.area,(function(t){return t.areaName})):[],n=t?s.map(t.district,(function(t){return t.districtName})):[];return e.concat(n)},t.$inject=["linkedDocumentService","$timeout","documentLinkRestService","blockUI","nsiRestService","$q","dossierRestService","dossierLinkRestService","documentRestService"],t}(),template:n(82),bindings:{document:"<"}})},function(t,e){t.exports='<loading-block loading-status=$ctrl.loadingStatus> <success> <div ng-if=$ctrl.hasDoc> <div ng-repeat="dossier in $ctrl.dossiers"> <h4 ng-init="cycleShow = true" style=outline:0 ng-click="cycleShow = !cycleShow" class="m-t-sm m-b-md"> <i style=width:15px class="fa fa-caret-right" ng-show="cycleShow === false"></i> <i style=width:15px class="fa fa-angle-down" ng-show="cycleShow === true"></i> {{$ctrl.dossierToString(dossier)}} </h4> <div ng-show=cycleShow style=margin-left:20px> <div class=description> <dl class=dl-horizontal> <dt ng-if=dossier.parcelDossier.cadastralNumber><span>Кадастровый номер</span></dt> <dd ng-if=dossier.parcelDossier.cadastralNumber>{{dossier.parcelDossier.cadastralNumber}}</dd> <dt ng-if=dossier.parcelDossier.area.areaName><span>Округ</span></dt> <dd ng-if=dossier.parcelDossier.area.areaName>{{dossier.parcelDossier.area.areaName}}</dd> <dt ng-if=dossier.parcelDossier.district.districtName><span>Район</span></dt> <dd ng-if=dossier.parcelDossier.district.districtName>{{dossier.parcelDossier.district.districtName}}</dd> <dt ng-if=dossier.parcelDossier.address><span>Адрес</span></dt> <dd ng-if=dossier.parcelDossier.address>{{dossier.parcelDossier.address}}</dd> </dl> </div> <loading-block loading-status=dossier.loading> <success> <table class="table animated fadeIn"> <thead> <tr> <th width=25% style=vertical-align:bottom>Тип документа</th> <th width=15% style=vertical-align:bottom>Номер</th> <th width=10% style=vertical-align:bottom>Дата</th> <th width=50% style=vertical-align:bottom>Содержание</th> </tr> </thead> <tbody> <tr ng-repeat="doc in dossier.documents"> <td style=white-space:pre-wrap ng-init="name = $ctrl.findChapterByCode($ctrl.chapters, doc.reestr)">{{name}}</td> <td style=white-space:pre-wrap><a ng-class="{\'red-link\': (doc.documentRequisites && doc.documentRequisites.documentStatusCode && doc.documentRequisites.documentStatusCode === \'CANCELED\')}" ui-sref="app.isogd.card({id: doc.documentID})">{{doc.documentRequisites.documentNumber}}</a></td> <td style=white-space:pre-wrap>{{doc.documentRequisites.documentDate | date:"dd.MM.yyyy"}}</td> <td ng-init="addressString = $ctrl.getAddressString(doc)"> <b ng-if=doc.documentRequisites.documentName>{{doc.documentRequisites.documentName}}<br></b> <b ng-if=addressString>{{addressString}}<br/></b> <span ng-if=doc.document.object.objectName>{{doc.object.objectName}}</span> </td> </tr> </tbody> </table> </success> <error> <span class="text-danger fa fa-times-circle"></span> <span> Ошибка при получении информации о документах</span> </error> <loading> <div class=m-t-sm> <div style=height:200px;padding-top:45px> <spinner style=margin:5px type="\'three-bounce\'"></spinner> </div> </div> </loading> </loading-block> </div> </div> </div> <div ng-if=!$ctrl.hasDoc> <span> <i class="text-warning fa fa-exclamation-triangle" aria-hidden=true></i> <span> Дел о земельном участке нет</span></span> </div> </success> <error> <span class="text-danger fa fa-times-circle"></span> <span> Ошибка при получении информации о делах</span> </error> <loading> <div class=m-t-sm> <div style=height:200px;padding-top:45px> <spinner style=margin:5px type="\'three-bounce\'"></spinner> </div> </div> </loading> </loading-block>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(0),s=(n.n(i),{controller:function(){function t(t,e,n,i,s,o,c,r,a,l){this.linkedDocumentService=t,this.toastr=e,this.$timeout=n,this.documentLinkRestService=i,this.blockUI=s,this.nsiRestService=o,this.$q=c,this.dossierRestService=r,this.dossierLinkRestService=a,this.documentRestService=l,this.selectAll=!1,this.disabledAll=!0}return t.prototype.$onInit=function(){this.myBlockUI=this.blockUI.instances.get("linkedDossiers")},t.prototype.$onDestroy=function(){this.myBlockUI.reset()},t.prototype.$onChanges=function(t){t.dossiers&&t.dossiers.currentValue&&(this.dossiers.forEach((function(t){t.checked=!1})),this.selectAll=!1,this.disabledAll=!0)},t.prototype.selectAllLinks=function(){var t=this;this.dossiers.forEach((function(e){e.checked=t.selectAll})),this.disabledAll=!this.selectAll},t.prototype.changeSelection=function(){var t=!0,e=!1;this.dossiers.forEach((function(n){!1===n.checked&&(t=!1),!0===n.checked&&(e=!0)})),this.selectAll=t,this.disabledAll=!e},t.prototype.deleteLink=function(t){var e=this;this.myBlockUI.start(),this.$timeout(1500).then((function(n){e.dossierLinkRestService.deleteDossierLink(t.link.linkId).then((function(t){e.toastr.success("Связь успешно удалена!"),e.myBlockUI.stop(),e.onUpdate()})).catch((function(t){e.toastr.error("Ошибка при удалении связи!"),e.myBlockUI.stop()}))}))},t.prototype.deleteSelectedLinks=function(){var t=this,e=[];this.dossiers.forEach((function(n){!0===n.checked&&e.push(t.dossierLinkRestService.deleteDossierLink(n.link.linkId))})),this.myBlockUI.start(),this.$q.all(e).then((function(e){t.myBlockUI.stop(),t.onUpdate(),t.toastr.success("Выделенные связи успешно удалены!","Успех")})).catch((function(e){t.myBlockUI.stop(),t.toastr.error("Ошибка при удалении выделенных связей!","Ошибка")}))},t.prototype.dossierToString=function(t){var e="";return t.parcelDossier.cadastralNumber&&(e+=t.parcelDossier.cadastralNumber,e+=" "),(e+=this.getAddress(t)).trim()},t.prototype.getAddress=function(t){var e="";t&&t.parcelDossier&&t.parcelDossier.address&&(e+=t.parcelDossier.address,e+=" ");var n="";t&&t.parcelDossier&&t.parcelDossier.area&&t.parcelDossier.area.areaName&&(n=t.parcelDossier.area.areaName);var i="";t&&t.parcelDossier&&t.parcelDossier.district&&t.parcelDossier.district.districtName&&(i=t.parcelDossier.district.districtName);var s="";return n&&(s+=n),i&&(s+=n?", ":"",s+=i),s&&(s=" ("+s+")"),e+=s},t.prototype.getAddressString=function(t){if(!t.territory)return"";var e=this.getTerritoryValues(t.territory);if(t.object&&t.object.objectAddress){var n=t.object.objectAddress;return e&&e.length>0&&(n+=" ("+e.join(", ")+")"),n}return e&&e.length>0?e.join(", "):void 0},t.prototype.getTerritoryValues=function(t){var e=t?i.map(t.area,(function(t){return t.areaName})):[],n=t?i.map(t.district,(function(t){return t.districtName})):[];return e.concat(n)},t.$inject=["linkedDocumentService","toastr","$timeout","documentLinkRestService","blockUI","nsiRestService","$q","dossierRestService","dossierLinkRestService","documentRestService"],t}(),template:n(84),bindings:{document:"<",chapters:"<",dossiers:"<",onUpdate:"&"}})},function(t,e){t.exports='<div ng-class=linkedDossiersClass class=m-t-lg block-ui=linkedDossiers> <div ng-if="$ctrl.dossiers.length > 0" class=m-t-lg> <div ng-repeat="dossier in $ctrl.dossiers"> <h4 ng-init="cycleShow = true" style=outline:0 class="m-t-sm m-b-xs clearfix"> <div class=pull-left ng-click="cycleShow = !cycleShow" style=outline:0> <i style=width:15px class="fa fa-caret-right" ng-show="cycleShow === false"></i> <i style=width:15px class="fa fa-angle-down" ng-show="cycleShow === true"></i> <label style=margin-bottom:0> <input icheck type=checkbox ng-model=dossier.checked ng-change=$ctrl.changeSelection()> </label> {{$ctrl.dossierToString(dossier)}} </div> <div class=pull-right> <button type=button ng-click=$ctrl.deleteLink(dossier) title="Удалить связь" class="btn btn-default"><i class="fa fa-chain-broken text-danger" aria-hidden=true></i></button> </div> </h4> <div ng-show=cycleShow class=m-b-md style=margin-left:20px> <div class=description> <dl class=dl-horizontal> <dt ng-if=dossier.parcelDossier.cadastralNumber><span>Кадастровый номер</span></dt> <dd ng-if=dossier.parcelDossier.cadastralNumber>{{dossier.parcelDossier.cadastralNumber}}</dd> <dt ng-if=dossier.parcelDossier.area.areaName><span>Округ</span></dt> <dd ng-if=dossier.parcelDossier.area.areaName>{{dossier.parcelDossier.area.areaName}}</dd> <dt ng-if=dossier.parcelDossier.district.districtName><span>Район</span></dt> <dd ng-if=dossier.parcelDossier.district.districtName>{{dossier.parcelDossier.district.districtName}}</dd> <dt ng-if=dossier.parcelDossier.address><span>Адрес</span></dt> <dd ng-if=dossier.parcelDossier.address>{{dossier.parcelDossier.address}}</dd> </dl> </div> <loading-block loading-status=dossier.loading> <success> <table ng-show="dossier.documents.length > 0" class="table animated fadeIn m-b-md"> <thead> <tr> <th width=25% style=vertical-align:bottom>Тип документа</th> <th width=15% style=vertical-align:bottom>Номер</th> <th width=10% style=vertical-align:bottom>Дата</th> <th width=50% style=vertical-align:bottom>Содержание</th> </tr> </thead> <tbody> <tr ng-repeat="doc in dossier.documents"> <td style=white-space:pre-wrap ng-init="name = $ctrl.linkedDocumentService.findChapterByCode($ctrl.chapters, doc.reestr)">{{name}}</td> <td style=white-space:pre-wrap><a ng-class="{\'red-link\': (doc.documentRequisites && doc.documentRequisites.documentStatusCode && doc.documentRequisites.documentStatusCode === \'CANCELED\')}" ui-sref="app.isogd.card({id: doc.documentID})">{{doc.documentRequisites.documentNumber}}</a></td> <td style=white-space:pre-wrap>{{doc.documentRequisites.documentDate | date:"dd.MM.yyyy"}}</td> <td ng-init="addressString = $ctrl.getAddressString(doc)"> <b ng-if=doc.documentRequisites.documentName>{{doc.documentRequisites.documentName}}<br></b> <b ng-if=addressString>{{addressString}}<br/></b> <span ng-if=doc.object.objectName>{{doc.object.objectName}}</span> </td> </tr> </tbody> </table> </success> <error> <span class="text-danger fa fa-times-circle"></span> <span> Ошибка при получении информации о документах</span> </error> <loading> <div class=m-t-sm> <div style=height:200px;padding-top:45px> <spinner style=margin:5px type="\'three-bounce\'"></spinner> </div> </div> </loading> </loading-block> </div> </div> <div class=pull-right> <label style=margin-bottom:0;margin-right:20px> <input icheck type=checkbox ng-model=$ctrl.selectAll ng-change=$ctrl.selectAllLinks()> Выделить все </label> <button type=button ng-click=$ctrl.deleteSelectedLinks() ng-disabled=$ctrl.disabledAll title="Удалить выбраные связь" class="btn btn-default"><i class="fa fa-chain-broken text-danger" aria-hidden=true></i></button> </div> </div> <div ng-if="$ctrl.dossiers.length === 0" class=m-t-lg> <span> <i class="text-warning fa fa-exclamation-triangle" aria-hidden=true></i> <span> Связанные дела отсутствуют</span></span> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){function t(t,e,n,i,s,o,c,r,a,l){this.linkedDocumentService=t,this.toastr=e,this.$timeout=n,this.documentLinkRestService=i,this.blockUI=s,this.nsiRestService=o,this.$q=c,this.dossierRestService=r,this.dossierLinkRestService=a,this.documentRestService=l,this.newDossier={reason:"cad",cadastral:"",district:null,prefect:null,address:""}}return t.prototype.$onInit=function(){this.document.object&&this.document.object.objectAddress&&(this.newDossier.address=this.document.object.objectAddress),this.newDossier.address=this.newDossier.address.trim(),this.myBlockUI=this.blockUI.instances.get("newDossier")},t.prototype.$onDestroy=function(){this.myBlockUI.reset()},t.prototype.create=function(){var t=this;this.myBlockUI.start(),this.$timeout(1500).then((function(e){t.dossierRestService.findDossierByCadastralNumber(t.newDossier.cadastral).then((function(e){if(e)t.myBlockUI.stop(),t.toastr.warning("Дело с таким кадастровым номером уже существует!");else{var n={parcelDossier:{cadastralNumber:t.newDossier.cadastral,address:t.newDossier.address}};"cad"===t.newDossier.reason&&""!==t.newDossier.cadastral&&(n.parcelDossier.cadastralNumber=t.newDossier.cadastral),t.newDossier.prefect&&(n.parcelDossier.area={areaName:t.newDossier.prefect.name,areaCode:t.newDossier.prefect.code}),t.newDossier.district&&(n.parcelDossier.district={districtName:t.newDossier.district.name,districtCode:t.newDossier.district.code}),t.dossierRestService.createDossier(n).then((function(e){t.toastr.success("Новое дело успешно создано!"),t.dossierLinkRestService.create({dossierId:e.parcelDossier.dossierId,docId:t.document.documentID}).then((function(e){t.myBlockUI.stop(),t.toastr.success("Связь дела и документа установлена!"),t.onUpdate()})).catch((function(e){t.myBlockUI.stop(),t.toastr.error("Ошибка при связывании дела и документа!")}))})).catch((function(e){t.myBlockUI.stop(),t.toastr.error("Ошибка при создании нового дела!")}))}})).catch((function(e){t.myBlockUI.stop(),t.toastr.warning("Ошибка при создании нового дела!"),console.log(e)}))}))},t.$inject=["linkedDocumentService","toastr","$timeout","documentLinkRestService","blockUI","nsiRestService","$q","dossierRestService","dossierLinkRestService","documentRestService"],t}(),template:n(86),bindings:{document:"<",districts:"<",prefects:"<",chapters:"<",onUpdate:"&"}}},function(t,e){t.exports='<div ng-class=newDossierClass class=m-t-lg block-ui=newDossier> <div class=row> <div class=col-sm-3 style=text-align:right>Основание:</div> <div class=col-sm-9> <div class=form-group> <label style=padding-left:0 class=checkbox-inline> <input icheck type=radio ng-model=$ctrl.newDossier.reason value=cad> Кадастровый номер</label> <label class=checkbox-inline> <input icheck type=radio ng-model=$ctrl.newDossier.reason value=doc> Документ</label> </div> </div> </div> <div ng-if="$ctrl.newDossier.reason === \'cad\'" class=row> <div class=col-sm-3 style=text-align:right>Кадастровый номер по документу:</div> <div class=col-sm-9> <select class=form-control ng-model=$ctrl.newDossier.cadastral> <option ng-repeat="c in $ctrl.document.territory.cadastralNumber">{{c}}</option> </select> </div> </div> <div ng-if="$ctrl.newDossier.reason === \'cad\'" class="row m-t-sm"> <div class=col-sm-3 style=text-align:right>Кадастровый номер дела:</div> <div class=col-sm-9> <input class=form-control ng-model=$ctrl.newDossier.cadastral> </div> </div> <div class="row m-t-sm"> <div class=col-sm-3 style=text-align:right>Округ:</div> <div class=col-sm-9> <select class=form-control ng-options="p as p.fullName for p in $ctrl.prefects" ng-model=$ctrl.newDossier.prefect></select> </div> </div> <div class="row m-t-sm"> <div class=col-sm-3 style=text-align:right>Район:</div> <div class=col-sm-9> <select class=form-control ng-options="p as p.name for p in $ctrl.districts" ng-model=$ctrl.newDossier.district></select> </div> </div> <div class="row m-t-sm" ng-class="{\'has-error\': $ctrl.newDossier.address === \'\'}"> <div class=col-sm-3 style=text-align:right> Адрес: <span ng-show="$ctrl.newDossier.address === \'\'" class=our-mandatory>*</span></div> <div class=col-sm-9> <input class=form-control ng-model=$ctrl.newDossier.address> </div> </div> <div class="row m-t-md"> <div class=col-sm-3></div> <div class=col-sm-9> <button ng-disabled="$ctrl.newDossier.address === \'\'" class="btn btn-primary" ng-click=$ctrl.create()>Создать дело</button> </div> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(0),s=(n.n(i),n(1)),o=(n.n(s),{controller:function(){function t(t,e,n,i,s,o,c,r,a,l){this.linkedDocumentService=t,this.toastr=e,this.$timeout=n,this.documentLinkRestService=i,this.blockUI=s,this.nsiRestService=o,this.$q=c,this.dossierRestService=r,this.dossierLinkRestService=a,this.documentRestService=l,this.cadastral="",this.result=[]}return t.prototype.$onInit=function(){this.myBlockUI=this.blockUI.instances.get("searchDossiers")},t.prototype.$onDestroy=function(){this.myBlockUI.reset()},t.prototype.$onChanges=function(t){var e=this;t.dossiers&&t.dossiers.currentValue&&(""!==this.cadastral?(this.myBlockUI.start(),this.$timeout(1500).then((function(t){e.dossierRestService.findDossierByCadastralNumber(e.cadastral).then((function(t){e.result=[],t&&e.result.push(t),e.result.forEach((function(t){t.exist=!1,e.dossiers.forEach((function(e){t.parcelDossier.dossierId===e.parcelDossier.dossierId&&(t.exist=!0)}))})),e.result.forEach((function(t){t.documents=[],t.loading=s.LoadingStatus.LOADING,e.dossierLinkRestService.getFromDossier(t.parcelDossier.dossierId).then((function(n){var o=[];n.forEach((function(t){o.push(e.documentRestService.getDocument(t.docId))})),e.$q.all(o).then((function(e){t.documents=i.map(e,(function(t){return t.document})),t.documents=i.orderBy(t.documents,(function(t){return t.documentRequisites.documentDate}),["asc"]),t.loading=s.LoadingStatus.SUCCESS})).catch((function(e){t.loading=s.LoadingStatus.ERROR}))})).catch((function(t){}))})),e.myBlockUI.stop()})).catch((function(t){e.myBlockUI.stop()}))}))):this.result=[])},t.prototype.find=function(){var t=this;this.myBlockUI.start(),this.$timeout(1500).then((function(e){t.dossierRestService.findDossierByCadastralNumber(t.cadastral).then((function(e){t.result=[],e&&t.result.push(e),t.result.forEach((function(e){e.exist=!1,t.dossiers.forEach((function(t){e.parcelDossier.dossierId===t.parcelDossier.dossierId&&(e.exist=!0)}))})),t.result.forEach((function(e){e.documents=[],e.loading=s.LoadingStatus.LOADING,t.dossierLinkRestService.getFromDossier(e.parcelDossier.dossierId).then((function(n){var o=[];n.forEach((function(e){o.push(t.documentRestService.getDocument(e.docId))})),t.$q.all(o).then((function(t){e.documents=i.map(t,(function(t){return t.document})),e.documents=i.orderBy(e.documents,(function(t){return t.documentRequisites.documentDate}),["asc"]),e.loading=s.LoadingStatus.SUCCESS})).catch((function(t){e.loading=s.LoadingStatus.ERROR}))})).catch((function(t){}))})),t.myBlockUI.stop()})).catch((function(e){t.myBlockUI.stop()}))}))},t.prototype.addLink=function(t){var e=this;this.myBlockUI.start(),this.$timeout(1500).then((function(n){e.dossierLinkRestService.create({dossierId:t.parcelDossier.dossierId,docId:e.document.documentID}).then((function(t){e.toastr.success("Связь успешно установлена!"),e.myBlockUI.stop(),e.onUpdate()})).catch((function(t){e.toastr.error("Ошибка при установлении связи!"),e.myBlockUI.stop()}))}))},t.prototype.dossierToString=function(t){var e="";return t.parcelDossier.cadastralNumber&&(e+=t.parcelDossier.cadastralNumber,e+=" "),(e+=this.getAddress(t)).trim()},t.prototype.getAddress=function(t){var e="";t&&t.parcelDossier&&t.parcelDossier.address&&(e+=t.parcelDossier.address,e+=" ");var n="";t&&t.parcelDossier&&t.parcelDossier.area&&t.parcelDossier.area.areaName&&(n=t.parcelDossier.area.areaName);var i="";t&&t.parcelDossier&&t.parcelDossier.district&&t.parcelDossier.district.districtName&&(i=t.parcelDossier.district.districtName);var s="";return n&&(s+=n),i&&(s+=n?", ":"",s+=i),s&&(s=" ("+s+")"),e+=s},t.prototype.getAddressString=function(t){if(!t.territory)return"";var e=this.getTerritoryValues(t.territory);if(t.object&&t.object.objectAddress){var n=t.object.objectAddress;return e&&e.length>0&&(n+=" ("+e.join(", ")+")"),n}return e&&e.length>0?e.join(", "):void 0},t.prototype.getTerritoryValues=function(t){var e=t?i.map(t.area,(function(t){return t.areaName})):[],n=t?i.map(t.district,(function(t){return t.districtName})):[];return e.concat(n)},t.$inject=["linkedDocumentService","toastr","$timeout","documentLinkRestService","blockUI","nsiRestService","$q","dossierRestService","dossierLinkRestService","documentRestService"],t}(),template:n(88),bindings:{document:"<",chapters:"<",dossiers:"<",onUpdate:"&"}})},function(t,e){t.exports='<div class="searchDossiers m-t-lg" block-ui=searchDossiers> <h4>Параметры поиска:</h4> <div class="clearfix m-b-xs"> <div class=col-sm-3 style=text-align:right>Кадастровый номер:</div> <div class="col-lg-8 col-md-7 col-sm-7"> <input class=form-control ng-model=$ctrl.cadastral style=width:100%> </div> <div class="col-lg-1 col-md-2 col-sm-2"> <button class="btn btn-primary" ng-disabled="$ctrl.cadastral === \'\'" ng-click=$ctrl.find() style=width:100%>Найти</button> </div> </div> <h4>Результаты поиска:</h4> <div class=container-fluid ng-if="$ctrl.result.length > 0"> <div class=row> <div ng-repeat="dossier in $ctrl.result"> <h4 ng-init="cycleShow = true" style=outline:0 class="m-t-sm m-b-xs clearfix"> <div class=pull-left ng-click="cycleShow = !cycleShow" style=outline:0> <i style=width:15px class="fa fa-caret-right" ng-show="cycleShow === false"></i> <i style=width:15px class="fa fa-angle-down" ng-show="cycleShow === true"></i> {{$ctrl.dossierToString(dossier)}} </div> <div class=pull-right> <button ng-show=!dossier.exist type=button ng-click=$ctrl.addLink(dossier) title="Привязать документ к делу" class="btn btn-default"><i class="fa fa-chain" aria-hidden=true></i></button> </div> </h4> <div ng-show=cycleShow class="m-b-md m-t-md" style=margin-left:20px> <div class=description> <dl class=dl-horizontal> <dt ng-if=dossier.parcelDossier.cadastralNumber><span>Кадастровый номер</span></dt> <dd ng-if=dossier.parcelDossier.cadastralNumber>{{dossier.parcelDossier.cadastralNumber}}</dd> <dt ng-if=dossier.parcelDossier.area.areaName><span>Округ</span></dt> <dd ng-if=dossier.parcelDossier.area.areaName>{{dossier.parcelDossier.area.areaName}}</dd> <dt ng-if=dossier.parcelDossier.district.districtName><span>Район</span></dt> <dd ng-if=dossier.parcelDossier.district.districtName>{{dossier.parcelDossier.district.districtName}}</dd> <dt ng-if=dossier.parcelDossier.address><span>Адрес</span></dt> <dd ng-if=dossier.parcelDossier.address>{{dossier.parcelDossier.address}}</dd> </dl> </div> <loading-block loading-status=dossier.loading> <success> <table ng-show="dossier.documents.length > 0" class="table animated fadeIn m-b-md"> <thead> <tr> <th width=25% style=vertical-align:bottom>Тип документа</th> <th width=15% style=vertical-align:bottom>Номер</th> <th width=10% style=vertical-align:bottom>Дата</th> <th width=50% style=vertical-align:bottom>Содержание</th> </tr> </thead> <tbody> <tr ng-repeat="doc in dossier.documents"> <td style=white-space:pre-wrap ng-init="name = $ctrl.linkedDocumentService.findChapterByCode($ctrl.chapters, doc.reestr)">{{name}}</td> <td style=white-space:pre-wrap><a ng-class="{\'red-link\': (doc.documentRequisites && doc.documentRequisites.documentStatusCode && doc.documentRequisites.documentStatusCode === \'CANCELED\')}" ui-sref="app.isogd.card({id: doc.documentID})">{{doc.documentRequisites.documentNumber}}</a></td> <td style=white-space:pre-wrap>{{doc.documentRequisites.documentDate | date:"dd.MM.yyyy"}}</td> <td ng-init="addressString = $ctrl.getAddressString(doc)"> <b ng-if=doc.documentRequisites.documentName>{{doc.documentRequisites.documentName}}<br></b> <b ng-if=addressString>{{addressString}}<br/></b> <span ng-if=doc.object.objectName>{{doc.object.objectName}}</span> </td> </tr> </tbody> </table> </success> <error> <span class="text-danger fa fa-times-circle"></span> <span> Ошибка при получении информации о документах</span> </error> <loading> <div class=m-t-sm> <div style=height:200px;padding-top:45px> <spinner style=margin:5px type="\'three-bounce\'"></spinner> </div> </div> </loading> </loading-block> </div> </div> </div> </div> <div class=container-fluid ng-if="$ctrl.result.length === 0"> <div class=row> <span class="text-warning fa fa-times-circle"></span> <span> Дела не найдены</span> </div> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(6),s=(n.n(i),n(0)),o=(n.n(s),n(4)),c=n(1),r=(n.n(c),{controller:function(){function t(t,e,n,i,s,r,a,l,d,u){this.$filter=t,this.solarRestService=e,this.linkedDocumentService=n,this.$timeout=i,this.toastr=s,this.blockUI=r,this.documentLinksRestService=a,this.documentRestService=l,this.nsiRestService=d,this.$q=u,this.linksWithDocument=[],this.linksWithDocumentApprove=[],this.linksWithDocumentReview=[],this.linksWithDocumentReject=[],this.loadingStatus=c.LoadingStatus.LOADING,this.searchResult=[],this.searchParams={search:"",documentType:"",documentNumber:"",documentDate:{startDate:null,endDate:null},searchType:"",docStatuse:null},this.pagination={currentPage:1,totalItems:0,disable:!1},this.sortings=[new o.b("documentDate","desc","по дате"),new o.b("documentNumber","desc","по номеру")]}return t.prototype.$onDestroy=function(){this.myBlockUI.reset()},t.prototype.$onInit=function(){var t=this;this.myBlockUI=this.blockUI.instances.get("linkedDocumentEditor"),this.nsiRestService.get("LinkdocTypes").then((function(e){return t.linkdocTypes=e,t.nsiRestService.get("LinkdocStatuses")})).then((function(e){return t.linkdocStatuses=e,t.nsiRestService.get("OldChapters")})).then((function(e){return t.chapters=e,t.nsiRestService.get("DocumentTypes")})).then((function(e){return t.documentTypes=e,t.nsiRestService.get("DocumentStatus")})).then((function(e){return t.statuses=e,t.documentLinksRestService.getAll(t.document.documentID)})).then((function(e){var n=e;if(n.length>0){var i=[];n.forEach((function(e){i.push(t.documentRestService.getDocument(t.getLinkedDocId(e)))})),t.$q.all(i).then((function(e){var i=s.map(e,(function(t){return t.document}));n.forEach((function(e){i.forEach((function(n){t.getLinkedDocId(e)===n.documentID&&t.linksWithDocument.push({link:e,document:n,checked:!1})}))})),t.linksWithDocumentApprove=s.filter(t.linksWithDocument,(function(t){return"approve"===t.link.status})),t.linksWithDocumentReview=s.filter(t.linksWithDocument,(function(t){return"review"===t.link.status})),t.linksWithDocumentReject=s.filter(t.linksWithDocument,(function(t){return"reject"===t.link.status})),t.linksWithDocumentApprove=s.orderBy(t.linksWithDocumentApprove,(function(t){return t.document.documentRequisites.documentDate}),["asc"]),t.linksWithDocumentReview=s.orderBy(t.linksWithDocumentReview,(function(t){return t.document.documentRequisites.documentDate}),["asc"]),t.linksWithDocumentReject=s.orderBy(t.linksWithDocumentReject,(function(t){return t.document.documentRequisites.documentDate}),["asc"]),t.loadingStatus=c.LoadingStatus.SUCCESS})).catch((function(e){t.loadingStatus=c.LoadingStatus.ERROR}))}else t.loadingStatus=c.LoadingStatus.SUCCESS})).catch((function(e){t.loadingStatus=c.LoadingStatus.ERROR,console.log(e)}))},t.prototype.update=function(){var t=this;this.myBlockUI.start(),this.$timeout(1500).then((function(e){t.documentLinksRestService.getAll(t.document.documentID).then((function(e){var n=e;if(n.length>0){var i=[];n.forEach((function(e){i.push(t.documentRestService.getDocument(t.getLinkedDocId(e)))})),t.$q.all(i).then((function(e){var i=s.map(e,(function(t){return t.document}));t.linksWithDocument=[],n.forEach((function(e){i.forEach((function(n){t.getLinkedDocId(e)===n.documentID&&t.linksWithDocument.push({link:e,document:n,checked:!1})}))})),t.linksWithDocumentApprove=s.filter(t.linksWithDocument,(function(t){return"approve"===t.link.status})),t.linksWithDocumentReview=s.filter(t.linksWithDocument,(function(t){return"review"===t.link.status})),t.linksWithDocumentReject=s.filter(t.linksWithDocument,(function(t){return"reject"===t.link.status})),t.linksWithDocumentApprove=s.orderBy(t.linksWithDocumentApprove,(function(t){return t.document.documentRequisites.documentDate}),["asc"]),t.linksWithDocumentReview=s.orderBy(t.linksWithDocumentReview,(function(t){return t.document.documentRequisites.documentDate}),["asc"]),t.linksWithDocumentReject=s.orderBy(t.linksWithDocumentReject,(function(t){return t.document.documentRequisites.documentDate}),["asc"]),t.myBlockUI.stop()})).catch((function(e){t.myBlockUI.stop(),console.log(e)}))}else t.myBlockUI.stop()})).catch((function(e){t.myBlockUI.stop(),console.log(e)}))}))},t.prototype.updateAndFind=function(){var t=this;this.myBlockUI.start(),this.$timeout(1500).then((function(e){t.documentLinksRestService.getAll(t.document.documentID).then((function(e){var n=e;if(n.length>0){var i=[];n.forEach((function(e){i.push(t.documentRestService.getDocument(t.getLinkedDocId(e)))})),t.$q.all(i).then((function(e){var i=s.map(e,(function(t){return t.document}));if(t.linksWithDocument=[],n.forEach((function(e){i.forEach((function(n){t.getLinkedDocId(e)===n.documentID&&t.linksWithDocument.push({link:e,document:n,checked:!1})}))})),t.linksWithDocumentApprove=s.filter(t.linksWithDocument,(function(t){return"approve"===t.link.status})),t.linksWithDocumentReview=s.filter(t.linksWithDocument,(function(t){return"review"===t.link.status})),t.linksWithDocumentReject=s.filter(t.linksWithDocument,(function(t){return"reject"===t.link.status})),""!==t.searchParams.searchType){var o=null;"common"===t.searchParams.searchType?o=t.solarRestService.searchCommon({page:t.pagination.currentPage-1,sort:t.sortingsToString(),text:t.searchParams.search,reestr:[],documentRegistrationCode:["REGISTERED","QUEUE","REFUSED","DELETED","DOUBLE","CHANGE_QUEUE","CHANGE_REFUSED","CHANGE_REGISTERED","CHANGE_DELETED"]}):"ext"===t.searchParams.searchType&&(o=t.solarRestService.searchExt(t.updateData())),t.$timeout(1500).then((function(e){o.then((function(e){t.searchResult=e.docs,t.searchResult.forEach((function(e){var n=t.findLinkedDocumentById(e.documentId);e.checked=!1,e.linkStatus=null!==n?n.link.status:"approve",e.linkType=null!==n?n.link.linkType:"link",e.hasLink=null!==n})),t.pagination.totalItems=e.numFound,t.pagination.currentPage=e.start/e.pageSize+1,t.myBlockUI.stop()})).catch((function(e){console.log(e),t.myBlockUI.stop()}))}))}else t.myBlockUI.stop()})).catch((function(e){t.myBlockUI.stop(),console.log(e)}))}else t.myBlockUI.stop()})).catch((function(e){t.myBlockUI.stop(),console.log(e)}))}))},t.prototype.getLinkedDocId=function(t){return t.doc1Id===this.document.documentID?t.doc2Id:t.doc1Id},t.prototype.find=function(){var t=this;if(""!==this.searchParams.searchType){var e=null;this.myBlockUI.start(),"common"===this.searchParams.searchType?e=this.solarRestService.searchCommon({page:this.pagination.currentPage-1,sort:this.sortingsToString(),reestr:[],text:this.searchParams.search,documentRegistrationCode:["REGISTERED","QUEUE","REFUSED","DELETED","DOUBLE","CHANGE_QUEUE","CHANGE_REFUSED","CHANGE_REGISTERED","CHANGE_DELETED"]}):"ext"===this.searchParams.searchType&&(e=this.solarRestService.searchExt(this.updateData())),this.$timeout(1500).then((function(n){e.then((function(e){t.searchResult=e.docs,t.searchResult.forEach((function(e){var n=t.findLinkedDocumentById(e.documentId);e.checked=!1,e.linkStatus=null!==n?n.link.status:"approve",e.linkType=null!==n?n.link.linkType:"link",e.hasLink=null!==n})),t.pagination.totalItems=e.numFound,t.pagination.currentPage=e.start/e.pageSize+1,t.myBlockUI.stop()})).catch((function(e){console.log(e),t.myBlockUI.stop()}))}))}},t.prototype.sortingsToString=function(){var t=this,e="";return this.sortings.forEach((function(n,i){e+=n.name+" "+n.value,i<t.sortings.length-1&&(e+=",")})),e},t.prototype.updateData=function(){var t=new i.SearchExtData;return t.page=this.pagination.currentPage-1,t.sort=this.sortingsToString(),t.reestr=[],t.documentRegistrationCode=["REGISTERED","QUEUE","REFUSED","DELETED","DOUBLE","CHANGE_QUEUE","CHANGE_REFUSED","CHANGE_REGISTERED","CHANGE_DELETED"],this.searchParams.docStatuse&&(t.documentStatusCode=this.searchParams.docStatuse.statusCode),""!==this.searchParams.documentType&&(t.reestr=[this.searchParams.documentType]),""!==this.searchParams.documentNumber&&(t.documentNumber=this.searchParams.documentNumber),null!==this.searchParams.documentDate.startDate&&(t.documentDateFrom=this.$filter("date")(this.searchParams.documentDate.startDate,"yyyy-MM-dd")),null!==this.searchParams.documentDate.endDate&&(t.documentDateTo=this.$filter("date")(this.searchParams.documentDate.endDate,"yyyy-MM-dd")),t},t.prototype.findLinkedDocumentById=function(t){var e=null;return this.linksWithDocument.forEach((function(n){n.document.documentID===t&&(e=n)})),e},t.$inject=["$filter","solarRestService","linkedDocumentService","$timeout","toastr","blockUI","documentLinkRestService","documentRestService","nsiRestService","$q"],t}(),template:n(91),bindings:{document:"<"}})},function(t,e){t.exports="<span style=margin-right:5px>Сортировать: </span> <span class=\"m-r-sm sorting\" style=margin-right:5px ng-repeat=\"sorting in $ctrl.sortings\"> <a ng-if=\"sorting.value === 'none'\" ng-class=\"{'sorting-inactive-a': sorting.value === 'none'}\" ng-click=$ctrl.change(sorting)>{{sorting.text}}</a> <a ng-if=\"sorting.value === 'asc'\" class=filter-sorter__link_asc ng-class=\"{'sorting-inactive-a': sorting.value === 'none'}\" ng-click=$ctrl.change(sorting)>{{sorting.text}}</a> <a ng-if=\"sorting.value === 'desc'\" class=filter-sorter__link_desc ng-class=\"{'sorting-inactive-a': sorting.value === 'none'}\" ng-click=$ctrl.change(sorting)>{{sorting.text}}</a> </span>"},function(t,e){t.exports='<loading-block loading-status=$ctrl.loadingStatus> <success> <div class=linkedDocumentEditor block-ui=linkedDocumentEditor> <uib-tabset class=our-nav-tab active=0> <uib-tab heading=Связи index=0> <h4 class=m-t-lg>1. Связанные документы <span class=text-success><i class="fa fa-check" aria-hidden=true></i></span></h4> <linked-documents type="\'approve\'" update-and-find=$ctrl.updateAndFind() document=$ctrl.document links-with-document=$ctrl.linksWithDocumentApprove chapters=$ctrl.chapters linkdoc-types=$ctrl.linkdocTypes linkdoc-statuses=$ctrl.linkdocStatuses> </linked-documents> <h4>2. Кандидаты на привязку <span class=text-warning><i class="fa fa-clock-o" aria-hidden=true></i></span></h4> <linked-documents type="\'review\'" update-and-find=$ctrl.updateAndFind() document=$ctrl.document links-with-document=$ctrl.linksWithDocumentReview chapters=$ctrl.chapters linkdoc-types=$ctrl.linkdocTypes linkdoc-statuses=$ctrl.linkdocStatuses> </linked-documents> <h4>3. Отклоненные кандидаты <span class=text-danger><i class="fa fa-times" aria-hidden=true></i></span></h4> <linked-documents type="\'reject\'" update-and-find=$ctrl.updateAndFind() document=$ctrl.document links-with-document=$ctrl.linksWithDocumentReject chapters=$ctrl.chapters linkdoc-types=$ctrl.linkdocTypes linkdoc-statuses=$ctrl.linkdocStatuses>  </linked-documents></uib-tab> <uib-tab index=1> <uib-tab-heading> <i class="fa fa-search" aria-hidden=true></i> Поиск кандидатов </uib-tab-heading> <search-candidates statuses=$ctrl.statuses search-params=$ctrl.searchParams sortings=$ctrl.sortings pagination=$ctrl.pagination response=$ctrl.searchResult linkdoc-statuses=$ctrl.linkdocStatuses linkdoc-types=$ctrl.linkdocTypes linked-documents=$ctrl.linksWithDocument on-update=$ctrl.updateAndFind() on-find=$ctrl.find() document=$ctrl.document chapters=$ctrl.chapters></search-candidates> </uib-tab> </uib-tabset> </div> </success> <error> <span class="text-danger fa fa-times-circle"></span> <span> Ошибка при получении информации о связанных документа</span> </error> <loading> <div class=m-t-sm> <div style=height:200px;padding-top:45px> <spinner style=margin:5px type="\'three-bounce\'"></spinner> </div> </div> </loading> </loading-block>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(1),s=(n.n(i),n(0)),o=(n.n(s),{controller:function(){function t(t,e,n,s,o,c,r,a,l,d){this.$filter=t,this.solarService=e,this.linkedDocumentService=n,this.$timeout=s,this.toastr=o,this.blockUI=c,this.documentLinkRestService=r,this.documentRestService=a,this.$q=l,this.nsiRestService=d,this.chapters=[],this.loadingStatus=i.LoadingStatus.LOADING}return t.prototype.$onInit=function(){var t=this;this.documentLinkRestService.getAll(this.document.documentID).then((function(e){t.linkedDocuments=s.filter(e,(function(t){return"approve"===t.status})),t.linkedDocuments.length>0?t.nsiRestService.get("LinkdocTypes").then((function(e){return t.linkdocTypes=e,t.nsiRestService.get("OldChapters").then((function(e){t.chapters=e;var n=s.map(t.linkedDocuments,(function(e){return e.doc2Id===t.document.documentID?{id:e.doc1Id,linkType:e.linkType}:{id:e.doc2Id,linkType:e.linkType}})),o=[];n.forEach((function(e){o.push(t.documentRestService.getDocument(e.id))})),t.$q.all(o).then((function(e){t.documents=s.map(e,(function(t){return t.document})),t.documents=s.orderBy(t.documents,(function(t){return t.documentRequisites.documentDate}),["asc"]),t.documents.forEach((function(e){n.forEach((function(n){n.id===e.documentID&&(e.linkType=t.linkedDocumentService.findLinkTypeByCode(t.linkdocTypes,n.linkType))}))})),t.loadingStatus=i.LoadingStatus.SUCCESS})).catch((function(e){t.loadingStatus=i.LoadingStatus.ERROR,console.log(e)}))})).catch((function(e){t.loadingStatus=i.LoadingStatus.ERROR,console.log(e)}))})).catch((function(e){t.loadingStatus=i.LoadingStatus.ERROR,console.log(e)})):t.loadingStatus=i.LoadingStatus.SUCCESS})).catch((function(e){t.loadingStatus=i.LoadingStatus.ERROR,console.log(e)}))},t.$inject=["$filter","solarRestService","linkedDocumentService","$timeout","toastr","blockUI","documentLinkRestService","documentRestService","$q","nsiRestService"],t}(),template:n(93),bindings:{document:"<"}})},function(t,e){t.exports='<loading-block loading-status=$ctrl.loadingStatus> <success> <div ng-if="$ctrl.linkedDocuments.length > 0"> <table class="table animated fadeIn"> <thead> <tr> <th width=25% style=vertical-align:bottom>Тип документа</th> <th width=15% style=vertical-align:bottom>Номер</th> <th width=10% style=vertical-align:bottom>Дата</th> <th width=10% style=vertical-align:bottom>Тип связи</th> <th width=40% style=vertical-align:bottom>Содержание</th> </tr> </thead> <tbody> <tr ng-repeat="doc in $ctrl.documents"> <td style=white-space:pre-wrap ng-init="name = $ctrl.linkedDocumentService.findChapterByCode($ctrl.chapters, doc.reestr)">{{name}}</td> <td style=white-space:pre-wrap><a ng-class="{\'red-link\': (doc.documentRequisites && doc.documentRequisites.documentStatusCode && doc.documentRequisites.documentStatusCode === \'CANCELED\')}" ui-sref="app.isogd.card({id: doc.documentID})">{{doc.documentRequisites.documentNumber}}</a></td> <td style=white-space:pre-wrap>{{doc.documentRequisites.documentDate | date:"dd.MM.yyyy"}}</td> <td> {{doc.linkType}} </td> <td ng-init="addressString = $ctrl.linkedDocumentService.getAddressString(doc)"> <b ng-if=doc.documentRequisites.documentName>{{doc.documentRequisites.documentName}}<br></b> <b ng-if=addressString>{{addressString}}<br/></b> <span ng-if=doc.document.object.objectName>{{doc.object.objectName}}</span> </td> </tr> </tbody> </table> </div> <div ng-if="$ctrl.linkedDocuments.length === 0"> <span> <i class="text-warning fa fa-exclamation-triangle" aria-hidden=true></i> <span> Связанных документов нет</span></span> </div> </success> <error> <span class="text-danger fa fa-times-circle"></span> <span> Ошибка при получении информации о делах</span> </error> <loading> <div class=m-t-sm> <div style=height:200px;padding-top:45px> <spinner style=margin:5px type="\'three-bounce\'"></spinner> </div> </div> </loading> </loading-block>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){function t(t,e,n,i,s,o,c,r,a,l){this.$filter=t,this.solarService=e,this.linkedDocumentService=n,this.$timeout=i,this.toastr=s,this.blockUI=o,this.documentLinkRestService=c,this.documentRestService=r,this.$q=a,this.nsiRestService=l,this.selectAll=!1,this.disabledAll=!0,this.allLinkType=""}return t.prototype.clear=function(){this.selectAll=!1,this.disabledAll=!0,this.allLinkType=""},t.prototype.$onInit=function(){switch(this.type){case"approve":this.linkedDocumentEditorClass="linkedDocumentApproveEditor",this.linkedDocumentEditorBlockUIName="linkedDocumentApproveEditor";break;case"review":this.linkedDocumentEditorClass="linkedDocumentReviewEditor",this.linkedDocumentEditorBlockUIName="linkedDocumentReviewEditor";break;case"reject":this.linkedDocumentEditorClass="linkedDocumentRejectditor",this.linkedDocumentEditorBlockUIName="linkedDocumentRejectditor"}this.myBlockUI=this.blockUI.instances.get(this.linkedDocumentEditorBlockUIName)},t.prototype.$onChanges=function(t){t.linksWithDocument&&t.linksWithDocument.currentValue&&this.clear()},t.prototype.$onDestroy=function(){this.myBlockUI.reset()},t.prototype.selectAllLinks=function(){var t=this;this.linksWithDocument.forEach((function(e){e.checked=t.selectAll})),this.disabledAll=!this.selectAll},t.prototype.changeSelection=function(){var t=!0,e=!1;this.linksWithDocument.forEach((function(n){!1===n.checked&&(t=!1),!0===n.checked&&(e=!0)})),this.selectAll=t,this.disabledAll=!e},t.prototype.changeLinkType=function(t){var e=this;this.myBlockUI.start(),this.linkedDocumentService.changeLink(t.link).then((function(t){e.myBlockUI.stop(),e.updateAndFind(),e.toastr.success("Тип связи успешно изменён!","Успех")})).catch((function(t){e.myBlockUI.stop(),e.toastr.error("Ошибка при изменении типа связи!","Ошибка")}))},t.prototype.changeSelectedLinkType=function(){var t=this,e=[];this.linksWithDocument.forEach((function(n){!0===n.checked&&(n.link.linkType=t.allLinkType,e.push(t.linkedDocumentService.changeLink(n.link)))})),this.myBlockUI.start(),this.$q.all(e).then((function(e){t.myBlockUI.stop(),t.updateAndFind(),t.toastr.success("Тип выделенных связей успешно изменён!","Успех")})).catch((function(e){t.myBlockUI.stop(),t.toastr.error("Ошибка при изменении типа выделенных связей!","Ошибка")}))},t.prototype.deleteLink=function(t,e){var n=this;this.myBlockUI.start(),this.linkedDocumentService.deleteLink(t.link).then((function(t){n.linksWithDocument.splice(e,1),n.myBlockUI.stop(),n.updateAndFind(),n.toastr.success("Связь успешно удалена!","Успех")})).catch((function(t){n.myBlockUI.stop(),n.toastr.error("Ошибка при удалении связи!","Ошибка")}))},t.prototype.deleteSelectedLink=function(){var t=this,e=[];this.linksWithDocument.forEach((function(n){!0===n.checked&&e.push(t.linkedDocumentService.deleteLink(n.link))})),this.myBlockUI.start(),this.$q.all(e).then((function(e){t.myBlockUI.stop(),t.updateAndFind(),t.toastr.success("Выделенные связи успешно удалены!","Успех")})).catch((function(e){t.myBlockUI.stop(),t.toastr.error("Ошибка при удалении выделенных связей!","Ошибка")}))},t.prototype.changeLinkStatus=function(t,e){var n=this;this.myBlockUI.start(),t.link.status=e,this.linkedDocumentService.changeLink(t.link).then((function(t){n.myBlockUI.stop(),n.updateAndFind(),n.toastr.success("Изменение статуса связи прошло успешно!","Успех")})).catch((function(t){n.myBlockUI.stop(),n.toastr.error("Ошибка при изменении статуса связи!","Ошибка")}))},t.prototype.changeLinkStatusToApprove=function(t){this.changeLinkStatus(t,"approve")},t.prototype.changeLinkStatusToReview=function(t){this.changeLinkStatus(t,"review")},t.prototype.changeLinkStatusToReject=function(t){this.changeLinkStatus(t,"reject")},t.prototype.changeSelectedLinkStatus=function(t){var e=this,n=[];this.linksWithDocument.forEach((function(i){!0===i.checked&&(i.link.status=t,n.push(e.linkedDocumentService.changeLink(i.link)))})),this.myBlockUI.start(),this.$q.all(n).then((function(t){e.myBlockUI.stop(),e.updateAndFind(),e.toastr.success("Изменение статуса выделенных связей прошло успешно!","Успех")})).catch((function(t){e.myBlockUI.stop(),e.toastr.error("Ошибка при изменении статуса выделенных связей!","Ошибка")}))},t.prototype.changeSelectedLinkStatusToApprove=function(){this.changeSelectedLinkStatus("approve")},t.prototype.changeSelectedLinkStatusToReview=function(){this.changeSelectedLinkStatus("review")},t.prototype.changeSelectedLinkStatusToReject=function(){this.changeSelectedLinkStatus("reject")},t.$inject=["$filter","solarRestService","linkedDocumentService","$timeout","toastr","blockUI","documentLinkRestService","documentRestService","$q","nsiRestService"],t}(),template:n(95),bindings:{document:"<",linksWithDocument:"<",chapters:"<",linkdocTypes:"<",linkdocStatuses:"<",updateAndFind:"&",type:"<"}}},function(t,e){t.exports='<div ng-class=$ctrl.linkedDocumentEditorClass block-ui={{$ctrl.linkedDocumentEditorBlockUIName}} class=m-l-md> <div ng-if="$ctrl.linksWithDocument.length > 0"> <table class="table animated fadeIn"> <thead> <tr> <th> </th> <th width=25% style=vertical-align:bottom>Тип документа</th> <th width=15% style=vertical-align:bottom>Номер</th> <th width=10% style=vertical-align:bottom>Дата</th> <th width=10% style=vertical-align:bottom>Тип связи</th> <th width=40% style=vertical-align:bottom>Содержание</th> <th></th> </tr> </thead> <tbody> <tr style=background-color:#f5f5f5> <td> <label style=margin-bottom:0 title="Выделить все"> <input icheck type=checkbox ng-model=$ctrl.selectAll ng-change=$ctrl.selectAllLinks()> </label> </td> <td></td> <td></td> <td></td> <td> <select title="Изменение типа связей выбранных документов" ng-disabled=$ctrl.disabledAll class=form-control ng-model=$ctrl.allLinkType ng-change=$ctrl.changeSelectedLinkType()> <option ng-repeat="lt in $ctrl.linkdocTypes" value={{lt.code}}>{{lt.name}}</option> </select> </td> <td> </td> <td> <div class=btn-group role=group style=width:140px> <button ng-disabled=$ctrl.disabledAll type=button ng-click=$ctrl.deleteSelectedLink() title="Удалить выделенные связи" class="btn btn-default"><i class="fa fa-chain-broken text-danger" aria-hidden=true></i></button> <button ng-if="$ctrl.type === \'review\' || $ctrl.type === \'reject\'" ng-disabled=$ctrl.disabledAll type=button ng-click=$ctrl.changeSelectedLinkStatusToApprove() title="Перенести выделенные связи в связанные документы" class="btn btn-default"><i class="fa fa-check text-success" aria-hidden=true></i></button> <button ng-if="$ctrl.type === \'approve\' || $ctrl.type === \'reject\'" ng-disabled=$ctrl.disabledAll type=button ng-click=$ctrl.changeSelectedLinkStatusToReview() title="Перенести выделенные связи в кандидаты на привязку" class="btn btn-default"><i class="fa fa-clock-o text-warning" aria-hidden=true></i></button> <button ng-if="$ctrl.type === \'review\' || $ctrl.type === \'approve\'" ng-disabled=$ctrl.disabledAll type=button ng-click=$ctrl.changeSelectedLinkStatusToReject() title="Перенести выделенные связи в отклоненные кандидаты" class="btn btn-default"><i class="fa fa-times text-danger" aria-hidden=true></i></button> </div> </td> </tr> <tr ng-repeat="ld in $ctrl.linksWithDocument"> <td> <label style=margin-bottom:0> <input icheck type=checkbox ng-model=ld.checked ng-change=$ctrl.changeSelection()> </label> </td> <td style=white-space:pre-wrap ng-init="name = $ctrl.linkedDocumentService.findChapterByCode($ctrl.chapters, ld.document.reestr)">{{name}}</td> <td style=white-space:pre-wrap><a ng-class="{\'red-link\': (ld.document.documentRequisites && ld.document.documentRequisites.documentStatusCode && ld.document.documentRequisites.documentStatusCode === \'CANCELED\')}" ui-sref="app.isogd.card({id: ld.document.documentID})">{{ld.document.documentRequisites.documentNumber}}</a></td> <td style=white-space:pre-wrap>{{ld.document.documentRequisites.documentDate | date:"dd.MM.yyyy"}}</td> <td> <select class=form-control ng-model=ld.link.linkType ng-change=$ctrl.changeLinkType(ld)> <option ng-repeat="lt in $ctrl.linkdocTypes" value={{lt.code}}>{{lt.name}}</option> </select> </td> <td ng-init="addressString = $ctrl.linkedDocumentService.getAddressString(ld.document)"> <b ng-if=doc.document.documentRequisites.documentName>{{ld.document.documentRequisites.documentName}}<br></b> <b ng-if=addressString>{{addressString}}<br/></b> <span ng-if=ld.document.object.objectName>{{ld.document.object.objectName}}</span> </td> <td> <div class=btn-group role=group style=width:140px> <button type=button ng-click="$ctrl.deleteLink(ld, $index)" title="Удалить связь" class="btn btn-default"><i class="fa fa-chain-broken text-danger" aria-hidden=true></i></button> <button ng-if="$ctrl.type === \'review\' || $ctrl.type === \'reject\'" type=button ng-click=$ctrl.changeLinkStatusToApprove(ld) title="Перенести в связанные документы" class="btn btn-default"><i class="fa fa-check text-success" aria-hidden=true></i></button> <button ng-if="$ctrl.type === \'approve\' || $ctrl.type === \'reject\'" type=button ng-click=$ctrl.changeLinkStatusToReview(ld) title="Перенести в кандидаты на привязку" class="btn btn-default"><i class="fa fa-clock-o text-warning" aria-hidden=true></i></button> <button ng-if="$ctrl.type === \'review\' || $ctrl.type === \'approve\'" type=button ng-click=$ctrl.changeLinkStatusToReject(ld) title="Перенести в отклоненные кандидаты" class="btn btn-default"><i class="fa fa-times text-danger" aria-hidden=true></i></button> </div> </td> </tr> </tbody> </table> </div> <div ng-if="$ctrl.linksWithDocument.length === 0" class=m-b-md> <span> <i class="text-warning fa fa-exclamation-triangle" aria-hidden=true></i> <span> Связанные документы отсутствуют</span></span> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(3),s=(n.n(i),n(4)),o={controller:function(){function t(t,e,n,i,s,o,c,r,a){this.$filter=t,this.solarService=e,this.linkedDocumentService=n,this.$timeout=i,this.toastr=s,this.blockUI=o,this.documentLinkRestService=c,this.nsiRestService=r,this.$q=a,this.groupedChapters=[],this.notFound=!0}return t.prototype.$onDestroy=function(){this.myBlockUI.reset()},t.prototype.$onInit=function(){var t=this;this.myBlockUI=this.blockUI.instances.get("searchCandidateEditor"),this.chapters.forEach((function(e){e.children&&e.children.forEach((function(n){var s=i.copy(n);i.extend(s,{parentName:e.name}),t.groupedChapters.push(s)}))}))},t.prototype.findLinkedDocumentById=function(t){var e=null;return this.linkedDocuments.forEach((function(n){n.document.documentID===t&&(e=n)})),e},t.prototype.find=function(){this.searchParams.searchType="common",this.searchParams.documentType="",this.searchParams.documentNumber="",this.searchParams.documentDate.startDate=null,this.searchParams.documentDate.endDate=null,this.onFind()},t.prototype.search=function(){this.searchParams.searchType="ext",this.searchParams.search="",this.pagination.currentPage=1,this.sortings=[new s.b("documentDate","desc","по дате"),new s.b("documentNumber","desc","по номеру")],this.onFind()},t.prototype.sortingsToString=function(){var t=this,e="";return this.sortings.forEach((function(n,i){e+=n.name+" "+n.value,i<t.sortings.length-1&&(e+=",")})),e},t.prototype.onPaginationChange=function(){this.onFind()},t.prototype.onSortingChange=function(){this.onFind()},t.prototype.onFilterChanged=function(){this.searchParams.search="",this.pagination.currentPage=1,this.sortings=[new s.b("documentDate","desc","по дате"),new s.b("documentNumber","desc","по номеру")],this.onFind()},t.prototype.addLink=function(t){var e=this;this.myBlockUI.start(),this.documentLinkRestService.create(t).then((function(t){e.myBlockUI.stop(),e.toastr.success("Связь успешно добавлена!","Успех"),e.onUpdate()})).catch((function(t){e.myBlockUI.stop(),e.toastr.error("Ошибка при добавлении связи!","Ошибка")}))},t.prototype.addLinks=function(t){var e=this,n=[];t.forEach((function(t){n.push(e.documentLinkRestService.create(t))})),this.myBlockUI.start(),this.$q.all(n).then((function(t){e.myBlockUI.stop(),e.onUpdate(),e.toastr.success("Тип выделенных связей успешно изменён!","Успех")})).catch((function(t){e.myBlockUI.stop(),e.toastr.error("Ошибка при изменении типа выделенных связей!","Ошибка")}))},t.$inject=["$filter","solarRestService","linkedDocumentService","$timeout","toastr","blockUI","documentLinkRestService","nsiRestService","$q"],t}(),template:n(97),bindings:{document:"<",chapters:"<",onUpdate:"&",onFind:"&",linkedDocuments:"<",linkdocStatuses:"<",linkdocTypes:"<",searchParams:"<",sortings:"<",pagination:"<",response:"<",statuses:"<"}}},function(t,e){t.exports='<div class="searchCandidateEditor m-t-lg" block-ui=searchCandidateEditor> <h4>Параметры поиска:</h4> <search-filter statuses=$ctrl.statuses grouped-chapters=$ctrl.groupedChapters params=$ctrl.searchParams on-find=$ctrl.find() on-search=$ctrl.search()></search-filter> <h4>Результаты поиска:</h4> <div class=container-fluid> <div class="row m-b-md"> <span style=margin-right:15px>Найдено — {{$ctrl.pagination.totalItems}}</span> </div> </div> <div class=container-fluid ng-if="$ctrl.response.length > 0"> <div class=row> <search-result on-add-links=$ctrl.addLinks(links) on-add-link=$ctrl.addLink(link) document=$ctrl.document linkdoc-types=$ctrl.linkdocTypes linkdoc-statuses=$ctrl.linkdocStatuses sortings=$ctrl.sortings on-sortings-changed=$ctrl.onSortingChange() chapters=$ctrl.chapters doc-types=$ctrl.docTypes documents=$ctrl.response></search-result> </div> </div> <div class=container-fluid ng-if="$ctrl.response.length > 0"> <div class=row> <search-pagination data=$ctrl.pagination on-change=$ctrl.onPaginationChange()></search-pagination> </div> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){function t(){}return t.prototype.search=function(){this.onSearch()},t.prototype.find=function(){this.onFind()},t}(),template:n(99),bindings:{params:"<",onFind:"&",onSearch:"&",groupedChapters:"<",statuses:"<"}}},function(t,e){t.exports='<div class="clearfix m-b-xs"> <div class=col-sm-3 style=text-align:right>Найти:</div> <div class=col-sm-9> <div class=input-group> <input style=text-align:left type=text ng-enter=$ctrl.find() class=form-control ng-model=$ctrl.params.search placeholder="Адрес, номер или дата документа ..."> <span class=input-group-btn><button ng-disabled="$ctrl.params.search.length < 3" class="btn btn-primary" ng-click=$ctrl.find() type=button>Найти</button></span> </div> </div> </div> <div class="clearfix m-b-xs"> <div class=col-sm-3 style=text-align:right><b>Расширенный поиск:</b></div> <div class=col-sm-9> </div> </div> <div class="clearfix m-b-xs"> <div class=col-sm-3 style=text-align:right>Тип документа:</div> <div class=col-sm-9> <select class=form-control style=width:100% ng-model=$ctrl.params.documentType ng-options="ch.chapterCode as ch.name group by ch.parentName for ch in $ctrl.groupedChapters"></select> </div> </div> <div class="clearfix m-b-xs"> <div class=col-sm-3 style=text-align:right>Номер документа:</div> <div class=col-sm-9> <input class=form-control ng-model=$ctrl.params.documentNumber style=width:100%> </div> </div> <div class="clearfix m-b-xs"> <div class=col-sm-3 style=text-align:right>Дата документа:</div> <div class=col-sm-9> <date-range-selector model-from=$ctrl.params.documentDate.startDate model-to=$ctrl.params.documentDate.endDate my-width=450 /> </div> </div> <div class="clearfix m-b-xs"> <div class=col-sm-3 style=text-align:right>Статус действия документа</div> <div class=col-md-9> <ui-select ng-model=$ctrl.params.docStatuse theme=bootstrap> <ui-select-match>{{$select.selected.statusName}}</ui-select-match> <ui-select-choices repeat="status in $ctrl.statuses | filter: $select.search"> <span style=font-size:13px title={{status.statusName}} ng-bind-html="status.statusName | highlight: $select.search"></span> </ui-select-choices> </ui-select> </div> </div> <div class="clearfix m-b-xs"> <div class=col-sm-3 style=text-align:right></div> <div class=col-sm-9> <button class="btn btn-primary" ng-click=$ctrl.search()>Найти</button> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){function t(){}return t.prototype.onPaginationChange=function(){this.onChange()},t}(),template:n(101),bindings:{data:"<",onChange:"&"}}},function(t,e){t.exports="<ul uib-pagination rotate=true previous-text=Предыдущая items-per-page=20 next-text=Следующая max-size=3 total-items=$ctrl.data.totalItems ng-model=$ctrl.data.currentPage ng-disabled=$ctrl.data.disable boundary-link-numbers=true ng-change=$ctrl.onPaginationChange()></ul>"},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){function t(t,e,n,i,s,o,c,r,a,l){this.$filter=t,this.solarService=e,this.linkedDocumentService=n,this.$timeout=i,this.toastr=s,this.blockUI=o,this.documentLinkRestService=c,this.documentRestService=r,this.$q=a,this.nsiRestService=l,this.count=0,this.disabledAll=!0,this.allLinkType="",this.allLinkStatus=""}return t.prototype.clear=function(){this.disabledAll=!0,this.allLinkType="",this.allLinkStatus=""},t.prototype.$onChanges=function(t){t.documents&&t.documents.currentValue&&this.clear()},t.prototype.getRegOgd=function(t){var e="";return t&&t.registrationNumber&&(e+="Регистрация в ИАИС ОГД — ",e+=t.registrationNumber,t&&t.registrationDate&&(e+=" от ",e+=this.$filter("date")(t.registrationDate,"dd.MM.yyyy"))),e},t.prototype.getCad=function(t){var e="";return t&&t.cadastralNumbers&&t.cadastralNumbers.length>0&&t.cadastralNumbers.forEach((function(n,i){e+=n,i<t.cadastralNumbers.length-1&&(e+=", ")})),e},t.prototype.getFirstString=function(t){var e="";return e+=this.findDocShortName(t),e+=" № ",e+=t.documentNumber,t&&t.documentDate&&(e+=" от ",e+=this.$filter("date")(t.documentDate,"dd.MM.yyyy")),e},t.prototype.findDocShortName=function(t){var e="";return this.docTypes.forEach((function(n){n.docCode===t.documentType&&(e=n.docNameShort?n.docNameShort:"")})),e},t.prototype.getAddress=function(t){var e="";t&&t.objectAddress?e+=t.objectAddress:t&&t.postAddress&&(e+=t.postAddress);var n="";t&&t.areaNames&&t.areaNames.length>0&&(n=t.areaNames[0]);var i="";t&&t.districtNames&&t.districtNames.length>0&&(i=t.districtNames[0]);var s="";return n&&(s+=n),i&&(s+=n?", ":"",s+=i),""!==e&&s&&(s=" ("+s+")"),e+=s,console.log("address"),e},t.prototype.change=function(t){this.update(t.name),this.onSortingsChanged({sorting:t})},t.prototype.update=function(t){this.sortings.forEach((function(e){if(e.name===t)if("desc"===e.value)e.value="asc";else e.value="desc"}))},t.prototype.addLink=function(t,e){this.onAddLink({link:{doc1Id:this.document.documentID,doc2Id:t.documentId,linkType:t.linkType,status:t.linkStatus}})},t.prototype.getLinkStatusNameByCode=function(t){var e="";return this.linkdocStatuses.forEach((function(n){n.code===t&&(e=n.name)})),e},t.prototype.getLinkTypeNameByCode=function(t){var e="";return this.linkdocTypes.forEach((function(n){n.code===t&&(e=n.name)})),e},t.prototype.changeSelection=function(){var t=!1;this.documents.forEach((function(e){!1===e.checked&&!1,!0===e.checked&&(t=!0)})),this.disabledAll=!t},t.prototype.changeSelectedLinkType=function(){var t=this;this.documents.forEach((function(e){!0===e.checked&&(e.linkType=t.allLinkType)}))},t.prototype.changeSelectedLinkStatus=function(){var t=this;this.documents.forEach((function(e){!0===e.checked&&(e.linkStatus=t.allLinkStatus)}))},t.prototype.addSelectedLink=function(){var t=this,e=[];this.documents.forEach((function(n){!0===n.checked&&e.push({doc1Id:t.document.documentID,doc2Id:n.documentId,linkType:n.linkType,status:n.linkStatus})})),this.onAddLinks({links:e})},t.$inject=["$filter","solarRestService","linkedDocumentService","$timeout","toastr","blockUI","documentLinkRestService","documentRestService","$q","nsiRestService"],t}(),template:n(103),bindings:{document:"<",documents:"<",docTypes:"<",chapters:"<",statuses:"<",sortings:"<",onSortingsChanged:"&",linkdocStatuses:"<",linkdocTypes:"<",onAddLink:"&",onAddLinks:"&"}}},function(t,e){t.exports='<table class="table search-result-table" style=font-size:14px;color:#676a6c> <thead> <tr style="border-top:1px solid #f0f0f0;font-weight:600"> <th></th> <th style=width:15%;font-weight:600>Тип документа</th> <th style=width:8%;font-weight:500> <span class="m-r-sm sorting" style=margin-right:5px> <a ng-if="$ctrl.sortings[0].value === \'none\'" ng-class="{\'sorting-inactive-a\': $ctrl.sortings[0].value === \'none\'}" ng-click=$ctrl.change($ctrl.sortings[0])>Дата</a> <a ng-if="$ctrl.sortings[0].value === \'asc\'" class=filter-sorter__link_asc ng-class="{\'sorting-inactive-a\': $ctrl.sortings[0].value === \'none\'}" ng-click=$ctrl.change($ctrl.sortings[0])>Дата</a> <a ng-if="$ctrl.sortings[0].value === \'desc\'" class=filter-sorter__link_desc ng-class="{\'sorting-inactive-a\': $ctrl.sortings[0].value === \'none\'}" ng-click=$ctrl.change($ctrl.sortings[0])>Дата</a> </span> </th> <th style=width:15%;font-weight:500> <span class="m-r-sm sorting" style=margin-right:5px> <a ng-if="$ctrl.sortings[1].value === \'none\'" ng-class="{\'sorting-inactive-a\': $ctrl.sortings[1].value === \'none\'}" ng-click=$ctrl.change($ctrl.sortings[1])>Номер</a> <a ng-if="$ctrl.sortings[1].value === \'asc\'" class=filter-sorter__link_asc ng-class="{\'sorting-inactive-a\': $ctrl.sortings[1].value === \'none\'}" ng-click=$ctrl.change($ctrl.sortings[1])>Номер</a> <a ng-if="$ctrl.sortings[1].value === \'desc\'" class=filter-sorter__link_desc ng-class="{\'sorting-inactive-a\': $ctrl.sortings[1].value === \'none\'}" ng-click=$ctrl.change($ctrl.sortings[1])>Номер</a> </span> </th> <th style=font-weight:600>Содержание</th> <th>Тип связи</th> <th>Статус связи</th> <th></th> </tr> </thead> <tbody> <tr style=background-color:#f5f5f5> <td> </td> <td></td> <td> </td> <td> </td> <td> </td> <td> <select title="Изменение типа связей выбранных документов" ng-disabled=$ctrl.disabledAll class=form-control ng-model=$ctrl.allLinkType ng-change=$ctrl.changeSelectedLinkType()> <option ng-repeat="lt in $ctrl.linkdocTypes" value={{lt.code}}>{{lt.name}}</option> </select> </td> <td> <select title="Изменение статусов связей выбранных документов" ng-disabled=$ctrl.disabledAll class=form-control ng-model=$ctrl.allLinkStatus ng-change=$ctrl.changeSelectedLinkStatus()> <option ng-repeat="lt in $ctrl.linkdocStatuses" value={{lt.code}}>{{lt.name}}</option> </select> </td> <td> <button ng-disabled=$ctrl.disabledAll type=button ng-click=$ctrl.addSelectedLink() title="Привязать выбранные документы" class="btn btn-default"><i class="fa fa-chain text-primary" aria-hidden=true></i></button> </td> </tr> <tr ng-repeat="d in $ctrl.documents track by d.documentId"> <td> <label ng-if=!d.hasLink style=margin-bottom:0> <input ng-cloak icheck class=icheckbox_square-green type=checkbox ng-model=d.checked ng-change=$ctrl.changeSelection()> </label> </td> <td style=white-space:pre-wrap ng-init="name = $ctrl.linkedDocumentService.findChapterByCode($ctrl.chapters, d.reestr)">{{name}}</td> <td>{{d.documentDate | date: \'MM.dd.yyyy\'}} </td> <td> <a ng-class="{\'red-link\': d.documentStatusCode === \'CANCELED\'}" ui-sref="app.isogd.card({id: d.documentId})">{{d.documentNumber}}</a> </td> <td> <div style=font-weight:600;margin-bottom:5px ng-if=d.documentName>{{d.documentName}}</div> <div ng-init="address = $ctrl.getAddress(d)"> <div style=font-weight:600;margin-bottom:5px ng-if=address>{{address}}</div> </div> <div ng-if=d.objectName> <div style=margin-bottom:5px> {{d.objectName}} </div> </div> <div ng-init="cad = $ctrl.getCad(d)"> <div style=margin-bottom:5px> <div ng-if=cad>{{cad}}</div> </div> </div> </td> <td style=width:150px> <select ng-if=!d.hasLink class=form-control ng-model=d.linkType> <option ng-repeat="lt in $ctrl.linkdocTypes" value={{lt.code}}>{{lt.name}}</option> </select> <span ng-if=d.hasLink>{{$ctrl.getLinkTypeNameByCode(d.linkType)}}</span> </td> <td style=width:180px> <select ng-if=!d.hasLink class=form-control ng-model=d.linkStatus> <option ng-repeat="lt in $ctrl.linkdocStatuses" value={{lt.code}}>{{lt.name}}</option> </select> <span ng-if=d.hasLink>{{$ctrl.getLinkStatusNameByCode(d.linkStatus)}}</span> </td> <td> <button ng-if=!d.hasLink type=button ng-click="$ctrl.addLink(d, $index)" title=Привязать class="btn btn-default"><i class="fa fa-chain text-primary" aria-hidden=true></i></button> <span ng-if=d.hasLink> <span ng-if="d.linkStatus === \'approve\'" class=text-success><i class="fa fa-check" aria-hidden=true></i></span> <span ng-if="d.linkStatus === \'review\'" class=text-warning><i class="fa fa-clock-o" aria-hidden=true></i></span> <span ng-if="d.linkStatus === \'reject\'" class=text-danger><i class="fa fa-times" aria-hidden=true></i></span> </span> </td> </tr> </tbody> </table>'},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));var i=function(){function e(t){this.$q=t}return e.prototype.getContentFromBlobAsBinaryString=function(e){var n=this.$q.defer();FileReader.prototype.readAsBinaryString||(FileReader.prototype.readAsBinaryString=function(e){var n="",i=this,s=new FileReader;s.onload=function(e){for(var o=new Uint8Array(s.result),c=o.byteLength,r=0;r<c;r++)n+=String.fromCharCode(o[r]);i.content=n,t(i).trigger("onload")},s.readAsArrayBuffer(e)});var i=new FileReader;return i.onload=function(t){var e=t?t.target.result:this.content;n.resolve(e)},i.onerror=function(t){n.reject(t)},i.readAsBinaryString(e),n.promise},e.$inject=["$q"],e}()}).call(e,n(5))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){function t(){}return t.prototype.$onInit=function(){this.subject=""!==this.ngModel.lastName||""!==this.ngModel.firstName?this.ngModel.lastName+" "+this.ngModel.firstName:this.ngModel.subject,this.subject=this.subject.trim()},t}(),template:n(106),bindings:{ngModel:"<"}}},function(t,e){t.exports="<p class=text-left>Владелец: <b>{{$ctrl.subject}}</b></p> <p class=text-left>Организация: <b>{{$ctrl.ngModel.organisation}}</b></p> <p class=text-left>Должность: <b>{{$ctrl.ngModel.position}}</b></p> <p class=text-left>Серийный номер: <b>{{$ctrl.ngModel.serialNumber}}</b></p> <p class=text-left>Издатель: <b>{{$ctrl.ngModel.issuer}}</b></p> <p class=text-left>Выдан: <b>{{$ctrl.ngModel.from}}</b>&nbsp;&nbsp;Действителен до: <b>{{$ctrl.ngModel.till}}</b></p> <p class=text-left>Криптопровайдер: <b>{{$ctrl.ngModel.provname}}</b></p> <p class=text-left>Алгоритм ключа: <b>{{$ctrl.ngModel.algorithm}}</b></p>"},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){function t(t,e,n,i,s){this.fileRestService=t,this.toastr=e,this.$uibModal=n,this.blockUI=i,this.$state=s,this.availableExtensions=["csv","doc","docx","dwg","jpg","jpeg","pdf","png","rar","sig","tiff","tif","txt","xml","zip"]}return t.prototype.$onInit=function(){var t=this;this.myBlockUI=this.blockUI.instances.get("folderLoad"),this.fileExtension=this.fileInfo.fileName.split(".").pop().toLowerCase(),this.fileName=this.removeExtension(this.fileInfo.fileName);var e=!1;this.availableExtensions.forEach((function(n){n===t.fileExtension&&(e=!0)})),e||(this.fileExtension="unknown");var n=this.fileInfo.contentLength/1024,i=n<1024;this.fileSize=i?n.toFixed(1).toString()+" Кб":(n/1024).toFixed(2).toString()+" Мб"},t.prototype.$onDestroy=function(){this.myBlockUI.reset()},t.prototype.removeExtension=function(t){var e=t.lastIndexOf(".");return-1===e?t:t.substr(0,e)},t.prototype.openFile=function(t){this.openFileInNewWindow(t)},t.prototype.open=function(t){this.openFileInNewWindow(t)},t.prototype.openFileInNewWindow=function(t){var e;e=this.isOld?"isogd-oldsystem-rest/v1/files/"+t+"/view":"isogd-api/v2/files/view/"+t,window.open(e,"_blank")},t.prototype.delete=function(t){var e=this;this.$uibModal.open({template:n(7),controller:"ConfirmController as ctrl",size:"md",backdrop:"static",keyboard:!1,windowClass:"delete-file-modal",resolve:{title:function(){return"Удаление файла"},message:function(){return"Удалить файл '"+e.fileInfo.fileName+"' из FileNet?"},btnOk:function(){return"Удалить"}}}).result.then((function(t){e.myBlockUI.start(),e.fileRestService.deleteFile(e.fileInfo.fileId).then((function(t){e.toastr.success("Файл '"+e.fileInfo.fileName+"' успешно удален"),e.$state.reload(),e.myBlockUI.stop()})).catch((function(t){e.toastr.error("Ошибка при удалении файла!"),e.myBlockUI.stop()}))})).catch((function(t){}))},t.prototype.sign=function(){var t=this;this.$uibModal.open({template:n(108),controller:"SignFileController as ctrl",backdrop:"static",keyboard:!1,size:"md",resolve:{fileInfo:this.fileInfo,folderGuid:function(){return t.folderId}}}).result.then((function(e){null===e.error?(t.toastr.success("Время подписания: "+e.result.time+" мс.","Файл "+t.fileInfo.fileName+" подписан."),t.$state.reload()):(t.toastr.error("Ошибка при подписании файла: "+e.error.message),t.$state.reload())}))},t.prototype.verify=function(){this.$uibModal.open({template:n(109),controller:"VerifyController as ctrl",size:"md",backdrop:"static",keyboard:!1,resolve:{fileInfo:this.fileInfo}}).result.then((function(t){})).catch((function(t){}))},t.prototype.uploadSign=function(t){var e=this;if(t&&t.length){if(t.length>1)return void this.toastr.error("Допустимое число файлов: 1");if("sig"!==t[0].name.split(".").pop())return void this.toastr.error("Допустимые расширения файлов: .sig");var n=new FormData,i=t[0];n.append("signature",i),this.fileRestService.handleFileUploadWithSign(this.fileInfo.fileId,n).then((function(t){e.toastr.success("Подпись успешно добавлена к файлу!"),e.$state.reload(),e.fileInfo.signed=!0})).catch((function(t){e.toastr.error("Ошибка при добавлении подписи к файлу!"),e.fileInfo.signed=!1}))}},t.$inject=["fileRestService","toastr","$uibModal","blockUI","$state"],t}(),template:n(110),bindings:{fileInfo:"<",onOpen:"&",folderId:"<",editor:"<",isOld:"<",notOpenable:"<?",deletable:"<?"}}},function(t,e){t.exports='<div class=inmodal style=backface-visibility:hidden> <div class=modal-header> <h3 class=modal-title>Подписать файл</h3> </div> <div class=modal-body> <form name=form class=form-horizontal> <div class=ex-provInfo> <p class=text-center> <i ng-show="ctrl.state === \'danger\'" class="fa fa-exclamation-circle text-danger" aria-hidden=true></i> <i ng-show="ctrl.state === \'success\'" class="fa fa-check-circle text-success" aria-hidden=true></i> &nbsp;{{ctrl.stateValue}}&nbsp;&nbsp; <span ng-show="ctrl.state === \'success\'">Версия плагина: {{ctrl.pluginInfo.version}}</span> </p> <p ng-show="ctrl.state === \'success\'" class=text-center>Криптопровайдер: {{ctrl.pluginInfo.crypto}}</p> <p ng-show="ctrl.state === \'success\'" class=text-center>Версия криптопровайдера: {{ctrl.pluginInfo.cryptoVersion}}</p> </div> <h3 ng-show="ctrl.state === \'success\'" style=margin-top:20px>Список сертификатов: </h3> <div ng-show="ctrl.state === \'success\'" class=ex-sertList> <select style=width:100%;resize:none;border:0 ng-show="ctrl.certificatesState === true" class=form-control ng-model=ctrl.selectedCertificate ng-options="org as org.text for org in ctrl.certificates" ng-change=ctrl.onChangeCertificate()> </select> </div> <div class=ex-sertInfo ng-show="ctrl.certificateInfoEx !== null"> <h2 style=margin-top:0 class=text-left>Информация о сертификате</h2> <certificate-info ng-if=ctrl.certificateInfoEx ng-model=ctrl.certificateInfoEx></certificate-info> </div> </form> </div> <div class=modal-footer> <button ng-show="ctrl.state === \'success\' && ctrl.certificates.length > 0 && ctrl.selectedCertificate !== null" type=button ladda=ctrl.finishing data-spinner-size=18 data-spinner-color=#FFFFFF data-style=expand-right type=button class="btn btn-primary" ng-click=ctrl.ok()> Подписать </button> <button type=button class="btn btn-white" ng-click=ctrl.cancel()>Отмена</button> </div> </div>'},function(t,e){t.exports='<div class=inmodal style=backface-visibility:hidden> <div class=modal-header> <h3 class=modal-title>Проверка электронной подписи</h3> </div> <div class=modal-body style=background:#fff> <loading-block loading-status=ctrl.loading> <success> <div class="description description-sm"> <dl class="dl-horizontal m-b-none"> <dt><span>Файл</span></dt> <dd><a ng-href=isogd-api/v2/files/{{ctrl.fileInfo.fileId}}>{{ctrl.fileInfo.fileName}}</a></dd> <dt><span>Подпись</span></dt> <dd><a ng-href=isogd-api/v2/files/sign/{{ctrl.fileInfo.fileId}}>{{ctrl.fileInfo.fileName + ".sig"}}</a></dd> <dt><span>Статус подписи</span></dt> <dd ng-show="ctrl.result.success === true"><span class="label label-success"><i class="fa fa-check"></i> Подпись подтверждена</span></dd> <dd ng-show="ctrl.result.success === false"><span class="label label-danger"><i class="fa fa-times"></i> Подпись не подтверждена</span></dd> </dl> <div class=ex-sertInfo-err ng-if=ctrl.result.errorMessage> <dl class="dl-horizontal m-b-none"> <dt><span>Сообщение об ошибке</span></dt> <dd>{{ctrl.result.errorMessage}}</dd> </dl> </div> <div class=ex-sertInfo ng-repeat="r in ctrl.result.signaturesInfo"> <dl class="dl-horizontal m-b-none"> <dt><span>Дата подписи</span></dt> <dd>{{r.dateSign}}</dd> <dt><span>Серийный номер сертификата</span></dt> <dd><span style=white-space:pre-wrap>{{r.serialNumber}}</span></dd> <dt><span>Владелец сертификата</span></dt> <dd><span style=white-space:pre-wrap>{{r.subject}}</span></dd> <dt><span>Сертификат выдан</span></dt> <dd>{{r.issuer}}</dd> <dt><span>Срок действия сертификата</span></dt> <dd>с {{r.dateFrom}} по {{r.dateTo}}</dd> <dt ng-if=r.signatureTimeStampTime><span>Штамп времени</span></dt> <dd ng-if=r.signatureTimeStampTime>{{r.signatureTimeStampTime | date:\'dd.MM.yyyy HH:mm\'}}</dd> </dl> </div> </div> </success> <error> <span class=text-danger> <span class="fa fa-times-circle"></span> <span> Ошибка при проверке электронной подписи</span> </span> </error> <loading> <div class=m-t-sm> <div style=height:200px;padding-top:45px> <spinner style=margin:5px type="\'three-bounce\'"></spinner> </div> </div> </loading> </loading-block> </div> <div class=modal-footer> <button type=button class="btn btn-white" ng-click=ctrl.cancel()>Закрыть</button> </div> </div>'},function(t,e){t.exports='<div class="file col-lg-6 col-md-6 col-sm-12"> <div class=fileIcon ng-switch=$ctrl.fileExtension> <div ng-switch-when=csv ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=csv-img></div> <div ng-switch-when=doc ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=doc-img></div> <div ng-switch-when=docx ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=docx-img></div> <div ng-switch-when=dwg ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=dwg-img></div> <div ng-switch-when=jpeg ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=jpeg-img></div> <div ng-switch-when=jpg ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=jpeg-img></div> <div ng-switch-when=pdf ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=pdf-img></div> <div ng-switch-when=png ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=png-img></div> <div ng-switch-when=ppt ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=ppt-img></div> <div ng-switch-when=pptx ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=pptx-img></div> <div ng-switch-when=rar ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=rar-img></div> <div ng-switch-when=sig ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=sig-img></div> <div ng-switch-when=tif ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=tif-img></div> <div ng-switch-when=tiff ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=tiff-img></div> <div ng-switch-when=txt ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=txt-img></div> <div ng-switch-when=xml ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=xml-img></div> <div ng-switch-when=zip ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=zip-img></div> <div ng-switch-default ng-click=$ctrl.openFile($ctrl.fileInfo.fileId) class=unknown-img></div> </div> <div class="fileName clearfix" title={{$ctrl.fileInfo.fileName}}> <div class=fileName_name ng-click=$ctrl.openFile($ctrl.fileInfo.fileId)> <p data-ng-bind=$ctrl.fileInfo.fileName data-ellipsis></p> </div> <div class=fileName_size> <span>{{$ctrl.fileSize}}</span> </div> <div ng-if=$ctrl.fileInfo.signed class=fileName_sign_icon> <div class=certificate-img></div> </div> </div> <div class=fileInfo> <span ng-if=!$ctrl.notOpenable style=cursor:pointer;margin-right:5px><a ng-click=$ctrl.open($ctrl.fileInfo.fileId)>Открыть</a></span> <span ng-if=!$ctrl.isOld style=cursor:pointer;margin-right:5px><a ng-href=isogd-api/v2/files/{{$ctrl.fileInfo.fileId}} target=_blank>Скачать</a></span> <span ng-if=$ctrl.isOld style=cursor:pointer;margin-right:5px><a ng-href=isogd-oldsystem-rest/v1/files/{{$ctrl.fileInfo.fileId}}/download target=_blank>Скачать</a></span> <span ng-disabled=true style=cursor:pointer;margin-right:5px ng-if=$ctrl.fileInfo.signed><a ng-href=isogd-api/v2/files/sign/{{$ctrl.fileInfo.fileId}} target=_blank>Скачать ЭЦП</a></span> <span ng-disabled=true style=cursor:pointer;margin-right:5px ng-if=$ctrl.fileInfo.signed><a ng-click=$ctrl.verify()>Проверить ЭЦП</a></span> <span ng-if=$ctrl.editor style=cursor:pointer;margin-right:5px><a ng-click=$ctrl.sign()>Подписать</a></span> <span ng-if=$ctrl.editor style=cursor:pointer;margin-right:5px ng-show="$ctrl.fileInfo.signed !== true"><a ngf-select=$ctrl.uploadSign($files)>Приложить ЭЦП</a></span> <span ng-if="$ctrl.editor || $ctrl.deletable" style=cursor:pointer><a ng-click=$ctrl.delete($ctrl.fileInfo.fileId) class="fa fa-trash-o"></a></span> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){function t(t,e,n,i){this.$state=t,this.fileRestService=e,this.blockUI=n,this.toastr=i}return t.prototype.$onInit=function(){this.myBlockUI=this.blockUI.instances.get("folderLoad")},t.prototype.open=function(t){this.onOpen({folderInfo:this.folderInfo})},t.prototype.$onDestroy=function(){this.myBlockUI.reset()},t.prototype.changeVisibl=function(){var t=this,e="",n="";this.folderInfo.hidden?(e="hide",n="Каталог скрыт на портале"):(e="show",n="Каталог отображается на портале"),this.fileRestService.hideFolder(this.folderInfo.folderId,e).then((function(e){t.toastr.success(n),t.$state.reload()})).catch((function(e){t.toastr.success("Ошибка при изменении видимости каталога")}))},t.$inject=["$state","fileRestService","blockUI","toastr"],t}(),template:n(112),bindings:{folderInfo:"<",onOpen:"&",editor:"<"}}},function(t,e){t.exports='<div class="folder col-lg-6 col-md-6 col-sm-12" ng-click=$ctrl.open()> <div class=folderIcon> <div ng-class="{\'hidden-folder\': $ctrl.folderInfo.hidden}" class=folder-img></div> </div> <div class=folderName title={{$ctrl.folderInfo.folderName}}> <p ng-class="{\'hidden-folder-p\': $ctrl.folderInfo.hidden}" data-ng-bind=$ctrl.folderInfo.folderName data-ellipsis></p> </div> <div class=folderInfo> <span ng-if="$ctrl.folderInfo.files.length > 0">Файлов: {{$ctrl.folderInfo.files.length}}&nbsp;</span> <span ng-if=$ctrl.editor>Скрыть: <input icheck ng-model=$ctrl.folderInfo.hidden ng-change=$ctrl.changeVisibl() id=checkBox type=checkbox></span> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(0),s=(n.n(i),n(3)),o=(n.n(s),{controller:function(){function t(t,e,n,i,s,o,c,r,a){this.fileRestService=t,this.fileOldSystemRestService=e,this.toastr=n,this.$state=i,this.$sce=s,this.blockUI=o,this.$uibModal=c,this.$timeout=r,this.documentRestService=a,this.navigation=[],this.fileIsOpened=!1,this.extPattern="",this.availableExtensions=["csv","doc","docx","dwg","jpg","jpeg","pdf","png","rar","sig","tiff","tif","txt","xml","zip"],this.showBtnCreate=!1,this.showBtnCreateFolder=!1}return t.prototype.$onInit=function(){var t=this;this.myBlockUI=this.blockUI.instances.get("folderLoad"),this.showBtnCreate=0===this.folderInfo.folders.length&&0===this.folderInfo.files.length&&"8400"===this.code,this.navFolderInfo=this.buildNavFolderInfo(this.folderInfo),this.navFolderInfo.loaded=!0,this.navigation.push({id:this.navFolderInfo.folderId,name:this.navFolderInfo.folderName}),this.selected=this.navFolderInfo,this.extensions.forEach((function(e,n){t.extPattern+=e,n<t.extensions.length-1&&(t.extPattern+=", ")}))},t.prototype.buildNavFolderInfo=function(t){var e=t;return e.loaded=!1,t.folders&&t.folders.length>0&&t.folders.forEach((function(t,n){e.folders[n].loaded=!1})),e},t.prototype.createFolderStructure=function(){var t=this;this.$uibModal.open({template:n(114),controller:"SelectObjectTypeController as ctrl",backdrop:"static",keyboard:!1,size:"md"}).result.then((function(e){t.myBlockUI.start(),t.fileRestService.createTreeStructure(t.folderInfo.folderId,e).then((function(e){t.toastr.success("Структура каталогов успешно создана!"),t.myBlockUI.stop(),t.$state.reload()})).catch((function(e){t.toastr.error("Ошибка при создании структуры каталогов!"),t.myBlockUI.stop()}))})).catch((function(t){}))},t.prototype.openFolder=function(t){var e=this;if(t.loaded)!0===t.loaded&&(this.navigation.push({id:t.folderId,name:t.folderName}),this.selected=t,this.fileIsOpened=!1);else{this.myBlockUI.start();(this.isOld?this.fileOldSystemRestService.filesTreeOld(t.folderId,"1levels"):this.fileRestService.filesTree(t.folderId,"1level")).then((function(n){t.folders=e.buildNavFolderInfo(n).folders,t.files=n.files,t.loaded=!0,e.myBlockUI.stop(),e.navigation.push({id:t.folderId,name:t.folderName}),e.selected=t,e.fileIsOpened=!1})).catch((function(t){e.myBlockUI.stop(),console.log(t)}))}},t.prototype.open=function(t,e){this.navigation.splice(i.findIndex(this.navigation,(function(e){return e.id===t}))+1),this.selected=this.findFolder(this.navFolderInfo,t),this.fileIsOpened=!1},t.prototype.findFolder=function(t,e){var n=null;if(t.folderId===e)n=t;else if(t.folders&&t.folders.length>0)for(var i=0;i<t.folders.length;i++){var s=this.findFolder(t.folders[i],e);null!==s&&(n=s)}return n},t.prototype.openFile=function(t){var e=this.$state.href("viewFile",{id:t});window.open(e,"_blank")},t.prototype.$onDestroy=function(){this.myBlockUI.reset()},t.prototype.serial=function(t){var e=null;return s.forEach(t,(function(t){e=null===e?t():e.then(t)})),e},t.prototype.upload=function(t){var e=this;if(void 0!==this.classFile&&null!==this.classFile&&""!==this.classFile){var n=this.extPattern.split(",");if(t&&t.length){for(var i=[],s=function(s){var c=t[s].name.split(".").pop(),r=!1;if(o.availableExtensions.forEach((function(t){t===c&&(r=!0)})),r||(c="unknown"),"sig"===c){var a=t[s].name.split(".");a[a.length-2]}var l=!1;n.forEach((function(t){var e=t.trim();c===e&&(l=!0)})),n.length>0&&!l&&o.toastr.warning("Файл: "+t[s].name+" имеет недопустимое расширение!");var d=new FormData,u=t[s];d.append("file",u),o.selected.folderId&&d.append("folderGuid",o.selected.folderId),o.classFile&&d.append("fileType",o.classFile),l&&i.push((function(){return e.fileRestService.handleFileUpload(d)}))},o=this,c=0;c<t.length;c++)s(c);i.length>0&&(this.isUploaded=!0,this.serial(i).then((function(t){e.toastr.success(1===i.length?"Файл успешно загружен!":"Файлы успешно загружены!"),e.isUploaded=!1,(e.isOld?e.fileOldSystemRestService.filesTreeOld(e.selected.folderId,"1levels"):e.fileRestService.filesTree(e.selected.folderId,"1level")).then((function(t){e.isUploaded=!1,e.selected.files=t.files,e.fileIsOpened=!1})).catch((function(t){e.toastr.error((1===i.length?"Ошибка при загрузке файла: ":"Ошибка при загрузке файлов: ")+t.status),e.isUploaded=!1}))})).catch((function(t){e.toastr.error((1===i.length?"Ошибка при загрузке файла: ":"Ошибка при загрузке файлов: ")+t.status),e.isUploaded=!1})))}}else this.toastr.error("Не указан класс файла!")},t.$inject=["fileRestService","fileOldSystemRestService","toastr","$state","$sce","blockUI","$uibModal","$timeout","documentRestService"],t}(),template:n(115),bindings:{folderInfo:"<",extensions:"<",classFile:"<",code:"<",editor:"<",isOld:"<",document:"<",registry:"<"}})},function(t,e){t.exports='<div class=inmodal style=backface-visibility:hidden> <div class=modal-header> <h3 class=modal-title>Определите вид объекта</h3> </div> <div class=modal-body style=background:#fff;padding-bottom:20px> <label class=m-r-sm> <input icheck type=radio value=1000 ng-model=ctrl.code> <i></i> Объект капитального строительства </label> <label> <input icheck type=radio value=2000 ng-model=ctrl.code> <i></i> Линейный объект </label> </div> <div class=modal-footer> <button type=button ng-disabled="ctrl.code === \'\'" type=button class="btn btn-primary" ng-click=ctrl.select()>Выбрать</button> <button type=button class="btn btn-white" ng-click=ctrl.cancel()>Закрыть</button> </div> </div>'},function(t,e){t.exports='<div class=navigator block-ui=folderLoad> <ul class=file-nav> <li ng-repeat="n in $ctrl.navigation"> <span data-ng-bind=n.name ng-class="{\'hover\': $index < $ctrl.navigation.length - 1,\'last\': $index === $ctrl.navigation.length - 1 }" ng-click="$ctrl.open(n.id, $index)"></span> </li> </ul> <div class=container-fluid> <div class=row> <div style=margin-top:20px ng-if=!$ctrl.fileIsOpened> <div class=clearfix> <div ng-if="$ctrl.selected.folders && $ctrl.selected.folders.length > 0"> <div ng-repeat="f in $ctrl.selected.folders"> <folder folder-info=f editor=$ctrl.editor on-open=$ctrl.openFolder(folderInfo)></folder> </div> </div> <div ng-if="$ctrl.selected.files && $ctrl.selected.files.length > 0"> <div ng-repeat="f in $ctrl.selected.files"> <file is-old=$ctrl.isOld editor=$ctrl.editor folder-id=$ctrl.selected.folderId file-info=f on-open=$ctrl.openFile(id)></file> </div> </div> </div> </div> </div> <div class=row ng-if="$ctrl.editor && !$ctrl.showBtnCreate"> <div class=ex-dropzone-outer style=margin-top:15px> <div ngf-multiple=true ngf-select=$ctrl.upload($files) ngf-drag-over-class="\'dragover\'" style=cursor:pointer class=ex-dropzone ng-show=!$ctrl.isUploaded> <i class="fa fa-download" aria-hidden=true></i>&nbsp;Загрузить файл <br> <span style=font-size:13px>Допустимые расширения: {{$ctrl.extPattern}}</span> </div> <div class=ex-dropzone ng-show=$ctrl.isUploaded> <spinner style=margin:5px type="\'three-bounce\'"></spinner> </div> </div> </div> <div class=row ng-if=$ctrl.showBtnCreate> <button class="btn btn-default" ng-click=$ctrl.createFolderStructure()>Создать структуру проектной документации</button> </div> </div> </div>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(t){this.$uibModalInstance=t,this.code=""}return t.prototype.cancel=function(){this.$uibModalInstance.dismiss("cancel")},t.prototype.select=function(){this.$uibModalInstance.close(this.code)},t.$inject=["$uibModalInstance","fileRestService"],t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(t,e,n,i,s,o,c,r){this.fileRestService=t,this.$uibModalInstance=e,this.toastr=n,this.cryptoService=i,this.$log=s,this.fileService=o,this.fileInfo=c,this.folderGuid=r,this.certificates=[],this.selectedCertificate=null,this.certificateInfoEx=null,this.finishing=!1,this.fileExtension=this.fileInfo.fileName.split(".").pop();var a=this.fileInfo.contentLength/1024;this.isKB=a<1024,this.fileSize=this.isKB?a.toFixed(1):(a/1024).toFixed(2),this.pluginInfo={version:"",cryptoVersion:"",crypto:""},cadesplugin?this.CheckPlugIn():(this.state="danger",this.stateValue="Плагин не загружен")}return t.prototype.ok=function(){var t=this;this.finishing=!0,this.fileInfo.signed?this.fileRestService.getFileHash(this.fileInfo.fileId).then((function(e){var n=e.hash;t.fileRestService.getSign(t.fileInfo.fileId).then((function(e){var i=e;t.fileService.getContentFromBlobAsBinaryString(i).then((function(e){t.cryptoService.coSignHash(t.selectedCertificate,n,e,"http://cryptopro.ru/tsp/").then((function(e){t.signature=e;var n=new FormData;n.append("folderGuid",t.folderGuid);var i=new Blob([t.signature.value],{type:"application/octet-stream"});n.append("signature",i,t.fileInfo.fileName+".sig"),t.fileRestService.handleFileUploadWithSign(t.fileInfo.fileId,n).then((function(e){t.$uibModalInstance.close({result:{guid:t.fileInfo.fileId,time:t.signature.time},error:null})})).catch((function(e){t.toastr.error("Ошибка при сохранении файла с подписью!"),t.$uibModalInstance.close({result:null,error:"Ошибка при сохранении файла с подписью!"})}))})).catch((function(e){t.$log.error(e),t.$uibModalInstance.close({result:null,error:e})}))})).catch((function(e){t.$log.error(e),t.$uibModalInstance.close({result:null,error:e})}))}),(function(e){t.$log.error(e),t.$uibModalInstance.close({result:null,error:e})}))}),(function(e){t.$log.error(e),t.$uibModalInstance.close({result:null,error:e})})):this.fileRestService.getFileHash(this.fileInfo.fileId).then((function(e){t.cryptoService.signHash(t.selectedCertificate,e.hash,"http://cryptopro.ru/tsp/").then((function(e){t.signature=e;var n=new FormData;n.append("folderGuid",t.folderGuid),n.append("signature",new Blob([t.signature.value],{type:"application/octet-stream"}),t.fileInfo.fileName+".sig"),t.fileRestService.handleFileUploadWithSign(t.fileInfo.fileId,n).then((function(e){t.$uibModalInstance.close({result:{guid:t.fileInfo.fileId,time:t.signature.time},error:null})})).catch((function(e){t.toastr.error("Ошибка при сохранении файла с подписью!"),t.$uibModalInstance.close({result:null,error:"Ошибка при сохранении файла с подписью!"})}))})).catch((function(e){t.$log.error(e),t.$uibModalInstance.close({result:null,error:e})}))}),(function(e){t.$log.error(e),t.$uibModalInstance.close({result:null,error:e})}))},t.prototype.cancel=function(){this.$uibModalInstance.dismiss("cancel")},t.prototype.CheckPlugIn=function(){var t=this;this.state="success",this.stateValue="Плагин загружен.",this.cryptoService.getInfoAboutPlugin().then((function(e){t.pluginInfo=e,t.cryptoService.getCertificates().then((function(e){t.certificates=e,t.certificates.length>0&&(t.selectedCertificate=t.certificates[0],t.onChangeCertificate()),t.certificatesState=!0}),(function(e){t.$log.error(e),t.certificatesState=!1}))}),(function(e){t.$log.error("Ошибка при загрузке плагина CryptoPro: "+e),t.state="danger",t.stateValue="Ошибка при работе с плагином!",t.certificatesState=!1}))},t.prototype.onChangeCertificate=function(){var t=this;this.cryptoService.fillCertInfo(this.selectedCertificate).then((function(e){t.certificateInfoEx=e}),(function(e){t.$log.error("Ошибка при загрузке сертификата: "+e)}))},t.$inject=["fileRestService","$uibModalInstance","toastr","cryptoService","$log","fileService","fileInfo","folderGuid"],t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(1),s=(n.n(i),function(){function t(t,e,n,s){var o=this;this.$uibModalInstance=t,this.fileRestService=e,this.toastr=n,this.fileInfo=s,this.loading=i.LoadingStatus.LOADING,this.fileRestService.verifySign(this.fileInfo.fileId).then((function(t){o.result=t,o.loading=i.LoadingStatus.SUCCESS}),(function(t){o.toastr.error("Ошибка при проверке подписи!"),o.loading=i.LoadingStatus.ERROR,o.$uibModalInstance.dismiss("cancel")}))}return t.prototype.cancel=function(){this.$uibModalInstance.dismiss("cancel")},t.$inject=["$uibModalInstance","fileRestService","toastr","fileInfo"],t}())},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(1),s=(n.n(i),{controller:function(){function t(t,e,n){this.fileRestService=t,this.fileOldSystemRestService=e,this.nsiRestService=n,this.loadingStatus=i.LoadingStatus.LOADING,this.extensions=["pdf","tiff","jpg","jpeg","doc","docx"]}return t.prototype.$onInit=function(){var t=this;this.loadingStatus=i.LoadingStatus.LOADING,this.nsiRestService.getBy("OldChapters",{nickAttr:"chapterCode",values:[this.document.reestr]}).then((function(e){t.registry=e[0],t.document.folderID?t.isOld=!1:t.document.oldFolderID?t.isOld=!0:t.isOld=void 0,void 0!==t.isOld?(t.isOld?t.fileOldSystemRestService.filesTreeOld(t.document.oldFolderID,"1levels"):t.fileRestService.filesTree(t.document.folderID,"1level")).then((function(e){t.folder=e,t.loadingStatus=i.LoadingStatus.SUCCESS})).catch((function(e){t.loadingStatus=i.LoadingStatus.ERROR,console.log(e)})):t.loadingStatus=i.LoadingStatus.SUCCESS}))},t.$inject=["fileRestService","fileOldSystemRestService","nsiRestService"],t}(),template:n(120),bindings:{document:"<"}})},function(t,e){t.exports='<loading-block loading-status=$ctrl.loadingStatus> <success> <div ng-if="$ctrl.isOld !== undefined"> <navigator document=$ctrl.document registry=$ctrl.registry is-old=$ctrl.isOld editor=false class-file=$ctrl.registry.docClass code=$ctrl.document.reestr extensions=$ctrl.extensions folder-info=$ctrl.folder> </navigator> </div> <div ng-if="$ctrl.isOld === undefined"> <span> <span class="fa fa-times-circle text-warning"></span> <span> Отсутствует каталог связанный с данным документом</span></span> </div> </success> <error> <span> <span class="fa fa-times-circle text-danger"></span> <span> Ошибка при получении информации о каталоге</span></span> </error> <loading> <div class=m-t-sm> <div style=height:200px;padding-top:45px> <spinner style=margin:5px type="\'three-bounce\'"></spinner> </div> </div> </loading> </loading-block>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(t,e,n,i){this.$uibModalInstance=t,this.title=e,this.message=n,this.btnOk=i}return t.prototype.ok=function(){this.$uibModalInstance.close()},t.prototype.cancel=function(){this.$uibModalInstance.dismiss("cancel")},t.$inject=["$uibModalInstance","title","message","btnOk"],t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(1),s=(n.n(i),{controller:function(){function t(t,e,n,s,o,c,r,a){this.$state=t,this.documentRestService=e,this.$timeout=n,this.blockUI=s,this.$uibModal=o,this.fileRestService=c,this.fileOldSystemRestService=r,this.nsiRestService=a,this.loadingStatus=i.LoadingStatus.LOADING,this.extensions=["pdf","tiff","tif","jpg","jpeg","doc","docx"]}return t.prototype.$onInit=function(){var t=this;this.loadingStatus=i.LoadingStatus.LOADING,this.nsiRestService.getBy("OldChapters",{nickAttr:"chapterCode",values:[this.document.reestr]}).then((function(e){t.registry=e[0],t.document.folderID?t.isOld=!1:t.document.oldFolderID?t.isOld=!0:t.isOld=void 0,void 0!==t.isOld?(t.isOld?t.fileOldSystemRestService.filesTreeOld(t.document.oldFolderID,"1levels"):t.fileRestService.filesTree(t.document.folderID,"1level")).then((function(e){t.folder=e,t.loadingStatus=i.LoadingStatus.SUCCESS})).catch((function(e){t.loadingStatus=i.LoadingStatus.ERROR,console.log(e)})):t.loadingStatus=i.LoadingStatus.SUCCESS}))},t.prototype.createFolder=function(){var t=this;this.$uibModal.open({template:n(7),controller:"ConfirmController as ctrl",size:"md",backdrop:"static",keyboard:!1,windowClass:"delete-file-modal",resolve:{title:function(){return"Создание каталога"},message:function(){return"Создать каталог {"+t.document.documentID+"} в FileNet?"},btnOk:function(){return"Создать"}}}).result.then((function(e){t.$timeout(1500).then((function(e){var n={folderName:t.document.documentID,parentGuid:t.registry.folderID,folderType:t.registry.folderClass,folderAttrs:[]};return t.fileRestService.createFolder(n)})).then((function(e){return t.document.folderID=e.guid,t.$timeout(1500)})).then((function(e){return t.documentRestService.getDocument(t.document.documentID)})).then((function(e){return e.document.folderID=t.document.folderID,t.documentRestService.update(t.document.documentID,{document:e.document})})).then((function(e){t.$state.reload()})).catch((function(t){console.log(t)}))})).catch((function(t){}))},t.$inject=["$state","documentRestService","$timeout","blockUI","$uibModal","fileRestService","fileOldSystemRestService","nsiRestService"],t}(),template:n(123),bindings:{document:"<"}})},function(t,e){t.exports='<loading-block loading-status=$ctrl.loadingStatus> <success> <div ng-if="$ctrl.isOld !== undefined"> <navigator document=$ctrl.document registry=$ctrl.registry is-old=$ctrl.isOld editor=true class-file=$ctrl.registry.docClass code=$ctrl.document.reestr extensions=$ctrl.extensions folder-info=$ctrl.folder> </navigator> </div> <div ng-if="$ctrl.isOld === undefined"> <button class="btn btn-default" ng-click=$ctrl.createFolder()>Создать каталог</button> </div> </success> <error> <span class=text-danger> <span class="fa fa-times-circle"></span> <span> Ошибка при получении информации о каталоге</span></span> </error> <loading> <div class=m-t-sm> <div style=height:200px;padding-top:45px> <spinner style=margin:5px type="\'three-bounce\'"></spinner> </div> </div> </loading> </loading-block>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(1),s=(n.n(i),{controller:function(){function t(t){this.documentRestService=t,this.loadingStatus=i.LoadingStatus.LOADING}return t.prototype.$onInit=function(){var t=this;this.loadingStatus=i.LoadingStatus.LOADING,this.documentRestService.log(this.id).then((function(e){t.logs=e,t.logs.forEach((function(t){t.jsonPatch=JSON.parse(t.jsonPatch)})),t.loadingStatus=i.LoadingStatus.SUCCESS})).catch((function(e){t.loadingStatus=i.LoadingStatus.ERROR}))},t.$inject=["documentRestService"],t}(),template:n(125),bindings:{id:"<"}})},function(t,e){t.exports='<loading-block loading-status=$ctrl.loadingStatus> <success> <div class=m-t-md> <table class="table animated fadeIn"> <thead> <tr> <th style=width:150px>Дата изменения</th> <th style=width:150px>Пользователь</th> <th>Содержимое</th> </tr> </thead> <tbody ng-show="$ctrl.logs.length > 0"> <tr ng-repeat="log in $ctrl.logs | orderBy:\'-\'"> <td style=vertical-align:middle!important>{{log.dateEdit | date: \'dd.MM.yyyy HH:mm\'}}</td> <td style=vertical-align:middle!important>{{log.userName}}</td> <td style=vertical-align:middle!important> <table class="table animated fadeIn table-without-header"> <tbody> <tr ng-repeat="p in log.jsonPatch"> <td style=vertical-align:middle!important> {{p.op}} </td> <td style=vertical-align:middle!important>{{p.path}}</td> <td style=vertical-align:middle!important>{{p.value}}</td> </tr> </tbody> </table> </td> </tr> </tbody> <tbody ng-show="$ctrl.logs.length === 0"> <tr> <td colspan=3 style=padding:20px> <span> <i class="fa fa-exclamation-triangle text-warning"></i> В таблице отсутствуют значения </span> </td> </tr> </tbody> </table> </div> </success> <error> <div class=m-t-md> <span class="fa fa-times-circle text-danger"></span> <span> Ошибка при формировании раздела</span> </div> </error> <loading> <div class=m-t-sm> <div style=height:200px;padding-top:40px> <div class="sk-spinner sk-spinner-three-bounce"> <div class=sk-bounce1></div> <div class=sk-bounce2></div> <div class=sk-bounce3></div> </div> </div> </div> </loading> </loading-block>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(1),s=(n.n(i),{controller:function(){function t(t,e,n,s,o){this.$state=t,this.$timeout=e,this.gisRestService=n,this.$filter=s,this.blockUI=o,this.loadingStatus=i.LoadingStatus.LOADING}return t.prototype.$onInit=function(){var t,e,n=this;this.myBlockUI=this.blockUI.instances.get("gisLoad"),this.gisRestService.linksSearch({registryCode:this.document.reestr,docNumber:this.document.documentRequisites.documentNumber,docDate:this.$filter("date")(new Date(this.document.documentRequisites.documentDate.toString()),"yyyy-MM-dd")}).then((function(e){return t=n.transformAllLinks(e),n.gisRestService.findByDocId(n.document.documentID)})).then((function(s){e=n.transformLinks(s);var o=[];t.forEach((function(t){var n=!1;e.forEach((function(e){t.layerTableId===e.layerTableId&&t.objectContourId===e.objectContourId&&(n=!0)})),n||o.push(t)})),n.allLinks=o,n.links=e,n.loadingStatus=i.LoadingStatus.SUCCESS})).catch((function(t){n.errorMessage="Данные не найдены",n.loadingStatus=i.LoadingStatus.ERROR}))},t.prototype.$onDestroy=function(){this.myBlockUI.reset()},t.prototype.updateData=function(){var t,e,n=this;this.gisRestService.linksSearch({registryCode:this.document.reestr,docNumber:this.document.documentRequisites.documentNumber,docDate:this.$filter("date")(new Date(this.document.documentRequisites.documentDate.toString()),"yyyy-MM-dd")}).then((function(e){return t=n.transformAllLinks(e),n.gisRestService.findByDocId(n.document.documentID)})).then((function(i){e=n.transformLinks(i);var s=[];t.forEach((function(t){var n=!1;e.forEach((function(e){t.layerTableId===e.layerTableId&&t.objectContourId===e.objectContourId&&(n=!0)})),n||s.push(t)})),n.allLinks=s,n.links=e,n.myBlockUI.stop()})).catch((function(t){n.myBlockUI.stop()}))},t.prototype.transformAllLinks=function(t){var e=[];return t.forEach((function(t){e.push({layerTable:t.layerTable,layerTableId:t.layerTableId,objectContourId:t.objectContourId})})),e},t.prototype.transformLinks=function(t){var e=[];return t._embedded.links.forEach((function(t){e.push({docId:t.docId,hide:t.hide,id:t.id,layerTable:t.layerTable,layerTableId:t.layerTableId,objectContourId:t.objectContourId})})),e},t.prototype.openMap=function(t){var e="/portal-gis/"+t.layerTableId+"/"+t.objectContourId;window.open(e,"_blank")},t.prototype.delete=function(t){var e=this;this.myBlockUI.start(),this.$timeout(1500).then((function(n){e.gisRestService.deleteLink(t.id).then((function(t){e.updateData()})).catch((function(t){e.myBlockUI.stop()}))}))},t.prototype.hide=function(t){var e=this;this.myBlockUI.start(),this.$timeout(1500).then((function(n){e.gisRestService.updateLink(t.id,t).then((function(t){e.updateData()})).catch((function(t){e.myBlockUI.stop()}))}))},t.prototype.bind=function(t){var e=this;this.myBlockUI.start(),this.$timeout(1500).then((function(n){var i=[];e.links.forEach((function(t){i.push({docId:e.document.documentID,layerTable:t.layerTable,layerTableId:t.layerTableId,objectContourId:t.objectContourId})})),i.push({docId:e.document.documentID,layerTable:t.layerTable,layerTableId:t.layerTableId,objectContourId:t.objectContourId}),e.gisRestService.replaceLinks(i).then((function(t){e.updateData()})).catch((function(t){e.myBlockUI.stop()}))}))},t.$inject=["$state","$timeout","gisRestService","$filter","blockUI"],t}(),template:n(127),bindings:{document:"<"}})},function(t,e){t.exports='<loading-block loading-status=$ctrl.loadingStatus> <success> <div class="row gisSelctor" block-ui=gisLoad> <div class=col-xs-6> <h4>Привязанные контура</h4> <div ng-class="{\'alert-success\': !l.hide, \'alert-warning\': l.hide}" class="alert alert-success" style=margin-bottom:20px;margin-right:20px ng-if="$ctrl.links.length > 0" ng-repeat="l in $ctrl.links"> <div style=margin-bottom:10px> <span>ID контура: <b>{{l.objectContourId}}</b></span> </div> <div> <button ng-click=$ctrl.openMap(l) class="btn btn-primary">Открыть на карте</button> <button ng-click=$ctrl.delete(l) class="btn btn-default" title="Удалить связь"><i class="fa fa-trash text-danger"></i></button> <button ng-click=$ctrl.hide(l) uib-btn-checkbox ng-model=l.hide class="btn btn-default" title="Скрыть связь"><i class="fa fa-eye-slash"></i></button> </div> </div> <div ng-if="$ctrl.links.length === 0"> отсутствуют </div> </div> <div class=col-xs-6> <h4>Кандидаты на привязку</h4> <div class="alert alert-info" style=margin-bottom:20px;margin-right:20px ng-if="$ctrl.allLinks.length > 0" ng-repeat="l in $ctrl.allLinks"> <div style=margin-bottom:10px> <span>ID контура: <b>{{l.objectContourId}}</b></span> </div> <div> <button ng-click=$ctrl.openMap(l) class="btn btn-primary">Открыть на карте</button> <button ng-click=$ctrl.bind(l) class="btn btn-default">Привязать</button> </div> </div> <div ng-if="$ctrl.allLinks.length === 0"> отсутствуют </div> </div> </div> </success> <error> <div class=m-t-sm> <span class="fa fa-times-circle text-danger"></span> <span> {{$ctrl.errorMessage}}</span> </div> </error> <loading> <div class=m-t-sm> <div style=height:200px;padding-top:40px> <div class="sk-spinner sk-spinner-three-bounce"> <div class=sk-bounce1></div> <div class=sk-bounce2></div> <div class=sk-bounce3></div> </div> </div> </div> </loading> </loading-block>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(1),s=(n.n(i),{controller:function(){function t(t,e,n,s,o){this.$state=t,this.$timeout=e,this.gisRestService=n,this.$filter=s,this.blockUI=o,this.loadingStatus=i.LoadingStatus.LOADING}return t.prototype.$onInit=function(){var t,e,n=this;this.myBlockUI=this.blockUI.instances.get("gisLoad"),this.gisRestService.linksSearch({registryCode:this.document.reestr,docNumber:this.document.documentRequisites.documentNumber,docDate:this.$filter("date")(new Date(this.document.documentRequisites.documentDate.toString()),"yyyy-MM-dd")}).then((function(e){return t=n.transformAllLinks(e),n.gisRestService.findByDocId(n.document.documentID)})).then((function(s){e=n.transformLinks(s);var o=[];t.forEach((function(t){var n=!1;e.forEach((function(e){t.layerTableId===e.layerTableId&&t.objectContourId===e.objectContourId&&(n=!0)})),n||o.push(t)})),n.allLinks=o,n.links=e,n.loadingStatus=i.LoadingStatus.SUCCESS})).catch((function(t){n.errorMessage="Данные не найдены",n.loadingStatus=i.LoadingStatus.ERROR}))},t.prototype.$onDestroy=function(){this.myBlockUI.reset()},t.prototype.updateData=function(){var t,e,n=this;this.gisRestService.linksSearch({registryCode:this.document.reestr,docNumber:this.document.documentRequisites.documentNumber,docDate:this.$filter("date")(new Date(this.document.documentRequisites.documentDate.toString()),"yyyy-MM-dd")}).then((function(e){return t=n.transformAllLinks(e),n.gisRestService.findByDocId(n.document.documentID)})).then((function(i){e=n.transformLinks(i);var s=[];t.forEach((function(t){var n=!1;e.forEach((function(e){t.layerTableId===e.layerTableId&&t.objectContourId===e.objectContourId&&(n=!0)})),n||s.push(t)})),n.allLinks=s,n.links=e,n.myBlockUI.stop()})).catch((function(t){n.myBlockUI.stop()}))},t.prototype.transformAllLinks=function(t){var e=[];return t.forEach((function(t){e.push({layerTable:t.layerTable,layerTableId:t.layerTableId,objectContourId:t.objectContourId})})),e},t.prototype.transformLinks=function(t){var e=[];return t._embedded.links.forEach((function(t){e.push({docId:t.docId,hide:t.hide,id:t.id,layerTable:t.layerTable,layerTableId:t.layerTableId,objectContourId:t.objectContourId})})),e},t.prototype.openMap=function(t){var e="/portal-gis/"+t.layerTableId+"/"+t.objectContourId;window.open(e,"_blank")},t.prototype.bind=function(t){var e=this;this.myBlockUI.start(),this.$timeout(1500).then((function(n){var i=[];e.links.forEach((function(t){i.push({docId:e.document.documentID,layerTable:t.layerTable,layerTableId:t.layerTableId,objectContourId:t.objectContourId})})),i.push({docId:e.document.documentID,layerTable:t.layerTable,layerTableId:t.layerTableId,objectContourId:t.objectContourId}),e.gisRestService.replaceLinks(i).then((function(t){e.updateData()})).catch((function(t){e.myBlockUI.stop()}))}))},t.$inject=["$state","$timeout","gisRestService","$filter","blockUI"],t}(),template:n(129),bindings:{document:"<"}})},function(t,e){t.exports='<loading-block loading-status=$ctrl.loadingStatus> <success> <div class="row gisSelctor" block-ui=gisLoad> <div class=col-xs-6> <h4>Привязанные контура</h4> <div ng-class="{\'alert-success\': !l.hide, \'alert-warning\': l.hide}" class="alert alert-success" style=margin-bottom:20px;margin-right:20px ng-if="$ctrl.links.length > 0" ng-repeat="l in $ctrl.links"> <div style=margin-bottom:10px> <span>ID контура: <b>{{l.objectContourId}}</b></span> </div> <div> <button ng-click=$ctrl.openMap(l) class="btn btn-primary">Открыть на карте</button> </div> </div> <div ng-if="$ctrl.links.length === 0"> отсутствуют </div> </div> <div class=col-xs-6> <h4>Кандидаты на привязку</h4> <div class="alert alert-info" style=margin-bottom:20px;margin-right:20px ng-if="$ctrl.allLinks.length > 0" ng-repeat="l in $ctrl.allLinks"> <div style=margin-bottom:10px> <span>ID контура: <b>{{l.objectContourId}}</b></span> </div> <div> <button ng-click=$ctrl.openMap(l) class="btn btn-primary">Открыть на карте</button> </div> </div> <div ng-if="$ctrl.allLinks.length === 0"> отсутствуют </div> </div> </div> </success> <error> <div class=m-t-sm> <span class="fa fa-times-circle text-danger"></span> <span> {{$ctrl.errorMessage}}</span> </div> </error> <loading> <div class=m-t-sm> <div style=height:200px;padding-top:40px> <div class="sk-spinner sk-spinner-three-bounce"> <div class=sk-bounce1></div> <div class=sk-bounce2></div> <div class=sk-bounce3></div> </div> </div> </div> </loading> </loading-block>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(t,e){this.$uibModalInstance=t,this.logs=e}return t.prototype.cancel=function(){this.$uibModalInstance.close()},t.$inject=["$uibModalInstance","logs"],t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),s=(n.n(i),n(4)),o=n(0),c=(n.n(o),{controller:function(){function t(t,e,n,s,o,c,r){this.$state=t,this.$timeout=e,this.zeptService=n,this.$filter=s,this.blockUI=o,this.$uibModal=c,this.toastr=r,this.loadingStatus=i.LoadingStatus.LOADING}return t.prototype.$onInit=function(){var t=this;this.sortings=[new s.b("lfileName","none",""),new s.b("lfileSize","none",""),new s.b("lfolderName","asc",""),new s.b("ldateOper","none",""),new s.b("lstatus","none","")],this.myBlockUI=this.blockUI.instances.get("logFiles"),this.zeptService.get(this.document.documentID).then((function(e){t.files=e,t.calculate(),t.loadingStatus=i.LoadingStatus.SUCCESS})).catch((function(e){t.loadingStatus=i.LoadingStatus.ERROR}))},t.prototype.orderBy=function(t,e){var n=this,i=t;return e.slice().reverse().forEach((function(t){switch(t.value){case"desc":i=n.$filter("orderBy")(i,t.name,!0);break;case"asc":i=n.$filter("orderBy")(i,t.name,!1)}})),i},t.prototype.change=function(t){this.update(t.name),this.files=this.orderBy(this.files,this.sortings)},t.prototype.update=function(t){this.sortings.forEach((function(e){if(e.name===t)if("desc"===e.value)e.value="asc";else e.value="desc";else e.value="none"}))},t.prototype.calculate=function(){var t=this;this.firstTime=!o.every(this.files,(function(t){return"SUCCESS"===t.status})),this.files.forEach((function(t){t.lfileName=t.fileName,t.lstatus=t.status,t.lfileSize=t.fileSize,t.lfolderName=t.folderName,t.ldateOper=t.dateOper,t.lfileId=t.id,t.lfolderId=t.guidFolder,t.lurlPart=t.urlPart,t.lattempt=t.attempt})),this.files=this.orderBy(this.files,this.sortings);var e=!0;this.loadedFilesNumber=0,this.allFilesNumber=this.files.length,this.summLoadedFilesSize=0,this.summAllFilesSize=0,this.files.forEach((function(n){t.summAllFilesSize+=null===n.fileSize?0:parseInt(n.fileSize),"SUCCESS"!==n.status?e=!1:(t.loadedFilesNumber++,t.summLoadedFilesSize+=null===n.fileSize?0:parseInt(n.fileSize))})),this.summLoadedFilesSize=this.summLoadedFilesSize/1048576,this.summAllFilesSize=this.summAllFilesSize/1048576,this.status=e},t.prototype.$onDestroy=function(){this.myBlockUI.reset()},t.prototype.showHistory=function(t){this.$uibModal.open({template:n(132),controller:"LogFileGldController as ctrl",size:"lg",backdrop:"static",keyboard:!1,resolve:{logs:function(){return t.zepdLogs}}}).result.then((function(t){})).catch((function(t){}))},t.prototype.upload=function(){var t=this;this.myBlockUI.start(),this.zeptService.post(this.document.documentID).then((function(e){t.zeptService.get(t.document.documentID).then((function(e){t.files=e,t.calculate(),t.myBlockUI.stop()})).catch((function(e){t.myBlockUI.stop(),t.toastr.error("Ошибка при дозагрузке файлов!")}))})).catch((function(e){t.myBlockUI.stop(),t.toastr.error("Ошибка при дозагрузке файлов!")}))},t.$inject=["$state","$timeout","zeptRestService","$filter","blockUI","$uibModal","toastr"],t}(),template:n(133),bindings:{document:"<",editor:"<"}})},function(t,e){t.exports='<div class=inmodal> <div class=modal-header> <h3 class=modal-title><i class="fa fa-history" aria-hidden=true></i>&nbsp;История загрузки</h3> </div> <div class=modal-body style=background:#fff> <table class="table animated fadeIn"> <thead> <tr> <th style=width:auto;vertical-align:bottom>Статус загрузки</th> <th style=width:auto;vertical-align:bottom>Дата загрузки</th> </tr> </thead> <tbody> <tr ng-repeat="log in ctrl.logs"> <td style=vertical-align:middle!important;outline:0> <span class="label label-success" ng-if="log.status === \'SUCCESS\'">Успешно</span> <span class="label label-danger" ng-if="log.status === \'ERROR\'">Ошибка</span> </td> <td style=vertical-align:middle!important;outline:0>{{log.dateOper | date: "dd.MM.yyyy"}}</td> </tr> </tbody> </table> </div> <div class=modal-footer> <button type=button class="btn btn-white" ng-click=ctrl.cancel()>Закрыть</button> </div> </div>'},function(t,e){t.exports='<loading-block loading-status=$ctrl.loadingStatus> <success> <div ng-if="$ctrl.files.length === 0"> <span class="text-warning fa fa-exclamation-triangle"></span> <span> История загрузки файлов пуста</span> </div> <div class=logFiles block-ui=logFiles ng-if="$ctrl.files.length > 0"> <div class=clearfix> <div style=margin-bottom:0 class="pull-left alert" ng-class="{\'alert-success\': $ctrl.status, \'alert-danger\': !$ctrl.status}"> <p>Общий статус: <b><span ng-if=$ctrl.status>Загружены все файлы</span><span ng-if=!$ctrl.status>Не все файлы загружены</span></b></p> <p>Загружено: <b>{{$ctrl.loadedFilesNumber}} из {{$ctrl.allFilesNumber}} ({{$ctrl.summLoadedFilesSize | number:2}} Мб из {{$ctrl.summAllFilesSize | number:2}} Мб) </b></p> </div> <div style=margin-bottom:0 class=pull-right> <button class="btn btn-primary" ng-if=$ctrl.firstTime ng-click=$ctrl.upload()>Догрузить файлы</button> </div> </div> <table class="table animated fadeIn"> <thead> <tr> <th style=width:30px;vertical-align:bottom></th> <th style=width:300px;vertical-align:bottom> <span class="m-r-sm sorting" style=margin-right:5px> <a ng-if="$ctrl.sortings[0].value === \'none\'" ng-click=$ctrl.change($ctrl.sortings[0])>Название документа</a> <a ng-if="$ctrl.sortings[0].value === \'asc\'" ng-click=$ctrl.change($ctrl.sortings[0])>Название документа <span class="fa fa-sort-asc"></span></a> <a ng-if="$ctrl.sortings[0].value === \'desc\'" ng-click=$ctrl.change($ctrl.sortings[0])>Название документа <span class="fa fa-sort-desc"></span></a> </span> </th> <th style=width:150px;vertical-align:bottom> <span class="m-r-sm sorting" style=margin-right:5px> <a ng-if="$ctrl.sortings[1].value === \'none\'" ng-click=$ctrl.change($ctrl.sortings[1])>Размер</a> <a ng-if="$ctrl.sortings[1].value === \'asc\'" ng-click=$ctrl.change($ctrl.sortings[1])>Размер <span class="fa fa-sort-asc"></span></a> <a ng-if="$ctrl.sortings[1].value === \'desc\'" ng-click=$ctrl.change($ctrl.sortings[1])>Размер <span class="fa fa-sort-desc"></span></a> </span> </th> <th style=width:auto;vertical-align:bottom> <span class="m-r-sm sorting" style=margin-right:5px> <a ng-if="$ctrl.sortings[2].value === \'none\'" ng-click=$ctrl.change($ctrl.sortings[2])>Название папки</a> <a ng-if="$ctrl.sortings[2].value === \'asc\'" ng-click=$ctrl.change($ctrl.sortings[2])>Название папки <span class="fa fa-sort-asc"></span></a> <a ng-if="$ctrl.sortings[2].value === \'desc\'" ng-click=$ctrl.change($ctrl.sortings[2])>Название папки <span class="fa fa-sort-desc"></span></a> </span> </th> <th style=width:150px;vertical-align:bottom> <span class="m-r-sm sorting" style=margin-right:5px> <a ng-if="$ctrl.sortings[3].value === \'none\'" ng-click=$ctrl.change($ctrl.sortings[3])>Дата загрузки</a> <a ng-if="$ctrl.sortings[3].value === \'asc\'" ng-click=$ctrl.change($ctrl.sortings[3])>Дата загрузки <span class="fa fa-sort-asc"></span></a> <a ng-if="$ctrl.sortings[3].value === \'desc\'" ng-click=$ctrl.change($ctrl.sortings[3])>Дата загрузки <span class="fa fa-sort-desc"></span></a> </span> </th> <th style=width:150px;vertical-align:bottom> <span class="m-r-sm sorting" style=margin-right:5px> <a ng-if="$ctrl.sortings[4].value === \'none\'" ng-click=$ctrl.change($ctrl.sortings[4])>Статус загрузки</a> <a ng-if="$ctrl.sortings[4].value === \'asc\'" ng-click=$ctrl.change($ctrl.sortings[4])>Статус загрузки <span class="fa fa-sort-asc"></span></a> <a ng-if="$ctrl.sortings[4].value === \'desc\'" ng-click=$ctrl.change($ctrl.sortings[4])>Статус загрузки <span class="fa fa-sort-desc"></span></a> </span> </th> <th style=padding-right:0;padding-top:0> </th> </tr> </thead> <tbody> <tr ng-repeat-start="f in $ctrl.files" ng-init="rowShow = false;"> <td ng-click="rowShow = !rowShow" style=outline:0;vertical-align:middle!important> <span> <i class="fa fa-angle-right" ng-show="rowShow === false"></i><i class="fa fa-angle-down" ng-show="rowShow === true"></i> </span> </td> <td ng-click="rowShow = !rowShow" style=vertical-align:middle!important;outline:0>{{f.lfileName}}</td> <td ng-click="rowShow = !rowShow" style=vertical-align:middle!important;outline:0> <span ng-if="f.lfileSize !== null">{{(f.lfileSize / (1024*1024)) | number:2}} Мб</span> </td> <td ng-click="rowShow = !rowShow" style=vertical-align:middle!important;outline:0>{{f.lfolderName}}</td> <td ng-click="rowShow = !rowShow" style=vertical-align:middle!important;outline:0>{{f.ldateOper | date: "dd.MM.yyyy HH:mm"}}</td> <td ng-click="rowShow = !rowShow" style=vertical-align:middle!important;outline:0> <span class="label label-success" ng-if="f.lstatus === \'SUCCESS\'">Успешно</span> <span class="label label-danger" ng-if="f.lstatus === \'ERROR\'">Ошибка</span> <span class="label label-primary" ng-if="f.lstatus === \'CREATE\'">Создан</span> </td> <th style=vertical-align:middle!important> <button ng-if="f.zepdLogs.length > 1" class="btn btn-default" title="Посмотреть историю" ng-click=$ctrl.showHistory(f)><i class="fa fa-columns"></i></button> </th> </tr> <tr ng-repeat-end ng-show=rowShow style="border-top:2px solid #de8650"> <td colspan=7> <div class="row m-t-sm"> <div class="col-lg-3 col-md-3 col-sm-3 control-label our-form-label">Идентификатор файла</div> <div class="col-lg-9 col-md-9 col-sm-9"> <p ng-if=f.lfileId class=specified>{{f.lfileId}}</p> <p ng-if=!f.lfileId class=not-specified>отсутсвует</p> </div> </div> <div class=row> <div class="col-lg-3 col-md-3 col-sm-3 control-label our-form-label">Идентификатор папки файла</div> <div class="col-lg-9 col-md-9 col-sm-9"> <p ng-if=f.lfolderId class=specified>{{f.lfolderId}}</p> <p ng-if=!f.lfolderId class=not-specified>отсутсвует</p> </div> </div> <div class=row> <div class="col-lg-3 col-md-3 col-sm-3 control-label our-form-label">Значение тэга URLPart входящего документа</div> <div class="col-lg-9 col-md-9 col-sm-9"> <p ng-if=f.lurlPart class=specified>{{f.lurlPart}}</p> <p ng-if=!f.lurlPart class=not-specified>отсутсвует</p> </div> </div> <div class=row> <div class="col-lg-3 col-md-3 col-sm-3 control-label our-form-label">Колличество попыток</div> <div class="col-lg-9 col-md-9 col-sm-9"> <p ng-if=f.lattempt class=specified>{{f.lattempt}}</p> <p ng-if=!f.lattempt class=not-specified>отсутсвует</p> </div> </div> </td> </tr> </tbody> </table> </div> </success> <error> <span class="text-danger fa fa-exclamation-triangle"></span> <span> Ошибка при формировании истории загрузки файлов</span> </error> </loading-block>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i={controller:function(){function t(){}return t.prototype.$onInit=function(){var t=this;this.statuses.forEach((function(e){e.code===t.document.registration.registrationStatus&&(t.color=e.color,t.value=e.name)}))},t}(),template:n(135),bindings:{document:"<",statuses:"<"}}},function(t,e){t.exports='Статус регистрации: <span class="label label-{{$ctrl.color}}">{{$ctrl.value}}</span>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(1),s=(n.n(i),n(0)),o=(n.n(s),{controller:function(){function t(t,e,n,i,s,o){this.$q=t,this.$timeout=e,this.solarRestService=n,this.$filter=i,this.nsiRestService=s,this.documentRestService=o,this.changedDoc=[],this.isDanger=!1,this.message="Внесение изменений в зарегистрированный документ",this.showUnregistered=!1,this.showRegistered=!0}return t.prototype.$onInit=function(){var t=this;this.nsiRestService.get("registrationStatus").then((function(e){if(t.statuses=e,t.loadingStatus=i.LoadingStatus.LOADING,t.document&&t.document.registration&&"CHANGE_QUEUE"===t.document.registration.registrationStatus){var n=null;n="8050"===t.document.reestr&&(t.document.documentType="GPZU")?{documentRegistrationCode:["CHANGE_QUEUE","QUEUE","REGISTERED"],reestr:[t.document.reestr],documentNumber:t.document.documentRequisites.documentNumber}:{documentRegistrationCode:["CHANGE_QUEUE","QUEUE","REGISTERED"],reestr:[t.document.reestr],documentDateFrom:t.$filter("date")(t.document.documentRequisites.documentDate,"yyyy-MM-dd"),documentDateTo:t.$filter("date")(t.document.documentRequisites.documentDate,"yyyy-MM-dd"),documentNumber:t.document.documentRequisites.documentNumber},t.solarRestService.searchExt(n).then((function(e){e.docs.length>0?e.docs.forEach((function(e){var n=[];e.documentId!==t.document.documentID?(n.push(t.documentRestService.getDocument(e.documentId)),t.$q.all(n).then((function(e){e.forEach((function(e){var n=e.document;"QUEUE"===n.registration.registrationStatus&&(t.isDanger=!0,t.message="Внесение изменений в незарегистрированный документ"),t.changedDoc.push(n)})),t.changedDoc.length>0&&!t.isDanger&&(t.showUnregistered=!0),t.changedDoc.length>0&&t.isDanger&&(t.showRegistered=!1),t.loadingStatus=i.LoadingStatus.SUCCESS})).catch((function(e){console.log(e),t.loadingStatus=i.LoadingStatus.ERROR}))):t.loadingStatus=i.LoadingStatus.SUCCESS})):t.loadingStatus=i.LoadingStatus.SUCCESS})).catch((function(e){t.loadingStatus=i.LoadingStatus.ERROR,console.log(e)}))}else t.loadingStatus=i.LoadingStatus.SUCCESS})).catch((function(e){console.log(e),t.loadingStatus=i.LoadingStatus.ERROR}))},t.prototype.getAddressString=function(){var t=this.getTerritoryValues();if(this.document.object&&this.document.object.objectAddress){var e=this.document.object.objectAddress;return t&&t.length>0&&(e+=" ("+t.join(", ")+")"),e}if(t&&t.length>0)return t.join(", ")},t.prototype.getTerritoryValues=function(){var t=this.document.territory?this.document.territory:void 0,e=t?s.map(this.document.territory.area,(function(t){return t.areaName})):[],n=t?s.map(this.document.territory.district,(function(t){return t.districtName})):[];return e.concat(n)},t.$inject=["$q","$timeout","solarRestService","$filter","nsiRestService","documentRestService"],t}(),template:n(137),bindings:{document:"<"},transclude:{headerMenuSlot:"headerMenu"}})},function(t,e){t.exports='<loading-block loading-status=$ctrl.loadingStatus> <success> <div class=m-b-xs ng-init="addressString = $ctrl.getAddressString()"> <h3 class=m-t-xs ng-class="{\'text-warning\': !$ctrl.isDanger, \'text-danger\': $ctrl.isDanger}" ng-if="$ctrl.changedDoc.length > 0"> {{$ctrl.message}} <a ng-repeat="doc in $ctrl.changedDoc" class="fa fa-link" ui-sref="app.isogd.card({id: doc.documentID})" target=_blank aria-hidden=true></a> </h3> <div ng-if=$ctrl.isDanger class="alert alert-danger m-b-xs" role=alert> Редактирование документа невозможно, до момента регистрации первичного документа </div> <div class=clearfix> <h2 class="m-t-sm m-b-xs semibold pull-left" style=font-weight:600> <span>{{$ctrl.document.documentTypeValue}}</span> <span ng-if=$ctrl.document.documentRequisites.documentNumber>№ {{$ctrl.document.documentRequisites.documentNumber}}</span> <span ng-if=$ctrl.document.documentRequisites.documentDate>от {{$ctrl.document.documentRequisites.documentDate | date: \'dd.MM.yyyy\'}}</span> </h2> <div class=pull-right ng-if=!$ctrl.isDanger> <div ng-transclude=headerMenuSlot></div> </div> </div> <h2 style=font-weight:500 class="m-t-xs normal" ng-if=$ctrl.document.documentRequisites.documentName>{{$ctrl.document.documentRequisites.documentName}}</h2> <h2 style=font-weight:500 class="m-t-xs normal" ng-if=addressString> {{addressString}} </h2> <h3 class=m-t-xs ng-if=$ctrl.document.object.objectName>{{$ctrl.document.object.objectName}}</h3> <div ng-if=$ctrl.document.territory.cadastralNumber>Кадастровый номер: {{$ctrl.document.territory.cadastralNumber.join(\', \')}}</div> <div class="m-t-xs m-b-xs"> <span style=margin-right:10px ng-if=$ctrl.document.documentRequisites.documentStatusValue>Статус действия: <span class="label label-{{$ctrl.document.documentRequisites.documentStatusColor}}">{{$ctrl.document.documentRequisites.documentStatusValue}}</span></span> <registration-status document=$ctrl.document statuses=$ctrl.statuses></registration-status> </div> </div> </success> <error> <div class=m-t-sm> <span class="fa fa-times-circle text-danger"></span> <span> Ошибка при формировании заголовка документа</span> </div> </error> <loading> <div class=m-t-sm> <div style=height:100px;padding-top:40px> <div class="sk-spinner sk-spinner-three-bounce"> <div class=sk-bounce1></div> <div class=sk-bounce2></div> <div class=sk-bounce3></div> </div> </div> </div> </loading> </loading-block>'},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(0),s=(n.n(i),function(){function t(t,e,n,i){this.$timeout=t,this.toastr=e,this.documentLinkRestService=n,this.$q=i}return t.prototype.changeLink=function(t){var e=this,n=this.$q.defer();return this.$timeout(1500).then((function(i){e.documentLinkRestService.update(t).then((function(t){n.resolve()})).catch((function(t){n.reject(t)}))})),n.promise},t.prototype.deleteLink=function(t){var e=this,n=this.$q.defer();return this.$timeout(1500).then((function(i){e.documentLinkRestService.delete(t.linkId).then((function(t){n.resolve()})).catch((function(t){n.reject(t)}))})),n.promise},t.prototype.getAddress=function(t){var e="";t&&t.parcelDossier&&t.parcelDossier.address&&(e+=t.parcelDossier.address,e+=" ");var n="";t&&t.parcelDossier&&t.parcelDossier.area&&t.parcelDossier.area.areaName&&(n=t.parcelDossier.area.areaName);var i="";t&&t.parcelDossier&&t.parcelDossier.district&&t.parcelDossier.district.districtName&&(i=t.parcelDossier.district.districtName);var s="";return n&&(s+=n),i&&(s+=n?", ":"",s+=i),s&&(s=" ("+s+")"),e+=s},t.prototype.findChapterByCode=function(t,e){var n=this._findChapterByCode(t,e);return n?n.name:""},t.prototype.findLinkTypeByCode=function(t,e){var n=null;return t.forEach((function(t){t.code===e&&(n=t.name)})),n},t.prototype.getAddressString=function(t){if(!t.territory)return"";var e=this.getTerritoryValues(t.territory);if(t.object&&t.object.objectAddress){var n=t.object.objectAddress;return e&&e.length>0&&(n+=" ("+e.join(", ")+")"),n}return e&&e.length>0?e.join(", "):void 0},t.prototype.getTerritoryValues=function(t){var e=t?i.map(t.area,(function(t){return t.areaName})):[],n=t?i.map(t.district,(function(t){return t.districtName})):[];return e.concat(n)},t.prototype._findChapterByCode=function(t,e){var n=this,i=null;return t.forEach((function(t){if(t.chapterCode===e&&(i=t),t.children&&t.children.length>0){var s=n._findChapterByCode(t.children,e);null!==s&&(i=s)}})),i},t.$inject=["$timeout","toastr","documentLinkRestService","$q"],t}())}])}));
//# sourceMappingURL=/sm/d6dfd326dddceed46d0d95c024f91d95755803999a35ec340fdec90eace11a2a.map