Commit 3e31cbe9 authored by d.arizona's avatar d.arizona

BISMILLAH_FIX_FIX_FINAL

parent 4faa8a8b
...@@ -90,7 +90,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -90,7 +90,7 @@ export default class CorporateAnnualTarget extends Component {
this.getKPIType() this.getKPIType()
this.getMaxAch() this.getMaxAch()
this.getLatestUpdate() this.getLatestUpdate()
// console.log(this.props.lastStatus); // // console.log(this.props.lastStatus);
} }
...@@ -103,12 +103,12 @@ export default class CorporateAnnualTarget extends Component { ...@@ -103,12 +103,12 @@ export default class CorporateAnnualTarget extends Component {
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
"submission_id": this.props.submissionID "submission_id": this.props.submissionID
} }
// console.log(JSON.stringify(payload)) // // console.log(JSON.stringify(payload))
api.create().getDetailReportMB(payload).then(response => { api.create().getDetailReportMB(payload).then(response => {
let dataTable = [] let dataTable = []
let dataCustomerPrs = [] let dataCustomerPrs = []
let dataInternalBsn = [] let dataInternalBsn = []
// console.log(response) // // console.log(response)
let res = response.data.data let res = response.data.data
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
...@@ -218,7 +218,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -218,7 +218,7 @@ export default class CorporateAnnualTarget extends Component {
} }
}) })
this.setState({ dataTable, loading: false, dataReal: res, editable: true, dataCustomerPrs, dataInternalBsn }, () => { this.setState({ dataTable, loading: false, dataReal: res, editable: true, dataCustomerPrs, dataInternalBsn }, () => {
console.log(dataCustomerPrs) // console.log(dataCustomerPrs)
}) })
}) })
} }
...@@ -228,7 +228,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -228,7 +228,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}` `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() res = await res.blob()
// console.log(res) // // console.log(res)
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
...@@ -239,16 +239,16 @@ export default class CorporateAnnualTarget extends Component { ...@@ -239,16 +239,16 @@ export default class CorporateAnnualTarget extends Component {
} }
async downloadAllData() { 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] 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 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 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( let res = await fetch(
this.props.submissionID == null ? resNull : resReal this.props.submissionID == null ? resNull : resReal
) )
res = await res.blob() res = await res.blob()
// console.log(res) // // console.log(res)
this.setState({ loading: false }) this.setState({ loading: false })
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
...@@ -262,13 +262,13 @@ export default class CorporateAnnualTarget extends Component { ...@@ -262,13 +262,13 @@ export default class CorporateAnnualTarget extends Component {
fileHandler = (event) => { fileHandler = (event) => {
let fileObj = event let fileObj = event
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
// // console.log(resp) // // // console.log(resp)
if (err) { if (err) {
// console.log(err); // // console.log(err);
} }
else { else {
let isi = resp.rows.slice(3) let isi = resp.rows.slice(3)
// console.log(isi); // // console.log(isi);
let payload = [] let payload = []
let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/; let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/;
isi.map((i, index) => { isi.map((i, index) => {
...@@ -290,8 +290,8 @@ export default class CorporateAnnualTarget extends Component { ...@@ -290,8 +290,8 @@ export default class CorporateAnnualTarget extends Component {
} }
nilaiTotal = i[6] == 'SUM' ? total : i[6] == 'AVG' ? total / 12 : lastValz nilaiTotal = i[6] == 'SUM' ? total : i[6] == 'AVG' ? total / 12 : lastValz
} }
// console.log(nilaiTotal) // // 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(i[2] === undefined ? "" : String(Number(i[2]*100)).length > 3? String(Number(i[2]*100).toFixed(0) + '%') : String(Number(i[2]*100)) + '%')
payload.push({ payload.push({
item_report_id: i[0] === undefined ? 0 : reg.test(String(i[0])) === false ? 0 : String(i[0]).trim(), item_report_id: i[0] === undefined ? 0 : reg.test(String(i[0])) === false ? 0 : String(i[0]).trim(),
item_report: i[1] === undefined ? "" : String(i[1]).trim(), item_report: i[1] === undefined ? "" : String(i[1]).trim(),
...@@ -328,7 +328,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -328,7 +328,7 @@ export default class CorporateAnnualTarget extends Component {
status: '', status: '',
cat: payload cat: payload
} }
// console.log(body) // // console.log(body)
this.setState({ payload: body, judul: resp.rows[1][0] }) this.setState({ payload: body, judul: resp.rows[1][0] })
} }
}); });
...@@ -339,7 +339,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -339,7 +339,7 @@ export default class CorporateAnnualTarget extends Component {
let dataDelete = this.state.dataDelete let dataDelete = this.state.dataDelete
api.create().getIdDeleteFromExcel(this.state.payload).then((response) => { api.create().getIdDeleteFromExcel(this.state.payload).then((response) => {
if (response.data) { if (response.data) {
// // console.log(response.data) // // // console.log(response.data)
let idDelete = response.data.data.item_report_id let idDelete = response.data.data.item_report_id
if (idDelete.length > 0) { if (idDelete.length > 0) {
idDelete.map((item, index) => { idDelete.map((item, index) => {
...@@ -349,10 +349,10 @@ export default class CorporateAnnualTarget extends Component { ...@@ -349,10 +349,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 => { api.create().checkUploadMB(this.state.payload).then(response => {
// // console.log(JSON.stringify(this.state.payload)); // // // console.log(JSON.stringify(this.state.payload));
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
// this.setState({ visibleUpload: false, visibleCAT: false }) // this.setState({ visibleUpload: false, visibleCAT: false })
...@@ -416,16 +416,16 @@ export default class CorporateAnnualTarget extends Component { ...@@ -416,16 +416,16 @@ export default class CorporateAnnualTarget extends Component {
item.error item.error
]) ])
}) })
console.log(dataTable) // console.log(dataTable)
// console.log(this.state.buttonError) // // console.log(this.state.buttonError)
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, dataDelete }, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, dataDelete }, () => {
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
if (item[30].length > 0) { if (item[30].length > 0) {
// console.log('masuk') // // console.log('masuk')
this.setState({ buttonError: true, errorPreview: true, editable: true }) this.setState({ buttonError: true, errorPreview: true, editable: true })
} }
}) })
// // console.log(this.state.dataTable); // // // console.log(this.state.dataTable);
}) })
} }
} }
...@@ -434,7 +434,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -434,7 +434,7 @@ export default class CorporateAnnualTarget extends Component {
uploadCAT(type) { uploadCAT(type) {
// let dataDelete = this.state.dataDelete // let dataDelete = this.state.dataDelete
// console.log(dataDelete) // // console.log(dataDelete)
let payload = { "item_report_id": this.state.dataDelete } let payload = { "item_report_id": this.state.dataDelete }
if (this.state.dataDelete.length > 0) { if (this.state.dataDelete.length > 0) {
api.create().deleteAllItemReport(payload).then((response) => { api.create().deleteAllItemReport(payload).then((response) => {
...@@ -448,7 +448,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -448,7 +448,7 @@ export default class CorporateAnnualTarget extends Component {
functionUpload(type) { functionUpload(type) {
let data = [] let data = []
// console.log(this.state.dataTable) // // console.log(this.state.dataTable)
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
data.push({ data.push({
"item_report_id": i[1] == "" || i[1] == null ? 0 : i[1], "item_report_id": i[1] == "" || i[1] == null ? 0 : i[1],
...@@ -487,10 +487,10 @@ export default class CorporateAnnualTarget extends Component { ...@@ -487,10 +487,10 @@ export default class CorporateAnnualTarget extends Component {
"status": type, "status": type,
"cat": data "cat": data
} }
// console.log(data); // // console.log(data);
console.log(JSON.stringify(body)) // console.log(JSON.stringify(body))
api.create('UPLOAD').uploadMasterBudget(body).then(response => { api.create('UPLOAD').uploadMasterBudget(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()
...@@ -506,7 +506,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -506,7 +506,7 @@ export default class CorporateAnnualTarget extends Component {
handleValidate() { handleValidate() {
let data = [] let data = []
// console.log(this.state.dataTable) // // console.log(this.state.dataTable)
let totalWeight = 0 let totalWeight = 0
let dataTableBaru = this.state.dataTable let dataTableBaru = this.state.dataTable
let dataTampung = [] let dataTampung = []
...@@ -527,14 +527,14 @@ export default class CorporateAnnualTarget extends Component { ...@@ -527,14 +527,14 @@ export default class CorporateAnnualTarget extends Component {
if (i[2] !== null) { if (i[2] !== null) {
let indexID = this.state.dataTable.findIndex((val) => val[1] == i[2]) let indexID = this.state.dataTable.findIndex((val) => val[1] == i[2])
// console.log(indexID) // // console.log(indexID)
// console.log(i[2]) // // console.log(i[2])
if (indexID !== -1) { 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 (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) { if (i[6] == "" || i[7] == "" || i[9] == null || i[10] == null || i[11] == null) {
handleKosongKPIMAXYTD = true handleKosongKPIMAXYTD = true
// console.log(handleKosongKPIMAXYTD) // // console.log(handleKosongKPIMAXYTD)
} }
} }
} }
...@@ -543,7 +543,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -543,7 +543,7 @@ export default class CorporateAnnualTarget extends Component {
// if (i[0] == null && i[2] == null) { // if (i[0] == null && i[2] == null) {
// if (i[6] == "" || i[7] == "" || i[9] == null || i[10] == null || i[11] == null) { // if (i[6] == "" || i[7] == "" || i[9] == null || i[10] == null || i[11] == null) {
// handleKosongKPIMAXYTD = true // handleKosongKPIMAXYTD = true
// // console.log(handleKosongKPIMAXYTD) // // // console.log(handleKosongKPIMAXYTD)
// } // }
// } // }
...@@ -563,9 +563,9 @@ export default class CorporateAnnualTarget extends Component { ...@@ -563,9 +563,9 @@ export default class CorporateAnnualTarget extends Component {
weightReal = i[7] weightReal = i[7]
dataTampung[indexID].valChild = dataTampung[indexID].valChild + Number(i[7] == "" || i[7] == undefined ? 0 : i[7].replace('%', '')) dataTampung[indexID].valChild = dataTampung[indexID].valChild + Number(i[7] == "" || i[7] == undefined ? 0 : i[7].replace('%', ''))
} }
// console.log(weightReal) // // console.log(weightReal)
// console.log(dataTableBaru[index][7]) // // console.log(dataTableBaru[index][7])
// console.log(dataTampung[indexID].valChild) // // console.log(dataTampung[indexID].valChild)
} }
} }
...@@ -599,8 +599,8 @@ export default class CorporateAnnualTarget extends Component { ...@@ -599,8 +599,8 @@ export default class CorporateAnnualTarget extends Component {
}) })
}) })
// console.log(dataTableBaru) // // console.log(dataTableBaru)
// console.log(JSON.stringify(data)) // // console.log(JSON.stringify(data))
let payload = { let payload = {
"submission_id": this.props.submissionID, "submission_id": this.props.submissionID,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
...@@ -609,7 +609,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -609,7 +609,7 @@ export default class CorporateAnnualTarget extends Component {
"status": "submitted", "status": "submitted",
"cat": data "cat": data
} }
// console.log(totalWeight) // // console.log(totalWeight)
// this.setState({dataTable: dataTampung}) // this.setState({dataTable: dataTampung})
if (handleKosongKPIMAXYTD) { if (handleKosongKPIMAXYTD) {
this.setState({ alert: true, messageAlert: 'KPI / Weight / KPI Type / Max Ach / Formula YTD / Cannot be Empty', tipeAlert: 'warning', loading: false, editable: true}) this.setState({ alert: true, messageAlert: 'KPI / Weight / KPI Type / Max Ach / Formula YTD / Cannot be Empty', tipeAlert: 'warning', loading: false, editable: true})
...@@ -617,7 +617,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -617,7 +617,7 @@ export default class CorporateAnnualTarget extends Component {
this.setState({ alert: true, messageAlert: 'Total weight less than 100%', tipeAlert: 'warning', loading: false, editable: true}) this.setState({ alert: true, messageAlert: 'Total weight less than 100%', tipeAlert: 'warning', loading: false, editable: true})
} else { } else {
api.create().validateSubmitReport(payload).then((response) => { api.create().validateSubmitReport(payload).then((response) => {
// console.log(response) // // console.log(response)
if (response.data.data.result) { if (response.data.data.result) {
this.setState({ loading: false, buttonError: false, editable: false, buttonDraft: false }) this.setState({ loading: false, buttonError: false, editable: false, buttonDraft: false })
} else { } else {
...@@ -633,9 +633,9 @@ export default class CorporateAnnualTarget extends Component { ...@@ -633,9 +633,9 @@ export default class CorporateAnnualTarget extends Component {
backToMasterBudget(type) { backToMasterBudget(type) {
let data = [] let data = []
// console.log(this.state.dataTable) // // console.log(this.state.dataTable)
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
// // console.log(i[9] == null? "" : i[9].value) // // // console.log(i[9] == null? "" : i[9].value)
data.push({ data.push({
"item_report_id": i[1] == "" || i[1] == null? 0 : i[1], "item_report_id": i[1] == "" || i[1] == null? 0 : i[1],
"item_name": String(i[6]), "item_name": String(i[6]),
...@@ -665,7 +665,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -665,7 +665,7 @@ export default class CorporateAnnualTarget extends Component {
"pic": String(i[29]) "pic": String(i[29])
}) })
}) })
// console.log(JSON.stringify(data)) // // console.log(JSON.stringify(data))
let payload = { let payload = {
"submission_id": this.props.submissionID, "submission_id": this.props.submissionID,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
...@@ -674,7 +674,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -674,7 +674,7 @@ export default class CorporateAnnualTarget extends Component {
"status": type, "status": type,
"cat": data "cat": data
} }
// console.log(JSON.stringify(payload)); // // console.log(JSON.stringify(payload));
this.deleteReport(payload) this.deleteReport(payload)
} }
...@@ -683,10 +683,10 @@ export default class CorporateAnnualTarget extends Component { ...@@ -683,10 +683,10 @@ export default class CorporateAnnualTarget extends Component {
if (this.state.dataDelete.length > 0) { if (this.state.dataDelete.length > 0) {
api.create().deleteAllItemReport(payload).then((response) => { api.create().deleteAllItemReport(payload).then((response) => {
// console.log(response) // // console.log(response)
// api.create().validateSubmitReport(payloadBro).then((response) => { // api.create().validateSubmitReport(payloadBro).then((response) => {
// // console.log(response) // // // console.log(response)
// if (response.data.data.result) { // if (response.data.data.result) {
this.props.saveToMasterBudget(payloadBro) this.props.saveToMasterBudget(payloadBro)
this.props.onClickClose() this.props.onClickClose()
...@@ -696,9 +696,9 @@ export default class CorporateAnnualTarget extends Component { ...@@ -696,9 +696,9 @@ export default class CorporateAnnualTarget extends Component {
// }) // })
}) })
} else { } else {
// // console.log('sini jing') // // // console.log('sini jing')
// api.create().validateSubmitReport(payloadBro).then((response) => { // api.create().validateSubmitReport(payloadBro).then((response) => {
// // console.log(response) // // // console.log(response)
// if (response.data.data.result) { // if (response.data.data.result) {
this.props.saveToMasterBudget(payloadBro) this.props.saveToMasterBudget(payloadBro)
this.props.onClickClose() this.props.onClickClose()
...@@ -717,12 +717,12 @@ export default class CorporateAnnualTarget extends Component { ...@@ -717,12 +717,12 @@ export default class CorporateAnnualTarget extends Component {
type: 'KPI_TYPE' type: 'KPI_TYPE'
} }
api.create().getAllSettingByType(body).then(response => { api.create().getAllSettingByType(body).then(response => {
// // console.log(response) // // // console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
let data = response.data.data let data = response.data.data
// console.log(data) // // console.log(data)
let inputKPI = [] let inputKPI = []
data.map((item) => { data.map((item) => {
...@@ -734,7 +734,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -734,7 +734,7 @@ export default class CorporateAnnualTarget extends Component {
options: inputKPI, options: inputKPI,
getOptionLabel: (option) => titleCase(option.value), getOptionLabel: (option) => titleCase(option.value),
}; };
// console.log(defaultProps) // // console.log(defaultProps)
this.setState({ kpiTypeList: defaultProps }) this.setState({ kpiTypeList: defaultProps })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
...@@ -838,7 +838,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -838,7 +838,7 @@ export default class CorporateAnnualTarget extends Component {
// }) // })
// let valz = dataTable2[tableMeta.rowIndex][11] == null ? 'SUM' : dataTable2[tableMeta.rowIndex][11].value // 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)) // 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) => { const handleChangeDropdown = (value, tableMeta) => {
...@@ -867,9 +867,9 @@ export default class CorporateAnnualTarget extends Component { ...@@ -867,9 +867,9 @@ export default class CorporateAnnualTarget extends Component {
} else { } else {
index = data.findIndex((val) => val.value == value.value) index = data.findIndex((val) => val.value == value.value)
} }
// console.log(value) // // console.log(value)
// console.log(data) // // console.log(data)
// console.log(index) // // console.log(index)
if (index == -1) { if (index == -1) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = null dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = null
return null return null
...@@ -890,7 +890,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -890,7 +890,7 @@ export default class CorporateAnnualTarget extends Component {
// dataTable2.map((item, index) => { // dataTable2.map((item, index) => {
// if (item[2] == dataTable2[indexParentDatatable][1] && item[1] !== tableMeta.rowData[1]) { // if (item[2] == dataTable2[indexParentDatatable][1] && item[1] !== tableMeta.rowData[1]) {
// let weightItem = item[7] == "" ? 0 : item[7].replace('%', '') // let weightItem = item[7] == "" ? 0 : item[7].replace('%', '')
// // console.log(weightItem) // // // console.log(weightItem)
// valChild += Number(weightItem) // valChild += Number(weightItem)
// } // }
// }) // })
...@@ -898,19 +898,19 @@ export default class CorporateAnnualTarget extends Component { ...@@ -898,19 +898,19 @@ export default class CorporateAnnualTarget extends Component {
// let endVal = '' // let endVal = ''
// if ((Number(valueReal) + Number(valChild)) > Number(valParent.replace('%', ''))) { // if ((Number(valueReal) + Number(valChild)) > Number(valParent.replace('%', ''))) {
// endVal = `${Number(valParent.replace('%', '')) - (Number(valChild))}%` // endVal = `${Number(valParent.replace('%', '')) - (Number(valChild))}%`
// // console.log(endVal) // // // console.log(endVal)
// } else { // } else {
// endVal = `${Number(valueReal)}%` // endVal = `${Number(valueReal)}%`
// // console.log(endVal)
// }
// // // console.log(endVal) // // // console.log(endVal)
// }
// // // // console.log(endVal)
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = endVal // dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = endVal
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value
} }
const handleChangeText = (value, tableMeta) => { const handleChangeText = (value, tableMeta) => {
// console.log(value) // // console.log(value)
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value
// this.setState({dataTable: dataTable2}) // this.setState({dataTable: dataTable2})
} }
...@@ -949,7 +949,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -949,7 +949,7 @@ export default class CorporateAnnualTarget extends Component {
} }
const handleTambah = (data, rowIndex) => { const handleTambah = (data, rowIndex) => {
console.log(dataTable2) // console.log(dataTable2)
let newData = [] let newData = []
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
newData.push(item) newData.push(item)
...@@ -993,7 +993,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -993,7 +993,7 @@ export default class CorporateAnnualTarget extends Component {
this.setState({ dataTable: dataTable2 }, () => { this.setState({ dataTable: dataTable2 }, () => {
setTimeout(() => { setTimeout(() => {
this.setState({ loading: false }) this.setState({ loading: false })
console.log(dataTable2) // console.log(dataTable2)
}, 500) }, 500)
}) })
} }
...@@ -1076,7 +1076,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1076,7 +1076,7 @@ export default class CorporateAnnualTarget extends Component {
cursor: 'pointer', cursor: 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
}} }}
// onClick={() => // console.log(tableMeta.rowData[1])} // onClick={() => // // console.log(tableMeta.rowData[1])}
onClick={() => { onClick={() => {
this.setState({ loading: true }) this.setState({ loading: true })
handleTambah(tableMeta.rowData[1], tableMeta.rowIndex) handleTambah(tableMeta.rowData[1], tableMeta.rowIndex)
...@@ -1132,9 +1132,9 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1132,9 +1132,9 @@ export default class CorporateAnnualTarget extends Component {
defaultValue={val} defaultValue={val}
// disabled={!handleAction(tableMeta.rowData[2])} // disabled={!handleAction(tableMeta.rowData[2])}
onBlur={(event) => { onBlur={(event) => {
// console.log(event.target.value) // // console.log(event.target.value)
handleChangeText(event.target.value, tableMeta) handleChangeText(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1249,10 +1249,10 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1249,10 +1249,10 @@ export default class CorporateAnnualTarget extends Component {
color={"#5198ea"} color={"#5198ea"}
disabled={true} disabled={true}
onBlur={(event) => { onBlur={(event) => {
// console.log(event.target.value) // // console.log(event.target.value)
// updateValue(event.target.value) // updateValue(event.target.value)
handleChangeText(event.target.value, tableMeta) handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> : /> :
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
...@@ -1265,10 +1265,10 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1265,10 +1265,10 @@ export default class CorporateAnnualTarget extends Component {
color={"#5198ea"} color={"#5198ea"}
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : !handleAction(tableMeta.rowData[2]))} // disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : !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)
handleChangeText(event.target.value, tableMeta) handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
</ThemeProvider> </ThemeProvider>
...@@ -1415,7 +1415,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1415,7 +1415,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1435,7 +1435,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1435,7 +1435,7 @@ export default class CorporateAnnualTarget extends Component {
</TableCell> </TableCell>
), ),
customBodyRender: (value, tableMeta) => { customBodyRender: (value, tableMeta) => {
// console.log(tableMeta.rowData[0]) // // console.log(tableMeta.rowData[0])
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2|| tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2|| tableMeta.rowData[0] === 4 ?
...@@ -1457,7 +1457,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1457,7 +1457,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
// console.log(tableMeta.rowData[0]) // // console.log(tableMeta.rowData[0])
}} }}
/> />
} }
...@@ -1498,7 +1498,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1498,7 +1498,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1539,7 +1539,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1539,7 +1539,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1580,7 +1580,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1580,7 +1580,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1621,7 +1621,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1621,7 +1621,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1662,7 +1662,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1662,7 +1662,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1703,7 +1703,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1703,7 +1703,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1744,7 +1744,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1744,7 +1744,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1785,7 +1785,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1785,7 +1785,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1826,7 +1826,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1826,7 +1826,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1867,7 +1867,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1867,7 +1867,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1908,7 +1908,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1908,7 +1908,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1947,7 +1947,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1947,7 +1947,7 @@ export default class CorporateAnnualTarget extends Component {
// onBlur={(event) => { // onBlur={(event) => {
// // updateValue(event.target.value) // // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta) // handleChange(event.target.value, tableMeta)
// // console.log(dataTable2) // // // console.log(dataTable2)
// }} // }}
/> />
} }
...@@ -1987,7 +1987,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1987,7 +1987,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
} }
...@@ -2028,7 +2028,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2028,7 +2028,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
} }
...@@ -2064,9 +2064,9 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2064,9 +2064,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)} 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} defaultValue={value}
onBlur={(event) => { onBlur={(event) => {
// console.log(event.target.value) // // console.log(event.target.value)
handleChangeText(event.target.value, tableMeta) handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
</ThemeProvider> </ThemeProvider>
...@@ -2104,10 +2104,10 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2104,10 +2104,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)} 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} defaultValue={value}
onBlur={(event) => { onBlur={(event) => {
// console.log(event.target.value) // // console.log(event.target.value)
// updateValue(event.target.value) // updateValue(event.target.value)
handleChangeText(event.target.value, tableMeta) handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/> />
</ThemeProvider> </ThemeProvider>
......
...@@ -61,7 +61,7 @@ export default class BalanceSheet extends Component { ...@@ -61,7 +61,7 @@ export default class BalanceSheet extends Component {
"periode": this.props.data.periode, "periode": this.props.data.periode,
} }
api.create().getLastestUpdateOI(payload).then(response => { api.create().getLastestUpdateOI(payload).then(response => {
console.log(response.data) // console.log(response.data)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -76,7 +76,7 @@ export default class BalanceSheet extends Component { ...@@ -76,7 +76,7 @@ export default class BalanceSheet extends Component {
// this.getItemHierarki() // this.getItemHierarki()
this.getDataDetail() this.getDataDetail()
this.getLatestUpdate() this.getLatestUpdate()
console.log(this.props); // console.log(this.props);
} }
getDataDetail() { getDataDetail() {
...@@ -87,12 +87,12 @@ export default class BalanceSheet extends Component { ...@@ -87,12 +87,12 @@ export default class BalanceSheet extends Component {
"company_id": this.props.data.company.company_id, "company_id": this.props.data.company.company_id,
"periode": this.props.data.periode "periode": this.props.data.periode
} }
console.log(payload) // console.log(payload)
api.create().getOperatingIndDetail(payload).then(response => { api.create().getOperatingIndDetail(payload).then(response => {
console.log(response) // console.log(response)
let dataTable = [] let dataTable = []
let res = response.data.data let res = response.data.data
// console.log(res) // // console.log(res)
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) { if (indexIDzz === -1) {
...@@ -200,8 +200,8 @@ export default class BalanceSheet extends Component { ...@@ -200,8 +200,8 @@ export default class BalanceSheet extends Component {
"status": type, "status": type,
"master_budget": payloadMB "master_budget": payloadMB
} }
console.log('=========================') // console.log('=========================')
console.log(JSON.stringify(payload)) // console.log(JSON.stringify(payload))
this.props.saveOperatingInd(payload) this.props.saveOperatingInd(payload)
this.props.onClickClose() this.props.onClickClose()
} }
...@@ -215,7 +215,7 @@ export default class BalanceSheet extends Component { ...@@ -215,7 +215,7 @@ export default class BalanceSheet extends Component {
}) })
let indexParent = this.state.dataTable.findIndex((val) => val[1] == this.state.dataTable[data.rowIndex][2]) let indexParent = this.state.dataTable.findIndex((val) => val[1] == this.state.dataTable[data.rowIndex][2])
let a = this.state.dataTable[data.rowIndex][data.columnIndex] = total let a = this.state.dataTable[data.rowIndex][data.columnIndex] = total
// console.log(indexParent); // // console.log(indexParent);
return a return a
} }
...@@ -264,7 +264,7 @@ export default class BalanceSheet extends Component { ...@@ -264,7 +264,7 @@ export default class BalanceSheet extends Component {
// "status": type, // "status": type,
// "balance_sheet": data // "balance_sheet": data
// } // }
// // console.log(data); // // // console.log(data);
// this.props.saveToMasterBudget(payload) // this.props.saveToMasterBudget(payload)
this.props.onClickClose() this.props.onClickClose()
} }
...@@ -274,7 +274,7 @@ export default class BalanceSheet extends Component { ...@@ -274,7 +274,7 @@ export default class BalanceSheet extends Component {
`https://tia.eksad.com/tia-reporting-dev/public/transaction/operating_indicator/download_template?report_id=${this.props.data.report_id}&&company_id=${this.props.data.company.company_id}&&year=${this.props.data.periode}` `https://tia.eksad.com/tia-reporting-dev/public/transaction/operating_indicator/download_template?report_id=${this.props.data.report_id}&&company_id=${this.props.data.company.company_id}&&year=${this.props.data.periode}`
) )
res = await res.blob() res = await res.blob()
console.log(res) // console.log(res)
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
...@@ -285,15 +285,15 @@ export default class BalanceSheet extends Component { ...@@ -285,15 +285,15 @@ export default class BalanceSheet extends Component {
} }
async downloadAllData() { async downloadAllData() {
// console.log('masuk') // // console.log('masuk')
let bram = [this.props.data.operatingIndID, this.props.report_id, this.props.data.company.company_id, this.props.data.periode] let bram = [this.props.data.operatingIndID, this.props.report_id, this.props.data.company.company_id, this.props.data.periode]
console.log(bram) // console.log(bram)
let res = await fetch( let res = await fetch(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/operating_indicator/export_operating_indicator?operating_indicator_id=${this.props.data.operatingIndID == null ? "" : this.props.data.operatingIndID}&&report_id=${this.props.data.report_id}&&company_id=${this.props.data.company.company_id}&&year=${this.props.data.periode}` `https://tia.eksad.com/tia-reporting-dev/public/transaction/operating_indicator/export_operating_indicator?operating_indicator_id=${this.props.data.operatingIndID == null ? "" : this.props.data.operatingIndID}&&report_id=${this.props.data.report_id}&&company_id=${this.props.data.company.company_id}&&year=${this.props.data.periode}`
) )
res = await res.blob() res = await res.blob()
console.log(res) // console.log(res)
this.setState({ loading: false }) this.setState({ loading: false })
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
...@@ -307,13 +307,13 @@ export default class BalanceSheet extends Component { ...@@ -307,13 +307,13 @@ export default class BalanceSheet extends Component {
fileHandler = (event) => { fileHandler = (event) => {
let fileObj = event let fileObj = event
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp) // // console.log(resp)
if (err) { if (err) {
console.log(err); // console.log(err);
} }
else { else {
let isi = resp.rows.slice(3) let isi = resp.rows.slice(3)
console.log(isi); // console.log(isi);
let payload = [] let payload = []
let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/; let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/;
isi.map((i, index) => { isi.map((i, index) => {
...@@ -346,18 +346,18 @@ export default class BalanceSheet extends Component { ...@@ -346,18 +346,18 @@ export default class BalanceSheet extends Component {
report_id: this.props.data.report_id, report_id: this.props.data.report_id,
master_budget: payload master_budget: payload
} }
console.log(resp.rows[1][0]) // console.log(resp.rows[1][0])
this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] }) this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] })
} }
}); });
} }
checkUpload() { checkUpload() {
console.log(JSON.stringify(this.state.payload)) // console.log(JSON.stringify(this.state.payload))
api.create().checkUploadOperatingInd(this.state.payload).then(response => { api.create().checkUploadOperatingInd(this.state.payload).then(response => {
// console.log(JSON.stringify(this.state.payload)); // // console.log(JSON.stringify(this.state.payload));
console.log('===============') // console.log('===============')
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
this.setState({ visibleUpload: false, visibleOI: false, loading: true }) this.setState({ visibleUpload: false, visibleOI: false, loading: true })
...@@ -396,7 +396,7 @@ export default class BalanceSheet extends Component { ...@@ -396,7 +396,7 @@ export default class BalanceSheet extends Component {
uploadOI(type) { uploadOI(type) {
let data = [] let data = []
console.log(this.state.dataTable) // console.log(this.state.dataTable)
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
data.push({ data.push({
"item_report_id": i[1], "item_report_id": i[1],
...@@ -425,10 +425,10 @@ export default class BalanceSheet extends Component { ...@@ -425,10 +425,10 @@ export default class BalanceSheet extends Component {
status: type, status: type,
master_budget: data master_budget: data
} }
console.log(data); // console.log(data);
console.log(JSON.stringify(body)) // console.log(JSON.stringify(body))
api.create('UPLOAD').uploadOperatingInd(body).then(response => { api.create('UPLOAD').uploadOperatingInd(body).then(response => {
console.log(response); // console.log(response);
this.setState({loading: false}) this.setState({loading: false})
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -460,7 +460,7 @@ export default class BalanceSheet extends Component { ...@@ -460,7 +460,7 @@ export default class BalanceSheet extends Component {
// } // }
// }) // })
// dataTable2[tableMeta.rowIndex][20] = total // dataTable2[tableMeta.rowIndex][20] = total
console.log(dataTable2[tableMeta.rowIndex]) // console.log(dataTable2[tableMeta.rowIndex])
} }
const handleValue = (value, tableMeta) => { const handleValue = (value, tableMeta) => {
...@@ -478,12 +478,12 @@ export default class BalanceSheet extends Component { ...@@ -478,12 +478,12 @@ export default class BalanceSheet extends Component {
} }
const handleParent = (tableMeta) => { const handleParent = (tableMeta) => {
console.log(tableMeta) // console.log(tableMeta)
let total = Number(tableMeta.columnIndex == ""? 0 : tableMeta.columnIndex) let total = Number(tableMeta.columnIndex == ""? 0 : tableMeta.columnIndex)
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
if (item[2] == tableMeta.rowData[1]) { if (item[2] == tableMeta.rowData[1]) {
console.log('masuk') // console.log('masuk')
total += Number(item[tableMeta.columnIndex]) total += Number(item[tableMeta.columnIndex])
} }
}) })
...@@ -495,7 +495,7 @@ export default class BalanceSheet extends Component { ...@@ -495,7 +495,7 @@ export default class BalanceSheet extends Component {
const handleFormula = (tableMeta) => { const handleFormula = (tableMeta) => {
let arrayFormula = tableMeta.rowData[3].match(/[a-zA-Z]+|[0-9]+|[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+(?:\.[0-9]+@|)/g) let arrayFormula = tableMeta.rowData[3].match(/[a-zA-Z]+|[0-9]+|[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+(?:\.[0-9]+@|)/g)
let arrayFormulaConvert = [] let arrayFormulaConvert = []
// console.log(arrayFormula) // // console.log(arrayFormula)
arrayFormula.map((item, indexs) => { arrayFormula.map((item, indexs) => {
if (item == '-' || item == '+' || item == '/' || item == '*') { if (item == '-' || item == '+' || item == '/' || item == '*') {
arrayFormulaConvert.push(item) arrayFormulaConvert.push(item)
...@@ -503,13 +503,13 @@ export default class BalanceSheet extends Component { ...@@ -503,13 +503,13 @@ export default class BalanceSheet extends Component {
let indexID = dataTable2.findIndex((val) => val[21] == item) let indexID = dataTable2.findIndex((val) => val[21] == item)
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = dataTable2[indexID][tableMeta.columnIndex] let valuezz = dataTable2[indexID][tableMeta.columnIndex]
// console.log(dataTable2[indexID]) // // console.log(dataTable2[indexID])
arrayFormulaConvert.push(valuezz == "" ? 0 : valuezz) arrayFormulaConvert.push(valuezz == "" ? 0 : valuezz)
} }
} }
}) })
// console.log(arrayFormula) // // console.log(arrayFormula)
// console.log(arrayFormulaConvert) // // console.log(arrayFormulaConvert)
let array = arrayFormulaConvert let array = arrayFormulaConvert
let total = 0 let total = 0
let opt = "" let opt = ""
...@@ -649,10 +649,10 @@ export default class BalanceSheet extends Component { ...@@ -649,10 +649,10 @@ export default class BalanceSheet extends Component {
value={value} value={value}
disabled={true} disabled={true}
// onBlur={(event) => { // onBlur={(event) => {
// console.log(event.target.value) // // console.log(event.target.value)
// // updateValue(event.target.value) // // updateValue(event.target.value)
// handleChangeText(event.target.value, tableMeta) // handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
// }} // }}
/> />
} }
...@@ -740,7 +740,7 @@ export default class BalanceSheet extends Component { ...@@ -740,7 +740,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -763,7 +763,7 @@ export default class BalanceSheet extends Component { ...@@ -763,7 +763,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -826,7 +826,7 @@ export default class BalanceSheet extends Component { ...@@ -826,7 +826,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -849,7 +849,7 @@ export default class BalanceSheet extends Component { ...@@ -849,7 +849,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -911,7 +911,7 @@ export default class BalanceSheet extends Component { ...@@ -911,7 +911,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -934,7 +934,7 @@ export default class BalanceSheet extends Component { ...@@ -934,7 +934,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -996,7 +996,7 @@ export default class BalanceSheet extends Component { ...@@ -996,7 +996,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1019,7 +1019,7 @@ export default class BalanceSheet extends Component { ...@@ -1019,7 +1019,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1081,7 +1081,7 @@ export default class BalanceSheet extends Component { ...@@ -1081,7 +1081,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1104,7 +1104,7 @@ export default class BalanceSheet extends Component { ...@@ -1104,7 +1104,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1166,7 +1166,7 @@ export default class BalanceSheet extends Component { ...@@ -1166,7 +1166,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1189,7 +1189,7 @@ export default class BalanceSheet extends Component { ...@@ -1189,7 +1189,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1251,7 +1251,7 @@ export default class BalanceSheet extends Component { ...@@ -1251,7 +1251,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1274,7 +1274,7 @@ export default class BalanceSheet extends Component { ...@@ -1274,7 +1274,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1336,7 +1336,7 @@ export default class BalanceSheet extends Component { ...@@ -1336,7 +1336,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1359,7 +1359,7 @@ export default class BalanceSheet extends Component { ...@@ -1359,7 +1359,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1421,7 +1421,7 @@ export default class BalanceSheet extends Component { ...@@ -1421,7 +1421,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1444,7 +1444,7 @@ export default class BalanceSheet extends Component { ...@@ -1444,7 +1444,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1506,7 +1506,7 @@ export default class BalanceSheet extends Component { ...@@ -1506,7 +1506,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1529,7 +1529,7 @@ export default class BalanceSheet extends Component { ...@@ -1529,7 +1529,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1591,7 +1591,7 @@ export default class BalanceSheet extends Component { ...@@ -1591,7 +1591,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1614,7 +1614,7 @@ export default class BalanceSheet extends Component { ...@@ -1614,7 +1614,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1676,7 +1676,7 @@ export default class BalanceSheet extends Component { ...@@ -1676,7 +1676,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1699,7 +1699,7 @@ export default class BalanceSheet extends Component { ...@@ -1699,7 +1699,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1761,7 +1761,7 @@ export default class BalanceSheet extends Component { ...@@ -1761,7 +1761,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1784,7 +1784,7 @@ export default class BalanceSheet extends Component { ...@@ -1784,7 +1784,7 @@ export default class BalanceSheet extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
......
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