Commit 1da99a2c authored by faisalhamdi's avatar faisalhamdi

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

parents 79bfb438 3c6dfd0e
......@@ -190,6 +190,7 @@ const create = (type = "") => {
const getParentItemReport = (body) => api.post('item_report/get_parent_item_report_default', body)
const saveMasterDataCat = (body) => api.post('item_report_company/create_item_report_company', body)
// const getDetailMasterDataCat = (id) => api.get(`item_report_company/create_item_report_company/${id}`)
const deleteMasterDataCat = (idCompany, years) => api.post(`item_report_company/delete_item_report_company/${idCompany}/${years}`)
//Transaction
const getReportTypeBody = (body) => api.post('transaction/master_budget/get_all_report', body)
......@@ -693,7 +694,8 @@ const create = (type = "") => {
getAllMasterDataCat,
getParentItemReport,
saveMasterDataCat,
// getDetailMasterDataCat
// getDetailMasterDataCat,
deleteMasterDataCat
}
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -609,7 +609,9 @@ export default class MasterDataCAT extends Component {
item.report_name,
item.weight,
item.years,
item.status]
item.status,
item.item_report_company_id
]
})
this.setState({ dataTable: listData, listData: response.data.data }, () => {
setTimeout(() => {
......@@ -637,9 +639,11 @@ export default class MasterDataCAT extends Component {
}
deleteReport(payload) {
// console.log(payload);
let id = String(payload[1])
api.create().deleteReportItems(id).then(response => {
console.log(payload);
let idCompany = payload[8]
let years = payload[6]
api.create().deleteMasterDataCat(idCompany, years).then(response => {
console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
......@@ -673,7 +677,7 @@ export default class MasterDataCAT extends Component {
} else if (type === 'delete') {
this.setState({
rowData: index,
reportNameDelete: "[" + String(index[2]) + " - " + String(index[3]) + " - " + String(index[5]) + "]",
reportNameDelete: "[" + String(index[3]) + " - " + String(index[6]) + "] ",
visibleDelete: true
})
} else {
......@@ -761,8 +765,10 @@ export default class MasterDataCAT extends Component {
}
downloadDataTable = async () => {
let url = `${process.env.REACT_APP_URL_MAIN_BE}/item_report_company/export_item_report_company`
console.log(url)
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/item_report/export_item_report`
`${process.env.REACT_APP_URL_MAIN_BE}/item_report_company/export_item_report_company`
)
res = await res.blob()
// console.log(res)
......@@ -770,7 +776,7 @@ export default class MasterDataCAT extends Component {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Report Items.xlsx';
a.download = 'Master Data - CAT.xlsx';
a.click();
}
}
......@@ -968,6 +974,12 @@ export default class MasterDataCAT extends Component {
);
}
}
},
{
name: "company id",
options: {
display: false
}
}
]
const data = [
......@@ -1013,7 +1025,7 @@ export default class MasterDataCAT extends Component {
/>
</div> */}
<div style={{ width: '50%', justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template">
{/* <a data-tip={'Download Template'} data-for="template">
<button
style={{
backgroundColor: 'transparent',
......@@ -1026,8 +1038,8 @@ export default class MasterDataCAT extends Component {
<img src={Images.template} />
</button>
</a>
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
{this.state.buttonCreate && (
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" /> */}
{/* {this.state.buttonCreate && (
<a data-tip={'Upload'} data-for="upload">
<button
style={{
......@@ -1042,7 +1054,7 @@ export default class MasterDataCAT extends Component {
</button>
</a>
)}
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" /> */}
<a data-tip={'Download'} data-for="download">
<button
style={{
......@@ -1057,7 +1069,7 @@ export default class MasterDataCAT extends Component {
</button>
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
<a data-tip={'Visualization'} data-for="visualisasi">
{/* <a data-tip={'Visualization'} data-for="visualisasi">
<button
style={{
backgroundColor: 'transparent',
......@@ -1070,7 +1082,7 @@ export default class MasterDataCAT extends Component {
<img src={Images.visualisasi} />
</button>
</a>
<ReactTooltip border={true} id="visualisasi" place="bottom" type="light" effect="solid" />
<ReactTooltip border={true} id="visualisasi" place="bottom" type="light" effect="solid" /> */}
{this.state.buttonCreate && (
<a data-tip={'Add New'} data-for="tambah">
<button
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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