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
649f5efa
Commit
649f5efa
authored
Jul 08, 2024
by
tdgiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upddate build
parent
b43ab868
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
705 additions
and
5 deletions
+705
-5
RootRoutes.jsx
src/app/RootRoutes.jsx
+2
-2
landingpage.js
src/app/apis/Functions/landingpage.js
+29
-0
url.js
src/app/apis/url.js
+1
-1
navigations.js
src/app/navigations.js
+2
-2
Create.js
src/app/views/landingpage/priceProduct/Create.js
+237
-0
Index.js
src/app/views/landingpage/priceProduct/Index.js
+155
-0
Table.js
src/app/views/landingpage/priceProduct/Table.js
+0
-0
Update.js
src/app/views/landingpage/priceProduct/Update.js
+159
-0
View.js
src/app/views/landingpage/priceProduct/View.js
+107
-0
router.js
src/app/views/landingpage/router.js
+13
-0
No files found.
src/app/RootRoutes.jsx
View file @
649f5efa
...
@@ -18,7 +18,7 @@ import GasStationRoutes from './views/GasStation/GasStationRoutes'
...
@@ -18,7 +18,7 @@ import GasStationRoutes from './views/GasStation/GasStationRoutes'
import
ListRequestRoutes
from
'./views/ListRequest/routes'
import
ListRequestRoutes
from
'./views/ListRequest/routes'
import
SignUp
from
'./views/SignUp/routes'
import
SignUp
from
'./views/SignUp/routes'
import
InvoiceSupplier
from
'./views/InvoiceSupplier/routes'
import
InvoiceSupplier
from
'./views/InvoiceSupplier/routes'
import
Package
from
'./views/package/routers'
//
import Package from './views/package/routers'
import
NccRouter
from
'./views/Ncc/router'
import
NccRouter
from
'./views/Ncc/router'
import
LandingpageRouter
from
'./views/landingpage/router'
import
LandingpageRouter
from
'./views/landingpage/router'
...
@@ -39,7 +39,7 @@ const errorRoute = [
...
@@ -39,7 +39,7 @@ const errorRoute = [
const
routes
=
[
const
routes
=
[
...
LandingpageRouter
,
...
LandingpageRouter
,
...
NccRouter
,
...
NccRouter
,
...
Package
,
//
...Package,
...
InvoiceSupplier
,
...
InvoiceSupplier
,
...
SignUp
,
...
SignUp
,
...
ListRequestRoutes
,
...
ListRequestRoutes
,
...
...
src/app/apis/Functions/landingpage.js
View file @
649f5efa
...
@@ -30,3 +30,32 @@ export const changeStatusPackageFunction = async (body) =>
...
@@ -30,3 +30,32 @@ export const changeStatusPackageFunction = async (body) =>
PostData
(
url
.
changeStatusPackageFunction
,
body
)
PostData
(
url
.
changeStatusPackageFunction
,
body
)
.
then
((
res
)
=>
res
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
.
catch
((
err
)
=>
null
)
export
const
getListPriceProduct
=
async
(
body
)
=>
PostData
(
url
.
urlGetListPriceProduct
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
createPriceProduct
=
async
(
body
)
=>
PostData
(
url
.
urlCreatePriceProduct
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
updatePriceProduct
=
async
(
body
)
=>
PostData
(
url
.
urlUpdatePriceProduct
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
detailPriceProduct
=
async
(
id
,
body
)
=>
GetURL
(
`
${
url
.
urlDetailPriceProduct
}
/
${
id
}
`
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
deletePriceProduct
=
async
(
body
)
=>
PostData
(
url
.
urlDeletePriceProduct
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
changeStatusPriceProduct
=
async
(
body
)
=>
PostData
(
url
.
changeStatusPriceProduct
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
src/app/apis/url.js
View file @
649f5efa
...
@@ -131,7 +131,7 @@ export default {
...
@@ -131,7 +131,7 @@ export default {
urlDetailPackageFunction
:
`
${
root
}
/functionpk`
,
urlDetailPackageFunction
:
`
${
root
}
/functionpk`
,
changeStatusPackageFunction
:
`
${
root
}
/functionpk/changeStatus`
,
changeStatusPackageFunction
:
`
${
root
}
/functionpk/changeStatus`
,
urlGetListPriceProduct
:
`
${
root
}
/construction/
list
`
,
urlGetListPriceProduct
:
`
${
root
}
/construction/
paging
`
,
urlCreatePriceProduct
:
`
${
root
}
/construction/create`
,
urlCreatePriceProduct
:
`
${
root
}
/construction/create`
,
urlUpdatePriceProduct
:
`
${
root
}
/construction/update`
,
urlUpdatePriceProduct
:
`
${
root
}
/construction/update`
,
urlDeletePriceProduct
:
`
${
root
}
/construction/delete`
,
urlDeletePriceProduct
:
`
${
root
}
/construction/delete`
,
...
...
src/app/navigations.js
View file @
649f5efa
...
@@ -226,9 +226,9 @@ export const navigationsAdmin = [
...
@@ -226,9 +226,9 @@ export const navigationsAdmin = [
id
:
'FUNCTION'
,
id
:
'FUNCTION'
,
},
},
{
{
name
:
'
Cấu hình báo giá
'
,
name
:
'
Danh sách sản phẩm
'
,
iconText
:
'FN'
,
iconText
:
'FN'
,
path
:
'/p
ackage-setting
'
,
path
:
'/p
rice-product
'
,
hide
:
false
,
hide
:
false
,
id
:
'FUNCTION'
,
id
:
'FUNCTION'
,
},
},
...
...
src/app/views/landingpage/priceProduct/Create.js
0 → 100644
View file @
649f5efa
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
ValidatorForm
,
TextValidator
,
SelectValidator
,
}
from
'react-material-ui-form-validator'
import
{
Button
,
Grid
,
MenuItem
}
from
'@material-ui/core'
import
{
createPackageFunction
}
from
'app/apis/Functions/landingpage'
import
{
showLoading
,
hideLoading
}
from
'app/redux/actions/loadingAction'
import
{
toast
}
from
'react-toastify'
import
{
Breadcrumb
,
SimpleCard
}
from
'app/components'
import
{
Link
,
useHistory
,
useLocation
}
from
'react-router-dom'
import
{
connect
}
from
'react-redux'
import
{
useTranslation
}
from
'react-i18next'
import
{
trimObject
,
toPriceVndInput
,
isNumeric
,
toPriceVnd
,
}
from
'app/config/Function'
const
SimpleForm
=
(
props
)
=>
{
const
[
state
,
setState
]
=
useState
({})
const
{
t
}
=
useTranslation
()
const
history
=
useHistory
()
const
handleSubmit
=
async
(
event
)
=>
{
const
newValue
=
trimObject
(
state
)
props
.
showLoading
()
const
res
=
await
createPackageFunction
({
...
newValue
,
status
:
1
,
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
history
.
push
(
'/price-product'
)
if
(
res
.
data
.
code
==
200
)
{
toast
.
success
(
'Tạo chức năng gói thành công!'
,
{
theme
:
'colored'
,
})
}
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
})
}
}
const
handleChange
=
(
event
)
=>
{
event
.
persist
()
if
(
event
.
target
.
name
===
'price'
)
{
if
(
event
.
target
.
value
!==
null
)
setState
({
...
state
,
[
event
.
target
.
name
]:
event
.
target
.
value
.
split
(
'.'
).
join
(
''
),
})
}
else
setState
({
...
state
,
[
event
.
target
.
name
]:
event
.
target
.
value
,
})
}
const
handleDateChange
=
(
date
)
=>
{
setState
({
...
state
,
date
})
}
const
{
cons_name
,
unit
,
price
,
type_caculator
,
type
,
suppconstruction_id
,
}
=
state
return
(
<
div
className
=
"m-sm-30"
>
<
div
className
=
"mb-sm-30"
>
<
div
className
=
"mb-sm-30"
>
<
Breadcrumb
routeSegments
=
{[
{
name
:
'Danh sách sản phẩm'
,
path
:
'/price-product'
,
},
{
name
:
'Thêm mới'
},
]}
/
>
<
/div
>
<
SimpleCard
>
<
ValidatorForm
onSubmit
=
{
handleSubmit
}
onError
=
{()
=>
null
}
>
<
Grid
container
spacing
=
{
3
}
>
<
Grid
item
lg
=
{
6
}
md
=
{
6
}
sm
=
{
12
}
xs
=
{
12
}
>
<
TextValidator
variant
=
"outlined"
className
=
"mb-4 w-full"
label
=
"Tên sản phẩm *"
onChange
=
{
handleChange
}
type
=
"text"
name
=
"cons_name"
value
=
{
cons_name
||
''
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
]}
/
>
<
/Grid
>
<
Grid
item
lg
=
{
6
}
md
=
{
6
}
sm
=
{
12
}
xs
=
{
12
}
>
<
TextValidator
variant
=
"outlined"
className
=
"mb-4 w-full"
label
=
"Đơn vị tính *"
onChange
=
{
handleChange
}
type
=
"text"
name
=
"unit"
value
=
{
unit
||
''
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
]}
/
>
<
/Grid
>
<
Grid
item
lg
=
{
6
}
md
=
{
6
}
sm
=
{
12
}
xs
=
{
12
}
>
<
TextValidator
variant
=
"outlined"
className
=
"mb-4 w-full"
label
=
"Đơn giá *"
type
=
"text"
value
=
{
toPriceVndInput
(
price
)
||
''
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
]}
/
>
<
/Grid
>
<
Grid
xs
=
{
6
}
sm
=
{
6
}
item
>
<
SelectValidator
variant
=
{
'outlined'
}
label
=
{
'Cách tính *'
}
className
=
"mb-4 w-full"
value
=
{
type_caculator
||
''
}
displayEmpty
name
=
"type_caculator"
onChange
=
{
handleChange
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
]}
>
{[].
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
))}
<
/SelectValidator
>
<
/Grid
>
<
Grid
xs
=
{
6
}
sm
=
{
6
}
item
>
<
SelectValidator
variant
=
{
'outlined'
}
label
=
{
'Loại sản phẩm *'
}
className
=
"mb-4 w-full"
value
=
{
type_caculator
||
''
}
displayEmpty
name
=
"type_caculator"
onChange
=
{
handleChange
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
]}
>
{[].
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
))}
<
/SelectValidator
>
<
/Grid
>
<
Grid
xs
=
{
6
}
sm
=
{
6
}
item
>
<
SelectValidator
variant
=
{
'outlined'
}
label
=
{
'Nhà cung cấp *'
}
className
=
"mb-4 w-full"
value
=
{
type_caculator
||
''
}
displayEmpty
name
=
"type_caculator"
onChange
=
{
handleChange
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
]}
>
{[].
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
))}
<
/SelectValidator
>
<
/Grid
>
<
/Grid
>
<
Grid
container
justify
=
{
'flex-end'
}
>
<
Button
style
=
{{
marginRight
:
20
,
}}
color
=
"inherit"
variant
=
"contained"
onClick
=
{()
=>
{
history
.
goBack
()
}}
>
<
span
className
=
"capitalize"
>
Quay
l
ạ
i
<
/span
>
<
/Button
>
<
Button
color
=
"primary"
variant
=
"contained"
type
=
"submit"
>
<
span
className
=
"capitalize"
>
Th
ê
m
m
ớ
i
<
/span
>
<
/Button
>
<
/Grid
>
<
/ValidatorForm
>
<
/SimpleCard
>
<
/div
>
<
/div
>
)
}
const
mapStateToProps
=
(
state
)
=>
{
return
{}
}
export
default
connect
(
mapStateToProps
,
{
showLoading
,
hideLoading
})(
SimpleForm
)
src/app/views/landingpage/priceProduct/Index.js
0 → 100644
View file @
649f5efa
import
React
,
{
useState
,
useEffect
}
from
'react'
import
ToolUserView
from
'./View'
import
{
getListPriceProduct
,
deletePriceProduct
,
changeStatusPriceProduct
,
}
from
'app/apis/Functions/landingpage'
import
{
useHistory
}
from
'react-router-dom'
import
KEY
from
'../../../assets/Key'
import
{
connect
}
from
'react-redux'
import
{
showLoading
,
hideLoading
}
from
'app/redux/actions/loadingAction'
import
{
toast
}
from
'react-toastify'
import
useDebounce
from
'app/hooks/useDebounce'
import
{
useTranslation
}
from
'react-i18next'
const
ToolNotificate
=
(
props
)
=>
{
const
[
txtSearch
,
setTxtSearch
]
=
useState
(
''
)
const
searchDebount
=
useDebounce
(
txtSearch
,
1000
)
const
{
t
}
=
useTranslation
()
const
[
activeSelected
,
setActiveSeleted
]
=
useState
(
null
)
const
[
changeActive
,
setChangeActive
]
=
useState
(
1
)
const
[
pageIndex
,
setPageIndex
]
=
useState
(
0
)
const
[
pageSize
]
=
useState
(
10
)
const
[
totalRecords
,
setTotalRecord
]
=
useState
(
0
)
const
history
=
useHistory
()
const
[
data
,
setData
]
=
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
)
=>
{
props
.
showLoading
()
const
res
=
await
changeStatusPriceProduct
({
idGuid
:
id
,
status_id
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
getData
()
toast
.
success
(
'Thay đổi trạng thái thành công!'
,
{
theme
:
'colored'
,
})
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
})
}
}
const
getData
=
async
(
isInit
)
=>
{
props
.
showLoading
()
let
res
if
(
isInit
)
{
setPageIndex
(
0
)
res
=
await
getListPriceProduct
({
func_name
:
searchDebount
,
page_no
:
0
,
page_size
:
pageSize
,
})
}
else
{
res
=
await
getListPriceProduct
({
func_name
:
searchDebount
,
page_no
:
pageIndex
+
1
,
page_size
:
pageSize
,
})
}
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
console
.
log
(
res
.
data
)
const
newList
=
res
.
data
.
data
.
data
.
map
((
e
,
i
)
=>
{
return
{
...
e
,
index
:
i
+
1
+
pageIndex
*
pageSize
}
})
setData
(
newList
)
setTotalRecord
(
res
.
data
.
data
.
total_elements
)
}
else
if
(
res
.
data
.
code
==
401
)
{
localStorage
.
removeItem
(
KEY
.
API_TOKEN
)
setTimeout
(()
=>
{
history
.
push
(
'/'
)
},
100
)
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
})
}
}
useEffect
(()
=>
{
getData
(
true
)
},
[
searchDebount
])
useEffect
(()
=>
{
getData
(
false
)
},
[
pageIndex
])
const
removeItem
=
async
(
id
)
=>
{
props
.
showLoading
()
const
res
=
await
deletePriceProduct
({
idGuid
:
id
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
getData
()
toast
.
success
(
'Xoá bản ghi thành công!'
,
{
theme
:
'colored'
,
})
}
else
if
(
res
.
data
.
code
==
401
)
{
localStorage
.
removeItem
(
KEY
.
API_TOKEN
)
setTimeout
(()
=>
{
history
.
push
(
'/'
)
},
100
)
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
})
}
}
return
(
<
ToolUserView
data
=
{
data
}
removeItem
=
{
removeItem
}
setTxtSearch
=
{
setTxtSearch
}
setActiveSeleted
=
{
setActiveSeleted
}
pageIndex
=
{
pageIndex
}
changeActive
=
{
changeActive
}
setChangeActive
=
{
setChangeActive
}
setPageIndex
=
{
setPageIndex
}
activeSelected
=
{
activeSelected
}
handeChangeActive
=
{
handeChangeActive
}
totalRecords
=
{
totalRecords
}
permissions
=
{
permissions
}
/
>
)
}
const
mapStateToProps
=
(
state
)
=>
{
return
{}
}
export
default
connect
(
mapStateToProps
,
{
showLoading
,
hideLoading
})(
ToolNotificate
)
src/app/views/landingpage/priceProduct/Table.js
0 → 100644
View file @
649f5efa
This diff is collapsed.
Click to expand it.
src/app/views/landingpage/priceProduct/Update.js
0 → 100644
View file @
649f5efa
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
ValidatorForm
,
TextValidator
}
from
'react-material-ui-form-validator'
import
{
Button
,
Grid
}
from
'@material-ui/core'
import
{
detailPackageFunction
,
updatePackageFunction
,
}
from
'app/apis/Functions/landingpage'
import
{
showLoading
,
hideLoading
}
from
'app/redux/actions/loadingAction'
import
{
toast
}
from
'react-toastify'
import
{
Breadcrumb
,
SimpleCard
}
from
'app/components'
import
{
Link
,
useHistory
,
useLocation
}
from
'react-router-dom'
import
{
trimObject
}
from
'app/config/Function'
import
{
connect
}
from
'react-redux'
import
localStorageService
from
'app/services/localStorageService'
import
{
useTranslation
}
from
'react-i18next'
const
SimpleForm
=
(
props
)
=>
{
const
[
state
,
setState
]
=
useState
({})
const
history
=
useHistory
()
const
location
=
useLocation
()
const
{
t
}
=
useTranslation
()
useEffect
(()
=>
{
getData
()
},
[])
const
getData
=
async
()
=>
{
props
.
showLoading
()
const
res
=
await
detailPackageFunction
(
location
.
state
,
{})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
setState
(
res
.
data
.
data
)
}
else
if
(
res
.
data
.
code
==
401
)
{
localStorageService
.
removeToken
()
setTimeout
(()
=>
{
history
.
push
(
'/'
)
},
100
)
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
})
}
}
const
handleSubmit
=
async
(
event
)
=>
{
const
newValue
=
trimObject
(
state
)
props
.
showLoading
()
const
res
=
await
updatePackageFunction
({
...
newValue
,
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
history
.
push
(
'/price-product'
)
if
(
res
.
data
.
code
==
200
)
{
toast
.
success
(
'Cập nhật chức năng thành công!'
,
{
theme
:
'colored'
,
})
}
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
})
}
}
const
handleChange
=
(
event
)
=>
{
event
.
persist
()
setState
({
...
state
,
[
event
.
target
.
name
]:
event
.
target
.
value
,
})
}
const
handleDateChange
=
(
date
)
=>
{
setState
({
...
state
,
date
})
}
const
{
description
,
func_name
}
=
state
return
(
<
div
className
=
"m-sm-30"
>
<
div
className
=
"mb-sm-30"
>
<
div
className
=
"mb-sm-30"
>
<
Breadcrumb
routeSegments
=
{[
{
name
:
'Danh sách sản phẩm'
,
path
:
'/price-product'
,
},
{
name
:
'Cập nhật'
},
]}
/
>
<
/div
>
<
SimpleCard
>
<
ValidatorForm
onSubmit
=
{
handleSubmit
}
onError
=
{()
=>
null
}
>
<
Grid
container
spacing
=
{
3
}
>
<
Grid
item
lg
=
{
6
}
md
=
{
6
}
sm
=
{
12
}
xs
=
{
12
}
>
<
TextValidator
variant
=
"outlined"
className
=
"mb-4 w-full"
label
=
"Tên chức năng *"
onChange
=
{
handleChange
}
type
=
"text"
name
=
"func_name"
value
=
{
func_name
||
''
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
]}
/
>
<
/Grid
>
<
Grid
item
lg
=
{
6
}
md
=
{
6
}
sm
=
{
12
}
xs
=
{
12
}
>
<
TextValidator
variant
=
"outlined"
className
=
"mb-4 w-full"
label
=
"Mô tả "
onChange
=
{
handleChange
}
type
=
"text"
name
=
"description"
value
=
{
description
||
''
}
/
>
<
/Grid
>
<
/Grid
>
<
Grid
container
justify
=
{
'flex-end'
}
>
<
Button
style
=
{{
marginRight
:
20
,
}}
color
=
"inherit"
variant
=
"contained"
onClick
=
{()
=>
{
history
.
goBack
()
}}
>
<
span
className
=
"capitalize"
>
Quay
l
ạ
i
<
/span
>
<
/Button
>
<
Button
color
=
"primary"
variant
=
"contained"
type
=
"submit"
>
<
span
className
=
"capitalize"
>
C
ậ
p
nh
ậ
t
<
/span
>
<
/Button
>
<
/Grid
>
<
/ValidatorForm
>
<
/SimpleCard
>
<
/div
>
<
/div
>
)
}
const
mapStateToProps
=
(
state
)
=>
{
return
{}
}
export
default
connect
(
mapStateToProps
,
{
showLoading
,
hideLoading
})(
SimpleForm
)
src/app/views/landingpage/priceProduct/View.js
0 → 100644
View file @
649f5efa
import
React
,
{
Fragment
,
useState
,
useEffect
}
from
'react'
import
{
TextField
,
Icon
,
Button
,
StepLabel
,
Step
,
Stepper
,
Grid
,
FormControl
,
InputLabel
,
Select
,
MenuItem
,
}
from
'@material-ui/core'
import
Table
from
'./Table'
import
{
Breadcrumb
}
from
'app/components'
import
{
Link
}
from
'react-router-dom'
import
{
Autocomplete
,
createFilterOptions
}
from
'@material-ui/lab'
import
useAuth
from
'app/hooks/useAuth'
import
{
checkRole
}
from
'app/config/Function'
function
CustomerView
(
props
)
{
const
{
data
,
updateItem
,
removeItem
,
setTxtSearch
,
changeActive
,
setChangeActive
,
handeChangeActive
,
setPageIndex
,
pageIndex
,
totalRecords
,
permissions
,
}
=
props
const
[
age
,
setAge
]
=
React
.
useState
(
''
)
const
{
user
}
=
useAuth
()
const
handleChange
=
(
event
)
=>
{
setAge
(
event
.
target
.
value
)
}
return
(
<
Fragment
>
<
div
className
=
"m-sm-30"
>
<
div
className
=
"mb-sm-30"
>
<
Breadcrumb
routeSegments
=
{[
{
name
:
'Danh sách sản phẩm'
,
path
:
'/price-product'
,
},
]}
/
>
<
/div
>
<
Grid
style
=
{{
padding
:
10
,
marginBottom
:
20
,
}}
justify
=
{
'space-between'
}
alignItems
=
{
'center'
}
container
spacing
=
{
3
}
>
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
sm
=
{
6
}
xs
=
{
6
}
>
<
TextField
variant
=
"outlined"
className
=
"w-full"
label
=
"Nhập từ khoá"
onChange
=
{(
e
)
=>
{
const
text
=
e
.
target
.
value
setTimeout
(()
=>
{
setTxtSearch
(
text
)
},
1000
)
}}
/
>
<
/Grid
>
{
checkRole
(
user
,
'/price-product/create'
)
?
(
<
Link
to
=
"/price-product/create"
>
<
Button
variant
=
"contained"
className
=
{
'bg-light-primary'
}
>
<
span
className
=
{
'text-primary'
}
>
Th
ê
m
m
ớ
i
<
/span
>
<
/Button
>
<
/Link
>
)
:
null
}
<
/Grid
>
<
Table
data
=
{
data
}
changeActive
=
{
changeActive
}
setChangeActive
=
{
setChangeActive
}
handeChangeActive
=
{
handeChangeActive
}
updateItem
=
{
updateItem
}
removeItem
=
{
removeItem
}
pageIndex
=
{
pageIndex
}
setPageIndex
=
{
setPageIndex
}
totalRecords
=
{
totalRecords
}
permissions
=
{
permissions
}
/
>
<
/div
>
<
/Fragment
>
)
}
export
default
CustomerView
src/app/views/landingpage/router.js
View file @
649f5efa
...
@@ -13,6 +13,19 @@ const Routes = [
...
@@ -13,6 +13,19 @@ const Routes = [
path
:
'/package-function'
,
path
:
'/package-function'
,
component
:
React
.
lazy
(()
=>
import
(
'./function/Index'
)),
component
:
React
.
lazy
(()
=>
import
(
'./function/Index'
)),
},
},
{
path
:
'/price-product/create'
,
component
:
React
.
lazy
(()
=>
import
(
'./priceProduct/Create'
)),
},
{
path
:
'/price-product/update'
,
component
:
React
.
lazy
(()
=>
import
(
'./priceProduct/Update'
)),
},
{
path
:
'/price-product'
,
component
:
React
.
lazy
(()
=>
import
(
'./priceProduct/Index'
)),
},
]
]
export
default
Routes
export
default
Routes
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