Commit 5b2f6f1d authored by a.bairuha's avatar a.bairuha

update

parent 5b1197fb
...@@ -456,9 +456,9 @@ export default class CreateApprovalMatrix extends Component { ...@@ -456,9 +456,9 @@ export default class CreateApprovalMatrix extends Component {
</div> </div>
</div> */} </div> */}
</div> </div>
<div className="margin-top-10px" style={{ padding: 10, paddingLeft: 0 }}> <div className="margin-top-10px" style={{ paddingTop: 10, paddingBottom: 10, paddingLeft: 10, paddingRight: 30 }}>
<Typography style={{ fontSize: 11 }}>{`Created by : `}</Typography> <Typography style={{ fontSize: 11 }}>{`Created By : `}</Typography>
{/* <Typography style={{ fontSize: 11 }}>Diubah : Admin - 21 Jul 2020, 18:45</Typography> */} <Typography style={{ fontSize: 11 }}>{`Updated By :`}</Typography>
</div> </div>
</div> </div>
<div className="border-top grid grid-2x" style={{ height: 56, backgroundColor: '#f5f5f5', paddingLeft: 20, paddingRight: 20 }}> <div className="border-top grid grid-2x" style={{ height: 56, backgroundColor: '#f5f5f5', paddingLeft: 20, paddingRight: 20 }}>
......
...@@ -489,13 +489,13 @@ export default class EditApprovalMatrix extends Component { ...@@ -489,13 +489,13 @@ export default class EditApprovalMatrix extends Component {
</div> */} </div> */}
</div> </div>
</div> </div>
<div className="margin-top-10px" style={{ padding: 10, paddingLeft: 0, borderRadius: 5 }}> <div className="margin-top-10px" style={{ paddingTop: 10, paddingBottom: 10, paddingLeft: 10, paddingRight: 20 }}>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<Typography style={{ fontSize: 11, width: '20%' }}>Created by</Typography> <Typography style={{ fontSize: 11, width: '12%' }}>Created By</Typography>
<Typography style={{ fontSize: 11 }}>: {this.state.created}</Typography> <Typography style={{ fontSize: 11 }}>: {this.state.created}</Typography>
</div> </div>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<Typography style={{ fontSize: 11, width: '20%' }}>Updated by</Typography> <Typography style={{ fontSize: 11, width: '12%' }}>Updated By</Typography>
<Typography style={{ fontSize: 11 }}>: {this.state.updated == - null ? "" : this.state.updated}</Typography> <Typography style={{ fontSize: 11 }}>: {this.state.updated == - null ? "" : this.state.updated}</Typography>
</div> </div>
</div> </div>
......
...@@ -45,22 +45,26 @@ export default class VisualisasiAM extends Component { ...@@ -45,22 +45,26 @@ export default class VisualisasiAM extends Component {
getTypeData() { getTypeData() {
api.create().getTypeAM().then((response) => { api.create().getTypeAM().then((response) => {
if (response.data.status == 'success') { if (response.data) {
let data = response.data.data if (response.data.status == 'success') {
// console.log(data) let data = response.data.data
let typeData = data.map((item) => { // console.log(data)
return { let typeData = data.map((item) => {
approval_type_id: item.approval_type_id, return {
approval_type_name: item.approval_type_name approval_type_id: item.approval_type_id,
} approval_type_name: item.approval_type_name
}) }
let typeProps = { })
options: typeData, let typeProps = {
getOptionLabel: (option) => option.approval_type_name, options: typeData,
}; getOptionLabel: (option) => option.approval_type_name,
this.setState({ types: typeProps, typeData: response.data.data }) };
this.setState({ types: typeProps, typeData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' })
}
} else { } else {
alert(response.data.message) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
...@@ -71,28 +75,32 @@ export default class VisualisasiAM extends Component { ...@@ -71,28 +75,32 @@ export default class VisualisasiAM extends Component {
"keyword": this.state.typeName "keyword": this.state.typeName
} }
api.create().searchAM(body).then(response => { api.create().searchAM(body).then(response => {
if (response.data.status == 'success') { if (response.data) {
let data = response.data.data if (response.data.status == 'success') {
// console.log(data) let data = response.data.data
let listVisual = [] // console.log(data)
data.map((item, index) => { let listVisual = []
let indexId = listVisual.findIndex((val) => val.orderId == item.orders) data.map((item, index) => {
if(indexId == -1){ let indexId = listVisual.findIndex((val) => val.orderId == item.orders)
listVisual.push({ if(indexId == -1){
orderId: item.orders, listVisual.push({
data: [item] orderId: item.orders,
}) data: [item]
// console.log(listVisual); })
} else { // console.log(listVisual);
listVisual[indexId].data.push(item) } else {
// console.log('listVisual'); listVisual[indexId].data.push(item)
// console.log(listVisual); // console.log('listVisual');
} // console.log(listVisual);
}) }
this.setState({ listApproval: listVisual}) })
// console.log(listVisual); this.setState({ listApproval: listVisual})
// console.log(listVisual);
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' })
}
} else { } else {
alert(response.data.message) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
......
...@@ -75,21 +75,25 @@ export default class CreateParameter extends Component { ...@@ -75,21 +75,25 @@ export default class CreateParameter extends Component {
getDetailParameter() { getDetailParameter() {
api.create().getDetailParameter(this.props.data[0]).then((response) => { api.create().getDetailParameter(this.props.data[0]).then((response) => {
console.log(response); console.log(response);
if (response.data.status === 'success') { if (response.data) {
let data = response.data.data if (response.data.status === 'success') {
this.setState({ let data = response.data.data
tempData: response.data.data, this.setState({
getSettingGroupID: data.setting_group_id, tempData: response.data.data,
getCompanyID: data.company_id, getSettingGroupID: data.setting_group_id,
settingType: data.setting_type, getCompanyID: data.company_id,
}, () => { settingType: data.setting_type,
this.getAllGroup() }, () => {
this.getPerusahaan() this.getAllGroup()
this.getParameterByGroup(data.setting_group_id) this.getPerusahaan()
console.log(this.state.tempData) this.getParameterByGroup(data.setting_group_id)
}) console.log(this.state.tempData)
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' })
}
} else { } else {
alert(response.data.message) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
...@@ -97,94 +101,110 @@ export default class CreateParameter extends Component { ...@@ -97,94 +101,110 @@ export default class CreateParameter extends Component {
getAllGroup() { getAllGroup() {
api.create().getAllGroup().then(response => { api.create().getAllGroup().then(response => {
console.log(response); console.log(response);
if (response.data.status == 'success') { if (response.data) {
let data = response.data.data if (response.data.status == 'success') {
let typeData = data.map((item) => { let data = response.data.data
return { let typeData = data.map((item) => {
setting_group_id: item.setting_group_id, return {
setting_group_name: item.setting_group_name setting_group_id: item.setting_group_id,
} setting_group_name: item.setting_group_name
}) }
let index = typeData.findIndex((val) => val.setting_group_id == this.state.getSettingGroupID) })
let typeProps = { let index = typeData.findIndex((val) => val.setting_group_id == this.state.getSettingGroupID)
options: typeData, let typeProps = {
getOptionLabel: (option) => option.setting_group_name, options: typeData,
}; getOptionLabel: (option) => option.setting_group_name,
this.setState({ types: typeProps, typeData: response.data.data, getTypes: index == -1 ? typeData[0] : typeData[index] }) };
this.setState({ types: typeProps, typeData: response.data.data, getTypes: index == -1 ? typeData[0] : typeData[index] })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' })
}
} else { } else {
alert(response.data.message) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
getPerusahaan() { getPerusahaan() {
api.create().getPerusahaanActive().then(response => { api.create().getPerusahaanActive().then(response => {
if (response.data.status == 'success') { if (response.data) {
let data = response.data.data if (response.data.status == 'success') {
let perusahaanData = data.map((item) => { let data = response.data.data
return { let perusahaanData = data.map((item) => {
company_id: item.company_id, return {
company_name: item.company_name company_id: item.company_id,
} company_name: item.company_name
}) }
perusahaanData.push({ })
company_id: 0, perusahaanData.push({
company_name: 'Default' company_id: 0,
}) company_name: 'Default'
let index = perusahaanData.sort((a, b) => a.company_id - b.company_id).findIndex((val) => val.company_id == this.state.getCompanyID) })
let typeProps = { let index = perusahaanData.sort((a, b) => a.company_id - b.company_id).findIndex((val) => val.company_id == this.state.getCompanyID)
options: perusahaanData, let typeProps = {
getOptionLabel: (option) => option.company_name, options: perusahaanData,
}; getOptionLabel: (option) => option.company_name,
this.setState({ perusahaan: typeProps, perusahaanData: response.data.data, getPerusahaan: index == -1 ? null : perusahaanData[index], msgErrorPerusahaan: index === -1 ? 'Company has been inactive' : "", errorPerusahaan: index === -1 ? true : false }) };
this.setState({ perusahaan: typeProps, perusahaanData: response.data.data, getPerusahaan: index == -1 ? null : perusahaanData[index], msgErrorPerusahaan: index === -1 ? 'Company has been inactive' : "", errorPerusahaan: index === -1 ? true : false })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' })
}
} else { } else {
alert(response.data.message) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
getDataGroup() { getDataGroup() {
api.create().getAllGroup().then((response) => { api.create().getAllGroup().then((response) => {
if (response.data.status == 'success') { if (response.data) {
let data = response.data.data if (response.data.status == 'success') {
let typeData = data.map((item) => { let data = response.data.data
return { let typeData = data.map((item) => {
setting_group_id: item.setting_group_id, return {
setting_group_name: item.setting_group_name setting_group_id: item.setting_group_id,
} setting_group_name: item.setting_group_name
}) }
let typeProps = { })
options: typeData, let typeProps = {
getOptionLabel: (option) => option.setting_group_name, options: typeData,
}; getOptionLabel: (option) => option.setting_group_name,
this.setState({ types: typeProps, typeData: response.data.data }) };
this.setState({ types: typeProps, typeData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' })
}
} else { } else {
alert(response.data.message) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
getDataPerusahaan() { getDataPerusahaan() {
api.create().getPerusahaanActive().then((response) => { api.create().getPerusahaanActive().then((response) => {
if (response.data.status == 'success') { if (response.data) {
let data = response.data.data if (response.data.status == 'success') {
let typeData = data.map((item) => { let data = response.data.data
return { let typeData = data.map((item) => {
company_id: item.company_id, return {
company_name: item.company_name company_id: item.company_id,
} company_name: item.company_name
}) }
typeData.push({ })
company_id: 0, typeData.push({
company_name: 'Default' company_id: 0,
}) company_name: 'Default'
let typeProps = { })
options: typeData.sort((a, b) => a.company_id - b.company_id), let typeProps = {
getOptionLabel: (option) => option.company_name, options: typeData.sort((a, b) => a.company_id - b.company_id),
}; getOptionLabel: (option) => option.company_name,
this.setState({ perusahaan: typeProps, perusahaanData: response.data.data }) };
this.setState({ perusahaan: typeProps, perusahaanData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' })
}
} else { } else {
alert(response.data.message) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
...@@ -192,22 +212,26 @@ export default class CreateParameter extends Component { ...@@ -192,22 +212,26 @@ export default class CreateParameter extends Component {
getParameterByGroup(id) { getParameterByGroup(id) {
api.create().getParameterByGroup(id).then(response => { api.create().getParameterByGroup(id).then(response => {
console.log(response); console.log(response);
if (response.data.status == 'success') { if (response.data) {
let data = response.data.data if (response.data.status == 'success') {
let typeData = data.map((item) => { let data = response.data.data
return { let typeData = data.map((item) => {
setting_type_id: item.setting_type_id, return {
setting_type_name: item.setting_type_name setting_type_id: item.setting_type_id,
} setting_type_name: item.setting_type_name
}) }
let index = typeData.findIndex((val) => val.setting_type_id == this.state.getSettingTypeID) })
let typeProps = { let index = typeData.findIndex((val) => val.setting_type_id == this.state.getSettingTypeID)
options: typeData, let typeProps = {
getOptionLabel: (option) => option.setting_type_name, options: typeData,
}; getOptionLabel: (option) => option.setting_type_name,
this.setState({ enableParameter: true, parameter: typeProps, parameterData: response.data.data, getParameter: index == -1 ? typeData[0] : typeData[index] }) };
this.setState({ enableParameter: true, parameter: typeProps, parameterData: response.data.data, getParameter: index == -1 ? typeData[0] : typeData[index] })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' })
}
} else { } else {
alert(response.data.message) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
...@@ -378,7 +402,7 @@ export default class CreateParameter extends Component { ...@@ -378,7 +402,7 @@ export default class CreateParameter extends Component {
} else if ((!R.isNil(this.state.minValue) && R.isNil(this.state.maxValue)) || (!R.isNil(this.state.minValue) && R.isEmpty(this.state.maxValue))) { } else if ((!R.isNil(this.state.minValue) && R.isNil(this.state.maxValue)) || (!R.isNil(this.state.minValue) && R.isEmpty(this.state.maxValue))) {
this.setState({ errorMaxValue: true, msgErrorMaxValue: 'Max Value Cannot be Empty.' }) this.setState({ errorMaxValue: true, msgErrorMaxValue: 'Max Value Cannot be Empty.' })
} else if (R.isNil(this.state.endDate)) { } else if (R.isNil(this.state.endDate)) {
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' }) this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty.' })
} else { } else {
this.createParameter() this.createParameter()
} }
......
...@@ -179,26 +179,30 @@ export default class Parameter extends Component { ...@@ -179,26 +179,30 @@ export default class Parameter extends Component {
} }
api.create().searchParameter(body).then(response => { api.create().searchParameter(body).then(response => {
console.log(response.data); console.log(response.data);
if (response.data.status == 'success') { if (response.data) {
let data = response.data.data if (response.data.status == 'success') {
let listData = data.map((item, index) => { let data = response.data.data
return [ let listData = data.map((item, index) => {
item.setting_id, return [
item.setting_id, item.setting_id,
item.setting_group, item.setting_id,
item.setting_type, item.setting_group,
item.company_name, item.setting_type,
item.description, item.company_name,
item.order, item.description,
item.value, item.order,
item.min_value, item.value,
item.max_value, item.min_value,
item.status item.max_value,
] item.status
}) ]
this.setState({ dataTable: listData, listData: response.data.data }) })
this.setState({ dataTable: listData, listData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' })
}
} else { } else {
alert(response.data.message) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
......
...@@ -830,14 +830,14 @@ export default class CreateReportItems extends Component { ...@@ -830,14 +830,14 @@ export default class CreateReportItems extends Component {
</div> </div>
</div> </div>
<div className="margin-top-10px" style={{ padding: 20}}> <div className="margin-top-10px" style={{ paddingTop: 10, paddingBottom: 30, paddingRight: 30, paddingLeft: 30}}>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<Typography style={{ fontSize: 11, width: '13%' }}>Created By</Typography> <Typography style={{ fontSize: 11, width: '13%' }}>Created By :</Typography>
<Typography style={{ fontSize: 11 }}>: </Typography> {/* <Typography style={{ fontSize: 11 }}>: </Typography> */}
</div> </div>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<Typography style={{ fontSize: 11, width: '13%' }}>Updated By</Typography> <Typography style={{ fontSize: 11, width: '13%' }}>Updated By :</Typography>
<Typography style={{ fontSize: 11 }}>: </Typography> {/* <Typography style={{ fontSize: 11 }}>: </Typography> */}
</div> </div>
</div> </div>
......
...@@ -796,13 +796,13 @@ export default class EditReportItems extends Component { ...@@ -796,13 +796,13 @@ export default class EditReportItems extends Component {
</div> </div>
</div> </div>
</div> </div>
<div className="margin-top-10px" style={{ padding: 20}}> <div className="margin-top-10px" style={{ paddingTop: 10, paddingBottom: 30, paddingRight: 30, paddingLeft: 30}}>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<Typography style={{ fontSize: 11, width: '13%' }}>Created By</Typography> <Typography style={{ fontSize: 11, width: '12%' }}>Created By</Typography>
<Typography style={{ fontSize: 11 }}>: {this.state.tempData === null ? "" : this.state.tempData.created}</Typography> <Typography style={{ fontSize: 11 }}>: {this.state.tempData === null ? "" : this.state.tempData.created}</Typography>
</div> </div>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<Typography style={{ fontSize: 11, width: '13%' }}>Updated By</Typography> <Typography style={{ fontSize: 11, width: '12%' }}>Updated By</Typography>
<Typography style={{ fontSize: 11 }}>: {this.state.tempData === null ? "" : this.state.tempData.updated}</Typography> <Typography style={{ fontSize: 11 }}>: {this.state.tempData === null ? "" : this.state.tempData.updated}</Typography>
</div> </div>
</div> </div>
......
...@@ -689,7 +689,7 @@ export default class EditUser extends Component { ...@@ -689,7 +689,7 @@ export default class EditUser extends Component {
</div> </div>
</div> </div>
</div> </div>
<div style={{ flexDirection: 'column', display: 'flex', paddingLeft: 20, paddingRight: 20 }}> <div style={{ flexDirection: 'column', display: 'flex', paddingLeft: 30, paddingRight: 30 }}>
<Typography style={{ fontSize: 11 }}>{`Created By : ${this.state.tempData === null ? '' : this.state.tempData.created}`}</Typography> <Typography style={{ fontSize: 11 }}>{`Created By : ${this.state.tempData === null ? '' : this.state.tempData.created}`}</Typography>
<Typography style={{ fontSize: 11 }}>{`Updated By : ${this.state.tempData === null ? '' : this.state.tempData.updated}`}</Typography> <Typography style={{ fontSize: 11 }}>{`Updated By : ${this.state.tempData === null ? '' : this.state.tempData.updated}`}</Typography>
</div> </div>
......
...@@ -507,7 +507,7 @@ export default class EditRole extends Component { ...@@ -507,7 +507,7 @@ export default class EditRole extends Component {
</div> </div>
</div> </div>
</div> </div>
<div style={{ flexDirection: 'column', display: 'flex', paddingLeft: 20, paddingRight: 20 }}> <div style={{ flexDirection: 'column', display: 'flex', paddingLeft: 30, paddingRight: 30 }}>
<Typography style={{ fontSize: 11 }}>{`Created By : ${this.state.tempData === null ? '' : (this.state.tempData.created === null ? '-' : this.state.tempData.created)}`}</Typography> <Typography style={{ fontSize: 11 }}>{`Created By : ${this.state.tempData === null ? '' : (this.state.tempData.created === null ? '-' : this.state.tempData.created)}`}</Typography>
<Typography style={{ fontSize: 11 }}>{`Updated By : ${this.state.tempData === null ? '' : (this.state.tempData.updated === null ? '-' : this.state.tempData.updated)}`}</Typography> <Typography style={{ fontSize: 11 }}>{`Updated By : ${this.state.tempData === null ? '' : (this.state.tempData.updated === null ? '-' : this.state.tempData.updated)}`}</Typography>
</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