Commit 5eb76402 authored by EKSAD's avatar EKSAD

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

parents 2eb003db e4f23628
...@@ -69,6 +69,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => ...@@ -69,6 +69,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
//Role //Role
const getRole = () => api.get('role/get_all_role') const getRole = () => api.get('role/get_all_role')
const getRoleActive = () => api.get('role/get_all_role_active')
const getDetailRole = (roleId) => api.get(`role/get_role_by_id/${roleId}`) const getDetailRole = (roleId) => api.get(`role/get_role_by_id/${roleId}`)
const searchRole = (body) => api.post('/role/search_role', body) const searchRole = (body) => api.post('/role/search_role', body)
const addRole = (body) => api.post('role/create_role', body) const addRole = (body) => api.post('role/create_role', body)
...@@ -120,6 +121,13 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => ...@@ -120,6 +121,13 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const searchReportItems = (body) => api.post('/item_report/search_item_report', body) const searchReportItems = (body) => api.post('/item_report/search_item_report', body)
const createReportItems = (body) => api.post('/item_report/create_item_report', body) const createReportItems = (body) => api.post('/item_report/create_item_report', body)
//PARAMETER
const getAllParameter = () => api.get('/setting/get_all_setting')
const getDetailParameter = (id) => api.get(`setting/get_setting_by_id/${id}`)
const getAllGroup = () => api.get('/setting_group/get_all_setting_group')
const getParameterByGroup = (groupID) => api.get(`/setting_type/get_all_setting_type_by_group/${groupID}`)
const createParameter = (body) => api.post('setting/create_setting', body)
const updateParameter = (body) => api.post('setting/update_setting', body)
//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}`)
...@@ -181,8 +189,15 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => ...@@ -181,8 +189,15 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
createReportItems, createReportItems,
getInputType, getInputType,
getReportType, getReportType,
getPerusahaanActive getAllParameter,
} getAllGroup,
getParameterByGroup,
getDetailParameter,
updateParameter,
createParameter,
getPerusahaanActive,
getRoleActive
}
} }
// let's return back our create method as the default. // let's return back our create method as the default.
......
...@@ -161,6 +161,47 @@ ...@@ -161,6 +161,47 @@
.btn-no-outline{ .btn-no-outline{
outline: 'none' outline: 'none'
} }
.form {
display: flex;
}
.form>div {
display: inline-block;
vertical-align: top;
}
#treeviewDriveC,
#treeviewDriveD {
margin-top: 10px;
}
.drive-header {
min-height: auto;
padding: 0px;
cursor: default;
}
.drive-header .dx-icon {
margin-top: -4px;
}
.drive-panel {
padding: 20px 30px;
font-size: 115%;
font-weight: bold;
border-right: 1px solid rgba(165, 165, 165, 0.4);
height: 100%;
}
.drive-panel:last-of-type {
border-right: none;
}
.dx-treeview-item {
position: relative;
left: -2px;
}
.color-white { .color-white {
...@@ -78,10 +78,10 @@ export default class DashboardCAT extends Component { ...@@ -78,10 +78,10 @@ export default class DashboardCAT extends Component {
<Tab label="KPIs" style={{ color: '#fff', fontSize: 11 }} /> <Tab label="KPIs" style={{ color: '#fff', fontSize: 11 }} />
</Tabs> </Tabs>
</AppBar> </AppBar>
{this.state.tab == 0 ? {this.state.tab === 0 ?
<ExceutiveScoreboard height={this.props.height} /> <ExceutiveScoreboard height={this.props.height} />
: :
this.state.tab == 1 ? this.state.tab === 1 ?
<span>Testt</span> <span>Testt</span>
: :
<span>Test2</span> <span>Test2</span>
......
...@@ -50,12 +50,14 @@ export default class UnitBisnis extends Component { ...@@ -50,12 +50,14 @@ export default class UnitBisnis extends Component {
let isi = resp.rows.slice(3) let isi = resp.rows.slice(3)
let payload = [] let payload = []
isi.map((item, index) => { isi.map((item, index) => {
payload.push({ if (item.length > 0) {
id: index + 1, payload.push({
business_unit_name: item[0], id: index + 1,
start_date: item[1], business_unit_name: item[0],
end_date: item[2], start_date: item[1],
}) end_date: item[2],
})
}
}) })
let body = { let body = {
business_unit: payload business_unit: payload
...@@ -170,8 +172,6 @@ export default class UnitBisnis extends Component { ...@@ -170,8 +172,6 @@ export default class UnitBisnis extends Component {
}) })
// console.log(JSON.stringify(payload));
} }
}); });
} }
...@@ -185,7 +185,7 @@ export default class UnitBisnis extends Component { ...@@ -185,7 +185,7 @@ export default class UnitBisnis extends Component {
console.log(response) console.log(response)
if (response.data.status == 'success') { if (response.data.status == 'success') {
let data = response.data.data let data = response.data.data
let listData = data.map((item, index) => { let listData = data.sort((a,b) => a.business_unit_id - b.business_unit_id).map((item, index) => {
return [index, item.business_unit_id, item.business_unit_name, item.status] return [index, item.business_unit_id, item.business_unit_name, item.status]
}) })
this.setState({ dataTable: listData, listData: response.data.data }) this.setState({ dataTable: listData, listData: response.data.data })
...@@ -287,7 +287,7 @@ export default class UnitBisnis extends Component { ...@@ -287,7 +287,7 @@ export default class UnitBisnis extends Component {
this.setState({ visibleUnitBisnis: true }) this.setState({ visibleUnitBisnis: true })
}) })
} }
render() { render() {
const columns = [{ const columns = [{
name: "Action", name: "Action",
......
...@@ -4,8 +4,6 @@ import { TextField, List, ListSubheader, Typography, Collapse } from '@material- ...@@ -4,8 +4,6 @@ import { TextField, List, ListSubheader, Typography, Collapse } from '@material-
import MinimizeIcon from '@material-ui/icons/Minimize'; import MinimizeIcon from '@material-ui/icons/Minimize';
import AddIcon from '@material-ui/icons/Add'; import AddIcon from '@material-ui/icons/Add';
import RemoveIcon from '@material-ui/icons/Remove'; import RemoveIcon from '@material-ui/icons/Remove';
import TreeView from '@material-ui/lab/TreeView';
import TreeItem from '@material-ui/lab/TreeItem';
import Nestable from 'react-nestable'; import Nestable from 'react-nestable';
const useStyles = makeStyles((theme) => ({ const useStyles = makeStyles((theme) => ({
...@@ -73,7 +71,8 @@ export default class VisualReportItems extends Component { ...@@ -73,7 +71,8 @@ export default class VisualReportItems extends Component {
] ]
}, },
], ],
arrayCollapse: [] arrayCollapse: [],
defaultCollapsed: false
} }
} }
...@@ -94,32 +93,30 @@ export default class VisualReportItems extends Component { ...@@ -94,32 +93,30 @@ export default class VisualReportItems extends Component {
} }
} }
renderItem = ({ item, index }) => { onDefaultCollapsed = () => this.setState({
return(item.text) defaultCollapsed: !this.state.defaultCollapsed
// if (item.children.length > 0) { });
// return (
// <TreeView collapse = (collapseCase) => {
// defaultCollapseIcon={<RemoveIcon />} let arrayCollapse = this.state.arrayCollapse
// defaultExpandIcon={< AddIcon/>} let index = arrayCollapse.findIndex((val) => val.id === collapseCase)
// > if (arrayCollapse.includes(collapseCase)) {
// {item.children.length > 0 && arrayCollapse.splice(index, 1)
// <TreeItem nodeId={item.id} style={{margin: 10}} label={item.text}> } else {
// {item.children.map((items,indexs) => { arrayCollapse.push(collapseCase)
// return ( }
// <TreeItem nodeId={items.id} style={{margin: 10}} label={items.text}/> if (this.refNestable) {
// ) this.refNestable.collapse(arrayCollapse.length > 0? arrayCollapse : 'NONE');
// })} }
// </TreeItem> };
// // :
// // <TreeItem nodeId={item.id} style={{margin: 10}} label={item.text}/> renderItem = ({ item, collapseIcon }) => {
// } return (
// </TreeView> <div>
// ) {collapseIcon ? (this.state.arrayCollapse.includes(item.id)? <AddIcon/> : <RemoveIcon/>) : null}
// } else { <button type="button" onClick={() => this.collapse(item.id)}>{item.text}</button>
// return ( </div>
// <TreeItem nodeId={item.id} style={{margin: 10}} label={item.text}/> )
// )
// }
}; };
render() { render() {
...@@ -141,7 +138,6 @@ export default class VisualReportItems extends Component { ...@@ -141,7 +138,6 @@ export default class VisualReportItems extends Component {
style={{ width: 250 }} style={{ width: 250 }}
select select
label="Item Laporan" label="Item Laporan"
// onChange={handleChange}
helperText="" helperText=""
SelectProps={{ SelectProps={{
native: true, native: true,
...@@ -177,7 +173,6 @@ export default class VisualReportItems extends Component { ...@@ -177,7 +173,6 @@ export default class VisualReportItems extends Component {
style={{ width: 250 }} style={{ width: 250 }}
select select
label="Perusahaan" label="Perusahaan"
// onChange={handleChange}
helperText="" helperText=""
SelectProps={{ SelectProps={{
native: true, native: true,
...@@ -210,7 +205,9 @@ export default class VisualReportItems extends Component { ...@@ -210,7 +205,9 @@ export default class VisualReportItems extends Component {
<div className="margin-top-30px"> <div className="margin-top-30px">
<Nestable <Nestable
items={this.state.items} items={this.state.items}
collapsed={this.state.defaultCollapsed}
renderItem={this.renderItem} renderItem={this.renderItem}
ref={el => this.refNestable = el}
onChange={(e) => this.setState({items: e})} onChange={(e) => this.setState({items: e})}
/> />
</div> </div>
......
...@@ -78,7 +78,7 @@ export default class CreateUnitBisnis extends Component { ...@@ -78,7 +78,7 @@ export default class CreateUnitBisnis extends Component {
return ( return (
<div className="test app-popup-show"> <div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}> <div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
<div className="popup-panel grid grid-2x" style={{ backgroundColor: '#51c6ea', height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 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="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
<div className="popup-title"> <div className="popup-title">
<span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Edit Data</span> <span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Edit Data</span>
......
...@@ -47,7 +47,7 @@ export default class UserRole extends Component { ...@@ -47,7 +47,7 @@ export default class UserRole extends Component {
if (response.data.status === 'success') { if (response.data.status === 'success') {
let data = response.data.data let data = response.data.data
let listData = data.sort((a,b) => a.user_id - b.user_id).map((item, index) => { let listData = data.sort((a,b) => a.user_id - b.user_id).map((item, index) => {
return [index, item.user_id, item.fullname === null? '-' : item.fullname, item.email, item.role_name, '-', item.status] return [index, item.user_id, item.fullname === null? '-' : item.fullname, item.email, item.role_name, item.totalCompany, item.status]
}) })
this.setState({ listUser: listData }) this.setState({ listUser: listData })
} else { } else {
...@@ -64,7 +64,7 @@ export default class UserRole extends Component { ...@@ -64,7 +64,7 @@ export default class UserRole extends Component {
if (response.data.status === 'success') { if (response.data.status === 'success') {
let data = response.data.data let data = response.data.data
let listData = data.sort((a,b) => a.user_id - b.user_id).map((item, index) => { let listData = data.sort((a,b) => a.user_id - b.user_id).map((item, index) => {
return [index, item.user_id, item.fullname == null? '-' : item.fullname, item.email, item.role_name, '-', item.status] return [index, item.user_id, item.fullname == null? '-' : item.fullname, item.email, item.role_name, item.totalCompany, item.status]
}) })
this.setState({ listUser: listData }) this.setState({ listUser: listData })
} else { } else {
...@@ -271,7 +271,7 @@ export default class UserRole extends Component { ...@@ -271,7 +271,7 @@ export default class UserRole extends Component {
if (this.state.search.length > 0) { if (this.state.search.length > 0) {
this.searchUser() this.searchUser()
} else { } else {
this.getRole() this.getUser()
} }
} }
} }
......
...@@ -119,7 +119,7 @@ export default class AddUser extends Component { ...@@ -119,7 +119,7 @@ export default class AddUser extends Component {
} }
getRole() { getRole() {
api.create().getRole().then((response) => { api.create().getRoleActive().then((response) => {
if(response.data.status === 'success') { if(response.data.status === 'success') {
let data = response.data.data let data = response.data.data
let roleData = data.map((item) => { let roleData = data.map((item) => {
......
...@@ -154,7 +154,7 @@ export default class EditUser extends Component { ...@@ -154,7 +154,7 @@ export default class EditUser extends Component {
} }
getRole() { getRole() {
api.create().getRole().then((response) => { api.create().getRoleActive().then((response) => {
if(response.data.status === 'success') { if(response.data.status === 'success') {
let data = response.data.data let data = response.data.data
let roleData = data.map((item) => { let roleData = data.map((item) => {
...@@ -201,6 +201,29 @@ export default class EditUser extends Component { ...@@ -201,6 +201,29 @@ export default class EditUser extends Component {
this.setState({ company }) this.setState({ company })
} }
renderChild = (item, index) => {
console.log(item.child)
// item.child.map((items,indexs) => {
// return (
// // <Collapse in={true} timeout="auto" unmountOnExit>
// <div style={{ paddingLeft: 60, display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}>
// {/* {item.sub_menu.length > 0 && <span onClick={() => this.setState({ selectedIndex: index === this.state.selectedIndex ? 0 : index })} style={{ marginLeft: 7, marginRight: 2 }}>
// {index === this.state.selectedIndex ? <RemoveIcon color={'action'} fontSize={'small'} /> : <AddIcon color={'action'} fontSize={'small'} />}
// </span>} */}
// {/* <RemoveIcon color={'action'} fontSize={'small'} /> */}
// <span>
// <CustomCheckbox
// checked={this.handleItemChecked(items)}
// onChange={() => this.handleItemClick(items)}
// />
// </span>
// <Typography style={{ fontSize: 12 }}>{titleCase(items.company_name)}</Typography>
// </div>
// // </Collapse>
// )
// })
}
render() { render() {
return ( return (
<div className="test app-popup-show"> <div className="test app-popup-show">
...@@ -388,7 +411,7 @@ export default class EditUser extends Component { ...@@ -388,7 +411,7 @@ export default class EditUser extends Component {
return( return(
<div> <div>
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}> <div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}>
{item.childCompany.length > 0 && <span onClick={() => this.setState({ selectedIndex: index === this.state.selectedIndex ? 0 : index })} style={{ marginLeft: 7, marginRight: 2 }}> {item.child.length > 0 && <span onClick={() => this.setState({ selectedIndex: index === this.state.selectedIndex ? 0 : index })} style={{ marginLeft: 7, marginRight: 2 }}>
{index === this.state.selectedIndex ? <RemoveIcon color={'action'} fontSize={'small'} /> : <AddIcon color={'action'} fontSize={'small'} />} {index === this.state.selectedIndex ? <RemoveIcon color={'action'} fontSize={'small'} /> : <AddIcon color={'action'} fontSize={'small'} />}
</span>} </span>}
<span> <span>
...@@ -399,26 +422,7 @@ export default class EditUser extends Component { ...@@ -399,26 +422,7 @@ export default class EditUser extends Component {
</span> </span>
<Typography style={{ fontSize: 12 }}>{titleCase(item.company_name)}</Typography> <Typography style={{ fontSize: 12 }}>{titleCase(item.company_name)}</Typography>
</div> </div>
{item.childCompany.length > 0 && item.childCompany.map((items,indexs) => { {this.renderChild(item,index)}
return (
<Collapse in={index === this.state.selectedIndex} timeout="auto" unmountOnExit>
<div style={{ paddingLeft: 60, display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}>
{/* {item.sub_menu.length > 0 && <span onClick={() => this.setState({ selectedIndex: index === this.state.selectedIndex ? 0 : index })} style={{ marginLeft: 7, marginRight: 2 }}>
{index === this.state.selectedIndex ? <RemoveIcon color={'action'} fontSize={'small'} /> : <AddIcon color={'action'} fontSize={'small'} />}
</span>} */}
{/* <RemoveIcon color={'action'} fontSize={'small'} /> */}
<span>
<CustomCheckbox
checked={this.handleItemChecked(items)}
onChange={() => this.handleItemClick(items)}
/>
</span>
<Typography style={{ fontSize: 12 }}>{titleCase(items.company_name)}</Typography>
</div>
</Collapse>
)
})}
</div> </div>
) )
})} })}
......
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