Commit f45b37e1 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'riri' into 'master'

apdet

See merge request !127
parents 90ca8295 814f6c50
......@@ -465,12 +465,11 @@ export default class ReportItems extends Component {
openPopUp(index, type) {
if (type === 'edit') {
this.setState({
selectIndex: index,
rowData: index,
edit: true
})
} else {
this.setState({
data: this.state.listData[index],
add: true
})
}
......@@ -564,6 +563,7 @@ export default class ReportItems extends Component {
const columns = [{
name: "Action",
options: {
sort: false,
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
......@@ -573,7 +573,7 @@ export default class ReportItems extends Component {
cursor: 'pointer',
borderColor: 'transparent'
}}
onClick={() => this.openPopUp(tableMeta.rowIndex, 'edit')}
onClick={() => this.openPopUp(tableMeta.rowData, 'edit')}
>
<img src={Images.editCopy} />
......@@ -875,7 +875,7 @@ export default class ReportItems extends Component {
{this.state.edit && (
<EditReportItems
onClickClose={() => this.setState({ edit: false })}
data={this.state.listData[this.state.selectIndex]}
data={this.state.rowData}
refresh={this.getData.bind(this)}
updateReportItems={this.updateReportItems.bind(this)}
/>
......
......@@ -18,7 +18,7 @@ export default class CreateReportItems extends Component {
reportType: null,
startDate: null,
endDate: null,
order: null,
order: '',
description: '',
uom: '',
weight: null,
......@@ -55,6 +55,12 @@ export default class CreateReportItems extends Component {
this.getPerusahaan()
this.getReportType()
// this.getParent()
let date = format(new Date, 'yyyy-MM-dd')
console.log(date);
this.setState({
startDate: date,
endDate: date
})
}
......@@ -145,7 +151,7 @@ export default class CreateReportItems extends Component {
"company_id": this.state.company.company_id,
"description": this.state.description,
"orders": this.state.order,
"parent": this.state.parent.item_report_id,
"parent": this.state.parent === null ? null : this.state.parent.item_report_id,
"type_report_id": this.state.InputType.type_report_id,
"formula": this.state.formula,
"uom": this.state.uom,
......@@ -158,12 +164,14 @@ export default class CreateReportItems extends Component {
console.log(payload)
api.create().createReportItems(payload).then((response) => {
console.log(response)
if (response.data) {
if (response.data.status === 'success') {
this.props.onClickClose()
this.props.refresh()
} else {
alert(response.data.message)
}
}
})
}
......@@ -267,7 +275,6 @@ export default class CreateReportItems extends Component {
}
render() {
const { startDate, endDate } = this.state;
return (
<div className="test app-popup-show">
......@@ -301,14 +308,12 @@ export default class CreateReportItems extends Component {
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085',
}
......@@ -329,12 +334,11 @@ export default class CreateReportItems extends Component {
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontWeight: 600, fontFamily: 'Nunito Sans, sans-serif' } }}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.reportType}
/>
......@@ -356,12 +360,11 @@ export default class CreateReportItems extends Component {
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontWeight: 600, fontFamily: 'Nunito Sans, sans-serif' } }}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.company}
/>
......@@ -374,22 +377,19 @@ export default class CreateReportItems extends Component {
id="orders"
name="order"
label="Order"
onChange={(e) => this.handleChange(e, '')}
onChange={(e) => this.handleChange(e, null)}
value={this.state.order}
error={this.state.errorOrder}
helperText={this.state.msgErrorOrder}
onChange={(e) => this.handleChange(e, '')}
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085',
}
......@@ -416,14 +416,12 @@ export default class CreateReportItems extends Component {
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085',
}
......@@ -446,12 +444,11 @@ export default class CreateReportItems extends Component {
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontWeight: 600, fontFamily: 'Nunito Sans, sans-serif' } }}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.parent}
/>
......@@ -472,14 +469,12 @@ export default class CreateReportItems extends Component {
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085',
}
......@@ -500,14 +495,12 @@ export default class CreateReportItems extends Component {
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085',
}
......@@ -537,12 +530,11 @@ export default class CreateReportItems extends Component {
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontWeight: 600, fontFamily: 'Nunito Sans, sans-serif' } }}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.InputType}
/>
......@@ -563,14 +555,12 @@ export default class CreateReportItems extends Component {
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085',
}
......@@ -597,14 +587,12 @@ export default class CreateReportItems extends Component {
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085',
}
......@@ -628,12 +616,11 @@ export default class CreateReportItems extends Component {
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontWeight: 600, fontFamily: 'Nunito Sans, sans-serif' } }}
InputProps={{ ...params.InputProps, style: { fontSize: 11,fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
/>
</div>
......@@ -648,7 +635,7 @@ export default class CreateReportItems extends Component {
id="startDate"
label="Berlaku Mulai"
format="dd MMMM yyyy"
value={this.state.startDate}
value={this.state.startDate == "" ? null : this.state.startDate}
error={this.state.errorStartDate}
helperText={this.state.msgErrorSD}
onChange={(e) => this.handleChange(e, 'start_date')}
......@@ -658,7 +645,6 @@ export default class CreateReportItems extends Component {
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
......@@ -666,7 +652,6 @@ export default class CreateReportItems extends Component {
style: {
fontSize: 11,
color: '#7e8085',
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
......@@ -682,7 +667,7 @@ export default class CreateReportItems extends Component {
id="endDate"
label="Berlaku Hingga"
format="dd MMMM yyyy"
value={this.state.endDate}
value={this.state.endDate == "" ? null : this.state.endDate}
error={this.state.errorEndDate}
helperText={this.state.msgErrorED}
onChange={(e) => this.handleChange(e, 'end_date')}
......@@ -693,7 +678,6 @@ export default class CreateReportItems extends Component {
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
......@@ -701,7 +685,6 @@ export default class CreateReportItems extends Component {
style: {
fontSize: 11,
color: '#7e8085',
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
......@@ -724,14 +707,12 @@ export default class CreateReportItems extends Component {
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085',
}
......
......@@ -53,7 +53,6 @@ export default class EditReportItems extends Component {
}
componentDidMount() {
// console.log(this.props.data);
this.getDetailReportItems();
}
......@@ -124,7 +123,15 @@ export default class EditReportItems extends Component {
else if (this.state.InputType.type_report_name === 'Formula' || this.state.InputType.type_report_name === 'Validation' && R.isEmpty(this.state.tempData.formula)) {
this.setState({errorFormula: true, msgErrorFormula: 'Formula Harus Diisi'})
}
else {
else if (this.state.InputType.type_report_name === 'Validation' && R.isEmpty(this.state.tempData.condition_it_should_be)) {
this.setState({errorRV: true, msgErrorRV: 'Nilai Seharusnya Harus Diisi'})
}
else if (this.state.InputType.type_report_name === 'Validation' && R.isNil(this.state.condition)) return alert("Kondisi Jika Salah is Required.");
else if (R.isNil(this.state.tempData.start_date)) {
this.setState({ errorStartDate: true, msgErrorSD: 'Start Date Harus Diisi' })
} else if (R.isNil(this.state.tempData.end_date)) {
this.setState({ errorEndDate: true, msgErrorED: 'End Date Harus Diisi' })
} else {
this.updateReportItems()
}
......@@ -149,24 +156,22 @@ export default class EditReportItems extends Component {
"end_date": this.state.tempData.end_date
}
console.log(payload)
api.create().updateReportItems(payload).then((response) => {
if (response.data.status === 'success') {
this.props.onClickClose()
this.props.refresh()
} else {
alert(response.data.message)
}
})
// api.create().updateReportItems(payload).then((response) => {
// if (response.data) {
// if (response.data.status === 'success') {
// this.props.onClickClose()
// this.props.refresh()
// } else {
// alert(response.data.message)
// }
// }
// })
}
getDetailReportItems() {
api.create().getDetailReportItems(this.props.data.item_report_id).then((response) => {
this.getInputType()
this.getPerusahaan()
this.getReportType()
this.getParent()
api.create().getDetailReportItems(this.props.data[1]).then((response) => {
if (response.data.status === 'success') {
this.setState({ tempData: response.data.data})
this.setState({ tempData: response.data.data}, () => this.getInputType(), this.getPerusahaan(), this.getReportType(),)
console.log(response.data.data)
} else {
alert(response.data.message)
......@@ -215,7 +220,7 @@ export default class EditReportItems extends Component {
};
let index = companyData.findIndex((val) => val.company_id === this.state.tempData.company_id)
this.setState({listCompany: defaultProps, company: index === -1 ? null : companyData[index]})
this.setState({listCompany: defaultProps, company: index === -1 ? null : companyData[index]}, () => this.getParent())
} else {
alert(response.data.message)
}
......@@ -239,7 +244,7 @@ export default class EditReportItems extends Component {
};
let index = reportTypeData.findIndex((val) => val.report_id === this.state.tempData.report_id)
this.setState({listReportType: defaultProps, reportType: index === -1 ? null: reportTypeData[index]})
this.setState({listReportType: defaultProps, reportType: index === -1 ? null: reportTypeData[index]}, () => this.getParent())
} else {
alert(response.data.message)
}
......@@ -276,12 +281,11 @@ export default class EditReportItems extends Component {
}
render() {
const { startDate, endDate } = this.state;
return (
<div className="test app-popup-show">
<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="popup-title">
<span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Edit Data</span>
......@@ -298,8 +302,7 @@ export default class EditReportItems extends Component {
</div>
</div>
<div className="border-bottom grid grid-2x grid-mobile-none gap-15px" style={{ padding: 20 }}>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
<TextField
......@@ -313,20 +316,45 @@ export default class EditReportItems extends Component {
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif'
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
/>
</div>
</div>
<div className="column-2">
<div className="margin-top-10px" style={{padding: 10}}>
<Autocomplete
{...this.state.listReportType}
id="reportType"
onChange={(event, newInputValue) => this.setState({reportType: newInputValue}, () => this.getParent())}
debug
renderInput={(params) =>
<TextField {...params}
label="Jenis Laporan"
InputLabelProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.reportType}
/>
</div>
</div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{padding: 10}} >
<Autocomplete
{...this.state.listCompany}
......@@ -339,37 +367,36 @@ export default class EditReportItems extends Component {
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontWeight: 600, fontFamily: 'Nunito Sans, sans-serif' } }}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.company}
/>
</div>
<div style={{ padding: 10, borderRadius: 5 }}>
</div>
<div className="column-2">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<TextField
style={{ width: '100%' }}
id="description"
label="Deskripsi"
name="description"
error={this.state.errorDesc}
helperText={this.state.msgErrorDesc}
id="order"
label="Order"
name="order"
value={this.state.tempData === null ? '' : this.state.tempData.order}
error={this.state.errorOrder}
helperText={this.state.msgErrorOrder}
onChange={(e) => this.handleChange(e, '')}
value={this.state.tempData === null ? '' : this.state.tempData.description}
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif'
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
......@@ -377,25 +404,29 @@ export default class EditReportItems extends Component {
>
</TextField>
</div>
<div style={{ padding: 10, borderRadius: 5 }}>
</div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<TextField
style={{ width: '100%' }}
id="uom"
label="UOM"
name="uom"
id="description"
label="Deskripsi"
name="description"
error={this.state.errorDesc}
helperText={this.state.msgErrorDesc}
onChange={(e) => this.handleChange(e, '')}
value={this.state.tempData === null ? '' : this.state.tempData.uom}
value={this.state.tempData === null ? '' : this.state.tempData.description}
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif'
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
......@@ -403,152 +434,77 @@ export default class EditReportItems extends Component {
>
</TextField>
</div>
<div className="margin-top-10px" style={{padding: 10}}>
</div>
<div className="column-2">
<div className="margin-top-10px" style={{padding: 10}} >
<Autocomplete
{...this.state.listInputType}
id="inputType"
onChange={(event, newInputValue) => this.setState({InputType: newInputValue}, () => console.log(this.state.InputType))}
{...this.state.listParent}
id="parentId"
onChange={(event, newInputValue) => this.setState({parent: newInputValue})}
disabled={this.state.reportType == null || this.state.company == null}
debug
renderInput={(params) =>
<TextField {...params}
label="Tipe Data"
label="Parent ID"
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontWeight: 600, fontFamily: 'Nunito Sans, sans-serif' } }}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.InputType}
value={this.state.parent}
/>
</div>
<div className="margin-top-10px" style={{ padding: 10 }}>
<TextField
style={{ width: '100%' }}
id="condition_it_should_be"
label="Nilai Seharusnya"
disabled={this.state.InputType == null? true : (this.state.InputType.type_report_name === 'Validation'? false : true)}
name="condition_it_should_be"
onChange={(e) => this.handleChange(e, '')}
value={this.state.tempData === null ? '' : this.state.tempData.condition_it_should_be}
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif'
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
/>
</div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<DatePicker
margin="normal"
id="startDate"
label="Berlaku Mulai"
format="dd MMMM yyyy"
value={this.state.tempData === null ? null : this.state.tempData.start_date}
error={this.state.errorStartDate}
helperText={this.state.msgErrorSD}
onChange={(e) => this.handleChange(e, 'start_date')}
KeyboardButtonProps={{
'aria-label': 'change date',
}}
style={{ padding: 0, margin: 0, width: '100%' }}
/>
</div>
<div className="margin-top-10px" style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<TextField
style={{ width: '100%' }}
value={this.state.tempData === null ? '' : this.state.tempData.status}
id="status"
label="Status"
disabled
id="uom"
label="UOM"
name="uom"
onChange={(e) => this.handleChange(e, '')}
value={this.state.tempData === null ? '' : this.state.tempData.uom}
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif'
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
/>
</div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<div style={{display: 'flex'}}>
<Typography style={{ fontSize: 11, width: '20%' }}>Dibuat</Typography>
<Typography style={{ fontSize: 11 }}>: Admin - 21 Jul 2020, 18:45</Typography>
</div>
<div style={{display: 'flex'}}>
<Typography style={{ fontSize: 11, width: '20%' }}>Diubah</Typography>
<Typography style={{ fontSize: 11 }}>: Admin - 21 Jul 2020, 18:45</Typography>
</div>
>
</TextField>
</div>
</div>
<div className="column-2">
<div className="margin-top-10px" style={{padding: 10}}>
<Autocomplete
{...this.state.listReportType}
id="reportType"
onChange={(event, newInputValue) => this.setState({reportType: newInputValue}, () => this.getParent())}
debug
renderInput={(params) =>
<TextField {...params}
label="Jenis Laporan"
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontWeight: 600, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.reportType}
/>
</div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<TextField
style={{ width: '100%' }}
id="order"
label="Order"
name="order"
value={this.state.tempData === null ? '' : this.state.tempData.order}
error={this.state.errorOrder}
helperText={this.state.msgErrorOrder}
id="weight"
label="Weight"
name="weight"
onChange={(e) => this.handleChange(e, '')}
value={this.state.tempData === null ? '' : this.state.tempData.weight}
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif'
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
......@@ -556,48 +512,58 @@ export default class EditReportItems extends Component {
>
</TextField>
</div>
<div style={{padding: 10}} >
</div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{padding: 10}}>
<Autocomplete
{...this.state.listParent}
id="parentId"
onChange={(event, newInputValue) => this.setState({parent: newInputValue})}
disabled={this.state.reportType == null || this.state.company == null}
{...this.state.listInputType}
id="inputType"
onChange={(event, newInputValue) =>
this.setState({InputType: newInputValue,
tempData: {...this.state.tempData, formula: '', condition_it_should_be: '', condition_if_wrong: ''},
errorFormula: false, msgErrorFormula: '',
errorRV: false, msgErrorRV: ''},
() => console.log(this.state.InputType))}
debug
renderInput={(params) =>
<TextField {...params}
label="Parent ID"
label="Tipe Data"
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontWeight: 600, fontFamily: 'Nunito Sans, sans-serif' } }}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.parent}
value={this.state.InputType}
/>
</div>
<div style={{ padding: 10, borderRadius: 5 }}>
</div>
<div className="column-2">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<TextField
style={{ width: '100%' }}
id="weight"
label="Weight"
name="weight"
id="formula"
label="Formula"
disabled={this.state.InputType == null? true : (this.state.InputType.type_report_name === 'Formula' || this.state.InputType.type_report_name === 'Validation'? false : true)}
name="formula"
error={this.state.errorFormula}
helperText={this.state.msgErrorFormula}
onChange={(e) => this.handleChange(e, '')}
value={this.state.tempData === null ? '' : this.state.tempData.weight}
value={this.state.tempData === null ? '' : this.state.tempData.formula}
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif'
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
......@@ -605,35 +571,38 @@ export default class EditReportItems extends Component {
>
</TextField>
</div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
</div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{ padding: 10 }}>
<TextField
style={{ width: '100%' }}
id="formula"
label="Formula"
disabled={this.state.InputType == null? true : (this.state.InputType.type_report_name === 'Formula' || this.state.InputType.type_report_name === 'Validation'? false : true)}
name="formula"
error={this.state.errorFormula}
helperText={this.state.msgErrorFormula}
id="condition_it_should_be"
label="Nilai Seharusnya"
error={this.state.errorRV}
helperText={this.state.msgErrorRV}
disabled={this.state.InputType == null? true : (this.state.InputType.type_report_name === 'Validation'? false : true)}
name="condition_it_should_be"
onChange={(e) => this.handleChange(e, '')}
value={this.state.tempData === null ? '' : this.state.tempData.formula}
value={this.state.tempData === null ? '' : this.state.tempData.condition_it_should_be}
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif'
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
>
</TextField>
/>
</div>
</div>
<div className="column-2">
<div className="margin-top-10px" style={{padding: 10}}>
<Autocomplete
value={this.state.tempData === null ? '' : this.state.tempData.condition}
......@@ -649,15 +618,36 @@ export default class EditReportItems extends Component {
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontWeight: 600, fontFamily: 'Nunito Sans, sans-serif' } }}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
/>
</div>
</div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<DatePicker
margin="normal"
id="startDate"
label="Berlaku Mulai"
format="dd MMMM yyyy"
value={this.state.tempData === null ? null : this.state.tempData.start_date}
error={this.state.errorStartDate}
helperText={this.state.msgErrorSD}
onChange={(e) => this.handleChange(e, 'start_date')}
KeyboardButtonProps={{
'aria-label': 'change date',
}}
style={{ padding: 0, margin: 0, width: '100%' }}
/>
</div>
</div>
<div className="column-2">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<DatePicker
margin="normal"
......@@ -677,7 +667,46 @@ export default class EditReportItems extends Component {
/>
</div>
</div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
<TextField
style={{ width: '100%' }}
value={this.state.tempData === null ? '' : this.state.tempData.status}
id="status"
label="Status"
disabled
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif'
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
/>
</div>
</div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<div style={{display: 'flex'}}>
<Typography style={{ fontSize: 11, width: '20%' }}>Dibuat</Typography>
<Typography style={{ fontSize: 11 }}>: Admin - 21 Jul 2020, 18:45</Typography>
</div>
<div style={{display: 'flex'}}>
<Typography style={{ fontSize: 11, width: '20%' }}>Diubah</Typography>
<Typography style={{ fontSize: 11 }}>: Admin - 21 Jul 2020, 18:45</Typography>
</div>
</div>
</div>
</div>
<div className="border-top grid grid-2x" style={{ height: 56, backgroundColor: '#f5f5f5', paddingLeft: 20, paddingRight: 20 }}>
......
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