1import{_ as B}from"./DIdJ3plM.js";import{_ as M,u as L}from"./CUpk7FNn.js";import{_ as R}from"./DhhkyHwl.js";import{f as H,g as U,h as E,r as p,i as f,o as r,c as u,a as o,b as x,w as b,ag as O,k as a,l as $,q as v,x as y,y as j,F as q,j as G,z as I,t as m,d as h,ah as J}from"./DyNFu711.js";import{u as K}from"./BRNlkNsu.js";import{u as Q}from"./DkOUL9A9.js";import{u as W}from"./DmGGPJ1V.js";import{u as X}from"./BtRnkTGe.js";import"./C8KKOoSk.js";import"./BcSw_gwq.js";import"./Dx6q48Bo.js";import"./CyoQxZyk.js";const Y={class:"bg-white p-6"},Z={class:"flex flex-col m-6"},ee={class:"mb-4"},te=["value"],oe={class:"mb-4"},ae={key:0,class:"text-red-ancom text-sm"},se={class:"mb-4"},ne={class:"px-3 py-2 border border-[#CCCCCC] focus:outline-none w-1/2 text-gray-700 text-sm bg-[#F9F9F9]"},re={class:"mb-4"},ie={class:"px-3 py-2 border border-[#CCCCCC] focus:outline-none w-1/2 text-gray-700 text-sm bg-[#F9F9F9]"},le={key:0},ue={key:1},ze=H({__name:"index",async setup(pe){let i,l;const c=K(),z=U();Q({title:"SSCPDS PersoanÄ autorizatÄ",ogTitle:"SSCPDS PersoanÄ autorizatÄ",description:"SSCPDS PersoanÄ autorizatÄ",ogDescription:"SSCPDS PersoanÄ autorizatÄ"});const w=E(),{change:S,get:k}=W(),{getAllCatalogue:P}=X(),{getHelpContextual:N}=L(),_=p();let s=p({});const g=p(!1),d=p({nume:null}),C=p([]);[i,l]=f(()=>P().then(t=>{C.value=t}).catch(t=>{c.add({title:"Nu s-au putut citi reprezentanÈii legali."}),console.log(t)})),await i,l(),[i,l]=f(()=>k(w.params.id).then(t=>{s.value=t}).catch(t=>{c.add({title:"Nu s-a putut citi persoana autorizatÄ."}),console.log(t)})),await i,l(),[i,l]=f(()=>N("persoana_autorizata_modifica").then(t=>{_.value=t}).catch(t=>{console.log(t)})),await i,l();const D=async t=>{F()&&(g.value=!0,await S(s.value).then(e=>{c.add({title:"Persoana autorizatÄ a fost modificatÄ.",color:"green"}),J(z("/admin/persoane-autorizate"))}).catch(e=>{c.add({title:"Nu s-a putut modifica persoana autorizatÄ."}),console.log(e)}),g.value=!1)},F=()=>{d.value={nume:null};let t=!1;return s.value.properties.nume_prenume||(d.value.nume="Numele Èi prenumele sunt obligatorii.",t=!0),!t};return(t,e)=>{const A=B,T=M,V=R;return r(),u("div",null,[o("div",Y,[x(A,null,{default:b(()=>e[2]||(e[2]=[h("ModificÄ persoanÄ autorizatÄ")])),_:1})]),o("div",Z,[o("form",{onSubmit:O(D,["prevent"]),class:"bg-white p-8"},[a(_)?(r(),$(T,{key:0,html:a(_),class:"mb-4"},null,8,["html"])):v("",!0),o("div",ee,[e[3]||(e[3]=o("label",{for:"reprezentant_legal",class:"block text-gray-700 text-sm mb-2"}," Reprezentant legal ",-1)),y(o("select",{name:"reprezentant_legal","onUpdate:modelValue":e[0]||(e[0]=n=>a(s).properties.id_furnizor_persoana_parinte=n),class:"px-3 py-2 border border-[#CCCCCC] focus:outline-none w-1/2 text-gray-700 text-sm bg-white"},[(r(!0),u(q,null,G(a(C),n=>(r(),u("option",{key:n.key,value:n.key},m(n.nume_prenume)+" - "+m(n.cnp),9,te))),128))],512),[[j,a(s).properties.id_furnizor_persoana_parinte]])]),o("div",oe,[e[4]||(e[4]=o("label",{for:"nume_prenume",class:"block text-gray-700 text-sm mb-2"},"Nume Èi prenume",-1)),y(o("input",{"onUpdate:modelValue":e[1]||(e[1]=n=>a(s).properties.nume_prenume=n),name:"nume_prenume",class:"px-3 py-2 border border-[#CCCCCC] focus:outline-none w-1/2 text-gray-700 text-sm bg-white"},null,512),[[I,a(s).properties.nume_prenume]]),a(d).nume?(r(),u("div",ae,m(a(d).nume),1)):v("",!0)]),o("div",se,[e[5]||(e[5]=o("p",{class:"block text-gray-700 text-sm mb-2"},"CetÄÅ£enie RomânÄ",-1)),o("p",ne,m(a(s).properties.cetatenie_romana?"DA":"NU"),1)]),o("div",re,[e[6]||(e[6]=o("p",{class:"block text-gray-700 text-sm mb-2"},"Cod Numeric Personal",-1)),o("p",ie,[a(s).properties.cnp?(r(),u("span",le,m(a(s).properties.cnp),1)):(r(),u("span",ue,"-"))])]),o("div",null,[x(V,{submit:!0,loading:a(g),class:"w-32"},{default:b(()=>e[7]||(e[7]=[h(" SalveazÄ ")])),_:1},8,["loading"])])],32)])])}}});export{ze as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.