window.location.reload()}\r\n status_id={this.state.data.status_id}\r\n />\r\n );\r\n }\r\n } else {\r\n return null;\r\n }\r\n };\r\n\r\n card_info = info => {\r\n return (\r\n \r\n {info.map((item, index) => (\r\n \r\n {item}\r\n \r\n ))}\r\n \r\n );\r\n };\r\n\r\n render_lydo_bo_qua = () => {\r\n if (this.state.data.bo_qua_id != null && this.state.data.status_id == 200) {\r\n return (\r\n \r\n {'Lý do bỏ qua: '}\r\n {bo_qua_detail(this.state.data.bo_qua_id)}\r\n \r\n );\r\n }\r\n };\r\n\r\n render_khop_lenh = () => {\r\n if (\r\n (this.state.role_admin == CONST_DATA.ROLE_KE_TOAN_KHOP_LENH ||\r\n this.state.role_admin == CONST_DATA.ROLE_ADMIN) &&\r\n this.state.data.id_chuyen_tien_sai != null &&\r\n this.state.data.transaction_id == null &&\r\n this.state.data.ticket_type == 'CHUYỂN TIỀN' &&\r\n this.state.data.status_id != 10 &&\r\n this.state.data.status_id != 200 &&\r\n this.state.data.status_id != 400\r\n ) {\r\n return (\r\n \r\n );\r\n }\r\n };\r\n\r\n handleUpdateInfoBank = () => {\r\n\r\n this.setState({ loading: true })\r\n Axios({\r\n method: 'PUT',\r\n headers: { user_id: this.state.user_id, access_token: this.state.access_token },\r\n url: CONST_DATA.update_bank_info,\r\n data: {\r\n ticket_id: this.state.ticket_id\r\n }\r\n })\r\n .then(response => {\r\n this.setState({ loading: false });\r\n const result = response.data\r\n if (result.status === 'success') {\r\n\r\n // this.setState({\r\n // data_success: true,\r\n // data: response.data.data\r\n // });\r\n console.log(result);\r\n toast.success(`Cập nhật thông tin tài khoản thành công`)\r\n }\r\n else if (result.status === 'error') {\r\n toast.error(`Cập nhật không thành công: ${result.data}`)\r\n }\r\n })\r\n .catch(error => {\r\n this.setState({ loading: false });\r\n });\r\n }\r\n\r\n render_giao_dich_hoan_tra = () => {\r\n if (this.state.data.ticket_type == 'SỬA THÔNG TIN TÀI KHOẢN NGÂN HÀNG') {\r\n return (\r\n \r\n );\r\n }\r\n };\r\n\r\n\r\n\r\n render() {\r\n const { classes } = this.props;\r\n if (!this.state.loading) {\r\n return (\r\n \r\n
\r\n \r\n {this.state.data.ticket_type == 'CHUYỂN TIỀN' ? (\r\n \r\n ) : null}\r\n\r\n \r\n \r\n \r\n \r\n \r\n Chi tiết yêu cầu\r\n \r\n {this.card_info([\r\n this.state.ticket_id,\r\n 'Loại yêu cầu: ' + this.state.data.ticket_type,\r\n 'Trạng thái hiện tại: ' +\r\n status_detail(this.state.data.status_id),\r\n this.render_lydo_bo_qua(),\r\n this.state.data.is_truy_thu ? 'Đơn dạng thuy thu' : null\r\n ])}\r\n\r\n {this.state.role_admin == CONST_DATA.ROLE_TU_VAN\r\n ? null\r\n : this.card_info([\r\n 'User id: ' + this.state.data.user_id,\r\n this.state.data.user_profile == null\r\n ? null\r\n : 'SDT: ' + this.state.data.user_profile.phone_number,\r\n this.state.data.user_profile == null\r\n ? null\r\n : 'Email: ' + this.state.data.user_profile.email\r\n ])}\r\n\r\n {this.render_status(classes)}\r\n {this.state.role_admin == CONST_DATA.ROLE_ADMIN &&\r\n this.state.data.status_id != 100 ? (\r\n \r\n this.mo_lai_don()}>\r\n Mở lại đơn - đang giải quyết\r\n \r\n
\r\n ) : null}\r\n\r\n \r\n \r\n \r\n {this.state.data.ticket_detail.map((item, index) => {\r\n return this.render_ticket_detail(classes, item, index)\r\n }\r\n )}\r\n \r\n {this.state.data && this.state.data.ticket_type && this.state.data.ticket_type === \"ĐỐI SOÁT\" && this.state.data.ticket_detail.length > 4 && !!this.state.data.id_hoan_tra && this.state.data.status_id !== 200 && this.state.data.status_id !== 400 && this.handleUpdateInfoBank()} style={{ marginLeft: \"10px\" }} variant=\"contained\" color=\"primary\">\r\n Cập nhật thông tin ngân hàng\r\n }\r\n\r\n \r\n {this.render_khop_lenh()}\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n Comment\r\n \r\n \r\n\r\n \r\n \r\n this.remove_comment(item)\r\n }> \r\n\r\n {this.state.role_admin == 0 ? (\r\n \r\n this.setState({\r\n edit_comment: !this.state.edit_comment\r\n })\r\n }>\r\n Chỉnh sửa comment\r\n \r\n ) : null}\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n {/* Ghi chú */}\r\n {this.state.data.note != null\r\n ? this.state.data.note.map(item => (\r\n {item} \r\n ))\r\n : null}\r\n\r\n this.send_note(note)}> \r\n\r\n \r\n Lịch sử thay đổi trạng thái\r\n \r\n {this.state.data.status_log.map((item, index) => (\r\n \r\n ))}\r\n \r\n \r\n\r\n {this.state.data.admin_assign_log == null ? null : (\r\n \r\n )}\r\n \r\n \r\n
{this.render_chuyen_tien_sai()} \r\n\r\n
{this.render_hoan_tra()} \r\n {/*
{this.render_giao_dich_hoan_tra()} */}\r\n
\r\n );\r\n } else {\r\n return ;\r\n }\r\n }\r\n}\r\nexport default withStyles(styles)(Issue);\r\n","import React, { Component } from 'react';\r\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\r\nimport { TextField, IconButton } from '@material-ui/core';\r\nimport SearchIcon from '@material-ui/icons/Search';\r\n\r\nconst styles = theme => ({\r\n root: {},\r\n container: {\r\n maxHeight: '70vh'\r\n },\r\n formControl: {\r\n margin: theme.spacing(1),\r\n minWidth: 170\r\n },\r\n selectEmpty: {\r\n marginTop: theme.spacing(2)\r\n }\r\n});\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n seach_text: ''\r\n };\r\n }\r\n\r\n render() {\r\n const { classes } = this.props;\r\n\r\n return (\r\n \r\n this.setState({ seach_text: event.target.value })}\r\n />\r\n \r\n this.props.onClick(this.state.seach_text)}\r\n />\r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(User);\r\n","import React, { Component } from 'react';\r\nimport { Button, Box, TextField, Typography } from '@material-ui/core';\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n note_change: null\r\n };\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n Chinh sửa ghi chú \r\n this.setState({ note_change: event.target.value })}\r\n />\r\n this.props.send_note(this.state.note_change)}>\r\n Cập nhật ghi chú\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default User;\r\n","import React, { Component } from 'react';\r\nimport { withStyles } from '@material-ui/core/styles';\r\nimport { Button, TextField, Card, Box, Typography, CircularProgress } from '@material-ui/core';\r\n\r\nimport CONST_DATA from 'constant';\r\nimport Axios from 'axios';\r\n\r\n// const columns = [\r\n// { label: 'Ngày', minWidth: 10 },\r\n// { label: 'Diễn giải', minWidth: 10 },\r\n// { label: 'Số bút toán', minWidth: 10 },\r\n// { label: 'Số tiền', minWidth: 10 },\r\n// { label: 'Bank', minWidth: 10 },\r\n// { label: 'Ghi chú', minWidth: 10 },\r\n// { label: '', minWidth: 10 }\r\n// ];\r\n\r\nconst styles = theme => ({\r\n root: {},\r\n container: {\r\n maxHeight: '70vh'\r\n },\r\n formControl: {\r\n // margin: theme.spacing(1),\r\n minWidth: 10\r\n },\r\n selectEmpty: {\r\n marginTop: theme.spacing(2)\r\n },\r\n textField: {\r\n // marginTop: theme.spacing(2)\r\n // width: 200\r\n flex: 1\r\n }\r\n});\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n access_token: this.props.access_token,\r\n user_id: this.props.user_id,\r\n text_add: null,\r\n search_key: null,\r\n insert_log: null,\r\n disabled: false,\r\n\r\n start_date_thong_ke: null,\r\n end_date_thong_ke: null\r\n };\r\n }\r\n\r\n send_data = async () => {\r\n const body_req = {\r\n user_id: this.state.user_id,\r\n access_token: this.state.access_token,\r\n text_add: this.state.text_add\r\n };\r\n this.setState({\r\n disabled: true,\r\n });\r\n\r\n await Axios.post(CONST_DATA.ketoan_add_item, body_req)\r\n .then(response => {\r\n if (response.data.status === 'success') {\r\n this.setState({\r\n insert_log: response.data.data\r\n });\r\n // this.props.refesh_page();\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n });\r\n this.setState({\r\n disabled: false,\r\n });\r\n };\r\n\r\n renderDuplicate = () => {\r\n return (\r\n \r\n \r\n Đã thêm {this.state.insert_log.success} \r\n Bị trùng {this.state.insert_log.duplicate} \r\n Bị lỗi {this.state.insert_log.error} \r\n \r\n\r\n this.props.refesh_page()}\r\n variant=\"outlined\"\r\n size=\"small\"\r\n color=\"primary\">\r\n xác nhận\r\n \r\n \r\n );\r\n };\r\n\r\n showProgressLoading = () => {\r\n return (\r\n \r\n );\r\n }\r\n\r\n render() {\r\n const { classes } = this.props;\r\n const { disabled } = this.state;\r\n\r\n return (\r\n \r\n \r\n {this.props.role_admin === CONST_DATA.ROLE_KE_TOAN ? (\r\n \r\n \r\n this.setState({ text_add: event.target.value })\r\n }\r\n />\r\n\r\n this.send_data()}\r\n variant=\"outlined\"\r\n size=\"small\"\r\n color=\"primary\" disabled={disabled}>\r\n Gửi dữ liệu\r\n \r\n \r\n ) : null}\r\n\r\n \r\n \r\n this.setState({ search_key: event.target.value })\r\n }\r\n />\r\n\r\n this.props.search_data(this.state.search_key)}\r\n variant=\"outlined\"\r\n size=\"small\"\r\n color=\"primary\">\r\n Tìm kiếm\r\n \r\n \r\n\r\n \r\n {\r\n let link_thong_ke = CONST_DATA.ketoan_thong_ke;\r\n\r\n window.location.href = link_thong_ke;\r\n }}\r\n variant=\"outlined\"\r\n size=\"small\"\r\n color=\"primary\">\r\n Thống kê\r\n \r\n \r\n \r\n {this.state.disabled === false ? null : this.showProgressLoading()}\r\n \r\n Lưu ý copy nhiều dòng, các dòng có ô đầu tiền giống nhau\r\n \r\n\r\n {this.state.insert_log === null ? null : this.renderDuplicate()}\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(User);\r\n","import React, { Component } from 'react';\r\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\r\nimport {\r\n Paper,\r\n Table,\r\n TableBody,\r\n TableCell,\r\n TableContainer,\r\n TableHead,\r\n TableRow,\r\n Button,\r\n Dialog\r\n} from '@material-ui/core';\r\n\r\nimport CONST_DATA from 'constant';\r\nimport SearchText from './SearchText';\r\nimport Axios from 'axios';\r\nimport DialogEdit from './DialogEdit';\r\nimport TableAdd from './TableAdd';\r\n\r\nconst columns = [\r\n { label: 'Edit', minWidth: 1 },\r\n { label: 'Ngày', minWidth: 10 },\r\n { label: 'Số tiền', minWidth: 10 },\r\n { label: 'Bank', minWidth: 10 },\r\n\r\n { label: 'Diễn giải', minWidth: 10 },\r\n { label: 'Số bút toán', minWidth: 10 },\r\n { label: 'Transaction ID', minWidth: 10 },\r\n { label: 'ID', minWidth: 10 },\r\n { label: 'Mã case', minWidth: 10 },\r\n { label: 'CS', minWidth: 10 },\r\n { label: 'Ghi chú', minWidth: 10 }\r\n];\r\n\r\nconst styles = theme => ({\r\n root: {},\r\n container: {\r\n maxHeight: '70vh'\r\n },\r\n formControl: {\r\n margin: theme.spacing(1),\r\n minWidth: 170\r\n },\r\n selectEmpty: {\r\n marginTop: theme.spacing(2)\r\n }\r\n});\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n access_token: this.props.access_token,\r\n user_id: this.props.user_id,\r\n data: this.props.data,\r\n data_success: false,\r\n open_delete: false,\r\n id_delete: null,\r\n data_delete: null,\r\n\r\n note_change: null\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this.get_data();\r\n }\r\n\r\n ren_admin = data => {\r\n if (data.admin_assign != null) {\r\n return {data.admin_assign.full_name} ;\r\n } else {\r\n return ;\r\n }\r\n };\r\n\r\n get_data = () => {\r\n const body_req = {\r\n user_id: this.state.user_id,\r\n access_token: this.state.access_token\r\n };\r\n\r\n Axios.post(CONST_DATA.ketoan_get_all_item, body_req)\r\n .then(response => {\r\n if (response.data.status == 'success') {\r\n this.setState({\r\n data_success: true,\r\n data: response.data.data\r\n });\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n });\r\n };\r\n\r\n search_data = search_key => {\r\n const body_req = {\r\n user_id: this.state.user_id,\r\n access_token: this.state.access_token,\r\n search_key: search_key\r\n };\r\n\r\n Axios.post(CONST_DATA.ketoan_ketoan_search_item, body_req)\r\n .then(response => {\r\n if (response.data.status == 'success') {\r\n this.setState({\r\n data_success: true,\r\n data: response.data.data\r\n });\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n });\r\n };\r\n\r\n delete_data = id_chuyen_tien_sai => {\r\n const body_req = {\r\n user_id: this.state.user_id,\r\n access_token: this.state.access_token,\r\n id_chuyen_tien_sai: id_chuyen_tien_sai\r\n };\r\n\r\n Axios.post(CONST_DATA.ketoan_delete_item, body_req)\r\n .then(response => {\r\n if (response.data.status == 'success') {\r\n this.props.refesh_page();\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n });\r\n };\r\n\r\n edit_note = (id_chuyen_tien_sai, note) => {\r\n const body_req = {\r\n user_id: this.state.user_id,\r\n access_token: this.state.access_token,\r\n id_chuyen_tien_sai: id_chuyen_tien_sai,\r\n note: note\r\n };\r\n\r\n Axios.post(CONST_DATA.ketoan_edit_note, body_req)\r\n .then(response => {\r\n if (response.data.status == 'success') {\r\n this.props.refesh_page();\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n });\r\n };\r\n\r\n render_delete = () => {\r\n return (\r\n this.setState({ open_delete: false })}\r\n aria-labelledby=\"alert-dialog-title\"\r\n aria-describedby=\"alert-dialog-description\">\r\n {\r\n this.setState({ open_delete: false });\r\n this.delete_data(this.state.id_delete);\r\n }}>\r\n Xóa toàn bộ dữ liệu\r\n \r\n \r\n \r\n this.edit_note(this.state.id_delete, note)}\r\n />\r\n \r\n );\r\n };\r\n\r\n render() {\r\n const { classes } = this.props;\r\n return (\r\n \r\n
window.location.reload()}\r\n search_data={search_key => this.search_data(search_key)}\r\n role_admin={this.props.role_admin}\r\n />\r\n\r\n {this.render_delete()}\r\n \r\n \r\n \r\n \r\n \r\n {columns.map(column => (\r\n \r\n {column.label}\r\n \r\n ))}\r\n \r\n \r\n \r\n {this.state.data_success\r\n ? this.state.data.map((row, index) => (\r\n \r\n \r\n {(this.props.role_admin == CONST_DATA.ROLE_KE_TOAN && row.cs_confirm == false) ? (\r\n \r\n this.setState({\r\n open_delete: true,\r\n id_delete: row.id\r\n })\r\n }\r\n variant=\"outlined\"\r\n size=\"small\"\r\n color=\"primary\">\r\n Edit\r\n \r\n ) : null}\r\n \r\n {row.ngay} \r\n \r\n {row.so_tien\r\n .toString()\r\n .replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',')}\r\n \r\n {row.bank} \r\n {row.dien_giai} \r\n {row.so_but_toan} \r\n \r\n {row.ticket_detail == null\r\n ? null\r\n : row.ticket_detail.transaction_id}\r\n \r\n {row.id} \r\n {row.ma_case} \r\n {row.cs_confirm.toString()} \r\n \r\n {row.note == null ? null : row.note.toString()}\r\n \r\n \r\n ))\r\n : null}\r\n \r\n
\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(User);\r\n","import React, { Component } from 'react';\r\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\r\nimport { Grid } from '@material-ui/core';\r\nimport CONST_DATA from 'constant';\r\nimport TableAll from './TableAll';\r\n\r\nconst styles = theme => ({\r\n root: {\r\n padding: theme.spacing(2)\r\n }\r\n});\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n access_token: null,\r\n user_id: null,\r\n data_success: false,\r\n data: null,\r\n data_ticket: null,\r\n data_ticket_success: false,\r\n role_admin: null\r\n };\r\n }\r\n\r\n check_login = () => {\r\n let login_data = localStorage.getItem(CONST_DATA.localStorage_login);\r\n\r\n if (login_data == null) {\r\n this.props.history.push(CONST_DATA.router_sign_in);\r\n } else {\r\n login_data = JSON.parse(login_data);\r\n this.setState({\r\n access_token: login_data.access_token,\r\n user_id: login_data.user_id,\r\n role_admin: login_data.role\r\n });\r\n }\r\n };\r\n\r\n async componentDidMount() {\r\n await this.check_login();\r\n }\r\n\r\n render() {\r\n const { classes } = this.props;\r\n return (\r\n \r\n
\r\n \r\n {this.state.access_token != null ? (\r\n window.location.reload()}\r\n role_admin={this.state.role_admin}\r\n />\r\n ) : null}\r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(User);\r\n","import React, { Component } from 'react';\r\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\r\nimport {\r\n Paper,\r\n Table,\r\n TableBody,\r\n TableCell,\r\n TableContainer,\r\n TableHead,\r\n TablePagination,\r\n TableRow,\r\n Button,\r\n FormControl,\r\n InputLabel,\r\n Select,\r\n MenuItem,\r\n Box,\r\n TextField\r\n} from '@material-ui/core';\r\nimport { Link } from 'react-router-dom';\r\n\r\nimport {\r\n to_date,\r\n to_date_min,\r\n status_detail,\r\n to_date_search,\r\n convert_date_to_search\r\n} from 'utility';\r\nimport CONST_DATA from 'constant';\r\nimport Axios from 'axios';\r\n\r\nconst columns = [\r\n { label: 'STT', minWidth: 10 },\r\n { label: 'Ngày comment', minWidth: 10 },\r\n { label: 'User id', minWidth: 10 },\r\n { label: 'Comment', minWidth: 10 },\r\n { label: 'Mã yêu cầu', minWidth: 10 },\r\n { label: 'Vấn đề ', minWidth: 10 },\r\n { label: 'Trạng thái', minWidth: 10 }\r\n];\r\n\r\nconst styles = theme => ({\r\n root: {},\r\n container: {\r\n maxHeight: '70vh'\r\n },\r\n formControl: {\r\n margin: theme.spacing(1),\r\n minWidth: 170\r\n },\r\n selectEmpty: {\r\n marginTop: theme.spacing(2)\r\n }\r\n});\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n data: this.props.data\r\n };\r\n }\r\n\r\n ren_admin = data => {\r\n if (data.admin_assign != null) {\r\n return {data.admin_assign.full_name} ;\r\n } else {\r\n return ;\r\n }\r\n };\r\n\r\n confirm_read_comment = ticket_id => {\r\n const body_req = {\r\n user_id: this.props.user_id,\r\n access_token: this.props.access_token,\r\n ticket_id: ticket_id\r\n };\r\n\r\n Axios.post(CONST_DATA.confirm_read_comment, body_req)\r\n .then(response => {\r\n this.props.reload();\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n });\r\n };\r\n\r\n render() {\r\n const { classes } = this.props;\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n {columns.map(column => (\r\n \r\n {column.label}\r\n \r\n ))}\r\n \r\n \r\n \r\n {this.state.data.map((row, index) => (\r\n \r\n \r\n this.confirm_read_comment(row.ticket_id)}\r\n to={CONST_DATA.router_detail + '/' + row.ticket_id}\r\n target=\"_blank\">\r\n \r\n {index + 1}\r\n \r\n \r\n \r\n {to_date_min(row.new_comment_date)} \r\n {row.user_id} \r\n \r\n {row.comment_log.slice(-1)[0].comment}\r\n \r\n {row.ticket_id} \r\n {row.ticket_type} \r\n {status_detail(row.status_id)} \r\n \r\n ))}\r\n \r\n
\r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(User);\r\n","import React, { Component } from 'react';\r\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\r\nimport {\r\n Grid,\r\n Dialog,\r\n DialogActions,\r\n DialogContent,\r\n DialogContentText,\r\n DialogTitle,\r\n Button,\r\n CircularProgress\r\n} from '@material-ui/core';\r\nimport UsersTable from './Table';\r\nimport CONST_DATA from 'constant';\r\nimport Axios from 'axios';\r\nimport { get_time_second, to_date_unix } from 'utility';\r\n\r\nconst styles = theme => ({\r\n root: {\r\n padding: theme.spacing(2)\r\n }\r\n});\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n access_token: null,\r\n user_id: null,\r\n data_success: false,\r\n data: null,\r\n data_ticket: null,\r\n data_ticket_success: false\r\n };\r\n }\r\n\r\n check_login = () => {\r\n let login_data = localStorage.getItem(CONST_DATA.localStorage_login);\r\n\r\n if (login_data == null) {\r\n this.props.history.push(CONST_DATA.router_sign_in);\r\n } else {\r\n login_data = JSON.parse(login_data);\r\n this.setState({\r\n access_token: login_data.access_token,\r\n user_id: login_data.user_id\r\n });\r\n }\r\n };\r\n\r\n async componentDidMount() {\r\n await this.check_login();\r\n await this.get_data();\r\n }\r\n\r\n get_data = () => {\r\n const body_req = {\r\n user_id: this.state.user_id,\r\n access_token: this.state.access_token\r\n };\r\n\r\n Axios.post(CONST_DATA.get_ticket_new_comment, body_req)\r\n .then(response => {\r\n if (response.data.status == 'success') {\r\n this.setState({\r\n data_success: true,\r\n data: response.data.data\r\n });\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n });\r\n };\r\n\r\n reload = () => {\r\n window.location.reload();\r\n };\r\n\r\n render() {\r\n const { classes } = this.props;\r\n return (\r\n \r\n \r\n \r\n {this.state.data_success ? (\r\n this.reload()}\r\n />\r\n ) : (\r\n \r\n )}\r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(User);\r\n","import React, { Component } from 'react';\r\nimport { Button, Box, TextField, Typography } from '@material-ui/core';\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n note_change: null\r\n };\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n Chinh sửa ghi chú \r\n this.setState({ note_change: event.target.value })}\r\n />\r\n this.props.send_note(this.state.note_change)}>\r\n Cập nhật ghi chú\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default User;\r\n","import React, { Component } from 'react';\r\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\r\nimport { Button, TextField, Card, Box, Typography, CircularProgress } from '@material-ui/core';\r\nimport { Link } from 'react-router-dom';\r\n\r\nimport CONST_DATA from 'constant';\r\nimport SearchText from './SearchText';\r\nimport Axios from 'axios';\r\nimport CardCS from 'views/Detail/CardCS';\r\n\r\nconst columns = [\r\n { label: 'Ngày', minWidth: 10 },\r\n { label: 'Diễn giải', minWidth: 10 },\r\n { label: 'Số bút toán', minWidth: 10 },\r\n { label: 'Số tiền', minWidth: 10 },\r\n { label: 'Bank', minWidth: 10 },\r\n { label: 'Ghi chú', minWidth: 10 },\r\n { label: '', minWidth: 10 }\r\n];\r\n\r\nconst styles = theme => ({\r\n root: {}\r\n});\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n access_token: this.props.access_token,\r\n user_id: this.props.user_id,\r\n text_add: null,\r\n disabled: false,\r\n\r\n search_key: null,\r\n\r\n insert_log: null,\r\n button_active:false,\r\n count:59\r\n };\r\n this.timer = 0;\r\n }\r\n\r\n send_data = async () => {\r\n const body_req = {\r\n user_id: this.state.user_id,\r\n access_token: this.state.access_token,\r\n text_add: this.state.text_add\r\n };\r\n this.setState({\r\n disabled: true,\r\n });\r\n\r\n await Axios.post(CONST_DATA.ketoan_hoan_tra_add_item, body_req)\r\n .then(response => {\r\n if (response.data.status == 'success') {\r\n this.setState({\r\n insert_log: response.data.data\r\n });\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n });\r\n this.setState({\r\n disabled: false,\r\n });\r\n };\r\n export_file = () => {\r\n this.props.export_file_ketoan()\r\n this.setState({ \r\n button_active:true\r\n })\r\n if (this.timer == 0 && this.state.count > 0) {\r\n this.timer = setInterval(this.count_down, 1000);\r\n console.log(this.timer)\r\n }\r\n }\r\n\r\n count_down =()=>{\r\n let count = this.state.count-1\r\n this.setState({\r\n count: count\r\n })\r\n\r\n if (count == 0) { \r\n clearInterval(this.timer);\r\n this.setState({\r\n count:59,\r\n button_active:false\r\n })\r\n this.timer=0\r\n }\r\n\r\n \r\n }\r\n\r\n renderDuplicate = () => {\r\n return (\r\n \r\n \r\n Đã thêm {this.state.insert_log.success} \r\n Bị trùng {this.state.insert_log.duplicate} \r\n Bị lỗi {this.state.insert_log.error} \r\n \r\n\r\n this.props.refesh_page()}\r\n variant=\"outlined\"\r\n size=\"small\"\r\n color=\"primary\">\r\n xác nhận\r\n \r\n \r\n );\r\n };\r\n\r\n showProgressLoading = () => {\r\n return (\r\n \r\n );\r\n }\r\n\r\n render() {\r\n const { classes } = this.props;\r\n const { disabled } = this.state;\r\n\r\n return (\r\n \r\n \r\n {this.props.role_admin == CONST_DATA.ROLE_KE_TOAN ? (\r\n \r\n \r\n this.setState({ text_add: event.target.value })\r\n }\r\n />\r\n\r\n this.send_data()}\r\n variant=\"outlined\"\r\n size=\"small\"\r\n color=\"primary\" disabled={disabled}>\r\n Gửi dữ liệu\r\n \r\n \r\n ) : null}\r\n \r\n \r\n this.setState({ search_key: event.target.value })\r\n }\r\n />\r\n\r\n this.props.search_data(this.state.search_key)}\r\n variant=\"outlined\"\r\n size=\"small\"\r\n color=\"primary\">\r\n Tìm kiếm\r\n \r\n\r\n {this.props.role_admin===CONST_DATA.ROLE_KE_TOAN?(\r\n this.export_file()}\r\n variant=\"outlined\"\r\n size=\"small\"\r\n color=\"primary\"\r\n disabled={this.state.button_active}\r\n >\r\n {this.state.button_active===true?`Sử dụng lại sau (${this.state.count})`:'Export File'}\r\n \r\n ):null}\r\n \r\n \r\n {this.state.disabled === false ? null : this.showProgressLoading()}\r\n Lưu ý copy từng dòng \r\n\r\n {this.state.insert_log == null ? null : this.renderDuplicate()}\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(User);\r\n","import React, { Component } from 'react';\r\nimport { TextField, IconButton } from '@material-ui/core';\r\nimport SearchIcon from '@material-ui/icons/Search';\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n seach_text: ''\r\n };\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n this.setState({ seach_text: event.target.value })}\r\n />\r\n \r\n this.props.onClick(this.state.seach_text)}\r\n />\r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default User;\r\n","import React, { Component } from 'react';\r\nimport { withStyles } from '@material-ui/core/styles';\r\nimport {\r\n Paper,\r\n Table,\r\n TableBody,\r\n TableCell,\r\n TableContainer,\r\n TableHead,\r\n TableRow,\r\n Button,\r\n Dialog\r\n} from '@material-ui/core';\r\n\r\nimport CONST_DATA from 'constant';\r\nimport Axios from 'axios';\r\nimport DialogEdit from './DialogEdit';\r\nimport TableAdd from './TableAdd';\r\nimport Snackbar from '@material-ui/core/Snackbar';\r\nimport Alert from '@material-ui/lab/Alert';\r\n\r\nconst columns = [\r\n { label: 'Edit', minWidth: 10 },\r\n { label: 'User Id', minWidth: 10 },\r\n { label: 'Ngày', minWidth: 10 },\r\n { label: 'Số tiền', minWidth: 10 },\r\n { label: 'Mã rút tiền', minWidth: 10 },\r\n { label: 'Diễn giải', minWidth: 10 },\r\n { label: 'ID', minWidth: 10 },\r\n { label: 'Mã case', minWidth: 10 },\r\n { label: 'CS', minWidth: 10 },\r\n { label: 'Ghi chú', minWidth: 10 }\r\n];\r\n\r\nconst styles = theme => ({\r\n root: {},\r\n container: {\r\n maxHeight: '70vh'\r\n },\r\n formControl: {\r\n margin: theme.spacing(1),\r\n minWidth: 170\r\n },\r\n selectEmpty: {\r\n marginTop: theme.spacing(2)\r\n }\r\n});\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n access_token: this.props.access_token,\r\n user_id: this.props.user_id,\r\n data: this.props.data,\r\n data_success: false,\r\n open_delete: false,\r\n id_delete: null,\r\n data_delete: null,\r\n note_change: null,\r\n message_error:'',\r\n open_error:false\r\n };\r\n }\r\n\r\n get_data = () => {\r\n const body_req = {\r\n user_id: this.state.user_id,\r\n access_token: this.state.access_token\r\n };\r\n\r\n Axios.post(CONST_DATA.ketoan_hoan_tra_get_all_item, body_req)\r\n .then(response => {\r\n if (response.data.status === 'success') {\r\n this.setState({\r\n data_success: true,\r\n data: response.data.data\r\n });\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n });\r\n };\r\n\r\n search_data = search_key => {\r\n const body_req = {\r\n user_id: this.state.user_id,\r\n access_token: this.state.access_token,\r\n search_key: search_key\r\n };\r\n\r\n Axios.post(CONST_DATA.ketoan_hoan_tra_ketoan_search_item, body_req)\r\n .then(response => {\r\n if (response.data.status === 'success') {\r\n this.setState({\r\n data_success: true,\r\n data: response.data.data\r\n });\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n });\r\n };\r\n\r\n delete_data = id_hoan_tra => {\r\n const body_req = {\r\n user_id: this.state.user_id,\r\n access_token: this.state.access_token,\r\n id_hoan_tra: id_hoan_tra\r\n };\r\n\r\n Axios.post(CONST_DATA.ketoan_hoan_tra_delete_item, body_req)\r\n .then(response => {\r\n if (response.data.status === 'success') {\r\n this.get_data();\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n });\r\n };\r\n\r\n edit_note = (id_hoan_tra, note) => {\r\n const body_req = {\r\n user_id: this.state.user_id,\r\n access_token: this.state.access_token,\r\n id_hoan_tra: id_hoan_tra,\r\n note: note\r\n };\r\n\r\n Axios.post(CONST_DATA.ketoan_hoan_tra_edit_note, body_req)\r\n .then(response => {\r\n if (response.data.status === 'success') {\r\n\r\n window.location.reload();\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n });\r\n };\r\n export_file_ketoan = ()=>{\r\n const headers = {\r\n user_id: this.state.user_id,\r\n access_token: this.state.access_token,\r\n \"Content-Type\": \"application/json\",\r\n };\r\n\r\n Axios.post(CONST_DATA.ketoan_hoan_tra_export_file,{},{headers: headers})\r\n .then(res=>{\r\n if(res.status==200){\r\n console.log(res.data.data)\r\n this.setState({\r\n message_error:res.data.data,\r\n open_error:true\r\n })\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n })\r\n\r\n }\r\n\r\n componentDidMount() {\r\n this.get_data();\r\n }\r\n\r\n render_delete = () => {\r\n return (\r\n this.setState({ open_delete: false })}\r\n aria-labelledby=\"alert-dialog-title\"\r\n aria-describedby=\"alert-dialog-description\">\r\n {\r\n this.setState({ open_delete: false });\r\n this.delete_data(this.state.id_delete);\r\n }}>\r\n Xóa toàn bộ dữ liệu\r\n \r\n \r\n \r\n this.edit_note(this.state.id_delete, note)}\r\n />\r\n \r\n );\r\n };\r\n\r\n handleClose =()=>{\r\n this.setState({\r\n open_error:false\r\n })\r\n }\r\n\r\n render() {\r\n const { classes } = this.props;\r\n return (\r\n \r\n
window.location.reload()}\r\n search_data={search_key => this.search_data(search_key)}\r\n role_admin={this.props.role_admin}\r\n export_file_ketoan = {(data)=>this.export_file_ketoan(data)}\r\n />\r\n\r\n {this.render_delete()}\r\n \r\n \r\n \r\n \r\n \r\n {columns.map(column => {\r\n return (\r\n \r\n {column.label}\r\n \r\n )\r\n }\r\n )}\r\n \r\n \r\n \r\n {this.state.data_success\r\n ? this.state.data.map((row, index) => {\r\n return (\r\n \r\n \r\n {this.props.role_admin == CONST_DATA.ROLE_KE_TOAN ? (\r\n \r\n this.setState({\r\n open_delete: true,\r\n id_delete: row.id\r\n })\r\n }\r\n variant=\"outlined\"\r\n size=\"small\"\r\n color=\"primary\">\r\n Edit\r\n \r\n ) : null}\r\n \r\n {row.user_id ? row.user_id : null} \r\n {row.date} \r\n \r\n {row.so_tien\r\n .toString()\r\n .replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',')}\r\n \r\n\r\n {row.ma_rut_tien} \r\n {row.dien_giai} \r\n {row.id} \r\n {row.ma_case} \r\n {row.cs_match ? 'yes' : 'no'} \r\n {row.note ? row.note : null} \r\n\r\n \r\n )\r\n })\r\n : null}\r\n \r\n
\r\n \r\n \r\n\r\n \r\n \r\n {this.state.message_error}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(User);\r\n","import React, { Component } from 'react';\r\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\r\nimport { Grid } from '@material-ui/core';\r\nimport CONST_DATA from 'constant';\r\nimport TableAll from './TableAll';\r\n\r\nconst styles = theme => ({\r\n root: {\r\n padding: theme.spacing(2)\r\n }\r\n});\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n access_token: null,\r\n user_id: null,\r\n data_success: false,\r\n data: null,\r\n data_ticket: null,\r\n data_ticket_success: false,\r\n role_admin: null\r\n };\r\n }\r\n\r\n check_login = () => {\r\n let login_data = localStorage.getItem(CONST_DATA.localStorage_login);\r\n\r\n if (login_data == null) {\r\n this.props.history.push(CONST_DATA.router_sign_in);\r\n } else {\r\n login_data = JSON.parse(login_data);\r\n this.setState({\r\n access_token: login_data.access_token,\r\n user_id: login_data.user_id,\r\n role_admin: login_data.role\r\n });\r\n }\r\n };\r\n\r\n async componentDidMount() {\r\n await this.check_login();\r\n }\r\n\r\n render() {\r\n const { classes } = this.props;\r\n return (\r\n \r\n
\r\n \r\n {this.state.access_token != null ? (\r\n window.location.reload()}\r\n role_admin={this.state.role_admin}\r\n />\r\n ) : null}\r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(User);\r\n","import React, { Component } from 'react';\r\nimport { withStyles } from '@material-ui/core/styles';\r\nimport { Grid, CircularProgress } from '@material-ui/core';\r\nimport {\r\n Paper,\r\n Table,\r\n TableBody,\r\n TableCell,\r\n TableContainer,\r\n TableHead,\r\n TableRow,\r\n Button,\r\n FormControl,\r\n Box,\r\n TextField\r\n} from '@material-ui/core';\r\n\r\nimport {\r\n to_date_min,\r\n to_date_unix\r\n} from 'utility';\r\nimport CONST_DATA from 'constant';\r\nimport Axios from 'axios';\r\nimport {\r\n Typography,\r\n} from '@material-ui/core';\r\nimport SearchIcon from '@material-ui/icons/Search';\r\nconst columns = [\r\n { label: 'STT', minWidth: 10 },\r\n { label: 'ID_OCR', minWidth: 10 },\r\n { label: 'ID_Selfie_Compare', minWidth: 10 },\r\n\r\n];\r\n\r\nconst styles = theme => ({\r\n root: {},\r\n container: {\r\n maxHeight: '70vh'\r\n },\r\n formControl: {\r\n margin: theme.spacing(1),\r\n minWidth: 170\r\n },\r\n selectEmpty: {\r\n marginTop: theme.spacing(2)\r\n }\r\n});\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n access_token: this.props.access_token,\r\n user_id: this.props.user_id,\r\n data: this.props.data,\r\n data_success: false,\r\n loading: false,\r\n startDate: null,\r\n enDate: null\r\n };\r\n }\r\n\r\n\r\n\r\n get_data = () => {\r\n this.setState({\r\n loading: true\r\n });\r\n const body_req = {\r\n user_id: this.state.user_id,\r\n access_token: this.state.access_token,\r\n };\r\n if (this.state.startDate) {\r\n body_req.start_date = to_date_unix(this.state.startDate)\r\n }\r\n else {\r\n body_req.start_date = 1546448400\r\n }\r\n\r\n if (this.state.enDate) {\r\n body_req.end_date = to_date_unix(this.state.enDate)\r\n }\r\n else {\r\n body_req.end_date = 1615309200\r\n }\r\n\r\n Axios.post(CONST_DATA.doi_soat_ekyc, body_req)\r\n .then(response => {\r\n if (response.data.status === 'success') {\r\n this.setState({\r\n data_success: true,\r\n data: [response.data.data],\r\n loading: false\r\n });\r\n }\r\n else {\r\n this.setState({\r\n loading: false\r\n });\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n this.setState({\r\n loading: false\r\n });\r\n });\r\n };\r\n\r\n componentDidMount() {\r\n this.get_data();\r\n }\r\n\r\n\r\n\r\n handleOnSearch = async () => {\r\n this.get_data()\r\n }\r\n\r\n render() {\r\n const { classes } = this.props;\r\n return (\r\n \r\n
\r\n Từ\r\n \r\n {\r\n this.setState({ startDate: event.target.value });\r\n }}\r\n type=\"date\"\r\n />\r\n\r\n \r\n Đến\r\n \r\n {\r\n this.setState({ enDate: event.target.value });\r\n }}\r\n type=\"date\"\r\n />\r\n \r\n \r\n Tìm kiếm \r\n \r\n \r\n \r\n {this.state.loading ?
:
\r\n \r\n \r\n \r\n \r\n {columns.length && columns.map(column => (\r\n \r\n {column.label}\r\n \r\n ))}\r\n \r\n \r\n \r\n {this.state.data_success\r\n ? this.state.data.map((row, index) => (\r\n \r\n \r\n \r\n {index + 1}\r\n \r\n \r\n {row.count_ocr} \r\n {row.count_selfie} \r\n\r\n \r\n ))\r\n : null}\r\n \r\n
\r\n \r\n }\r\n\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(User);\r\n","import React, { Component } from 'react';\r\nimport { withStyles } from '@material-ui/core/styles';\r\nimport { Grid } from '@material-ui/core';\r\nimport CONST_DATA from 'constant';\r\nimport TableAll from './TableAll';\r\nconst styles = theme => ({\r\n root: {\r\n padding: theme.spacing(2)\r\n }\r\n});\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n access_token: null,\r\n user_id: null,\r\n data_success: false,\r\n data: null,\r\n data_ticket: null,\r\n data_ticket_success: false\r\n };\r\n }\r\n\r\n check_login = () => {\r\n let login_data = localStorage.getItem(CONST_DATA.localStorage_login);\r\n if (login_data === null) {\r\n this.props.history.push(CONST_DATA.router_sign_in);\r\n } else {\r\n login_data = JSON.parse(login_data);\r\n this.setState({\r\n access_token: login_data.access_token,\r\n user_id: login_data.user_id,\r\n role_admin: login_data.role\r\n });\r\n }\r\n };\r\n\r\n componentDidMount() {\r\n this.check_login();\r\n }\r\n\r\n\r\n\r\n\r\n\r\n render_table = () => {\r\n return (\r\n \r\n );\r\n };\r\n\r\n render() {\r\n const { classes } = this.props;\r\n return (\r\n \r\n \r\n \r\n {this.state.access_token && this.render_table()}\r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(User);\r\n","import React, { Component } from \"react\";\r\nimport { makeStyles, withStyles } from \"@material-ui/core/styles\";\r\nimport {\r\n Paper,\r\n Table,\r\n TableBody,\r\n TableCell,\r\n TableContainer,\r\n TableHead,\r\n TableRow,\r\n} from \"@material-ui/core\";\r\nimport Pagination from \"@material-ui/lab/Pagination\";\r\nimport Switch from \"@material-ui/core/Switch\";\r\n\r\nimport CONST_DATA from \"constant\";\r\nimport Axios from \"axios\";\r\n\r\n\r\nconst columns = [\r\n { label: \"Họ tên\", minWidth: 10 },\r\n { label: \"Tên đăng nhập\", minWidth: 10 },\r\n { label: \"Trạng Thái\", minWidth: 1 },\r\n { label: \"Vai trò\", minWidth: 1 },\r\n { label: \"Thay đổi trạng thái kích hoạt\", minWidth: 1 },\r\n];\r\n\r\nconst styles = (theme) => ({\r\n root: {\r\n \"& > *\": {\r\n marginTop: theme.spacing(2),\r\n },\r\n },\r\n container: {\r\n maxHeight: \"70vh\",\r\n },\r\n formControl: {\r\n margin: theme.spacing(1),\r\n minWidth: 170,\r\n },\r\n selectEmpty: {\r\n marginTop: theme.spacing(2),\r\n },\r\n});\r\n\r\nclass TableUser extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n access_token: this.props.access_token,\r\n user_id: this.props.user_id,\r\n data: this.props.data,\r\n data_success: false,\r\n open_delete: false,\r\n id_delete: null,\r\n data_delete: null,\r\n\r\n note_change: null,\r\n page: 1,\r\n totalPage: 50,\r\n limit: 20,\r\n checked: true,\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n console.log(this.state.data)\r\n }\r\n\r\n \r\n\r\n checkRoleDisplay = (role) => {\r\n let roleDisplay = \"\";\r\n if (role == 0) {\r\n roleDisplay = \"Admin\";\r\n }\r\n if (role == 100) {\r\n roleDisplay = \"CS\";\r\n }\r\n if (role == 50) {\r\n roleDisplay = \"Kế toán\";\r\n }\r\n if (role == 55) {\r\n roleDisplay = \"Kế toán khớp lệnh\";\r\n }\r\n if (role == 70) {\r\n roleDisplay = \"Tư vấn\";\r\n }\r\n if (role == 1000) {\r\n roleDisplay = \"test\";\r\n }\r\n if (role == 10000) {\r\n roleDisplay = \"kyc\";\r\n }\r\n return roleDisplay;\r\n };\r\n\r\n handleChange = (id, currentStatus) => {\r\n \r\n const headers = {\r\n access_token: this.state.access_token,\r\n user_id: this.state.user_id,\r\n };\r\n if (currentStatus == false) {\r\n Axios.put(`${CONST_DATA.change_status_user}${id}/active`,{},{headers:headers})\r\n .then((res) => {\r\n if (res.data.status == \"success\") {\r\n window.location.reload();\r\n }\r\n })\r\n .catch((err) => {\r\n console.log(err)\r\n })\r\n }\r\n if (currentStatus == true) {\r\n Axios.put(\r\n `${CONST_DATA.change_status_user}${id}/inactive`,\r\n {},\r\n { headers: headers }\r\n )\r\n .then((res) => {\r\n if (res.data.status == \"success\") {\r\n window.location.reload();\r\n }\r\n })\r\n .catch((err) => {\r\n console.log(err);\r\n });\r\n }\r\n }\r\n\r\n render() {\r\n const { classes } = this.props;\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n {columns.map((column) => (\r\n \r\n {column.label}\r\n \r\n ))}\r\n \r\n \r\n \r\n {this.state.data.map((item, index) => {\r\n return (\r\n \r\n {item.full_name} \r\n {item.user_name} \r\n \r\n {item.is_active === true\r\n ? \"Đang kích hoạt\"\r\n : \"Không kích hoạt\"}\r\n \r\n {this.checkRoleDisplay(item.role)} \r\n \r\n \r\n this.handleChange(item.user_id, item.is_active)\r\n }\r\n color=\"primary\"\r\n name=\"checked\"\r\n inputProps={{ \"aria-label\": \"primary checkbox\" }}\r\n />\r\n \r\n \r\n );\r\n })}\r\n \r\n
\r\n \r\n {/* */}\r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(TableUser);\r\n","import React, { Component } from \"react\";\r\nimport { makeStyles, withStyles } from \"@material-ui/core/styles\";\r\nimport {\r\n Grid,\r\n Paper,\r\n TextField,\r\n Typography,\r\n Button,\r\n Card,\r\n CircularProgress,\r\n Select,\r\n MenuItem,\r\n FormControl,\r\n InputLabel,\r\n Modal,\r\n Backdrop,\r\n Fade,\r\n} from \"@material-ui/core\";\r\nimport FormHelperText from \"@material-ui/core/FormHelperText\";\r\nimport CONST_DATA from \"constant\";\r\nimport Axios from \"axios\";\r\nimport { get_time_second } from \"utility\";\r\nimport TableAll from \"./TableAll\";\r\nimport { ThreeSixtySharp, TransferWithinAStationSharp } from \"@material-ui/icons\";\r\n\r\n\r\nconst styles = (theme) => ({\r\n root: {\r\n padding: theme.spacing(2),\r\n margin: theme.spacing(1),\r\n },\r\n textField: {\r\n margin: theme.spacing(1),\r\n },\r\n formControl: {\r\n margin: theme.spacing(1),\r\n minWidth: 120,\r\n },\r\n selectEmpty: {\r\n marginTop: theme.spacing(2),\r\n },\r\n modal: {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n },\r\n paper: {\r\n backgroundColor: theme.palette.background.paper,\r\n // border: \"2px solid #000\",\r\n boxShadow: theme.shadows[5],\r\n padding: theme.spacing(2, 4, 3),\r\n },\r\n});\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n access_token: null,\r\n full_name: \"\",\r\n user_name: \"\",\r\n data: null,\r\n data_success: false,\r\n role: \"\",\r\n open: false,\r\n user_id: \"\",\r\n isError: {\r\n isErrorFullName: false,\r\n isErrorUserName: false,\r\n isErrorRole: false,\r\n },\r\n errorFullNameText: \"\",\r\n errorUserNameText: \"\",\r\n errorRoleText: \"\"\r\n };\r\n }\r\n handleClose = () => {\r\n this.setState({\r\n open: false,\r\n });\r\n };\r\n handleOpen = () => {\r\n this.setState({\r\n open: true,\r\n });\r\n };\r\n check_login = () => {\r\n let login_data = localStorage.getItem(CONST_DATA.localStorage_login);\r\n\r\n if (login_data == null) {\r\n this.props.history.push(CONST_DATA.router_sign_in);\r\n } else {\r\n login_data = JSON.parse(login_data);\r\n this.setState({\r\n access_token: login_data.access_token,\r\n user_id: login_data.user_id,\r\n });\r\n }\r\n };\r\n\r\n async componentDidMount() {\r\n await this.check_login();\r\n await this.get_all_user();\r\n }\r\n\r\n get_all_user = () => {\r\n const headers = {\r\n user_id: this.state.user_id,\r\n access_token: this.state.access_token,\r\n \"Content-Type\": \"application/json\",\r\n };\r\n Axios.get(CONST_DATA.get_all_admin, { headers: headers })\r\n .then((response) => {\r\n if (response.data.status == \"success\") {\r\n console.log(response);\r\n this.setState({\r\n data: response.data.data,\r\n data_success: true,\r\n });\r\n }\r\n })\r\n .catch((error) => {\r\n console.log(error);\r\n });\r\n };\r\n\r\n render_list_admin = (item, classes) => {\r\n return (\r\n \r\n full_name: {item.full_name} \r\n user_name: {item.user_name} \r\n user_id: {item.user_id} \r\n \r\n );\r\n };\r\n\r\n send_data_add = () => {\r\n const body_req = {\r\n full_name: this.state.full_name,\r\n user_name: this.state.user_name,\r\n role: this.state.role,\r\n is_active: false,\r\n };\r\n const headers = {\r\n access_token: this.state.access_token,\r\n user_id: this.state.user_id,\r\n };\r\n if (this.checkValidateFullName() && this.checkValidateUsername()) {\r\n Axios.post(CONST_DATA.creat_user_admin, body_req, { headers: headers })\r\n .then((response) => {\r\n if (response.data.status == \"success\") {\r\n window.location.reload();\r\n }\r\n })\r\n .catch((error) => {\r\n console.log(error);\r\n });\r\n }\r\n else {\r\n this.checkValidateUsername();\r\n this.checkValidateFullName();\r\n this.checkValidateRole();\r\n }\r\n\r\n };\r\n checkValidateFullName = () => {\r\n let validate = true;\r\n if (this.state.full_name === \"\") {\r\n this.setState({\r\n isError: {\r\n isErrorFullName: true,\r\n },\r\n errorFullNameText: \"Trường không được bỏ trống\",\r\n });\r\n validate = false\r\n } else {\r\n this.setState({\r\n isError: {\r\n isErrorFullName: false,\r\n },\r\n errorFullNameText: \"\",\r\n });\r\n }\r\n return validate\r\n };\r\n checkValidateUsername = () => {\r\n let validate = true;\r\n if (this.state.user_name === \"\") {\r\n this.setState({\r\n isError: {\r\n isErrorUserName: true,\r\n },\r\n errorUserNameText: \"Trường không được bỏ trống\",\r\n });\r\n validate = false\r\n } else {\r\n this.setState({\r\n isError: {\r\n isErrorUserName: false,\r\n },\r\n errorUserNameText: \"\",\r\n });\r\n }\r\n return validate\r\n };\r\n checkValidateRole = () => {\r\n let validate = true;\r\n if (this.state.role === \"\") {\r\n this.setState({\r\n isError: {\r\n isErrorRole: true,\r\n },\r\n errorRoleText: \"Chọn Role\",\r\n });\r\n validate = false\r\n }\r\n else {\r\n this.setState({\r\n isError: {\r\n isErrorRole: false,\r\n },\r\n errorRoleText: \"\",\r\n });\r\n }\r\n return validate\r\n }\r\n\r\n render() {\r\n const { classes } = this.props;\r\n const { open } = this.state;\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n Thêm mới người dùng\r\n \r\n \r\n {this.state.data_success ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n\r\n {/* MODAL THEM MOI */}\r\n
\r\n
\r\n \r\n \r\n \r\n Thêm mới người dùng \r\n \r\n this.setState({ full_name: event.target.value })\r\n }\r\n onBlur={this.checkValidateFullName}\r\n required\r\n />\r\n \r\n this.setState({ user_name: event.target.value })\r\n }\r\n onBlur={this.checkValidateUsername}\r\n required\r\n />\r\n \r\n \r\n \r\n Role\r\n \r\n \r\n this.setState({ role: event.target.value })\r\n }\r\n >\r\n Admin \r\n CS \r\n Kế toán \r\n Kế toán khớp lệnh \r\n Tư vấn \r\n kyc \r\n \r\n \r\n {this.state.errorRoleText}\r\n \r\n \r\n \r\n this.send_data_add()}\r\n >\r\n Add admin\r\n \r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(User);\r\n","const list_check_fail = [\r\n { title: 'Ảnh chưa đúng nội dung', check: false },\r\n { title: 'Ảnh mặt trước và mặt sau không cùng loại', check: false },\r\n { title: 'Ảnh CMTND/CCCD thiếu 4 góc', check: false },\r\n { title: 'Ảnh thuộc loại photocopy hoặc chụp ảnh từ màn hình', check: false },\r\n { title: 'Ảnh quá tối hoặc bị lóe sáng', check: false },\r\n { title: 'Ảnh chụp bị nhòe số CMTND/CCCD', check: false },\r\n { title: 'CMTND/CCCD hết hạn sử dụng', check: false },\r\n { title: 'Không có khuôn mặt xuất hiện trong ảnh selfie', check: false },\r\n { title: 'Ảnh selfie bị nhắm mắt', check: false },\r\n { title: 'Ảnh selfie quá tối hoặc lóe sáng', check: false },\r\n { title: 'Người dùng chưa đủ 18 tuổi', check: false },\r\n {\r\n title: 'Ảnh selfie và ảnh mặt trước của CMTND/CCCD không cùng một người',\r\n check: false\r\n }\r\n];\r\n\r\nexport { list_check_fail };\r\n","import React, { Component } from 'react';\r\nimport {\r\n Button,\r\n FormControl,\r\n FormGroup,\r\n Checkbox,\r\n FormControlLabel,\r\n Card,\r\n Box,\r\n Typography,\r\n TextField,\r\n CircularProgress\r\n} from '@material-ui/core';\r\n\r\nimport RotateRightIcon from '@material-ui/icons/RotateRight';\r\nimport { list_check_fail } from './data';\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n ly_do_reject: 0,\r\n reject: false,\r\n accept: false,\r\n deg_rotate: 0,\r\n list_check_fail: list_check_fail,\r\n\r\n is_accept: null,\r\n\r\n id_name: null,\r\n id_number: null,\r\n id_dob: null,\r\n id_address: null,\r\n id_issue_address: null,\r\n id_issue_date: null\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n let data_cmt = this.props.data_cmt;\r\n\r\n try {\r\n this.setState({\r\n id_name: data_cmt.true_id.ocr_id.data_fields.name.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_name: data_cmt.true_id.final.kyc_result.front.name.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_name: data_cmt.user_info.name\r\n });\r\n } catch (error) { }\r\n }\r\n }\r\n\r\n try {\r\n this.setState({\r\n id_number: data_cmt.true_id.ocr_id.data_fields.id_number.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_number: data_cmt.true_id.final.kyc_result.front.id_number.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_number: data_cmt.user_info.id_number\r\n });\r\n } catch (error) { }\r\n }\r\n }\r\n\r\n try {\r\n this.setState({\r\n id_dob: data_cmt.true_id.ocr_id.data_fields.dob.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_dob: data_cmt.true_id.final.kyc_result.front.dob.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_dob: data_cmt.user_info.dob\r\n });\r\n } catch (error) { }\r\n }\r\n }\r\n\r\n try {\r\n this.setState({\r\n id_address: data_cmt.true_id.ocr_id.data_fields.id_address.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_address: data_cmt.true_id.final.kyc_result.front.id_address.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_address: data_cmt.user_info.address\r\n });\r\n } catch (error) { }\r\n }\r\n }\r\n\r\n try {\r\n this.setState({\r\n id_issue_date: data_cmt.true_id.ocr_id.data_fields.given_date.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_issue_date: data_cmt.true_id.final.kyc_result.back.given_date.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_issue_date: data_cmt.user_info.id_issue_date\r\n });\r\n } catch (error) { }\r\n }\r\n }\r\n\r\n try {\r\n this.setState({\r\n id_issue_address: data_cmt.true_id.ocr_id.data_fields.given_place.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_issue_address:\r\n data_cmt.true_id.final.kyc_result.back.given_place.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_issue_address: data_cmt.user_info.id_issue_address\r\n });\r\n } catch (error) { }\r\n }\r\n }\r\n }\r\n\r\n render_img = src_link => {\r\n let max_h = 400;\r\n return (\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n render_img_selfie = src_link => {\r\n let max_h = 150;\r\n return (\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n onChangeList_fail = event => {\r\n\r\n let pre_list_check = this.state.list_check_fail;\r\n let index_of_item = this.state.list_check_fail.findIndex(\r\n a => a.title === event.target.name\r\n );\r\n pre_list_check[index_of_item].check = event.target.checked;\r\n this.setState({ list_check_fail: pre_list_check });\r\n };\r\n\r\n card_text = (label, value, onChange) => {\r\n return (\r\n \r\n {label} \r\n onChange(event.target.value)}\r\n />\r\n
\r\n );\r\n };\r\n\r\n render_accept = () => {\r\n return (\r\n \r\n {this.card_text('Họ và tên', this.state.id_name, value =>\r\n this.setState({ id_name: value })\r\n )}\r\n {this.card_text('Số CMTND/CCCD hộ chiếu', this.state.id_number, value =>\r\n this.setState({ id_number: value })\r\n )}\r\n {this.card_text('Ngày sinh', this.state.id_dob, value =>\r\n this.setState({ id_dob: value })\r\n )}\r\n {this.card_text('Địa chỉ', this.state.id_address, value =>\r\n this.setState({ id_address: value })\r\n )}\r\n {this.card_text('Ngày cấp', this.state.id_issue_date, value =>\r\n this.setState({ id_issue_date: value })\r\n )}\r\n {this.card_text('Nơi cấp', this.state.id_issue_address, value =>\r\n this.setState({ id_issue_address: value })\r\n )}\r\n \r\n );\r\n };\r\n\r\n render_rejcet = () => {\r\n return (\r\n \r\n \r\n \r\n {this.state.list_check_fail.map(item => (\r\n this.onChangeList_fail(event)}\r\n name={item.title}\r\n />\r\n }\r\n label={item.title}\r\n />\r\n ))}\r\n \r\n \r\n \r\n );\r\n };\r\n render_cs_confirm = () => {\r\n console.log(this.props.loading_confirm)\r\n if (this.state.is_accept) {\r\n if (\r\n this.state.id_number != null &&\r\n this.state.id_name != null &&\r\n this.state.id_number != '' &&\r\n this.state.id_name != ''\r\n ) {\r\n return (\r\n <>\r\n {this.props.loading_confirm ? : \r\n this.props.send_accept({\r\n id_address: { value: this.state.id_address },\r\n given_date: { value: this.state.id_issue_date },\r\n name: { value: this.state.id_name },\r\n given_place: { value: this.state.id_issue_address },\r\n id_number: { value: this.state.id_number },\r\n dob: { value: this.state.id_dob }\r\n })\r\n }>\r\n Xác nhận đổi thông tin người dùng và gửi thông báo\r\n }\r\n >\r\n\r\n );\r\n }\r\n }\r\n\r\n if (this.state.is_accept == false) {\r\n return (\r\n {\r\n let data = '';\r\n this.state.list_check_fail.map(item => {\r\n if (item.check) {\r\n data = data + '- ' + item.title + '.';\r\n }\r\n });\r\n this.props.send_reject(data);\r\n }}\r\n style={{ backgroundColor: 'rgb(244,67,54)', color: 'white' }}>\r\n Xác nhận thông tin sai và gửi thông báo\r\n \r\n );\r\n }\r\n };\r\n\r\n render() {\r\n return (\r\n \r\n
\r\n \r\n {this.render_img_selfie(this.props.data.result.selfie)}\r\n {this.render_img(this.props.data.result.front)}\r\n {this.render_img(this.props.data.result.back)}\r\n \r\n\r\n \r\n this.setState({ deg_rotate: this.state.deg_rotate + 90 })\r\n }>\r\n \r\n \r\n \r\n\r\n
\r\n {/* this.setState({ is_accept: true })}>\r\n Accept\r\n \r\n\r\n this.setState({ is_accept: false })}>\r\n Reject\r\n \r\n {this.state.is_accept == true ? this.render_accept() : null}\r\n {this.state.is_accept == false ? this.render_rejcet() : null}\r\n\r\n {this.render_cs_confirm()} */}\r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default User;\r\n","import React, { Component } from 'react';\r\nimport {\r\n Button,\r\n FormControl,\r\n FormGroup,\r\n Checkbox,\r\n FormControlLabel,\r\n Card,\r\n Box,\r\n Typography,\r\n TextField,\r\n Input,\r\n CircularProgress\r\n} from '@material-ui/core';\r\n\r\nimport RotateRightIcon from '@material-ui/icons/RotateRight';\r\nimport { list_check_fail } from './data';\r\n\r\nclass Selfie extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n ly_do_reject: '',\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n let data_cmt = this.props.data_cmt;\r\n\r\n try {\r\n this.setState({\r\n id_name: data_cmt.true_id.ocr_id.data_fields.name.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_name: data_cmt.true_id.final.kyc_result.front.name.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_name: data_cmt.user_info.name\r\n });\r\n } catch (error) { }\r\n }\r\n }\r\n\r\n try {\r\n this.setState({\r\n id_number: data_cmt.true_id.ocr_id.data_fields.id_number.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_number: data_cmt.true_id.final.kyc_result.front.id_number.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_number: data_cmt.user_info.id_number\r\n });\r\n } catch (error) { }\r\n }\r\n }\r\n\r\n try {\r\n this.setState({\r\n id_dob: data_cmt.true_id.ocr_id.data_fields.dob.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_dob: data_cmt.true_id.final.kyc_result.front.dob.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_dob: data_cmt.user_info.dob\r\n });\r\n } catch (error) { }\r\n }\r\n }\r\n\r\n try {\r\n this.setState({\r\n id_address: data_cmt.true_id.ocr_id.data_fields.id_address.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_address: data_cmt.true_id.final.kyc_result.front.id_address.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_address: data_cmt.user_info.address\r\n });\r\n } catch (error) { }\r\n }\r\n }\r\n\r\n try {\r\n this.setState({\r\n id_issue_date: data_cmt.true_id.ocr_id.data_fields.given_date.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_issue_date: data_cmt.true_id.final.kyc_result.back.given_date.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_issue_date: data_cmt.user_info.id_issue_date\r\n });\r\n } catch (error) { }\r\n }\r\n }\r\n\r\n try {\r\n this.setState({\r\n id_issue_address: data_cmt.true_id.ocr_id.data_fields.given_place.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_issue_address:\r\n data_cmt.true_id.final.kyc_result.back.given_place.value\r\n });\r\n } catch (error) {\r\n try {\r\n this.setState({\r\n id_issue_address: data_cmt.user_info.id_issue_address\r\n });\r\n } catch (error) { }\r\n }\r\n }\r\n }\r\n\r\n render_img = src_link => {\r\n let max_h = 400;\r\n return (\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n render_img_selfie = src_link => {\r\n let max_h = 150;\r\n return (\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n onChangeList_fail = event => {\r\n\r\n let pre_list_check = this.state.list_check_fail;\r\n let index_of_item = this.state.list_check_fail.findIndex(\r\n a => a.title === event.target.name\r\n );\r\n pre_list_check[index_of_item].check = event.target.checked;\r\n this.setState({ list_check_fail: pre_list_check });\r\n };\r\n\r\n card_text = (label, value, onChange) => {\r\n return (\r\n \r\n {label} \r\n onChange(event.target.value)}\r\n />\r\n
\r\n );\r\n };\r\n\r\n render_reason = () => {\r\n return (\r\n \r\n Lý do:\r\n this.setState({ ly_do_reject: e.target.value })} value={this.state.ly_do_reject} >\r\n \r\n );\r\n };\r\n\r\n render_rejcet = () => {\r\n return (\r\n \r\n \r\n \r\n {this.state.list_check_fail.map(item => (\r\n this.onChangeList_fail(event)}\r\n name={item.title}\r\n />\r\n }\r\n label={item.title}\r\n />\r\n ))}\r\n \r\n \r\n \r\n );\r\n };\r\n render_cs_confirm = () => {\r\n if (this.state.is_accept) {\r\n if (\r\n this.state.id_number != null &&\r\n this.state.id_name != null &&\r\n this.state.id_number != '' &&\r\n this.state.id_name != ''\r\n ) {\r\n return (\r\n \r\n this.props.send_confirm_selfie(1, this.state.ly_do_reject)\r\n }>\r\n Xác nhận đổi thông tin người dùng và gửi thông báo\r\n \r\n );\r\n }\r\n }\r\n\r\n if (this.state.is_accept == false) {\r\n return (\r\n this.props.send_confirm_selfie(0, this.state.ly_do_reject)}\r\n style={{ backgroundColor: 'rgb(244,67,54)', color: 'white' }}>\r\n Xác nhận thông tin sai và gửi thông báo\r\n \r\n );\r\n }\r\n };\r\n\r\n render() {\r\n return (\r\n \r\n
\r\n \r\n {this.render_img_selfie(this.props.data.result.selfie)}\r\n {this.render_img(this.props.data.result.front)}\r\n {this.render_img(this.props.data.result.back)}\r\n \r\n\r\n \r\n this.setState({ deg_rotate: this.state.deg_rotate + 90 })\r\n }>\r\n \r\n \r\n \r\n\r\n
\r\n {this.props.loading_confirm ? : <> this.setState({ is_accept: true })}>\r\n onClick={() => this.props.send_confirm_selfie(1, this.state.ly_do_reject)}>\r\n Accept\r\n \r\n\r\n this.setState({ is_accept: false })}\r\n onClick={() => this.props.send_confirm_selfie(0, this.state.ly_do_reject)}>\r\n Reject\r\n \r\n\r\n >}\r\n\r\n {/* {this.render_reason()}\r\n {this.render_cs_confirm()} */}\r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default Selfie;\r\n","import React, { Component } from 'react';\r\nimport {\r\n Button,\r\n FormControl,\r\n FormGroup,\r\n Checkbox,\r\n FormControlLabel,\r\n Card,\r\n Box,\r\n Typography,\r\n TextField\r\n} from '@material-ui/core';\r\nimport CONST_DATA from 'constant';\r\nimport Axios from 'axios';\r\nimport RotateRightIcon from '@material-ui/icons/RotateRight';\r\nimport { list_check_fail } from './data';\r\n\r\nclass UpdateUserInfo extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n ly_do_reject: 0,\r\n reject: false,\r\n accept: false,\r\n deg_rotate: 0,\r\n list_check_fail: list_check_fail,\r\n\r\n is_accept: null,\r\n\r\n id_name: null,\r\n id_number: null,\r\n id_dob: null,\r\n id_address: null,\r\n id_issue_address: null,\r\n id_issue_date: null,\r\n data_true_id: null,\r\n unrender:false,\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n if(this.props.data_cmt){\r\n let { full_name, identity_number, dob, id_issue_address, id_issue_date, address } = this.props.data_cmt;\r\n this.setState({\r\n id_name: full_name,\r\n id_number: identity_number,\r\n id_dob: dob,\r\n id_address: address,\r\n id_issue_date,\r\n id_issue_address,\r\n data_true_id: this.props.data_true_id\r\n })\r\n }\r\n else{\r\n alert(\"không có dữ liệu\")\r\n this.setState({\r\n unrender:true\r\n })\r\n }\r\n \r\n }\r\n\r\n render_img = src_link => {\r\n let max_h = 400;\r\n return (\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n render_img_selfie = src_link => {\r\n let max_h = 150;\r\n return (\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n onChangeList_fail = event => {\r\n\r\n let pre_list_check = this.state.list_check_fail;\r\n let index_of_item = this.state.list_check_fail.findIndex(\r\n a => a.title === event.target.name\r\n );\r\n pre_list_check[index_of_item].check = event.target.checked;\r\n this.setState({ list_check_fail: pre_list_check });\r\n };\r\n\r\n card_text = (label, value, onChange, key) => {\r\n const isNotMatchTrueId = this.state.data_true_id && this.state.data_true_id[key] && this.state.data_true_id[key].toUpperCase() !== value.toUpperCase();\r\n // console.log({ value, trueId: this.state.data_true_id[key] })\r\n return (\r\n \r\n {label} \r\n onChange(event.target.value)}\r\n helperText={isNotMatchTrueId ? `Thông tin không khớp với True ID: ${this.state.data_true_id[key]}` : null}\r\n variant={isNotMatchTrueId ? 'filled' : 'standard'}\r\n />\r\n
\r\n );\r\n };\r\n\r\n render_accept = () => {\r\n return (\r\n \r\n {this.card_text('Họ và tên', this.state.id_name, value =>\r\n this.setState({ id_name: value }), 'name'\r\n )}\r\n {this.card_text('Số CMTND/CCCD hộ chiếu', this.state.id_number, value =>\r\n this.setState({ id_number: value }), 'id_number'\r\n )}\r\n {this.card_text('Ngày sinh', this.state.id_dob, value =>\r\n this.setState({ id_dob: value }), 'dob'\r\n )}\r\n {this.card_text('Địa chỉ', this.state.id_address, value =>\r\n this.setState({ id_address: value }), 'id_address'\r\n )}\r\n {this.card_text('Ngày cấp', this.state.id_issue_date, value =>\r\n this.setState({ id_issue_date: value }), 'given_date'\r\n )}\r\n {this.card_text('Nơi cấp', this.state.id_issue_address, value =>\r\n this.setState({ id_issue_address: value }), 'given_place'\r\n )}\r\n \r\n );\r\n };\r\n\r\n render_rejcet = () => {\r\n return (\r\n \r\n \r\n \r\n {this.state.list_check_fail.map(item => (\r\n this.onChangeList_fail(event)}\r\n name={item.title}\r\n />\r\n }\r\n label={item.title}\r\n />\r\n ))}\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n render_cs_confirm = () => {\r\n if (this.state.is_accept) {\r\n if (\r\n this.state.id_number != null &&\r\n this.state.id_name != null &&\r\n this.state.id_number != '' &&\r\n this.state.id_name != ''\r\n ) {\r\n return (\r\n \r\n this.props.handleAccept({\r\n identity_number: this.state.id_number,\r\n full_name: this.state.id_name,\r\n dob: this.state.id_dob,\r\n address: this.state.id_address,\r\n id_issue_date: this.state.id_issue_date,\r\n id_issue_address: this.state.id_issue_address\r\n })\r\n }>\r\n Xác nhận đổi thông tin người dùng và gửi thông báo\r\n \r\n );\r\n }\r\n }\r\n\r\n // if (this.state.is_accept == false) {\r\n // return (\r\n // {\r\n // let data = '';\r\n // this.state.list_check_fail.map(item => {\r\n // if (item.check) {\r\n // data = data + '- ' + item.title + '.';\r\n // }\r\n // });\r\n // this.props.send_reject(data);\r\n // }}\r\n // style={{ backgroundColor: 'rgb(244,67,54)', color: 'white' }}>\r\n // Xác nhận thông tin sai và gửi thông báo\r\n // \r\n // );\r\n // }\r\n };\r\n\r\n render() {\r\n return (\r\n \r\n
\r\n \r\n {this.render_img_selfie(this.props.data.result.selfie)}\r\n {this.render_img(this.props.data.result.front)}\r\n {this.render_img(this.props.data.result.back)}\r\n \r\n\r\n \r\n this.setState({ deg_rotate: this.state.deg_rotate + 90 })\r\n }>\r\n \r\n \r\n \r\n\r\n
\r\n this.setState({ is_accept: true })}>\r\n Accept\r\n \r\n this.setState({ is_accept: false })}\r\n onClick={() =>\r\n this.props.send_confirm_selfie(0, this.state.ly_do_reject)\r\n }\r\n >\r\n Reject\r\n \r\n\r\n {/* this.setState({ is_accept: false })}>\r\n Reject\r\n */}\r\n {this.state.is_accept == true ? this.render_accept() : null}\r\n {this.state.is_accept == false ? this.render_rejcet() : null}\r\n\r\n {this.render_cs_confirm()}\r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default UpdateUserInfo;\r\n","import React, { Component } from 'react';\r\nimport {\r\n Button,\r\n FormControl,\r\n FormGroup,\r\n Checkbox,\r\n FormControlLabel,\r\n Card,\r\n Box,\r\n Typography,\r\n TextField\r\n} from '@material-ui/core';\r\nimport CONST_DATA from 'constant';\r\nimport Axios from 'axios';\r\nimport RotateRightIcon from '@material-ui/icons/RotateRight';\r\nimport { list_check_fail } from './data';\r\n\r\nclass IDCard extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n ly_do_reject: 0,\r\n reject: false,\r\n accept: false,\r\n deg_rotate: 0,\r\n list_check_fail: list_check_fail,\r\n\r\n is_accept: null,\r\n\r\n id_name: null,\r\n id_number: null,\r\n id_dob: null,\r\n id_issue_address: null,\r\n id_issue_date: null,\r\n unrender:false,\r\n };\r\n }\r\n\r\n getValueFromTrueIdAndUser(key, data_cmt, key_true_id, data_true_id) {\r\n if (data_cmt && data_cmt[key]) return data_cmt[key]\r\n if (data_true_id && data_true_id[key_true_id]) return data_true_id[key_true_id]\r\n return ''\r\n }\r\n\r\n componentDidMount() {\r\n let full_name = this.getValueFromTrueIdAndUser('full_name', this.props.data_cmt, 'name', this.props.data_true_id);\r\n let identity_number = this.getValueFromTrueIdAndUser('identity_number', this.props.data_cmt, 'id_number', this.props.data_true_id);\r\n let dob = this.getValueFromTrueIdAndUser('dob', this.props.data_cmt, 'dob', this.props.data_true_id);\r\n let id_issue_address = this.getValueFromTrueIdAndUser('id_issue_address', this.props.data_cmt, 'given_place', this.props.data_true_id);\r\n let id_issue_date = this.getValueFromTrueIdAndUser('id_issue_date', this.props.data_cmt, 'given_date', this.props.data_true_id);\r\n\r\n this.setState({\r\n id_name: full_name,\r\n id_number: identity_number,\r\n id_dob: dob,\r\n id_issue_date,\r\n id_issue_address,\r\n })\r\n }\r\n\r\n render_img = src_link => {\r\n let max_h = 400;\r\n return (\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n render_img_selfie = src_link => {\r\n let max_h = 150;\r\n return (\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n onChangeList_fail = event => {\r\n\r\n let pre_list_check = this.state.list_check_fail;\r\n let index_of_item = this.state.list_check_fail.findIndex(\r\n a => a.title === event.target.name\r\n );\r\n pre_list_check[index_of_item].check = event.target.checked;\r\n this.setState({ list_check_fail: pre_list_check });\r\n };\r\n\r\n card_text = (label, value, onChange, key) => {\r\n return (\r\n \r\n {label} \r\n onChange(event.target.value)}\r\n />\r\n
\r\n );\r\n };\r\n\r\n render_accept = () => {\r\n return (\r\n \r\n {this.card_text('Họ và tên', this.state.id_name, value =>\r\n this.setState({ id_name: value }), 'name'\r\n )}\r\n {this.card_text('Số CMTND/CCCD hộ chiếu', this.state.id_number, value =>\r\n this.setState({ id_number: value }), 'id_number'\r\n )}\r\n {this.card_text('Ngày sinh', this.state.id_dob, value =>\r\n this.setState({ id_dob: value }), 'dob'\r\n )}\r\n {this.card_text('Ngày cấp', this.state.id_issue_date, value =>\r\n this.setState({ id_issue_date: value }), 'given_date'\r\n )}\r\n {this.card_text('Nơi cấp', this.state.id_issue_address, value =>\r\n this.setState({ id_issue_address: value }), 'given_place'\r\n )}\r\n \r\n );\r\n };\r\n\r\n render_rejcet = () => {\r\n return (\r\n \r\n \r\n \r\n {this.state.list_check_fail.map(item => (\r\n this.onChangeList_fail(event)}\r\n name={item.title}\r\n />\r\n }\r\n label={item.title}\r\n />\r\n ))}\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n isValidDate(date) {\r\n return /^\\d{2}\\/\\d{2}\\/\\d{4}$/.test(date);\r\n }\r\n\r\n render_cs_confirm = () => {\r\n if (this.state.is_accept) {\r\n if (\r\n this.state.id_number && this.state.id_name && this.state.id_issue_address && this.isValidDate(this.state.id_issue_date)\r\n && this.isValidDate(this.state.id_dob)\r\n ) {\r\n return (\r\n \r\n this.props.send_accept({\r\n identity_number: this.state.id_number,\r\n full_name: this.state.id_name,\r\n dob: this.state.id_dob,\r\n id_issue_date: this.state.id_issue_date,\r\n id_issue_address: this.state.id_issue_address\r\n })\r\n }>\r\n Xác nhận\r\n \r\n );\r\n }\r\n }\r\n };\r\n\r\n render() {\r\n return (\r\n \r\n
\r\n \r\n {this.render_img_selfie(this.props.data.result.selfie)}\r\n {this.render_img(this.props.data.result.front)}\r\n {this.render_img(this.props.data.result.back)}\r\n \r\n\r\n \r\n this.setState({ deg_rotate: this.state.deg_rotate + 90 })\r\n }>\r\n \r\n \r\n \r\n\r\n
\r\n this.setState({ is_accept: true })}>\r\n Accept\r\n \r\n \r\n this.props.send_reject('')\r\n }\r\n >\r\n Reject\r\n \r\n {this.state.is_accept === true ? this.render_accept() : null}\r\n {this.state.is_accept === false ? this.render_rejcet() : null}\r\n\r\n {this.render_cs_confirm()}\r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default IDCard;","import React, { useState, useEffect } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport ListItem from '@material-ui/core/ListItem';\r\nimport ListItemText from '@material-ui/core/ListItemText';\r\nimport { FixedSizeList } from 'react-window';\r\nimport { List } from '@material-ui/core';\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n width: '100%',\r\n maxWidth: 360,\r\n backgroundColor: theme.palette.background.paper,\r\n position: 'relative',\r\n overflow: 'auto',\r\n maxHeight: 350,\r\n },\r\n listSection: {\r\n backgroundColor: 'inherit',\r\n },\r\n ul: {\r\n backgroundColor: 'inherit',\r\n padding: 0,\r\n },\r\n}));\r\n\r\n\r\n\r\nexport default function VirtualizedList({ data, handleOnCick }) {\r\n const classes = useStyles();\r\n return (\r\n \r\n {data.length > 0 && \r\n {data.map(el => {\r\n return \r\n handleOnCick(el.user_id)} />\r\n \r\n })}\r\n
}\r\n\r\n
\r\n );\r\n}","import React, { Component } from 'react';\r\nimport {\r\n Button,\r\n FormControl,\r\n FormGroup,\r\n Checkbox,\r\n FormControlLabel,\r\n Card,\r\n Box,\r\n Typography,\r\n TextField\r\n} from '@material-ui/core';\r\nimport RotateRightIcon from '@material-ui/icons/RotateRight';\r\nimport { list_check_fail } from './data';\r\n\r\nclass CheckUserPassport extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n reason: '',\r\n reject: false,\r\n accept: false,\r\n deg_rotate: 0,\r\n list_check_fail: list_check_fail,\r\n\r\n is_accept: null,\r\n\r\n id_name: null,\r\n id_identity: null,\r\n id_dob: null,\r\n id_nationality: null,\r\n id_issue_date: null,\r\n unrender: false,\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n if (this.props.data_cmt) {\r\n console.log(this.props.data_cmt)\r\n let { passport_info } = this.props.data_cmt;\r\n this.setState({\r\n id_name: passport_info.name,\r\n id_dob: passport_info.dob,\r\n id_identity: passport_info.identity,\r\n id_issue_date: passport_info.id_issue_date,\r\n id_nationality: passport_info.nationality\r\n })\r\n }\r\n else {\r\n alert(\"không có dữ liệu\")\r\n this.setState({\r\n unrender: true\r\n })\r\n }\r\n\r\n }\r\n\r\n render_img = src_link => {\r\n let max_h = 400;\r\n return (\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n render_img_selfie = src_link => {\r\n let max_h = 150;\r\n return (\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n onChangeList_fail = event => {\r\n\r\n let pre_list_check = this.state.list_check_fail;\r\n let index_of_item = this.state.list_check_fail.findIndex(\r\n a => a.title === event.target.name\r\n );\r\n pre_list_check[index_of_item].check = event.target.checked;\r\n this.setState({ list_check_fail: pre_list_check });\r\n };\r\n\r\n card_text = (label, value, onChange, key) => {\r\n return (\r\n \r\n {label} \r\n onChange(event.target.value)}\r\n />\r\n
\r\n );\r\n };\r\n\r\n card_textarea = (label, value, onChange, key) => {\r\n return (\r\n \r\n onChange(event.target.value)}\r\n />\r\n
\r\n );\r\n };\r\n\r\n render_rejcet = () => {\r\n return (\r\n \r\n {this.card_textarea('Lí do từ chối', this.state.reason, value =>\r\n this.setState({ reason: value }), 'reason'\r\n )}\r\n \r\n );\r\n };\r\n\r\n render_cs_confirm = () => {\r\n if (this.state.is_accept == false) {\r\n return (\r\n {\r\n this.props.send_reject(this.state.reason);\r\n }}\r\n style={{ backgroundColor: 'rgb(244,67,54)', color: 'white' }}>\r\n Xác nhận thông tin sai và gửi thông báo\r\n \r\n );\r\n }\r\n };\r\n\r\n render() {\r\n return (\r\n \r\n
\r\n \r\n {this.render_img_selfie(this.props.data.result.selfie)}\r\n {this.render_img(this.props.data.result.front)}\r\n {this.render_img(this.props.data.result.back)}\r\n \r\n\r\n \r\n this.setState({ deg_rotate: this.state.deg_rotate + 90 })\r\n }>\r\n \r\n \r\n \r\n
\r\n {this.card_text('Họ và tên', this.state.id_name, value =>\r\n this.setState({ id_name: value }), 'name'\r\n )}\r\n {this.card_text('Ngày sinh', this.state.id_dob, value =>\r\n this.setState({ id_dob: value }), 'dob'\r\n )}\r\n {this.card_text('Số hộ chiếu', this.state.id_identity, value =>\r\n this.setState({ id_identity: value }), 'id_identity'\r\n )}\r\n {this.card_text('Ngày cấp', this.state.id_issue_date, value =>\r\n this.setState({ id_issue_date: value }), 'given_date'\r\n )}\r\n {this.card_text('Nơi cấp', this.state.id_nationality, value =>\r\n this.setState({ id_nationality: value }), 'given_place'\r\n )}\r\n \r\n
\r\n \r\n this.props.send_accept({\r\n identity: this.state.id_identity,\r\n name: this.state.id_name,\r\n dob: this.state.id_dob,\r\n id_issue_date: this.state.id_issue_date,\r\n nationality: this.state.id_nationality\r\n })\r\n }>\r\n Accept\r\n \r\n this.setState({ is_accept: false })}\r\n >\r\n Reject\r\n \r\n {this.state.is_accept == true ? this.render_accept() : null}\r\n {this.state.is_accept == false ? this.render_rejcet() : null}\r\n\r\n {this.render_cs_confirm()}\r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default CheckUserPassport;\r\n","import React, { Component } from 'react';\r\nimport {\r\n Button,\r\n FormControl,\r\n FormGroup,\r\n Checkbox,\r\n FormControlLabel,\r\n Card,\r\n Box,\r\n Typography,\r\n TextField\r\n} from '@material-ui/core';\r\nimport RotateRightIcon from '@material-ui/icons/RotateRight';\r\nimport { list_check_fail } from './data';\r\n\r\nclass ReEkyc extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n ly_do_reject: 0,\r\n reject: false,\r\n accept: false,\r\n deg_rotate: 0,\r\n list_check_fail: list_check_fail,\r\n\r\n is_accept: null,\r\n\r\n id_name: null,\r\n id_number: null,\r\n id_dob: null,\r\n id_issue_address: null,\r\n id_issue_date: null,\r\n unrender:false,\r\n };\r\n }\r\n\r\n getValueFromTrueIdAndUser(key, data_cmt, key_true_id, data_true_id) {\r\n if (data_cmt && data_cmt[key]) return data_cmt[key]\r\n if (data_true_id && data_true_id[key_true_id]) return data_true_id[key_true_id]\r\n return ''\r\n }\r\n\r\n componentDidMount() {\r\n let full_name = this.getValueFromTrueIdAndUser('full_name', this.props.data_cmt, 'name', this.props.data_true_id);\r\n let identity_number = this.getValueFromTrueIdAndUser('identity_number', this.props.data_cmt, 'id_number', this.props.data_true_id);\r\n let dob = this.getValueFromTrueIdAndUser('dob', this.props.data_cmt, 'dob', this.props.data_true_id);\r\n let id_issue_address = this.getValueFromTrueIdAndUser('id_issue_address', this.props.data_cmt, 'given_place', this.props.data_true_id);\r\n let id_issue_date = this.getValueFromTrueIdAndUser('id_issue_date', this.props.data_cmt, 'given_date', this.props.data_true_id);\r\n\r\n this.setState({\r\n id_name: full_name,\r\n id_number: identity_number,\r\n id_dob: dob,\r\n id_issue_date,\r\n id_issue_address,\r\n })\r\n }\r\n\r\n render_img = src_link => {\r\n let max_h = 400;\r\n return (\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n render_img_selfie = src_link => {\r\n let max_h = 150;\r\n return (\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n onChangeList_fail = event => {\r\n\r\n let pre_list_check = this.state.list_check_fail;\r\n let index_of_item = this.state.list_check_fail.findIndex(\r\n a => a.title === event.target.name\r\n );\r\n pre_list_check[index_of_item].check = event.target.checked;\r\n this.setState({ list_check_fail: pre_list_check });\r\n };\r\n\r\n card_text = (label, value, onChange, key) => {\r\n return (\r\n \r\n {label} \r\n onChange(event.target.value)}\r\n />\r\n
\r\n );\r\n };\r\n\r\n render_accept = () => {\r\n return (\r\n \r\n {this.card_text('Họ và tên', this.state.id_name, value =>\r\n this.setState({ id_name: value }), 'name'\r\n )}\r\n {this.card_text('Số CMTND/CCCD hộ chiếu', this.state.id_number, value =>\r\n this.setState({ id_number: value }), 'id_number'\r\n )}\r\n {this.card_text('Ngày sinh', this.state.id_dob, value =>\r\n this.setState({ id_dob: value }), 'dob'\r\n )}\r\n {this.card_text('Ngày cấp', this.state.id_issue_date, value =>\r\n this.setState({ id_issue_date: value }), 'given_date'\r\n )}\r\n {this.card_text('Nơi cấp', this.state.id_issue_address, value =>\r\n this.setState({ id_issue_address: value }), 'given_place'\r\n )}\r\n \r\n );\r\n };\r\n\r\n render_rejcet = () => {\r\n return (\r\n \r\n \r\n \r\n {this.state.list_check_fail.map(item => (\r\n this.onChangeList_fail(event)}\r\n name={item.title}\r\n />\r\n }\r\n label={item.title}\r\n />\r\n ))}\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n isValidDate(date) {\r\n return /^\\d{2}\\/\\d{2}\\/\\d{4}$/.test(date);\r\n }\r\n\r\n render_cs_confirm = () => {\r\n if (this.state.is_accept) {\r\n if (\r\n this.state.id_number && this.state.id_name && this.state.id_issue_address && this.isValidDate(this.state.id_issue_date)\r\n && this.isValidDate(this.state.id_dob)\r\n ) {\r\n return (\r\n \r\n this.props.send_accept({\r\n identity_number: this.state.id_number,\r\n full_name: this.state.id_name,\r\n dob: this.state.id_dob,\r\n id_issue_date: this.state.id_issue_date,\r\n id_issue_address: this.state.id_issue_address\r\n })\r\n }>\r\n Xác nhận\r\n \r\n );\r\n }\r\n }\r\n };\r\n\r\n render() {\r\n return (\r\n \r\n
\r\n \r\n {this.render_img_selfie(this.props.data.result.selfie)}\r\n {this.render_img(this.props.data.result.front)}\r\n {this.render_img(this.props.data.result.back)}\r\n \r\n\r\n \r\n this.setState({ deg_rotate: this.state.deg_rotate + 90 })\r\n }>\r\n \r\n \r\n \r\n\r\n
\r\n this.setState({ is_accept: true })}>\r\n Accept\r\n \r\n \r\n this.props.send_reject('')\r\n }\r\n >\r\n Reject\r\n \r\n {this.state.is_accept === true ? this.render_accept() : null}\r\n {this.state.is_accept === false ? this.render_rejcet() : null}\r\n\r\n {this.render_cs_confirm()}\r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default ReEkyc;","import React, { Component } from 'react';\r\nimport { toast } from 'react-toastify';\r\nimport CONST_DATA from 'constant';\r\nimport Axios from 'axios';\r\nimport CmtItem from './CmtItem';\r\nimport {\r\n Button,\r\n CircularProgress,\r\n TextField,\r\n Typography\r\n} from '@material-ui/core';\r\nimport Selfie from './Selfie';\r\nimport UpdateUserInfo from './UpdateUserInfo';\r\nimport IDCard from './IDCard';\r\nimport VirtualizedList from 'components/VirtualizedList/ListVirtualized';\r\nimport CheckUserPassport from './Passport';\r\nimport ReEkyc from './ReEkyc';\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n access_token: null,\r\n user_id: null,\r\n data_success: false,\r\n data: null,\r\n\r\n is_loading: false,\r\n user_id_chosing: this.props.match.params.user_id,\r\n\r\n seach_text: null,\r\n\r\n data_detail: null,\r\n data_detail_success: false,\r\n\r\n data_cmt: null,\r\n data_cmt_success: false,\r\n\r\n need_cs_check_ly_do: 1,\r\n data_true_id: null,\r\n loading_confirm: false\r\n };\r\n }\r\n\r\n check_login = () => {\r\n let login_data = localStorage.getItem(CONST_DATA.localStorage_login);\r\n\r\n if (login_data === null) {\r\n this.props.history.push(CONST_DATA.router_sign_in);\r\n } else {\r\n login_data = JSON.parse(login_data);\r\n this.setState({\r\n access_token: login_data.access_token,\r\n user_id: login_data.user_id\r\n });\r\n }\r\n };\r\n\r\n async componentDidMount() {\r\n await this.check_login();\r\n await this.get_list(this.state.need_cs_check_ly_do);\r\n\r\n if (this.state.user_id_chosing != null) {\r\n this.get_data_detail(this.state.user_id_chosing);\r\n }\r\n }\r\n\r\n send_accept = data => {\r\n const body_req = {\r\n admin_assign: this.state.user_id,\r\n access_token: this.state.access_token,\r\n user_id: this.state.user_id_chosing,\r\n ocr_id: data\r\n };\r\n this.setState({ loading_confirm: true })\r\n\r\n Axios.post(CONST_DATA.cmt_trueid_api_cs_accept, body_req)\r\n .then(response => {\r\n if (response.data.status === 'success') {\r\n this.props.history.push(CONST_DATA.router_cmt);\r\n toast.success('Cập nhật thông tin thành công.')\r\n window.location.reload();\r\n }\r\n this.setState({ loading_confirm: false })\r\n })\r\n .catch(error => {\r\n this.setState({ loading_confirm: false })\r\n toast.error('Cập nhật thông tin không thành công vui lòng thử lại.')\r\n });\r\n };\r\n\r\n send_accept_new = data => {\r\n const body_req = {\r\n admin_assign: this.state.user_id,\r\n access_token: this.state.access_token,\r\n user_id: this.state.user_id_chosing,\r\n ocr_id: data\r\n };\r\n this.setState({ loading_confirm: true })\r\n\r\n Axios.post(CONST_DATA.ekyc_api_cs_accept, body_req)\r\n .then(response => {\r\n if (response.data.error_code === '0') {\r\n this.props.history.push(CONST_DATA.router_cmt);\r\n toast.success('Cập nhật thông tin người dùng thành công.');\r\n window.location.reload();\r\n } else {\r\n toast.error(`Cập nhật thông tin người dùng không thành công: ${response.data.message}`)\r\n }\r\n this.setState({ loading_confirm: false })\r\n })\r\n .catch(error => {\r\n this.setState({ loading_confirm: false })\r\n toast.error('Cập nhật thông tin không thành công vui lòng thử lại.')\r\n });\r\n };\r\n\r\n send_confirm_selfie = (status, reason) => {\r\n const body_req = {\r\n admin_assign: this.state.user_id,\r\n access_token: this.state.access_token,\r\n user_id: this.state.user_id_chosing,\r\n accept: status,\r\n // content: reason\r\n };\r\n // if (reason) {\r\n // body_req.content = reason;\r\n // }\r\n // console.log({ body_req });\r\n\r\n Axios.post(CONST_DATA.check_selfie, body_req)\r\n .then(response => {\r\n const result = response.data;\r\n if (result.error_code === '0') {\r\n this.props.history.push(CONST_DATA.router_cmt);\r\n toast.success('Cập nhật thông tin người dùng thành công.');\r\n }\r\n else {\r\n toast.error(`Cập nhật thông tin người dùng không thành công: ${result.message}`)\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error)\r\n });\r\n };\r\n\r\n send_reject = data => {\r\n const body_req = {\r\n admin_assign: this.state.user_id,\r\n access_token: this.state.access_token,\r\n user_id: this.state.user_id_chosing,\r\n reject_data: data\r\n };\r\n this.setState({ loading_confirm: true })\r\n Axios.post(CONST_DATA.cmt_trueid_api_cs_reject, body_req)\r\n .then(response => {\r\n if (response.data.status === 'success') {\r\n this.props.history.push(CONST_DATA.router_cmt);\r\n window.location.reload();\r\n this.setState({ loading_confirm: false })\r\n }\r\n this.setState({ loading_confirm: false })\r\n })\r\n .catch(error => {\r\n toast.error('Cập nhật không thành công vui lòng thử lại.')\r\n this.setState({ loading_confirm: false })\r\n });\r\n };\r\n\r\n send_reject_new = data => {\r\n const body_req = {\r\n admin_assign: this.state.user_id,\r\n access_token: this.state.access_token,\r\n user_id: this.state.user_id_chosing,\r\n reject_data: data\r\n };\r\n this.setState({ loading_confirm: true })\r\n Axios.post(CONST_DATA.ekyc_api_cs_reject, body_req)\r\n .then(response => {\r\n if (response.data.error_code === '0') {\r\n this.props.history.push(CONST_DATA.router_cmt);\r\n toast.success('Cập nhật thông tin người dùng thành công.');\r\n window.location.reload();\r\n } else {\r\n toast.error(`Cập nhật thông tin người dùng không thành công: ${response.data.message}`)\r\n }\r\n this.setState({ loading_confirm: false })\r\n })\r\n .catch(error => {\r\n toast.error('Cập nhật không thành công vui lòng thử lại.')\r\n this.setState({ loading_confirm: false })\r\n });\r\n };\r\n\r\n // re-ekyc\r\n send_re_ekyc_accept = data => {\r\n const body_req = {\r\n admin_assign: this.state.user_id,\r\n access_token: this.state.access_token,\r\n user_id: this.state.user_id_chosing,\r\n ocr_id: data\r\n };\r\n this.setState({ loading_confirm: true })\r\n\r\n this.send_cs_action(CONST_DATA.re_ekyc_cs_accept, body_req)\r\n };\r\n\r\n send_re_ekyc_reject = data => {\r\n const body_req = {\r\n admin_assign: this.state.user_id,\r\n access_token: this.state.access_token,\r\n user_id: this.state.user_id_chosing,\r\n reject_data: data\r\n };\r\n this.setState({ loading_confirm: true })\r\n \r\n this.send_cs_action(CONST_DATA.re_ekyc_cs_reject, body_req)\r\n };\r\n\r\n send_cs_action = (url, data) => {\r\n Axios.post(url, data)\r\n .then(response => {\r\n if (response.data.error_code === '0') {\r\n this.props.history.push(CONST_DATA.router_cmt);\r\n toast.success('Cập nhật thông tin người dùng thành công.');\r\n window.location.reload();\r\n } else {\r\n toast.error(`Cập nhật thông tin người dùng không thành công: ${response.data.message}`)\r\n }\r\n this.setState({ loading_confirm: false })\r\n })\r\n .catch(error => {\r\n toast.error('Cập nhật không thành công vui lòng thử lại.')\r\n this.setState({ loading_confirm: false })\r\n });\r\n }\r\n\r\n get_list = need_cs_check_ly_do => {\r\n const body_req = {\r\n admin_assign: this.state.user_id,\r\n access_token: this.state.access_token,\r\n need_cs_check_ly_do: need_cs_check_ly_do\r\n };\r\n\r\n Axios.post(CONST_DATA.cmt_get_list, body_req)\r\n .then(response => {\r\n if (response.data.status === 'success') {\r\n this.setState({\r\n data_success: true,\r\n data: response.data.data\r\n });\r\n }\r\n })\r\n .catch(error => {\r\n });\r\n };\r\n\r\n get_data_detail = async uid => {\r\n const body_req = {\r\n admin_assign: this.state.user_id,\r\n access_token: this.state.access_token,\r\n user_id: uid,\r\n is_re_ekyc: [14,15,16].includes(this.state.need_cs_check_ly_do)\r\n };\r\n\r\n await this.setState({\r\n data_detail_success: false,\r\n data_detail: null,\r\n data_cmt_success: false,\r\n data_cmt: null,\r\n is_loading: true\r\n });\r\n\r\n await Axios.post(CONST_DATA.cmt_get_image, body_req)\r\n // Axios.post('https://cs.finhay.com.vn/api_finhaycs/cmt/get_image', body_req)\r\n .then(response => {\r\n if (response.data.status === 'success') {\r\n this.setState({\r\n data_detail_success: true,\r\n data_detail: response.data.data,\r\n is_loading: false\r\n });\r\n }\r\n else {\r\n\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n });\r\n\r\n\r\n // cap nhat thong tin user\r\n if ([5,7,9,10,11,12,13,14,15,16].includes(this.state.need_cs_check_ly_do)) {\r\n await Axios.post(CONST_DATA.cmt_get_detail_user_id, body_req)\r\n .then(response => {\r\n if (response.data.status === 'success') {\r\n const { user_info_updated_by_user, true_id } = response.data.data;\r\n if (true_id && true_id.ocr_id && true_id.ocr_id.data_fields) {\r\n console.log(true_id.ocr_id.data_fields);\r\n const data_true_id = true_id.ocr_id.data_fields;\r\n const data_true_id_state = {};\r\n for (const key in data_true_id) {\r\n data_true_id_state[key] = data_true_id[key].value;\r\n }\r\n this.setState({ data_true_id: data_true_id_state })\r\n }\r\n this.setState({ data_cmt_success: true, data_cmt: user_info_updated_by_user, is_loading: false });\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n });\r\n }\r\n else {\r\n await Axios.post(CONST_DATA.cmt_get_detail_user_id, body_req)\r\n .then(response => {\r\n if (response.data.status === 'success') {\r\n this.setState({\r\n data_cmt_success: true,\r\n data_cmt: response.data.data,\r\n is_loading: false\r\n });\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n });\r\n }\r\n };\r\n\r\n seach_user_id = () => {\r\n this.props.history.push(\r\n CONST_DATA.router_cmt + '/' + this.state.seach_text\r\n );\r\n\r\n this.setState({\r\n user_id_chosing: this.state.seach_text\r\n });\r\n };\r\n\r\n render_detail_info = () => {\r\n if (this.state.need_cs_check_ly_do === 6) {\r\n return \r\n }\r\n if (this.state.need_cs_check_ly_do === 5) {\r\n return this.handleAccept(data)}\r\n data_true_id={this.state.data_true_id}\r\n loading_confirm={this.state.loading_confirm}\r\n send_confirm_selfie={this.send_confirm_selfie}\r\n > \r\n }\r\n if (this.state.need_cs_check_ly_do === 8) {\r\n return this.acceptAndUpdatePassportInfor(data)}\r\n send_reject={data => this.rejectPassportInfor(data)}\r\n loading_confirm={this.state.loading_confirm}\r\n > \r\n }\r\n if ([7,9,10,11,12,13].includes(this.state.need_cs_check_ly_do)) {\r\n return this.send_accept_new(data)}\r\n send_reject={data => this.send_reject_new(data)}\r\n > \r\n }\r\n if ([14,15,16].includes(this.state.need_cs_check_ly_do)) {\r\n return this.send_re_ekyc_accept(data)}\r\n send_reject={data => this.send_re_ekyc_reject(data)}\r\n > \r\n }\r\n return this.send_accept(data)}\r\n send_reject={data => this.send_reject(data)}\r\n loading_confirm={this.state.loading_confirm}\r\n />\r\n };\r\n\r\n handleAccept = async (data_ocr) => {\r\n const body_req = {\r\n access_token: this.state.access_token,\r\n admin_assign: this.state.user_id,\r\n user_id: this.state.user_id_chosing,\r\n ocr_id: data_ocr\r\n };\r\n this.setState({ loading_confirm: true })\r\n await Axios.post(CONST_DATA.accept_trueid_v2, body_req)\r\n .then(response => {\r\n const result = response.data;\r\n // if (result.status === 'success') {\r\n // toast.success('Cập nhật thông tin thành công.');\r\n // window.location.reload();\r\n // }\r\n // else if (result.status === 'error') {\r\n // toast.error(`Cập nhật thông tin không thành công: ${result.data}`);\r\n // }\r\n if (result.error_code === '0') {\r\n toast.success('Cập nhật thông tin thành công.');\r\n window.location.reload();\r\n }\r\n else {\r\n toast.error(`Cập nhật thông tin không thành công: ${result.message}`);\r\n }\r\n this.setState({ loading_confirm: false })\r\n })\r\n .catch(error => {\r\n this.setState({ loading_confirm: false })\r\n console.log(error);\r\n });\r\n }\r\n\r\n // accept và update thông tin passport người dùng\r\n acceptAndUpdatePassportInfor = async (passport_info) => {\r\n const body_req = {\r\n access_token: this.state.access_token,\r\n admin_assign: this.state.user_id,\r\n user_id: this.state.user_id_chosing,\r\n passport_info: passport_info\r\n };\r\n this.setState({ loading_confirm: true })\r\n await Axios.put(CONST_DATA.cmt_passport_api_cs_accept, body_req)\r\n .then(response => {\r\n const result = response.data;\r\n if (result.error_code === '0') {\r\n this.props.history.push(CONST_DATA.router_cmt);\r\n toast.success('Cập nhật thông tin thành công.');\r\n window.location.reload();\r\n }\r\n else {\r\n toast.error(`Cập nhật thông tin không thành công: ${result.message}`);\r\n }\r\n this.setState({ loading_confirm: false })\r\n })\r\n .catch(error => {\r\n this.setState({ loading_confirm: false })\r\n console.log(error);\r\n });\r\n }\r\n\r\n //reject passport user\r\n rejectPassportInfor = async (reason) => {\r\n const body_req = {\r\n access_token: this.state.access_token,\r\n admin_assign: this.state.user_id,\r\n user_id: this.state.user_id_chosing,\r\n reason: reason\r\n };\r\n this.setState({ loading_confirm: true })\r\n await Axios.put(CONST_DATA.cmt_passport_api_cs_reject, body_req)\r\n .then(response => {\r\n const result = response.data;\r\n if (result.error_code === '0') {\r\n toast.success('Đã thành công.');\r\n this.props.history.push(CONST_DATA.router_cmt);\r\n window.location.reload();\r\n }\r\n else {\r\n toast.error(`Cập nhật thông tin không thành công: ${result.message}`);\r\n }\r\n this.setState({ loading_confirm: false })\r\n })\r\n .catch(error => {\r\n this.setState({ loading_confirm: false })\r\n console.log(error);\r\n });\r\n }\r\n\r\n handleOnClickItemUserId = (user_id) => {\r\n this.props.history.push(\r\n CONST_DATA.router_cmt + '/' + user_id\r\n );\r\n this.setState({\r\n user_id_chosing: user_id,\r\n data_cmt_success: false,\r\n data_detail_success: false\r\n });\r\n\r\n this.get_data_detail(user_id);\r\n }\r\n\r\n render() {\r\n let need_cs_check_ly_do_arr = [\r\n // { code: 1, title: 'Quá 3 lần check' },\r\n // { code: 2, title: 'Hộ chiếu' },\r\n // { code: 3, title: 'Sai mặt' },\r\n // { code: 4, title: 'Tên - bank - cmt không khớp' },\r\n { code: 5, title: 'Cập nhật thông tin người dùng' },\r\n { code: 6, title: 'Đối chiếu Selfie - CMT' },\r\n { code: 8, title: 'Đối chiếu Hộ chiếu' },\r\n { code: 7, title: 'Dưới 18 tuổi' },\r\n { code: 9, title: 'CMT hết hạn' },\r\n { code: 10, title: 'Cập nhật thông tin người dùng(Mới)' },\r\n { code: 11, title: 'Đối chiếu Selfie - CMT(Mới)' },\r\n { code: 12, title: 'Trùng Số CMT' },\r\n { code: 13, title: 'ID Validity lỗi' },\r\n { code: 14, title: '[Re-eKYC] Chụp ảnh sai 3 lần' },\r\n { code: 15, title: '[Re-eKYC] User thay đổi thông tin' },\r\n { code: 16, title: '[Re-eKYC] ID Validity lỗi' },\r\n ];\r\n\r\n return (\r\n \r\n
\r\n {need_cs_check_ly_do_arr.map(item => (\r\n {\r\n this.setState({\r\n data: null,\r\n data_success: false,\r\n need_cs_check_ly_do: item.code,\r\n data_cmt_success: false\r\n });\r\n this.get_list(item.code);\r\n }}\r\n style={{ margin: 10 }}\r\n variant=\"contained\"\r\n color={\r\n this.state.need_cs_check_ly_do === item.code\r\n ? 'primary'\r\n : 'default'\r\n }>\r\n \r\n {item.title}\r\n \r\n \r\n ))}\r\n\r\n {\r\n if (e.key === 'Enter') {\r\n this.seach_user_id();\r\n this.get_data_detail(this.state.seach_text);\r\n }\r\n }}\r\n onChange={event =>\r\n this.setState({ seach_text: event.target.value })\r\n }\r\n />\r\n\r\n\r\n {this.state.data_success\r\n ? \r\n : null}\r\n
\r\n\r\n
\r\n {this.state.is_loading ? : null}\r\n {this.state.data_detail_success && this.state.data_cmt_success && (\r\n this.render_detail_info()\r\n )}\r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default User;\r\n","import React, { Component } from 'react';\r\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\r\nimport {\r\n Grid,\r\n Paper,\r\n TextField,\r\n Typography,\r\n Button,\r\n Card\r\n} from '@material-ui/core';\r\nimport CONST_DATA from 'constant';\r\nimport Axios from 'axios';\r\nimport { get_time_second } from 'utility';\r\n\r\nconst styles = theme => ({\r\n root: {\r\n padding: theme.spacing(2),\r\n margin: theme.spacing(1)\r\n },\r\n textField: {\r\n margin: theme.spacing(1)\r\n }\r\n});\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n ticket_id: null,\r\n new_user_id: null,\r\n password: null,\r\n admin_id: null,\r\n error_text: null\r\n };\r\n }\r\n\r\n render_send = () => {\r\n if (\r\n this.state.ticket_id != null &&\r\n this.state.new_user_id != null &&\r\n this.state.password != null\r\n ) {\r\n return (\r\n this.send_data()}>\r\n Xác nhận\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n };\r\n\r\n send_data = () => {\r\n const body_req = {\r\n ticket_id: this.state.ticket_id,\r\n new_user_id: this.state.new_user_id,\r\n admin_id: this.props.admin_id,\r\n password: this.state.password\r\n };\r\n\r\n Axios.post(CONST_DATA.tao_ho_don, body_req)\r\n .then(response => {\r\n if (response.data.status == 'success') {\r\n window.location.reload();\r\n } else {\r\n this.setState({\r\n error_text: response.data.data\r\n });\r\n }\r\n })\r\n .catch(error => {\r\n console.log(error);\r\n });\r\n };\r\n\r\n render() {\r\n const { classes } = this.props;\r\n return (\r\n \r\n Tạo hộ đơn \r\n this.setState({ ticket_id: event.target.value })}\r\n />\r\n this.setState({ new_user_id: event.target.value })}\r\n />\r\n this.setState({ password: event.target.value })}\r\n />\r\n {this.state.error_text} \r\n {this.render_send()}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(User);\r\n","import React, { Component } from 'react';\r\nimport { withStyles } from '@material-ui/core/styles';\r\nimport {\r\n Grid,\r\n} from '@material-ui/core';\r\nimport CONST_DATA from 'constant';\r\nimport TaoHoDon from './TaoHoDon';\r\n\r\nconst styles = theme => ({\r\n root: {\r\n padding: theme.spacing(2),\r\n margin: theme.spacing(1)\r\n },\r\n textField: {\r\n margin: theme.spacing(1)\r\n }\r\n});\r\n\r\nclass User extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {};\r\n }\r\n\r\n check_login = () => {\r\n let login_data = localStorage.getItem(CONST_DATA.localStorage_login);\r\n\r\n if (login_data == null) {\r\n this.props.history.push(CONST_DATA.router_sign_in);\r\n } else {\r\n login_data = JSON.parse(login_data);\r\n this.setState({\r\n access_token: login_data.access_token,\r\n admin_id: login_data.user_id\r\n });\r\n }\r\n };\r\n\r\n componentDidMount() {\r\n this.check_login();\r\n }\r\n\r\n render() {\r\n const { classes } = this.props;\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(User);\r\n","import React from 'react';\r\nimport { Switch, Redirect } from 'react-router-dom';\r\nimport { RouteWithLayout } from './components';\r\nimport { Main as MainLayout, Minimal as MinimalLayout } from './layouts';\r\nimport {\r\n UserList as UserListView,\r\n SignIn as SignInView,\r\n NotFound as NotFoundView,\r\n Admin,\r\n Admin0,\r\n Detail,\r\n Ketoan,\r\n NewComment,\r\n KetoanHoantra,\r\n Cmt,\r\n DoiSoatEKyc,\r\n DanhSachNguoiDung\r\n} from './views';\r\nimport CONST_DATA from 'constant';\r\nimport Tool from 'views/Tool';\r\n\r\nconst Routes = () => {\r\n return (\r\n \r\n \r\n\r\n (\r\n \r\n )}\r\n exact\r\n layout={MainLayout}\r\n path={CONST_DATA.router_viec_cua_toi}\r\n />\r\n\r\n }\r\n exact\r\n layout={MainLayout}\r\n path={CONST_DATA.router_all}\r\n />\r\n\r\n }\r\n exact\r\n layout={MainLayout}\r\n path={CONST_DATA.router_doi_soat_ekyc}\r\n />\r\n }\r\n exact\r\n layout={MainLayout}\r\n path={CONST_DATA.router_can_xu_ly}\r\n />\r\n\r\n (\r\n \r\n )}\r\n exact\r\n layout={MainLayout}\r\n path={CONST_DATA.router_dang_giai_quyet}\r\n />\r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Routes;\r\n","import React, { Component } from 'react';\r\nimport { Router } from 'react-router-dom';\r\nimport { createBrowserHistory } from 'history';\r\nimport { Chart } from 'react-chartjs-2';\r\nimport { ThemeProvider } from '@material-ui/styles';\r\nimport validate from 'validate.js';\r\nimport { ToastContainer } from \"react-toastify\";\r\nimport { chartjs } from './helpers';\r\nimport theme from './theme';\r\nimport 'react-perfect-scrollbar/dist/css/styles.css';\r\nimport './assets/scss/index.scss';\r\nimport validators from './common/validators';\r\nimport Routes from './Routes';\r\n\r\nconst browserHistory = createBrowserHistory();\r\n\r\nChart.helpers.extend(Chart.elements.Rectangle.prototype, {\r\n draw: chartjs.draw\r\n});\r\n\r\nvalidate.validators = {\r\n ...validate.validators,\r\n ...validators\r\n};\r\n\r\nexport default class App extends Component {\r\n\r\n render() {\r\n console.log(\"ENVIRONMENT VARIABLE\", process.env)\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\n\r\nimport * as serviceWorker from './serviceWorker';\r\nimport App from './App';\r\nimport \"react-toastify/dist/ReactToastify.css\";\r\nReactDOM.render( , document.getElementById('root'));\r\n\r\nserviceWorker.unregister();\r\n"],"sourceRoot":""}