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

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

parents 2f842d2d 1e7354b1
......@@ -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,17 +1925,20 @@ 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.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
this.backToOLPA('draft')
})
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')
})
}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
......@@ -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