Commit beaf9b04 by tdgiang

update build

parent 649f5efa
...@@ -69,3 +69,23 @@ export const dropdownListSupplier = async (body) => ...@@ -69,3 +69,23 @@ export const dropdownListSupplier = async (body) =>
GetData(url.dropdownListSupplier, body) GetData(url.dropdownListSupplier, body)
.then((res) => res) .then((res) => res)
.catch((err) => null) .catch((err) => null)
export const dropdownTypeCaculator = async (body) =>
GetData(url.dropdownTypeCaculator, body)
.then((res) => res)
.catch((err) => null)
export const dropdownEquipment = async (body) =>
GetData(url.dropdownEquipment, body)
.then((res) => res)
.catch((err) => null)
export const dropdownNcc = async (body) =>
GetData(url.dropdownNcc, body)
.then((res) => res)
.catch((err) => null)
export const dropdownFuncitonPackge = async (body) =>
GetData(url.dropdownFuncitonPackge, body)
.then((res) => res)
.catch((err) => null)
...@@ -59,3 +59,32 @@ export const changeStatusPriceProduct = async (body) => ...@@ -59,3 +59,32 @@ export const changeStatusPriceProduct = async (body) =>
PostData(url.changeStatusPriceProduct, body) PostData(url.changeStatusPriceProduct, body)
.then((res) => res) .then((res) => res)
.catch((err) => null) .catch((err) => null)
export const getListPackage = async (body) =>
PostData(url.urlGetListPackage, body)
.then((res) => res)
.catch((err) => null)
export const createPackage = async (body) =>
PostData(url.urlCreatePackage, body)
.then((res) => res)
.catch((err) => null)
export const updatePackage = async (body) =>
PostData(url.urlUpdatePackage, body)
.then((res) => res)
.catch((err) => null)
export const detailPackage = async (id, body) =>
GetURL(`${url.urlDetailPackage}/${id}`, body)
.then((res) => res)
.catch((err) => null)
export const deletePackage = async (body) =>
PostData(url.urlDeletePackage, body)
.then((res) => res)
.catch((err) => null)
export const changeStatusPackage = async (body) =>
PostData(url.changeStatusPackage, body)
.then((res) => res)
.catch((err) => null)
...@@ -117,7 +117,7 @@ export default { ...@@ -117,7 +117,7 @@ export default {
detailCustomerCare: `${root}/customerCare`, detailCustomerCare: `${root}/customerCare`,
//landingpage //landingpage
urlGetListPackage: `${root}/package/list`, urlGetListPackage: `${root}/package/paging`,
urlCreatePackage: `${root}/package/create`, urlCreatePackage: `${root}/package/create`,
urlUpdatePackage: `${root}/package/update`, urlUpdatePackage: `${root}/package/update`,
urlDeletePackage: `${root}/package/delete`, urlDeletePackage: `${root}/package/delete`,
...@@ -151,4 +151,8 @@ export default { ...@@ -151,4 +151,8 @@ export default {
dropdownMerchant: `${root}/dropdown/listmerchant`, dropdownMerchant: `${root}/dropdown/listmerchant`,
dropdownProcutByType: `${root}/dropdown/productListByType`, dropdownProcutByType: `${root}/dropdown/productListByType`,
dropdownListSupplier: `${root}/dropdown/listSupplier`, dropdownListSupplier: `${root}/dropdown/listSupplier`,
dropdownTypeCaculator: `${root}/dropdown/getlisttypecaculator`,
dropdownEquipment: `${root}/dropdown/getlisttypeatc`,
dropdownNcc: `${root}/dropdown/getlistsuppliercontruct`,
dropdownFuncitonPackge: `${root}/dropdown/getlistfunctionpk`,
} }
...@@ -232,15 +232,15 @@ export const navigationsAdmin = [ ...@@ -232,15 +232,15 @@ export const navigationsAdmin = [
hide: false, hide: false,
id: 'FUNCTION', id: 'FUNCTION',
}, },
{
name: 'Danh sách đăng ký',
iconText: 'FN',
path: '/package-register',
hide: false,
id: 'SIGN',
},
], ],
}, },
{
name: 'Danh sách đăng ký',
path: '/package-register',
icon: 'how_to_reg',
id: 'SIGN-UP',
hide: false,
},
{ {
name: 'Quản lý hệ thống', name: 'Quản lý hệ thống',
......
import React, { useState, useEffect } from 'react'
import { ValidatorForm, TextValidator } from 'react-material-ui-form-validator'
import { Button, Grid, FormControlLabel, Checkbox } 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 [outstanding, setOutstanding] = useState(false)
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('/package-function')
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()
console.log('event.target.name', event.target.name)
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 { description, func_name, price } = state
return (
<div className="m-sm-30">
<div className="mb-sm-30">
<div className="mb-sm-30">
<Breadcrumb
routeSegments={[
{
name: 'Danh sách gói',
path: '/package',
},
{ 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 gói*"
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="Đơn giá *"
onChange={handleChange}
type="text"
name="price"
value={toPriceVndInput(price) || ''}
validators={['required']}
errorMessages={[
'Không được để trống trường này',
]}
/>
</Grid>
<Grid lg={12} md={12} sm={12} xs={12} item>
<FormControlLabel
className="min-w-288"
control={
<Checkbox
size="small"
color="primary"
onChange={(event) => {
console.log(
event.target.checked
)
setOutstanding(
event.target.checked
)
}}
value={outstanding}
/>
}
label="Nổi bật"
/>
</Grid>
</Grid>
<Grid container justify={'flex-end'}>
<Button
style={{
marginRight: 20,
}}
color="inherit"
variant="contained"
onClick={() => {
history.goBack()
}}
>
<span className="capitalize">Quay li</span>
</Button>
<Button
color="primary"
variant="contained"
type="submit"
>
<span className="capitalize">Thêm mi</span>
</Button>
</Grid>
</ValidatorForm>
</SimpleCard>
</div>
</div>
)
}
const mapStateToProps = (state) => {
return {}
}
export default connect(mapStateToProps, { showLoading, hideLoading })(
SimpleForm
)
import React, { useState, useEffect } from 'react'
import ToolUserView from './View'
import {
getListPackage,
deletePackage,
changeStatusPackage,
} 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 handeChangeActiveOutstanding = async (id, status_id) => {
// props.showLoading()
// const res = await changeStatusPackage({ 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 handeChangeActive = async (id, status_id) => {
props.showLoading()
const res = await changeStatusPackage({ 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 getListPackage({
pack_name: searchDebount,
page_no: 0,
page_size: pageSize,
})
} else {
res = await getListPackage({
pack_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 deletePackage({ 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}
handeChangeActiveOutstanding={handeChangeActiveOutstanding}
/>
)
}
const mapStateToProps = (state) => {
return {}
}
export default connect(mapStateToProps, { showLoading, hideLoading })(
ToolNotificate
)
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('/package-function')
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 gói',
path: '/package',
},
{ 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 li</span>
</Button>
<Button
color="primary"
variant="contained"
type="submit"
>
<span className="capitalize">Cp nht</span>
</Button>
</Grid>
</ValidatorForm>
</SimpleCard>
</div>
</div>
)
}
const mapStateToProps = (state) => {
return {}
}
export default connect(mapStateToProps, { showLoading, hideLoading })(
SimpleForm
)
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,
handeChangeActiveOutstanding,
} = 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 gói',
path: '/package',
},
]}
/>
</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, '/package/create') ? (
<Link to="/package/create">
<Button
variant="contained"
className={'bg-light-primary'}
>
<span className={'text-primary'}>Thêm mi</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}
handeChangeActiveOutstanding={handeChangeActiveOutstanding}
/>
</div>
</Fragment>
)
}
export default CustomerView
...@@ -128,6 +128,7 @@ const SimpleForm = (props) => { ...@@ -128,6 +128,7 @@ const SimpleForm = (props) => {
variant="outlined" variant="outlined"
className="mb-4 w-full" className="mb-4 w-full"
label="Đơn giá *" label="Đơn giá *"
onChange={handleChange}
type="text" type="text"
value={toPriceVndInput(price) || ''} value={toPriceVndInput(price) || ''}
validators={['required']} validators={['required']}
......
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('/package-function')
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 chức năng gói',
path: '/package-function',
},
{ name: 'Cập nhật chức năng' },
]}
/>
</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 li</span>
</Button>
<Button
color="primary"
variant="contained"
type="submit"
>
<span className="capitalize">Cp nht</span>
</Button>
</Grid>
</ValidatorForm>
</SimpleCard>
</div>
</div>
)
}
const mapStateToProps = (state) => {
return {}
}
export default connect(mapStateToProps, { showLoading, hideLoading })(
SimpleForm
)
import React, { useState, useEffect } from 'react'
import ToolUserView from './View'
import {
getListPackageFunction,
deletePackageFunction,
changeStatusPackageFunction,
} 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 changeStatusPackageFunction({ 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 getListPackageFunction({
func_name: searchDebount,
page_no: 0,
page_size: pageSize,
})
} else {
res = await getListPackageFunction({
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 deletePackageFunction({ 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
)
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 đăng ký',
path: '/package-register',
},
]}
/>
</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, '/package-function/create') ? (
<Link to="/package-function/create">
<Button
variant="contained"
className={'bg-light-primary'}
>
<span className={'text-primary'}>Thêm mi</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
...@@ -26,6 +26,28 @@ const Routes = [ ...@@ -26,6 +26,28 @@ const Routes = [
path: '/price-product', path: '/price-product',
component: React.lazy(() => import('./priceProduct/Index')), component: React.lazy(() => import('./priceProduct/Index')),
}, },
{
path: '/package/create',
component: React.lazy(() => import('./package/Create')),
},
{
path: '/package/update',
component: React.lazy(() => import('./package/Update')),
},
{
path: '/package',
component: React.lazy(() => import('./package/Index')),
},
{
path: '/package-register/detail',
component: React.lazy(() => import('./register/Detail')),
},
{
path: '/package-register',
component: React.lazy(() => import('./register/Index')),
},
] ]
export default Routes export default Routes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment