Commit ffedbdee authored by EKSAD's avatar EKSAD

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into riri

parents 8ee3a764 259b9b4a
...@@ -179,6 +179,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => ...@@ -179,6 +179,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const getDocumentCategory = (body) => api.post('setting/get_all_setting_document_category', body) const getDocumentCategory = (body) => api.post('setting/get_all_setting_document_category', body)
const getAllDocument = (body) => api.post('document/get_all_document', body) const getAllDocument = (body) => api.post('document/get_all_document', body)
const uploadDocument = (body) => api.post('document/upload_document', body) const uploadDocument = (body) => api.post('document/upload_document', body)
const updateDocument = (body) => api.post('document/update_document', body)
const downloadDocument = (body) => api.post('document/download_document', body)
// ------ // ------
// STEP 3 // STEP 3
...@@ -286,6 +288,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => ...@@ -286,6 +288,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
getDocumentCategory, getDocumentCategory,
getAllDocument, getAllDocument,
uploadDocument, uploadDocument,
updateDocument,
downloadDocument,
createSubmitReport, createSubmitReport,
getSubmission getSubmission
} }
......
...@@ -220,7 +220,7 @@ export default class VisualisasiAM extends Component { ...@@ -220,7 +220,7 @@ export default class VisualisasiAM extends Component {
{this.state.listApproval.sort((a,b) => a.orderId - b.orderId).map((item, index) => ( {this.state.listApproval.sort((a,b) => a.orderId - b.orderId).map((item, index) => (
<li key={index} style={{color: '#4b4b4b', fontSize: 14}}> <li key={index} style={{color: '#4b4b4b', fontSize: 14}}>
<a href='#' style={{ color: '#4b4b4b', fontSize: '14px', cursor: 'auto', outline: 'none' }}> <a href='#' style={{ color: '#4b4b4b', fontSize: '14px', cursor: 'auto', outline: 'none' }}>
<div className="grid grid-3x grid-mobile-none gap-20px margin-bottom-20px" style={{width: '75%'}}> <div className="grid grid-4x grid-mobile-none gap-20px margin-bottom-20px" style={{width: '75%'}}>
{item.data.map((items, indexs) => {return(<label>{items.fullname}</label>)})} {item.data.map((items, indexs) => {return(<label>{items.fullname}</label>)})}
<label>{item.data.length == 1? '' : item.data[0].operator_type_name}</label> <label>{item.data.length == 1? '' : item.data[0].operator_type_name}</label>
</div> </div>
...@@ -231,20 +231,20 @@ export default class VisualisasiAM extends Component { ...@@ -231,20 +231,20 @@ export default class VisualisasiAM extends Component {
</ReactDragListView> </ReactDragListView>
</div> </div>
</div> </div>
<div className="row" style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 15, paddingLeft: 15, paddingBottom: 25 }}> <div className="row" style={{ float: 'right', display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 15, paddingLeft: 15, paddingBottom: 25 }}>
<div onClick={() => this.props.onClickClose()} style={{ width: 102, height: 30, marginLeft: 25, backgroundColor: 'dodgerblue', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor:"pointer" }}> {/* <div onClick={() => this.props.onClickClose()} style={{ width: 102, height: 30, marginLeft: 25, backgroundColor: 'dodgerblue', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor:"pointer" }}>
<span style={{ color: '#fff', fontSize: 11 }}>Back</span> <span style={{ color: '#fff', fontSize: 11 }}>Back</span>
</div> </div> */}
{this.props.btnedit && (
<div className="row" style={{ float: 'right', marginRight: 25 }}> <div className="row" style={{ float: 'right', marginRight: 25 }}>
<div onClick={() => this.props.onClickClose()} style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor:"pointer" }}> <div onClick={() => this.props.onClickClose()} style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor:"pointer" }}>
<span style={{ color: '#354960', fontSize: 11 }} >Cancel</span> <span style={{ color: '#354960', fontSize: 11 }} >Cancel</span>
</div> </div>
{this.props.btnedit && (
<div onClick={() => this.handleSave()} style={{ width: 102, height: 30, marginLeft: 25, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor:"pointer" }}> <div onClick={() => this.handleSave()} style={{ width: 102, height: 30, marginLeft: 25, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor:"pointer" }}>
<span style={{ color: '#fff', fontSize: 11 }}>Save</span> <span style={{ color: '#fff', fontSize: 11 }}>Save</span>
</div> </div>
)}
</div> </div>
)}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -677,6 +677,8 @@ export default class BudgetTahunan extends Component { ...@@ -677,6 +677,8 @@ export default class BudgetTahunan extends Component {
company={this.state.company} company={this.state.company}
revision={this.state.revisionTable} revision={this.state.revisionTable}
periode={this.state.periode.periode} periode={this.state.periode.periode}
submissionID={this.state.submissionID}
saveToMasterBudget={this.saveToMasterBudget.bind(this)}
onClickClose={() => this.setState({ visibleTP: false, visibleBudgetTahunan: true })} onClickClose={() => this.setState({ visibleTP: false, visibleBudgetTahunan: true })}
/> />
)} )}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2,6 +2,8 @@ import React, { Component } from 'react' ...@@ -2,6 +2,8 @@ import React, { Component } from 'react'
import MUIDataTable from 'mui-datatables' import MUIDataTable from 'mui-datatables'
import { createMuiTheme, MuiThemeProvider } from '@material-ui/core'; import { createMuiTheme, MuiThemeProvider } from '@material-ui/core';
import api from '../../api'; import api from '../../api';
import Images from '../../assets/Images';
import ReactTooltip from 'react-tooltip';
import CreateManagementDoc from './CreateManagementDoc'; import CreateManagementDoc from './CreateManagementDoc';
...@@ -39,14 +41,15 @@ export default class AuditTahunan extends Component { ...@@ -39,14 +41,15 @@ export default class AuditTahunan extends Component {
api.create().getAllDocument(payload).then(response => { api.create().getAllDocument(payload).then(response => {
console.log(response) console.log(response)
let dataTable = response.data.data.map(item => { let dataTable = response.data.data.map((item, index) => {
return [ return [
index,
item.document_name, item.document_name,
item.description, item.description,
item.company_name, item.company_name,
"", item.document_periode,
item.document_type, item.document_type,
String(Number(item.document_size) / 1000 + ' MB'), String(Number(item.document_size) / 1000 + ' KB'),
item.created_by, item.created_by,
item.created_at, item.created_at,
] ]
...@@ -56,8 +59,37 @@ export default class AuditTahunan extends Component { ...@@ -56,8 +59,37 @@ export default class AuditTahunan extends Component {
} }
render() { render() {
let columns = [ let columns = [{
"Nama File", "Keterangan", "Perusahaan", "Periode", "Tipe", "Ukuran", "Ditambahkan Oleh", "Ditambahkan Tanggal" name: "Action",
options: {
filter: false,
sort: false,
customBodyRender: (val, tableMeta) => {
console.log(tableMeta)
return (
<div style={{ display: 'flex' }}>
{/* {this.state.btnedit && <span> */}
<a data-tip={'Download'} data-for="download">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginRight: 15
}}
// onClick={() => console.log(tableMeta)}
// onClick={() => this.openPopUp(tableMeta.rowData, 'edit')}
>
<img src={Images.download} />
</button>
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
{/* </span>} */}
</div >
);
}
}
}, "Nama File", "Keterangan", "Perusahaan", "Periode", "Tipe", "Ukuran", "Ditambahkan Oleh", "Ditambahkan Tanggal"
] ]
return ( return (
<div style={{ width: '100%' }}> <div style={{ width: '100%' }}>
......
import React, { Component } from 'react'
import MUIDataTable from 'mui-datatables'
import { createMuiTheme, MuiThemeProvider } from '@material-ui/core';
import api from '../../api';
import Images from '../../assets/Images';
import ReactTooltip from 'react-tooltip';
import CreateManagementDoc from './CreateManagementDoc';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
const options = ct.customOptionsManagementDocument();
export default class BOD extends Component {
constructor(props) {
super(props)
this.state = {
dataTable: [],
visibleCreate: false,
refresh: ''
}
}
componentDidMount() {
// console.log(this.props.data)
this.getData()
}
componentWillReceiveProps(props) {
// console.log(props);
const { refresh, id } = this.props;
if (props.refresh !== refresh) {
this.getData()
}
}
getData() {
let payload = {
"setting_id": this.props.data.setting_id
}
api.create().getAllDocument(payload).then((response) => {
console.log(response)
if (response.problem){
alert(response.problem)
}
if (response.data) {
if (response.ok) {
if (response.data.status == 'success') {
let dataTable = response.data.data.map((item, index) => {
return [
index,
item.document_name,
item.description,
item.company_name,
item.document_periode,
item.document_type,
String(Number(item.document_size) / 1000 + ' MB'),
item.created_by,
item.created_at,
]
})
this.setState({ dataTable })
}
}
}
})
}
render() {
let columns = [
{
name: "Action",
options: {
filter: false,
sort: false,
customBodyRender: (val, tableMeta) => {
console.log(tableMeta)
return (
<div style={{ display: 'flex' }}>
{/* {this.state.btnedit && <span> */}
<a data-tip={'Download'} data-for="download">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginRight: 15
}}
// onClick={() => console.log(tableMeta)}
// onClick={() => this.openPopUp(tableMeta.rowData, 'edit')}
>
<img src={Images.download} />
</button>
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
{/* </span>} */}
</div >
);
}
}
}, "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>
)
}
}
...@@ -8,10 +8,6 @@ import { format } from 'date-fns'; ...@@ -8,10 +8,6 @@ import { format } from 'date-fns';
import UploadFile from "../../library/Upload"; import UploadFile from "../../library/Upload";
import { ExcelRenderer } from 'react-excel-renderer'; import { ExcelRenderer } from 'react-excel-renderer';
import * as R from 'ramda' import * as R from 'ramda'
import MuiAlert from '@material-ui/lab/Alert';
const Alert = withStyles({
})((props) => <MuiAlert elevation={6} variant="filled" {...props} />);
export default class CreateManagementDoc extends Component { export default class CreateManagementDoc extends Component {
constructor(props) { constructor(props) {
...@@ -36,7 +32,9 @@ export default class CreateManagementDoc extends Component { ...@@ -36,7 +32,9 @@ export default class CreateManagementDoc extends Component {
alert: false, alert: false,
tipeAlert: '', tipeAlert: '',
messageAlert: '', messageAlert: '',
fileType: '' fileType: '',
konfirmasi: false,
docId:''
} }
} }
...@@ -184,39 +182,19 @@ export default class CreateManagementDoc extends Component { ...@@ -184,39 +182,19 @@ export default class CreateManagementDoc extends Component {
formData.append("description", this.state.description); formData.append("description", this.state.description);
formData.append("extension", this.state.fileType); formData.append("extension", this.state.fileType);
this.setState({ formData }, ()=> { this.setState({ formData }, ()=> {
this.createDocument() this.props.createDocument(this.state.formData, this.props.setting_id)
}) })
} }
} }
createDocument(){
api.create().uploadDocument(this.state.formData).then(response => {
console.log(response)
if (response) {
if (response.data.status === "success") {
this.props.getDataDocument(this.props.setting_id)
this.props.onClickClose()
}
}
})
}
closeAlert() {
this.setState({ alert: false })
}
deleteFile(e){ deleteFile(e){
this.setState({ file: null}) this.setState({ file: null})
} }
render() { render() {
return ( return (
<div>
<div className="test app-popup-show"> <div className="test app-popup-show">
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
<Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
{this.state.messageAlert}
</Alert>
</Snackbar>
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}> <div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
<div className="popup-panel grid grid-2x main-color" style={{ 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="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
...@@ -364,6 +342,7 @@ export default class CreateManagementDoc extends Component { ...@@ -364,6 +342,7 @@ export default class CreateManagementDoc extends Component {
</div> </div>
</div> </div>
</div> </div>
</div>
) )
} }
} }
import React, { Component } from 'react'
import MUIDataTable from 'mui-datatables'
import { createMuiTheme, MuiThemeProvider } from '@material-ui/core';
import api from '../../api';
import Images from '../../assets/Images';
import ReactTooltip from 'react-tooltip';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
const options = ct.customOptions();
export default class ManualBookETMS extends Component {
constructor(props) {
super(props)
this.state = {
dataTable: [],
visibleCreate: false,
refresh: ''
}
}
componentDidMount() {
// console.log(this.props.data)
this.getData()
}
componentWillReceiveProps(props) {
// console.log(props);
const { refresh, id } = this.props;
if (props.refresh !== refresh) {
this.getData()
}
}
getData() {
let payload = {
"setting_id": this.props.data.setting_id
}
api.create().getAllDocument(payload).then(response => {
console.log(response)
let dataTable = response.data.data.map((item, index) => {
return [
index,
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 = [{
name: "Action",
options: {
filter: false,
sort: false,
customBodyRender: (val, tableMeta) => {
console.log(tableMeta)
return (
<div style={{ display: 'flex' }}>
{/* {this.state.btnedit && <span> */}
<a data-tip={'Download'} data-for="download">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginRight: 15
}}
// onClick={() => console.log(tableMeta)}
// onClick={() => this.openPopUp(tableMeta.rowData, 'edit')}
>
<img src={Images.download} />
</button>
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
{/* </span>} */}
</div >
);
}
}
}, "Nama File", "Keterangan", "Perusahaan", "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>
)
}
}
import React, { Component } from 'react' import React, { Component } from 'react'
import MUIDataTable from 'mui-datatables' import MUIDataTable from 'mui-datatables'
import { createMuiTheme, MuiThemeProvider } from '@material-ui/core'; import { createMuiTheme, MuiThemeProvider } from '@material-ui/core';
import api from '../../api';
import Images from '../../assets/Images';
import ReactTooltip from 'react-tooltip';
var ct = require("../../library/CustomTable"); var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable());
...@@ -11,13 +13,81 @@ export default class ManualBookTia extends Component { ...@@ -11,13 +13,81 @@ export default class ManualBookTia extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
dataTable: [] dataTable: [],
visibleCreate: false,
refresh: ''
} }
} }
componentDidMount() {
// console.log(this.props.data)
this.getData()
}
componentWillReceiveProps(props) {
// console.log(props);
const { refresh, id } = this.props;
if (props.refresh !== refresh) {
this.getData()
}
}
getData() {
let payload = {
"setting_id": this.props.data.setting_id
}
api.create().getAllDocument(payload).then(response => {
console.log(response)
let dataTable = response.data.data.map((item, index) => {
return [
index,
item.document_name,
item.description,
item.company_name,
item.document_periode,
item.document_type,
String(Number(item.document_size) / 1000 + ' MB'),
item.created_by,
item.created_at,
]
})
this.setState({ dataTable })
})
}
render() { render() {
let columns = [ let columns = [{
"Nama File", "Keterangan", "Perusahaan", "Tipe", "Ukuran", "Ditambahkan Oleh", "Ditambahkan Tanggal" name: "Action",
options: {
filter: false,
sort: false,
customBodyRender: (val, tableMeta) => {
console.log(tableMeta)
return (
<div style={{ display: 'flex' }}>
{/* {this.state.btnedit && <span> */}
<a data-tip={'Download'} data-for="download">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginRight: 15
}}
// onClick={() => console.log(tableMeta)}
// onClick={() => this.openPopUp(tableMeta.rowData, 'edit')}
>
<img src={Images.download} />
</button>
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
{/* </span>} */}
</div >
);
}
}
}, "Nama File", "Keterangan", "Perusahaan", "Tipe", "Ukuran", "Ditambahkan Oleh", "Ditambahkan Tanggal"
] ]
return ( return (
<div style={{ width: '100%' }}> <div style={{ width: '100%' }}>
......
import React, { Component } from 'react';
import Images from '../../assets/Images';
import { Typography } from '@material-ui/core';
import api from "../../api";
import Constant from '../../library/Constant';
export default class PopUpKonfirmasi extends Component {
constructor(props) {
super(props)
this.state = {
}
}
componentDidMount() {
}
onClickUpload() {
let payload = this.props.data
this.props.uploadDocId(payload)
}
render() {
return (
<div className="test app-popup-show" style={{ zIndex: 2500}}>
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
<div style={{ display: 'flex', justifyContent: 'center', paddingTop: 20 }}>
<img src={Images.failed} />
</div>
<div style={{ display: 'grid', justifyContent: 'center', marginTop: 20, paddingBottom: 20 }}>
<span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold', fontFamily: 'Nunito Sans, sans-serif' }}>
The Document Already Exists in The System, <br />
Do You Want to Overwrite It?
</span>
</div>
<div className="border-top grid grid-2x" style={{ height: 56, backgroundColor: '#f5f5f5', paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1" style={{ alignSelf: 'center' }}>
<button
type="button"
onClick={() => this.props.onClickClosePopUp()}
>
<div style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#354960', fontSize: 11 }}>Cancel</span>
</div>
</button>
</div>
<div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
<button
type="button"
onClick={()=> this.onClickUpload()}
>
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Rewrite</span>
</div>
</button>
</div>
</div>
</div>
</div>
);
}
}
import React, { Component } from 'react' import React, { Component } from 'react'
import MUIDataTable from 'mui-datatables' import MUIDataTable from 'mui-datatables'
import { createMuiTheme, MuiThemeProvider } from '@material-ui/core'; import { withStyles } from '@material-ui/core/styles';
import { createMuiTheme, MuiThemeProvider, Snackbar } from '@material-ui/core';
import api from '../../api'; import api from '../../api';
import MuiAlert from '@material-ui/lab/Alert';
import Constant from '../../library/Constant';
import Images from '../../assets/Images';
import ReactTooltip from 'react-tooltip';
import CreateManagementDoc from './CreateManagementDoc'; import CreateManagementDoc from './CreateManagementDoc';
...@@ -9,50 +14,142 @@ var ct = require("../../library/CustomTable"); ...@@ -9,50 +14,142 @@ var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable());
const options = ct.customOptionsManagementDocument(); const options = ct.customOptionsManagementDocument();
export default class AuditTahunan extends Component { const Alert = withStyles({
})((props) => <MuiAlert elevation={6} variant="filled" {...props} />);
export default class QReview extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
dataTable: [], dataTable: [],
visibleCreate: false visibleCreate: false,
refresh: ''
} }
} }
componentDidMount() { componentDidMount() {
console.log(this.props.data) // console.log(this.props.data)
this.getData() this.getData()
} }
componentWillReceiveProps(props) {
// console.log(props);
const { refresh, id } = this.props;
if (props.refresh !== refresh) {
this.getData()
}
}
getData() { getData() {
let payload = { let payload = {
"company_id": 1, "setting_id": this.props.data.setting_id
"document_category_id": 3
} }
api.create().getAllDocument(payload).then(respone => { api.create().getAllDocument(payload).then((response) => {
let dataTable = respone.data.data.map(item => { console.log(response)
return [ if (response.problem){
item.document_name, alert(response.problem)
item.description, }
item.company_name, if (response.data) {
"", if (response.ok) {
item.document_type, if (response.data.status == 'success') {
String(Number(item.document_size) / 1000 + ' MB'), let dataTable = response.data.data.map((item, index) => {
item.created_by, return [
item.created_at, index,
] item.document_name,
}) item.description,
this.setState({ dataTable }) item.company_name,
item.document_periode,
item.document_type,
String(Number(item.document_size) / 1000 + ' MB'),
item.created_by,
item.created_at,
]
})
this.setState({ dataTable })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
}
}) })
} }
openPopUp(index, type){
if (type === 'download') {
const formData = new FormData();
formData.append("documentName", index[1]);
formData.append("fileType", index[5]);
this.setState({ formData }, ()=> {
this.props.getDownloadDocument(this.state.formData)
})
}
}
downloadDoc() {
let datax = this.state.index
console.log(datax)
// let payload = {
// "documentName": this.state.typeId.approval_type_id,
// "fileType": this.state.order
// }
// this.props.getDownloadDocument(payload)
}
render() { render() {
let columns = [ let columns = [{
"Nama File", "Keterangan", "Perusahaan", "Periode", "Tipe", "Ukuran", "Ditambahkan Oleh", "Ditambahkan Tanggal" name: "Action",
options: {
filter: false,
sort: false,
customBodyRender: (val, tableMeta) => {
console.log(tableMeta)
return (
<div style={{ display: 'flex' }}>
{/* {this.state.btnedit && <span> */}
<a data-tip={'Download'} data-for="download">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginRight: 15
}}
// onClick={() => console.log(tableMeta)}
onClick={() => this.openPopUp(tableMeta.rowData, 'download')}
>
<img src={Images.download} />
</button>
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
{/* </span>} */}
</div >
);
}
}
}, "Nama File", "Keterangan", "Perusahaan", "Periode", "Tipe", "Ukuran", "Ditambahkan Oleh", "Ditambahkan Tanggal"
] ]
return ( return (
<div style={{ width: '100%' }}> <div style={{ width: '100%' }}>
<div style={{ padding: 25 }}> <div style={{ padding: 25 }}>
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
<Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
{this.state.messageAlert}
</Alert>
</Snackbar>
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
theme={getMuiTheme()} theme={getMuiTheme()}
......
...@@ -654,11 +654,11 @@ export default class CreateParameter extends Component { ...@@ -654,11 +654,11 @@ export default class CreateParameter extends Component {
}} }}
name="min_value" name="min_value"
onChange={(e) => { onChange={(e) => {
let coba = String(e.target.value).replace(/[^\d]/g, ''); // let coba = String(e.target.value).replace(/[^\d]/g, '');
this.setState({ this.setState({
tempData: { tempData: {
...this.state.tempData, ...this.state.tempData,
min_value: coba min_value: e.target.value
} }
}) })
this.clearMessage() this.clearMessage()
...@@ -822,11 +822,11 @@ export default class CreateParameter extends Component { ...@@ -822,11 +822,11 @@ export default class CreateParameter extends Component {
}} }}
name="max_value" name="max_value"
onChange={(e) => { onChange={(e) => {
let coba = String(e.target.value).replace(/[^\d]/g, ''); // let coba = String(e.target.value).replace(/[^\d]/g, '');
this.setState({ this.setState({
tempData: { tempData: {
...this.state.tempData, ...this.state.tempData,
max_value: coba max_value: e.target.value
} }
}) })
this.clearMessage() this.clearMessage()
...@@ -1035,9 +1035,9 @@ export default class CreateParameter extends Component { ...@@ -1035,9 +1035,9 @@ export default class CreateParameter extends Component {
}} }}
name="minValue" name="minValue"
onChange={(e) => { onChange={(e) => {
let coba = String(e.target.value).replace(/[^\d]/g, ''); // let coba = String(e.target.value).replace(/[^\d]/g, '');
this.setState({ this.setState({
minValue: coba minValue: e.target.value
}) })
this.clearMessage() this.clearMessage()
} }
...@@ -1194,9 +1194,9 @@ export default class CreateParameter extends Component { ...@@ -1194,9 +1194,9 @@ export default class CreateParameter extends Component {
}} }}
name="maxValue" name="maxValue"
onChange={(e) => { onChange={(e) => {
let coba = String(e.target.value).replace(/[^\d]/g, ''); // let coba = String(e.target.value).replace(/[^\d]/g, '');
this.setState({ this.setState({
maxValue: coba maxValue: e.target.value
}) })
this.clearMessage() this.clearMessage()
} }
......
...@@ -383,9 +383,9 @@ export default class Profile extends Component { ...@@ -383,9 +383,9 @@ export default class Profile extends Component {
onClick={() => this.setState({ uploadVisible: true })} onClick={() => this.setState({ uploadVisible: true })}
> >
{/* <img src={Images.photo} /> */} {/* <img src={Images.photo} /> */}
<div style={{ width: 93, height: 30, objectFit: 'contain', backgroundColor: '#019ce5', borderRadius: 4, display: 'flex', alignContent: 'center', justifyContent: 'center' }}> <div style={{ height: 30, objectFit: 'contain', backgroundColor: '#019ce5', borderRadius: 4, display: 'flex', alignContent: 'center', justifyContent: 'center', paddingLeft: 10, paddingRight: 10 }}>
<img src={Images.camera} /> <img src={Images.camera} />
<Typography style={{ color: '#ffffff', fontSize: 11, fontFamily: 'Nunito Sans, sans-serif', alignSelf: 'center', marginLeft: 5 }}>Ganti Foto</Typography> <Typography style={{ color: '#ffffff', fontSize: 11, fontFamily: 'Nunito Sans, sans-serif', alignSelf: 'center', marginLeft: 5 }}>Change Picture</Typography>
</div> </div>
</button> </button>
</div> </div>
...@@ -610,7 +610,8 @@ export default class Profile extends Component { ...@@ -610,7 +610,8 @@ export default class Profile extends Component {
<ImageUploader <ImageUploader
withIcon={true} withIcon={true}
withPreview withPreview
buttonText='Pilih Gambar' buttonStyles={this.state.pictures.length > 0 ? { display: 'none' } : null}
buttonText={'Select Picture'}
onChange={this.onDrop} onChange={this.onDrop}
imgExtension={['.jpg', '.gif', '.png', '.gif', '.jpeg']} imgExtension={['.jpg', '.gif', '.png', '.gif', '.jpeg']}
maxFileSize={1000000} maxFileSize={1000000}
...@@ -620,7 +621,7 @@ export default class Profile extends Component { ...@@ -620,7 +621,7 @@ export default class Profile extends Component {
<div style={{ display: 'grid', margin: 20 }}> <div style={{ display: 'grid', margin: 20 }}>
<div style={{ justifySelf: 'center' }}> <div style={{ justifySelf: 'center' }}>
<span className="main-color" style={{ color: '#fff', padding: 20, paddingBottom: 10, paddingTop: 10, borderRadius: 15, cursor: 'pointer' }} onClick={() => this.uploadFoto()}>Upload Foto</span> <span className="main-color" style={{ color: '#fff', padding: 20, paddingBottom: 10, paddingTop: 10, borderRadius: 15, cursor: 'pointer' }} onClick={() => this.uploadFoto()}>Upload</span>
</div> </div>
</div> : null </div> : null
} }
......
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