Commit 851b6cfb authored by rifkaki's avatar rifkaki

create & list master data cat

parent 6d12fce3
...@@ -186,7 +186,9 @@ const create = (type = "") => { ...@@ -186,7 +186,9 @@ const create = (type = "") => {
const deleteParameter = (id) => api.post(`setting/delete_setting/${id}`) const deleteParameter = (id) => api.post(`setting/delete_setting/${id}`)
// MASTER DATA - CAT // MASTER DATA - CAT
const getAllMasterDataCat = () => api.get('item_report_company/get_all_item_report_company')
const getParentItemReport = (body) => api.post('item_report/get_parent_item_report_default', body) 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)
//Transaction //Transaction
const getReportTypeBody = (body) => api.post('transaction/master_budget/get_all_report', body) const getReportTypeBody = (body) => api.post('transaction/master_budget/get_all_report', body)
...@@ -687,7 +689,9 @@ const create = (type = "") => { ...@@ -687,7 +689,9 @@ const create = (type = "") => {
getHierarkiCronJobMRRatio, getHierarkiCronJobMRRatio,
getRollingOutlookID, getRollingOutlookID,
getRollingOutlookBS, getRollingOutlookBS,
getParentItemReport getAllMasterDataCat,
getParentItemReport,
saveMasterDataCat
} }
} }
......
...@@ -594,8 +594,8 @@ export default class MasterDataCAT extends Component { ...@@ -594,8 +594,8 @@ export default class MasterDataCAT extends Component {
getData() { getData() {
this.setState({ loading: true }) this.setState({ loading: true })
api.create().getReportItems().then((response) => { api.create().getAllMasterDataCat().then((response) => {
// console.log(response) console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
...@@ -606,15 +606,9 @@ export default class MasterDataCAT extends Component { ...@@ -606,15 +606,9 @@ export default class MasterDataCAT extends Component {
item.item_report_id, item.item_report_id,
item.report_name, item.report_name,
item.company_name, item.company_name,
item.order, item.report_name,
item.description,
item.parent !== null ? `${item.parent} - ${item.parent_name}` : "" ,
item.uom,
item.weight, item.weight,
item.type_item_report_name, item.years,
item.kpi_type,
item.max_ach,
item.formula_ytd,
item.status] item.status]
}) })
this.setState({ dataTable: listData, listData: response.data.data }, () => { this.setState({ dataTable: listData, listData: response.data.data }, () => {
...@@ -622,6 +616,7 @@ export default class MasterDataCAT extends Component { ...@@ -622,6 +616,7 @@ export default class MasterDataCAT extends Component {
this.setState({ loading: false }) this.setState({ loading: false })
}, 2000); }, 2000);
}) })
console.log(this.state.dataTable)
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
...@@ -724,7 +719,7 @@ export default class MasterDataCAT extends Component { ...@@ -724,7 +719,7 @@ export default class MasterDataCAT extends Component {
createReportItems = (payload) => { createReportItems = (payload) => {
this.setState({ add: false }) this.setState({ add: false })
api.create().createReportItems(payload).then(response => { api.create().saveMasterDataCat(payload).then(response => {
// console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
...@@ -896,7 +891,7 @@ export default class MasterDataCAT extends Component { ...@@ -896,7 +891,7 @@ export default class MasterDataCAT extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[13] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span> <span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div > </div >
); );
} }
...@@ -908,7 +903,7 @@ export default class MasterDataCAT extends Component { ...@@ -908,7 +903,7 @@ export default class MasterDataCAT extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[13] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span> <span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div > </div >
); );
} }
...@@ -920,7 +915,7 @@ export default class MasterDataCAT extends Component { ...@@ -920,7 +915,7 @@ export default class MasterDataCAT extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[13] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span> <span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div > </div >
); );
} }
...@@ -932,7 +927,7 @@ export default class MasterDataCAT extends Component { ...@@ -932,7 +927,7 @@ export default class MasterDataCAT extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[13] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span> <span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div > </div >
); );
} }
...@@ -944,7 +939,7 @@ export default class MasterDataCAT extends Component { ...@@ -944,7 +939,7 @@ export default class MasterDataCAT extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[13] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span> <span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div > </div >
); );
} }
...@@ -956,7 +951,7 @@ export default class MasterDataCAT extends Component { ...@@ -956,7 +951,7 @@ export default class MasterDataCAT extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[13] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span> <span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</div > </div >
); );
} }
...@@ -968,7 +963,7 @@ export default class MasterDataCAT extends Component { ...@@ -968,7 +963,7 @@ export default class MasterDataCAT extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[13] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span> <span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span>
</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