Commit d5e4ba43 authored by EKSAD's avatar EKSAD

matiin console log

parent cd5fe3ce
...@@ -57,7 +57,7 @@ export default class ProfitLoss extends Component { ...@@ -57,7 +57,7 @@ export default class ProfitLoss extends Component {
componentDidMount() { componentDidMount() {
this.getItemHierarki() this.getItemHierarki()
this.getLatestUpdate() this.getLatestUpdate()
console.log(this.props); // console.log(this.props);
} }
getLatestUpdate() { getLatestUpdate() {
...@@ -89,7 +89,7 @@ export default class ProfitLoss extends Component { ...@@ -89,7 +89,7 @@ export default class ProfitLoss extends Component {
"submission_id": this.props.submissionID "submission_id": this.props.submissionID
} }
api.create().getDetailReportMB(payload).then(response => { api.create().getDetailReportMB(payload).then(response => {
console.log(response); // console.log(response);
let dataTable = [] let dataTable = []
this.setState({ visibleProfitLoss: true }) this.setState({ visibleProfitLoss: true })
if (response.data) { if (response.data) {
...@@ -167,7 +167,7 @@ export default class ProfitLoss extends Component { ...@@ -167,7 +167,7 @@ export default class ProfitLoss extends Component {
} }
} }
}) })
console.log(dataTable) // console.log(dataTable)
this.setState({ dataTable, loading: false, buttonError: true, editable: true }) this.setState({ dataTable, loading: false, buttonError: true, editable: true })
} else { } else {
this.setState({ dataTable, loading: false, buttonError: true, editable: true }) this.setState({ dataTable, loading: false, buttonError: true, editable: true })
...@@ -235,7 +235,7 @@ export default class ProfitLoss extends Component { ...@@ -235,7 +235,7 @@ export default class ProfitLoss extends Component {
"status": type, "status": type,
"profit_loss": data "profit_loss": data
} }
console.log(data); // console.log(data);
this.setState({ loading: false }) this.setState({ loading: false })
this.props.saveToMasterBudget(payload) this.props.saveToMasterBudget(payload)
this.props.onClickClose() this.props.onClickClose()
...@@ -246,7 +246,7 @@ export default class ProfitLoss extends Component { ...@@ -246,7 +246,7 @@ export default class ProfitLoss extends Component {
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}` `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}`
) )
res = await res.blob() res = await res.blob()
console.log(res) // console.log(res)
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
...@@ -261,11 +261,11 @@ export default class ProfitLoss extends Component { ...@@ -261,11 +261,11 @@ export default class ProfitLoss extends Component {
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp) // console.log(resp)
if (err) { if (err) {
console.log(err); // console.log(err);
} }
else { else {
let isi = resp.rows.slice(3) let isi = resp.rows.slice(3)
console.log(resp.rows[2]); // console.log(resp.rows[2]);
let payload = [] let payload = []
let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/; let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/;
isi.map((i, index) => { isi.map((i, index) => {
...@@ -299,7 +299,7 @@ export default class ProfitLoss extends Component { ...@@ -299,7 +299,7 @@ export default class ProfitLoss extends Component {
report_id: this.props.report_id, report_id: this.props.report_id,
profit_loss: payload profit_loss: payload
} }
console.log(body) // console.log(body)
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[2] }) this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[2] })
} }
}); });
...@@ -308,7 +308,7 @@ export default class ProfitLoss extends Component { ...@@ -308,7 +308,7 @@ export default class ProfitLoss extends Component {
checkUpload() { checkUpload() {
api.create().checkUploadMB(this.state.payload).then(response => { api.create().checkUploadMB(this.state.payload).then(response => {
// console.log(JSON.stringify(this.state.payload)); // console.log(JSON.stringify(this.state.payload));
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
this.setState({ visibleUpload: false, visibleProfitLoss: false, loading: true }) this.setState({ visibleUpload: false, visibleProfitLoss: false, loading: true })
...@@ -344,7 +344,7 @@ export default class ProfitLoss extends Component { ...@@ -344,7 +344,7 @@ export default class ProfitLoss extends Component {
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => {
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
if (item[24].length > 0) { if (item[24].length > 0) {
console.log('masuk') // console.log('masuk')
this.setState({ buttonError: true, errorPreview: true, editable: true }) this.setState({ buttonError: true, errorPreview: true, editable: true })
} }
}) })
...@@ -387,9 +387,9 @@ export default class ProfitLoss extends Component { ...@@ -387,9 +387,9 @@ export default class ProfitLoss extends Component {
profit_loss: data, profit_loss: data,
status: type status: type
} }
console.log(data); // console.log(data);
api.create('UPLOAD').uploadMasterBudget(body).then(response => { api.create('UPLOAD').uploadMasterBudget(body).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.onClickClose() this.props.onClickClose()
...@@ -409,7 +409,7 @@ export default class ProfitLoss extends Component { ...@@ -409,7 +409,7 @@ export default class ProfitLoss extends Component {
async downloadAllData() { async downloadAllData() {
let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}` let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
let sub_null = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}` let sub_null = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
console.log(url); // console.log(url);
let res = await fetch( let res = await fetch(
this.props.submissionID == null ? sub_null : url this.props.submissionID == null ? sub_null : url
) )
...@@ -457,9 +457,9 @@ export default class ProfitLoss extends Component { ...@@ -457,9 +457,9 @@ export default class ProfitLoss extends Component {
"profit_loss": data, "profit_loss": data,
"status": "submitted" "status": "submitted"
} }
console.log(payload) // console.log(payload)
api.create().validateSubmitReport(payload).then((response) => { api.create().validateSubmitReport(payload).then((response) => {
console.log(response) // console.log(response)
if (response.data.data.result) { if (response.data.data.result) {
this.setState({ loading: false, buttonError: false, editable: false }) this.setState({ loading: false, buttonError: false, editable: false })
} else { } else {
...@@ -481,7 +481,7 @@ export default class ProfitLoss extends Component { ...@@ -481,7 +481,7 @@ export default class ProfitLoss extends Component {
} else { } else {
// let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[tableMeta.rowIndex][2]) // let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[tableMeta.rowIndex][2])
// if (indexParent > 0) { // if (indexParent > 0) {
// // console.log(indexParent) // // // console.log(indexParent)
// let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val) // let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
// let jagain = dataTable2[indexParent][tableMeta.columnIndex] // let jagain = dataTable2[indexParent][tableMeta.columnIndex]
// a = dataTable2[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (Number(jagain) + Number(val)) // a = dataTable2[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (Number(jagain) + Number(val))
...@@ -515,9 +515,9 @@ export default class ProfitLoss extends Component { ...@@ -515,9 +515,9 @@ export default class ProfitLoss extends Component {
// console.log(total); // console.log(total);
} }
const handleNotes = (value, tableMeta) => { const handleNotes = (value, tableMeta) => {
console.log(value) // console.log(value)
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value
console.log(dataTable2[tableMeta.rowIndex]); // console.log(dataTable2[tableMeta.rowIndex]);
} }
const handleValue = (data) => { const handleValue = (data) => {
let total = 0 let total = 0
...@@ -667,7 +667,7 @@ export default class ProfitLoss extends Component { ...@@ -667,7 +667,7 @@ export default class ProfitLoss extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleNotes(event.target.value, tableMeta) handleNotes(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -921,7 +921,7 @@ export default class ProfitLoss extends Component { ...@@ -921,7 +921,7 @@ export default class ProfitLoss extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1011,7 +1011,7 @@ export default class ProfitLoss extends Component { ...@@ -1011,7 +1011,7 @@ export default class ProfitLoss extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1101,7 +1101,7 @@ export default class ProfitLoss extends Component { ...@@ -1101,7 +1101,7 @@ export default class ProfitLoss extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1191,7 +1191,7 @@ export default class ProfitLoss extends Component { ...@@ -1191,7 +1191,7 @@ export default class ProfitLoss extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1281,7 +1281,7 @@ export default class ProfitLoss extends Component { ...@@ -1281,7 +1281,7 @@ export default class ProfitLoss extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1371,7 +1371,7 @@ export default class ProfitLoss extends Component { ...@@ -1371,7 +1371,7 @@ export default class ProfitLoss extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1461,7 +1461,7 @@ export default class ProfitLoss extends Component { ...@@ -1461,7 +1461,7 @@ export default class ProfitLoss extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1551,7 +1551,7 @@ export default class ProfitLoss extends Component { ...@@ -1551,7 +1551,7 @@ export default class ProfitLoss extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1641,7 +1641,7 @@ export default class ProfitLoss extends Component { ...@@ -1641,7 +1641,7 @@ export default class ProfitLoss extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1731,7 +1731,7 @@ export default class ProfitLoss extends Component { ...@@ -1731,7 +1731,7 @@ export default class ProfitLoss extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1868,7 +1868,7 @@ export default class ProfitLoss extends Component { ...@@ -1868,7 +1868,7 @@ export default class ProfitLoss extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1958,7 +1958,7 @@ export default class ProfitLoss extends Component { ...@@ -1958,7 +1958,7 @@ export default class ProfitLoss extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
......
...@@ -58,7 +58,7 @@ export default class OperatingIndicator extends Component { ...@@ -58,7 +58,7 @@ export default class OperatingIndicator extends Component {
menu: "operating indicator" menu: "operating indicator"
} }
api.create().getPermission(payload).then(response => { api.create().getPermission(payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -76,7 +76,7 @@ export default class OperatingIndicator extends Component { ...@@ -76,7 +76,7 @@ export default class OperatingIndicator extends Component {
getLastPeriod() { getLastPeriod() {
api.create().getLastPeriodOI(this.state.company.company_id).then(response => { api.create().getLastPeriodOI(this.state.company.company_id).then(response => {
console.log(response); // console.log(response);
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => { this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => {
this.getPeriode() this.getPeriode()
...@@ -97,7 +97,7 @@ export default class OperatingIndicator extends Component { ...@@ -97,7 +97,7 @@ export default class OperatingIndicator extends Component {
this.setState({ listAttachment: response.data.data }) this.setState({ listAttachment: response.data.data })
} }
} }
// console.log(response); // // console.log(response);
}) })
} }
...@@ -108,7 +108,7 @@ export default class OperatingIndicator extends Component { ...@@ -108,7 +108,7 @@ export default class OperatingIndicator extends Component {
"report_type": "operating indicator", "report_type": "operating indicator",
} }
api.create().getAllOperatingInd(payload).then(response => { api.create().getAllOperatingInd(payload).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
let dataTable = response.data.data.map((item, index) => { let dataTable = response.data.data.map((item, index) => {
...@@ -120,7 +120,7 @@ export default class OperatingIndicator extends Component { ...@@ -120,7 +120,7 @@ export default class OperatingIndicator extends Component {
item.is_can_upload item.is_can_upload
] ]
}) })
// console.log(dataTable); // // console.log(dataTable);
this.setState({ dataTable, dataReport: response.data.data }) this.setState({ dataTable, dataReport: response.data.data })
} }
} }
...@@ -220,17 +220,17 @@ export default class OperatingIndicator extends Component { ...@@ -220,17 +220,17 @@ export default class OperatingIndicator extends Component {
if (item >= 2000 && item <= (Number(currentYear) + 1)) { if (item >= 2000 && item <= (Number(currentYear) + 1)) {
data.push(item) data.push(item)
} }
console.log('bibim') // console.log('bibim')
} else { } else {
if ((item >= 2000) && (item == this.state.lastPeriod || item < this.state.lastPeriod)) { if ((item >= 2000) && (item == this.state.lastPeriod || item < this.state.lastPeriod)) {
data.push(item) data.push(item)
} }
console.log('bubum') // console.log('bubum')
} }
}) })
console.log(this.state.lastPeriod) // console.log(this.state.lastPeriod)
console.log(this.state.lastPeriod) // console.log(this.state.lastPeriod)
console.log(this.state.isApprover) // console.log(this.state.isApprover)
let periodeData = data.map((item) => { let periodeData = data.map((item) => {
return { return {
periode: item, periode: item,
...@@ -240,7 +240,7 @@ export default class OperatingIndicator extends Component { ...@@ -240,7 +240,7 @@ export default class OperatingIndicator extends Component {
options: periodeData, options: periodeData,
getOptionLabel: (option) => option.periode, getOptionLabel: (option) => option.periode,
}; };
console.log(defaultProps) // console.log(defaultProps)
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.lastPeriod) let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.lastPeriod)
let index = data.sort((a, b) => a - b).findIndex((val) => val === periode) let index = data.sort((a, b) => a - b).findIndex((val) => val === periode)
this.setState({ listPeriode: defaultProps, periode: index == -1 ? periodeData[0] : periodeData[index] }, () => { this.setState({ listPeriode: defaultProps, periode: index == -1 ? periodeData[0] : periodeData[index] }, () => {
...@@ -257,7 +257,7 @@ export default class OperatingIndicator extends Component { ...@@ -257,7 +257,7 @@ export default class OperatingIndicator extends Component {
"periode": this.state.periode.periode "periode": this.state.periode.periode
} }
api.create().getRevision(payload).then(response => { api.create().getRevision(payload).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
let data = response.data.data let data = response.data.data
...@@ -286,7 +286,7 @@ export default class OperatingIndicator extends Component { ...@@ -286,7 +286,7 @@ export default class OperatingIndicator extends Component {
} }
api.create().getOpetratingIndID(payload).then(response => { api.create().getOpetratingIndID(payload).then(response => {
if (response) { if (response) {
console.log(response.data.data) // console.log(response.data.data)
this.getLatestPeriodSubmit() this.getLatestPeriodSubmit()
if (response.data.data) { if (response.data.data) {
this.setState({ operatingIndID: response.data.data.operating_indicator_id }) this.setState({ operatingIndID: response.data.data.operating_indicator_id })
...@@ -303,7 +303,7 @@ export default class OperatingIndicator extends Component { ...@@ -303,7 +303,7 @@ export default class OperatingIndicator extends Component {
"periode": this.state.periode.periode "periode": this.state.periode.periode
} }
api.create().getSubmitOI(body).then(response => { api.create().getSubmitOI(body).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ isSubmit: response.data.data.is_can_submit }, () => { this.setState({ isSubmit: response.data.data.is_can_submit }, () => {
...@@ -335,9 +335,9 @@ export default class OperatingIndicator extends Component { ...@@ -335,9 +335,9 @@ export default class OperatingIndicator extends Component {
fileHandler = (event) => { fileHandler = (event) => {
let fileObj = event let fileObj = event
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp) // // console.log(resp)
if (err) { if (err) {
console.log(err); // console.log(err);
} }
else { else {
const formData = new FormData(); const formData = new FormData();
...@@ -360,7 +360,7 @@ export default class OperatingIndicator extends Component { ...@@ -360,7 +360,7 @@ export default class OperatingIndicator extends Component {
}) })
} }
} }
// console.log(response) // // console.log(response)
}) })
} }
...@@ -390,7 +390,7 @@ export default class OperatingIndicator extends Component { ...@@ -390,7 +390,7 @@ export default class OperatingIndicator extends Component {
// <Select // <Select
// value={val} // value={val}
// onChange={event => { // onChange={event => {
// // console.log(event.target) // // // console.log(event.target)
// updateValue(event.target.value) // updateValue(event.target.value)
// this.handleChange(event.target.value, tableMeta) // this.handleChange(event.target.value, tableMeta)
// }} // }}
......
...@@ -72,7 +72,7 @@ export default class OutlookPA extends Component { ...@@ -72,7 +72,7 @@ export default class OutlookPA extends Component {
this.setState({ loading: true }) this.setState({ loading: true })
this.props.selectIndex('Outlook Performance Appraisal') this.props.selectIndex('Outlook Performance Appraisal')
if (this.props.location.state !== undefined) { if (this.props.location.state !== undefined) {
console.log(this.props); // console.log(this.props);
this.setState({ userType: this.props.location.state.userType, intent: 'Home', lastPeriod: this.props.location.state.rawData.periode, rawData: this.props.location.state.rawData }, () => { this.setState({ userType: this.props.location.state.userType, intent: 'Home', lastPeriod: this.props.location.state.rawData.periode, rawData: this.props.location.state.rawData }, () => {
this.checkApprover() this.checkApprover()
}) })
...@@ -83,7 +83,7 @@ export default class OutlookPA extends Component { ...@@ -83,7 +83,7 @@ export default class OutlookPA extends Component {
checkApprover() { checkApprover() {
api.create().checkApproverOLPA().then(response => { api.create().checkApproverOLPA().then(response => {
console.log(response); // console.log(response);
if (response.data.data.is_approver === true) { if (response.data.data.is_approver === true) {
this.setState({ isApprover: true, checkApprover: true }, () => this.setState({ isApprover: true, checkApprover: true }, () =>
this.getPeriode()) this.getPeriode())
...@@ -99,7 +99,7 @@ export default class OutlookPA extends Component { ...@@ -99,7 +99,7 @@ export default class OutlookPA extends Component {
"periode": this.state.periode.periode "periode": this.state.periode.periode
} }
api.create().getCompanySubmittedOLPA(body).then(response => { api.create().getCompanySubmittedOLPA(body).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
let data = response.data.data let data = response.data.data
...@@ -115,7 +115,7 @@ export default class OutlookPA extends Component { ...@@ -115,7 +115,7 @@ export default class OutlookPA extends Component {
getOptionLabel: (option) => titleCase(option.company_name), getOptionLabel: (option) => titleCase(option.company_name),
}; };
this.setState({ listCompany: defaultProps, company: companyData[0] }, () => { this.setState({ listCompany: defaultProps, company: companyData[0] }, () => {
// console.log(response.data.data); // // console.log(response.data.data);
if (response.data.data.length > 0) { if (response.data.data.length > 0) {
this.getRevision() this.getRevision()
} else { } else {
...@@ -146,13 +146,13 @@ export default class OutlookPA extends Component { ...@@ -146,13 +146,13 @@ export default class OutlookPA extends Component {
"revision": this.state.revision.revision, "revision": this.state.revision.revision,
} }
api.create().getOLPAAtt(payload).then(response => { api.create().getOLPAAtt(payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ listAttachment: response.data.data }) this.setState({ listAttachment: response.data.data })
} }
} }
// console.log(response); // // console.log(response);
}) })
} }
...@@ -163,7 +163,7 @@ export default class OutlookPA extends Component { ...@@ -163,7 +163,7 @@ export default class OutlookPA extends Component {
"report_type": "Outlook PA", "report_type": "Outlook PA",
} }
api.create().getReportOLPA(payload).then(response => { api.create().getReportOLPA(payload).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
let dataTable = response.data.data.map((item, index) => { let dataTable = response.data.data.map((item, index) => {
...@@ -184,7 +184,7 @@ export default class OutlookPA extends Component { ...@@ -184,7 +184,7 @@ export default class OutlookPA extends Component {
"" ""
] ]
}) })
// console.log(dataTable); // // console.log(dataTable);
this.setState({ dataTable, loading: false, dataTableRevision, dataForRevision: response.data.data }) this.setState({ dataTable, loading: false, dataTableRevision, dataForRevision: response.data.data })
} }
} else { } else {
...@@ -199,7 +199,7 @@ export default class OutlookPA extends Component { ...@@ -199,7 +199,7 @@ export default class OutlookPA extends Component {
"periode": this.state.periode.periode "periode": this.state.periode.periode
} }
api.create().getSubmitOLPA(body).then(response => { api.create().getSubmitOLPA(body).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ isSubmit: response.data.data.is_can_submit }, () => { this.setState({ isSubmit: response.data.data.is_can_submit }, () => {
...@@ -228,7 +228,7 @@ export default class OutlookPA extends Component { ...@@ -228,7 +228,7 @@ export default class OutlookPA extends Component {
getCompanyActive() { getCompanyActive() {
api.create().getPerusahaanActive().then((response) => { api.create().getPerusahaanActive().then((response) => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
let data = response.data.data let data = response.data.data
...@@ -274,7 +274,7 @@ export default class OutlookPA extends Component { ...@@ -274,7 +274,7 @@ export default class OutlookPA extends Component {
getLastPeriod() { getLastPeriod() {
api.create().getLastPeriodOLPA(this.state.company.company_id).then(response => { api.create().getLastPeriodOLPA(this.state.company.company_id).then(response => {
console.log(response); // console.log(response);
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => { this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => {
this.getPeriode() this.getPeriode()
...@@ -288,7 +288,7 @@ export default class OutlookPA extends Component { ...@@ -288,7 +288,7 @@ export default class OutlookPA extends Component {
// let dateNow = new Date // let dateNow = new Date
// let year = this.state.rawData ? this.state.rawData.periode : format(dateNow, 'yyyy') // let year = this.state.rawData ? this.state.rawData.periode : format(dateNow, 'yyyy')
let currentYear = new Date().getFullYear() let currentYear = new Date().getFullYear()
// console.log(currentYear) // // console.log(currentYear)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
let data = [] let data = []
...@@ -314,10 +314,10 @@ export default class OutlookPA extends Component { ...@@ -314,10 +314,10 @@ export default class OutlookPA extends Component {
}; };
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.lastPeriod) let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.lastPeriod)
let index = data.sort((a, b) => a - b).findIndex((val) => val === periode) let index = data.sort((a, b) => a - b).findIndex((val) => val === periode)
// console.log(data) // // console.log(data)
console.log(this.state.lastPeriod) // console.log(this.state.lastPeriod)
// console.log(periodeData) // // console.log(periodeData)
// console.log(index) // // console.log(index)
this.setState({ listPeriode: defaultProps, periode: index === -1 ? periodeData[0] : periodeData[index] }, () => { this.setState({ listPeriode: defaultProps, periode: index === -1 ? periodeData[0] : periodeData[index] }, () => {
if (this.state.isApprover === true) { if (this.state.isApprover === true) {
this.getCompanySubmitted() this.getCompanySubmitted()
...@@ -336,7 +336,7 @@ export default class OutlookPA extends Component { ...@@ -336,7 +336,7 @@ export default class OutlookPA extends Component {
"periode": this.state.periode.periode "periode": this.state.periode.periode
} }
api.create().getRevision(payload).then(response => { api.create().getRevision(payload).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
let data = response.data.data let data = response.data.data
...@@ -365,7 +365,7 @@ export default class OutlookPA extends Component { ...@@ -365,7 +365,7 @@ export default class OutlookPA extends Component {
"is_approver": this.state.isApprover "is_approver": this.state.isApprover
} }
api.create().getOutlookPAID(payload).then(response => { api.create().getOutlookPAID(payload).then(response => {
console.log(response) // console.log(response)
if (response) { if (response) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -376,11 +376,11 @@ export default class OutlookPA extends Component { ...@@ -376,11 +376,11 @@ export default class OutlookPA extends Component {
lastRevision: response.data.data.last_revision, lastRevision: response.data.data.last_revision,
btnApprove: response.data.data.is_submit btnApprove: response.data.data.is_submit
}, () => { }, () => {
console.log(this.state.lastStatus); // console.log(this.state.lastStatus);
this.historyApproval() this.historyApproval()
this.getLatestPeriodSubmit() this.getLatestPeriodSubmit()
api.create().checkApprover().then(response => { api.create().checkApprover().then(response => {
// console.log(response); // // console.log(response);
if (response.data.data.is_approver === true) { if (response.data.data.is_approver === true) {
this.setState({ isApprover: true, checkApprover: true }) this.setState({ isApprover: true, checkApprover: true })
} else { } else {
...@@ -402,7 +402,7 @@ export default class OutlookPA extends Component { ...@@ -402,7 +402,7 @@ export default class OutlookPA extends Component {
"periode": this.state.periode.periode "periode": this.state.periode.periode
} }
api.create().historyApprovalOLPA(body).then(response => { api.create().historyApprovalOLPA(body).then(response => {
console.log(response); // console.log(response);
if (response.data.data.length > 0) { if (response.data.data.length > 0) {
let dataTableHistory = response.data.data.map(item => { let dataTableHistory = response.data.data.map(item => {
return [ return [
...@@ -432,9 +432,9 @@ export default class OutlookPA extends Component { ...@@ -432,9 +432,9 @@ export default class OutlookPA extends Component {
"min_periode": moment(this.state.minDateRevision).format('YYYY-MM-DD'), "min_periode": moment(this.state.minDateRevision).format('YYYY-MM-DD'),
"max_periode": moment(this.state.maxDateRevision).format('YYYY-MM-DD') "max_periode": moment(this.state.maxDateRevision).format('YYYY-MM-DD')
} }
console.log(payload) // console.log(payload)
api.create().approvalSubmission(body).then((res) => { api.create().approvalSubmission(body).then((res) => {
console.log(res) // console.log(res)
this.setState({ loading: false }, () => { this.setState({ loading: false }, () => {
this.getSubmission() this.getSubmission()
}) })
...@@ -445,7 +445,7 @@ export default class OutlookPA extends Component { ...@@ -445,7 +445,7 @@ export default class OutlookPA extends Component {
} }
clickDetail(item, id, revision, status) { clickDetail(item, id, revision, status) {
console.log(this.state.dataForRevision); // console.log(this.state.dataForRevision);
this.state.dataForRevision.map(i => { this.state.dataForRevision.map(i => {
if (i.report_name === item) { if (i.report_name === item) {
if (i.revision !== revision) { if (i.revision !== revision) {
...@@ -510,9 +510,9 @@ export default class OutlookPA extends Component { ...@@ -510,9 +510,9 @@ export default class OutlookPA extends Component {
fileHandler = (event) => { fileHandler = (event) => {
let fileObj = event let fileObj = event
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp) // // console.log(resp)
if (err) { if (err) {
console.log(err); // console.log(err);
} }
else { else {
const formData = new FormData(); const formData = new FormData();
...@@ -553,9 +553,9 @@ export default class OutlookPA extends Component { ...@@ -553,9 +553,9 @@ export default class OutlookPA extends Component {
saveToOLPA(data) { saveToOLPA(data) {
this.setState({ loading: true }) this.setState({ loading: true })
// console.log(JSON.stringify(data)); // // console.log(JSON.stringify(data));
api.create('UPLOAD').createReportOLPA(data).then(response => { api.create('UPLOAD').createReportOLPA(data).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.getOutlookPAID() this.getOutlookPAID()
...@@ -577,9 +577,9 @@ export default class OutlookPA extends Component { ...@@ -577,9 +577,9 @@ export default class OutlookPA extends Component {
async downloadAttachment(fileurl, name) { async downloadAttachment(fileurl, name) {
let length = name.split(".").length let length = name.split(".").length
let fileType = name.split(".")[length - 1] let fileType = name.split(".")[length - 1]
console.log(fileType); // console.log(fileType);
let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/download_attachment?fileName=${fileurl}&&fileType=${fileType}` let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/download_attachment?fileName=${fileurl}&&fileType=${fileType}`
// console.log(url); // // console.log(url);
let res = await fetch( let res = await fetch(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/download_attachment?fileName=${fileurl}&&fileType=${fileType}` `https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/download_attachment?fileName=${fileurl}&&fileType=${fileType}`
) )
...@@ -616,7 +616,7 @@ export default class OutlookPA extends Component { ...@@ -616,7 +616,7 @@ export default class OutlookPA extends Component {
outlook_pa_id: this.state.outlook_pa_id outlook_pa_id: this.state.outlook_pa_id
} }
api.create().submitOLPA(body).then(response => { api.create().submitOLPA(body).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.getOutlookPAID() this.getOutlookPAID()
...@@ -627,9 +627,9 @@ export default class OutlookPA extends Component { ...@@ -627,9 +627,9 @@ export default class OutlookPA extends Component {
this.setState({ alert: true, messageAlert: 'Data Is Not Complete', tipeAlert: 'warning', loading: false }) this.setState({ alert: true, messageAlert: 'Data Is Not Complete', tipeAlert: 'warning', loading: false })
} }
// if (array.includes("not-yet" || "draft")) { // if (array.includes("not-yet" || "draft")) {
// console.log('gagal'); // // console.log('gagal');
// } else { // } else {
// console.log('masuk'); // // console.log('masuk');
// } // }
} }
...@@ -657,7 +657,7 @@ export default class OutlookPA extends Component { ...@@ -657,7 +657,7 @@ export default class OutlookPA extends Component {
<Select <Select
value={val} value={val}
onChange={event => { onChange={event => {
// console.log(event.target) // // console.log(event.target)
updateValue(event.target.value) updateValue(event.target.value)
this.handleChange(event.target.value, tableMeta) this.handleChange(event.target.value, tableMeta)
}} }}
...@@ -784,10 +784,10 @@ export default class OutlookPA extends Component { ...@@ -784,10 +784,10 @@ export default class OutlookPA extends Component {
defaultValue={value} defaultValue={value}
color={"#5198ea"} color={"#5198ea"}
onBlur={(event) => { onBlur={(event) => {
// console.log(event.target.value) // // console.log(event.target.value)
// updateValue(event.target.value) // updateValue(event.target.value)
handleChangeText(event.target.value, tableMeta) handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2) // // console.log(dataTable2)
}} }}
/>} />}
/> />
...@@ -825,7 +825,7 @@ export default class OutlookPA extends Component { ...@@ -825,7 +825,7 @@ export default class OutlookPA extends Component {
detailRevisiCheck.splice(indexId, 1) detailRevisiCheck.splice(indexId, 1)
} }
this.setState({ detailRevisiCheck }) this.setState({ detailRevisiCheck })
console.log(detailRevisiCheck) // console.log(detailRevisiCheck)
} }
const options = { const options = {
......
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