Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CmsPetrolPay
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
11
Issues
11
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Giang Tran
CmsPetrolPay
Commits
be49e123
Commit
be49e123
authored
Jan 24, 2024
by
tdgiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update code
parent
2c69692f
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
54 additions
and
50 deletions
+54
-50
Create.js
src/app/views/Company/Employee/Create.js
+6
-4
Index.js
src/app/views/Company/Employee/Index.js
+8
-4
Update.js
src/app/views/Company/Employee/Update.js
+6
-3
Create.js
src/app/views/Company/Function/Create.js
+4
-1
Index.js
src/app/views/Company/Function/Index.js
+7
-5
Update.js
src/app/views/Company/Function/Update.js
+5
-3
Index.js
src/app/views/Company/GroupRole/Index.js
+5
-19
Create.js
src/app/views/Company/Role/Create.js
+4
-2
Index.js
src/app/views/Company/Role/Index.js
+5
-5
Update.js
src/app/views/Company/Role/Update.js
+4
-4
No files found.
src/app/views/Company/Employee/Create.js
View file @
be49e123
...
@@ -25,7 +25,7 @@ import {
...
@@ -25,7 +25,7 @@ import {
}
from
'app/apis/Functions/dropdown'
}
from
'app/apis/Functions/dropdown'
import
PickerImage
from
'app/components/Input/PickerImage'
import
PickerImage
from
'app/components/Input/PickerImage'
import
{
actionByGroup
,
createEmployee
}
from
'app/apis/Functions/Employee'
import
{
actionByGroup
,
createEmployee
}
from
'app/apis/Functions/Employee'
import
{
useTranslation
}
from
'react-i18next'
const
SimpleForm
=
(
props
)
=>
{
const
SimpleForm
=
(
props
)
=>
{
const
[
state
,
setState
]
=
useState
({})
const
[
state
,
setState
]
=
useState
({})
const
[
listDepartment
,
setListDepartment
]
=
useState
([])
const
[
listDepartment
,
setListDepartment
]
=
useState
([])
...
@@ -36,6 +36,8 @@ const SimpleForm = (props) => {
...
@@ -36,6 +36,8 @@ const SimpleForm = (props) => {
const
[
role
,
setRole
]
=
useState
()
const
[
role
,
setRole
]
=
useState
()
const
[
listGroup
,
setGroup
]
=
useState
([])
const
[
listGroup
,
setGroup
]
=
useState
([])
const
[
checkAll
,
setCheckAll
]
=
useState
(
true
)
const
[
checkAll
,
setCheckAll
]
=
useState
(
true
)
const
{
t
}
=
useTranslation
()
useEffect
(()
=>
{
useEffect
(()
=>
{
getUserGroup
()
getUserGroup
()
},
[])
},
[])
...
@@ -56,7 +58,7 @@ const SimpleForm = (props) => {
...
@@ -56,7 +58,7 @@ const SimpleForm = (props) => {
history
.
push
(
'/'
)
history
.
push
(
'/'
)
},
100
)
},
100
)
}
else
{
}
else
{
toast
.
error
(
'Lấy giữ liệu thất bại !'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -73,7 +75,7 @@ const SimpleForm = (props) => {
...
@@ -73,7 +75,7 @@ const SimpleForm = (props) => {
history
.
push
(
'/'
)
history
.
push
(
'/'
)
},
100
)
},
100
)
}
else
{
}
else
{
toast
.
error
(
'Lấy giữ liệu thất bại !'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -105,7 +107,7 @@ const SimpleForm = (props) => {
...
@@ -105,7 +107,7 @@ const SimpleForm = (props) => {
})
})
}
}
}
else
{
}
else
{
toast
.
error
(
'Tạo nhân viên thất bại!'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
...
src/app/views/Company/Employee/Index.js
View file @
be49e123
...
@@ -11,6 +11,8 @@ import { connect } from 'react-redux'
...
@@ -11,6 +11,8 @@ import { connect } from 'react-redux'
import
{
showLoading
,
hideLoading
}
from
'app/redux/actions/loadingAction'
import
{
showLoading
,
hideLoading
}
from
'app/redux/actions/loadingAction'
import
{
toast
}
from
'react-toastify'
import
{
toast
}
from
'react-toastify'
import
useDebounce
from
'app/hooks/useDebounce'
import
useDebounce
from
'app/hooks/useDebounce'
import
{
useTranslation
}
from
'react-i18next'
const
ToolNotificate
=
(
props
)
=>
{
const
ToolNotificate
=
(
props
)
=>
{
const
[
txtSearch
,
setTxtSearch
]
=
useState
(
''
)
const
[
txtSearch
,
setTxtSearch
]
=
useState
(
''
)
const
[
activeSelected
,
setActiveSeleted
]
=
useState
(
null
)
const
[
activeSelected
,
setActiveSeleted
]
=
useState
(
null
)
...
@@ -21,7 +23,7 @@ const ToolNotificate = (props) => {
...
@@ -21,7 +23,7 @@ const ToolNotificate = (props) => {
const
[
totalRecords
,
setTotalRecord
]
=
useState
(
0
)
const
[
totalRecords
,
setTotalRecord
]
=
useState
(
0
)
const
history
=
useHistory
()
const
history
=
useHistory
()
const
{
t
}
=
useTranslation
()
const
[
data
,
setData
]
=
useState
([])
const
[
data
,
setData
]
=
useState
([])
const
[
permissions
,
setPermissions
]
=
useState
([])
const
[
permissions
,
setPermissions
]
=
useState
([])
// useEffect(() => {
// useEffect(() => {
...
@@ -49,7 +51,7 @@ const ToolNotificate = (props) => {
...
@@ -49,7 +51,7 @@ const ToolNotificate = (props) => {
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
else
{
}
else
{
toast
.
error
(
'Thay đổi trạng thái thất bại!'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -76,7 +78,9 @@ const ToolNotificate = (props) => {
...
@@ -76,7 +78,9 @@ const ToolNotificate = (props) => {
history
.
push
(
'/'
)
history
.
push
(
'/'
)
},
100
)
},
100
)
}
else
{
}
else
{
// enqueueSnackbar('Error!', { variant: 'error' })
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
})
}
}
}
catch
(
error
)
{}
}
catch
(
error
)
{}
}
}
...
@@ -100,7 +104,7 @@ const ToolNotificate = (props) => {
...
@@ -100,7 +104,7 @@ const ToolNotificate = (props) => {
history
.
push
(
'/'
)
history
.
push
(
'/'
)
},
100
)
},
100
)
}
else
{
}
else
{
toast
.
error
(
'Xoá bản ghi thất bại!'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
...
src/app/views/Company/Employee/Update.js
View file @
be49e123
...
@@ -31,6 +31,7 @@ import {
...
@@ -31,6 +31,7 @@ import {
detailEmployee
,
detailEmployee
,
updateEmployee
,
updateEmployee
,
}
from
'app/apis/Functions/Employee'
}
from
'app/apis/Functions/Employee'
import
{
useTranslation
}
from
'react-i18next'
const
SimpleForm
=
(
props
)
=>
{
const
SimpleForm
=
(
props
)
=>
{
const
[
state
,
setState
]
=
useState
({})
const
[
state
,
setState
]
=
useState
({})
...
@@ -44,6 +45,8 @@ const SimpleForm = (props) => {
...
@@ -44,6 +45,8 @@ const SimpleForm = (props) => {
const
[
checkAll
,
setCheckAll
]
=
useState
(
true
)
const
[
checkAll
,
setCheckAll
]
=
useState
(
true
)
const
location
=
useLocation
()
const
location
=
useLocation
()
const
[
defaultAction
,
setDefaultAction
]
=
useState
([])
const
[
defaultAction
,
setDefaultAction
]
=
useState
([])
const
{
t
}
=
useTranslation
()
useEffect
(()
=>
{
useEffect
(()
=>
{
getUserGroup
()
getUserGroup
()
getData
()
getData
()
...
@@ -94,7 +97,7 @@ const SimpleForm = (props) => {
...
@@ -94,7 +97,7 @@ const SimpleForm = (props) => {
history
.
push
(
'/'
)
history
.
push
(
'/'
)
},
100
)
},
100
)
}
else
{
}
else
{
toast
.
error
(
'Lấy giữ liệu thất bại !'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -111,7 +114,7 @@ const SimpleForm = (props) => {
...
@@ -111,7 +114,7 @@ const SimpleForm = (props) => {
history
.
push
(
'/'
)
history
.
push
(
'/'
)
},
100
)
},
100
)
}
else
{
}
else
{
toast
.
error
(
'Lấy giữ liệu thất bại !'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -142,7 +145,7 @@ const SimpleForm = (props) => {
...
@@ -142,7 +145,7 @@ const SimpleForm = (props) => {
})
})
}
}
}
else
{
}
else
{
toast
.
error
(
'Tạo nhân viên thất bại!'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
...
src/app/views/Company/Function/Create.js
View file @
be49e123
...
@@ -9,8 +9,11 @@ import { Breadcrumb, SimpleCard } from 'app/components'
...
@@ -9,8 +9,11 @@ import { Breadcrumb, SimpleCard } from 'app/components'
import
{
Link
,
useHistory
,
useLocation
}
from
'react-router-dom'
import
{
Link
,
useHistory
,
useLocation
}
from
'react-router-dom'
import
{
trimObject
}
from
'app/config/Function'
import
{
trimObject
}
from
'app/config/Function'
import
{
connect
}
from
'react-redux'
import
{
connect
}
from
'react-redux'
import
{
useTranslation
}
from
'react-i18next'
const
SimpleForm
=
(
props
)
=>
{
const
SimpleForm
=
(
props
)
=>
{
const
[
state
,
setState
]
=
useState
({})
const
[
state
,
setState
]
=
useState
({})
const
{
t
}
=
useTranslation
()
const
history
=
useHistory
()
const
history
=
useHistory
()
const
handleSubmit
=
async
(
event
)
=>
{
const
handleSubmit
=
async
(
event
)
=>
{
const
newValue
=
trimObject
(
state
)
const
newValue
=
trimObject
(
state
)
...
@@ -29,7 +32,7 @@ const SimpleForm = (props) => {
...
@@ -29,7 +32,7 @@ const SimpleForm = (props) => {
})
})
}
}
}
else
{
}
else
{
toast
.
error
(
'Tạo hành động thất bại!'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
...
src/app/views/Company/Function/Index.js
View file @
be49e123
...
@@ -11,11 +11,11 @@ import { connect } from 'react-redux'
...
@@ -11,11 +11,11 @@ import { connect } from 'react-redux'
import
{
showLoading
,
hideLoading
}
from
'app/redux/actions/loadingAction'
import
{
showLoading
,
hideLoading
}
from
'app/redux/actions/loadingAction'
import
{
toast
}
from
'react-toastify'
import
{
toast
}
from
'react-toastify'
import
useDebounce
from
'app/hooks/useDebounce'
import
useDebounce
from
'app/hooks/useDebounce'
import
{
useTranslation
}
from
'react-i18next'
const
ToolNotificate
=
(
props
)
=>
{
const
ToolNotificate
=
(
props
)
=>
{
const
[
txtSearch
,
setTxtSearch
]
=
useState
(
''
)
const
[
txtSearch
,
setTxtSearch
]
=
useState
(
''
)
const
searchDebount
=
useDebounce
(
txtSearch
,
1000
)
const
searchDebount
=
useDebounce
(
txtSearch
,
1000
)
const
{
t
}
=
useTranslation
()
const
[
activeSelected
,
setActiveSeleted
]
=
useState
(
null
)
const
[
activeSelected
,
setActiveSeleted
]
=
useState
(
null
)
const
[
changeActive
,
setChangeActive
]
=
useState
(
1
)
const
[
changeActive
,
setChangeActive
]
=
useState
(
1
)
...
@@ -52,7 +52,7 @@ const ToolNotificate = (props) => {
...
@@ -52,7 +52,7 @@ const ToolNotificate = (props) => {
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
else
{
}
else
{
toast
.
error
(
'Thay đổi trạng thái thất bại!'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -82,7 +82,9 @@ const ToolNotificate = (props) => {
...
@@ -82,7 +82,9 @@ const ToolNotificate = (props) => {
history
.
push
(
'/'
)
history
.
push
(
'/'
)
},
100
)
},
100
)
}
else
{
}
else
{
// enqueueSnackbar('Error!', { variant: 'error' })
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
})
}
}
}
}
...
@@ -105,7 +107,7 @@ const ToolNotificate = (props) => {
...
@@ -105,7 +107,7 @@ const ToolNotificate = (props) => {
history
.
push
(
'/'
)
history
.
push
(
'/'
)
},
100
)
},
100
)
}
else
{
}
else
{
toast
.
error
(
'Xoá bản ghi thất bại!'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
...
src/app/views/Company/Function/Update.js
View file @
be49e123
...
@@ -10,11 +10,13 @@ import { Link, useHistory, useLocation } from 'react-router-dom'
...
@@ -10,11 +10,13 @@ import { Link, useHistory, useLocation } from 'react-router-dom'
import
{
trimObject
}
from
'app/config/Function'
import
{
trimObject
}
from
'app/config/Function'
import
{
connect
}
from
'react-redux'
import
{
connect
}
from
'react-redux'
import
localStorageService
from
'app/services/localStorageService'
import
localStorageService
from
'app/services/localStorageService'
import
{
useTranslation
}
from
'react-i18next'
const
SimpleForm
=
(
props
)
=>
{
const
SimpleForm
=
(
props
)
=>
{
const
[
state
,
setState
]
=
useState
({})
const
[
state
,
setState
]
=
useState
({})
const
history
=
useHistory
()
const
history
=
useHistory
()
const
location
=
useLocation
()
const
location
=
useLocation
()
const
{
t
}
=
useTranslation
()
useEffect
(()
=>
{
useEffect
(()
=>
{
getData
()
getData
()
},
[])
},
[])
...
@@ -31,7 +33,7 @@ const SimpleForm = (props) => {
...
@@ -31,7 +33,7 @@ const SimpleForm = (props) => {
history
.
push
(
'/'
)
history
.
push
(
'/'
)
},
100
)
},
100
)
}
else
{
}
else
{
toast
.
error
(
'Lấy thông tin bản ghi thất bại!'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -54,7 +56,7 @@ const SimpleForm = (props) => {
...
@@ -54,7 +56,7 @@ const SimpleForm = (props) => {
})
})
}
}
}
else
{
}
else
{
toast
.
error
(
'Cập nhật hành động thất bại!'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
...
src/app/views/Company/GroupRole/Index.js
View file @
be49e123
...
@@ -11,7 +11,7 @@ import { connect } from 'react-redux'
...
@@ -11,7 +11,7 @@ import { connect } from 'react-redux'
import
{
showLoading
,
hideLoading
}
from
'app/redux/actions/loadingAction'
import
{
showLoading
,
hideLoading
}
from
'app/redux/actions/loadingAction'
import
{
toast
}
from
'react-toastify'
import
{
toast
}
from
'react-toastify'
import
useDebounce
from
'app/hooks/useDebounce'
import
useDebounce
from
'app/hooks/useDebounce'
import
{
useTranslation
}
from
'react-i18next'
const
ToolNotificate
=
(
props
)
=>
{
const
ToolNotificate
=
(
props
)
=>
{
const
[
txtSearch
,
setTxtSearch
]
=
useState
(
''
)
const
[
txtSearch
,
setTxtSearch
]
=
useState
(
''
)
const
[
activeSelected
,
setActiveSeleted
]
=
useState
(
null
)
const
[
activeSelected
,
setActiveSeleted
]
=
useState
(
null
)
...
@@ -20,25 +20,11 @@ const ToolNotificate = (props) => {
...
@@ -20,25 +20,11 @@ const ToolNotificate = (props) => {
const
[
pageIndex
,
setPageIndex
]
=
useState
(
0
)
const
[
pageIndex
,
setPageIndex
]
=
useState
(
0
)
const
[
pageSize
]
=
useState
(
10
)
const
[
pageSize
]
=
useState
(
10
)
const
[
totalRecords
,
setTotalRecord
]
=
useState
(
0
)
const
[
totalRecords
,
setTotalRecord
]
=
useState
(
0
)
const
{
t
}
=
useTranslation
()
const
history
=
useHistory
()
const
history
=
useHistory
()
const
[
data
,
setData
]
=
useState
([])
const
[
data
,
setData
]
=
useState
([])
const
[
permissions
,
setPermissions
]
=
useState
([])
const
[
permissions
,
setPermissions
]
=
useState
([])
// useEffect(() => {
// getListPermission();
// }, []);
// const getListPermission = () => {
// let temp = localStorage.getItem(KEY.LISTPATH);
// let listPath = JSON.parse(temp);
// if (listPath) {
// const newlist = listPath.map((e) => {
// if (e.function_code) return e.function_code;
// return e.action_code;
// });
// setPermissions(newlist);
// }
// };
const
handeChangeActive
=
async
(
id
,
status_id
)
=>
{
const
handeChangeActive
=
async
(
id
,
status_id
)
=>
{
props
.
showLoading
()
props
.
showLoading
()
...
@@ -50,7 +36,7 @@ const ToolNotificate = (props) => {
...
@@ -50,7 +36,7 @@ const ToolNotificate = (props) => {
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
else
{
}
else
{
toast
.
success
(
'Thay đổi trạng thái thất bại!'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -80,7 +66,7 @@ const ToolNotificate = (props) => {
...
@@ -80,7 +66,7 @@ const ToolNotificate = (props) => {
history
.
push
(
'/'
)
history
.
push
(
'/'
)
},
100
)
},
100
)
}
else
{
}
else
{
toast
.
error
(
'Lấy giữ liệu thất bại !'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -105,7 +91,7 @@ const ToolNotificate = (props) => {
...
@@ -105,7 +91,7 @@ const ToolNotificate = (props) => {
history
.
push
(
'/'
)
history
.
push
(
'/'
)
},
100
)
},
100
)
}
else
{
}
else
{
toast
.
error
(
'Xoá bản ghi thất bại!'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
...
src/app/views/Company/Role/Create.js
View file @
be49e123
...
@@ -32,11 +32,13 @@ import { trimObject } from 'app/config/Function'
...
@@ -32,11 +32,13 @@ import { trimObject } from 'app/config/Function'
import
{
connect
}
from
'react-redux'
import
{
connect
}
from
'react-redux'
import
{
showLoading
,
hideLoading
}
from
'app/redux/actions/loadingAction'
import
{
showLoading
,
hideLoading
}
from
'app/redux/actions/loadingAction'
import
{
createAction
}
from
'app/apis/Functions/action'
import
{
createAction
}
from
'app/apis/Functions/action'
import
{
useTranslation
}
from
'react-i18next'
const
SimpleForm
=
(
props
)
=>
{
const
SimpleForm
=
(
props
)
=>
{
const
[
state
,
setState
]
=
useState
({})
const
[
state
,
setState
]
=
useState
({})
const
[
listDrop
,
setListDrop
]
=
useState
([])
const
[
listDrop
,
setListDrop
]
=
useState
([])
const
history
=
useHistory
()
const
history
=
useHistory
()
const
{
t
}
=
useTranslation
()
useEffect
(()
=>
{
useEffect
(()
=>
{
getData
()
getData
()
},
[])
},
[])
...
@@ -74,7 +76,7 @@ const SimpleForm = (props) => {
...
@@ -74,7 +76,7 @@ const SimpleForm = (props) => {
})
})
}
}
}
else
{
}
else
{
toast
.
error
(
'Tạo hành động thất bại!'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
...
src/app/views/Company/Role/Index.js
View file @
be49e123
...
@@ -11,13 +11,13 @@ import { connect } from 'react-redux'
...
@@ -11,13 +11,13 @@ import { connect } from 'react-redux'
import
{
showLoading
,
hideLoading
}
from
'app/redux/actions/loadingAction'
import
{
showLoading
,
hideLoading
}
from
'app/redux/actions/loadingAction'
import
{
toast
}
from
'react-toastify'
import
{
toast
}
from
'react-toastify'
import
useDebounce
from
'app/hooks/useDebounce'
import
useDebounce
from
'app/hooks/useDebounce'
import
{
useTranslation
}
from
'react-i18next'
const
ToolNotificate
=
(
props
)
=>
{
const
ToolNotificate
=
(
props
)
=>
{
const
[
txtSearch
,
setTxtSearch
]
=
useState
(
''
)
const
[
txtSearch
,
setTxtSearch
]
=
useState
(
''
)
const
[
activeSelected
,
setActiveSeleted
]
=
useState
(
null
)
const
[
activeSelected
,
setActiveSeleted
]
=
useState
(
null
)
const
[
changeActive
,
setChangeActive
]
=
useState
(
1
)
const
[
changeActive
,
setChangeActive
]
=
useState
(
1
)
const
searchDebount
=
useDebounce
(
txtSearch
,
1000
)
const
searchDebount
=
useDebounce
(
txtSearch
,
1000
)
const
{
t
}
=
useTranslation
()
const
[
pageIndex
,
setPageIndex
]
=
useState
(
0
)
const
[
pageIndex
,
setPageIndex
]
=
useState
(
0
)
const
[
pageSize
]
=
useState
(
10
)
const
[
pageSize
]
=
useState
(
10
)
const
[
totalRecords
,
setTotalRecord
]
=
useState
(
0
)
const
[
totalRecords
,
setTotalRecord
]
=
useState
(
0
)
...
@@ -37,7 +37,7 @@ const ToolNotificate = (props) => {
...
@@ -37,7 +37,7 @@ const ToolNotificate = (props) => {
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
else
{
}
else
{
toast
.
error
(
'Thay đổi trạng thái thất bại!'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -67,7 +67,7 @@ const ToolNotificate = (props) => {
...
@@ -67,7 +67,7 @@ const ToolNotificate = (props) => {
history
.
push
(
'/'
)
history
.
push
(
'/'
)
},
100
)
},
100
)
}
else
{
}
else
{
toast
.
error
(
'Lấy giữ liệu thất bại !'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -92,7 +92,7 @@ const ToolNotificate = (props) => {
...
@@ -92,7 +92,7 @@ const ToolNotificate = (props) => {
history
.
push
(
'/'
)
history
.
push
(
'/'
)
},
100
)
},
100
)
}
else
{
}
else
{
toast
.
error
(
'Xoá bản ghi thất bại!'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
...
src/app/views/Company/Role/Update.js
View file @
be49e123
...
@@ -14,12 +14,12 @@ import { Link, useHistory, useLocation } from 'react-router-dom'
...
@@ -14,12 +14,12 @@ import { Link, useHistory, useLocation } from 'react-router-dom'
import
{
trimObject
}
from
'app/config/Function'
import
{
trimObject
}
from
'app/config/Function'
import
{
connect
}
from
'react-redux'
import
{
connect
}
from
'react-redux'
import
localStorageService
from
'app/services/localStorageService'
import
localStorageService
from
'app/services/localStorageService'
import
{
useTranslation
}
from
'react-i18next'
const
SimpleForm
=
(
props
)
=>
{
const
SimpleForm
=
(
props
)
=>
{
const
[
state
,
setState
]
=
useState
({})
const
[
state
,
setState
]
=
useState
({})
const
[
listDrop
,
setListDrop
]
=
useState
([])
const
[
listDrop
,
setListDrop
]
=
useState
([])
const
history
=
useHistory
()
const
history
=
useHistory
()
const
{
t
}
=
useTranslation
()
const
location
=
useLocation
()
const
location
=
useLocation
()
useEffect
(()
=>
{
useEffect
(()
=>
{
getDropDown
()
getDropDown
()
...
@@ -39,7 +39,7 @@ const SimpleForm = (props) => {
...
@@ -39,7 +39,7 @@ const SimpleForm = (props) => {
history
.
push
(
'/'
)
history
.
push
(
'/'
)
},
100
)
},
100
)
}
else
{
}
else
{
toast
.
error
(
'Lấy thông tin bản ghi thất bại!'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -54,7 +54,7 @@ const SimpleForm = (props) => {
...
@@ -54,7 +54,7 @@ const SimpleForm = (props) => {
history
.
push
(
'/'
)
history
.
push
(
'/'
)
},
100
)
},
100
)
}
else
{
}
else
{
toast
.
error
(
'Lấy giữ liệu thất bại !'
,
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment