Commit df4d80e6 authored by Deni Rinaldi's avatar Deni Rinaldi

update permision

parent 163b234e
......@@ -160,6 +160,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const uploadAttachment = (body) => api.post('transaction/upload_attachment', body)
const getRevision = (body) => api.post('transaction/get_revision', body)
const getPeriodeTransaction = () => api.get('transaction/get_periode')
const deleteAttachment = (id) => api.post(`transaction/delete_attachment/${id}`)
//Template
const downloadTemplate = (fileName, fileType) => api.get(`attachment/download_file?fileName=${fileName}&&fileType=${fileType}`)
......@@ -262,7 +263,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
getMasterBudgetAtt,
uploadAttachment,
getPeriodeTransaction,
getRevision
getRevision,
deleteAttachment
}
}
......
......@@ -591,7 +591,6 @@ export default class ApprovalMatrix extends Component {
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginLeft: 16,
padding: 0,
margin: 5
}}
......@@ -608,7 +607,6 @@ export default class ApprovalMatrix extends Component {
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginLeft: 16,
padding: 0,
margin: 5
}}
......@@ -624,7 +622,6 @@ export default class ApprovalMatrix extends Component {
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginLeft: 16,
padding: 0,
margin: 5
}}
......@@ -635,15 +632,15 @@ export default class ApprovalMatrix extends Component {
</a>
<ReactTooltip border={true} id="visualisasi" place="bottom" type="light" effect="solid" />
{this.state.btncreate && (
<a data-tip={'Add'} data-for="create">
<a data-tip={'Add New'} data-for="create">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginLeft: 16,
padding: 0,
margin: 5
margin: 5,
marginRight: 20
}}
onClick={() => this.setState({ visibleCreate: true })}
>
......
......@@ -244,7 +244,17 @@ export default class BudgetTahunan extends Component {
})
}
}
// console.log(response)
})
}
deleteAttachment(item) {
api.create().deleteAttachment(item.attachment_id).then(response => {
if (response.data) {
if (response.data.status === "success") {
this.getReport()
this.getReportAttachment()
}
}
})
}
......@@ -291,9 +301,9 @@ export default class BudgetTahunan extends Component {
<div style={{ display: 'flex' }}>
{val === "submitted" || val === "approved" ?
<img src={Images.ceklis} style={{ width: 31, height: 24 }} /> :
val === "revision" ?
<span>Revisi</span> :
null
val === "revision" ?
<span>Revisi</span> :
null
}
</div >
);
......@@ -476,7 +486,18 @@ export default class BudgetTahunan extends Component {
{this.state.listAttachment.length > 0 ?
this.state.listAttachment.map((item) => {
return (
<Typography style={{ fontSize: '16px', color: '#ff3939' }}>Delete</Typography>
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
display: 'grid'
}}
onClick={() => this.deleteAttachment(item)}
>
<Typography style={{ fontSize: '16px', color: '#ff3939' }}>Delete</Typography>
</button>
)
})
: null
......
......@@ -674,7 +674,7 @@ export default class CreateParameter extends Component {
helperText={this.state.msgErrorPerusahaan}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
label="Company" />}
label="Company Name" />}
value={this.state.getPerusahaan}
/>
</div>
......@@ -1044,7 +1044,7 @@ export default class CreateParameter extends Component {
{...params}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
label="Company"
label="Company Name"
error={this.state.errorPerusahaan}
helperText={this.state.msgErrorPerusahaan}
/>}
......
......@@ -42,7 +42,10 @@ export default class Perusahaan extends Component {
popupError: false,
alert: false,
tipeAlert: '',
messageAlert: ''
messageAlert: '',
create: false,
edit: false,
load: false
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -278,7 +281,7 @@ export default class Perusahaan extends Component {
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', dataTable: [] })
}
}
})
}
......@@ -385,8 +388,8 @@ export default class Perusahaan extends Component {
console.log(response)
if (response.data) {
if (response.data.status == "success") {
this.getData()
this.setState({ visiblePerusahaan: true, alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
this.getData()
this.setState({ visiblePerusahaan: true, alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' })
}
......@@ -407,17 +410,19 @@ export default class Perusahaan extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent'
}}
// onClick={() => this.setState({ visibleEdit: true, data: tableMeta.rowData })}
onClick={() => this.openPopUp(tableMeta.rowData, 'edit')}
>
<img src={Images.editCopy} />
</button>
{this.state.edit && (
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent'
}}
// onClick={() => this.setState({ visibleEdit: true, data: tableMeta.rowData })}
onClick={() => this.openPopUp(tableMeta.rowData, 'edit')}
>
<img src={Images.editCopy} />
</button>
)}
</div >
);
}
......@@ -524,19 +529,21 @@ export default class Perusahaan extends Component {
</button>
</a>
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
<a data-tip={'Upload'} data-for="upload">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() => this.setState({ visibleUpload: true })}
>
<img src={Images.upload} />
</button>
</a>
{this.state.create && (
<a data-tip={'Upload'} data-for="upload">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() => this.setState({ visibleUpload: true })}
>
<img src={Images.upload} />
</button>
</a>
)}
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
<a data-tip={'Download'} data-for="download">
<button
......@@ -566,19 +573,22 @@ export default class Perusahaan extends Component {
</button>
</a>
<ReactTooltip border={true} id="visual" place="bottom" type="light" effect="solid" />
<a data-tip={'Add'} data-for="create">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() => this.setState({ visibleCreate: true })}
>
<img src={Images.add} />
</button>
</a>
{this.state.create && (
<a data-tip={'Add New'} data-for="create">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5,
marginRight: 20
}}
onClick={() => this.setState({ visibleCreate: true })}
>
<img src={Images.add} />
</button>
</a>
)}
<ReactTooltip border={true} id="create" place="bottom" type="light" effect="solid" />
</div>
</div>
......@@ -598,6 +608,8 @@ export default class Perusahaan extends Component {
:
this.state.visibleVisual === true ?
<VisualPerusahaan
buttonCreate={this.state.create}
buttonEdit={this.state.edit}
onClickClose={() => this.setState({ visibleVisual: false, visiblePerusahaan: true })}
height={this.props.height}
/>
......@@ -686,7 +698,7 @@ export default class Perusahaan extends Component {
className="btn btn-circle btn-white"
onClick={() => this.setState({ visibleUpload: false })}
>
<img src={Images.close}/>
<img src={Images.close} />
</button>
</div>
</div>
......
......@@ -16,22 +16,24 @@ export default class VisualPerusahaan extends Component {
super(props)
this.state = {
items: [
{ id: 0, GG: 'Accumulated Depreciation (negative value)', collapse: false,
{
id: 0, GG: 'Accumulated Depreciation (negative value)', collapse: false,
children: [
{ id: 3, GG: 'Beginning Balance', collapse: false },
{ id: 4, GG: 'Depreciation expense MTD (please fill in, if any)', collapse: false },
{ id: 5, GG: 'Depreciation expense MTD (please fill in, if any)', collapse: false }
]
},{
}, {
id: 1, GG: 'Control Gain/(Loss) on Fixed Assets', collapse: false
},{
}, {
id: 2, GG: 'Gain/(Loss) on Fixed Assets', collapse: false,
children: [
{ id: 6, GG: 'NBV', collapse: false,
children : [
{
id: 6, GG: 'NBV', collapse: false,
children: [
{ id: 8, GG: 'Cost', collapse: false },
{ id: 9, GG: 'Accm. Depreciation', collapse: false },
]
]
},
{ id: 7, GG: 'Proceed from sale or disposal of Fixed Assets (please fill in, if any)', collapse: false },
]
......@@ -52,7 +54,7 @@ export default class VisualPerusahaan extends Component {
getPerusahaan() {
api.create().getPerusahaanHierarki().then((response) => {
console.log(response)
if (response.data) {
if (response.data) {
if (response.data.status == 'success') {
this.setState({ items: response.data.data })
console.log(response.data.data)
......@@ -78,7 +80,7 @@ export default class VisualPerusahaan extends Component {
arrayCollapse.push(collapseCase)
}
if (this.refNestable) {
this.refNestable.collapse(arrayCollapse.length > 0? arrayCollapse : 'NONE');
this.refNestable.collapse(arrayCollapse.length > 0 ? arrayCollapse : 'NONE');
}
};
......@@ -88,9 +90,9 @@ export default class VisualPerusahaan extends Component {
}
api.create().saveVisualisasiPerusahaan(payload).then((response) => {
// if (response.data.status == 'ucces') {
this.props.onClickClose()
this.props.onClickClose()
// } else {
// alert(response.data.message)
// alert(response.data.message)
// }
})
}
......@@ -99,9 +101,9 @@ export default class VisualPerusahaan extends Component {
return (
<div>
<button type="button" onClick={() => this.collapse(item.id)}>
{collapseIcon ? (this.state.arrayCollapse.includes(item.id)? <AddIcon/> : <RemoveIcon/>) : null}
{collapseIcon ? (this.state.arrayCollapse.includes(item.id) ? <AddIcon /> : <RemoveIcon />) : null}
</button>
<label style={{marginLeft: collapseIcon ? 10 : 0}}>{item.company_name}</label>
<label style={{ marginLeft: collapseIcon ? 10 : 0 }}>{item.company_name}</label>
</div>
)
};
......@@ -113,46 +115,49 @@ export default class VisualPerusahaan extends Component {
render() {
return (
<div>
<div>
<div style={{ height: this.props.height }}>
<div style={{ width: '100%', backgroundColor: '#354960' }} />
<div>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -150 }}>
<label style={{ color: 'white', width: '20%', fontSize: 16, paddingTop: 8 }}>Company Hierarchy</label>
</div>
<div style={{ display: 'flex', paddingRight: 25, paddingLeft: 25 }}>
<label style={{ color: '#51c6ea', width: '20%', fontSize: 11 }}>Master Data / Company /
<span style={{ color: 'white', width: '20%', fontSize: 11 }}> Visualization</span>
</label>
<div>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -150 }}>
<label style={{ color: 'white', width: '20%', fontSize: 16, paddingTop: 8 }}>Company Hierarchy</label>
</div>
<div style={{ display: 'flex', paddingRight: 25, paddingLeft: 25 }}>
<label style={{ color: '#51c6ea', width: '20%', fontSize: 11 }}>Master Data / Company /
<span style={{ color: 'white', width: '20%', fontSize: 11 }}> Visualization</span>
</label>
</div>
<div style={{ padding: 25, width: '100%' }}>
<div style={{ width: '100%', padding: 25, backgroundColor: 'white', borderRadius: 6, border: 'solid 1px #c4c4c4' }}>
<Nestable
items={this.state.items}
collapsed={this.state.defaultCollapsed}
renderItem={this.renderItem}
ref={el => this.refNestable = el}
onChange={(e) => this.setState({ items: e }, () => console.log(JSON.stringify(e)))}
/>
</div>
<div style={{ padding: 25, width: '100%' }}>
<div style={{ width: '100%', padding: 25, backgroundColor: 'white', borderRadius: 6, border: 'solid 1px #c4c4c4'}}>
<Nestable
items={this.state.items}
collapsed={this.state.defaultCollapsed}
renderItem={this.renderItem}
ref={el => this.refNestable = el}
onChange={(e) => this.setState({items: e}, () => console.log(JSON.stringify(e)))}
/>
</div>
</div>
<div className="row" style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 15, paddingLeft: 15, paddingBottom: 25 }}>
<div onClick={() => this.props.onClickClose()} style={{ width: 102, height: 30, marginLeft: 25, backgroundColor: 'dodgerblue', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor: "pointer" }}>
<span style={{ color: '#fff', fontSize: 11 }}>Back</span>
</div>
<div className="row" style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 15, paddingLeft: 15, paddingBottom: 25 }}>
<div onClick={() => this.props.onClickClose()} style={{ width: 102, height: 30, marginLeft: 25, backgroundColor: 'dodgerblue', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor:"pointer" }}>
<span style={{ color: '#fff', fontSize: 11 }}>Back</span>
</div>
{this.props.buttonEdit && (
<div className="row" style={{ float: 'right', marginRight: 25 }}>
<div onClick={() => this.props.onClickClose()} style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor:"pointer" }}>
<div onClick={() => this.props.onClickClose()} style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor: "pointer" }}>
<span style={{ color: '#354960', fontSize: 11 }} >Cancel</span>
</div>
<div onClick={() => this.handleSave()} style={{ width: 102, height: 30, marginLeft: 25, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor:"pointer" }}>
<div onClick={() => this.handleSave()} style={{ width: 102, height: 30, marginLeft: 25, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor: "pointer" }}>
<span style={{ color: '#fff', fontSize: 11 }}>Save</span>
</div>
</div>
</div>
)}
</div>
</div>
</div>
</div>
);
}
}
......@@ -217,7 +217,7 @@ export default class UnitBisnis extends Component {
getData() {
api.create().getUnitBisnis().then((response) => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.data.status == 'success') {
let data = response.data.data
......
......@@ -573,13 +573,14 @@ export default class UserRole extends Component {
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
{this.state.buttonCreate && (
<a data-tip={'Create'} data-for="create">
<a data-tip={'Add New'} data-for="create">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
margin: 5,
marginRight: 20
}}
onClick={() => this.setState({ add: true })}
>
......
......@@ -257,13 +257,14 @@ class UserRole extends Component {
{/* <label style={{ color: 'white', width: '60%', justifyContent: 'center', display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center' }}>Search</label> */}
<div style={{ width: '20%', justifyContent: 'flex-end', display: 'flex' }}>
{this.state.buttonCreate && (
<a data-tip={'Create'} data-for="create">
<a data-tip={'Add New'} data-for="create">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
margin: 5,
marginRight: 20
}}
onClick={() => this.setState({ add: true })}
>
......
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