import{j as e,r as f,m as h,W as S,h as y,o as N,O as l,K as D}from"./index-7722cded.js";import{L as C}from"./PictureAsPdf-a0aef435.js";import{r as F}from"./DatosDom-6f0f3839.js";import{C as v}from"./MoreVert-88a310d0.js";import"./Close-24c851c2.js";import"./DialogContentText-8fb92df8.js";const L=a=>{const{ejecutarAdministraWf:m,paramsProceso:b,isFirstTarea:n,mode:i,tarActual:s,dataPrc:u}=a,c=a.dataPrc;return c?e(A,{paramsProceso:b,solInfo:c,ejecutarAdministraWf:m,isFirstTarea:n,mode:i,tarActual:s,dataPrc:u}):e(C,{})},A=a=>{const{ejecutarAdministraWf:m,paramsProceso:b,tarActual:n}=a,i=a.dataPrc;f.useEffect(()=>{h.getData(i,["sol"]).then(o=>{o.sol!==void 0&&(t("SolNumDoc",o.sol.SolNumDoc),t("SolNumDoc",o.sol.SolNumDoc),t("SolCuit",o.sol.SolCuit),t("SolSex",o.sol.SolSex),t("SolNom",o.sol.SolNom),t("SolApe",o.sol.SolApe),t("SolFchNac",o.sol.SolFchNac),t("SolNivEst",o.sol.SolNivEst),t("SolNac",o.sol.SolNac),t("SolEstCiv",o.sol.SolEstCiv))}).catch(o=>{S.error("Error al buscar datos"),console.error(o)})},[]);const s={id:"DmnAbr",name:"SolSex",text:"DmnDet",tabla:"dmn",where:"DmnFilt = 'TIPSEX'",type:"supercombobox"},u={id:"DmnAbr",name:"SolNivEst",text:"DmnDet",tabla:"dmn",where:"DmnFilt = 'ESTNIV'",type:"supercombobox"},c={id:"NacAbr",name:"SolNac",text:"NacNom",tabla:"nac",type:"supercombobox"},p={id:"DmnAbr",name:"SolEstCiv",text:"DmnDet",tabla:"dmn",where:"DmnFilt = 'ESTCIV'",type:"supercombobox"},{control:r,handleSubmit:x,formState:E,setValue:t}=y({mode:"onChange",defaultValues:{SolNumDoc:"",SolCuit:"",SolApe:"",SolNom:"",SolFchNac:"",SolSex:"",SolNivEst:"",SolNac:"",SolEstCiv:""}});return e(v,{children:N("form",{onSubmit:x(o=>{F.guardar("Sol",{iprId:i,data:o}).then(d=>{if(!d.success){S.error("Error al guardar datos");return}m({out:o,act:"END",tar:n})}).catch(d=>{S.error("Error al guardar datos"),console.error(d)})},()=>{console.log(E.errors)}),children:[N("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px"},children:[e(l,{required:!0,control:r,name:"SolNumDoc",type:"number",label:"Número de documento"}),e(l,{required:!0,control:r,name:"SolCuit",type:"number",label:"CUIT"}),e(l,{required:!0,control:r,name:"SolApe",type:"text",label:"Apellido"}),e(l,{required:!0,control:r,name:"SolNom",type:"text",label:"Nombre"}),e(l,{required:!0,control:r,name:"SolFchNac",type:"date",label:"Fecha de Nacimiento"}),e(l,{required:!0,control:r,name:"SolSex",type:"supercombobox",label:"Sexo",iField:s}),e(l,{required:!0,control:r,name:"SolNivEst",type:"supercombobox",label:"Nivel de estudio",iField:u}),e(l,{required:!0,control:r,name:"SolNac",type:"supercombobox",label:"Nacionalidad",iField:c}),e(l,{required:!0,control:r,name:"SolEstCiv",type:"supercombobox",label:"Estado civil",iField:p})]}),a.mode!=="history"&&e("div",{style:{display:"flex",justifyContent:"end",marginTop:"10px"},children:e(D,{sx:{marginLeft:"10px"},color:"secondary",type:"submit",variant:"contained",children:"Continuar"})})]})})};export{L as default};
