????
Current Path : C:/inetpub/vhost/sdoc.nextform.vn/www/assets/ |
Current File : C:/inetpub/vhost/sdoc.nextform.vn/www/assets/Index-912e4c50.js |
var $t=Object.defineProperty;var Jt=(s,a,t)=>a in s?$t(s,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[a]=t;var X=(s,a,t)=>(Jt(s,typeof a!="symbol"?a+"":a,t),t);import{r as i,F as Se,Z as bn,l as Ke,$ as Zt,j as e,R as me,d as te,e as ge,T as B,a0 as Qt,m as M,a1 as ea,P as Te,i as y,E as dn,x as na,z as U,X as lt,a2 as bt,a3 as yt,n as G,C as Z,a4 as ta,H as un,a5 as St,a6 as Nt,a7 as aa,U as pe,a8 as Sn,a9 as It,v as sa,aa as Bt,Y as oa}from"./index-727ccf4d.js";import{R as xe}from"./Row-4ad47f29.js";import{C as Q}from"./Col-ed66bf37.js";import{N as ia}from"./Nav-12db6fea.js";import{N as rt,a as ct,b as la,c as ra,T as ca}from"./TabsBasic-ac34a1aa.js";import{_ as ht,B as E}from"./Button-9330b92c.js";import{F as L}from"./FontAwesome4-32fe4385.js";import{S as ha,d as da,c as ua,R as Nn,s as V,a as _t,b as dt}from"./SkeletonLinhVuc-40d935ae.js";import{E as cn}from"./Empty-aeb908cf.js";import{T as fe}from"./Table-9bef8b1e.js";import{A as ut}from"./Alert-f0fd0c60.js";import{G as He,F as ga}from"./FullScreenDialogNew-becf28b6.js";import{T as Ye,C as gn,D as xa,b as ma,d as Ta,e as pa}from"./DialogCustomize-4c6977d9.js";import{L as In}from"./LoadingSpinner-7e623df9.js";import{a as fa,Q as Ca,D as At}from"./DetailInfo-7f646e21.js";import{d as Da,i as wt,F as ye,a as xn,e as ne,f as Bn,g as _n,T as An,M as ja,h as ba}from"./DropdownList-ca18995c.js";import{I as yn}from"./Button-461c8cce.js";import{b as Fe,e as ya,B as kt,a as We}from"./DataSelect-00074039.js";import{I as Mt}from"./Input-ae2484bb.js";import{L as wn,a as Sa,b as Na}from"./ListItem-f429a201.js";import{a as mn}from"./useTheme-41684c89.js";import{w as $e,c as Tn}from"./capitalize-f7a57a5c.js";import{c as Ia}from"./createSvgIcon-a089baf7.js";import{F as Ba}from"./Form-2a8b127f.js";import{I as _a}from"./Icon-3adf4f11.js";import{H as ee,T as Aa}from"./const-0478bc07.js";import{B as vt}from"./Badge-00b2c8d5.js";import{M as kn,a as Je,b as Ze}from"./SelectCustom-701e5fac.js";import{u as wa}from"./UseHandleFormControl-d53e5bce.js";import{B as Mn}from"./ButtonDropdown-8c17a411.js";import{D as Xe,a as qe,b as R}from"./DropdownToggle-56b088f2.js";import{F as ka}from"./FormGroup-74b8b50e.js";import{a as Ma}from"./Required-e4b19dca.js";import"./InputNumber-dceb4c1c.js";import"./InputTime-0a0b65be.js";import{T as va}from"./TextArea-56268c1b.js";import{F as La}from"./FullScreenDialog-84a3de57.js";import{B as Va}from"./index-3a5bff16.js";import"./Fade-7cf1057f.js";import"./Transition-27f52f03.js";import"./DefaultPropsProvider-53cf3a0d.js";import"./extends-0a21b0e1.js";import"./BodyDialog-933f74b0.js";import"./debounce-b2775af4.js";import"./classCallCheck-22a738c0.js";import"./withStyles-da525f81.js";import"./_commonjs-dynamic-modules-302442b1.js";import"./possibleConstructorReturn-e4ffd6dd.js";import"./Dropdown-ab2dfbba.js";import"./Manager-0c2f0563.js";import"./SelectPanelMulti-70ffdcea.js";import"./TransitionGroup-273fc20b.js";import"./Collapse-da981db3.js";import"./DataTable-2f4d7f97.js";import"./OdataUtils-2c90172a.js";import"./index-0eaf7829.js";import"./ButtonBase-9568d0b0.js";import"./Popper-c8f432b9.js";const Ha=Ia(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 Ea=function(a){return{root:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:a.typography.fontFamily,fontSize:a.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none"},colorDefault:{color:a.palette.background.default,backgroundColor:a.palette.type==="light"?a.palette.grey[400]:a.palette.grey[600]},circle:{},circular:{},rounded:{borderRadius:a.shape.borderRadius},square:{borderRadius:0},img:{width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4},fallback:{width:"75%",height:"75%"}}};function Fa(s){var a=s.src,t=s.srcSet,n=i.useState(!1),o=n[0],l=n[1];return i.useEffect(function(){if(!(!a&&!t)){l(!1);var h=!0,u=new Image;return u.src=a,u.srcSet=t,u.onload=function(){h&&l("loaded")},u.onerror=function(){h&&l("error")},function(){h=!1}}},[a,t]),o}var Ka=i.forwardRef(function(a,t){var n=a.alt,o=a.children,l=a.classes,h=a.className,u=a.component,m=u===void 0?"div":u,g=a.imgProps,d=a.sizes,r=a.src,p=a.srcSet,c=a.variant,x=c===void 0?"circular":c,A=mn(a,["alt","children","classes","className","component","imgProps","sizes","src","srcSet","variant"]),_=null,S=Fa({src:r,srcSet:p}),H=r||p,b=H&&S!=="error";return b?_=i.createElement("img",Se({alt:n,src:r,srcSet:p,sizes:d,className:l.img},g)):o!=null?_=o:H&&n?_=n[0]:_=i.createElement(Ha,{className:l.fallback}),i.createElement(m,Se({className:Tn(l.root,l.system,l[x],h,!b&&l.colorDefault),ref:t},A),_)});const Pa=$e(Ea,{name:"MuiAvatar"})(Ka);var Oa={root:{marginBottom:12}},Ga=i.forwardRef(function(a,t){return i.createElement(Ye,Se({component:"p",variant:"body1",color:"textSecondary",ref:t},a))});const za=$e(Oa,{name:"MuiDialogContentText"})(Ga);var Ra={root:{minWidth:56,flexShrink:0},alignItemsFlexStart:{marginTop:8}},Ya=i.forwardRef(function(a,t){var n=a.classes,o=a.className,l=mn(a,["classes","className"]),h=i.useContext(wn);return i.createElement("div",Se({className:Tn(n.root,o,h.alignItems==="flex-start"&&n.alignItemsFlexStart),ref:t},l))});const Xa=$e(Ra,{name:"MuiListItemAvatar"})(Ya);var qa=function(a){return{root:{minWidth:56,color:a.palette.action.active,flexShrink:0,display:"inline-flex"},alignItemsFlexStart:{marginTop:8}}},Ua=i.forwardRef(function(a,t){var n=a.classes,o=a.className,l=mn(a,["classes","className"]),h=i.useContext(wn);return i.createElement("div",Se({className:Tn(n.root,o,h.alignItems==="flex-start"&&n.alignItemsFlexStart),ref:t},l))});const Wa=$e(qa,{name:"MuiListItemIcon"})(Ua);var $a={root:{flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},multiline:{marginTop:6,marginBottom:6},dense:{},inset:{paddingLeft:56},primary:{},secondary:{}},Ja=i.forwardRef(function(a,t){var n=a.children,o=a.classes,l=a.className,h=a.disableTypography,u=h===void 0?!1:h,m=a.inset,g=m===void 0?!1:m,d=a.primary,r=a.primaryTypographyProps,p=a.secondary,c=a.secondaryTypographyProps,x=mn(a,["children","classes","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"]),A=i.useContext(wn),_=A.dense,S=d??n;S!=null&&S.type!==Ye&&!u&&(S=i.createElement(Ye,Se({variant:_?"body2":"body1",className:o.primary,component:"span",display:"block"},r),S));var H=p;return H!=null&&H.type!==Ye&&!u&&(H=i.createElement(Ye,Se({variant:"body2",className:o.secondary,color:"textSecondary",display:"block"},c),H)),i.createElement("div",Se({className:Tn(o.root,l,_&&o.dense,g&&o.inset,S&&H&&o.multiline),ref:t},x),S,H)});const Za=$e($a,{name:"MuiListItemText"})(Ja);class Qa{constructor(a){this.Them=a.Them,this.Xoa=a.Xoa,this.Xem=a.Xem,this.Download=a.Download,this.Upload=a.Upload,this.KySo=a.KySo,this.TrinhKy=a.TrinhKy,this.TiepNhanTrinhKy=a.TiepNhanTrinhKy,this.Gui=a.Gui,this.TiepNhanBaoCao=a.TiepNhanBaoCao}}const es=s=>{if(typeof s!="string")throw new Error("Url parameter of useActionPermission hook must be string");let a=bn?bn.find(n=>n.url===s):{};return new Qa(a||{})},Lt=s=>es(s||"/quan-ly-bao-cao"),Ee=`${window.location.origin}${Ke}/BaoCaos/KySo`,Ae=`${window.location.origin}${Ke}/BaoCaos/GeneratePDF`,ns=`${Ke}/QuanLyVanBan/Download`,ts="BaoCaos/DuyetBaoCao",as="BaoCaos/TuChoiBaoCao",ss={DN:"DoanhNghiep",SBN:"SoBanNganh",STC:"SoTaiChinh"},os=Zt;const is=s=>{const[a,t]=i.useState(0),n=o=>{a!==o&&t(o)};return e.jsx("div",{className:"win10-container",children:e.jsxs(xe,{children:[e.jsx(Q,{md:"2",children:e.jsx(ia,{tabs:!0,children:s.data&&s.data.map((o,l)=>{let h=o.MaChucNang;const u=bn.filter(m=>m.ma_chuc_nang===h);return h?u[0]&&u[0].access&&e.jsx(rt,{children:e.jsx(ct,{className:ht({active:a===l}),onClick:()=>{n(l),s.onChangeTab&&s.onChangeTab(l)},children:o.TabName})},l):e.jsx(rt,{children:e.jsx(ct,{className:ht({active:a===l}),onClick:()=>{n(l),s.onChangeTab&&s.onChangeTab(l)},children:o.TabName})},l)})})}),e.jsx(Q,{className:"bg-white",md:"10",children:e.jsx(la,{activeTab:a,children:s.data&&s.data.map((o,l)=>e.jsx(ra,{tabId:l,children:a===l&&o.TabContent},l))})})]})})},ls=is,Vt=me.createContext(),vn=()=>i.useContext(Vt),rs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAABQCAYAAAByKBsiAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADDhJREFUeNrsXV1oHMcdH4eEQkXjDdR+SVudTKGNa1dXSpJSQn2iT31wJNFAcSi5E6S04IKkB9PEL5IeXAp5kAQt9UPpnfJQU0jRyaJNoQ9aldA6pW5OSI0SCNYpHy9KwWs3LpQ+uPO/+481Ozu33zu3p/3/YLm7/ZjZnZ3f/D9njjECgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAYYx6gJssP986zMP6yExTjH1lmLWvNo4GFqgtTIVeIf03wDklVSLLrBtylqY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hmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYZvPyPwBWJhvkqQR0AAAAAElFTkSuQmCC";class oe{constructor(a,t,n,o,l,h,u){this.from_id=a,this.to_id=t,this.title=n,this.body=o,this.target_id=l,this.target_module=h,this.hanh_dong=u}}const hn=te.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 us extends me.Component{constructor(t){super(t);X(this,"handleSign",t=>{const{FileName:n,UploadServer:o,handleSuccess:l,setisChange:h,IDBaoCao:u,TenBaoCao:m}=this.props;this.setState({loading:!0});var g=JSON.stringify({issuer:t,page:ge("KYSO_DOANHNGHIEP_PAGE"),x:ge("KYSO_DOANHNGHIEP_X"),y:ge("KYSO_DOANHNGHIEP_Y"),width:ge("KYSO_DOANHNGHIEP_WIDTH"),height:ge("KYSO_DOANHNGHIEP_HEIGHT"),UploadHandler:o,FileName:n,maTaiKhoan:B.MaTaiKhoan});Qt(),fetch("http://127.0.0.1:12019/SignPDF/",{mode:"cors",method:"POST",body:g,headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}}).then(d=>d.json()).then(d=>JSON.parse(d)).then(d=>{let r=new oe;r.from_id=B.IDDonVi,r.to_id=B.IDDonVi,r.title=B.TenDonVi,r.body="Ký số "+m,r.target_id=u,r.target_module="BaoCao",r.hanh_dong="da_ky_so",h(!1),l(d),this.setState({loading:!1})}).catch(d=>{M("Ký số không thành công !"),this.setState({loading:!1,openGhiChu:!0})}).finally(()=>ea())});this.state={loading:!1,openGhiChu:!1}}render(){const{open:t,close:n}=this.props;return e.jsx(e.Fragment,{children:e.jsx(gn,{title:"Chọn loại ký số doanh nghiệp",open:t,handleClose:n,maxWidth:"sm",children:e.jsxs(In,{show:this.state.loading,children:[e.jsxs(xe,{style:{marginRight:4},children:[e.jsx(Q,{md:"4",children:e.jsx(hn,{src:cs,alt:"VIETTELCA",title:"VIETTELCA",onClick:o=>this.handleSign("6")})}),e.jsx(Q,{md:"4",children:e.jsx(hn,{src:rs,alt:"FPTCA",title:"FPTCA",onClick:o=>this.handleSign("8")})}),e.jsx(Q,{md:"4",children:e.jsx(hn,{src:hs,alt:"VNPTCA",title:"VNPTCA",onClick:o=>this.handleSign("4")})})]}),e.jsx(xe,{style:{marginRight:4},children:e.jsx(Q,{md:"4",children:e.jsx(hn,{src:ds,alt:"NEWCA",title:"NEWCA",onClick:o=>this.handleSign("7")})})}),e.jsx(xe,{children:e.jsx(Q,{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(xe,{style:{marginRight:4},children:e.jsx(Q,{md:"12",children:e.jsx(E,{color:"primary",onClick:()=>this.handleSign("100"),children:"Ký số hãng khác"})})}),e.jsx(xe,{children:e.jsx(Q,{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 Ln=s=>{const{title:a,variant:t,children:n,className:o}=s;return e.jsxs("div",{className:`toast-detail ${o}`,children:[e.jsxs("div",{className:"toast-detail-header",children:[t==="h3"&&e.jsx("h3",{children:e.jsx("strong",{children:a})}),t==="h4"&&e.jsx("h4",{children:e.jsx("strong",{children:a})}),t==="h5"&&e.jsx("h5",{children:e.jsx("strong",{children:a})}),t==="h6"&&e.jsx("strong",{children:a})]}),e.jsx("div",{className:"toast-detail-body",children:n})]})};Ln.propTypes={title:Te.string.isRequired};Ln.defaultProps={title:"Chi tiết",variant:"h6"};class gs extends i.Component{constructor(t){super(t);X(this,"submitHandler",t=>{this.setState({reload:!0}),t.preventDefault(),this.props.onSubmit(this.state.file)});this.state={file:"",reload:!1}}getInputValue(t,n){return this.props.data&&this.props.data[t]?this.props.data[t]:n||""}render(){return e.jsx(gn,{open:this.props.open,handleClose:()=>{this.props.close(),this.setState({reload:!1})},maxWidth:"xs",children:e.jsxs(Ba,{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(Da,{name:"file",required:!0,getFile:t=>this.setState({file:t}),accept:"application/pdf"})})]}),e.jsxs("div",{className:"d-flex justify-content-center gap-3",children:[e.jsx(E,{style:{fontWeight:500,padding:"0.5rem",width:"100%"},onClick:this.props.close,children:"Đóng"}),e.jsx(E,{style:{fontWeight:500,background:"linear-gradient(45deg, rgb(0 131 255), rgb(0 80 116))",padding:"0.5rem",width:"100%",color:this.state.reload?"white":""},disabled:this.state.reload,type:"submit",children:this.state.reload?e.jsx(ha,{size:"sm",children:"Loading..."}):e.jsx(e.Fragment,{children:"Tải lên"})})]})]})})}}class pn extends i.Component{constructor(t){super(t);X(this,"uploadVanBan",t=>{let n=this,o=Math.max(...this.state.data.map(l=>l.stt));t.append("target_id",n.props.target_id||null),t.append("target_module",n.props.target_module||null),t.append("ma_tai_khoan",B.MaTaiKhoan),t.append("created_date",new Date),t.append("stt",o),this.props.isHoGiaDinh&&t.append("hogiadinh_id",this.props.isHoGiaDinh),na("QuanLyVanBan/Attachment","POST",t,!1).then(function(l){n.getItems(),n.setState({uploading:!1,showPopup:!1})}).catch(function(l){M(l)})});X(this,"addAttachment",async t=>{let n=Math.max(...this.state.data.map(o=>o.stt),1);for(let o=0;o<t.length;o++){let l={target_id:this.props.target_id||null,target_module:this.props.target_module||null,created_by:B.MaTaiKhoan,created_date:new Date,id_van_ban:t[o],stt:++n};try{await y("Attachments","POST",JSON.stringify(l))}catch(h){console.log(h)}}this.setState({searching:!1}),this.getItems()});X(this,"deleteAttachment",async(t,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")&&y(`Attachments(guid'${t}')`,"DELETE",null).then(()=>y(`VanBans(guid'${n}')`,"DELETE",null).then(()=>this.getItems()))}catch(o){M(o)}});X(this,"popupImage",t=>{var n=document.getElementById("myModal"),o=document.getElementById("img01"),l=document.getElementById("caption");n.style.display="block",o.src=t.src,l.innerHTML=t.alt;var h=document.getElementsByClassName("close")[0];h.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(){y(`DonVis?$filter=MaDonVi eq '${B.MaDonVi}'`).then(t=>this.setState({LoaiDonVi:t.value[0]?t.value[0].LoaiDonVi:null})).catch(t=>console.log(t))}getItems(){const{isChange:t}=this.props;let n=this;y(`Attachments?$expand=VanBan&$filter=${`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},()=>t(n.state.data.length))}).catch(function(o){M(o.Message||o)})}downloadPDF(t){let n=t.LinkFile.split("/")[3].split(".")[1];dn(`QuanLyVanBan/Download?id=${t.ID}`,t.Subject+`.${n}`).then().catch(function(o){M(o)})}getCode(t){let n=[];return t.CodeNumber&&n.push(t.CodeNumber),t.CodeNotation&&n.push(t.CodeNotation),n.join("/")}renderClassName(t){let n="";switch(t.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:t}=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?wt?e.jsxs(yn,{color:"success",onClick:()=>{this.setState({showPopup:!0})},children:[e.jsx(L,{fa:"upload"})," Tải lên"]}):e.jsx(e.Fragment,{}):e.jsxs(yn,{color:"success",onClick:()=>{this.setState({showPopup:!0})},children:[e.jsx(L,{fa:"upload"})," Tải lên"]})})]}),e.jsx("p",{}),e.jsxs(fe,{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:Ke+n.VanBan.LinkFile,className:"myImg",width:"50",height:"30"}):e.jsx(_a,{style:{fontSize:"2rem",marginRight:5},className:this.renderClassName(n.VanBan)})}),e.jsx("div",{className:"pull-left",children:t&&t===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(xs,{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(fa,{mode:"create",onOpen:()=>this.setState({uploading:!0}),onClose:()=>this.setState({uploading:!1}),onSubmit:this.uploadVanBan}):null,this.state.showPopup?e.jsx(gs,{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:Te.string.isRequired,target_id:Te.string.isRequired,onView:Te.func};class Vn extends i.Component{constructor(t){super(t);X(this,"handleChange",t=>{this.setState({searchText:t.target.value})});X(this,"selectVanBan",t=>{let n=this.state.selected;n.indexOf(t.target.value)>-1?n.splice(n.indexOf(t.target.value),1):n.push(t.target.value)});X(this,"submitHandler",t=>{this.props.onSubmit(this.state.selected)});this.updateResult=this.updateResult.bind(this),this.state={searchText:"",result:[],selected:[]}}componentDidMount(){this.updateResult()}updateResult(){let t=this;y(`VanBans?$select=ID,Subject,CodeNumber,CodeNotation&$filter= DocType ne null and substringof('${t.state.searchText}', Subject) and Attachments/all(a:a/target_id ne '${t.props.target_id}')`).then(function(n){t.setState({result:n.value})}).catch(function(n){M(n)})}getSize(t){let n=t;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(t){let n=[];return t.CodeNumber&&n.push(t.CodeNumber),t.CodeNotation&&n.push(t.CodeNotation),"Số, ký hiệu: "+n.join("/")}showResult(){return this.state.result&&this.state.result.length?e.jsx(Sa,{dense:!0,children:this.state.result.map((t,n)=>e.jsxs(Na,{children:[e.jsx(Wa,{children:e.jsx(Mt,{id:"vb_"+t.ID,type:"checkbox",value:t.ID,onChange:this.selectVanBan})}),e.jsx(Xa,{children:e.jsx(Pa,{children:e.jsx(L,{fa:"file-pdf-o",style:{color:"red"}})})}),e.jsx(Za,{primary:t.Subject,secondary:this.getCode(t)})]},n))}):e.jsx(za,{children:"* Không tìm thấy văn bản nào"})}render(){return e.jsxs(xa,{open:this.props.open,onClose:this.props.setClose,fullWidth:!0,scroll:"paper",maxWidth:"lg",style:{height:"100%"},children:[e.jsxs(ma,{children:["Tìm kiếm văn bản",e.jsx(Ca,{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(Ta,{children:this.showResult()}),e.jsxs(pa,{children:[e.jsx(ya,{color:"danger",onClick:this.props.setClose,children:"Đóng lại"}),e.jsxs(yn,{color:"primary",onClick:this.submitHandler,children:[e.jsx(L,{fa:"paperclip"})," Đính kèm"]})]})]})}}Vn.propTypes={open:Te.bool,setClose:Te.func.isRequired,onSubmit:Te.func.isRequired};Vn.defaultProps={open:!0};const xs=Vn;const gt="ActivityLogs?$expand=SYS_TaiKhoan/SYS_DonVi";let Hn=class extends i.Component{constructor(a){super(a),this.state={model:[],loading:!1}}componentDidMount(){this.props.target_module&&this.props.target_id&&(this.setState({loading:!0}),lt(`${gt}&$filter=target_module eq '${this.props.target_module}' and target_id eq '${this.props.target_id}'&$orderby=created_date desc`).then(a=>{this.setState({model:a.value,loading:!1})}).catch(a=>M(a)))}componentDidUpdate(a,t){const{isActiveLog:n,isChangeActivityLog:o}=this.props;(n!==a.isActiveLog||o!==a.isChangeActivityLog)&&(this.setState({loading:!0}),lt(`${gt}&$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=>M(l)))}renderData(a){let t="";switch(a.name){case ee.TinNhanTuDonVi:t=e.jsx("b",{className:"text-primary",children:"Gửi"});break;case ee.GuiBaoCao:t=e.jsx("b",{className:"text-primary",children:"Gửi"});break;case ee.DuyetBaoCao:t=e.jsx("b",{className:"text-success",children:"Tiếp nhận"});break;case ee.TuChoiBaoCao:t=e.jsx("b",{className:"text-danger",children:"Từ chối"});break;case ee.ChinhSuaBaoCao:t=e.jsx("b",{className:"text-info",children:"Yêu cầu chỉnh sửa"});break;case ee.DaTrinhKy:t=e.jsx("b",{className:"text-primary",children:"Trình ký"});break;case ee.TuChoiTrinhKy:t=e.jsx("b",{className:"text-danger",children:"Từ chối trình ký"});break;case ee.TiepNhanTrinhKy:t=e.jsx("b",{className:"text-success",children:"Tiếp nhận trình ký"});break;case ee.DaKySo:t=e.jsx("b",{className:"text-primary",children:"Ký số"});break;case ee.HuyKySo:t=e.jsx("b",{className:"text-danger",children:"Hủy ký số"});break;case ee.KhoiTao:t=e.jsx("b",{className:"text-primary",children:"Khởi tạo"});break}return e.jsx(e.Fragment,{children:t&&e.jsx("span",{children:e.jsx("b",{children:t})})})}render(){return e.jsx(In,{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((a,t)=>{let n=a.content;a.content==="Chờ duyệt báo cáo"&&(n="Gửi báo cáo"),a.content==="báo cáo đã ký số"&&(n="Ký số");let o="",l="";return o=a.SYS_TaiKhoan.SYS_DonVi.TenDonVi,l=a.SYS_TaiKhoan.HinhAnh?Ke+a.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:bt(a.created_date)})]}),this.renderData(a),n&&e.jsx("div",{className:"form-info",children:e.jsx("div",{children:n})})]})]},t)})})]})})}};Hn.propTypes={target_id:Te.string.isRequired,target_module:Te.string.isRequired};Hn.defaultProps={hasTitle:!0};var se={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"}};te.div``;te.div` .form-group { label, b { font-weight: bold; } } `;te.div``;te.div``;te(kn)` &.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; } `;te(kn)` .modal-dialog { max-width: ${s=>s.maxWidth?s.maxWidth+"px":"inherit"}; } .ntable-inner { height: ${s=>s.heighttable||"100%"}; } `;const Qe=te(kn)` .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}},ms="gdt@123#@!";function Ts(s){const{isOpen:a,onClose:t,ID:n,reloadAll:o}=s,[l,h]=i.useState({}),{handleChange:u,handleValidate:m}=wa(l,re,r=>h(p=>({...p,...r}))),g=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"),y(`BaoCaos('${n}')?$expand=SYS_DonVi&$select=${r.join(",")}`,"GET",null).then(p=>h({...p,[re.MaDonViNhan.field_name]:p.SYS_DonVi.MaDonVi})).catch(p=>M("Đã xảy ra lỗi","Thông báo"))},[n]);i.useEffect(()=>{g()},[g]);const d=i.useCallback(async()=>{da(l);let r={...l,Id:n};delete r.Parent_Id,delete r.SYS_DonVi,m()&&(await yt("Nhập mật khẩu: ","Thông báo","Vui lòng nhập mật khẩu",!0)===ms?y("BaoCaos/Update","POST",JSON.stringify(r),{odata:!1}).then(()=>{o(),G("Cập nhật thành công","Thông báo"),t()}).catch(c=>M(c||"Đã 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,m,t,o]);return e.jsxs(Qe,{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:"Chỉnh sửa thông tin báo cáo"})}),e.jsxs(Ze,{children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",marginBottom:"1rem",gap:"1.5rem"},children:[e.jsx(ye,{data:re.ID,value:l.ID}),e.jsx(ye,{data:re.Parent_Id,value:l.Parent_Id||"Không có"}),e.jsx(ye,{data:re.MaDonViNhan,inline:!1,value:l.MaDonViNhan,onChange:u}),e.jsx(ye,{data:re.IsTrinhKy,value:l.IsTrinhKy,onChange:u}),e.jsx(ye,{data:re.TrangThai,inline:!1,value:l.TrangThai,onChange:u})]}),e.jsx(xe,{children:e.jsx(Q,{md:"12",children:e.jsxs(fe,{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:ua.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(vt,{color:r.color,children:r.name})})]},r.status))})]})})})]}),e.jsx("div",{className:"mt-1 p-3 d-flex justify-content-end",children:e.jsx(kt,{onClick:d,children:e.jsx("b",{children:"Lưu"})})})]})}function ps(s){var v,N,T,j,D,w,O;const{data:a,isActiveLog:t,reloadAll:n}=s,[o,l]=i.useState(""),[h,u]=i.useState(!1),[m,g]=i.useState(0),[d,r]=i.useState([]),[p,c]=i.useState(!1),x=i.useCallback(()=>c(!p),[p]);i.useEffect(()=>{u(!!o)},[o]),i.useEffect(()=>{_()},[t]);const A=i.useCallback(F=>{g(F)},[]),_=()=>{y(`Attachments?$expand=VanBan&$filter=target_id eq '${a.ID}' and IsAttachment eq false&$orderby=stt`,"GET",null).then(F=>r(F.value)).catch(F=>M(F.Message||F))},S=F=>{dn(`QuanLyVanBan/Download?id=${F.ID}`,F.Subject+".pdf").then().catch(function(q){M(q)})},H=i.useMemo(()=>e.jsxs("span",{children:[a.MaBaoCao," ",e.jsx(fs,{title:"Chỉnh sửa thông tin báo cáo",onClick:x,children:e.jsx(L,{fa:"cog"})})]}),[a.MaBaoCao,x]),b=i.useMemo(()=>e.jsx(pn,{target_id:a.ID,target_module:a.LinhVuc_Id,isChange:A,IsAttachment:!0}),[a.ID,a.LinhVuc_Id,A]),f=i.useMemo(()=>h&&e.jsx(At,{open:h,onClose:()=>u(!1),filePDF:o}),[h,o]),k=i.useMemo(()=>p&&e.jsx(Ts,{isOpen:p,onClose:x,ID:a.ID,reloadAll:n}),[a.ID,p,x,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=a.DM_BaoCao)==null?void 0:v.Name}),e.jsx("p",{className:"mb-4",children:H})]}),e.jsxs("div",{className:"form-body-thongtin-bao-cao",children:[[{data:se.MauBaoCao_Id,value:(N=a.DM_MauBaoCao)==null?void 0:N.Name},{data:se.TanSuat_Id,value:(T=a.DM_TanSuat)==null?void 0:T.Name},{data:se.TenDonViGui,value:(j=a.SYS_DonVi1)==null?void 0:j.TenDonVi},{data:se.TenDonViNhan,value:(D=a.SYS_DonVi)==null?void 0:D.TenDonVi},{data:se.MaDonViNhan,value:(w=a.SYS_DonVi)==null?void 0:w.MaDonVi},a.PhongBanTiepNhan_Id&&{data:se.PhongBanTiepNhan_Id,value:(O=a.DM_PhongBan)==null?void 0:O.TenPhongBan},{data:se.TrangThai,value:e.jsx(Nn,{status:a.TrangThai})},{data:se.TGTao,value:a==null?void 0:a.TGTao},{data:se.TGGuiBaoCao,value:a.TGGuiBaoCao},{data:se.Period,value:a.Period}].map((F,q)=>F&&e.jsx("div",{children:e.jsx(ye,{data:F.data,value:F.value,isDetail:!0})},q)),a.Thang_Id&&e.jsx(ye,{data:se.Thang_Id,value:a.Thang_Id,isDetail:!0}),a.LyDo&&(a.TrangThai===V.Tu_Choi||a.TrangThai===V.Tu_Choi_Trinh_Ky)&&e.jsx(ye,{data:se.LyDo,value:a.LyDo}),d&&d.length>0&&d.map((F,q)=>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:F.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:ae=>{l(`${ns}?id=${F.id_van_ban}`),u(!0)},title:"Xem trước"}),e.jsx(Fe,{color:"primary",icon:"download",onClick:ae=>S(F.VanBan),title:"Tải xuống"})]})]},F.id_van_ban))]}),e.jsx(He,{children:b}),e.jsx(He,{children:f}),e.jsx(He,{children:k})]}),e.jsx("div",{children:e.jsx("div",{children:e.jsx(Ln,{title:"Lịch sử thao tác",children:e.jsx(Hn,{isChangeActivityLog:m,hasTitle:!1,target_id:a.ID,target_module:"BaoCao",isActiveLog:t})})})})]})})}const fs=te.span` cursor: pointer; transition: 0.3s; margin-left: 0.25rem; &:hover { color: gray; } i { font-size: 16px; } `;var Ht=["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,a){var t=function(n){for(;--n;)s.push(s.shift())};t(++a)})(Ht,341);var z=function(s,a){s=s-0;var t=Ht[s];return t};function Cs(s,a){if(z("0x0")in window){var t=new WebSocket("wss://127.0.0.1:8987/SignPDF");t[z("0x2")]=function(){t.send(s)},t.onerror=function(){Et(s,a)},t[z("0x5")]=function(n){a&&a(n[z("0xc")]),t[z("0x6")]()},t[z("0x7")]=function(){console[z("0x8")](z("0x9"))}}else a&&a('{"Error": "WebSocket NOT supported by your Browser!", "Status":500}'),console.log(z("0xa"))}function Ds(s,a){if("WebSocket"in window){var t=new WebSocket(z("0x12"));t[z("0x2")]=function(){t[z("0x3")](s)},t.onerror=function(){Et(s,a)},t.onmessage=function(n){a&&a(n[z("0xc")]),t[z("0x6")]()},t[z("0x7")]=function(){console[z("0x8")](z("0x9"))}}else a&&a(z("0xd")),console[z("0x8")](z("0xa"))}function Et(s,a){if(z("0x0")in window){var t=new WebSocket(z("0x1e"));t[z("0x2")]=function(){t.send(s)},t.onerror=function(){Ds(s,a)},t[z("0x5")]=function(n){a&&a(n[z("0xc")]),t.close()},t.onclose=function(){console[z("0x8")](z("0x9"))}}else a&&a(z("0xd")),console[z("0x8")]("WebSocket NOT supported by your Browser!")}const ue=ta.mixin({cancelButtonColor:"#d33"});class js{constructor(){X(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});X(this,"defaultSuccessSwal",{icon:"success",showConfirmButton:!0,showCancelButton:!1,confirmButtonText:"Xác nhận",allowOutsideClick:!0,title:"Thành công",text:""});X(this,"handleSuccess",(a,t)=>n=>{typeof t=="function"&&t(n);const o=()=>typeof a=="string"?{title:a}:typeof a(n)=="object"?a(n):{title:a(n)},l=a!==void 0?{...this.defaultSuccessSwal,...o()}:this.defaultSuccessSwal;return ue.isVisible()?ue.update(l):ue.fire(l)});X(this,"handleError",a=>t=>{const{onError:{getSwal:n,callback:o}={}}=a;typeof o=="function"&&o(t);const l=()=>typeof n=="string"?{...this.defaultErrorSwal,title:n}:typeof n=="function"?{...this.defaultErrorSwal,...n(t)}:this.defaultErrorSwal;return ue.fire({preConfirm:()=>this.onOpen(a,!0),...l()})});X(this,"onOpen",(a,t)=>{const{confirmSwal:n,pendingSwal:o,callAPIFn:l,onSuccess:{getSwal:h,callback:u}={}}=a;if(typeof l!="function")throw new Error("bro what the fck");const m=()=>{ue.showLoading(),l().then(this.handleSuccess(h,u)).catch(this.handleError(a)).finally(ue.hideLoading)},g={icon:"info",title:"Đang xử lý",showConfirmButton:!1,showCancelButton:!1,allowOutsideClick:!ue.isLoading,onOpen:m},d=()=>o===void 0?g:typeof o=="object"?{...g,...o}:typeof o=="string"?{...g,title:o}:g,r=()=>typeof n=="object"?n:typeof n=="string"?{title:n}:{},p=()=>ue.fire(d()),x={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:A=>{if(A)return p()}};return n?t?p():ue.fire({...x,...r()}):p()})}}const bs=new js,ys=i.memo(s=>{const{open:a,onClose:t,onSave:n,label:o="Lý do từ chối:",placeholder:l="Nhập lý do từ chối"}=s,[h,u]=i.useState("");return e.jsx(gn,{open:a,handleClose:onclose,title:"Từ chối",maxWidth:"sm",renderButton:e.jsxs("div",{children:[e.jsx(We,{onClick:t,children:"Hủy"}),e.jsx(kt,{onClick:()=>n(h),children:"Lưu"})]}),children:e.jsxs(ka,{row:!0,children:[e.jsx(Q,{md:"4",children:e.jsx(Ma,{htmlFor:"select",children:e.jsxs("b",{children:[o," ",e.jsx("span",{style:{color:"red"},children:"(*)"})]})})}),e.jsx(Q,{md:"8",children:e.jsx(va,{name:"ly_do",placeholder:l,onChange:m=>u(m.target.value),rows:5})})]})})});function Ss(s){const{onClose:a,isOpen:t,MauBaoCao_Id:n,data_id:o}=s,[l,h]=i.useState([]),u=i.useCallback(()=>{n&&y(`BaoCaos/GetDownloadList?MauBaoCao_Id=${n}`,"GET",null,{odata:!1}).then(g=>h(g))},[n]),m=i.useMemo(()=>l.map((g,d)=>e.jsxs("tr",{children:[e.jsx("td",{className:"text-center",children:d+1}),e.jsx("td",{children:g.Name}),e.jsxs("td",{style:{textAlign:"center"},children:[e.jsxs("span",{children:[" ",e.jsx(Ns,{MauBaoCao_HTML_Id:g.Id,data_id:o})," "]})," "]})]},d)),[l,o]);return i.useEffect(()=>{u()},[u]),e.jsxs(Qe,{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:"Phiên bản tải xuống"})}),e.jsx(Ze,{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:m})]})}),e.jsx(xn,{children:e.jsx(We,{size:"md",onClick:a,children:e.jsx("b",{children:"Trở lại"})})})]})}const Ns=s=>{const{MauBaoCao_HTML_Id:a,data_id:t}=s,[n,o]=i.useState(!1),l="BaoCaos/GeneratePDF",h=()=>o(!n),u=(m="pdf")=>{let g=m;m==="excel"&&(g="xlsx"),m==="word"&&(g="docx"),m==="xml"&&(g="xml"),dn(`${l}?id=${t}&MauBaoCao_HTML_Id=${a}&pageSize=A4&landscape=true&mode=download_${m}`,`Tải xuống.${g}`,"GET",null,!0).then(()=>{}).catch(()=>M("Đã xảy ra lỗi tải file!","Thông báo"))};return e.jsxs(Mn,{isOpen:n,toggle:h,className:"mr-2",children:[e.jsxs(Xe,{caret:!0,color:"success",size:"sm",children:[e.jsx(L,{fa:"print"})," Tải xuống"]}),e.jsxs(qe,{children:[e.jsx(R,{onClick:()=>u(),children:"PDF"}),e.jsx(R,{onClick:()=>u("excel"),children:"Excel"}),e.jsx(R,{onClick:()=>u("word"),children:"Word"}),e.jsx(R,{onClick:()=>u("xml"),children:"XML"})]})]})};function Is(s){const{onClose:a,isOpen:t,MauBaoCao_Id:n,data_id:o,handleShowPDFSLT:l,checkDonVi:h}=s,[u,m]=i.useState([]),g=i.useCallback(()=>{n&&y(`BaoCaos/GetDownloadList?MauBaoCao_Id=${n}`,"GET",null,{odata:!1}).then(r=>m(r))},[n]),d=i.useMemo(()=>u.map((r,p)=>{if(h){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(xt,{handleShowPDFSLT:l,MauBaoCao_HTML_Id:r.Id,data_id:o,onClose:a})})})]},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(xt,{handleShowPDFSLT:l,MauBaoCao_HTML_Id:r.Id,data_id:o,onClose:a})})})]},p)}),[u,o]);return i.useEffect(()=>{g()},[g]),e.jsxs(Qe,{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:"Phiên bản xem PDF"})}),e.jsx(Ze,{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(xn,{children:e.jsx(We,{size:"md",onClick:a,children:e.jsx("b",{children:"Trở lại"})})})]})}const xt=s=>{const{MauBaoCao_HTML_Id:a,data_id:t,handleShowPDFSLT:n,onClose:o}=s,[l,h]=i.useState(!1),u=()=>h(!l),m=()=>{n(`api/BaoCaos/GeneratePDF?id=${t}&MauBaoCao_HTML_Id=${a}`),o()};return e.jsxs(E,{color:"success",isOpen:l,toggle:u,className:"mr-2",onClick:()=>m(),children:[e.jsx(L,{fa:"eye"})," Xem PDF"]})};function mt(){const{innerWidth:s,innerHeight:a}=window;return{width:s,height:a}}function Bs(){const[s,a]=i.useState(mt());return i.useEffect(()=>{function t(){a(mt())}return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]),s}function _s(s){const{onClose:a,isOpen:t,MauBaoCao_Id:n,data_id:o,handleShowPDFSLT:l,checkDonVi:h,getDataBaoCao:u}=s,[m,g]=i.useState([]),d=i.useCallback(()=>{n&&y(`BaoCaos/GetDownloadList?MauBaoCao_Id=${n}`,"GET",null,{odata:!1}).then(p=>g(p))},[n]),r=i.useMemo(()=>m.map((p,c)=>{if(h){if(p.Id)return e.jsxs("tr",{children:[e.jsx("td",{className:"text-center",children:c}),e.jsx("td",{children:p.Name}),e.jsxs("td",{style:{textAlign:"center"},children:[e.jsxs("span",{children:[" ",e.jsx(Tt,{handleShowPDFSLT:l,MauBaoCao_HTML_Id:p.Id,data_id:o,getDataBaoCao:u})," "]})," "]})]},c)}else return e.jsxs("tr",{children:[e.jsx("td",{className:"text-center",children:c}),e.jsx("td",{children:p.Name}),e.jsxs("td",{style:{textAlign:"center"},children:[e.jsxs("span",{children:[" ",e.jsx(Tt,{handleShowPDFSLT:l,MauBaoCao_HTML_Id:p.Id,data_id:o,getDataBaoCao:u})," "]})," "]})]},c)}),[m,o]);return i.useEffect(()=>{d()},[d]),e.jsxs(Qe,{isOpen:t,toggle:a,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(Ze,{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(xn,{children:e.jsx(We,{size:"md",onClick:a,children:e.jsx("b",{children:"Trở lại"})})})]})}const Tt=s=>{const{MauBaoCao_HTML_Id:a,data_id:t,handleShowPDFSLT:n,getDataBaoCao:o}=s,[l,h]=i.useState(!1),u=()=>h(!l),m=(g="pdf")=>{y(`BaoCaos/GeneratePDF?id=${t}&MauBaoCao_HTML_Id=${a}&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=>{M("Lỗi","Thông báo"),o()})};return e.jsxs(E,{color:"success",isOpen:l,toggle:u,className:"mr-2",onClick:()=>m(),children:[e.jsx(L,{fa:"check"})," Xác nhận"]})};function As(s){const{onClose:a,isOpen:t,MauBaoCao_Id:n,data_id:o,handleShowPDFSLT:l,checkDonVi:h,setOpenKySoSoBanNganh:u,setIdMauBaoCao:m}=s,[g,d]=i.useState([]);i.useState(!1);const r=i.useCallback(()=>{n&&y(`BaoCaos/GetDownloadList?MauBaoCao_Id=${n}`,"GET",null,{odata:!1}).then(c=>d(c))},[n]),p=i.useMemo(()=>g.map((c,x)=>{if(h){if(c.Id)return e.jsxs("tr",{children:[e.jsx("td",{className:"text-center",children:x}),e.jsx("td",{children:c.Name}),e.jsxs("td",{style:{textAlign:"center"},children:[e.jsxs("span",{children:[" ",e.jsxs(E,{color:"success",className:"mr-2",onClick:()=>{c.Id&&m(c.Id),u(!0)},children:[e.jsx(L,{fa:"check"})," Ký số"]})]})," "]})]},x)}else return e.jsxs("tr",{children:[e.jsx("td",{className:"text-center",children:x}),e.jsx("td",{children:c.Name}),e.jsxs("td",{style:{textAlign:"center"},children:[e.jsxs("span",{children:[" ",e.jsxs(E,{color:"success",className:"mr-2",onClick:()=>{c.Id&&m(c.Id),u(!0)},children:[e.jsx(L,{fa:"check"})," Ký số"]})," "]})," "]})]},x)}),[g,o]);return i.useEffect(()=>{r()},[r]),e.jsxs(Qe,{isOpen:t,toggle:a,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(Ze,{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(xn,{children:e.jsx(We,{size:"md",onClick:a,children:e.jsx("b",{children:"Trở lại"})})})]})}const ws=38,ks=s=>aa(`/Dieu19/XoaBaoCao?baoCao_Id=${s}`,"DELETE",null,1+1==3),jn=te(Mn)` .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 pt(s){var at,st,ot,it;const{data:{TrangThai:a,IsTrinhKy:t},data:n,BaoCaoDi:o,setOpenKySoDoanhNghiep:l,setOpenKySoSoBanNganh:h,setIdMauBaoCao:u,handleShowPDF:m,onClose:g,reloadData:d,getDataBaoCao:r,setIsActiveLog:p,reportCode:c,isChange:x,setisChange:A,handleClose:_,handleShowPDFSLT:S,handleCheckDataSynthesis:H,handleReloadDetailChiTiet:b,disabledTiepNhan:f}=s,k=un(),{Them:v,Xoa:N,Download:T,Upload:j,Xem:D,TrinhKy:w,KySo:O,Gui:F,TiepNhanTrinhKy:q,TiepNhanBaoCao:ae}=Lt(k==null?void 0:k.pathname),we=()=>{St(`${Ae}?id=${n.ID}`).then(C=>C.blob()).then(C=>{const I=new FormData;I.append("ma_tai_khoan",B.MaTaiKhoan),I.append("uploadfile",C),Nt(`${Ee}?id_bao_cao=${n.ID}`,I).then(P=>{P.Status?G("Ký số thành công !").then(()=>{var ze;let W=new oe;W.from_id=B.IDDonVi,W.to_id=B.IDDonVi,W.title=B.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",A(!1),d(),r(),p(!0)}):M("Ký số không thành công !")}).catch(P=>console.log(P))}).catch(C=>console.log(C))},Ce=i.useCallback(()=>B.Dieu18_SoLieuTinh===!0&&(n.DM_MauBaoCao.Code===123||n.DM_MauBaoCao.Code===125),[n.DM_MauBaoCao.Code]),[De,en]=i.useState(!1),[je,nn]=i.useState(!1),[Ne,ce]=i.useState(!1),[Ie,fn]=i.useState(!1),he=i.useCallback(()=>en(!De),[De]),Pe=i.useCallback(()=>nn(!je),[je]),Oe=i.useCallback(()=>ce(!Ne),[Ne]),ke=i.useCallback(()=>{const C=n.DM_MauBaoCao.Code;ge("KYSO_GIALAP")||n.LinhVuc_Id==="a08e3e74-3bfa-41ef-b105-e3f3e752bd5c"?C===36||C===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"):we():fn(!Ie)},[n.DM_MauBaoCao.Code,n.LinhVuc_Id,we,Ie]),[ie,de]=i.useState(!1);i.useState(!1),i.useState(!1);const[En,tn]=i.useState(""),[Cn,K]=i.useState(0),{height:$,width:Be}=Bs();i.useEffect(()=>{window.screen.width<1536&&tn("0.66563rem")},[]);const le=i.useMemo(()=>ie&&ie.isOpen&&ie.onSave&&e.jsx(ys,{open:ie.isOpen,onClose:()=>de(null),onSave:ie.onSave,label:ie.label,placeholder:ie.placeholder}),[ie]);i.useCallback(()=>{y(`BaoCaos/GeneratePDF?id=${n.ID}&isUpdate=true`,"GET",null,{odata:!1}).then(C=>{G("Xác nhận dữ liệu thành công","Thông báo"),r()}).catch(C=>{G("Xác nhận dữ liệu thành công","Thông báo"),r()})},[n.ID]);const be=()=>{const C=n.DM_MauBaoCao.Code;ge("KYSO_GIALAP")||n.LinhVuc_Id==="a08e3e74-3bfa-41ef-b105-e3f3e752bd5c"?C===36||C===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"):we():h(!0)},an=()=>{ge("KYSO_GIALAP")?we():l(!0)},Ge=C=>{x?U("Bạn chưa lưu dữ liệu, bạn chắc chắn muốn ký số?").then(()=>C()):C()},Fn=i.useCallback(()=>de({isOpen:!0,label:"Lý do hủy ký số:",placeholder:"Nhập lý do từ chối",onSave:C=>{C?y("BaoCaos/HuyKySo","POST",JSON.stringify({id:n.ID,ly_do:C}),{odata:!1}).then(()=>G("Hủy ký số thành công","Thông báo").then(()=>{var P;let I=new oe;I.from_id=B.IDDonVi,I.to_id=B.IDDonVi,I.title=B.TenDonVi,I.body="Hủy ký số "+((P=n.DM_BaoCao)==null?void 0:P.Name),I.target_id=n.ID,I.target_module="BaoCao",I.hanh_dong="huy-ky-so",A(!1),p(!0),d(),r(),de(null)})).catch(I=>M("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,A]),Kn=()=>{y("BaoCaos/GuiBaoCao","POST",JSON.stringify({id:n.ID}),{odata:!1}).then(C=>G("Gửi báo cáo thành công!","Thông báo").then(()=>{var P;let I=new oe;I.from_id=B.IDDonVi,I.to_id=n.DonViNhan_Id,I.title=B.TenDonVi,I.body="Gửi "+((P=n.DM_BaoCao)==null?void 0:P.Name),I.target_id=n.ID,I.target_module="BaoCao",I.hanh_dong="gui",d(),g()})).catch(C=>console.log(C))},Pn=()=>{U(`Bạn muốn tiếp nhận với mã báo cáo '${n.MaBaoCao}' ?`).then(()=>y(`${ts}`,"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 C=new oe;C.from_id=B.IDDonVi,C.to_id=n.DonVi_Id,C.title=B.TenDonVi,C.body="Tiếp nhận "+((I=n.DM_BaoCao)==null?void 0:I.Name),C.target_id=n.ID,C.target_module="BaoCao",C.hanh_dong="da_duyet",d(),r(),g()}))).catch(C=>M("Đã xảy ra lỗi khi tiếp nhận báo cáo !"))},On=()=>{let C=(k==null?void 0:k.pathname)==="/phe-duyet",I=C?`BaoCaos/HuyTiepNhan?baoCao_Id=${n==null?void 0:n.ID}`:`BaoCaos('${n==null?void 0:n.ID}')`,P=C?"POST":"PATCH",W=C?null:JSON.stringify({TrangThai:2});U("Bạn có chắc chắn muốn thực hiện").then(()=>y(I,P,W,{odata:!C}).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(),g()}))).catch(ze=>M("Đã xảy ra lỗi khi tiếp nhận báo cáo !"))},Gn=i.useCallback(()=>de({isOpen:!0,onSave:C=>{C?y(`${as}`,"POST",JSON.stringify({id:n.ID,ly_do:C}),{odata:!1}).then(()=>G("Từ chối báo cáo thành công","Thông báo").then(()=>{var P;let I=new oe;I.from_id=B.IDDonVi,I.to_id=n.DonVi_Id,I.title=B.TenDonVi,I.body="Từ chối báo cáo "+((P=n.DM_BaoCao)==null?void 0:P.Name),I.target_id=n.ID,I.target_module="BaoCao",I.hanh_dong="tu_choi",d(),r(),g()})).catch(I=>M(I,"Thông báo")):Z("Vui lòng nhập lý do từ chối!","THÔNG BÁO")}}),[(at=n.DM_BaoCao)==null?void 0:at.Name,n.DonVi_Id,n.ID,r,g,d,de]),zn=()=>{if(!n.ID)return M("Không tìm thấy Id báo cáo.Vui lòng thử lại!","Lỗi!");if(c===ws)return bs.onOpen({callAPIFn:()=>ks(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(),g()},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(C=>{y(`BaoCaos('${n.ID}')`,"DELETE",null).then(I=>G("Xóa báo cáo thành công","Thông báo").then(()=>{d(),g()})).catch(I=>M("Xóa báo cáo không thành công","Thông báo"))})},Rn=i.useCallback(()=>n&&y("BaoCaos/TrinhKy","POST",JSON.stringify({id:n.ID}),{odata:!1}).then(()=>{var I;let C=new oe;C.from_id=B.IDDonVi,C.to_id=B.IDDonVi,C.title=B.TenDonVi,C.body="Trình ký "+((I=n.DM_BaoCao)==null?void 0:I.Name),C.target_id=n.ID,C.target_module="BaoCao",C.hanh_dong="trinh_ky",d(),r(),G("Trình ký thành công","Thông báo")}).catch(()=>M("Không thể trình ký","Thông báo")),[n,r,d]),Yn=i.useCallback(()=>n&&y("BaoCaos/TiepNhanTrinhKy","POST",JSON.stringify({id:n.ID}),{odata:!1}).then(()=>{var I;let C=new oe;C.from_id=B.IDDonVi,C.to_id=B.IDDonVi,C.title=B.TenDonVi,C.body="Tiếp nhận trình ký "+((I=n.DM_BaoCao)==null?void 0:I.Name),C.target_id=n.ID,C.target_module="BaoCao",C.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(()=>M("Không thể tiếp nhận trình ký","Thông báo")),[n,r,d]),Xn=i.useCallback(()=>de({isOpen:!0,onSave:C=>{C?y("BaoCaos/TuChoiTrinhKy","POST",JSON.stringify({id:n.ID,ly_do:C}),{odata:!1}).then(()=>G("Từ chối trình ký thành công","Thông báo").then(()=>{var P;let I=new oe;I.from_id=B.IDDonVi,I.to_id=B.IDDonVi,I.title=B.TenDonVi,I.body="Từ chối trình ký"+((P=n.DM_BaoCao)==null?void 0:P.Name),I.target_id=n.ID,I.target_module="BaoCao",I.hanh_dong="tu_choi_trinh_ky",d(),r(),g()})).catch(I=>M("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")}}),[(st=n.DM_BaoCao)==null?void 0:st.Name,n.ID,r,g,d]);B.MaLoaiDonVi;const _e=n&&ss&&!n.PhongBanTiepNhan_Id?!0:(n==null?void 0:n.PhongBanTiepNhan_Id)===B.PhongBan_Id;i.useEffect(()=>{const C=[T,o&&w&&t,o&&q&&t,o&&O&&B.LoaiKySo===1,o&&O&&B.LoaiKySo===2,o&&O,o&&F,o&&N,!o&&ae&&_e,o&&v],I=[];C.forEach(W=>{let ze=!(!W||W===void 0);I.push(+ze)});let P=0;I.forEach(W=>P+=W),K(P)},[o,t,_e]);const qn=i.useMemo(()=>!(a===V.Tu_Choi||a===V.Tu_Choi_Trinh_Ky),[a]),sn=i.useMemo(()=>t===!0?a!==V.Da_Tiep_Nhan_Trinh_Ky:a!==V.Khoi_Tao,[t,a]),Un=i.useCallback(()=>{var C;if(n){let I={HanhDong:ee.ChinhSuaBaoCao,NoiDung:(C=n.DM_BaoCao)==null?void 0:C.Name,DonViGui_Id:n.DonVi_Id,DonViNhan_Id:n.DonViNhan_Id,DaXemThongBao:!1,Target_Id:n.ID,Targer_Module:Aa.BaoCao};Promise.all([y("SYS_ThongBao","POST",JSON.stringify(I)),(k==null?void 0:k.pathname)==="/de-xuat"||(k==null?void 0:k.pathname)==="/phe-duyet"?y(`BaoCaos/ChinhSuaBaoCao?baoCao_Id=${n.ID}`,"POST",null,{odata:!1}):y(`BaoCaos('${n.ID}')`,"PATCH",JSON.stringify({TrangThai:V.Khoi_Tao}))]).then(()=>{var W;let P=new oe;P.from_id=B.IDDonVi,P.to_id=B.IDDonVi,P.title=B.TenDonVi,P.body="Chỉnh sửa báo cáo"+((W=n.DM_BaoCao)==null?void 0:W.Name),P.target_id=n.ID,P.target_module="BaoCao",P.hanh_dong=ee.ChinhSuaBaoCao,d(),r()}).catch(()=>{M("Không thể chỉnh sửa","Thông báo"),y(`BaoCaos('${n.ID}')`,"PATCH",JSON.stringify({TrangThai:V.Tu_Choi}))})}},[n,r,d]),Wn=i.useMemo(()=>De&&e.jsx(Ss,{MauBaoCao_Id:n.MauBaoCao_Id,data_id:n.ID,isOpen:De,onClose:he}),[n,De,he]),$n=i.useMemo(()=>je&&e.jsx(Is,{checkDonVi:Ce(),MauBaoCao_Id:n.MauBaoCao_Id,data_id:n.ID,isOpen:je,onClose:Pe,handleShowPDFSLT:S}),[n,je,Pe,S]),Jn=i.useMemo(()=>Ne&&e.jsx(_s,{checkDonVi:Ce(),MauBaoCao_Id:n.MauBaoCao_Id,data_id:n.ID,isOpen:Ne,onClose:Oe,getDataBaoCao:r}),[Ne,n,Oe,r]),Ot=i.useMemo(()=>Ie&&e.jsx(As,{checkDonVi:Ce(),MauBaoCao_Id:n.MauBaoCao_Id,data_id:n.ID,isOpen:Ie,onClose:ke,getDataBaoCao:r,r:!0,setOpenKySoSoBanNganh:h,setIdMauBaoCao:u}),[Ie,Ce,n.MauBaoCao_Id,n.ID,ke,r,h]),[Zn,Gt]=i.useState(!1),zt=()=>Gt(!Zn),[Qn,Rt]=i.useState(!1),Yt=()=>Rt(!Qn),[et,Xt]=i.useState(!1),qt=()=>Xt(!et),on=((ot=n==null?void 0:n.BaoCao2)==null?void 0:ot.TrangThai)!==void 0;((it=n==null?void 0:n.BaoCao2)==null?void 0:it.TrangThai)===V.Cho_Duyet||V.Da_Duyet||V.Tu_Choi;const[Dn,Ut]=i.useState([]),[Me,Wt]=i.useState(!1),ln=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 rn=i.useCallback(()=>{y(`BaoCaos('${n.ID}')?$expand=HNCN_TrangThaiDuLieu`,"GET",null,{odata:!0}).then(C=>{var I,P;console.log((I=C.HNCN_TrangThaiDuLieu[0])==null?void 0:I.DaChotDuLieu),Ut(C.HNCN_TrangThaiDuLieu),Wt((P=C.HNCN_TrangThaiDuLieu[0])==null?void 0:P.DaChotDuLieu)}).catch(C=>{console.log(C)})},[n.ID]),nt=i.useCallback(()=>{U(`Chốt số liệu năm ${n==null?void 0:n.NamBanHanh}?`,"Thông báo").then(()=>{y(`BaoCaoExt/ChotDuLieu?baoCao_Id=${n.ID}`,"POST",null,{odata:!1}).then(C=>{G(C,"Thông báo"),d(),rn(),H()}).catch(C=>{M(C,"Thông báo")})})},[]),tt=i.useCallback(()=>{U(`Huỷ chốt dữ liệu năm ${n==null?void 0:n.NamBanHanh}?`,"Thông báo").then(()=>{var C;y(`HNCN_TrangThaiDuLieu(${Dn&&((C=Dn[0])==null?void 0:C.Id)})`,"PATCH",JSON.stringify({DaChotDuLieu:!1}),{odata:!0}).then(()=>{G("Huỷ chốt dữ liệu thành công","Thông báo"),rn(),H(),d()}).catch(()=>M("Huỷ chốt dữ liệu không thành công","Thông báo"))})},[Dn]);return i.useEffect(()=>{rn()},[rn]),a||a===0?e.jsxs("div",{className:"form-render-button",children:[Be<1500?e.jsxs(e.Fragment,{children:[T&&e.jsxs(jn,{className:"me-2",isOpen:Zn,toggle:zt,children:[e.jsx(Xe,{color:"primary",caret:!0,size:"sm",children:"Thao tác với PDF"}),e.jsx(qe,{children:T&&e.jsxs(e.Fragment,{children:[e.jsxs(R,{onClick:he,children:[e.jsx(L,{fa:"download"}),"Tải xuống"]}),e.jsxs(R,{onClick:()=>m(n),children:[e.jsx(L,{fa:"eye"}),"Xem file PDF"]})]})})]}),(o&&w&&t||o&&q&&t||o&&F||!o&&ae&&_e||o&&v)&&e.jsxs(jn,{className:"me-2",isOpen:Qn,toggle:Yt,children:[e.jsx(Xe,{color:"success",caret:!0,size:"sm",children:"Thao tác với báo cáo"}),e.jsxs(qe,{children:[o&&w&&t&&e.jsxs(R,{disabled:a!==V.Khoi_Tao&&a!==V.Tu_Choi,onClick:Rn,children:[e.jsx(L,{fa:"pencil-square-o"})," Trình ký"]}),o&&q&&t&&e.jsxs(R,{disabled:a!==V.Da_Trinh_Ky,onClick:Yn,children:[e.jsx(L,{fa:"pencil-square-o"})," Tiếp nhận trình ký"]}),o&&q&&t&&e.jsxs(R,{onClick:Xn,children:[e.jsx(L,{fa:"pencil-square-o"})," Từ chối trình ký"]}),o&&F&&e.jsxs(R,{disabled:a!==V.Da_Ki_So,onClick:Kn,children:[e.jsx(L,{fa:"paper-plane"})," Gửi báo cáo"]}),ne&&ln&&o&&!O&&e.jsxs(R,{disabled:Me,onClick:nt,children:[e.jsx(L,{fa:"check-square-o"})," Chốt số liệu"]}),ne&&ln&&o&&!O&&e.jsxs(R,{disabled:!Me,onClick:tt,children:[e.jsx(L,{fa:"ban"})," Huỷ chốt số liệu"]}),o&&N&&e.jsxs(R,{disabled:Me?!0:a!==V.Khoi_Tao&&a!==V.Tu_Choi&&a!==V.Tu_Choi_Trinh_Ky,onClick:zn,children:[e.jsx(L,{fa:"trash"})," Xóa báo cáo"]}),!o&&ae&&_e&&e.jsx(R,{onClick:Pn,disabled:f||a!==V.Cho_Duyet,children:"Tiếp nhận báo cáo đến"}),!o&&a===V.Da_Duyet&&e.jsx(R,{onClick:On,disabled:a!==V.Tu_Choi?!!(on&&a!==V.Cho_Duyet):!0,children:"Hoàn tác"}),!o&&ae&&_e&&e.jsx(R,{onClick:Gn,disabled:a!==V.Tu_Choi?!!(on&&a!==V.Cho_Duyet):!0,children:"Từ chối báo cáo đến"}),o&&v&&e.jsxs(R,{disabled:qn,onClick:Un,children:[e.jsx(L,{fa:"edit"})," Chỉnh sửa"]})]})]}),(o&&O&&B.LoaiKySo===1||o&&O&&B.LoaiKySo===2||o&&O)&&e.jsxs(jn,{className:"me-2",isOpen:et,toggle:qt,children:[e.jsx(Xe,{color:"warning",caret:!0,size:"sm",children:"Thao tác với ký số"}),e.jsxs(qe,{children:[o&&O&&B.LoaiKySo===1&&e.jsxs(R,{disabled:sn,onClick:()=>Ge(be),children:[e.jsx(L,{fa:"pencil-square-o"})," Ký số"]}),o&&O&&B.LoaiKySo===2&&e.jsxs(R,{disabled:sn,onClick:()=>Ge(an),children:[e.jsx(L,{fa:"pencil-square-o"})," Ký số"]}),o&&O&&e.jsxs(R,{disabled:a!==V.Da_Ki_So,onClick:Fn,children:[e.jsx(L,{fa:"times"})," Hủy ký số"]})]})]}),Wn,$n,le,Jn]}):e.jsxs(e.Fragment,{children:[T&&e.jsxs(E,{color:"primary",size:"sm",onClick:he,className:"me-2",children:[" ","Tải Xuống"]}),T&&e.jsx(E,{color:"primary",size:"sm",onClick:Pe,className:"me-2",children:"Xem file PDF"}),o&&w&&t&&e.jsxs(E,{onClick:Rn,disabled:a!==V.Khoi_Tao&&a!==V.Tu_Choi,color:"primary",size:"sm",className:"me-2",children:[e.jsx(L,{fa:"pencil-square-o"})," Trình ký"]}),o&&q&&t&&e.jsxs(E,{onClick:Yn,disabled:a!==V.Da_Trinh_Ky,color:"primary",size:"sm",className:"me-2",children:[e.jsx(L,{fa:"pencil-square-o"})," Tiếp nhận trình ký"]}),o&&q&&t&&e.jsxs(E,{onClick:Xn,color:"danger",size:"sm",className:"me-2",children:[e.jsx(L,{fa:"pencil-square-o"})," Từ chối trình ký"]}),o&&O&&B.LoaiKySo===1&&e.jsxs(E,{onClick:ke,disabled:sn,color:"primary",size:"sm",className:"me-2",children:[e.jsx(L,{fa:"pencil-square-o"})," Ký số"]}),o&&O&&B.LoaiKySo===2&&e.jsxs(E,{onClick:()=>Ge(an),disabled:sn,color:"primary",size:"sm",className:"me-2",children:[e.jsx(L,{fa:"pencil-square-o"})," Ký số"]}),o&&O&&e.jsxs(E,{onClick:Fn,disabled:a!==V.Da_Ki_So,color:"primary",size:"sm",className:"me-2",children:[e.jsx(L,{fa:"pencil-square-o"})," Hủy ký số"]}),o&&F&&e.jsxs(E,{onClick:Kn,disabled:a!==V.Da_Ki_So,color:"success",size:"sm",className:"me-2",children:[e.jsx(L,{fa:"paper-plane"})," Gửi báo cáo"]}),ne&&ln&&o&&!O&&e.jsxs(E,{onClick:nt,disabled:Me,color:"success",size:"sm",className:"me-2",children:[e.jsx(L,{fa:"check-square-o"})," Chốt số liệu"]}),ne&&ln&&o&&!O&&e.jsxs(E,{onClick:tt,disabled:!Me,color:"danger",size:"sm",className:"me-2",children:[e.jsx(L,{fa:"ban"})," Huỷ chốt số liệu"]}),o&&N&&e.jsxs(E,{onClick:zn,disabled:Me?!0:a!==V.Khoi_Tao&&a!==V.Tu_Choi&&a!==V.Tu_Choi_Trinh_Ky,color:"danger",size:"sm",className:"me-2",children:[e.jsx(L,{fa:"trash"})," Xóa báo cáo"]}),!o&&ae&&_e&&e.jsx(E,{onClick:Pn,disabled:f||a!==V.Cho_Duyet,color:"success",size:"sm",className:"me-2",children:"Tiếp nhận báo cáo đến"}),!o&&a===V.Da_Duyet&&e.jsx(E,{onClick:On,disabled:a!==V.Tu_Choi?!!(on&&a!==V.Cho_Duyet):!0,color:"warning",size:"sm",className:"me-2",children:"Hoàn tác"}),!o&&ae&&_e&&e.jsx(E,{onClick:Gn,disabled:a!==V.Tu_Choi?!!(on&&a!==V.Cho_Duyet):!0,color:"danger",size:"sm",className:"me-2",children:"Từ chối báo cáo đến"}),o&&v&&e.jsxs(E,{disabled:qn,color:"primary",size:"sm",onClick:Un,className:"me-2",children:[" ","Chỉnh sửa"]}),le,Wn,$n,Jn,Ot]}),_&&e.jsxs(E,{color:"danger",size:"sm",onClick:_,children:[e.jsx(L,{fa:"times-circle"}),e.jsx("span",{className:"ml-1",children:"Đóng"})]})]}):e.jsx(e.Fragment,{})}const Ms={68:e.jsx(e.Fragment,{children:"Thịnh"})},vs="/assets/vgca-ac42c61e.png",Ls=te.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 Vs extends me.Component{constructor(t){super(t);X(this,"handleKySoBanCoYeu",()=>{const t=this.props.data.DM_MauBaoCao.Code;ge("KYSO_GIALAP")?t===36||t===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()});X(this,"handleKySoGiaLap",()=>{St(`${Ae}?id=${this.props.data.ID}`).then(t=>t.blob()).then(t=>{const n=new FormData;n.append("ma_tai_khoan",B.MaTaiKhoan),n.append("uploadfile",t),Nt(`${Ee}?id_bao_cao=${this.props.data.ID}`,n).then(o=>{o.Status?G("Ký số thành công !").then(()=>{var h;let l=new oe;l.from_id=B.IDDonVi,l.to_id=B.IDDonVi,l.title=B.TenDonVi,l.body="Ký số "+((h=this.data.DM_BaoCao)==null?void 0:h.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)}):M("Ký số không thành công !")}).catch(o=>console.log(o))}).catch(t=>console.log(t))});X(this,"handleKySoVgca",()=>{let t=this.props.idMauBaoCao?`${Ee}?id_bao_cao=${this.props.IDBaoCao}&mau_html_id=${this.props.idMauBaoCao}&ma_tai_khoan=${B.MaTaiKhoan}`:`${Ee}?id_bao_cao=${this.props.IDBaoCao}&ma_tai_khoan=${B.MaTaiKhoan}`,n=this.props.idMauBaoCao?`${Ae}?id=${this.props.IDBaoCao}&MauBaoCao_HTML_Id=${this.props.idMauBaoCao}`:`${Ae}?id=${this.props.IDBaoCao}`;Cs(JSON.stringify({FileUploadHandler:t,SessionId:"",FileName:n,MetaData:[{Key:"ma_tai_khoan",Value:B.MaTaiKhoan}]}),o=>{try{var l=JSON.parse(o);if(l.Error&&l.Status===404){M(l.Error);return}l&&l.Status===0?G("Ký số thành công !").then(()=>{var u;let h=new oe;h.from_id=B.IDDonVi,h.to_id=B.IDDonVi,h.title=B.TenDonVi,h.body="Ký số "+((u=this.props.data.DM_BaoCao)==null?void 0:u.Name),h.target_id=this.props.data.ID,h.target_module="BaoCao",h.hanh_dong="da_ky_so",this.props.setisChange(!1),this.props.reloadData(),this.props.getDataBaoCao()}):(M("Ký số không thành công !"),this.props.reloadData(),this.props.getDataBaoCao())}catch{M("Ký số không thành công !")}})});this.state={loading:!1,openGhiChu:!1}}render(){const{open:t,close:n}=this.props;return e.jsx(e.Fragment,{children:e.jsx(gn,{title:"Chọn ký số Ban cơ yếu",open:t,handleClose:n,maxWidth:"sm",children:e.jsxs(In,{show:this.state.loading,children:[e.jsx(xe,{style:{marginRight:4,display:"flex",justifyContent:"center"},children:e.jsx(Q,{md:"4",children:e.jsx(Ls,{src:vs,alt:"VIETTELCA",title:"BAN CƠ YẾU",onClick:o=>this.handleKySoVgca()})})}),e.jsx(xe,{children:e.jsx(Q,{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,a)=>{let t=a?null:s==null?void 0:s.TrangThaiDuyet_Tinh;switch(t||((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:[t?"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:[t?"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:[t?"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:t?"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 đã ",t?"đượ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 đã ",t?"đượ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 đã ",t?"được Tỉnh":"được Huyện"," phê duyệt!"]})}),color:s!=null&&s.IsChiDinh||t?"tinh-phe-duyet":"huyen-phe-duyet",title:s!=null&&s.IsChiDinh?"Được chỉ định":`Đã ${t?"đượ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ý"}}},Ue=[{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=>`${pe(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 t,n,o,l,h;const a={...s,TrangThaiBaoCao:(t=s==null?void 0:s.BaoCao)==null?void 0:t.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(a,!0))==null?void 0:n.color}`,children:(o=Y(a,!0))==null?void 0:o.title})}),e.jsx("div",{className:"form-label-trang-thai-duyet",children:!!(a!=null&&a.TrangThaiDuyet_Tinh)&&!(a!=null&&a.IsChiDinh)&&e.jsx(e.Fragment,{children:e.jsx("div",{className:`label-trang-thai-duyet ${(l=Y(a))==null?void 0:l.color}`,children:(h=Y(a))==null?void 0:h.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}],Ft=({data:s,reload:a,disabled:t})=>{const n=()=>ne?"content3":Bn?"content2":"content";return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"form-nop-de-xuat",children:[e.jsx("div",{children:Y(s)[n()]}),!t&&!(s!=null&&s.IsChiDinh)&&e.jsx(Hs,{data:s,reload:a})]})})},Hs=({data:s,reload:a})=>{var l,h,u,m,g;const t=d=>{U("Bạn chắc chắn muốn thực hiện!","Thông báo").then(()=>{y(`BaoCaoDoiTuongHoTro/DoiTrangThai?Id=${s==null?void 0:s.Id}&trangThai=${d}`,"POST",null,{odata:!1}).then(r=>{G("Thành công!"),a()})})},n=d=>{U("Bạn chắc chắn muốn thực hiện!","Thông báo").then(()=>{y(`BaoCaoDoiTuongHoTro/DoiTrangThai?Id=${s==null?void 0:s.Id}&trangThai=${d}`,"POST",null,{odata:!1}).then(r=>{G("Thành công!"),a()})})},o=async d=>{let r=await yt("Vui lòng nhập lý do từ chối","Thông báo","Vui lòng nhập lý do...",!0);r.trim()?y(`BaoCaoDoiTuongHoTro/DoiTrangThai?Id=${s==null?void 0:s.Id}&trangThai=${d}&lyDo=${r}`,"POST",null,{odata:!1}).then(p=>{G("Thành công!"),a()}):M("Vui lòng nhập lý do!")};return e.jsx(e.Fragment,{children:wt?e.jsx(e.Fragment,{children:(!!Y(s).numberChangeStatus||Y(s).numberChangeStatus===0)&&((l=Y(s))==null?void 0:l.isAction)&&e.jsx(E,{className:(h=Y(s))==null?void 0:h.color,onClick:()=>t(Y(s).numberChangeStatus),children:Y(s).btn})}):e.jsxs(e.Fragment,{children:[((u=Y(s))==null?void 0:u.numberAccept)&&((m=Y(s))==null?void 0:m.numberRefuse)&&e.jsxs("div",{className:"d-flex gap-2",children:[e.jsx(E,{onClick:()=>{var d;return n((d=Y(s))==null?void 0:d.numberAccept)},className:"btn-accept",children:"Phê duyệt"}),e.jsx(E,{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(E,{className:(g=Y(s))==null?void 0:g.color,onClick:()=>t(Y(s).numberChangeStatus),children:Y(s).btn})]})})},Es=({dataDefault:s,close:a,reload:t,dataBaoCao:n,disabled:o})=>{var g;const l=i.useRef(),[h,u]=i.useState({}),m=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:a,columns:Ue,getData:d=>u(d),children:[{position:"top",component:e.jsx(e.Fragment,{children:e.jsx(Ft,{data:{...h,TrangThaiBaoCao:(g=s==null?void 0:s.BaoCao)==null?void 0:g.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()),t()}})})}],RenderAttachment:m})})},Fs=({year:s,dataBaoCao:a,reloadTable:t})=>{var _,S,H,b;const[n,o]=i.useState(null),[l,h]=i.useState({}),[u,m]=i.useState({}),[g,d]=i.useState([]),[r,p]=i.useState([]),c=i.useRef();i.useEffect(()=>{y("QuanHuyens?$filter=MaTinhThanh eq '54'&$expand=PhuongXa").then(({value:f})=>{p(f)})},[]),i.useEffect(()=>{y("DM_NoiDungChi").then(f=>d(f==null?void 0:f.value))},[]);const x=f=>{U("Bạn có chắc chắn muốn xóa!","Thông báo").then(()=>{y(`QuanLyDoiTuongHoTroes(${f})`,"DELETE",null).then(k=>{var v,N;G("Xóa thành công!"),(v=c==null?void 0:c.current)!=null&&v.reloadTable&&((N=c==null?void 0:c.current)==null||N.reloadTable())})})},A=f=>{var T,j;let k=f.HNCN_HoGiaDinh.ThonXom.MaPhuongXa;const v=r.find(D=>D.PhuongXa.find(w=>w.MaPhuongXa===k)),N=v.PhuongXa.find(D=>D.MaPhuongXa===k);return`${(j=(T=f==null?void 0:f.HNCN_HoGiaDinh)==null?void 0:T.ThonXom)==null?void 0:j.Ten}, ${N==null?void 0:N.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(An,{ref:c,where:`(DonVi_Id eq '${(_=a==null?void 0:a.SYS_DonVi1)==null?void 0:_.ID}' and IsChiDinh eq true and Nam eq ${s}) or (BaoCao_Id eq '${a==null?void 0:a.ID}' and Nam eq ${s})`,url:"QuanLyDoiTuongHoTroes",isEdit:!1,isDelete:!1,isAdd:a.TrangThai<1,addValue:{Nam:s,DonVi_Id:`${(S=B)==null?void 0:S.IDDonVi}`,BaoCao_Id:a==null?void 0:a.ID,TrangThaiDuyet:0},defaultValue:{SoTien:g!=null&&g.length?(H=g==null?void 0:g.find(({Id:f})=>f===(u==null?void 0:u.NoiDungChi_Id)))==null?void 0:H.SoTien:0},getData:f=>m(f),onRowClick:f=>{h(f)},columns:[{title:"Địa chỉ",table:!0,field:"HNCN_HoGiaDinh/ThonXom.Ten",render:f=>A(f)},...Ue,{title:"Thao tác",field:"Id",table:!0,render:f=>e.jsx(e.Fragment,{children:a.TrangThai===0&&!(f!=null&&f.IsChiDinh)&&((f==null?void 0:f.TrangThaiDuyet)===0||(f==null?void 0:f.TrangThaiDuyet)===2)&&e.jsxs("div",{onClick:k=>k.stopPropagation(),className:"d-flex justify-content-center",children:[e.jsx(E,{onClick:()=>o(f==null?void 0:f.Id),className:"icon icon-edit"}),e.jsx(E,{onClick:()=>x(f==null?void 0:f.Id),className:"icon icon-del"})]})})}]})}),e.jsx(Es,{dataDefault:l,dataBaoCao:a,close:()=>h({}),reload:()=>{var f,k;(f=c==null?void 0:c.current)!=null&&f.reloadTable&&((k=c==null?void 0:c.current)==null||k.reloadTable()),t()},disabled:Bn&&((a==null?void 0:a.TrangThai)===4||(a==null?void 0:a.TrangThai)===3)}),n&&e.jsx(ja,{columns:Ue,open:n,close:()=>o(null),Id:n,defaultValue:{SoTien:g!=null&&g.length?(b=g==null?void 0:g.find(({Id:f})=>f===(u==null?void 0:u.NoiDungChi_Id)))==null?void 0:b.SoTien:0},getData:f=>m(f),url:"QuanLyDoiTuongHoTroes",afterSaving:()=>{var f,k;(f=c==null?void 0:c.current)!=null&&f.reloadTable&&((k=c==null?void 0:c.current)==null||k.reloadTable())}})]})},Ks=({data:s,year:a,reloadTable:t,isDataSynthesis:n})=>{const[o,l]=i.useState({NamKeHoach:a,DMQuy_Id:0,DauKi:"",KeHoach:"",ThucHien:"",CuoiKy:"",Id:-1,Id_Row:void 0,IsNhapDauKy:!1}),h=c=>new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(c),u=()=>{l(c=>({...c,Id:-1,Id_Row:-1,IsNhapDauKy:!1}))},m=(c,x,A,_,S)=>{const H={NamKeHoach:a,DMQuy_Id:c.DMQuy_Id,DauKi:String(c.DauKi).replace(/\D/g,""),KeHoach:String(c.KeHoach).replace(/\D/g,""),ThucHien:"0",CuoiKy:"0",NoiDungChi_Id:c.Id},b={KeHoach:String(c.KeHoach).replace(/\D/g,""),DauKi:String(c.DauKi).replace(/\D/g,"")},f=_-x+Number(b.KeHoach)>S+(A===Number(b.DauKi)?0:Number(b.DauKi)<A?-A-Number(b.DauKi):Number(b.DauKi));U(`Cập nhật kế hoạch giải ngân năm ${a}`,"Cập nhật").then(k=>{if(k&&k.isConfirmed){if(!f){y(`QuanLyNganSachQuys${c.Id_Row&&c.Id_Row!==-1?`(${c.Id_Row})`:""}`,`${c.Id_Row&&c.Id_Row!==-1?"PATCH":"POST"}`,JSON.stringify(c.Id_Row&&c.Id_Row!==-1?b:H),{odata:!0}).then(()=>{G("Cập nhật dữ liệu thành công").then(()=>{t(),u()})}).catch(v=>M(v,"Cập nhật dữ liệu lỗi!!"));return}Z("Đã vượt quá ngân sách!!")}})},g=c=>{const x=c.replace(/\D/g,"");return new Intl.NumberFormat("vi-VN").format(x)},d=(c,x)=>{const A=c.target.value,_=g(A);l(S=>({...S,[x]:_}))},r=c=>{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(x=>{if(x&&x.isConfirmed){l(c);return}})},p=c=>c.map((x,A)=>{var _;return e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{style:{textAlign:"center",color:"#4872b5",fontWeight:"bold"},children:Sn(A+1)}),e.jsx("td",{style:{color:"#4872b5",fontWeight:"bold",fontSize:15},children:x.Name}),["DauKi","KeHoach","ThucHien","CuoiKy"].map(S=>e.jsx("td",{children:e.jsx("table",{style:ve.columnChild,children:e.jsx("tr",{children:S==="KeHoach"?e.jsxs("td",{children:[e.jsx("div",{style:{whiteSpace:"pre-wrap",fontWeight:"bold"},children:h(x[S])}),e.jsxs("div",{style:{whiteSpace:"pre-wrap"},children:["(Tối đa ",h(x.SoTienToiDa),")"]})]}):e.jsx("td",{style:{fontWeight:"bold"},children:h(x[S])})})})},S)),!n&&e.jsx("td",{style:{textAlign:"center"},children:"-"})]},A),(_=x.Children)==null?void 0:_.map((S,H)=>e.jsxs("tr",{children:[e.jsx("td",{style:{textAlign:"center",fontSize:14},children:It(H)}),e.jsx("td",{style:{fontSize:13},children:S.Name}),["DauKi","KeHoach","ThucHien","CuoiKy"].map(b=>e.jsx("td",{children:e.jsx("table",{style:ve.columnChild,children:e.jsx("tr",{children:e.jsx("td",{children:S.Id!==o.Id||b!=="KeHoach"&&(b!=="DauKi"||!S.IsNhapDauKy)?h(S[b])??"-":e.jsx(Mt,{type:"text",pattern:"\\d*",value:g(String(o[b])),onChange:f=>d(f,b),style:{textAlign:"center",height:35,marginTop:0}})})})})},b)),!n&&e.jsx("td",{children:e.jsx("table",{style:ve.columnChild,children:e.jsx("tr",{children:e.jsxs("td",{children:[e.jsx(Fe,{onClick:()=>{x.Children.reduce((f,k)=>f+(k.DauKi||0),0);const b=x.Children.reduce((f,k)=>f+(k.KeHoach||0),0);S.Id!==o.Id?o.Id===-1?l({...o,...S,DMQuy_Id:x.Id}):r(S):m(o,S.KeHoach,S.DauKi,b,x.SoTienToiDa)},style:{border:0},icon:S.Id===o.Id?"save":"edit",color:"primary"}),S.Id===o.Id&&e.jsx(Fe,{onClick:()=>u(),style:{border:0},icon:"close",color:"primary"})]})})})})]},H))]})});return e.jsx("td",{children:e.jsxs(fe,{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((c,x)=>e.jsx("th",{style:{...ve.th,...Object.values(ve.columnWidths)[x]},children:c}))})}),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 Ps=({data:s,year:a,reloadTable:t,BaoCaoDi:n,isDataSynthesis:o})=>{i.useState({NamKeHoach:a,DMQuy_Id:0,DauKi:"",KeHoach:"",ThucHien:"",CuoiKy:"",Id:-1,Id_Row:void 0,IsNhapDauKy:!1});const[l,h]=i.useState({}),[u,m]=i.useState({}),[g,d]=i.useState({}),[r,p]=i.useState({}),c=N=>new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(N),x=N=>{U(`Cập nhật trạng thái giải ngân cho ${N.TenChuHo}`,"Cập nhật").then(T=>{T&&T.isConfirmed&&y(`BaoCaoGiaiNgan/DoiTrangThaiGiaiNgan?Id=${N.Id_Row}&TrangThai=${N.TrangThai===1?0:1}`,"POST",null,{odata:!1}).then(()=>{G("Cập nhật dữ liệu thành công").then(()=>{t()})}).catch(j=>M(j,"Cập nhật dữ liệu lỗi!!"))})},A=N=>{U("Cập nhật trạng thái giải ngân cho đơn vị","Cập nhật").then(T=>{T&&T.isConfirmed&&y(`BaoCaoGiaiNgan/DoiTrangThaiGiaiNganAll?IdDV=${N.IdDV}&TrangThai=${N.TrangThai===1?0:1}`,"POST",null,{odata:!1}).then(()=>{G("Cập nhật dữ liệu thành công").then(()=>{t()})}).catch(j=>M(j,"Cập nhật dữ liệu lỗi!!"))})},_=N=>{h(T=>({...T,[N]:!T[N]}))},S=(N,T)=>{m(j=>{var D;return{...j,[N]:{...j[N],[T]:!((D=j[N])!=null&&D[T])}}})},H=N=>{d(T=>({...T,[N]:!0}))},b=N=>{d(T=>({...T,[N]:!1}))},f=N=>{p({...N,TrangThaiBaoCao:1})},k=(N,T,j)=>N&&N.Details.map((D,w)=>{var O;return e.jsxs("tr",{onClick:D!=null&&D.Id?()=>{f(D)}:null,style:{cursor:"pointer"},className:`fade-${(O=u[T])!=null&&O[w]?"enter":"exit"}`,children:[e.jsx("td",{style:{textAlign:"center",color:"#4872b5",fontSize:14},children:j?It(w):w+1}),e.jsx("td",{style:{fontSize:15,textAlign:"center"},children:D.TenThon}),e.jsx("td",{style:J.texttd,children:D.MaHo}),e.jsx("td",{style:J.texttd,children:D.CCCD}),e.jsx("td",{style:J.texttd,children:D.TenChuHo}),e.jsx("td",{style:J.texttd,children:D.DiaChi??"Chưa cập nhật"}),e.jsx("td",{style:J.texttd,children:D.NoiDungChi}),e.jsx("td",{style:J.texttd,children:c(D.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:J.texttd,children:D.GhiChu}),e.jsx("td",{style:{textAlign:"center"},onClick:F=>{if(F.stopPropagation(),o){Z("Báo cáo đã được chốt dữ liệu!!");return}n&&ne&&x(D)},children:e.jsxs(E,{disabled:!1,color:D.TrangThai===1?"success":"warning",size:"sm",className:"me-2",children:[e.jsx(L,{fa:""})," ",D.TrangThai===1?"Đã giải ngân":"Chưa giải ngân"]})})]},w)}),v=N=>N.map((T,j)=>e.jsxs(me.Fragment,{children:[e.jsxs("tr",{onClick:()=>{_(j)},onMouseEnter:()=>H(j),onMouseLeave:()=>b(j),style:{color:g[j]?"#3f51b5":"black",cursor:"pointer"},children:[e.jsx("td",{style:{textAlign:"center",color:"#4872b5",fontWeight:"bold"},children:Sn(j+1)}),e.jsx("td",{style:{alignItems:"center",textAlign:"center",fontSize:15,fontWeight:"bold",cursor:"pointer"},children:e.jsx("span",{children:T.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:c(T.TongTien)}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:100,fontWeight:"bold"},children:c(T.SoTienChuaGiaiNgan)}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:100,fontWeight:"bold"},children:c(T.SoTienDaGiaiNgan)}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:200},children:"-"}),e.jsx("td",{style:{textAlign:"center"},children:n&&ne?e.jsx(E,{onClick:D=>{if(D.stopPropagation(),o){Z("Báo cáo đã được chốt dữ liệu!!");return}A(T)},disabled:!1,color:T.TrangThai===0?"primary":"danger",size:"sm",className:"me-2",children:T.TrangThai===0?"Giải ngân đơn vị":"Huỷ giải ngân đơn vị"}):"-"})]}),l[j]&&e.jsxs(me.Fragment,{children:[(!n||!ne)&&k(T,j,!1),ne&&n&&T&&T.Details.map((D,w)=>{var O;return e.jsxs(me.Fragment,{children:[e.jsxs("tr",{onClick:()=>S(j,w),onMouseEnter:()=>H(`${j}-${w}`),onMouseLeave:()=>b(`${j}-${w}`),style:{color:g[`${j}-${w}`]?"#3f51b5":"black",cursor:"pointer"},children:[e.jsx("td",{style:{textAlign:"center",color:"#4872b5",fontSize:14},children:w+1}),e.jsx("td",{style:{alignItems:"center",fontWeight:"550",textAlign:"center",fontSize:15,cursor:"pointer",color:g[`${j}-${w}`]?"#3f51b5":"black"},children:D.Name}),e.jsx("td",{style:J.texttd,children:"-"}),e.jsx("td",{style:J.texttd,children:"-"}),e.jsx("td",{style:J.texttd,children:"-"}),e.jsx("td",{style:J.texttd,children:"-"}),e.jsx("td",{style:J.texttd,children:"-"}),e.jsx("td",{style:{textAlign:"center",fontSize:15,fontWeight:"bold"},children:c(D.TongTien)}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:100,fontWeight:"bold"},children:c(D.SoTienChuaGiaiNgan)}),e.jsx("td",{style:{textAlign:"center",fontSize:15,width:100,fontWeight:"bold"},children:c(D.SoTienDaGiaiNgan)}),e.jsx("td",{style:J.texttd,children:"-"}),e.jsx("td",{style:{textAlign:"center"},children:"-"})]}),((O=u[j])==null?void 0:O[w])&&k(D,`${j}-${w}`,!0)]},`${j}-${w}`)})]})]},j));return e.jsxs(e.Fragment,{children:[e.jsx("td",{children:e.jsxs(fe,{bordered:!0,children:[e.jsx("thead",{style:J.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(N=>e.jsx("th",{style:J.th,children:N},N))})}),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:Ue,children:[]})]})},J={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}},Os=({data:s,reloadTable:a,BaoCaoDi:t,dataBaoCao:n})=>{const o=r=>new Intl.NumberFormat("vi-VN",{style:"currency",currency:"VND"}).format(r),l=r=>(r+9).toString(36).toUpperCase(),[h,u]=i.useState({}),m=r=>{u({...r,TrangThaiBaoCao:1})},g=i.useMemo(()=>e.jsx(pn,{target_id:n.Id,target_module:n.LinhVuc_Id,isChange:()=>{},IsAttachment:!0,isHoGiaDinh:h&&h.Id_Row}),[n,h]),d=(r,p=0)=>r.map((c,x)=>{var _,S;let A={...c,TrangThaiBaoCao:n==null?void 0:n.TrangThai,TrangThaiDuyet_Tinh:c==null?void 0:c.TrangThai};return e.jsxs(e.Fragment,{children:[e.jsxs("tr",{onClick:c!=null&&c.Id?()=>{m(A)}: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(x+1):p===1?x+1:l(x+1)}),e.jsx("td",{style:{fontSize:15,fontWeight:p===0?"bold":p===1?500:400,color:p===0?"#4872b5":"black"},children:c.Name??c.DiaChi}),e.jsx("td",{style:{fontSize:15},children:c.MaHo??"-"}),e.jsx("td",{style:{fontSize:15},children:c.TenChuHo??"-"}),e.jsx("td",{style:{fontSize:15},children:c.CCCD??"-"}),e.jsx("td",{style:{fontSize:15},children:c.NoiDungChi??"-"}),e.jsx("td",{style:{fontSize:15,fontWeight:"bold"},children:c!=null&&c.TongTien?o(c==null?void 0:c.TongTien):o(c==null?void 0:c.SoTien)}),e.jsx("td",{style:{fontSize:15},children:c.GhiChu??"-"}),(!t||!ne)&&e.jsx("td",{style:{fontSize:15},children:((c==null?void 0:c.TrangThai)||(c==null?void 0:c.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 ${(_=Y(A))==null?void 0:_.color}`,children:(S=Y(A))==null?void 0:S.title})})})})})]},x),(c==null?void 0:c.Details)&&d(c==null?void 0:c.Details,p+1)]})});return e.jsxs(e.Fragment,{children:[e.jsx("td",{children:e.jsxs(fe,{bordered:!0,children:[e.jsx("thead",{style:ft.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ú",...!t||!ne?["Trạng thái"]:[]].map(r=>e.jsx("th",{style:ft.th,children:r}))})}),e.jsx("tbody",{children:d(s)})]})}),(h==null?void 0:h.Id_Row)&&e.jsx(_n,{url:"QuanLyDoiTuongHoTroes",Id:h==null?void 0:h.Id_Row,open:h&&h.Id_Row,close:()=>u(null),columns:Ue,children:[{position:"top",hidden:!!t||!ne&&(h==null?void 0:h.TrangThai)!==2,component:e.jsx(e.Fragment,{children:e.jsx(Ft,{data:{...h,Id:h==null?void 0:h.Id_Row},disabled:(n==null?void 0:n.TrangThai)===4||(n==null?void 0:n.TrangThai)===3,reload:()=>{a&&a(),u(null)}})})}],RenderAttachment:g})]})},ft={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"}},Gs=[{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=>`${pe(s==null?void 0:s.SoTien)||0} VNĐ`},{title:"Số tiền chỉ định",field:"SoTienChiDinh",table:!0,render:s=>`${pe(s==null?void 0:s.SoTienChiDinh)||0} VNĐ`},{title:"Số tiền còn lại",field:"SoTienConLai",table:!0,render:s=>`${pe(s==null?void 0:s.SoTienConLai)||0} VNĐ`}],zs=[{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=>`${sa(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=>`${pe(s==null?void 0:s.SoTien)} VNĐ`}],Rs=({Id:s,year:a,dataDN:t,reload:n})=>{var c;const[o,l]=i.useState({}),[h,u]=i.useState([]),[m,g]=i.useState(),d=i.useRef();i.useEffect(()=>{y("DM_NoiDungChi").then(x=>u(x==null?void 0:x.value))},[]),i.useEffect(()=>{o!=null&&o.DoiTuongDeXuat_Id&&y(`HNCN_HoGiaDinh(${o==null?void 0:o.DoiTuongDeXuat_Id})?$expand=ThonXom`,"GET",null,{isLoading:!1}).then(x=>{var A;y(`DonVis?$filter=MaPhuongXa eq '${(A=x==null?void 0:x.ThonXom)==null?void 0:A.MaPhuongXa}'`,"GET",null,{isLoading:!1}).then(({value:_})=>{var S;g((S=_[0])==null?void 0:S.ID)})})},[o==null?void 0:o.DoiTuongDeXuat_Id]);const r=x=>{var A,_;m&&y("QuanLyDoiTuongHoTroes","POST",JSON.stringify({HoGiaDinh_Id:x==null?void 0:x.DoiTuongDeXuat_Id,NoiDungChi_Id:x==null?void 0:x.NoiDungChi_Id,SoTien:x==null?void 0:x.SoTien,GhiChu:`${(A=t==null?void 0:t.DM_DoanhNghiep)==null?void 0:A.Ten} đã ủng hộ ${pe(x==null?void 0:x.SoTien)} VNĐ từ ${(_=t==null?void 0:t.DM_DanhMucQuy)==null?void 0:_.Name}`,Nam:a,DonVi_Id:m,TrangThaiDuyet:1,TrangThaiDuyet_Tinh:1,IsChiDinh:!0}))},p=x=>{U("Bạn có chắc chắn muốn xóa!","Thông báo").then(()=>{y(`BaoCaoTienUngHoDN/XoaDuLieu?Nam=${a}&doiTuongDX_Id=${x}`,"DELETE",null,{odata:!1}).then(A=>{var _,S;G("Xóa thành công!"),(_=d==null?void 0:d.current)!=null&&_.reloadTable&&((S=d==null?void 0:d.current)==null||S.reloadTable()),n()})})};return e.jsx(e.Fragment,{children:e.jsx(An,{ref:d,where:`QL_TienUngHoDN_Id eq ${s}`,columns:zs,url:"DoanhNghiep_DTDeXuat",addValue:{QL_TienUngHoDN_Id:s},defaultValue:{SoTien:h!=null&&h.length?(c=h==null?void 0:h.find(({Id:x})=>x===(o==null?void 0:o.NoiDungChi_Id)))==null?void 0:c.SoTien:0},afterSaving:(x,A)=>{A&&r(x),n()},getData:x=>l(x),onDelete:x=>p(x==null?void 0:x.DoiTuongDeXuat_Id)})})};const Ys=({year:s})=>{const[a,t]=i.useState(null),[n,o]=i.useState(null),[l,h]=i.useState({TongTien:0,TongTienChiDinh:0,TongTienConLai:0}),u=i.useRef();return i.useEffect(()=>{s&&y(`BaoCaoTienUngHoDN/GetTongTien?Nam=${s}`,"GET",null,{odata:!1}).then(m=>{h(m)})},[s]),e.jsx(e.Fragment,{children:e.jsxs("div",{className:"bg-white p-3 rounded",children:[e.jsx(An,{ref:u,where:`Nam eq ${s}`,columns:Gs,url:"QL_TienUngHoDN",addValue:{Nam:s},openDetailSave:!0,getData:m=>o(m),getId:(m,g)=>{t(m&&g?m:null)},childrenModal:a&&[{title:"Đối tượng đề xuất của doanh nghiệp",component:e.jsx(e.Fragment,{children:e.jsx(Rs,{Id:a,year:s,dataDN:n,reload:()=>{var m,g;(m=u==null?void 0:u.current)!=null&&m.reloadTable&&((g=u==null?void 0:u.current)==null||g.reloadTable())}})})}]}),e.jsx(Xs,{data:l})]})})},Xs=({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:pe(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:pe(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:pe(s==null?void 0:s.TongTien)})]}),e.jsx("h6",{children:"VNĐ"})]})]})})}),qs=({code:s,data:a,year:t,reloadTable:n,dataBaoCao:o,isDataSynthesis:l,BaoCaoDi:h})=>{const u=()=>{switch(s){case"BaoCaoThucHienGiaiNgan":return e.jsx(e.Fragment,{children:e.jsx(Ks,{data:a,year:t,reloadTable:n,isDataSynthesis:l})});case"BaoCaoGiaiNgan":return e.jsx(e.Fragment,{children:e.jsx(Ps,{data:a,year:t,reloadTable:n,BaoCaoDi:h,dataBaoCao:o,isDataSynthesis:l})});case"BaoCaoDoiTuongHoTro":return e.jsx(e.Fragment,{children:e.jsx(Os,{data:a,year:t,reloadTable:n,BaoCaoDi:h,dataBaoCao:o})});case"BaoCaoTienUngHoDN":return e.jsx(e.Fragment,{children:e.jsx(Ys,{year:t})});case"DeXuat":return e.jsx(e.Fragment,{children:e.jsx(Fs,{dataBaoCao:o,year:t,reloadTable:n})})}};return e.jsx(e.Fragment,{children:u()})},Us=i.forwardRef((s,a)=>{var r,p,c,x,A,_;const{data:t,reloadAll:n,isDataSynthesis:o,BaoCaoDi:l}=s,[h,u]=i.useState([]),m=((r=t==null?void 0:t.DM_MauBaoCao)==null?void 0:r.TieuDeCon)==="BaoCaoThucHienGiaiNgan"||((p=t==null?void 0:t.DM_MauBaoCao)==null?void 0:p.TieuDeCon)==="BaoCaoDoiTuongHoTro"?"GetBaoCao":`GetBaoCaoGiaiNgan${ne?l?"Tinh":"Huyen":l&&Bn?"Huyen":"Xa"}`,g=`${(c=t==null?void 0:t.DM_MauBaoCao)==null?void 0:c.TieuDeCon}/${m}`,d=i.useCallback(()=>{var S;((S=t==null?void 0:t.DM_MauBaoCao)==null?void 0:S.GhiChu)!=="notapi"&&y(`${g}?BaoCao_Id=${t.ID}`,"GET",null,{odata:!1}).then(H=>{u(H)}).catch(H=>{M(H.Message||H)})},[g,(x=t==null?void 0:t.DM_MauBaoCao)==null?void 0:x.GhiChu,t.ID]);return i.useEffect(()=>{d()},[d]),i.useImperativeHandle(a,()=>({reloadData(){d()}})),e.jsx(e.Fragment,{children:t.ID&&e.jsxs(He,{paddingY:8,container:!0,children:[e.jsx(He,{container:!0,lg:12,md:12,paddingX:4}),e.jsxs(He,{justifyContent:"center",container:!0,lg:12,md:12,paddingX:4,children:[e.jsxs("p",{style:{fontWeight:"bold",fontSize:16},children:[(A=t==null?void 0:t.DM_MauBaoCao)==null?void 0:A.TieuDe," năm ",t==null?void 0:t.NamBanHanh]}),e.jsx(fe,{className:"table-bao-cao",bordered:!0,children:e.jsx(qs,{year:t==null?void 0:t.NamBanHanh,code:(_=t==null?void 0:t.DM_MauBaoCao)==null?void 0:_.TieuDeCon,data:h,reloadTable:()=>{n&&n(),d()},dataBaoCao:t,isDataSynthesis:o,BaoCaoDi:l})})]})]})})});function Kt(s){var tn,Cn;const{ID:a,onClose:t,open:n,BaoCaoDi:o,reloadData:l,seeDetailFromNotify:h,nam:u,selectedFolder:m,nameTanSuat:g,NhomDoiTuong:d}=s,[r,p]=i.useState(null),[c,x]=i.useState(!1),[A,_]=i.useState(!1),[S,H]=i.useState(!1),[b,f]=i.useState(null),[k,v]=i.useState(!1),[N,T]=i.useState(""),[j,D]=i.useState(null),[w,O]=i.useState("100%"),[F,q]=i.useState(!1),[ae,we]=i.useState(!1),Ce=i.useRef(),[De,en]=i.useState(!1),je=un(),nn=()=>{let K=je.pathname;(K==="/de-xuat"||K==="/phe-duyet")&&y(`BaoCaoExt/CheckPheDuyet?BaoCao_Id=${a==null?void 0:a.ID}`,"GET",null,{odata:!1,isLoading:!1}).then($=>{en($===!0)})},Ne=()=>{je.pathname==="/de-xuat"&&a!=null&&a.ID&&y(`BaoCaoDoiTuongHoTro/CapNhatDTChiDinh?BaoCao_Id=${a==null?void 0:a.ID}`,"GET",null,{odata:!1,isLoading:!1})};i.useEffect(()=>{a&&(ce(),nn(),Ne())},[a]),i.useEffect(()=>{r&&Ie()},[r]);const ce=()=>{y(`BaoCaos?$expand=DM_Quy,DM_PhongBan,DM_BaoCao,SYS_DonVi1,SYS_DonVi,DM_TanSuat,DM_MauBaoCao,BaoCao2&$filter=ID eq '${a.ID}'`,"GET",null).then(K=>{h||fn(K.value[0]).then($=>Pe($==null?void 0:$.Id,!0)),p(K.value[0])}).catch(K=>M("Không thể tải dữ liệu báo cáo!","Thông báo"))},Ie=()=>{y(`DM_MauBaoCao(guid'${r.MauBaoCao_Id}')?$select=Code`,"GET",null).then(K=>D(K.Code))},fn=K=>new Promise(($,Be)=>{let le="";switch(K.TrangThai){case V.Cho_Duyet:le="gui";break;case V.Tu_Choi:le="tu_choi";break;case V.Da_Duyet:le="da_duyet";break}le&&y(`SYS_ThongBao?$filter=Target_Id eq '${K.ID}' and HanhDong eq '${le}'`,"GET",null).then(be=>$(be.value[0])).catch(be=>M("Không thể tải dữ liệu thông báo!","Thông báo").reject(be))}),he=i.useCallback(()=>{y(`BaoCaos('${r&&r.ID}')?$expand=HNCN_TrangThaiDuLieu`,"GET",null,{odata:!0}).then(K=>{var $;we(($=K.HNCN_TrangThaiDuLieu[0])==null?void 0:$.DaChotDuLieu)}).catch(K=>{console.log(K)})},[r]);i.useEffect(()=>{r&&he()},[r,he]);const Pe=(K,$)=>{K&&y(`SYS_ThongBao(guid'${K}')`,"PATCH",JSON.stringify({DaXemThongBao:$})).then(Be=>{}).catch(Be=>M("Không thể cập nhật trạng thái đã xem của báo cáo","Thông báo"))},Oe=K=>{T(K),v(!0)},ke=K=>{T(`${Ae}?id=${K.ID}`),v(!0)},ie=K=>{K.Status?G("Ký số thành công !").then(()=>{T(`${Ke}${K.FileServer}`),l(),ce(),x(!0)}):M("Ký số không thành công !")},de=()=>{Ce.current&&Ce.current.reloadData()};i.useCallback(()=>{var K,$,Be,le,be;if((K=r.DM_MauBaoCao)!=null&&K.IsBaoCaoDeCuong)return e.jsxs(ut,{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((($=r.DM_MauBaoCao)==null?void 0:$.DangBaoTri)==!0&&(r.TrangThai==0||r.TrangThai==3||r.TrangThai==8))return e.jsxs(ut,{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 an=Ms[j];return e.jsx(an,{code:j,BaoCao_Id:{...a,Data_StartDate:r.Data_StartDate,Data_EndDate:r.Data_EndDate,TrangThai:r.TrangThai,DonViBaoCao:(Be=r==null?void 0:r.SYS_DonVi1)==null?void 0:Be.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:Ge=>O(Ge+35),isChange:F,codeTanSuat:(be=r.DM_TanSuat)==null?void 0:be.Code,nameTanSuat:g,DuLieuKyTruoc:r.DuLieuKyTruoc,getDataBaoCao:ce,setisChange:q,NamLamBaoCao:u,selectedFolder:m,NhomDoiTuong:d})}},[j,r]);const En=i.useCallback(()=>{F?U("Bạn chưa lưu dữ liệu, bạn chắc chắn muốn thoát?").then(()=>t()):t()},[F,t]);return e.jsxs(Ws,{className:"dialog-detail-bao-cao",title:"THÔNG TIN BÁO CÁO",open:n,onClose:()=>{F?U("Bạn chưa lưu dữ liệu, bạn chắc chắn muốn thoát?").then(()=>t()):t()},renderButton:e.jsx(pt,{reportCode:j,data:r||{},BaoCaoDi:o,setIsActiveLog:x,getDataBaoCao:ce,reloadData:l,onClose:t,handleShowPDF:ke,handleShowPDFSLT:Oe,setOpenKySoDoanhNghiep:_,setOpenKySoSoBanNganh:H,isChange:F,setisChange:q,setIdMauBaoCao:f,idMauBaoCao:b,isDataSynthesis:ae,handleCheckDataSynthesis:he,handleReloadDetailChiTiet:de,disabledTiepNhan:De}),children:[e.jsx(i.Suspense,{fallback:os(),children:r&&e.jsx("div",{className:"csdlg-detail",children:e.jsx(ca,{renderButton:e.jsx(pt,{reportCode:j,data:r||{},BaoCaoDi:o,setIsActiveLog:x,getDataBaoCao:ce,reloadData:l,onClose:t,handleShowPDF:ke,handleShowPDFSLT:Oe,setOpenKySoDoanhNghiep:_,setOpenKySoSoBanNganh:H,isChange:F,setisChange:q,handleClose:En,setIdMauBaoCao:f,idMauBaoCao:b,isDataSynthesis:ae,handleCheckDataSynthesis:he,handleReloadDetailChiTiet:de,disabledTiepNhan:De}),isTabNew:!0,codeBaoCao:m==null?void 0:m.Code,setStyle:{activeTab:1,style:{width:w}},setClassName:{activeTab:1,className:"overflowTabBasic"},data:[{TabName:"Thông tin báo cáo",TabContent:e.jsx(ps,{data:r,isActiveLog:c,reloadAll:()=>{l(),ce()}}),middleware:F?()=>U("Bạn chưa lưu dữ liệu, bạn chắc chắn muốn thoát?").then(()=>q(!1)):null},{TabName:"Chi tiết báo cáo",TabContent:e.jsx(Us,{data:r,isActiveLog:c,reloadAll:()=>{l(),ce(),nn()},isDataSynthesis:ae,ref:Ce,BaoCaoDi:o}),middleware:F?()=>U("Bạn chưa lưu dữ liệu, bạn chắc chắn muốn thoát?").then(()=>q(!1)):null}]})})}),A&&e.jsx(us,{close:()=>_(!1),IDBaoCao:r.ID,TenBaoCao:(tn=r.DM_BaoCao)==null?void 0:tn.Name,UploadServer:`${Ee}?id_bao_cao=${r.ID}`,FileName:`${Ae}?id=${r.ID}`,open:A,handleSuccess:ie,setisChange:q}),S&&e.jsx(Vs,{data:r||{},close:()=>H(!1),IDBaoCao:r.ID,TenBaoCao:(Cn=r.DM_BaoCao)==null?void 0:Cn.Name,UploadServer:`${Ee}?id_bao_cao=${r.ID}`,FileName:`${Ae}?id=${r.ID}`,open:S,handleSuccess:ie,setisChange:q,reloadData:l,getDataBaoCao:ce,setIsActiveLog:x,idMauBaoCao:b}),k&&N&&e.jsx(At,{open:k,onClose:()=>v(!1),filePDF:N})]})}const Ws=te(ga)` &.dialog-detail-bao-cao { .MuiDialogContent-root { overflow: auto !important; } } `,{Xem:Ct,TrinhKy:Dt}=Lt();function $s({data:s,nam:a,onReloadAll:t}){const{LinhVuc_Id:n,selectedFolder:o}=vn(),[l,h]=i.useState(null),[u,m]=i.useState(null),[g,d]=i.useState(!1),[r,p]=i.useState({}),{pathname:c}=un();i.useEffect(()=>{H()},[]);const x=i.useCallback(T=>new Promise((j,D)=>{o.Code!==10?j(!0):S(T).then(w=>{w===18||w===68?B.SetUpTuChu?j(!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(()=>D(!1)):j(!0)})}),[o.Code]),A=(T,j)=>{y(`BaoCaoDoiTuongHoTro/CheckTaoBaoCao?Nam=${a}`,"GET",null,{odata:!1}).then(D=>{(D==null?void 0:D.result)===!0?_(T,j):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!")})},_=i.useCallback((T,j)=>{if(s&&s[0].TenMauBaoCao==="Mẫu giải ngân"){y(`BaoCaoGiaiNgan/CheckTaoBaoGiaiNgan?Nam=${a}`,"GET",null,{odata:!1}).then(D=>{if(D){x(T).then(()=>{T.DonVi_Nhan_Id?y("Reports/Create","POST",JSON.stringify({TanSuat_Id:T.TanSuat_Id,LinhVuc_Id:n,MauBaoCao_Id:j.MauBaoCao_Id,BaoCao_Id:o.Id,NgayDenHanGui:T.TGDenHanGui,Year:a,IsNamSau:T.IsNamSau,IsTrinhKy:!!(Ct&&Dt),LanSo:T.LanSo,DonVi_Nhan_Id:T.DonVi_Nhan_Id}),{odata:!1}).then(w=>{t(),G("Tạo báo cáo thành công!")}).catch(w=>M(w!=null&&w.ExceptionMessage?w.ExceptionMessage:w.Message?w.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}x(T).then(()=>{T.DonVi_Nhan_Id?y("Reports/Create","POST",JSON.stringify({TanSuat_Id:T.TanSuat_Id,LinhVuc_Id:n,MauBaoCao_Id:j.MauBaoCao_Id,BaoCao_Id:o.Id,NgayDenHanGui:T.TGDenHanGui,Year:a,IsNamSau:T.IsNamSau,IsTrinhKy:!!(Ct&&Dt),LanSo:T.LanSo,DonVi_Nhan_Id:T.DonVi_Nhan_Id}),{odata:!1}).then(D=>{t(),G("Tạo báo cáo thành công!")}).catch(D=>M(D!=null&&D.ExceptionMessage?D.ExceptionMessage:D.Message?D.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,x,a,t,o,s]),S=T=>new Promise((j,D)=>{y(`DM_MauBaoCao(guid'${T.MauBaoCao_Id}')?$select=Code`).then(w=>j(w.Code)).catch(()=>j(!1))});i.useEffect(()=>{d(!!l)},[l]);const H=()=>{y(`DonVis('${B.IDDonVi}')`).then(T=>p(T)).catch(()=>M("Không thể lấy dữ liệu của đơn vị","Thông báo"))},b=i.useCallback((T,j)=>e.jsxs("span",{className:"d-flex align-items-center",children:[j.DonVi_Nhan_Id!==T.DonVi_Nhan_Id&&e.jsxs("span",{className:"d-block",style:{marginTop:2,color:"red"},children:[e.jsx(L,{fa:"exclamation-triangle"})," "]}),e.jsx(E,{onClick:()=>{h({ID:T.Id}),m({nameTanSuat:j==null?void 0:j.TenTanSuat,tenChuSoHuu:j==null?void 0:j.TenDonViNhan})},className:"btn-mau-bao-cao",children:T.MaBaoCao}),e.jsx(Nn,{style:{display:"block"},status:T.TrangThaiOfBaoBao})]}),[]),f=i.useCallback((T,j)=>e.jsxs(E,{className:"btn-tao-bao-cao",onClick:()=>{c==="/de-xuat"?A(T,j):_(T,j)},children:[e.jsx(L,{fa:"trello"})," Tạo Báo Cáo"]}),[_]),k=i.useCallback((T,j)=>{let D=T?T.length:0;if(D>1)return T.map((w,O)=>e.jsx(me.Fragment,{children:b(w,j)},O));if(D===1)return b(T[0],j)},[b]),v=i.useMemo(()=>g&&e.jsx(Kt,{ID:l,nameTanSuat:u,BaoCaoDi:!0,open:g,onClose:()=>h(null),reloadData:t,nam:a,selectedFolder:o}),[l,g,a,t,o,u]),N=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((T,j)=>e.jsxs("div",{className:"item-loai-bao-cao",children:[e.jsx("h5",{className:"mb-4",children:T.TenMauBaoCao}),e.jsxs(fe,{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:T.ListTanSuat.length?T.ListTanSuat.map((D,w)=>e.jsxs("tr",{children:[e.jsx("td",{children:Bt(D.TGDenHanGui)}),e.jsx("td",{children:D.TenTanSuat}),e.jsx("td",{style:{fontWeight:"400"},children:D.TenDonViNhan}),e.jsx("td",{children:!D.ListDuLieuBaoCao.length&&e.jsx(_t,{value:D.SoNgayDenHan,isNgayDenHan:D.SoNgayDenHan})}),e.jsx("td",{children:D.ListDuLieuBaoCao.length?k(D.ListDuLieuBaoCao,D):f(D,T)})]},w)):N})]})]},j)):N,v]})}const Le={tat_ca:"tat_ca",sap_den_han_gui:"sap_den_han_gui",tre_han_gui:"tre_han_gui"},Ve={tat_ca:"tat-ca",da_gui:"da-gui",chua_gui:"chua-gui"},Js=i.memo(s=>{const{selectedFolder:a}=vn(),{item:t,open:n,onClose:o,onReloadAll:l,nam:h}=s,[u,m]=i.useState([]),[g,d]=i.useState([]),[r,p]=i.useState(Ve.tat_ca),[c,x]=i.useState({}),[A,_]=i.useState(null);i.useEffect(()=>{t&&S()},[t]),i.useEffect(()=>{g.length&&(r===Ve.da_gui?m(g.filter(b=>parseInt(b.TrangThai||0)>=2)):r===Ve.chua_gui?m(g.filter(b=>parseInt(b.TrangThai||0)<2)):m(g))},[r]);const S=()=>{y(`Reports/ThongKeBaoCaoDen_ChiTiet?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}`,"GET",null,{odata:!1}).then(b=>{d(b),m(b),x({...c,tat_ca:b.length,da_gui:b.filter(f=>parseInt(f.TrangThai||0)>=2).length,chua_gui:b.filter(f=>parseInt(f.TrangThai||0)<2).length})}).catch(b=>M(b.Message,"Thông báo"))},H=(b,f)=>{let k=u.slice(),v=k[b];v={...v,TrangThai:f},k[b]=v,m(k)};return e.jsxs(La,{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(Zs,{item:t,value:r,selectedFolder:a,data:[{label:`Tất cả (${c.tat_ca||0})`,value:Ve.tat_ca,icon:"stack-overflow"},{label:`Đã gửi (${c.da_gui||0})`,value:Ve.da_gui,color:"primary",icon:"clock-o"},{label:`Chưa gửi (${c.chua_gui||0})`,value:Ve.chua_gui,color:"warning",icon:"stumbleupon"}],onChange:b=>p(b)}),e.jsx("div",{className:"loai-bao-cao",children:e.jsxs(fe,{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:u.map((b,f)=>e.jsxs("tr",{children:[e.jsx("td",{children:b.MaDonVi}),e.jsx("td",{children:b.TenDonVi}),e.jsxs("td",{children:[" ",parseInt(b.TrangThai||0)>=2?e.jsxs(vt,{style:{padding:".125rem .5rem",fontSize:11,fontWeight:"normal"},color:"success",children:[e.jsx("span",{style:{fontSize:12},children:e.jsx(L,{fa:"check-circle-o"})})," ","Đã gửi"]}):e.jsxs(me.Fragment,{children:[e.jsx("span",{style:{fontSize:13},className:"text-warning",children:e.jsx(L,{fa:"exclamation-circle"})})," ","Chưa gửi"]})]}),e.jsx("td",{children:b.MaBaoCao&&parseInt(b.TrangThai||0)>=2&&e.jsxs("div",{children:[e.jsx(E,{className:"btn-mau-bao-cao",onClick:()=>_({ID:b.DuLieuBaoCao_Id,index:f,NhomDoiTuong:b.NhomDoiTuong}),children:b.MaBaoCao}),e.jsx(Nn,{status:b.TrangThai})]})}),e.jsxs("td",{children:[bt(b.TGGuiBaoCao)," ",parseInt(b.SoNgayDenHan||0)<0&&e.jsx(_t,{value:b.SoNgayDenHan})]})]},f))})]})})]}),A&&e.jsx(Kt,{ID:A,open:!!A,BaoCaoDi:!1,onClose:()=>{_(null),S()},reloadData:l,onChangeTrangThai:H,selectedFolder:a,nam:h,NhomDoiTuong:A.NhomDoiTuong})]})}),Zs=s=>{const{data:a,value:t,onChange:n,item:o,selectedFolder:l}=s;return i.useState(t),e.jsxs("div",{className:"d-flex form-filter-danh-sach-bao-cao",children:[e.jsx("div",{children:e.jsx(Pt,{column:a,onChange:h=>{n&&n(h)}})}),e.jsx("div",{md:"4",className:"ms-auto",children:o&&e.jsx(Qs,{item:o,selectedFolder:l})})]})},Qs=s=>{const{item:a,selectedFolder:t}=s,[n,o]=i.useState(!1),l="Reports/ThongKeBaoCaoDen_ChiTiet",h=()=>o(!n),u=(m="pdf")=>{let g=m;m==="excel"&&(g="xlsx"),m==="word"&&(g="docx"),a&&dn(`${l}?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}&isDownload=true&mode=download_${m}&pageSize=A4&landscape=true`,`Tải xuống.${g}`,"GET",null,!0).then(()=>{}).catch(()=>M("Đã xảy ra lỗi tải file!","Thông báo"))};return e.jsxs(Mn,{isOpen:n,toggle:h,className:"mr-2",children:[e.jsxs(Xe,{caret:!0,color:"success",size:"sm",children:[e.jsx(L,{fa:"print"})," Tải xuống DS đơn vị gửi báo cáo"]}),e.jsxs(qe,{children:[e.jsx(R,{onClick:()=>u(),children:"PDF"}),e.jsx(R,{onClick:()=>u("excel"),children:"Excel"}),e.jsx(R,{onClick:()=>u("word"),children:"Word"})]})]})},eo=i.memo(({data:s,onReloadAll:a,nam:t})=>{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"})}),[]),h=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"})]})}),[]),u=i.useCallback(d=>e.jsx("tbody",{children:d.ListTanSuat.length?d.ListTanSuat.map((r,p)=>e.jsxs("tr",{children:[e.jsx("td",{children:Bt(r.TGDenHanGui)}),e.jsx("td",{children:r.TenTanSuat}),e.jsx("td",{className:"text-right",children:e.jsx(Re,{className:"text-primary",children:r.TongSoDonVi?r.TongSoDonVi+" đơn vị":"-"})}),e.jsx("td",{className:"text-right",children:e.jsx(Re,{className:"text-info",children:r.DonViChoDuyet?r.DonViChoDuyet+" đơn vị":"-"})}),e.jsx("td",{className:"text-right",children:e.jsx(Re,{className:"text-success",children:r.DonViDaDuyet?r.DonViDaDuyet+" đơn vị":"-"})}),e.jsx("td",{className:"text-right",children:e.jsx(Re,{className:"text-danger",children:r.DonViTuChoi?r.DonViTuChoi+" đơn vị":"-"})}),e.jsx("td",{className:"text-right",children:e.jsx(Re,{className:"text-warning",children:r.DonViChuaGui?r.DonViChuaGui+" đơn vị":"-"})}),e.jsx("td",{className:"text-right",children:e.jsx(E,{className:"btn-mau-bao-cao",size:"sm",onClick:()=>o({...r,MauBaoCao_Id:d.MauBaoCao_Id,nam:t}),children:"Xem chi tiết"})})]},p)):l}),[l,t]),m=i.useCallback(d=>e.jsxs(fe,{className:"table-minhon",children:[h,u(d)]}),[u,h]),g=i.useMemo(()=>n&&e.jsx(Js,{item:n,open:!!n,onClose:()=>o(null),onReloadAll:a,nam:t}),[a,n,t]);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}),m(d)]},r)):l,g]})}),Re=te.span` font-size: 16px; `,no=i.memo(()=>{const{selectedFolder:s,data:a,onAnTenLinhVuc:t,reloadData:n,TenLinhVuc:o,isDi:l}=vn(),[h,u]=i.useState([]),[m,g]=i.useState([]),[d,r]=i.useState(new Date().getFullYear()),[p,c]=i.useState({}),x=i.useRef(),A=i.useCallback(v=>{if(l){g(v);let N=0,T=0,j=0;v.forEach(D=>{D.ListTanSuat.forEach(w=>{j+=1,parseInt(w.SoNgayDenHan||0)<=5&&parseInt(w.SoNgayDenHan||0)>=0?N+=1:parseInt(w.SoNgayDenHan||0)<0&&(T+=1)})}),c({denHan:N,treHan:T,tatCa:j})}},[l]),_=i.useCallback(()=>{let v=l?"Reports/BaoCaoDi":"Reports/BaoCaoDen";s.Id&&d&&y(`${v}?DMBaoCao_Id=${s.Id}&year=${d}`,"GET",null,{odata:!1}).then(N=>{u(N),A(N)})},[l,d,A,s.Id]);i.useEffect(()=>{s&&_()},[_,s,d]),i.useEffect(()=>{t&&t(!0)},[s]),i.useEffect(()=>{x.current&&x.current._setvalueRadio(Le.tat_ca)},[d]);const S=i.useCallback(()=>{n(),_()},[_,n]),H=i.useCallback(v=>{let N=[];v===Le.sap_den_han_gui?m.forEach(T=>{var j=T.ListTanSuat.filter(D=>parseInt(D.SoNgayDenHan||0)<=5&&parseInt(D.SoNgayDenHan||0)>=0);N.push({...T,ListTanSuat:j})}):v===Le.tre_han_gui?m.forEach((T,j)=>{var D=T.ListTanSuat.filter(w=>parseInt(w.SoNgayDenHan||0)<0);N.push({...T,ListTanSuat:D})}):N=m,u(N)},[m]),b=i.useMemo(()=>l?e.jsx($s,{nam:d,data:h,onReloadAll:S}):e.jsx(eo,{data:h,onReloadAll:S,nam:d}),[h,l,d,S]),f=i.useMemo(()=>e.jsxs("div",{className:"ms-auto form-filter-year-dsmbc",children:[e.jsx("strong",{children:"Chọn theo năm"}),e.jsx(ba,{value:d,onChange:v=>r((v==null?void 0:v.value)||new Date().getFullYear()),generateOptions:{minYear:2020,maxYear:new Date().getFullYear()+5}})]}),[d]),k=i.useMemo(()=>a&&e.jsx(Va,{listItem:[o,s.Name]}),[o,a,s.Name]);return e.jsxs(me.Fragment,{children:[k,e.jsxs("div",{className:"form-filter-danh-sach-bao-cao",children:[(!!+(p==null?void 0:p.tatCa)||!!+(p==null?void 0:p.denHan)||!!+(p==null?void 0:p.treHan))&&e.jsx(e.Fragment,{children:e.jsx(Pt,{column:[{label:`Tất cả (${p.tatCa||0})`,value:Le.tat_ca,icon:"stack-overflow"},{label:`Sắp đến hạn gửi (${p.denHan||0})`,value:Le.sap_den_han_gui,color:"warning",icon:"clock-o"},{label:`Trễ hạn gửi (${p.treHan||0})`,value:Le.tre_han_gui,color:"danger",icon:"stumbleupon"}],onChange:v=>H(v)})}),f]}),b]})}),Pt=({column:s,onChange:a})=>{var o;const[t,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:()=>{a(l==null?void 0:l.value),n(l==null?void 0:l.value)},className:`item ${t===(l==null?void 0:l.value)?`active ${l==null?void 0:l.color}`:""}`,children:[e.jsx(L,{fa:l==null?void 0:l.icon}),l==null?void 0:l.label]})}))})})},to=i.memo(s=>{const{TenLinhVuc:a,LinhVuc_Id:t,onAnTenLinhVuc:n,isDi:o,exit:l}=s,[h,u]=i.useState([]),[m,g]=i.useState(null),d=un();let r=d==null?void 0:d.pathname;const p=i.useCallback(()=>{r&&y(`Reports/GetAllDMBaoCaoOfLinhVuc?linhVucId=${t}&isDi=${o}&route=${r}`,"GET",null,{odata:!1}).then(x=>{u(x.sort(oa("STT","asc"))),g(x[0])})},[t,r,o]);i.useEffect(()=>{p()},[p]);const c=i.useMemo(()=>m&&e.jsx(no,{}),[m]);return e.jsx("div",{className:"lich-bao-cao",children:e.jsx("div",{className:"index-folder-bc-di",children:e.jsx("div",{className:"folder-cus clearfix",children:e.jsx(Vt.Provider,{value:{selectedFolder:m,setselectedFolder:g,data:h,LinhVuc_Id:t,TenLinhVuc:a,onAnTenLinhVuc:n,isDi:o,reloadData:p,exit:l},children:c})})})})}),jt=to;class hi extends i.Component{constructor(t){super(t);X(this,"loadDataLinhVuc",t=>{this.setState({isSkeleton:!0,isAnTenLinhVuc:!1}),y(`Reports/GetLinhVuc?isDi=${t}&Route=${this.state.route}`,"GET",null,{odata:!1}).then(n=>{t===!0&&this.loadDataLinhVuc(!1),t===!1&&n.length&&this.setState({datainLinhVucDen:n}),t===!0&&n.length&&this.setState({datainLinhVucDi:n}),this.setState({isSkeleton:!1})}).catch(()=>{this.setState({isSkeleton:!1})})});X(this,"selectedLinhVuc",(t,n)=>{this.setState({LinhVuc_Id:t,TenLinhVuc:n})});X(this,"onAnTenLinhVuc",t=>{this.setState({isAnTenLinhVuc:t})});this.state={LinhVuc_Id:null,TenLinhVuc:"",datainLinhVucDen:[],datainLinhVucDi:[],isAnTenLinhVuc:!1,isDi:!1,isSkeleton:!1,method:"",route:window.location.pathname}}componentDidMount(){this.loadDataLinhVuc(!0)}render(){const{isSkeleton:t,datainLinhVucDen:n,datainLinhVucDi:o}=this.state;let l=[];return n.length&&l.push({TabName:e.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",gap:"1rem"},onClick:()=>{this.loadDataLinhVuc(!1)},children:[e.jsx(L,{fa:"inbox"}),e.jsx("span",{style:{fontSize:15},children:"Báo cáo đến"})]}),TabContent:e.jsx(e.Fragment,{children:t?e.jsx(e.Fragment,{children:t?e.jsx(dt,{length:5,width:300}):e.jsx(cn,{size:"sm",text:"Chưa có dữ liệu"})}):n.length>0?e.jsx(jt,{TenLinhVuc:n[0].Name,onAnTenLinhVuc:this.onAnTenLinhVuc,LinhVuc_Id:n[0].Id,isDi:!1,exit:()=>this.selectedLinhVuc(null,null)}):e.jsx(cn,{size:"sm",text:"Chưa có dữ liệu"})})}),o.length&&l.push({TabName:e.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",gap:"1rem"},onClick:()=>{this.loadDataLinhVuc(!0)},children:[e.jsx(L,{fa:"rocket"}),e.jsx("span",{style:{fontSize:15},children:"Báo cáo đi"})]}),TabContent:e.jsx(e.Fragment,{children:t?e.jsx(e.Fragment,{children:t?e.jsx(dt,{length:5,width:300}):e.jsx(cn,{size:"sm",text:"Chưa có dữ liệu"})}):o.length>0?e.jsx(jt,{TenLinhVuc:o[0].Name,onAnTenLinhVuc:this.onAnTenLinhVuc,LinhVuc_Id:o[0].Id,exit:()=>this.selectedLinhVuc(null,null),isDi:!0}):e.jsx(cn,{size:"sm",text:"Chưa có dữ liệu"})})}),e.jsx("div",{className:"index-quan-ly-bao-cao",style:{height:"100%"},children:e.jsx(ls,{data:l})})}}export{hi as default};