|
|
|
@ -10,6 +10,14 @@ import {
|
|
|
|
|
CHECKLIST_K3_ADD, CHECKLIST_K3_EDIT, CHECKLIST_K3_DELETE, CHECKLIST_K3_SEARCH, COMPANY_MANAGEMENT_LIST |
|
|
|
|
} from '../../../const/ApiConst'; |
|
|
|
|
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 config = { |
|
|
|
@ -34,6 +42,7 @@ const ChecklistK3 = ({ params, ...props }) => {
|
|
|
|
|
hierarchy = props.hierarchy; |
|
|
|
|
user_name = props.user_name; |
|
|
|
|
} |
|
|
|
|
const location = useLocation(); |
|
|
|
|
const HEADER = { |
|
|
|
|
headers: { |
|
|
|
|
"Content-Type": "application/json", |
|
|
|
@ -363,7 +372,12 @@ const ChecklistK3 = ({ params, ...props }) => {
|
|
|
|
|
</Col> |
|
|
|
|
<Col> |
|
|
|
|
<Tooltip title={t('ChecklistK3Add')}> |
|
|
|
|
{ |
|
|
|
|
checkActMenup(location.pathname, 'create') ? |
|
|
|
|
<Button style={{ background: "#4caf50", color: "#fff" }} onClick={() => handleOpenDialog('Save')}><i className="fa fa-plus"></i></Button> |
|
|
|
|
: |
|
|
|
|
null |
|
|
|
|
} |
|
|
|
|
</Tooltip> |
|
|
|
|
<Tooltip title={t('exportExcel')}> |
|
|
|
|
<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}> |
|
|
|
|
<td className='nowrap'> |
|
|
|
|
<Tooltip title={t('delete')}> |
|
|
|
|
{ |
|
|
|
|
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 title={t('edit')}> |
|
|
|
|
{ |
|
|
|
|
checkActMenup(location.pathname, 'edit') ? |
|
|
|
|
<i id="TooltipEdit" className="fa fa-edit" style={{ color: 'green', cursor: "pointer" }} onClick={() => handleEdit(n)}></i> |
|
|
|
|
: |
|
|
|
|
null |
|
|
|
|
} |
|
|
|
|
</Tooltip> |
|
|
|
|
</td> |
|
|
|
|
{role_name === 'Super Admin' && |
|
|
|
|