Commit 4ed7df1f authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'master' into 'didam'

# Conflicts:
#   src/api/index.js
bismillah
parents 831c4705 7d5fa451
...@@ -219,6 +219,21 @@ const create = (type = "") => { ...@@ -219,6 +219,21 @@ const create = (type = "") => {
const getDashboard = (body) => api.get('transaction/get_dashboard') const getDashboard = (body) => api.get('transaction/get_dashboard')
const historyApproval = (body) => api.post('transaction/master_budget/history_approval', body) const historyApproval = (body) => api.post('transaction/master_budget/history_approval', body)
//OUTLOOK PA
const getOutlookPAID = (body) => api.post('transaction/outlook_pa/get_outlook_pa_id', body)
const getLastPeriodOLPA = (idCompany) => api.get(`/transaction/outlook_pa/get_last_periode/${idCompany}`)
const getCompanySubmittedOLPA = (body) => api.post('transaction/outlook_pa/get_company_submitted', body)
const getRevisionOLPA = (body) => api.post('transaction/outlook_pa/get_revision', body)
const historyApprovalOLPA = (body) => api.post('transaction/outlook_pa/history_approval', body)
const getSubmitOLPA = (body) => api.post('transaction/outlook_pa/get_latest_periode_submit', body)
const getOLPAAtt = (body) => api.post('transaction/outlook_pa/get_report_attachment', body)
const submitOLPA = (body) => api.post('transaction/outlook_pa/submit_outlook_pa', body)
const getLastestUpdateOLPA = (body) => api.post('transaction/outlook_pa/get_latest_update', body)
const createReportOLPA = (body) => api.post('transaction/outlook_pa/create_outlook_report', body)
const checkUploadOLPA = (body) => api.post('transaction/outlook_pa/check_import', body)
const validateSubmitReportOLPA = (body) => api.post('transaction/outlook_pa/validate_save', body)
const uploadOLPA = (body) => api.post('transaction/outlook_pa/import_outlook_pa')
//Template //Template
const downloadTemplate = (fileName, fileType) => api.get(`attachment/download_file?fileName=${fileName}&&fileType=${fileType}`) const downloadTemplate = (fileName, fileType) => api.get(`attachment/download_file?fileName=${fileName}&&fileType=${fileType}`)
...@@ -375,7 +390,20 @@ const create = (type = "") => { ...@@ -375,7 +390,20 @@ const create = (type = "") => {
getLastPeriod, getLastPeriod,
getSubmitMasterBudget, getSubmitMasterBudget,
createPeriodeRevision, createPeriodeRevision,
getLastestUpdateOI getLastestUpdateOI,
getOutlookPAID,
getLastPeriodOLPA,
getCompanySubmittedOLPA,
getRevisionOLPA,
historyApprovalOLPA,
getSubmitOLPA,
getOLPAAtt,
submitOLPA,
getLastestUpdateOLPA,
createReportOLPA,
checkUploadOLPA,
uploadOLPA,
validateSubmitReportOLPA
} }
} }
......
...@@ -614,7 +614,7 @@ export default class BudgetTahunan extends Component { ...@@ -614,7 +614,7 @@ export default class BudgetTahunan extends Component {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
a.href = url; a.href = url;
a.download = 'Master Budget Balance Sheet.xlsx'; a.download = 'Master Budget Attachment.xlsx';
a.click(); a.click();
} }
} }
...@@ -984,7 +984,7 @@ export default class BudgetTahunan extends Component { ...@@ -984,7 +984,7 @@ export default class BudgetTahunan extends Component {
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
<Typography style={{ fontSize: '16px', color: '#4b4b4b', fontWeight: 'bold' }}>Attachment: </Typography> <Typography style={{ fontSize: '16px', color: '#4b4b4b', fontWeight: 'bold' }}>Attachment: </Typography>
</div> </div>
{!this.state.isApprover && (this.state.lastStatus == 'SUBMIT' && this.state.lastStatus == 'REVISION') && ( {!this.state.isApprover && (this.state.lastStatus === 'SUBMIT' && this.state.lastStatus === 'REVISION') && (
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
<button <button
style={{ style={{
...@@ -1030,7 +1030,7 @@ export default class BudgetTahunan extends Component { ...@@ -1030,7 +1030,7 @@ export default class BudgetTahunan extends Component {
: null : null
} }
</div> </div>
{!this.state.isApprover && (this.state.lastStatus == 'SUBMIT' && this.state.lastStatus == 'REVISION') && ( {!this.state.isApprover && (this.state.lastStatus === 'SUBMIT' && this.state.lastStatus === 'REVISION') && (
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
{this.state.listAttachment.length > 0 ? {this.state.listAttachment.length > 0 ?
this.state.listAttachment.map((item) => { this.state.listAttachment.map((item) => {
......
...@@ -2,7 +2,6 @@ import React, { Component } from 'react'; ...@@ -2,7 +2,6 @@ import React, { Component } from 'react';
import { Typography, Paper, TextField, MenuItem, Select, FormControlLabel, Snackbar, withStyles, createMuiTheme, MuiThemeProvider, Checkbox, Input } from '@material-ui/core'; import { Typography, Paper, TextField, MenuItem, Select, FormControlLabel, Snackbar, withStyles, createMuiTheme, MuiThemeProvider, Checkbox, Input } from '@material-ui/core';
import MUIDataTable from 'mui-datatables'; import MUIDataTable from 'mui-datatables';
import Images from '../assets/Images'; import Images from '../assets/Images';
import BalanceSheet from './OutlookPA/BalanceSheet';
import api from '../api'; import api from '../api';
import Autocomplete from '@material-ui/lab/Autocomplete'; import Autocomplete from '@material-ui/lab/Autocomplete';
import MuiAlert from '@material-ui/lab/Alert'; import MuiAlert from '@material-ui/lab/Alert';
...@@ -15,6 +14,7 @@ import { format } from 'date-fns'; ...@@ -15,6 +14,7 @@ import { format } from 'date-fns';
import Constant from '../library/Constant'; import Constant from '../library/Constant';
import PropagateLoader from "react-spinners/PropagateLoader" import PropagateLoader from "react-spinners/PropagateLoader"
import { DatePicker } from '@material-ui/pickers'; import { DatePicker } from '@material-ui/pickers';
import BalanceSheetOLPA from './OutlookPA/BalanceSheetOLPA';
var ct = require("../library/CustomTable"); var ct = require("../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable());
...@@ -43,7 +43,7 @@ export default class OutlookPA extends Component { ...@@ -43,7 +43,7 @@ export default class OutlookPA extends Component {
alert: false, alert: false,
tipeAlert: '', tipeAlert: '',
messageAlert: '', messageAlert: '',
submissionID: null, outlook_pa_id: null,
isSubmit: false, isSubmit: false,
visibleTableHistory: false, visibleTableHistory: false,
isApprover: false, isApprover: false,
...@@ -91,7 +91,7 @@ export default class OutlookPA extends Component { ...@@ -91,7 +91,7 @@ export default class OutlookPA extends Component {
let body = { let body = {
"periode": this.state.periode.periode "periode": this.state.periode.periode
} }
api.create().getCompanySubmitted(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') {
...@@ -138,7 +138,7 @@ export default class OutlookPA extends Component { ...@@ -138,7 +138,7 @@ export default class OutlookPA extends Component {
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
"revision": this.state.revision.revision, "revision": this.state.revision.revision,
} }
api.create().getMasterBudgetAtt(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") {
...@@ -191,7 +191,7 @@ export default class OutlookPA extends Component { ...@@ -191,7 +191,7 @@ export default class OutlookPA extends Component {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"periode": this.state.periode.periode "periode": this.state.periode.periode
} }
api.create().getSubmitMasterBudget(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") {
...@@ -266,7 +266,7 @@ export default class OutlookPA extends Component { ...@@ -266,7 +266,7 @@ export default class OutlookPA extends Component {
} }
getLastPeriod() { getLastPeriod() {
api.create().getLastPeriod(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 }, () => {
...@@ -342,26 +342,26 @@ export default class OutlookPA extends Component { ...@@ -342,26 +342,26 @@ export default class OutlookPA extends Component {
getOptionLabel: (option) => option.revision, getOptionLabel: (option) => option.revision,
}; };
this.setState({ listRevision: defaultProps, revision: revisionData[0] }, () => { this.setState({ listRevision: defaultProps, revision: revisionData[0] }, () => {
this.getSubmission() this.getOutlookPAID()
}) })
} }
} }
}) })
} }
getSubmission() { getOutlookPAID() {
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,
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
"is_approver": this.state.isApprover "is_approver": this.state.isApprover
} }
api.create().getSubmission(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({
submissionID: response.data.data.submission_id, outlook_pa_id: response.data.data.outlook_pa_id,
submitter: response.data.data.submitter, submitter: response.data.data.submitter,
approverID: response.data.data.approve_id, pic: response.data.data.approver == null ? '' : response.data.data.approver, approverID: response.data.data.approve_id, pic: response.data.data.approver == null ? '' : response.data.data.approver,
lastStatus: response.data.data.last_status === null ? 'SUBMIT' : response.data.data.last_status, lastStatus: response.data.data.last_status === null ? 'SUBMIT' : response.data.data.last_status,
...@@ -382,7 +382,7 @@ export default class OutlookPA extends Component { ...@@ -382,7 +382,7 @@ export default class OutlookPA extends Component {
}) })
}) })
} else { } else {
this.setState({ submissionID: null, loading: false }) this.setState({ outlook_pa_id: null, loading: false })
} }
} }
}) })
...@@ -393,7 +393,7 @@ export default class OutlookPA extends Component { ...@@ -393,7 +393,7 @@ export default class OutlookPA extends Component {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"periode": this.state.periode.periode "periode": this.state.periode.periode
} }
api.create().historyApproval(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 => {
...@@ -420,7 +420,7 @@ export default class OutlookPA extends Component { ...@@ -420,7 +420,7 @@ export default class OutlookPA extends Component {
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.getOutlookPAID()
}) })
}) })
} }
...@@ -496,7 +496,7 @@ export default class OutlookPA extends Component { ...@@ -496,7 +496,7 @@ export default class OutlookPA extends Component {
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ visibleUpload: false }, () => { this.setState({ visibleUpload: false }, () => {
this.getSubmission() this.getOutlookPAID()
}) })
} }
} }
...@@ -507,7 +507,7 @@ export default class OutlookPA extends Component { ...@@ -507,7 +507,7 @@ export default class OutlookPA extends Component {
api.create().deleteAttachment(item.attachment_id).then(response => { api.create().deleteAttachment(item.attachment_id).then(response => {
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.getSubmission() this.getOutlookPAID()
} }
} }
}) })
...@@ -517,22 +517,22 @@ export default class OutlookPA extends Component { ...@@ -517,22 +517,22 @@ export default class OutlookPA extends Component {
this.setState({ alert: false }) this.setState({ alert: false })
} }
saveToMasterBudget(data) { saveToOLPA(data) {
this.setState({ loading: true }) this.setState({ loading: true })
// console.log(JSON.stringify(data)); // console.log(JSON.stringify(data));
api.create('UPLOAD').createSubmitReport(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.getSubmission() this.getOutlookPAID()
} else { } else {
this.setState({ loading: false }, () => { this.setState({ loading: false }, () => {
this.getSubmission() this.getOutlookPAID()
}) })
} }
} else { } else {
this.setState({ loading: false }, () => { this.setState({ loading: false }, () => {
this.getSubmission() this.getOutlookPAID()
}) })
} }
}) })
...@@ -542,10 +542,10 @@ export default class OutlookPA extends Component { ...@@ -542,10 +542,10 @@ export default class OutlookPA extends Component {
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/master_budget/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/master_budget/download_attachment?fileName=${fileurl}&&fileType=${fileType}` `https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/download_attachment?fileName=${fileurl}&&fileType=${fileType}`
) )
res = await res.blob() res = await res.blob()
this.setState({ loading: false }) this.setState({ loading: false })
...@@ -553,7 +553,7 @@ export default class OutlookPA extends Component { ...@@ -553,7 +553,7 @@ export default class OutlookPA extends Component {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
a.href = url; a.href = url;
a.download = 'Master Budget Balance Sheet.xlsx'; a.download = 'Outlook Perfromance Appraisal.xlsx';
a.click(); a.click();
} }
} }
...@@ -577,13 +577,13 @@ export default class OutlookPA extends Component { ...@@ -577,13 +577,13 @@ export default class OutlookPA extends Component {
}) })
if (canSubmit === true) { if (canSubmit === true) {
let body = { let body = {
submission_id: this.state.submissionID outlook_pa_id: this.state.outlook_pa_id
} }
api.create().submitMasterBudget(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.getSubmission() this.getOutlookPAID()
} }
} }
}) })
...@@ -905,7 +905,7 @@ export default class OutlookPA extends Component { ...@@ -905,7 +905,7 @@ export default class OutlookPA extends Component {
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
<Typography style={{ fontSize: '16px', color: '#4b4b4b', fontWeight: 'bold' }}>Attachment: </Typography> <Typography style={{ fontSize: '16px', color: '#4b4b4b', fontWeight: 'bold' }}>Attachment: </Typography>
</div> </div>
{!this.state.isApprover && (this.state.lastStatus !== 'SUBMITTED' && this.state.lastStatus !== 'APPROVED') && ( {!this.state.isApprover && (this.state.lastStatus === 'SUBMIT' && this.state.lastStatus === 'REVISION') && (
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
<button <button
style={{ style={{
...@@ -951,7 +951,7 @@ export default class OutlookPA extends Component { ...@@ -951,7 +951,7 @@ export default class OutlookPA extends Component {
: null : null
} }
</div> </div>
{!this.state.isApprover && (this.state.lastStatus !== 'SUBMITTED' && this.state.lastStatus !== 'APPROVED') && ( {!this.state.isApprover && (this.state.lastStatus === 'SUBMIT' && this.state.lastStatus === 'REVISION') && (
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
{this.state.listAttachment.length > 0 ? {this.state.listAttachment.length > 0 ?
this.state.listAttachment.map((item) => { this.state.listAttachment.map((item) => {
...@@ -1139,7 +1139,7 @@ export default class OutlookPA extends Component { ...@@ -1139,7 +1139,7 @@ export default class OutlookPA extends Component {
)} )}
{this.state.visibleBS && ( {this.state.visibleBS && (
<BalanceSheet <BalanceSheetOLPA
open={this.props.open} open={this.props.open}
report_id={this.state.report_id} report_id={this.state.report_id}
height={this.props.height} height={this.props.height}
...@@ -1147,10 +1147,10 @@ export default class OutlookPA extends Component { ...@@ -1147,10 +1147,10 @@ export default class OutlookPA extends Component {
company={this.state.company} company={this.state.company}
revision={this.state.revisionTable} revision={this.state.revisionTable}
periode={this.state.periode.periode} periode={this.state.periode.periode}
submissionID={this.state.submissionID} outlook_pa_id={this.state.outlook_pa_id}
saveToMasterBudget={this.saveToMasterBudget.bind(this)} saveToOLPA={this.saveToOLPA.bind(this)}
onClickClose={() => this.setState({ visibleBS: false, visibleOutlookPA: true })} onClickClose={() => this.setState({ visibleBS: false, visibleOutlookPA: true })}
getReport={this.getSubmission.bind(this)} getReport={this.getOutlookPAID.bind(this)}
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
prevRevision={this.state.prevRevision} prevRevision={this.state.prevRevision}
...@@ -1166,10 +1166,10 @@ export default class OutlookPA extends Component { ...@@ -1166,10 +1166,10 @@ export default class OutlookPA extends Component {
company={this.state.company} company={this.state.company}
revision={this.state.revisionTable} revision={this.state.revisionTable}
periode={this.state.periode.periode} periode={this.state.periode.periode}
submissionID={this.state.submissionID} outlook_pa_id={this.state.outlook_pa_id}
saveToMasterBudget={this.saveToMasterBudget.bind(this)} saveToOLPA={this.saveToOLPA.bind(this)}
onClickClose={() => this.setState({ visiblePL: false, visibleOutlookPA: true })} onClickClose={() => this.setState({ visiblePL: false, visibleOutlookPA: true })}
getReport={this.getSubmission.bind(this)} getReport={this.getOutlookPAID.bind(this)}
status={this.state.status} status={this.state.status}
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
...@@ -1186,10 +1186,10 @@ export default class OutlookPA extends Component { ...@@ -1186,10 +1186,10 @@ export default class OutlookPA extends Component {
company={this.state.company} company={this.state.company}
revision={this.state.revisionTable} revision={this.state.revisionTable}
periode={this.state.periode.periode} periode={this.state.periode.periode}
submissionID={this.state.submissionID} outlook_pa_id={this.state.outlook_pa_id}
saveToMasterBudget={this.saveToMasterBudget.bind(this)} saveToOLPA={this.saveToOLPA.bind(this)}
onClickClose={() => this.setState({ visibleTP: false, visibleOutlookPA: true })} onClickClose={() => this.setState({ visibleTP: false, visibleOutlookPA: true })}
getReport={this.getSubmission.bind(this)} getReport={this.getOutlookPAID.bind(this)}
status={this.state.status} status={this.state.status}
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -12,10 +12,10 @@ import ReportItems from '../container/MasterData/ReportItems' ...@@ -12,10 +12,10 @@ import ReportItems from '../container/MasterData/ReportItems'
import DashboardCAT from '../container/Laporan/DashboardCAT' import DashboardCAT from '../container/Laporan/DashboardCAT'
import BudgetTahunan from '../container/BudgetTahunan'; import BudgetTahunan from '../container/BudgetTahunan';
import RollingOutlook from '../container/RollingOutlook'; import RollingOutlook from '../container/RollingOutlook';
import OutlookPA from '../container/OutlookPA';
import OperatingIndicator from '../container/OprIndicator/OperatingIndicator' import OperatingIndicator from '../container/OprIndicator/OperatingIndicator'
import MonthlyReport from '../container/MonthlyReport'; import MonthlyReport from '../container/MonthlyReport';
import DocumentManagement from '../container/DocumentManagement/DocumentManagement'; import DocumentManagement from '../container/DocumentManagement/DocumentManagement';
import OutlookPA from '../container/OutlookPA';
const routes = [ const routes = [
{ {
...@@ -38,14 +38,14 @@ const routes = [ ...@@ -38,14 +38,14 @@ const routes = [
path: "/home/master-budget", path: "/home/master-budget",
main: BudgetTahunan main: BudgetTahunan
}, },
{
path: "/home/outlook-performance",
main: OutlookPA
},
{ {
path: "/home/rolling-outlook", path: "/home/rolling-outlook",
main: RollingOutlook main: RollingOutlook
}, },
{
path: "/home/outlook-performance",
main: OutlookPA
},
{ {
path: "/home/profile", path: "/home/profile",
main: Profile main: Profile
......
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