Commit 1fd34b93 by tdgiang

update build

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