PageSourceSearch

https://serrabranca.pb.gov.br/assets/form-NNMpd2t3.js

js serrabranca.pb.gov.br collected 2026-09-25 09:09:30 UTC 4,511 bytes, 1 lines download raw bytes

1import{j as e}from"./app-Con2Uz40.js";import{r as x,u as N,H as C,L as R,e as h}from"./vendor-inertia-BMF_YWrS.js";import{A as S}from"./AdminLayout-B09P9NBj.js";import{P,C as p,c as g,b as n,S as c,I as v,T as k,B as D}from"./ui-DlMH4Qp3.js";import{w as A,af as E,Z as w,U as T,v as I}from"./vendor-icons-CKF1xuco.js";import"./FlashMessages-Bc9lB5dL.js";import"./campaigns-BMBq-BQU.js";import"./useFocusTrap-Cq0uZysT.js";const L={bimestre:6,trimestre:4,quadrimestre:3,semestre:2,anual:1},q=["","1º","2º","3º","4º","5º","6º"];function V({report:s,types:f,periodKinds:j}){const r=!!s,[d,u]=x.useState(!1),[o,b]=x.useState(null),{data:i,setData:t}=N({report_type:(s==null?void 0:s.report_type)||"RGF",year:(s==null?void 0:s.year)||new Date().getFullYear(),period_kind:(s==null?void 0:s.period_kind)||"quadrimestre",period_number:s!=null&&s.period_number?String(s.period_number):"1",title:(s==null?void 0:s.title)||"",description:(s==null?void 0:s.description)||"",is_active:(s==null?void 0:s.is_active)??!0}),_=i.period_kind==="anual",y=L[i.period_kind]??1;function F(a){a.preventDefault();const l={...i,file:o},m={forceFormData:!0,onStart:()=>u(!0),onFinish:()=>u(!1)};r?h.post(`/painel/relatorios-fiscais/${s.id}?_method=PUT`,l,m):h.post("/painel/relatorios-fiscais",l,m)}return e.jsxs(S,{title:r?"Editar Relatório Fiscal":"Novo Relatório Fiscal",children:[e.jsx(C,{title:`${r?"Editar":"Novo"} Relatório Fiscal - Painel`}),e.jsxs(R,{href:"/painel/relatorios-fiscais",className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-4",children:[e.jsx(A,{className:"w-4 h-4"})," Voltar para Relatórios Fiscais"]}),e.jsx(P,{title:r?"Editar Relatório Fiscal":"Novo Relatório Fiscal",description:"Cadastre RGF, RREO e demais relatórios organizados por ano e período (LRF / PNTP 11.5).",icon:E}),e.jsxs("form",{onSubmit:F,className:"space-y-6",children:[e.jsxs(p,{className:"space-y-4",children:[e.jsx(g,{title:"Identificação do relatório",icon:w}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsx(n,{label:"Tipo",children:e.jsx(c,{value:i.report_type,onChange:a=>t("report_type",a.target.value),children:f.map(a=>e.jsx("option",{value:a,children:a},a))})}),e.jsx(n,{label:"Ano",children:e.jsx(v,{type:"number",value:i.year,onChange:a=>t("year",a.target.value)})}),e.jsx(n,{label:"Periodicidade",children:e.jsx(c,{value:i.period_kind,onChange:a=>{t("period_kind",a.target.value),t("period_number","1")},children:j.map(a=>e.jsx("option",{value:a,children:a.charAt(0).toUpperCase()+a.slice(1)},a))})})]}),!_&&e.jsx(n,{label:"Período",hint:"Qual fração do ano este relatório cobre",children:e.jsx(c,{value:i.period_number,onChange:a=>t("period_number",a.target.value),children:Array.from({length:y},(a,l)=>l+1).map(a=>e.jsxs("option",{value:String(a),children:[q[a]??`${a}º`," ",i.period_kind]},a))})}),e.jsx(n,{label:"Título (opcional)",hint:"Se vazio, gera automaticamente (ex.: RGF — 2º Quadrimestre/2026)",children:e.jsx(v,{type:"text",value:i.title,onChange:a=>t("title",a.target.value),placeholder:"Deixe em branco para gerar automaticamente"})}),e.jsx(n,{label:"Observações (opcional)",children:e.jsx(k,{value:i.description,onChange:a=>t("description",a.target.value),rows:3})})]}),e.jsxs(p,{className:"space-y-4",children:[e.jsx(g,{title:"Arquivo (PDF)"}),e.jsxs(n,{label:"PDF do relatório e anexos",children:[e.jsxs("label",{className:"flex items-center gap-2 px-3 py-2.5 border border-border rounded-lg text-sm bg-card cursor-pointer hover:bg-muted max-w-md",children:[e.jsx(T,{className:"w-4 h-4 shrink-0"}),e.jsx("span",{className:"truncate",children:o?o.name:"Escolher arquivo PDF"}),e.jsx("input",{type:"file",accept:".pdf",className:"hidden",onChange:a=>{var l;return b(((l=a.target.files)==null?void 0:l[0])||null)}})]}),(s==null?void 0:s.file_url)&&!o&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1.5",children:["Atual:"," ",e.jsx("a",{href:s.file_url,target:"_blank",rel:"noopener noreferrer",className:"text-navy dark:text-sky underline",children:"ver PDF"})," ","— envie outro para substituir."]})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-foreground",children:[e.jsx("input",{type:"checkbox",checked:i.is_active,onChange:a=>t("is_active",a.target.checked),className:"accent-[hsl(var(--navy))]"}),"Publicado (visível no site)"]})]}),e.jsxs(D,{type:"submit",loading:d,children:[!d&&e.jsx(I,{className:"w-4 h-4"}
1),d?"Salvando...":"Salvar"]})]})]})}export{V 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.