Commit a649918d authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

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

parents 51a93f4c 8edb12a0
......@@ -717,9 +717,9 @@ export default class BudgetTahunan extends Component {
}}
onClick={() =>
this.state.isSubmit === false ? null :
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 ?
......
......@@ -398,7 +398,7 @@ export default class CorporateAnnualTarget extends Component {
console.log(this.state.dataTable)
this.state.dataTable.map(i => {
data.push({
"item_report_id": i[1] == "" ? null : i[1],
"item_report_id": i[1] == "" || i[1] == null? 0 : i[1],
"item_report": String(i[6]),
"weight": String(i[7]),
"uom": String(i[8]),
......@@ -815,7 +815,7 @@ export default class CorporateAnnualTarget extends Component {
// this.setState({dataTable: dataTable2})
}
const handleAction = (idParent, typeReport) => {
const handleAction = (idParent, typeReport, tableMeta) => {
if (idParent !== null) {
let indexsss = dataTable2.findIndex((val) => val[1] == idParent)
if (dataTable2[indexsss][6] == 'CUSTOMER PERSPECTIVE' || dataTable2[indexsss][6] == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') {
......@@ -826,6 +826,13 @@ export default class CorporateAnnualTarget extends Component {
} else {
if (typeReport == null) {
return true
} else if (tableMeta !== undefined && tableMeta.rowData[0] == 1) {
let indexID = dataTable2.findIndex((val) => val[2] == tableMeta.rowData[1])
if (indexID !== -1) {
return false
} else {
return true
}
} else {
return false
}
......@@ -841,7 +848,7 @@ export default class CorporateAnnualTarget extends Component {
newData.push([
3,
"",
item[2],
item[2] == null? item[1] : item[2],
item[3],
item[4],
"",
......@@ -889,7 +896,7 @@ export default class CorporateAnnualTarget extends Component {
this.setState({ dataTable: dataTable2, dataDelete }, () => {
setTimeout(() => {
this.setState({ loading: false })
}, 500)
}, 100)
})
}
......@@ -949,7 +956,7 @@ export default class CorporateAnnualTarget extends Component {
customBodyRender: (val, tableMeta) => {
return (
// handleAction(tableMeta.rowData[2]) &&
handleAction(tableMeta.rowData[2], tableMeta.rowData[0]) && <div style={{ display: 'flex' }}>
handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta) && <div style={{ display: 'flex' }}>
{/* {tableMeta.rowData[6] === "Active" ? */}
{<span>
<LightTooltip title={'Add'} arrow>
......
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