Commit 13eadb11 authored by EKSAD's avatar EKSAD

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

parents 61329c10 06630a5b
......@@ -115,7 +115,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const updateAM = (body) => api.post('/approval_matrix/update_approval_matrix', body)
const updateVAM = (body) => api.post('/approval_matrix/visual_approval_matrix', body)
const checkUploadAM = (body) => api.post('/approval_matrix/check_import_approval_matrix', body)
const uploadAM = (body) => api.post('/approval_matrix/check_import_approval_matrix', body)
const uploadAM = (body) => api.post('approval_matrix/import_approval_matrix', body)
//User
const getUser = () => api.get('user/get_all_user')
......
......@@ -28,6 +28,10 @@ export default class CreateApprovalMatrix extends Component {
msgErrOrder: '',
errorType: false,
msgErrType: '',
errorApproved: false,
msgErrApproved: '',
errorOperator: false,
msgErrOperator: '',
errorStartDate: false,
errorEndDate: false,
msgErrorStartDate: "",
......@@ -140,6 +144,10 @@ export default class CreateApprovalMatrix extends Component {
msgErrOrder: "",
errorType: false,
msgErrType: '',
errorApproved: false,
msgErrApproved: '',
errorOperator: false,
msgErrOperator: '',
errorStartDate: false,
errorEndDate: false,
msgErrorStartDate: "",
......@@ -149,13 +157,18 @@ export default class CreateApprovalMatrix extends Component {
validasi() {
if (R.isNil(this.state.typeId)) {
return alert("Tipe Persetujuan tidak boleh kosong");
this.setState({ errorType: true, msgErrType: 'Tipe Persetujuan tidak boleh kosong' })
}
else if (R.isEmpty(this.state.order)) {
this.setState({ errorOrder: true, msgErrOrder: 'Order tidak boleh kosong'})
}
else if (R.isNil(this.state.userId)) return alert("Pemberi Persetujuan tidak boleh kosong");
else if (R.isNil(this.state.operatorId)) return alert("Operator tidak boleh kosong");
else if (R.isNil(this.state.userId)) {
// return alert("Pemberi Persetujuan tidak boleh kosong");
this.setState({ errorApproved: true, msgErrApproved: 'Pemberi Persetujuan tidak boleh kosong' })
}
else if (R.isNil(this.state.operatorId)) {
this.setState({ errorOperator: true, msgErrOperator: 'Operator tidak boleh kosong' })
}
else if (R.isNil(this.state.startDate)) {
this.setState({ errorStartDate: true, msgErrorStartDate: 'Tanggal Mulai tidak boleh kosong' })
} else if (R.isNil(this.state.endDate)) {
......@@ -225,29 +238,26 @@ export default class CreateApprovalMatrix extends Component {
<Autocomplete
{...this.state.types}
id="tipe"
onChange={(event, newInputValue) => this.setState({typeId:newInputValue})}
onChange={(event, newInputValue) => this.setState({typeId:newInputValue}, ()=> this.clearError())}
debug
renderInput={(params) =>
<TextField
{...params}
label="Tipe Persetujuan"
onChange={(e) => this.handleChange(e, '')}
error={this.state.errorType}
helperText={this.state.msgErrType}
InputLabelProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>
}
value={this.state.typeId}
error={this.state.errorType}
helperText={this.state.msgErrType}
// inputProps={{
// style: {
// fontSize: 11
// }
// }}
/>
</div>
</div>
......@@ -284,12 +294,15 @@ export default class CreateApprovalMatrix extends Component {
<Autocomplete
{...this.state.approvedBy}
id="approvedby"
onChange={(event, newInputValue) => this.setState({userId:newInputValue})}
onChange={(event, newInputValue) => this.setState({userId:newInputValue}, ()=> this.clearError())}
// disableClearable
debug
renderInput={(params) =>
<TextField {...params}
label="Pemberi Persetujuan"
onChange={(e) => this.handleChange(e, '')}
error={this.state.errorApproved}
helperText={this.state.msgErrApproved}
InputLabelProps={{
style: {
fontSize: 11,
......@@ -299,12 +312,6 @@ export default class CreateApprovalMatrix extends Component {
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
/>}
value={this.state.userId}
// inputProps={{
// style: {
// fontSize: 11
// }
// }}
// style={{ padding: 0, margin: 0, width: '100%'}}
/>
</div>
</div>
......@@ -317,10 +324,13 @@ export default class CreateApprovalMatrix extends Component {
id="operator"
// disableClearable
debug
onChange={(event, newInputValue) => this.setState({operatorId:newInputValue})}
onChange={(event, newInputValue) => this.setState({operatorId:newInputValue}, ()=> this.clearError())}
renderInput={(params) =>
<TextField {...params}
label="Operator"
onChange={(e) => this.handleChange(e, '')}
error={this.state.errorOperator}
helperText={this.state.msgErrOperator}
InputLabelProps={{
style: {
fontSize: 11,
......@@ -330,12 +340,6 @@ export default class CreateApprovalMatrix extends Component {
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
/>}
value={this.state.operatorId}
// inputProps={{
// style: {
// fontSize: 11
// }
// }}
// style={{ padding: 0, margin: 0, width: '100%' }}
/>
</div>
</div>
......
......@@ -22,6 +22,12 @@ export default class EditApprovalMatrix extends Component {
getTypes: null,
operators: null,
getOperators: null,
errorType: false,
msgErrType: '',
errorApproved: false,
msgErrApproved: '',
errorOperator: false,
msgErrOperator: '',
errorOrder: false,
msgErrOrder: '',
errorStartDate: false,
......@@ -153,6 +159,12 @@ export default class EditApprovalMatrix extends Component {
clearError() {
this.setState({
errorType: false,
msgErrType: '',
errorApproved: false,
msgErrApproved: '',
errorOperator: false,
msgErrOperator: '',
errorOrder: false,
msgErrOrder: "",
errorStartDate: false,
......@@ -164,14 +176,17 @@ export default class EditApprovalMatrix extends Component {
validasi() {
if (R.isNil(this.state.getTypes)) {
return alert("Tipe Persetujuan tidak boleh kosong");
this.setState({ errorType: true, msgErrType: 'Tipe Persetujuan tidak boleh kosong' })
}
else if (R.isEmpty(this.state.order)) {
this.setState({ errorOrder: true, msgErrOrder: 'Order tidak boleh kosong'})
}
else if (R.isNil(this.state.getApprovedBy)) return alert("Pemberi Persetujuan tidak boleh kosong");
else if (R.isNil(this.state.getOperators)) return alert("Operator tidak boleh kosong");
else 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");
else if (R.isNil(this.state.getApprovedBy)) {
this.setState({ errorApproved: true, msgErrApproved: 'Pemberi Persetujuan tidak boleh kosong' })
}
else if (R.isNil(this.state.getOperators)) {
this.setState({ errorOperator: true, msgErrOperator: 'Operator 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)) {
......@@ -246,10 +261,13 @@ export default class EditApprovalMatrix extends Component {
option
debug
id="tipe"
onChange={(event, newInputValue) => this.setState({getTypes:newInputValue})}
onChange={(event, newInputValue) => this.setState({getTypes:newInputValue}, ()=> this.clearError())}
renderInput={(params) =>
<TextField {...params}
label="Tipe Persetujuan"
onChange={(e) => this.handleChange(e, '')}
error={this.state.errorType}
helperText={this.state.msgErrType}
InputLabelProps={{
style: {
fontSize: 11,
......@@ -298,10 +316,13 @@ export default class EditApprovalMatrix extends Component {
option
debug
id="approvedby"
onChange={(event, newInputValue) => this.setState({getApprovedBy: newInputValue})}
onChange={(event, newInputValue) => this.setState({getApprovedBy: newInputValue}, ()=> this.clearError())}
renderInput={(params) =>
<TextField {...params}
label="Pemberi Persetujuan"
onChange={(e) => this.handleChange(e, '')}
error={this.state.errorApproved}
helperText={this.state.msgErrApproved}
InputLabelProps={{
style: {
fontSize: 11,
......@@ -321,12 +342,15 @@ export default class EditApprovalMatrix extends Component {
<Autocomplete
{...this.state.operators}
option
disableClearable
debug
id="operator"
onChange={(event, newInputValue) => this.setState({getOperators: newInputValue})}
onChange={(event, newInputValue) => this.setState({getOperators: newInputValue}, ()=> this.clearError())}
renderInput={(params) =>
<TextField {...params}
label="Operator"
onChange={(e) => this.handleChange(e, '')}
error={this.state.errorOperator}
helperText={this.state.msgErrOperator}
InputLabelProps={{
style: {
fontSize: 11,
......
......@@ -82,7 +82,12 @@ export default class CreateParameter extends Component {
getSettingGroupID: data.setting_group_id,
getCompanyID: data.company_id,
settingType: data.setting_type,
}, () => this.getAllGroup(), this.getPerusahaan(), this.getParameterByGroup(data.setting_group_id))
}, () => {
this.getAllGroup()
this.getPerusahaan()
this.getParameterByGroup(data.setting_group_id)
console.log(this.state.tempData)
})
} else {
alert(response.data.message)
}
......@@ -338,7 +343,7 @@ export default class CreateParameter extends Component {
// this.setState({ errorDeskripsi: true, msgErrorDeskripsi: 'Deskripsi tidak boleh kosong' })
// } else if (R.isEmpty(this.state.tempData.value)) {
// this.setState({ errorValue: true, msgErrorValue: 'Value tidak boleh kosong' })
} else if (!R.isNil(this.state.tempData.max_value) && R.isNil(this.state.tempData.min_value)) {
} else if ((!R.isNil(this.state.tempData.max_value) && R.isNil(this.state.tempData.min_value)) || (!R.isNil(this.state.tempData.max_value) && R.isEmpty(this.state.tempData.min_value))) {
this.setState({ errorMinValue: true, msgErrorMinValue: 'Min Value tidak boleh kosong' })
} else if (R.isNil(this.state.tempData.start_date)) {
this.setState({ errorStartDate: true, msgErrorStartDate: 'Start Date tidak boleh kosong' })
......
......@@ -48,6 +48,7 @@ export default class Parameter extends Component {
let data = response.data.data
let listData = data.map((item, index) => {
return [
item.setting_id,
item.setting_id,
item.setting_group,
item.setting_type,
......@@ -559,13 +560,24 @@ export default class Parameter extends Component {
);
}
}
}, {
}, {
name: "ID",
options: {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[10] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div >
);
}
}
},{
name: "Group",
options: {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[9] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
<span style={{ color: tableMeta.rowData[10] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div >
);
}
......@@ -576,7 +588,7 @@ export default class Parameter extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[9] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
<span style={{ color: tableMeta.rowData[10] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div >
);
}
......@@ -587,7 +599,7 @@ export default class Parameter extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[9] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
<span style={{ color: tableMeta.rowData[10] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div >
);
}
......@@ -598,7 +610,7 @@ export default class Parameter extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[9] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
<span style={{ color: tableMeta.rowData[10] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div >
);
}
......@@ -609,7 +621,7 @@ export default class Parameter extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[9] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
<span style={{ color: tableMeta.rowData[10] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div >
);
}
......@@ -620,7 +632,7 @@ export default class Parameter extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[9] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
<span style={{ color: tableMeta.rowData[10] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div >
);
}
......@@ -631,7 +643,7 @@ export default class Parameter extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[9] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
<span style={{ color: tableMeta.rowData[10] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div >
);
}
......@@ -642,7 +654,7 @@ export default class Parameter extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[9] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
<span style={{ color: tableMeta.rowData[10] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div >
);
}
......@@ -653,7 +665,7 @@ export default class Parameter extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[9] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
<span style={{ color: tableMeta.rowData[10] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div >
);
}
......
......@@ -10,6 +10,7 @@ import UnitBisnis from '../container/MasterData/UnitBisnis'
import Parameter from '../container/MasterData/Parameter/Parameter'
import ReportItems from '../container/MasterData/ReportItems'
import DashboardCAT from '../container/Laporan/DashboardCAT'
import BudgetTahunan from '../container/BudgetTahunan';
const routes = [
{
......@@ -30,7 +31,7 @@ const routes = [
},
{
path: "/home/master-budget",
main: BalanceSheet
main: BudgetTahunan
},
{
path: "/home/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