????

Your IP : 3.128.31.200


Current Path : C:/inetpub/vhost/hotrochinhsach.nextform.vn/www/assets/
Upload File :
Current File : C:/inetpub/vhost/hotrochinhsach.nextform.vn/www/assets/SkeletonLinhVuc-86e78a13.js

var Yt=Object.defineProperty;var Xt=(s,t,a)=>t in s?Yt(s,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[t]=a;var q=(s,t,a)=>(Xt(s,typeof t!="symbol"?t+"":t,a),a);import{r as i,G as Se,an as rt,k as Ve,ac as qt,P as ce,j as e,p as $,R as de,d as me,T as _,ao as Ut,l as H,ap as Wt,h as S,D as dn,v as $t,x as U,Q as ct,ae as Dt,aq as jt,m as G,C as Z,ar as Jt,as as bn,at as yt,au as bt,av as Qt,K as Te,aw as Sn,ax as St,O as Zt,af as Nt}from"./index-3ac6b886.js";import{B as F}from"./Button-d32d698a.js";import{T as pe,a as ea,Q as na,D as It}from"./DetailInfo-598f38f6.js";import{F as v}from"./FontAwesome4-4d1c8e97.js";import{A as ht}from"./Alert-8adf8c12.js";import{a as ta,H as aa,F as sa}from"./FullScreenDialog-3e8faf30.js";import{R as ye}from"./Row-ef702d16.js";import{C as oe,T as oa}from"./TextArea-5c5d2643.js";import{T as Xe,C as un,D as ia,h as la,b as ra,i as ca}from"./DialogCustomize-f58e33cd.js";import{L as Nn}from"./LoadingSpinner-37d10bf9.js";import{T as ha}from"./TabsBasic-8d0666c0.js";import{c as _t,F as be,M as gn,d as ne,e as In,f as _n,g as Bn,h as da,j as ua,S as ga}from"./DropdownList-92e339e1.js";import{B as yn}from"./Button-9ef33eb6.js";import{a as Pe,B as wn,b as Fe,k as xa}from"./DataSelect-21292454.js";import{I as Bt}from"./Input-a404c875.js";import{b as An,L as ma,a as Ta}from"./ListItem-c9e1521c.js";import{a as xn}from"./useTheme-cc71593c.js";import{c as mn}from"./withStyles-be05542d.js";import{w as $e}from"./capitalize-2c2e3657.js";import{c as pa,I as fa}from"./Icon-38b0de34.js";import{F as Ca}from"./Form-fa36fba5.js";import{B as kn}from"./Badge-69f10678.js";import{H as ee,T as Da}from"./const-0478bc07.js";import{M as Je,a as Qe}from"./SelectCustom-a3812854.js";import{u as ja}from"./UseHandleFormControl-bd31c77e.js";import{M as Mn}from"./Modal-834c96f4.js";import{G as Ee}from"./Grid-7ea1e802.js";import{B as vn}from"./ButtonDropdown-77330e2e.js";import{D as qe,a as Ue,b as z}from"./DropdownToggle-ce0bc76b.js";import{F as ya}from"./FormGroup-894dd1cd.js";import{a as ba}from"./Required-a585e744.js";import"./InputNumber-e0e8281b.js";import"./InputTime-6c25e67a.js";const Sa=pa(i.createElement("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}));var Na=function(t){return{root:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none"},colorDefault:{color:t.palette.background.default,backgroundColor:t.palette.type==="light"?t.palette.grey[400]:t.palette.grey[600]},circle:{},circular:{},rounded:{borderRadius:t.shape.borderRadius},square:{borderRadius:0},img:{width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4},fallback:{width:"75%",height:"75%"}}};function Ia(s){var t=s.src,a=s.srcSet,n=i.useState(!1),o=n[0],l=n[1];return i.useEffect(function(){if(!(!t&&!a)){l(!1);var c=!0,g=new Image;return g.src=t,g.srcSet=a,g.onload=function(){c&&l("loaded")},g.onerror=function(){c&&l("error")},function(){c=!1}}},[t,a]),o}var _a=i.forwardRef(function(t,a){var n=t.alt,o=t.children,l=t.classes,c=t.className,g=t.component,T=g===void 0?"div":g,x=t.imgProps,d=t.sizes,r=t.src,p=t.srcSet,h=t.variant,u=h===void 0?"circular":h,N=xn(t,["alt","children","classes","className","component","imgProps","sizes","src","srcSet","variant"]),B=null,b=Ia({src:r,srcSet:p}),L=r||p,y=L&&b!=="error";return y?B=i.createElement("img",Se({alt:n,src:r,srcSet:p,sizes:d,className:l.img},x)):o!=null?B=o:L&&n?B=n[0]:B=i.createElement(Sa,{className:l.fallback}),i.createElement(T,Se({className:mn(l.root,l.system,l[u],c,!y&&l.colorDefault),ref:a},N),B)});const Ba=$e(Na,{name:"MuiAvatar"})(_a);var wa={root:{marginBottom:12}},Aa=i.forwardRef(function(t,a){return i.createElement(Xe,Se({component:"p",variant:"body1",color:"textSecondary",ref:a},t))});const ka=$e(wa,{name:"MuiDialogContentText"})(Aa);var Ma={root:{minWidth:56,flexShrink:0},alignItemsFlexStart:{marginTop:8}},va=i.forwardRef(function(t,a){var n=t.classes,o=t.className,l=xn(t,["classes","className"]),c=i.useContext(An);return i.createElement("div",Se({className:mn(n.root,o,c.alignItems==="flex-start"&&n.alignItemsFlexStart),ref:a},l))});const Ha=$e(Ma,{name:"MuiListItemAvatar"})(va);var La=function(t){return{root:{minWidth:56,color:t.palette.action.active,flexShrink:0,display:"inline-flex"},alignItemsFlexStart:{marginTop:8}}},Ea=i.forwardRef(function(t,a){var n=t.classes,o=t.className,l=xn(t,["classes","className"]),c=i.useContext(An);return i.createElement("div",Se({className:mn(n.root,o,c.alignItems==="flex-start"&&n.alignItemsFlexStart),ref:a},l))});const Ka=$e(La,{name:"MuiListItemIcon"})(Ea);var Fa={root:{flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},multiline:{marginTop:6,marginBottom:6},dense:{},inset:{paddingLeft:56},primary:{},secondary:{}},Va=i.forwardRef(function(t,a){var n=t.children,o=t.classes,l=t.className,c=t.disableTypography,g=c===void 0?!1:c,T=t.inset,x=T===void 0?!1:T,d=t.primary,r=t.primaryTypographyProps,p=t.secondary,h=t.secondaryTypographyProps,u=xn(t,["children","classes","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"]),N=i.useContext(An),B=N.dense,b=d??n;b!=null&&b.type!==Xe&&!g&&(b=i.createElement(Xe,Se({variant:B?"body2":"body1",className:o.primary,component:"span",display:"block"},r),b));var L=p;return L!=null&&L.type!==Xe&&!g&&(L=i.createElement(Xe,Se({variant:"body2",className:o.secondary,color:"textSecondary",display:"block"},h),L)),i.createElement("div",Se({className:mn(o.root,l,B&&o.dense,x&&o.inset,b&&L&&o.multiline),ref:a},u),b,L)});const Pa=$e(Fa,{name:"MuiListItemText"})(Va);class Oa{constructor(t){this.Them=t.Them,this.Xoa=t.Xoa,this.Xem=t.Xem,this.Download=t.Download,this.Upload=t.Upload,this.KySo=t.KySo,this.TrinhKy=t.TrinhKy,this.TiepNhanTrinhKy=t.TiepNhanTrinhKy,this.Gui=t.Gui,this.TiepNhanBaoCao=t.TiepNhanBaoCao}}const Ga=s=>{if(typeof s!="string")throw new Error("Url parameter of useActionPermission hook must be string");let t=rt?rt.find(n=>n.url===s):{};return new Oa(t||{})},wt=s=>Ga(s||"/quan-ly-bao-cao"),Ke=`${window.location.origin}${Ve}/BaoCaos/KySo`,we=`${window.location.origin}${Ve}/BaoCaos/GeneratePDF`,Ra=`${Ve}/QuanLyVanBan/Download`,za="BaoCaos/DuyetBaoCao",Ya="BaoCaos/TuChoiBaoCao",Xa={DN:"DoanhNghiep",SBN:"SoBanNganh",STC:"SoTaiChinh"},qa=qt,A={Khoi_Tao:0,Da_Trinh_Ky:5,Da_Ki_So:1,Cho_Duyet:2,Tu_Choi:3,Da_Duyet:4,Tu_Choi_Trinh_Ky:8,Da_Tiep_Nhan_Trinh_Ky:9},At=[{status:A.Khoi_Tao,name:"Khởi tạo báo cáo",color:"primary"},{status:A.Da_Ki_So,name:"Báo cáo đã ký số",color:"info"},{status:A.Cho_Duyet,name:"Báo cáo đã gửi- Chờ tiếp nhận",color:"warning"},{status:A.Tu_Choi,name:"Từ chối báo cáo",color:"danger"},{status:A.Da_Duyet,name:"Đã tiếp nhận báo cáo",color:"success"},{status:A.Da_Trinh_Ky,name:"Đã trình ký",color:"success"},{status:A.Da_Tiep_Nhan_Trinh_Ky,name:"Đã tiếp nhận trình ký",color:"primary"},{status:A.Tu_Choi_Trinh_Ky,name:"Từ chối trình ký",color:"danger"}],Ze=s=>{const{status:t,style:a}=s,n=At.find(o=>o.status===t);return e.jsx(kn,{style:a,color:n==null?void 0:n.color,children:n==null?void 0:n.name})};Ze.propTypes={status:ce.number.isRequired};Ze.defaultProps={};const Ua=s=>{for(let t in s)(s[t]==="Infinity"||s[t]==="-Infinity"||Number.isNaN(s[t])||s[t]==="NaN"||s[t]==="")&&delete s[t]},Ao=s=>{for(let t in s)typeof s[t]=="number"&&(s[t]+="")};function Tn(s){const{value:t,isNgayDenHan:a}=s;return e.jsx(Wa,{className:"d-flex justify-content-between",children:a&&(t<=5?t<0?e.jsxs($a,{children:[e.jsx("i",{className:"fa fa-exclamation-triangle"})," Trễ hạn ",e.jsx("b",{children:Math.abs(t)})," ngày"]}):t===0?e.jsxs(dt,{children:[e.jsx("i",{className:"fa fa-clock-o"})," Hôm nay"]}):e.jsxs(dt,{children:[e.jsx("i",{className:"fa fa-clock-o"})," Còn ",e.jsx("b",{children:t})," ngày"]}):e.jsxs(Ja,{style:{color:"rgb(0, 80, 110)"},children:["Còn ",e.jsx("b",{children:t})," ngày"]}))})}Tn.propTypes={value:ce.number.isRequired};Tn.defaultProps={value:0};const Wa=$.div``,$a=$.span`
  color: red !important;
  border: 1px solid;
  border-radius: 0.25rem;
  padding: 2px 5px;
`,dt=$.span`
  color: orange !important;
  border: 1px solid;
  border-radius: 0.25rem;
  padding: 2px 5px;
`,Ja=$.span``;function Qa(s){const{children:t,onClose:a,open:n,className:o}=s;return e.jsx(ta,{open:n,onClose:a,className:o,children:e.jsx(aa,{children:t})})}const Za="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAABQCAYAAAByKBsiAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADDhJREFUeNrsXV1oHMcdH4eEQkXjDdR+SV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6SyHgXwKDTCzLYSlIo9q5oN46T4tO2mTFSpNspheCOGltU2lME3Q3rFmnqxNV5thXzakNSCCn+PzpyRmCgXR34PscmYeiIzuF8lmCOVSy+uN8nCm2BVtLrVhHiOEjNTO8IQJ2idBkUdzena6z6PtaCNiemy6R8T9ca6nZpiiAk9yHg1k2yP8P2F6KyS6P4TnuRvCvjxQeXjU5uZm138hbE7SKNpt5kVBVX9JF4bCrGYYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYZvPyPwBWJhvkqQR0AAAAAElFTkSuQmCC";class se{constructor(t,a,n,o,l,c,g){this.from_id=t,this.to_id=a,this.title=n,this.body=o,this.target_id=l,this.target_module=c,this.hanh_dong=g}}const hn=$.img`
  border: 1px solid #ddd;
  width: 180px;
  margin-top: 10px;
  &:hover {
    cursor: pointer;
    box-shadow: -1px 10px 8px -1px rgba(0, 0, 0, 0.42);
    transition: all 0.5s ease-out;
  }
`;class as extends de.Component{constructor(a){super(a);q(this,"handleSign",a=>{const{FileName:n,UploadServer:o,handleSuccess:l,setisChange:c,IDBaoCao:g,TenBaoCao:T}=this.props;this.setState({loading:!0});var x=JSON.stringify({issuer:a,page:me("KYSO_DOANHNGHIEP_PAGE"),x:me("KYSO_DOANHNGHIEP_X"),y:me("KYSO_DOANHNGHIEP_Y"),width:me("KYSO_DOANHNGHIEP_WIDTH"),height:me("KYSO_DOANHNGHIEP_HEIGHT"),UploadHandler:o,FileName:n,maTaiKhoan:_.MaTaiKhoan});Ut(),fetch("http://127.0.0.1:12019/SignPDF/",{mode:"cors",method:"POST",body:x,headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}}).then(d=>d.json()).then(d=>JSON.parse(d)).then(d=>{let r=new se;r.from_id=_.IDDonVi,r.to_id=_.IDDonVi,r.title=_.TenDonVi,r.body="Ký số "+T,r.target_id=g,r.target_module="BaoCao",r.hanh_dong="da_ky_so",c(!1),l(d),this.setState({loading:!1})}).catch(d=>{H("Ký số không thành công !"),this.setState({loading:!1,openGhiChu:!0})}).finally(()=>Wt())});this.state={loading:!1,openGhiChu:!1}}render(){const{open:a,close:n}=this.props;return e.jsx(e.Fragment,{children:e.jsx(un,{title:"Chọn loại ký số doanh nghiệp",open:a,handleClose:n,maxWidth:"sm",children:e.jsxs(Nn,{show:this.state.loading,children:[e.jsxs(ye,{style:{marginRight:4},children:[e.jsx(oe,{md:"4",children:e.jsx(hn,{src:es,alt:"VIETTELCA",title:"VIETTELCA",onClick:o=>this.handleSign("6")})}),e.jsx(oe,{md:"4",children:e.jsx(hn,{src:Za,alt:"FPTCA",title:"FPTCA",onClick:o=>this.handleSign("8")})}),e.jsx(oe,{md:"4",children:e.jsx(hn,{src:ns,alt:"VNPTCA",title:"VNPTCA",onClick:o=>this.handleSign("4")})})]}),e.jsx(ye,{style:{marginRight:4},children:e.jsx(oe,{md:"4",children:e.jsx(hn,{src:ts,alt:"NEWCA",title:"NEWCA",onClick:o=>this.handleSign("7")})})}),e.jsx(ye,{children:e.jsx(oe,{md:"12",children:e.jsx("strong",{style:{color:"red"},children:"* Trường hợp không có chữ ký số của 4 hãng trên, quý doanh nghiệp vui lòng bấm vào nút bên dưới"})})}),e.jsx(ye,{style:{marginRight:4},children:e.jsx(oe,{md:"12",children:e.jsx(F,{color:"primary",onClick:()=>this.handleSign("100"),children:"Ký số hãng khác"})})}),e.jsx(ye,{children:e.jsx(oe,{md:"12",children:e.jsx("div",{className:"alert alert-warning",children:e.jsx("a",{href:"/assets/GDT_Sign_Plugin.rar",target:"_blank",children:"Đường dẫn tải plugin ký số công cộng: GDT_Sign_Plugin.rar"})})})})]})})})}}const Hn=s=>{const{title:t,variant:a,children:n,className:o}=s;return e.jsxs("div",{className:`toast-detail ${o}`,children:[e.jsxs("div",{className:"toast-detail-header",children:[a==="h3"&&e.jsx("h3",{children:e.jsx("strong",{children:t})}),a==="h4"&&e.jsx("h4",{children:e.jsx("strong",{children:t})}),a==="h5"&&e.jsx("h5",{children:e.jsx("strong",{children:t})}),a==="h6"&&e.jsx("strong",{children:t})]}),e.jsx("div",{className:"toast-detail-body",children:n})]})};Hn.propTypes={title:ce.string.isRequired};Hn.defaultProps={title:"Chi tiết",variant:"h6"};const ss=({getFile:s,reset:t,accept:a,name:n,required:o})=>{const l=i.useRef(),[c,g]=i.useState(null),[T,x]=i.useState(100),[d,r]=i.useState("select"),p=N=>{N.target.files&&N.target.files.length>0&&(g(N.target.files[0]),s(N.target.files[0]))},h=()=>{var N;l!=null&&l.current&&((N=l==null?void 0:l.current)==null||N.click())},u=()=>{l.current.value="",g(null),s(null),x(0),r("select"),t&&t()};return e.jsxs("div",{className:"form-input-file-custom",children:[e.jsx("input",{ref:l,name:n,required:o,accept:a||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",type:"file",onChange:p,style:{display:"none"}}),!c&&e.jsxs("button",{className:"file-btn",onClick:h,children:[e.jsx(v,{fa:"upload"})," Upload File",e.jsx("h6",{children:a?"Chọn File bạn muốn tải lên":"Chọn File Excel của bạn"})]}),c&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:"file-card",children:[e.jsx("div",{className:"icon-file-card",children:e.jsx(v,{fa:"trello"})}),e.jsxs("div",{className:"file-info",children:[e.jsxs("div",{style:{flex:1},children:[e.jsx("h6",{children:c==null?void 0:c.name}),e.jsx("div",{className:"progress-bg",children:e.jsx("div",{className:"progress"})})]}),d==="select"?e.jsx("button",{onClick:u,children:e.jsx(v,{fa:"times"})}):e.jsx("div",{className:"check-circle",children:d==="uploading"?`${T}%`:d==="done"?e.jsx("span",{class:"material-symbols-outlined",style:{fontSize:"20px"},children:"check"}):null})]})]})})]})};class os extends i.Component{constructor(a){super(a);q(this,"renderbutton",()=>e.jsxs("div",{style:{float:"right"},children:[e.jsx(Pe,{onClick:this.props.close,children:"Hủy"}),e.jsx(wn,{size:"sm",type:"submit",children:"Lưu"})]}));q(this,"submitHandler",a=>{a.preventDefault();let n=new FormData(this.formRef.current);this.props.onSubmit(n)});this.state={file:"",Subject:""},this.formRef=de.createRef()}getInputValue(a,n){return this.props.data&&this.props.data[a]?this.props.data[a]:n||""}render(){return e.jsx(un,{open:this.props.open,handleClose:this.props.close,title:"Đính kèm văn bản",maxWidth:"xs",children:e.jsxs(Ca,{innerRef:this.formRef,id:"upload-vanban-form",method:"POST",onSubmit:this.submitHandler,children:[e.jsxs("div",{children:[e.jsx("h6",{className:"fw-bold",children:"Tệp tin"}),e.jsx("div",{className:"mb-4",children:e.jsx(ss,{name:"file",required:!0,getFile:a=>this.setState({file:a}),accept:"application/pdf"})})]}),this.renderbutton()]})})}}class pn extends i.Component{constructor(a){super(a);q(this,"uploadVanBan",a=>{let n=this,o=Math.max(...this.state.data.map(l=>l.stt));a.append("target_id",n.props.target_id||null),a.append("target_module",n.props.target_module||null),a.append("ma_tai_khoan",_.MaTaiKhoan),a.append("created_date",new Date),a.append("stt",o),this.props.isHoGiaDinh&&a.append("hogiadinh_id",this.props.isHoGiaDinh),$t("QuanLyVanBan/Attachment","POST",a).then(function(l){n.getItems(),n.setState({uploading:!1,showPopup:!1})}).catch(function(l){H(l)})});q(this,"addAttachment",async a=>{let n=Math.max(...this.state.data.map(o=>o.stt),1);for(let o=0;o<a.length;o++){let l={target_id:this.props.target_id||null,target_module:this.props.target_module||null,created_by:_.MaTaiKhoan,created_date:new Date,id_van_ban:a[o],stt:++n};try{await S("Attachments","POST",JSON.stringify(l))}catch(c){console.log(c)}}this.setState({searching:!1}),this.getItems()});q(this,"deleteAttachment",async(a,n)=>{try{await U("Bạn muốn xóa văn bản sau khỏi danh sách văn bản liên quan","Xác nhận")&&S(`Attachments(guid'${a}')`,"DELETE",null).then(()=>S(`VanBans(guid'${n}')`,"DELETE",null).then(()=>this.getItems()))}catch(o){H(o)}});q(this,"popupImage",a=>{var n=document.getElementById("myModal"),o=document.getElementById("img01"),l=document.getElementById("caption");n.style.display="block",o.src=a.src,l.innerHTML=a.alt;var c=document.getElementsByClassName("close")[0];c.onclick=function(){n.style.display="none",o.src="",l.innerHTML=""}});this.uploadVanBan=this.uploadVanBan.bind(this),this.addAttachment=this.addAttachment.bind(this),this.deleteAttachment=this.deleteAttachment.bind(this),this.state={searching:!1,uploading:!1,data:[],LoaiDonVi:null,showPopup:!1}}componentDidMount(){this.getDN(),this.getItems()}getDN(){S(`DonVis?$filter=MaDonVi eq '${_.MaDonVi}'`).then(a=>this.setState({LoaiDonVi:a.value[0]?a.value[0].LoaiDonVi:null})).catch(a=>console.log(a))}getItems(){const{isChange:a}=this.props;let n=this;S(`Attachments?$expand=VanBan&$filter=${this.props.isHoGiaDinh?`HoGiaDinh_Id eq ${this.props.isHoGiaDinh}`:`target_id eq '${this.props.target_id}'`} and IsAttachment eq ${this.props.IsAttachment??!1}&$orderby=stt`,"GET",null).then(function(o){n.setState({data:o.value},()=>a(n.state.data.length))}).catch(function(o){H(o.Message||o)})}downloadPDF(a){let n=a.LinkFile.split("/")[3].split(".")[1];dn(`QuanLyVanBan/Download?id=${a.ID}`,a.Subject+`.${n}`).then().catch(function(o){H(o)})}getCode(a){let n=[];return a.CodeNumber&&n.push(a.CodeNumber),a.CodeNotation&&n.push(a.CodeNotation),n.join("/")}renderClassName(a){let n="";switch(a.LinkFile.split("/")[3].split(".")[1]){case"pdf":n="fa fa-file-pdf-o colorRed";break;case"xlsx":n="fa fa-file-excel-o colorGreen";break;case"xls":n="fa fa-file-excel-o colorGreen";break;case"docx":n="fa fa-file-word-o colorBlue";break;case"doc":n="fa fa-file-word-o colorBlue";break}return n}render(){const{LoaiDonVi:a}=this.state;return e.jsxs("div",{className:"mt-4",children:[e.jsxs("div",{className:"clearfix",children:[e.jsx("b",{children:"DANH SÁCH ĐÍNH KÈM"}),e.jsx("div",{className:"pull-right",children:this.props.isHoGiaDinh?_t?e.jsxs(yn,{color:"success",onClick:()=>{this.setState({showPopup:!0})},children:[e.jsx(v,{fa:"upload"})," Tải lên"]}):e.jsx(e.Fragment,{}):e.jsxs(yn,{color:"success",onClick:()=>{this.setState({showPopup:!0})},children:[e.jsx(v,{fa:"upload"})," Tải lên"]})})]}),e.jsx("p",{}),e.jsxs(pe,{size:"sm",className:"table-bordered table-attachment",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"#"}),e.jsx("th",{children:"Tiêu đề"}),e.jsx("th",{children:"Thao tác"})]})}),e.jsx("tbody",{children:this.state.data&&this.state.data.length?this.state.data.map((n,o)=>n.VanBan?e.jsxs("tr",{children:[e.jsx("td",{className:"td-stt",children:o+1}),e.jsxs("td",{children:[e.jsx("div",{className:"pull-left",children:n.VanBan.LinkFile.split("/")[3].split(".")[1]==="png"||n.VanBan.LinkFile.split("/")[3].split(".")[1]==="jpg"?e.jsx("img",{onClick:l=>this.popupImage(l.target),alt:"",src:Ve+n.VanBan.LinkFile,className:"myImg",width:"50",height:"30"}):e.jsx(fa,{style:{fontSize:"2rem",marginRight:5},className:this.renderClassName(n.VanBan)})}),e.jsx("div",{className:"pull-left",children:a&&a===2?e.jsx("p",{children:n.VanBan.Subject}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"small text-muted",children:["Số, ký hiệu: ",this.getCode(n.VanBan)]}),e.jsx("div",{children:n.VanBan.Subject})]})})]}),e.jsxs("td",{className:"td-actions",children:[e.jsx(Fe,{color:"primary",icon:"download",onClick:l=>this.downloadPDF(n.VanBan),title:"Tải xuống"}),n.VanBan&&e.jsx(Fe,{color:"danger",icon:"times",onClick:l=>this.deleteAttachment(n.id,n.VanBan.ID),title:"Xóa văn bản"})]})]},n.id_van_ban):null):e.jsx("tr",{children:e.jsx("td",{colSpan:"3",className:"td-noAttachment",children:"Không có văn bản đính kèm"})})})]}),this.state.searching?e.jsx(is,{target_id:this.props.target_id,target_module:this.props.target_module,setClose:()=>this.setState({searching:!1}),onSubmit:this.addAttachment}):null,this.state.uploading?e.jsx(ea,{mode:"create",onOpen:()=>this.setState({uploading:!0}),onClose:()=>this.setState({uploading:!1}),onSubmit:this.uploadVanBan}):null,this.state.showPopup?e.jsx(os,{open:this.state.showPopup,close:()=>this.setState({showPopup:!1}),onSubmit:this.uploadVanBan}):null,e.jsxs("div",{id:"myModal",className:"modal",children:[e.jsx("span",{className:"close",children:"×"}),e.jsx("img",{className:"modal-content",id:"img01",alt:""}),e.jsx("div",{id:"caption"})]})]})}}pn.propTypes={target_module:ce.string.isRequired,target_id:ce.string.isRequired,onView:ce.func};class Ln extends i.Component{constructor(a){super(a);q(this,"handleChange",a=>{this.setState({searchText:a.target.value})});q(this,"selectVanBan",a=>{let n=this.state.selected;n.indexOf(a.target.value)>-1?n.splice(n.indexOf(a.target.value),1):n.push(a.target.value)});q(this,"submitHandler",a=>{this.props.onSubmit(this.state.selected)});this.updateResult=this.updateResult.bind(this),this.state={searchText:"",result:[],selected:[]}}componentDidMount(){this.updateResult()}updateResult(){let a=this;S(`VanBans?$select=ID,Subject,CodeNumber,CodeNotation&$filter= DocType ne null and substringof('${a.state.searchText}', Subject) and Attachments/all(a:a/target_id ne '${a.props.target_id}')`).then(function(n){a.setState({result:n.value})}).catch(function(n){H(n)})}getSize(a){let n=a;if(n<1e3)return n+" bytes";if(n=n/1e3,n<1e3)return n.toFixed(2)+" KB";if(n=n/1e3,n<1e3)return n.toFixed(2)+" MB";if(n=n/1e3,n<1e3)return n.toFixed(2)+" GB"}getCode(a){let n=[];return a.CodeNumber&&n.push(a.CodeNumber),a.CodeNotation&&n.push(a.CodeNotation),"Số, ký hiệu: "+n.join("/")}showResult(){return this.state.result&&this.state.result.length?e.jsx(ma,{dense:!0,children:this.state.result.map((a,n)=>e.jsxs(Ta,{children:[e.jsx(Ka,{children:e.jsx(Bt,{id:"vb_"+a.ID,type:"checkbox",value:a.ID,onChange:this.selectVanBan})}),e.jsx(Ha,{children:e.jsx(Ba,{children:e.jsx(v,{fa:"file-pdf-o",style:{color:"red"}})})}),e.jsx(Pa,{primary:a.Subject,secondary:this.getCode(a)})]},n))}):e.jsx(ka,{children:"* Không tìm thấy văn bản nào"})}render(){return e.jsxs(ia,{open:this.props.open,onClose:this.props.setClose,fullWidth:!0,scroll:"paper",maxWidth:"lg",style:{height:"100%"},children:[e.jsxs(la,{children:["Tìm kiếm văn bản",e.jsx(na,{placeholder:"Nhập thông tin văn bản cần tìm",value:this.state.searchText,onChange:this.handleChange,onSearch:this.updateResult})]}),e.jsx(ra,{children:this.showResult()}),e.jsxs(ca,{children:[e.jsx(xa,{color:"danger",onClick:this.props.setClose,children:"Đóng lại"}),e.jsxs(yn,{color:"primary",onClick:this.submitHandler,children:[e.jsx(v,{fa:"paperclip"})," Đính kèm"]})]})]})}}Ln.propTypes={open:ce.bool,setClose:ce.func.isRequired,onSubmit:ce.func.isRequired};Ln.defaultProps={open:!0};const is=Ln;const ut="ActivityLogs?$expand=SYS_TaiKhoan/SYS_DonVi";class En extends i.Component{constructor(t){super(t),this.state={model:[],loading:!1}}componentDidMount(){this.props.target_module&&this.props.target_id&&(this.setState({loading:!0}),ct(`${ut}&$filter=target_module eq '${this.props.target_module}' and target_id eq '${this.props.target_id}'&$orderby=created_date desc`).then(t=>{this.setState({model:t.value,loading:!1})}).catch(t=>H(t)))}componentDidUpdate(t,a){const{isActiveLog:n,isChangeActivityLog:o}=this.props;(n!==t.isActiveLog||o!==t.isChangeActivityLog)&&(this.setState({loading:!0}),ct(`${ut}&$filter=target_module eq '${this.props.target_module}' and target_id eq '${this.props.target_id}'&$orderby=created_date desc`).then(l=>this.setState({model:l.value,loading:!1})).catch(l=>H(l)))}renderData(t){let a="";switch(t.name){case ee.TinNhanTuDonVi:a=e.jsx("b",{className:"text-primary",children:"Gửi"});break;case ee.GuiBaoCao:a=e.jsx("b",{className:"text-primary",children:"Gửi"});break;case ee.DuyetBaoCao:a=e.jsx("b",{className:"text-success",children:"Tiếp nhận"});break;case ee.TuChoiBaoCao:a=e.jsx("b",{className:"text-danger",children:"Từ chối"});break;case ee.ChinhSuaBaoCao:a=e.jsx("b",{className:"text-info",children:"Yêu cầu chỉnh sửa"});break;case ee.DaTrinhKy:a=e.jsx("b",{className:"text-primary",children:"Trình ký"});break;case ee.TuChoiTrinhKy:a=e.jsx("b",{className:"text-danger",children:"Từ chối trình ký"});break;case ee.TiepNhanTrinhKy:a=e.jsx("b",{className:"text-success",children:"Tiếp nhận trình ký"});break;case ee.DaKySo:a=e.jsx("b",{className:"text-primary",children:"Ký số"});break;case ee.HuyKySo:a=e.jsx("b",{className:"text-danger",children:"Hủy ký số"});break;case ee.KhoiTao:a=e.jsx("b",{className:"text-primary",children:"Khởi tạo"});break}return e.jsx(e.Fragment,{children:a&&e.jsx("span",{children:e.jsx("b",{children:a})})})}render(){return e.jsx(Nn,{show:this.state.loading,children:e.jsxs("div",{className:"form-list-operation-history",children:[this.props.hasTitle&&e.jsx("div",{className:"thead-light",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-center",children:e.jsx("i",{className:"icon-people"})}),e.jsx("th",{children:"Hoạt động"})]})}),e.jsx(e.Fragment,{children:this.state.model&&this.state.model.map((t,a)=>{let n=t.content;t.content==="Chờ duyệt báo cáo"&&(n="Gửi báo cáo"),t.content==="báo cáo đã ký số"&&(n="Ký số");let o="",l="";return o=t.SYS_TaiKhoan.SYS_DonVi.TenDonVi,l=t.SYS_TaiKhoan.HinhAnh?Ve+t.SYS_TaiKhoan.HinhAnh:"/assets/profile-w.jpg",e.jsxs("div",{className:"form-item-history",children:[e.jsx("img",{src:l,alt:"",className:"img-avatar"}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-3 justify-content-between",children:[e.jsx("h6",{className:"title mb-0",children:o}),e.jsx("span",{children:Dt(t.created_date)})]}),this.renderData(t),n&&e.jsx("div",{className:"form-info",children:e.jsx("div",{children:n})})]})]},a)})})]})})}}En.propTypes={target_id:ce.string.isRequired,target_module:ce.string.isRequired};En.defaultProps={hasTitle:!0};var ae={MaBaoCao:{field_name:"MaBaoCao",title:"Mã báo cáo",type:"label"},TenBaoCao:{field_name:"TenBaoCao",title:"Tên báo cáo",type:"label"},TenDonViGui:{field_name:"TenDonViGui",title:"Đơn vị gửi",type:"label"},TenDonViNhan:{field_name:"TenDonViNhan",title:"Đơn vị nhận",type:"label"},MaDonViNhan:{field_name:"MaDonViNhan",title:"Mã đơn vị nhận",type:"label"},MauBaoCao_Id:{field_name:"MauBaoCao_Id",title:"Mẫu báo cáo",type:"label"},TanSuat_Id:{field_name:"TanSuat_Id",title:"Tần suất",type:"label"},TrangThai:{field_name:"TrangThai",title:"Trạng thái",type:"label"},TGTao:{field_name:"TGTao",title:"Thời gian tạo",type:"datetime"},TGGuiBaoCao:{field_name:"TGGuiBaoCao",title:"Thời gian gửi",type:"datetime"},PhongBanTiepNhan_Id:{field_name:"PhongBanTiepNhan_Id",title:"Phòng ban tiếp nhận",type:"label"},LyDo:{field_name:"LyDo",title:"Lý do từ chối",type:"textarea"},Quy_Id:{field_name:"Quy_Id",title:"Quý",type:"label"},Thang_Id:{field_name:"Thang_Id",title:"Tháng",type:"label"},Period:{field_name:"Period",title:"Period",type:"label"}};$.div``;$.div`
  .form-group {
    label,
    b {
      font-weight: bold;
    }
  }
`;$.div``;$.div``;$(Mn)`
  &.modal-dialog {
    max-width: 1400px !important;
    transition: unset !important;
  }
  .modal-content {
    ${""}
    overflow: auto;
    width: 100% !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    .modal-header {
      .modal-title {
        display: flex;
        justify-content: space-between;
      }
    }
  }
  .modal-body {
    overflow-x: auto;
  }
`;$(Mn)`
  .modal-dialog {
    max-width: ${s=>s.maxWidth?s.maxWidth+"px":"inherit"};
  }

  .ntable-inner {
    height: ${s=>s.heighttable||"100%"};
  }
`;const en=$(Mn)`
  .form-group {
    label,
    b {
      font-weight: bold;
    }
    .form-control-MaHangHoa > div > label > span {
      display: none;
    }
  }
`,re={ID:{field_name:"ID",title:"Báo cáo Id: ",type:"label"},Parent_Id:{field_name:"Parent_Id",title:"Parent Id: ",type:"label"},MaDonViNhan:{field_name:"MaDonViNhan",title:"Đơn vị nhận: ",type:"textbox",required:!0},IsTrinhKy:{field_name:"IsTrinhKy",title:"Có trình ký: ",type:"checkbox"},TrangThai:{field_name:"TrangThai",title:"Trạng thái: ",type:"numeric",placeholder:null}},ls="gdt@123#@!";function rs(s){const{isOpen:t,onClose:a,ID:n,reloadAll:o}=s,[l,c]=i.useState({}),{handleChange:g,handleValidate:T}=ja(l,re,r=>c(p=>({...p,...r}))),x=i.useCallback(()=>{let r=[];r.push(re.ID.field_name),r.push(re.Parent_Id.field_name),r.push(re.IsTrinhKy.field_name),r.push(re.TrangThai.field_name),r.push("SYS_DonVi/MaDonVi"),S(`BaoCaos('${n}')?$expand=SYS_DonVi&$select=${r.join(",")}`,"GET",null).then(p=>c({...p,[re.MaDonViNhan.field_name]:p.SYS_DonVi.MaDonVi})).catch(p=>H("Đã xảy ra lỗi","Thông báo"))},[n]);i.useEffect(()=>{x()},[x]);const d=i.useCallback(async()=>{Ua(l);let r={...l,Id:n};delete r.Parent_Id,delete r.SYS_DonVi,T()&&(await jt("Nhập mật khẩu: ","Thông báo","Vui lòng nhập mật khẩu",!0)===ls?S("BaoCaos/Update","POST",JSON.stringify(r),{odata:!1}).then(()=>{o(),G("Cập nhật thành công","Thông báo"),a()}).catch(h=>H(h||"Đã xảy ra lỗi","Thông báo")):Z("Mật khẩu không chính xác","Thông báo"))},[n,l,T,a,o]);return e.jsxs(en,{isOpen:t,toggle:a,zIndex:"1500",size:"lg",children:[e.jsx(Je,{style:{backgroundColor:"rgb(3,56,99)"},className:"text-white",children:e.jsx("b",{children:"Chỉnh sửa thông tin báo cáo"})}),e.jsxs(Qe,{children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",marginBottom:"1rem",gap:"1.5rem"},children:[e.jsx(be,{data:re.ID,value:l.ID}),e.jsx(be,{data:re.Parent_Id,value:l.Parent_Id||"Không có"}),e.jsx(be,{data:re.MaDonViNhan,inline:!1,value:l.MaDonViNhan,onChange:g}),e.jsx(be,{data:re.IsTrinhKy,value:l.IsTrinhKy,onChange:g}),e.jsx(be,{data:re.TrangThai,inline:!1,value:l.TrangThai,onChange:g})]}),e.jsx(ye,{children:e.jsx(oe,{md:"12",children:e.jsxs(pe,{width:"100%",cellPadding:"6",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-center",children:"Giá trị"}),e.jsx("th",{className:"text-center",children:"Ý nghĩa"})]})}),e.jsx("tbody",{children:At.map(r=>e.jsxs("tr",{children:[e.jsx("td",{className:"text-center font-weight-bold",children:r.status}),e.jsx("td",{className:"text-center",children:e.jsx(kn,{color:r.color,children:r.name})})]},r.status))})]})})})]}),e.jsx("div",{className:"mt-1 p-3 d-flex justify-content-end",children:e.jsx(wn,{onClick:d,children:e.jsx("b",{children:"Lưu"})})})]})}function cs(s){var V,w,m,C,j,k,K;const{data:t,isActiveLog:a,reloadAll:n}=s,[o,l]=i.useState(""),[c,g]=i.useState(!1),[T,x]=i.useState(0),[d,r]=i.useState([]),[p,h]=i.useState(!1),u=i.useCallback(()=>h(!p),[p]);i.useEffect(()=>{g(!!o)},[o]),i.useEffect(()=>{B()},[a]);const N=i.useCallback(E=>{x(E)},[]),B=()=>{S(`Attachments?$expand=VanBan&$filter=target_id eq '${t.ID}' and IsAttachment eq false&$orderby=stt`,"GET",null).then(E=>r(E.value)).catch(E=>H(E.Message||E))},b=E=>{dn(`QuanLyVanBan/Download?id=${E.ID}`,E.Subject+".pdf").then().catch(function(X){H(X)})},L=i.useMemo(()=>e.jsxs("span",{children:[t.MaBaoCao," ",e.jsx(hs,{title:"Chỉnh sửa thông tin báo cáo",onClick:u,children:e.jsx(v,{fa:"cog"})})]}),[t.MaBaoCao,u]),y=i.useMemo(()=>e.jsx(pn,{target_id:t.ID,target_module:t.LinhVuc_Id,isChange:N,IsAttachment:!0}),[t.ID,t.LinhVuc_Id,N]),f=i.useMemo(()=>c&&e.jsx(It,{open:c,onClose:()=>g(!1),filePDF:o}),[c,o]),M=i.useMemo(()=>p&&e.jsx(rs,{isOpen:p,onClose:u,ID:t.ID,reloadAll:n}),[t.ID,p,u,n]);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"form-detail-thongtin-bao-cao",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h4",{children:(V=t.DM_BaoCao)==null?void 0:V.Name}),e.jsx("p",{className:"mb-4",children:L})]}),e.jsxs("div",{className:"form-body-thongtin-bao-cao",children:[[{data:ae.MauBaoCao_Id,value:(w=t.DM_MauBaoCao)==null?void 0:w.Name},{data:ae.TanSuat_Id,value:(m=t.DM_TanSuat)==null?void 0:m.Name},{data:ae.TenDonViGui,value:(C=t.SYS_DonVi1)==null?void 0:C.TenDonVi},{data:ae.TenDonViNhan,value:(j=t.SYS_DonVi)==null?void 0:j.TenDonVi},{data:ae.MaDonViNhan,value:(k=t.SYS_DonVi)==null?void 0:k.MaDonVi},t.PhongBanTiepNhan_Id&&{data:ae.PhongBanTiepNhan_Id,value:(K=t.DM_PhongBan)==null?void 0:K.TenPhongBan},{data:ae.TrangThai,value:e.jsx(Ze,{status:t.TrangThai})},{data:ae.TGTao,value:t==null?void 0:t.TGTao},{data:ae.TGGuiBaoCao,value:t.TGGuiBaoCao},{data:ae.Period,value:t.Period}].map((E,X)=>E&&e.jsx("div",{children:e.jsx(be,{data:E.data,value:E.value,isDetail:!0})},X)),t.Thang_Id&&e.jsx(be,{data:ae.Thang_Id,value:t.Thang_Id,isDetail:!0}),t.LyDo&&(t.TrangThai===A.Tu_Choi||t.TrangThai===A.Tu_Choi_Trinh_Ky)&&e.jsx(be,{data:ae.LyDo,value:t.LyDo}),d&&d.length>0&&d.map((E,X)=>e.jsxs("div",{children:[e.jsx("strong",{style:{fontSize:"12px"},children:"File PDF"}),e.jsx("div",{className:"d-flex align-items-center gap-2 mb-3",children:E.Code==="file_du_lieu"?e.jsx("div",{children:"File PDF báo cáo dữ liệu"}):e.jsx("div",{className:"text-muted",children:"File PDF kết quả"})}),e.jsxs("div",{children:[e.jsx(Fe,{color:"success",icon:"eye",onClick:te=>{l(`${Ra}?id=${E.id_van_ban}`),g(!0)},title:"Xem trước"}),e.jsx(Fe,{color:"primary",icon:"download",onClick:te=>b(E.VanBan),title:"Tải xuống"})]})]},E.id_van_ban))]}),e.jsx(Ee,{children:y}),e.jsx(Ee,{children:f}),e.jsx(Ee,{children:M})]}),e.jsx("div",{children:e.jsx("div",{children:e.jsx(Hn,{title:"Lịch sử thao tác",children:e.jsx(En,{isChangeActivityLog:T,hasTitle:!1,target_id:t.ID,target_module:"BaoCao",isActiveLog:a})})})})]})})}const hs=$.span`
  cursor: pointer;
  transition: 0.3s;
  margin-left: 0.25rem;

  &:hover {
    color: gray;
  }

  i {
    font-size: 16px;
  }
`;var kt=["WebSocket","wss://127.0.0.1:8987/Config","onopen","send","config","onmessage","close","onclose","log","Connection is closed...","WebSocket NOT supported by your Browser!","wss://127.0.0.1:8987/SignMsg","data",'{"Error": "WebSocket NOT supported by your Browser!", "Status":500}',"wss://127.0.0.1:8987/VerifyMsg","wss://127.0.0.1:8987/VerifyPDF","wss://127.0.0.1:8987/SignOffice","wss://127.0.0.1:8987/VerifyOffice","wss://127.0.0.1:8987/SignFile","wss://127.0.0.1:8987/GetLicenseRequest","request","wss://127.0.0.1:8987/SignXML","wss://127.0.0.1:8987/GetCertInfo","get_cert_info","wss://127.0.0.1:8987/VerifyXML",'{"Message": "WebSocket NOT supported by your Browser!", "Status":500}',"wss://127.0.0.1:8987/SignXMLP12","wss://127.0.0.1:8987/SignPDFWP","wss://127.0.0.1:8987/SignIncome","wss://127.0.0.1:8987/Auth","wss://127.0.0.1:8987/SignIssued"];(function(s,t){var a=function(n){for(;--n;)s.push(s.shift())};a(++t)})(kt,341);var R=function(s,t){s=s-0;var a=kt[s];return a};function ds(s,t){if(R("0x0")in window){var a=new WebSocket("wss://127.0.0.1:8987/SignPDF");a[R("0x2")]=function(){a.send(s)},a.onerror=function(){Mt(s,t)},a[R("0x5")]=function(n){t&&t(n[R("0xc")]),a[R("0x6")]()},a[R("0x7")]=function(){console[R("0x8")](R("0x9"))}}else t&&t('{"Error": "WebSocket NOT supported by your Browser!", "Status":500}'),console.log(R("0xa"))}function us(s,t){if("WebSocket"in window){var a=new WebSocket(R("0x12"));a[R("0x2")]=function(){a[R("0x3")](s)},a.onerror=function(){Mt(s,t)},a.onmessage=function(n){t&&t(n[R("0xc")]),a[R("0x6")]()},a[R("0x7")]=function(){console[R("0x8")](R("0x9"))}}else t&&t(R("0xd")),console[R("0x8")](R("0xa"))}function Mt(s,t){if(R("0x0")in window){var a=new WebSocket(R("0x1e"));a[R("0x2")]=function(){a.send(s)},a.onerror=function(){us(s,t)},a[R("0x5")]=function(n){t&&t(n[R("0xc")]),a.close()},a.onclose=function(){console[R("0x8")](R("0x9"))}}else t&&t(R("0xd")),console[R("0x8")]("WebSocket NOT supported by your Browser!")}const xe=Jt.mixin({cancelButtonColor:"#d33"});class gs{constructor(){q(this,"defaultErrorSwal",{title:"Đã xảy ra lỗi!",text:"Vui lòng thử lại",confirmButtonText:"Thử lại",cancelButtonText:"Đóng",icon:"error",showCancelButton:!0});q(this,"defaultSuccessSwal",{icon:"success",showConfirmButton:!0,showCancelButton:!1,confirmButtonText:"Xác nhận",allowOutsideClick:!0,title:"Thành công",text:""});q(this,"handleSuccess",(t,a)=>n=>{typeof a=="function"&&a(n);const o=()=>typeof t=="string"?{title:t}:typeof t(n)=="object"?t(n):{title:t(n)},l=t!==void 0?{...this.defaultSuccessSwal,...o()}:this.defaultSuccessSwal;return xe.isVisible()?xe.update(l):xe.fire(l)});q(this,"handleError",t=>a=>{const{onError:{getSwal:n,callback:o}={}}=t;typeof o=="function"&&o(a);const l=()=>typeof n=="string"?{...this.defaultErrorSwal,title:n}:typeof n=="function"?{...this.defaultErrorSwal,...n(a)}:this.defaultErrorSwal;return xe.fire({preConfirm:()=>this.onOpen(t,!0),...l()})});q(this,"onOpen",(t,a)=>{const{confirmSwal:n,pendingSwal:o,callAPIFn:l,onSuccess:{getSwal:c,callback:g}={}}=t;if(typeof l!="function")throw new Error("bro what the fck");const T=()=>{xe.showLoading(),l().then(this.handleSuccess(c,g)).catch(this.handleError(t)).finally(xe.hideLoading)},x={icon:"info",title:"Đang xử lý",showConfirmButton:!1,showCancelButton:!1,allowOutsideClick:!xe.isLoading,onOpen:T},d=()=>o===void 0?x:typeof o=="object"?{...x,...o}:typeof o=="string"?{...x,title:o}:x,r=()=>typeof n=="object"?n:typeof n=="string"?{title:n}:{},p=()=>xe.fire(d()),u={icon:"question",confirmButtonText:"Xác nhận",cancelButtonText:"Hủy",showCancelButton:!0,showConfirmButton:!0,text:"Thao tác này không thể hoàn tác!",preConfirm:N=>{if(N)return p()}};return n?a?p():xe.fire({...u,...r()}):p()})}}const xs=new gs,ms=i.memo(s=>{const{open:t,onClose:a,onSave:n,label:o="Lý do từ chối:",placeholder:l="Nhập lý do từ chối"}=s,[c,g]=i.useState("");return e.jsx(un,{open:t,handleClose:onclose,title:"Từ chối",maxWidth:"sm",renderButton:e.jsxs("div",{children:[e.jsx(Pe,{onClick:a,children:"Hủy"}),e.jsx(wn,{onClick:()=>n(c),children:"Lưu"})]}),children:e.jsxs(ya,{row:!0,children:[e.jsx(oe,{md:"4",children:e.jsx(ba,{htmlFor:"select",children:e.jsxs("b",{children:[o," ",e.jsx("span",{style:{color:"red"},children:"(*)"})]})})}),e.jsx(oe,{md:"8",children:e.jsx(oa,{name:"ly_do",placeholder:l,onChange:T=>g(T.target.value),rows:5})})]})})});function Ts(s){const{onClose:t,isOpen:a,MauBaoCao_Id:n,data_id:o}=s,[l,c]=i.useState([]),g=i.useCallback(()=>{n&&S(`BaoCaos/GetDownloadList?MauBaoCao_Id=${n}`,"GET",null,{odata:!1}).then(x=>c(x))},[n]),T=i.useMemo(()=>l.map((x,d)=>e.jsxs("tr",{children:[e.jsx("td",{className:"text-center",children:d+1}),e.jsx("td",{children:x.Name}),e.jsxs("td",{style:{textAlign:"center"},children:[e.jsxs("span",{children:[" ",e.jsx(ps,{MauBaoCao_HTML_Id:x.Id,data_id:o})," "]})," "]})]},d)),[l,o]);return i.useEffect(()=>{g()},[g]),e.jsxs(en,{isOpen:a,toggle:t,zIndex:"1500",size:"lg",children:[e.jsx(Je,{style:{backgroundColor:"rgb(3,56,99)"},className:"text-white",children:e.jsx("b",{children:"Phiên bản tải xuống"})}),e.jsx(Qe,{children:e.jsxs("table",{className:"customers-table-download",children:[e.jsx("thead",{children:e.jsxs("tr",{style:{textAlign:"center",background:"#4dbd74",color:"white"},children:[e.jsx("th",{children:"STT"}),e.jsx("th",{children:"Mẫu báo cáo"}),e.jsx("th",{children:"Phiên bản"})]})}),e.jsx("tbody",{children:T})]})}),e.jsx(gn,{children:e.jsx(Pe,{size:"md",onClick:t,children:e.jsx("b",{children:"Trở lại"})})})]})}const ps=s=>{const{MauBaoCao_HTML_Id:t,data_id:a}=s,[n,o]=i.useState(!1),l="BaoCaos/GeneratePDF",c=()=>o(!n),g=(T="pdf")=>{let x=T;T==="excel"&&(x="xlsx"),T==="word"&&(x="docx"),T==="xml"&&(x="xml"),dn(`${l}?id=${a}&MauBaoCao_HTML_Id=${t}&pageSize=A4&landscape=true&mode=download_${T}`,`Tải xuống.${x}`,"GET",null,!0).then(()=>{}).catch(()=>H("Đã xảy ra lỗi tải file!","Thông báo"))};return e.jsxs(vn,{isOpen:n,toggle:c,className:"mr-2",children:[e.jsxs(qe,{caret:!0,color:"success",size:"sm",children:[e.jsx(v,{fa:"print"})," Tải xuống"]}),e.jsxs(Ue,{children:[e.jsx(z,{onClick:()=>g(),children:"PDF"}),e.jsx(z,{onClick:()=>g("excel"),children:"Excel"}),e.jsx(z,{onClick:()=>g("word"),children:"Word"}),e.jsx(z,{onClick:()=>g("xml"),children:"XML"})]})]})};function fs(s){const{onClose:t,isOpen:a,MauBaoCao_Id:n,data_id:o,handleShowPDFSLT:l,checkDonVi:c}=s,[g,T]=i.useState([]),x=i.useCallback(()=>{n&&S(`BaoCaos/GetDownloadList?MauBaoCao_Id=${n}`,"GET",null,{odata:!1}).then(r=>T(r))},[n]),d=i.useMemo(()=>g.map((r,p)=>{if(c){if(r.Id)return e.jsxs("tr",{children:[e.jsx("td",{className:"text-center",children:p}),e.jsx("td",{children:r.Name}),e.jsx("td",{style:{textAlign:"center"},children:e.jsx("span",{children:e.jsx(gt,{handleShowPDFSLT:l,MauBaoCao_HTML_Id:r.Id,data_id:o,onClose:t})})})]},p)}else return e.jsxs("tr",{children:[e.jsx("td",{className:"text-center",children:p}),e.jsx("td",{children:r.Name}),e.jsx("td",{style:{textAlign:"center"},children:e.jsx("span",{children:e.jsx(gt,{handleShowPDFSLT:l,MauBaoCao_HTML_Id:r.Id,data_id:o,onClose:t})})})]},p)}),[g,o]);return i.useEffect(()=>{x()},[x]),e.jsxs(en,{isOpen:a,toggle:t,zIndex:"1500",size:"lg",children:[e.jsx(Je,{style:{backgroundColor:"rgb(3,56,99)"},className:"text-white",children:e.jsx("b",{children:"Phiên bản xem PDF"})}),e.jsx(Qe,{children:e.jsxs("table",{className:"customers-table-download",children:[e.jsx("thead",{children:e.jsxs("tr",{style:{textAlign:"center",background:"#4dbd74",color:"white"},children:[e.jsx("th",{children:"STT"}),e.jsx("th",{children:"Mẫu báo cáo"}),e.jsx("th",{children:"Xem"})]})}),e.jsx("tbody",{children:d})]})}),e.jsx(gn,{children:e.jsx(Pe,{size:"md",onClick:t,children:e.jsx("b",{children:"Trở lại"})})})]})}const gt=s=>{const{MauBaoCao_HTML_Id:t,data_id:a,handleShowPDFSLT:n,onClose:o}=s,[l,c]=i.useState(!1),g=()=>c(!l),T=()=>{n(`api/BaoCaos/GeneratePDF?id=${a}&MauBaoCao_HTML_Id=${t}`),o()};return e.jsxs(F,{color:"success",isOpen:l,toggle:g,className:"mr-2",onClick:()=>T(),children:[e.jsx(v,{fa:"eye"})," Xem PDF"]})};function xt(){const{innerWidth:s,innerHeight:t}=window;return{width:s,height:t}}function Cs(){const[s,t]=i.useState(xt());return i.useEffect(()=>{function a(){t(xt())}return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]),s}function Ds(s){const{onClose:t,isOpen:a,MauBaoCao_Id:n,data_id:o,handleShowPDFSLT:l,checkDonVi:c,getDataBaoCao:g}=s,[T,x]=i.useState([]),d=i.useCallback(()=>{n&&S(`BaoCaos/GetDownloadList?MauBaoCao_Id=${n}`,"GET",null,{odata:!1}).then(p=>x(p))},[n]),r=i.useMemo(()=>T.map((p,h)=>{if(c){if(p.Id)return e.jsxs("tr",{children:[e.jsx("td",{className:"text-center",children:h}),e.jsx("td",{children:p.Name}),e.jsxs("td",{style:{textAlign:"center"},children:[e.jsxs("span",{children:[" ",e.jsx(mt,{handleShowPDFSLT:l,MauBaoCao_HTML_Id:p.Id,data_id:o,getDataBaoCao:g})," "]})," "]})]},h)}else return e.jsxs("tr",{children:[e.jsx("td",{className:"text-center",children:h}),e.jsx("td",{children:p.Name}),e.jsxs("td",{style:{textAlign:"center"},children:[e.jsxs("span",{children:[" ",e.jsx(mt,{handleShowPDFSLT:l,MauBaoCao_HTML_Id:p.Id,data_id:o,getDataBaoCao:g})," "]})," "]})]},h)}),[T,o]);return i.useEffect(()=>{d()},[d]),e.jsxs(en,{isOpen:a,toggle:t,zIndex:"1300",size:"lg",children:[e.jsx(Je,{style:{backgroundColor:"rgb(3,56,99)"},className:"text-white",children:e.jsx("b",{children:"Phiên bản xác nhận"})}),e.jsx(Qe,{children:e.jsxs("table",{className:"customers-table-download",children:[e.jsx("thead",{children:e.jsxs("tr",{style:{textAlign:"center",background:"#4dbd74",color:"white"},children:[e.jsx("th",{children:"STT"}),e.jsx("th",{children:"Mẫu báo cáo"}),e.jsx("th",{children:"Xác nhận"})]})}),e.jsx("tbody",{children:r})]})}),e.jsx(gn,{children:e.jsx(Pe,{size:"md",onClick:t,children:e.jsx("b",{children:"Trở lại"})})})]})}const mt=s=>{const{MauBaoCao_HTML_Id:t,data_id:a,handleShowPDFSLT:n,getDataBaoCao:o}=s,[l,c]=i.useState(!1),g=()=>c(!l),T=(x="pdf")=>{S(`BaoCaos/GeneratePDF?id=${a}&MauBaoCao_HTML_Id=${t}&isUpdate=true`,"GET",null,{odata:!1}).then(d=>{G("Xác nhận dữ liệu thành công","Thông báo"),o()}).catch(d=>{H("Lỗi","Thông báo"),o()})};return e.jsxs(F,{color:"success",isOpen:l,toggle:g,className:"mr-2",onClick:()=>T(),children:[e.jsx(v,{fa:"check"})," Xác nhận"]})};function js(s){const{onClose:t,isOpen:a,MauBaoCao_Id:n,data_id:o,handleShowPDFSLT:l,checkDonVi:c,setOpenKySoSoBanNganh:g,setIdMauBaoCao:T}=s,[x,d]=i.useState([]);i.useState(!1);const r=i.useCallback(()=>{n&&S(`BaoCaos/GetDownloadList?MauBaoCao_Id=${n}`,"GET",null,{odata:!1}).then(h=>d(h))},[n]),p=i.useMemo(()=>x.map((h,u)=>{if(c){if(h.Id)return e.jsxs("tr",{children:[e.jsx("td",{className:"text-center",children:u}),e.jsx("td",{children:h.Name}),e.jsxs("td",{style:{textAlign:"center"},children:[e.jsxs("span",{children:[" ",e.jsxs(F,{color:"success",className:"mr-2",onClick:()=>{h.Id&&T(h.Id),g(!0)},children:[e.jsx(v,{fa:"check"})," Ký số"]})]})," "]})]},u)}else return e.jsxs("tr",{children:[e.jsx("td",{className:"text-center",children:u}),e.jsx("td",{children:h.Name}),e.jsxs("td",{style:{textAlign:"center"},children:[e.jsxs("span",{children:[" ",e.jsxs(F,{color:"success",className:"mr-2",onClick:()=>{h.Id&&T(h.Id),g(!0)},children:[e.jsx(v,{fa:"check"})," Ký số"]})," "]})," "]})]},u)}),[x,o]);return i.useEffect(()=>{r()},[r]),e.jsxs(en,{isOpen:a,toggle:t,zIndex:"1300",size:"lg",children:[e.jsx(Je,{style:{backgroundColor:"rgb(3,56,99)"},className:"text-white",children:e.jsx("b",{children:"Phiên bản ký số"})}),e.jsx(Qe,{children:e.jsxs("table",{className:"customers-table-download",children:[e.jsx("thead",{children:e.jsxs("tr",{style:{textAlign:"center",background:"#4dbd74",color:"white"},children:[e.jsx("th",{children:"STT"}),e.jsx("th",{children:"Mẫu báo cáo"}),e.jsx("th",{children:"Ký số"})]})}),e.jsx("tbody",{children:p})]})}),e.jsx(gn,{children:e.jsx(Pe,{size:"md",onClick:t,children:e.jsx("b",{children:"Trở lại"})})})]})}const ys=38,bs=s=>Qt(`/Dieu19/XoaBaoCao?baoCao_Id=${s}`,"DELETE",null,1+1==3),jn=$(vn)`
  .btn-primary:focus,
  .btn-primary.focus {
    box-shadow: none !important;
  }
  .btn-success:focus,
  .btn-success.focus {
    box-shadow: none !important;
  }
  .btn-warning:focus,
  .btn-warning.focus {
    box-shadow: none !important;
  }
`;function Tt(s){var st,ot,it,lt;const{data:{TrangThai:t,IsTrinhKy:a},data:n,BaoCaoDi:o,setOpenKySoDoanhNghiep:l,setOpenKySoSoBanNganh:c,setIdMauBaoCao:g,handleShowPDF:T,onClose:x,reloadData:d,getDataBaoCao:r,setIsActiveLog:p,reportCode:h,isChange:u,setisChange:N,handleClose:B,handleShowPDFSLT:b,handleCheckDataSynthesis:L,handleReloadDetailChiTiet:y,disabledTiepNhan:f}=s,M=bn(),{Them:V,Xoa:w,Download:m,Upload:C,Xem:j,TrinhKy:k,KySo:K,Gui:E,TiepNhanTrinhKy:X,TiepNhanBaoCao:te}=wt(M==null?void 0:M.pathname),Ae=()=>{yt(`${we}?id=${n.ID}`).then(D=>D.blob()).then(D=>{const I=new FormData;I.append("ma_tai_khoan",_.MaTaiKhoan),I.append("uploadfile",D),bt(`${Ke}?id_bao_cao=${n.ID}`,I).then(O=>{O.Status?G("Ký số thành công !").then(()=>{var ze;let W=new se;W.from_id=_.IDDonVi,W.to_id=_.IDDonVi,W.title=_.TenDonVi,W.body="Ký số "+((ze=n.DM_BaoCao)==null?void 0:ze.Name),W.target_id=n.ID,W.target_module="BaoCao",W.hanh_dong="da_ky_so",N(!1),d(),r(),p(!0)}):H("Ký số không thành công !")}).catch(O=>console.log(O))}).catch(D=>console.log(D))},fe=i.useCallback(()=>_.Dieu18_SoLieuTinh===!0&&(n.DM_MauBaoCao.Code===123||n.DM_MauBaoCao.Code===125),[n.DM_MauBaoCao.Code]),[Ce,nn]=i.useState(!1),[De,tn]=i.useState(!1),[Ne,he]=i.useState(!1),[Ie,fn]=i.useState(!1),ue=i.useCallback(()=>nn(!Ce),[Ce]),Oe=i.useCallback(()=>tn(!De),[De]),Ge=i.useCallback(()=>he(!Ne),[Ne]),ke=i.useCallback(()=>{const D=n.DM_MauBaoCao.Code;me("KYSO_GIALAP")||n.LinhVuc_Id==="a08e3e74-3bfa-41ef-b105-e3f3e752bd5c"?D===36||D===16?Z("Đơn vị chưa cài đặt tự chủ! Cài đặt tự chủ để tiếp tục ký số","THÔNG BÁO"):Ae():fn(!Ie)},[n.DM_MauBaoCao.Code,n.LinhVuc_Id,Ae,Ie]),[ie,ge]=i.useState(!1);i.useState(!1),i.useState(!1);const[Fn,an]=i.useState(""),[Cn,P]=i.useState(0),{height:J,width:_e}=Cs();i.useEffect(()=>{window.screen.width<1536&&an("0.66563rem")},[]);const le=i.useMemo(()=>ie&&ie.isOpen&&ie.onSave&&e.jsx(ms,{open:ie.isOpen,onClose:()=>ge(null),onSave:ie.onSave,label:ie.label,placeholder:ie.placeholder}),[ie]);i.useCallback(()=>{S(`BaoCaos/GeneratePDF?id=${n.ID}&isUpdate=true`,"GET",null,{odata:!1}).then(D=>{G("Xác nhận dữ liệu thành công","Thông báo"),r()}).catch(D=>{G("Xác nhận dữ liệu thành công","Thông báo"),r()})},[n.ID]);const je=()=>{const D=n.DM_MauBaoCao.Code;me("KYSO_GIALAP")||n.LinhVuc_Id==="a08e3e74-3bfa-41ef-b105-e3f3e752bd5c"?D===36||D===16?Z("Đơn vị chưa cài đặt tự chủ! Cài đặt tự chủ để tiếp tục ký số","THÔNG BÁO"):Ae():c(!0)},sn=()=>{me("KYSO_GIALAP")?Ae():l(!0)},Re=D=>{u?U("Bạn chưa lưu dữ liệu, bạn chắc chắn muốn ký số?").then(()=>D()):D()},Vn=i.useCallback(()=>ge({isOpen:!0,label:"Lý do hủy ký số:",placeholder:"Nhập lý do từ chối",onSave:D=>{D?S("BaoCaos/HuyKySo","POST",JSON.stringify({id:n.ID,ly_do:D}),{odata:!1}).then(()=>G("Hủy ký số thành công","Thông báo").then(()=>{var O;let I=new se;I.from_id=_.IDDonVi,I.to_id=_.IDDonVi,I.title=_.TenDonVi,I.body="Hủy ký số "+((O=n.DM_BaoCao)==null?void 0:O.Name),I.target_id=n.ID,I.target_module="BaoCao",I.hanh_dong="huy-ky-so",N(!1),p(!0),d(),r(),ge(null)})).catch(I=>H("Hủy báo cáo không thành công","Thông báo")):Z("Vui lòng nhập lý do hủy ký số!","THÔNG BÁO")}}),[n,r,d,p,N]),Pn=()=>{S("BaoCaos/GuiBaoCao","POST",JSON.stringify({id:n.ID}),{odata:!1}).then(D=>G("Gửi báo cáo thành công!","Thông báo").then(()=>{var O;let I=new se;I.from_id=_.IDDonVi,I.to_id=n.DonViNhan_Id,I.title=_.TenDonVi,I.body="Gửi "+((O=n.DM_BaoCao)==null?void 0:O.Name),I.target_id=n.ID,I.target_module="BaoCao",I.hanh_dong="gui",d(),x()})).catch(D=>console.log(D))},On=()=>{U(`Bạn muốn tiếp nhận với mã báo cáo '${n.MaBaoCao}' ?`).then(()=>S(`${za}`,"POST",JSON.stringify({id:n.ID}),{odata:!1}).then(()=>G("Tiếp nhận báo cáo thành công!","Thông báo").then(()=>{var I;let D=new se;D.from_id=_.IDDonVi,D.to_id=n.DonVi_Id,D.title=_.TenDonVi,D.body="Tiếp nhận "+((I=n.DM_BaoCao)==null?void 0:I.Name),D.target_id=n.ID,D.target_module="BaoCao",D.hanh_dong="da_duyet",d(),r(),x()}))).catch(D=>H("Đã xảy ra lỗi khi tiếp nhận báo cáo !"))},Gn=()=>{let D=(M==null?void 0:M.pathname)==="/phe-duyet",I=D?`BaoCaos/HuyTiepNhan?baoCao_Id=${n==null?void 0:n.ID}`:`BaoCaos('${n==null?void 0:n.ID}')`,O=D?"POST":"PATCH",W=D?null:JSON.stringify({TrangThai:2});U("Bạn có chắc chắn muốn thực hiện").then(()=>S(I,O,W,{odata:!D}).then(()=>G("Hoàn tác tiếp nhận báo cáo thành công!","Thông báo").then(()=>{d(),r(),x()}))).catch(ze=>H("Đã xảy ra lỗi khi tiếp nhận báo cáo !"))},Rn=i.useCallback(()=>ge({isOpen:!0,onSave:D=>{D?S(`${Ya}`,"POST",JSON.stringify({id:n.ID,ly_do:D}),{odata:!1}).then(()=>G("Từ chối báo cáo thành công","Thông báo").then(()=>{var O;let I=new se;I.from_id=_.IDDonVi,I.to_id=n.DonVi_Id,I.title=_.TenDonVi,I.body="Từ chối báo cáo "+((O=n.DM_BaoCao)==null?void 0:O.Name),I.target_id=n.ID,I.target_module="BaoCao",I.hanh_dong="tu_choi",d(),r(),x()})).catch(I=>H(I,"Thông báo")):Z("Vui lòng nhập lý do từ chối!","THÔNG BÁO")}}),[(st=n.DM_BaoCao)==null?void 0:st.Name,n.DonVi_Id,n.ID,r,x,d,ge]),zn=()=>{if(!n.ID)return H("Không tìm thấy Id báo cáo.Vui lòng thử lại!","Lỗi!");if(h===ys)return xs.onOpen({callAPIFn:()=>bs(n.ID),confirmSwal:{title:"Thông báo",text:"Bạn có chắc muốn xóa báo cáo này",icon:void 0},pendingSwal:"Đang xóa báo cáo",onSuccess:{callback:()=>{d(),x()},getSwal:"Báo cáo đã được xóa!"},onError:{callback:console.log,getSwal:"Không thể xóa báo cáo, vui lòng thử lại!"}});U("Bạn chắc chắn muốn xóa báo cáo này?","Thông báo").then(D=>{S(`BaoCaos('${n.ID}')`,"DELETE",null).then(I=>G("Xóa báo cáo thành công","Thông báo").then(()=>{d(),x()})).catch(I=>H("Xóa báo cáo không thành công","Thông báo"))})},Yn=i.useCallback(()=>n&&S("BaoCaos/TrinhKy","POST",JSON.stringify({id:n.ID}),{odata:!1}).then(()=>{var I;let D=new se;D.from_id=_.IDDonVi,D.to_id=_.IDDonVi,D.title=_.TenDonVi,D.body="Trình ký "+((I=n.DM_BaoCao)==null?void 0:I.Name),D.target_id=n.ID,D.target_module="BaoCao",D.hanh_dong="trinh_ky",d(),r(),G("Trình ký thành công","Thông báo")}).catch(()=>H("Không thể trình ký","Thông báo")),[n,r,d]),Xn=i.useCallback(()=>n&&S("BaoCaos/TiepNhanTrinhKy","POST",JSON.stringify({id:n.ID}),{odata:!1}).then(()=>{var I;let D=new se;D.from_id=_.IDDonVi,D.to_id=_.IDDonVi,D.title=_.TenDonVi,D.body="Tiếp nhận trình ký "+((I=n.DM_BaoCao)==null?void 0:I.Name),D.target_id=n.ID,D.target_module="BaoCao",D.hanh_dong="tiep_nhan_trinh_ky",d(),r(),G("Tiếp nhận trình ký thành công","Thông báo")}).catch(()=>H("Không thể tiếp nhận trình ký","Thông báo")),[n,r,d]),qn=i.useCallback(()=>ge({isOpen:!0,onSave:D=>{D?S("BaoCaos/TuChoiTrinhKy","POST",JSON.stringify({id:n.ID,ly_do:D}),{odata:!1}).then(()=>G("Từ chối trình ký thành công","Thông báo").then(()=>{var O;let I=new se;I.from_id=_.IDDonVi,I.to_id=_.IDDonVi,I.title=_.TenDonVi,I.body="Từ chối trình ký"+((O=n.DM_BaoCao)==null?void 0:O.Name),I.target_id=n.ID,I.target_module="BaoCao",I.hanh_dong="tu_choi_trinh_ky",d(),r(),x()})).catch(I=>H("Từ chối trình ký không thành công","Thông báo")):Z("Vui lòng nhập lý do từ chối!","THÔNG BÁO")}}),[(ot=n.DM_BaoCao)==null?void 0:ot.Name,n.ID,r,x,d]);_.MaLoaiDonVi;const Be=n&&Xa&&!n.PhongBanTiepNhan_Id?!0:(n==null?void 0:n.PhongBanTiepNhan_Id)===_.PhongBan_Id;i.useEffect(()=>{const D=[m,o&&k&&a,o&&X&&a,o&&K&&_.LoaiKySo===1,o&&K&&_.LoaiKySo===2,o&&K,o&&E,o&&w,!o&&te&&Be,o&&V],I=[];D.forEach(W=>{let ze=!(!W||W===void 0);I.push(+ze)});let O=0;I.forEach(W=>O+=W),P(O)},[o,a,Be]);const Un=i.useMemo(()=>!(t===A.Tu_Choi||t===A.Tu_Choi_Trinh_Ky),[t]),on=i.useMemo(()=>a===!0?t!==A.Da_Tiep_Nhan_Trinh_Ky:t!==A.Khoi_Tao,[a,t]),Wn=i.useCallback(()=>{var D;if(n){let I={HanhDong:ee.ChinhSuaBaoCao,NoiDung:(D=n.DM_BaoCao)==null?void 0:D.Name,DonViGui_Id:n.DonVi_Id,DonViNhan_Id:n.DonViNhan_Id,DaXemThongBao:!1,Target_Id:n.ID,Targer_Module:Da.BaoCao};Promise.all([S("SYS_ThongBao","POST",JSON.stringify(I)),(M==null?void 0:M.pathname)==="/de-xuat"||(M==null?void 0:M.pathname)==="/phe-duyet"?S(`BaoCaos/ChinhSuaBaoCao?baoCao_Id=${n.ID}`,"POST",null,{odata:!1}):S(`BaoCaos('${n.ID}')`,"PATCH",JSON.stringify({TrangThai:A.Khoi_Tao}))]).then(()=>{var W;let O=new se;O.from_id=_.IDDonVi,O.to_id=_.IDDonVi,O.title=_.TenDonVi,O.body="Chỉnh sửa báo cáo"+((W=n.DM_BaoCao)==null?void 0:W.Name),O.target_id=n.ID,O.target_module="BaoCao",O.hanh_dong=ee.ChinhSuaBaoCao,d(),r()}).catch(()=>{H("Không thể chỉnh sửa","Thông báo"),S(`BaoCaos('${n.ID}')`,"PATCH",JSON.stringify({TrangThai:A.Tu_Choi}))})}},[n,r,d]),$n=i.useMemo(()=>Ce&&e.jsx(Ts,{MauBaoCao_Id:n.MauBaoCao_Id,data_id:n.ID,isOpen:Ce,onClose:ue}),[n,Ce,ue]),Jn=i.useMemo(()=>De&&e.jsx(fs,{checkDonVi:fe(),MauBaoCao_Id:n.MauBaoCao_Id,data_id:n.ID,isOpen:De,onClose:Oe,handleShowPDFSLT:b}),[n,De,Oe,b]),Qn=i.useMemo(()=>Ne&&e.jsx(Ds,{checkDonVi:fe(),MauBaoCao_Id:n.MauBaoCao_Id,data_id:n.ID,isOpen:Ne,onClose:Ge,getDataBaoCao:r}),[Ne,n,Ge,r]),Et=i.useMemo(()=>Ie&&e.jsx(js,{checkDonVi:fe(),MauBaoCao_Id:n.MauBaoCao_Id,data_id:n.ID,isOpen:Ie,onClose:ke,getDataBaoCao:r,r:!0,setOpenKySoSoBanNganh:c,setIdMauBaoCao:g}),[Ie,fe,n.MauBaoCao_Id,n.ID,ke,r,c]),[Zn,Kt]=i.useState(!1),Ft=()=>Kt(!Zn),[et,Vt]=i.useState(!1),Pt=()=>Vt(!et),[nt,Ot]=i.useState(!1),Gt=()=>Ot(!nt),ln=((it=n==null?void 0:n.BaoCao2)==null?void 0:it.TrangThai)!==void 0;((lt=n==null?void 0:n.BaoCao2)==null?void 0:lt.TrangThai)===A.Cho_Duyet||A.Da_Duyet||A.Tu_Choi;const[Dn,Rt]=i.useState([]),[Me,zt]=i.useState(!1),rn=n&&n.DM_MauBaoCao&&n.DM_MauBaoCao.TieuDeCon==="BaoCaoThucHienGiaiNgan"||n.DM_MauBaoCao.TieuDeCon==="BaoCaoGiaiNgan"||n.DM_MauBaoCao.TieuDeCon==="BaoCaoDoiTuongHoTro";n&&n.DM_MauBaoCao&&n.DM_MauBaoCao.TieuDeCon==="BaoCaoThucHienGiaiNgan"||n.DM_MauBaoCao.TieuDeCon;const cn=i.useCallback(()=>{S(`BaoCaos('${n.ID}')?$expand=HNCN_TrangThaiDuLieu`,"GET",null,{odata:!0}).then(D=>{var I,O;console.log((I=D.HNCN_TrangThaiDuLieu[0])==null?void 0:I.DaChotDuLieu),Rt(D.HNCN_TrangThaiDuLieu),zt((O=D.HNCN_TrangThaiDuLieu[0])==null?void 0:O.DaChotDuLieu)}).catch(D=>{console.log(D)})},[n.ID]),tt=i.useCallback(()=>{U(`Chốt số liệu năm ${n==null?void 0:n.NamBanHanh}?`,"Thông báo").then(()=>{S(`BaoCaoExt/ChotDuLieu?baoCao_Id=${n.ID}`,"POST",null,{odata:!1}).then(D=>{G(D,"Thông báo"),d(),cn(),L()}).catch(D=>{H(D,"Thông báo")})})},[]),at=i.useCallback(()=>{U(`Huỷ chốt dữ liệu năm ${n==null?void 0:n.NamBanHanh}?`,"Thông báo").then(()=>{var D;S(`HNCN_TrangThaiDuLieu(${Dn&&((D=Dn[0])==null?void 0:D.Id)})`,"PATCH",JSON.stringify({DaChotDuLieu:!1}),{odata:!0}).then(()=>{G("Huỷ chốt dữ liệu thành công","Thông báo"),cn(),L(),d()}).catch(()=>H("Huỷ chốt dữ liệu không thành công","Thông báo"))})},[Dn]);return i.useEffect(()=>{cn()},[cn]),t||t===0?e.jsxs("div",{className:"form-render-button",children:[_e<1500?e.jsxs(e.Fragment,{children:[m&&e.jsxs(jn,{className:"me-2",isOpen:Zn,toggle:Ft,children:[e.jsx(qe,{color:"primary",caret:!0,size:"sm",children:"Thao tác với PDF"}),e.jsx(Ue,{children:m&&e.jsxs(e.Fragment,{children:[e.jsxs(z,{onClick:ue,children:[e.jsx(v,{fa:"download"}),"Tải xuống"]}),e.jsxs(z,{onClick:()=>T(n),children:[e.jsx(v,{fa:"eye"}),"Xem file PDF"]})]})})]}),(o&&k&&a||o&&X&&a||o&&E||!o&&te&&Be||o&&V)&&e.jsxs(jn,{className:"me-2",isOpen:et,toggle:Pt,children:[e.jsx(qe,{color:"success",caret:!0,size:"sm",children:"Thao tác với báo cáo"}),e.jsxs(Ue,{children:[o&&k&&a&&e.jsxs(z,{disabled:t!==A.Khoi_Tao&&t!==A.Tu_Choi,onClick:Yn,children:[e.jsx(v,{fa:"pencil-square-o"})," Trình ký"]}),o&&X&&a&&e.jsxs(z,{disabled:t!==A.Da_Trinh_Ky,onClick:Xn,children:[e.jsx(v,{fa:"pencil-square-o"})," Tiếp nhận trình ký"]}),o&&X&&a&&e.jsxs(z,{onClick:qn,children:[e.jsx(v,{fa:"pencil-square-o"})," Từ chối trình ký"]}),o&&E&&e.jsxs(z,{disabled:t!==A.Da_Ki_So,onClick:Pn,children:[e.jsx(v,{fa:"paper-plane"})," Gửi báo cáo"]}),ne&&rn&&o&&!K&&e.jsxs(z,{disabled:Me,onClick:tt,children:[e.jsx(v,{fa:"check-square-o"})," Chốt số liệu"]}),ne&&rn&&o&&!K&&e.jsxs(z,{disabled:!Me,onClick:at,children:[e.jsx(v,{fa:"ban"})," Huỷ chốt số liệu"]}),o&&w&&e.jsxs(z,{disabled:Me?!0:t!==A.Khoi_Tao&&t!==A.Tu_Choi&&t!==A.Tu_Choi_Trinh_Ky,onClick:zn,children:[e.jsx(v,{fa:"trash"})," Xóa báo cáo"]}),!o&&te&&Be&&e.jsx(z,{onClick:On,disabled:f||t!==A.Cho_Duyet,children:"Tiếp nhận báo cáo đến"}),!o&&t===A.Da_Duyet&&e.jsx(z,{onClick:Gn,disabled:t!==A.Tu_Choi?!!(ln&&t!==A.Cho_Duyet):!0,children:"Hoàn tác"}),!o&&te&&Be&&e.jsx(z,{onClick:Rn,disabled:t!==A.Tu_Choi?!!(ln&&t!==A.Cho_Duyet):!0,children:"Từ chối báo cáo đến"}),o&&V&&e.jsxs(z,{disabled:Un,onClick:Wn,children:[e.jsx(v,{fa:"edit"})," Chỉnh sửa"]})]})]}),(o&&K&&_.LoaiKySo===1||o&&K&&_.LoaiKySo===2||o&&K)&&e.jsxs(jn,{className:"me-2",isOpen:nt,toggle:Gt,children:[e.jsx(qe,{color:"warning",caret:!0,size:"sm",children:"Thao tác với ký số"}),e.jsxs(Ue,{children:[o&&K&&_.LoaiKySo===1&&e.jsxs(z,{disabled:on,onClick:()=>Re(je),children:[e.jsx(v,{fa:"pencil-square-o"})," Ký số"]}),o&&K&&_.LoaiKySo===2&&e.jsxs(z,{disabled:on,onClick:()=>Re(sn),children:[e.jsx(v,{fa:"pencil-square-o"})," Ký số"]}),o&&K&&e.jsxs(z,{disabled:t!==A.Da_Ki_So,onClick:Vn,children:[e.jsx(v,{fa:"times"})," Hủy ký số"]})]})]}),$n,Jn,le,Qn]}):e.jsxs(e.Fragment,{children:[m&&e.jsxs(F,{color:"primary",size:"sm",onClick:ue,className:"me-2",children:[" ","Tải Xuống"]}),m&&e.jsx(F,{color:"primary",size:"sm",onClick:Oe,className:"me-2",children:"Xem file PDF"}),o&&k&&a&&e.jsxs(F,{onClick:Yn,disabled:t!==A.Khoi_Tao&&t!==A.Tu_Choi,color:"primary",size:"sm",className:"me-2",children:[e.jsx(v,{fa:"pencil-square-o"})," Trình ký"]}),o&&X&&a&&e.jsxs(F,{onClick:Xn,disabled:t!==A.Da_Trinh_Ky,color:"primary",size:"sm",className:"me-2",children:[e.jsx(v,{fa:"pencil-square-o"})," Tiếp nhận trình ký"]}),o&&X&&a&&e.jsxs(F,{onClick:qn,color:"danger",size:"sm",className:"me-2",children:[e.jsx(v,{fa:"pencil-square-o"})," Từ chối trình ký"]}),o&&K&&_.LoaiKySo===1&&e.jsxs(F,{onClick:ke,disabled:on,color:"primary",size:"sm",className:"me-2",children:[e.jsx(v,{fa:"pencil-square-o"})," Ký số"]}),o&&K&&_.LoaiKySo===2&&e.jsxs(F,{onClick:()=>Re(sn),disabled:on,color:"primary",size:"sm",className:"me-2",children:[e.jsx(v,{fa:"pencil-square-o"})," Ký số"]}),o&&K&&e.jsxs(F,{onClick:Vn,disabled:t!==A.Da_Ki_So,color:"primary",size:"sm",className:"me-2",children:[e.jsx(v,{fa:"pencil-square-o"})," Hủy ký số"]}),o&&E&&e.jsxs(F,{onClick:Pn,disabled:t!==A.Da_Ki_So,color:"success",size:"sm",className:"me-2",children:[e.jsx(v,{fa:"paper-plane"})," Gửi báo cáo"]}),ne&&rn&&o&&!K&&e.jsxs(F,{onClick:tt,disabled:Me,color:"success",size:"sm",className:"me-2",children:[e.jsx(v,{fa:"check-square-o"})," Chốt số liệu"]}),ne&&rn&&o&&!K&&e.jsxs(F,{onClick:at,disabled:!Me,color:"danger",size:"sm",className:"me-2",children:[e.jsx(v,{fa:"ban"})," Huỷ chốt số liệu"]}),o&&w&&e.jsxs(F,{onClick:zn,disabled:Me?!0:t!==A.Khoi_Tao&&t!==A.Tu_Choi&&t!==A.Tu_Choi_Trinh_Ky,color:"danger",size:"sm",className:"me-2",children:[e.jsx(v,{fa:"trash"})," Xóa báo cáo"]}),!o&&te&&Be&&e.jsx(F,{onClick:On,disabled:f||t!==A.Cho_Duyet,color:"success",size:"sm",className:"me-2",children:"Tiếp nhận báo cáo đến"}),!o&&t===A.Da_Duyet&&e.jsx(F,{onClick:Gn,disabled:t!==A.Tu_Choi?!!(ln&&t!==A.Cho_Duyet):!0,color:"warning",size:"sm",className:"me-2",children:"Hoàn tác"}),!o&&te&&Be&&e.jsx(F,{onClick:Rn,disabled:t!==A.Tu_Choi?!!(ln&&t!==A.Cho_Duyet):!0,color:"danger",size:"sm",className:"me-2",children:"Từ chối báo cáo đến"}),o&&V&&e.jsxs(F,{disabled:Un,color:"primary",size:"sm",onClick:Wn,className:"me-2",children:[" ","Chỉnh sửa"]}),le,$n,Jn,Qn,Et]}),B&&e.jsxs(F,{color:"danger",size:"sm",onClick:B,children:[e.jsx(v,{fa:"times-circle"}),e.jsx("span",{className:"ml-1",children:"Đóng"})]})]}):e.jsx(e.Fragment,{})}const Ss={68:e.jsx(e.Fragment,{children:"Thịnh"})},Ns="/assets/vgca-ac42c61e.png",Is=$.img`
  border: 1px solid #ddd;
  width: 180px;
  margin-top: 10px;
  &:hover {
    cursor: pointer;
    box-shadow: -1px 10px 8px -1px rgba(0, 0, 0, 0.42);
    transition: all 0.5s ease-out;
  }
`;class _s extends de.Component{constructor(a){super(a);q(this,"handleKySoBanCoYeu",()=>{const a=this.props.data.DM_MauBaoCao.Code;me("KYSO_GIALAP")?a===36||a===16?Z("Đơn vị chưa cài đặt tự chủ! Cài đặt tự chủ để tiếp tục ký số","THÔNG BÁO"):this.handleKySoGiaLap():this.handleKySoVgca()});q(this,"handleKySoGiaLap",()=>{yt(`${we}?id=${this.props.data.ID}`).then(a=>a.blob()).then(a=>{const n=new FormData;n.append("ma_tai_khoan",_.MaTaiKhoan),n.append("uploadfile",a),bt(`${Ke}?id_bao_cao=${this.props.data.ID}`,n).then(o=>{o.Status?G("Ký số thành công !").then(()=>{var c;let l=new se;l.from_id=_.IDDonVi,l.to_id=_.IDDonVi,l.title=_.TenDonVi,l.body="Ký số "+((c=this.data.DM_BaoCao)==null?void 0:c.Name),l.target_id=this.props.data.ID,l.target_module="BaoCao",l.hanh_dong="da_ky_so",this.props.setisChange(!1),this.props.reloadData(),this.props.getDataBaoCao(),this.setIsActiveLog(!0)}):H("Ký số không thành công !")}).catch(o=>console.log(o))}).catch(a=>console.log(a))});q(this,"handleKySoVgca",()=>{let a=this.props.idMauBaoCao?`${Ke}?id_bao_cao=${this.props.IDBaoCao}&mau_html_id=${this.props.idMauBaoCao}&ma_tai_khoan=${_.MaTaiKhoan}`:`${Ke}?id_bao_cao=${this.props.IDBaoCao}&ma_tai_khoan=${_.MaTaiKhoan}`,n=this.props.idMauBaoCao?`${we}?id=${this.props.IDBaoCao}&MauBaoCao_HTML_Id=${this.props.idMauBaoCao}`:`${we}?id=${this.props.IDBaoCao}`;ds(JSON.stringify({FileUploadHandler:a,SessionId:"",FileName:n,MetaData:[{Key:"ma_tai_khoan",Value:_.MaTaiKhoan}]}),o=>{try{var l=JSON.parse(o);if(l.Error&&l.Status===404){H(l.Error);return}l&&l.Status===0?G("Ký số thành công !").then(()=>{var g;let c=new se;c.from_id=_.IDDonVi,c.to_id=_.IDDonVi,c.title=_.TenDonVi,c.body="Ký số "+((g=this.props.data.DM_BaoCao)==null?void 0:g.Name),c.target_id=this.props.data.ID,c.target_module="BaoCao",c.hanh_dong="da_ky_so",this.props.setisChange(!1),this.props.reloadData(),this.props.getDataBaoCao()}):(H("Ký số không thành công !"),this.props.reloadData(),this.props.getDataBaoCao())}catch{H("Ký số không thành công !")}})});this.state={loading:!1,openGhiChu:!1}}render(){const{open:a,close:n}=this.props;return e.jsx(e.Fragment,{children:e.jsx(un,{title:"Chọn ký số Ban cơ yếu",open:a,handleClose:n,maxWidth:"sm",children:e.jsxs(Nn,{show:this.state.loading,children:[e.jsx(ye,{style:{marginRight:4,display:"flex",justifyContent:"center"},children:e.jsx(oe,{md:"4",children:e.jsx(Is,{src:Ns,alt:"VIETTELCA",title:"BAN CƠ YẾU",onClick:o=>this.handleKySoVgca()})})}),e.jsx(ye,{children:e.jsx(oe,{md:"12",children:e.jsx("div",{className:"alert alert-warning",children:e.jsx("a",{href:"/assets/Plugin_BCY.zip",target:"_blank",children:"Đường dẫn tải plugin ký số BCY: Plugin_BCY.zip"})})})})]})})})}}const Y=(s,t)=>{let a=t?null:s==null?void 0:s.TrangThaiDuyet_Tinh;switch(a||((s==null?void 0:s.TrangThai)??(s==null?void 0:s.TrangThaiDuyet))){case 0:return{content:e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"Danh sách"})," sẽ được gửi lên ",e.jsx("strong",{children:"Cấp trên"})," và chờ được xử lý. Sẽ có kết quả trong thời gian sớm nhất!"]}),content2:e.jsxs(e.Fragment,{children:["Hãy xem xét thông tin để quyết định ",e.jsx("strong",{children:"Phê duyệt"})," hoặc ",e.jsx("strong",{children:"Từ chối"}),"."]}),content3:e.jsxs(e.Fragment,{children:["Hãy xem xét thông tin để quyết định ",e.jsx("strong",{children:"Phê duyệt"})," hoặc ",e.jsx("strong",{children:"Từ chối"}),"."]}),color:(s==null?void 0:s.TrangThaiBaoCao)>1?"warning":"duoc-de-xuat",numberAccept:1,numberRefuse:2,title:(s==null?void 0:s.TrangThaiBaoCao)>1?"Chờ phê duyệt":"Chưa gửi báo cáo"};case 2:return{content:e.jsxs(e.Fragment,{children:[e.jsxs("strong",{style:{color:"#d01b1b"},children:[a?"Tỉnh từ chối":"Huyện từ chối"," với lý do:"]})," ",s!=null&&s.LyDo?e.jsx("span",{children:s==null?void 0:s.LyDo}):e.jsx("i",{className:"font-weight-light text-muted",children:"Không xác định."})]}),content2:e.jsxs(e.Fragment,{children:[e.jsxs("strong",{style:{color:"#d01b1b"},children:[a?"Tỉnh từ chối":"Huyện từ chối"," với lý do:"]})," ",s!=null&&s.LyDo?e.jsx("span",{children:s==null?void 0:s.LyDo}):e.jsx("i",{className:"font-weight-light text-muted",children:"Không xác định."})]}),content3:e.jsxs(e.Fragment,{children:[e.jsxs("strong",{style:{color:"#d01b1b"},children:[a?"Tỉnh từ chối":"Huyện từ chối"," với lý do:"]})," ",s!=null&&s.LyDo?e.jsx("span",{children:s==null?void 0:s.LyDo}):e.jsx("i",{className:"font-weight-light text-muted",children:"Không xác định."})]}),color:"huyen-tu-choi",title:a?"Tỉnh từ chối":"Huyện từ chối"};case 1:return{content:e.jsx(e.Fragment,{children:s!=null&&s.IsChiDinh?e.jsx(e.Fragment,{children:e.jsxs("div",{style:{color:"#005ec3"},children:[e.jsx("strong",{children:"Được chỉ định:"})," ",e.jsx("span",{className:"text-dark",children:s==null?void 0:s.GhiChu})]})}):e.jsxs("strong",{style:{color:"#009930",fontSize:"larger"},children:["Đề xuất đã ",a?"được Tỉnh":"được Huyện"," phê duyệt!"]})}),content2:e.jsx(e.Fragment,{children:s!=null&&s.IsChiDinh?e.jsx(e.Fragment,{children:e.jsxs("div",{style:{color:"#005ec3"},children:[e.jsx("strong",{children:"Được chỉ định:"})," ",e.jsx("span",{className:"text-dark",children:s==null?void 0:s.GhiChu})]})}):e.jsxs("strong",{style:{color:"#009930",fontSize:"larger"},children:["Đề xuất đã ",a?"được Tỉnh":"được Huyện"," phê duyệt!"]})}),content3:e.jsx(e.Fragment,{children:s!=null&&s.IsChiDinh?e.jsx(e.Fragment,{children:e.jsxs("div",{style:{color:"#005ec3"},children:[e.jsx("strong",{children:"Được chỉ định:"})," ",e.jsx("span",{className:"text-dark",children:s==null?void 0:s.GhiChu})]})}):e.jsxs("strong",{style:{color:"#009930",fontSize:"larger"},children:["Đề xuất đã ",a?"được Tỉnh":"được Huyện"," phê duyệt!"]})}),color:s!=null&&s.IsChiDinh||a?"tinh-phe-duyet":"huyen-phe-duyet",title:s!=null&&s.IsChiDinh?"Được chỉ định":`Đã ${a?"được Tỉnh":"được Huyện"} phê duyệt`,btn:"Hủy phê duyệt",numberChangeStatus:0};default:return{content:e.jsx(e.Fragment,{children:"Đề xuất của bạn sẽ được gửi lên Cấp trên để chờ xét duyệt."}),color:"duoc-de-xuat",btn:"Gửi đề xuất",title:"Chưa xử lý"}}},We=[{title:"Id",field:"Id",hidden:"true",dataID:!0,table:!0,notEdit:!0},{tabName:"Đối tượng",ratio:1,hidden:!0},{title:"Đối tượng đề xuất",field:"HoGiaDinh_Id",type:"danh-sach-ho-gd",required:!0,disabledWhenEdit:!0},{title:"Mã hộ",field:"HNCN_HoGiaDinh.MaHo",table:!0},{title:"Tên chủ hộ",field:"HNCN_HoGiaDinh.TenChuHo",table:!0},{title:"Số CCCD",field:"HNCN_HoGiaDinh.CCCD",table:!0},{title:"Địa chỉ",field:"HNCN_HoGiaDinh/ThonXom.MaPhuongXa",table:!0,hidden:!0},{tabName:"Nội dung",ratio:2,hidden:!0},{title:"Nội dung chi",field:"NoiDungChi_Id",type:"data-select",dataSelect:{url:"DM_NoiDungChi",value_field:"Id",text_field:"Name",placeholder:"Chọn Nội dung chi"},required:!0},{title:"Nội dung chi",field:"DM_NoiDungChi.Name",table:!0},{title:"Số tiền",field:"SoTien",type:"number",disabled:!0,required:!0},{title:"Số tiền",field:"SoTien",table:!0,render:s=>`${Te(s==null?void 0:s.SoTien)} VNĐ`},{title:"Trạng thái",field:"BaoCao.TrangThai",table:!0,hidden:!0},{title:"Trạng thái duyệt tỉnh",field:"TrangThaiDuyet_Tinh",table:!0,hidden:!0},{title:"Trạng thái",field:"TrangThaiDuyet",table:!0,render:s=>{var a,n,o,l,c;const t={...s,TrangThaiBaoCao:(a=s==null?void 0:s.BaoCao)==null?void 0:a.TrangThai};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"form-label-trang-thai-duyet mb-2",children:e.jsx("div",{className:`label-trang-thai-duyet ${(n=Y(t,!0))==null?void 0:n.color}`,children:(o=Y(t,!0))==null?void 0:o.title})}),e.jsx("div",{className:"form-label-trang-thai-duyet",children:!!(t!=null&&t.TrangThaiDuyet_Tinh)&&!(t!=null&&t.IsChiDinh)&&e.jsx(e.Fragment,{children:e.jsx("div",{className:`label-trang-thai-duyet ${(l=Y(t))==null?void 0:l.color}`,children:(c=Y(t))==null?void 0:c.title})})})]})}},{title:"Lý do từ chối",field:"LyDo",table:!0},{title:"Ghi chú",field:"GhiChu",type:"textbox",table:!0},{title:"Được chỉ định",field:"IsChiDinh",table:!0,hidden:!0}],vt=({data:s,reload:t,disabled:a})=>{const n=()=>ne?"content3":In?"content2":"content";return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"form-nop-de-xuat",children:[e.jsx("div",{children:Y(s)[n()]}),!a&&!(s!=null&&s.IsChiDinh)&&e.jsx(Bs,{data:s,reload:t})]})})},Bs=({data:s,reload:t})=>{var l,c,g,T,x;const a=d=>{U("Bạn chắc chắn muốn thực hiện!","Thông báo").then(()=>{S(`BaoCaoDoiTuongHoTro/DoiTrangThai?Id=${s==null?void 0:s.Id}&trangThai=${d}`,"POST",null,{odata:!1}).then(r=>{G("Thành công!"),t()})})},n=d=>{U("Bạn chắc chắn muốn thực hiện!","Thông báo").then(()=>{S(`BaoCaoDoiTuongHoTro/DoiTrangThai?Id=${s==null?void 0:s.Id}&trangThai=${d}`,"POST",null,{odata:!1}).then(r=>{G("Thành công!"),t()})})},o=async d=>{let r=await jt("Vui lòng nhập lý do từ chối","Thông báo","Vui lòng nhập lý do...",!0);r.trim()?S(`BaoCaoDoiTuongHoTro/DoiTrangThai?Id=${s==null?void 0:s.Id}&trangThai=${d}&lyDo=${r}`,"POST",null,{odata:!1}).then(p=>{G("Thành công!"),t()}):H("Vui lòng nhập lý do!")};return e.jsx(e.Fragment,{children:_t?e.jsx(e.Fragment,{children:(!!Y(s).numberChangeStatus||Y(s).numberChangeStatus===0)&&((l=Y(s))==null?void 0:l.isAction)&&e.jsx(F,{className:(c=Y(s))==null?void 0:c.color,onClick:()=>a(Y(s).numberChangeStatus),children:Y(s).btn})}):e.jsxs(e.Fragment,{children:[((g=Y(s))==null?void 0:g.numberAccept)&&((T=Y(s))==null?void 0:T.numberRefuse)&&e.jsxs("div",{className:"d-flex gap-2",children:[e.jsx(F,{onClick:()=>{var d;return n((d=Y(s))==null?void 0:d.numberAccept)},className:"btn-accept",children:"Phê duyệt"}),e.jsx(F,{onClick:()=>{var d;return o((d=Y(s))==null?void 0:d.numberRefuse)},className:"btn-refuse",children:"Từ chối"})]}),(!!Y(s).numberChangeStatus||Y(s).numberChangeStatus===0)&&e.jsx(F,{className:(x=Y(s))==null?void 0:x.color,onClick:()=>a(Y(s).numberChangeStatus),children:Y(s).btn})]})})},ws=({dataDefault:s,close:t,reload:a,dataBaoCao:n,disabled:o})=>{var x;const l=i.useRef(),[c,g]=i.useState({}),T=i.useMemo(()=>e.jsx(pn,{target_id:s.Id,target_module:n.LinhVuc_Id,isChange:()=>{},IsAttachment:!0,isHoGiaDinh:s.Id}),[s,n]);return e.jsx(e.Fragment,{children:(s==null?void 0:s.Id)&&e.jsx(_n,{url:"QuanLyDoiTuongHoTroes",ref:l,Id:s==null?void 0:s.Id,open:s==null?void 0:s.Id,close:t,columns:We,getData:d=>g(d),children:[{position:"top",component:e.jsx(e.Fragment,{children:e.jsx(vt,{data:{...c,TrangThaiBaoCao:(x=s==null?void 0:s.BaoCao)==null?void 0:x.TrangThai},disabled:o,reload:()=>{var d,r;(d=l==null?void 0:l.current)!=null&&d.loadData&&((r=l==null?void 0:l.current)==null||r.loadData()),a()}})})}],RenderAttachment:T})})},As=({year:s,dataBaoCao:t,reloadTable:a})=>{var B,b,L,y;const[n,o]=i.useState(null),[l,c]=i.useState({}),[g,T]=i.useState({}),[x,d]=i.useState([]),[r,p]=i.useState([]),h=i.useRef();i.useEffect(()=>{S("QuanHuyens?$filter=MaTinhThanh eq '54'&$expand=PhuongXa").then(({value:f})=>{p(f)})},[]),i.useEffect(()=>{S("DM_NoiDungChi").then(f=>d(f==null?void 0:f.value))},[]);const u=f=>{U("Bạn có chắc chắn muốn xóa!","Thông báo").then(()=>{S(`QuanLyDoiTuongHoTroes(${f})`,"DELETE",null).then(M=>{var V,w;G("Xóa thành công!"),(V=h==null?void 0:h.current)!=null&&V.reloadTable&&((w=h==null?void 0:h.current)==null||w.reloadTable())})})},N=f=>{var m,C;let M=f.HNCN_HoGiaDinh.ThonXom.MaPhuongXa;const V=r.find(j=>j.PhuongXa.find(k=>k.MaPhuongXa===M)),w=V.PhuongXa.find(j=>j.MaPhuongXa===M);return`${(C=(m=f==null?void 0:f.HNCN_HoGiaDinh)==null?void 0:m.ThonXom)==null?void 0:C.Ten}, ${w==null?void 0:w.TenPhuongXa}, ${V==null?void 0:V.TenQuanHuyen}`};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bg-white p-3 rounded",children:e.jsx(Bn,{ref:h,where:`(DonVi_Id eq '${(B=t==null?void 0:t.SYS_DonVi1)==null?void 0:B.ID}' and IsChiDinh eq true and Nam eq ${s}) or (BaoCao_Id eq '${t==null?void 0:t.ID}' and Nam eq ${s})`,url:"QuanLyDoiTuongHoTroes",isEdit:!1,isDelete:!1,isAdd:t.TrangThai<1,addValue:{Nam:s,DonVi_Id:`${(b=_)==null?void 0:b.IDDonVi}`,BaoCao_Id:t==null?void 0:t.ID,TrangThaiDuyet:0},defaultValue:{SoTien:x!=null&&x.length?(L=x==null?void 0:x.find(({Id:f})=>f===(g==null?void 0:g.NoiDungChi_Id)))==null?void 0:L.SoTien:0},getData:f=>T(f),onRowClick:f=>{c(f)},columns:[{title:"Địa chỉ",table:!0,field:"HNCN_HoGiaDinh/ThonXom.Ten",render:f=>N(f)},...We,{title:"Thao tác",field:"Id",table:!0,render:f=>e.jsx(e.Fragment,{children:t.TrangThai===0&&!(f!=null&&f.IsChiDinh)&&((f==null?void 0:f.TrangThaiDuyet)===0||(f==null?void 0:f.TrangThaiDuyet)===2)&&e.jsxs("div",{onClick:M=>M.stopPropagation(),className:"d-flex justify-content-center",children:[e.jsx(F,{onClick:()=>o(f==null?void 0:f.Id),className:"icon icon-edit"}),e.jsx(F,{onClick:()=>u(f==null?void 0:f.Id),className:"icon icon-del"})]})})}]})}),e.jsx(ws,{dataDefault:l,dataBaoCao:t,close:()=>c({}),reload:()=>{var f,M;(f=h==null?void 0:h.current)!=null&&f.reloadTable&&((M=h==null?void 0:h.current)==null||M.reloadTable()),a()},disabled:In&&((t==null?void 0:t.TrangThai)===4||(t==null?void 0:t.TrangThai)===3)}),n&&e.jsx(da,{columns:We,open:n,close:()=>o(null),Id:n,defaultValue:{SoTien:x!=null&&x.length?(y=x==null?void 0:x.find(({Id:f})=>f===(g==null?void 0:g.NoiDungChi_Id)))==null?void 0:y.SoTien:0},getData:f=>T(f),url:"QuanLyDoiTuongHoTroes",afterSaving:()=>{var f,M;(f=h==null?void 0:h.current)!=null&&f.reloadTable&&((M=h==null?void 0:h.current)==null||M.reloadTable())}})]})},ks=({data:s,year:t,reloadTable:a,isDataSynthesis:n})=>{const[o,l]=i.useState({NamKeHoach:t,DMQuy_Id:0,DauKi:"",KeHoach:"",ThucHien:"",CuoiKy:"",Id:-1,Id_Row:void 0,IsNhapDauKy:!1}),c=h=>new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(h),g=()=>{l(h=>({...h,Id:-1,Id_Row:-1,IsNhapDauKy:!1}))},T=(h,u,N,B,b)=>{const L={NamKeHoach:t,DMQuy_Id:h.DMQuy_Id,DauKi:String(h.DauKi).replace(/\D/g,""),KeHoach:String(h.KeHoach).replace(/\D/g,""),ThucHien:"0",CuoiKy:"0",NoiDungChi_Id:h.Id},y={KeHoach:String(h.KeHoach).replace(/\D/g,""),DauKi:String(h.DauKi).replace(/\D/g,"")},f=B-u+Number(y.KeHoach)>b+(N===Number(y.DauKi)?0:Number(y.DauKi)<N?-N-Number(y.DauKi):Number(y.DauKi));U(`Cập nhật kế hoạch giải ngân năm ${t}`,"Cập nhật").then(M=>{if(M&&M.isConfirmed){if(!f){S(`QuanLyNganSachQuys${h.Id_Row&&h.Id_Row!==-1?`(${h.Id_Row})`:""}`,`${h.Id_Row&&h.Id_Row!==-1?"PATCH":"POST"}`,JSON.stringify(h.Id_Row&&h.Id_Row!==-1?y:L),{odata:!0}).then(()=>{G("Cập nhật dữ liệu thành công").then(()=>{a(),g()})}).catch(V=>H(V,"Cập nhật dữ liệu lỗi!!"));return}Z("Đã vượt quá ngân sách!!")}})},x=h=>{const u=h.replace(/\D/g,"");return new Intl.NumberFormat("vi-VN").format(u)},d=(h,u)=>{const N=h.target.value,B=x(N);l(b=>({...b,[u]:B}))},r=h=>{U("Bạn chưa lưu dữ liệu, bạn chắc chắn muốn thoát?","Xác nhận thoát").then(u=>{if(u&&u.isConfirmed){l(h);return}})},p=h=>h.map((u,N)=>{var B;return e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{style:{textAlign:"center",color:"#4872b5",fontWeight:"bold"},children:Sn(N+1)}),e.jsx("td",{style:{color:"#4872b5",fontWeight:"bold",fontSize:15},children:u.Name}),["DauKi","KeHoach","ThucHien","CuoiKy"].map(b=>e.jsx("td",{children:e.jsx("table",{style:ve.columnChild,children:e.jsx("tr",{children:b==="KeHoach"?e.jsxs("td",{children:[e.jsx("div",{style:{whiteSpace:"pre-wrap",fontWeight:"bold"},children:c(u[b])}),e.jsxs("div",{style:{whiteSpace:"pre-wrap"},children:["(Tối đa ",c(u.SoTienToiDa),")"]})]}):e.jsx("td",{style:{fontWeight:"bold"},children:c(u[b])})})})},b)),!n&&e.jsx("td",{style:{textAlign:"center"},children:"-"})]},N),(B=u.Children)==null?void 0:B.map((b,L)=>e.jsxs("tr",{children:[e.jsx("td",{style:{textAlign:"center",fontSize:14},children:St(L)}),e.jsx("td",{style:{fontSize:13},children:b.Name}),["DauKi","KeHoach","ThucHien","CuoiKy"].map(y=>e.jsx("td",{children:e.jsx("table",{style:ve.columnChild,children:e.jsx("tr",{children:e.jsx("td",{children:b.Id!==o.Id||y!=="KeHoach"&&(y!=="DauKi"||!b.IsNhapDauKy)?c(b[y])??"-":e.jsx(Bt,{type:"text",pattern:"\\d*",value:x(String(o[y])),onChange:f=>d(f,y),style:{textAlign:"center",height:35,marginTop:0}})})})})},y)),!n&&e.jsx("td",{children:e.jsx("table",{style:ve.columnChild,children:e.jsx("tr",{children:e.jsxs("td",{children:[e.jsx(Fe,{onClick:()=>{u.Children.reduce((f,M)=>f+(M.DauKi||0),0);const y=u.Children.reduce((f,M)=>f+(M.KeHoach||0),0);b.Id!==o.Id?o.Id===-1?l({...o,...b,DMQuy_Id:u.Id}):r(b):T(o,b.KeHoach,b.DauKi,y,u.SoTienToiDa)},style:{border:0},icon:b.Id===o.Id?"save":"edit",color:"primary"}),b.Id===o.Id&&e.jsx(Fe,{onClick:()=>g(),style:{border:0},icon:"close",color:"primary"})]})})})})]},L))]})});return e.jsx("td",{children:e.jsxs(pe,{bordered:!0,children:[e.jsx("thead",{style:ve.thead,children:e.jsx("tr",{children:["STT","Tên quỹ","Đầu kì","Kế hoạch","Thực hiện","Cuối kì",...n?[]:["Thao tác"]].map((h,u)=>e.jsx("th",{style:{...ve.th,...Object.values(ve.columnWidths)[u]},children:h}))})}),e.jsx("tbody",{children:p(s)})]})})},ve={th:{textAlign:"center",fontSize:14,fontWeight:"bold",justifyContent:"center",color:"white"},td:{textAlign:"center",color:"#4872b5",fontWeight:"bold"},thead:{backgroundColor:"#3f51b5",fontSize:20},columnWidths:{stt:{width:"7%"},tenQuy:{width:"25%"},dauKi:{width:"15%"},keHoach:{width:"15%"},thucHien:{width:"15%"},cuoiKi:{width:"15%"},thaoTac:{width:"8%"}},columnChild:{width:"100%",textAlign:"center"}};const Ms=({data:s,year:t,reloadTable:a,BaoCaoDi:n,isDataSynthesis:o})=>{i.useState({NamKeHoach:t,DMQuy_Id:0,DauKi:"",KeHoach:"",ThucHien:"",CuoiKy:"",Id:-1,Id_Row:void 0,IsNhapDauKy:!1});const[l,c]=i.useState({}),[g,T]=i.useState({}),[x,d]=i.useState({}),[r,p]=i.useState({}),h=w=>new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(w),u=w=>{U(`Cập nhật trạng thái giải ngân cho ${w.TenChuHo}`,"Cập nhật").then(m=>{m&&m.isConfirmed&&S(`BaoCaoGiaiNgan/DoiTrangThaiGiaiNgan?Id=${w.Id_Row}&TrangThai=${w.TrangThai===1?0:1}`,"POST",null,{odata:!1}).then(()=>{G("Cập nhật dữ liệu thành công").then(()=>{a()})}).catch(C=>H(C,"Cập nhật dữ liệu lỗi!!"))})},N=w=>{U("Cập nhật trạng thái giải ngân cho đơn vị","Cập nhật").then(m=>{m&&m.isConfirmed&&S(`BaoCaoGiaiNgan/DoiTrangThaiGiaiNganAll?IdDV=${w.IdDV}&TrangThai=${w.TrangThai===1?0:1}`,"POST",null,{odata:!1}).then(()=>{G("Cập nhật dữ liệu thành công").then(()=>{a()})}).catch(C=>H(C,"Cập nhật dữ liệu lỗi!!"))})},B=w=>{c(m=>({...m,[w]:!m[w]}))},b=(w,m)=>{T(C=>{var j;return{...C,[w]:{...C[w],[m]:!((j=C[w])!=null&&j[m])}}})},L=w=>{d(m=>({...m,[w]:!0}))},y=w=>{d(m=>({...m,[w]:!1}))},f=w=>{p({...w,TrangThaiBaoCao:1})},M=(w,m,C)=>w&&w.Details.map((j,k)=>{var K;return e.jsxs("tr",{onClick:j!=null&&j.Id?()=>{f(j)}:null,style:{cursor:"pointer"},className:`fade-${(K=g[m])!=null&&K[k]?"enter":"exit"}`,children:[e.jsx("td",{style:{textAlign:"center",color:"#4872b5",fontSize:14},children:C?St(k):k+1}),e.jsx("td",{style:{fontSize:15,textAlign:"center"},children:j.TenThon}),e.jsx("td",{style:Q.texttd,children:j.MaHo}),e.jsx("td",{style:Q.texttd,children:j.CCCD}),e.jsx("td",{style:Q.texttd,children:j.TenChuHo}),e.jsx("td",{style:Q.texttd,children:j.DiaChi??"Chưa cập nhật"}),e.jsx("td",{style:Q.texttd,children:j.NoiDungChi}),e.jsx("td",{style:Q.texttd,children:h(j.SoTien)}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:100},children:"-"}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:100},children:"-"}),e.jsx("td",{style:Q.texttd,children:j.GhiChu}),e.jsx("td",{style:{textAlign:"center"},onClick:E=>{if(E.stopPropagation(),o){Z("Báo cáo đã được chốt dữ liệu!!");return}n&&ne&&u(j)},children:e.jsxs(F,{disabled:!1,color:j.TrangThai===1?"success":"warning",size:"sm",className:"me-2",children:[e.jsx(v,{fa:""})," ",j.TrangThai===1?"Đã giải ngân":"Chưa giải ngân"]})})]},k)}),V=w=>w.map((m,C)=>e.jsxs(de.Fragment,{children:[e.jsxs("tr",{onClick:()=>{B(C)},onMouseEnter:()=>L(C),onMouseLeave:()=>y(C),style:{color:x[C]?"#3f51b5":"black",cursor:"pointer"},children:[e.jsx("td",{style:{textAlign:"center",color:"#4872b5",fontWeight:"bold"},children:Sn(C+1)}),e.jsx("td",{style:{alignItems:"center",textAlign:"center",fontSize:15,fontWeight:"bold",cursor:"pointer"},children:e.jsx("span",{children:m.Name})}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:100},children:"-"}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:200},children:"-"}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:200},children:"-"}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:200}}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:200},children:"-"}),e.jsx("td",{style:{textAlign:"center",fontSize:15,fontWeight:"bold"},children:h(m.TongTien)}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:100,fontWeight:"bold"},children:h(m.SoTienChuaGiaiNgan)}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:100,fontWeight:"bold"},children:h(m.SoTienDaGiaiNgan)}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:200},children:"-"}),e.jsx("td",{style:{textAlign:"center"},children:n&&ne?e.jsx(F,{onClick:j=>{if(j.stopPropagation(),o){Z("Báo cáo đã được chốt dữ liệu!!");return}N(m)},disabled:!1,color:m.TrangThai===0?"primary":"danger",size:"sm",className:"me-2",children:m.TrangThai===0?"Giải ngân đơn vị":"Huỷ giải ngân đơn vị"}):"-"})]}),l[C]&&e.jsxs(de.Fragment,{children:[(!n||!ne)&&M(m,C,!1),ne&&n&&m&&m.Details.map((j,k)=>{var K;return e.jsxs(de.Fragment,{children:[e.jsxs("tr",{onClick:()=>b(C,k),onMouseEnter:()=>L(`${C}-${k}`),onMouseLeave:()=>y(`${C}-${k}`),style:{color:x[`${C}-${k}`]?"#3f51b5":"black",cursor:"pointer"},children:[e.jsx("td",{style:{textAlign:"center",color:"#4872b5",fontSize:14},children:k+1}),e.jsx("td",{style:{alignItems:"center",fontWeight:"550",textAlign:"center",fontSize:15,cursor:"pointer",color:x[`${C}-${k}`]?"#3f51b5":"black"},children:j.Name}),e.jsx("td",{style:Q.texttd,children:"-"}),e.jsx("td",{style:Q.texttd,children:"-"}),e.jsx("td",{style:Q.texttd,children:"-"}),e.jsx("td",{style:Q.texttd,children:"-"}),e.jsx("td",{style:Q.texttd,children:"-"}),e.jsx("td",{style:{textAlign:"center",fontSize:15,fontWeight:"bold"},children:h(j.TongTien)}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:100,fontWeight:"bold"},children:h(j.SoTienChuaGiaiNgan)}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:100,fontWeight:"bold"},children:h(j.SoTienDaGiaiNgan)}),e.jsx("td",{style:Q.texttd,children:"-"}),e.jsx("td",{style:{textAlign:"center"},children:"-"})]}),((K=g[C])==null?void 0:K[k])&&M(j,`${C}-${k}`,!0)]},`${C}-${k}`)})]})]},C));return e.jsxs(e.Fragment,{children:[e.jsx("td",{children:e.jsxs(pe,{bordered:!0,children:[e.jsx("thead",{style:Q.thead,children:e.jsx("tr",{children:["STT","Thôn xóm","Mã hộ GĐ","CCCD Chủ hộ","Tên chủ hộ","Địa chỉ","Nội dung chi","Số tiền","Số tiền chưa giải ngân","Số tiền đã giải ngân","Ghi chú","Trạng thái giải ngân"].map(w=>e.jsx("th",{style:Q.th,children:w},w))})}),e.jsx("tbody",{children:V(s)})]})}),(r==null?void 0:r.Id_Row)&&e.jsx(_n,{url:"BaoCaoGiaiNgans",Id:r==null?void 0:r.Id_Row,open:r&&r.Id_Row,close:()=>p(null),columns:We,children:[]})]})},Q={th:{textAlign:"center",fontSize:14,fontWeight:"bold",justifyContent:"center",color:"white"},td:{textAlign:"center",color:"#4872b5",fontWeight:"bold"},thead:{backgroundColor:"#3f51b5",fontSize:20},columnChild:{width:"100%",textAlign:"center"},texttd:{textAlign:"center",fontSize:15}},vs=({data:s,reloadTable:t,BaoCaoDi:a,dataBaoCao:n})=>{const o=r=>new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(r),l=r=>(r+9).toString(36).toUpperCase(),[c,g]=i.useState({}),T=r=>{g({...r,TrangThaiBaoCao:1})},x=i.useMemo(()=>e.jsx(pn,{target_id:n.Id,target_module:n.LinhVuc_Id,isChange:()=>{},IsAttachment:!0,isHoGiaDinh:c&&c.Id_Row}),[n,c]),d=(r,p=0)=>r.map((h,u)=>{var B,b;let N={...h,TrangThaiBaoCao:n==null?void 0:n.TrangThai,TrangThaiDuyet_Tinh:h==null?void 0:h.TrangThai};return e.jsxs(e.Fragment,{children:[e.jsxs("tr",{onClick:h!=null&&h.Id?()=>{T(N)}:null,style:{cursor:"pointer"},children:[e.jsx("td",{className:p>=2?"text-lowercase":"",style:{color:p===0?"#4872b5":"black",fontWeight:p===0?"bold":p===1?500:400},children:p===0?Sn(u+1):p===1?u+1:l(u+1)}),e.jsx("td",{style:{fontSize:15,fontWeight:p===0?"bold":p===1?500:400,color:p===0?"#4872b5":"black"},children:h.Name??h.DiaChi}),e.jsx("td",{style:{fontSize:15},children:h.MaHo??"-"}),e.jsx("td",{style:{fontSize:15},children:h.TenChuHo??"-"}),e.jsx("td",{style:{fontSize:15},children:h.CCCD??"-"}),e.jsx("td",{style:{fontSize:15},children:h.NoiDungChi??"-"}),e.jsx("td",{style:{fontSize:15,fontWeight:"bold"},children:h!=null&&h.TongTien?o(h==null?void 0:h.TongTien):o(h==null?void 0:h.SoTien)}),e.jsx("td",{style:{fontSize:15},children:h.GhiChu??"-"}),(!a||!ne)&&e.jsx("td",{style:{fontSize:15},children:((h==null?void 0:h.TrangThai)||(h==null?void 0:h.TrangThai)===0)&&e.jsx(e.Fragment,{children:e.jsx("td",{className:"d-flex",children:e.jsx("div",{className:"form-label-trang-thai-duyet",children:e.jsx("div",{className:`label-trang-thai-duyet ${(B=Y(N))==null?void 0:B.color}`,children:(b=Y(N))==null?void 0:b.title})})})})})]},u),(h==null?void 0:h.Details)&&d(h==null?void 0:h.Details,p+1)]})});return e.jsxs(e.Fragment,{children:[e.jsx("td",{children:e.jsxs(pe,{bordered:!0,children:[e.jsx("thead",{style:pt.thead,children:e.jsx("tr",{children:["STT","Địa chỉ","Mã hộ","Tên chủ hộ","Số CCCD","Nội dung chi","Số tiền","Ghi chú",...!a||!ne?["Trạng thái"]:[]].map(r=>e.jsx("th",{style:pt.th,children:r}))})}),e.jsx("tbody",{children:d(s)})]})}),(c==null?void 0:c.Id_Row)&&e.jsx(_n,{url:"QuanLyDoiTuongHoTroes",Id:c==null?void 0:c.Id_Row,open:c&&c.Id_Row,close:()=>g(null),columns:We,children:[{position:"top",hidden:!!a||!ne&&(c==null?void 0:c.TrangThai)!==2,component:e.jsx(e.Fragment,{children:e.jsx(vt,{data:{...c,Id:c==null?void 0:c.Id_Row},disabled:(n==null?void 0:n.TrangThai)===4||(n==null?void 0:n.TrangThai)===3,reload:()=>{t&&t(),g(null)}})})}],RenderAttachment:x})]})},pt={th:{textAlign:"center",fontSize:14,fontWeight:"bold",justifyContent:"center",color:"white"},td:{textAlign:"center",color:"#4872b5",fontWeight:"bold"},thead:{backgroundColor:"#3f51b5",fontSize:20},columnChild:{width:"100%",textAlign:"center"}},Hs=[{title:"Id",field:"Id",hidden:"true",dataID:!0,table:!0,notEdit:!0},{title:"Doanh nghiệp",field:"DoanhNghiep_Id",type:"data-select",searchable:!0,dataSelect:{url:"DM_DoanhNghiep",value_field:"Id",text_field:"Ten",placeholder:"Chọn doanh nghiệp"},required:!0},{title:"Doanh nghiệp",field:"DM_DoanhNghiep.Ten",table:!0},{title:"Tên quỹ",field:"DM_Quy_Id",type:"data-select",searchable:!0,dataSelect:{url:"DM_DanhMucQuy",value_field:"Id",text_field:"Name",placeholder:"Chọn Tên quỹ"},required:!0},{title:"Tên quỹ",field:"DM_DanhMucQuy.Name",table:!0},{title:"Năm ủng hộ",field:"Nam",table:!0,required:!0},{title:"Số tiền",field:"SoTien",type:"number",required:!0},{title:"Số tiền",field:"SoTien",table:!0,render:s=>`${Te(s==null?void 0:s.SoTien)||0} VNĐ`},{title:"Số tiền chỉ định",field:"SoTienChiDinh",table:!0,render:s=>`${Te(s==null?void 0:s.SoTienChiDinh)||0} VNĐ`},{title:"Số tiền còn lại",field:"SoTienConLai",table:!0,render:s=>`${Te(s==null?void 0:s.SoTienConLai)||0} VNĐ`}],Ls=[{title:"Id",field:"Id",hidden:"true",dataID:!0,table:!0,notEdit:!0},{tabName:"Đối tượng",ratio:1,hidden:!0},{title:"Đối tượng đề xuất",field:"DoiTuongDeXuat_Id",type:"danh-sach-ho-gd",required:!0,disabledWhenEdit:!0},{title:"Đối tượng đề xuất",field:"DoiTuongDeXuat_Id",hidden:!0,table:!0},{title:"Mã hộ",field:"HNCN_HoGiaDinh.MaHo",table:!0},{title:"Tên chủ hộ",field:"HNCN_HoGiaDinh.TenChuHo",table:!0},{title:"Số CCCD",field:"HNCN_HoGiaDinh.CCCD",table:!0},{title:"Giới tính",field:"HNCN_HoGiaDinh/DM_GioiTinh.Name",table:!0},{title:"Ngày sinh",field:"HNCN_HoGiaDinh.NgaySinh",render:s=>`${Zt(s.HNCN_HoGiaDinh.NgaySinh).format("DD/MM/YYYY")}`,table:!0},{tabName:"Nội dung",ratio:2,hidden:!0},{title:"Nội dung chi",table:!0,field:"DM_NoiDungChi.Name"},{title:"Nội dung chi",field:"NoiDungChi_Id",type:"data-select",dataSelect:{url:"DM_NoiDungChi",value_field:"Id",text_field:"Name",placeholder:"Chọn Nội dung chi"},required:!0},{title:"Số tiền",field:"SoTien",type:"number",required:!0,disabled:!0},{title:"Số tiền",field:"SoTien",table:!0,render:s=>`${Te(s==null?void 0:s.SoTien)} VNĐ`}],Es=({Id:s,year:t,dataDN:a,reload:n})=>{var h;const[o,l]=i.useState({}),[c,g]=i.useState([]),[T,x]=i.useState(),d=i.useRef();i.useEffect(()=>{S("DM_NoiDungChi").then(u=>g(u==null?void 0:u.value))},[]),i.useEffect(()=>{o!=null&&o.DoiTuongDeXuat_Id&&S(`HNCN_HoGiaDinh(${o==null?void 0:o.DoiTuongDeXuat_Id})?$expand=ThonXom`,"GET",null,{isLoading:!1}).then(u=>{var N;S(`DonVis?$filter=MaPhuongXa eq '${(N=u==null?void 0:u.ThonXom)==null?void 0:N.MaPhuongXa}'`,"GET",null,{isLoading:!1}).then(({value:B})=>{var b;x((b=B[0])==null?void 0:b.ID)})})},[o==null?void 0:o.DoiTuongDeXuat_Id]);const r=u=>{var N,B;T&&S("QuanLyDoiTuongHoTroes","POST",JSON.stringify({HoGiaDinh_Id:u==null?void 0:u.DoiTuongDeXuat_Id,NoiDungChi_Id:u==null?void 0:u.NoiDungChi_Id,SoTien:u==null?void 0:u.SoTien,GhiChu:`${(N=a==null?void 0:a.DM_DoanhNghiep)==null?void 0:N.Ten} đã ủng hộ ${Te(u==null?void 0:u.SoTien)} VNĐ từ ${(B=a==null?void 0:a.DM_DanhMucQuy)==null?void 0:B.Name}`,Nam:t,DonVi_Id:T,TrangThaiDuyet:1,TrangThaiDuyet_Tinh:1,IsChiDinh:!0}))},p=u=>{U("Bạn có chắc chắn muốn xóa!","Thông báo").then(()=>{S(`BaoCaoTienUngHoDN/XoaDuLieu?Nam=${t}&doiTuongDX_Id=${u}`,"DELETE",null,{odata:!1}).then(N=>{var B,b;G("Xóa thành công!"),(B=d==null?void 0:d.current)!=null&&B.reloadTable&&((b=d==null?void 0:d.current)==null||b.reloadTable()),n()})})};return e.jsx(e.Fragment,{children:e.jsx(Bn,{ref:d,where:`QL_TienUngHoDN_Id eq ${s}`,columns:Ls,url:"DoanhNghiep_DTDeXuat",addValue:{QL_TienUngHoDN_Id:s},defaultValue:{SoTien:c!=null&&c.length?(h=c==null?void 0:c.find(({Id:u})=>u===(o==null?void 0:o.NoiDungChi_Id)))==null?void 0:h.SoTien:0},afterSaving:(u,N)=>{N&&r(u),n()},getData:u=>l(u),onDelete:u=>p(u==null?void 0:u.DoiTuongDeXuat_Id)})})};const Ks=({year:s})=>{const[t,a]=i.useState(null),[n,o]=i.useState(null),[l,c]=i.useState({TongTien:0,TongTienChiDinh:0,TongTienConLai:0}),g=i.useRef();return i.useEffect(()=>{s&&S(`BaoCaoTienUngHoDN/GetTongTien?Nam=${s}`,"GET",null,{odata:!1}).then(T=>{c(T)})},[s]),e.jsx(e.Fragment,{children:e.jsxs("div",{className:"bg-white p-3 rounded",children:[e.jsx(Bn,{ref:g,where:`Nam eq ${s}`,columns:Hs,url:"QL_TienUngHoDN",addValue:{Nam:s},openDetailSave:!0,getData:T=>o(T),getId:(T,x)=>{a(T&&x?T:null)},childrenModal:t&&[{title:"Đối tượng đề xuất của doanh nghiệp",component:e.jsx(e.Fragment,{children:e.jsx(Es,{Id:t,year:s,dataDN:n,reload:()=>{var T,x;(T=g==null?void 0:g.current)!=null&&T.reloadTable&&((x=g==null?void 0:g.current)==null||x.reloadTable())}})})}]}),e.jsx(Fs,{data:l})]})})},Fs=({data:s})=>e.jsx(e.Fragment,{children:e.jsx("div",{className:"list-tong-tien",children:e.jsxs("div",{className:"item-tong-tien",children:[e.jsxs("div",{className:"d-flex justify-content-between",children:[e.jsx("p",{children:"Tiền đã chi"})," ",e.jsx("h5",{children:Te(s==null?void 0:s.TongTienChiDinh)})]}),e.jsxs("div",{className:"d-flex justify-content-between",children:[e.jsx("p",{children:"Tiền chưa chi"})," ",e.jsx("h5",{children:Te(s==null?void 0:s.TongTienConLai)})]}),e.jsxs("div",{className:"footer-item",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-2",children:"Tổng cộng"}),e.jsx("h4",{children:Te(s==null?void 0:s.TongTien)})]}),e.jsx("h6",{children:"VNĐ"})]})]})})}),Vs=({code:s,data:t,year:a,reloadTable:n,dataBaoCao:o,isDataSynthesis:l,BaoCaoDi:c})=>{const g=()=>{switch(s){case"BaoCaoThucHienGiaiNgan":return e.jsx(e.Fragment,{children:e.jsx(ks,{data:t,year:a,reloadTable:n,isDataSynthesis:l})});case"BaoCaoGiaiNgan":return e.jsx(e.Fragment,{children:e.jsx(Ms,{data:t,year:a,reloadTable:n,BaoCaoDi:c,dataBaoCao:o,isDataSynthesis:l})});case"BaoCaoDoiTuongHoTro":return e.jsx(e.Fragment,{children:e.jsx(vs,{data:t,year:a,reloadTable:n,BaoCaoDi:c,dataBaoCao:o})});case"BaoCaoTienUngHoDN":return e.jsx(e.Fragment,{children:e.jsx(Ks,{year:a})});case"DeXuat":return e.jsx(e.Fragment,{children:e.jsx(As,{dataBaoCao:o,year:a,reloadTable:n})})}};return e.jsx(e.Fragment,{children:g()})},Ps=i.forwardRef((s,t)=>{var r,p,h,u,N,B;const{data:a,reloadAll:n,isDataSynthesis:o,BaoCaoDi:l}=s,[c,g]=i.useState([]),T=((r=a==null?void 0:a.DM_MauBaoCao)==null?void 0:r.TieuDeCon)==="BaoCaoThucHienGiaiNgan"||((p=a==null?void 0:a.DM_MauBaoCao)==null?void 0:p.TieuDeCon)==="BaoCaoDoiTuongHoTro"?"GetBaoCao":`GetBaoCaoGiaiNgan${ne?l?"Tinh":"Huyen":l&&In?"Huyen":"Xa"}`,x=`${(h=a==null?void 0:a.DM_MauBaoCao)==null?void 0:h.TieuDeCon}/${T}`,d=i.useCallback(()=>{var b;((b=a==null?void 0:a.DM_MauBaoCao)==null?void 0:b.GhiChu)!=="notapi"&&S(`${x}?BaoCao_Id=${a.ID}`,"GET",null,{odata:!1}).then(L=>{g(L)}).catch(L=>{H(L.Message||L)})},[x,(u=a==null?void 0:a.DM_MauBaoCao)==null?void 0:u.GhiChu,a.ID]);return i.useEffect(()=>{d()},[d]),i.useImperativeHandle(t,()=>({reloadData(){d()}})),e.jsx(e.Fragment,{children:a.ID&&e.jsxs(Ee,{paddingY:8,container:!0,children:[e.jsx(Ee,{container:!0,lg:12,md:12,paddingX:4}),e.jsxs(Ee,{justifyContent:"center",container:!0,lg:12,md:12,paddingX:4,children:[e.jsxs("p",{style:{fontWeight:"bold",fontSize:16},children:[(N=a==null?void 0:a.DM_MauBaoCao)==null?void 0:N.TieuDe," năm ",a==null?void 0:a.NamBanHanh]}),e.jsx(pe,{className:"table-bao-cao",bordered:!0,children:e.jsx(Vs,{year:a==null?void 0:a.NamBanHanh,code:(B=a==null?void 0:a.DM_MauBaoCao)==null?void 0:B.TieuDeCon,data:c,reloadTable:()=>{n&&n(),d()},dataBaoCao:a,isDataSynthesis:o,BaoCaoDi:l})})]})]})})});function Ht(s){var an,Cn;const{ID:t,onClose:a,open:n,BaoCaoDi:o,reloadData:l,seeDetailFromNotify:c,nam:g,selectedFolder:T,nameTanSuat:x,NhomDoiTuong:d}=s,[r,p]=i.useState(null),[h,u]=i.useState(!1),[N,B]=i.useState(!1),[b,L]=i.useState(!1),[y,f]=i.useState(null),[M,V]=i.useState(!1),[w,m]=i.useState(""),[C,j]=i.useState(null),[k,K]=i.useState("100%"),[E,X]=i.useState(!1),[te,Ae]=i.useState(!1),fe=i.useRef(),[Ce,nn]=i.useState(!1),De=bn(),tn=()=>{let P=De.pathname;(P==="/de-xuat"||P==="/phe-duyet")&&S(`BaoCaoExt/CheckPheDuyet?BaoCao_Id=${t==null?void 0:t.ID}`,"GET",null,{odata:!1,isLoading:!1}).then(J=>{nn(J===!0)})},Ne=()=>{De.pathname==="/de-xuat"&&t!=null&&t.ID&&S(`BaoCaoDoiTuongHoTro/CapNhatDTChiDinh?BaoCao_Id=${t==null?void 0:t.ID}`,"GET",null,{odata:!1,isLoading:!1})};i.useEffect(()=>{t&&(he(),tn(),Ne())},[t]),i.useEffect(()=>{r&&Ie()},[r]);const he=()=>{S(`BaoCaos?$expand=DM_Quy,DM_PhongBan,DM_BaoCao,SYS_DonVi1,SYS_DonVi,DM_TanSuat,DM_MauBaoCao,BaoCao2&$filter=ID eq '${t.ID}'`,"GET",null).then(P=>{c||fn(P.value[0]).then(J=>Oe(J==null?void 0:J.Id,!0)),p(P.value[0])}).catch(P=>H("Không thể tải dữ liệu báo cáo!","Thông báo"))},Ie=()=>{S(`DM_MauBaoCao(guid'${r.MauBaoCao_Id}')?$select=Code`,"GET",null).then(P=>j(P.Code))},fn=P=>new Promise((J,_e)=>{let le="";switch(P.TrangThai){case A.Cho_Duyet:le="gui";break;case A.Tu_Choi:le="tu_choi";break;case A.Da_Duyet:le="da_duyet";break}le&&S(`SYS_ThongBao?$filter=Target_Id eq '${P.ID}' and HanhDong eq '${le}'`,"GET",null).then(je=>J(je.value[0])).catch(je=>H("Không thể tải dữ liệu thông báo!","Thông báo").reject(je))}),ue=i.useCallback(()=>{S(`BaoCaos('${r&&r.ID}')?$expand=HNCN_TrangThaiDuLieu`,"GET",null,{odata:!0}).then(P=>{var J;Ae((J=P.HNCN_TrangThaiDuLieu[0])==null?void 0:J.DaChotDuLieu)}).catch(P=>{console.log(P)})},[r]);i.useEffect(()=>{r&&ue()},[r,ue]);const Oe=(P,J)=>{P&&S(`SYS_ThongBao(guid'${P}')`,"PATCH",JSON.stringify({DaXemThongBao:J})).then(_e=>{}).catch(_e=>H("Không thể cập nhật trạng thái đã xem của báo cáo","Thông báo"))},Ge=P=>{m(P),V(!0)},ke=P=>{m(`${we}?id=${P.ID}`),V(!0)},ie=P=>{P.Status?G("Ký số thành công !").then(()=>{m(`${Ve}${P.FileServer}`),l(),he(),u(!0)}):H("Ký số không thành công !")},ge=()=>{fe.current&&fe.current.reloadData()};i.useCallback(()=>{var P,J,_e,le,je;if((P=r.DM_MauBaoCao)!=null&&P.IsBaoCaoDeCuong)return e.jsxs(ht,{color:"warning",children:[e.jsx("p",{children:"Đây là mẫu báo cáo đề cương"}),e.jsx("p",{children:'Đơn vị vui lòng, bấm sang tab "Thông tin báo cáo", rồi di chuyển đến mục "VĂN BẢN LIÊN QUAN"'}),e.jsx("p",{children:'Tại đây đơn vị chọn "Văn bản bên ngoài", để tải văn bản đề cương lên'})]});if(((J=r.DM_MauBaoCao)==null?void 0:J.DangBaoTri)==!0&&(r.TrangThai==0||r.TrangThai==3||r.TrangThai==8))return e.jsxs(ht,{color:"warning",children:[e.jsx("p",{children:"Mẫu báo cáo này đang được bảo trì!"}),e.jsx("p",{children:"Quý đơn vị vui lòng quay lại sau!"})]});{let sn=Ss[C];return e.jsx(sn,{code:C,BaoCao_Id:{...t,Data_StartDate:r.Data_StartDate,Data_EndDate:r.Data_EndDate,TrangThai:r.TrangThai,DonViBaoCao:(_e=r==null?void 0:r.SYS_DonVi1)==null?void 0:_e.TenDonVi,NamBanHanh:r.NamBanHanh,DonViGui_Id:r==null?void 0:r.DonVi_Id,Quy_Id:r.Quy_Id,Thang_Id:r.Thang_Id,codeTanSuatDinhKy:r.DM_TanSuat.Code,NameTanSuatBaoCao:r.DM_TanSuat.Name,NameQuy:(le=r==null?void 0:r.DM_Quy)==null?void 0:le.Name},IdBaoCao:r.MauBaoCao_Id,BaoCaoDi:o,IdTanSuat:r.TanSuat_Id,PhanLoaiDoanhNghiep_Id:r.SYS_DonVi1.PhanLoaiDoanhNghiep_Id,NamBanHanh:r.NamBanHanh,setWidthTab:Re=>K(Re+35),isChange:E,codeTanSuat:(je=r.DM_TanSuat)==null?void 0:je.Code,nameTanSuat:x,DuLieuKyTruoc:r.DuLieuKyTruoc,getDataBaoCao:he,setisChange:X,NamLamBaoCao:g,selectedFolder:T,NhomDoiTuong:d})}},[C,r]);const Fn=i.useCallback(()=>{E?U("Bạn chưa lưu dữ liệu, bạn chắc chắn muốn thoát?").then(()=>a()):a()},[E,a]);return e.jsxs(Os,{className:"dialog-detail-bao-cao",title:"THÔNG TIN BÁO CÁO",open:n,onClose:()=>{E?U("Bạn chưa lưu dữ liệu, bạn chắc chắn muốn thoát?").then(()=>a()):a()},renderButton:e.jsx(Tt,{reportCode:C,data:r||{},BaoCaoDi:o,setIsActiveLog:u,getDataBaoCao:he,reloadData:l,onClose:a,handleShowPDF:ke,handleShowPDFSLT:Ge,setOpenKySoDoanhNghiep:B,setOpenKySoSoBanNganh:L,isChange:E,setisChange:X,setIdMauBaoCao:f,idMauBaoCao:y,isDataSynthesis:te,handleCheckDataSynthesis:ue,handleReloadDetailChiTiet:ge,disabledTiepNhan:Ce}),children:[e.jsx(i.Suspense,{fallback:qa(),children:r&&e.jsx("div",{className:"csdlg-detail",children:e.jsx(ha,{renderButton:e.jsx(Tt,{reportCode:C,data:r||{},BaoCaoDi:o,setIsActiveLog:u,getDataBaoCao:he,reloadData:l,onClose:a,handleShowPDF:ke,handleShowPDFSLT:Ge,setOpenKySoDoanhNghiep:B,setOpenKySoSoBanNganh:L,isChange:E,setisChange:X,handleClose:Fn,setIdMauBaoCao:f,idMauBaoCao:y,isDataSynthesis:te,handleCheckDataSynthesis:ue,handleReloadDetailChiTiet:ge,disabledTiepNhan:Ce}),isTabNew:!0,codeBaoCao:T==null?void 0:T.Code,setStyle:{activeTab:1,style:{width:k}},setClassName:{activeTab:1,className:"overflowTabBasic"},data:[{TabName:"Thông tin báo cáo",TabContent:e.jsx(cs,{data:r,isActiveLog:h,reloadAll:()=>{l(),he()}}),middleware:E?()=>U("Bạn chưa lưu dữ liệu, bạn chắc chắn muốn thoát?").then(()=>X(!1)):null},{TabName:"Chi tiết báo cáo",TabContent:e.jsx(Ps,{data:r,isActiveLog:h,reloadAll:()=>{l(),he(),tn()},isDataSynthesis:te,ref:fe,BaoCaoDi:o}),middleware:E?()=>U("Bạn chưa lưu dữ liệu, bạn chắc chắn muốn thoát?").then(()=>X(!1)):null}]})})}),N&&e.jsx(as,{close:()=>B(!1),IDBaoCao:r.ID,TenBaoCao:(an=r.DM_BaoCao)==null?void 0:an.Name,UploadServer:`${Ke}?id_bao_cao=${r.ID}`,FileName:`${we}?id=${r.ID}`,open:N,handleSuccess:ie,setisChange:X}),b&&e.jsx(_s,{data:r||{},close:()=>L(!1),IDBaoCao:r.ID,TenBaoCao:(Cn=r.DM_BaoCao)==null?void 0:Cn.Name,UploadServer:`${Ke}?id_bao_cao=${r.ID}`,FileName:`${we}?id=${r.ID}`,open:b,handleSuccess:ie,setisChange:X,reloadData:l,getDataBaoCao:he,setIsActiveLog:u,idMauBaoCao:y}),M&&w&&e.jsx(It,{open:M,onClose:()=>V(!1),filePDF:w})]})}const Os=$(Qa)`
  &.dialog-detail-bao-cao {
    .MuiDialogContent-root {
      overflow: auto !important;
    }
  }
`,Gs=de.createContext(),Kn=()=>i.useContext(Gs),{Xem:ft,TrinhKy:Ct}=wt();function Rs({data:s,nam:t,onReloadAll:a}){const{LinhVuc_Id:n,selectedFolder:o}=Kn(),[l,c]=i.useState(null),[g,T]=i.useState(null),[x,d]=i.useState(!1),[r,p]=i.useState({}),{pathname:h}=bn();i.useEffect(()=>{L()},[]);const u=i.useCallback(m=>new Promise((C,j)=>{o.Code!==10?C(!0):b(m).then(k=>{k===18||k===68?_.SetUpTuChu?C(!0):Z("Đơn vị hiện tại chưa thiết lập tổ chức, đơn vị tự chủ hoặc không nằm trong nhóm đối tượng thực hiện báo cáo này","Thông báo").then(()=>j(!1)):C(!0)})}),[o.Code]),N=(m,C)=>{S(`BaoCaoDoiTuongHoTro/CheckTaoBaoCao?Nam=${t}`,"GET",null,{odata:!1}).then(j=>{(j==null?void 0:j.result)===!0?B(m,C):Z("Cấp trên đã tổng hợp toàn bộ báo cáo này, bạn không thể tạo báo cáo mới!")})},B=i.useCallback((m,C)=>{if(s&&s[0].TenMauBaoCao==="Mẫu giải ngân"){S(`BaoCaoGiaiNgan/CheckTaoBaoGiaiNgan?Nam=${t}`,"GET",null,{odata:!1}).then(j=>{if(j){u(m).then(()=>{m.DonVi_Nhan_Id?S("Reports/Create","POST",JSON.stringify({TanSuat_Id:m.TanSuat_Id,LinhVuc_Id:n,MauBaoCao_Id:C.MauBaoCao_Id,BaoCao_Id:o.Id,NgayDenHanGui:m.TGDenHanGui,Year:t,IsNamSau:m.IsNamSau,IsTrinhKy:!!(ft&&Ct),LanSo:m.LanSo,DonVi_Nhan_Id:m.DonVi_Nhan_Id}),{odata:!1}).then(k=>{a(),G("Tạo báo cáo thành công!")}).catch(k=>H(k!=null&&k.ExceptionMessage?k.ExceptionMessage:k.Message?k.Message:"Không thành công"),"Thông báo"):Z("Chưa cài đặt đơn vị nhận","Thông báo")});return}Z("Báo cáo đề xuất tỉnh chưa chốt dữ liệu!!!","Thông báo")});return}u(m).then(()=>{m.DonVi_Nhan_Id?S("Reports/Create","POST",JSON.stringify({TanSuat_Id:m.TanSuat_Id,LinhVuc_Id:n,MauBaoCao_Id:C.MauBaoCao_Id,BaoCao_Id:o.Id,NgayDenHanGui:m.TGDenHanGui,Year:t,IsNamSau:m.IsNamSau,IsTrinhKy:!!(ft&&Ct),LanSo:m.LanSo,DonVi_Nhan_Id:m.DonVi_Nhan_Id}),{odata:!1}).then(j=>{a(),G("Tạo báo cáo thành công!")}).catch(j=>H(j!=null&&j.ExceptionMessage?j.ExceptionMessage:j.Message?j.Message:"Không thành công"),"Thông báo"):Z("Chưa cài đặt đơn vị nhận","Thông báo")})},[n,u,t,a,o,s]),b=m=>new Promise((C,j)=>{S(`DM_MauBaoCao(guid'${m.MauBaoCao_Id}')?$select=Code`).then(k=>C(k.Code)).catch(()=>C(!1))});i.useEffect(()=>{d(!!l)},[l]);const L=()=>{S(`DonVis('${_.IDDonVi}')`).then(m=>p(m)).catch(()=>H("Không thể lấy dữ liệu của đơn vị","Thông báo"))},y=i.useCallback((m,C)=>e.jsxs("span",{className:"d-flex align-items-center",children:[C.DonVi_Nhan_Id!==m.DonVi_Nhan_Id&&e.jsxs("span",{className:"d-block",style:{marginTop:2,color:"red"},children:[e.jsx(v,{fa:"exclamation-triangle"})," "]}),e.jsx(F,{onClick:()=>{c({ID:m.Id}),T({nameTanSuat:C==null?void 0:C.TenTanSuat,tenChuSoHuu:C==null?void 0:C.TenDonViNhan})},className:"btn-mau-bao-cao",children:m.MaBaoCao}),e.jsx(Ze,{style:{display:"block"},status:m.TrangThaiOfBaoBao})]}),[]),f=i.useCallback((m,C)=>e.jsxs(F,{className:"btn-tao-bao-cao",onClick:()=>{h==="/de-xuat"?N(m,C):B(m,C)},children:[e.jsx(v,{fa:"trello"})," Tạo Báo Cáo"]}),[B]),M=i.useCallback((m,C)=>{let j=m?m.length:0;if(j>1)return m.map((k,K)=>e.jsx(de.Fragment,{children:y(k,C)},K));if(j===1)return y(m[0],C)},[y]),V=i.useMemo(()=>x&&e.jsx(Ht,{ID:l,nameTanSuat:g,BaoCaoDi:!0,open:x,onClose:()=>c(null),reloadData:a,nam:t,selectedFolder:o}),[l,x,t,a,o,g]),w=i.useMemo(()=>e.jsx("td",{colSpan:"5",children:e.jsx("div",{className:"text-center",children:"Không tồn tại báo cáo nào"})}),[]);return e.jsxs("div",{className:"loai-bao-cao loai-bao-cao-custom",children:[s?s.map((m,C)=>e.jsxs("div",{className:"item-loai-bao-cao",children:[e.jsx("h5",{className:"mb-4",children:m.TenMauBaoCao}),e.jsxs(pe,{className:"table-minhon",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{width:"15%"},children:"Ngày đến hạn gửi"}),e.jsx("th",{style:{width:"15%"},children:"Tần suất"}),e.jsx("th",{style:{width:"25%"},children:"Đơn vị nhận"}),e.jsx("th",{style:{width:"15%"},children:"Số ngày đến hạn"}),e.jsx("th",{style:{width:"30%"},children:"Dữ liệu báo cáo"})]})}),e.jsx("tbody",{children:m.ListTanSuat.length?m.ListTanSuat.map((j,k)=>e.jsxs("tr",{children:[e.jsx("td",{children:Nt(j.TGDenHanGui)}),e.jsx("td",{children:j.TenTanSuat}),e.jsx("td",{style:{fontWeight:"400"},children:j.TenDonViNhan}),e.jsx("td",{children:!j.ListDuLieuBaoCao.length&&e.jsx(Tn,{value:j.SoNgayDenHan,isNgayDenHan:j.SoNgayDenHan})}),e.jsx("td",{children:j.ListDuLieuBaoCao.length?M(j.ListDuLieuBaoCao,j):f(j,m)})]},k)):w})]})]},C)):w,V]})}const He={tat_ca:"tat_ca",sap_den_han_gui:"sap_den_han_gui",tre_han_gui:"tre_han_gui"},Le={tat_ca:"tat-ca",da_gui:"da-gui",chua_gui:"chua-gui"},zs=i.memo(s=>{const{selectedFolder:t}=Kn(),{item:a,open:n,onClose:o,onReloadAll:l,nam:c}=s,[g,T]=i.useState([]),[x,d]=i.useState([]),[r,p]=i.useState(Le.tat_ca),[h,u]=i.useState({}),[N,B]=i.useState(null);i.useEffect(()=>{a&&b()},[a]),i.useEffect(()=>{x.length&&(r===Le.da_gui?T(x.filter(y=>parseInt(y.TrangThai||0)>=2)):r===Le.chua_gui?T(x.filter(y=>parseInt(y.TrangThai||0)<2)):T(x))},[r]);const b=()=>{S(`Reports/ThongKeBaoCaoDen_ChiTiet?DMBaoCao_Id=${t.Id}&TanSuat_Id=${a.TanSuat_Id}&MauBaoCao_Id=${a.MauBaoCao_Id}&Year=${a.nam}&hanGui=${a.TGDenHanGui.split("T")[0]}&ThangGui=${a.ThangGui}&NgayGui=${a.NgayGui}&LanSo=${a.LanSo}`,"GET",null,{odata:!1}).then(y=>{d(y),T(y),u({...h,tat_ca:y.length,da_gui:y.filter(f=>parseInt(f.TrangThai||0)>=2).length,chua_gui:y.filter(f=>parseInt(f.TrangThai||0)<2).length})}).catch(y=>H(y.Message,"Thông báo"))},L=(y,f)=>{let M=g.slice(),V=M[y];V={...V,TrangThai:f},M[y]=V,T(M)};return e.jsxs(sa,{open:n,onClose:o,title:"Danh sách đơn vị gửi báo cáo",children:[e.jsxs("div",{className:"bg-white p-3 rounded",children:[e.jsx(Ys,{item:a,value:r,selectedFolder:t,data:[{label:`Tất cả (${h.tat_ca||0})`,value:Le.tat_ca,icon:"stack-overflow"},{label:`Đã gửi (${h.da_gui||0})`,value:Le.da_gui,color:"primary",icon:"clock-o"},{label:`Chưa gửi (${h.chua_gui||0})`,value:Le.chua_gui,color:"warning",icon:"stumbleupon"}],onChange:y=>p(y)}),e.jsx("div",{className:"loai-bao-cao",children:e.jsxs(pe,{bordered:!0,className:"table-minhon",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Mã đơn vị"}),e.jsx("th",{children:"Tên đơn vị"}),e.jsx("th",{children:"Trạng thái"}),e.jsx("th",{children:"Mã báo cáo"}),e.jsx("th",{children:"Ngày gửi"})]})}),e.jsx("tbody",{children:g.map((y,f)=>e.jsxs("tr",{children:[e.jsx("td",{children:y.MaDonVi}),e.jsx("td",{children:y.TenDonVi}),e.jsxs("td",{children:[" ",parseInt(y.TrangThai||0)>=2?e.jsxs(kn,{style:{padding:".125rem .5rem",fontSize:11,fontWeight:"normal"},color:"success",children:[e.jsx("span",{style:{fontSize:12},children:e.jsx(v,{fa:"check-circle-o"})})," ","Đã gửi"]}):e.jsxs(de.Fragment,{children:[e.jsx("span",{style:{fontSize:13},className:"text-warning",children:e.jsx(v,{fa:"exclamation-circle"})})," ","Chưa gửi"]})]}),e.jsx("td",{children:y.MaBaoCao&&parseInt(y.TrangThai||0)>=2&&e.jsxs("div",{children:[e.jsx(F,{className:"btn-mau-bao-cao",onClick:()=>B({ID:y.DuLieuBaoCao_Id,index:f,NhomDoiTuong:y.NhomDoiTuong}),children:y.MaBaoCao}),e.jsx(Ze,{status:y.TrangThai})]})}),e.jsxs("td",{children:[Dt(y.TGGuiBaoCao)," ",parseInt(y.SoNgayDenHan||0)<0&&e.jsx(Tn,{value:y.SoNgayDenHan})]})]},f))})]})})]}),N&&e.jsx(Ht,{ID:N,open:!!N,BaoCaoDi:!1,onClose:()=>{B(null),b()},reloadData:l,onChangeTrangThai:L,selectedFolder:t,nam:c,NhomDoiTuong:N.NhomDoiTuong})]})}),Ys=s=>{const{data:t,value:a,onChange:n,item:o,selectedFolder:l}=s;return i.useState(a),e.jsxs("div",{className:"d-flex form-filter-danh-sach-bao-cao",children:[e.jsx("div",{children:e.jsx(Lt,{column:t,onChange:c=>{n&&n(c)}})}),e.jsx("div",{md:"4",className:"ms-auto",children:o&&e.jsx(Xs,{item:o,selectedFolder:l})})]})},Xs=s=>{const{item:t,selectedFolder:a}=s,[n,o]=i.useState(!1),l="Reports/ThongKeBaoCaoDen_ChiTiet",c=()=>o(!n),g=(T="pdf")=>{let x=T;T==="excel"&&(x="xlsx"),T==="word"&&(x="docx"),t&&dn(`${l}?DMBaoCao_Id=${a.Id}&TanSuat_Id=${t.TanSuat_Id}&MauBaoCao_Id=${t.MauBaoCao_Id}&Year=${t.nam}&hanGui=${t.TGDenHanGui.split("T")[0]}&ThangGui=${t.ThangGui}&NgayGui=${t.NgayGui}&LanSo=${t.LanSo}&isDownload=true&mode=download_${T}&pageSize=A4&landscape=true`,`Tải xuống.${x}`,"GET",null,!0).then(()=>{}).catch(()=>H("Đã xảy ra lỗi tải file!","Thông báo"))};return e.jsxs(vn,{isOpen:n,toggle:c,className:"mr-2",children:[e.jsxs(qe,{caret:!0,color:"success",size:"sm",children:[e.jsx(v,{fa:"print"})," Tải xuống DS đơn vị gửi báo cáo"]}),e.jsxs(Ue,{children:[e.jsx(z,{onClick:()=>g(),children:"PDF"}),e.jsx(z,{onClick:()=>g("excel"),children:"Excel"}),e.jsx(z,{onClick:()=>g("word"),children:"Word"})]})]})},qs=i.memo(({data:s,onReloadAll:t,nam:a})=>{const[n,o]=i.useState(null),l=i.useMemo(()=>e.jsx("td",{colSpan:"5",children:e.jsx("div",{className:"text-center",children:"Không tồn tại báo cáo nào"})}),[]),c=i.useMemo(()=>e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Ngày đến hạn gửi"}),e.jsx("th",{children:"Tần suất"}),e.jsx("th",{children:"Tổng đơn vị thực hiện"}),e.jsx("th",{children:"Đơn vị chờ duyệt"}),e.jsx("th",{children:"Đơn vị đã duyệt"}),e.jsx("th",{children:"Đơn vị bị từ chối"}),e.jsx("th",{children:"Đơn vị chưa gửi"}),e.jsx("th",{children:"Thao tác"})]})}),[]),g=i.useCallback(d=>e.jsx("tbody",{children:d.ListTanSuat.length?d.ListTanSuat.map((r,p)=>e.jsxs("tr",{children:[e.jsx("td",{children:Nt(r.TGDenHanGui)}),e.jsx("td",{children:r.TenTanSuat}),e.jsx("td",{className:"text-right",children:e.jsx(Ye,{className:"text-primary",children:r.TongSoDonVi?r.TongSoDonVi+" đơn vị":"-"})}),e.jsx("td",{className:"text-right",children:e.jsx(Ye,{className:"text-info",children:r.DonViChoDuyet?r.DonViChoDuyet+" đơn vị":"-"})}),e.jsx("td",{className:"text-right",children:e.jsx(Ye,{className:"text-success",children:r.DonViDaDuyet?r.DonViDaDuyet+" đơn vị":"-"})}),e.jsx("td",{className:"text-right",children:e.jsx(Ye,{className:"text-danger",children:r.DonViTuChoi?r.DonViTuChoi+" đơn vị":"-"})}),e.jsx("td",{className:"text-right",children:e.jsx(Ye,{className:"text-warning",children:r.DonViChuaGui?r.DonViChuaGui+" đơn vị":"-"})}),e.jsx("td",{className:"text-right",children:e.jsx(F,{className:"btn-mau-bao-cao",size:"sm",onClick:()=>o({...r,MauBaoCao_Id:d.MauBaoCao_Id,nam:a}),children:"Xem chi tiết"})})]},p)):l}),[l,a]),T=i.useCallback(d=>e.jsxs(pe,{className:"table-minhon",children:[c,g(d)]}),[g,c]),x=i.useMemo(()=>n&&e.jsx(zs,{item:n,open:!!n,onClose:()=>o(null),onReloadAll:t,nam:a}),[t,n,a]);return e.jsxs("div",{className:"loai-bao-cao loai-bao-cao-custom",children:[s?s.map((d,r)=>e.jsxs("div",{className:"item-loai-bao-cao",children:[e.jsx("h5",{className:"mb-4",children:d.TenMauBaoCao}),T(d)]},r)):l,x]})}),Ye=$.span`
  font-size: 16px;
`,ko=i.memo(()=>{const{selectedFolder:s,setselectedFolder:t,data:a,onAnTenLinhVuc:n,reloadData:o,TenLinhVuc:l,isDi:c,setShowDieu13:g}=Kn(),[T,x]=i.useState([]),[d,r]=i.useState([]),[p,h]=i.useState(new Date().getFullYear()),[u,N]=i.useState({}),B=i.useRef(),b=i.useCallback(m=>{if(c){r(m);let C=0,j=0,k=0;m.forEach(K=>{K.ListTanSuat.forEach(E=>{k+=1,parseInt(E.SoNgayDenHan||0)<=5&&parseInt(E.SoNgayDenHan||0)>=0?C+=1:parseInt(E.SoNgayDenHan||0)<0&&(j+=1)})}),N({denHan:C,treHan:j,tatCa:k})}},[c]),L=i.useCallback(()=>{let m=c?"Reports/BaoCaoDi":"Reports/BaoCaoDen";s.Id&&p&&S(`${m}?DMBaoCao_Id=${s.Id}&year=${p}`,"GET",null,{odata:!1}).then(C=>{x(C),b(C)})},[c,p,b,s.Id]);i.useEffect(()=>{s&&L()},[L,s,p]),i.useEffect(()=>{n&&n(!0)},[s]),i.useEffect(()=>{B.current&&B.current._setvalueRadio(He.tat_ca)},[p]);const y=i.useCallback(()=>{o(),L()},[L,o]),f=i.useCallback(m=>{let C=[];m===He.sap_den_han_gui?d.forEach(j=>{var k=j.ListTanSuat.filter(K=>parseInt(K.SoNgayDenHan||0)<=5&&parseInt(K.SoNgayDenHan||0)>=0);C.push({...j,ListTanSuat:k})}):m===He.tre_han_gui?d.forEach((j,k)=>{var K=j.ListTanSuat.filter(E=>parseInt(E.SoNgayDenHan||0)<0);C.push({...j,ListTanSuat:K})}):C=d,x(C)},[d]),M=i.useMemo(()=>c?e.jsx(Rs,{nam:p,data:T,onReloadAll:y}):e.jsx(qs,{data:T,onReloadAll:y,nam:p}),[T,c,p,y]),V=i.useMemo(()=>e.jsxs("div",{className:"ms-auto form-filter-year-dsmbc",children:[e.jsx("strong",{children:"Chọn theo năm"}),e.jsx(ua,{value:p,onChange:m=>h((m==null?void 0:m.value)||new Date().getFullYear()),generateOptions:{minYear:2020,maxYear:new Date().getFullYear()+5}})]}),[p]),w=i.useMemo(()=>a&&e.jsx(Us,{listItem:[l,s.Name]}),[l,a,s.Name]);return e.jsxs(de.Fragment,{children:[w,e.jsxs("div",{className:"form-filter-danh-sach-bao-cao",children:[(!!+(u==null?void 0:u.tatCa)||!!+(u==null?void 0:u.denHan)||!!+(u==null?void 0:u.treHan))&&e.jsx(e.Fragment,{children:e.jsx(Lt,{column:[{label:`Tất cả (${u.tatCa||0})`,value:He.tat_ca,icon:"stack-overflow"},{label:`Sắp đến hạn gửi (${u.denHan||0})`,value:He.sap_den_han_gui,color:"warning",icon:"clock-o"},{label:`Trễ hạn gửi (${u.treHan||0})`,value:He.tre_han_gui,color:"danger",icon:"stumbleupon"}],onChange:m=>f(m)})}),V]}),M]})}),Lt=({column:s,onChange:t})=>{var o;const[a,n]=i.useState((o=s[0])==null?void 0:o.value);return e.jsx(e.Fragment,{children:e.jsx("div",{className:"form-filter-stauts-bao-cao",children:s.map(l=>e.jsx(e.Fragment,{children:e.jsxs("div",{onClick:()=>{t(l==null?void 0:l.value),n(l==null?void 0:l.value)},className:`item ${a===(l==null?void 0:l.value)?`active ${l==null?void 0:l.color}`:""}`,children:[e.jsx(v,{fa:l==null?void 0:l.icon}),l==null?void 0:l.label]})}))})})},Us=({onBack:s,listItem:t,onClick:a})=>{let o=t.join("  ++  ").split("  ");return e.jsx(e.Fragment,{children:e.jsxs("div",{onClick:()=>a&&a(),className:"header-danh-sach-bao-cao mb-0",children:[e.jsx(F,{className:"btn-go-back",onClick:()=>s&&s(),size:"sm",children:e.jsx(v,{fa:s?"arrow-left":"home"})}),e.jsx("div",{className:"list-page",children:o.map((l,c)=>l==="++"?e.jsx(v,{fa:"angle-double-right"}):e.jsx("span",{className:c+1===o.length?"active item-breadcrumb":"item-breadcrumb",children:l}))})]})})};function Mo({length:s,width:t}){return e.jsx("div",{style:{display:"flex",padding:"1rem",gap:"1rem"},children:Array.from(new Array(s).keys()).map((a,n)=>e.jsx("div",{style:{width:`${t}`},children:e.jsx(ga,{style:{borderRadius:"10px"},variant:"rect",width:t,height:200})},n))})}export{Us as B,ko as D,Tn as S,Mo as a,Gs as b,Ao as f};