Commit cd9c7f4c authored by Faisal Hamdi's avatar Faisal Hamdi

Merge branch 'faisal' into 'master'

apdet lagi!

See merge request !769
parents 7e6decdd d0f7c5d8
...@@ -1175,6 +1175,7 @@ export default class MonthlyReport extends Component { ...@@ -1175,6 +1175,7 @@ export default class MonthlyReport extends Component {
month={this.state.month} month={this.state.month}
saveToMonthlyReport={this.saveToMonthlyReport.bind(this)} saveToMonthlyReport={this.saveToMonthlyReport.bind(this)}
onClickClose={() => this.setState({ visibleFAM: false, visibleMonthlyReport: true })} onClickClose={() => this.setState({ visibleFAM: false, visibleMonthlyReport: true })}
isApprover={this.state.isApprover}
/> />
)} )}
{this.state.visibleCAT && ( {this.state.visibleCAT && (
......
...@@ -45,7 +45,8 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -45,7 +45,8 @@ export default class FixedAssetsMovementMR extends Component {
this.state = { this.state = {
dataTable: [], dataTable: [],
loading: true, loading: true,
visibleFAMMR: true visibleFAMMR: true,
updateBy: '-'
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
} }
...@@ -96,8 +97,8 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -96,8 +97,8 @@ export default class FixedAssetsMovementMR extends Component {
"months": this.props.month.month_id "months": this.props.month.month_id
} }
api.create().getHierarkiMontlyReportFAM(payload).then(response => { api.create().getHierarkiMontlyReportFAM(payload).then(response => {
console.log(payload); // console.log(payload);
console.log(response); // console.log(response);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
...@@ -321,7 +322,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -321,7 +322,7 @@ export default class FixedAssetsMovementMR extends Component {
} }
console.log(data); console.log(data);
api.create('UPLOAD').uploadMonthlyReportFAM(body).then(response => { api.create('UPLOAD').uploadMonthlyReportFAM(body).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.onClickClose() this.props.onClickClose()
...@@ -344,7 +345,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -344,7 +345,7 @@ export default class FixedAssetsMovementMR extends Component {
backToMonthlyReport(type) { backToMonthlyReport(type) {
this.setState({ loading: true }) this.setState({ loading: true })
console.log(this.state.dataTable); // console.log(this.state.dataTable);
let data = [] let data = []
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
data.push({ data.push({
...@@ -373,7 +374,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -373,7 +374,7 @@ export default class FixedAssetsMovementMR extends Component {
// console.log(JSON.stringify(payload)); // console.log(JSON.stringify(payload));
api.create('UPLOAD').createMonthlyReportFAM(payload).then(response => { api.create('UPLOAD').createMonthlyReportFAM(payload).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.saveToMonthlyReport() this.props.saveToMonthlyReport()
...@@ -862,10 +863,11 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -862,10 +863,11 @@ export default class FixedAssetsMovementMR extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ color: this.props.isApprover ? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.props.isApprover}
value={Number(tableMeta.rowData[8]).toFixed(1)} value={Number(tableMeta.rowData[8]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 8) handleChange(event.target.value, tableMeta, 8)
...@@ -1262,55 +1264,78 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -1262,55 +1264,78 @@ export default class FixedAssetsMovementMR extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> {this.props.isApprover === true ?
<a data-tip={'Download Template'} data-for="template"> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<button <a data-tip={'Download'} data-for="download">
style={{ <button
backgroundColor: 'transparent', style={{
cursor: 'pointer', backgroundColor: 'transparent',
borderColor: 'transparent', cursor: 'pointer',
margin: 5 borderColor: 'transparent',
}} margin: 5
onClick={() => this.downloadTemplate() } }}
> onClick={() =>
<img src={Images.template} /> this.setState({ loading: true }, () => {
</button> setTimeout(() => {
</a> this.downloadAllData()
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" /> }, 100);
<a data-tip={'Upload'} data-for="upload"> })}
<button >
style={{ <img src={Images.download} />
backgroundColor: 'transparent', </button>
cursor: 'pointer', </a>
borderColor: 'transparent', <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
margin: 5 </div> :
}} <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
onClick={() => this.setState({ visibleUpload: true })} <a data-tip={'Download Template'} data-for="template">
> <button
<img src={Images.upload} /> style={{
</button> backgroundColor: 'transparent',
</a> cursor: 'pointer',
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" /> borderColor: 'transparent',
<a data-tip={'Download'} data-for="download"> margin: 5
<button }}
style={{ onClick={() => this.downloadTemplate() }
backgroundColor: 'transparent', >
cursor: 'pointer', <img src={Images.template} />
borderColor: 'transparent', </button>
margin: 5 </a>
}} <ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
onClick={() => <a data-tip={'Upload'} data-for="upload">
this.setState({ loading: true }, () => { <button
setTimeout(() => { style={{
this.downloadAllData() backgroundColor: 'transparent',
}, 100); cursor: 'pointer',
})} borderColor: 'transparent',
> margin: 5
<img src={Images.download} /> }}
</button> onClick={() => this.setState({ visibleUpload: true })}
</a> >
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" /> <img src={Images.upload} />
</div> </button>
</a>
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
<a data-tip={'Download'} data-for="download">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() =>
this.setState({ loading: true }, () => {
setTimeout(() => {
this.downloadAllData()
}, 100);
})}
>
<img src={Images.download} />
</button>
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
</div>
}
</div> </div>
</div> </div>
...@@ -1348,8 +1373,9 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -1348,8 +1373,9 @@ export default class FixedAssetsMovementMR extends Component {
</div> </div>
</button> </button>
</div> </div>
{/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null : {this.props.isApprover === true ?
(this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === "draft" || this.props.status === 'submitted') ? */} <div className="col-2"></div>
:
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button <button
className="button" className="button"
...@@ -1420,8 +1446,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -1420,8 +1446,7 @@ export default class FixedAssetsMovementMR extends Component {
</div> </div>
</button> </button>
</div> </div>
{/* : null }
} */}
</div> </div>
</Paper> : </Paper> :
<Paper style={{ paddingTop: 10 }}> <Paper style={{ paddingTop: 10 }}>
......
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