|
|
@ -15,18 +15,18 @@ import { HealthByBudget, HealthBySchedule } from './Components'; |
|
|
|
import { Link } from 'react-router-dom'; |
|
|
|
import { Link } from 'react-router-dom'; |
|
|
|
|
|
|
|
|
|
|
|
const DashboardBOD = (props) => { |
|
|
|
const DashboardBOD = (props) => { |
|
|
|
let role_id = '', user_id='',isLogin='',token=''; |
|
|
|
let role_id = '', user_id = '', isLogin = '', token = ''; |
|
|
|
if (props.location.state && props.location.state.role_id && props.location.state.user_id) { |
|
|
|
if (props.location.state && props.location.state.role_id && props.location.state.user_id) { |
|
|
|
role_id = props.location.state.role_id; |
|
|
|
role_id = props.location.state.role_id; |
|
|
|
user_id = props.location.state.user_id; |
|
|
|
user_id = props.location.state.user_id; |
|
|
|
token = props.location.state.token; |
|
|
|
token = props.location.state.token; |
|
|
|
isLogin = props.location.state.isLogin; |
|
|
|
isLogin = props.location.state.isLogin; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
role_id = localStorage.getItem("role_id"); |
|
|
|
role_id = localStorage.getItem("role_id"); |
|
|
|
user_id = localStorage.getItem("user_id"); |
|
|
|
user_id = localStorage.getItem("user_id"); |
|
|
|
token = localStorage.getItem("token"); |
|
|
|
token = localStorage.getItem("token"); |
|
|
|
isLogin = localStorage.getItem("isLogin"); |
|
|
|
isLogin = localStorage.getItem("isLogin"); |
|
|
|
} |
|
|
|
} |
|
|
|
const HEADER = { |
|
|
|
const HEADER = { |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
|
"Content-Type": "application/json", |
|
|
|
"Content-Type": "application/json", |
|
|
@ -256,9 +256,9 @@ const DashboardBOD = (props) => { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (result.status == 200 && result.data.data) { |
|
|
|
if (result.status == 200 && result.data.data) { |
|
|
|
let dataRes = result.data.data; |
|
|
|
let dataRes = result.data.data; |
|
|
|
const filteredData = dataRes.filter(item => item.parent === null); |
|
|
|
const filteredData = dataRes.filter(item => item.parent === null); |
|
|
|
SET_PROJECT_PER_DIVISION(filteredData); |
|
|
|
SET_PROJECT_PER_DIVISION(filteredData); |
|
|
|
} |
|
|
|
} |
|
|
|
SET_READY_PROJECT_PER_DIVISION(true); |
|
|
|
SET_READY_PROJECT_PER_DIVISION(true); |
|
|
@ -317,16 +317,16 @@ const DashboardBOD = (props) => { |
|
|
|
let tableData = []; |
|
|
|
let tableData = []; |
|
|
|
result.data.data.map((item, idx) => { |
|
|
|
result.data.data.map((item, idx) => { |
|
|
|
let statusHealthBySchedule = 'on-schedule'; |
|
|
|
let statusHealthBySchedule = 'on-schedule'; |
|
|
|
let planningProgress = 0; |
|
|
|
let planningProgress = 0; |
|
|
|
let actualProgress = 0; |
|
|
|
let actualProgress = 0; |
|
|
|
let selisihProgress = 0; |
|
|
|
let selisihProgress = 0; |
|
|
|
|
|
|
|
|
|
|
|
if(item.scurve && item.scurve[0]) { |
|
|
|
if (item.scurve && item.scurve[0]) { |
|
|
|
planningProgress = item.scurve[0].data.percentagePlan[item.scurve[0].data.percentagePlan.length - 1] |
|
|
|
planningProgress = item.scurve[0].data.percentagePlan[item.scurve[0].data.percentagePlan.length - 1] |
|
|
|
actualProgress = item.scurve[0].data.percentageReal[item.scurve[0].data.percentageReal.length - 1] |
|
|
|
actualProgress = item.scurve[0].data.percentageReal[item.scurve[0].data.percentageReal.length - 1] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
selisihProgress = planningProgress - actualProgress |
|
|
|
selisihProgress = planningProgress - actualProgress |
|
|
|
|
|
|
|
|
|
|
|
if (selisihProgress > 0 && selisihProgress <= 5) { |
|
|
|
if (selisihProgress > 0 && selisihProgress <= 5) { |
|
|
|
statusHealthBySchedule = 'warning' |
|
|
|
statusHealthBySchedule = 'warning' |
|
|
@ -433,12 +433,12 @@ const DashboardBOD = (props) => { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style={{ flex: 6, display: 'flex', justifyContent: 'center', alignItems: 'center' }}> |
|
|
|
<div style={{ flex: 6, display: 'flex', justifyContent: 'center', alignItems: 'center' }}> |
|
|
|
<Link to="/dashboard-project-carousell" style={{ textDecoration: 'none' }}> |
|
|
|
<Link to="/dashboard-perproject" style={{ textDecoration: 'none' }}> |
|
|
|
<div style={{ backgroundColor: '#DDDDDD', color: '#4C4747', borderRadius: 5, padding: 4, fontWeight: 500, cursor: 'pointer', fontSize: 12, textAlign: 'center', lineHeight: 'normal' }}> |
|
|
|
<div style={{ backgroundColor: '#DDDDDD', color: '#4C4747', borderRadius: 5, padding: 4, fontWeight: 500, cursor: 'pointer', fontSize: 12, textAlign: 'center', lineHeight: 'normal' }}> |
|
|
|
View All Gantt |
|
|
|
All Dashboard |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</Link> |
|
|
|
</Link> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</> |
|
|
|
</> |
|
|
|
: |
|
|
|
: |
|
|
|
<div style={{ flex: 6, display: 'flex', justifyContent: 'center', alignItems: 'center' }}> |
|
|
|
<div style={{ flex: 6, display: 'flex', justifyContent: 'center', alignItems: 'center' }}> |
|
|
|