Commit b4dabb9c authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'rifka' into 'master'

update hapus titik

See merge request !272
parents 48e65be2 d0695bc5
...@@ -209,21 +209,21 @@ export default class CreateApprovalMatrix extends Component { ...@@ -209,21 +209,21 @@ export default class CreateApprovalMatrix extends Component {
validasi() { validasi() {
if (R.isNil(this.state.typeId)) { 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)) { 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)) { 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)) { else if (R.isNil(this.state.operatorId)) {
this.setState({ errorOperator: true, msgErrOperator: 'Operator Cannot be Empty. Please Choose - Option' }) this.setState({ errorOperator: true, msgErrOperator: 'Operator Cannot be Empty. Please Choose - Option' })
} }
else if (R.isNil(this.state.startDate)) { 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)) { } 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 {
console.log('masuk'); console.log('masuk');
let payload = { let payload = {
......
...@@ -249,21 +249,21 @@ export default class EditApprovalMatrix extends Component { ...@@ -249,21 +249,21 @@ export default class EditApprovalMatrix extends Component {
validasi() { validasi() {
if (R.isNil(this.state.getTypes)) { 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)) { 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)) { 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)) { 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)) { 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)) { } 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 { } else {
console.log('masuk'); console.log('masuk');
if (this.props.type == 'edit') { if (this.props.type == 'edit') {
......
...@@ -6,6 +6,7 @@ import ManualBookTia from './ManualBookTia' ...@@ -6,6 +6,7 @@ import ManualBookTia from './ManualBookTia'
import api from '../../api' import api from '../../api'
import AuditTahunan from './AuditTahunan' import AuditTahunan from './AuditTahunan'
import CreateManagementDoc from './CreateManagementDoc' import CreateManagementDoc from './CreateManagementDoc'
import QReview from './QReview'
export default class DocumentManagement extends Component { export default class DocumentManagement extends Component {
constructor(props) { constructor(props) {
...@@ -19,6 +20,7 @@ export default class DocumentManagement extends Component { ...@@ -19,6 +20,7 @@ export default class DocumentManagement extends Component {
selectTab = (event, newEvent) => { selectTab = (event, newEvent) => {
this.setState({ tab: newEvent }) this.setState({ tab: newEvent })
console.log(this.state.tab)
} }
componentDidMount() { componentDidMount() {
...@@ -32,6 +34,7 @@ export default class DocumentManagement extends Component { ...@@ -32,6 +34,7 @@ export default class DocumentManagement extends Component {
id: response.data.data[0].document_category_id, id: response.data.data[0].document_category_id,
loadTable: true loadTable: true
}) })
console.log(this.state.listData)
}) })
} }
...@@ -81,9 +84,16 @@ export default class DocumentManagement extends Component { ...@@ -81,9 +84,16 @@ export default class DocumentManagement extends Component {
this.state.id === 2 ? this.state.id === 2 ?
<AuditTahunan <AuditTahunan
data={this.state.listData[this.state.tab]} data={this.state.listData[this.state.tab]}
/> : />
:
this.state.id === 1 ? this.state.id === 1 ?
<ManualBookTia /> : <ManualBookTia />
:
this.state.id === 3 ?
<QReview
data={this.state.listData[this.state.tab]}
/>
:
<span>Test2</span> <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