????
Current Path : C:/inetpub/vhost/donthu.nextform.vn/wwwroot/assets/ |
Current File : C:/inetpub/vhost/donthu.nextform.vn/wwwroot/assets/index-Cvy8hqTd.js |
var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});import{r as reactExports,bV as useFormContext,k as jsxRuntimeExports,P as Paper,am as Grid,x as IconButton,I as Icon,ar as Typography,b6 as Divider,aG as Stack,y as Button,B as Box,bK as lodashExports,bh as CHECK_SUCCESS,F as useAuth,o as styled,cV as DonThuNguoiUyQuyen,q as Paragraph,cP as TiepDan,cQ as CHECK_REQUEST,bi as CHECK_ERROR,cR as hooks,aq as getCurrentDate,C as Card,bR as Backdrop,aH as CircularProgress,h as useTheme,bf as Grow}from"./index-y1X-EiI1.js";import{c as columns}from"./letterprocess-CVN7qOWK.js";import{k as useDonThu,E as Enums_LoaiVanBan,a as FormControl,n as Enums_GioiTinh,C as CardHeader,G as useTiepDan,H as formDataCoQuanChuyenDen,s as useDonThuNguoiDungDon,I as useDonThuNguoiUyQuyen,J as Enums_NguoiDungDon,K as formDataNguoiDungDon,L as Enums_PhanTheoSoNguoi,M as Stack$1,v as v4,u as useAsync,F as Form,y as CardActions,e as Tabs,f as Tab,z as SwipeableViews,D as DataTable}from"./DataTable-BEDH0i35.js";import{F as FindUser}from"./UpdateForm-Cut1vEQD.js";import{T as Tooltip}from"./Tooltip-C0pwvyhl.js";import{u as useLetterProcess}from"./LetterProcess.service-WE3ArG0h.js";import{L as LoadingButton}from"./LoadingButton-DgqpHLzy.js";import{C as Collapse}from"./Collapse-YEAu7S3-.js";import{B as Breadcrumbs}from"./Breadcrumbs-B7ARQx64.js";import{L as Link}from"./Link-D62DzNC-.js";import"./utils-B_XeHYak.js";import"./TableRow-BfZy-RM-.js";import"./DialogTitle-B28XGy8_.js";import"./FormGroup-CEJG6asl.js";import"./ListItemText-BvrfP19N.js";import"./Autocomplete-CpStdzj7.js";import"./Close-DnCuke95.js";import"./Popper-BN0GgV3z.js";import"./usePreviousProps-eNEUPQQG.js";import"./Chip-4iuxTgqW.js";import"./warning-BmqNoLzl.js";import"./TablePagination-Dnie0nHQ.js";import"./Toolbar-BZCdaOvb.js";import"./Badge-BUU8rl3f.js";import"./Alert-AfWalC00.js";import"./Switch-BlzK9Osj.js";import"./SwitchBase-HB81Uehs.js";import"./Checkbox-B8nePMFP.js";import"./AppBar-BrohM22l.js";const formDetailCaNhan={soDinhDanh:{field_name:"donThuNguoiUyQuyen.soDinhDanh",title:"Số định danh",type:"select-creatable",disabled:!0},email:{field_name:"donThuNguoiUyQuyen.email",title:"Email",type:"textbox",rules:{required:"Vui lòng nhập",pattern:{value:/\S+@\S+\.\S+/,message:"Sai định dạng email"}},disabled:!0},hoVaTenDem:{field_name:"donThuNguoiUyQuyen.hoVaTenDem",title:"Họ và tên đệm",type:"textbox",rules:{required:"Vui lòng nhập"},disabled:!0},ten:{field_name:"donThuNguoiUyQuyen.ten",title:"Tên",type:"textbox",rules:{required:"Vui lòng nhập"},disabled:!0},gioiTinh:{field_name:"donThuNguoiUyQuyen.gioiTinh",title:"Giới tính",type:"select-custom",rules:{required:"Vui lòng nhập"},options:Enums_GioiTinh,disabled:!0},noiCapCuThe:{field_name:"donThuNguoiUyQuyen.noiCapCuThe",title:"Nơi cấp cụ thể",type:"textbox",disabled:!0},dienThoai:{field_name:"donThuNguoiUyQuyen.dienThoai",title:"Điện thoại",type:"textbox",disabled:!0},thuongTruCuThe:{field_name:"donThuNguoiUyQuyen.thuongTruCuThe",title:"Địa chỉ",type:"textbox",disabled:!0}},formLuatSu={soThe:{field_name:"luatSu.soThe",title:"Số Thẻ",type:"textbox",rules:{required:"Vui lòng nhập"}},ngayCap:{field_name:"luatSu.ngayCap",title:"Ngày cấp",type:"datetime",rules:{required:"Vui lòng nhập"}},noiCap:{field_name:"luatSu.noiCap",title:"Nơi cấp",type:"textbox",rules:{required:"Vui lòng nhập"}},thongTinGioiThieu:{field_name:"luatSu.thongTinGioiThieu",title:"Thông tin giới thiệu",type:"textbox",rules:{required:"Vui lòng nhập"}},fileId:{field_name:"luatSu.fileId",title:"Tài liệu kèm theo",type:"file",isMulti:!0}},CollapsibleUyQuyen=__name(({})=>{const{getDocument,uploadDocument}=useDonThu(),{watch}=useFormContext();return reactExports.useCallback((name,value)=>{},[]),jsxRuntimeExports.jsxs(Paper,{sx:{width:"100%",overflow:"hidden"},children:[jsxRuntimeExports.jsxs(Grid,{container:!0,xs:12,children:[jsxRuntimeExports.jsx(Tooltip,{title:"Chi tiết ủy quyền",children:jsxRuntimeExports.jsx(IconButton,{size:"small",color:"default",children:jsxRuntimeExports.jsx(Icon,{children:"info"})})}),jsxRuntimeExports.jsx(Typography,{display:"flex",marginBottom:0,alignItems:"center",fontWeight:"bold",fontSize:15,gutterBottom:!0,component:"div",marginRight:1,children:"Chi tiết"}),jsxRuntimeExports.jsx(Divider,{orientation:"vertical",flexItem:!0})]}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsxs(Grid,{container:!0,xs:12,children:[jsxRuntimeExports.jsx(FormControl,{data:{type:"hidden",name:"donThuNguoiUyQuyen.thongTinCaNhanId"},name:"donThuNguoiUyQuyen.thongTinCaNhanId"}),Object.entries(formDetailCaNhan).map(([key,value],idx)=>{const dataFiles=key==="fileId"?{getDocument,uploadDocument,loaiVanBan:Enums_LoaiVanBan.LAWYER,typeFolder:"DonThu",fileId:watch("fileId")}:{};return jsxRuntimeExports.jsx(Grid,{item:!0,xs:6,children:jsxRuntimeExports.jsx(FormControl,{data:{...value,name:value.field_name,...dataFiles},rules:value.rules,name:value.field_name,inline:!1})})})]})]})},"CollapsibleUyQuyen"),CollapsibleLuatSu=reactExports.memo(({isLabel})=>{const{getDocument,uploadDocument}=useDonThu(),{watch}=useFormContext();return reactExports.useCallback((name,value)=>{},[]),jsxRuntimeExports.jsxs(Paper,{sx:{width:"100%",overflow:"hidden"},children:[jsxRuntimeExports.jsxs(Grid,{container:!0,xs:12,children:[jsxRuntimeExports.jsx(Tooltip,{title:"Chi tiết ủy quyền",children:jsxRuntimeExports.jsx(IconButton,{size:"small",color:"default",children:jsxRuntimeExports.jsx(Icon,{children:"info"})})}),jsxRuntimeExports.jsx(Typography,{display:"flex",marginBottom:0,alignItems:"center",fontWeight:"bold",fontSize:15,gutterBottom:!0,component:"div",marginRight:1,children:"Chi tiết luật sư"}),jsxRuntimeExports.jsx(Divider,{orientation:"vertical",flexItem:!0})]}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(Grid,{container:!0,xs:12,children:Object.entries(formLuatSu).map(([key,value],idx)=>{const dataFiles=key==="fileId"?{getDocument,uploadDocument,loaiVanBan:Enums_LoaiVanBan.LAWYER,typeFolder:"DonThu",fileId:watch("fileId")}:{};return jsxRuntimeExports.jsx(Grid,{item:!0,xs:6,children:jsxRuntimeExports.jsx(FormControl,{data:{...value,name:value.field_name,...dataFiles,disabled:isLabel},rules:value.rules,name:value.field_name,inline:!1,...key==="fileId"?{isLabel}:{}})})})})]})}),Delegacy=reactExports.memo(({isLabel,id})=>{const[open,setOpen]=reactExports.useState(!1),{watch,setValue}=useFormContext(),addButton=reactExports.useMemo(()=>!isLabel&&jsxRuntimeExports.jsx(Paper,{sx:{width:"100%"},elevation:3,children:jsxRuntimeExports.jsx(Stack,{color:"blueDark",justifyContent:"center",direction:"row",alignItems:"center",children:jsxRuntimeExports.jsx(Button,{onClick:()=>setOpen(!0),sx:{width:"100%",alignItems:"center"},startIcon:jsxRuntimeExports.jsxs(Icon,{children:[watch("donThuNguoiUyQuyen")?"change_circle":"add_circle"," "]}),children:watch("donThuNguoiUyQuyen.thongTinCaNhanId")?"Thay đổi":"Thêm thông tin người ủy quyền"})})}),[isLabel]);return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Grid,{rowGap:1,container:!0,xs:12,children:jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,children:jsxRuntimeExports.jsxs(Grid,{sx:{width:"auto"},container:!0,spacing:1,margin:1,children:[jsxRuntimeExports.jsx(Grid,{item:!0,xs:(watch("donThuNguoiUyQuyen"),2),display:"flex",alignItems:"center",children:jsxRuntimeExports.jsx(Stack,{width:"100%",direction:"row",justifyContent:"space-between",alignItems:"center",children:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsxs(Typography,{width:"auto",variant:"h6",fontSize:"inherit",children:[jsxRuntimeExports.jsx("strong",{style:{color:"darksalmon"},children:"Người được ủy quyền"}),jsxRuntimeExports.jsx("span",{style:{color:"red"},children:"*"})]})})})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:10,display:"flex",alignItems:"center",children:addButton}),watch("donThuNguoiUyQuyen.thongTinCaNhanId")&&jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,alignItems:"center",children:jsxRuntimeExports.jsx(CollapsibleUyQuyen,{})})]})})}),jsxRuntimeExports.jsx(FindUser,{onClose:()=>{setOpen(!1)},open,fieldParent:"donThuNguoiUyQuyen",onChoose:rowData=>{const uyQuyen={...rowData,thongTinCaNhanId:rowData.id,isLuatSu:watch("donThuNguoiUyQuyen.isLuatSu")};setValue("donThuNguoiUyQuyen",uyQuyen),setValue("donThuNguoiUyQuyen.soDinhDanh",{value:rowData.soDinhDanh,label:rowData.soDinhDanh}),setOpen(!1)}}),jsxRuntimeExports.jsx(FormControl,{data:{field_name:"isLuatSu",name:"isLuatSu",title:"Luật sư",type:"checkbox",labelCol:1,contentCol:10,disabled:isLabel},name:"donThuNguoiUyQuyen.isLuatSu"}),watch("donThuNguoiUyQuyen.isLuatSu")&&jsxRuntimeExports.jsx(Grid,{rowGap:1,container:!0,xs:12,children:jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,children:jsxRuntimeExports.jsx(Grid,{sx:{width:"auto"},container:!0,spacing:1,margin:1,children:jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,children:jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,display:"flex",alignItems:"center",children:jsxRuntimeExports.jsx(CollapsibleLuatSu,{isLabel})})})})})})]})}),formCoQuanGiaiQuyet={coQuanDaGiaiQuyet:{field_name:"donThuCoQuanDaGiaiQuyet.coQuanDaGiaiQuyet",title:"Cơ quan đã giải quyết",type:"textbox",rules:{required:"Vui lòng nhập"},fullLine:!0},ngayBanHanh:{field_name:"donThuCoQuanDaGiaiQuyet.ngayBanHanh",title:"Ngày ban hành",type:"datetime",rules:{required:"Vui lòng nhập"},fullLine:!0},soVanBanDaGiaiQuyet:{field_name:"donThuCoQuanDaGiaiQuyet.soVanBanDaGiaiQuyet",title:"Số văn bản",type:"textbox",rules:{required:"Vui lòng nhập"},fullLine:!0},fileId:{field_name:"donThuCoQuanDaGiaiQuyet.fileId",title:"Tài liệu kèm theo",type:"file",isMulti:!0}},formDataDonThu={dmPhanTheoNoiDungId:{field_name:"dmPhanTheoNoiDungId",title:"Phân loại đơn",type:"select-async",value_field:"id",value_label:"name",url:"/api/buss/public/DanhMuc/GetPhanTheoNoiDung",fullLine:!0,rules:{required:"Vui lòng nhập"}},dmLoaiDoiTuongId:{field_name:"dmLoaiDoiTuongId",title:"Loại đối tượng",type:"select-async",value_field:"id",value_label:"name",url:"/api/buss/allow/DMLoaiDoiTuongs",fullLine:!0},dmLinhVucId:{field_name:"dmLinhVucId",title:"Lĩnh vực",type:"select-async",value_field:"id",value_label:"name",url:"/api/buss/public/DanhMuc/GetLinhVuc",fullLine:!0},dmNhiemKyId:{field_name:"dmNhiemKyId",title:"Nhiệm kỳ",type:"select-async",value_field:"id",value_label:"name",url:"/api/buss/allow/DMNhiemKys",rules:{required:"Vui lòng nhập"},fullLine:!0,fieldValueLabel:"dmNhiemKy.name"},noiDungDon:{field_name:"noiDungDon",title:"Nội dung đơn",type:"textarea",fullLine:!0,rules:{required:"Vui lòng nhập"}},ghiChu:{field_name:"ghiChu",title:"Ghi chú",type:"textarea",fullLine:!0,rules:{required:"Vui lòng nhập"}},fileId:{field_name:"fileId",title:"Tài liệu kèm theo",type:"file",isMulti:!0}},CollapsibleCoQuanGiaiQuyet=__name(({data,onRemove})=>{const{getDocument,uploadDocument}=useDonThu(),[fileId,setFileId]=reactExports.useState(""),handleChangeNS=reactExports.useCallback((name,value)=>{},[]);return reactExports.useEffect(()=>()=>{setFileId("")},[data]),jsxRuntimeExports.jsxs(Paper,{sx:{width:"100%",overflow:"hidden"},children:[jsxRuntimeExports.jsxs(Grid,{container:!0,xs:12,children:[jsxRuntimeExports.jsx(Tooltip,{title:"Thông tin cơ quan giải quyết",children:jsxRuntimeExports.jsx(IconButton,{size:"small",color:"default",children:jsxRuntimeExports.jsx(Icon,{children:"info"})})}),jsxRuntimeExports.jsx(Typography,{display:"flex",marginBottom:0,alignItems:"center",fontWeight:"bold",fontSize:15,gutterBottom:!0,component:"div",marginRight:1,children:"Chi tiết "}),jsxRuntimeExports.jsx(Divider,{orientation:"vertical",flexItem:!0})]}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(Grid,{container:!0,xs:12,children:Object.entries(formCoQuanGiaiQuyet).map(([key,value],idx)=>{const dataFiles=key==="fileId"?{getDocument,uploadDocument,loaiVanBan:Enums_LoaiVanBan.ORGAN_RESOLVED,typeFolder:"DonThu",fileId}:{};return jsxRuntimeExports.jsx(Grid,{item:!0,xs:idx<=2?4:6,children:jsxRuntimeExports.jsx(FormControl,{data:{...value,name:value.field_name,...dataFiles},rules:value.rules,name:value.field_name,value:lodashExports.get(data,value.field_name,null),onChange:handleChangeNS,inline:!1,defaultValue:value.defaultValue||lodashExports.get(data,value.field_name,null)})})})})]})},"CollapsibleCoQuanGiaiQuyet"),DonForm=reactExports.memo(reactExports.forwardRef(({id},ref)=>{const[donThu,setDonThu]=reactExports.useState({}),[isCoQuanGiaiQuyet,setIsCoQuanGiaiQuyet]=reactExports.useState(!1),{uploadDocument,getDocument,updateLetter}=useDonThu(),{watch}=useFormContext(),[isUpdate,setIsUpdate]=reactExports.useState(!1),{getValues}=useFormContext(),handleEdit=reactExports.useCallback(async()=>{try{const tiepDan=getValues(),dataForm={};Object.entries({...formDataDonThu,donThuCoQuanGiaiQuyet:""}).forEach(([key,value])=>{dataForm[key]=lodashExports.get(tiepDan,key)}),delete dataForm.fileId,delete dataForm.ghiChu,id&&await updateLetter(id,dataForm),CHECK_SUCCESS("Cập nhật thành công"),setIsUpdate(!1)}catch{}},[id]);return reactExports.useImperativeHandle(ref,()=>({enableEdit:statusEdit=>{setIsUpdate(statusEdit===StatusEdit.EDIT)},handleEdit}),[]),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Grid,{rowGap:0,container:!0,xs:12,children:[Object.entries(formDataDonThu).map(([key,value],idx,arr)=>idx<4?jsxRuntimeExports.jsx(Grid,{item:!0,xs:3,display:value.field_name==="dmLoaiDoiTuongId"&&(!watch("dmPhanTheoNoiDungId")||![29,30].includes(parseInt(watch("dmPhanTheoNoiDungId"))))?"none":"block",children:jsxRuntimeExports.jsx(FormControl,{data:{...value,name:value.field_name,where:value.field_name==="dmLoaiDoiTuongId"?[{field:"dmPhanTheoNoiDungId",expression:"eq",value:watch("dmPhanTheoNoiDungId")}]:null},rules:value.rules,name:value.field_name,isLabel:id&&!isUpdate,hidden:value.field_name==="dmLoaiDoiTuongId"&&(!watch("dmPhanTheoNoiDungId")||![29,30].includes(parseInt(watch("dmPhanTheoNoiDungId"))))},idx+key)},idx+3+key):jsxRuntimeExports.jsx(reactExports.Fragment,{},idx+3+key)),jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,children:jsxRuntimeExports.jsx(FormControl,{data:{...formDataDonThu.noiDungDon,name:formDataDonThu.noiDungDon.field_name},rules:formDataDonThu.noiDungDon.rules,name:formDataDonThu.noiDungDon.field_name,isLabel:id&&!isUpdate})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:6,children:jsxRuntimeExports.jsx(FormControl,{data:{...formDataDonThu.fileId,name:formDataDonThu.fileId.field_name,getDocument,uploadDocument,loaiVanBan:Enums_LoaiVanBan.ATTACH,typeFolder:"DonThu",fileId:watch("fileId"),notChangeValue:!0},rules:formDataDonThu.fileId,name:formDataDonThu.fileId.field_name,isLabel:id&&!isUpdate})}),jsxRuntimeExports.jsxs(Grid,{item:!0,xs:12,children:[jsxRuntimeExports.jsx(FormControl,{data:{field_name:"donThuCoQuanDaGiaiQuyet.isCoQuanDaGiaiQuyet",title:"Thông tin cơ quan đã giải quyết",type:"checkbox",labelCol:3,contentCol:9},name:"donThuCoQuanDaGiaiQuyet.isCoQuanDaGiaiQuyet"}),watch("donThuCoQuanDaGiaiQuyet.isCoQuanDaGiaiQuyet")&&jsxRuntimeExports.jsx(Grid,{container:!0,xs:12,children:jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,children:jsxRuntimeExports.jsx(Grid,{sx:{width:"auto"},container:!0,spacing:1,margin:1,children:jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,children:jsxRuntimeExports.jsx(CollapsibleCoQuanGiaiQuyet,{data:donThu,onRemove:dataRemove=>{setIsCoQuanGiaiQuyet(!1)},isCoQuanGiaiQuyet:!0})})})})})]})]})})})),formDataXuLy={dmHinhThucXuLyDonId:{field_name:"donThuXuLy.dmHinhThucXuLyDonId",title:"Hướng xử lý",type:"select-async",value_field:"id",value_label:"name",url:"/api/buss/public/DanhMuc/GetHinhThucXuLyDon",rules:{required:"Vui lòng nhập"},fullLine:!0},loaiDonViNhan:{field_name:"donThuXuLy.loaiDonViNhan",title:"Loại đơn vị nhận",options:[{value:1,label:"Trong hệ thống"},{value:2,label:"Ngoài hệ thống"}],type:"select-custom",fullLine:!0},coQuanTiepNhanId:{field_name:"donThuXuLy.coQuanTiepNhanId",title:"Cơ quan tiếp nhận",type:"select-async",url:"/api/buss/allow/Organizations",value_field:"id",value_label:"organName",rules:{required:"Vui lòng nhập"},isSearchByQuery:!0,fullLine:!0},canBoTiepNhanId:{field_name:"donThuXuLy.canBoTiepNhanId",title:"Cán bộ tiếp nhận",type:"select-async",url:"/api/buss/allow/CanBos/getNonOrgan",value_field:"id",value_label:"hoVaTen",rules:{required:"Vui lòng nhập"},isSearchByQuery:!0,fullLine:!0},coQuanTiepNhanNgoaiHeThong:{field_name:"donThuXuLy.coQuanTiepNhanNgoaiHeThong",title:"Cơ quan tiếp nhận ngoài hệ thống",type:"textbox",fullLine:!0},dmTrangThaiXuLyDonId:{field_name:"donThuXuLy.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",fullLine:!0},fileId:{field_name:"donThuXuLy.fileId",title:"Tài liệu kèm theo",type:"file",isMulti:!0,fullLine:!0},yKienXuLy:{field_name:"donThuXuLy.yKienXuLy",title:"Ý kiến xử lý",type:"textarea",fullLine:!0,rules:{required:"Vui lòng nhập"}},id:{field_name:"donThuXuLy.id",type:"hidden"}},ProcessForm=reactExports.memo(reactExports.forwardRef(({id},ref)=>{const{getDocument,uploadDocument,updateLetterProcess}=useLetterProcess(),{watch}=useFormContext(),[isUpdate,setIsUpdate]=reactExports.useState(!1),{getValues}=useFormContext(),isChuyenDon=[3,4,5].includes(watch("donThuXuLy.dmHinhThucXuLyDonId")),{user}=useAuth(),handleEdit=reactExports.useCallback(async()=>{try{const data=getValues(),{id:id2,...dataForm}={...data.donThuXuLy};delete dataForm.loaiDonViNhan,delete dataForm.id,id2&&await updateLetterProcess(id2,dataForm),CHECK_SUCCESS("Cập nhật thành công"),setIsUpdate(!1)}catch{}},[]);reactExports.useImperativeHandle(ref,()=>({enableEdit:statusEdit=>{setIsUpdate(statusEdit===StatusEdit.EDIT)},handleEdit}),[]);const checkHidden=reactExports.useCallback(name=>{let hidden=!1;switch(name){case"donThuXuLy.coQuanTiepNhanId":case"donThuXuLy.canBoTiepNhanId":hidden=!isChuyenDon||watch("donThuXuLy.loaiDonViNhan")!==1;break;case"donThuXuLy.coQuanTiepNhanNgoaiHeThong":hidden=!isChuyenDon||watch("donThuXuLy.loaiDonViNhan")!==2;break;case"donThuXuLy.loaiDonViNhan":hidden=!isChuyenDon}return hidden},[watch,isChuyenDon]),checkConditions=reactExports.useCallback(name=>{let where=[];switch(name){case"donThuXuLy.canBoTiepNhanId":where=[{field:"organizationId",expression:"eq",value:`${watch("donThuXuLy.coQuanTiepNhanId")}`}];break;case"donThuXuLy.coQuanTiepNhanId":where=[{field:"id",expression:"ne",value:user.organizationId}];break}return where},[watch,isChuyenDon,user]);return jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Grid,{rowGap:0,container:!0,xs:12,children:[jsxRuntimeExports.jsx(FormControl,{data:{...formDataXuLy.id,name:formDataXuLy.id.field_name},name:formDataXuLy.id.field_name,isLabel:id&&!isUpdate}),Object.entries(formDataXuLy).map(([key,value],idx,arr)=>{const hidden=checkHidden(value.field_name),where=checkConditions(value.field_name);return["fileId","yKienXuLy","id"].includes(key)?jsxRuntimeExports.jsx(reactExports.Fragment,{},idx+key):jsxRuntimeExports.jsx(Grid,{item:!0,xs:4,id:value.field_name,display:hidden?"none":"block",children:jsxRuntimeExports.jsx(FormControl,{data:{...value,name:value.field_name,where},rules:value.rules,name:value.field_name,isLabel:id&&!isUpdate,hidden},idx+key)},idx+key)}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:4,children:jsxRuntimeExports.jsx(FormControl,{data:{...formDataXuLy.fileId,name:formDataXuLy.fileId.field_name,getDocument,uploadDocument,loaiVanBan:Enums_LoaiVanBan.ORGAN_RESOLVED,typeFolder:"DonThu",fileId:watch("donThuXuLy.fileId"),notChangeValue:!0},rules:formDataXuLy.fileId,name:formDataXuLy.fileId.field_name,isLabel:id&&!isUpdate})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,children:jsxRuntimeExports.jsx(FormControl,{data:{...formDataXuLy.yKienXuLy,name:formDataXuLy.yKienXuLy.field_name},rules:formDataXuLy.yKienXuLy.rules,name:formDataXuLy.yKienXuLy.field_name,isLabel:id&&!isUpdate})})]})})})),ExpandMore=styled(props=>{const{expand,...other}=props;return jsxRuntimeExports.jsx(IconButton,{...other})})(({theme,expand})=>({transform:expand?"rotate(0deg)":"rotate(180deg)",marginLeft:"auto",transition:theme.transitions.create("transform",{duration:theme.transitions.duration.shortest})})),CardHeaderCustom=styled(CardHeader)(({theme})=>({"& .MuiCardHeader-title":{color:"#1976d2",fontSize:"small",fontWeight:"500",padding:0},padding:5})),ThongTinChungForm=reactExports.memo(reactExports.forwardRef(({id},ref)=>{const[isUpdate,setIsUpdate]=reactExports.useState(!1),{getValues}=useFormContext(),{updateReceivingCitizens}=useTiepDan(),{updateLetter}=useDonThu(),handleEdit=reactExports.useCallback(async()=>{try{const tiepDan=getValues("tiepDan"),dataForm={};Object.entries(formDataThongTinChung).forEach(([key,value])=>{dataForm[key]=lodashExports.get(tiepDan,key)});const{dmNhiemKyId,...tiepDanData}=dataForm;tiepDan!=null&&tiepDan.id&&await updateReceivingCitizens(tiepDan==null?void 0:tiepDan.id,tiepDanData),id&&await updateLetter(id,{dmNhiemKyId}),CHECK_SUCCESS("Cập nhật thành công"),setIsUpdate(!1)}catch{}},[id]);return reactExports.useImperativeHandle(ref,()=>({enableEdit:statusEdit=>{setIsUpdate(statusEdit==="EDIT")},handleEdit}),[]),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(Grid,{rowGap:1,container:!0,xs:12,children:Object.entries(formDataCoQuanChuyenDen).map(([key,value],idx,arr)=>jsxRuntimeExports.jsx(Grid,{item:!0,xs:4,children:jsxRuntimeExports.jsx(FormControl,{data:{...value,name:value.field_name},rules:value.rules,name:value.field_name,isLabel:id&&!isUpdate},idx+key)},idx+3+key))})})})),NguoiDungDonForm=reactExports.memo(reactExports.forwardRef(({id},ref)=>{const[isUpdate,setIsUpdate]=reactExports.useState(!1),{watch,getValues}=useFormContext(),{updateLetter}=useDonThu(),{postUserLetter}=useDonThuNguoiDungDon(),{updateNguoiUyQuyen}=useDonThuNguoiUyQuyen(),handleChangeNS=reactExports.useCallback(async(name,value)=>{if(id)try{console.log(name,value);const nguoiDaiDien={thongTinCaNhanId:value.slice(-1)[0].thongTinCaNhan.id,loai:name==="nguoiDaiDien"?Enums_NguoiDungDon.DUNGDON:Enums_NguoiDungDon.DICUNG,donThuId:id};await postUserLetter(nguoiDaiDien)}catch{}},[id]),handleEdit=reactExports.useCallback(async()=>{try{const dataForm={};Object.entries({...formDataNguoiDungDon,donThuNguoiUyQuyen:"",luatSu:""}).forEach(([key,value])=>{dataForm[key]=lodashExports.get(getValues(),key)});const{donThuNguoiUyQuyen,luatSu,...donThu}=dataForm;console.log(dataForm),delete luatSu.fileId;let nguoiUyQuyen={};donThuNguoiUyQuyen&&(nguoiUyQuyen=new DonThuNguoiUyQuyen({thongTinCaNhanId:donThuNguoiUyQuyen.thongTinCaNhanId,...luatSu,isLuatSu:donThuNguoiUyQuyen.isLuatSu})),delete nguoiUyQuyen.fileId,delete nguoiUyQuyen.donThuId,delete nguoiUyQuyen.id;const donThuSave={phanTheoSoNguoi:donThu.phanTheoSoNguoi,soNguoi:donThu.soNguoi,soNguoiDaiDien:donThu.soNguoiDaiDien};console.log(nguoiUyQuyen,donThuSave),id&&(await updateLetter(id,donThuSave),await updateNguoiUyQuyen(id,nguoiUyQuyen)),setIsUpdate(!1)}catch{}},[id]);reactExports.useImperativeHandle(ref,()=>({enableEdit:statusEdit=>{setIsUpdate(statusEdit==="EDIT")},handleEdit}),[]);const layout=reactExports.useCallback(phanTheoSoNguoi=>{switch(phanTheoSoNguoi){case"0":case"1":return 4;default:return 3}},[]);return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Grid,{rowGap:1,container:!0,xs:12,children:Object.entries(formDataNguoiDungDon).map(([key,value],idx,arr)=>{const formatLayout=layout(watch("phanTheoSoNguoi"));return idx===0||watch("phanTheoSoNguoi")===value.group?jsxRuntimeExports.jsx(Grid,{item:!0,xs:formatLayout,children:jsxRuntimeExports.jsx(FormControl,{data:{...value,name:value.field_name},rules:value.rules,name:value.field_name,isLabel:id&&!isUpdate},idx+key)},idx+3+key):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})})}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(FormControl,{data:formDataNguoiDungDon.nguoiDaiDien,name:formDataNguoiDungDon.nguoiDaiDien.field_name,isLabel:id&&!isUpdate,enableSaveSingle:id,onChange:handleChangeNS}),watch("phanTheoSoNguoi")===Enums_PhanTheoSoNguoi[1].value&&jsxRuntimeExports.jsx(FormControl,{data:formDataNguoiDungDon.nguoiDiCung,name:formDataNguoiDungDon.nguoiDiCung.field_name,isLabel:id&&!isUpdate,onChange:handleChangeNS,enableSaveSingle:id}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(FormControl,{data:{...formDataNguoiDungDon.uyQuyen,name:"uyQuyen",disabled:id&&!isUpdate},name:"uyQuyen"}),watch("uyQuyen")&&jsxRuntimeExports.jsx(Delegacy,{id,isLabel:!!(id&&!isUpdate)})]})}));var StatusEdit=(StatusEdit2=>(StatusEdit2.EDIT="EDIT",StatusEdit2.SEEN="SEEN",StatusEdit2))(StatusEdit||{});const ExpandForm=reactExports.memo(reactExports.forwardRef(({children,title,id,enableEdit=!0,titleEdit="Chỉnh sửa"},ref)=>{const[expanded,setExpanded]=reactExports.useState(!0),[status,setStatus]=reactExports.useState("SEEN"),[statusSaveForm,setStatusSaveForm]=reactExports.useState("idle"),refChild=reactExports.useRef();reactExports.useEffect(()=>{id&&setStatus("SEEN")},[id]);const handleExpandClick=reactExports.useCallback(()=>{setExpanded(pre=>!pre)},[]);reactExports.useImperativeHandle(ref,()=>({handleExpandClick}),[handleExpandClick]);const childWithProps=reactExports.isValidElement(children)?reactExports.cloneElement(children,{ref:refChild,id}):children,handleSaveUpdate=reactExports.useCallback(async()=>{try{setStatusSaveForm("pending"),await refChild.current.handleEdit(),setStatus("SEEN"),setStatusSaveForm("success")}catch{}},[]);return jsxRuntimeExports.jsxs(Box,{marginBottom:1,borderRadius:"0.5rem",bgcolor:"white",boxShadow:"0px 5px 5px -3px rgba(0, 0, 0, 0.06), 0px 0px 0px 1px rgba(0, 0, 0, 0.042), 0px 3px 14px 2px rgba(0, 0, 0, 0.036)",children:[jsxRuntimeExports.jsx(CardHeaderCustom,{title:jsxRuntimeExports.jsxs(Stack$1,{direction:"row",justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Stack$1,{alignItems:"center",direction:"row",justifyContent:"flex-start",children:[jsxRuntimeExports.jsx(ExpandMore,{expand:expanded,onClick:handleExpandClick,"aria-label":"show more",children:jsxRuntimeExports.jsx(Icon,{children:"expand_more"})}),jsxRuntimeExports.jsx(Paragraph,{children:title})]}),id&&enableEdit&&jsxRuntimeExports.jsxs(Stack$1,{alignItems:"center",direction:"row",justifyContent:"flex-start",children:[status==="SEEN"&&jsxRuntimeExports.jsx(Button,{size:"small",onClick:()=>{setExpanded(!0),refChild.current.enableEdit("EDIT"),setStatus("EDIT")},variant:"outlined",startIcon:jsxRuntimeExports.jsx(Icon,{children:"edit"}),children:titleEdit}),status==="EDIT"&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:statusSaveForm==="pending"?jsxRuntimeExports.jsx(LoadingButton,{loading:!0,loadingPosition:"start",color:"success",startIcon:jsxRuntimeExports.jsx(Icon,{children:"save"}),variant:"outlined",children:"Lưu"}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{variant:"outlined",size:"small",onClick:handleSaveUpdate,startIcon:jsxRuntimeExports.jsx(Icon,{children:"save"}),color:"success",children:"Lưu"}),jsxRuntimeExports.jsx(Button,{variant:"outlined",size:"small",color:"error",onClick:()=>{refChild.current.enableEdit("SEEN"),setStatus("SEEN")},startIcon:jsxRuntimeExports.jsx(Icon,{children:"cancel"}),children:"Hủy"})]})})]})]})}),jsxRuntimeExports.jsx(Collapse,{in:expanded,timeout:"auto",children:childWithProps})]})})),Index$2=__name(({id,onClose})=>{const{postLetter,getXuLyByDonThu}=useDonThu(),{getBienNhan}=useTiepDan(),refForm=reactExports.useRef(),refExpand=reactExports.useRef(),getDataById=reactExports.useCallback(async id2=>{try{let{donThuNguoiUyQuyen,tiepDan,donThuNguoiDungDons,phanTheoSoNguoi,soNguoi,soNguoiDaiDien,noiDungDon,tiepNhanTu,donThuXuLys,...data}=await getXuLyByDonThu(id2),defaultVal={DICUNG:[],DUNGDON:[]},groupNguoiDungDon={DICUNG:[],DUNGDON:[]};donThuNguoiDungDons&&(groupNguoiDungDon=donThuNguoiDungDons==null?void 0:donThuNguoiDungDons.reduce((preVal,currentVal)=>{switch(currentVal.loai){case Enums_NguoiDungDon.DUNGDON:preVal.DUNGDON.push(currentVal);break;default:preVal.DICUNG.push(currentVal);break}return preVal},defaultVal));let luatSu={};if(donThuNguoiUyQuyen){const{thongTinCaNhan,...nguoiUyQuyen}=donThuNguoiUyQuyen;if(donThuNguoiUyQuyen={...nguoiUyQuyen,...thongTinCaNhan,soDinhDanh:{value:donThuNguoiUyQuyen.thongTinCaNhan.soDinhDanh,label:donThuNguoiUyQuyen.thongTinCaNhan.soDinhDanh}},donThuNguoiUyQuyen!=null&&donThuNguoiUyQuyen.isLuatSu){const{ngayCap,noiCap,soThe,thongTinGioiThieu}=donThuNguoiUyQuyen;luatSu={ngayCap,noiCap,soThe,thongTinGioiThieu}}}const{ngayTiepNhan,ngayXuLy,dmHinhThucXuLyDon,dmTrangThaiXuLyDon,coQuanTiepNhan,canBoTiepNhan}=tiepNhanTu||{},donThuXuLy=donThuXuLys[0]||{},dataForm={id:id2,coQuanGiaiQuyet:"",dmLinhVucId:data.dmLinhVucId,dmPhanTheoNoiDungId:data.dmPhanTheoNoiDungId,fileId:data.fileId,nguoiDaiDien:groupNguoiDungDon.DUNGDON.map(cur=>({...cur,thongTinCaNhan:{...cur.thongTinCaNhan,soDinhDanh:{value:cur.thongTinCaNhan.soDinhDanh,label:cur.thongTinCaNhan.soDinhDanh+" - "+cur.hoVaTen}}})),nguoiDiCung:groupNguoiDungDon.DICUNG.map(cur=>({...cur,thongTinCaNhan:{...cur.thongTinCaNhan,soDinhDanh:{value:cur.thongTinCaNhan.soDinhDanh,label:cur.thongTinCaNhan.soDinhDanh+" - "+cur.hoVaTen}}})),donThuNguoiUyQuyen,luatSu,noiDungDon,phanTheoSoNguoi,soNguoi,soNguoiDaiDien,tiepDan,dmNhiemKyId:data.dmNhiemKyId,uyQuyen:!!donThuNguoiUyQuyen,tiepNhanTu:{ngayTiepNhan,ngayXuLy,hinhThucXuLyDon:dmHinhThucXuLyDon==null?void 0:dmHinhThucXuLyDon.name,trangThaiXuLyDon:dmTrangThaiXuLyDon==null?void 0:dmTrangThaiXuLyDon.name,coQuanTiepNhan:coQuanTiepNhan==null?void 0:coQuanTiepNhan.organName,diaChi:coQuanTiepNhan==null?void 0:coQuanTiepNhan.diaChi,canBoTiepNhan:canBoTiepNhan==null?void 0:canBoTiepNhan.hoVaTen},donThuXuLy:{loaiDonViNhan:donThuXuLy.loaiDonViNhan||1,fileId:donThuXuLy.fileId||v4(),id:donThuXuLy.id,dmHinhThucXuLyDonId:donThuXuLy.dmHinhThucXuLyDonId,coQuanTiepNhanId:donThuXuLy.coQuanTiepNhanId,canBoTiepNhanId:donThuXuLy.canBoTiepNhanId,coQuanTiepNhanNgoaiHeThong:donThuXuLy.coQuanTiepNhanNgoaiHeThong,dmTrangThaiXuLyDonId:donThuXuLy.dmTrangThaiXuLyDonId,yKienXuLy:donThuXuLy.yKienXuLy}};return console.log(dataForm),dataForm}catch(error){console.log(error)}},[]),handleSubmit=reactExports.useCallback(async dataForm=>{var _a,_b;try{let{nguoiDaiDien,nguoiDiCung,donThuNguoiUyQuyen,tiepDan,luatSu,fileId,donThuCoQuanDaGiaiQuyet,...donThu}=dataForm;if(id)console.log(dataForm);else{console.log(dataForm);const donThuNguoiDungDons=[];let nguoiUyQuyen={};donThuNguoiUyQuyen&&(nguoiUyQuyen=new DonThuNguoiUyQuyen({thongTinCaNhanId:donThuNguoiUyQuyen.thongTinCaNhanId,...luatSu,isLuatSu:donThuNguoiUyQuyen.isLuatSu})),nguoiDaiDien&&nguoiDaiDien.forEach(u=>donThuNguoiDungDons.push({thongTinCaNhanId:u.thongTinCaNhan.id,loai:Enums_NguoiDungDon.DUNGDON})),nguoiDiCung&&nguoiDiCung.forEach(u=>donThuNguoiDungDons.push({thongTinCaNhanId:u.thongTinCaNhan.id,loai:Enums_NguoiDungDon.DICUNG}));const{dmNhiemKyId,...dataTiepDan}=tiepDan;delete donThu.uyQuyen,delete donThu.coQuanGiaiQuyet,delete donThu.fileId,delete nguoiUyQuyen.fileId;const tiepDanSave=new TiepDan({...dataTiepDan,dmHinhThucTiepDanId:1});delete donThuCoQuanDaGiaiQuyet.isCoQuanDaGiaiQuyet;const donThuSave={donThuNguoiDungDons,donThuNguoiUyQuyen:nguoiUyQuyen,fileId,tiepDan:tiepDanSave,...donThu,dmNhiemKyId,dmLoaiHinhTiepNhanId:2,thoiGianTiepNhan:(_a=tiepDanSave.tiepDanXuLy)==null?void 0:_a.ngayXuLy,donThuXuLys:[{ngayTiepNhan:(_b=tiepDanSave.tiepDanXuLy)==null?void 0:_b.ngayXuLy}]},{resultObj}=await postLetter(donThuSave);CHECK_REQUEST("Lưu Thành công! Xuất giấy biên nhận?","Thông báo","Giấy biên nhận",()=>getBienNhan(resultObj.tiepDanId)).then(async()=>{onClose(),console.log("Thành công")}),Promise.resolve(resultObj)}}catch(error){CHECK_ERROR(error)}},[onClose]),{execute:submitForm,status:statusSubmit}=useAsync(handleSubmit),{execute,status}=useAsync(getDataById),getInitData=reactExports.useCallback(()=>{const currentDate=hooks(),iniData={fileId:v4(),phanTheoSoNguoi:"Mot",tiepDan:{ngayTiepDan:getCurrentDate({}).format(),ngayHenTra:getCurrentDate({date:currentDate.clone().add(10,"days")}).format(),fileId:v4(),tiepDanXuLy:{ngayXuLy:getCurrentDate({}).format()}}};return Promise.resolve(iniData)},[]);return jsxRuntimeExports.jsx(Form,{ref:refForm,onSubmit:submitForm,defaultValues:()=>id?execute(id):getInitData(),children:jsxRuntimeExports.jsxs(Card,{sx:{background:"transparent",borderRadius:"0.5rem",boxShadow:"none !important",padding:"0.2rem"},children:[jsxRuntimeExports.jsx(Backdrop,{sx:{color:"#fff",zIndex:theme=>theme.zIndex.drawer+1},open:status==="pending"||statusSubmit==="pending",children:jsxRuntimeExports.jsx(CircularProgress,{color:"inherit"})}),jsxRuntimeExports.jsx(ExpandForm,{id,ref:refExpand,titleEdit:"Cập nhật xử lý",title:"Xử lý tại đơn vị",children:jsxRuntimeExports.jsx(ProcessForm,{})}),jsxRuntimeExports.jsx(ExpandForm,{id,enableEdit:!1,ref:refExpand,title:"Cơ quan chuyển đến",children:jsxRuntimeExports.jsx(ThongTinChungForm,{})}),jsxRuntimeExports.jsx(ExpandForm,{id,enableEdit:!1,ref:refExpand,title:"Người đứng đơn",children:jsxRuntimeExports.jsx(NguoiDungDonForm,{})}),jsxRuntimeExports.jsx(ExpandForm,{id,enableEdit:!1,ref:refExpand,title:"Đơn / Vụ việc",children:jsxRuntimeExports.jsx(DonForm,{})}),jsxRuntimeExports.jsxs(CardActions,{children:[jsxRuntimeExports.jsx(Stack$1,{direction:"row",justifyContent:"end",spacing:2}),jsxRuntimeExports.jsx(Button,{size:"small",color:"error",startIcon:jsxRuntimeExports.jsx(Icon,{children:"cancel"}),onClick:onClose,disabled:!1,children:"Hủy"}),jsxRuntimeExports.jsx(Button,{size:"small",type:"button",onClick:()=>{refForm.current.submit()},variant:"outlined",startIcon:status==="pending"?jsxRuntimeExports.jsx(CircularProgress,{size:20}):jsxRuntimeExports.jsx(Icon,{children:"save"}),disabled:status==="pending",children:"Lưu"})]})]})})},"Index$2"),LetterForm=reactExports.memo(Index$2),DetailForm=Object.assign(LetterForm,{ExpandMore,ExpandForm,ThongTinChungForm,NguoiDungDonForm}),CustomTabPanel=__name(props=>{const{children,value,index,...other}=props;return jsxRuntimeExports.jsx("div",{role:"tabpanel",style:{display:value===index?"block":"none"},id:`simple-tabpanel-${index}`,"aria-labelledby":`simple-tab-${index}`,...other,children:jsxRuntimeExports.jsx(Box,{sx:{padding:"2px"},children:jsxRuntimeExports.jsx(Typography,{children})})})},"CustomTabPanel");function a11yProps(index){return{id:`full-width-tab-${index}`,"aria-controls":`full-width-tabpanel-${index}`}}__name(a11yProps,"a11yProps");const Index$1=__name(({donThu,onClose})=>{const theme=useTheme(),[value,setValue]=reactExports.useState(0);reactExports.useEffect(()=>{donThu&&donThu.isTuChoi&&setValue(1)},[]);const handleChange=__name((event,newValue)=>{setValue(newValue)},"handleChange"),handleChangeIndex=__name(index=>{setValue(index)},"handleChangeIndex");return jsxRuntimeExports.jsxs(Box,{sx:{width:"100%"},children:[jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",justifyContent:"space-between",sx:{borderBottom:1,borderColor:"divider"},children:[jsxRuntimeExports.jsxs(Stack,{gap:1,direction:"row",alignItems:"center",justifyContent:"left",children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",fontWeight:"bold",children:"Thông tin đơn thư"}),jsxRuntimeExports.jsx(Divider,{orientation:"vertical",flexItem:!0}),jsxRuntimeExports.jsx(Typography,{variant:"body1",fontWeight:"bold",children:"Ngày tạo:"}),jsxRuntimeExports.jsx(Typography,{variant:"body1",fontWeight:"normal",color:"blueviolet",children:hooks((donThu==null?void 0:donThu.ngayTiepDan)||new Date,"YYYY-MM-DD HH:mm","Asia/Ho_Chi_Minh").format("YYYY-MM-DD HH:mm")})]}),jsxRuntimeExports.jsx(Tabs,{style:{minHeight:"40px"},value,onChange:handleChange,"aria-label":"basic tabs example",children:jsxRuntimeExports.jsx(Tab,{iconPosition:"start",icon:jsxRuntimeExports.jsx(Icon,{children:"contact_mail"}),sx:{fontSize:"0.8rem",padding:"6px",minHeight:"auto"},label:"Đơn thư",...a11yProps(0)})})]}),jsxRuntimeExports.jsx(SwipeableViews,{axis:theme.direction==="rtl"?"x-reverse":"x",index:value,onChangeIndex:handleChangeIndex,style:{overflow:"hidden"},children:jsxRuntimeExports.jsx(CustomTabPanel,{value,index:0,children:jsxRuntimeExports.jsx(DetailForm,{id:donThu==null?void 0:donThu.id,onClose})})})]})},"Index$1"),UpdateForm=reactExports.memo(Index$1),Index=__name(()=>{const tableRef=reactExports.createRef(),[openConfig,setOpenConfig]=reactExports.useState(null),reloadTable=__name(()=>tableRef.current&&tableRef.current.onQueryChange(),"reloadTable");return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Grow,{in:!openConfig,children:jsxRuntimeExports.jsx(Box,{sx:{display:openConfig?"none":"block"},children:jsxRuntimeExports.jsx(DataTable,{isFullTextSearch:!0,tableRef,isAuth:!0,url:"/buss/allow/DonThus",title:"Đơn thư xử lý",columns,selectType:"withColumns",onActions:[dataRow=>({icon:"filter_frames_rounded",color:"info",tooltip:"Xử lý đơn",disabled:dataRow&&dataRow.enableAdmin===!1,onClick:(event,rowData)=>{setOpenConfig(rowData)}})],onRowClick:(e,rowData)=>{console.log(rowData),setOpenConfig(rowData)}})})}),jsxRuntimeExports.jsx(Grow,{in:!!openConfig,children:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:1,justifyContent:"left",alignItems:"center",children:[openConfig&&jsxRuntimeExports.jsx(Button,{size:"small",onClick:()=>setOpenConfig(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:"Đơn thư xử lý"}),jsxRuntimeExports.jsx(Typography,{color:"text.primary",children:"Xử lý"})]})]}),openConfig&&jsxRuntimeExports.jsx(UpdateForm,{donThu:openConfig,onClose:()=>{reloadTable(),setOpenConfig(null)}})]})})]})},"Index");export{Index as default};