Commit 0ee66d2b by tdgiang

update build

parent 21bee4ca
...@@ -58,3 +58,7 @@ p.MuiFormHelperText-root.MuiFormHelperText-contained.Mui-error.MuiFormHelperText ...@@ -58,3 +58,7 @@ p.MuiFormHelperText-root.MuiFormHelperText-contained.Mui-error.MuiFormHelperText
.ck.ck-editor__main > .ck-editor__editable { .ck.ck-editor__main > .ck-editor__editable {
height: 400px !important; height: 400px !important;
} }
.MuiInputBase-input.Mui-disabled {
color: black !important;
}
...@@ -16,6 +16,8 @@ import FeeRouters from './views/Fee/FeeRouters' ...@@ -16,6 +16,8 @@ import FeeRouters from './views/Fee/FeeRouters'
import MerchantRoutes from './views/Merchant/MerchantRoutes' import MerchantRoutes from './views/Merchant/MerchantRoutes'
import GasStationRoutes from './views/GasStation/GasStationRoutes' import GasStationRoutes from './views/GasStation/GasStationRoutes'
import ListRequestRoutes from './views/ListRequest/routes' import ListRequestRoutes from './views/ListRequest/routes'
import SignUp from './views/SignUp/routes'
const redirectRoute = [ const redirectRoute = [
{ {
path: '/', path: '/',
...@@ -31,6 +33,7 @@ const errorRoute = [ ...@@ -31,6 +33,7 @@ const errorRoute = [
] ]
const routes = [ const routes = [
...SignUp,
...ListRequestRoutes, ...ListRequestRoutes,
...GasStationRoutes, ...GasStationRoutes,
...MerchantRoutes, ...MerchantRoutes,
......
...@@ -11,3 +11,8 @@ export const updateStatusRequest = async (body) => ...@@ -11,3 +11,8 @@ export const updateStatusRequest = async (body) =>
PostData(url.updateStatusRequest, body) PostData(url.updateStatusRequest, body)
.then((res) => res) .then((res) => res)
.catch((err) => null) .catch((err) => null)
export const detailCustomerCare = async (id, body) =>
GetURL(`${url.detailCustomerCare}/${id}`, body)
.then((res) => res)
.catch((err) => null)
...@@ -95,6 +95,7 @@ export default { ...@@ -95,6 +95,7 @@ export default {
listRequest: `${root}/customerCare/list`, listRequest: `${root}/customerCare/list`,
updateStatusRequest: `${root}/customerCare/changeStatus`, updateStatusRequest: `${root}/customerCare/changeStatus`,
detailCustomerCare: `${root}/customerCare`,
//dropdown //dropdown
dropdownFuntions: `${root}/dropdown/function`, dropdownFuntions: `${root}/dropdown/function`,
dropdownPermission: `${root}/function/getFunctionTree`, dropdownPermission: `${root}/function/getFunctionTree`,
......
...@@ -190,7 +190,7 @@ export const navigationsAdmin = [ ...@@ -190,7 +190,7 @@ export const navigationsAdmin = [
hide: false, hide: false,
}, },
{ {
name: 'Danh sách yêu cầu', name: 'Yêu cầu tư vấn',
path: '/list-request', path: '/list-request',
icon: 'schedule_send', icon: 'schedule_send',
id: 'LIST-REQUEST', id: 'LIST-REQUEST',
...@@ -198,6 +198,14 @@ export const navigationsAdmin = [ ...@@ -198,6 +198,14 @@ export const navigationsAdmin = [
}, },
{ {
name: 'Yêu cầu dùng thử',
path: '/sign-up',
icon: 'schedule_send',
id: 'SIGN-UP',
hide: false,
},
{
name: 'Quản lý hệ thống', name: 'Quản lý hệ thống',
icon: 'wb_iridescent', icon: 'wb_iridescent',
hide: false, hide: false,
......
...@@ -50,6 +50,7 @@ const ToolNotificate = (props) => { ...@@ -50,6 +50,7 @@ const ToolNotificate = (props) => {
page_no: 0, page_no: 0,
page_size: pageSize, page_size: pageSize,
status, status,
care_type: 1,
}) })
} else { } else {
res = await listRequest({ res = await listRequest({
...@@ -57,6 +58,7 @@ const ToolNotificate = (props) => { ...@@ -57,6 +58,7 @@ const ToolNotificate = (props) => {
page_no: pageIndex + 1, page_no: pageIndex + 1,
page_size: pageSize, page_size: pageSize,
status, status,
care_type: 1,
}) })
} }
......
...@@ -47,7 +47,7 @@ function CustomerView(props) { ...@@ -47,7 +47,7 @@ function CustomerView(props) {
<Breadcrumb <Breadcrumb
routeSegments={[ routeSegments={[
{ {
name: 'Danh sách yêu cầu', name: 'Yêu cầu tư vấn',
path: '/list-request', path: '/list-request',
}, },
]} ]}
...@@ -77,7 +77,7 @@ function CustomerView(props) { ...@@ -77,7 +77,7 @@ function CustomerView(props) {
<TextField <TextField
variant="outlined" variant="outlined"
className="w-full" className="w-full"
label="Tên pháp nhân" label="Từ khoá"
onChange={(e) => { onChange={(e) => {
const text = e.target.value const text = e.target.value
setTimeout(() => { setTimeout(() => {
......
...@@ -30,10 +30,30 @@ const SimpleForm = (props) => { ...@@ -30,10 +30,30 @@ const SimpleForm = (props) => {
const [payment, setPayment] = useState(false) const [payment, setPayment] = useState(false)
const [listDrop, setListDrop] = useState([]) const [listDrop, setListDrop] = useState([])
const { t } = useTranslation() const { t } = useTranslation()
const location = useLocation()
console.log('location.state', location.state)
useEffect(() => { useEffect(() => {
getData() getData()
}, []) }, [])
useEffect(() => {
if (location.state) {
const { company_name, tax, phone, email, city } = location.state
setState(
{
merchant_name: company_name,
tax_code: tax,
address: city,
email,
phone_number: phone,
},
[]
)
}
}, [])
const getData = async () => { const getData = async () => {
props.showLoading() props.showLoading()
const res = await dropdownListSupplier({}) const res = await dropdownListSupplier({})
...@@ -604,18 +624,19 @@ const SimpleForm = (props) => { ...@@ -604,18 +624,19 @@ const SimpleForm = (props) => {
) : null} ) : null}
</Grid> </Grid>
<Grid container justify={'flex-end'}> <Grid container justify={'flex-end'}>
<Link to="merchant"> <Button
<Button style={{
style={{ marginRight: 20,
marginRight: 20, }}
}} color="inherit"
color="inherit" variant="contained"
variant="contained" onClick={() => {
onClick={() => {}} history.goBack()
> }}
<span className="capitalize">Quay li</span> >
</Button> <span className="capitalize">Quay li</span>
</Link> </Button>
<Button <Button
color="primary" color="primary"
variant="contained" variant="contained"
......
import React, { useState, useEffect } from 'react'
import ToolUserView from './View'
import { listRequest, updateStatusRequest } from 'app/apis/Functions/request'
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 [activeSelected, setActiveSeleted] = useState(null)
const [changeActive, setChangeActive] = useState(1)
const [status, setStatus] = useState()
const [pageIndex, setPageIndex] = useState(0)
const [pageSize] = useState(10)
const [totalRecords, setTotalRecord] = useState(0)
const history = useHistory()
const { t } = useTranslation()
const [data, setData] = useState([])
const [permissions, setPermissions] = useState([])
const handeChangeActive = async (id, status_id) => {
props.showLoading()
const res = await updateStatusRequest({ id: 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 listRequest({
cus_name: searchDebount,
page_no: 0,
page_size: pageSize,
status,
care_type: 2,
})
} else {
res = await listRequest({
cus_name: searchDebount,
page_no: pageIndex + 1,
page_size: pageSize,
status,
care_type: 2,
})
}
props.hideLoading()
console.log('res', res)
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 {
toast.error(t(res.data.error), {
theme: 'colored',
})
}
}
useEffect(() => {
getData(true)
}, [searchDebount, status])
useEffect(() => {
getData(false)
}, [pageIndex])
const removeItem = async (id) => {}
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}
status={status}
setStatus={setStatus}
/>
)
}
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,
status,
setStatus,
} = 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: 'Đăng ký dùng thử',
path: '/sign-up',
},
]}
/>
</div>
<Grid
style={{
padding: 10,
marginBottom: 20,
}}
justify={'space-between'}
alignItems={'center'}
container
spacing={3}
>
<Grid
container
spacing={3}
item
lg={8}
md={8}
sm={8}
xs={8}
>
<Grid item lg={5} md={5} sm={5} xs={5}>
<TextField
variant="outlined"
className="w-full"
label="Từ khoá"
onChange={(e) => {
const text = e.target.value
setTimeout(() => {
setTxtSearch(text)
}, 1000)
}}
/>
</Grid>
<Grid item lg={5} md={5} sm={5} xs={5}>
<FormControl variant="outlined" fullWidth>
<InputLabel htmlFor="outlined-age-native-simple">
Trng thái
</InputLabel>
<Select
label="Trạng thái"
value={status}
onChange={(e) => setStatus(e.target.value)}
inputProps={{
name: 'age',
id: 'outlined-age-native-simple',
}}
>
<MenuItem value="">
<em>Tt c</em>
</MenuItem>
{[
{
id: 1,
name: 'Chờ tư vấn',
},
{
id: 2,
name: 'Đang tư vấn',
},
{
id: 3,
name: 'Đã tư vấn',
},
].map((e) => (
<MenuItem value={e.id}>
{e.name}
</MenuItem>
))}
</Select>
</FormControl>
</Grid>
</Grid>
</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
import React from 'react'
const ListRequestRoutes = [
{
path: '/sign-up/detail',
component: React.lazy(() => import('./detail')),
},
{
path: '/sign-up',
component: React.lazy(() => import('./Index')),
},
]
export default ListRequestRoutes
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