Commit 4faa8a8b authored by d.arizona's avatar d.arizona

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into didam

parents 32de7146 397067a4
...@@ -210,6 +210,8 @@ const create = (type = "") => { ...@@ -210,6 +210,8 @@ const create = (type = "") => {
const getIdDeleteFromExcel = (body) => api.post('transaction/master_budget/delete_from_excel', body) const getIdDeleteFromExcel = (body) => api.post('transaction/master_budget/delete_from_excel', body)
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)
const getDashboardUser = () => api.get('transaction/get_dashboard_sub_co')
const getDashboardMB = (body) => api.get('transaction/get_dashboard_table')
const getOpetratingIndID = (body) => api.post('transaction/operating_indicator/get_operating_indicator_id', body) const getOpetratingIndID = (body) => api.post('transaction/operating_indicator/get_operating_indicator_id', body)
const getSubmitOI = (body) => api.post('transaction/operating_indicator/get_latest_periode_submit', body) const getSubmitOI = (body) => api.post('transaction/operating_indicator/get_latest_periode_submit', body)
...@@ -393,6 +395,7 @@ const create = (type = "") => { ...@@ -393,6 +395,7 @@ const create = (type = "") => {
getIdDeleteFromExcel, getIdDeleteFromExcel,
getDashboard, getDashboard,
historyApproval, historyApproval,
getDashboardMB,
checkApprover, checkApprover,
approvalSubmission, approvalSubmission,
getCompanySubmitted, getCompanySubmitted,
...@@ -421,7 +424,8 @@ const create = (type = "") => { ...@@ -421,7 +424,8 @@ const create = (type = "") => {
checkApproverOLPA, checkApproverOLPA,
getLastPeriodeOI, getLastPeriodeOI,
getSubmitOI, getSubmitOI,
getLastPeriodOI getLastPeriodOI,
getDashboardUser
} }
} }
......
...@@ -512,10 +512,15 @@ export default class FixedAssetsMovement extends Component { ...@@ -512,10 +512,15 @@ export default class FixedAssetsMovement extends Component {
} else { } else {
// console.log(item) // console.log(item)
let indexID = dataTable2.findIndex((val) => val[22] == item) let indexID = dataTable2.findIndex((val) => val[22] == item)
// console.log(dataTable2[indexID][tableMeta.columnIndex]) // console.log(dataTable2[indexID])
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = dataTable2[indexID][tableMeta.columnIndex].value == undefined ? dataTable2[indexID][tableMeta.columnIndex] : dataTable2[indexID][tableMeta.columnIndex].value let valuezz = dataTable2[indexID][tableMeta.columnIndex].value == undefined ? dataTable2[indexID][tableMeta.columnIndex] : dataTable2[indexID][tableMeta.columnIndex].value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} else {
if (item === '(-1)') {
anjay.push(-1)
}
// console.log(item);
} }
} }
} }
......
...@@ -6209,17 +6209,14 @@ export default class TaxPlanning extends Component { ...@@ -6209,17 +6209,14 @@ export default class TaxPlanning extends Component {
name: `${this.props.periode}`, name: `${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<div style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} > <th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
{/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> */}
<div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div> <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div>
<div style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}> <div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
<div style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}> <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Fiscal)"}</span> <span>{"Trial Balance (Fiscal)"}</span>
</div> </div>
</div> </div>
</div> </th>
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
......
...@@ -22,7 +22,11 @@ class HomePage extends Component { ...@@ -22,7 +22,11 @@ class HomePage extends Component {
{ nama: 'Dharma Group', status: 'overdue' }, { nama: 'Dharma Group', status: 'overdue' },
{ nama: 'Daya Group', status: 'open' }, { nama: 'Daya Group', status: 'open' },
], ],
isApprover: true isApprover: true,
listSubcoMB: [],
valueSubmit: 0,
listdmb: [],
dataTableMB: []
} }
} }
...@@ -47,6 +51,8 @@ class HomePage extends Component { ...@@ -47,6 +51,8 @@ class HomePage extends Component {
// } // }
// }) // })
this.getApprMat() this.getApprMat()
this.getListUserSubco()
this.getDashboardMB()
} }
componentDidUpdate() { componentDidUpdate() {
...@@ -56,6 +62,26 @@ class HomePage extends Component { ...@@ -56,6 +62,26 @@ class HomePage extends Component {
} }
} }
getListUserSubco() {
api.create().getDashboardUser().then(response => {
console.log(response);
let valueSubmit = 0
if (response.data) {
if (response.data.status === "success") {
response.data.data.map((item, index) => {
if (item.is_submit === true) {
valueSubmit += 1
}
})
this.setState({
listSubcoMB: response.data.data,
valueSubmit
})
}
}
})
}
getDashboard() { getDashboard() {
let listDashboard = [] let listDashboard = []
api.create().getDashboard().then((response) => { api.create().getDashboard().then((response) => {
...@@ -74,20 +100,37 @@ class HomePage extends Component { ...@@ -74,20 +100,37 @@ class HomePage extends Component {
api.create().getAM().then((response) => { api.create().getAM().then((response) => {
console.log(response); console.log(response);
let actAM = response.data.data.map((item, index) => { let actAM = response.data.data.map((item, index) => {
if(String(item.status).toLocaleLowerCase() == 'active'){ if (String(item.status).toLocaleLowerCase() == 'active') {
return item return item
} }
}) })
let userId = localStorage.getItem(Constant.USER) let userId = localStorage.getItem(Constant.USER)
let indexId = actAM.findIndex((val) => val.user_id == userId) let indexId = actAM.findIndex((val) => val.user_id == userId)
if (indexId === -1){ if (indexId === -1) {
this.setState({ isApprover: false }) this.setState({ isApprover: false })
} }
console.log(actAM) console.log(actAM)
}) })
} }
getDashboardMB() {
api.create().getDashboardMB().then((response) =>{
console.log(response)
if(String(response.data.status).toLocaleLowerCase() == 'success'){
let data = response.data.data
let listdmb = data.sort((a, b) => a.company_id - b.company_id).map((item, index) => {
return [
item.company_name,
item.master_budget,
item.operating_indicator
]
})
this.setState({ dataTableMB: listdmb })
}
})
}
render() { render() {
const columns = ["#", "ID", "Nama Perusahaan", "Jenis Report", "Revisi", "Status", { const columns = ["#", "ID", "Nama Perusahaan", "Jenis Report", "Revisi", "Status", {
name: "Action", name: "Action",
...@@ -138,6 +181,9 @@ class HomePage extends Component { ...@@ -138,6 +181,9 @@ class HomePage extends Component {
rowsPerPage: 5, rowsPerPage: 5,
search: false search: false
} }
const columnsMB = ["Company", "Master Budget & CAT", "Operating Indicator"]
const dataChart = [{ const dataChart = [{
count: 90, count: 90,
color: '#5198ea', color: '#5198ea',
...@@ -189,6 +235,18 @@ class HomePage extends Component { ...@@ -189,6 +235,18 @@ class HomePage extends Component {
</MuiThemeProvider> </MuiThemeProvider>
</div> </div>
<div style={{ marginTop: 20 }}> <div style={{ marginTop: 20 }}>
<Typography style={{ color: '#656565', fontSize: '16px', fontWeight: 'bold' }}>Master Budget & CAT</Typography>
<div style={{ marginTop: 10, width: '100%' }}>
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={this.state.dataTableMB}
columns={columnsMB}
options={options}
/>
</MuiThemeProvider>
</div>
</div>
{/* <div style={{ marginTop: 20 }}>
<Typography style={{ color: '#656565', fontSize: '16px', fontWeight: 'bold' }}>Status Laporan</Typography> <Typography style={{ color: '#656565', fontSize: '16px', fontWeight: 'bold' }}>Status Laporan</Typography>
<div style={{ marginTop: 10, display: 'flex' }}> <div style={{ marginTop: 10, display: 'flex' }}>
<div style={{ width: 280, height: 400, padding: 20, backgroundColor: 'white', borderRadius: 6, border: 'solid 1px #c4c4c4', marginRight: 25 }}> <div style={{ width: 280, height: 400, padding: 20, backgroundColor: 'white', borderRadius: 6, border: 'solid 1px #c4c4c4', marginRight: 25 }}>
...@@ -315,7 +373,7 @@ class HomePage extends Component { ...@@ -315,7 +373,7 @@ class HomePage extends Component {
</div> </div>
</div> </div>
</div> </div>
</div> </div> */}
</div> </div>
</div> </div>
: :
...@@ -329,16 +387,33 @@ class HomePage extends Component { ...@@ -329,16 +387,33 @@ class HomePage extends Component {
</div> </div>
</div> </div>
<div style={{ flex: 1, padding: 20, width: '100%' }}> <div style={{ flex: 1, padding: 20, width: '100%' }}>
<Paper style={{ width: 400, padding: 20, borderRadius: 10 }}> <Paper style={{ width: 450, padding: 20, borderRadius: 10 }}>
<Typography style={{ fontWeight: 'bold', textDecorationLine: 'underline' }}>Master Budget - Oct 2020 (1/4)</Typography> <Typography style={{ fontWeight: 'bold', textDecorationLine: 'underline' }}>{`Master Budget ${this.state.valueSubmit}/${this.state.listSubcoMB.length}`}</Typography>
{this.state.listMasterBudget.map((item, index) => { {this.state.listSubcoMB.map((item, index) => {
return ( return (
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: 10, paddingLeft: 10 }}> <div style={{ display: 'flex', justifyContent: 'space-between', marginTop: 10, paddingLeft: 10 }}>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<img src={item.status === "overdue" ? Images.dotOverdue : item.status === "open" ? Images.dotOpen : Images.dotDone} /> <img src={item.is_submit === true ? Images.dotDone : item.is_overdue === true ? Images.dotOverdue : Images.dotOpen} />
<Typography style={{ marginLeft: 10, color: '#5198ea', fontSize: 13 }}>{item.nama}</Typography> <Link to={{
pathname: `/home/master-budget/`,
state: {
userType: 'user',
rawData: item
}
}}>
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5,
outline: 'none'
}}>
<Typography style={{ marginLeft: 10, color: '#5198ea', fontSize: 13 }}>{item.company_name}</Typography>
</button>
</Link>
</div> </div>
{item.status === 'overdue' && ( {item.is_overdue && (
<div style={{ backgroundColor: '#f65a4c', paddingRight: 5, paddingLeft: 5, borderRadius: 5, alignSelf: 'center' }}> <div style={{ backgroundColor: '#f65a4c', paddingRight: 5, paddingLeft: 5, borderRadius: 5, alignSelf: 'center' }}>
<Typography style={{ fontSize: 11, color: '#fff' }}>Overdue</Typography> <Typography style={{ fontSize: 11, color: '#fff' }}>Overdue</Typography>
</div> </div>
...@@ -352,6 +427,7 @@ class HomePage extends Component { ...@@ -352,6 +427,7 @@ class HomePage extends Component {
} }
</div> </div>
); );
} }
} }
......
...@@ -240,6 +240,7 @@ export default class OperatingIndicator extends Component { ...@@ -240,6 +240,7 @@ export default class OperatingIndicator extends Component {
options: periodeData, options: periodeData,
getOptionLabel: (option) => option.periode, getOptionLabel: (option) => option.periode,
}; };
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] }, () => {
...@@ -554,13 +555,13 @@ export default class OperatingIndicator extends Component { ...@@ -554,13 +555,13 @@ export default class OperatingIndicator extends Component {
</MuiThemeProvider> </MuiThemeProvider>
</div> </div>
</div> </div>
{this.state.isSubmit && ( {/* {this.state.isSubmit && (
<div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} > <div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Submit</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Submit</Typography>
</div> </div>
</div> </div>
)} )} */}
</Paper> </Paper>
</div> </div>
......
This diff is collapsed.
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