Commit 1fd34b93 by tdgiang

update build

parent cd1dc3f6
...@@ -30,7 +30,7 @@ export async function GetData(url, data) { ...@@ -30,7 +30,7 @@ export async function GetData(url, data) {
message: 'error', message: 'error',
status: error.request.status, status: error.request.status,
data: { data: {
code: 401, code: error?.request?.status,
}, },
} }
return err return err
...@@ -60,7 +60,7 @@ export async function PostHaveKey(url, json, key) { ...@@ -60,7 +60,7 @@ export async function PostHaveKey(url, json, key) {
message: 'error', message: 'error',
status: error.request.status, status: error.request.status,
data: { data: {
code: 401, code: error?.request?.status,
}, },
} }
return err return err
...@@ -94,7 +94,7 @@ export async function GetHaveKey(url, data, key) { ...@@ -94,7 +94,7 @@ export async function GetHaveKey(url, data, key) {
message: 'error', message: 'error',
status: error.request.status, status: error.request.status,
data: { data: {
code: 401, code: error?.request?.status,
}, },
} }
return err return err
...@@ -127,7 +127,7 @@ export async function GetURL(url, data) { ...@@ -127,7 +127,7 @@ export async function GetURL(url, data) {
message: 'error', message: 'error',
status: error.request.status, status: error.request.status,
data: { data: {
code: 401, code: error?.request?.status,
}, },
} }
return err return err
...@@ -176,11 +176,12 @@ export async function PostData(url, json, isAuth = true) { ...@@ -176,11 +176,12 @@ export async function PostData(url, json, isAuth = true) {
.then((response) => response) .then((response) => response)
.then((response) => response) .then((response) => response)
.catch((error) => { .catch((error) => {
console.log('error.request.status----', error.request.status)
const err = { const err = {
message: 'error', message: 'error',
status: error.request.status, status: error.request.status,
data: { data: {
code: 401, code: error?.request?.status,
}, },
} }
return err return err
...@@ -208,7 +209,7 @@ export async function PostURL(url) { ...@@ -208,7 +209,7 @@ export async function PostURL(url) {
message: 'error', message: 'error',
status: error.request.status, status: error.request.status,
data: { data: {
code: 401, code: error?.request?.status,
}, },
} }
return err return err
...@@ -238,7 +239,7 @@ export async function PostFormData(url, data) { ...@@ -238,7 +239,7 @@ export async function PostFormData(url, data) {
message: 'error', message: 'error',
status: error.request.status, status: error.request.status,
data: { data: {
code: 401, code: error?.request?.status,
}, },
} }
return err return err
...@@ -281,7 +282,7 @@ export async function PostExportFile(url, json, isAuth = true) { ...@@ -281,7 +282,7 @@ export async function PostExportFile(url, json, isAuth = true) {
message: 'error', message: 'error',
status: error.request.status, status: error.request.status,
data: { data: {
code: 400, code: error?.request?.status,
}, },
} }
return err return err
...@@ -309,7 +310,7 @@ export async function PostNonToken(url, json, isAuth = true) { ...@@ -309,7 +310,7 @@ export async function PostNonToken(url, json, isAuth = true) {
message: 'error', message: 'error',
status: error.request.status, status: error.request.status,
data: { data: {
code: 401, code: error?.request?.status,
}, },
} }
return err return err
......
...@@ -363,7 +363,9 @@ ...@@ -363,7 +363,9 @@
"ERROR_QUEUE_CODE_EXIST":"Mã Queue đã tồn tại", "ERROR_QUEUE_CODE_EXIST":"Mã Queue đã tồn tại",
"ERROR_NAME_PACKAGE_IS_EXITS":"Tên gói đã tồn tại", "ERROR_NAME_PACKAGE_IS_EXITS":"Tên gói đã tồn tại",
"ERROR_NAME_FUNCTION_IS_EXITS":"Tên chức năng đã tồn tại", "ERROR_NAME_FUNCTION_IS_EXITS":"Tên chức năng đã tồn tại",
"ERROR_USER_GROUP_EXISTS_DATA":"Nhóm quyền đã có dữ liệu" "ERROR_USER_GROUP_EXISTS_DATA":"Nhóm quyền đã có dữ liệu",
"ERROR_DATE_INVALID":"Thời gian không hợp lệ"
} }
...@@ -23,16 +23,31 @@ import { useTranslation } from 'react-i18next' ...@@ -23,16 +23,31 @@ import { useTranslation } from 'react-i18next'
import { hideLoading, showLoading } from 'app/redux/actions/loadingAction' import { hideLoading, showLoading } from 'app/redux/actions/loadingAction'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { KeyboardDatePicker } from '@material-ui/pickers' import { KeyboardDatePicker } from '@material-ui/pickers'
import { convertDate, getTimeDDMM } from 'app/config/Function'
function FormDialog(props) { function FormDialog(props) {
const { t } = useTranslation() const { t } = useTranslation()
const { open, handleClose, data, onAgree } = props const { open, handleClose, data, onAgree } = props
console.log('data', data)
const [forever, setForever] = useState(false) const [forever, setForever] = useState(false)
const [name, setName] = useState() const [name, setName] = useState()
const [date, setDate] = useState(addOneYear()) const [date, setDate] = useState(addOneYear())
useEffect(() => {
if (data && data?.date_expried) {
if (
data.date_expried != 'Vô thời hạ' &&
data.date_expried != 'Vô thời hạn'
) {
setDate(getTimeDDMM(data.date_expried))
} else {
setDate(new Date())
}
}
}, [data])
const handleDateChangeLast = (date) => { const handleDateChangeLast = (date) => {
setDate(date) setDate(date)
......
...@@ -177,7 +177,7 @@ const ToolNotificate = (props) => { ...@@ -177,7 +177,7 @@ const ToolNotificate = (props) => {
props.showLoading() props.showLoading()
const res = await changeStatusStore({ const res = await changeStatusStore({
id: item.id, id: item.id,
status: 1, status: item?.status == 3 ? 0 : 1,
expired: forever ? null : convertDate(date), expired: forever ? null : convertDate(date),
}) })
props.hideLoading() props.hideLoading()
...@@ -202,9 +202,12 @@ const ToolNotificate = (props) => { ...@@ -202,9 +202,12 @@ const ToolNotificate = (props) => {
}) })
props.hideLoading() props.hideLoading()
if (res.data.code == 200) { if (res.data.code == 200) {
toast.success(`${'Phê duyệt'} cây xăng thành công`, { toast.success(
theme: 'colored', `${'Điều chỉnh thời gian hoạt động của'} cây xăng thành công`,
}) {
theme: 'colored',
}
)
getData() getData()
} else { } else {
toast.error(t(res.data.error), { toast.error(t(res.data.error), {
......
...@@ -73,7 +73,7 @@ const columns = [ ...@@ -73,7 +73,7 @@ const columns = [
}, },
{ {
id: 'representative', id: 'connective',
label: 'Người đại diện', label: 'Người đại diện',
align: 'left', align: 'left',
minWidth: 140, minWidth: 140,
...@@ -458,6 +458,7 @@ function TableList(props) { ...@@ -458,6 +458,7 @@ function TableList(props) {
/> />
<UpdateTimeStore <UpdateTimeStore
data={selected}
open={openUpdate} open={openUpdate}
handleClose={() => { handleClose={() => {
setOpenUpdate(false) setOpenUpdate(false)
......
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