Commit c60743f3 authored by ardiansyah's avatar ardiansyah

Merge branch 'ENV-DEV' into 'BACKUP-DEV'

Env dev

See merge request !1951
parents 26f0ff1f 3966ea81
...@@ -76,7 +76,6 @@ export default class OperatingIndicatorMR extends Component { ...@@ -76,7 +76,6 @@ export default class OperatingIndicatorMR extends Component {
visibleAlertSave: false visibleAlertSave: false
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
this.fileHandlerSimulasi = this.fileHandlerSimulasi.bind(this);
} }
componentDidMount() { componentDidMount() {
...@@ -428,46 +427,6 @@ export default class OperatingIndicatorMR extends Component { ...@@ -428,46 +427,6 @@ export default class OperatingIndicatorMR extends Component {
}); });
} }
fileHandlerSimulasi = (event) => {
let fileObj = event
ExcelRenderer(fileObj, (err, resp) => {
console.log(resp)
if (err) {
// // console.log(err);
}
else {
let isi = resp.rows.slice(3)
// // console.log(isi);
let payload = []
let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/;
isi.map((i, index) => {
if (i.length > 0) {
payload.push({
order: i[0] === undefined ? "" : String(i[0]).trim(),
item_report_id: i[1] === undefined ? "" : String(i[1]).trim(),
item_report: i[2] === undefined ? "" : String(i[2]).trim(),
uom: i[3] === undefined ? "" : String(i[3]).trim(),
actual: i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(),
mtd_vs_mb: i[5] === undefined ? "" : String(i[5]).trim(),
mtd_vs_rb: i[6] === undefined ? "" : String(i[6]).trim(),
})
}
})
let body = {
company_id: this.props.data.company.company_id,
periode: this.props.data.periode,
report_id: this.props.data.report_id,
months: this.props.months,
status: 'submitted',
monthly_report: payload
}
console.log(body)
console.log(JSON.stringify(body));
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[0][0] })
}
});
}
checkUpload() { checkUpload() {
let payload = { let payload = {
...this.state.payload, ...this.state.payload,
...@@ -538,32 +497,6 @@ export default class OperatingIndicatorMR extends Component { ...@@ -538,32 +497,6 @@ export default class OperatingIndicatorMR extends Component {
}) })
} }
uploadSimulasi() {
let payload = {
...this.state.payload,
currency_id: this.state.defaultCurrencyUpload?.id
}
this.setState({ loading: true, dataTable: [] })
console.log(payload)
api.create().uploadSimulasiMROI(payload).then(response => {
console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
this.props.onClickClose()
this.props.getReport()
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
} else {
this.setState({ alert: true, messageAlert: 'Error saving data. Please try again', tipeAlert: 'error', loading: false })
}
})
}
uploadOI(type) { uploadOI(type) {
let data = [] let data = []
// console.log(this.state.dataTable) // console.log(this.state.dataTable)
...@@ -1767,21 +1700,6 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1767,21 +1700,6 @@ export default class OperatingIndicatorMR extends Component {
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
<a data-tip={'Upload Simulasi'} data-for="upload">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginRight: 5
}}
onClick={() => this.setState({ visibleUploadSimulasi: true, buttonDraft: true })}
>
<img src={Images.simulasiUpload} style={{ width: 40, height: 40, marginRight: 3 }} />
</button>
</a>
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
{this.state.get_for == 'edit' && (this.props.permission.create || this.props.permission.edit) && <a data-tip={'Download Template'} data-for="template"> {this.state.get_for == 'edit' && (this.props.permission.create || this.props.permission.edit) && <a data-tip={'Download Template'} data-for="template">
<button <button
style={{ style={{
...@@ -2137,47 +2055,6 @@ export default class OperatingIndicatorMR extends Component { ...@@ -2137,47 +2055,6 @@ export default class OperatingIndicatorMR extends Component {
</div> </div>
)} )}
{this.state.visibleUploadSimulasi && (
<div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
<div className="popup-panel grid grid-2x main-color" style={{ height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
<div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
<div className="popup-title">
<span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Upload File Simulasi</span>
</div>
</div>
<div className="col-2 content-right" style={{ maxWidth: "inherit", alignSelf: 'center' }}>
<button
type="button"
className="btn btn-circle btn-white"
onClick={() => this.setState({ visibleUploadSimulasi: false })}
>
<img src={Images.close} />
</button>
</div>
</div>
<div style={{ padding: '25px 30px' }}>
<UploadFile
type={this.state.uploadStatusSimulasi}
percentage={this.state.percentageSimulasi}
result={this.state.resultSimulasi}
acceptedFiles={["xlsx"]}
onHandle={(dt) => {
this.fileHandlerSimulasi(dt)
this.setState({ uploadStatusSimulasi: 'idle', percentageSimulasi: '0' })
}}
onUpload={() => {
String(this.state.judulColumn).includes("TEMPLATE") && String(this.state.judulColumn).includes("UPLOAD") && String(this.state.judul).includes("MONTHLY") && String(this.state.judul).includes("REPORT") && String(this.state.judul).includes("OPERATING") && String(this.state.judul).includes("INDICATOR") ?
this.uploadSimulasi() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}}
/>
</div>
<div style={{ padding: '0px 30px 29px', fontSize: 17, color: 'red' }}><b>Warning:</b> Valid currency for uploading data is <b>{this.props.defaultCurrency.id == 1 ? "IDR" : "USD"}</b></div>
</div>
</div>
)}
{this.state.visibleAlertSave && ( {this.state.visibleAlertSave && (
<div className="test app-popup-show"> <div className="test app-popup-show">
<div className="popup-content border-radius" style={{ background: '#FFF27D', borderRadius: 10, width: 715, height: 238 }}> <div className="popup-content border-radius" style={{ background: '#FFF27D', borderRadius: 10, width: 715, height: 238 }}>
......
This diff is collapsed.
...@@ -339,10 +339,10 @@ export default class CashFlow extends Component { ...@@ -339,10 +339,10 @@ export default class CashFlow extends Component {
}) })
console.log(listCF) console.log(listCF)
this.createCashFlow(listCF, trigger) this.createCashFlow(listCF)
} }
createCashFlow(dbcf, trigger) { createCashFlow(dbcf) {
let payload = { let payload = {
"outlook_pa_id": this.props.outlook_pa_id, "outlook_pa_id": this.props.outlook_pa_id,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
...@@ -355,39 +355,6 @@ export default class CashFlow extends Component { ...@@ -355,39 +355,6 @@ export default class CashFlow extends Component {
} }
console.log(dbcf) console.log(dbcf)
console.log(JSON.stringify(payload)) console.log(JSON.stringify(payload))
if (trigger === 'simulasi') {
api.create().createSimulasiOLPACF(payload).then(response => {
console.log(payload);
console.log(response);
// console.log(JSON.stringify(payload))
if (response.data) {
if (response.data.status === "success") {
this.props.onClickClose()
this.props.getReport()
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleDoubleClick: 0 }, () => {
document.body.style.overflow = 'unset';
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
this.props.onClickClose()
this.props.getReport()
})
}
// else {
// this.setState({ loading: false, handleDoubleClick: 0 }, () => {
// this.props.onClickClose()
// this.props.getReport()
// })
// }
} else {
this.setState({ loading: false, handleDoubleClick: 0 })
}
})
} else {
api.create().createCFOLPA(payload).then(response => { api.create().createCFOLPA(payload).then(response => {
console.log(payload); console.log(payload);
console.log(response); console.log(response);
...@@ -419,7 +386,6 @@ export default class CashFlow extends Component { ...@@ -419,7 +386,6 @@ export default class CashFlow extends Component {
this.setState({ loading: false, handleDoubleClick: 0 }) this.setState({ loading: false, handleDoubleClick: 0 })
} }
}) })
}
this.props.onClickClose() this.props.onClickClose()
this.props.getReport() this.props.getReport()
} }
...@@ -1831,7 +1797,7 @@ export default class CashFlow extends Component { ...@@ -1831,7 +1797,7 @@ export default class CashFlow extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[18]).toFixed(1)} // value={Number(tableMeta.rowData[18]).toFixed(1)}
value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[18]).toFixed(1) : Number(handleTotal(tableMeta)).toFixed(1)} value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[18]).toFixed(1) : Number(handleTotal(tableMeta)).toFixed(1)}
/> />
</span> </span>
...@@ -2267,29 +2233,6 @@ export default class CashFlow extends Component { ...@@ -2267,29 +2233,6 @@ export default class CashFlow extends Component {
</button> </button>
</div> </div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
type="button"
// disabled={this.state.buttonError}
onClick={() =>
// this.state.buttonError ?
// this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
// :
this.state.handleDoubleClick == 1 ? null :
this.setState({ handleDoubleClick: 1 }, () => {
this.olahDataCashFlow(dataTable2, 'simulasi')
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 15
}}
>
<div style={{ backgroundColor: '#cd5c5c', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save Data Simulasi</Typography>
</div>
</button>
{this.state.viewOnly && {this.state.viewOnly &&
<button <button
type="button" type="button"
......
...@@ -578,8 +578,7 @@ export default class OutlookPA extends Component { ...@@ -578,8 +578,7 @@ export default class OutlookPA extends Component {
}) })
} }
getOutlookPAID(type, trigger) { getOutlookPAID(type) {
this.setState({ loading: true }) this.setState({ loading: true })
let payload = { let payload = {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
...@@ -620,7 +619,7 @@ export default class OutlookPA extends Component { ...@@ -620,7 +619,7 @@ export default class OutlookPA extends Component {
this.getLatestPeriodSubmit() this.getLatestPeriodSubmit()
if (type != undefined && type == 'PL') { if (type != undefined && type == 'PL') {
// this.getCashFlow(type) // this.getCashFlow(type)
this.getPL(type, trigger) this.getPL(type)
} else if (type != undefined && type == 'BS') { } else if (type != undefined && type == 'BS') {
let bodyRatioOLPA = { let bodyRatioOLPA = {
"report": 'ratio', "report": 'ratio',
...@@ -1006,7 +1005,7 @@ export default class OutlookPA extends Component { ...@@ -1006,7 +1005,7 @@ export default class OutlookPA extends Component {
} }
getPL(type, trigger) { getPL(type) {
let PLID = null let PLID = null
let payloadID = { let payloadID = {
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
...@@ -1116,7 +1115,7 @@ export default class OutlookPA extends Component { ...@@ -1116,7 +1115,7 @@ export default class OutlookPA extends Component {
}) })
// console.log(dataTable) // console.log(dataTable)
this.setState({ dbPL: dataTable }, () => { this.setState({ dbPL: dataTable }, () => {
this.olahDataPL(this.state.dbPL, type, trigger) this.olahDataPL(this.state.dbPL, type)
}) })
} else { } else {
this.setState({ dbPL: [], previewTable: false, previewDownload: false }) this.setState({ dbPL: [], previewTable: false, previewDownload: false })
...@@ -1355,7 +1354,7 @@ export default class OutlookPA extends Component { ...@@ -1355,7 +1354,7 @@ export default class OutlookPA extends Component {
return total return total
} }
olahDataPL(dbPL, type, trigger) { olahDataPL(dbPL, type) {
dbPL.map((item, index) => { dbPL.map((item, index) => {
if (item[0] == 5 || item[0] == 6 || item[0] == 7) { if (item[0] == 5 || item[0] == 6 || item[0] == 7) {
item[7].value = this.handleValueFormulaDBPL(index, item[7], item, 7) item[7].value = this.handleValueFormulaDBPL(index, item[7], item, 7)
...@@ -1375,11 +1374,11 @@ export default class OutlookPA extends Component { ...@@ -1375,11 +1374,11 @@ export default class OutlookPA extends Component {
} }
}) })
this.setState({ dbPL }, () => { this.setState({ dbPL }, () => {
this.payloadPL(type, trigger) this.payloadPL(type)
}) })
} }
payloadPL(type, trigger) { payloadPL(type) {
let listPL = [] let listPL = []
// console.log(this.state.dbPL) // console.log(this.state.dbPL)
this.state.dbPL.map((item, index) => { this.state.dbPL.map((item, index) => {
...@@ -1474,13 +1473,13 @@ export default class OutlookPA extends Component { ...@@ -1474,13 +1473,13 @@ export default class OutlookPA extends Component {
if (type != undefined) { if (type != undefined) {
if (type == 'PL') { if (type == 'PL') {
console.log('tarik sis') console.log('tarik sis')
this.createDBPL(trigger) this.createDBPL()
} }
} }
}) })
} }
createDBPL(trigger) { createDBPL() {
let payload = { let payload = {
// "submission_id": this.state.submissionID, // "submission_id": this.state.submissionID,
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
...@@ -1493,18 +1492,11 @@ export default class OutlookPA extends Component { ...@@ -1493,18 +1492,11 @@ export default class OutlookPA extends Component {
} }
console.log(this.state.dbPL) console.log(this.state.dbPL)
// console.log(JSON.stringify(payload)) // console.log(JSON.stringify(payload))
if (trigger === 'simulasiPL') {
api.create().createDBPLOLPASimulasi(payload).then((res) => {
console.log(res)
this.setState({ loading: false })
})
} else {
api.create().createDBPLOLPA(payload).then((res) => { api.create().createDBPLOLPA(payload).then((res) => {
console.log(res) console.log(res)
this.setState({ loading: false }) this.setState({ loading: false })
}) })
} }
}
handleApproveAdmin() { handleApproveAdmin() {
this.setState({ visibleApproveSuperadmin: true }) this.setState({ visibleApproveSuperadmin: true })
......
This diff is collapsed.
This diff is collapsed.
...@@ -342,7 +342,7 @@ export default class CashFlow extends Component { ...@@ -342,7 +342,7 @@ export default class CashFlow extends Component {
this.createCashFlow(listCF, trigger) this.createCashFlow(listCF, trigger)
} }
createCashFlow(dbcf, trigger) { createCashFlow(dbcf) {
let payload = { let payload = {
"rolling_outlook_id": this.props.rollingOutlookID, "rolling_outlook_id": this.props.rollingOutlookID,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
...@@ -355,37 +355,6 @@ export default class CashFlow extends Component { ...@@ -355,37 +355,6 @@ export default class CashFlow extends Component {
} }
console.log(dbcf) console.log(dbcf)
console.log(JSON.stringify(payload)) console.log(JSON.stringify(payload))
if (trigger === 'simulasi') {
api.create().createRollingOutlookCFSimulasi(payload).then(response => {
console.log(payload);
console.log(response);
// console.log(JSON.stringify(payload))
if (response.data) {
if (response.data.status === "success") {
this.props.onClickClose()
this.props.refresh()
} else {
if (response.data?.message == "Please Set Up Rate Currency First") {
this.setState({ visibleAlertSave: true, loading: false })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleDoubleClick: 0 }, () => {
document.body.style.overflow = 'unset';
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
this.props.onClickClose()
this.props.refresh()
})
}
}
} else {
this.setState({ loading: false, handleDoubleClick: 0 })
}
})
} else {
api.create().createRollingOutlookCF(payload).then(response => { api.create().createRollingOutlookCF(payload).then(response => {
console.log(payload); console.log(payload);
console.log(response); console.log(response);
...@@ -421,7 +390,6 @@ export default class CashFlow extends Component { ...@@ -421,7 +390,6 @@ export default class CashFlow extends Component {
this.setState({ loading: false, handleDoubleClick: 0 }) this.setState({ loading: false, handleDoubleClick: 0 })
} }
}) })
}
this.props.onClickClose() this.props.onClickClose()
this.props.refresh() this.props.refresh()
} }
...@@ -2250,29 +2218,6 @@ export default class CashFlow extends Component { ...@@ -2250,29 +2218,6 @@ export default class CashFlow extends Component {
</button> </button>
</div> </div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
type="button"
// disabled={this.state.buttonError}
onClick={() =>
// this.state.buttonError ?
// this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
// :
this.state.handleDoubleClick == 1 ? null :
this.setState({ handleDoubleClick: 1 }, () => {
this.olahDataCashFlow(dataTable2, 'simulasi')
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 15
}}
>
<div style={{ backgroundColor: '#cd5c5c', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save Data Simulasi</Typography>
</div>
</button>
{this.state.viewOnly && {this.state.viewOnly &&
<button <button
type="button" type="button"
......
...@@ -606,7 +606,7 @@ export default class RollingOutlook extends Component { ...@@ -606,7 +606,7 @@ export default class RollingOutlook extends Component {
}) })
} }
getRollingOutlookID(type, trigger) { getRollingOutlookID(type) {
this.setState({ loading: true }) this.setState({ loading: true })
let payload = { let payload = {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
...@@ -653,7 +653,7 @@ export default class RollingOutlook extends Component { ...@@ -653,7 +653,7 @@ export default class RollingOutlook extends Component {
this.getLatestPeriodSubmit() this.getLatestPeriodSubmit()
if (type != undefined && type == 'PL') { if (type != undefined && type == 'PL') {
// this.getCashFlow(type) // this.getCashFlow(type)
this.getPL(type, trigger) this.getPL(type)
} else if (type != undefined && type == 'BS') { } else if (type != undefined && type == 'BS') {
let bodyRatioBs = { let bodyRatioBs = {
"report": 'ratio', "report": 'ratio',
...@@ -663,17 +663,10 @@ export default class RollingOutlook extends Component { ...@@ -663,17 +663,10 @@ export default class RollingOutlook extends Component {
"quartal": this.state.quarter.value, "quartal": this.state.quarter.value,
"currency_id": this.state.defaultCurrency.id "currency_id": this.state.defaultCurrency.id
} }
if (trigger === "simulasiPL") {
api.create().triggerRatioROSimulasi(bodyRatioBs).then((res) => {
console.log(res)
this.setState({ loading: false })
})
} else {
api.create().triggerRatioRO(bodyRatioBs).then((res) => { api.create().triggerRatioRO(bodyRatioBs).then((res) => {
console.log(res) console.log(res)
this.setState({ loading: false }) this.setState({ loading: false })
}) })
}
} else { } else {
this.setState({ loading: false }) this.setState({ loading: false })
} }
...@@ -1024,7 +1017,7 @@ export default class RollingOutlook extends Component { ...@@ -1024,7 +1017,7 @@ export default class RollingOutlook extends Component {
} }
} }
getPL(type, trigger) { getPL(type) {
let PLID = null let PLID = null
let payloadID = { let payloadID = {
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
...@@ -1135,7 +1128,7 @@ export default class RollingOutlook extends Component { ...@@ -1135,7 +1128,7 @@ export default class RollingOutlook extends Component {
}) })
// console.log(dataTable) // console.log(dataTable)
this.setState({ dbPL: dataTable }, () => { this.setState({ dbPL: dataTable }, () => {
this.olahDataPL(this.state.dbPL, type, trigger) this.olahDataPL(this.state.dbPL, type)
}) })
} else { } else {
this.setState({ dbPL: [], previewTable: false, previewDownload: false }) this.setState({ dbPL: [], previewTable: false, previewDownload: false })
...@@ -1374,7 +1367,7 @@ export default class RollingOutlook extends Component { ...@@ -1374,7 +1367,7 @@ export default class RollingOutlook extends Component {
return total return total
} }
olahDataPL(dbPL, type, trigger) { olahDataPL(dbPL, type) {
dbPL.map((item, index) => { dbPL.map((item, index) => {
if (item[0] == 5 || item[0] == 6 || item[0] == 7) { if (item[0] == 5 || item[0] == 6 || item[0] == 7) {
item[7].value = this.handleValueFormulaDBPL(index, item[7], item, 7) item[7].value = this.handleValueFormulaDBPL(index, item[7], item, 7)
...@@ -1394,11 +1387,11 @@ export default class RollingOutlook extends Component { ...@@ -1394,11 +1387,11 @@ export default class RollingOutlook extends Component {
} }
}) })
this.setState({ dbPL }, () => { this.setState({ dbPL }, () => {
this.payloadPL(type, trigger) this.payloadPL(type)
}) })
} }
payloadPL(type, trigger) { payloadPL(type) {
let listPL = [] let listPL = []
// console.log(this.state.dbPL) // console.log(this.state.dbPL)
this.state.dbPL.map((item, index) => { this.state.dbPL.map((item, index) => {
...@@ -1493,13 +1486,13 @@ export default class RollingOutlook extends Component { ...@@ -1493,13 +1486,13 @@ export default class RollingOutlook extends Component {
if (type != undefined) { if (type != undefined) {
if (type == 'PL') { if (type == 'PL') {
console.log('tarik sis') console.log('tarik sis')
this.createDBPL(trigger) this.createDBPL()
} }
} }
}) })
} }
createDBPL(trigger) { createDBPL() {
let payload = { let payload = {
// "submission_id": this.state.submissionID, // "submission_id": this.state.submissionID,
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
...@@ -1513,18 +1506,11 @@ export default class RollingOutlook extends Component { ...@@ -1513,18 +1506,11 @@ export default class RollingOutlook extends Component {
} }
console.log(this.state.dbPL) console.log(this.state.dbPL)
// console.log(JSON.stringify(payload)) // console.log(JSON.stringify(payload))
if (trigger === 'simulasiPL') {
api.create().createDBPLROSimulasi(payload).then((res) => {
console.log(res)
this.setState({ loading: false })
})
} else {
api.create().createDBPLRO(payload).then((res) => { api.create().createDBPLRO(payload).then((res) => {
console.log(res) console.log(res)
this.setState({ loading: false }) this.setState({ loading: false })
}) })
} }
}
handleApproveAdmin() { handleApproveAdmin() {
this.setState({ visibleApproveSuperadmin: true }) this.setState({ visibleApproveSuperadmin: true })
......
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