Commit 315bc86f authored by Riri Novita's avatar Riri Novita

push issue perdownload an

parent a15a1d19
...@@ -169,34 +169,34 @@ class MaintenanceMode extends Component { ...@@ -169,34 +169,34 @@ class MaintenanceMode extends Component {
"maintenance_headline": this.state.headline, "maintenance_headline": this.state.headline,
"maintenance_content": this.state.maintenanceContent, "maintenance_content": this.state.maintenanceContent,
"maintenance_status": this.state.maintenanceStatus, "maintenance_status": this.state.maintenanceStatus,
"maintenance_mail": [
{
"mail_type": "MAINTENANCE_MODE_ACTIVE",
"mail_subject": "TIA 4.0 Is Under Maintenance",
"mail_body": "",
"mail_status": 0
},
{
"mail_type": "MAINTENANCE_MODE_INACTIVE",
"mail_subject": "TIA 4.0 is Back",
"mail_body": "",
"mail_status": 0
}
]
// "maintenance_mail": [ // "maintenance_mail": [
// { // {
// "mail_type": "MAINTENANCE_MODE_ACTIVE", // "mail_type": "MAINTENANCE_MODE_ACTIVE",
// "mail_subject": this.state.subjectMailActive, // "mail_subject": "TIA 4.0 Is Under Maintenance",
// "mail_body": this.state.mailcontentModeActive, // "mail_body": "",
// "mail_status": this.state.mailStatusActive // "mail_status": 0
// }, // },
// { // {
// "mail_type": "MAINTENANCE_MODE_INACTIVE", // "mail_type": "MAINTENANCE_MODE_INACTIVE",
// "mail_subject": this.state.subjectMailNonActive, // "mail_subject": "TIA 4.0 is Back",
// "mail_body": this.state.mailcontentModeNonActive, // "mail_body": "",
// "mail_status": this.state.mailStatusNonActive // "mail_status": 0
// } // }
// ] // ]
"maintenance_mail": [
{
"mail_type": "MAINTENANCE_MODE_ACTIVE",
"mail_subject": this.state.subjectMailActive,
"mail_body": this.state.mailcontentModeActive,
"mail_status": this.state.mailStatusActive
},
{
"mail_type": "MAINTENANCE_MODE_INACTIVE",
"mail_subject": this.state.subjectMailNonActive,
"mail_body": this.state.mailcontentModeNonActive,
"mail_status": this.state.mailStatusNonActive
}
]
} }
console.log(payload); console.log(payload);
api.create().createMaintenanceMode(payload).then((response) => { api.create().createMaintenanceMode(payload).then((response) => {
...@@ -234,34 +234,34 @@ class MaintenanceMode extends Component { ...@@ -234,34 +234,34 @@ class MaintenanceMode extends Component {
"maintenance_headline": this.state.headline, "maintenance_headline": this.state.headline,
"maintenance_content": this.state.maintenanceContent, "maintenance_content": this.state.maintenanceContent,
"maintenance_status": this.state.maintenanceStatus, "maintenance_status": this.state.maintenanceStatus,
"maintenance_mail": [
{
"mail_type": "MAINTENANCE_MODE_ACTIVE",
"mail_subject": "TIA 4.0 Is Under Maintenance",
"mail_body": "",
"mail_status": 0
},
{
"mail_type": "MAINTENANCE_MODE_INACTIVE",
"mail_subject": "TIA 4.0 is Back",
"mail_body": "",
"mail_status": 0
}
]
// "maintenance_mail": [ // "maintenance_mail": [
// { // {
// "mail_type": "MAINTENANCE_MODE_ACTIVE", // "mail_type": "MAINTENANCE_MODE_ACTIVE",
// "mail_subject": this.state.subjectMailActive, // "mail_subject": "TIA 4.0 Is Under Maintenance",
// "mail_body": this.state.mailcontentModeActive, // "mail_body": "",
// "mail_status": this.state.mailStatusActive // "mail_status": 0
// }, // },
// { // {
// "mail_type": "MAINTENANCE_MODE_INACTIVE", // "mail_type": "MAINTENANCE_MODE_INACTIVE",
// "mail_subject": this.state.subjectMailNonActive, // "mail_subject": "TIA 4.0 is Back",
// "mail_body": this.state.mailcontentModeNonActive, // "mail_body": "",
// "mail_status": this.state.mailStatusNonActive // "mail_status": 0
// } // }
// ] // ]
"maintenance_mail": [
{
"mail_type": "MAINTENANCE_MODE_ACTIVE",
"mail_subject": this.state.subjectMailActive,
"mail_body": this.state.mailcontentModeActive,
"mail_status": this.state.mailStatusActive
},
{
"mail_type": "MAINTENANCE_MODE_INACTIVE",
"mail_subject": this.state.subjectMailNonActive,
"mail_body": this.state.mailcontentModeNonActive,
"mail_status": this.state.mailStatusNonActive
}
]
} }
console.log(payload); console.log(payload);
api.create().updateMaintenanceMode(payload).then((response) => { api.create().updateMaintenanceMode(payload).then((response) => {
......
This diff is collapsed.
...@@ -1461,7 +1461,7 @@ export default class RollingOutlook extends Component { ...@@ -1461,7 +1461,7 @@ export default class RollingOutlook extends Component {
if (!this.state.selectReport.includes(item[4])) { if (!this.state.selectReport.includes(item[4])) {
checkAll.push(item[4]) checkAll.push(item[4])
} }
} }
}) })
console.log(checkAll); console.log(checkAll);
this.setState({ selectReport: checkAll, isCheckAll: true }) this.setState({ selectReport: checkAll, isCheckAll: true })
...@@ -1522,19 +1522,12 @@ export default class RollingOutlook extends Component { ...@@ -1522,19 +1522,12 @@ export default class RollingOutlook extends Component {
}) })
} }
componentDidUpdate = (prevProps, prevState) => { async handleGenerateReport(data) {
if (this.state.selectReport.length > 0 && (this.state.arrayReport.length == this.state.selectReport.length)) {
setTimeout(() => {
this.handleZip()
}, 200);
}
}
handleGenerateReport(data) {
let { selectReport, rollingOutlookID, company, periode, month, downloadedFileReportId, quarter } = this.state let { selectReport, rollingOutlookID, company, periode, month, downloadedFileReportId, quarter } = this.state
let a = []
if (selectReport.length > 0) { if (selectReport.length > 0) {
selectReport.map(async (items) => { let result = []
console.log('mulai hit')
for (const items of selectReport) {
let urlReport = items === 14 ? "profit_loss" : items === 15 ? "tax_planning" : items === 16 ? "balance_sheet" : items === 17 ? "cash_flow" : items === 37 ? "cat" : null let urlReport = items === 14 ? "profit_loss" : items === 15 ? "tax_planning" : items === 16 ? "balance_sheet" : items === 17 ? "cash_flow" : items === 37 ? "cat" : null
let datas = data.findIndex((val) => val[4] == items) let datas = data.findIndex((val) => val[4] == items)
let report = data[datas] let report = data[datas]
...@@ -1542,72 +1535,25 @@ export default class RollingOutlook extends Component { ...@@ -1542,72 +1535,25 @@ export default class RollingOutlook extends Component {
let res = await fetch( let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/${urlReport}/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${rollingOutlookID === null ? "" : rollingOutlookID}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&quartal=${quarter.value}&&download_file_report_id=${downloadedFileReportId}` `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/${urlReport}/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${rollingOutlookID === null ? "" : rollingOutlookID}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&quartal=${quarter.value}&&download_file_report_id=${downloadedFileReportId}`
) )
console.log(res);
if (res.status === 200) { if (res.status === 200) {
this.setState({ arrayReport: [...this.state.arrayReport, items] }) result = [...result, res];
} }
}
// if (items === 14) { console.log('ini result', result);
// let datas = data.findIndex((val) => val[4] == items) // every untuk cek ke setiap result di dalam array
// let report = data[datas] if (result.every((e) => e.status == 200)) {
// let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/profit_loss/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${rollingOutlookID}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&quartal=${quarter.value}&&download_file_report_id=${downloadedFileReportId}` this.handleZip();
// let res = await fetch( }
// `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/profit_loss/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${rollingOutlookID === null ? "" : rollingOutlookID}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&quartal=${quarter.value}&&download_file_report_id=${downloadedFileReportId}`
// )
// if (res.status === 200) {
// this.setState({ arrayReport: [...this.state.arrayReport, items] })
// }
// } else if (items === 15) {
// let datas = data.findIndex((val) => val[4] == items)
// let report = data[datas]
// let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/tax_planning/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${rollingOutlookID}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&quartal=${quarter.value}&&download_file_report_id=${downloadedFileReportId}`
// let res = await fetch(
// `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/tax_planning/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${rollingOutlookID === null ? "" : rollingOutlookID}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&quartal=${quarter.value}&&download_file_report_id=${downloadedFileReportId}`
// )
// console.log(res);
// if (res.status === 200) {
// this.setState({ arrayReport: [...this.state.arrayReport, items] })
// }
// } else if (items === 16) {
// let datas = data.findIndex((val) => val[4] == items)
// let report = data[datas]
// let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/balance_sheet/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${rollingOutlookID}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&quartal=${quarter.value}&&download_file_report_id=${downloadedFileReportId}`
// let res = await fetch(
// `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/balance_sheet/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${rollingOutlookID === null ? "" : rollingOutlookID}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&quartal=${quarter.value}&&download_file_report_id=${downloadedFileReportId}`
// )
// console.log(res);
// if (res.status === 200) {
// this.setState({ arrayReport: [...this.state.arrayReport, items] })
// }
// } else if (items === 17) {
// let datas = data.findIndex((val) => val[4] == items)
// let report = data[datas]
// let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${rollingOutlookID}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&quartal=${quarter.value}&&download_file_report_id=${downloadedFileReportId}`
// let res = await fetch(
// `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${rollingOutlookID === null ? "" : rollingOutlookID}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&quartal=${quarter.value}&&download_file_report_id=${downloadedFileReportId}`
// )
// if (res.status === 200) {
// this.setState({ arrayReport: [...this.state.arrayReport, items] })
// }
// } else if (items === 37) {
// let datas = data.findIndex((val) => val[4] == items)
// let report = data[datas]
// let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cat/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${rollingOutlookID}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&quartal=${quarter.value}&&download_file_report_id=${downloadedFileReportId}`
// let res = await fetch(
// `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cat/rolling_outlook/export_rolling_outlook?rolling_outlook_id=${rollingOutlookID === null ? "" : rollingOutlookID}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&quartal=${quarter.value}&&download_file_report_id=${downloadedFileReportId}`
// )
// if (res.status === 200) {
// this.setState({ arrayReport: [...this.state.arrayReport, items] })
// }
// }
})
} else { } else {
alert("Anda harus memilih report yang ingin di download terlebih dahulu!") alert("Anda harus memilih report yang ingin di download terlebih dahulu!")
} }
} }
async handleZip() { async handleZip() {
console.log('mulai zip')
api.create().createZipReport(this.state.downloadedFileReportId).then((response) => { api.create().createZipReport(this.state.downloadedFileReportId).then((response) => {
console.log(response) console.log(response)
if (response.data) { if (response.data) {
...@@ -2656,7 +2602,7 @@ export default class RollingOutlook extends Component { ...@@ -2656,7 +2602,7 @@ export default class RollingOutlook extends Component {
<div className="test app-popup-show"> <div className="test app-popup-show">
<div className="popup-content border-radius" style={{ background: '#D9D9D9', borderRadius: 10, width: 609, height: 276 }}> <div className="popup-content border-radius" style={{ background: '#D9D9D9', borderRadius: 10, width: 609, height: 276 }}>
<div> <div>
<div style={{ justifyContent: 'center', fontSize: 20, color: '#33508B', margin: '70px 20px' }}>Rolling Outlook {this.state.company.company_name} {this.state.periode.periode} In Progress Download, silahkan cek status di menu <b>Progress Download</b></div> <div style={{ justifyContent: 'center', fontSize: 20, color: '#33508B', margin: '70px 20px' }}>Rolling Outlook {this.state.company.company_name} {this.state.periode.periode} In Progress Download, silahkan cek status di menu <b>Download Report</b></div>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}> <div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<button <button
className="button" className="button"
......
...@@ -152,8 +152,8 @@ const arraySide = [ ...@@ -152,8 +152,8 @@ const arraySide = [
}, },
{ {
img: Images.outlookperformance, img: Images.outlookperformance,
label: 'Download Files', label: 'Download Report',
path: 'download-files', path: 'download-report',
subItem: null subItem: null
}, },
] ]
......
...@@ -136,7 +136,7 @@ const routes = [ ...@@ -136,7 +136,7 @@ const routes = [
main: MaintenanceMode main: MaintenanceMode
}, },
{ {
path: "/home/download-files", path: "/home/download-report",
main: DownloadReport main: DownloadReport
}, },
{ {
......
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