Commit 36983554 authored by EKSAD's avatar EKSAD

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

parents d965ba16 2a57fbd4
......@@ -1033,6 +1033,7 @@ export default class BudgetTahunan extends Component {
saveToMasterBudget={this.saveToMasterBudget.bind(this)}
onClickClose={() => this.setState({ visibleCAT: false, visibleBudgetTahunan: true })}
getReport={this.getCompanyActive.bind(this)}
isApprover={this.state.isApprover}
/>
)}
{this.state.visibleCF && (
......
......@@ -76,7 +76,8 @@ export default class CorporateAnnualTarget extends Component {
dataDelete: [],
dataReal: [],
buttonDraft: true,
updateBy: ''
updateBy: '',
handleTekTekTek: 0
}
this.fileHandler = this.fileHandler.bind(this);
......@@ -859,7 +860,7 @@ export default class CorporateAnnualTarget extends Component {
name: "",
options: {
filter: false,
// display: this.state.visibleCAT,
display: this.props.isApprover? false : true,
customHeadRender: (columnMeta) => (
<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>
......@@ -1009,6 +1010,7 @@ export default class CorporateAnnualTarget extends Component {
type="text"
placeholder=""
value={value}
disabled={this.props.isApprover}
maxLength={4}
onBlur={(event) => {
// updateValue(some)
......@@ -1048,7 +1050,7 @@ export default class CorporateAnnualTarget extends Component {
placeholder=""
defaultValue={value}
color={"#5198ea"}
disabled={!handleAction(tableMeta.rowData[2])}
disabled={this.props.isApprover? true : !handleAction(tableMeta.rowData[2])}
onBlur={(event) => {
console.log(event.target.value)
// updateValue(event.target.value)
......@@ -1064,7 +1066,7 @@ export default class CorporateAnnualTarget extends Component {
placeholder=""
defaultValue={value}
color={"#5198ea"}
disabled={!handleAction(tableMeta.rowData[2])}
disabled={this.props.isApprover? true : !handleAction(tableMeta.rowData[2])}
onBlur={(event) => {
console.log(event.target.value)
// updateValue(event.target.value)
......@@ -1099,7 +1101,7 @@ export default class CorporateAnnualTarget extends Component {
onChange={(event, newInputValue) => handleChangeDropdown(newInputValue, tableMeta)}
debug
disableClearable
disabled={!handleAction(tableMeta.rowData[2])}
disabled={this.props.isApprover? true : !handleAction(tableMeta.rowData[2])}
value={val}
style={{padding: 0, margin: 0}}
renderInput={(params) =>
......@@ -1135,7 +1137,7 @@ export default class CorporateAnnualTarget extends Component {
disableClearable
value={val}
style={{padding: 0, margin: 0}}
disabled={!handleAction(tableMeta.rowData[2])}
disabled={this.props.isApprover? true : !handleAction(tableMeta.rowData[2])}
renderInput={(params) =>
<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} />
......@@ -1171,7 +1173,7 @@ export default class CorporateAnnualTarget extends Component {
debug
disableClearable
value={val}
disabled={!handleAction(tableMeta.rowData[2])}
disabled={this.props.isApprover? true : !handleAction(tableMeta.rowData[2])}
style={{padding: 0, margin: 0}}
renderInput={(params) =>
<div ref={params.InputProps.ref} style={{padding: 0, margin: 0}}>
......@@ -1210,6 +1212,7 @@ export default class CorporateAnnualTarget extends Component {
type="text"
placeholder=""
value={value}
disabled={this.props.isApprover}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1250,6 +1253,7 @@ export default class CorporateAnnualTarget extends Component {
type="text"
placeholder=""
value={value}
disabled={this.props.isApprover}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1290,6 +1294,7 @@ export default class CorporateAnnualTarget extends Component {
type="text"
placeholder=""
value={value}
disabled={this.props.isApprover}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1331,6 +1336,7 @@ export default class CorporateAnnualTarget extends Component {
placeholder=""
value={value}
decimalScale={1}
disabled={this.props.isApprover}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1370,6 +1376,7 @@ export default class CorporateAnnualTarget extends Component {
type="text"
placeholder=""
value={value}
disabled={this.props.isApprover}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -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' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={value}
decimalScale={1}
onBlur={(event) => {
......@@ -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' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={value}
decimalScale={1}
onBlur={(event) => {
......@@ -1490,6 +1499,7 @@ export default class CorporateAnnualTarget extends Component {
type="text"
placeholder=""
value={value}
disabled={this.props.isApprover}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1530,6 +1540,7 @@ export default class CorporateAnnualTarget extends Component {
type="text"
placeholder=""
value={value}
disabled={this.props.isApprover}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -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' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
decimalScale={1}
value={value}
onBlur={(event) => {
......@@ -1610,6 +1622,7 @@ export default class CorporateAnnualTarget extends Component {
type="text"
placeholder=""
value={value}
disabled={this.props.isApprover}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1650,6 +1663,7 @@ export default class CorporateAnnualTarget extends Component {
type="text"
placeholder=""
value={value}
disabled={this.props.isApprover}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1690,6 +1704,7 @@ export default class CorporateAnnualTarget extends Component {
type="text"
placeholder=""
value={value}
disabled={this.props.isApprover}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1768,6 +1783,7 @@ export default class CorporateAnnualTarget extends Component {
type="text"
placeholder=""
value={value}
disabled={this.props.isApprover}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1808,6 +1824,7 @@ export default class CorporateAnnualTarget extends Component {
type="text"
placeholder=""
value={value}
disabled={this.props.isApprover}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -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 }}
type="text"
placeholder=""
disabled={this.props.isApprover}
defaultValue={value}
onBlur={(event) => {
console.log(event.target.value)
......@@ -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 }}
type="text"
placeholder=""
disabled={this.props.isApprover}
defaultValue={value}
onBlur={(event) => {
console.log(event.target.value)
......@@ -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' }}>in IDR mn</Typography>
</div>
<div style={{ width: '50%' }}>
{!this.props.isApprover && <div style={{ width: '50%' }}>
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template">
<button
......@@ -1987,7 +2006,7 @@ export default class CorporateAnnualTarget extends Component {
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
</div>
</div>
</div>}
</div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
......@@ -2023,7 +2042,7 @@ export default class CorporateAnnualTarget extends Component {
</div>
</button>
</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
className="button"
type="button"
......@@ -2057,8 +2076,12 @@ export default class CorporateAnnualTarget extends Component {
marginRight: 20
}}
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' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
......@@ -2069,7 +2092,11 @@ export default class CorporateAnnualTarget extends Component {
// disabled={this.state.buttonError}
onClick={() => this.state.buttonError?
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={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
......@@ -2081,7 +2108,7 @@ export default class CorporateAnnualTarget extends Component {
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div>
</button>
</div>
</div>}
</div>
</Paper>
:
......@@ -2128,7 +2155,7 @@ export default class CorporateAnnualTarget extends Component {
</div>
</button>
</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
type="button"
onClick={() =>
......@@ -2155,11 +2182,14 @@ export default class CorporateAnnualTarget extends Component {
outline: 'none',
marginRight: 20
}}
onClick={() => this.setState({ loading: true }, () => {
onClick={() => this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1? null :
this.setState({handleTekTekTek: 1}, () => {
setTimeout(() => {
this.uploadCAT("draft")
}, 100);
})}
})
)}
>
<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>
......@@ -2168,17 +2198,20 @@ export default class CorporateAnnualTarget extends Component {
<button
type="button"
disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () => {
onClick={() => this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1? null :
this.setState({handleTekTekTek: 1}, () => {
setTimeout(() => {
this.uploadCAT("submitted")
}, 100);
})}
})
)}
>
<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>
</div>
</button>
</div>
</div>}
</div>
</div>
</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