import{j as e,r as h,m as N,W as S,h as y,o as x,O as l,K as D}from"./index-28356639.js";import{L as C}from"./PictureAsPdf-4f5f60d5.js";import{r as F}from"./DatosDom-f11d8bf3.js";import{C as v}from"./MoreVert-47b3685e.js";import"./DialogContentText-8cf287af.js";const w=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;h.useEffect(()=>{N.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),N.isTruthy(o.sol.SolNac)&&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:E,formState:f,setValue:t}=y({mode:"onChange",defaultValues:{SolNumDoc:"",SolCuit:"",SolApe:"",SolNom:"",SolFchNac:"",SolSex:"",SolNivEst:"",SolNac:"ARG",SolEstCiv:""}});return e(v,{children:x("form",{onSubmit:E(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(f.errors)}),children:[x("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{w as default};
