Commit a89c3ee9 authored by EKSAD's avatar EKSAD

Item Laporan

parent 3ea10554
......@@ -112,6 +112,10 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const checkUploadUser = (body) => api.post('/user/check_import', body)
const uploadUser = (body) => api.post('/user/import_user', body)
//Report Items
const getReportItems = () => api.get('item_report/get_all_item_report')
const searchReportItems = (body) => api.post('/item_report/search_item_report', body)
//Template
const downloadTemplate = (fileName,fileType) => api.get(`attachment/download_file?fileName=${fileName}&&fileType=${fileType}`)
......@@ -167,7 +171,9 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
changePassword,
getPerusahaanHierarki,
checkUploadUser,
uploadUser
uploadUser,
getReportItems,
searchReportItems
}
}
......
import React, { Component } from "react";
import { Container, Row, Col } from "react-bootstrap";
import { makeStyles, createMuiTheme, MuiThemeProvider } from '@material-ui/core/styles';
import SearchIcon from '@material-ui/icons/Search';
import { createMuiTheme, MuiThemeProvider } from '@material-ui/core/styles';
import Images from "../../assets/Images";
import MUIDataTable from "mui-datatables";
import { TextField, InputBase } from "@material-ui/core";
import { InputBase } from "@material-ui/core";
import { ExcelRenderer } from 'react-excel-renderer';
import UploadFile from "../../library/Upload";
import CreateReportItems from "./formReportItems/CreateReportItems";
import EditReportItems from "./formReportItems/EditReportItems";
import VisualReportItems from "./formReportItems/VisualReportItems";
import api from "../../api";
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
......@@ -40,17 +39,10 @@ export default class ReportItems extends Component {
let fileObj = event
ExcelRenderer(fileObj, (err, resp) => {
if (err) {
// console.log(err);
}
else {
let judul = resp.rows[0]
let isi = resp.rows.slice(1)
// let body = isi.map((item) => {
// return {
// item
// ]
// })
// console.log(JSON.stringify(isi));
this.setState({
dataLoaded: true,
cols: judul,
......@@ -60,12 +52,24 @@ export default class ReportItems extends Component {
});
}
closeEdit() {
this.setState({edit: false})
componentDidMount() {
this.getData()
console.log(this.props.height)
}
closeAdd() {
this.setState({add: false})
getData() {
api.create().getReportItems().then((response) => {
console.log(response)
// if (response.data.status == 'success') {
// let data = response.data.data
// let listData = data.map((item, index) => {
// return [index, item.item_report_id, item.report_name, item.company_name, item.order, item.description, item.parent, item.uom, item.weight, item.type_report_name, item.status ]
// })
// this.setState({ dataTable: listData, listData: response.data.data })
// } else {
// alert(response.data.message)
// }
})
}
render() {
......@@ -238,13 +242,13 @@ export default class ReportItems extends Component {
}
{this.state.add && (
<CreateReportItems
onClickClose={this.closeAdd.bind(this)}
onClickClose={() => this.setState({ add: false })}
data={this.state.indexData}
/>
)}
{this.state.edit && (
<EditReportItems
onClickClose={this.closeEdit.bind(this)}
onClickClose={() => this.setState({ edit: false })}
data={this.state.indexData}
/>
)}
......
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