Commit 7a14bac1 authored by fahrur huzain's avatar fahrur huzain

closing dan logactivity

parent 81c31f87
...@@ -37,6 +37,9 @@ const Images = { ...@@ -37,6 +37,9 @@ const Images = {
down: require('./down.svg'), down: require('./down.svg'),
close: require('./close.svg'), close: require('./close.svg'),
cross: require('./cross.svg'), cross: require('./cross.svg'),
rollback: require('./rollback.svg'),
circleCheck: require('./check-circle.svg'),
crossCircle: require('./cross-circle.svg'),
//Image //Image
triputra: require('./triputra.png'), triputra: require('./triputra.png'),
......
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="36" height="36" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 16C2 8.26801 8.26801 2 16 2C23.732 2 30 8.26801 30 16C30 23.732 23.732 30 16 30C8.26801 30 2 23.732 2 16ZM20.9502 14.2929C21.3407 13.9024 21.3407 13.2692 20.9502 12.8787C20.5597 12.4882 19.9265 12.4882 19.536 12.8787L14.5862 17.8285L12.4649 15.7071C12.0744 15.3166 11.4412 15.3166 11.0507 15.7071C10.6602 16.0977 10.6602 16.7308 11.0507 17.1213L13.8791 19.9498C14.2697 20.3403 14.9028 20.3403 15.2933 19.9498L20.9502 14.2929Z" fill="#4CAF51"/>
</svg>
\ No newline at end of file
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
<svg width="32" height="32" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" fill="#000000">
<g id="SVGRepo_bgCarrier" stroke-width="0"/>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"/>
<g id="SVGRepo_iconCarrier"> <title>cross-circle</title> <desc>Created with Sketch Beta.</desc> <defs> </defs> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage"> <g id="Icon-Set-Filled" sketch:type="MSLayerGroup" transform="translate(-570.000000, -1089.000000)" fill="#ED5050"> <path d="M591.657,1109.24 C592.048,1109.63 592.048,1110.27 591.657,1110.66 C591.267,1111.05 590.633,1111.05 590.242,1110.66 L586.006,1106.42 L581.74,1110.69 C581.346,1111.08 580.708,1111.08 580.314,1110.69 C579.921,1110.29 579.921,1109.65 580.314,1109.26 L584.58,1104.99 L580.344,1100.76 C579.953,1100.37 579.953,1099.73 580.344,1099.34 C580.733,1098.95 581.367,1098.95 581.758,1099.34 L585.994,1103.58 L590.292,1099.28 C590.686,1098.89 591.323,1098.89 591.717,1099.28 C592.11,1099.68 592.11,1100.31 591.717,1100.71 L587.42,1105.01 L591.657,1109.24 L591.657,1109.24 Z M586,1089 C577.163,1089 570,1096.16 570,1105 C570,1113.84 577.163,1121 586,1121 C594.837,1121 602,1113.84 602,1105 C602,1096.16 594.837,1089 586,1089 L586,1089 Z" id="cross-circle" sketch:type="MSShapeGroup"> </path> </g> </g> </g>
</svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="23" height="24" viewBox="0 0 23 24"> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<defs>
<path id="ni206yvona" d="M0 0L22.46 0 22.46 23.835 0 23.835z"/> <!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
</defs> <svg width="32" height="32" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" fill="#000000">
<g fill="none" fill-rule="evenodd">
<mask id="6c78lb5jhb" fill="#fff"> <g id="SVGRepo_bgCarrier" stroke-width="0"/>
<use xlink:href="#ni206yvona"/>
</mask> <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"/>
<path fill="#EC1F25" d="M21.08 23.834c-.96-.003-1.715-.22-2.447-.515-1.416-.569-2.64-1.45-3.834-2.38-1.443-1.124-2.783-2.362-4.057-3.671-.718-.738-1.369-1.535-2.019-2.331-.137-.168-.131-.168-.243.019-1.084 1.801-2.058 3.66-3.006 5.535-.48.95-1.093 1.812-1.87 2.551-.6.574-1.286.876-2.131.72C.7 23.618.127 22.904.023 22.26c-.073-.446.06-.877.316-1.268.727-1.11 1.42-2.244 2.17-3.338.828-1.207 1.53-2.492 2.37-3.69.448-.64.9-1.279 1.371-1.902.078-.103.09-.173.006-.283-.993-1.32-1.925-2.68-2.772-4.1-.476-.797-1.017-1.557-1.524-2.336C1.408 4.498.852 3.656.316 2.8-.025 2.255-.13 1.671.201 1.078.556.443 1.072.06 1.831.037c.712-.022 1.27.285 1.767.753.828.782 1.459 1.709 1.963 2.72.914 1.834 1.882 3.64 2.932 5.399.058.097.092.182.207.033.959-1.234 2.005-2.39 3.137-3.467 1.458-1.387 2.981-2.697 4.664-3.811C17.528.984 18.609.42 19.819.142c.597-.137 1.199-.206 1.806-.063.25.06.472.17.653.357.238.246.24.556.006.812-.327.357-.749.573-1.182.755-1.315.55-2.447 1.379-3.542 2.267-1.128.913-2.192 1.897-3.21 2.93-1.106 1.119-2.159 2.286-3.104 3.546-.256.34-.486.7-.736 1.045-.072.099-.057.17.007.265.756 1.13 1.606 2.187 2.52 3.193.913 1.009 1.868 1.975 2.873 2.892 1.09.995 2.219 1.941 3.448 2.764.657.44 1.378.751 2.085 1.094.285.138.555.3.78.53.347.352.312.722-.1 1.007-.363.25-.774.306-1.042.298" mask="url(#6c78lb5jhb)"/>
</g> <g id="SVGRepo_iconCarrier"> <title>cross-circle</title> <desc>Created with Sketch Beta.</desc> <defs> </defs> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage"> <g id="Icon-Set-Filled" sketch:type="MSLayerGroup" transform="translate(-570.000000, -1089.000000)" fill="#ED5050"> <path d="M591.657,1109.24 C592.048,1109.63 592.048,1110.27 591.657,1110.66 C591.267,1111.05 590.633,1111.05 590.242,1110.66 L586.006,1106.42 L581.74,1110.69 C581.346,1111.08 580.708,1111.08 580.314,1110.69 C579.921,1110.29 579.921,1109.65 580.314,1109.26 L584.58,1104.99 L580.344,1100.76 C579.953,1100.37 579.953,1099.73 580.344,1099.34 C580.733,1098.95 581.367,1098.95 581.758,1099.34 L585.994,1103.58 L590.292,1099.28 C590.686,1098.89 591.323,1098.89 591.717,1099.28 C592.11,1099.68 592.11,1100.31 591.717,1100.71 L587.42,1105.01 L591.657,1109.24 L591.657,1109.24 Z M586,1089 C577.163,1089 570,1096.16 570,1105 C570,1113.84 577.163,1121 586,1121 C594.837,1121 602,1113.84 602,1105 C602,1096.16 594.837,1089 586,1089 L586,1089 Z" id="cross-circle" sketch:type="MSShapeGroup"> </path> </g> </g> </g>
</svg> </svg>
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg height="32" width="32" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 512 512" xml:space="preserve">
<circle style="fill:#4CAF51;" cx="256" cy="256" r="256"/>
<path style="fill:#4CAF51;" d="M505.018,315.559l-66.743-68.07l-105.636,5.277L209.53,129.612l-57.827,46.801l-22.985,22.985
l24.062,158.168l149.594,150.232C402.142,489.541,481.69,413.458,505.018,315.559z"/>
<path style="fill:#FFFFFF;" d="M438.277,247.491l-80.774-61.228l-61.219,80.775l27.477,20.825l23.295-30.737
c0.657,16.991-3.16,33.925-11.355,49.338c-12.216,22.976-32.649,39.82-57.535,47.428c-24.886,7.609-51.247,5.07-74.221-7.147
c-22.976-12.216-39.82-32.649-47.428-57.535c-7.609-24.886-5.07-51.245,7.147-74.221c12.216-22.976,32.649-39.82,57.535-47.428
l-11.669-37.948c-35.014,10.704-63.686,34.435-80.875,66.762c-17.189,32.328-20.759,69.415-10.056,104.427
s34.404,63.762,66.731,80.951c20.102,10.688,42.039,16.112,64.179,16.112c13.465,0,27.008-2.008,40.25-6.056
c35.014-10.704,63.762-34.404,80.951-66.731c12.204-22.95,17.505-48.3,15.744-73.604l30.992,23.493L438.277,247.491z"/>
<path style="fill:#E6F3FF;" d="M438.277,247.491l-80.774-61.228l-61.219,80.775l27.477,20.825l23.295-30.737
c0.657,16.991-3.16,33.925-11.355,49.338c-12.216,22.976-32.649,39.82-57.535,47.428c-8.621,2.636-17.418,4.025-26.19,4.244v39.683
c12.65-0.231,25.35-2.208,37.783-6.01c35.014-10.704,63.762-34.404,80.951-66.731c12.204-22.95,17.505-48.3,15.744-73.604
l30.992,23.493L438.277,247.491z"/>
</svg>
\ No newline at end of file
...@@ -60,7 +60,8 @@ export default class AuditTrails extends Component { ...@@ -60,7 +60,8 @@ export default class AuditTrails extends Component {
load: false, load: false,
judul: '', judul: '',
popupDel: false, popupDel: false,
loading: false loading: false,
popupRollback: false
} }
} }
...@@ -130,10 +131,10 @@ export default class AuditTrails extends Component { ...@@ -130,10 +131,10 @@ export default class AuditTrails extends Component {
} }
openPopUp(index, type) { openPopUp(index, type) {
if (type === 'edit') { if (type === 'rollback') {
this.setState({ this.setState({
rowData: index, rowData: index,
visibleEdit: true popupRollback: true
}) })
} else if (type === 'delete') { } else if (type === 'delete') {
this.setState({ this.setState({
...@@ -182,6 +183,33 @@ export default class AuditTrails extends Component { ...@@ -182,6 +183,33 @@ export default class AuditTrails extends Component {
}) })
} }
deleteAM = (payload) => {
this.setState({ popupDel: false })
api.create().deleteAM(payload).then(response => {
// console.log(response.data)
if (response.data) {
if (response.ok) {
if (response.data.status == 'success') {
this.getData()
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ loading: false, alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
})
}
closeAlert() { closeAlert() {
this.setState({ alert: false }) this.setState({ alert: false })
...@@ -198,7 +226,7 @@ export default class AuditTrails extends Component { ...@@ -198,7 +226,7 @@ export default class AuditTrails extends Component {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{this.state.btnedit && <span> {this.state.btnedit && <span>
<a data-tip={'Edit'} data-for="edit"> <a data-tip={'Rollback'} data-for="rollback">
<button <button
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
...@@ -209,27 +237,11 @@ export default class AuditTrails extends Component { ...@@ -209,27 +237,11 @@ export default class AuditTrails extends Component {
// onClick={() => console.log(tableMeta)} // onClick={() => console.log(tableMeta)}
onClick={() => this.openPopUp(tableMeta.rowData, 'edit')} onClick={() => this.openPopUp(tableMeta.rowData, 'edit')}
> >
<img src={Images.editCopy} /> <img src={Images.rollback} />
</button> </button>
</a> </a>
<ReactTooltip border={true} id="edit" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="edit" place="bottom" type="light" effect="solid" />
</span>} </span>}
{this.state.btndelete && <span>
<a data-tip={'Delete'} data-for="delete">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
}}
// onClick={() => console.log(tableMeta)}
onClick={() => this.openPopUp(tableMeta.rowData, 'delete')}
>
<img src={Images.delete} />
</button>
</a>
<ReactTooltip border={true} id="delete" place="bottom" type="light" effect="solid" />
</span>}
</div > </div >
); );
} }
...@@ -412,7 +424,15 @@ export default class AuditTrails extends Component { ...@@ -412,7 +424,15 @@ export default class AuditTrails extends Component {
</div> </div>
</div> </div>
} }
{this.state.popupDel && (
<DeleteApprovalMatrix
type={"delete"}
onClickClose={() => this.setState({ popupDel: false })}
data={this.state.rowData}
// getList={() => this.getData.bind(this)}
deleteAM={this.deleteAM.bind(this)}
/>
)}
{this.state.popupError && ( {this.state.popupError && (
<PopUpFailedSave onClickClose={() => this.setState({ popupError: false })} /> <PopUpFailedSave onClickClose={() => this.setState({ popupError: false })} />
)} )}
......
...@@ -35,7 +35,7 @@ const options2 = ct.customOptions2(); ...@@ -35,7 +35,7 @@ const options2 = ct.customOptions2();
const Alert = withStyles({ const Alert = withStyles({
})((props) => <MuiAlert elevation={6} variant="filled" {...props} />); })((props) => <MuiAlert elevation={6} variant="filled" {...props} />);
export default class LogActivity extends Component { export default class ClosingReport extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
...@@ -209,7 +209,7 @@ export default class LogActivity extends Component { ...@@ -209,7 +209,7 @@ export default class LogActivity extends Component {
// onClick={() => console.log(tableMeta)} // onClick={() => console.log(tableMeta)}
onClick={() => this.openPopUp(tableMeta.rowData, 'edit')} onClick={() => this.openPopUp(tableMeta.rowData, 'edit')}
> >
<img src={Images.editCopy} /> <img src={Images.circleCheck} />
</button> </button>
</a> </a>
<ReactTooltip border={true} id="edit" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="edit" place="bottom" type="light" effect="solid" />
...@@ -225,7 +225,7 @@ export default class LogActivity extends Component { ...@@ -225,7 +225,7 @@ export default class LogActivity extends Component {
// onClick={() => console.log(tableMeta)} // onClick={() => console.log(tableMeta)}
onClick={() => this.openPopUp(tableMeta.rowData, 'delete')} onClick={() => this.openPopUp(tableMeta.rowData, 'delete')}
> >
<img src={Images.delete} /> <img src={Images.crossCircle} />
</button> </button>
</a> </a>
<ReactTooltip border={true} id="delete" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="delete" place="bottom" type="light" effect="solid" />
...@@ -248,7 +248,7 @@ export default class LogActivity extends Component { ...@@ -248,7 +248,7 @@ export default class LogActivity extends Component {
} }
}, },
{ {
name: "Name Audit", name: "Report Name",
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
...@@ -272,7 +272,7 @@ export default class LogActivity extends Component { ...@@ -272,7 +272,7 @@ export default class LogActivity extends Component {
} }
}, },
{ {
name: "Revisi", name: "Revisi Name",
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
...@@ -330,7 +330,7 @@ export default class LogActivity extends Component { ...@@ -330,7 +330,7 @@ export default class LogActivity extends Component {
</Snackbar> </Snackbar>
<div> <div>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -182 }}> <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -182 }}>
<label style={{ width: '50%', color: 'white', fontSize: 16, alignSelf: 'center' }}>Log Activity</label> <label style={{ width: '50%', color: 'white', fontSize: 16, alignSelf: 'center' }}>Closing Report</label>
{/* <div style={{ color: 'white', width: '50%', height: 37, display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center', borderRadius: 6, paddingLeft: 5, paddingRight: 5, alignSelf: 'center' }}> {/* <div style={{ color: 'white', width: '50%', height: 37, display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center', borderRadius: 6, paddingLeft: 5, paddingRight: 5, alignSelf: 'center' }}>
<img src={Images.searchBlack} style={{ marginRight: 10 }} /> <img src={Images.searchBlack} style={{ marginRight: 10 }} />
<InputBase <InputBase
......
...@@ -35,7 +35,7 @@ const options2 = ct.customOptions2(); ...@@ -35,7 +35,7 @@ const options2 = ct.customOptions2();
const Alert = withStyles({ const Alert = withStyles({
})((props) => <MuiAlert elevation={6} variant="filled" {...props} />); })((props) => <MuiAlert elevation={6} variant="filled" {...props} />);
export default class ClosingReport extends Component { export default class LogActivity extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
...@@ -103,7 +103,7 @@ export default class ClosingReport extends Component { ...@@ -103,7 +103,7 @@ export default class ClosingReport extends Component {
if (response.data.status == 'success') { if (response.data.status == 'success') {
let data = response.data.data let data = response.data.data
let listData = data.sort((a, b) => a.approval_matrix_id - b.approval_matrix_id).map((item, index) => { let listData = data.sort((a, b) => a.approval_matrix_id - b.approval_matrix_id).map((item, index) => {
return [index, item.approval_matrix_id, item.approval_type_name, item.orders, item.fullname, item.operator_type_name, item.status] return [item.approval_matrix_id, item.approval_type_name, item.orders, item.fullname, item.operator_type_name, item.status]
}) })
this.setState({ dataTable: listData, listData: response.data.data }, () => { this.setState({ dataTable: listData, listData: response.data.data }, () => {
setTimeout(() => { setTimeout(() => {
...@@ -160,7 +160,7 @@ export default class ClosingReport extends Component { ...@@ -160,7 +160,7 @@ export default class ClosingReport extends Component {
if (response.data.status == 'success') { if (response.data.status == 'success') {
let data = response.data.data let data = response.data.data
let listData = data.map((item, index) => { let listData = data.map((item, index) => {
return [index, item.approval_matrix_id, item.approval_type_name, item.orders, item.fullname, item.operator_type_name, item.status] return [item.approval_matrix_id, item.approval_type_name, item.orders, item.fullname, item.operator_type_name, item.status]
}) })
this.setState({ dataTable: listData, listData: response.data.data }) this.setState({ dataTable: listData, listData: response.data.data })
} else { } else {
...@@ -188,120 +188,75 @@ export default class ClosingReport extends Component { ...@@ -188,120 +188,75 @@ export default class ClosingReport extends Component {
} }
render() { render() {
const columns = [{ console.log(this.state.dataTable)
name: "Action", const columns = [
options: {
filter: false,
sort: false,
customBodyRender: (val, tableMeta) => {
// console.log(tableMeta)
return (
<div style={{ display: 'flex' }}>
{this.state.btnedit && <span>
<a data-tip={'Edit'} data-for="edit">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginRight: 15
}}
// onClick={() => console.log(tableMeta)}
onClick={() => this.openPopUp(tableMeta.rowData, 'edit')}
>
<img src={Images.editCopy} />
</button>
</a>
<ReactTooltip border={true} id="edit" place="bottom" type="light" effect="solid" />
</span>}
{this.state.btndelete && <span>
<a data-tip={'Delete'} data-for="delete">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
}}
// onClick={() => console.log(tableMeta)}
onClick={() => this.openPopUp(tableMeta.rowData, 'delete')}
>
<img src={Images.delete} />
</button>
</a>
<ReactTooltip border={true} id="delete" place="bottom" type="light" effect="solid" />
</span>}
</div >
);
}
}
},
{ {
name: "ID", name: "ID",
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[6] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span> <span style={{ color: tableMeta.rowData[5] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div > </div >
); );
} }
} }
}, },
{ {
name: "Name Audit", name: "Activity",
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[6] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span> <span style={{ color: tableMeta.rowData[5] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div > </div >
); );
} }
} }
}, },
{ {
name: "Company Name", name: "Report Name",
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[6] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span> <span style={{ color: tableMeta.rowData[5] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div > </div >
); );
} }
} }
}, },
{ {
name: "Revisi", name: "Report type",
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[6] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span> <span style={{ color: tableMeta.rowData[5] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div > </div >
); );
} }
} }
}, },
{ {
name: "Approver", name: "User",
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[6] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span> <span style={{ color: tableMeta.rowData[5] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div > </div >
); );
} }
} }
}, },
{ {
name: "Status", name: "Date",
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[6] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span> <span style={{ color: tableMeta.rowData[5] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div > </div >
); );
} }
...@@ -330,7 +285,7 @@ export default class ClosingReport extends Component { ...@@ -330,7 +285,7 @@ export default class ClosingReport extends Component {
</Snackbar> </Snackbar>
<div> <div>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -182 }}> <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -182 }}>
<label style={{ width: '50%', color: 'white', fontSize: 16, alignSelf: 'center' }}>Closing Report</label> <label style={{ width: '50%', color: 'white', fontSize: 16, alignSelf: 'center' }}>Log Activity</label>
{/* <div style={{ color: 'white', width: '50%', height: 37, display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center', borderRadius: 6, paddingLeft: 5, paddingRight: 5, alignSelf: 'center' }}> {/* <div style={{ color: 'white', width: '50%', height: 37, display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center', borderRadius: 6, paddingLeft: 5, paddingRight: 5, alignSelf: 'center' }}>
<img src={Images.searchBlack} style={{ marginRight: 10 }} /> <img src={Images.searchBlack} style={{ marginRight: 10 }} />
<InputBase <InputBase
......
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 RollbackAuditTrails extends Component {
constructor(props) {
super(props)
this.state = {
id: '',
getApprovedBy: null,
getTypes: null,
}
}
componentDidMount() {
if (this.props.type === 'delete') {
this.getDetailAM()
}
}
getDetailAM() {
api.create().getDetailAM(this.props.data[1]).then(response => {
// console.log(response.data)
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
let data = response.data.data
this.setState({
id: data.approval_matrix_id,
getTypes: data.approval_type_name,
getApprovedBy: data.fullname
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
})
}
onClickDelete() {
if (this.props.type === 'delete') {
let payload = this.state.id
this.props.deleteAM(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.state.getTypes} - {this.state.getApprovedBy}?
</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.onClickDelete()}
>
<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>
);
}
}
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