????

Your IP : 216.73.216.130


Current Path : C:/inetpub/vhost/donthu.nextform.vn/wwwroot/assets/
Upload File :
Current File : C:/inetpub/vhost/donthu.nextform.vn/wwwroot/assets/index-EPGxz-Jk.js

var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});import{k as jsxRuntimeExports,bM as formatDatetime,r as reactExports,h as useTheme,am as Grid,y as Button,I as Icon,C as Card,B as Box,P as Paper,d4 as CHECK_CONFIRMS,bi as CHECK_ERROR,ao as useService,d1 as DonThuXuLy,bK as lodashExports,bh as CHECK_SUCCESS,bg as CHECK_CONFIRM,bW as iniAddress$2,bV as useFormContext,F as useAuth,aG as Stack,bf as Grow,b6 as Divider,ar as Typography}from"./index-y1X-EiI1.js";import{t as typeStatus,o as typeNumUser,p as typeLetter,k as useDonThu,F as Form,C as CardHeader,b as CardContent,a as FormControl,j as useDetailUser,u as useAsync,R as ReceivingForm,A as Address,s as useDonThuNguoiDungDon,V as VisuallyHiddenInput,l as default_1,q as FindUser,D as DataTable}from"./DataTable-BEDH0i35.js";import{u as useMediaQuery}from"./useMediaQuery-BtRkfgHg.js";import{b as DialogContent,D as Dialog}from"./DialogTitle-B28XGy8_.js";import{D as Descriptions,a as DanhSachVanBanXuLy,c as createData,U as UserTable,A as AddForm}from"./TaiDonVi-BhB2EbXD.js";import{u as useCanBo}from"./CanBo.service-1WolgtmP.js";import{u as useLetterProcess}from"./LetterProcess.service-WE3ArG0h.js";import{B as Breadcrumbs}from"./Breadcrumbs-B7ARQx64.js";import{L as Link}from"./Link-D62DzNC-.js";import"./Tooltip-C0pwvyhl.js";import"./Popper-BN0GgV3z.js";import"./utils-B_XeHYak.js";import"./TableRow-BfZy-RM-.js";import"./FormGroup-CEJG6asl.js";import"./ListItemText-BvrfP19N.js";import"./Autocomplete-CpStdzj7.js";import"./Close-DnCuke95.js";import"./usePreviousProps-eNEUPQQG.js";import"./Chip-4iuxTgqW.js";import"./warning-BmqNoLzl.js";import"./TablePagination-Dnie0nHQ.js";import"./Toolbar-BZCdaOvb.js";import"./LoadingButton-DgqpHLzy.js";import"./Badge-BUU8rl3f.js";import"./Collapse-YEAu7S3-.js";import"./Alert-AfWalC00.js";import"./Switch-BlzK9Osj.js";import"./SwitchBase-HB81Uehs.js";import"./Checkbox-B8nePMFP.js";import"./AppBar-BrohM22l.js";import"./Edit-B3_PTrTU.js";const columns=[{title:"id",field:"id",type:"string",hidden:!0},{title:"Ngày tiếp nhận",field:"thoiGianTiepNhan",type:"string",dataCheck:!0,searchable:!0,render:rowData=>jsxRuntimeExports.jsx("span",{style:{fontSize:12},children:formatDatetime(rowData.thoiGianTiepNhan)})},{title:"Nội dung đơn",field:"noiDungDon",type:"string",dataCheck:!0,searchable:!0},{title:"Trạng thái",field:"phanTheoDieuKien",type:"string",dataCheck:!0,searchable:!0,render:rowData=>jsxRuntimeExports.jsx("span",{style:{fontSize:12},children:typeStatus(rowData.phanTheoDieuKien)})},{title:"Phân loại",field:"phanTheoSoNguoi",type:"string",dataCheck:!0,searchable:!0,render:rowData=>jsxRuntimeExports.jsx("span",{style:{fontSize:12},children:typeNumUser(rowData.phanTheoSoNguoi)})},{title:"Loại đơn thư",field:"dmPhanTheoNoiDungId",type:"string",dataCheck:!0,searchable:!0,render:rowData=>jsxRuntimeExports.jsx("span",{style:{fontSize:12},children:typeLetter(rowData.dmPhanLoaiTheoNoiDungId)})}],Enums_Type=[{value:"KhongThamQuyen",label:"Không Thẩm Quyền"},{value:"CoThamQuyen",label:"Có Thẩm Quyền"}],formData$2={soVanBan:{field_name:"soVanBan",title:"Số văn bản",type:"textbox"},phanTheoDieuKien:{field_name:"phanTheoDieuKien",title:"Trạng thái",type:"select-async",value_field:"id",value_label:"name"},phanTheoThamQuyen:{field_name:"phanTheoThamQuyen",title:"Thẩm quyền",type:"select-async",value_field:"id",value_label:"name",options:Enums_Type},hinhThuc:{field_name:"hinhThuc",title:"Hình thức xử lý",type:"select-async",value_field:"id",value_label:"name"},noiGhinhan:{field_name:"noiGhinhan",title:"Nơi ghi nhận",type:"select-async",value_field:"id",value_label:"name"}},Index$5=__name(({onClose,open,id,updateQueryState})=>{const[data,setData]=reactExports.useState({}),{getListLetterById}=useDonThu(),theme=useTheme(),fullScreen=useMediaQuery(theme.breakpoints.down("sm")),windowHeight=window.innerHeight,getDataById=reactExports.useCallback(async id2=>{try{const data2=await getListLetterById(id2,{});return setData(data2),data2}catch{}},[getListLetterById]),handleSubmit=reactExports.useCallback(dataForm=>{const conditions=Object.entries(dataForm).filter(([key,value])=>value!==void 0).map(([key,value])=>`${key} eq ${typeof value=="string"?`'${value}'`:value}`);updateQueryState(conditions.join(" and ")),onClose()},[onClose,updateQueryState]),handleChangeNS=reactExports.useCallback((name,value)=>{setData(pre=>({...pre,[name]:value}))},[]),renderFormCreate=reactExports.useMemo(()=>jsxRuntimeExports.jsxs(Form,{onSubmit:handleSubmit,defaultValues:()=>id?getDataById(id):Promise.resolve({}),children:[jsxRuntimeExports.jsxs(Grid,{padding:1,container:!0,children:[jsxRuntimeExports.jsx(Grid,{xs:11,md:10,children:jsxRuntimeExports.jsx(CardHeader,{titleTypographyProps:{variant:"h6"},title:"Tìm kiếm nâng cao"})}),jsxRuntimeExports.jsx(Grid,{xs:1,md:2,alignSelf:"center",justifySelf:"center",children:jsxRuntimeExports.jsx(Button,{type:"submit",variant:"outlined",startIcon:jsxRuntimeExports.jsx(Icon,{children:"search"}),children:"Tìm kiếm"})})]}),jsxRuntimeExports.jsx(DialogContent,{style:{height:`${windowHeight-200}px`},sx:{padding:"0px"},children:jsxRuntimeExports.jsx(Card,{children:jsxRuntimeExports.jsx(CardContent,{sx:{background:"#E7EBF0"},children:jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(Grid,{container:!0,children:jsxRuntimeExports.jsx(Grid,{xs:12,children:jsxRuntimeExports.jsx(Paper,{sx:{borderRadius:"0.3rem",padding:"0.2rem"},children:Object.entries(formData$2).map(([key,value],idx)=>jsxRuntimeExports.jsx(FormControl,{data:{...value,name:key},rules:value.rules,name:key,value:data&&data[key],onChange:handleChangeNS,defaultValue:value.defaultValue||data[key]},idx+key))})})})})})})})]}),[data,getDataById,handleChangeNS,handleSubmit,id,windowHeight]);return jsxRuntimeExports.jsx(Dialog,{fullWidth:!fullScreen,disableEnforceFocus:!0,disableAutoFocus:!0,maxWidth:"md",onClose,open:!!open,fullScreen,children:renderFormCreate})},"Index$5"),FilterForm=reactExports.memo(Index$5),formData$1={canBo:{field_name:"canBo",title:"Cán bộ",type:"select-async",value_field:"thongTinCaNhanId",value_label:"thongTinCaNhanId",url:"api/buss/allow/CanBos"},ghiChu:{field_name:"ghiChu",title:"Ghi chú",type:"textarea"}},Index$4=__name(({onClose,open,id,data})=>{const handleSubmit=reactExports.useCallback(async dataForm=>{try{CHECK_CONFIRMS("Chuyển đơn thư","Chuyển đơn").then(res=>{res&&res.isConfirmed&&(console.log(data),onClose())})}catch(error){CHECK_ERROR(error)}},[data,onClose]),renderFormCreate=reactExports.useMemo(()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(Form,{onSubmit:handleSubmit,children:[jsxRuntimeExports.jsxs(Grid,{padding:1,container:!0,children:[jsxRuntimeExports.jsx(Grid,{container:!0,lg:9,md:8,children:jsxRuntimeExports.jsx(CardHeader,{titleTypographyProps:{variant:"h6",fontWeight:"bold",color:"warning"},title:"Chuyển xử lý"})}),jsxRuntimeExports.jsx(Grid,{lg:3,item:!0,md:2,container:!0,justifyContent:"center",children:jsxRuntimeExports.jsx(Grid,{alignSelf:"center",justifySelf:"center",children:jsxRuntimeExports.jsx(Button,{type:"submit",color:"warning",variant:"outlined",startIcon:jsxRuntimeExports.jsx(Icon,{children:"mark_email_read"}),children:"Chuyển đơn"})})})]}),jsxRuntimeExports.jsx(CardContent,{sx:{background:"#E7EBF0"},children:jsxRuntimeExports.jsx(Paper,{sx:{borderRadius:"0.3rem",padding:"0.2rem"},children:jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,children:Object.entries(formData$1).map(([key,value],idx)=>jsxRuntimeExports.jsx(Grid,{item:!0,lg:12,md:12,children:jsxRuntimeExports.jsx(FormControl,{data:{...value,name:key},rules:value.rules,name:key,value:data&&data[key],defaultValue:(value==null?void 0:value.defaultValue)||(data==null?void 0:data[key])},idx+key)}))})})})]})}),[data,handleSubmit]);return jsxRuntimeExports.jsx(Dialog,{fullWidth:!0,disableEnforceFocus:!0,disableAutoFocus:!0,maxWidth:"sm",onClose,open:!!open,children:renderFormCreate})},"Index$4"),TransferLetter=reactExports.memo(Index$4);function EmailProcessing(){const allow=useService(DonThuXuLy,"allow"),auth2=useService(DonThuXuLy,"auth");return{getEmailProcessing:__name(param=>allow.get({url:""},param),"getEmailProcessing"),getListEmailProcessingById:__name((id,param)=>allow.get({url:`(${id})`},param),"getListEmailProcessingById"),postEmailProcessing:__name((canBoID,donThuID)=>auth2.post({url:`/PostCanBoXuLyDon?canBoId=${canBoID}&donThuId=${donThuID}`}),"postEmailProcessing"),updateEmailProcessing:__name((id,data)=>allow.path({url:`(${id})`,body:data}),"updateEmailProcessing"),deleteEmailProcessing:__name(id=>allow.deleteMethod({url:`(${id})`}),"deleteEmailProcessing"),EditEmailProcessing:__name((canBoID,donThuXuLyId)=>auth2.post({url:`/EditCanBoXuLyDon?canBoId=${canBoID}&donThuXuLyId=${donThuXuLyId}`}),"EditEmailProcessing")}}__name(EmailProcessing,"EmailProcessing");const KetQuaXuLy=__name(({donThuXuLy})=>{console.log(donThuXuLy);const items=[{label:"Hướng xử lý",value:donThuXuLy.dmHinhThucXuLyDon.name},{label:"Đơn vị xử lý",value:donThuXuLy.donThuXuLyCanBo.organizationId}];return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Descriptions,{cols:4,items}),donThuXuLy.fileId!==void 0&&jsxRuntimeExports.jsx(DanhSachVanBanXuLy,{donThuXuLy})]})},"KetQuaXuLy"),ThamQuyen$1=[{value:"Mot",label:"Cá nhân"},{value:"Nhieu",label:"Đoàn đông người"},{value:"ToChuc",label:"Cơ quan tổ chức"}],customForm$1={phanTheoSoNguoi:{field_name:"phanTheoSoNguoi",title:"Phân loại người đứng đơn",type:"select-custom",options:ThamQuyen$1}},iniAddress$1={province:{id:"52",code:"52",name:"Tỉnh Bình Định"}},customCheckBox$1={coUyQuyen:{field_name:"coUyQuyen",title:"Có uỷ quyền",type:"checkbox",options:ThamQuyen$1}},Index$3=__name(({onClose,open,id,handleReload,formData:formData2,formDataUser:formDataUser2,formDataSend:formDataSend2,formDataOrganization:formDataOrganization2,formDataOrganizations:formDataOrganizations2,luatSu:luatSu2,LS:LS2})=>{const{getListLetterById,acceptLetter,getXuLyByDonThu}=useDonThu(),{EditEmailProcessing,postEmailProcessing}=EmailProcessing(),{getListDetailUserById}=useDetailUser(),{getAllCanBo}=useCanBo(),[data,setData]=reactExports.useState({}),[openConfig,setOpenConfig]=reactExports.useState({}),[arrUser,setArrUser]=reactExports.useState([]),[selectedFilesList,setSelectedFilesList]=reactExports.useState([]),theme=useTheme(),fullScreen=useMediaQuery(theme.breakpoints.down("sm")),[openSend,setOpenSend]=reactExports.useState(!1),[listSendLetterUser,setSendLetterUser]=reactExports.useState({}),[isUyQuyen,setIsUyQuyen]=reactExports.useState(!1),[author,setAuthor]=reactExports.useState({}),[isLS,setIsLS]=reactExports.useState(!1),[infoLS,setInfoLS]=reactExports.useState({}),[typeLetter2,setTypeletter]=reactExports.useState(""),tableHead=[{label:"Số định danh",colSpan:1},{label:"Tên",colSpan:2},{label:"Giới tính",colSpan:1},{label:"Điện thoại",colSpan:1}],getDataById=reactExports.useCallback(async id2=>{var _a,_b,_c,_d,_e,_f,_g,_h,_i;try{const data2=await getXuLyByDonThu(id2);setData(data2),console.log(data2),setTypeletter(data2.phanTheoSoNguoi),data2&&data2.donThuNguoiDungDons&&data2.donThuNguoiDungDons.forEach(value=>{getListDetailUserById(value.thongTinCaNhanId,{expand:["thuongTruHuyen","thuongTru"]}).then(res=>{setArrUser(prev=>[...prev,createData(res.gioiTinh,res.ngayCap,res.ngaySinh,res.noiCap,res.hoVaTenDem,res.soDinhDanh,res.ten,res.thuongTruHuyen&&res.thuongTruHuyen.name,res.thuongTru&&res.thuongTru.name,res.dienThoai,"","")])}).catch(err=>{console.log(err)})});let getDataCanbo;(_a=data2.donCanBoTiepNhans)!=null&&_a.length&&(getDataCanbo=await getAllCanBo({filter:`thongTinCaNhanId eq ${data2.donThuCanBoTiepNhans[0].thongTinCaNhanId}`,expand:"thongTinCaNhan"}));let getDataCanboUyQuyen;data2&&data2.donThuNguoiUyQuyen?(getDataCanboUyQuyen=await getListDetailUserById((_b=data2.donThuNguoiUyQuyen)==null?void 0:_b.thongTinCaNhanId,{expand:["thuongTruHuyen","thuongTru"]}),setIsUyQuyen(!0),setIsLS((_c=data2.donThuNguoiUyQuyen)==null?void 0:_c.isLuatSu)):(getDataCanboUyQuyen=void 0,setIsUyQuyen(!1),setIsLS(!1));let getDataCanboXuly;return data2&&data2.donThuXuLys.length>0&&((_e=(_d=data2.donThuXuLys)==null?void 0:_d[0])!=null&&_e.donThuXuLyCanBo)?getDataCanboXuly=await getAllCanBo({filter:`thongTinCaNhanId eq ${data2.donThuXuLys[0].donThuXuLyCanBo.thongTinCaNhanId}`,expand:"thongTinCaNhan"}):getDataCanboXuly=void 0,{...data2,province:data2.noiGhiNhanTinh,district:data2.noiGhiNhanHuyen,ward:data2.noiGhiNhan,donThuCanBoTiepNhan:getDataCanbo&&getDataCanbo[0].id,DonThuXuLy:getDataCanboXuly&&getDataCanboXuly[0].id,coUyQuyen:!!data2.donThuNguoiUyQuyen,luatSu:(_f=data2.donThuNguoiUyQuyen)==null?void 0:_f.isLuatSu,...getDataCanboUyQuyen,soThe:(_g=data2.donThuNguoiUyQuyen)==null?void 0:_g.soThe,noiCap:(_h=data2.donThuNguoiUyQuyen)==null?void 0:_h.noiCap,ngayCapThe:(_i=data2.donThuNguoiUyQuyen)==null?void 0:_i.ngayCap}}catch(error){console.log(error)}},[getAllCanBo,getListDetailUserById,getXuLyByDonThu]),getInitData=reactExports.useCallback(()=>Promise.resolve(iniAddress$1),[]),handleChangeChecked=__name((name,value)=>{},"handleChangeChecked"),handleChangeAuthor=reactExports.useCallback((name,value)=>{switch(name){case"thongTinCaNhan.soDinhDanh":const{id:id2}=value||{};setAuthor(id2?pre=>({...pre,canBo:{thongTinCaNhanId:id2},thongTinCaNhan:{...value,thongTinCaNhanId:id2}}):pre=>{const data2={...pre};return lodashExports.set(data2,"thongTinCaNhan",{}),lodashExports.set(data2,name,value&&value.value),lodashExports.set(data2,"canBo.thongTinCaNhanId",id2),{...data2,thongTinCaNhanId:id2}});break;default:setAuthor(pre=>({...pre,[name]:value}));break}},[]),handleChangeLS=__name((name,value)=>{},"handleChangeLS"),handleChangeInfoLS=reactExports.useCallback((name,value)=>{setInfoLS(pre=>({...pre,[name]:value}))},[]),handleSubmit=reactExports.useCallback(async data2=>{CHECK_CONFIRMS("Gửi xử lý đơn thư","Gửi cán bộ xử lý đơn thư").then(res=>{if(res&&res.isConfirmed){const{donThuCanBoTiepNhan,canBoTiepNhanId,province,district,ward,...newData}=data2;if(console.log(newData),newData.donThuXuLys.length>0){EditEmailProcessing(listSendLetterUser.canBoTiepNhanId,newData.donThuXuLys[0].id).then(()=>{CHECK_SUCCESS("Xử lý đơn thành công "),setTimeout(()=>{onClose()},1e3)}).catch(err=>{CHECK_ERROR("Xử lý đơn thất bại !"),console.log(err)});return}postEmailProcessing(listSendLetterUser.canBoTiepNhanId,newData.donThuCanBoTiepNhans[0].donThuId).then(()=>{CHECK_SUCCESS("Xử lý đơn thành công "),setTimeout(()=>{onClose()},1e3)}).catch(err=>{CHECK_ERROR("Xử lý đơn thất bại !"),console.log(err)})}})},[EditEmailProcessing,listSendLetterUser.canBoTiepNhanId,onClose,postEmailProcessing]),handleDeleteDocument=__name(file=>{console.log(file)},"handleDeleteDocument"),handleChangeNSLetter=reactExports.useCallback((name,value)=>{setSendLetterUser(pre=>({...pre,[name]:value}))},[]),{execute}=useAsync(handleSubmit),renderUserLetter=reactExports.useMemo(()=>jsxRuntimeExports.jsx(Form,{ref:null,onSubmit:execute,defaultValues:()=>id?getDataById(id):getInitData(),children:jsxRuntimeExports.jsxs(Paper,{children:[jsxRuntimeExports.jsxs(Grid,{padding:1,container:!0,children:[jsxRuntimeExports.jsx(Grid,{container:!0,lg:9,md:8,xl:4,xs:5,children:jsxRuntimeExports.jsx(CardHeader,{titleTypographyProps:{variant:"h6",fontWeight:"bold",color:"green"},title:"Chuyển đơn"})}),jsxRuntimeExports.jsx(Grid,{lg:3,item:!0,md:2,xl:2,xs:3.5,container:!0,justifyContent:"flex-end",children:jsxRuntimeExports.jsx(Grid,{alignSelf:"center",justifySelf:"center",children:jsxRuntimeExports.jsx(Button,{type:"submit",color:"success",variant:"outlined",endIcon:jsxRuntimeExports.jsx(Icon,{children:"send"}),children:"Chuyển đơn"})})})]}),jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,children:Object.entries(formDataSend2).map(([key,value],idx)=>jsxRuntimeExports.jsx(Grid,{item:!0,lg:12,md:12,sm:12,children:jsxRuntimeExports.jsx(FormControl,{fullLine:!0,data:{...value,name:key},rules:value.rules,name:key,value:data&&data[key],onChange:handleChangeNSLetter,defaultValue:(value==null?void 0:value.defaultValue)||(data==null?void 0:data[key])},idx+key)}))})]})}),[data,execute,formDataSend2,getDataById,getInitData,handleChangeNSLetter,id]);reactExports.useRef();const renderFormCreate=reactExports.useMemo(()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Form,{onSubmit:()=>setOpenSend(!0),defaultValues:()=>id?getDataById(id):getInitData(),children:jsxRuntimeExports.jsx(reactExports.Fragment,{children:jsxRuntimeExports.jsxs(Grid,{lg:12,padding:0,container:!0,children:[jsxRuntimeExports.jsx(Grid,{container:!0,lg:8,children:jsxRuntimeExports.jsx(CardHeader,{titleTypographyProps:{fontSize:16,fontWeight:"bold",color:theme.palette.primary.main},title:"CHI TIẾT XỬ LÝ GIẢI QUYẾT ĐƠN/VỤ VIỆC"})}),jsxRuntimeExports.jsxs(CardContent,{sx:{background:"white"},children:[arrUser.length>0&&jsxRuntimeExports.jsx(ReceivingForm.ExpandForm,{ref:null,title:"NGƯỜI ĐỨNG ĐƠN/VỤ VIỆC",children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Grid,{container:!0,lg:12,md:12,children:[Object.entries(customForm$1).map(([key,value],idx)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Grid,{item:!0,lg:3,md:3,children:jsxRuntimeExports.jsx(FormControl,{fullLine:!0,data:{...value,name:key},rules:value.rules,name:key,value:data&&data[key],onChange:{},defaultValue:value.defaultValue||data[key]},idx+key)})})),typeLetter2==="Mot"||typeLetter2==="Nhieu"&&Object.entries(formDataOrganization2).map(([key,value],idx)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Grid,{item:!0,lg:3,md:3,children:jsxRuntimeExports.jsx(FormControl,{fullLine:!0,data:{...value,name:key},rules:value.rules,name:key,value:data&&data[key],onChange:{},defaultValue:value.defaultValue||data[key]},idx+key)})})),typeLetter2==="ToChuc"&&Object.entries(formDataOrganizations2).map(([key,value],idx)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Grid,{item:!0,lg:3,md:3,children:jsxRuntimeExports.jsx(FormControl,{fullLine:!0,data:{...value,name:key},rules:value.rules,name:key,value:data&&data[key],onChange:{},defaultValue:value.defaultValue||data[key]},idx+key)})})),typeLetter2==="Mot"||typeLetter2==="Nhieu"&&Object.entries(formDataOrganization2).map(([key,value],idx)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Grid,{item:!0,lg:3,md:3,children:jsxRuntimeExports.jsx(FormControl,{fullLine:!0,data:{...value,name:key},rules:value.rules,name:key,value:data&&data[key],onChange:{},defaultValue:value.defaultValue||data[key]},idx+key)})})),typeLetter2==="ToChuc"&&Object.entries(formDataOrganizations2).map(([key,value],idx)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Grid,{item:!0,lg:3,md:3,children:jsxRuntimeExports.jsx(FormControl,{fullLine:!0,data:{...value,name:key},rules:value.rules,name:key,value:data&&data[key],onChange:{},defaultValue:value.defaultValue||data[key]},idx+key)})}))]}),jsxRuntimeExports.jsx(UserTable,{tableHead,arrUser,theme}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[isUyQuyen&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Grid,{lg:12,md:12,children:Object.entries(customCheckBox$1).map(([key,value],idx)=>jsxRuntimeExports.jsx(Grid,{item:!0,lg:4,md:4,children:jsxRuntimeExports.jsx(FormControl,{data:{...value,name:key},rules:value.rules,name:key,value:data&&data[key],onChange:handleChangeChecked,defaultValue:value.defaultValue||data[key]},idx+key)}))}),jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,md:12,children:Object.entries(formDataUser2).map(([key,value],idx)=>{var _a,_b;return jsxRuntimeExports.jsx(Grid,{item:!0,lg:3,md:3,children:jsxRuntimeExports.jsx(FormControl,{fullLine:!0,data:{...value,name:value.field_name,disabled:key==="soDinhDanh"&&!id&&((_a=author.thongTinCaNhan)!=null&&_a.id)?!1:(_b=author.thongTinCaNhan)==null?void 0:_b.id},rules:value.rules,name:key,value:lodashExports.get(author,value.field_name,null),onChange:handleChangeAuthor,defaultValue:value.defaultValue||author[key]},idx+key)})})})]}),isLS&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[" ",jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,md:12,children:Object.entries(luatSu2).map(([key,value],idx)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Grid,{item:!0,lg:3,md:3,children:jsxRuntimeExports.jsx(FormControl,{data:{...value,name:key},rules:value.rules,name:key,value:data&&data[key],onChange:handleChangeLS,defaultValue:value.defaultValue||data[key]},idx+key)})}))}),jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,md:12,children:Object.entries(LS2).map(([key,value],idx)=>jsxRuntimeExports.jsx(Grid,{item:!0,lg:3,md:3,children:jsxRuntimeExports.jsx(FormControl,{fullLine:!0,data:{...value,name:key},rules:value.rules,name:key,value:infoLS&&infoLS[key],onChange:handleChangeInfoLS,defaultValue:value.defaultValue||infoLS[key]},idx+key)}))})]})]})]})}),jsxRuntimeExports.jsx(ReceivingForm.ExpandForm,{ref:null,title:"ĐƠN/VỤ VIỆC",children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,children:Object.entries(formData2).map(([key,value],idx)=>jsxRuntimeExports.jsx(Grid,{item:!0,lg:4,md:4,xs:12,children:jsxRuntimeExports.jsx(FormControl,{data:{...value,name:key},rules:value.rules,name:key,fullLine:!0,value:data&&data[key],defaultValue:(value==null?void 0:value.defaultValue)||(data==null?void 0:data[key]),handleDeleteDocument},idx+key)}))}),jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,md:12,children:jsxRuntimeExports.jsx(Address,{inline:!0,value:(data==null?void 0:data.address)??iniAddress$1,wrapComponent:Grid,isRequire:!0,customProps:{item:!0,lg:4,md:4,xs:4}})})]})}),(data==null?void 0:data.tiepNhanTu)&&jsxRuntimeExports.jsx(ReceivingForm.ExpandForm,{ref:null,title:"XỬ LÝ TẠI ĐƠN VỊ CHUYỂN ĐƠN",children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(KetQuaXuLy,{donThuXuLy:data.tiepNhanTu}),jsxRuntimeExports.jsxs(Grid,{lg:12,justifyContent:"flex-end",alignItems:"end",display:"flex",gap:1,padding:2,children:[jsxRuntimeExports.jsx(Button,{type:"submit",color:"error",variant:"contained",startIcon:jsxRuntimeExports.jsx(Icon,{children:"not_interested"}),onClick:()=>{CHECK_CONFIRM("Từ chối đơn thư","Đơn thư tiếp nhận").then(value=>{value&&CHECK_SUCCESS("Thành công","Từ chối đơn thư")})},children:"Từ chối"}),jsxRuntimeExports.jsx(Button,{type:"submit",color:"primary",variant:"contained",startIcon:jsxRuntimeExports.jsx(Icon,{children:"check_circle_outline"}),onClick:()=>{CHECK_CONFIRM("Tiếp nhận đơn thư","Đơn thư tiếp nhận").then(value=>{value&&id&&(acceptLetter(id).then(()=>{}),CHECK_SUCCESS("Thành công","Từ chối đơn thư"))})},children:"Chấp nhận"})]})]})}),jsxRuntimeExports.jsx(ReceivingForm.ExpandForm,{ref:null,title:"TÀI LIỆU ĐƠN/VỤ VIỆC",children:jsxRuntimeExports.jsx(Grid,{lg:12,children:selectedFilesList.length>0&&jsxRuntimeExports.jsxs("div",{style:{padding:15,paddingTop:0},children:[jsxRuntimeExports.jsx("h4",{children:"Tài liệu đơn thư"}),jsxRuntimeExports.jsx("ul",{children:selectedFilesList.map((file,index)=>jsxRuntimeExports.jsx("li",{style:{display:"flex",alignItems:"center",marginBottom:"10px"},children:jsxRuntimeExports.jsx("span",{onClick:()=>{console.log("view")},style:{flex:1,paddingRight:10,textDecoration:"underline",cursor:"pointer",color:theme.palette.primary.main},children:file.fileName})},index))})]})})})]})]})})})}),[LS2,acceptLetter,arrUser,author,data,formData2,formDataOrganization2,formDataOrganizations2,formDataUser2,getDataById,getInitData,handleChangeAuthor,handleChangeInfoLS,id,infoLS,isLS,isUyQuyen,luatSu2,selectedFilesList,tableHead,theme,typeLetter2]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[renderFormCreate,openConfig&&jsxRuntimeExports.jsx(TransferLetter,{open:openConfig.status,id:openConfig.id,onClose:()=>{setOpenConfig(null)},data}),jsxRuntimeExports.jsx(Dialog,{fullWidth:!fullScreen,disableEnforceFocus:!0,disableAutoFocus:!0,maxWidth:"sm",onClose:()=>{setOpenSend(!1)},open:openSend,fullScreen,children:renderUserLetter})]})},"Index$3"),DetailForm=reactExports.memo(Index$3),Index$2=__name(({onClose,open,id,updateQueryState,handleReload,formDataUser:formDataUser2})=>{const[data,setData]=reactExports.useState({}),{updateDetailUser}=useDetailUser(),theme=useTheme(),fullScreen=useMediaQuery(theme.breakpoints.down("sm")),getDataById=reactExports.useCallback(async data2=>(console.log(data2),setData(data2),{...data2,province:{id:"52",code:"52",name:"Tỉnh Bình Định"},district:{id:data2.codeDiachi,code:data2.codeDiachi,name:data2.diaChi},ward:{id:data2.codeMoiO,code:data2.codeMoiO,name:data2.noiOHienTaiCode}}),[]),handleSubmit=reactExports.useCallback(dataForm=>{try{const{district,province,ward,name,diaChi,codeMoiO,codeDiachi,noiOHienTaiCode,...newDataEdit}=dataForm;CHECK_CONFIRM("Bạn có chắc muốn cập nhật người đứng đơn này không?","Cập nhật người đứng đơn").then(async res=>{res&&res.isConfirmed&&(open&&console.log(open,"open"),await updateDetailUser(open==null?void 0:open.data.id,{...newDataEdit,thuongTruCode:dataForm.ward.code,thuongTruHuyenCode:dataForm.district.code}),handleReload(),onClose(),CHECK_SUCCESS("Cập nhật thành công"),console.log(newDataEdit))})}catch{CHECK_ERROR("Cập nhật thất bại")}},[handleReload,onClose,open,updateDetailUser]),handleChangeNS=reactExports.useCallback((name,value)=>{setData(pre=>({...pre,[name]:value}))},[]),renderFormCreate=reactExports.useMemo(()=>jsxRuntimeExports.jsxs(Form,{onSubmit:handleSubmit,defaultValues:()=>open!=null&&open.data?getDataById(open==null?void 0:open.data):Promise.resolve({}),children:[jsxRuntimeExports.jsxs(Grid,{padding:1,container:!0,children:[jsxRuntimeExports.jsx(Grid,{lg:10,md:8,xl:4,xs:5,children:jsxRuntimeExports.jsx(CardHeader,{titleTypographyProps:{variant:"h6"},title:"Cập nhật người đứng đơn"})}),jsxRuntimeExports.jsx(Grid,{lg:2,item:!0,md:2,xl:2,xs:3.5,container:!0,justifyContent:"flex-end",children:jsxRuntimeExports.jsx(Grid,{alignSelf:"center",justifySelf:"center",children:jsxRuntimeExports.jsx(Button,{type:"submit",color:"success",variant:"outlined",startIcon:jsxRuntimeExports.jsx(Icon,{children:"mark_email_read"}),children:"Cập nhật"})})})]}),jsxRuntimeExports.jsx(Card,{children:jsxRuntimeExports.jsx(CardContent,{children:jsxRuntimeExports.jsxs(Grid,{container:!0,lg:12,children:[Object.entries(formDataUser2).map(([key,value],idx)=>jsxRuntimeExports.jsx(Grid,{item:!0,lg:4,md:4,sm:12,children:jsxRuntimeExports.jsx(FormControl,{data:{...value,name:key},rules:value.rules,name:key,value:data&&data[key],onChange:handleChangeNS,defaultValue:value.defaultValue||data[key]},idx+key)})),jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,md:12,children:jsxRuntimeExports.jsx(Address,{fullLine:!0,value:data.address??iniAddress$2,wrapComponent:Grid,isRequire:!0,customProps:{item:!0,lg:4,md:4,xs:4}})})]})})})]}),[data,formDataUser2,getDataById,handleChangeNS,handleSubmit,open==null?void 0:open.data]);return jsxRuntimeExports.jsx(Dialog,{fullWidth:!fullScreen,disableEnforceFocus:!0,disableAutoFocus:!0,maxWidth:"md",onClose,open:!!(open!=null&&open.status),fullScreen,children:renderFormCreate})},"Index$2"),UpdateUserForm=reactExports.memo(Index$2),XuLyTaiDonViForm=__name(()=>{const{watch}=useFormContext(),{user}=useAuth(),isChuyenDon=[80,81,82].includes(watch("dmHinhThucXuLyDonId")),formData2={dmHinhThucXuLyDonId:{field_name:"dmHinhThucXuLyDonId",title:"Hướng xử lý",type:"select-async",value_field:"id",value_label:"name",url:"/api/buss/allow/DMHinhThucXuLyDons",rules:{required:"Vui lòng nhập"}},loaiDonViNhan:{field_name:"loaiDonViNhan",title:"Đơn vị nhận",options:[{value:1,label:"Trong hệ thống"},{value:2,label:"Ngoài hệ thống"}],type:isChuyenDon?"select-custom":"hidden"},coQuanTiepNhanId:{field_name:"coQuanTiepNhanId",title:"Cơ quan tiếp nhận",url:"/api/buss/allow/Organizations",value_field:"id",value_label:"organName",rules:{required:"Vui lòng nhập"},isSearchByQuery:!0,type:!isChuyenDon||watch("loaiDonViNhan")===2?"hidden":"select-async",where:[{field:"id",expression:"ne",value:user.organizationId}]},canBoTiepNhanId:{field_name:"canBoTiepNhanId",title:"Cán bộ tiếp nhận",url:"/api/buss/allow/CanBos",value_field:"id",value_label:"hoVaTen",rules:{required:"Vui lòng nhập"},isSearchByQuery:!0,where:[{field:"organizationId",expression:"eq",value:`${watch("coQuanTiepNhanId")}`}],type:!isChuyenDon||watch("loaiDonViNhan")===2?"hidden":"select-async"},coQuanTiepNhanNgoaiHeThong:{field_name:"coQuanTiepNhanNgoaiHeThong",title:"Cơ quan tiếp nhận ngoài hệ thống",type:!isChuyenDon||watch("loaiDonViNhan")===1?"hidden":"textbox"},dmTrangThaiXuLyDonId:{field_name:"dmTrangThaiXuLyDonId",title:"Trạng thái xử lý",url:"/api/buss/allow/DMTrangThaiXuLyDons",value_field:"id",value_label:"name",rules:{required:"Vui lòng nhập"},type:"select-async"}};return jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,children:Object.entries(formData2).map(([key,value],idx)=>jsxRuntimeExports.jsx(Grid,{item:!0,lg:4,md:4,style:{display:value.type==="hidden"?"none":"block"},children:jsxRuntimeExports.jsx(FormControl,{data:{...value,name:key},rules:value.rules,name:key,fullLine:!0})},idx+key))})},"XuLyTaiDonViForm"),iniAddress={province:{id:"52",code:"52",name:"Tỉnh Bình Định"}},ThamQuyen=[{value:"Mot",label:"Cá nhân"},{value:"Nhieu",label:"Đoàn đông người"},{value:"ToChuc",label:"Cơ quan tổ chức"}],customCheckBox={coUyQuyen:{field_name:"coUyQuyen",title:"Có uỷ quyền",type:"checkbox"}},customForm={phanTheoSoNguoi:{field_name:"phanTheoSoNguoi",title:"Phân loại người đứng đơn",type:"select-custom",options:ThamQuyen}},Index$1=__name(({onClose,open,id,isEdit,handleReload,formData:formData2,formDataUser:formDataUser2,formDataOrganization:formDataOrganization2,formDataOrganizations:formDataOrganizations2,luatSu:luatSu2,LS:LS2})=>{const[data,setData]=reactExports.useState({}),{updateLetter,getListLetterById,getDocument,deleteDocument}=useDonThu(),{deleteUserLetter,postUserLetter}=useDonThuNguoiDungDon(),[arrUser,setArrUser]=reactExports.useState([]),{getListDetailUserById}=useDetailUser(),[isEdits,setIsEdit]=reactExports.useState(!1),[rowEdit,setRowEdit]=reactExports.useState({codeDiachi:"",codeMoiO:"",diaChi:"",dienThoai:"",name:"",noiOHienTaiCode:"",soDinhDanh:""}),[editingRowIndex,setEditingRowIndex]=reactExports.useState(null),[selectedFilesList,setSelectedFilesList]=reactExports.useState([]),[selectedFiles,setSelectedFiles]=reactExports.useState([]),{getAllCanBo}=useCanBo(),[listUser,setListUser]=reactExports.useState({}),[idUser,setIdUser]=reactExports.useState(),theme=useTheme(),[isUyQuyen,setIsUyQuyen]=reactExports.useState(!1),[author,setAuthor]=reactExports.useState({}),[UserLetter,setUserLetter]=reactExports.useState({}),[isLS,setIsLS]=reactExports.useState(!1),[infoLS,setInfoLS]=reactExports.useState({}),idRef=reactExports.useRef(null),[openUser,setOpenUser]=reactExports.useState(!1);useMediaQuery(theme.breakpoints.down("sm"));const refForm=reactExports.useRef(),refFormXuLyDon=reactExports.useRef(),[typeLetter2,setTypeletter]=reactExports.useState(""),{postLetterProcess}=useLetterProcess(),tableHead=[{label:"Số định danh",colSpan:1},{label:"Tên",colSpan:2},{label:"Giới tính",colSpan:1},{label:"Điện thoại",colSpan:1}],getInitData=reactExports.useCallback(()=>Promise.resolve(iniAddress),[]),handleReloads=__name(id2=>{setArrUser([]),getDataById(id2)},"handleReloads"),addUser=reactExports.useCallback(async dataForm=>{var _a;const arrDungDonThu=prepareDonThuData(dataForm,[createData(dataForm.thongTinCaNhan.gioiTinh,dataForm.thongTinCaNhan.ngayCap,dataForm.thongTinCaNhan.ngaySinh,dataForm.thongTinCaNhan.noiCap,dataForm.thongTinCaNhan.hoVaTenDem,dataForm.thongTinCaNhan.soDinhDanh,dataForm.thongTinCaNhan.ten,dataForm&&((_a=dataForm.ward)==null?void 0:_a.name),dataForm&&dataForm.district.name,dataForm.thongTinCaNhan.dienThoai,dataForm&&dataForm.ward.code,dataForm&&dataForm.district.code,idUser)]),d=idUser?{thongTinCaNhanId:idUser}:{thongTinCaNhan:{...arrDungDonThu[0].thongTinCaNhan}};CHECK_CONFIRM("Thêm người đứng đơn?","Thêm người đứng đơn").then(async res=>{if(res&&res.isConfirmed){const body={...d,donThuId:data.id};console.log(body),await postUserLetter(body),handleReloads(data.id),CHECK_SUCCESS("Cập nhật thành công"),setListUser({}),setUserLetter({}),setOpenUser(!1),setIdUser(void 0)}})},[data.id,handleReloads,idUser,postUserLetter]);reactExports.useMemo(()=>[{key:"soDinhDanh",label:"Số định danh"},{key:"name",label:"Tên",colSpan:1},{key:"diaChi",label:"Địa chỉ",colSpan:1},{key:"noiOHienTaiCode",label:"Nơi ở hiện tại",colSpan:1},{key:"dienThoai",label:"Điện thoại"}],[]);const[openConfig,setOpenConfig]=reactExports.useState({}),getDataById=reactExports.useCallback(async id2=>{var _a,_b,_c,_d,_e,_f;idRef.current=id2;try{const data2=await getListLetterById(id2,{expand:["DonThuNguoiDungDons","noiGhiNhan","noiGhiNhanHuyen","noiGhiNhanTinh","donThuCanBoTiepNhans","donThuNguoiUyQuyen"]}),getDataCanbo=await getAllCanBo({filter:`thongTinCaNhanId eq ${data2.donThuCanBoTiepNhans[0].thongTinCaNhanId}`,expand:"thongTinCaNhan"});setData(data2),setTypeletter(data2.phanTheoSoNguoi),data2&&data2.donThuNguoiDungDons&&data2.donThuNguoiDungDons.forEach(value=>{getListDetailUserById(value.thongTinCaNhanId,{expand:["thuongTruHuyen","thuongTru"]}).then(res=>{setArrUser(prev=>[...prev,createData(res.gioiTinh,res.ngayCap,res.ngaySinh,res.noiCap,res.hoVaTenDem,res.soDinhDanh,res.ten,res.thuongTruHuyen&&res.thuongTruHuyen.name,res.thuongTru&&res.thuongTru.name,res.dienThoai,res.thuongTruHuyen&&res.thuongTruHuyen.code,res.thuongTru&&res.thuongTru.code,res.id)])}).catch(err=>{console.log(err)})});let getDataCanboUyQuyen;return data2&&data2.donThuNguoiUyQuyen?(getDataCanboUyQuyen=await getListDetailUserById((_a=data2.donThuNguoiUyQuyen)==null?void 0:_a.thongTinCaNhanId,{expand:["thuongTruHuyen","thuongTru"]}),setIsUyQuyen(!0),setIsLS((_b=data2.donThuNguoiUyQuyen)==null?void 0:_b.isLuatSu)):(getDataCanboUyQuyen=void 0,setIsUyQuyen(!1),setIsLS(!1)),{...data2,province:data2.noiGhiNhanTinh,district:data2.noiGhiNhanHuyen,ward:data2.noiGhiNhan,donThuCanBoTiepNhan:getDataCanbo[0].id,coUyQuyen:!!data2.donThuNguoiUyQuyen,luatSu:(_c=data2.donThuNguoiUyQuyen)==null?void 0:_c.isLuatSu,...getDataCanboUyQuyen,soThe:(_d=data2.donThuNguoiUyQuyen)==null?void 0:_d.soThe,noiCap:(_e=data2.donThuNguoiUyQuyen)==null?void 0:_e.noiCap,ngayCapThe:(_f=data2.donThuNguoiUyQuyen)==null?void 0:_f.ngayCap}}catch{}},[getAllCanBo,getDocument,getListDetailUserById,getListLetterById]),onDeleteUser=reactExports.useCallback((row,data2)=>{CHECK_CONFIRM(`Bạn có chắc muốn xoá người đứng đơn  ${row.hoVaTenDem} ${row.ten}?`,"Xoá người đứng đơn").then(async res=>{res&&res.isConfirmed&&data2.donThuNguoiDungDons.forEach(value=>{getListDetailUserById(value.thongTinCaNhanId,{}).then(async ress=>{if(ress.soDinhDanh===row.soDinhDanh){await deleteUserLetter(data2.id,ress.id),CHECK_SUCCESS("Xoá người đứng đơn thành công!");const newArrUser=arrUser.filter(rows=>rows.soDinhDanh!==row.soDinhDanh);setArrUser(newArrUser);return}}).catch(err=>{console.log(err),CHECK_ERROR("Xoá người đứng đơn thất bại!")})})})},[arrUser,deleteUserLetter,getListDetailUserById]);reactExports.useCallback((row,data2,index)=>{setIsEdit(!0),setRowEdit(row),setEditingRowIndex(index),setOpenConfig({status:"open",data:row,id:data2.id})},[]);const handleChangeNSUser=reactExports.useCallback((name,value)=>{switch(name){case"thongTinCaNhan.soDinhDanh":const{id:id2}=value||{};id2?(setUserLetter(pre=>({...pre,canBo:{thongTinCaNhanId:id2},thongTinCaNhan:{...value,thongTinCaNhanId:id2}})),setIdUser(id2)):setUserLetter(pre=>{const data2={...pre};return lodashExports.set(data2,"thongTinCaNhan",{}),lodashExports.set(data2,name,value&&value.value),lodashExports.set(data2,"canBo.thongTinCaNhanId",id2),{...data2,thongTinCaNhanId:id2}});break;default:setUserLetter(pre=>({...pre,[name]:value}));break}},[]),{execute:excutes}=useAsync(addUser);reactExports.useMemo(()=>jsxRuntimeExports.jsx(Form,{ref:refForm,onSubmit:excutes,defaultValues:()=>getInitData(),children:jsxRuntimeExports.jsxs(CardContent,{children:[jsxRuntimeExports.jsxs(Grid,{padding:1,container:!0,children:[jsxRuntimeExports.jsx(Grid,{container:!0,lg:10,md:8,xl:4,xs:5,children:jsxRuntimeExports.jsx(CardHeader,{titleTypographyProps:{variant:"h6",fontWeight:"bold",color:"green"},title:"Người đứng đơn"})}),jsxRuntimeExports.jsx(Grid,{lg:2,item:!0,md:2,xl:2,xs:3.5,container:!0,justifyContent:"flex-end",children:jsxRuntimeExports.jsx(Grid,{alignSelf:"center",justifySelf:"center",children:jsxRuntimeExports.jsx(Button,{type:"submit",color:"success",variant:"outlined",startIcon:jsxRuntimeExports.jsx(Icon,{children:"add"}),children:"Thêm"})})})]}),jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,children:Object.entries(formDataUser2).map(([key,value],idx)=>jsxRuntimeExports.jsx(Grid,{item:!0,lg:4,md:4,sm:12,children:jsxRuntimeExports.jsx(FormControl,{fullLine:!0,data:{...value,name:value.field_name},rules:value.rules,name:value.field_name,value:lodashExports.get(UserLetter,value.field_name,null),onChange:handleChangeNSUser,defaultValue:value.defaultValue||UserLetter[value.field_name]},idx+key)}))}),jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,md:12,children:jsxRuntimeExports.jsx(Address,{value:data.address??iniAddress,wrapComponent:Grid,isRequire:!0,customProps:{item:!0,lg:4,md:4,xs:12}})})]})}),[UserLetter,data.address,excutes,formDataUser2,getInitData,handleChangeNSUser]);const handleFileChange=reactExports.useCallback(file=>{setSelectedFiles(prev=>[...prev,file])},[]);function prepareDonThuData(dataForm,users){return users.map(user=>{var _a;return{thongTinCaNhan:{soDinhDanh:user.soDinhDanh,ngayCap:"2019-01-11T07:10:10.606Z",noiCapCuThe:user.diaChi,hoVaTenDem:"Nguyễn",ten:user.name,gioiTinh:"Nam",dienThoai:user.dienThoai,thuongTruCode:user.codeDiachi,thuongTruHuyenCode:user.codeMoiO,thuongTruTinhCode:(_a=dataForm.province)==null?void 0:_a.code,cccd:user.soDinhDanh}}})}__name(prepareDonThuData,"prepareDonThuData");const handleSubmit=reactExports.useCallback(async dataForm=>{try{const{...dataEdit}=dataForm,{donThuNguoiDungDons,province,district,ward,noiGhiNhan,noiGhiNhanHuyen,donThuCanBoTiepNhans,donThuCanBoTiepNhan,coUyQuyen,DonThuXuLy:DonThuXuLy2,danTocId,email,gioiTinh,hoVaTenDem,ngayCap,noiCapCuThe,quocTichId,soDinhDanh,ten,thuongTruCuThe,dienThoai,luatSu:luatSu22,ngayCapThe,noiCap,soThe,cccd,queQuanCuThe,queQuanCode,queQuanHuyenCode,queQuanTinhCode,thuongTruCode,thuongTruHuyenCode,thuongTruTinhCode,thuongTruHuyen,thuongTru,donThuNguoiUyQuyen,noiGhiNhanTinh,id:id2,...newDataEdit}=dataEdit;if(console.log(newDataEdit,"newDataEdit"),idRef.current){CHECK_CONFIRM("Chỉnh sửa đơn thư?","Sửa đơn thư").then(async res=>{if(res&&res.isConfirmed){await updateLetter(idRef.current,{...newDataEdit,noiGhiNhanCode:dataForm.ward.code,noiGhiNhanCuThe:dataForm.ward.code,noiGhiNhanHuyenCode:dataForm.district.code}),CHECK_SUCCESS("Cập nhật thành công"),handleReload(),onClose();return}});return}}catch(error){CHECK_ERROR(error),CHECK_ERROR("Cập nhật thất bại")}},[handleReload,onClose,updateLetter]),handleChangeAuthor=reactExports.useCallback((name,value)=>{switch(name){case"thongTinCaNhan.soDinhDanh":const{id:id2}=value||{};setAuthor(id2?pre=>({...pre,canBo:{thongTinCaNhanId:id2},thongTinCaNhan:{...value,thongTinCaNhanId:id2}}):pre=>{const data2={...pre};return lodashExports.set(data2,"thongTinCaNhan",{}),lodashExports.set(data2,name,value&&value.value),lodashExports.set(data2,"canBo.thongTinCaNhanId",id2),{...data2,thongTinCaNhanId:id2}});break;default:setAuthor(pre=>({...pre,[name]:value}));break}},[]),handleChangeInfoLS=reactExports.useCallback((name,value)=>{setInfoLS(pre=>({...pre,[name]:value}))},[]),handleSubmitXuLyDon=__name(values=>{const{loaiDonViNhan,...rest}=values;postLetterProcess({...rest,donThuId:idRef.current})},"handleSubmitXuLyDon"),renderFormCreate=reactExports.useMemo(()=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Grid,{container:!0,children:[jsxRuntimeExports.jsx(Grid,{container:!0,lg:10.5,md:8,xl:5,xs:5,children:jsxRuntimeExports.jsx(CardHeader,{titleTypographyProps:{fontSize:16,fontWeight:"bold",color:theme.palette.primary.main},title:"CHỈNH SỬA XỬ LÝ GIẢI QUYẾT ĐƠN/VỤ VIỆC"})}),jsxRuntimeExports.jsx(Grid,{lg:1.5,item:!0,md:1.5,xl:3.5,xs:3.5,container:!0,justifyContent:"center",children:jsxRuntimeExports.jsx(Grid,{alignSelf:"center",justifySelf:"center",children:jsxRuntimeExports.jsx(Button,{type:"submit",color:"primary",variant:"outlined",startIcon:jsxRuntimeExports.jsx(Icon,{children:"mark_email_read"}),children:"Lưu đơn"})})})]}),jsxRuntimeExports.jsxs(Paper,{children:[jsxRuntimeExports.jsxs(Form,{onSubmit:handleSubmit,defaultValues:()=>id?getDataById(id):Promise.resolve({}),children:[jsxRuntimeExports.jsxs(ReceivingForm.ExpandForm,{ref:null,title:"NGƯỜI ĐỨNG ĐƠN VỤ VIỆC",children:[jsxRuntimeExports.jsxs(Grid,{container:!0,lg:12,md:12,children:[Object.entries(customForm).map(([key,value],idx)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Grid,{item:!0,lg:3,md:3,children:jsxRuntimeExports.jsx(FormControl,{fullLine:!0,data:{...value,name:key},rules:value.rules,name:key,value:data&&data[key],onChange:{},defaultValue:value.defaultValue||data[key]},idx+key)})})),typeLetter2==="Mot"||typeLetter2==="Nhieu"&&Object.entries(formDataOrganization2).map(([key,value],idx)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Grid,{item:!0,lg:3,md:3,children:jsxRuntimeExports.jsx(FormControl,{fullLine:!0,data:{...value,name:key},rules:value.rules,name:key,value:data&&data[key],onChange:{},defaultValue:value.defaultValue||data[key]},idx+key)})})),typeLetter2==="ToChuc"&&Object.entries(formDataOrganizations2).map(([key,value],idx)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Grid,{item:!0,lg:3,md:3,children:jsxRuntimeExports.jsx(FormControl,{fullLine:!0,data:{...value,name:key},rules:value.rules,name:key,value:data&&data[key],onChange:{},defaultValue:value.defaultValue||data[key]},idx+key)})}))]}),jsxRuntimeExports.jsxs(Grid,{alignItems:"center",container:!0,lg:12,md:12,children:[jsxRuntimeExports.jsx(Grid,{paddingX:2,paddingY:1,lg:12,md:12,children:jsxRuntimeExports.jsx("label",{style:{fontWeight:"bold"},children:"Thêm người đứng đơn"})}),jsxRuntimeExports.jsxs(Grid,{paddingX:2,paddingY:1,lg:12,md:12,children:[jsxRuntimeExports.jsx("input",{accept:".pdf, .xlsx",type:"file",multiple:!0,style:{display:"none"},id:"file-input"}),jsxRuntimeExports.jsx(Button,{onClick:()=>{setOpenUser(!0)},style:{width:"100%"},component:"label",variant:"outlined",startIcon:jsxRuntimeExports.jsx(Icon,{children:"add_outline"}),children:jsxRuntimeExports.jsx("li",{style:{listStyle:"none"},children:"Thêm người đứng đơn"})})]})]}),arrUser.length>0&&jsxRuntimeExports.jsx(UserTable,{tableHead,handleDelete:onDeleteUser,arrUser,theme,data}),isUyQuyen&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Grid,{lg:12,md:12,children:Object.entries(customCheckBox).map(([key,value],idx)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Grid,{item:!0,lg:4,md:4,children:jsxRuntimeExports.jsx(FormControl,{data:{...value,name:key},rules:value.rules,name:key,value:data&&data[key],onChange:{},defaultValue:value.defaultValue||data[key]},idx+key)})}))}),jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,md:12,children:Object.entries(formDataUser2).map(([key,value],idx)=>{var _a,_b;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Grid,{item:!0,lg:3,md:3,children:jsxRuntimeExports.jsx(FormControl,{fullLine:!0,data:{...value,name:value.field_name,disabled:key==="soDinhDanh"&&!id&&((_a=author.thongTinCaNhan)!=null&&_a.id)?!1:(_b=author.thongTinCaNhan)==null?void 0:_b.id},rules:value.rules,name:key,value:lodashExports.get(author,value.field_name,null),onChange:handleChangeAuthor,defaultValue:value.defaultValue||author[key]},idx+key)})})})})]}),isLS&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[" ",jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,md:12,children:Object.entries(luatSu2).map(([key,value],idx)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Grid,{item:!0,lg:3,md:3,children:jsxRuntimeExports.jsx(FormControl,{data:{...value,name:key},rules:value.rules,name:key,value:data&&data[key],onChange:{},defaultValue:value.defaultValue||data[key]},idx+key)})}))}),jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,md:12,children:Object.entries(LS2).map(([key,value],idx)=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Grid,{item:!0,lg:3,md:3,children:jsxRuntimeExports.jsx(FormControl,{fullLine:!0,data:{...value,name:key},rules:value.rules,name:key,value:infoLS&&infoLS[key],onChange:handleChangeInfoLS,defaultValue:value.defaultValue||infoLS[key]},idx+key)})}))})]})]}),jsxRuntimeExports.jsx(ReceivingForm.ExpandForm,{ref:null,title:"ĐƠN/VỤ VIỆC",children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,children:Object.entries(formData2).map(([key,value],idx)=>jsxRuntimeExports.jsx(Grid,{item:!0,lg:4,md:4,children:jsxRuntimeExports.jsx(FormControl,{data:{...value,name:key},rules:value.rules,name:key,fullLine:!0,value:data&&data[key],defaultValue:value.defaultValue||data[key]},idx+key)}))}),jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,md:12,children:jsxRuntimeExports.jsx(Address,{value:data.address??iniAddress,wrapComponent:Grid,isRequire:!0,inline:!0,customProps:{item:!0,lg:4,md:4,xs:4}})})]})})]}),jsxRuntimeExports.jsx(ReceivingForm.ExpandForm,{title:"XỬ LÝ TẠI ĐƠN VỊ",children:jsxRuntimeExports.jsx(Form,{ref:refFormXuLyDon,onSubmit:handleSubmitXuLyDon,defaultValues:()=>Promise.resolve({loaiDonViNhan:1}),children:jsxRuntimeExports.jsx(XuLyTaiDonViForm,{})})}),jsxRuntimeExports.jsx(ReceivingForm.ExpandForm,{ref:null,title:"TÀI LIỆU ĐƠN/VỤ VIỆC",children:jsxRuntimeExports.jsx(Grid,{container:!0,lg:12,children:selectedFilesList.length<1e4&&jsxRuntimeExports.jsxs(Grid,{alignSelf:"center",alignItems:"center",lg:12,md:12,paddingX:2,children:[jsxRuntimeExports.jsx(Grid,{lg:12,paddingY:1,md:12,children:jsxRuntimeExports.jsx("label",{style:{fontWeight:"bold"},children:"Tài liệu đính kèm"})}),jsxRuntimeExports.jsx(Paper,{sx:{width:"100%"},style:{margin:10,padding:1},elevation:3,children:jsxRuntimeExports.jsxs(Stack,{color:"blueDark",justifyContent:"center",direction:"row",alignItems:"center",children:[jsxRuntimeExports.jsx("input",{accept:".pdf, .xlsx",type:"file",multiple:!0,onChange:handleFileChange,style:{display:"none"},id:"file-input"}),jsxRuntimeExports.jsxs(Button,{component:"label",endIcon:jsxRuntimeExports.jsx(Icon,{children:"cloud_upload"}),children:[jsxRuntimeExports.jsx("li",{style:{listStyle:"none"},children:"Thêm tài liệu đính kèm"}),jsxRuntimeExports.jsx(VisuallyHiddenInput,{accept:".pdf, .xls, .xlsx",type:"file",onChange:e=>{let file=e.target.files[0];handleFileChange(file),setSelectedFilesList(prev=>[...prev,e.target.files])}})]})]})}),jsxRuntimeExports.jsx(Grid,{lg:12,md:12,children:selectedFilesList.map((file,index)=>jsxRuntimeExports.jsxs(Grid,{lg:12,md:12,style:{display:"flex",alignItems:"center",marginTop:"20px"},children:[jsxRuntimeExports.jsx("span",{onClick:()=>{console.log("view")},style:{flex:1,paddingRight:10,textDecoration:"underline",cursor:"pointer",color:theme.palette.primary.main},children:file.fileName}),jsxRuntimeExports.jsx(default_1,{style:{cursor:"pointer",color:theme.palette.error.main},onClick:()=>{CHECK_CONFIRMS("Có chắc muốn xoá  tài liệu này","Xoá tài liệu").then(res=>{res&&res.isConfirmed&&deleteDocument(file.filePath).then(res2=>{console.log(res2),getDataById(id)}).catch(err=>{console.log(err)})}),console.log(file)}})]},index))})]})})}),jsxRuntimeExports.jsx(Grid,{lg:12,container:!0,justifyContent:"end",style:{padding:"16px"},children:jsxRuntimeExports.jsx(Button,{onClick:()=>{refFormXuLyDon.current.submit()},type:"submit",color:"primary",variant:"outlined",startIcon:jsxRuntimeExports.jsx(Icon,{children:"send"}),children:"Chuyển đơn"})})]})]}),[LS2,arrUser,author,data,deleteDocument,formData2,formDataOrganization2,formDataOrganizations2,formDataUser2,getDataById,handleChangeAuthor,handleChangeInfoLS,handleFileChange,handleSubmit,id,infoLS,isLS,isUyQuyen,luatSu2,onDeleteUser,selectedFilesList,tableHead,theme,typeLetter2]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[renderFormCreate,openConfig&&jsxRuntimeExports.jsx(UpdateUserForm,{open:openConfig,id:openConfig.id,onClose:()=>{setOpenConfig(null)},handleReload:()=>{handleReload(),handleReloads(id)},formDataUser:formDataUser2,updateQueryState:()=>{}}),jsxRuntimeExports.jsx(FindUser,{onClose:()=>{setOpenUser(!1)},open:openUser,onChoose:rowData=>{var _a,_b,_c,_d;const arrDungDonThu=prepareDonThuData(rowData,[createData(rowData.gioiTinh,rowData==null?void 0:rowData.ngayCap,rowData.ngaySinh,rowData.noiCap,rowData.hoVaTenDem,rowData.soDinhDanh,rowData.ten,rowData&&((_a=rowData.ward)==null?void 0:_a.name),rowData&&((_b=rowData.district)==null?void 0:_b.name),rowData.dienThoai,rowData&&((_c=rowData.ward)==null?void 0:_c.code),rowData&&((_d=rowData.district)==null?void 0:_d.code),rowData.id)]),d=rowData.id?{thongTinCaNhanId:rowData.id}:{thongTinCaNhan:{...arrDungDonThu[0].thongTinCaNhan}};CHECK_CONFIRM("Thêm người đứng đơn?","Thêm người đứng đơn").then(async res=>{if(res&&res.isConfirmed){const body={...d,donThuId:data.id};console.log(body),await postUserLetter(body),handleReloads(data.id),CHECK_SUCCESS("Cập nhật thành công"),setListUser({}),setUserLetter({}),setOpenUser(!1),setIdUser(void 0)}})}})]})},"Index$1"),UpdateForm=reactExports.memo(Index$1),DieuKien=[{value:"DuDieuKien",label:"Đủ điều kiện"},{value:"KhongDuDieuKien",label:"Không đủ điều kiện"}],formData={dmPhanLoaiTheoNoiDungId:{field_name:"dmPhanLoaiTheoNoiDungId",title:"Loại đơn thư",type:"select-async",value_field:"id",value_label:"name",url:"/api/buss/public/DanhMuc/GetPhanTheoNoiDung",rules:{required:"Vui lòng nhập"}},donThuCanBoTiepNhan:{field_name:"donThuCanBoTiepNhan",title:"Cán bộ tiếp nhận",type:"select-async",originfield:!0,value_field:"id",value_label:"thongTinCaNhan.ten",url:"/api/buss/auth/CanBos",rules:{required:"Vui lòng nhập"},multiLabel:[{field:"thongTinCaNhan.cccd",ligature:"-",position:"start",isSearch:!0}]},soVanBan:{field_name:"soVanBan",title:"Số văn bản",type:"textbox",rules:{required:"Vui lòng nhập"}},noiDungDon:{field_name:"noiDungDon",title:"Nội dung đơn",type:"textarea"},phanTheoDieuKien:{field_name:"phanTheoDieuKien",title:"Điều kiện",type:"select-custom",options:DieuKien,rules:{required:"Vui lòng nhập"}},dmLinhVucId:{field_name:"dmLinhVucId",title:"Lĩnh vực",type:"select-async",value_field:"id",value_label:"name",url:"/api/buss/public/DanhMuc/GetLinhVuc",rules:{required:"Vui lòng nhập"}},lanThu:{field_name:"lanThu",title:"Lần thứ",type:"textbox",rules:{required:"Vui lòng nhập"}},dmLoaiHinhTiepNhanId:{field_name:"dmLoaiHinhTiepNhanId",title:"Hình thức tiếp nhận",type:"select-async",value_field:"id",value_label:"name",url:"/api/buss/public/DanhMuc/GetLoaiHinhTiepNhan",rules:{required:"Vui lòng nhập"}},DonThuXuLy:{field_name:"DonThuXuLy",title:"Cán bộ xử lý",type:"select-async",originfield:!0,value_field:"id",value_label:"thongTinCaNhan.ten",url:"/api/buss/auth/CanBos",multiLabel:[{field:"thongTinCaNhan.cccd",ligature:"-",position:"start",isSearch:!0}]}},Enums_GioiTinh=[{value:"Nam",label:"Nam"},{value:"Nu",label:"Nữ"},{value:"No",label:"Không xác định"}],formDataUser={soDinhDanh:{field_name:"thongTinCaNhan.soDinhDanh",title:"Số định danh",type:"select-creatable",rules:{required:"Vui lòng nhập",maxLength:{value:12,message:"Vui lòng nhập ít nhất 12 số"},minLength:{value:12,message:"Vui lòng nhập ít nhất 12 số"},pattern:{value:/^[0-9]*$/,message:"Phải là số"}}},hoVaTenDem:{field_name:"thongTinCaNhan.hoVaTenDem",title:"Họ và tên đệm",type:"textbox",rules:{required:"Vui lòng nhập"}},ten:{field_name:"thongTinCaNhan.ten",title:"Tên",type:"textbox",rules:{required:"Vui lòng nhập"}},email:{field_name:"thongTinCaNhan.email",title:"Email",type:"textbox",rules:{pattern:{value:/\S+@\S+\.\S+/,message:"Sai định dạng email"}}},gioiTinh:{field_name:"thongTinCaNhan.gioiTinh",title:"Giới tính",type:"select-custom",rules:{required:"Vui lòng nhập"},options:Enums_GioiTinh},ngayCap:{field_name:"thongTinCaNhan.ngayCap",title:"Ngày cấp",type:"datetime"},noiCapCuThe:{field_name:"thongTinCaNhan.noiCapCuThe",title:"Nơi cấp cụ thể",type:"textbox"},quocTichId:{field_name:"thongTinCaNhan.quocTichId",title:"Quốc tịch",type:"select-async",value_field:"id",value_label:"name",url:"/api/buss/public/DanhMuc/GetQuocGia"},danTocId:{field_name:"thongTinCaNhan.danTocId",title:"Dân tộc",type:"select-async",value_field:"id",value_label:"name",url:"/api/buss/public/DanhMuc/GetDanToc"},dienThoai:{field_name:"thongTinCaNhan.dienThoai",title:"Điện thoại",type:"textbox"},thuongTruCuThe:{field_name:"thongTinCaNhan.thuongTruCuThe",title:"Địa chỉ",type:"textbox"}},formDataUsers={hoVaTenDem:{field_name:"hoVaTenDem",title:"Họ đệm",type:"textbox"},ten:{field_name:"ten",title:"Tên",type:"textbox"},dienThoai:{field_name:"dienThoai",title:"Số điện thoại",type:"textbox"},soDinhDanh:{field_name:"soDinhDanh",title:"CCCD/CMND",type:"textbox"}},formDataSend={canBoTiepNhanId:{field_name:"canBoTiepNhanId",title:"Cán bộ tiếp nhận",type:"select-async",originfield:!0,value_field:"id",value_label:"thongTinCaNhan.ten",url:"/api/buss/auth/CanBos",rules:{required:"Vui lòng nhập"},multiLabel:[{field:"thongTinCaNhan.cccd",ligature:"-",position:"start",isSearch:!0}]},ghiChu:{field_name:"ghiChu",title:"Ghi chú",type:"textarea"}},formDataOrganization={soNguoi:{field_name:"soNguoi",title:"Số người",type:"textbox"},soNguoiDaiDien:{field_name:"soNguoiDaiDien",title:"Số người đại diện",type:"textbox"}},formDataOrganizations={tenCoQuan:{field_name:"tenCoQuan",title:"Tên cơ quan/ Tổ chức",type:"textbox"},diaChiCoQuan:{field_name:"diaChiCoQuan",title:"Địa chỉ cơ quan",type:"textbox"},sdtCoQuan:{field_name:"sdtCoQuan",title:"Số điện thoại cơ quan",type:"textbox"}},luatSu={luatSu:{field_name:"luatSu",title:"Luật sư",type:"checkbox"}},LS={soThe:{field_name:"soThe",title:"Số thẻ",type:"textbox"},ngayCapThe:{field_name:"ngayCapThe",title:"Ngày cấp",type:"datetime"},noiCap:{field_name:"noiCap",title:"Nơi cấp",type:"textbox"}},Index=__name(()=>{const tableRef=reactExports.createRef(),[openConfig,setOpenConfig]=reactExports.useState({}),[openInfo,setOpenInfo]=reactExports.useState({}),[openEdit,setOpenEdit]=reactExports.useState({}),[openAdd,setOpenAdd]=reactExports.useState({}),reloadTable=__name(()=>tableRef.current&&tableRef.current.onQueryChange(),"reloadTable"),[query,setQuery]=reactExports.useState(""),[condition,setCondition]=reactExports.useState(""),{deleteLetter,acceptLetter}=useDonThu(),updateQueryState=__name(query2=>{setQuery(query2)},"updateQueryState");return reactExports.useEffect(()=>{setCondition(query),reloadTable()},[query]),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Grid,{container:!0,children:openAdd&&openAdd.status==="open"?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Grow,{in:!!openConfig,children:jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:1,justifyContent:"left",alignItems:"center",children:[openConfig&&jsxRuntimeExports.jsx(Button,{size:"small",onClick:()=>setOpenAdd(null),startIcon:jsxRuntimeExports.jsx(Icon,{children:"undo"}),children:"Quay lại"}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsxs(Breadcrumbs,{"aria-label":"breadcrumb",children:[jsxRuntimeExports.jsx(Link,{underline:"hover",color:"inherit",href:"",children:"Tiếp nhận đơn thư"}),jsxRuntimeExports.jsx(Typography,{color:"text.primary",children:openConfig!=null&&openConfig.id?"Sửa":"Thêm mới"})]})]})}),jsxRuntimeExports.jsx(AddForm,{open:openAdd.status,id:openAdd.id,onClose:()=>{setOpenAdd(null)},formData,formDataUser,formDataUsers,handleReload:reloadTable,formDataOrganization,formDataOrganizations,luatSu,LS})]}):openEdit&&openEdit.status==="open"?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Grow,{in:!!openConfig,children:jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:1,justifyContent:"left",alignItems:"center",children:[openConfig&&jsxRuntimeExports.jsx(Button,{size:"small",onClick:()=>setOpenEdit(null),startIcon:jsxRuntimeExports.jsx(Icon,{children:"undo"}),children:"Quay lại"}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsxs(Breadcrumbs,{"aria-label":"breadcrumb",children:[jsxRuntimeExports.jsx(Link,{underline:"hover",color:"inherit",href:"",children:"Tiếp nhận đơn thư"}),jsxRuntimeExports.jsx(Typography,{color:"text.primary",children:openConfig!=null&&openConfig.id?"Sửa":"Chỉnh sửa"})]})]})}),jsxRuntimeExports.jsx(UpdateForm,{open:openEdit.status,id:openEdit.id,isEdit:!0,onClose:()=>{setOpenEdit(null)},formData,handleReload:reloadTable,formDataUser,formDataOrganization,formDataOrganizations,luatSu,LS})]}):openInfo&&openInfo.status==="open"?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Grow,{in:!!openConfig,children:jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:1,justifyContent:"left",alignItems:"center",children:[openConfig&&jsxRuntimeExports.jsx(Button,{size:"small",onClick:()=>setOpenInfo(null),startIcon:jsxRuntimeExports.jsx(Icon,{children:"undo"}),children:"Quay lại"}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsxs(Breadcrumbs,{"aria-label":"breadcrumb",children:[jsxRuntimeExports.jsx(Link,{underline:"hover",color:"inherit",href:"",children:"Tiếp nhận đơn thư"}),jsxRuntimeExports.jsx(Typography,{color:"text.primary",children:openConfig!=null&&openConfig.id?"Sửa":"Thông tin"})]})]})}),jsxRuntimeExports.jsx(DetailForm,{open:openInfo.status,id:openInfo.id,onClose:()=>{setOpenInfo(null)},formData,formDataUser,handleReload:reloadTable,formDataSend,formDataOrganization,formDataOrganizations,luatSu,LS})]}):jsxRuntimeExports.jsx(DataTable,{tableRef,isAuth:!0,url:"/buss/allow/DonThus/GetTiepNhan",title:"Đơn thư tiếp nhận",columns,selectType:"withColumns",onAdd:{onClick:()=>{setOpenAdd({status:"open"})}},onRowClick:(e,rowData)=>{setOpenInfo({status:"open",id:rowData.id})},where:condition,onActions:[dataRow=>({icon:"check_circle_outline",color:"info",tooltip:"Chấp nhận",disabled:dataRow&&dataRow.enableAdmin===!1,onClick:(event,rowData)=>{CHECK_CONFIRM("Tiếp nhận đơn thư","Đơn thư tiếp nhận").then(value=>{value&&acceptLetter(rowData.id).then(res=>{res.isSuccessed&&CHECK_SUCCESS("Thành công","Từ chối đơn thư"),CHECK_ERROR("Đã có lỗi xảy ra","Thất bại")})})}}),dataRow=>({icon:"not_interested",color:"error",tooltip:"Từ chối",disabled:dataRow&&dataRow.enableAdmin===!1,onClick:(event,rowData)=>{CHECK_CONFIRM("Từ chối đơn thư","Đơn thư tiếp nhận").then(value=>{value&&CHECK_SUCCESS("Thành công","Từ chối đơn thư")})}})]})}),openConfig&&jsxRuntimeExports.jsx(FilterForm,{open:openConfig.status,id:openConfig.id,onClose:()=>{setOpenConfig(null)},handleReload:reloadTable,updateQueryState})]})},"Index");export{Index as default,formDataUser};