Commit 3aeca67e authored by Riri Novita's avatar Riri Novita

rolling

parent 8fff5844
...@@ -81,8 +81,13 @@ export default class OperatingIndicatorMR extends Component { ...@@ -81,8 +81,13 @@ export default class OperatingIndicatorMR extends Component {
handleViewOnly() { handleViewOnly() {
let checkCreate = this.props.permission.create let checkCreate = this.props.permission.create
let checkEdit = this.props.permission.edit let checkEdit = this.props.permission.edit
let checkStatus = true
this.setState({viewOnly: checkCreate && checkEdit}) if (String(this.props.data.status).toLocaleUpperCase() === 'CLOSED') {
checkStatus = false
}
this.setState({viewOnly: checkCreate && checkEdit && checkStatus})
} }
handleGetFor(type) { handleGetFor(type) {
......
...@@ -333,7 +333,7 @@ export default class OperatingIndicator extends Component { ...@@ -333,7 +333,7 @@ export default class OperatingIndicator extends Component {
String(item[1]).toLocaleLowerCase().includes('dec') ? 12 : null String(item[1]).toLocaleLowerCase().includes('dec') ? 12 : null
this.setState({ this.setState({
statusDetail: String(item[2]).toLocaleLowerCase(), statusDetail: String(item[2]).toLocaleLowerCase(),
dataDetail: { ...this.state.dataReport[index], periode: this.state.periode.periode, operatingIndID: this.state.operatingIndID, company: this.state.company }, dataDetail: { ...this.state.dataReport[index], periode: this.state.periode.periode, operatingIndID: this.state.operatingIndID, company: this.state.company, status: item[2] },
visibleOperatingIndicator: false, visibleOperatingIndicator: false,
visibleDetailOpt: false, visibleDetailOpt: false,
visibleDetailMonthly: true, visibleDetailMonthly: true,
...@@ -348,7 +348,7 @@ export default class OperatingIndicator extends Component { ...@@ -348,7 +348,7 @@ export default class OperatingIndicator extends Component {
String(item[1]).toLocaleLowerCase().includes('q3') ? "q3" : null String(item[1]).toLocaleLowerCase().includes('q3') ? "q3" : null
this.setState({ this.setState({
statusDetail: String(item[2]).toLocaleLowerCase(), statusDetail: String(item[2]).toLocaleLowerCase(),
dataDetail: { ...this.state.dataReport[index], periode: this.state.periode.periode, operatingIndID: this.state.operatingIndID, company: this.state.company }, dataDetail: { ...this.state.dataReport[index], periode: this.state.periode.periode, operatingIndID: this.state.operatingIndID, company: this.state.company, status: item[2] },
visibleOperatingIndicator: false, visibleOperatingIndicator: false,
visibleDetailOpt: false, visibleDetailOpt: false,
visibleDetailMonthly: false, visibleDetailMonthly: false,
......
...@@ -69,8 +69,15 @@ export default class OperatingIndicatorRO extends Component { ...@@ -69,8 +69,15 @@ export default class OperatingIndicatorRO extends Component {
handleViewOnly() { handleViewOnly() {
let checkCreate = this.props.permission.create let checkCreate = this.props.permission.create
let checkEdit = this.props.permission.edit let checkEdit = this.props.permission.edit
let checkStatus = true
this.setState({ viewOnly: checkCreate && checkEdit }) console.log(this.props.data.status);
if (String(this.props.data.status).toLocaleUpperCase() === 'CLOSED') {
checkStatus = false
}
console.log(checkStatus);
this.setState({ viewOnly: checkCreate && checkEdit && checkStatus})
} }
handleGetFor(type) { handleGetFor(type) {
...@@ -2120,7 +2127,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -2120,7 +2127,7 @@ export default class OperatingIndicatorRO extends Component {
</button> </button>
</div> </div>
{!this.state.emptyData && (this.props.permission.create || this.props.permission.edit) && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 2 }}> {!this.state.emptyData && (this.props.permission.create || this.props.permission.edit) && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 2 }}>
{this.state.get_for == 'view' && this.state.viewOnly && {this.state.get_for == 'view' &&
<button <button
type="button" type="button"
onClick={() => { onClick={() => {
...@@ -2354,7 +2361,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -2354,7 +2361,7 @@ export default class OperatingIndicatorRO extends Component {
this.setState({ uploadStatus: 'idle', percentage: '0' }) this.setState({ uploadStatus: 'idle', percentage: '0' })
}} }}
onUpload={() => { onUpload={() => {
String(this.state.judulColumn).includes("TEMPLATE") && String(this.state.judulColumn).includes("UPLOAD") && String(this.state.judul).includes("ROLLING") && String(this.state.judul).includes("OUTLOOK") && String(this.state.judul).includes("OPERATING") && String(this.state.judul).includes("INDICATOR") ? String(this.state.judulColumn).includes("TEMPLATE") && String(this.state.judulColumn).includes("UPLOAD") && String(this.state.judul).includes("ROLLING") && String(this.state.judul).includes("OUTLOOK") && String(this.state.judul).includes(String(this.props.quartal).toLocaleUpperCase()) && String(this.state.judul).includes("OPERATING") && String(this.state.judul).includes("INDICATOR") ?
this.checkUpload() : this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' }) this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}} }}
......
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