Browse Source

project phase

pull/1/head
khaidralirahman 10 months ago
parent
commit
fe462877f0
  1. 28
      src/views/Master/ProjectPhase/index.js

28
src/views/Master/ProjectPhase/index.js

@ -9,6 +9,14 @@ import { NotificationContainer, NotificationManager } from 'react-notifications'
import { PROJECT_PHASE_ADD, PROJECT_PHASE_EDIT, PROJECT_PHASE_DELETE, PROJECT_PHASE_SEARCH, COMPANY_MANAGEMENT_LIST, BASE_OSPRO } from '../../../const/ApiConst'; import { PROJECT_PHASE_ADD, PROJECT_PHASE_EDIT, PROJECT_PHASE_DELETE, PROJECT_PHASE_SEARCH, COMPANY_MANAGEMENT_LIST, BASE_OSPRO } from '../../../const/ApiConst';
import { Pagination, Button, Tooltip, Table } from 'antd'; import { Pagination, Button, Tooltip, Table } from 'antd';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import {
formatNumber,
formatRupiah,
formatThousand,
renderFormatRupiah,
checkActMenup,
} from "../../../const/CustomFunc";
import { useLocation } from "react-router-dom";
const ProjectPhase = ({ params, ...props }) => { const ProjectPhase = ({ params, ...props }) => {
@ -26,6 +34,7 @@ const ProjectPhase = ({ params, ...props }) => {
user_name = props.user_name; user_name = props.user_name;
} }
const location = useLocation();
const HEADER = { const HEADER = {
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
@ -350,10 +359,20 @@ const ProjectPhase = ({ params, ...props }) => {
className: 'nowrap', className: 'nowrap',
render: (text, record) => <> render: (text, record) => <>
<Tooltip title={t('delete')}> <Tooltip title={t('delete')}>
<i className="fa fa-trash" style={{ color: 'red', marginRight: '10px', cursor: "pointer" }} onClick={() => handleDelete(text.id)}></i> {
checkActMenup(location.pathname, 'delete') ?
<i id="TooltipDelete" className="fa fa-trash" style={{ color: 'red', marginRight: '10px', cursor: "pointer" }} onClick={() => handleDelete(text.id)}></i>
:
null
}
</Tooltip> </Tooltip>
<Tooltip title={t('Edit')}> <Tooltip title={t('Edit')}>
<i className="fa fa-edit" style={{ color: 'green', cursor: "pointer" }} onClick={() => handleEdit(text)}></i> {
checkActMenup(location.pathname, 'update') ?
<i id="TooltipEdit" className="fa fa-edit" style={{ color: 'green', cursor: "pointer" }} onClick={() => handleEdit(text)}></i>
:
null
}
</Tooltip>{" "} </Tooltip>{" "}
</>, </>,
}, },
@ -429,7 +448,12 @@ const ProjectPhase = ({ params, ...props }) => {
</Col> </Col>
<Col> <Col>
<Tooltip title={t('projectPhase')}> <Tooltip title={t('projectPhase')}>
{
checkActMenup(location.pathname, 'create') ?
<Button style={{ background: "#4caf50", color: "#fff" }} onClick={() => handleOpenDialog('Save')}><i className="fa fa-plus"></i></Button> <Button style={{ background: "#4caf50", color: "#fff" }} onClick={() => handleOpenDialog('Save')}><i className="fa fa-plus"></i></Button>
:
null
}
</Tooltip> </Tooltip>
<Tooltip title={t('exportExcel')}> <Tooltip title={t('exportExcel')}>
<Button style={{ marginLeft: "5px" }} onClick={() => handleExportExcel()}><i className="fa fa-print"></i></Button> <Button style={{ marginLeft: "5px" }} onClick={() => handleExportExcel()}><i className="fa fa-print"></i></Button>

Loading…
Cancel
Save