Browse Source

checklist 3

pull/1/head
khaidralirahman 10 months ago
parent
commit
c1f8a08d6d
  1. 30
      src/views/SimproV2/ChecklistK3/index.js

30
src/views/SimproV2/ChecklistK3/index.js

@ -10,6 +10,14 @@ import {
CHECKLIST_K3_ADD, CHECKLIST_K3_EDIT, CHECKLIST_K3_DELETE, CHECKLIST_K3_SEARCH, COMPANY_MANAGEMENT_LIST CHECKLIST_K3_ADD, CHECKLIST_K3_EDIT, CHECKLIST_K3_DELETE, CHECKLIST_K3_SEARCH, COMPANY_MANAGEMENT_LIST
} from '../../../const/ApiConst'; } from '../../../const/ApiConst';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useLocation } from "react-router-dom";
import {
formatNumber,
formatRupiah,
formatThousand,
renderFormatRupiah,
checkActMenup,
} from "../../../const/CustomFunc";
const token = window.localStorage.getItem('token'); const token = window.localStorage.getItem('token');
const config = { const config = {
@ -34,6 +42,7 @@ const ChecklistK3 = ({ params, ...props }) => {
hierarchy = props.hierarchy; hierarchy = props.hierarchy;
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",
@ -363,7 +372,12 @@ const ChecklistK3 = ({ params, ...props }) => {
</Col> </Col>
<Col> <Col>
<Tooltip title={t('ChecklistK3Add')}> <Tooltip title={t('ChecklistK3Add')}>
<Button style={{ background: "#4caf50", color: "#fff" }} onClick={() => handleOpenDialog('Save')}><i className="fa fa-plus"></i></Button> {
checkActMenup(location.pathname, 'create') ?
<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" }} color="primary" onClick={() => handleExportExcel()}><i className="fa fa-print"></i></Button> <Button style={{ marginLeft: "5px" }} color="primary" onClick={() => handleExportExcel()}><i className="fa fa-print"></i></Button>
@ -390,10 +404,20 @@ const ChecklistK3 = ({ params, ...props }) => {
<tr key={n.id}> <tr key={n.id}>
<td className='nowrap'> <td className='nowrap'>
<Tooltip title={t('delete')}> <Tooltip title={t('delete')}>
<i id="TooltipDelete" className="fa fa-trash" style={{ color: 'red', marginRight: 10, cursor: "pointer" }} onClick={() => handleDelete(n.id)}></i> {
checkActMenup(location.pathname, 'delete') ?
<i id="TooltipDelete" className="fa fa-trash" style={{ color: 'red', marginRight: 10, cursor: "pointer" }} onClick={() => handleDelete(n.id)}></i>
:
null
}
</Tooltip> </Tooltip>
<Tooltip title={t('edit')}> <Tooltip title={t('edit')}>
<i id="TooltipEdit" className="fa fa-edit" style={{ color: 'green', cursor: "pointer" }} onClick={() => handleEdit(n)}></i> {
checkActMenup(location.pathname, 'edit') ?
<i id="TooltipEdit" className="fa fa-edit" style={{ color: 'green', cursor: "pointer" }} onClick={() => handleEdit(n)}></i>
:
null
}
</Tooltip> </Tooltip>
</td> </td>
{role_name === 'Super Admin' && {role_name === 'Super Admin' &&

Loading…
Cancel
Save