Commit 6a516f21 authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

update doc manag

parent 1c026c14
......@@ -259,13 +259,13 @@ export default class getAllDocument extends Component {
}
}, "File Name", "Description", "Company Name",
{
name: "Monthly",
name: "Period Month",
options: {
display: String(this.props.data.value).includes('Manual Book TIA') ? false : true
}
},
{
name: "Period",
name: "Period Year",
options: {
display: String(this.props.data.value).includes('Manual Book TIA') ? false : true
}
......
......@@ -29,8 +29,12 @@ export default class CreateManagementDoc extends Component {
msgErrorDocument: '',
listPeriode: null,
periode: null,
errorPeriode: false,
msgErrorPeriode: '',
listMonth: null,
monthId: null,
errorMonth: false,
msgErrorMonth: '',
description: '',
errorDesc: false,
msgErrorDesc: '',
......@@ -202,6 +206,10 @@ export default class CreateManagementDoc extends Component {
msgErrorPerusahaan: '',
errorDocument: false,
msgErrorDocument: '',
errorMonth: false,
msgErrorMonth: '',
errorPeriode: false,
msgErrorPeriode: '',
})
}
......@@ -221,17 +229,16 @@ export default class CreateManagementDoc extends Component {
}
validasi() {
console.log(this.state.monthId.month_id)
if (R.isNil(this.state.getPerusahaan)) {
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company Cannot be Empty' })
} else if (R.isNil(this.state.getDocument)) {
this.setState({ errorDocument: true, msgErrorDocument: 'Category Cannot be Empty' })
}
// else if (R.isNil(this.state.periode)) {
// this.setState({ errorPeriode: true, msgErrorPeriode: 'Period Cannot be Empty' })
// } else if (R.isNil(this.state.monthId)) {
// this.setState({ errorMonth: true, msgErrorMonth: 'Month Cannot be Empty' })
// }
else if (R.isNil(this.state.periode)) {
this.setState({ errorPeriode: true, msgErrorPeriode: 'Period Cannot be Empty' })
} else if (R.isNil(this.state.monthId)) {
this.setState({ errorMonth: true, msgErrorMonth: 'Month Cannot be Empty' })
}
else if (R.isNil(this.state.file)) {
this.setState({ alert: true, messageAlert: 'File Cannot be Empty', tipeAlert: 'warning' })
} else {
......@@ -298,25 +305,6 @@ export default class CreateManagementDoc extends Component {
value={this.state.getPerusahaan}
/>
</div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete
{...this.state.listMonth}
// debug
clearOnEscape
id="month"
onChange={(event, newInputValue) => this.setState({ monthId: newInputValue }, () => {
this.clearMessage()
})}
style={{ width: 250 }}
renderInput={(params) =>
<TextField {...params} label="Monthly" margin="normal" style={{ marginTop: 7 }}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
/>}
value={this.state.monthId}
/>
</div>
</div>
<div className="column-2">
<div style={{ padding: 10, borderRadius: 5 }}>
......@@ -336,21 +324,42 @@ export default class CreateManagementDoc extends Component {
value={this.state.getDocument}
/>
</div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
</div>
<div className="column-1">
<div style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete
{...this.state.listMonth}
// debug
clearOnEscape
id="month"
onChange={(event, newInputValue) => this.setState({ monthId: newInputValue }, () => this.clearMessage())}
style={{ width: 250 }}
renderInput={(params) =>
<TextField {...params} label="Period Month" margin="normal" style={{ marginTop: 7 }}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
error={this.state.errorMonth}
helperText={this.state.msgErrorMonth}
/>}
value={this.state.monthId}
/>
</div>
</div>
<div className="column-2">
<div style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete
{...this.state.listPeriode}
// debug
clearOnEscape
id="periode"
onChange={(event, newInputValue) => this.setState({ periode: newInputValue }, () => {
this.clearMessage()
})}
onChange={(event, newInputValue) => this.setState({ periode: newInputValue }, () => this.clearMessage())}
style={{ width: 250 }}
renderInput={(params) =>
<TextField {...params} label="Period" margin="normal" style={{ marginTop: 7 }}
<TextField {...params} label="Period Year" margin="normal" style={{ marginTop: 7 }}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
error={this.state.errorPeriode}
helperText={this.state.msgErrorPeriode}
/>}
value={this.state.periode}
/>
......
......@@ -184,7 +184,7 @@ export default class DocumentManagement extends Component {
</Alert>
</Snackbar>
<div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Management Document</Typography>
<Typography style={{ fontSize: '16px', color: 'white' }}>Document Management</Typography>
</div>
<div style={{ padding: 20 }}>
<Paper style={{ padding: 20 }}>
......
......@@ -34,6 +34,10 @@ export default class EditManagementDoc extends Component {
description: '',
errorDesc: false,
msgErrorDesc: '',
errorMonth: false,
msgErrorMonth: '',
errorPeriode: false,
msgErrorPeriode: '',
file: null,
alert: false,
tipeAlert: '',
......@@ -250,6 +254,10 @@ export default class EditManagementDoc extends Component {
msgErrorPerusahaan: '',
errorDocument: false,
msgErrorDocument: '',
errorMonth: false,
msgErrorMonth: '',
errorPeriode: false,
msgErrorPeriode: '',
})
}
......@@ -277,8 +285,13 @@ export default class EditManagementDoc extends Component {
this.setState({ errorDocument: true, msgErrorDocument: 'Category Cannot be Empty' })
} else if (R.isNil(this.state.file)) {
this.setState({ alert: true, messageAlert: 'File Cannot be Empty', tipeAlert: 'warning' })
// this.setState({ errorDocument: true, msgErrorDocument: 'File Cannot be Empty' })
} else {
}
else if (R.isNil(this.state.periode)) {
this.setState({ errorPeriode: true, msgErrorPeriode: 'Period Cannot be Empty' })
} else if (R.isNil(this.state.monthId)) {
this.setState({ errorMonth: true, msgErrorMonth: 'Month Cannot be Empty' })
}
else {
const formData = new FormData();
if (this.state.file == this.state.filePath){
formData.append("updated", 0);
......@@ -355,25 +368,6 @@ export default class EditManagementDoc extends Component {
value={this.state.getPerusahaan}
/>
</div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete
{...this.state.listMonth}
// debug
clearOnEscape
id="month"
onChange={(event, newInputValue) => this.setState({ monthId: newInputValue }, () => {
this.clearMessage()
})}
style={{ width: 250 }}
renderInput={(params) =>
<TextField {...params} label="Monthly" margin="normal" style={{ marginTop: 7 }}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
/>}
value={this.state.monthId}
/>
</div>
</div>
<div className="column-2">
<div style={{ padding: 10, borderRadius: 5 }}>
......@@ -393,21 +387,42 @@ export default class EditManagementDoc extends Component {
value={this.state.getDocument}
/>
</div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
</div>
<div className="column-1">
<div style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete
{...this.state.listMonth}
// debug
clearOnEscape
id="month"
onChange={(event, newInputValue) => this.setState({ monthId: newInputValue }, () => this.clearMessage())}
style={{ width: 250 }}
renderInput={(params) =>
<TextField {...params} label="Period Month" margin="normal" style={{ marginTop: 7 }}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
error={this.state.errorMonth}
helperText={this.state.msgErrorMonth}
/>}
value={this.state.monthId}
/>
</div>
</div>
<div className="column-2">
<div style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete
{...this.state.listPeriode}
// debug
clearOnEscape
id="periode"
onChange={(event, newInputValue) => this.setState({ periode: newInputValue }, () => {
this.clearMessage()
})}
onChange={(event, newInputValue) => this.setState({ periode: newInputValue }, () => this.clearMessage())}
style={{ width: 250 }}
renderInput={(params) =>
<TextField {...params} label="Period" margin="normal" style={{ marginTop: 7 }}
<TextField {...params} label="Period Year" margin="normal" style={{ marginTop: 7 }}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
error={this.state.errorPeriode}
helperText={this.state.msgErrorPeriode}
/>}
value={this.state.periode}
/>
......
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