Commit 9e511e14 authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

update hapus titik validasi

parent b98fc12c
......@@ -209,21 +209,21 @@ export default class CreateApprovalMatrix extends Component {
validasi() {
if (R.isNil(this.state.typeId)) {
this.setState({ errorType: true, msgErrType: 'Approval Type Cannot be Empty.' })
this.setState({ errorType: true, msgErrType: 'Approval Type Cannot be Empty' })
}
else if (R.isEmpty(this.state.order)) {
this.setState({ errorOrder: true, msgErrOrder: 'Order Cannot be Empty.'})
this.setState({ errorOrder: true, msgErrOrder: 'Order Cannot be Empty'})
}
else if (R.isNil(this.state.userId)) {
this.setState({ errorApproved: true, msgErrApproved: 'Approver Name Cannot be Empty.' })
this.setState({ errorApproved: true, msgErrApproved: 'Approver Name Cannot be Empty' })
}
else if (R.isNil(this.state.operatorId)) {
this.setState({ errorOperator: true, msgErrOperator: 'Operator Cannot be Empty. Please Choose - Option' })
}
else if (R.isNil(this.state.startDate)) {
this.setState({ errorStartDate: true, msgErrorStartDate: 'Valid From Cannot be Empty.' })
this.setState({ errorStartDate: true, msgErrorStartDate: 'Valid From Cannot be Empty' })
} 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 {
console.log('masuk');
let payload = {
......
......@@ -249,21 +249,21 @@ export default class EditApprovalMatrix extends Component {
validasi() {
if (R.isNil(this.state.getTypes)) {
this.setState({ errorType: true, msgErrType: 'Approval Type Cannot be Empty.' })
this.setState({ errorType: true, msgErrType: 'Approval Type Cannot be Empty' })
}
else if (R.isEmpty(this.state.order)) {
this.setState({ errorOrder: true, msgErrOrder: 'Order Cannot be Empty.'})
this.setState({ errorOrder: true, msgErrOrder: 'Order Cannot be Empty'})
}
else if (R.isNil(this.state.getApprovedBy)) {
this.setState({ errorApproved: true, msgErrApproved: 'Approver Name Cannot be Empty.' })
this.setState({ errorApproved: true, msgErrApproved: 'Approver Name Cannot be Empty' })
}
else if (R.isNil(this.state.getOperators)) {
this.setState({ errorOperator: true, msgErrOperator: 'Operator Cannot be Empty.' })
this.setState({ errorOperator: true, msgErrOperator: 'Operator Cannot be Empty' })
}
else if (R.isEmpty(this.state.startDate)) {
this.setState({ errorStartDate: true, msgErrorStartDate: 'Valid From Cannot be Empty.' })
this.setState({ errorStartDate: true, msgErrorStartDate: 'Valid From Cannot be Empty' })
} else if (R.isEmpty(this.state.endDate)) {
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty.' })
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
} else {
console.log('masuk');
if (this.props.type == 'edit') {
......
......@@ -6,6 +6,7 @@ import ManualBookTia from './ManualBookTia'
import api from '../../api'
import AuditTahunan from './AuditTahunan'
import CreateManagementDoc from './CreateManagementDoc'
import QReview from './QReview'
export default class DocumentManagement extends Component {
constructor(props) {
......@@ -19,6 +20,7 @@ export default class DocumentManagement extends Component {
selectTab = (event, newEvent) => {
this.setState({ tab: newEvent })
console.log(this.state.tab)
}
componentDidMount() {
......@@ -32,6 +34,7 @@ export default class DocumentManagement extends Component {
id: response.data.data[0].document_category_id,
loadTable: true
})
console.log(this.state.listData)
})
}
......@@ -81,9 +84,16 @@ export default class DocumentManagement extends Component {
this.state.id === 2 ?
<AuditTahunan
data={this.state.listData[this.state.tab]}
/> :
/>
:
this.state.id === 1 ?
<ManualBookTia /> :
<ManualBookTia />
:
this.state.id === 3 ?
<QReview
data={this.state.listData[this.state.tab]}
/>
:
<span>Test2</span>
)}
......
import React, { Component } from 'react'
import MUIDataTable from 'mui-datatables'
import { createMuiTheme, MuiThemeProvider } from '@material-ui/core';
import api from '../../api';
import CreateManagementDoc from './CreateManagementDoc';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
const options = ct.customOptionsManagementDocument();
export default class AuditTahunan extends Component {
constructor(props) {
super(props)
this.state = {
dataTable: [],
visibleCreate: false
}
}
componentDidMount() {
console.log(this.props.data)
this.getData()
}
getData() {
let payload = {
"company_id": 1,
"document_category_id": 3
}
api.create().getAllDocument(payload).then(respone => {
let dataTable = respone.data.data.map(item => {
return [
item.document_name,
item.description,
item.company_name,
"",
item.document_type,
String(Number(item.document_size) / 1000 + ' MB'),
item.created_by,
item.created_at,
]
})
this.setState({ dataTable })
})
}
render() {
let columns = [
"Nama File", "Keterangan", "Perusahaan", "Periode", "Tipe", "Ukuran", "Ditambahkan Oleh", "Ditambahkan Tanggal"
]
return (
<div style={{ width: '100%' }}>
<div style={{ padding: 25 }}>
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
theme={getMuiTheme()}
data={this.state.dataTable}
columns={columns}
options={options}
/>
</MuiThemeProvider>
</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