Commit f97d5d21 authored by Riri Novita's avatar Riri Novita

chcm

parent e288c640
......@@ -494,6 +494,9 @@ const create = (type = "") => {
const uploadCarfmDocument = (body) => api.post('document/upload_cafrm_document', body)
const getChcmDocumentBySubmenu = (body) => api.post('document/get_chcm_document_by_submenu', body);
const uploadChcmDocument = (body) => api.post('document/upload_chcm_document', body)
const deleteReportChcm = (id) => api.post(`document/delete_chcm_document/${id}`)
const getDetailReportChcm = (id) => api.get(`document/get_chcm_document_by_id/${id}`)
const updateReportChcm = (body) => api.post('document/update_chcm_document', body)
// Monitoring
......@@ -677,6 +680,9 @@ const create = (type = "") => {
uploadCarfmDocument,
getChcmDocumentBySubmenu,
uploadChcmDocument,
deleteReportChcm,
getDetailReportChcm,
updateReportChcm,
updateDocument,
downloadDocument,
getPerusahaanUserActive,
......
......@@ -101,6 +101,8 @@ export default class ChcmDocument extends Component {
menu: subMenu
}
api.create().getPermission(payload).then(response => {
console.log(response);
if (response.data) {
console.log(`status get permission ${response.data.status}`);
if (response.data.status === "success") {
......@@ -108,6 +110,8 @@ export default class ChcmDocument extends Component {
btncreate: response.data.data.create,
btnview: response.data.data.view,
btndownload: response.data.data.download,
btnedit: response.data.data.edit,
btndelete: response.data.data.delete,
load: true,
})
console.log("btn create " + this.state.btncreate);
......@@ -190,7 +194,6 @@ export default class ChcmDocument extends Component {
if (response.data) {
if (response.ok) {
if (response.data.message === "Data was Saved Successfully") {
console.log("tes123");
this.setState({ visibleCreate: false, visibleTrue: true, loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'success'}, () => {
// window.location.reload();
......@@ -295,6 +298,10 @@ export default class ChcmDocument extends Component {
name={this.state.name}
submenu_id={this.state.submenu_id}
btndownload = {this.state.btndownload}
btnedit = {this.state.btnedit}
btndelete = {this.state.btndelete}
menuName={this.state.menu_title}
submenu_id={this.state.submenu_id}
/>)}
</div>
......
This diff is collapsed.
import React, { Component } from 'react';
import Images from '../../assets/Images';
import { Typography } from '@material-ui/core';
import api from "../../api";
import Constant from '../../library/Constant';
export default class PopUpDelete extends Component {
constructor(props) {
super(props)
this.state = {
id: '',
getApprovedBy: null,
getTypes: null,
}
}
componentDidMount() {
console.log(this.props);
if (this.props.type === 'delete') {
// console.log(this.props.idoc)
// console.log(this.props.data)
}
}
onClickDelete() {
if (this.props.type == 'delete') {
let payload = this.props.idoc
this.props.deleteDoc(payload)
}
}
render() {
return (
<div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
<div style={{ display: 'flex', justifyContent: 'center', paddingTop: 20 }}>
<img src={Images.failed} />
</div>
<div style={{ display: 'grid', justifyContent: 'center', marginTop: 20, paddingBottom: 20 }}>
<span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold', fontFamily: 'Nunito Sans, sans-serif' }}>
Delete {this.props.data[1]} ?
</span>
</div>
<div className="border-top grid grid-2x" style={{ height: 56, backgroundColor: '#f5f5f5', paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1" style={{ alignSelf: 'center' }}>
<button
type="button"
onClick={() => this.props.onClickClose()}
>
<div style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#354960', fontSize: 11 }}>Cancel</span>
</div>
</button>
</div>
<div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
<button
type="button"
onClick={() =>
this.setState({ loading: true }, () => {
setTimeout(() => {
this.onClickDelete()
}, 100);
})
}
>
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Delete</span>
</div>
</button>
</div>
</div>
</div>
</div>
);
}
}
This diff is collapsed.
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