|
|
@ -8,6 +8,14 @@ import { NotificationContainer, NotificationManager } from 'react-notifications' |
|
|
|
import { Pagination, Button, Tooltip } from 'antd'; |
|
|
|
import { Pagination, Button, Tooltip } from 'antd'; |
|
|
|
import { SATUAN_ADD, SATUAN_EDIT, SATUAN_DELETE, SATUAN_SEARCH, COMPANY_MANAGEMENT_LIST } from '../../../const/ApiConst'; |
|
|
|
import { SATUAN_ADD, SATUAN_EDIT, SATUAN_DELETE, SATUAN_SEARCH, COMPANY_MANAGEMENT_LIST } 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 Satuan = ({ params, ...props }) => { |
|
|
|
const Satuan = ({ params, ...props }) => { |
|
|
@ -24,7 +32,7 @@ const Satuan = ({ 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", |
|
|
@ -352,7 +360,12 @@ const Satuan = ({ params, ...props }) => { |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
<Col> |
|
|
|
<Col> |
|
|
|
<Tooltip title={t('uomAdd')}> |
|
|
|
<Tooltip title={t('uomAdd')}> |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
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" }} 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> |
|
|
@ -380,11 +393,21 @@ const Satuan = ({ params, ...props }) => { |
|
|
|
<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('ubah')}> |
|
|
|
<Tooltip title={t('ubah')}> |
|
|
|
<i id="TooltipEdit" className="fa fa-edit" style={{ color: 'green', cursor: "pointer" }} onClick={() => handleEdit(n)}></i> |
|
|
|
{ |
|
|
|
|
|
|
|
checkActMenup(location.pathname, 'update') ? |
|
|
|
|
|
|
|
<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' && |
|
|
|