Commit 41083315 authored by Deni Rinaldi's avatar Deni Rinaldi

push banyak banget pokonya ampe puyeng

parent 8115bdd0
...@@ -79,6 +79,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => ...@@ -79,6 +79,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
//Menu //Menu
const getMenu = () => api.get('menu/get_menu_hierarki') const getMenu = () => api.get('menu/get_menu_hierarki')
const getMenuByRole = () => api.get('menu/get_menu_hierarki_by_role') const getMenuByRole = () => api.get('menu/get_menu_hierarki_by_role')
const getMenuByUser = () => api.get('menu/get_menu')
//UNIT BISNIS //UNIT BISNIS
const getUnitBisnis = () => api.get('business_unit/get_all_business_unit') const getUnitBisnis = () => api.get('business_unit/get_all_business_unit')
...@@ -87,6 +88,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => ...@@ -87,6 +88,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const searchUnitBisnis = (body) => api.post('/business_unit/search_business_unit', body) const searchUnitBisnis = (body) => api.post('/business_unit/search_business_unit', body)
const checkUploadUnitBisnis = (body) => api.post('/business_unit/check_import', body) const checkUploadUnitBisnis = (body) => api.post('/business_unit/check_import', body)
const uploadUnitBisnis = (body) => api.post('/business_unit/import_business_unit', body) const uploadUnitBisnis = (body) => api.post('/business_unit/import_business_unit', body)
const getUnitBisnisActive = () => api.get('business_unit/get_all_business_unit_active')
// Perusahaan // Perusahaan
const getPerusahaan = () => api.get('company/get_all_company') const getPerusahaan = () => api.get('company/get_all_company')
...@@ -95,6 +97,10 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => ...@@ -95,6 +97,10 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const updatePerusahaan = (body) => api.post('/company/update_company', body) const updatePerusahaan = (body) => api.post('/company/update_company', body)
const getPerusahaanHierarki = () => api.get('company/get_company_hierarki') const getPerusahaanHierarki = () => api.get('company/get_company_hierarki')
const saveVisualisasiPerusahaan = (body) => api.post('company/save_visualization', body) const saveVisualisasiPerusahaan = (body) => api.post('company/save_visualization', body)
const checkUploadPerusahaan = (body) => api.post('company/check_import', body)
const getDetailPerusahaan = (id) => api.get(`company/get_company_by_id/${id}`)
const uploadPerusahaan = (body) => api.post('company/import_company', body)
const searchPerusahaan = (body) => api.post('company/search_company', body)
// APPROVAL MATRIX // APPROVAL MATRIX
const getAM = () => api.get('approval_matrix/get_all_approval_matrix') const getAM = () => api.get('approval_matrix/get_all_approval_matrix')
...@@ -138,6 +144,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => ...@@ -138,6 +144,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const updateParameter = (body) => api.post('setting/update_setting', body) const updateParameter = (body) => api.post('setting/update_setting', body)
const checkUploadParameter = (body) => api.post('setting/check_import', body) const checkUploadParameter = (body) => api.post('setting/check_import', body)
const uploadParameter = (body) => api.post('/setting/import_setting', body) const uploadParameter = (body) => api.post('/setting/import_setting', body)
const searchParameter = (body) => api.post('setting/search_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}`)
...@@ -216,7 +223,14 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => ...@@ -216,7 +223,14 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
getItemReportHierarki, getItemReportHierarki,
getMenuByRole, getMenuByRole,
saveVisualisasiReport, saveVisualisasiReport,
saveVisualisasiPerusahaan saveVisualisasiPerusahaan,
searchParameter,
checkUploadPerusahaan,
getDetailPerusahaan,
uploadPerusahaan,
searchPerusahaan,
getUnitBisnisActive,
getMenuByUser
} }
} }
......
This diff is collapsed.
...@@ -124,6 +124,36 @@ export default class Parameter extends Component { ...@@ -124,6 +124,36 @@ export default class Parameter extends Component {
} }
} }
handleInputChange(e) {
this.setState({ search: e })
let body = {
"keyword": e
}
api.create().searchParameter(body).then(response => {
console.log(response.data);
if (response.data.status == 'success') {
let data = response.data.data
let listData = data.map((item, index) => {
return [
index,
item.setting_group,
item.setting_type,
item.company_name,
item.description,
item.order,
item.value,
item.min_value,
item.max_value,
item.status
]
})
this.setState({ dataTable: listData, listData: response.data.data })
} else {
alert(response.data.message)
}
})
}
fileHandler = (event) => { fileHandler = (event) => {
let fileObj = event let fileObj = event
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
...@@ -612,6 +642,8 @@ export default class Parameter extends Component { ...@@ -612,6 +642,8 @@ export default class Parameter extends Component {
<InputBase <InputBase
style={{ width: '100%' }} style={{ width: '100%' }}
placeholder="Search" placeholder="Search"
value={this.state.search}
onChange={(e) => this.handleInputChange(e.target.value)}
inputProps={{ 'aria-label': 'naked' }} inputProps={{ 'aria-label': 'naked' }}
/> />
</div> </div>
......
This diff is collapsed.
...@@ -11,8 +11,13 @@ export default class CreateUnitBisnis extends Component { ...@@ -11,8 +11,13 @@ export default class CreateUnitBisnis extends Component {
id: '', id: '',
name: '', name: '',
startDate: '', startDate: '',
endDate: '' endDate: '',
errorName: false,
errorStartDate: false,
errorEndDate: false,
msgErrorName: "",
msgErrorStartDate: "",
msgErrorEndDate: ""
} }
} }
render() { render() {
...@@ -36,11 +41,13 @@ export default class CreateUnitBisnis extends Component { ...@@ -36,11 +41,13 @@ export default class CreateUnitBisnis extends Component {
let data = this.state let data = this.state
let isDate = type !== '' ? true : false let isDate = type !== '' ? true : false
if (isDate && type == 'start_date') { if (isDate && type == 'start_date') {
this.setState({ startDate: format(e, 'yyyy-MM-dd') }, () => { this.setState({ startDate: format(e, 'yyyy-MM-dd'), endDate: null }, () => {
this.clearError()
console.log(this.state.startDate) console.log(this.state.startDate)
}) })
} else if (isDate && type == 'end_date') { } else if (isDate && type == 'end_date') {
this.setState({ endDate: format(e, 'yyyy-MM-dd') }, () => { this.setState({ endDate: format(e, 'yyyy-MM-dd') }, () => {
this.clearError()
console.log(this.state.endDate) console.log(this.state.endDate)
}) })
} else { } else {
...@@ -49,13 +56,25 @@ export default class CreateUnitBisnis extends Component { ...@@ -49,13 +56,25 @@ export default class CreateUnitBisnis extends Component {
} }
clearError() {
this.setState({
errorName: false,
errorStartDate: false,
errorEndDate: false,
msgErrorName: "",
msgErrorStartDate: "",
msgErrorEndDate: ""
})
}
validasi() { validasi() {
if (R.isEmpty(this.state.name)) return alert("Unit Bisnis Name is Required."); if (R.isEmpty(this.state.name)) {
if (!R.isEmpty(this.state.startDate) && !R.isEmpty(this.state.endDate) && (this.state.startDate > this.state.endDate)) return alert("Masa Berlaku Tidak Boleh Kurang Dari Tanggal Mulai"); this.setState({ errorName: true, msgErrorName: 'Unit Bisnis tidak boleh kosong' })
if (R.isEmpty(this.state.startDate)) return alert("Tanggal Mulai is Required."); } else if (R.isEmpty(this.state.startDate)) {
if (R.isEmpty(this.state.endDate)) return alert("Tanggal Berakhir is Required."); this.setState({ errorStartDate: true, msgErrorStartDate: 'Tanggal Mulai tidak boleh kosong' })
console.log('masuk'); } else if (R.isEmpty(this.state.endDate) || this.state.endDate === null) {
if (this.props.type == 'edit') { this.setState({ errorEndDate: true, msgErrorEndDate: 'Tanggal Berakhir tidak boleh kosong' })
} else {
let payload = { let payload = {
"business_unit_id": this.state.id, "business_unit_id": this.state.id,
"business_unit_name": this.state.name, "business_unit_name": this.state.name,
...@@ -63,7 +82,17 @@ export default class CreateUnitBisnis extends Component { ...@@ -63,7 +82,17 @@ export default class CreateUnitBisnis extends Component {
"end_date": this.state.endDate "end_date": this.state.endDate
} }
this.props.updateUnitBisnis(payload) this.props.updateUnitBisnis(payload)
} else if (this.props.type == 'create') { }
}
validasiCreate() {
if (R.isEmpty(this.state.name)) {
this.setState({ errorName: true, msgErrorName: 'Unit Bisnis tidak boleh kosong' })
} else if (R.isEmpty(this.state.startDate)) {
this.setState({ errorStartDate: true, msgErrorStartDate: 'Tanggal Mulai tidak boleh kosong' })
} else if (R.isEmpty(this.state.endDate)) {
this.setState({ errorEndDate: true, msgErrorEndDate: 'Tanggal Berakhir tidak boleh kosong' })
} else {
let payload = { let payload = {
"business_unit_name": this.state.name, "business_unit_name": this.state.name,
"start_date": this.state.startDate, "start_date": this.state.startDate,
...@@ -71,7 +100,6 @@ export default class CreateUnitBisnis extends Component { ...@@ -71,7 +100,6 @@ export default class CreateUnitBisnis extends Component {
} }
this.props.createUnitBisnis(payload) this.props.createUnitBisnis(payload)
} }
} }
renderEdit() { renderEdit() {
...@@ -140,7 +168,8 @@ export default class CreateUnitBisnis extends Component { ...@@ -140,7 +168,8 @@ export default class CreateUnitBisnis extends Component {
color: '#7e8085' color: '#7e8085'
} }
}} }}
error={this.state.errorStartDate}
helperText={this.state.msgErrorStartDate}
style={{ padding: 0, margin: 0, width: '100%' }} style={{ padding: 0, margin: 0, width: '100%' }}
/> />
</div> </div>
...@@ -196,7 +225,9 @@ export default class CreateUnitBisnis extends Component { ...@@ -196,7 +225,9 @@ export default class CreateUnitBisnis extends Component {
color: '#7e8085' color: '#7e8085'
} }
}} }}
onChange={(e) => this.setState({ name: e.target.value })} error={this.state.errorName}
helperText={this.state.msgErrorName}
onChange={(e) => this.setState({ name: e.target.value }, () => this.clearError())}
> >
</TextField> </TextField>
</div> </div>
...@@ -206,6 +237,9 @@ export default class CreateUnitBisnis extends Component { ...@@ -206,6 +237,9 @@ export default class CreateUnitBisnis extends Component {
id="startDate" id="startDate"
label="Berakhir Hingga" label="Berakhir Hingga"
format="dd MMMM yyyy" format="dd MMMM yyyy"
error={this.state.errorEndDate}
helperText={this.state.msgErrorEndDate}
minDate={this.state.startDate}
value={this.state.endDate} value={this.state.endDate}
onChange={(e) => this.handleChange(e, 'end_date')} onChange={(e) => this.handleChange(e, 'end_date')}
KeyboardButtonProps={{ KeyboardButtonProps={{
...@@ -222,7 +256,6 @@ export default class CreateUnitBisnis extends Component { ...@@ -222,7 +256,6 @@ export default class CreateUnitBisnis extends Component {
color: '#7e8085' color: '#7e8085'
} }
}} }}
style={{ padding: 0, margin: 0, width: '100%' }} style={{ padding: 0, margin: 0, width: '100%' }}
/> />
</div> </div>
...@@ -323,7 +356,8 @@ export default class CreateUnitBisnis extends Component { ...@@ -323,7 +356,8 @@ export default class CreateUnitBisnis extends Component {
color: '#7e8085' color: '#7e8085'
} }
}} }}
error={this.state.errorStartDate}
helperText={this.state.msgErrorStartDate}
style={{ padding: 0, margin: 0, width: '100%' }} style={{ padding: 0, margin: 0, width: '100%' }}
/> />
</div> </div>
...@@ -373,7 +407,9 @@ export default class CreateUnitBisnis extends Component { ...@@ -373,7 +407,9 @@ export default class CreateUnitBisnis extends Component {
color: '#7e8085' color: '#7e8085'
} }
}} }}
onChange={(e) => this.setState({ name: e.target.value })} error={this.state.errorName}
helperText={this.state.msgErrorName}
onChange={(e) => this.setState({ name: e.target.value }, () => this.clearError())}
> >
</TextField> </TextField>
</div> </div>
...@@ -383,6 +419,9 @@ export default class CreateUnitBisnis extends Component { ...@@ -383,6 +419,9 @@ export default class CreateUnitBisnis extends Component {
id="endDate" id="endDate"
label="Berakhir Hingga" label="Berakhir Hingga"
format="dd MMMM yyyy" format="dd MMMM yyyy"
error={this.state.errorEndDate}
helperText={this.state.msgErrorEndDate}
minDate={this.state.startDate}
value={this.state.endDate == "" ? null : this.state.endDate} value={this.state.endDate == "" ? null : this.state.endDate}
onChange={(e) => this.handleChange(e, 'end_date')} onChange={(e) => this.handleChange(e, 'end_date')}
KeyboardButtonProps={{ KeyboardButtonProps={{
...@@ -421,7 +460,7 @@ export default class CreateUnitBisnis extends Component { ...@@ -421,7 +460,7 @@ export default class CreateUnitBisnis extends Component {
<div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}> <div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
<button <button
type="button" type="button"
onClick={() => this.validasi()} onClick={() => this.validasiCreate()}
> >
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}> <div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Simpan</span> <span style={{ color: '#fff', fontSize: 11 }}>Simpan</span>
......
...@@ -17,7 +17,7 @@ const routes = [ ...@@ -17,7 +17,7 @@ const routes = [
main: HomePage main: HomePage
}, },
{ {
path: "/home/userrole", path: "/home/user-role",
main: UserRole main: UserRole
}, },
{ {
...@@ -29,7 +29,7 @@ const routes = [ ...@@ -29,7 +29,7 @@ const routes = [
main: ReportItems main: ReportItems
}, },
{ {
path: "/home/budget-tahunan", path: "/home/master-budget",
main: BalanceSheet main: BalanceSheet
}, },
{ {
...@@ -37,7 +37,7 @@ const routes = [ ...@@ -37,7 +37,7 @@ const routes = [
main: Profile main: Profile
}, },
{ {
path: "/home/perusahaan", path: "/home/company",
main: Perusahaan main: Perusahaan
}, },
{ {
...@@ -45,15 +45,15 @@ const routes = [ ...@@ -45,15 +45,15 @@ const routes = [
main: User main: User
}, },
{ {
path: "/home/unit-bisnis", path: "/home/business-unit",
main: UnitBisnis main: UnitBisnis
}, },
{ {
path: "/home/parameter", path: "/home/parameters",
main: Parameter main: Parameter
}, },
{ {
path: "/home/dashboard-cat", path: "/home/cat-dashboard",
main: DashboardCAT main: DashboardCAT
}, },
{ {
......
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