bms-shared-components 1.1.14 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -120208,10 +120208,8 @@ const xlsx = /* @__PURE__ */ getDefaultExportFromCjs(distExports), _hoisted_1$l
|
|
|
120208
120208
|
return "#f9c7c8";
|
|
120209
120209
|
if (io?.Monetization)
|
|
120210
120210
|
return "#f3c77a";
|
|
120211
|
-
|
|
120212
|
-
|
|
120213
|
-
let vr = hooks(), Uo = hooks(io.DateIn), jo = hooks(io.DateOut ?? "2999-12-12");
|
|
120214
|
-
return vr.isBetween(Uo, jo) ? "#cbe4cb" : "#dedee1";
|
|
120211
|
+
let vr = hooks().startOf("day"), Uo = hooks(io.DateIn).startOf("day"), jo = hooks(io.DateOut ?? "2999-12-12").startOf("day");
|
|
120212
|
+
return !io.DateOut || vr.isBetween(Uo, jo, null, "[]") ? "#cbe4cb" : "#dedee1";
|
|
120215
120213
|
}
|
|
120216
120214
|
BenefitProgram((io) => xt.value = io.map((vr) => ({ ...vr, Benefits: JSON.parse(vr.Benefits) }))), BenefitMap((io) => Dt.value = io);
|
|
120217
120215
|
const xn = ["Snils", "Fio", "AttachedMo"], Pn = computed(() => {
|
|
@@ -1300,7 +1300,7 @@ EOD`}return{to_workbook:St,to_sheet:ve,from_sheet:Ut}}(),rC=function(){function
|
|
|
1300
1300
|
`,rn=Yt.charCodeAt(0),un="",gn=[],$n=St.skipHidden&&oe["!cols"]||[],Tn=St.skipHidden&&oe["!rows"]||[],Nn=Et.s.c;Nn<=Et.e.c;++Nn)($n[Nn]||{}).hidden||(gn[Nn]=mf(Nn));var cr=Et.s.r,fr=!1,sr=0;return ve._read=function(){if(!fr)return fr=!0,ve.push("\uFEFF");for(;cr<=Et.e.r;)if(++cr,!(Tn[cr-1]||{}).hidden&&(un=Bq(oe,Et,cr-1,gn,Ut,rn,Mt,sr,St),un!=null&&(un||St.blankrows!==!1)))return ve.push((sr++?Yt:"")+un);return ve.push(null)},ve}function JI(oe,ze){var ve=UR(),St=ze||{},Et=St.header!=null?St.header:$M,Mt=St.footer!=null?St.footer:GL;ve.push(Et);var Ut=K0(oe["!ref"]);ve.push(HI(oe,Ut,St));var Yt=Ut.s.r,rn=!1;return ve._read=function(){if(Yt>Ut.e.r)return rn||(rn=!0,ve.push("</table>"+Mt)),ve.push(null);for(;Yt<=Ut.e.r;){ve.push(Ly(oe,Ut,Yt,St)),++Yt;break}},ve}function UH(oe,ze){var ve=UR({objectMode:!0});if(oe==null||oe["!ref"]==null)return ve.push(null),ve;var St={t:"n",v:0},Et=0,Mt=1,Ut=[],Yt=0,rn="",un={s:{r:0,c:0},e:{r:0,c:0}},gn=ze||{},$n=gn.range!=null?gn.range:oe["!ref"];switch(gn.header===1?Et=1:gn.header==="A"?Et=2:Array.isArray(gn.header)&&(Et=3),typeof $n){case"string":un=Nf($n);break;case"number":un=Nf(oe["!ref"]),un.s.r=$n;break;default:un=$n}Et>0&&(Mt=0);var Tn=Jd(un.s.r),Nn=[],cr=0,fr=oe["!data"]!=null,sr=un.s.r,nr=0,Or={};fr&&!oe["!data"][sr]&&(oe["!data"][sr]=[]);var xr=gn.skipHidden&&oe["!cols"]||[],Vr=gn.skipHidden&&oe["!rows"]||[];for(nr=un.s.c;nr<=un.e.c;++nr)if(!(xr[nr]||{}).hidden)switch(Nn[nr]=mf(nr),St=fr?oe["!data"][sr][nr]:oe[Nn[nr]+Tn],Et){case 1:Ut[nr]=nr-un.s.c;break;case 2:Ut[nr]=Nn[nr];break;case 3:Ut[nr]=gn.header[nr-un.s.c];break;default:if(St==null&&(St={w:"__EMPTY",t:"s"}),rn=Yt=Lh(St,null,gn),cr=Or[Yt]||0,!cr)Or[Yt]=1;else{do rn=Yt+"_"+cr++;while(Or[rn]);Or[Yt]=cr,Or[rn]=1}Ut[nr]=rn}return sr=un.s.r+Mt,ve._read=function(){for(;sr<=un.e.r;)if(!(Vr[sr-1]||{}).hidden){var Ro=h1(oe,un,sr,Nn,Et,Ut,gn);if(++sr,Ro.isempty===!1||(Et===1?gn.blankrows!==!1:gn.blankrows)){ve.push(Ro.row);return}}return ve.push(null)},ve}function Mq(oe,ze){var ve=UR(),St=ze??{},Et=+St.stride||10;oe.SSF||(oe.SSF=Cd(Aa)),oe.SSF&&(va(),rl(oe.SSF),St.revssf=Dg(oe.SSF),St.revssf[oe.SSF[65535]]=0,St.ssf=oe.SSF,St.cellXfs=[],Fv(St.cellXfs,{},{revssf:{General:0}})),oe.SheetNames.forEach(function(nr){var Or=oe.Sheets[nr];if(!(!Or||!Or["!ref"])){for(var xr=K0(Or["!ref"]),Vr=Or["!data"]!=null,Ro=Vr?Or["!data"]:[],Bs=xr.s.r;Bs<=xr.e.r;++Bs)if(!(Vr&&!Ro[Bs]))for(var qr=xr.s.c;qr<=xr.e.c;++qr){var Qr=Vr?Ro[Bs][qr]:Or[mf(qr)+Jd(Bs)];Qr&&(Qr.t=="d"&&Qr.z==null&&(Qr=Cd(Qr),Qr.z=Aa[14]),Fv(St.cellXfs,Qr,St))}}});var Mt=TO(oe,St),Ut=0,Yt=0,rn=oe.Sheets[oe.SheetNames[Yt]],un=Nf(rn),gn=-1,$n=!1,Tn=[],Nn=0,cr=!1,fr=[],sr={r:0,c:0};return ve._read=function(){switch(Ut){case 0:Ut=1,ve.push(cp),ve.push("<Workbook"+fx({xmlns:vf.ss,"xmlns:o":vf.o,"xmlns:x":vf.x,"xmlns:ss":vf.ss,"xmlns:dt":vf.dt,"xmlns:html":vf.html})+">");break;case 1:Ut=2,ve.push(EO(oe,St)),ve.push(FC(oe));break;case 2:Ut=3,ve.push(Mt),ve.push(OC(oe));break;case 3:{if($n=!1,Yt>=oe.SheetNames.length){Ut=-1,ve.push("");break}if(ve.push("<Worksheet"+fx({"ss:Name":wd(oe.SheetNames[Yt])})+">"),rn=oe.Sheets[oe.SheetNames[Yt]],!rn)return ve.push("</Worksheet>"),void++Yt;var nr=LL(rn,St,Yt,oe);if(nr.length&&ve.push("<Names>"+nr+"</Names>"),!rn["!ref"])return Ut=5;un=Nf(rn["!ref"]),gn=un.s.r,Ut=4}break;case 4:{if(gn<0||gn>un.e.r)return $n&&ve.push("</Table>"),void(Ut=5);gn<=un.s.r&&(rn["!cols"]&&rn["!cols"].forEach(function(Qr,To){ob(Qr);var Yo=!!Qr.width,Jo=fb(To,Qr),Oa={"ss:Index":To+1};Yo&&(Oa["ss:Width"]=F1(Jo.width)),Qr.hidden&&(Oa["ss:Hidden"]="1"),$n||($n=!0,ve.push("<Table>")),ve.push(Fu("Column",null,Oa))}),cr=rn["!data"]!=null,cr&&(fr=rn["!data"]),sr.r=sr.c=0);for(var Or=0;gn<=un.e.r&&Or<Et;++gn,++Or){var xr=[VL(gn,(rn["!rows"]||[])[gn])];if(sr.r=gn,!(cr&&!fr[gn]))for(var Vr=un.s.c;Vr<=un.e.c;++Vr){sr.c=Vr;var Ro=!1;for(Nn=0;Nn!=Tn.length;++Nn)if(!(Tn[Nn].s.c>Vr)&&!(Tn[Nn].s.r>gn)&&!(Tn[Nn].e.c<Vr)&&!(Tn[Nn].e.r<gn)){(Tn[Nn].s.c!=Vr||Tn[Nn].s.r!=gn)&&(Ro=!0);break}if(!Ro){var Bs=mf(Vr)+Jd(gn),qr=cr?fr[gn][Vr]:rn[Bs];xr.push($L(qr,Bs,rn,St,Yt,oe,sr))}}xr.push("</Row>"),$n||($n=!0,ve.push("<Table>")),ve.push(xr.join(""))}}break;case 5:return ve.push(PR(rn,St,Yt,oe)),rn&&rn["!autofilter"]&&ve.push('<AutoFilter x:Range="'+Wb(j0(rn["!autofilter"].ref),{r:0,c:0})+'" xmlns="urn:schemas-microsoft-com:office:excel"></AutoFilter>'),ve.push("</Worksheet>"),Yt++,gn=-1,void(Ut=3);case-1:Ut=-2,ve.push("</Workbook>");break;case-2:ve.push(null);break}},ve}var HH={to_json:UH,to_html:JI,to_csv:IC,to_xlml:Mq,set_readable:p3};if(typeof IM<"u"&&(V.parse_xlscfb=IM),V.parse_zip=HM,V.read=NO,V.readFile=IH,V.readFileSync=IH,V.write=P7,V.writeFile=LH,V.writeFileSync=LH,V.writeFileAsync=RC,V.utils=iV,V.writeXLSX=jM,V.writeFileXLSX=Iq,V.set_fs=um,V.set_cptable=an,V.SSF=Ea,typeof HH<"u"&&(V.stream=HH),typeof Wu<"u"&&(V.CFB=Wu),typeof commonjsRequire<"u"){var Gz=require$$1;(Gz||{}).Readable&&p3(Gz.Readable);try{O0=require$$1}catch{}}}if(J(I),typeof window<"u"&&!window.XLSX)try{window.XLSX=N}catch{}}(xlsx$1,xlsx$1.exports)),xlsx$1.exports}var hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(e,I){Object.defineProperty(I,"__esModule",{value:!0}),I.libraryName=I.xlsx=I.getWorksheetColumnWidths=I.getJsonSheetRow=I.getContentProperty=I.utils=void 0;const N=requireXlsx();Object.defineProperty(I,"utils",{enumerable:!0,get:function(){return N.utils}});const J=(Rt,$t)=>{const Gt=(Ht,qt)=>{const Kt=Ht[qt[0]];return qt.length===1?Kt??"":Kt==null||typeof Kt=="string"||typeof Kt=="boolean"||typeof Kt=="number"||Kt instanceof Date?"":Gt(Kt,qt.slice(1))},zt=$t.split(".");return Gt(Rt,zt)};I.getContentProperty=J;const V=(Rt,$t)=>{const Gt={};return $t.forEach(zt=>{typeof zt.value=="function"?Gt[zt.label]=zt.value(Rt):Gt[zt.label]=(0,I.getContentProperty)(Rt,zt.value)}),Gt};I.getJsonSheetRow=V;const M=(Rt,$t,Gt)=>{var zt;for(let Ht=0;Ht<$t.length;Ht+=1){const qt=Gt[Ht];if(!qt)continue;const Kt=N.utils.decode_col($t[Ht]),Xt=N.utils.decode_range((zt=Rt["!ref"])!==null&&zt!==void 0?zt:"");for(let fn=Xt.s.r+1;fn<=Xt.e.r;++fn){const an=N.utils.encode_cell({r:fn,c:Kt});if(Rt[an])switch(qt){case"hyperlink":Rt[an].l={Target:Rt[an].v};break;default:Rt[an].z=qt}}}},vt=Rt=>{var $t;const Gt=N.utils.decode_range(($t=Rt["!ref"])!==null&&$t!==void 0?$t:""),zt=[];for(let Ht=Gt.s.c;Ht<=Gt.e.c;Ht++){const qt=N.utils.encode_col(Ht);zt.push(qt)}return zt},yt=Rt=>typeof Rt=="string"?Math.max(...Rt.split(`
|
|
1301
1301
|
`).map($t=>$t.length)):typeof Rt=="number"?Rt.toString().length:typeof Rt=="boolean"?Rt?4:5:Rt instanceof Date?Rt.toString().length:0,At=(Rt,$t=1)=>vt(Rt).map(zt=>({width:Object.keys(Rt).filter(Kt=>Kt.replace(/[0-9]/g,"")===zt).reduce((Kt,Xt)=>{const fn=Rt[Xt],an=yt(fn.v);if(!fn.z)return Math.max(Kt,an);const yn=fn.z.length,on=Math.max(an,yn);return Math.max(Kt,on)},0)+$t}));I.getWorksheetColumnWidths=At;const Dt=(Rt,$t)=>{let Gt;Rt.content.length>0?Gt=Rt.content.map(Kt=>(0,I.getJsonSheetRow)(Kt,Rt.columns)):Gt=Rt.columns.map(Kt=>({[Kt.label]:""}));const zt=N.utils.json_to_sheet(Gt),Ht=vt(zt),qt=Rt.columns.map(Kt=>{var Xt;return(Xt=Kt.format)!==null&&Xt!==void 0?Xt:null});return M(zt,Ht,qt),zt["!cols"]=(0,I.getWorksheetColumnWidths)(zt,$t.extraLength),zt},Ft=(Rt,$t={})=>{var Gt,zt,Ht,qt,Kt;const Xt=!!$t.RTL;(Gt=Rt.Workbook)!==null&&Gt!==void 0||(Rt.Workbook={}),(zt=(Kt=Rt.Workbook).Views)!==null&&zt!==void 0||(Kt.Views=[{}]),Rt.Workbook.Views.forEach(yn=>{yn.RTL=Xt});const fn=`${(Ht=$t.fileName)!==null&&Ht!==void 0?Ht:"Spreadsheet"}.xlsx`,an=(qt=$t.writeOptions)!==null&&qt!==void 0?qt:{};return $t.writeMode==="write"?(0,N.write)(Rt,an):$t.writeMode==="writeFile"?(0,N.writeFile)(Rt,fn,an):an.type==="buffer"?(0,N.write)(Rt,an):(0,N.writeFile)(Rt,fn,an)},Pt=(Rt,$t={},Gt=()=>{})=>{if(Rt.length===0)return;const zt=N.utils.book_new();return Rt.forEach((Ht,qt)=>{var Kt;const Xt=Dt(Ht,$t),fn=(Kt=Ht.sheet)!==null&&Kt!==void 0?Kt:`Sheet ${qt+1}`;N.utils.book_append_sheet(zt,Xt,fn)}),Gt(zt),Ft(zt,$t)};I.xlsx=Pt,I.default=I.xlsx,I.libraryName="json-as-xlsx",e.exports=I.xlsx,e.exports.getContentProperty=I.getContentProperty,e.exports.getJsonSheetRow=I.getJsonSheetRow,e.exports.getWorksheetColumnWidths=I.getWorksheetColumnWidths,e.exports.utils=N.utils}(dist,dist.exports)),dist.exports}var distExports=requireDist();const xlsx=getDefaultExportFromCjs(distExports),_hoisted_1$l=["id"],_hoisted_2$h={key:0,class:"flex justify-end mb-1"},_hoisted_3$d={class:"re-table"},_hoisted_4$c={key:0,class:"text-right"},_hoisted_5$b={class:"flex flex-col"},_hoisted_6$b=["onClick"],_hoisted_7$a={class:"flex flex-col gap-0.5 w-[600px]"},_hoisted_8$a={class:"text-sm text-slate-500 text-center"},_hoisted_9$8={open:"",class:"px-1"},_hoisted_10$8={class:"px-1"},_hoisted_11$7={class:"rs-table-btn"},_hoisted_12$6={class:"flex justify-between items-center text-sm text-slate-500 gap-1"},_hoisted_13$5={class:"flex flex-col gap-1"},_hoisted_14$4=["onClick"],_hoisted_15$4={class:"px-1"},_hoisted_16$4=["onClick"],_hoisted_17$3=["onDblclick"],_hoisted_18$3={key:1},_hoisted_19$3=["onContextmenu","onClick"],_hoisted_20$3={key:0,class:"text-right"},_hoisted_21$3=["onClick","title"],_hoisted_22$2={key:0},_hoisted_23$2={key:1},_hoisted_24$2=["title"],_hoisted_25$2=["title"],_hoisted_26$2={key:1},_hoisted_27$2=["onClick"],_hoisted_28$2={key:0},_hoisted_29$2={key:0,class:"bg-slate-100 hover:bg-slate-100 cursor-arrow"},_hoisted_30$2={key:0},_hoisted_31$2={key:1},_hoisted_32$2={key:1},_hoisted_33$2={class:"pagination-wrapper"},_hoisted_34$2={class:"flex items-center gap-4"},_hoisted_35$1={key:0,class:"pagination"},_hoisted_36$1=["onClick"],_hoisted_37$1={key:1,class:"flex items-center gap-2"},_hoisted_38$1={class:"text-sm text-slate-400"},_hoisted_39$1={key:0},_hoisted_40$1={class:"mb-3"},_hoisted_41$1={class:"border rounded p-3 bg-gray-50"},_hoisted_42$1=["onDragstart","onDrop"],_hoisted_43$1={class:"flex items-center gap-2"},_hoisted_44$1={class:"text-sm font-medium"},_hoisted_45$1={class:"flex items-center gap-1"},_hoisted_46$1=["onClick"],_hoisted_47$1=["onClick"],_hoisted_48$1={class:"flex justify-end gap-2"},STORAGE_KEY_ALL_HIDDEN$1="table_hidden_columns",STORAGE_KEY_ALL_WIDTHS$1="table_column_widths",STORAGE_KEY_PAGE_SIZE$1="table_page_size",STORAGE_KEY_COLUMN_ORDER$1="table_column_order",_sfc_main$t={__name:"ReSimpleTable",props:vue.mergeModels({striped:{type:Boolean,default:!1},columns:{type:Array,default:()=>[]},growOnlyX:{type:Boolean,default:!1},data:{type:Array,default:()=>[]},pageSize:{type:Number,default:999},rowActions:{type:Array,default:()=>[]},rowColor:{type:Function,default:()=>{}},enableXlsxExport:{type:Boolean,default:!1},contextActions:{type:Array,default:()=>[]},rowHorizontal:{type:Boolean,default:!1},tableClass:{type:String,default:""},customPagination:{type:Boolean,default:!1},recordTotal:{type:Number,default:0},tableId:{type:String,required:!0},stickyHeader:{type:Boolean,default:!1},wheelPropagation:{type:Boolean,default:!0},numbering:{type:Boolean,default:!1},enablePageSizeSelector:{type:Boolean,default:!1},footer:{type:Boolean,default:!1}},{sortDirection:{local:!0,default:null},sortDirectionModifiers:{},sortColumnIndex:{local:!0,default:null},sortColumnIndexModifiers:{},page:{local:!0,default:1},pageModifiers:{}}),emits:vue.mergeModels(["rowClicked","cellClicked"],["update:sortDirection","update:sortColumnIndex","update:page"]),setup(e,{expose:I,emit:N}){const J=N,V=vue.ref({}),M=e,vt=vue.useModel(e,"sortDirection"),yt=vue.useModel(e,"sortColumnIndex"),At=vue.ref(""),Dt=vue.ref({}),Ft=vue.ref({}),Pt=vue.ref({}),Rt=vue.ref(!1),$t=vue.ref([]),Gt=vue.ref(null),zt=vue.ref(M.pageSize);vue.watch(()=>M.pageSize,()=>{zt.value=M.pageSize},{immediate:!0});function Ht(){try{const Ir=JSON.parse(localStorage.getItem(STORAGE_KEY_ALL_HIDDEN$1)||"{}"),Fr=JSON.parse(localStorage.getItem(STORAGE_KEY_ALL_WIDTHS$1)||"{}"),Fa=JSON.parse(localStorage.getItem(STORAGE_KEY_COLUMN_ORDER$1)||"{}");Ir[M.tableId]&&(wn.value=Ir[M.tableId]),Fr[M.tableId]&&(on.value=Fr[M.tableId],Kt()),Fa[M.tableId]&&yd(Fa[M.tableId])}catch(Ir){console.error("Ошибка при загрузке состояния таблицы:",Ir)}}function qt(){try{const Ir=JSON.parse(localStorage.getItem(STORAGE_KEY_ALL_HIDDEN$1)||"{}"),Fr=JSON.parse(localStorage.getItem(STORAGE_KEY_ALL_WIDTHS$1)||"{}"),Fa=JSON.parse(localStorage.getItem(STORAGE_KEY_PAGE_SIZE$1)||"{}"),fs=JSON.parse(localStorage.getItem(STORAGE_KEY_COLUMN_ORDER$1)||"{}");Object.keys(wn.value).length?Ir[M.tableId]=wn.value:delete Ir[M.tableId],Object.keys(on.value).length?Fr[M.tableId]=on.value:delete Fr[M.tableId],Fa[M.tableId]=zt.value,$t.value.length>0?fs[M.tableId]=$t.value.map(eu=>eu.originalIndex):delete fs[M.tableId],localStorage.setItem(STORAGE_KEY_ALL_HIDDEN$1,JSON.stringify(Ir)),localStorage.setItem(STORAGE_KEY_ALL_WIDTHS$1,JSON.stringify(Fr)),localStorage.setItem(STORAGE_KEY_PAGE_SIZE$1,JSON.stringify(Fa)),localStorage.setItem(STORAGE_KEY_COLUMN_ORDER$1,JSON.stringify(fs))}catch(Ir){console.error("Ошибка при сохранении состояния таблицы:",Ir)}}async function Kt(){if(await vue.nextTick(),!M.tableId){console.log("Не указан идентификатор таблицы",M.columns),notifyError$1("Не указан идентификатор таблицы");return}const Ir=document.getElementById(`table-${M.tableId}`);if(!Ir)return;const Fr=Ir.querySelector(".re-table");if(!Fr)return;const Fa=Fr.querySelectorAll("thead th");Object.entries(on.value).forEach(([fs,eu])=>{const ga=Fa[parseInt(fs)];ga&&eu&&(ga.style.width=`${eu}px`,ga.style.minWidth=`${eu}px`)})}vue.onMounted(()=>{Aa(),Ht(),document.addEventListener("click",jr),document.addEventListener("keydown",io)});const Xt=vue.useModel(e,"page"),fn=vue.ref(!1),an=vue.ref({x:"0px",y:"0px"}),yn=vue.ref(null),on=vue.ref({});let _n=!1,dn=null,xn=0,bn=0;const wn=vue.ref({}),Tr=vue.ref(!1);let lr=vue.ref(null);function ar(Ir){_n=!0,dn=Ir.target.parentElement,xn=Ir.pageX,bn=dn.offsetWidth,document.addEventListener("mousemove",Qt),document.addEventListener("mouseup",Hn),Ir.preventDefault()}function Qt(Ir){if(!_n)return;const Fr=bn+(Ir.pageX-xn);if(Fr>=50){dn.style.width=`${Fr}px`,dn.style.minWidth=`${Fr}px`;const Fa=document.getElementById(`table-${M.tableId}`);if(!Fa)return;const fs=Fa.querySelector(".re-table");if(!fs)return;const eu=fs.querySelectorAll("thead th"),ga=Array.from(eu).indexOf(dn);ga!==-1&&(on.value[ga]=Fr,qt())}}function Hn(){_n=!1,document.removeEventListener("mousemove",Qt),document.removeEventListener("mouseup",Hn)}function tr(Ir){const Fr=document.getElementById(`table-${M.tableId}`);if(!Fr)return;const Fa=Fr.querySelector(".re-table");if(!Fa)return;const eu=Fa.querySelectorAll("thead th")[Ir];eu&&(eu.style.width="",eu.style.minWidth="120px",delete on.value[Ir],qt())}vue.onUnmounted(()=>{document.removeEventListener("mousemove",Qt),document.removeEventListener("mouseup",Hn),document.removeEventListener("click",jr),qt()});const wr=vue.computed(()=>{let Ir=[...M.data];for(const Fr in V.value)V.value[Fr]&&(typeof Ln.value[Fr]?.Field=="function"?Ir=Ir.filter(Fa=>String(Ln.value[Fr].Field(Fa))?.toLowerCase().indexOf(V.value[Fr]?.toLowerCase())>-1):Ir=Ir.filter(Fa=>String(Fa[Ln.value[Fr].Field])?.toLowerCase().indexOf(V.value[Fr]?.toLowerCase())>-1));for(const Fr in Dt.value)Dt.value[Fr]&&(Ir=Ir.filter(Fa=>typeof Ln.value[Fr]?.Field=="function"?Dt.value[Fr].includes(Ln.value[Fr].Field(Fa)):Dt.value[Fr].includes(Fa[Ln.value[Fr].Field])));for(const Fr in Pt.value)Pt.value[Fr]&&(Ir=Ir.filter(Fa=>{let fs;return typeof Ln.value[Fr]?.Field=="function"?fs=Ln.value[Fr].Field(Fa):fs=Fa[Ln.value[Fr].Field],fs==null||fs===""||typeof fs=="string"&&fs.trim()===""}));return yt.value>=0&&vt.value&&(Ir=Ir.sort((Fr,Fa)=>typeof Ln.value[yt.value].Field=="function"?typeof Ln.value[yt.value].SortMethod=="function"?Ln.value[yt.value].SortMethod(Fr,Fa):String(Ln.value[yt.value].Field(Fr))>String(Ln.value[yt.value].Field(Fa))?1:-1:typeof Ln.value[yt.value].SortMethod=="function"?Ln.value[yt.value].SortMethod(Fr,Fa):String(Fr[Ln.value[yt.value].Field])>String(Fa[Ln.value[yt.value].Field])?1:-1),vt.value==="desc"&&(Ir=Ir.reverse())),Ir}),Ln=vue.computed(()=>{let Ir=M.columns.filter(Fr=>!wn.value[Fr.Index]);return $t.value.length>0&&(Ir=$t.value.map(Fr=>Ir.find((Fa,fs)=>fs===Fr.originalIndex))),Ir}),vn=vue.computed(()=>M.contextActions.filter(Ir=>typeof Ir.IsVisible=="function"?Ir.IsVisible(yn.value):!0)),Pn=vue.computed(()=>{if(M.customPagination)return M.data;const Ir=(Xt.value-1)*parseInt(zt.value);return wr.value.slice(Ir,Ir+parseInt(zt.value))}),Sn=vue.computed(()=>M.customPagination?Math.ceil(M.recordTotal/parseInt(zt.value)):Math.ceil(wr.value.length/parseInt(zt.value))),Vn=vue.computed(()=>Sn.value>5?Xt.value<=3?[1,2,3,4,5,"...",Sn.value]:Xt.value>=Sn.value-2?[1,"...",Sn.value-4,Sn.value-3,Sn.value-2,Sn.value-1,Sn.value]:[1,"...",Xt.value-2,Xt.value-1,Xt.value,Xt.value+1,Xt.value+2,"...",Sn.value]:Array.from({length:Sn.value},(Ir,Fr)=>Fr+1)),dr=vue.computed(()=>M.customPagination?M.recordTotal:wr.value.length);vue.watch(()=>M.data,()=>{M.customPagination||(Xt.value=1,Aa())}),vue.watch(()=>Ln.value,(Ir,Fr)=>{(!Fr||Ir.length!==Fr.length||!Ir.every((Fa,fs)=>Fa.Title===Fr[fs].Title))&&(V.value={},wn.value={},on.value={},qt(),Aa(),vr(null,null),Dt.value={},Pt.value={})},{deep:!0}),vue.watch(()=>wr.value.length,()=>{M.customPagination||(Xt.value=1)}),vue.watch(zt,()=>{Xt.value=1,qt()});function or(){if(wr.value.length===0){notifyError$1("Нет данных для экспорта");return}let Ir=[{sheet:"Лист 1",columns:M.columns.map(Fa=>({label:Fa.Title,value:fs=>{let eu="";return typeof Fa.Field=="function"?eu=Fa.Field(fs):eu=fs[Fa.Field],Fa.LowField&&(typeof Fa.LowField=="function"?eu+=` (${Fa.LowField(fs)})`:fs[Fa.LowField]&&(eu+=` (${fs[Fa.LowField]})`)),eu}})),content:wr.value}],Fr={fileName:"Выгрузка данных от "+hooks().format("L HH:mm:ss"),extraLength:3,writeMode:"writeFile"};xlsx(Ir,Fr)}function er(Ir,Fr){an.value={x:Ir.pageX+"px",y:Ir.pageY+"px"},yn.value=Fr,fn.value=!0}function sn(){yn.value=null,fn.value=!1}function mr(Ir,Fr){if(Tr.value){_r();return}an.value={x:Ir.pageX,y:Ir.pageY},lr.value=Fr,Tr.value=!0,fn.value=!1}function pr(Ir){if(!wn.value[Ir]&&Ln.value.length-Object.values(wn.value).filter(Boolean).length<=1){notifyError$1("Должен быть виден хотя бы один столбец");return}wn.value[Ir]=!wn.value[Ir],qt()}function _r(){Tr.value=!1,lr.value=null}function jr(Ir){const Fr=document.getElementById("headerContextMenuId");Fr&&!Fr.contains(Ir.target)&&!Ir.target.closest(".header-filter-activator")&&_r()}function io(Ir){Ir.key==="Escape"&&Tr.value&&_r()}function vr(Ir,Fr){yt.value===Ir&&vt.value===Fr?(yt.value=null,vt.value=null):(yt.value=Ir,vt.value=Fr)}function Uo(Ir){return yt.value===Ir||V.value[Ir]||Dt.value[Ir]?.length>0||Pt.value[Ir]}function jo(){wn.value={},qt()}function Ur(Ir){let Fr=Dt.value[lr.value]||[];Fr.includes(Ir)?Fr=Fr.filter(Fa=>Fa!==Ir):Fr.push(Ir),Dt.value[lr.value]=Fr,Fr.length===0&&delete Dt.value[lr.value]}function Aa(){Ft.value={},Ln.value.forEach((Ir,Fr)=>{Ft.value[Fr]=[],M.data.forEach(Fa=>{let fs=Ft.value[Fr]||[];typeof Ir.Field=="function"?fs.push(Ir.Field(Fa)):fs.push(Fa[Ir.Field]),Ft.value[Fr]=fs}),Ft.value[Fr]=[...new Set(Ft.value[Fr])],Ft.value[Fr].sort()})}function pu(Ir){if(!Ft.value[Ir])return[];let Fr=[...Ft.value[Ir]];return Fr=Fr.filter(Fa=>Fa&&String(Fa).toLowerCase().includes(At.value)),Fr}function Ba(Ir){Dt.value[Ir]=Ft.value[Ir]}function sf(Ir){Pt.value[Ir]=!Pt.value[Ir],Pt.value[Ir]||delete Pt.value[Ir]}function Cf(Ir){let Fr=!1;fn.value&&(sn(),Fr=!0),Tr.value&&(_r(),Fr=!0),!Fr&&J("rowClicked",Ir)}function hl(){($t.value.length>0?$t.value:null)||($t.value=Ln.value.map((Fr,Fa)=>({originalIndex:Fa,displayIndex:Fa,title:Fr.Title}))),Rt.value=!0,_r()}function Bf(){Rt.value=!1}function Ka(Ir,Fr){Gt.value=Fr,Ir.dataTransfer.effectAllowed="move"}function Tu(Ir,Fr){if(Gt.value===null||Gt.value===Fr)return;const Fa=$t.value[Gt.value],fs=[...$t.value];fs.splice(Gt.value,1),fs.splice(Fr,0,Fa),fs.forEach((eu,ga)=>{eu.displayIndex=ga}),$t.value=fs,Gt.value=null}function Bo(Ir,Fr){if(Fr==="up"&&Ir>0){const Fa=$t.value[Ir];$t.value[Ir]=$t.value[Ir-1],$t.value[Ir-1]=Fa,$t.value[Ir].displayIndex=Ir,$t.value[Ir-1].displayIndex=Ir-1}else if(Fr==="down"&&Ir<$t.value.length-1){const Fa=$t.value[Ir];$t.value[Ir]=$t.value[Ir+1],$t.value[Ir+1]=Fa,$t.value[Ir].displayIndex=Ir,$t.value[Ir+1].displayIndex=Ir+1}}function qo(){$t.value=M.columns.map((Ir,Fr)=>({originalIndex:Fr,displayIndex:Fr,title:Ir.Title}))}function af(){const Ir=$t.value.map(Fr=>Fr.originalIndex);try{const Fr=JSON.parse(localStorage.getItem(STORAGE_KEY_COLUMN_ORDER$1)||"{}");Fr[M.tableId]=Ir,localStorage.setItem(STORAGE_KEY_COLUMN_ORDER$1,JSON.stringify(Fr))}catch(Fr){console.error("Ошибка при сохранении порядка столбцов:",Fr)}Bf()}function yd(Ir){if(!Ir||!Array.isArray(Ir))return;const Fr=Ir.filter(Fa=>Fa>=0&&Fa<M.columns.length);Fr.length===M.columns.length&&($t.value=Fr.map((Fa,fs)=>({originalIndex:Fa,displayIndex:fs,title:M.columns[Fa].Title})))}return I({exportToXlsx:or,filteredData:wr}),(Ir,Fr)=>{const Fa=vue.resolveComponent("PerfectScrollbar");return vue.openBlock(),vue.createElementBlock("div",{class:"h-full",id:"table-"+M.tableId},[M.enableXlsxExport?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$h,[vue.createVNode(vue.unref(P2),{onClick:or,prependIcon:"file-arrow-down"},{default:vue.withCtx(()=>[...Fr[11]||(Fr[11]=[vue.createTextVNode("Экспорт в Excel",-1)])]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(Fa,{class:vue.normalizeClass(["pb-4",M.tableClass]),options:{wheelPropagation:M.wheelPropagation}},{default:vue.withCtx(()=>[vue.createElementVNode("table",_hoisted_3$d,[vue.createElementVNode("thead",{class:vue.normalizeClass({sticky:M.stickyHeader})},[vue.createElementVNode("tr",null,[M.numbering?(vue.openBlock(),vue.createElementBlock("th",_hoisted_4$c,"№")):vue.createCommentVNode("",!0),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ln.value,(fs,eu)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("th",{class:"min-w-[120px] relative",key:fs.Title},[vue.createVNode(vue.unref(kt),{shown:Tr.value&&vue.unref(lr)!==null&&eu===vue.unref(lr),triggers:[],autoHide:!1,noAutoFocus:""},{popper:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$a,[vue.createElementVNode("p",_hoisted_8$a,vue.toDisplayString(Ln.value[vue.unref(lr)]?.Title),1),vue.createVNode(vue.unref(Iv1)),vue.createElementVNode("p",{class:vue.normalizeClass(["rs-table-btn",{"!font-bold !text-slate-500 !bg-slate-200":yt.value===vue.unref(lr)&&vt.value==="asc"}]),onClick:Fr[0]||(Fr[0]=ga=>vr(vue.unref(lr),"asc"))}," Сортировать А > Я ",2),vue.createElementVNode("p",{class:vue.normalizeClass(["rs-table-btn",{"!font-bold !text-slate-500 !bg-slate-200":yt.value===vue.unref(lr)&&vt.value==="desc"}]),onClick:Fr[1]||(Fr[1]=ga=>vr(vue.unref(lr),"desc"))}," Сортировать Я > А ",2),vue.createVNode(vue.unref(Iv1)),vue.createElementVNode("details",_hoisted_9$8,[Fr[12]||(Fr[12]=vue.createElementVNode("summary",{class:"rs-table-btn"},"Поиск по значению",-1)),vue.createVNode(vue.unref(IA),{type:"text",placeholder:"Введите значение",modelValue:V.value[vue.unref(lr)],"onUpdate:modelValue":Fr[2]||(Fr[2]=ga=>V.value[vue.unref(lr)]=ga),modelModifiers:{lazy:!0}},null,8,["modelValue"])]),vue.createElementVNode("details",_hoisted_10$8,[vue.createElementVNode("summary",_hoisted_11$7,[Fr[13]||(Fr[13]=vue.createTextVNode(" Фильтр по значению ",-1)),Dt.value[vue.unref(lr)]?.length>0?(vue.openBlock(),vue.createBlock(vue.unref(Z1),{key:0,name:"circle-exclamation"})):vue.createCommentVNode("",!0)]),vue.createVNode(vue.unref(IA),{placeholder:"Введите значение",modelValue:At.value,"onUpdate:modelValue":Fr[3]||(Fr[3]=ga=>At.value=ga)},null,8,["modelValue"]),vue.createElementVNode("div",_hoisted_12$6,[vue.createElementVNode("p",null," Показано "+vue.toDisplayString(Dt.value[vue.unref(lr)]?.length?Dt.value[vue.unref(lr)].length:Ft.value[vue.unref(lr)]?.length)+" из "+vue.toDisplayString(Ft.value[vue.unref(lr)]?.length),1),vue.createElementVNode("p",{class:"cursor-pointer hover:text-slate-700 hover:underline",onClick:Fr[4]||(Fr[4]=ga=>Ba(vue.unref(lr)))},"Все"),vue.createElementVNode("p",{class:"cursor-pointer hover:text-slate-700 hover:underline",onClick:Fr[5]||(Fr[5]=ga=>delete Dt.value[vue.unref(lr)])}," Сбросить ")]),vue.createVNode(Fa,{class:"max-h-[300px] max-w-[600px]"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_13$5,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(pu(vue.unref(lr)),ga=>(vue.openBlock(),vue.createElementBlock("div",{key:ga,class:"flex gap-1 select-none cursor-pointer hover:bg-slate-100 rounded",onClick:Xo=>Ur(ga)},[vue.createVNode(vue.unref(Kc),{checked:Dt.value[vue.unref(lr)]?.includes(ga)},null,8,["checked"]),vue.createElementVNode("p",null,vue.toDisplayString(ga||"(пусто)"),1)],8,_hoisted_14$4))),128))])]),_:1})]),vue.createElementVNode("details",_hoisted_15$4,[Fr[14]||(Fr[14]=vue.createElementVNode("summary",{class:"rs-table-btn"},"Скрыть столбец",-1)),vue.createElementVNode("p",{class:"text-sm text-slate-500 text-center cursor-pointer hover:text-slate-700 hover:bg-slate-100 rounded",onClick:jo}," Показать все "),vue.createVNode(Fa,{class:"max-h-[300px] overflow-y-auto"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ln.value,(ga,Xo)=>(vue.openBlock(),vue.createElementBlock("div",{key:ga.Title,class:"flex items-center gap-1 px-2 py-1 hover:bg-slate-100 cursor-pointer",onClick:Da=>pr(Xo)},[vue.createVNode(vue.unref(Z1),{class:"text-slate-500",name:wn.value[Xo]?"square":"check-square"},null,8,["name"]),vue.createElementVNode("span",null,vue.toDisplayString(ga.Title),1)],8,_hoisted_16$4))),128))]),_:2},1024)]),vue.createVNode(vue.unref(Iv1)),vue.createElementVNode("p",{class:vue.normalizeClass(["rs-table-btn",{"!font-bold !text-slate-500 !bg-slate-200":Pt.value[vue.unref(lr)]}]),onClick:Fr[6]||(Fr[6]=ga=>sf(vue.unref(lr)))}," Показать только пустые ",2),vue.createVNode(vue.unref(Iv1)),vue.createElementVNode("p",{class:"rs-table-btn",onClick:hl},"Изменить порядок столбцов")])]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_5$b,[vue.createElementVNode("div",{onClick:ga=>fs.filterable!=!1?mr(ga,eu):null,class:"flex flex-row justify-between items-center gap-1 hover:cursor-pointer hover:bg-slate-200 rounded px-2 py-1 header-filter-activator"},[vue.createElementVNode("p",{class:vue.normalizeClass({"whitespace-nowrap":M.growOnlyX})},vue.toDisplayString(fs.Title),3),fs.filterable!=!1?(vue.openBlock(),vue.createBlock(vue.unref(Z1),{key:0,name:"filter",class:vue.normalizeClass([{activeFilter:Uo(eu)},"text-slate-500"])},null,8,["class"])):vue.createCommentVNode("",!0)],8,_hoisted_6$b)])]),_:2},1032,["shown"]),vue.createElementVNode("div",{class:"column-resizer",onMousedown:Fr[7]||(Fr[7]=ga=>ar(ga)),onDblclick:ga=>tr(eu)},null,40,_hoisted_17$3)])),[[vue.vShow,!wn.value[eu]]])),128)),M.rowActions.length?(vue.openBlock(),vue.createElementBlock("th",_hoisted_18$3,[...Fr[15]||(Fr[15]=[vue.createElementVNode("p",null,"Действия",-1)])])):vue.createCommentVNode("",!0)])],2),vue.createElementVNode("tbody",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Pn.value,(fs,eu)=>(vue.openBlock(),vue.createElementBlock("tr",{class:vue.normalizeClass({"even:bg-slate-50":M.striped}),onContextmenu:vue.withModifiers(ga=>er(ga,fs),["right","prevent"]),onClick:ga=>Cf(fs),key:fs,style:vue.normalizeStyle({backgroundColor:fn.value&&yn.value===fs?"rgba(0, 0, 0, 0.05)":"",backgroundColor:e.rowColor(fs)})},[M.numbering?(vue.openBlock(),vue.createElementBlock("td",_hoisted_20$3,vue.toDisplayString(Xt.value*parseInt(zt.value)-parseInt(zt.value)+1+eu),1)):vue.createCommentVNode("",!0),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ln.value,(ga,Xo)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("td",{key:ga.Title,class:vue.normalizeClass(["hover:bg-slate-200",typeof ga.Class=="function"?ga.Class(fs):ga.Class]),onClick:Da=>J("cellClicked",{record:fs,column:ga,index:Xo}),title:typeof ga.titleOnHover=="function"?ga.titleOnHover(fs):ga.titleOnHover},[ga.Template?(vue.openBlock(),vue.createElementBlock("div",_hoisted_22$2,[vue.renderSlot(Ir.$slots,`cell(${ga.Template})`,{record:fs},void 0,!0)])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_23$2,[vue.createElementVNode("p",{class:vue.normalizeClass(["primary-text",{"whitespace-nowrap":M.growOnlyX}]),title:typeof ga.Field=="function"?ga.Field(fs):fs[ga.Field]},vue.toDisplayString(typeof ga.Field=="function"?ga.Field(fs):fs[ga.Field]),11,_hoisted_24$2),vue.createElementVNode("p",{class:vue.normalizeClass(["secondary-text",{"whitespace-nowrap":M.growOnlyX}]),title:typeof ga.LowField=="function"?ga.LowField(fs):fs[ga.LowField]},vue.toDisplayString(typeof ga.LowField=="function"?ga.LowField(fs):fs[ga.LowField]),11,_hoisted_25$2)]))],10,_hoisted_21$3)),[[vue.vShow,!wn.value[Xo]]])),128)),M.rowActions.length?(vue.openBlock(),vue.createElementBlock("td",_hoisted_26$2,[vue.createElementVNode("div",{class:vue.normalizeClass(["flex flex-col items-start",{horizontalAction:M.rowHorizontal}])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(M.rowActions,ga=>(vue.openBlock(),vue.createElementBlock("span",{class:"rowAction whitespace-nowrap",onClick:vue.withModifiers(Xo=>ga.Action(fs),["stop"]),key:ga},[typeof ga.IsVisible!="function"||ga.IsVisible(fs)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_28$2,[ga.Icon?(vue.openBlock(),vue.createBlock(vue.unref(Z1),{key:0,name:ga.Icon},null,8,["name"])):vue.createCommentVNode("",!0),vue.createTextVNode(" "+vue.toDisplayString(ga.Name),1)])):vue.createCommentVNode("",!0)],8,_hoisted_27$2))),128))],2)])):vue.createCommentVNode("",!0)],46,_hoisted_19$3))),128)),M.footer?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_29$2,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ln.value,(fs,eu)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("td",{key:fs.Title},[typeof fs.Footer=="function"?(vue.openBlock(),vue.createElementBlock("p",_hoisted_30$2,vue.toDisplayString(fs.Footer(Ir.row)),1)):(vue.openBlock(),vue.createElementBlock("p",_hoisted_31$2,vue.toDisplayString(fs.Footer),1))])),[[vue.vShow,!wn.value[eu]]])),128))])):vue.createCommentVNode("",!0),dr.value?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("tr",_hoisted_32$2,[...Fr[16]||(Fr[16]=[vue.createElementVNode("td",{colspan:"100",class:"text-center"},[vue.createElementVNode("p",{class:"text-xl text-slate-400 font-semibold"},"Данные отсутствуют")],-1)])]))])])]),_:3},8,["class","options"]),vue.createElementVNode("div",_hoisted_33$2,[vue.createElementVNode("div",_hoisted_34$2,[Sn.value>1?(vue.openBlock(),vue.createElementBlock("ul",_hoisted_35$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Vn.value,fs=>(vue.openBlock(),vue.createElementBlock("li",{key:fs,class:vue.normalizeClass({active:fs===Xt.value}),onClick:eu=>fs!=="..."?Xt.value=fs:null},[vue.createElementVNode("a",null,vue.toDisplayString(fs),1)],10,_hoisted_36$1))),128))])):vue.createCommentVNode("",!0),M.enablePageSizeSelector?(vue.openBlock(),vue.createElementBlock("div",_hoisted_37$1,[Fr[18]||(Fr[18]=vue.createElementVNode("span",{class:"text-sm text-slate-500"},"Показать:",-1)),vue.withDirectives(vue.createElementVNode("select",{"onUpdate:modelValue":Fr[8]||(Fr[8]=fs=>zt.value=fs),class:"text-sm border rounded px-1 py-0.5 w-[60px] border-slate-300"},[...Fr[17]||(Fr[17]=[vue.createElementVNode("option",{value:"5"},"5",-1),vue.createElementVNode("option",{value:"10"},"10",-1),vue.createElementVNode("option",{value:"20"},"20",-1),vue.createElementVNode("option",{value:"100"},"100",-1)])],512),[[vue.vModelSelect,zt.value]])])):vue.createCommentVNode("",!0)]),vue.createElementVNode("p",_hoisted_38$1," Записи "+vue.toDisplayString(Xt.value*parseInt(zt.value)-parseInt(zt.value)+1)+"-"+vue.toDisplayString(Math.min(Xt.value*parseInt(zt.value),dr.value))+" из "+vue.toDisplayString(dr.value),1)]),fn.value?(vue.openBlock(),vue.createElementBlock("div",{id:"contextMenuId",class:"context-menu",key:an.value,style:vue.normalizeStyle({top:an.value.y,left:an.value.x})},[vue.createVNode(vue.unref(dz1),{spacing:"xs"},{default:vue.withCtx(()=>[vn.value.length?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("p",_hoisted_39$1,"Нет доступных действий контекстного меню")),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vn.value,fs=>(vue.openBlock(),vue.createBlock(vue.unref(P2),{key:fs,prependIcon:fs.Icon,onClick:eu=>(fs.Action(yn.value),sn())},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(fs.Name),1)]),_:2},1032,["prependIcon","onClick"]))),128))]),_:1})],4)):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(Ds),{title:"Изменение порядка столбцов",modelValue:Rt.value,"onUpdate:modelValue":Fr[10]||(Fr[10]=fs=>Rt.value=fs),closeOnClickOutside:!0,class:"p-2"},{footer:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_48$1,[vue.createVNode(vue.unref(P2),{onClick:qo,variant:"outline",size:"sm"},{default:vue.withCtx(()=>[...Fr[20]||(Fr[20]=[vue.createTextVNode("Сбросить",-1)])]),_:1}),vue.createVNode(vue.unref(P2),{onClick:af,size:"sm"},{default:vue.withCtx(()=>[...Fr[21]||(Fr[21]=[vue.createTextVNode("Сохранить",-1)])]),_:1})])]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_40$1,[Fr[19]||(Fr[19]=vue.createElementVNode("p",{class:"text-sm text-gray-600 mb-2"},"Перетащите столбцы для изменения их порядка:",-1)),vue.createElementVNode("div",_hoisted_41$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList($t.value,(fs,eu)=>(vue.openBlock(),vue.createElementBlock("div",{key:fs.originalIndex,class:"flex items-center justify-between p-2 mb-1 bg-white rounded border cursor-move hover:bg-gray-50",draggable:"true",onDragstart:ga=>Ka(ga,eu),onDragover:Fr[9]||(Fr[9]=vue.withModifiers(()=>{},["prevent"])),onDrop:ga=>Tu(ga,eu)},[vue.createElementVNode("div",_hoisted_43$1,[vue.createVNode(vue.unref(Z1),{name:"grip-vertical",class:"text-gray-400 text-sm"}),vue.createElementVNode("span",_hoisted_44$1,vue.toDisplayString(fs.title),1)]),vue.createElementVNode("div",_hoisted_45$1,[eu>0?(vue.openBlock(),vue.createElementBlock("button",{key:0,onClick:ga=>Bo(eu,"up"),class:"p-1 hover:bg-gray-200 rounded text-xs",title:"Переместить вверх"},[vue.createVNode(vue.unref(Z1),{name:"chevron-up",class:"text-gray-500"})],8,_hoisted_46$1)):vue.createCommentVNode("",!0),eu<$t.value.length-1?(vue.openBlock(),vue.createElementBlock("button",{key:1,onClick:ga=>Bo(eu,"down"),class:"p-1 hover:bg-gray-200 rounded text-xs",title:"Переместить вниз"},[vue.createVNode(vue.unref(Z1),{name:"chevron-down",class:"text-gray-500"})],8,_hoisted_47$1)):vue.createCommentVNode("",!0)])],40,_hoisted_42$1))),128))])])]),_:1},8,["modelValue"])],8,_hoisted_1$l)}}},ReSimpleTable=_export_sfc(_sfc_main$t,[["__scopeId","data-v-821997b1"]]),_hoisted_1$k={class:"flex flex-col gap-3"},_hoisted_2$g={key:0,class:"border rounded p-2 bg-slate-100"},_hoisted_3$c={class:"flex justify-end gap-2 py-2"},_hoisted_4$b=["title"],_hoisted_5$a=["title"],_hoisted_6$a={key:1,class:"text-sm text-right text-gray-500"},_hoisted_7$9={class:"w-full h-full absolute top-0 left-0 flex justify-center items-center animate-pulse z-[5000]"},_hoisted_8$9={class:"flex flex-col gap-4"},_hoisted_9$7={class:"flex justify-end gap-2"},_hoisted_10$7=["title"],_hoisted_11$6={class:"flex gap-4 justify-end"},_hoisted_12$5={class:"flex-1 gap-4"},_hoisted_13$4={class:"flex flex-col border rounded p-4 gap-4"},_hoisted_14$3={class:"flex gap-4"},_hoisted_15$3={class:"flex flex-col border rounded p-4 gap-4"},_hoisted_16$3={class:"flex justify-end gap-2"},BURYAT_PHARMACY_ID="6fe08f39-a61e-4687-96a5-7f599ca9e5df",RKIB_ID="3ef9a148-4f1f-4bfc-9717-ef876f210b7b",MINZDRAV_ID="9d1790e4-965e-46d3-878f-c8c5ce7ae8c6",_sfc_main$s={__name:"NewBenefitList",props:{userOpen:{type:Object,default:{},required:!0},dataPatient:{type:{},default:null,require:!0},customRowClickHandler:{type:[Function,null],default:null},infoOnly:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},frlloFilters:{type:Object,default:{}},isMainViewTable:{type:Boolean,default:!1},nameProject:{type:String,default:"WebBMS",required:!0}},setup(e,{expose:I}){const N=e,J=vue.computed(()=>N.userOpen),V=vue.ref(J.value.LpuId===MINZDRAV_ID),M=vue.ref([]),vt=vue.ref([]),yt=vue.ref(!1),At=vue.ref(!1),Dt=vue.ref([]),Ft=vue.ref({Endministrator:{Id:"86d86dd3-0f57-421a-a1e0-5765149d96ce",IsActive:J?.value?.UserId=="86d86dd3-0f57-421a-a1e0-5765149d96ce"},Root:{Id:"3fc433b5-a61f-4775-a925-abbbadb92150",IsActive:J?.value?.UserId=="3fc433b5-a61f-4775-a925-abbbadb92150"}}),Pt=vue.inject("isAdmin")||Ft.value.Endministrator.IsActive||Ft.value.Root.IsActive;api$1.LpuByRegionId.get("03").then(io=>{M.value=io.data});const Rt=vue.computed(()=>N.dataPatient.PatientSnils?{Snils:N.dataPatient.PatientSnils}:{}),$t=vue.ref(N.isMainViewTable),{getBenefitList:Gt,getBenefitListV2:zt}=useBenefit(),Ht=vue.ref(!1),qt=vue.ref([]),Kt=vue.ref(!1),Xt=vue.ref(null),fn=vue.ref([]),an=vue.ref({}),yn=vue.ref(!1),on=vue.ref({}),_n=[{Name:"История",Icon:"history",Action:ar}];function dn(io){const vr=N.nameProject,Uo=[],jo=[];switch(io){case"registerControl":return!!(Pt||vr!="Pharmacy"&&vr!="MZ"&&vr!="Stock"||Uo.includes(J?.value?.UserId)||jo.includes(J?.value?.LpuId));case"getRegister":return J?.value?.LpuId===BURYAT_PHARMACY_ID}}vue.watch(()=>[on.value.BenefitCodeShort,on.value.ProgramName,on.value.LpuIdPrikrep],()=>{on.value.FileName=xn()});function xn(){return`${on.value.BenefitCodeShort||"Все-льготы"}_${on.value.ProgramName?.replace(/\s/g,"-")||"Все-программы"}_${M.value.find(io=>io.Id===on.value.LpuIdPrikrep)?.Name?.replace(/\s/g,"-")||"Все-МО"}_${hooks().format("YYYY-MM-DD_HH-mm-ss")}`}function bn(){on.value={},yn.value=!0,on.value.FileName=xn()}async function wn(){Ht.value=!0;try{const io=await window.axios.get(window.localhost+"dbf/export",{params:on.value});io.data?.File&&io.data?.Name?Tr(io.data):notifyError$1("Нет данных для экспорта")}catch(io){notifyError$1(`Ошибка при экспорте:
|
|
1302
1302
|
`+io.message)}finally{Ht.value=!1}}function Tr(io){let vr="data: application/x-zip-compressed;base64,"+io.File,Uo=document.createElement("a");Uo.href=vr,Uo.setAttribute("download",io.Name),document.body.appendChild(Uo),Uo.click(),document.body.removeChild(Uo)}async function lr(io){"filters"in io&&(io=io.filters),io={...Rt.value,...io,...N.frlloFilters},an.value=io,Ht.value=!0;try{const vr=await zt(io);qt.value=vr}catch(vr){qt.value=[],notifyError$1(`Ошибка при загрузке данных:
|
|
1303
|
-
`+vr.message)}finally{Ht.value=!1}}async function ar(io){const vr=await Gt({Snils:io.Snils,BenefitCodeShort:io.BenefitCodeShort},!1);fn.value=vr,Xt.value=io,Kt.value=!0}function Qt(){fn.value=[],Xt.value=null}const Hn={ОНЛС:[null],ВЗН:[null],"Орфанные заболевания":[null],П890:["ALL"],ССЗ:["ALL"],"Паллиативная помощь":["ALL"],"Сахарный диабет":["ALL"],"Дети до трёх лет":["ALL"],"Фонд Круг добра":[null],"Незарег. ЛП.":[null],"НМГ(Беременные)":["ALL"],"НМГ(Дети)":["ALL"],"Хронический Гепатит C":[RKIB_ID]};function tr(io){const vr=Hn[io?.BenefitProgram]?.includes(J.value.LpuId),Uo=Hn[io?.BenefitProgram]?.includes(J.value.UserId),jo=Hn[io?.BenefitProgram]?.includes("ALL")&&dn("registerControl")&&J.value.LpuId!==RKIB_ID,Ur=!Object.keys(Hn).includes(io?.BenefitProgram),Aa=J.value.LpuId===N.dataPatient?.LpuId&&io?.BenefitProgram==="Хронический Гепатит C";if(!$t.value)if(vr||Uo||jo||Ur||Pt||Aa){const{Id:pu,LogDateTime:Ba,PatientBenefitId:sf,...Cf}=io;Xt.value=Cf,dr()}else notifyWarning("У вас нет прав на редактирование данной льготы",15e3,"Ограничено системой");if(typeof N.customRowClickHandler=="function"){N.customRowClickHandler(io);return}}function wr(){Kt.value=!1,tr(fn.value[0])}function Ln(io){if(io?.Deleted)return"#f9c7c8";if(io?.Monetization)return"#f3c77a";if(io?.ActiveUntil&&hooks(io?.ActiveUntil).isSameOrBefore(hooks()))return"#aaaaaa";let vr=hooks(),Uo=hooks(io.DateIn),jo=hooks(io.DateOut??"2999-12-12");return vr.isBetween(Uo,jo)?"#cbe4cb":"#dedee1"}BenefitProgram(io=>vt.value=io.map(vr=>({...vr,Benefits:JSON.parse(vr.Benefits)}))),BenefitMap(io=>Dt.value=io);const vn=["Snils","Fio","AttachedMo"],Pn=vue.computed(()=>{let io=[{accessor:"Fio",type:"text",name:"Ф.И.О."},{accessor:"ProgramId",type:"select",list:vt.value,name:"Программа"},{accessor:"BenefitCodeShort",type:"select",name:"Код льготы",relation:({values:vr})=>vr?.ProgramId?vt.value.find(Uo=>vr.ProgramId===Uo.Id).Benefits:Dt.value,display:vr=>"("+vr.BenefitCodeShort+") "+vr.BenefitNameLong,idField:"BenefitCodeShort",style:{width:"20rem"}},{accessor:"Snils",type:"text",name:"СНИЛС",mask:"###-###-### ##"},{accessor:"Monetized",type:"select",name:"Монетизация",list:[{Id:"false",Name:"Не монетизированные"},{Id:"true",Name:"Монетизированные"}],placeholder:"Все"},{accessor:"AttachedMo",type:"select",list:M.value,name:"МО прикрепления",style:{width:"15rem"}},{accessor:"Active",type:"select",list:[{Id:"true",Name:"Активные"},{Id:"false",Name:"Неактивные"}],name:"Активность",placeholder:"Все",style:{width:"10rem"}},{accessor:"InMis",type:"select",list:[{Id:"true",Name:"Есть данные"},{Id:"false",Name:"Нет данных"}],name:"Данные пациента в МИС",placeholder:"Все",style:{width:"15rem"}},{accessor:"Deleted",type:"select",placeholder:"Неаннулированные",list:[{Id:"all",Name:"Все"},{Id:"true",Name:"Аннулированные"}],name:"Состояние",style:{width:"15rem"}}];return N.dataPatient.PatientSnils&&(io=io.filter(vr=>!vn.includes(vr.accessor))),V||(io=io.filter(vr=>vr.accessor!=="InMis")),io});vue.watch(()=>N.dataPatient.PatientSnils,()=>{N.dataPatient.PatientSnils&&lr({})},{immediate:!0});const Sn=vue.computed(()=>[{name:"Ф.И.О.",accessor:"PatientFio"},{name:"Дата рождения",display:vr=>hooks(vr.PatientBirthdate).format("DD.MM.YYYY")},{name:"МО прикрепления",accessor:"AttachedMoName"},{name:"Программа",accessor:"BenefitProgram"},{name:"СНИЛС",accessor:"Snils"},{name:"Полис",accessor:"PolicyNumber"},{name:"Страховая компания",accessor:"SmoName",Template:"SmoName"},{name:"Диагноз",accessor:"Ds"},{name:"Код льготы",accessor:"BenefitCodeShort"},{name:"Категория льготности",accessor:"BenefitName",Template:"BenefitName"},{name:"Адрес проживания",accessor:"AddressFact"},{name:"Адрес регистрации",accessor:"AddressReg"},{name:"Монетизирована",accessor:"MonetizationText"},{name:"Дата начала",display:vr=>vr?.DateIn?hooks(vr.DateIn).format("DD.MM.YYYY"):"-"},{name:"Дата конца",display:vr=>vr?.DateOut?hooks(vr.DateOut).format("DD.MM.YYYY"):"-"},{name:"Статус ФРЛЛО",display:vr=>vr?.FrlloStatus?vr.FrlloStatus:"Не выгружен"},{name:"Дата изменения",display:vr=>hooks(vr.LogDateTime).format("DD.MM.YYYY HH:mm:ss")},{name:"Пользователь",display:vr=>(vr.EmployeeLastname||"").trim()+" "+(vr.EmployeeFirstname||"").trim()+" "+(vr.EmployeePatronymic||"").trim()}].filter(vr=>!vr.hidden).map(vr=>({Title:vr.name,Field:typeof vr.display=="function"?vr.display:vr.accessor,Template:vr?.Template}))),Vn=vue.computed(()=>[{name:"Программа",accessor:"BenefitProgram"},{name:"Диагноз",accessor:"Ds"},{name:"Код льготы",accessor:"BenefitCodeShort"},{name:"Категория льготности",accessor:"BenefitName",Template:"BenefitName"},{name:"Монетизирована",accessor:"MonetizationText"},{name:"Дата начала",display:vr=>vr?.DateIn?hooks(vr.DateIn).format("DD.MM.YYYY"):"-"},{name:"Дата конца",display:vr=>vr?.DateOut?hooks(vr.DateOut).format("DD.MM.YYYY"):"-"},{name:"Статус ФРЛЛО",display:vr=>vr?.FrlloStatus?vr.FrlloStatus:"Не выгружен"},{name:"Дата изменения",display:vr=>hooks(vr.LogDateTime).format("DD.MM.YYYY HH:mm:ss")},{name:"Пользователь",display:vr=>(vr.EmployeeLastname||"").trim()+" "+(vr.EmployeeFirstname||"").trim()+" "+(vr.EmployeePatronymic||"").trim()}].filter(vr=>!vr.hidden).map(vr=>({Title:vr.name,Field:typeof vr.display=="function"?vr.display:vr.accessor,Template:vr?.Template})));function dr(){yt.value=!0}function or(io){yt.value=!1,notifyError$1(io)}async function er(){yt.value=!1,await new Promise(io=>setTimeout(io,1e3)),lr(an.value),notifySuccess("Льгота сохранена успешно!")}function sn(){yt.value=!1,lr(an.value),notifySuccess("Льгота аннулирована!")}function mr(){Xt.value=null,dr()}function pr(){At.value=!0}function _r(){return qt.value.filter(io=>io._selected_).map(io=>({Id:io.PatientBenefitId,Snils:io.PatientSnils}))}function jr(){on.value={}}return I({getSelectedRows:_r}),(io,vr)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",_hoisted_1$k,[e.infoOnly?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$g,[vue.createVNode(_sfc_main$z,{"filter-list":Pn.value,onSearch:lr},null,8,["filter-list"])])),vue.createElementVNode("div",_hoisted_3$c,[vr[13]||(vr[13]=vue.createStaticVNode('<div class="flex items-center gap-1"><div class="size-4 rounded" style="background:#f9c7c8;"></div><p>Аннулирована</p></div><div class="flex items-center gap-1"><div class="size-4 rounded" style="background:#f3c77a;"></div><p>Монетизированна</p></div><div class="flex items-center gap-1"><div class="size-4 rounded" style="background:#dedee1;"></div><p>Неактивная</p></div><div class="flex items-center gap-1"><div class="size-4 rounded" style="background:#cbe4cb;"></div><p>Активная</p></div>',4)),dn("getRegister")?(vue.openBlock(),vue.createBlock(vue.unref(P2),{key:0,onClick:bn,"prepend-icon":"download"},{default:vue.withCtx(()=>[...vr[10]||(vr[10]=[vue.createTextVNode("Экспорт в .dbf",-1)])]),_:1})):vue.createCommentVNode("",!0),dn("registerControl")?(vue.openBlock(),vue.createBlock(vue.unref(P2),{key:1,onClick:mr,"prepend-icon":"plus",primary:""},{default:vue.withCtx(()=>[...vr[11]||(vr[11]=[vue.createTextVNode("Добавить льготу",-1)])]),_:1})):vue.createCommentVNode("",!0),vue.unref(Pt)?(vue.openBlock(),vue.createBlock(vue.unref(P2),{key:2,onClick:pr,"prepend-icon":"unlock-keyhole",style:{backgroundColor:"white",color:"rgb(198 28 28 / var(--tw-text-opacity))"}},{default:vue.withCtx(()=>[...vr[12]||(vr[12]=[vue.createTextVNode("Доступ к ССЗ",-1)])]),_:1})):vue.createCommentVNode("",!0)]),vue.createVNode(ReSimpleTable,{"enable-xlsx-export":!0,data:qt.value,columns:$t.value?Sn.value:Vn.value,"page-size":20,"enable-page-size-selector":"","table-id":"benefitsList","context-actions":_n,"row-color":Ln,onRowClicked:tr},{"cell(BenefitName)":vue.withCtx(({record:Uo})=>[vue.createElementVNode("p",{class:"cell-lite",title:Uo?.BenefitName},vue.toDisplayString(Uo?.BenefitName),9,_hoisted_4$b)]),"cell(SmoName)":vue.withCtx(({record:Uo})=>[vue.createElementVNode("p",{class:"cell-lite",title:Uo?.SmoName},vue.toDisplayString(Uo?.SmoName),9,_hoisted_5$a)]),_:1},8,["data","columns"]),qt.value.length>950?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$a,[vue.createElementVNode("p",null,"Показаны первые ~"+vue.toDisplayString(Math.ceil(qt.value.length/1e3)*1e3)+" записей, чтобы найти нужного пациента уточните фильтры",1)])):vue.createCommentVNode("",!0)]),vue.withDirectives(vue.createElementVNode("div",_hoisted_7$9,[...vr[14]||(vr[14]=[vue.createElementVNode("div",{class:"bg-black/60 w-full h-full absolute top-0 left-0 z-[5001]"},null,-1),vue.createElementVNode("div",{class:"bg-white rounded-lg p-4 flex flex-row gap-3 items-center z-[5002]"},[vue.createElementVNode("div",{role:"status"},[vue.createElementVNode("svg",{"aria-hidden":"true",class:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-300 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[vue.createElementVNode("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),vue.createElementVNode("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})])]),vue.createElementVNode("div",null,[vue.createElementVNode("p",{class:"font-bold"},"Обработка данных"),vue.createElementVNode("p",{class:"text-sm text-gray-500"},"Пожалуйста, подождите...")])],-1)])],512),[[vue.vShow,Ht.value]]),vue.createVNode(vue.unref(Ds),{modelValue:Kt.value,"onUpdate:modelValue":vr[0]||(vr[0]=Uo=>Kt.value=Uo),title:`История льготы ${Xt.value?.BenefitCodeShort}`,class:"p-4",size:"7xl",onClose:Qt},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_8$9,[vue.createElementVNode("div",_hoisted_9$7,[vue.unref(Pt)||!V.value?(vue.openBlock(),vue.createBlock(vue.unref(P2),{key:0,onClick:wr,"prepend-icon":"pencil"},{default:vue.withCtx(()=>[...vr[15]||(vr[15]=[vue.createTextVNode("Изменить льготу",-1)])]),_:1})):vue.createCommentVNode("",!0)]),vue.createVNode(ReSimpleTable,{data:fn.value,columns:Vn.value,"page-size":20,"enable-page-size-selector":"","table-id":"benefitsListHistory"},{"cell(BenefitName)":vue.withCtx(({record:Uo})=>[vue.createElementVNode("p",{class:"cell-lite",title:Uo?.BenefitName},vue.toDisplayString(Uo?.BenefitName),9,_hoisted_10$7)]),_:1},8,["data","columns"])])]),_:1},8,["modelValue","title"]),vue.createVNode(vue.unref(Ds),{modelValue:yt.value,"onUpdate:modelValue":vr[1]||(vr[1]=Uo=>yt.value=Uo),title:"Льгота",size:"5xl",class:"p-4"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$v,{snils:Xt.value?.Snils||N.dataPatient.PatientSnils,"user-open":J.value,"patient-open":N.dataPatient,onSave:er,onDelete:sn,onError:or,"edit-benefit":Xt.value,disable:N.infoOnly,permisionLgot:PermissionLgot},null,8,["snils","user-open","patient-open","edit-benefit","disable"])]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(Ds),{modelValue:yn.value,"onUpdate:modelValue":vr[8]||(vr[8]=Uo=>yn.value=Uo),title:"Экспорт .dbf",size:"5xl",class:"p-4"},{default:vue.withCtx(()=>[vue.createElementVNode("form",{class:"flex flex-col gap-4",onSubmit:vue.withModifiers(wn,["prevent"])},[vue.createVNode(vue.unref(IA),{label:"Имя файла",disabled:"",modelValue:on.value.FileName,"onUpdate:modelValue":vr[2]||(vr[2]=Uo=>on.value.FileName=Uo)},null,8,["modelValue"]),vue.createVNode(_sfc_main$F,{required:!on.value.BenefitCodeShort&&!on.value.ProgramName,label:"МО прикрепления",data:M.value,modelValue:on.value.LpuIdPrikrep,"onUpdate:modelValue":vr[3]||(vr[3]=Uo=>on.value.LpuIdPrikrep=Uo),"id-field":"Id","display-expr":Uo=>Uo.Name,clearable:""},null,8,["required","data","modelValue","display-expr"]),vue.createElementVNode("div",_hoisted_11$6,[vue.createElementVNode("div",_hoisted_12$5,[vue.createElementVNode("fieldset",_hoisted_13$4,[vr[16]||(vr[16]=vue.createElementVNode("legend",{class:"px-2 font-semibold text-sm"},"Льгота",-1)),vue.createVNode(_sfc_main$F,{required:!on.value.BenefitCodeShort&&!on.value.LpuIdPrikrep,label:"Программа",data:vt.value,modelValue:on.value.ProgramName,"onUpdate:modelValue":vr[4]||(vr[4]=Uo=>on.value.ProgramName=Uo),"id-field":"Name","display-expr":Uo=>Uo.Name,clearable:""},null,8,["required","data","modelValue","display-expr"]),vue.createVNode(_sfc_main$F,{required:!on.value.ProgramName&&!on.value.LpuIdPrikrep,label:"Код льготы",data:Dt.value,modelValue:on.value.BenefitCodeShort,"onUpdate:modelValue":vr[5]||(vr[5]=Uo=>on.value.BenefitCodeShort=Uo),"id-field":"BenefitCodeShort","display-expr":Uo=>Uo.BenefitCodeShort+" | "+Uo.BenefitNameLong,clearable:"",limit:1e3},null,8,["required","data","modelValue","display-expr"])])]),vue.createElementVNode("div",_hoisted_14$3,[vue.createElementVNode("fieldset",_hoisted_15$3,[vr[17]||(vr[17]=vue.createElementVNode("legend",{class:"px-2 font-semibold text-sm"},"Период активности льготы",-1)),vue.createVNode(_sfc_main$E,{style:{width:"250px"},modelValue:on.value.BenefitStartDate,"onUpdate:modelValue":vr[6]||(vr[6]=Uo=>on.value.BenefitStartDate=Uo),label:"Дата начала",clearable:""},null,8,["modelValue"]),vue.createVNode(_sfc_main$E,{style:{width:"250px"},modelValue:on.value.BenefitEndDate,"onUpdate:modelValue":vr[7]||(vr[7]=Uo=>on.value.BenefitEndDate=Uo),label:"Дата окончания",clearable:""},null,8,["modelValue"])])])]),vue.createElementVNode("div",_hoisted_16$3,[vue.createVNode(vue.unref(P2),{label:"Сбросить фильтры",onClick:jr,delete:"",secondary:"","prepend-icon":"xmark"}),vue.createVNode(vue.unref(P2),{type:"submit","prepend-icon":"download",primary:""},{default:vue.withCtx(()=>[...vr[18]||(vr[18]=[vue.createTextVNode("Экспортировать",-1)])]),_:1})])],32)]),_:1},8,["modelValue"]),vue.createVNode(PermissionLgot,{isAdmin:vue.unref(Pt),visible:At.value,"onUpdate:visible":vr[9]||(vr[9]=Uo=>At.value=Uo)},null,8,["isAdmin","visible"])]))}},listStatuses=["В работе","Заполнение льгот","Проверка","Отправлен в МЗ","Завершен","Заявка","Заявка отправлена в МЗ","Заявка закрыта","Отклонено МЗ"],programToPreparat={"29528611-4db8-4a92-990d-0664eaec37fd":"ONLS","7303e13b-92f3-4f36-a08d-d52080c0ca28":"Cardio","0d3ffdb7-5a18-4efe-9853-a1a09927f415":"VNZ","5bc6620a-1ed6-4a60-a8ed-fa2a5e786150":"Diabetic","b50d16ad-6258-4e72-b8fc-49a5cefaf4ee":"Oraf","3398f155-5168-4c62-8861-5b8da2f191b4":"P890","0ca74c2a-a34b-4c9e-9ced-1565cdc8c067":"CircleGoodness","99b7de3c-52b0-4f65-b9a1-aacd6e47f073":"NMG","408e7c6f-0e70-4964-bc1c-0d3c4892b657":"NMG"},approvedBenefitProgram={"279c0cdc-772f-4f76-984c-2b463a42edd6":"ОНЛС","2b448ae8-4ff9-4fe6-a581-2cab122273b9":"ССЗ","270fefac-9670-4fcb-8c56-b7a422b774ad":"Сахарный диабет","260d15f6-3b69-4646-b551-c88404ca35df":"Орфанные заболевания","87691abf-cc37-49e5-8295-18eb71e9e015":"П890"},noSignPrograms=["29528611-4db8-4a92-990d-0664eaec37fd","7303e13b-92f3-4f36-a08d-d52080c0ca28"],lpusWithDivision=["f6bb8d21-9371-42e8-9406-b592fe2025e7","03032196-cf4b-480d-ab08-706f0eaa89ae","bff70664-565d-4b29-86ab-0cc3285ad156","1314c963-b459-43f4-b082-3b43f11cd7b2","8ac51557-f416-4032-b602-61b0bcf991e7","03bb9b43-b003-4eeb-a451-cb15ca6e28d3","5bd0e29f-6d86-476c-8caa-67f9c20ca243"],_sfc_main$r={__name:"NewMkbSelectBox",props:{mkbId:{type:[String,null]},label:{type:String,default:"Диагноз"},readOnly:{type:Boolean},isValidated:{type:Boolean,default:!1},mkbCode:{type:String,default:""},filterCodes:{type:Array,default:()=>[]},OMC:{type:Boolean,default:null},filterFunction:{type:Function,default:null},filterMkb:{type:Boolean,default:!0}},emits:["getMKBId","getMKBItem","validate"],setup(e,{emit:I}){const N=I;let J=null;const V=e;let M=!0;vue.watch(()=>V.OMC,(zt,Ht)=>{zt!==Ht&&!M&&(Ht?(J=yt.value,yt.value={Id:""},N("getMKBId",{choosedMKB:null}),Rt()):J&&Pt({data:J})),M&&(M=!1)});const vt=vue.ref(!1),yt=vue.ref({Id:""}),At=vue.ref(""),Dt=vue.computed(()=>({_mkb_oplata_param_:V.OMC===null?null:String(!!V.OMC),_mkb_codes_param_:V.filterCodes?.length?V.filterCodes.join(","):null})),Ft=vue.ref({Id:null});function Pt({data:zt}){J=null,At.value="",zt?.Id?(yt.value=zt,N("getMKBId",{choosedMKB:zt.Id}),Rt(zt)):(yt.value={Id:""},N("getMKBId",{choosedMKB:null}),Rt())}function Rt(zt={Id:null}){Ft.value.Id!==zt.Id&&(zt.Id?(N("getMKBItem",{choosedMKB:zt}),Ft.value=zt):(Ft.value={Id:null},N("getMKBItem",{choosedMKB:null})))}function $t(zt,Ht,qt){return V.filterMkb?["J47","E10","M45"].includes(zt.Code)?!0:(zt.Code.indexOf(".")!==-1||Ht.filter(Xt=>Xt.Code.startsWith(zt.Code)&&Xt.Code.length>3).length===0&&(Gt(qt[0])&&qt.length>2||!Gt(qt[0])&&qt.length>1))&&(typeof V.filterFunction!="function"||V.filterFunction(zt))&&(V.mkbCode!==qt||zt.Code===V.mkbCode):!0}function Gt(zt){return new RegExp("^\\p{L}$","u").test(zt)}return vue.watch(()=>V.mkbCode,()=>{V.mkbCode||(yt.value={Id:""},Pt({data:yt.value}))}),vue.watch(()=>V.mkbId,zt=>{zt?yt.value.Id!==zt&&(yt.value={Id:zt}):(yt.value={Id:""},Pt({data:yt.value}))},{immediate:!0}),vue.watch(()=>yt.value,()=>{V.isValidated&&(yt.value?.Id?(N("validate",{isValid:!0}),Rt(yt.value),vt.value=!0):(N("validate",{isValid:!1}),N("getMKBId",{choosedMKB:""}),vt.value=!1))}),(zt,Ht)=>(vue.openBlock(),vue.createBlock(_sfc_main$C,{disabled:V.readOnly,modelValue:yt.value.Id,"onUpdate:modelValue":Ht[0]||(Ht[0]=qt=>yt.value.Id=qt),"display-expr":qt=>"("+qt.Code+") "+qt.Name,"api-string":vue.unref(api$1).Mkb,"api-id":vue.unref(api$1).MkbById,label:V.label,"filter-field":"_search_str_","get-first-from-string":V.mkbCode,"result-filter":$t,params:Dt.value,onOnSelect:Pt,clearable:""},null,8,["disabled","modelValue","display-expr","api-string","api-id","label","get-first-from-string","params"]))}},_sfc_main$q={__name:"SDateInput",props:vue.mergeModels({withHours:{type:Boolean,default:!1},min:{type:Date,default:null},max:{type:Date,default:null}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const I=vue.useModel(e,"modelValue"),N=e;function J(M){return N.min&&hooks(N.min).format("YYYY-MM-DD HH:mm")>=hooks(M).format("YYYY-MM-DD HH:mm")?hooks(N.min).add(1,"minutes").format("YYYY-MM-DD HH:mm"):hooks(M).format("YYYY-MM-DD HH:mm")}function V(M){return M?N.withHours?J(M):M:null}return(M,vt)=>(vue.openBlock(),vue.createBlock(vue.unref(Jc),{format:"",min:e.min,max:e.max,withHours:e.withHours,label:"Дата","model-value":I.value,"onUpdate:modelValue":vt[0]||(vt[0]=yt=>I.value=V(yt))},null,8,["min","max","withHours","model-value"]))}},_hoisted_1$j={class:"p-3"},_hoisted_2$f={class:"w-full h-full absolute top-0 left-0 flex justify-center items-center animate-pulse z-[5000]"},_hoisted_3$b={class:"border p-2 rounded"},_hoisted_4$a={class:"grid grid-cols-2 gap-1"},_hoisted_5$9={class:"border p-2 rounded"},_hoisted_6$9={class:"grid grid-cols-2 gap-1"},_hoisted_7$8={class:"flex gap-3"},_hoisted_8$8={key:2,class:"flex flex-col gap-1"},_hoisted_9$6={class:"text-sm border rounded px-3 py-1 bg-gray-100 text-gray-800 text-balance h-[32px]"},_hoisted_10$6={class:"flex gap-3"},_hoisted_11$5={class:"flex gap-3"},_hoisted_12$4={class:"flex justify-end gap-3"},_sfc_main$p={__name:"ApplicationForm",props:{needId:{type:String,default:null},waitRequest:{type:Boolean,default:!1,required:!0},readOnly:{type:Boolean,default:!1},patientId:{type:String,default:"",required:!0},patientSnils:{type:String,default:"",required:!0},userOpen:{type:Object,default:{},required:!0},selectedApplication:{type:Object,default:{}},modalVisible:{type:Boolean,default:!1},hiddenControl:{type:Object,default:!1}},emits:["onSave","update:waitRequest"],setup(e,{expose:I,emit:N}){const{getBenefitList:J,getBenefitListV2:V}=useBenefit(),M=e,vt=vue.computed(()=>M.userOpen),yt=N,At=vue.ref(null),Dt=vue.ref(!1),Ft=vue.computed({get:()=>M.waitRequest,set:Pn=>yt("update:waitRequest",Pn)}),Pt=vue.computed({get:()=>M.modalVisible,set:Pn=>yt("update:modalVisible",Pn)}),Rt=vue.ref(M.selectedApplication),$t=vue.ref(M.hiddenControl),Gt=vue.ref(M.needId),zt=vue.ref(!0);vue.onMounted(async()=>{try{Ln(),await on(),Tr();const Pn=Object.values(approvedBenefitProgram);Kt.value=M.needId?await J({Snils:M.patientSnils})||[]:(await V({Snils:M.patientSnils,Monetized:!1,Active:!0,Deleted:!1})).filter(Sn=>Pn.includes(Sn.BenefitProgram))||[],await BenefitMap(Sn=>qt.value=Sn.filter(Vn=>Kt.value.map(dr=>dr.BenefitCodeShort).includes(Vn.BenefitCodeShort))),lpusWithDivision.includes(vt.value.LpuId)&&wr(),lr()}catch(Pn){const Sn=Pn.response?.data?.message||Pn.message||"Неизвестная ошибка";notifyError$1(`${Sn}. Пожалуйста, откройте потребность повторно`,15e3,"Ошибка загрузки данных")}finally{vn()}});const Ht=vue.ref([]),qt=vue.ref([]),Kt=vue.ref([]),Xt=vue.ref([]),fn=vue.computed(()=>Xt.value.find(Pn=>Pn.Id===_n.value.TemplatePreparatId)),an=vue.computed(()=>!!fn.value?.Sign),yn=vue.computed(()=>{if(_n.value.ProgramId){let Pn=Xt.value;noSignPrograms.includes(_n.value.ProgramId)&&(Pn=Pn.filter(Vn=>Vn.Sign));let Sn=Object.keys(programToPreparat).find(Vn=>Vn==_n.value.ProgramId);return Sn&&(Pn=Pn.filter(Vn=>Vn[programToPreparat[Sn]])),Pn}});async function on(){Ht.value=await window.axios.get(window.localhost+"PreparatProgram?BaseProgram=true").then(Pn=>Pn.data.Body.filter(Sn=>Sn.BenefitProgramId).map(Sn=>({...Sn,label:Sn.ValidName,Name:Sn.ValidName})))}const _n=vue.ref({DateNeed:new Date,Additional:!0,Interchangeability:!1}),dn=vue.ref(!1);async function xn(){if(At.value.reportValidity()){if(_n.value.NprNumber||_n.value.NprDate?_n.value.Npr=!0:_n.value.Npr=!1,!_n.value.LgotaId){notifyError$1("Льгота не выбрана");return}if(!_n.value.TemplatePreparatId){notifyError$1("Препарат не выбран");return}if(!an.value&&(!_n.value.NumberVK||!_n.value.DateVK)){notifyError$1("Для выбранного препарата требуется заполнить номер и дату ВК");return}if(_n.value.NprNumber&&!_n.value.NprDate){notifyError$1("Заполните дату НПР для указанного номера НПР");return}if(_n.value.NprDate&&!_n.value.NprNumber){notifyError$1("Заполните номер НПР для указанной даты НПР");return}if(!_n.value.ProgramId){notifyError$1("Программа не выбрана");return}if(lpusWithDivision.includes(vt.value.LpuId)&&!_n.value.DivisionId){notifyError$1("Отделение не выбрано");return}dn.value!=!0&&(Ln(),dn.value=!0,_n.value.LpuId=vt.value.LpuId,_n.value.EmployeePostId=vt.value.Id,_n.value.PatientId=M.patientId,_n.value.CountMonth=Number(_n.value.CountMonth),delete _n.value.MkbName,delete _n.value.Mnn,delete _n.value.MaxPriceWithVat,delete _n.value.MkbCode,delete _n.value.FullName,delete _n.value.DivisionName,delete _n.value.EmployeePostFIO,delete _n.value.ApplicationsNumber,delete _n.value.ApplicationsDeleted,delete _n.value.ApplicationsId,delete _n.value.CreateDateTime,delete _n.value.ApplicationsStatus,delete _n.value.ApplicationsComment,await window.axios({url:window.localhost+`ApplicationCompany/PatientNeeds?Id=${_n.value.Id??""}`,method:"post",data:_n.value}).then(async Pn=>{_n.value.Id&&await deleteApp().then(Sn=>{}),_n.value.Id||(_n.value.Id=Pn.data.Id),notifySuccess("Сохранено"),yt("onSave"),dn.value=!1}).catch(Pn=>{Pn.response.data&¬ifyError$1(Pn.response.data),dn.value=!1}).finally(()=>vn()))}}async function bn(){await window.axios.delete(window.localhost+`ApplicationCompany/PatientNeeds?PatientNeedId=${_n.value.Id}`).then(async()=>{await lr(),notifySuccess("Удалено"),Pt.value=!1}).catch(Pn=>{Pn?.response?.data?.Status?notifyError$1(Pn.response.data.Status):notifyError$1("Произошла ошибка при удалении")})}async function wn(){if(!_n.value.LgotaId){notifyError$1("Льгота не выбрана");return}if(!_n.value.TemplatePreparatId){notifyError$1("Препарат не выбран");return}if(an.value&&(!_n.value.NumberVK||!_n.value.DateVK)){notifyError$1("Для выбранного препарата требуется заполнить номер и дату ВК");return}if(_n.value.NprNumber&&!_n.value.NprDate){notifyError$1("Заполните дату НПР для указанного номера НПР");return}if(_n.value.NprDate&&!_n.value.NprNumber){notifyError$1("Заполните номер НПР для указанной даты НПР");return}if(!_n.value.ProgramId){notifyError$1("Программа не выбрана");return}if(lpusWithDivision.includes(vt.value.LpuId)&&!_n.value.DivisionId){notifyError$1("Отделение не выбрано");return}await xn()}async function Tr(){Xt.value=await window.axios.get(window.localhost+"ApplicationCompany/TemplatePreparatList?DocumentId=c3cd9940-000b-4e0f-8050-b82af933f6de&Deleted=false").then(Pn=>Pn.data)}async function lr(){M.needId&&(_n.value=await window.axios.get(window.localhost+`ApplicationCompany/PatientNeeds?Id=${M.needId}`).then(Pn=>Pn.data[0]))}vue.watch(()=>_n.value.LgotaId,Pn=>{if(Pn==null){_n.value.Mkb10Id=null,_n.value.ProgramId=null,_n.value.TemplatePreparatId=null,Dt.value=!1;return}_n.value.ProgramId=Ht.value.find(Vn=>Vn.BenefitProgramId==qt.value.find(dr=>dr.Id==_n.value.LgotaId)?.ProgramId)?.Id;let Sn=Kt.value.find(Vn=>Vn.BenefitCodeShort==qt.value.find(dr=>dr.Id==_n.value.LgotaId)?.BenefitCodeShort)?.MkbId;Sn?(_n.value.Mkb10Id=Sn,Dt.value=!0):M.readOnly||(_n.value.Mkb10Id=null,Dt.value=!1)}),vue.watch([()=>_n.value.TemplatePreparatId,()=>yn.value],()=>{if(!_n.value.ProgramId||!_n.value.TemplatePreparatId)return;const Pn=Xt.value?.find(er=>er.Id===_n.value.TemplatePreparatId),Sn=Ht.value?.find(er=>er.Id===_n.value.ProgramId)?.ProgramName??"Неизвестная программа";let Vn=yn.value,dr=Vn.some(er=>er.Id===_n.value.TemplatePreparatId),or=(Pn?`Неверно выбранный препарат ${Pn.Mnn} ${Pn.FullName}`:"Не найден препарат в справочнике").trimStart().trimEnd();!dr&&Vn.length>0&&(notifyError$1(`${or} для программы ${Sn}`),M.readOnly||notifyWarning("Выберите заново препарат!"),_n.value.TemplatePreparatId=null)}),vue.watch(()=>_n.value.Id,Pn=>{zt.value=!Pn});const ar=vue.computed(()=>_n.value.NumberVK&&_n.value.DateVK);function Qt(Pn){return Pn.CodeOKPD2=="1.2.643.5.1.13.13.99.2.1212"&&Pn.CodeATX=="Лекарственные препараты и специализированные продукты лечебного питания"?Pn.TradeName:""}function Hn(Pn){const Sn=[];return Pn.Mnn&&Sn.push(Pn.Mnn),Pn.FullName&&Sn.push(Pn.FullName),Pn.MaxPriceWithVat&&Sn.push(`(Цена: ${Pn.MaxPriceWithVat??"не указана"})`),Pn.CountInPackage&&Sn.push(`(в уп-ке: ${Pn.CountInPackage??"не указано"})`),Sn.join(" ")}const tr=vue.ref([]);async function wr(){tr.value=await window.axios.get(window.localhost+`Frmo?LpuId=${vt.value.LpuId}&TypeCode=18`).then(Pn=>Pn.data)}async function Ln(){Ft.value=!0,await vue.nextTick()}function vn(){Ft.value=!1}return I({save:xn,edit:wn}),(Pn,Sn)=>(vue.openBlock(),vue.createBlock(vue.unref(Ds),{size:"2xl",title:`${Rt.value?.Additional??_n.value.Additional?"Дополнительная":"Основная"} заявка${Rt.value?.Number?` № ${Rt.value.Number}`:""}`,modelValue:Pt.value,"onUpdate:modelValue":Sn[19]||(Sn[19]=Vn=>Pt.value=Vn)},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$j,[vue.withDirectives(vue.createElementVNode("div",_hoisted_2$f,[...Sn[20]||(Sn[20]=[vue.createElementVNode("div",{class:"bg-black/60 w-full h-full absolute top-0 left-0 z-[5001]"},null,-1),vue.createElementVNode("div",{class:"bg-white rounded-lg p-4 flex flex-row gap-3 items-center z-[5002]"},[vue.createElementVNode("div",{role:"status"},[vue.createElementVNode("svg",{"aria-hidden":"true",class:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-300 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[vue.createElementVNode("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),vue.createElementVNode("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})])]),vue.createElementVNode("div",null,[vue.createElementVNode("p",{class:"font-bold"},"Загрузка данных"),vue.createElementVNode("p",{class:"text-sm text-gray-500"},"Пожалуйста, подождите...")])],-1)])],512),[[vue.vShow,Ft.value]]),vue.createElementVNode("fieldset",null,[vue.createElementVNode("form",{ref_key:"formRef",ref:At,class:"flex flex-col gap-1"},[vt.value.LpuId=="e41d5246-7a49-4b5a-a306-00ef5125d3d8"?(vue.openBlock(),vue.createBlock(vue.unref(Kc),{key:0,label:"Дополнительная заявочная кампания",modelValue:_n.value.Additional,"onUpdate:modelValue":Sn[0]||(Sn[0]=Vn=>_n.value.Additional=Vn)},null,8,["modelValue"])):vue.createCommentVNode("",!0),vue.createVNode(_sfc_main$q,{label:"Дата заявки",modelValue:_n.value.DateNeed,"onUpdate:modelValue":Sn[1]||(Sn[1]=Vn=>_n.value.DateNeed=Vn),disabled:""},null,8,["modelValue"]),vue.createElementVNode("div",_hoisted_3$b,[Sn[21]||(Sn[21]=vue.createElementVNode("p",{class:"font-semibold text-sm"},"ВК",-1)),Sn[22]||(Sn[22]=vue.createElementVNode("hr",null,null,-1)),vue.createElementVNode("div",_hoisted_4$a,[vue.createVNode(vue.unref(IA),{label:"Номер ВК",modelValue:_n.value.NumberVK,"onUpdate:modelValue":Sn[2]||(Sn[2]=Vn=>_n.value.NumberVK=Vn),mask:"00000000000",tokens:"0:\\d:optional",required:!an.value,disabled:M.readOnly},null,8,["modelValue","required","disabled"]),vue.createVNode(_sfc_main$q,{label:"Дата ВК",modelValue:_n.value.DateVK,"onUpdate:modelValue":Sn[3]||(Sn[3]=Vn=>_n.value.DateVK=Vn),required:!an.value,disabled:M.readOnly},null,8,["modelValue","required","disabled"])])]),vue.createElementVNode("div",_hoisted_5$9,[Sn[23]||(Sn[23]=vue.createElementVNode("p",{class:"font-semibold text-sm"},"НПР",-1)),Sn[24]||(Sn[24]=vue.createElementVNode("hr",null,null,-1)),vue.createElementVNode("div",_hoisted_6$9,[vue.createVNode(vue.unref(IA),{label:"Номер НПР",modelValue:_n.value.NprNumber,"onUpdate:modelValue":Sn[4]||(Sn[4]=Vn=>_n.value.NprNumber=Vn),mask:"00000000000",tokens:"0:\\d:optional",required:!!_n.value.NprDate,disabled:M.readOnly},null,8,["modelValue","required","disabled"]),vue.createVNode(_sfc_main$q,{label:"Дата НПР",modelValue:_n.value.NprDate,"onUpdate:modelValue":Sn[5]||(Sn[5]=Vn=>_n.value.NprDate=Vn),required:!!_n.value.NprNumber,disabled:M.readOnly},null,8,["modelValue","required","disabled"])])]),vue.unref(lpusWithDivision).includes(vt.value.LpuId)?(vue.openBlock(),vue.createBlock(_sfc_main$F,{key:1,data:tr.value,label:"Отделение",modelValue:_n.value.DivisionId,"onUpdate:modelValue":Sn[6]||(Sn[6]=Vn=>_n.value.DivisionId=Vn),required:"",clearable:"",disabled:M.readOnly},null,8,["data","modelValue","disabled"])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_7$8,[vue.createVNode(_sfc_main$F,{label:"Льгота",modelValue:_n.value.LgotaId,"onUpdate:modelValue":Sn[7]||(Sn[7]=Vn=>_n.value.LgotaId=Vn),data:qt.value,"display-expr":Vn=>"("+Vn.BenefitCodeShort+") "+Vn.BenefitNameLong,required:"",clearable:"",disabled:!zt.value},null,8,["modelValue","data","display-expr","disabled"]),vue.createVNode(_sfc_main$F,{required:"",label:"Программа",modelValue:_n.value.ProgramId,"onUpdate:modelValue":Sn[8]||(Sn[8]=Vn=>_n.value.ProgramId=Vn),data:Ht.value,disabled:""},null,8,["modelValue","data"])]),vue.createVNode(_sfc_main$x,{required:"",label:"Препарат",modelValue:_n.value.TemplatePreparatId,"onUpdate:modelValue":Sn[9]||(Sn[9]=Vn=>_n.value.TemplatePreparatId=Vn),data:yn.value,"display-expr":Hn,"display-expr-low":Qt,searchByLowField:"",disabled:!_n.value.ProgramId||M.readOnly,clearable:""},null,8,["modelValue","data","disabled"]),ar.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_8$8,[Sn[25]||(Sn[25]=vue.createElementVNode("p",{class:"text-sm font-medium"},"Торговое наименование",-1)),vue.createElementVNode("p",_hoisted_9$6,vue.toDisplayString(Xt.value.find(Vn=>Vn.Id==_n.value.TemplatePreparatId)?.TradeName),1)])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_10$6,[vue.createVNode(vue.unref(Kc),{label:"Взаимозаменяемость",modelValue:_n.value.Interchangeability,"onUpdate:modelValue":Sn[10]||(Sn[10]=Vn=>_n.value.Interchangeability=Vn),disabled:M.readOnly},null,8,["modelValue","disabled"]),vue.createVNode(vue.unref(Kc),{label:"Дополнительная",modelValue:_n.value.Additional,"onUpdate:modelValue":Sn[11]||(Sn[11]=Vn=>_n.value.Additional=Vn),disabled:""},null,8,["modelValue"])]),vue.createVNode(_sfc_main$r,{label:"Диагноз",modelValue:_n.value.Mkb10Id,"onUpdate:modelValue":Sn[12]||(Sn[12]=Vn=>_n.value.Mkb10Id=Vn),required:"",clearable:"",disabled:Dt.value||M.readOnly},null,8,["modelValue","disabled"]),vue.createVNode(vue.unref(y$),{label:"Примечание",modelValue:_n.value.Comment,"onUpdate:modelValue":Sn[13]||(Sn[13]=Vn=>_n.value.Comment=Vn),disabled:M.readOnly},null,8,["modelValue","disabled"]),vue.createElementVNode("div",_hoisted_11$5,[vue.createVNode(vue.unref(IA),{label:"Кол-во упаковок на 1 месяц",mask:"0.99",tokens:"0:\\d:multiple|9:\\d:optional",modelValue:_n.value.CountMonth,"onUpdate:modelValue":Sn[14]||(Sn[14]=Vn=>_n.value.CountMonth=Vn),disabled:M.readOnly},null,8,["modelValue","disabled"]),vue.createVNode(vue.unref(g$),{label:"Кол-во упаковок на 1 год",min:1,modelValue:_n.value.CountYear,"onUpdate:modelValue":Sn[15]||(Sn[15]=Vn=>_n.value.CountYear=Vn),disabled:M.readOnly},null,8,["modelValue","disabled"])])],512)])])]),footer:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_12$4,[Gt.value&&!$t.value?(vue.openBlock(),vue.createBlock(vue.unref(P2),{key:0,delete:"",onClick:Sn[16]||(Sn[16]=Vn=>bn(Gt.value)),disabled:!Pn.deleteAccess||e.readOnly,loading:Ft.value},{default:vue.withCtx(()=>[...Sn[26]||(Sn[26]=[vue.createTextVNode("Удалить",-1)])]),_:1},8,["disabled","loading"])):vue.createCommentVNode("",!0),$t.value?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(P2),{key:1,primary:"",onClick:Sn[17]||(Sn[17]=Vn=>Gt.value?wn():xn()),loading:Ft.value,disabled:e.readOnly},{default:vue.withCtx(()=>[...Sn[27]||(Sn[27]=[vue.createTextVNode("Сохранить",-1)])]),_:1},8,["loading","disabled"])),vue.createVNode(vue.unref(P2),{onClick:Sn[18]||(Sn[18]=Vn=>Pt.value=!1)},{default:vue.withCtx(()=>[...Sn[28]||(Sn[28]=[vue.createTextVNode("Закрыть",-1)])]),_:1})])]),_:1},8,["title","modelValue"]))}},_hoisted_1$i=["id"],_hoisted_2$e={key:0,class:"flex justify-end mb-1 flex-none"},_hoisted_3$a={class:"min-h-0 overflow-hidden"},_hoisted_4$9={class:"re-table"},_hoisted_5$8={key:0,class:"text-right"},_hoisted_6$8={class:"flex flex-col"},_hoisted_7$7=["onClick"],_hoisted_8$7={class:"flex flex-col gap-0.5 w-[600px]"},_hoisted_9$5={class:"text-sm text-slate-500 text-center"},_hoisted_10$5={open:"",class:"px-1"},_hoisted_11$4={class:"px-1"},_hoisted_12$3={class:"rs-table-btn"},_hoisted_13$3={class:"flex justify-between items-center text-sm text-slate-500 gap-1"},_hoisted_14$2={class:"flex flex-col gap-1"},_hoisted_15$2=["onClick"],_hoisted_16$2={class:"px-1"},_hoisted_17$2=["onClick"],_hoisted_18$2=["onDblclick"],_hoisted_19$2={key:1},_hoisted_20$2=["onContextmenu","onClick"],_hoisted_21$2={key:0,class:"text-right"},_hoisted_22$1=["onClick","title"],_hoisted_23$1={key:0},_hoisted_24$1={key:1},_hoisted_25$1=["title"],_hoisted_26$1=["title"],_hoisted_27$1={key:1},_hoisted_28$1=["onClick"],_hoisted_29$1={key:0},_hoisted_30$1={key:0,class:"bg-slate-100 hover:bg-slate-100 cursor-arrow"},_hoisted_31$1={key:0},_hoisted_32$1={key:1},_hoisted_33$1={key:1},_hoisted_34$1={key:0},_hoisted_35={class:"mb-3"},_hoisted_36={class:"border rounded p-3 bg-gray-50"},_hoisted_37=["onDragstart","onDrop"],_hoisted_38={class:"flex items-center gap-2"},_hoisted_39={class:"text-sm font-medium"},_hoisted_40={class:"flex items-center gap-1"},_hoisted_41=["onClick"],_hoisted_42=["onClick"],_hoisted_43={class:"flex justify-end gap-2"},_hoisted_44={class:"flex-none pagination-wrapper"},_hoisted_45={class:"flex items-center gap-4"},_hoisted_46={key:0,class:"pagination"},_hoisted_47=["onClick"],_hoisted_48={key:1,class:"flex items-center gap-2"},_hoisted_49={class:"text-sm text-slate-400"},STORAGE_KEY_ALL_HIDDEN="table_hidden_columns",STORAGE_KEY_ALL_WIDTHS="table_column_widths",STORAGE_KEY_PAGE_SIZE="table_page_size",STORAGE_KEY_COLUMN_ORDER="table_column_order",_sfc_main$o={__name:"ReSimpleTableAppCompany",props:vue.mergeModels({striped:{type:Boolean,default:!1},columns:{type:Array,default:()=>[]},growOnlyX:{type:Boolean,default:!1},data:{type:Array,default:()=>[]},pageSize:{type:Number,default:999},rowActions:{type:Array,default:()=>[]},rowColor:{type:Function,default:()=>{}},enableXlsxExport:{type:Boolean,default:!1},contextActions:{type:Array,default:()=>[]},rowHorizontal:{type:Boolean,default:!1},tableClass:{type:String,default:""},customPagination:{type:Boolean,default:!1},recordTotal:{type:Number,default:0},tableId:{type:String,required:!0},stickyHeader:{type:Boolean,default:!1},wheelPropagation:{type:Boolean,default:!0},numbering:{type:Boolean,default:!1},enablePageSizeSelector:{type:Boolean,default:!1},footer:{type:Boolean,default:!1},height:{type:String}},{sortDirection:{local:!0,default:null},sortDirectionModifiers:{},sortColumnIndex:{local:!0,default:null},sortColumnIndexModifiers:{},page:{local:!0,default:1},pageModifiers:{}}),emits:vue.mergeModels(["rowClicked","cellClicked"],["update:sortDirection","update:sortColumnIndex","update:page"]),setup(e,{expose:I,emit:N}){const J=N,V=vue.ref({}),M=e,vt=vue.useModel(e,"sortDirection"),yt=vue.useModel(e,"sortColumnIndex"),At=vue.ref(""),Dt=vue.ref({}),Ft=vue.ref({}),Pt=vue.ref({}),Rt=vue.ref(!1),$t=vue.ref([]),Gt=vue.ref(null),zt=vue.ref(M.pageSize);vue.watch(()=>M.pageSize,()=>{zt.value=M.pageSize},{immediate:!0});function Ht(){try{const Ir=JSON.parse(localStorage.getItem(STORAGE_KEY_ALL_HIDDEN)||"{}"),Fr=JSON.parse(localStorage.getItem(STORAGE_KEY_ALL_WIDTHS)||"{}"),Fa=JSON.parse(localStorage.getItem(STORAGE_KEY_COLUMN_ORDER)||"{}");Ir[M.tableId]&&(wn.value=Ir[M.tableId]),Fr[M.tableId]&&(on.value=Fr[M.tableId],Kt()),Fa[M.tableId]&&yd(Fa[M.tableId])}catch(Ir){console.error("Ошибка при загрузке состояния таблицы:",Ir)}}function qt(){try{const Ir=JSON.parse(localStorage.getItem(STORAGE_KEY_ALL_HIDDEN)||"{}"),Fr=JSON.parse(localStorage.getItem(STORAGE_KEY_ALL_WIDTHS)||"{}"),Fa=JSON.parse(localStorage.getItem(STORAGE_KEY_PAGE_SIZE)||"{}"),fs=JSON.parse(localStorage.getItem(STORAGE_KEY_COLUMN_ORDER)||"{}");Object.keys(wn.value).length?Ir[M.tableId]=wn.value:delete Ir[M.tableId],Object.keys(on.value).length?Fr[M.tableId]=on.value:delete Fr[M.tableId],Fa[M.tableId]=zt.value,$t.value.length>0?fs[M.tableId]=$t.value.map(eu=>eu.originalIndex):delete fs[M.tableId],localStorage.setItem(STORAGE_KEY_ALL_HIDDEN,JSON.stringify(Ir)),localStorage.setItem(STORAGE_KEY_ALL_WIDTHS,JSON.stringify(Fr)),localStorage.setItem(STORAGE_KEY_PAGE_SIZE,JSON.stringify(Fa)),localStorage.setItem(STORAGE_KEY_COLUMN_ORDER,JSON.stringify(fs))}catch(Ir){console.error("Ошибка при сохранении состояния таблицы:",Ir)}}async function Kt(){if(await vue.nextTick(),!M.tableId){console.log("Не указан идентификатор таблицы",M.columns),notifyError$1("Не указан идентификатор таблицы");return}const Ir=document.getElementById(`table-${M.tableId}`);if(!Ir)return;const Fr=Ir.querySelector(".re-table");if(!Fr)return;const Fa=Fr.querySelectorAll("thead th");Object.entries(on.value).forEach(([fs,eu])=>{const ga=Fa[parseInt(fs)];ga&&eu&&(ga.style.width=`${eu}px`,ga.style.minWidth=`${eu}px`)})}vue.onMounted(()=>{Aa(),Ht(),document.addEventListener("click",jr),document.addEventListener("keydown",io)});const Xt=vue.useModel(e,"page"),fn=vue.ref(!1),an=vue.ref({x:"0px",y:"0px"}),yn=vue.ref(null),on=vue.ref({});let _n=!1,dn=null,xn=0,bn=0;const wn=vue.ref({}),Tr=vue.ref(!1);let lr=vue.ref(null);function ar(Ir){_n=!0,dn=Ir.target.parentElement,xn=Ir.pageX,bn=dn.offsetWidth,document.addEventListener("mousemove",Qt),document.addEventListener("mouseup",Hn),Ir.preventDefault()}function Qt(Ir){if(!_n)return;const Fr=bn+(Ir.pageX-xn);if(Fr>=50){dn.style.width=`${Fr}px`,dn.style.minWidth=`${Fr}px`;const Fa=document.getElementById(`table-${M.tableId}`);if(!Fa)return;const fs=Fa.querySelector(".re-table");if(!fs)return;const eu=fs.querySelectorAll("thead th"),ga=Array.from(eu).indexOf(dn);ga!==-1&&(on.value[ga]=Fr,qt())}}function Hn(){_n=!1,document.removeEventListener("mousemove",Qt),document.removeEventListener("mouseup",Hn)}function tr(Ir){const Fr=document.getElementById(`table-${M.tableId}`);if(!Fr)return;const Fa=Fr.querySelector(".re-table");if(!Fa)return;const eu=Fa.querySelectorAll("thead th")[Ir];eu&&(eu.style.width="",eu.style.minWidth="120px",delete on.value[Ir],qt())}vue.onUnmounted(()=>{document.removeEventListener("mousemove",Qt),document.removeEventListener("mouseup",Hn),document.removeEventListener("click",jr),qt()});const wr=vue.computed(()=>{let Ir=[...M.data];for(const Fr in V.value)V.value[Fr]&&(typeof Ln.value[Fr]?.Field=="function"?Ir=Ir.filter(Fa=>String(Ln.value[Fr].Field(Fa))?.toLowerCase().indexOf(V.value[Fr]?.toLowerCase())>-1):Ir=Ir.filter(Fa=>String(Fa[Ln.value[Fr].Field])?.toLowerCase().indexOf(V.value[Fr]?.toLowerCase())>-1));for(const Fr in Dt.value)Dt.value[Fr]&&(Ir=Ir.filter(Fa=>typeof Ln.value[Fr]?.Field=="function"?Dt.value[Fr].includes(Ln.value[Fr].Field(Fa)):Dt.value[Fr].includes(Fa[Ln.value[Fr].Field])));for(const Fr in Pt.value)Pt.value[Fr]&&(Ir=Ir.filter(Fa=>{let fs;return typeof Ln.value[Fr]?.Field=="function"?fs=Ln.value[Fr].Field(Fa):fs=Fa[Ln.value[Fr].Field],fs==null||fs===""||typeof fs=="string"&&fs.trim()===""}));return yt.value>=0&&vt.value&&(Ir=Ir.sort((Fr,Fa)=>typeof Ln.value[yt.value].Field=="function"?typeof Ln.value[yt.value].SortMethod=="function"?Ln.value[yt.value].SortMethod(Fr,Fa):String(Ln.value[yt.value].Field(Fr))>String(Ln.value[yt.value].Field(Fa))?1:-1:typeof Ln.value[yt.value].SortMethod=="function"?Ln.value[yt.value].SortMethod(Fr,Fa):String(Fr[Ln.value[yt.value].Field])>String(Fa[Ln.value[yt.value].Field])?1:-1),vt.value==="desc"&&(Ir=Ir.reverse())),Ir}),Ln=vue.computed(()=>{let Ir=M.columns.filter(Fr=>!wn.value[Fr.Index]);return $t.value.length>0&&(Ir=$t.value.map(Fr=>Ir.find((Fa,fs)=>fs===Fr.originalIndex))),Ir}),vn=vue.computed(()=>M.contextActions.filter(Ir=>typeof Ir.IsVisible=="function"?Ir.IsVisible(yn.value):!0)),Pn=vue.computed(()=>{if(M.customPagination)return M.data;const Ir=(Xt.value-1)*parseInt(zt.value);return wr.value.slice(Ir,Ir+parseInt(zt.value))}),Sn=vue.computed(()=>M.customPagination?Math.ceil(M.recordTotal/parseInt(zt.value)):Math.ceil(wr.value.length/parseInt(zt.value))),Vn=vue.computed(()=>Sn.value>5?Xt.value<=3?[1,2,3,4,5,"...",Sn.value]:Xt.value>=Sn.value-2?[1,"...",Sn.value-4,Sn.value-3,Sn.value-2,Sn.value-1,Sn.value]:[1,"...",Xt.value-2,Xt.value-1,Xt.value,Xt.value+1,Xt.value+2,"...",Sn.value]:Array.from({length:Sn.value},(Ir,Fr)=>Fr+1)),dr=vue.computed(()=>M.customPagination?M.recordTotal:wr.value.length);vue.watch(()=>M.data,()=>{M.customPagination||(Xt.value=1,Aa())}),vue.watch(()=>Ln.value,(Ir,Fr)=>{(!Fr||Ir.length!==Fr.length||!Ir.every((Fa,fs)=>Fa.Title===Fr[fs].Title))&&(V.value={},wn.value={},on.value={},qt(),Aa(),vr(null,null),Dt.value={},Pt.value={})},{deep:!0}),vue.watch(()=>wr.value.length,()=>{M.customPagination||(Xt.value=1)}),vue.watch(zt,()=>{Xt.value=1,qt()});function or(){if(wr.value.length===0){notifyError$1("Нет данных для экспорта");return}let Ir=[{sheet:"Лист 1",columns:M.columns.map(Fa=>({label:Fa.Title,value:fs=>{let eu="";return typeof Fa.Field=="function"?eu=Fa.Field(fs):eu=fs[Fa.Field],Fa.LowField&&(typeof Fa.LowField=="function"?eu+=` (${Fa.LowField(fs)})`:fs[Fa.LowField]&&(eu+=` (${fs[Fa.LowField]})`)),eu}})),content:wr.value}],Fr={fileName:"Выгрузка данных от "+hooks().format("L HH:mm:ss"),extraLength:3,writeMode:"writeFile"};xlsx(Ir,Fr)}function er(Ir,Fr){an.value={x:Ir.pageX+"px",y:Ir.pageY+"px"},yn.value=Fr,fn.value=!0}function sn(){yn.value=null,fn.value=!1}function mr(Ir,Fr){if(Tr.value){_r();return}an.value={x:Ir.pageX,y:Ir.pageY},lr.value=Fr,Tr.value=!0,fn.value=!1}function pr(Ir){if(!wn.value[Ir]&&Ln.value.length-Object.values(wn.value).filter(Boolean).length<=1){notifyError$1("Должен быть виден хотя бы один столбец");return}wn.value[Ir]=!wn.value[Ir],qt()}function _r(){Tr.value=!1,lr.value=null}function jr(Ir){const Fr=document.getElementById("headerContextMenuId");Fr&&!Fr.contains(Ir.target)&&!Ir.target.closest(".header-filter-activator")&&_r()}function io(Ir){Ir.key==="Escape"&&Tr.value&&_r()}function vr(Ir,Fr){yt.value===Ir&&vt.value===Fr?(yt.value=null,vt.value=null):(yt.value=Ir,vt.value=Fr)}function Uo(Ir){return yt.value===Ir||V.value[Ir]||Dt.value[Ir]?.length>0||Pt.value[Ir]}function jo(){wn.value={},qt()}function Ur(Ir){let Fr=Dt.value[lr.value]||[];Fr.includes(Ir)?Fr=Fr.filter(Fa=>Fa!==Ir):Fr.push(Ir),Dt.value[lr.value]=Fr,Fr.length===0&&delete Dt.value[lr.value]}function Aa(){Ft.value={},Ln.value.forEach((Ir,Fr)=>{Ft.value[Fr]=[],M.data.forEach(Fa=>{let fs=Ft.value[Fr]||[];typeof Ir.Field=="function"?fs.push(Ir.Field(Fa)):fs.push(Fa[Ir.Field]),Ft.value[Fr]=fs}),Ft.value[Fr]=[...new Set(Ft.value[Fr])],Ft.value[Fr].sort()})}function pu(Ir){if(!Ft.value[Ir])return[];let Fr=[...Ft.value[Ir]];return Fr=Fr.filter(Fa=>Fa&&String(Fa).toLowerCase().includes(At.value)),Fr}function Ba(Ir){Dt.value[Ir]=Ft.value[Ir]}function sf(Ir){Pt.value[Ir]=!Pt.value[Ir],Pt.value[Ir]||delete Pt.value[Ir]}function Cf(Ir){let Fr=!1;fn.value&&(sn(),Fr=!0),Tr.value&&(_r(),Fr=!0),!Fr&&J("rowClicked",Ir)}function hl(){($t.value.length>0?$t.value:null)||($t.value=Ln.value.map((Fr,Fa)=>({originalIndex:Fa,displayIndex:Fa,title:Fr.Title}))),Rt.value=!0,_r()}function Bf(){Rt.value=!1}function Ka(Ir,Fr){Gt.value=Fr,Ir.dataTransfer.effectAllowed="move"}function Tu(Ir,Fr){if(Gt.value===null||Gt.value===Fr)return;const Fa=$t.value[Gt.value],fs=[...$t.value];fs.splice(Gt.value,1),fs.splice(Fr,0,Fa),fs.forEach((eu,ga)=>{eu.displayIndex=ga}),$t.value=fs,Gt.value=null}function Bo(Ir,Fr){if(Fr==="up"&&Ir>0){const Fa=$t.value[Ir];$t.value[Ir]=$t.value[Ir-1],$t.value[Ir-1]=Fa,$t.value[Ir].displayIndex=Ir,$t.value[Ir-1].displayIndex=Ir-1}else if(Fr==="down"&&Ir<$t.value.length-1){const Fa=$t.value[Ir];$t.value[Ir]=$t.value[Ir+1],$t.value[Ir+1]=Fa,$t.value[Ir].displayIndex=Ir,$t.value[Ir+1].displayIndex=Ir+1}}function qo(){$t.value=M.columns.map((Ir,Fr)=>({originalIndex:Fr,displayIndex:Fr,title:Ir.Title}))}function af(){const Ir=$t.value.map(Fr=>Fr.originalIndex);try{const Fr=JSON.parse(localStorage.getItem(STORAGE_KEY_COLUMN_ORDER)||"{}");Fr[M.tableId]=Ir,localStorage.setItem(STORAGE_KEY_COLUMN_ORDER,JSON.stringify(Fr))}catch(Fr){console.error("Ошибка при сохранении порядка столбцов:",Fr)}Bf()}function yd(Ir){if(!Ir||!Array.isArray(Ir))return;const Fr=Ir.filter(Fa=>Fa>=0&&Fa<M.columns.length);Fr.length===M.columns.length&&($t.value=Fr.map((Fa,fs)=>({originalIndex:Fa,displayIndex:fs,title:M.columns[Fa].Title})))}return I({exportToXlsx:or,filteredData:wr,showOnlyEmpty:Pt,filterByValue:Dt,filterOption:V,saveTableState:qt}),(Ir,Fr)=>{const Fa=vue.resolveComponent("PerfectScrollbar");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{style:vue.normalizeStyle({height:M.height}),class:"flex flex-col",id:"table-"+M.tableId},[M.enableXlsxExport?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$e,[vue.createVNode(vue.unref(P2),{onClick:or,prependIcon:"file-arrow-down"},{default:vue.withCtx(()=>[...Fr[11]||(Fr[11]=[vue.createTextVNode("Экспорт в Excel",-1)])]),_:1})])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_3$a,[vue.createVNode(Fa,{class:vue.normalizeClass(["h-full pb-4",M.tableClass]),options:{wheelPropagation:M.wheelPropagation}},{default:vue.withCtx(()=>[vue.createElementVNode("table",_hoisted_4$9,[vue.createElementVNode("thead",{class:vue.normalizeClass({sticky:M.stickyHeader})},[vue.createElementVNode("tr",null,[M.numbering?(vue.openBlock(),vue.createElementBlock("th",_hoisted_5$8,"№")):vue.createCommentVNode("",!0),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ln.value,(fs,eu)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("th",{class:"min-w-[120px] relative",key:fs.Title},[vue.createVNode(vue.unref(kt),{shown:Tr.value&&vue.unref(lr)!==null&&eu===vue.unref(lr),triggers:[],autoHide:!1,noAutoFocus:""},{popper:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_8$7,[vue.createElementVNode("p",_hoisted_9$5,vue.toDisplayString(Ln.value[vue.unref(lr)]?.Title),1),vue.createVNode(vue.unref(Iv1)),vue.createElementVNode("p",{class:vue.normalizeClass(["rs-table-btn",{"!font-bold !text-slate-500 !bg-slate-200":yt.value===vue.unref(lr)&&vt.value==="asc"}]),onClick:Fr[0]||(Fr[0]=ga=>vr(vue.unref(lr),"asc"))}," Сортировать А > Я ",2),vue.createElementVNode("p",{class:vue.normalizeClass(["rs-table-btn",{"!font-bold !text-slate-500 !bg-slate-200":yt.value===vue.unref(lr)&&vt.value==="desc"}]),onClick:Fr[1]||(Fr[1]=ga=>vr(vue.unref(lr),"desc"))}," Сортировать Я > А ",2),vue.createVNode(vue.unref(Iv1)),vue.createElementVNode("details",_hoisted_10$5,[Fr[12]||(Fr[12]=vue.createElementVNode("summary",{class:"rs-table-btn"},"Поиск по значению",-1)),vue.createVNode(vue.unref(IA),{type:"text",placeholder:"Введите значение",modelValue:V.value[vue.unref(lr)],"onUpdate:modelValue":Fr[2]||(Fr[2]=ga=>V.value[vue.unref(lr)]=ga),modelModifiers:{lazy:!0}},null,8,["modelValue"])]),vue.createElementVNode("details",_hoisted_11$4,[vue.createElementVNode("summary",_hoisted_12$3,[Fr[13]||(Fr[13]=vue.createTextVNode(" Фильтр по значению ",-1)),Dt.value[vue.unref(lr)]?.length>0?(vue.openBlock(),vue.createBlock(vue.unref(Z1),{key:0,name:"circle-exclamation"})):vue.createCommentVNode("",!0)]),vue.createVNode(vue.unref(IA),{placeholder:"Введите значение",modelValue:At.value,"onUpdate:modelValue":Fr[3]||(Fr[3]=ga=>At.value=ga)},null,8,["modelValue"]),vue.createElementVNode("div",_hoisted_13$3,[vue.createElementVNode("p",null," Показано "+vue.toDisplayString(Dt.value[vue.unref(lr)]?.length?Dt.value[vue.unref(lr)].length:Ft.value[vue.unref(lr)]?.length)+" из "+vue.toDisplayString(Ft.value[vue.unref(lr)]?.length),1),vue.createElementVNode("p",{class:"cursor-pointer hover:text-slate-700 hover:underline",onClick:Fr[4]||(Fr[4]=ga=>Ba(vue.unref(lr)))},"Все"),vue.createElementVNode("p",{class:"cursor-pointer hover:text-slate-700 hover:underline",onClick:Fr[5]||(Fr[5]=ga=>delete Dt.value[vue.unref(lr)])}," Сбросить ")]),vue.createVNode(Fa,{class:"max-h-[300px] max-w-[600px]"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_14$2,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(pu(vue.unref(lr)),ga=>(vue.openBlock(),vue.createElementBlock("div",{key:ga,class:"flex gap-1 select-none cursor-pointer hover:bg-slate-100 rounded",onClick:Xo=>Ur(ga)},[vue.createVNode(vue.unref(Kc),{checked:Dt.value[vue.unref(lr)]?.includes(ga)},null,8,["checked"]),vue.createElementVNode("p",null,vue.toDisplayString(ga||"(пусто)"),1)],8,_hoisted_15$2))),128))])]),_:1})]),vue.createElementVNode("details",_hoisted_16$2,[Fr[14]||(Fr[14]=vue.createElementVNode("summary",{class:"rs-table-btn"},"Скрыть столбец",-1)),vue.createElementVNode("p",{class:"text-sm text-slate-500 text-center cursor-pointer hover:text-slate-700 hover:bg-slate-100 rounded",onClick:jo}," Показать все "),vue.createVNode(Fa,{class:"max-h-[300px] overflow-y-auto"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ln.value,(ga,Xo)=>(vue.openBlock(),vue.createElementBlock("div",{key:ga.Title,class:"flex items-center gap-1 px-2 py-1 hover:bg-slate-100 cursor-pointer",onClick:Da=>pr(Xo)},[vue.createVNode(vue.unref(Z1),{class:"text-slate-500",name:wn.value[Xo]?"square":"check-square"},null,8,["name"]),vue.createElementVNode("span",null,vue.toDisplayString(ga.Title),1)],8,_hoisted_17$2))),128))]),_:2},1024)]),vue.createVNode(vue.unref(Iv1)),vue.createElementVNode("p",{class:vue.normalizeClass(["rs-table-btn",{"!font-bold !text-slate-500 !bg-slate-200":Pt.value[vue.unref(lr)]}]),onClick:Fr[6]||(Fr[6]=ga=>sf(vue.unref(lr)))}," Показать только пустые ",2),vue.createVNode(vue.unref(Iv1)),vue.createElementVNode("p",{class:"rs-table-btn",onClick:hl},"Изменить порядок столбцов")])]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_6$8,[vue.createElementVNode("div",{onClick:ga=>fs.filterable!=!1?mr(ga,eu):null,class:"flex flex-row justify-between items-center gap-1 hover:cursor-pointer hover:bg-slate-200 rounded px-2 py-1 header-filter-activator"},[vue.createElementVNode("p",{class:vue.normalizeClass({"whitespace-nowrap":M.growOnlyX})},vue.toDisplayString(fs.Title),3),fs.filterable!=!1?(vue.openBlock(),vue.createBlock(vue.unref(Z1),{key:0,name:"filter",class:vue.normalizeClass([{activeFilter:Uo(eu)},"text-slate-500"])},null,8,["class"])):vue.createCommentVNode("",!0)],8,_hoisted_7$7)])]),_:2},1032,["shown"]),vue.createElementVNode("div",{class:"column-resizer",onMousedown:Fr[7]||(Fr[7]=ga=>ar(ga)),onDblclick:ga=>tr(eu)},null,40,_hoisted_18$2)])),[[vue.vShow,!wn.value[eu]]])),128)),M.rowActions.length?(vue.openBlock(),vue.createElementBlock("th",_hoisted_19$2,[...Fr[15]||(Fr[15]=[vue.createElementVNode("p",null,"Действия",-1)])])):vue.createCommentVNode("",!0)])],2),vue.createElementVNode("tbody",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Pn.value,(fs,eu)=>(vue.openBlock(),vue.createElementBlock("tr",{class:vue.normalizeClass({"even:bg-slate-50":M.striped}),onContextmenu:vue.withModifiers(ga=>er(ga,fs),["right","prevent"]),onClick:ga=>Cf(fs),key:fs,style:vue.normalizeStyle({backgroundColor:fn.value&&yn.value===fs?"rgba(0, 0, 0, 0.05)":"",backgroundColor:e.rowColor(fs)})},[M.numbering?(vue.openBlock(),vue.createElementBlock("td",_hoisted_21$2,vue.toDisplayString(Xt.value*parseInt(zt.value)-parseInt(zt.value)+1+eu),1)):vue.createCommentVNode("",!0),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ln.value,(ga,Xo)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("td",{key:ga.Title,class:vue.normalizeClass(["hover:bg-slate-200",typeof ga.Class=="function"?ga.Class(fs):ga.Class]),onClick:Da=>J("cellClicked",{record:fs,column:ga,index:Xo}),title:typeof ga.titleOnHover=="function"?ga.titleOnHover(fs):ga.titleOnHover},[ga.Template?(vue.openBlock(),vue.createElementBlock("div",_hoisted_23$1,[vue.renderSlot(Ir.$slots,`cell(${ga.Template})`,{record:fs},void 0,!0)])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_24$1,[vue.createElementVNode("p",{class:vue.normalizeClass(["primary-text",{"whitespace-nowrap":M.growOnlyX}]),title:typeof ga.Field=="function"?ga.Field(fs):fs[ga.Field]},vue.toDisplayString(typeof ga.Field=="function"?ga.Field(fs):fs[ga.Field]),11,_hoisted_25$1),vue.createElementVNode("p",{class:vue.normalizeClass(["secondary-text",{"whitespace-nowrap":M.growOnlyX}]),title:typeof ga.LowField=="function"?ga.LowField(fs):fs[ga.LowField]},vue.toDisplayString(typeof ga.LowField=="function"?ga.LowField(fs):fs[ga.LowField]),11,_hoisted_26$1)]))],10,_hoisted_22$1)),[[vue.vShow,!wn.value[Xo]]])),128)),M.rowActions.length?(vue.openBlock(),vue.createElementBlock("td",_hoisted_27$1,[vue.createElementVNode("div",{class:vue.normalizeClass(["flex flex-col items-start",{horizontalAction:M.rowHorizontal}])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(M.rowActions,ga=>(vue.openBlock(),vue.createElementBlock("span",{class:"rowAction whitespace-nowrap",onClick:vue.withModifiers(Xo=>ga.Action(fs),["stop"]),key:ga},[typeof ga.IsVisible!="function"||ga.IsVisible(fs)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_29$1,[ga.Icon?(vue.openBlock(),vue.createBlock(vue.unref(Z1),{key:0,name:ga.Icon},null,8,["name"])):vue.createCommentVNode("",!0),vue.createTextVNode(" "+vue.toDisplayString(ga.Name),1)])):vue.createCommentVNode("",!0)],8,_hoisted_28$1))),128))],2)])):vue.createCommentVNode("",!0)],46,_hoisted_20$2))),128)),M.footer?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_30$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ln.value,(fs,eu)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("td",{key:fs.Title},[typeof fs.Footer=="function"?(vue.openBlock(),vue.createElementBlock("p",_hoisted_31$1,vue.toDisplayString(fs.Footer(Ir.row)),1)):(vue.openBlock(),vue.createElementBlock("p",_hoisted_32$1,vue.toDisplayString(fs.Footer),1))])),[[vue.vShow,!wn.value[eu]]])),128))])):vue.createCommentVNode("",!0),dr.value?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("tr",_hoisted_33$1,[...Fr[16]||(Fr[16]=[vue.createElementVNode("td",{colspan:"100",class:"text-center"},[vue.createElementVNode("p",{class:"text-xl text-slate-400 font-semibold"},"Данные отсутствуют")],-1)])]))])])]),_:3},8,["class","options"])]),fn.value?(vue.openBlock(),vue.createElementBlock("div",{id:"contextMenuId",class:"context-menu",key:an.value,style:vue.normalizeStyle({top:an.value.y,left:an.value.x})},[vue.createVNode(vue.unref(dz1),{spacing:"xs"},{default:vue.withCtx(()=>[vn.value.length?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("p",_hoisted_34$1,"Нет доступных действий контекстного меню")),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vn.value,fs=>(vue.openBlock(),vue.createBlock(vue.unref(P2),{key:fs,prependIcon:fs.Icon,onClick:eu=>(fs.Action(yn.value),sn())},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(fs.Name),1)]),_:2},1032,["prependIcon","onClick"]))),128))]),_:1})],4)):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(Ds),{title:"Изменение порядка столбцов",modelValue:Rt.value,"onUpdate:modelValue":Fr[9]||(Fr[9]=fs=>Rt.value=fs),closeOnClickOutside:!0,class:"p-2"},{footer:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_43,[vue.createVNode(vue.unref(P2),{onClick:qo,variant:"outline",size:"sm"},{default:vue.withCtx(()=>[...Fr[18]||(Fr[18]=[vue.createTextVNode("Сбросить",-1)])]),_:1}),vue.createVNode(vue.unref(P2),{onClick:af,size:"sm"},{default:vue.withCtx(()=>[...Fr[19]||(Fr[19]=[vue.createTextVNode("Сохранить",-1)])]),_:1})])]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_35,[Fr[17]||(Fr[17]=vue.createElementVNode("p",{class:"text-sm text-gray-600 mb-2"},"Перетащите столбцы для изменения их порядка:",-1)),vue.createElementVNode("div",_hoisted_36,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList($t.value,(fs,eu)=>(vue.openBlock(),vue.createElementBlock("div",{key:fs.originalIndex,class:"flex items-center justify-between p-2 mb-1 bg-white rounded border cursor-move hover:bg-gray-50",draggable:"true",onDragstart:ga=>Ka(ga,eu),onDragover:Fr[8]||(Fr[8]=vue.withModifiers(()=>{},["prevent"])),onDrop:ga=>Tu(ga,eu)},[vue.createElementVNode("div",_hoisted_38,[vue.createVNode(vue.unref(Z1),{name:"grip-vertical",class:"text-gray-400 text-sm"}),vue.createElementVNode("span",_hoisted_39,vue.toDisplayString(fs.title),1)]),vue.createElementVNode("div",_hoisted_40,[eu>0?(vue.openBlock(),vue.createElementBlock("button",{key:0,onClick:ga=>Bo(eu,"up"),class:"p-1 hover:bg-gray-200 rounded text-xs",title:"Переместить вверх"},[vue.createVNode(vue.unref(Z1),{name:"chevron-up",class:"text-gray-500"})],8,_hoisted_41)):vue.createCommentVNode("",!0),eu<$t.value.length-1?(vue.openBlock(),vue.createElementBlock("button",{key:1,onClick:ga=>Bo(eu,"down"),class:"p-1 hover:bg-gray-200 rounded text-xs",title:"Переместить вниз"},[vue.createVNode(vue.unref(Z1),{name:"chevron-down",class:"text-gray-500"})],8,_hoisted_42)):vue.createCommentVNode("",!0)])],40,_hoisted_37))),128))])])]),_:1},8,["modelValue"])],12,_hoisted_1$i),vue.createElementVNode("div",_hoisted_44,[vue.createElementVNode("div",_hoisted_45,[Sn.value>1?(vue.openBlock(),vue.createElementBlock("ul",_hoisted_46,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Vn.value,fs=>(vue.openBlock(),vue.createElementBlock("li",{key:fs,class:vue.normalizeClass({active:fs===Xt.value}),onClick:eu=>fs!=="..."?Xt.value=fs:null},[vue.createElementVNode("a",null,vue.toDisplayString(fs),1)],10,_hoisted_47))),128))])):vue.createCommentVNode("",!0),M.enablePageSizeSelector?(vue.openBlock(),vue.createElementBlock("div",_hoisted_48,[Fr[21]||(Fr[21]=vue.createElementVNode("span",{class:"text-sm text-slate-500"},"Показать:",-1)),vue.withDirectives(vue.createElementVNode("select",{"onUpdate:modelValue":Fr[10]||(Fr[10]=fs=>zt.value=fs),class:"text-sm border rounded px-1 py-0.5 w-[60px] border-slate-300"},[...Fr[20]||(Fr[20]=[vue.createElementVNode("option",{value:"5"},"5",-1),vue.createElementVNode("option",{value:"10"},"10",-1),vue.createElementVNode("option",{value:"20"},"20",-1),vue.createElementVNode("option",{value:"100"},"100",-1)])],512),[[vue.vModelSelect,zt.value]])])):vue.createCommentVNode("",!0)]),vue.createElementVNode("p",_hoisted_49," Записи "+vue.toDisplayString(Xt.value*parseInt(zt.value)-parseInt(zt.value)+1)+"-"+vue.toDisplayString(Math.min(Xt.value*parseInt(zt.value),dr.value))+" из "+vue.toDisplayString(dr.value),1)])],64)}}},ReSimpleTableAppCompany=_export_sfc(_sfc_main$o,[["__scopeId","data-v-6c0b94b1"]]),_hoisted_1$h={class:"w-full h-full absolute top-0 left-0 flex justify-center items-center animate-pulse z-[5000]"},_hoisted_2$d={class:"border rounded p-2 bg-slate-100"},_hoisted_3$9={class:"h-full flex flex-col p-3 gap-3"},_sfc_main$n={__name:"PatientInfoPageAppCompany",props:{patientId:{type:String,default:"",required:!0},patientSnils:{type:String,default:"",required:!0},nameApp:{type:String,default:""}},setup(e){const I=vue.computed(()=>useUserStore().user),N=e,J=vue.ref(!1),V=vue.ref(!1),M=vue.ref(!1),vt=vue.ref(null),yt=vue.ref(null),At=[{Name:"Просмотр",Icon:"eye",Action:an=>qt(an.NeedsId,an.ApplicationId,an.MessageWarning)}],Dt=vue.computed(()=>{const an=hooks().year(),yn=2025,on=an+1,_n=[];for(let dn=yn;dn<=on;dn++)_n.push({Id:dn.toString(),Name:dn.toString()});return _n}),Ft=vue.computed(()=>{const an=[];for(let yn=0;yn<=listStatuses.length;yn++)an.push({Id:listStatuses[yn],Name:listStatuses[yn]});return an});vue.onMounted(()=>{$t(null)});const Pt=vue.ref(null),Rt=vue.ref([]);async function $t(an){try{N.patientId&&(J.value=!0,Rt.value=await window.axios.get(window.localhost+`ApplicationCompany/PatientApplications?PatientId=${N.patientId}&Sort=CreateDateApp&Desc=true`,{params:an||{}}).then(yn=>yn.data.map(on=>({...on,AdditionalApp:on.AdditionalApp===!1?"Основная":"Дополнительная",SumPrepapp:on.SumPrepapp.replace(".",","),SumPrepappfinal:on.SumPrepappfinal.replace(".",",")}))))}catch(yn){const on=yn.response?.data?.message||yn.message||"Неизвестная ошибка";notifyError$1(`${on}. Пожалуйста, выполните поиск повторно`,15e3,"Ошибка загрузки данных")}finally{J.value=!1}}const Gt=vue.ref(!1);async function zt(an){let yn=await window.axios.get(window.localhost+`ApplicationCompany/Application?ApplicationId=${an}`).then(on=>on.data).catch(on=>{});return vt.value=yn,yn?(yn.DateClose&&hooks(yn.DateClose).format("YYYY-MM-DD")<hooks().format("YYYY-MM-DD")||yn.Status!="В работе"&&yn.Status!="Заполнение льгот"&&yn.Status!="Проверка"&&yn.Status!="Заявка")&&N.nameApp==="WebBMS"?{status:!0,notify:{type:"warn",message:"Заявка по выбранной потребности закрыта для редактирования",duration:15e3,title:"Доступ для редактирования закрыт"}}:{status:!0,notify:{type:"",message:"",duration:15e3,title:""}}:{status:!1,notify:{type:"error",message:"Заявка по выбранной потребности не найдена",duration:15e3,title:"Ошибка в поиске заявки"}}}function Ht(an){return an.MessageWarning?"#fff6f6":""}async function qt(an,yn,on){if(!an){notifyWarning(on,15e3,"Уведомление системы"),console.log(on);return}yt.value=an;const{status:_n,notify:dn}=await zt(yn);switch(_n&&!dn?.type&&(Gt.value=!0,V.value=!1),_n&&dn?.type==="warn"&&(Gt.value=!0,V.value=!0),dn.type){case"error":notifyError$1(dn.message,dn.duration,dn.title),console.log(`${dn.message} ${dn.duration} ${dn.title}`);break;case"warn":notifyWarning(dn.message,dn.duration,dn.title),console.log(`${dn.message} ${dn.duration} ${dn.title}`);break}}async function Kt(an){"filters"in an&&(an=an.filters),an={...an},Pt.value=Object.keys(an).length>0?an:null,M.value=!0,console.log(Pt.value);try{await $t(Pt.value)}catch(yn){notifyError$1(`Ошибка при загрузке данных:
|
|
1303
|
+
`+vr.message)}finally{Ht.value=!1}}async function ar(io){const vr=await Gt({Snils:io.Snils,BenefitCodeShort:io.BenefitCodeShort},!1);fn.value=vr,Xt.value=io,Kt.value=!0}function Qt(){fn.value=[],Xt.value=null}const Hn={ОНЛС:[null],ВЗН:[null],"Орфанные заболевания":[null],П890:["ALL"],ССЗ:["ALL"],"Паллиативная помощь":["ALL"],"Сахарный диабет":["ALL"],"Дети до трёх лет":["ALL"],"Фонд Круг добра":[null],"Незарег. ЛП.":[null],"НМГ(Беременные)":["ALL"],"НМГ(Дети)":["ALL"],"Хронический Гепатит C":[RKIB_ID]};function tr(io){const vr=Hn[io?.BenefitProgram]?.includes(J.value.LpuId),Uo=Hn[io?.BenefitProgram]?.includes(J.value.UserId),jo=Hn[io?.BenefitProgram]?.includes("ALL")&&dn("registerControl")&&J.value.LpuId!==RKIB_ID,Ur=!Object.keys(Hn).includes(io?.BenefitProgram),Aa=J.value.LpuId===N.dataPatient?.LpuId&&io?.BenefitProgram==="Хронический Гепатит C";if(!$t.value)if(vr||Uo||jo||Ur||Pt||Aa){const{Id:pu,LogDateTime:Ba,PatientBenefitId:sf,...Cf}=io;Xt.value=Cf,dr()}else notifyWarning("У вас нет прав на редактирование данной льготы",15e3,"Ограничено системой");if(typeof N.customRowClickHandler=="function"){N.customRowClickHandler(io);return}}function wr(){Kt.value=!1,tr(fn.value[0])}function Ln(io){if(io?.Deleted)return"#f9c7c8";if(io?.Monetization)return"#f3c77a";let vr=hooks().startOf("day"),Uo=hooks(io.DateIn).startOf("day"),jo=hooks(io.DateOut??"2999-12-12").startOf("day");return!io.DateOut||vr.isBetween(Uo,jo,null,"[]")?"#cbe4cb":"#dedee1"}BenefitProgram(io=>vt.value=io.map(vr=>({...vr,Benefits:JSON.parse(vr.Benefits)}))),BenefitMap(io=>Dt.value=io);const vn=["Snils","Fio","AttachedMo"],Pn=vue.computed(()=>{let io=[{accessor:"Fio",type:"text",name:"Ф.И.О."},{accessor:"ProgramId",type:"select",list:vt.value,name:"Программа"},{accessor:"BenefitCodeShort",type:"select",name:"Код льготы",relation:({values:vr})=>vr?.ProgramId?vt.value.find(Uo=>vr.ProgramId===Uo.Id).Benefits:Dt.value,display:vr=>"("+vr.BenefitCodeShort+") "+vr.BenefitNameLong,idField:"BenefitCodeShort",style:{width:"20rem"}},{accessor:"Snils",type:"text",name:"СНИЛС",mask:"###-###-### ##"},{accessor:"Monetized",type:"select",name:"Монетизация",list:[{Id:"false",Name:"Не монетизированные"},{Id:"true",Name:"Монетизированные"}],placeholder:"Все"},{accessor:"AttachedMo",type:"select",list:M.value,name:"МО прикрепления",style:{width:"15rem"}},{accessor:"Active",type:"select",list:[{Id:"true",Name:"Активные"},{Id:"false",Name:"Неактивные"}],name:"Активность",placeholder:"Все",style:{width:"10rem"}},{accessor:"InMis",type:"select",list:[{Id:"true",Name:"Есть данные"},{Id:"false",Name:"Нет данных"}],name:"Данные пациента в МИС",placeholder:"Все",style:{width:"15rem"}},{accessor:"Deleted",type:"select",placeholder:"Неаннулированные",list:[{Id:"all",Name:"Все"},{Id:"true",Name:"Аннулированные"}],name:"Состояние",style:{width:"15rem"}}];return N.dataPatient.PatientSnils&&(io=io.filter(vr=>!vn.includes(vr.accessor))),V||(io=io.filter(vr=>vr.accessor!=="InMis")),io});vue.watch(()=>N.dataPatient.PatientSnils,()=>{N.dataPatient.PatientSnils&&lr({})},{immediate:!0});const Sn=vue.computed(()=>[{name:"Ф.И.О.",accessor:"PatientFio"},{name:"Дата рождения",display:vr=>hooks(vr.PatientBirthdate).format("DD.MM.YYYY")},{name:"МО прикрепления",accessor:"AttachedMoName"},{name:"Программа",accessor:"BenefitProgram"},{name:"СНИЛС",accessor:"Snils"},{name:"Полис",accessor:"PolicyNumber"},{name:"Страховая компания",accessor:"SmoName",Template:"SmoName"},{name:"Диагноз",accessor:"Ds"},{name:"Код льготы",accessor:"BenefitCodeShort"},{name:"Категория льготности",accessor:"BenefitName",Template:"BenefitName"},{name:"Адрес проживания",accessor:"AddressFact"},{name:"Адрес регистрации",accessor:"AddressReg"},{name:"Монетизирована",accessor:"MonetizationText"},{name:"Дата начала",display:vr=>vr?.DateIn?hooks(vr.DateIn).format("DD.MM.YYYY"):"-"},{name:"Дата конца",display:vr=>vr?.DateOut?hooks(vr.DateOut).format("DD.MM.YYYY"):"-"},{name:"Статус ФРЛЛО",display:vr=>vr?.FrlloStatus?vr.FrlloStatus:"Не выгружен"},{name:"Дата изменения",display:vr=>hooks(vr.LogDateTime).format("DD.MM.YYYY HH:mm:ss")},{name:"Пользователь",display:vr=>(vr.EmployeeLastname||"").trim()+" "+(vr.EmployeeFirstname||"").trim()+" "+(vr.EmployeePatronymic||"").trim()}].filter(vr=>!vr.hidden).map(vr=>({Title:vr.name,Field:typeof vr.display=="function"?vr.display:vr.accessor,Template:vr?.Template}))),Vn=vue.computed(()=>[{name:"Программа",accessor:"BenefitProgram"},{name:"Диагноз",accessor:"Ds"},{name:"Код льготы",accessor:"BenefitCodeShort"},{name:"Категория льготности",accessor:"BenefitName",Template:"BenefitName"},{name:"Монетизирована",accessor:"MonetizationText"},{name:"Дата начала",display:vr=>vr?.DateIn?hooks(vr.DateIn).format("DD.MM.YYYY"):"-"},{name:"Дата конца",display:vr=>vr?.DateOut?hooks(vr.DateOut).format("DD.MM.YYYY"):"-"},{name:"Статус ФРЛЛО",display:vr=>vr?.FrlloStatus?vr.FrlloStatus:"Не выгружен"},{name:"Дата изменения",display:vr=>hooks(vr.LogDateTime).format("DD.MM.YYYY HH:mm:ss")},{name:"Пользователь",display:vr=>(vr.EmployeeLastname||"").trim()+" "+(vr.EmployeeFirstname||"").trim()+" "+(vr.EmployeePatronymic||"").trim()}].filter(vr=>!vr.hidden).map(vr=>({Title:vr.name,Field:typeof vr.display=="function"?vr.display:vr.accessor,Template:vr?.Template})));function dr(){yt.value=!0}function or(io){yt.value=!1,notifyError$1(io)}async function er(){yt.value=!1,await new Promise(io=>setTimeout(io,1e3)),lr(an.value),notifySuccess("Льгота сохранена успешно!")}function sn(){yt.value=!1,lr(an.value),notifySuccess("Льгота аннулирована!")}function mr(){Xt.value=null,dr()}function pr(){At.value=!0}function _r(){return qt.value.filter(io=>io._selected_).map(io=>({Id:io.PatientBenefitId,Snils:io.PatientSnils}))}function jr(){on.value={}}return I({getSelectedRows:_r}),(io,vr)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",_hoisted_1$k,[e.infoOnly?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$g,[vue.createVNode(_sfc_main$z,{"filter-list":Pn.value,onSearch:lr},null,8,["filter-list"])])),vue.createElementVNode("div",_hoisted_3$c,[vr[13]||(vr[13]=vue.createStaticVNode('<div class="flex items-center gap-1"><div class="size-4 rounded" style="background:#f9c7c8;"></div><p>Аннулирована</p></div><div class="flex items-center gap-1"><div class="size-4 rounded" style="background:#f3c77a;"></div><p>Монетизированна</p></div><div class="flex items-center gap-1"><div class="size-4 rounded" style="background:#dedee1;"></div><p>Неактивная</p></div><div class="flex items-center gap-1"><div class="size-4 rounded" style="background:#cbe4cb;"></div><p>Активная</p></div>',4)),dn("getRegister")?(vue.openBlock(),vue.createBlock(vue.unref(P2),{key:0,onClick:bn,"prepend-icon":"download"},{default:vue.withCtx(()=>[...vr[10]||(vr[10]=[vue.createTextVNode("Экспорт в .dbf",-1)])]),_:1})):vue.createCommentVNode("",!0),dn("registerControl")?(vue.openBlock(),vue.createBlock(vue.unref(P2),{key:1,onClick:mr,"prepend-icon":"plus",primary:""},{default:vue.withCtx(()=>[...vr[11]||(vr[11]=[vue.createTextVNode("Добавить льготу",-1)])]),_:1})):vue.createCommentVNode("",!0),vue.unref(Pt)?(vue.openBlock(),vue.createBlock(vue.unref(P2),{key:2,onClick:pr,"prepend-icon":"unlock-keyhole",style:{backgroundColor:"white",color:"rgb(198 28 28 / var(--tw-text-opacity))"}},{default:vue.withCtx(()=>[...vr[12]||(vr[12]=[vue.createTextVNode("Доступ к ССЗ",-1)])]),_:1})):vue.createCommentVNode("",!0)]),vue.createVNode(ReSimpleTable,{"enable-xlsx-export":!0,data:qt.value,columns:$t.value?Sn.value:Vn.value,"page-size":20,"enable-page-size-selector":"","table-id":"benefitsList","context-actions":_n,"row-color":Ln,onRowClicked:tr},{"cell(BenefitName)":vue.withCtx(({record:Uo})=>[vue.createElementVNode("p",{class:"cell-lite",title:Uo?.BenefitName},vue.toDisplayString(Uo?.BenefitName),9,_hoisted_4$b)]),"cell(SmoName)":vue.withCtx(({record:Uo})=>[vue.createElementVNode("p",{class:"cell-lite",title:Uo?.SmoName},vue.toDisplayString(Uo?.SmoName),9,_hoisted_5$a)]),_:1},8,["data","columns"]),qt.value.length>950?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$a,[vue.createElementVNode("p",null,"Показаны первые ~"+vue.toDisplayString(Math.ceil(qt.value.length/1e3)*1e3)+" записей, чтобы найти нужного пациента уточните фильтры",1)])):vue.createCommentVNode("",!0)]),vue.withDirectives(vue.createElementVNode("div",_hoisted_7$9,[...vr[14]||(vr[14]=[vue.createElementVNode("div",{class:"bg-black/60 w-full h-full absolute top-0 left-0 z-[5001]"},null,-1),vue.createElementVNode("div",{class:"bg-white rounded-lg p-4 flex flex-row gap-3 items-center z-[5002]"},[vue.createElementVNode("div",{role:"status"},[vue.createElementVNode("svg",{"aria-hidden":"true",class:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-300 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[vue.createElementVNode("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),vue.createElementVNode("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})])]),vue.createElementVNode("div",null,[vue.createElementVNode("p",{class:"font-bold"},"Обработка данных"),vue.createElementVNode("p",{class:"text-sm text-gray-500"},"Пожалуйста, подождите...")])],-1)])],512),[[vue.vShow,Ht.value]]),vue.createVNode(vue.unref(Ds),{modelValue:Kt.value,"onUpdate:modelValue":vr[0]||(vr[0]=Uo=>Kt.value=Uo),title:`История льготы ${Xt.value?.BenefitCodeShort}`,class:"p-4",size:"7xl",onClose:Qt},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_8$9,[vue.createElementVNode("div",_hoisted_9$7,[vue.unref(Pt)||!V.value?(vue.openBlock(),vue.createBlock(vue.unref(P2),{key:0,onClick:wr,"prepend-icon":"pencil"},{default:vue.withCtx(()=>[...vr[15]||(vr[15]=[vue.createTextVNode("Изменить льготу",-1)])]),_:1})):vue.createCommentVNode("",!0)]),vue.createVNode(ReSimpleTable,{data:fn.value,columns:Vn.value,"page-size":20,"enable-page-size-selector":"","table-id":"benefitsListHistory"},{"cell(BenefitName)":vue.withCtx(({record:Uo})=>[vue.createElementVNode("p",{class:"cell-lite",title:Uo?.BenefitName},vue.toDisplayString(Uo?.BenefitName),9,_hoisted_10$7)]),_:1},8,["data","columns"])])]),_:1},8,["modelValue","title"]),vue.createVNode(vue.unref(Ds),{modelValue:yt.value,"onUpdate:modelValue":vr[1]||(vr[1]=Uo=>yt.value=Uo),title:"Льгота",size:"5xl",class:"p-4"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$v,{snils:Xt.value?.Snils||N.dataPatient.PatientSnils,"user-open":J.value,"patient-open":N.dataPatient,onSave:er,onDelete:sn,onError:or,"edit-benefit":Xt.value,disable:N.infoOnly,permisionLgot:PermissionLgot},null,8,["snils","user-open","patient-open","edit-benefit","disable"])]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(Ds),{modelValue:yn.value,"onUpdate:modelValue":vr[8]||(vr[8]=Uo=>yn.value=Uo),title:"Экспорт .dbf",size:"5xl",class:"p-4"},{default:vue.withCtx(()=>[vue.createElementVNode("form",{class:"flex flex-col gap-4",onSubmit:vue.withModifiers(wn,["prevent"])},[vue.createVNode(vue.unref(IA),{label:"Имя файла",disabled:"",modelValue:on.value.FileName,"onUpdate:modelValue":vr[2]||(vr[2]=Uo=>on.value.FileName=Uo)},null,8,["modelValue"]),vue.createVNode(_sfc_main$F,{required:!on.value.BenefitCodeShort&&!on.value.ProgramName,label:"МО прикрепления",data:M.value,modelValue:on.value.LpuIdPrikrep,"onUpdate:modelValue":vr[3]||(vr[3]=Uo=>on.value.LpuIdPrikrep=Uo),"id-field":"Id","display-expr":Uo=>Uo.Name,clearable:""},null,8,["required","data","modelValue","display-expr"]),vue.createElementVNode("div",_hoisted_11$6,[vue.createElementVNode("div",_hoisted_12$5,[vue.createElementVNode("fieldset",_hoisted_13$4,[vr[16]||(vr[16]=vue.createElementVNode("legend",{class:"px-2 font-semibold text-sm"},"Льгота",-1)),vue.createVNode(_sfc_main$F,{required:!on.value.BenefitCodeShort&&!on.value.LpuIdPrikrep,label:"Программа",data:vt.value,modelValue:on.value.ProgramName,"onUpdate:modelValue":vr[4]||(vr[4]=Uo=>on.value.ProgramName=Uo),"id-field":"Name","display-expr":Uo=>Uo.Name,clearable:""},null,8,["required","data","modelValue","display-expr"]),vue.createVNode(_sfc_main$F,{required:!on.value.ProgramName&&!on.value.LpuIdPrikrep,label:"Код льготы",data:Dt.value,modelValue:on.value.BenefitCodeShort,"onUpdate:modelValue":vr[5]||(vr[5]=Uo=>on.value.BenefitCodeShort=Uo),"id-field":"BenefitCodeShort","display-expr":Uo=>Uo.BenefitCodeShort+" | "+Uo.BenefitNameLong,clearable:"",limit:1e3},null,8,["required","data","modelValue","display-expr"])])]),vue.createElementVNode("div",_hoisted_14$3,[vue.createElementVNode("fieldset",_hoisted_15$3,[vr[17]||(vr[17]=vue.createElementVNode("legend",{class:"px-2 font-semibold text-sm"},"Период активности льготы",-1)),vue.createVNode(_sfc_main$E,{style:{width:"250px"},modelValue:on.value.BenefitStartDate,"onUpdate:modelValue":vr[6]||(vr[6]=Uo=>on.value.BenefitStartDate=Uo),label:"Дата начала",clearable:""},null,8,["modelValue"]),vue.createVNode(_sfc_main$E,{style:{width:"250px"},modelValue:on.value.BenefitEndDate,"onUpdate:modelValue":vr[7]||(vr[7]=Uo=>on.value.BenefitEndDate=Uo),label:"Дата окончания",clearable:""},null,8,["modelValue"])])])]),vue.createElementVNode("div",_hoisted_16$3,[vue.createVNode(vue.unref(P2),{label:"Сбросить фильтры",onClick:jr,delete:"",secondary:"","prepend-icon":"xmark"}),vue.createVNode(vue.unref(P2),{type:"submit","prepend-icon":"download",primary:""},{default:vue.withCtx(()=>[...vr[18]||(vr[18]=[vue.createTextVNode("Экспортировать",-1)])]),_:1})])],32)]),_:1},8,["modelValue"]),vue.createVNode(PermissionLgot,{isAdmin:vue.unref(Pt),visible:At.value,"onUpdate:visible":vr[9]||(vr[9]=Uo=>At.value=Uo)},null,8,["isAdmin","visible"])]))}},listStatuses=["В работе","Заполнение льгот","Проверка","Отправлен в МЗ","Завершен","Заявка","Заявка отправлена в МЗ","Заявка закрыта","Отклонено МЗ"],programToPreparat={"29528611-4db8-4a92-990d-0664eaec37fd":"ONLS","7303e13b-92f3-4f36-a08d-d52080c0ca28":"Cardio","0d3ffdb7-5a18-4efe-9853-a1a09927f415":"VNZ","5bc6620a-1ed6-4a60-a8ed-fa2a5e786150":"Diabetic","b50d16ad-6258-4e72-b8fc-49a5cefaf4ee":"Oraf","3398f155-5168-4c62-8861-5b8da2f191b4":"P890","0ca74c2a-a34b-4c9e-9ced-1565cdc8c067":"CircleGoodness","99b7de3c-52b0-4f65-b9a1-aacd6e47f073":"NMG","408e7c6f-0e70-4964-bc1c-0d3c4892b657":"NMG"},approvedBenefitProgram={"279c0cdc-772f-4f76-984c-2b463a42edd6":"ОНЛС","2b448ae8-4ff9-4fe6-a581-2cab122273b9":"ССЗ","270fefac-9670-4fcb-8c56-b7a422b774ad":"Сахарный диабет","260d15f6-3b69-4646-b551-c88404ca35df":"Орфанные заболевания","87691abf-cc37-49e5-8295-18eb71e9e015":"П890"},noSignPrograms=["29528611-4db8-4a92-990d-0664eaec37fd","7303e13b-92f3-4f36-a08d-d52080c0ca28"],lpusWithDivision=["f6bb8d21-9371-42e8-9406-b592fe2025e7","03032196-cf4b-480d-ab08-706f0eaa89ae","bff70664-565d-4b29-86ab-0cc3285ad156","1314c963-b459-43f4-b082-3b43f11cd7b2","8ac51557-f416-4032-b602-61b0bcf991e7","03bb9b43-b003-4eeb-a451-cb15ca6e28d3","5bd0e29f-6d86-476c-8caa-67f9c20ca243"],_sfc_main$r={__name:"NewMkbSelectBox",props:{mkbId:{type:[String,null]},label:{type:String,default:"Диагноз"},readOnly:{type:Boolean},isValidated:{type:Boolean,default:!1},mkbCode:{type:String,default:""},filterCodes:{type:Array,default:()=>[]},OMC:{type:Boolean,default:null},filterFunction:{type:Function,default:null},filterMkb:{type:Boolean,default:!0}},emits:["getMKBId","getMKBItem","validate"],setup(e,{emit:I}){const N=I;let J=null;const V=e;let M=!0;vue.watch(()=>V.OMC,(zt,Ht)=>{zt!==Ht&&!M&&(Ht?(J=yt.value,yt.value={Id:""},N("getMKBId",{choosedMKB:null}),Rt()):J&&Pt({data:J})),M&&(M=!1)});const vt=vue.ref(!1),yt=vue.ref({Id:""}),At=vue.ref(""),Dt=vue.computed(()=>({_mkb_oplata_param_:V.OMC===null?null:String(!!V.OMC),_mkb_codes_param_:V.filterCodes?.length?V.filterCodes.join(","):null})),Ft=vue.ref({Id:null});function Pt({data:zt}){J=null,At.value="",zt?.Id?(yt.value=zt,N("getMKBId",{choosedMKB:zt.Id}),Rt(zt)):(yt.value={Id:""},N("getMKBId",{choosedMKB:null}),Rt())}function Rt(zt={Id:null}){Ft.value.Id!==zt.Id&&(zt.Id?(N("getMKBItem",{choosedMKB:zt}),Ft.value=zt):(Ft.value={Id:null},N("getMKBItem",{choosedMKB:null})))}function $t(zt,Ht,qt){return V.filterMkb?["J47","E10","M45"].includes(zt.Code)?!0:(zt.Code.indexOf(".")!==-1||Ht.filter(Xt=>Xt.Code.startsWith(zt.Code)&&Xt.Code.length>3).length===0&&(Gt(qt[0])&&qt.length>2||!Gt(qt[0])&&qt.length>1))&&(typeof V.filterFunction!="function"||V.filterFunction(zt))&&(V.mkbCode!==qt||zt.Code===V.mkbCode):!0}function Gt(zt){return new RegExp("^\\p{L}$","u").test(zt)}return vue.watch(()=>V.mkbCode,()=>{V.mkbCode||(yt.value={Id:""},Pt({data:yt.value}))}),vue.watch(()=>V.mkbId,zt=>{zt?yt.value.Id!==zt&&(yt.value={Id:zt}):(yt.value={Id:""},Pt({data:yt.value}))},{immediate:!0}),vue.watch(()=>yt.value,()=>{V.isValidated&&(yt.value?.Id?(N("validate",{isValid:!0}),Rt(yt.value),vt.value=!0):(N("validate",{isValid:!1}),N("getMKBId",{choosedMKB:""}),vt.value=!1))}),(zt,Ht)=>(vue.openBlock(),vue.createBlock(_sfc_main$C,{disabled:V.readOnly,modelValue:yt.value.Id,"onUpdate:modelValue":Ht[0]||(Ht[0]=qt=>yt.value.Id=qt),"display-expr":qt=>"("+qt.Code+") "+qt.Name,"api-string":vue.unref(api$1).Mkb,"api-id":vue.unref(api$1).MkbById,label:V.label,"filter-field":"_search_str_","get-first-from-string":V.mkbCode,"result-filter":$t,params:Dt.value,onOnSelect:Pt,clearable:""},null,8,["disabled","modelValue","display-expr","api-string","api-id","label","get-first-from-string","params"]))}},_sfc_main$q={__name:"SDateInput",props:vue.mergeModels({withHours:{type:Boolean,default:!1},min:{type:Date,default:null},max:{type:Date,default:null}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const I=vue.useModel(e,"modelValue"),N=e;function J(M){return N.min&&hooks(N.min).format("YYYY-MM-DD HH:mm")>=hooks(M).format("YYYY-MM-DD HH:mm")?hooks(N.min).add(1,"minutes").format("YYYY-MM-DD HH:mm"):hooks(M).format("YYYY-MM-DD HH:mm")}function V(M){return M?N.withHours?J(M):M:null}return(M,vt)=>(vue.openBlock(),vue.createBlock(vue.unref(Jc),{format:"",min:e.min,max:e.max,withHours:e.withHours,label:"Дата","model-value":I.value,"onUpdate:modelValue":vt[0]||(vt[0]=yt=>I.value=V(yt))},null,8,["min","max","withHours","model-value"]))}},_hoisted_1$j={class:"p-3"},_hoisted_2$f={class:"w-full h-full absolute top-0 left-0 flex justify-center items-center animate-pulse z-[5000]"},_hoisted_3$b={class:"border p-2 rounded"},_hoisted_4$a={class:"grid grid-cols-2 gap-1"},_hoisted_5$9={class:"border p-2 rounded"},_hoisted_6$9={class:"grid grid-cols-2 gap-1"},_hoisted_7$8={class:"flex gap-3"},_hoisted_8$8={key:2,class:"flex flex-col gap-1"},_hoisted_9$6={class:"text-sm border rounded px-3 py-1 bg-gray-100 text-gray-800 text-balance h-[32px]"},_hoisted_10$6={class:"flex gap-3"},_hoisted_11$5={class:"flex gap-3"},_hoisted_12$4={class:"flex justify-end gap-3"},_sfc_main$p={__name:"ApplicationForm",props:{needId:{type:String,default:null},waitRequest:{type:Boolean,default:!1,required:!0},readOnly:{type:Boolean,default:!1},patientId:{type:String,default:"",required:!0},patientSnils:{type:String,default:"",required:!0},userOpen:{type:Object,default:{},required:!0},selectedApplication:{type:Object,default:{}},modalVisible:{type:Boolean,default:!1},hiddenControl:{type:Object,default:!1}},emits:["onSave","update:waitRequest"],setup(e,{expose:I,emit:N}){const{getBenefitList:J,getBenefitListV2:V}=useBenefit(),M=e,vt=vue.computed(()=>M.userOpen),yt=N,At=vue.ref(null),Dt=vue.ref(!1),Ft=vue.computed({get:()=>M.waitRequest,set:Pn=>yt("update:waitRequest",Pn)}),Pt=vue.computed({get:()=>M.modalVisible,set:Pn=>yt("update:modalVisible",Pn)}),Rt=vue.ref(M.selectedApplication),$t=vue.ref(M.hiddenControl),Gt=vue.ref(M.needId),zt=vue.ref(!0);vue.onMounted(async()=>{try{Ln(),await on(),Tr();const Pn=Object.values(approvedBenefitProgram);Kt.value=M.needId?await J({Snils:M.patientSnils})||[]:(await V({Snils:M.patientSnils,Monetized:!1,Active:!0,Deleted:!1})).filter(Sn=>Pn.includes(Sn.BenefitProgram))||[],await BenefitMap(Sn=>qt.value=Sn.filter(Vn=>Kt.value.map(dr=>dr.BenefitCodeShort).includes(Vn.BenefitCodeShort))),lpusWithDivision.includes(vt.value.LpuId)&&wr(),lr()}catch(Pn){const Sn=Pn.response?.data?.message||Pn.message||"Неизвестная ошибка";notifyError$1(`${Sn}. Пожалуйста, откройте потребность повторно`,15e3,"Ошибка загрузки данных")}finally{vn()}});const Ht=vue.ref([]),qt=vue.ref([]),Kt=vue.ref([]),Xt=vue.ref([]),fn=vue.computed(()=>Xt.value.find(Pn=>Pn.Id===_n.value.TemplatePreparatId)),an=vue.computed(()=>!!fn.value?.Sign),yn=vue.computed(()=>{if(_n.value.ProgramId){let Pn=Xt.value;noSignPrograms.includes(_n.value.ProgramId)&&(Pn=Pn.filter(Vn=>Vn.Sign));let Sn=Object.keys(programToPreparat).find(Vn=>Vn==_n.value.ProgramId);return Sn&&(Pn=Pn.filter(Vn=>Vn[programToPreparat[Sn]])),Pn}});async function on(){Ht.value=await window.axios.get(window.localhost+"PreparatProgram?BaseProgram=true").then(Pn=>Pn.data.Body.filter(Sn=>Sn.BenefitProgramId).map(Sn=>({...Sn,label:Sn.ValidName,Name:Sn.ValidName})))}const _n=vue.ref({DateNeed:new Date,Additional:!0,Interchangeability:!1}),dn=vue.ref(!1);async function xn(){if(At.value.reportValidity()){if(_n.value.NprNumber||_n.value.NprDate?_n.value.Npr=!0:_n.value.Npr=!1,!_n.value.LgotaId){notifyError$1("Льгота не выбрана");return}if(!_n.value.TemplatePreparatId){notifyError$1("Препарат не выбран");return}if(!an.value&&(!_n.value.NumberVK||!_n.value.DateVK)){notifyError$1("Для выбранного препарата требуется заполнить номер и дату ВК");return}if(_n.value.NprNumber&&!_n.value.NprDate){notifyError$1("Заполните дату НПР для указанного номера НПР");return}if(_n.value.NprDate&&!_n.value.NprNumber){notifyError$1("Заполните номер НПР для указанной даты НПР");return}if(!_n.value.ProgramId){notifyError$1("Программа не выбрана");return}if(lpusWithDivision.includes(vt.value.LpuId)&&!_n.value.DivisionId){notifyError$1("Отделение не выбрано");return}dn.value!=!0&&(Ln(),dn.value=!0,_n.value.LpuId=vt.value.LpuId,_n.value.EmployeePostId=vt.value.Id,_n.value.PatientId=M.patientId,_n.value.CountMonth=Number(_n.value.CountMonth),delete _n.value.MkbName,delete _n.value.Mnn,delete _n.value.MaxPriceWithVat,delete _n.value.MkbCode,delete _n.value.FullName,delete _n.value.DivisionName,delete _n.value.EmployeePostFIO,delete _n.value.ApplicationsNumber,delete _n.value.ApplicationsDeleted,delete _n.value.ApplicationsId,delete _n.value.CreateDateTime,delete _n.value.ApplicationsStatus,delete _n.value.ApplicationsComment,await window.axios({url:window.localhost+`ApplicationCompany/PatientNeeds?Id=${_n.value.Id??""}`,method:"post",data:_n.value}).then(async Pn=>{_n.value.Id&&await deleteApp().then(Sn=>{}),_n.value.Id||(_n.value.Id=Pn.data.Id),notifySuccess("Сохранено"),yt("onSave"),dn.value=!1}).catch(Pn=>{Pn.response.data&¬ifyError$1(Pn.response.data),dn.value=!1}).finally(()=>vn()))}}async function bn(){await window.axios.delete(window.localhost+`ApplicationCompany/PatientNeeds?PatientNeedId=${_n.value.Id}`).then(async()=>{await lr(),notifySuccess("Удалено"),Pt.value=!1}).catch(Pn=>{Pn?.response?.data?.Status?notifyError$1(Pn.response.data.Status):notifyError$1("Произошла ошибка при удалении")})}async function wn(){if(!_n.value.LgotaId){notifyError$1("Льгота не выбрана");return}if(!_n.value.TemplatePreparatId){notifyError$1("Препарат не выбран");return}if(an.value&&(!_n.value.NumberVK||!_n.value.DateVK)){notifyError$1("Для выбранного препарата требуется заполнить номер и дату ВК");return}if(_n.value.NprNumber&&!_n.value.NprDate){notifyError$1("Заполните дату НПР для указанного номера НПР");return}if(_n.value.NprDate&&!_n.value.NprNumber){notifyError$1("Заполните номер НПР для указанной даты НПР");return}if(!_n.value.ProgramId){notifyError$1("Программа не выбрана");return}if(lpusWithDivision.includes(vt.value.LpuId)&&!_n.value.DivisionId){notifyError$1("Отделение не выбрано");return}await xn()}async function Tr(){Xt.value=await window.axios.get(window.localhost+"ApplicationCompany/TemplatePreparatList?DocumentId=c3cd9940-000b-4e0f-8050-b82af933f6de&Deleted=false").then(Pn=>Pn.data)}async function lr(){M.needId&&(_n.value=await window.axios.get(window.localhost+`ApplicationCompany/PatientNeeds?Id=${M.needId}`).then(Pn=>Pn.data[0]))}vue.watch(()=>_n.value.LgotaId,Pn=>{if(Pn==null){_n.value.Mkb10Id=null,_n.value.ProgramId=null,_n.value.TemplatePreparatId=null,Dt.value=!1;return}_n.value.ProgramId=Ht.value.find(Vn=>Vn.BenefitProgramId==qt.value.find(dr=>dr.Id==_n.value.LgotaId)?.ProgramId)?.Id;let Sn=Kt.value.find(Vn=>Vn.BenefitCodeShort==qt.value.find(dr=>dr.Id==_n.value.LgotaId)?.BenefitCodeShort)?.MkbId;Sn?(_n.value.Mkb10Id=Sn,Dt.value=!0):M.readOnly||(_n.value.Mkb10Id=null,Dt.value=!1)}),vue.watch([()=>_n.value.TemplatePreparatId,()=>yn.value],()=>{if(!_n.value.ProgramId||!_n.value.TemplatePreparatId)return;const Pn=Xt.value?.find(er=>er.Id===_n.value.TemplatePreparatId),Sn=Ht.value?.find(er=>er.Id===_n.value.ProgramId)?.ProgramName??"Неизвестная программа";let Vn=yn.value,dr=Vn.some(er=>er.Id===_n.value.TemplatePreparatId),or=(Pn?`Неверно выбранный препарат ${Pn.Mnn} ${Pn.FullName}`:"Не найден препарат в справочнике").trimStart().trimEnd();!dr&&Vn.length>0&&(notifyError$1(`${or} для программы ${Sn}`),M.readOnly||notifyWarning("Выберите заново препарат!"),_n.value.TemplatePreparatId=null)}),vue.watch(()=>_n.value.Id,Pn=>{zt.value=!Pn});const ar=vue.computed(()=>_n.value.NumberVK&&_n.value.DateVK);function Qt(Pn){return Pn.CodeOKPD2=="1.2.643.5.1.13.13.99.2.1212"&&Pn.CodeATX=="Лекарственные препараты и специализированные продукты лечебного питания"?Pn.TradeName:""}function Hn(Pn){const Sn=[];return Pn.Mnn&&Sn.push(Pn.Mnn),Pn.FullName&&Sn.push(Pn.FullName),Pn.MaxPriceWithVat&&Sn.push(`(Цена: ${Pn.MaxPriceWithVat??"не указана"})`),Pn.CountInPackage&&Sn.push(`(в уп-ке: ${Pn.CountInPackage??"не указано"})`),Sn.join(" ")}const tr=vue.ref([]);async function wr(){tr.value=await window.axios.get(window.localhost+`Frmo?LpuId=${vt.value.LpuId}&TypeCode=18`).then(Pn=>Pn.data)}async function Ln(){Ft.value=!0,await vue.nextTick()}function vn(){Ft.value=!1}return I({save:xn,edit:wn}),(Pn,Sn)=>(vue.openBlock(),vue.createBlock(vue.unref(Ds),{size:"2xl",title:`${Rt.value?.Additional??_n.value.Additional?"Дополнительная":"Основная"} заявка${Rt.value?.Number?` № ${Rt.value.Number}`:""}`,modelValue:Pt.value,"onUpdate:modelValue":Sn[19]||(Sn[19]=Vn=>Pt.value=Vn)},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$j,[vue.withDirectives(vue.createElementVNode("div",_hoisted_2$f,[...Sn[20]||(Sn[20]=[vue.createElementVNode("div",{class:"bg-black/60 w-full h-full absolute top-0 left-0 z-[5001]"},null,-1),vue.createElementVNode("div",{class:"bg-white rounded-lg p-4 flex flex-row gap-3 items-center z-[5002]"},[vue.createElementVNode("div",{role:"status"},[vue.createElementVNode("svg",{"aria-hidden":"true",class:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-300 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[vue.createElementVNode("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),vue.createElementVNode("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})])]),vue.createElementVNode("div",null,[vue.createElementVNode("p",{class:"font-bold"},"Загрузка данных"),vue.createElementVNode("p",{class:"text-sm text-gray-500"},"Пожалуйста, подождите...")])],-1)])],512),[[vue.vShow,Ft.value]]),vue.createElementVNode("fieldset",null,[vue.createElementVNode("form",{ref_key:"formRef",ref:At,class:"flex flex-col gap-1"},[vt.value.LpuId=="e41d5246-7a49-4b5a-a306-00ef5125d3d8"?(vue.openBlock(),vue.createBlock(vue.unref(Kc),{key:0,label:"Дополнительная заявочная кампания",modelValue:_n.value.Additional,"onUpdate:modelValue":Sn[0]||(Sn[0]=Vn=>_n.value.Additional=Vn)},null,8,["modelValue"])):vue.createCommentVNode("",!0),vue.createVNode(_sfc_main$q,{label:"Дата заявки",modelValue:_n.value.DateNeed,"onUpdate:modelValue":Sn[1]||(Sn[1]=Vn=>_n.value.DateNeed=Vn),disabled:""},null,8,["modelValue"]),vue.createElementVNode("div",_hoisted_3$b,[Sn[21]||(Sn[21]=vue.createElementVNode("p",{class:"font-semibold text-sm"},"ВК",-1)),Sn[22]||(Sn[22]=vue.createElementVNode("hr",null,null,-1)),vue.createElementVNode("div",_hoisted_4$a,[vue.createVNode(vue.unref(IA),{label:"Номер ВК",modelValue:_n.value.NumberVK,"onUpdate:modelValue":Sn[2]||(Sn[2]=Vn=>_n.value.NumberVK=Vn),mask:"00000000000",tokens:"0:\\d:optional",required:!an.value,disabled:M.readOnly},null,8,["modelValue","required","disabled"]),vue.createVNode(_sfc_main$q,{label:"Дата ВК",modelValue:_n.value.DateVK,"onUpdate:modelValue":Sn[3]||(Sn[3]=Vn=>_n.value.DateVK=Vn),required:!an.value,disabled:M.readOnly},null,8,["modelValue","required","disabled"])])]),vue.createElementVNode("div",_hoisted_5$9,[Sn[23]||(Sn[23]=vue.createElementVNode("p",{class:"font-semibold text-sm"},"НПР",-1)),Sn[24]||(Sn[24]=vue.createElementVNode("hr",null,null,-1)),vue.createElementVNode("div",_hoisted_6$9,[vue.createVNode(vue.unref(IA),{label:"Номер НПР",modelValue:_n.value.NprNumber,"onUpdate:modelValue":Sn[4]||(Sn[4]=Vn=>_n.value.NprNumber=Vn),mask:"00000000000",tokens:"0:\\d:optional",required:!!_n.value.NprDate,disabled:M.readOnly},null,8,["modelValue","required","disabled"]),vue.createVNode(_sfc_main$q,{label:"Дата НПР",modelValue:_n.value.NprDate,"onUpdate:modelValue":Sn[5]||(Sn[5]=Vn=>_n.value.NprDate=Vn),required:!!_n.value.NprNumber,disabled:M.readOnly},null,8,["modelValue","required","disabled"])])]),vue.unref(lpusWithDivision).includes(vt.value.LpuId)?(vue.openBlock(),vue.createBlock(_sfc_main$F,{key:1,data:tr.value,label:"Отделение",modelValue:_n.value.DivisionId,"onUpdate:modelValue":Sn[6]||(Sn[6]=Vn=>_n.value.DivisionId=Vn),required:"",clearable:"",disabled:M.readOnly},null,8,["data","modelValue","disabled"])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_7$8,[vue.createVNode(_sfc_main$F,{label:"Льгота",modelValue:_n.value.LgotaId,"onUpdate:modelValue":Sn[7]||(Sn[7]=Vn=>_n.value.LgotaId=Vn),data:qt.value,"display-expr":Vn=>"("+Vn.BenefitCodeShort+") "+Vn.BenefitNameLong,required:"",clearable:"",disabled:!zt.value},null,8,["modelValue","data","display-expr","disabled"]),vue.createVNode(_sfc_main$F,{required:"",label:"Программа",modelValue:_n.value.ProgramId,"onUpdate:modelValue":Sn[8]||(Sn[8]=Vn=>_n.value.ProgramId=Vn),data:Ht.value,disabled:""},null,8,["modelValue","data"])]),vue.createVNode(_sfc_main$x,{required:"",label:"Препарат",modelValue:_n.value.TemplatePreparatId,"onUpdate:modelValue":Sn[9]||(Sn[9]=Vn=>_n.value.TemplatePreparatId=Vn),data:yn.value,"display-expr":Hn,"display-expr-low":Qt,searchByLowField:"",disabled:!_n.value.ProgramId||M.readOnly,clearable:""},null,8,["modelValue","data","disabled"]),ar.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_8$8,[Sn[25]||(Sn[25]=vue.createElementVNode("p",{class:"text-sm font-medium"},"Торговое наименование",-1)),vue.createElementVNode("p",_hoisted_9$6,vue.toDisplayString(Xt.value.find(Vn=>Vn.Id==_n.value.TemplatePreparatId)?.TradeName),1)])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_10$6,[vue.createVNode(vue.unref(Kc),{label:"Взаимозаменяемость",modelValue:_n.value.Interchangeability,"onUpdate:modelValue":Sn[10]||(Sn[10]=Vn=>_n.value.Interchangeability=Vn),disabled:M.readOnly},null,8,["modelValue","disabled"]),vue.createVNode(vue.unref(Kc),{label:"Дополнительная",modelValue:_n.value.Additional,"onUpdate:modelValue":Sn[11]||(Sn[11]=Vn=>_n.value.Additional=Vn),disabled:""},null,8,["modelValue"])]),vue.createVNode(_sfc_main$r,{label:"Диагноз",modelValue:_n.value.Mkb10Id,"onUpdate:modelValue":Sn[12]||(Sn[12]=Vn=>_n.value.Mkb10Id=Vn),required:"",clearable:"",disabled:Dt.value||M.readOnly},null,8,["modelValue","disabled"]),vue.createVNode(vue.unref(y$),{label:"Примечание",modelValue:_n.value.Comment,"onUpdate:modelValue":Sn[13]||(Sn[13]=Vn=>_n.value.Comment=Vn),disabled:M.readOnly},null,8,["modelValue","disabled"]),vue.createElementVNode("div",_hoisted_11$5,[vue.createVNode(vue.unref(IA),{label:"Кол-во упаковок на 1 месяц",mask:"0.99",tokens:"0:\\d:multiple|9:\\d:optional",modelValue:_n.value.CountMonth,"onUpdate:modelValue":Sn[14]||(Sn[14]=Vn=>_n.value.CountMonth=Vn),disabled:M.readOnly},null,8,["modelValue","disabled"]),vue.createVNode(vue.unref(g$),{label:"Кол-во упаковок на 1 год",min:1,modelValue:_n.value.CountYear,"onUpdate:modelValue":Sn[15]||(Sn[15]=Vn=>_n.value.CountYear=Vn),disabled:M.readOnly},null,8,["modelValue","disabled"])])],512)])])]),footer:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_12$4,[Gt.value&&!$t.value?(vue.openBlock(),vue.createBlock(vue.unref(P2),{key:0,delete:"",onClick:Sn[16]||(Sn[16]=Vn=>bn(Gt.value)),disabled:!Pn.deleteAccess||e.readOnly,loading:Ft.value},{default:vue.withCtx(()=>[...Sn[26]||(Sn[26]=[vue.createTextVNode("Удалить",-1)])]),_:1},8,["disabled","loading"])):vue.createCommentVNode("",!0),$t.value?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(P2),{key:1,primary:"",onClick:Sn[17]||(Sn[17]=Vn=>Gt.value?wn():xn()),loading:Ft.value,disabled:e.readOnly},{default:vue.withCtx(()=>[...Sn[27]||(Sn[27]=[vue.createTextVNode("Сохранить",-1)])]),_:1},8,["loading","disabled"])),vue.createVNode(vue.unref(P2),{onClick:Sn[18]||(Sn[18]=Vn=>Pt.value=!1)},{default:vue.withCtx(()=>[...Sn[28]||(Sn[28]=[vue.createTextVNode("Закрыть",-1)])]),_:1})])]),_:1},8,["title","modelValue"]))}},_hoisted_1$i=["id"],_hoisted_2$e={key:0,class:"flex justify-end mb-1 flex-none"},_hoisted_3$a={class:"min-h-0 overflow-hidden"},_hoisted_4$9={class:"re-table"},_hoisted_5$8={key:0,class:"text-right"},_hoisted_6$8={class:"flex flex-col"},_hoisted_7$7=["onClick"],_hoisted_8$7={class:"flex flex-col gap-0.5 w-[600px]"},_hoisted_9$5={class:"text-sm text-slate-500 text-center"},_hoisted_10$5={open:"",class:"px-1"},_hoisted_11$4={class:"px-1"},_hoisted_12$3={class:"rs-table-btn"},_hoisted_13$3={class:"flex justify-between items-center text-sm text-slate-500 gap-1"},_hoisted_14$2={class:"flex flex-col gap-1"},_hoisted_15$2=["onClick"],_hoisted_16$2={class:"px-1"},_hoisted_17$2=["onClick"],_hoisted_18$2=["onDblclick"],_hoisted_19$2={key:1},_hoisted_20$2=["onContextmenu","onClick"],_hoisted_21$2={key:0,class:"text-right"},_hoisted_22$1=["onClick","title"],_hoisted_23$1={key:0},_hoisted_24$1={key:1},_hoisted_25$1=["title"],_hoisted_26$1=["title"],_hoisted_27$1={key:1},_hoisted_28$1=["onClick"],_hoisted_29$1={key:0},_hoisted_30$1={key:0,class:"bg-slate-100 hover:bg-slate-100 cursor-arrow"},_hoisted_31$1={key:0},_hoisted_32$1={key:1},_hoisted_33$1={key:1},_hoisted_34$1={key:0},_hoisted_35={class:"mb-3"},_hoisted_36={class:"border rounded p-3 bg-gray-50"},_hoisted_37=["onDragstart","onDrop"],_hoisted_38={class:"flex items-center gap-2"},_hoisted_39={class:"text-sm font-medium"},_hoisted_40={class:"flex items-center gap-1"},_hoisted_41=["onClick"],_hoisted_42=["onClick"],_hoisted_43={class:"flex justify-end gap-2"},_hoisted_44={class:"flex-none pagination-wrapper"},_hoisted_45={class:"flex items-center gap-4"},_hoisted_46={key:0,class:"pagination"},_hoisted_47=["onClick"],_hoisted_48={key:1,class:"flex items-center gap-2"},_hoisted_49={class:"text-sm text-slate-400"},STORAGE_KEY_ALL_HIDDEN="table_hidden_columns",STORAGE_KEY_ALL_WIDTHS="table_column_widths",STORAGE_KEY_PAGE_SIZE="table_page_size",STORAGE_KEY_COLUMN_ORDER="table_column_order",_sfc_main$o={__name:"ReSimpleTableAppCompany",props:vue.mergeModels({striped:{type:Boolean,default:!1},columns:{type:Array,default:()=>[]},growOnlyX:{type:Boolean,default:!1},data:{type:Array,default:()=>[]},pageSize:{type:Number,default:999},rowActions:{type:Array,default:()=>[]},rowColor:{type:Function,default:()=>{}},enableXlsxExport:{type:Boolean,default:!1},contextActions:{type:Array,default:()=>[]},rowHorizontal:{type:Boolean,default:!1},tableClass:{type:String,default:""},customPagination:{type:Boolean,default:!1},recordTotal:{type:Number,default:0},tableId:{type:String,required:!0},stickyHeader:{type:Boolean,default:!1},wheelPropagation:{type:Boolean,default:!0},numbering:{type:Boolean,default:!1},enablePageSizeSelector:{type:Boolean,default:!1},footer:{type:Boolean,default:!1},height:{type:String}},{sortDirection:{local:!0,default:null},sortDirectionModifiers:{},sortColumnIndex:{local:!0,default:null},sortColumnIndexModifiers:{},page:{local:!0,default:1},pageModifiers:{}}),emits:vue.mergeModels(["rowClicked","cellClicked"],["update:sortDirection","update:sortColumnIndex","update:page"]),setup(e,{expose:I,emit:N}){const J=N,V=vue.ref({}),M=e,vt=vue.useModel(e,"sortDirection"),yt=vue.useModel(e,"sortColumnIndex"),At=vue.ref(""),Dt=vue.ref({}),Ft=vue.ref({}),Pt=vue.ref({}),Rt=vue.ref(!1),$t=vue.ref([]),Gt=vue.ref(null),zt=vue.ref(M.pageSize);vue.watch(()=>M.pageSize,()=>{zt.value=M.pageSize},{immediate:!0});function Ht(){try{const Ir=JSON.parse(localStorage.getItem(STORAGE_KEY_ALL_HIDDEN)||"{}"),Fr=JSON.parse(localStorage.getItem(STORAGE_KEY_ALL_WIDTHS)||"{}"),Fa=JSON.parse(localStorage.getItem(STORAGE_KEY_COLUMN_ORDER)||"{}");Ir[M.tableId]&&(wn.value=Ir[M.tableId]),Fr[M.tableId]&&(on.value=Fr[M.tableId],Kt()),Fa[M.tableId]&&yd(Fa[M.tableId])}catch(Ir){console.error("Ошибка при загрузке состояния таблицы:",Ir)}}function qt(){try{const Ir=JSON.parse(localStorage.getItem(STORAGE_KEY_ALL_HIDDEN)||"{}"),Fr=JSON.parse(localStorage.getItem(STORAGE_KEY_ALL_WIDTHS)||"{}"),Fa=JSON.parse(localStorage.getItem(STORAGE_KEY_PAGE_SIZE)||"{}"),fs=JSON.parse(localStorage.getItem(STORAGE_KEY_COLUMN_ORDER)||"{}");Object.keys(wn.value).length?Ir[M.tableId]=wn.value:delete Ir[M.tableId],Object.keys(on.value).length?Fr[M.tableId]=on.value:delete Fr[M.tableId],Fa[M.tableId]=zt.value,$t.value.length>0?fs[M.tableId]=$t.value.map(eu=>eu.originalIndex):delete fs[M.tableId],localStorage.setItem(STORAGE_KEY_ALL_HIDDEN,JSON.stringify(Ir)),localStorage.setItem(STORAGE_KEY_ALL_WIDTHS,JSON.stringify(Fr)),localStorage.setItem(STORAGE_KEY_PAGE_SIZE,JSON.stringify(Fa)),localStorage.setItem(STORAGE_KEY_COLUMN_ORDER,JSON.stringify(fs))}catch(Ir){console.error("Ошибка при сохранении состояния таблицы:",Ir)}}async function Kt(){if(await vue.nextTick(),!M.tableId){console.log("Не указан идентификатор таблицы",M.columns),notifyError$1("Не указан идентификатор таблицы");return}const Ir=document.getElementById(`table-${M.tableId}`);if(!Ir)return;const Fr=Ir.querySelector(".re-table");if(!Fr)return;const Fa=Fr.querySelectorAll("thead th");Object.entries(on.value).forEach(([fs,eu])=>{const ga=Fa[parseInt(fs)];ga&&eu&&(ga.style.width=`${eu}px`,ga.style.minWidth=`${eu}px`)})}vue.onMounted(()=>{Aa(),Ht(),document.addEventListener("click",jr),document.addEventListener("keydown",io)});const Xt=vue.useModel(e,"page"),fn=vue.ref(!1),an=vue.ref({x:"0px",y:"0px"}),yn=vue.ref(null),on=vue.ref({});let _n=!1,dn=null,xn=0,bn=0;const wn=vue.ref({}),Tr=vue.ref(!1);let lr=vue.ref(null);function ar(Ir){_n=!0,dn=Ir.target.parentElement,xn=Ir.pageX,bn=dn.offsetWidth,document.addEventListener("mousemove",Qt),document.addEventListener("mouseup",Hn),Ir.preventDefault()}function Qt(Ir){if(!_n)return;const Fr=bn+(Ir.pageX-xn);if(Fr>=50){dn.style.width=`${Fr}px`,dn.style.minWidth=`${Fr}px`;const Fa=document.getElementById(`table-${M.tableId}`);if(!Fa)return;const fs=Fa.querySelector(".re-table");if(!fs)return;const eu=fs.querySelectorAll("thead th"),ga=Array.from(eu).indexOf(dn);ga!==-1&&(on.value[ga]=Fr,qt())}}function Hn(){_n=!1,document.removeEventListener("mousemove",Qt),document.removeEventListener("mouseup",Hn)}function tr(Ir){const Fr=document.getElementById(`table-${M.tableId}`);if(!Fr)return;const Fa=Fr.querySelector(".re-table");if(!Fa)return;const eu=Fa.querySelectorAll("thead th")[Ir];eu&&(eu.style.width="",eu.style.minWidth="120px",delete on.value[Ir],qt())}vue.onUnmounted(()=>{document.removeEventListener("mousemove",Qt),document.removeEventListener("mouseup",Hn),document.removeEventListener("click",jr),qt()});const wr=vue.computed(()=>{let Ir=[...M.data];for(const Fr in V.value)V.value[Fr]&&(typeof Ln.value[Fr]?.Field=="function"?Ir=Ir.filter(Fa=>String(Ln.value[Fr].Field(Fa))?.toLowerCase().indexOf(V.value[Fr]?.toLowerCase())>-1):Ir=Ir.filter(Fa=>String(Fa[Ln.value[Fr].Field])?.toLowerCase().indexOf(V.value[Fr]?.toLowerCase())>-1));for(const Fr in Dt.value)Dt.value[Fr]&&(Ir=Ir.filter(Fa=>typeof Ln.value[Fr]?.Field=="function"?Dt.value[Fr].includes(Ln.value[Fr].Field(Fa)):Dt.value[Fr].includes(Fa[Ln.value[Fr].Field])));for(const Fr in Pt.value)Pt.value[Fr]&&(Ir=Ir.filter(Fa=>{let fs;return typeof Ln.value[Fr]?.Field=="function"?fs=Ln.value[Fr].Field(Fa):fs=Fa[Ln.value[Fr].Field],fs==null||fs===""||typeof fs=="string"&&fs.trim()===""}));return yt.value>=0&&vt.value&&(Ir=Ir.sort((Fr,Fa)=>typeof Ln.value[yt.value].Field=="function"?typeof Ln.value[yt.value].SortMethod=="function"?Ln.value[yt.value].SortMethod(Fr,Fa):String(Ln.value[yt.value].Field(Fr))>String(Ln.value[yt.value].Field(Fa))?1:-1:typeof Ln.value[yt.value].SortMethod=="function"?Ln.value[yt.value].SortMethod(Fr,Fa):String(Fr[Ln.value[yt.value].Field])>String(Fa[Ln.value[yt.value].Field])?1:-1),vt.value==="desc"&&(Ir=Ir.reverse())),Ir}),Ln=vue.computed(()=>{let Ir=M.columns.filter(Fr=>!wn.value[Fr.Index]);return $t.value.length>0&&(Ir=$t.value.map(Fr=>Ir.find((Fa,fs)=>fs===Fr.originalIndex))),Ir}),vn=vue.computed(()=>M.contextActions.filter(Ir=>typeof Ir.IsVisible=="function"?Ir.IsVisible(yn.value):!0)),Pn=vue.computed(()=>{if(M.customPagination)return M.data;const Ir=(Xt.value-1)*parseInt(zt.value);return wr.value.slice(Ir,Ir+parseInt(zt.value))}),Sn=vue.computed(()=>M.customPagination?Math.ceil(M.recordTotal/parseInt(zt.value)):Math.ceil(wr.value.length/parseInt(zt.value))),Vn=vue.computed(()=>Sn.value>5?Xt.value<=3?[1,2,3,4,5,"...",Sn.value]:Xt.value>=Sn.value-2?[1,"...",Sn.value-4,Sn.value-3,Sn.value-2,Sn.value-1,Sn.value]:[1,"...",Xt.value-2,Xt.value-1,Xt.value,Xt.value+1,Xt.value+2,"...",Sn.value]:Array.from({length:Sn.value},(Ir,Fr)=>Fr+1)),dr=vue.computed(()=>M.customPagination?M.recordTotal:wr.value.length);vue.watch(()=>M.data,()=>{M.customPagination||(Xt.value=1,Aa())}),vue.watch(()=>Ln.value,(Ir,Fr)=>{(!Fr||Ir.length!==Fr.length||!Ir.every((Fa,fs)=>Fa.Title===Fr[fs].Title))&&(V.value={},wn.value={},on.value={},qt(),Aa(),vr(null,null),Dt.value={},Pt.value={})},{deep:!0}),vue.watch(()=>wr.value.length,()=>{M.customPagination||(Xt.value=1)}),vue.watch(zt,()=>{Xt.value=1,qt()});function or(){if(wr.value.length===0){notifyError$1("Нет данных для экспорта");return}let Ir=[{sheet:"Лист 1",columns:M.columns.map(Fa=>({label:Fa.Title,value:fs=>{let eu="";return typeof Fa.Field=="function"?eu=Fa.Field(fs):eu=fs[Fa.Field],Fa.LowField&&(typeof Fa.LowField=="function"?eu+=` (${Fa.LowField(fs)})`:fs[Fa.LowField]&&(eu+=` (${fs[Fa.LowField]})`)),eu}})),content:wr.value}],Fr={fileName:"Выгрузка данных от "+hooks().format("L HH:mm:ss"),extraLength:3,writeMode:"writeFile"};xlsx(Ir,Fr)}function er(Ir,Fr){an.value={x:Ir.pageX+"px",y:Ir.pageY+"px"},yn.value=Fr,fn.value=!0}function sn(){yn.value=null,fn.value=!1}function mr(Ir,Fr){if(Tr.value){_r();return}an.value={x:Ir.pageX,y:Ir.pageY},lr.value=Fr,Tr.value=!0,fn.value=!1}function pr(Ir){if(!wn.value[Ir]&&Ln.value.length-Object.values(wn.value).filter(Boolean).length<=1){notifyError$1("Должен быть виден хотя бы один столбец");return}wn.value[Ir]=!wn.value[Ir],qt()}function _r(){Tr.value=!1,lr.value=null}function jr(Ir){const Fr=document.getElementById("headerContextMenuId");Fr&&!Fr.contains(Ir.target)&&!Ir.target.closest(".header-filter-activator")&&_r()}function io(Ir){Ir.key==="Escape"&&Tr.value&&_r()}function vr(Ir,Fr){yt.value===Ir&&vt.value===Fr?(yt.value=null,vt.value=null):(yt.value=Ir,vt.value=Fr)}function Uo(Ir){return yt.value===Ir||V.value[Ir]||Dt.value[Ir]?.length>0||Pt.value[Ir]}function jo(){wn.value={},qt()}function Ur(Ir){let Fr=Dt.value[lr.value]||[];Fr.includes(Ir)?Fr=Fr.filter(Fa=>Fa!==Ir):Fr.push(Ir),Dt.value[lr.value]=Fr,Fr.length===0&&delete Dt.value[lr.value]}function Aa(){Ft.value={},Ln.value.forEach((Ir,Fr)=>{Ft.value[Fr]=[],M.data.forEach(Fa=>{let fs=Ft.value[Fr]||[];typeof Ir.Field=="function"?fs.push(Ir.Field(Fa)):fs.push(Fa[Ir.Field]),Ft.value[Fr]=fs}),Ft.value[Fr]=[...new Set(Ft.value[Fr])],Ft.value[Fr].sort()})}function pu(Ir){if(!Ft.value[Ir])return[];let Fr=[...Ft.value[Ir]];return Fr=Fr.filter(Fa=>Fa&&String(Fa).toLowerCase().includes(At.value)),Fr}function Ba(Ir){Dt.value[Ir]=Ft.value[Ir]}function sf(Ir){Pt.value[Ir]=!Pt.value[Ir],Pt.value[Ir]||delete Pt.value[Ir]}function Cf(Ir){let Fr=!1;fn.value&&(sn(),Fr=!0),Tr.value&&(_r(),Fr=!0),!Fr&&J("rowClicked",Ir)}function hl(){($t.value.length>0?$t.value:null)||($t.value=Ln.value.map((Fr,Fa)=>({originalIndex:Fa,displayIndex:Fa,title:Fr.Title}))),Rt.value=!0,_r()}function Bf(){Rt.value=!1}function Ka(Ir,Fr){Gt.value=Fr,Ir.dataTransfer.effectAllowed="move"}function Tu(Ir,Fr){if(Gt.value===null||Gt.value===Fr)return;const Fa=$t.value[Gt.value],fs=[...$t.value];fs.splice(Gt.value,1),fs.splice(Fr,0,Fa),fs.forEach((eu,ga)=>{eu.displayIndex=ga}),$t.value=fs,Gt.value=null}function Bo(Ir,Fr){if(Fr==="up"&&Ir>0){const Fa=$t.value[Ir];$t.value[Ir]=$t.value[Ir-1],$t.value[Ir-1]=Fa,$t.value[Ir].displayIndex=Ir,$t.value[Ir-1].displayIndex=Ir-1}else if(Fr==="down"&&Ir<$t.value.length-1){const Fa=$t.value[Ir];$t.value[Ir]=$t.value[Ir+1],$t.value[Ir+1]=Fa,$t.value[Ir].displayIndex=Ir,$t.value[Ir+1].displayIndex=Ir+1}}function qo(){$t.value=M.columns.map((Ir,Fr)=>({originalIndex:Fr,displayIndex:Fr,title:Ir.Title}))}function af(){const Ir=$t.value.map(Fr=>Fr.originalIndex);try{const Fr=JSON.parse(localStorage.getItem(STORAGE_KEY_COLUMN_ORDER)||"{}");Fr[M.tableId]=Ir,localStorage.setItem(STORAGE_KEY_COLUMN_ORDER,JSON.stringify(Fr))}catch(Fr){console.error("Ошибка при сохранении порядка столбцов:",Fr)}Bf()}function yd(Ir){if(!Ir||!Array.isArray(Ir))return;const Fr=Ir.filter(Fa=>Fa>=0&&Fa<M.columns.length);Fr.length===M.columns.length&&($t.value=Fr.map((Fa,fs)=>({originalIndex:Fa,displayIndex:fs,title:M.columns[Fa].Title})))}return I({exportToXlsx:or,filteredData:wr,showOnlyEmpty:Pt,filterByValue:Dt,filterOption:V,saveTableState:qt}),(Ir,Fr)=>{const Fa=vue.resolveComponent("PerfectScrollbar");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{style:vue.normalizeStyle({height:M.height}),class:"flex flex-col",id:"table-"+M.tableId},[M.enableXlsxExport?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$e,[vue.createVNode(vue.unref(P2),{onClick:or,prependIcon:"file-arrow-down"},{default:vue.withCtx(()=>[...Fr[11]||(Fr[11]=[vue.createTextVNode("Экспорт в Excel",-1)])]),_:1})])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_3$a,[vue.createVNode(Fa,{class:vue.normalizeClass(["h-full pb-4",M.tableClass]),options:{wheelPropagation:M.wheelPropagation}},{default:vue.withCtx(()=>[vue.createElementVNode("table",_hoisted_4$9,[vue.createElementVNode("thead",{class:vue.normalizeClass({sticky:M.stickyHeader})},[vue.createElementVNode("tr",null,[M.numbering?(vue.openBlock(),vue.createElementBlock("th",_hoisted_5$8,"№")):vue.createCommentVNode("",!0),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ln.value,(fs,eu)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("th",{class:"min-w-[120px] relative",key:fs.Title},[vue.createVNode(vue.unref(kt),{shown:Tr.value&&vue.unref(lr)!==null&&eu===vue.unref(lr),triggers:[],autoHide:!1,noAutoFocus:""},{popper:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_8$7,[vue.createElementVNode("p",_hoisted_9$5,vue.toDisplayString(Ln.value[vue.unref(lr)]?.Title),1),vue.createVNode(vue.unref(Iv1)),vue.createElementVNode("p",{class:vue.normalizeClass(["rs-table-btn",{"!font-bold !text-slate-500 !bg-slate-200":yt.value===vue.unref(lr)&&vt.value==="asc"}]),onClick:Fr[0]||(Fr[0]=ga=>vr(vue.unref(lr),"asc"))}," Сортировать А > Я ",2),vue.createElementVNode("p",{class:vue.normalizeClass(["rs-table-btn",{"!font-bold !text-slate-500 !bg-slate-200":yt.value===vue.unref(lr)&&vt.value==="desc"}]),onClick:Fr[1]||(Fr[1]=ga=>vr(vue.unref(lr),"desc"))}," Сортировать Я > А ",2),vue.createVNode(vue.unref(Iv1)),vue.createElementVNode("details",_hoisted_10$5,[Fr[12]||(Fr[12]=vue.createElementVNode("summary",{class:"rs-table-btn"},"Поиск по значению",-1)),vue.createVNode(vue.unref(IA),{type:"text",placeholder:"Введите значение",modelValue:V.value[vue.unref(lr)],"onUpdate:modelValue":Fr[2]||(Fr[2]=ga=>V.value[vue.unref(lr)]=ga),modelModifiers:{lazy:!0}},null,8,["modelValue"])]),vue.createElementVNode("details",_hoisted_11$4,[vue.createElementVNode("summary",_hoisted_12$3,[Fr[13]||(Fr[13]=vue.createTextVNode(" Фильтр по значению ",-1)),Dt.value[vue.unref(lr)]?.length>0?(vue.openBlock(),vue.createBlock(vue.unref(Z1),{key:0,name:"circle-exclamation"})):vue.createCommentVNode("",!0)]),vue.createVNode(vue.unref(IA),{placeholder:"Введите значение",modelValue:At.value,"onUpdate:modelValue":Fr[3]||(Fr[3]=ga=>At.value=ga)},null,8,["modelValue"]),vue.createElementVNode("div",_hoisted_13$3,[vue.createElementVNode("p",null," Показано "+vue.toDisplayString(Dt.value[vue.unref(lr)]?.length?Dt.value[vue.unref(lr)].length:Ft.value[vue.unref(lr)]?.length)+" из "+vue.toDisplayString(Ft.value[vue.unref(lr)]?.length),1),vue.createElementVNode("p",{class:"cursor-pointer hover:text-slate-700 hover:underline",onClick:Fr[4]||(Fr[4]=ga=>Ba(vue.unref(lr)))},"Все"),vue.createElementVNode("p",{class:"cursor-pointer hover:text-slate-700 hover:underline",onClick:Fr[5]||(Fr[5]=ga=>delete Dt.value[vue.unref(lr)])}," Сбросить ")]),vue.createVNode(Fa,{class:"max-h-[300px] max-w-[600px]"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_14$2,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(pu(vue.unref(lr)),ga=>(vue.openBlock(),vue.createElementBlock("div",{key:ga,class:"flex gap-1 select-none cursor-pointer hover:bg-slate-100 rounded",onClick:Xo=>Ur(ga)},[vue.createVNode(vue.unref(Kc),{checked:Dt.value[vue.unref(lr)]?.includes(ga)},null,8,["checked"]),vue.createElementVNode("p",null,vue.toDisplayString(ga||"(пусто)"),1)],8,_hoisted_15$2))),128))])]),_:1})]),vue.createElementVNode("details",_hoisted_16$2,[Fr[14]||(Fr[14]=vue.createElementVNode("summary",{class:"rs-table-btn"},"Скрыть столбец",-1)),vue.createElementVNode("p",{class:"text-sm text-slate-500 text-center cursor-pointer hover:text-slate-700 hover:bg-slate-100 rounded",onClick:jo}," Показать все "),vue.createVNode(Fa,{class:"max-h-[300px] overflow-y-auto"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ln.value,(ga,Xo)=>(vue.openBlock(),vue.createElementBlock("div",{key:ga.Title,class:"flex items-center gap-1 px-2 py-1 hover:bg-slate-100 cursor-pointer",onClick:Da=>pr(Xo)},[vue.createVNode(vue.unref(Z1),{class:"text-slate-500",name:wn.value[Xo]?"square":"check-square"},null,8,["name"]),vue.createElementVNode("span",null,vue.toDisplayString(ga.Title),1)],8,_hoisted_17$2))),128))]),_:2},1024)]),vue.createVNode(vue.unref(Iv1)),vue.createElementVNode("p",{class:vue.normalizeClass(["rs-table-btn",{"!font-bold !text-slate-500 !bg-slate-200":Pt.value[vue.unref(lr)]}]),onClick:Fr[6]||(Fr[6]=ga=>sf(vue.unref(lr)))}," Показать только пустые ",2),vue.createVNode(vue.unref(Iv1)),vue.createElementVNode("p",{class:"rs-table-btn",onClick:hl},"Изменить порядок столбцов")])]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_6$8,[vue.createElementVNode("div",{onClick:ga=>fs.filterable!=!1?mr(ga,eu):null,class:"flex flex-row justify-between items-center gap-1 hover:cursor-pointer hover:bg-slate-200 rounded px-2 py-1 header-filter-activator"},[vue.createElementVNode("p",{class:vue.normalizeClass({"whitespace-nowrap":M.growOnlyX})},vue.toDisplayString(fs.Title),3),fs.filterable!=!1?(vue.openBlock(),vue.createBlock(vue.unref(Z1),{key:0,name:"filter",class:vue.normalizeClass([{activeFilter:Uo(eu)},"text-slate-500"])},null,8,["class"])):vue.createCommentVNode("",!0)],8,_hoisted_7$7)])]),_:2},1032,["shown"]),vue.createElementVNode("div",{class:"column-resizer",onMousedown:Fr[7]||(Fr[7]=ga=>ar(ga)),onDblclick:ga=>tr(eu)},null,40,_hoisted_18$2)])),[[vue.vShow,!wn.value[eu]]])),128)),M.rowActions.length?(vue.openBlock(),vue.createElementBlock("th",_hoisted_19$2,[...Fr[15]||(Fr[15]=[vue.createElementVNode("p",null,"Действия",-1)])])):vue.createCommentVNode("",!0)])],2),vue.createElementVNode("tbody",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Pn.value,(fs,eu)=>(vue.openBlock(),vue.createElementBlock("tr",{class:vue.normalizeClass({"even:bg-slate-50":M.striped}),onContextmenu:vue.withModifiers(ga=>er(ga,fs),["right","prevent"]),onClick:ga=>Cf(fs),key:fs,style:vue.normalizeStyle({backgroundColor:fn.value&&yn.value===fs?"rgba(0, 0, 0, 0.05)":"",backgroundColor:e.rowColor(fs)})},[M.numbering?(vue.openBlock(),vue.createElementBlock("td",_hoisted_21$2,vue.toDisplayString(Xt.value*parseInt(zt.value)-parseInt(zt.value)+1+eu),1)):vue.createCommentVNode("",!0),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ln.value,(ga,Xo)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("td",{key:ga.Title,class:vue.normalizeClass(["hover:bg-slate-200",typeof ga.Class=="function"?ga.Class(fs):ga.Class]),onClick:Da=>J("cellClicked",{record:fs,column:ga,index:Xo}),title:typeof ga.titleOnHover=="function"?ga.titleOnHover(fs):ga.titleOnHover},[ga.Template?(vue.openBlock(),vue.createElementBlock("div",_hoisted_23$1,[vue.renderSlot(Ir.$slots,`cell(${ga.Template})`,{record:fs},void 0,!0)])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_24$1,[vue.createElementVNode("p",{class:vue.normalizeClass(["primary-text",{"whitespace-nowrap":M.growOnlyX}]),title:typeof ga.Field=="function"?ga.Field(fs):fs[ga.Field]},vue.toDisplayString(typeof ga.Field=="function"?ga.Field(fs):fs[ga.Field]),11,_hoisted_25$1),vue.createElementVNode("p",{class:vue.normalizeClass(["secondary-text",{"whitespace-nowrap":M.growOnlyX}]),title:typeof ga.LowField=="function"?ga.LowField(fs):fs[ga.LowField]},vue.toDisplayString(typeof ga.LowField=="function"?ga.LowField(fs):fs[ga.LowField]),11,_hoisted_26$1)]))],10,_hoisted_22$1)),[[vue.vShow,!wn.value[Xo]]])),128)),M.rowActions.length?(vue.openBlock(),vue.createElementBlock("td",_hoisted_27$1,[vue.createElementVNode("div",{class:vue.normalizeClass(["flex flex-col items-start",{horizontalAction:M.rowHorizontal}])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(M.rowActions,ga=>(vue.openBlock(),vue.createElementBlock("span",{class:"rowAction whitespace-nowrap",onClick:vue.withModifiers(Xo=>ga.Action(fs),["stop"]),key:ga},[typeof ga.IsVisible!="function"||ga.IsVisible(fs)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_29$1,[ga.Icon?(vue.openBlock(),vue.createBlock(vue.unref(Z1),{key:0,name:ga.Icon},null,8,["name"])):vue.createCommentVNode("",!0),vue.createTextVNode(" "+vue.toDisplayString(ga.Name),1)])):vue.createCommentVNode("",!0)],8,_hoisted_28$1))),128))],2)])):vue.createCommentVNode("",!0)],46,_hoisted_20$2))),128)),M.footer?(vue.openBlock(),vue.createElementBlock("tr",_hoisted_30$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ln.value,(fs,eu)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("td",{key:fs.Title},[typeof fs.Footer=="function"?(vue.openBlock(),vue.createElementBlock("p",_hoisted_31$1,vue.toDisplayString(fs.Footer(Ir.row)),1)):(vue.openBlock(),vue.createElementBlock("p",_hoisted_32$1,vue.toDisplayString(fs.Footer),1))])),[[vue.vShow,!wn.value[eu]]])),128))])):vue.createCommentVNode("",!0),dr.value?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("tr",_hoisted_33$1,[...Fr[16]||(Fr[16]=[vue.createElementVNode("td",{colspan:"100",class:"text-center"},[vue.createElementVNode("p",{class:"text-xl text-slate-400 font-semibold"},"Данные отсутствуют")],-1)])]))])])]),_:3},8,["class","options"])]),fn.value?(vue.openBlock(),vue.createElementBlock("div",{id:"contextMenuId",class:"context-menu",key:an.value,style:vue.normalizeStyle({top:an.value.y,left:an.value.x})},[vue.createVNode(vue.unref(dz1),{spacing:"xs"},{default:vue.withCtx(()=>[vn.value.length?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("p",_hoisted_34$1,"Нет доступных действий контекстного меню")),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vn.value,fs=>(vue.openBlock(),vue.createBlock(vue.unref(P2),{key:fs,prependIcon:fs.Icon,onClick:eu=>(fs.Action(yn.value),sn())},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(fs.Name),1)]),_:2},1032,["prependIcon","onClick"]))),128))]),_:1})],4)):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(Ds),{title:"Изменение порядка столбцов",modelValue:Rt.value,"onUpdate:modelValue":Fr[9]||(Fr[9]=fs=>Rt.value=fs),closeOnClickOutside:!0,class:"p-2"},{footer:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_43,[vue.createVNode(vue.unref(P2),{onClick:qo,variant:"outline",size:"sm"},{default:vue.withCtx(()=>[...Fr[18]||(Fr[18]=[vue.createTextVNode("Сбросить",-1)])]),_:1}),vue.createVNode(vue.unref(P2),{onClick:af,size:"sm"},{default:vue.withCtx(()=>[...Fr[19]||(Fr[19]=[vue.createTextVNode("Сохранить",-1)])]),_:1})])]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_35,[Fr[17]||(Fr[17]=vue.createElementVNode("p",{class:"text-sm text-gray-600 mb-2"},"Перетащите столбцы для изменения их порядка:",-1)),vue.createElementVNode("div",_hoisted_36,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList($t.value,(fs,eu)=>(vue.openBlock(),vue.createElementBlock("div",{key:fs.originalIndex,class:"flex items-center justify-between p-2 mb-1 bg-white rounded border cursor-move hover:bg-gray-50",draggable:"true",onDragstart:ga=>Ka(ga,eu),onDragover:Fr[8]||(Fr[8]=vue.withModifiers(()=>{},["prevent"])),onDrop:ga=>Tu(ga,eu)},[vue.createElementVNode("div",_hoisted_38,[vue.createVNode(vue.unref(Z1),{name:"grip-vertical",class:"text-gray-400 text-sm"}),vue.createElementVNode("span",_hoisted_39,vue.toDisplayString(fs.title),1)]),vue.createElementVNode("div",_hoisted_40,[eu>0?(vue.openBlock(),vue.createElementBlock("button",{key:0,onClick:ga=>Bo(eu,"up"),class:"p-1 hover:bg-gray-200 rounded text-xs",title:"Переместить вверх"},[vue.createVNode(vue.unref(Z1),{name:"chevron-up",class:"text-gray-500"})],8,_hoisted_41)):vue.createCommentVNode("",!0),eu<$t.value.length-1?(vue.openBlock(),vue.createElementBlock("button",{key:1,onClick:ga=>Bo(eu,"down"),class:"p-1 hover:bg-gray-200 rounded text-xs",title:"Переместить вниз"},[vue.createVNode(vue.unref(Z1),{name:"chevron-down",class:"text-gray-500"})],8,_hoisted_42)):vue.createCommentVNode("",!0)])],40,_hoisted_37))),128))])])]),_:1},8,["modelValue"])],12,_hoisted_1$i),vue.createElementVNode("div",_hoisted_44,[vue.createElementVNode("div",_hoisted_45,[Sn.value>1?(vue.openBlock(),vue.createElementBlock("ul",_hoisted_46,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Vn.value,fs=>(vue.openBlock(),vue.createElementBlock("li",{key:fs,class:vue.normalizeClass({active:fs===Xt.value}),onClick:eu=>fs!=="..."?Xt.value=fs:null},[vue.createElementVNode("a",null,vue.toDisplayString(fs),1)],10,_hoisted_47))),128))])):vue.createCommentVNode("",!0),M.enablePageSizeSelector?(vue.openBlock(),vue.createElementBlock("div",_hoisted_48,[Fr[21]||(Fr[21]=vue.createElementVNode("span",{class:"text-sm text-slate-500"},"Показать:",-1)),vue.withDirectives(vue.createElementVNode("select",{"onUpdate:modelValue":Fr[10]||(Fr[10]=fs=>zt.value=fs),class:"text-sm border rounded px-1 py-0.5 w-[60px] border-slate-300"},[...Fr[20]||(Fr[20]=[vue.createElementVNode("option",{value:"5"},"5",-1),vue.createElementVNode("option",{value:"10"},"10",-1),vue.createElementVNode("option",{value:"20"},"20",-1),vue.createElementVNode("option",{value:"100"},"100",-1)])],512),[[vue.vModelSelect,zt.value]])])):vue.createCommentVNode("",!0)]),vue.createElementVNode("p",_hoisted_49," Записи "+vue.toDisplayString(Xt.value*parseInt(zt.value)-parseInt(zt.value)+1)+"-"+vue.toDisplayString(Math.min(Xt.value*parseInt(zt.value),dr.value))+" из "+vue.toDisplayString(dr.value),1)])],64)}}},ReSimpleTableAppCompany=_export_sfc(_sfc_main$o,[["__scopeId","data-v-6c0b94b1"]]),_hoisted_1$h={class:"w-full h-full absolute top-0 left-0 flex justify-center items-center animate-pulse z-[5000]"},_hoisted_2$d={class:"border rounded p-2 bg-slate-100"},_hoisted_3$9={class:"h-full flex flex-col p-3 gap-3"},_sfc_main$n={__name:"PatientInfoPageAppCompany",props:{patientId:{type:String,default:"",required:!0},patientSnils:{type:String,default:"",required:!0},nameApp:{type:String,default:""}},setup(e){const I=vue.computed(()=>useUserStore().user),N=e,J=vue.ref(!1),V=vue.ref(!1),M=vue.ref(!1),vt=vue.ref(null),yt=vue.ref(null),At=[{Name:"Просмотр",Icon:"eye",Action:an=>qt(an.NeedsId,an.ApplicationId,an.MessageWarning)}],Dt=vue.computed(()=>{const an=hooks().year(),yn=2025,on=an+1,_n=[];for(let dn=yn;dn<=on;dn++)_n.push({Id:dn.toString(),Name:dn.toString()});return _n}),Ft=vue.computed(()=>{const an=[];for(let yn=0;yn<=listStatuses.length;yn++)an.push({Id:listStatuses[yn],Name:listStatuses[yn]});return an});vue.onMounted(()=>{$t(null)});const Pt=vue.ref(null),Rt=vue.ref([]);async function $t(an){try{N.patientId&&(J.value=!0,Rt.value=await window.axios.get(window.localhost+`ApplicationCompany/PatientApplications?PatientId=${N.patientId}&Sort=CreateDateApp&Desc=true`,{params:an||{}}).then(yn=>yn.data.map(on=>({...on,AdditionalApp:on.AdditionalApp===!1?"Основная":"Дополнительная",SumPrepapp:on.SumPrepapp.replace(".",","),SumPrepappfinal:on.SumPrepappfinal.replace(".",",")}))))}catch(yn){const on=yn.response?.data?.message||yn.message||"Неизвестная ошибка";notifyError$1(`${on}. Пожалуйста, выполните поиск повторно`,15e3,"Ошибка загрузки данных")}finally{J.value=!1}}const Gt=vue.ref(!1);async function zt(an){let yn=await window.axios.get(window.localhost+`ApplicationCompany/Application?ApplicationId=${an}`).then(on=>on.data).catch(on=>{});return vt.value=yn,yn?(yn.DateClose&&hooks(yn.DateClose).format("YYYY-MM-DD")<hooks().format("YYYY-MM-DD")||yn.Status!="В работе"&&yn.Status!="Заполнение льгот"&&yn.Status!="Проверка"&&yn.Status!="Заявка")&&N.nameApp==="WebBMS"?{status:!0,notify:{type:"warn",message:"Заявка по выбранной потребности закрыта для редактирования",duration:15e3,title:"Доступ для редактирования закрыт"}}:{status:!0,notify:{type:"",message:"",duration:15e3,title:""}}:{status:!1,notify:{type:"error",message:"Заявка по выбранной потребности не найдена",duration:15e3,title:"Ошибка в поиске заявки"}}}function Ht(an){return an.MessageWarning?"#fff6f6":""}async function qt(an,yn,on){if(!an){notifyWarning(on,15e3,"Уведомление системы"),console.log(on);return}yt.value=an;const{status:_n,notify:dn}=await zt(yn);switch(_n&&!dn?.type&&(Gt.value=!0,V.value=!1),_n&&dn?.type==="warn"&&(Gt.value=!0,V.value=!0),dn.type){case"error":notifyError$1(dn.message,dn.duration,dn.title),console.log(`${dn.message} ${dn.duration} ${dn.title}`);break;case"warn":notifyWarning(dn.message,dn.duration,dn.title),console.log(`${dn.message} ${dn.duration} ${dn.title}`);break}}async function Kt(an){"filters"in an&&(an=an.filters),an={...an},Pt.value=Object.keys(an).length>0?an:null,M.value=!0,console.log(Pt.value);try{await $t(Pt.value)}catch(yn){notifyError$1(`Ошибка при загрузке данных:
|
|
1304
1304
|
`+yn.message)}finally{M.value=!1}}const Xt=[{name:"Наличие потребности в карте пациента",type:"select",accessor:"IsNeed",list:[{Id:"IsCreate",Name:"Да"},{Id:"IsNotCreate",Name:"Нет"}]},{name:"Статус потребности",type:"select",accessor:"Status",list:Ft.value},{name:"Период",type:"select",accessor:"Period",list:Dt.value},{name:"Заявка",type:"select",accessor:"Additional",list:[{Id:!0,Name:"Допонительная"},{Id:!1,Name:"Основная"}]}],fn=[{Title:"№",Field:"ApplicationNumber",SortMethod:(an,yn)=>{const on=parseInt(an.ApplicationNumber,10),_n=parseInt(yn.ApplicationNumber,10);return on-_n}},{Title:"Заявка",Field:"AdditionalApp"},{Title:"Дата создания",Field:an=>an.CreateDateTimeApp?hooks(an.CreateDateTimeApp).format("DD.MM.YYYY"):""},{Title:"Дата закрытия",Field:an=>an.DateCloseApp?hooks(an.DateCloseApp).format("DD.MM.YYYY"):""},{Title:"Статус",Field:"StatusApp",Class:"whitespace-nowrap"},{Title:"Комментарий к заявке",Field:"CommentApp",Class:"min-w-[300px] max-w-[300px] break-all"},{Title:"Период",Field:"Period",SortMethod:(an,yn)=>{const on=parseInt(an.Period,10),_n=parseInt(yn.Period,10);return on-_n}},{Title:"ЛПУ",Field:"LpuName",Class:"whitespace-nowrap"},{Title:"Отделение",Field:"DivisionName"},{Title:"Программа",Field:"Program"},{Title:"Категория",Field:"LgotaCode",SortMethod:(an,yn)=>{const on=parseInt(an.LgotaCode,10)||0,_n=parseInt(yn.LgotaCode,10)||0;return on-_n}},{Title:"Заболевание по МКБ-10",Field:"MkbCode"},{Title:"Номер ВК",Field:"NumberVk",SortMethod:(an,yn)=>{const on=parseInt(an.NumberVk,10)||0,_n=parseInt(yn.NumberVk,10)||0;return on-_n}},{Title:"Дата ВК",Field:an=>an.DateVk?hooks(an.DateVk).format("DD.MM.YYYY"):""},{Title:"Наличие НПР в потребности",Field:an=>an.PnNpr?"Да":"Нет"},{Title:"Номер НПР в потребности",Field:"PnNprNumber",SortMethod:(an,yn)=>{const on=parseInt(an.PnNprNumber,10)||0,_n=parseInt(yn.PnNprNumber,10)||0;return on-_n}},{Title:"Дата НПР в потребности",Field:an=>an.PnNprDate?hooks(an.PnNprDate).format("DD.MM.YYYY"):""},{Title:"МНН",Field:"Mnn",Class:"min-w-[300px] max-w-[300px] break-all"},{Title:"Торговое наименование",Field:"TradeName",Class:"min-w-[300px] max-w-[300px] break-all"},{Title:"Описание",Field:"Description",Class:"min-w-[300px] max-w-[300px] break-all"},{Title:"Дозировка",Field:"Dosage",Class:"min-w-[300px] max-w-[300px] break-all"},{Title:"ЖВ",Field:an=>an.Sign?"Да":"Нет"},{Title:"Взаимозаменяемость",Field:an=>an.Interchangeability?"Да":"Нет"},{Title:"Кто создал/редактировал потребность",Field:"PnEmployeePostFIO"},{Title:"Количество упаковок на месяц",Field:"CountMonth",SortMethod:(an,yn)=>{const on=parseInt(an.CountMonth,10)||0,_n=parseInt(yn.CountMonth,10)||0;return on-_n}},{Title:"Количество упаковок на год",Field:"CountYear",SortMethod:(an,yn)=>{const on=parseInt(an.CountYear,10)||0,_n=parseInt(yn.CountYear,10)||0;return on-_n}},{Title:"Количество упаковок в сводной потребности на год",Field:"CountPrepapp",SortMethod:(an,yn)=>{const on=parseInt(an.CountPrepapp,10)||0,_n=parseInt(yn.CountPrepapp,10)||0;return on-_n}},{Title:"Сумма в сводной потребности на год",Field:"SumPrepapp",SortMethod:(an,yn)=>{const on=parseFloat(an.SumPrepapp,10)||0,_n=parseFloat(yn.SumPrepapp,10)||0;return on-_n}},{Title:"Количество упаковок в сводной заявке на год",Field:"CountPrepappfinal",SortMethod:(an,yn)=>{const on=parseInt(an.CountPrepappfinal,10)||0,_n=parseInt(yn.CountPrepappfinal,10)||0;return on-_n}},{Title:"Сумма в сводной заявке на год",Field:"SumPrepappfinal",SortMethod:(an,yn)=>{const on=parseFloat(an.SumPrepappfinal,10)||0,_n=parseFloat(yn.SumPrepappfinal,10)||0;return on-_n}},{Title:"Примечание",Field:"MessageWarning",Class:"whitespace-nowrap"}];return(an,yn)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.withDirectives(vue.createElementVNode("div",_hoisted_1$h,[...yn[3]||(yn[3]=[vue.createElementVNode("div",{class:"bg-black/60 w-full h-full absolute top-0 left-0 z-[5001]"},null,-1),vue.createElementVNode("div",{class:"bg-white rounded-lg p-4 flex flex-row gap-3 items-center z-[5002]"},[vue.createElementVNode("div",{role:"status"},[vue.createElementVNode("svg",{"aria-hidden":"true",class:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-300 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[vue.createElementVNode("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),vue.createElementVNode("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})])]),vue.createElementVNode("div",null,[vue.createElementVNode("p",{class:"font-bold"},"Обработка данных"),vue.createElementVNode("p",{class:"text-sm text-gray-500"},"Пожалуйста, подождите...")])],-1)])],512),[[vue.vShow,J.value]]),vue.createElementVNode("div",_hoisted_2$d,[vue.createVNode(_sfc_main$z,{"filter-list":Xt,onSearch:Kt,class:"flex justify-end"})]),vue.createElementVNode("div",_hoisted_3$9,[yn[4]||(yn[4]=vue.createElementVNode("div",{class:"flex items-center gap-1"},[vue.createElementVNode("p",{class:"text-xs"},"Примечание:"),vue.createElementVNode("div",{class:"flex px-2 text-xs h-7 items-center",style:{background:"#fff0f0"}},"Потребность в карте пациента отсутствует, но имеется в своде")],-1)),vue.createVNode(ReSimpleTableAppCompany,{ref:"refTableAppCompany","enable-xlsx-export":!0,data:Rt.value,columns:fn,"page-size":20,"enable-page-size-selector":"","table-id":"appsList","context-actions":At,rowColor:Ht,height:"calc(100vh - 560px)","sticky-header":"true"},null,8,["data"])]),Gt.value?(vue.openBlock(),vue.createBlock(_sfc_main$p,{key:0,"user-open":I.value,"patient-id":N.patientId,"patient-snils":N.patientSnils,"selected-application":vt.value,"need-id":yt.value,"read-only":V.value||!0,"hidden-control":!0,"modal-visible":Gt.value,"onUpdate:modalVisible":yn[0]||(yn[0]=on=>Gt.value=on),"wait-request":M.value,"onUpdate:waitRequest":yn[1]||(yn[1]=on=>M.value=on),onOnSave:yn[2]||(yn[2]=on=>($t(),Gt.value=!1,yt.value=null,vt.value=null))},null,8,["user-open","patient-id","patient-snils","selected-application","need-id","read-only","modal-visible","wait-request"])):vue.createCommentVNode("",!0)],64))}},_hoisted_1$g={class:"grid grid-cols-2 gap-4 p-4"},_hoisted_2$c={class:"flex flex-col gap-2"},_hoisted_3$8={class:"flex items-center gap-2"},_hoisted_4$8={class:"flex items-center gap-2"},_hoisted_5$7={class:"flex items-center gap-2"},_hoisted_6$7={class:"flex flex-col gap-2"},_hoisted_7$6={class:"flex items-center gap-2"},_hoisted_8$6={class:"flex items-center gap-2"},_hoisted_9$4={class:"flex items-center gap-2"},_hoisted_10$4={class:"col-span-2 flex flex-col gap-2"},_hoisted_11$3={class:"flex items-center gap-2"},_hoisted_12$2={class:"flex items-center gap-2"},_hoisted_13$2={class:"border-t border-gray-200 mt-4 pt-4"},_sfc_main$m={__name:"PatientInfoComponent",props:{user:{type:Object,default:{},required:!0},patient:{type:Object,required:!0},infoOnly:{type:Boolean,default:!1},nameProject:{type:String,default:"",required:!0}},setup(e){const I=e;return(N,J)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(Wv1),{grow:"","keep-mounted":""},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(Uv1),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(Gv1),null,{default:vue.withCtx(()=>[...J[0]||(J[0]=[vue.createElementVNode("h2",null,"Данные пациента",-1)])]),_:1}),I.infoOnly?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(Gv1),{key:0},{default:vue.withCtx(()=>[...J[1]||(J[1]=[vue.createElementVNode("h2",null,"Заявочная кампания",-1)])]),_:1}))]),_:1}),vue.createVNode(vue.unref(Yv1),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(Xv1),null,{default:vue.withCtx(()=>[vue.createElementVNode("div",null,[vue.createElementVNode("div",_hoisted_1$g,[vue.createElementVNode("div",_hoisted_2$c,[vue.createElementVNode("div",_hoisted_3$8,[J[2]||(J[2]=vue.createElementVNode("span",{class:"font-medium text-gray-600"},"ФИО:",-1)),vue.createElementVNode("span",null,vue.toDisplayString(I.patient.PatientFio),1)]),vue.createElementVNode("div",_hoisted_4$8,[J[3]||(J[3]=vue.createElementVNode("span",{class:"font-medium text-gray-600"},"СНИЛС:",-1)),vue.createElementVNode("span",null,vue.toDisplayString(I.patient.PatientSnils),1)]),vue.createElementVNode("div",_hoisted_5$7,[J[4]||(J[4]=vue.createElementVNode("span",{class:"font-medium text-gray-600"},"Дата рождения:",-1)),vue.createElementVNode("span",null,vue.toDisplayString(vue.unref(hooks)(I.patient.PatientBirthdate).format("DD.MM.YYYY")),1)])]),vue.createElementVNode("div",_hoisted_6$7,[vue.createElementVNode("div",_hoisted_7$6,[J[5]||(J[5]=vue.createElementVNode("span",{class:"font-medium text-gray-600"},"Полис:",-1)),vue.createElementVNode("span",null,vue.toDisplayString(I.patient.PolicyNumber),1)]),vue.createElementVNode("div",_hoisted_8$6,[J[6]||(J[6]=vue.createElementVNode("span",{class:"font-medium text-gray-600"},"СМО:",-1)),vue.createElementVNode("span",null,vue.toDisplayString(I.patient.SmoName),1)]),vue.createElementVNode("div",_hoisted_9$4,[J[7]||(J[7]=vue.createElementVNode("span",{class:"font-medium text-gray-600"},"Прикрепление:",-1)),vue.createElementVNode("span",null,vue.toDisplayString(I.patient.AttachedMoName),1)])]),vue.createElementVNode("div",_hoisted_10$4,[vue.createElementVNode("div",_hoisted_11$3,[J[8]||(J[8]=vue.createElementVNode("span",{class:"font-medium text-gray-600"},"Адрес регистрации:",-1)),vue.createElementVNode("span",null,vue.toDisplayString(I.patient.AddressReg),1)]),vue.createElementVNode("div",_hoisted_12$2,[J[9]||(J[9]=vue.createElementVNode("span",{class:"font-medium text-gray-600"},"Адрес фактический:",-1)),vue.createElementVNode("span",null,vue.toDisplayString(I.patient.AddressFact),1)])])]),vue.createElementVNode("div",_hoisted_13$2,[J[10]||(J[10]=vue.createElementVNode("h3",{class:"text-lg font-medium text-gray-900 mb-4"}," Льготы пациента ",-1)),vue.createVNode(_sfc_main$s,{"data-patient":I.patient,"name-project":I.nameProject,"user-open":e.user},null,8,["data-patient","name-project","user-open"])])])]),_:1}),I.infoOnly?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(Xv1),{key:0},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$n,{"patient-id":I.patient.PatientId,"patient-snils":I.patient.PatientSnils},null,8,["patient-id","patient-snils"])]),_:1}))]),_:1})]),_:1})]))}};var Mode=(e=>(e[e.DELAY=0]="DELAY",e[e.INTERVAL=1]="INTERVAL",e[e.INTERVAL_BLOCK=2]="INTERVAL_BLOCK",e))(Mode||{});const hz=class hz{constructor(I,N,J){this.action=I,this.milliseconds=N,this.mode=J,this.currentTimerId=null,this.needRepeat=null,this.init()}init(){switch(this.mode){case 0:this.repeat=()=>{console.warn(this.mode+" mode has no repeat function!")},this.start=I=>{this.currentTimerId===null?this.currentTimerId=Number(setTimeout(()=>this.action(I),this.milliseconds)):(clearTimeout(this.currentTimerId),this.currentTimerId=Number(setTimeout(()=>this.action(I),this.milliseconds)))};break;case 1:this.repeat=()=>{this.needRepeat?(this.action(),this.needRepeat=!1,this.currentTimerId=Number(setTimeout(this.repeat,this.milliseconds))):this.needRepeat=null},this.start=()=>{this.needRepeat===null?(this.needRepeat=!0,this.repeat()):this.needRepeat===!1&&(this.needRepeat=!0)};break;case 2:this.repeat=()=>{console.warn(this.mode+" mode has no repeat function!")},this.start=()=>{this.currentTimerId===null&&(this.action(),this.currentTimerId=Number(setTimeout(()=>{this.currentTimerId=null},this.milliseconds)))};break;default:console.error("internal error! invalid mode for ActionLimiter!")}}stop(){clearTimeout(this.currentTimerId),this.currentTimerId=null}};hz.MODE=Mode;let ActionLimiter=hz;const DEFAULT_TYPE$1="string",TYPES=["string","boolean","number","date"],defaultMethods$1={"=":{compare:(e,I,N="string")=>N==="date"?e.isSame(I):e===I,types:TYPES,icon:"equals"},"!=":{compare:(e,I,N="string")=>N==="date"?!e.isSame(I):e!==I,types:TYPES,icon:"not-equal"},">":{compare:(e,I,N="string")=>N==="date"?e.isBefore(I):e>I,types:["number","date"],icon:"greater-than"},">=":{compare:(e,I,N="string")=>N==="date"?e.isSameOrBefore(I):e>=I,types:["number","date"],icon:"greater-than-equal"},"<":{compare:(e,I,N="string")=>N==="date"?e.isAfter(I):e<I,types:["number","date"],icon:"less-than"},"<=":{compare:(e,I,N="string")=>N==="date"?e.isSameOrAfter(I):e<=I,types:["number","date"],icon:"less-than-equal"},include:{compare:(e,I)=>I?String(I).toLowerCase().includes(e.toLowerCase()):!1,types:["string"],icon:"t"},exclude:{compare:(e,I)=>I?!String(I).toLowerCase().includes(e.toLowerCase()):!0,types:["string"],icon:"text-slash"}},types$1={string:{method:"include",value:""},number:{method:"=",value:null},boolean:{method:"=",value:!1},date:{method:"=",value:""}};function getFilterValue$1(e){return e in types$1?types$1[e].value:types$1[DEFAULT_TYPE$1].value}function getFilterMethod$1(e){return e in types$1?types$1[e].method:types$1[DEFAULT_TYPE$1].method}function getMethodIcon$1(e){return e in defaultMethods$1?defaultMethods$1[e].icon:"question"}function getFilter$1(e){return{method:getFilterMethod$1(e),value:getFilterValue$1(e)}}function getMethodsForType$1(e){if(typeof e=="string"&&TYPES.includes(e)){let I=[];for(let N in defaultMethods$1)defaultMethods$1[N].types.includes(e)&&I.push(N);return I}else{let I=new Error('Невозможно получить список методов сравнения для неопределённого типа: "'+e+'"');throw console.error(I),I}}function compare$1(e,I,N="string"){let J=e.value,V=I;if(N==="date"&&(J=hooks(hooks(J).format("YYYY-MM-DD")),V=hooks(hooks(V).format("YYYY-MM-DD"))),e?.method&&e.method in defaultMethods$1)if(e?.value??!1)try{return defaultMethods$1[e.method].compare(J,V,N)}catch(M){throw new Error(`Не удалось сравнить данные для фильтрации.
|
|
1305
1305
|
`+J+`
|
|
1306
1306
|
`+V+`
|