Commit 595bd686 authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into rifka

parents 00c83318 2a57fbd4
...@@ -1034,6 +1034,7 @@ export default class BudgetTahunan extends Component { ...@@ -1034,6 +1034,7 @@ export default class BudgetTahunan extends Component {
saveToMasterBudget={this.saveToMasterBudget.bind(this)} saveToMasterBudget={this.saveToMasterBudget.bind(this)}
onClickClose={() => this.setState({ visibleCAT: false, visibleBudgetTahunan: true })} onClickClose={() => this.setState({ visibleCAT: false, visibleBudgetTahunan: true })}
getReport={this.getCompanyActive.bind(this)} getReport={this.getCompanyActive.bind(this)}
isApprover={this.state.isApprover}
/> />
)} )}
{this.state.visibleCF && ( {this.state.visibleCF && (
......
...@@ -76,7 +76,8 @@ export default class CorporateAnnualTarget extends Component { ...@@ -76,7 +76,8 @@ export default class CorporateAnnualTarget extends Component {
dataDelete: [], dataDelete: [],
dataReal: [], dataReal: [],
buttonDraft: true, buttonDraft: true,
updateBy: '' updateBy: '',
handleTekTekTek: 0
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -859,7 +860,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -859,7 +860,7 @@ export default class CorporateAnnualTarget extends Component {
name: "", name: "",
options: { options: {
filter: false, filter: false,
// display: this.state.visibleCAT, display: this.props.isApprover? false : true,
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#dbdbdb'}}> <TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#dbdbdb'}}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography>
...@@ -1009,6 +1010,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1009,6 +1010,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
disabled={this.props.isApprover}
maxLength={4} maxLength={4}
onBlur={(event) => { onBlur={(event) => {
// updateValue(some) // updateValue(some)
...@@ -1048,7 +1050,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1048,7 +1050,7 @@ export default class CorporateAnnualTarget extends Component {
placeholder="" placeholder=""
defaultValue={value} defaultValue={value}
color={"#5198ea"} color={"#5198ea"}
disabled={!handleAction(tableMeta.rowData[2])} disabled={this.props.isApprover? true : !handleAction(tableMeta.rowData[2])}
onBlur={(event) => { onBlur={(event) => {
console.log(event.target.value) console.log(event.target.value)
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1064,7 +1066,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1064,7 +1066,7 @@ export default class CorporateAnnualTarget extends Component {
placeholder="" placeholder=""
defaultValue={value} defaultValue={value}
color={"#5198ea"} color={"#5198ea"}
disabled={!handleAction(tableMeta.rowData[2])} disabled={this.props.isApprover? true : !handleAction(tableMeta.rowData[2])}
onBlur={(event) => { onBlur={(event) => {
console.log(event.target.value) console.log(event.target.value)
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1099,7 +1101,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1099,7 +1101,7 @@ export default class CorporateAnnualTarget extends Component {
onChange={(event, newInputValue) => handleChangeDropdown(newInputValue, tableMeta)} onChange={(event, newInputValue) => handleChangeDropdown(newInputValue, tableMeta)}
debug debug
disableClearable disableClearable
disabled={!handleAction(tableMeta.rowData[2])} disabled={this.props.isApprover? true : !handleAction(tableMeta.rowData[2])}
value={val} value={val}
style={{padding: 0, margin: 0}} style={{padding: 0, margin: 0}}
renderInput={(params) => renderInput={(params) =>
...@@ -1135,7 +1137,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1135,7 +1137,7 @@ export default class CorporateAnnualTarget extends Component {
disableClearable disableClearable
value={val} value={val}
style={{padding: 0, margin: 0}} style={{padding: 0, margin: 0}}
disabled={!handleAction(tableMeta.rowData[2])} disabled={this.props.isApprover? true : !handleAction(tableMeta.rowData[2])}
renderInput={(params) => renderInput={(params) =>
<div ref={params.InputProps.ref} style={{padding: 0, margin: 0}}> <div ref={params.InputProps.ref} style={{padding: 0, margin: 0}}>
<input style={{ borderColor: 'white', width: 96, textAlign: 'center', padding: 0, margin: 0, color: handleAction(tableMeta.rowData[2])? "#5198ea" : "black"}} type="text" {...params.inputProps} /> <input style={{ borderColor: 'white', width: 96, textAlign: 'center', padding: 0, margin: 0, color: handleAction(tableMeta.rowData[2])? "#5198ea" : "black"}} type="text" {...params.inputProps} />
...@@ -1171,7 +1173,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1171,7 +1173,7 @@ export default class CorporateAnnualTarget extends Component {
debug debug
disableClearable disableClearable
value={val} value={val}
disabled={!handleAction(tableMeta.rowData[2])} disabled={this.props.isApprover? true : !handleAction(tableMeta.rowData[2])}
style={{padding: 0, margin: 0}} style={{padding: 0, margin: 0}}
renderInput={(params) => renderInput={(params) =>
<div ref={params.InputProps.ref} style={{padding: 0, margin: 0}}> <div ref={params.InputProps.ref} style={{padding: 0, margin: 0}}>
...@@ -1210,6 +1212,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1210,6 +1212,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
disabled={this.props.isApprover}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1250,6 +1253,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1250,6 +1253,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
disabled={this.props.isApprover}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1290,6 +1294,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1290,6 +1294,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
disabled={this.props.isApprover}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1331,6 +1336,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1331,6 +1336,7 @@ export default class CorporateAnnualTarget extends Component {
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1} decimalScale={1}
disabled={this.props.isApprover}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1370,6 +1376,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1370,6 +1376,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
disabled={this.props.isApprover}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1409,6 +1416,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1409,6 +1416,7 @@ export default class CorporateAnnualTarget extends Component {
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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover}
value={value} value={value}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -1449,6 +1457,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1449,6 +1457,7 @@ export default class CorporateAnnualTarget extends Component {
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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover}
value={value} value={value}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -1490,6 +1499,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1490,6 +1499,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
disabled={this.props.isApprover}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1530,6 +1540,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1530,6 +1540,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
disabled={this.props.isApprover}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1569,6 +1580,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1569,6 +1580,7 @@ export default class CorporateAnnualTarget extends Component {
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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover}
decimalScale={1} decimalScale={1}
value={value} value={value}
onBlur={(event) => { onBlur={(event) => {
...@@ -1610,6 +1622,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1610,6 +1622,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
disabled={this.props.isApprover}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1650,6 +1663,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1650,6 +1663,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
disabled={this.props.isApprover}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1690,6 +1704,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1690,6 +1704,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
disabled={this.props.isApprover}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1768,6 +1783,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1768,6 +1783,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
disabled={this.props.isApprover}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1808,6 +1824,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1808,6 +1824,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
disabled={this.props.isApprover}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1845,6 +1862,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1845,6 +1862,7 @@ export default class CorporateAnnualTarget extends Component {
style={{ fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -5 }} style={{ fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -5 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover}
defaultValue={value} defaultValue={value}
onBlur={(event) => { onBlur={(event) => {
console.log(event.target.value) console.log(event.target.value)
...@@ -1884,6 +1902,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1884,6 +1902,7 @@ export default class CorporateAnnualTarget extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -5 }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -5 }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover}
defaultValue={value} defaultValue={value}
onBlur={(event) => { onBlur={(event) => {
console.log(event.target.value) console.log(event.target.value)
...@@ -1937,7 +1956,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1937,7 +1956,7 @@ export default class CorporateAnnualTarget extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision})</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision})</Typography>
<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%' }}> {!this.props.isApprover && <div style={{ width: '50%' }}>
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template"> <a data-tip={'Download Template'} data-for="template">
<button <button
...@@ -1987,7 +2006,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1987,7 +2006,7 @@ export default class CorporateAnnualTarget extends Component {
</a> </a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
</div> </div>
</div> </div>}
</div> </div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}> <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
...@@ -2023,7 +2042,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2023,7 +2042,7 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
</button> </button>
</div> </div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> {!this.props.isApprover && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button <button
className="button" className="button"
type="button" type="button"
...@@ -2057,8 +2076,12 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2057,8 +2076,12 @@ export default class CorporateAnnualTarget extends Component {
marginRight: 20 marginRight: 20
}} }}
disabled={this.state.buttonDraft} disabled={this.state.buttonDraft}
onClick={() => { this.backToMasterBudget('draft') onClick={() =>
}} this.state.handleTekTekTek == 1? null :
this.setState({handleTekTekTek: 1}, () => {
this.backToMasterBudget('draft')
})
}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
...@@ -2069,7 +2092,11 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2069,7 +2092,11 @@ export default class CorporateAnnualTarget extends Component {
// disabled={this.state.buttonError} // disabled={this.state.buttonError}
onClick={() => this.state.buttonError? onClick={() => this.state.buttonError?
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' }) this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
: this.backToMasterBudget('submitted')} :
this.state.handleTekTekTek == 1? null :
this.setState({handleTekTekTek: 1}, () => {
this.backToMasterBudget('submitted')
})}
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer', cursor: this.state.buttonError === true ? 'default' : 'pointer',
...@@ -2081,7 +2108,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2081,7 +2108,7 @@ export default class CorporateAnnualTarget extends Component {
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div> </div>
</button> </button>
</div> </div>}
</div> </div>
</Paper> </Paper>
: :
...@@ -2128,7 +2155,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2128,7 +2155,7 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
</button> </button>
</div> </div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> {!this.props.isApprover && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button <button
type="button" type="button"
onClick={() => onClick={() =>
...@@ -2155,11 +2182,14 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2155,11 +2182,14 @@ export default class CorporateAnnualTarget extends Component {
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => this.setState({ loading: true }, () => { onClick={() => this.setState({ loading: true }, () =>
setTimeout(() => { this.state.handleTekTekTek == 1? null :
this.uploadCAT("draft") this.setState({handleTekTekTek: 1}, () => {
}, 100); setTimeout(() => {
})} this.uploadCAT("draft")
}, 100);
})
)}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
...@@ -2168,17 +2198,20 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2168,17 +2198,20 @@ export default class CorporateAnnualTarget extends Component {
<button <button
type="button" type="button"
disabled={this.state.buttonError} disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () => { onClick={() => this.setState({ loading: true }, () =>
setTimeout(() => { this.state.handleTekTekTek == 1? null :
this.uploadCAT("submitted") this.setState({handleTekTekTek: 1}, () => {
}, 100); setTimeout(() => {
})} this.uploadCAT("submitted")
}, 100);
})
)}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div> </div>
</button> </button>
</div> </div>}
</div> </div>
</div> </div>
</Paper>} </Paper>}
......
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