????

Your IP : 3.15.201.103


Current Path : C:/inetpub/vhost/lantha.gdtsolutions.vn/wwwtest/wwwroot/static/js/
Upload File :
Current File : C:/inetpub/vhost/lantha.gdtsolutions.vn/wwwtest/wwwroot/static/js/556.949def10.chunk.js

"use strict";(self.webpackChunkgdt=self.webpackChunkgdt||[]).push([[556],{5899:(a,e,n)=>{n.r(e),n.d(e,{default:()=>y});var t=n(9950),i=n(10077),h=n(57736),o=n(16272),s=n(70349),l=n(23931),r=n(85907),d=n(13650),T=n(67116),u=n(4370),p=n(44414),c={loai_tai_khoan_rong:{field_name:"loai_tai_khoan_rong",title:"",type:"label",required:!1},loai_tai_khoan:{field_name:"loai_tai_khoan",title:"Lo\u1ea1i t\xe0i kho\u1ea3n",type:"label",required:!0},MaTaiKhoan:{field_name:"MaTaiKhoan",title:"T\xean t\xe0i kho\u1ea3n",type:"textbox",required:!0},MatKhau:{field_name:"MatKhau",title:"M\u1eadt kh\u1ea9u",type:"password",required:!0},NhapLaiMatKhau:{field_name:"NhapLaiMatKhau",title:"Nh\u1eadp l\u1ea1i m\u1eadt kh\u1ea9u",type:"password",required:!0},TenHienThi:{field_name:"TenHienThi",title:"T\xean hi\u1ec3n th\u1ecb",type:"textbox",required:!0},Email:{field_name:"Email",title:"Email",type:"textbox",required:!0},TinhTrangHoatDong:{field_name:"TinhTrangHoatDong",title:"Tr\u1ea1ng th\xe1i",type:"checkbox"},DiemKinhDoanh_Id:{field_name:"DiemKinhDoanh_Id",title:"Thu\u1ed9c chi nh\xe1nh",type:"data-select",dataSelect:{url:"DiemKinhDoanhs",column:["Id","Ten"],value_field:"Id",text_field:"Ten"},required:!0},TrangChu:{field_name:"TrangChu",title:"Trang m\u1eb7c \u0111\u1ecbnh",type:"textbox"},VaiTro_Id:{field_name:"VaiTro_Id",title:"Vai tr\xf2",type:"data-select",dataSelect:{url:"DM_VaiTro",column:["Id","TenVaiTro"],value_field:"Id",text_field:"TenVaiTro"},required:!0}};class g extends t.Component{constructor(a){super(a),this.setStateData=(a,e)=>{var{data:n}=this.state;n[a]=e,this.setState({data:n})},this.handleChange=(a,e)=>{this.setStateData(a,e)},this.save=()=>{let{data:a}=this.state;if(this.handleValidate())if(null!=this.props.ID){let e={MaTaiKhoan:this.props.ID,TenHienThi:a.TenHienThi,Email:a.Email,TinhTrangHoatDong:a.TinhTrangHoatDong,TrangChu:a.TrangChu,DiemKinhDoanh_Id:a.DiemKinhDoanh_Id,VaiTro_Id:a.VaiTro_Id};(0,u.a7)("QuanLyTaiKhoan/ChinhSuaTaiKhoan","POST",JSON.stringify(e)).then((a=>(0,T.nw)("C\u1eadp nh\u1eadt th\xe0nh c\xf4ng","TH\xd4NG B\xc1O").then((()=>{this.props.reloadList(),this.props.handleClose()})))).catch((a=>(0,T.AB)(a,"TH\xd4NG B\xc1O")))}else{let e={MaTaiKhoan:a.MaTaiKhoan,MatKhau:a.MatKhau,TenHienThi:a.TenHienThi,Email:a.Email,TinhTrangHoatDong:a.TinhTrangHoatDong,loai_tai_khoan:a.loai_tai_khoan,IDDonVi:this.props.IDDonVi,TrangChu:a.TrangChu,DiemKinhDoanh_Id:a.DiemKinhDoanh_Id,VaiTro_Id:a.VaiTro_Id};(0,u.Pq)("TaiKhoans","POST",JSON.stringify(e)).then((a=>(0,T.nw)("T\u1ea1o t\xe0i kho\u1ea3n th\xe0nh c\xf4ng","TH\xd4NG B\xc1O").then((()=>{this.props.reloadList(),this.props.handleClose()})))).catch((a=>(0,T.AB)("T\xe0i kho\u1ea3n \u0111\xe3 t\u1ed3n t\u1ea1i","TH\xd4NG B\xc1O")))}},this.handleValidate=a=>{const e=Object.values(c).filter((a=>!0===a.required));let{data:n}=this.state;for(let t=0;t<e.length;t++){const a=e[t];let i=n[a.field_name];if(null===i||""===i||void 0===i||0===i.length)return(0,T.AB)('Vui l\xf2ng nh\u1eadp "'+a.title+'"'),!1}return null!=this.props.ID||n.MatKhau===n.NhapLaiMatKhau||((0,T.AB)("Nh\u1eadp m\u1eadt kh\u1ea9u kh\xf4ng kh\u1edbp"),!1)},this.state={data:{MaTaiKhoan:null,MatKhau:null,NhapLaiMatKhau:null,TenHienThi:null,Email:null,TinhTrangHoatDong:!0,loai_tai_khoan:null,TrangChu:null,VaiTro_Id:null}}}componentDidMount(){null!==this.props.ID?(0,u.Pq)(`TaiKhoans?$filter=MaTaiKhoan eq '${this.props.ID}'`,"GET",null).then((a=>{let{data:e}=this.state;e.MaTaiKhoan=this.props.ID,e.TenHienThi=a.value[0].TenHienThi,e.Email=a.value[0].Email,e.TinhTrangHoatDong=a.value[0].TinhTrangHoatDong,e.DiemKinhDoanh_Id=a.value[0].DiemKinhDoanh_Id,e.TrangChu=a.value[0].TrangChu,e.VaiTro_Id=a.value[0].VaiTro_Id,c.MaTaiKhoan.type="label",c.MatKhau.required=!1,c.NhapLaiMatKhau.required=!1,this.setState({data:e})})).catch((a=>(0,T.AB)(a,"TH\xd4NG B\xc1O"))):c.MaTaiKhoan.type="textbox",this.setStateData("loai_tai_khoan",this.props.LoaiTaiKhoan)}componentDidUpdate(a,e){this.props.ID!==a.ID&&this.props.ID&&(c.MaTaiKhoan.type="label",c.MatKhau.required=!1,c.NhapLaiMatKhau.required=!1)}render(){let{data:a}=this.state;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(s.A,{children:[(0,p.jsxs)(l.A,{children:[(0,p.jsx)(o.A,{data:c.loai_tai_khoan,value:a.loai_tai_khoan}),(0,p.jsx)(o.A,{data:c.MaTaiKhoan,value:a.MaTaiKhoan,onChange:this.handleChange}),null==this.props.ID&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o.A,{data:c.MatKhau,value:a.MatKhau,onChange:this.handleChange}),(0,p.jsx)(o.A,{data:c.NhapLaiMatKhau,value:a.NhapLaiMatKhau,onChange:this.handleChange})]}),(0,p.jsx)(o.A,{data:c.TenHienThi,value:a.TenHienThi,onChange:this.handleChange}),(0,p.jsx)(o.A,{data:c.Email,value:a.Email,onChange:this.handleChange})]}),(0,p.jsxs)(l.A,{style:{marginTop:null==this.props.ID?7:15},children:[null==this.props.ID&&(0,p.jsx)(o.A,{data:c.loai_tai_khoan_rong,value:a.loai_tai_khoan_rong}),(0,p.jsx)(o.A,{data:c.VaiTro_Id,value:a.VaiTro_Id,onChange:this.handleChange}),(0,p.jsx)(o.A,{data:c.DiemKinhDoanh_Id,value:a.DiemKinhDoanh_Id,onChange:this.handleChange}),(0,p.jsx)(o.A,{data:c.TrangChu,value:a.TrangChu,onChange:this.handleChange}),(0,p.jsx)(o.A,{data:c.TinhTrangHoatDong,value:a.TinhTrangHoatDong,onChange:this.handleChange})]})]}),(0,p.jsxs)(r.A,{children:[(0,p.jsx)(d.QB,{onClick:this.save,children:"L\u01b0u"})," ",(0,p.jsx)(d.$n,{onClick:this.props.handleClose,children:"H\u1ee7y"})]})]})}}var D=n(20390),m=n(60150),_=n(57780),C=n(69378),K=n(53744),I=n(38611),x=n(30616),k=n(28412),f=n(62181),M=n(32385),H=[{title:"M\xe3 t\xe0i kho\u1ea3n",field:"MaTaiKhoan",dataID:!0,type:"string",editable:"never",searchable:!0,render:a=>(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("span",{children:a.MaTaiKhoan}),"admin_don_vi"===a.code&&(0,p.jsxs)("span",{style:{color:"green",border:"1px solid green",marginLeft:5},children:[" ",(0,p.jsx)("i",{className:"fa fa-exclamation-circle"})," Qu\u1ea3n tr\u1ecb"]})]})},{title:"T\xean t\xe0i kho\u1ea3n",field:"TenHienThi",type:"string",searchable:!0},{title:"Trang m\u1eb7c \u0111\u1ecbnh",field:"TrangChu",type:"string",dataCheck:!0},{title:"T\xecnh tr\u1ea1ng",field:"TinhTrangHoatDong",type:"boolean",searchable:!1,lookup:{true:"Ho\u1ea1t \u0111\u1ed9ng",false:"\u0110\xe3 kh\xf3a"},render:a=>(0,p.jsx)(_.A,{isCheck:a.TinhTrangHoatDong,children:a.TinhTrangHoatDong?"Ho\u1ea1t \u0111\u1ed9ng":"\u0110\xe3 kh\xf3a"})},{field:"code",type:"string",hidden:!0}];const j=t.createRef(),A=()=>j.current&&j.current.onQueryChange();class y extends t.Component{constructor(a){super(a),this.handleChangeIDDonVi=(a,e)=>{this.setState({IDDonVi:a,TenDonVi:e.title}),A()},this.back=()=>{this.setState({IDDonVi:null})},this.setSearch=a=>{13===a.charCode&&this.setState({search:a.target.value},(()=>A()))},this.state={open:!1,openChangePassword:!1,openBangPhanQuyen:!1,openDetail:!1,ID:null,LoaiTaiKhoan:null,IDDonVi:null,search:null}}componentDidMount(){this.setState({LoaiTaiKhoan:"don_vi"})}render(){const{odata:a}=this.props,{search:e}=this.state;let n=[];return n.push("TinhTrangHoatDong eq true"),n.push(`loai_tai_khoan eq 'don_vi' and IDDonVi eq '${K.lg.IDDonVi}'`),e&&n.push(`(substringof('${e}', MaTaiKhoan) or substringof('${e}', TenHienThi))`),(0,p.jsx)(C.A,{data:[{TabName:"Qu\u1ea3n l\xfd t\xe0i kho\u1ea3n - Ph\xe2n quy\u1ec1n",TabContent:(0,p.jsxs)(x.A,{children:[(0,p.jsx)(k.A,{children:(0,p.jsx)(l.A,{md:"12",className:"p-0 mb-2",children:(0,p.jsx)(f.A,{title:"T\xecm ki\u1ebfm",defaultValue:e,onKeyPress:a=>this.setSearch(a),placeholder:"T\xecm ki\u1ebfm theo m\xe3, t\xean..."})})}),(0,p.jsxs)(M.A,{children:[(0,p.jsx)(i.A,{title:"T\xe0i kho\u1ea3n",tableRef:j,url:a?a.url:"TaiKhoans",where:n.join(" and "),columns:H,selectType:"withColumns",onAdd:{onClick:a=>this.setState({open:!0,ID:null})},onEdit:{onClick:(a,e)=>this.setState({open:!0,ID:e.MaTaiKhoan})},onDelete:{disabled:a=>"admin_don_vi"===a.code,onRowDelete:a=>new Promise((async(e,n)=>{(0,u.Pq)(`QuanLyTaiKhoan/XoaTaiKhoan?ma_tai_khoan=${a.MaTaiKhoan}`,"POST",null,!1).then((()=>e())).then((()=>(0,T.nw)("X\xf3a th\xe0nh c\xf4ng"))).catch((a=>n(a)))}))},onActions:[{icon:"check",tooltip:"Ph\xe2n quy\u1ec1n",onClick:(a,e)=>this.setState({openBangPhanQuyen:!0,ID:e.MaTaiKhoan,TenHienThi:e.TenHienThi})},{icon:"key",tooltip:"\u0110\u1ed5i m\u1eadt kh\u1ea9u",onClick:(a,e)=>this.setState({openChangePass:!0,ID:e.MaTaiKhoan})}],onRowClick:(a,e)=>this.setState({openDetail:!0,ID:e.MaTaiKhoan})}),this.state.open&&(0,p.jsx)(h.A,{maxWidth:"lg",open:this.state.open,title:null!=this.state.ID?"C\u1eadp nh\u1eadt":"Th\xeam m\u1edbi",handleClose:()=>this.setState({open:!1}),children:(0,p.jsx)(g,{ID:this.state.ID,LoaiTaiKhoan:this.state.LoaiTaiKhoan,IDDonVi:this.state.IDDonVi,handleClose:()=>this.setState({open:!1}),reloadList:A})}),(0,p.jsx)(D.A,{open:this.state.openDetail,handleClose:()=>this.setState({openDetail:!1}),MaTaiKhoan:this.state.ID}),(0,p.jsx)(h.A,{maxWidth:"md",open:this.state.openChangePass,title:"\u0110\u1ed5i m\u1eadt kh\u1ea9u",handleClose:()=>this.setState({openChangePass:!1}),children:(0,p.jsx)(m.A,{ID:this.state.ID,handleClose:()=>this.setState({openChangePass:!1}),reloadList:A})}),this.state.openBangPhanQuyen&&(0,p.jsx)(I.A,{ID:this.state.ID,TenHienThi:this.state.TenHienThi,open:this.state.openBangPhanQuyen,onClose:()=>this.setState({openBangPhanQuyen:!1,ID:null})})]})]})}]})}}},32385:(a,e,n)=>{n.d(e,{A:()=>o});var t=n(9950),i=n(23931),h=n(44414);class o extends t.Component{render(){let{children:a,className:e,FilterSearchAdvanced:n,FilterNoHeader:t,NoTabs:o}=this.props,s=[];return e&&s.push(e),s.push("filter-datatable"),n&&s.push("filter-search-advanced"),t&&s.push("filter-no-header"),o&&s.push("filter-no-tabs"),(0,h.jsx)(i.A,{className:s.join(" "),md:"9",children:a})}}o.defaultProps={className:"",FilterSearchAdvanced:"",FilterNoHeader:"",NoTabs:""}}}]);