Commit cc178e9e authored by Riri Novita's avatar Riri Novita

apdet

parent 2911e85a
......@@ -67,6 +67,7 @@ export default class OutlookPA extends Component {
btnApprove: false,
listStatus: [],
selectedStatus: [],
prevRevision: false
}
this.myRef = React.createRef()
this.fileHandler = this.fileHandler.bind(this);
......@@ -552,10 +553,9 @@ export default class OutlookPA extends Component {
}
clickDetail(item, id, revision, status) {
// console.log(this.state.dataForRevision);
this.state.dataForRevision.map(i => {
if (i.report_name === item) {
if (i.revision !== revision) {
if (i.revision == revision) {
this.setState({ prevRevision: true })
} else {
this.setState({ prevRevision: false })
......@@ -873,9 +873,9 @@ export default class OutlookPA 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 ?
......
......@@ -1911,7 +1911,7 @@ export default class BalanceSheetOLPA extends Component {
<div className="col-2">
</div> :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
{this.state.get_for == 'view' && <button
{this.state.get_for == 'view' && this.state.viewOnly && <button
className="button"
type="button"
style={{
......
......@@ -128,6 +128,7 @@ export default class ProfitLossOLPA extends Component {
"outlook_pa_id": this.props.outlook_pa_id
}
api.create().getLastestUpdateOLPA(payload).then(response => {
// console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.setState({
......@@ -584,10 +585,10 @@ export default class ProfitLossOLPA extends Component {
total += Number(valItem)
}
})
if (tableMeta.rowData[1] === 19865) {
console.log(total);
console.log(dataTable2[tableMeta.rowIndex]);
}
// if (tableMeta.rowData[1] === 19865) {
// console.log(total);
// console.log(dataTable2[tableMeta.rowIndex]);
// }
let indexParent = dataTable2.findIndex((val) => val[1] == tableMeta.rowData[2])
if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "sales price") {
let value = Number(dataTable2[tableMeta.rowIndex - 2][20]) / Number(dataTable2[tableMeta.rowIndex - 1][20])
......@@ -1876,7 +1877,8 @@ export default class ProfitLossOLPA extends Component {
<div className="col-2">
</div> :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
{this.state.get_for == 'view' && <button
{this.state.get_for == 'view' && this.state.viewOnly &&
<button
className="button"
type="button"
style={{
......@@ -1923,13 +1925,16 @@ export default class ProfitLossOLPA extends Component {
type="button"
style={{
backgroundColor: 'transparent',
cursor: this.state.editable !== true ? 'pointer' : 'default',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
disabled={this.state.buttonDraft}
// disabled={this.state.buttonDraft}
onClick={() =>
this.state.editable === true ?
this.setState({ alert: true, messageAlert: 'Data Incomplete !', tipeAlert: 'error' })
:
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
this.backToOLPA('draft')
......@@ -1942,9 +1947,9 @@ export default class ProfitLossOLPA extends Component {
</button>}
{this.state.get_for == 'edit' && <button
type="button"
disabled={this.state.buttonError}
// disabled={this.state.buttonError}
onClick={() => this.state.buttonError ?
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'error' })
:
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
......@@ -1952,7 +1957,7 @@ export default class ProfitLossOLPA extends Component {
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
}}
......@@ -2011,7 +2016,7 @@ export default class ProfitLossOLPA extends Component {
disabled={this.state.buttonError}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
......@@ -2032,14 +2037,15 @@ export default class ProfitLossOLPA extends Component {
type="button"
style={{
backgroundColor: 'transparent',
cursor: this.state.editable !== true ? 'pointer' : 'default',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() =>
this.state.editable === true ?
null :
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'error' })
:
this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
......@@ -2064,7 +2070,8 @@ export default class ProfitLossOLPA extends Component {
}}
onClick={() =>
this.state.editable === true ?
null :
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'error' })
:
this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
......
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