Commit 43071f0b authored by d.arizona's avatar d.arizona

tinggal deni

parent 5bc900c9
......@@ -755,9 +755,9 @@ export default class BudgetTahunan extends Component {
borderColor: 'transparent'
}}
onClick={() =>
tableMeta.rowData[5] == true ?
// tableMeta.rowData[5] == true ?
this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2], tableMeta.rowData[3])
: null
// : null
}
>
{/* {this.state.isApprover == true ?
......
......@@ -88,7 +88,7 @@ export default class CorporateAnnualTarget extends Component {
this.getKPIType()
this.getMaxAch()
this.getLatestUpdate()
console.log(this.props.lastStatus);
// console.log(this.props.lastStatus);
}
......@@ -101,10 +101,10 @@ export default class CorporateAnnualTarget extends Component {
"company_id": this.props.company.company_id,
"submission_id": this.props.submissionID
}
console.log(JSON.stringify(payload))
// console.log(JSON.stringify(payload))
api.create().getDetailReportMB(payload).then(response => {
let dataTable = []
console.log(response)
// console.log(response)
let res = response.data.data
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
......@@ -201,7 +201,7 @@ export default class CorporateAnnualTarget extends Component {
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}`
)
res = await res.blob()
console.log(res)
// console.log(res)
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
......@@ -212,16 +212,16 @@ export default class CorporateAnnualTarget extends Component {
}
async downloadAllData() {
console.log('masuk')
// console.log('masuk')
let bram = [this.props.submissionID, this.props.report_id, this.props.company.company_id, this.props.periode, this.props.revision]
console.log(bram)
// console.log(bram)
let resReal = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
let resNull = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
let res = await fetch(
this.props.submissionID == null ? resNull : resReal
)
res = await res.blob()
console.log(res)
// console.log(res)
this.setState({ loading: false })
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
......@@ -235,13 +235,13 @@ export default class CorporateAnnualTarget extends Component {
fileHandler = (event) => {
let fileObj = event
ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp)
// // console.log(resp)
if (err) {
console.log(err);
// console.log(err);
}
else {
let isi = resp.rows.slice(3)
console.log(isi);
// console.log(isi);
let payload = []
let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/;
isi.map((i, index) => {
......@@ -263,8 +263,8 @@ export default class CorporateAnnualTarget extends Component {
}
nilaiTotal = i[6] == 'SUM' ? total : i[6] == 'AVG' ? total / 12 : lastValz
}
console.log(nilaiTotal)
// console.log(i[2] === undefined ? "" : String(Number(i[2]*100)).length > 3? String(Number(i[2]*100).toFixed(0) + '%') : String(Number(i[2]*100)) + '%')
// console.log(nilaiTotal)
// // console.log(i[2] === undefined ? "" : String(Number(i[2]*100)).length > 3? String(Number(i[2]*100).toFixed(0) + '%') : String(Number(i[2]*100)) + '%')
payload.push({
item_report_id: i[0] === undefined ? "" : reg.test(String(i[0])) === false ? "" : String(i[0]).trim(),
item_report: i[1] === undefined ? "" : String(i[1]).trim(),
......@@ -301,18 +301,18 @@ export default class CorporateAnnualTarget extends Component {
status: '',
cat: payload
}
console.log(body)
// console.log(body)
this.setState({ payload: body, judul: resp.rows[1][0] })
}
});
}
checkUpload() {
this.setState({ loading: true })
this.setState({ loading: true, dataTable: [] })
let dataDelete = this.state.dataDelete
api.create().getIdDeleteFromExcel(this.state.payload).then((response) => {
if (response.data) {
// console.log(response.data)
// // console.log(response.data)
let idDelete = response.data.data.item_report_id
if (idDelete.length > 0) {
idDelete.map((item, index) => {
......@@ -322,10 +322,10 @@ export default class CorporateAnnualTarget extends Component {
}
}
})
console.log(JSON.stringify(this.state.payload))
// console.log(JSON.stringify(this.state.payload))
api.create().checkUploadMB(this.state.payload).then(response => {
// console.log(JSON.stringify(this.state.payload));
console.log(response)
// // console.log(JSON.stringify(this.state.payload));
// console.log(response)
if (response.data) {
if (response.data.status === 'success') {
// this.setState({ visibleUpload: false, visibleCAT: false })
......@@ -365,16 +365,16 @@ export default class CorporateAnnualTarget extends Component {
item.error
]
})
console.log(dataTable)
console.log(this.state.buttonError)
// console.log(dataTable)
// console.log(this.state.buttonError)
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => {
this.state.dataTable.map(item => {
if (item[30].length > 0) {
console.log('masuk')
// console.log('masuk')
this.setState({ buttonError: true, errorPreview: true, editable: true })
}
})
// console.log(this.state.dataTable);
// // console.log(this.state.dataTable);
})
}
}
......@@ -396,7 +396,7 @@ export default class CorporateAnnualTarget extends Component {
functionUpload(type) {
let data = []
console.log(this.state.dataTable)
// console.log(this.state.dataTable)
this.state.dataTable.map(i => {
data.push({
"item_report_id": i[1] == "" || i[1] == null ? 0 : i[1],
......@@ -435,10 +435,10 @@ export default class CorporateAnnualTarget extends Component {
"status": type,
"cat": data
}
console.log(data);
console.log(JSON.stringify(body))
// console.log(data);
// console.log(JSON.stringify(body))
api.create('UPLOAD').uploadMasterBudget(body).then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.props.onClickClose()
......@@ -454,7 +454,7 @@ export default class CorporateAnnualTarget extends Component {
handleValidate() {
let data = []
console.log(this.state.dataTable)
// console.log(this.state.dataTable)
let totalWeight = 0
let dataTableBaru = this.state.dataTable
let dataTampung = []
......@@ -475,14 +475,14 @@ export default class CorporateAnnualTarget extends Component {
if (i[2] !== null) {
let indexID = this.state.dataTable.findIndex((val) => val[1] == i[2])
console.log(indexID)
console.log(i[2])
// console.log(indexID)
// console.log(i[2])
if (indexID !== -1) {
console.log(dataTableBaru[indexID][6])
// console.log(dataTableBaru[indexID][6])
if (dataTableBaru[indexID][6] == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || dataTableBaru[indexID][6] == 'CUSTOMER PERSPECTIVE') {
if (i[6] == "" || i[7] == "" || i[9] == null || i[10] == null || i[11] == null) {
handleKosongKPIMAXYTD = true
console.log(handleKosongKPIMAXYTD)
// console.log(handleKosongKPIMAXYTD)
}
}
}
......@@ -504,9 +504,9 @@ export default class CorporateAnnualTarget extends Component {
weightReal = i[7]
dataTampung[indexID].valChild = dataTampung[indexID].valChild + Number(i[7] == "" || i[7] == undefined ? 0 : i[7].replace('%', ''))
}
console.log(weightReal)
console.log(dataTableBaru[index][7])
console.log(dataTampung[indexID].valChild)
// console.log(weightReal)
// console.log(dataTableBaru[index][7])
// console.log(dataTampung[indexID].valChild)
}
}
......@@ -540,8 +540,8 @@ export default class CorporateAnnualTarget extends Component {
})
})
console.log(dataTableBaru)
console.log(JSON.stringify(data))
// console.log(dataTableBaru)
// console.log(JSON.stringify(data))
let payload = {
"submission_id": this.props.submissionID,
"company_id": this.props.company.company_id,
......@@ -550,19 +550,19 @@ export default class CorporateAnnualTarget extends Component {
"status": "submitted",
"cat": data
}
console.log(totalWeight)
// console.log(totalWeight)
// this.setState({dataTable: dataTampung})
if (handleKosongKPIMAXYTD) {
this.setState({ alert: true, messageAlert: 'KPI / Weight / KPI Type / Max Ach / Formula YTD / Cannot be Empty', tipeAlert: 'warning', loading: false, buttonError: true, editable: true })
this.setState({ alert: true, messageAlert: 'KPI / Weight / KPI Type / Max Ach / Formula YTD / Cannot be Empty', tipeAlert: 'warning', loading: false, editable: true})
} else if (totalWeight < 100) {
this.setState({ alert: true, messageAlert: 'Total weight less than 100%', tipeAlert: 'warning', loading: false, buttonError: true, editable: true })
this.setState({ alert: true, messageAlert: 'Total weight less than 100%', tipeAlert: 'warning', loading: false, editable: true})
} else {
api.create().validateSubmitReport(payload).then((response) => {
console.log(response)
// console.log(response)
if (response.data.data.result) {
this.setState({ loading: false, buttonError: false, editable: false })
this.setState({ loading: false, buttonError: false, editable: false, buttonDraft: false })
} else {
this.setState({ loading: false, buttonError: true, editable: true })
this.setState({ loading: false, buttonError: true, editable: true, buttonDraft: true })
}
})
}
......@@ -574,9 +574,9 @@ export default class CorporateAnnualTarget extends Component {
backToMasterBudget(type) {
let data = []
console.log(this.state.dataTable)
// console.log(this.state.dataTable)
this.state.dataTable.map(i => {
// console.log(i[9] == null? "" : i[9].value)
// // console.log(i[9] == null? "" : i[9].value)
data.push({
"item_report_id": i[1] == "" ? null : i[1],
"item_name": String(i[6]),
......@@ -606,7 +606,7 @@ export default class CorporateAnnualTarget extends Component {
"pic": String(i[29])
})
})
console.log(JSON.stringify(data))
// console.log(JSON.stringify(data))
let payload = {
"submission_id": this.props.submissionID,
"company_id": this.props.company.company_id,
......@@ -615,7 +615,7 @@ export default class CorporateAnnualTarget extends Component {
"status": type,
"cat": data
}
console.log(JSON.stringify(payload));
// console.log(JSON.stringify(payload));
this.deleteReport(payload)
}
......@@ -624,10 +624,10 @@ export default class CorporateAnnualTarget extends Component {
if (this.state.dataDelete.length > 0) {
api.create().deleteAllItemReport(payload).then((response) => {
console.log(response)
// console.log(response)
// api.create().validateSubmitReport(payloadBro).then((response) => {
// console.log(response)
// // console.log(response)
// if (response.data.data.result) {
this.props.saveToMasterBudget(payloadBro)
this.props.onClickClose()
......@@ -637,9 +637,9 @@ export default class CorporateAnnualTarget extends Component {
// })
})
} else {
// console.log('sini jing')
// // console.log('sini jing')
// api.create().validateSubmitReport(payloadBro).then((response) => {
// console.log(response)
// // console.log(response)
// if (response.data.data.result) {
this.props.saveToMasterBudget(payloadBro)
this.props.onClickClose()
......@@ -658,12 +658,12 @@ export default class CorporateAnnualTarget extends Component {
type: 'KPI_TYPE'
}
api.create().getAllSettingByType(body).then(response => {
// console.log(response)
// // console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
let data = response.data.data
console.log(data)
// console.log(data)
let inputKPI = []
data.map((item) => {
......@@ -675,7 +675,7 @@ export default class CorporateAnnualTarget extends Component {
options: inputKPI,
getOptionLabel: (option) => titleCase(option.value),
};
console.log(defaultProps)
// console.log(defaultProps)
this.setState({ kpiTypeList: defaultProps })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
......@@ -779,7 +779,7 @@ export default class CorporateAnnualTarget extends Component {
// })
// let valz = dataTable2[tableMeta.rowIndex][11] == null ? 'SUM' : dataTable2[tableMeta.rowIndex][11].value
// dataTable2[tableMeta.rowIndex][25] = (valz == 'SUM' ? total : (valz == 'AVG' ? (total / 12) : lastValz))
// console.log(dataTable2[tableMeta.rowIndex])
// // console.log(dataTable2[tableMeta.rowIndex])
}
const handleChangeDropdown = (value, tableMeta) => {
......@@ -808,9 +808,9 @@ export default class CorporateAnnualTarget extends Component {
} else {
index = data.findIndex((val) => val.value == value.value)
}
console.log(value)
console.log(data)
console.log(index)
// console.log(value)
// console.log(data)
// console.log(index)
if (index == -1) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = null
return null
......@@ -831,7 +831,7 @@ export default class CorporateAnnualTarget extends Component {
// dataTable2.map((item, index) => {
// if (item[2] == dataTable2[indexParentDatatable][1] && item[1] !== tableMeta.rowData[1]) {
// let weightItem = item[7] == "" ? 0 : item[7].replace('%', '')
// console.log(weightItem)
// // console.log(weightItem)
// valChild += Number(weightItem)
// }
// })
......@@ -839,19 +839,19 @@ export default class CorporateAnnualTarget extends Component {
// let endVal = ''
// if ((Number(valueReal) + Number(valChild)) > Number(valParent.replace('%', ''))) {
// endVal = `${Number(valParent.replace('%', '')) - (Number(valChild))}%`
// console.log(endVal)
// // console.log(endVal)
// } else {
// endVal = `${Number(valueReal)}%`
// console.log(endVal)
// }
// // console.log(endVal)
// }
// // // console.log(endVal)
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = endVal
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value
}
const handleChangeText = (value, tableMeta) => {
console.log(value)
// console.log(value)
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value
// this.setState({dataTable: dataTable2})
}
......@@ -881,7 +881,7 @@ export default class CorporateAnnualTarget extends Component {
}
const handleTambah = (data, rowIndex) => {
console.log(dataTable2)
// console.log(dataTable2)
let newData = []
dataTable2.map((item, index) => {
newData.push(item)
......@@ -1007,7 +1007,7 @@ export default class CorporateAnnualTarget extends Component {
cursor: 'pointer',
borderColor: 'transparent',
}}
// onClick={() => console.log(tableMeta.rowData[1])}
// onClick={() => // console.log(tableMeta.rowData[1])}
onClick={() => {
this.setState({ loading: true })
handleTambah(tableMeta.rowData[1], tableMeta.rowIndex)
......@@ -1063,9 +1063,9 @@ export default class CorporateAnnualTarget extends Component {
defaultValue={val}
// disabled={!handleAction(tableMeta.rowData[2])}
onBlur={(event) => {
console.log(event.target.value)
// console.log(event.target.value)
handleChangeText(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -1180,10 +1180,10 @@ export default class CorporateAnnualTarget extends Component {
color={"#5198ea"}
disabled={true}
onBlur={(event) => {
console.log(event.target.value)
// console.log(event.target.value)
// updateValue(event.target.value)
handleChangeText(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/> :
<ThemeProvider theme={theme}>
......@@ -1196,10 +1196,10 @@ export default class CorporateAnnualTarget extends Component {
color={"#5198ea"}
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : !handleAction(tableMeta.rowData[2]))}
onBlur={(event) => {
console.log(event.target.value)
// console.log(event.target.value)
// updateValue(event.target.value)
handleChangeText(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
</ThemeProvider>
......@@ -1346,7 +1346,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -1387,7 +1387,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -1428,7 +1428,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -1469,7 +1469,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -1510,7 +1510,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -1551,7 +1551,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -1592,7 +1592,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -1633,7 +1633,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -1674,7 +1674,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -1715,7 +1715,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -1756,7 +1756,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -1797,7 +1797,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -1838,7 +1838,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -1877,7 +1877,7 @@ export default class CorporateAnnualTarget extends Component {
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
// }}
/>
}
......@@ -1917,7 +1917,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -1958,7 +1958,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -1994,9 +1994,9 @@ export default class CorporateAnnualTarget extends Component {
disabled={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') ? false : true)}
defaultValue={value}
onBlur={(event) => {
console.log(event.target.value)
// console.log(event.target.value)
handleChangeText(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
</ThemeProvider>
......@@ -2034,10 +2034,10 @@ export default class CorporateAnnualTarget extends Component {
disabled={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') ? false : true)}
defaultValue={value}
onBlur={(event) => {
console.log(event.target.value)
// console.log(event.target.value)
// updateValue(event.target.value)
handleChangeText(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
</ThemeProvider>
......@@ -2068,7 +2068,7 @@ export default class CorporateAnnualTarget extends Component {
<Typography style={{ fontSize: '16px', color: 'white' }}>Master Budget Submission</Typography>
</div>
{/* {this.state.loading && loadingComponent} */}
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
<Snackbar open={this.state.alert} autoHideDuration={3000} onClose={() => this.closeAlert()}>
<Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
{this.state.messageAlert}
</Alert>
......@@ -2131,7 +2131,7 @@ export default class CorporateAnnualTarget extends Component {
borderColor: 'transparent',
margin: 5
}}
onClick={() => this.setState({ visibleUpload: true })}
onClick={() => this.setState({ visibleUpload: true, buttonDraft: true })}
>
<img src={Images.upload} />
</button>
......@@ -2231,7 +2231,7 @@ export default class CorporateAnnualTarget extends Component {
disabled={this.state.buttonDraft}
onClick={() =>
this.state.editable === true ?
null :
this.setState({alert: true}) :
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
this.backToMasterBudget('draft')
......@@ -2244,8 +2244,10 @@ export default class CorporateAnnualTarget extends Component {
</button>}
{((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')) && <button
type="button"
// disabled={this.state.buttonError}
onClick={() => this.state.buttonError ?
disabled={this.state.buttonDraft}
onClick={() =>
this.state.editable? this.setState({alert: true}) :
this.state.buttonError ?
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
:
this.state.handleTekTekTek == 1 ? null :
......@@ -2299,7 +2301,7 @@ export default class CorporateAnnualTarget extends Component {
borderColor: 'transparent',
}}
onClick={() =>
this.setState({ loading: true, visibleCAT: true }, () => {
this.setState({ loading: true, visibleCAT: true, dataTable: []}, () => {
setTimeout(() => {
this.getItemHierarki()
}, 100)
......@@ -2317,7 +2319,7 @@ export default class CorporateAnnualTarget extends Component {
this.setState({ loading: true, dataTable: dataTable2, buttonDraft: false }, () => {
setTimeout(() => {
this.handleValidate()
this.setState({ loading: false, buttonError: this.state.errorPreview === true ? true : false, editable: false })
this.setState({ loading: false, buttonError: this.state.errorPreview === true ? true : false})
}, 100)
})
}
......@@ -2338,8 +2340,8 @@ export default class CorporateAnnualTarget extends Component {
outline: 'none',
marginRight: 20
}}
onClick={() => this.state.editable === true ?
null : this.setState({ loading: true }, () =>
onClick={() => this.state.editable?
this.setState({alert: true}) : this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
setTimeout(() => {
......@@ -2363,8 +2365,9 @@ export default class CorporateAnnualTarget extends Component {
}}
disabled={this.state.buttonDraft}
onClick={() =>
this.state.editable === true ?
null : this.setState({ loading: true }, () =>
this.state.editable? this.setState({alert: true}) :
this.state.buttonError === true ?
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' }) : this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
setTimeout(() => {
......
......@@ -311,18 +311,18 @@ export default class FixedAssetsMovement extends Component {
item.level,
item.item_report,
item.total_actual_before,
item.january,
item.february,
item.march,
item.april,
item.may,
item.june,
item.july,
item.august,
item.september,
item.october,
item.november,
item.december,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.january, formula: item.january_formula} : item.january,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.february, formula: item.february_formula} : item.february,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.march, formula: item.march_formula} : item.march,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.april, formula: item.april_formula} : item.april,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.may, formula: item.may_formula} : item.may,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.june, formula: item.june_formula} : item.june,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.july, formula: item.july_formula} : item.july,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.august, formula: item.august_formula} : item.august,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.september, formula: item.september_formula} : item.september,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.october, formula: item.october_formula} : item.october,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.november, formula: item.november_formula} : item.november,
item.type_report_id == 5 || item.type_report_id == 6? {value: item.december, formula: item.december_formula} : item.december,
item.total_current_year,
item.total_next_year,
item.total_more_year,
......@@ -542,11 +542,11 @@ export default class FixedAssetsMovement extends Component {
}
}
})
console.log(dataTable2[tableMeta.rowIndex][22])
console.log(tableMeta.rowData[5])
console.log(baru)
console.log(anjay)
console.log(total)
// console.log(dataTable2[tableMeta.rowIndex][22])
// console.log(tableMeta.rowData[5])
// console.log(baru)
// console.log(anjay)
// console.log(total)
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value == undefined) {
// console.log([tableMeta.rowIndex][tableMeta.columnIndex])
......
......@@ -694,6 +694,7 @@ export default class BalanceSheet extends Component {
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -735,6 +736,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
value={Number(value).toFixed(1)}
disabled={!this.props.permission.create || !this.props.permission.edit}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -775,6 +777,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={!this.props.permission.create || !this.props.permission.edit}
decimalScale={1}
value={Number(value).toFixed(1)}
onBlur={(event) => {
......@@ -816,6 +819,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={!this.props.permission.create || !this.props.permission.edit}
decimalScale={1}
value={Number(value).toFixed(1)}
onBlur={(event) => {
......@@ -858,6 +862,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -898,6 +903,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={!this.props.permission.create || !this.props.permission.edit}
decimalScale={1}
value={Number(value).toFixed(1)}
onBlur={(event) => {
......@@ -940,6 +946,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -981,6 +988,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1022,6 +1030,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1063,6 +1072,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1104,6 +1114,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1145,6 +1156,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1186,6 +1198,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1245,7 +1258,7 @@ export default class BalanceSheet extends Component {
</div>
<div style={{ width: '50%' }}>
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
{(this.props.permission.create && this.props.permission.edit) && <a data-tip={'Download Template'} data-for="template">
{(this.props.permission.create || this.props.permission.edit) && <a data-tip={'Download Template'} data-for="template">
<button
style={{
backgroundColor: 'transparent',
......@@ -1259,7 +1272,7 @@ export default class BalanceSheet extends Component {
</button>
</a>}
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
{(this.props.permission.create && this.props.permission.edit) && <a data-tip={'Upload'} data-for="upload">
{(this.props.permission.create || this.props.permission.edit) && <a data-tip={'Upload'} data-for="upload">
<button
style={{
backgroundColor: 'transparent',
......@@ -1267,7 +1280,7 @@ export default class BalanceSheet extends Component {
borderColor: 'transparent',
margin: 5
}}
onClick={() => this.setState({ visibleUpload: true })}
onClick={() => this.setState({ visibleUpload: true, editable: true })}
>
<img src={Images.upload} />
</button>
......@@ -1324,7 +1337,7 @@ export default class BalanceSheet extends Component {
</div>
</button>
</div>
{!this.state.emptyData && (this.props.permission.create && this.props.permission.edit) && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
{!this.state.emptyData && (this.props.permission.create || this.props.permission.edit) && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
type="button"
onClick={() =>
......@@ -1454,6 +1467,7 @@ export default class BalanceSheet extends Component {
outline: 'none',
marginRight: 20
}}
disabled={this.state.editable}
onClick={() =>
this.state.editable === true ?
null : this.setState({ loading: true }, () => {
......@@ -1476,6 +1490,7 @@ export default class BalanceSheet extends Component {
this.uploadOI("submitted")
}, 100);
})}
disabled={this.state.editable}
style={{
backgroundColor: 'transparent',
cursor: this.state.editable === true ? 'default' : 'pointer',
......
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