Commit e04ecf45 authored by d.arizona's avatar d.arizona

apdet

parent ca711eb6
...@@ -717,9 +717,9 @@ export default class BudgetTahunan extends Component { ...@@ -717,9 +717,9 @@ export default class BudgetTahunan extends Component {
}} }}
onClick={() => onClick={() =>
this.state.isSubmit === false ? null : 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]) this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2], tableMeta.rowData[3])
: null // : null
} }
> >
{/* {this.state.isApprover == true ? {/* {this.state.isApprover == true ?
......
...@@ -398,7 +398,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -398,7 +398,7 @@ export default class CorporateAnnualTarget extends Component {
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] == "" ? null : i[1], "item_report_id": i[1] == "" || i[1] == null? 0 : i[1],
"item_report": String(i[6]), "item_report": String(i[6]),
"weight": String(i[7]), "weight": String(i[7]),
"uom": String(i[8]), "uom": String(i[8]),
...@@ -815,7 +815,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -815,7 +815,7 @@ export default class CorporateAnnualTarget extends Component {
// this.setState({dataTable: dataTable2}) // this.setState({dataTable: dataTable2})
} }
const handleAction = (idParent, typeReport) => { const handleAction = (idParent, typeReport, tableMeta) => {
if (idParent !== null) { if (idParent !== null) {
let indexsss = dataTable2.findIndex((val) => val[1] == idParent) let indexsss = dataTable2.findIndex((val) => val[1] == idParent)
if (dataTable2[indexsss][6] == 'CUSTOMER PERSPECTIVE' || dataTable2[indexsss][6] == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') { if (dataTable2[indexsss][6] == 'CUSTOMER PERSPECTIVE' || dataTable2[indexsss][6] == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') {
...@@ -826,6 +826,13 @@ export default class CorporateAnnualTarget extends Component { ...@@ -826,6 +826,13 @@ export default class CorporateAnnualTarget extends Component {
} else { } else {
if (typeReport == null) { if (typeReport == null) {
return true 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 { } else {
return false return false
} }
...@@ -841,7 +848,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -841,7 +848,7 @@ export default class CorporateAnnualTarget extends Component {
newData.push([ newData.push([
3, 3,
"", "",
item[2], item[2] == null? item[1] : item[2],
item[3], item[3],
item[4], item[4],
"", "",
...@@ -889,7 +896,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -889,7 +896,7 @@ export default class CorporateAnnualTarget extends Component {
this.setState({ dataTable: dataTable2, dataDelete }, () => { this.setState({ dataTable: dataTable2, dataDelete }, () => {
setTimeout(() => { setTimeout(() => {
this.setState({ loading: false }) this.setState({ loading: false })
}, 500) }, 100)
}) })
} }
...@@ -949,7 +956,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -949,7 +956,7 @@ export default class CorporateAnnualTarget extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
// handleAction(tableMeta.rowData[2]) && // 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" ? */} {/* {tableMeta.rowData[6] === "Active" ? */}
{<span> {<span>
<LightTooltip title={'Add'} arrow> <LightTooltip title={'Add'} arrow>
...@@ -979,8 +986,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -979,8 +986,7 @@ export default class CorporateAnnualTarget extends Component {
marginLeft: 5 marginLeft: 5
}} }}
onClick={() => { onClick={() => {
this.setState({ loading: true }) this.setState({ loading: true }, () => handleDelete(tableMeta.rowIndex))
handleDelete(tableMeta.rowIndex)
}} }}
> >
<img src={Images.delete} /> <img src={Images.delete} />
......
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