Commit ae8e7fd8 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into deni-dev(pc)

parents c236f723 0835644c
...@@ -206,6 +206,7 @@ const create = (type = "") => { ...@@ -206,6 +206,7 @@ const create = (type = "") => {
const getCompanySubmitted = (body) => api.post('transaction/master_budget/get_company_submitted', body) const getCompanySubmitted = (body) => api.post('transaction/master_budget/get_company_submitted', body)
const getLastPeriod = (idCompany) => api.get(`transaction/master_budget/get_last_periode/${idCompany}`) const getLastPeriod = (idCompany) => api.get(`transaction/master_budget/get_last_periode/${idCompany}`)
const getSubmitMasterBudget = (body) => api.post('transaction/master_budget/get_latest_periode_submit', body) const getSubmitMasterBudget = (body) => api.post('transaction/master_budget/get_latest_periode_submit', body)
const createPeriodeRevision = (body) => api.post('transaction/master_budget/create_periode_revision', body)
const getIdDeleteFromExcel = (body) => api.post('transaction/master_budget/delete_from_excel', body) const getIdDeleteFromExcel = (body) => api.post('transaction/master_budget/delete_from_excel', body)
const getOpetratingIndID = (body) => api.post('transaction/get_operating_indicator_id', body) const getOpetratingIndID = (body) => api.post('transaction/get_operating_indicator_id', body)
...@@ -371,7 +372,8 @@ const create = (type = "") => { ...@@ -371,7 +372,8 @@ const create = (type = "") => {
approvalSubmission, approvalSubmission,
getCompanySubmitted, getCompanySubmitted,
getLastPeriod, getLastPeriod,
getSubmitMasterBudget getSubmitMasterBudget,
createPeriodeRevision
} }
} }
......
This diff is collapsed.
...@@ -398,7 +398,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -398,7 +398,7 @@ export default class CorporateAnnualTarget extends Component {
console.log(this.state.dataTable) console.log(this.state.dataTable)
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
data.push({ data.push({
"item_report_id": i[1] == "" ? null : i[1], "item_report_id": i[1] == "" || i[1] == null? 0 : i[1],
"item_report": String(i[6]), "item_report": String(i[6]),
"weight": String(i[7]), "weight": String(i[7]),
"uom": String(i[8]), "uom": String(i[8]),
...@@ -815,7 +815,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -815,7 +815,7 @@ export default class CorporateAnnualTarget extends Component {
// this.setState({dataTable: dataTable2}) // this.setState({dataTable: dataTable2})
} }
const handleAction = (idParent, typeReport) => { const handleAction = (idParent, typeReport, tableMeta) => {
if (idParent !== null) { if (idParent !== null) {
let indexsss = dataTable2.findIndex((val) => val[1] == idParent) let indexsss = dataTable2.findIndex((val) => val[1] == idParent)
if (dataTable2[indexsss][6] == 'CUSTOMER PERSPECTIVE' || dataTable2[indexsss][6] == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') { if (dataTable2[indexsss][6] == 'CUSTOMER PERSPECTIVE' || dataTable2[indexsss][6] == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') {
...@@ -826,6 +826,13 @@ export default class CorporateAnnualTarget extends Component { ...@@ -826,6 +826,13 @@ export default class CorporateAnnualTarget extends Component {
} else { } else {
if (typeReport == null) { if (typeReport == null) {
return true return true
} else if (tableMeta !== undefined && tableMeta.rowData[0] == 1) {
let indexID = dataTable2.findIndex((val) => val[2] == tableMeta.rowData[1])
if (indexID !== -1) {
return false
} else {
return true
}
} else { } else {
return false return false
} }
...@@ -841,7 +848,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -841,7 +848,7 @@ export default class CorporateAnnualTarget extends Component {
newData.push([ newData.push([
3, 3,
"", "",
item[2], item[2] == null? item[1] : item[2],
item[3], item[3],
item[4], item[4],
"", "",
...@@ -889,7 +896,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -889,7 +896,7 @@ export default class CorporateAnnualTarget extends Component {
this.setState({ dataTable: dataTable2, dataDelete }, () => { this.setState({ dataTable: dataTable2, dataDelete }, () => {
setTimeout(() => { setTimeout(() => {
this.setState({ loading: false }) this.setState({ loading: false })
}, 500) }, 100)
}) })
} }
...@@ -949,7 +956,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -949,7 +956,7 @@ export default class CorporateAnnualTarget extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
// handleAction(tableMeta.rowData[2]) && // handleAction(tableMeta.rowData[2]) &&
handleAction(tableMeta.rowData[2], tableMeta.rowData[0]) && <div style={{ display: 'flex' }}> handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta) && <div style={{ display: 'flex' }}>
{/* {tableMeta.rowData[6] === "Active" ? */} {/* {tableMeta.rowData[6] === "Active" ? */}
{<span> {<span>
<LightTooltip title={'Add'} arrow> <LightTooltip title={'Add'} arrow>
......
...@@ -630,7 +630,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -630,7 +630,7 @@ export default class FixedAssetsMovement extends Component {
display: false display: false
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[1] : "Account", name: "Account",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#1c71b8', width: 300 }}> <TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#1c71b8', width: 300 }}>
...@@ -668,7 +668,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -668,7 +668,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[2] : `31 Dec ${Number(this.props.periode) - 1} Actual`, name: `31 Dec ${Number(this.props.periode) - 1} Actual`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
...@@ -704,7 +704,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -704,7 +704,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[3] : `Jan ${this.props.periode}`, name: `Jan ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -792,7 +792,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -792,7 +792,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[4] : `Feb ${this.props.periode}`, name: `Feb ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -881,7 +881,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -881,7 +881,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[5] : `Mar ${this.props.periode}`, name: `Mar ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -970,7 +970,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -970,7 +970,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[6] : `Apr ${this.props.periode}`, name: `Apr ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1059,7 +1059,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1059,7 +1059,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[7] : `May ${this.props.periode}`, name: `May ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1148,7 +1148,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1148,7 +1148,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[8] : `Jun ${this.props.periode}`, name: `Jun ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1237,7 +1237,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1237,7 +1237,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[9] : `Jul ${this.props.periode}`, name: `Jul ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1326,7 +1326,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1326,7 +1326,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[10] : `Aug ${this.props.periode}`, name: `Aug ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1415,7 +1415,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1415,7 +1415,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[11] : `Sep ${this.props.periode}`, name: `Sep ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1504,7 +1504,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1504,7 +1504,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[12] : `Oct ${this.props.periode}`, name: `Oct ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1593,7 +1593,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1593,7 +1593,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[13] : `Nov ${this.props.periode}`, name: `Nov ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1682,7 +1682,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1682,7 +1682,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[14] : `Dec ${this.props.periode}`, name: `Dec ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1771,7 +1771,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1771,7 +1771,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[15] : "Current Total", name: "Current Total",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
...@@ -1809,7 +1809,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1809,7 +1809,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[16] : `31 Dec ${Number(this.props.periode) + 1} Total`, name: `31 Dec ${Number(this.props.periode) + 1} Total`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
...@@ -1898,7 +1898,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1898,7 +1898,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[17] : `31 Dec ${Number(this.props.periode) + 2} Total`, name: `31 Dec ${Number(this.props.periode) + 2} Total`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
......
...@@ -602,7 +602,7 @@ export default class ProfitLoss extends Component { ...@@ -602,7 +602,7 @@ export default class ProfitLoss extends Component {
display: false display: false
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[1] : "Account", name: "Account",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#1c71b8', width: 300 }}> <TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#1c71b8', width: 300 }}>
...@@ -640,7 +640,7 @@ export default class ProfitLoss extends Component { ...@@ -640,7 +640,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[2] : "Notes", name: "Notes",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -678,7 +678,7 @@ export default class ProfitLoss extends Component { ...@@ -678,7 +678,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[3] : `31 Dec ${Number(this.props.periode) - 1} Actual`, name: `31 Dec ${Number(this.props.periode) - 1} Actual`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
...@@ -715,7 +715,7 @@ export default class ProfitLoss extends Component { ...@@ -715,7 +715,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[4] : `Jan ${this.props.periode}`, name: `Jan ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -804,7 +804,7 @@ export default class ProfitLoss extends Component { ...@@ -804,7 +804,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[5] : `Feb ${this.props.periode}`, name: `Feb ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -894,7 +894,7 @@ export default class ProfitLoss extends Component { ...@@ -894,7 +894,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[6] : `Mar ${this.props.periode}`, name: `Mar ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -984,7 +984,7 @@ export default class ProfitLoss extends Component { ...@@ -984,7 +984,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[7] : `Apr ${this.props.periode}`, name: `Apr ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1074,7 +1074,7 @@ export default class ProfitLoss extends Component { ...@@ -1074,7 +1074,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[8] : `May ${this.props.periode}`, name: `May ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1164,7 +1164,7 @@ export default class ProfitLoss extends Component { ...@@ -1164,7 +1164,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[9] : `Jun ${this.props.periode}`, name: `Jun ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1254,7 +1254,7 @@ export default class ProfitLoss extends Component { ...@@ -1254,7 +1254,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[10] : `Jul ${this.props.periode}`, name: `Jul ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1344,7 +1344,7 @@ export default class ProfitLoss extends Component { ...@@ -1344,7 +1344,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[11] : `Aug ${this.props.periode}`, name: `Aug ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1434,7 +1434,7 @@ export default class ProfitLoss extends Component { ...@@ -1434,7 +1434,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[12] : `Sep ${this.props.periode}`, name: `Sep ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1524,7 +1524,7 @@ export default class ProfitLoss extends Component { ...@@ -1524,7 +1524,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[13] : `Oct ${this.props.periode}`, name: `Oct ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1614,7 +1614,7 @@ export default class ProfitLoss extends Component { ...@@ -1614,7 +1614,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[14] : `Nov ${this.props.periode}`, name: `Nov ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1704,7 +1704,7 @@ export default class ProfitLoss extends Component { ...@@ -1704,7 +1704,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[15] : `Dec ${this.props.periode}`, name: `Dec ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1794,7 +1794,7 @@ export default class ProfitLoss extends Component { ...@@ -1794,7 +1794,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[16] : "Current Total", name: "Current Total",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
...@@ -1841,7 +1841,7 @@ export default class ProfitLoss extends Component { ...@@ -1841,7 +1841,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[17] : `31 Dec ${Number(this.props.periode) + 1} Total`, name: `31 Dec ${Number(this.props.periode) + 1} Total`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
...@@ -1931,7 +1931,7 @@ export default class ProfitLoss extends Component { ...@@ -1931,7 +1931,7 @@ export default class ProfitLoss extends Component {
} }
} }
}, { }, {
name: this.state.judulColumn !== null ? this.state.judulColumn[18] : `31 Dec ${Number(this.props.periode) + 2} Total`, name: `31 Dec ${Number(this.props.periode) + 2} Total`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
......
This diff is collapsed.
...@@ -10,6 +10,7 @@ import PopUpDelete from "./PopUpDelete"; ...@@ -10,6 +10,7 @@ import PopUpDelete from "./PopUpDelete";
import api from '../../api'; import api from '../../api';
import CreateManagementDoc from './CreateManagementDoc'; import CreateManagementDoc from './CreateManagementDoc';
import EditManagementDoc from './EditManagementDoc'; import EditManagementDoc from './EditManagementDoc';
import PropagateLoader from "react-spinners/PropagateLoader"
var ct = require("../../library/CustomTable"); var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable());
...@@ -168,7 +169,7 @@ export default class getAllDocument extends Component { ...@@ -168,7 +169,7 @@ export default class getAllDocument extends Component {
} }
updateDocument(payload) { updateDocument(payload) {
this.setState({ loading: true }) this.setState({ visibleEdit: false, loading: true })
api.create().updateDocument(payload).then(response => { api.create().updateDocument(payload).then(response => {
console.log(response) console.log(response)
if (response.data) { if (response.data) {
...@@ -223,7 +224,7 @@ export default class getAllDocument extends Component { ...@@ -223,7 +224,7 @@ export default class getAllDocument extends Component {
</button> </button>
</a> </a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
{this.props.btnedit && <span> {this.props.btnedit && this.props.allsubcoEdit && <span>
<a data-tip={'Edit'} data-for="edit"> <a data-tip={'Edit'} data-for="edit">
<button <button
style={{ style={{
...@@ -282,7 +283,16 @@ export default class getAllDocument extends Component { ...@@ -282,7 +283,16 @@ export default class getAllDocument extends Component {
"Type", "File Size", "Created By", "Created Date" "Type", "File Size", "Created By", "Created Date"
] ]
const loadingComponent = (
<div style={{ position: 'absolute', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
<PropagateLoader
// css={override}
size={20}
color={"#274B80"}
loading={this.state.loading}
/>
</div>
);
return ( return (
<div style={{ width: '100%' }}> <div style={{ width: '100%' }}>
...@@ -293,7 +303,7 @@ export default class getAllDocument extends Component { ...@@ -293,7 +303,7 @@ export default class getAllDocument extends Component {
{this.state.messageAlert} {this.state.messageAlert}
</Alert> </Alert>
</Snackbar> </Snackbar>
{this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
// theme={getMuiTheme()} // theme={getMuiTheme()}
......
...@@ -132,12 +132,23 @@ export default class CreateManagementDoc extends Component { ...@@ -132,12 +132,23 @@ export default class CreateManagementDoc extends Component {
if (response.data) { if (response.data) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
let data = response.data.data let data = response.data.data
let typeData = data.map((item) => { let typeData = []
return { data.map((item) => {
if (String(item.value).includes('Manual')){
if( this.props.allsubcoCreate ){
typeData.push( {
document_category_id: item.setting_id, document_category_id: item.setting_id,
document_category_name: item.value document_category_name: item.value
})
} }
} else {
typeData.push( {
document_category_id: item.setting_id,
document_category_name: item.value
}) })
}
})
console.log(typeData)
let typeProps = { let typeProps = {
options: typeData.sort((a, b) => a.document_category_id - b.document_category_id), options: typeData.sort((a, b) => a.document_category_id - b.document_category_id),
getOptionLabel: (option) => option.document_category_name, getOptionLabel: (option) => option.document_category_name,
...@@ -243,16 +254,14 @@ export default class CreateManagementDoc extends Component { ...@@ -243,16 +254,14 @@ export default class CreateManagementDoc extends Component {
validasi() { validasi() {
if (this.state.disabledPeriode === true) { if (this.state.disabledPeriode === true) {
if (R.isNil(this.state.getPerusahaan)) { if (R.isNil(this.state.getDocument)) {
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company Cannot be Empty' })
} else if (R.isNil(this.state.getDocument)) {
this.setState({ errorDocument: true, msgErrorDocument: 'Category Cannot be Empty' }) this.setState({ errorDocument: true, msgErrorDocument: 'Category Cannot be Empty' })
} else if (R.isNil(this.state.file)) { } else if (R.isNil(this.state.file)) {
this.setState({ alert: true, messageAlert: 'File Cannot be Empty', tipeAlert: 'warning' }) this.setState({ alert: true, messageAlert: 'File Cannot be Empty', tipeAlert: 'warning' })
} else { } else {
const formData = new FormData(); const formData = new FormData();
formData.append("file", this.state.file); formData.append("file", this.state.file);
formData.append("companyId", this.state.getPerusahaan.company_id); formData.append("companyId", 1);
formData.append("settingId", this.state.getDocument.document_category_id); formData.append("settingId", this.state.getDocument.document_category_id);
formData.append("description", this.state.description); formData.append("description", this.state.description);
formData.append("extension", this.state.fileType); formData.append("extension", this.state.fileType);
...@@ -318,7 +327,7 @@ export default class CreateManagementDoc extends Component { ...@@ -318,7 +327,7 @@ export default class CreateManagementDoc extends Component {
); );
return ( return (
<div> <div>
<div className="test app-popup-show"> <div className="test app-popup-show" style={{ zIndex: 120 }}>
<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' }}>
...@@ -338,6 +347,7 @@ export default class CreateManagementDoc extends Component { ...@@ -338,6 +347,7 @@ export default class CreateManagementDoc extends Component {
</div> </div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20, paddingTop: 20 }}> <div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20, paddingTop: 20 }}>
{this.state.disabledPeriode === false ?
<div className="column-1"> <div className="column-1">
<div style={{ padding: 10, borderRadius: 5 }}> <div style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete <Autocomplete
...@@ -357,6 +367,8 @@ export default class CreateManagementDoc extends Component { ...@@ -357,6 +367,8 @@ export default class CreateManagementDoc extends Component {
/> />
</div> </div>
</div> </div>
: true}
{this.state.disabledPeriode === false ?
<div className="column-2"> <div className="column-2">
<div style={{ padding: 10, borderRadius: 5 }}> <div style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete <Autocomplete
...@@ -381,7 +393,32 @@ export default class CreateManagementDoc extends Component { ...@@ -381,7 +393,32 @@ export default class CreateManagementDoc extends Component {
/> />
</div> </div>
</div> </div>
{/* {String(this.props.name).includes('Manual Book TIA') ? false : ( */} :
<div className="column-1">
<div style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete
{...this.state.document}
// debug
clearOnEscape
id="tipe"
onChange={(event, newInputValue) => this.setState({ getDocument: newInputValue },
() => newInputValue === null ? this.setState({ disabledPeriode: false })
: newInputValue.document_category_name === 'Manual Book TIA 4.0' ?
this.setState({ disabledPeriode: true }, () => this.clearMessage())
: this.setState({ disabledPeriode: false }, () => this.clearMessage())
)}
renderInput={(params) =>
<TextField {...params}
error={this.state.errorDocument}
helperText={this.state.msgErrorDocument}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
label="Category" />}
value={this.state.getDocument}
/>
</div>
</div>
}
{this.state.disabledPeriode === false ? {this.state.disabledPeriode === false ?
<div className="column-1"> <div className="column-1">
<div style={{ padding: 10, borderRadius: 5 }}> <div style={{ padding: 10, borderRadius: 5 }}>
...@@ -403,8 +440,6 @@ export default class CreateManagementDoc extends Component { ...@@ -403,8 +440,6 @@ export default class CreateManagementDoc extends Component {
/> />
</div> </div>
</div> </div>
// )}
// {String(this.props.name).includes('Manual Book TIA') ? false : (
: true} : true}
{this.state.disabledPeriode === false ? {this.state.disabledPeriode === false ?
<div className="column-2"> <div className="column-2">
...@@ -427,7 +462,6 @@ export default class CreateManagementDoc extends Component { ...@@ -427,7 +462,6 @@ export default class CreateManagementDoc extends Component {
/> />
</div> </div>
</div> </div>
// )}
: true} : true}
</div> </div>
<div style={{ paddingLeft: 30, paddingRight: 30, paddingTop: 10 }}> <div style={{ paddingLeft: 30, paddingRight: 30, paddingTop: 10 }}>
...@@ -494,11 +528,11 @@ export default class CreateManagementDoc extends Component { ...@@ -494,11 +528,11 @@ export default class CreateManagementDoc extends Component {
<button <button
type="button" type="button"
onClick={() => onClick={() =>
// {this.props.handleLoading(1) {this.props.handleLoading(1)
setTimeout(() => { setTimeout(() => {
this.validasi() this.validasi()
}, 100) }, 100)
// } }
} }
> >
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}> <div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
......
...@@ -93,19 +93,17 @@ export default class DocumentManagement extends Component { ...@@ -93,19 +93,17 @@ export default class DocumentManagement extends Component {
} }
createDocument(payload, settingID, menuName) { createDocument(payload, settingID, menuName) {
this.setState({ loading: true }) // this.setState({ visibleCreate: false, loading: true })
api.create().uploadDocument(payload).then(response => { api.create().uploadDocument(payload).then(response => {
console.log(response) console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.message === "The Document Already Exists in The System, Do You Want to Overwrite It?") { if (response.data.message === "The Document Already Exists in The System, Do You Want to Overwrite It?") {
this.setState({ formData: payload, docId: response.data.data.document_id, settingID, menuName, loading: false }, () => { this.setState({ konfirmasi: true, formData: payload, docId: response.data.data.document_id, settingID, menuName, loading: false })
this.setState({ konfirmasi: true })
})
} }
else if (response.data.message === "Data was Saved Successfully") { else if (response.data.message === "Data was Saved Successfully") {
this.getDataDocument(settingID, menuName) this.getDataDocument(settingID, menuName)
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success', settingID, menuName, visibleCreate: false, loading: false}) this.setState({ visibleCreate: false, loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'success', settingID, menuName})
} }
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 }, () => {
...@@ -127,6 +125,7 @@ export default class DocumentManagement extends Component { ...@@ -127,6 +125,7 @@ export default class DocumentManagement extends Component {
} }
createUploadDocument() { createUploadDocument() {
this.setState({ visibleCreate: false, konfirmasi: false })
const formData = this.state.formData const formData = this.state.formData
formData.append("documentId", this.state.docId) formData.append("documentId", this.state.docId)
formData.append("updated", 1) formData.append("updated", 1)
...@@ -137,7 +136,7 @@ export default class DocumentManagement extends Component { ...@@ -137,7 +136,7 @@ export default class DocumentManagement extends Component {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.getDataDocument(this.state.settingID, this.state.menuName) this.getDataDocument(this.state.settingID, this.state.menuName)
this.setState({ konfirmasi: false, alert: true, messageAlert: response.data.message, tipeAlert: 'success', visibleCreate: false }) this.setState({ konfirmasi: false, alert: true, messageAlert: response.data.message, tipeAlert: 'success', visibleCreate: false, loading: false })
} 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")) {
...@@ -253,7 +252,7 @@ export default class DocumentManagement extends Component { ...@@ -253,7 +252,7 @@ export default class DocumentManagement extends Component {
{this.state.loading && loadingComponent} {this.state.loading && loadingComponent}
<Paper style={{ padding: 20 }}> <Paper style={{ padding: 20 }}>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}> <div style={{ display: 'flex', justifyContent: 'flex-end' }}>
{(this.state.btncreate && this.state.btnadd) && <span> {(this.state.btncreate) && <span>
<a data-tip={'Add'} data-for="add"> <a data-tip={'Add'} data-for="add">
<div style={{ display: 'grid', justifyContent: 'flex-end' }}> <div style={{ display: 'grid', justifyContent: 'flex-end' }}>
<button <button
...@@ -295,6 +294,8 @@ export default class DocumentManagement extends Component { ...@@ -295,6 +294,8 @@ export default class DocumentManagement extends Component {
load={this.state.load} load={this.state.load}
setId={this.state.id} setId={this.state.id}
userCompActive={this.state.userCompActive} userCompActive={this.state.userCompActive}
allsubcoEdit={this.state.btnadd}
handleLoading={this.handleLoading.bind(this)}
/> />
// this.state.id === 68542 ? // this.state.id === 68542 ?
// <AuditTahunan // <AuditTahunan
...@@ -359,6 +360,7 @@ export default class DocumentManagement extends Component { ...@@ -359,6 +360,7 @@ export default class DocumentManagement extends Component {
setting_id={this.state.id} setting_id={this.state.id}
name={this.state.name} name={this.state.name}
handleLoading={this.handleLoading.bind(this)} handleLoading={this.handleLoading.bind(this)}
allsubcoCreate={this.state.btnadd}
/> />
)} )}
</div> </div>
......
...@@ -291,11 +291,11 @@ export default class EditManagementDoc extends Component { ...@@ -291,11 +291,11 @@ export default class EditManagementDoc extends Component {
this.setState({ errorPeriode: true, msgErrorPeriode: 'Period Cannot be Empty' }) this.setState({ errorPeriode: true, msgErrorPeriode: 'Period Cannot be Empty' })
} else if (R.isNil(this.state.monthId)) { } else if (R.isNil(this.state.monthId)) {
this.setState({ errorMonth: true, msgErrorMonth: 'Month Cannot be Empty' }) this.setState({ errorMonth: true, msgErrorMonth: 'Month Cannot be Empty' })
} else if (R.isNil(this.state.getPerusahaan)) {
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company Cannot be Empty' })
} }
} }
if (R.isNil(this.state.getPerusahaan)) { if (R.isNil(this.state.getDocument)) {
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company Cannot be Empty' })
} else if (R.isNil(this.state.getDocument)) {
this.setState({ errorDocument: true, msgErrorDocument: 'Category Cannot be Empty' }) this.setState({ errorDocument: true, msgErrorDocument: 'Category Cannot be Empty' })
} else if (R.isNil(this.state.file)) { } else if (R.isNil(this.state.file)) {
this.setState({ alert: true, messageAlert: 'File Cannot be Empty', tipeAlert: 'warning' }) this.setState({ alert: true, messageAlert: 'File Cannot be Empty', tipeAlert: 'warning' })
...@@ -313,11 +313,13 @@ export default class EditManagementDoc extends Component { ...@@ -313,11 +313,13 @@ export default class EditManagementDoc extends Component {
if (String(this.props.name).includes('Manual Book TIA')){ if (String(this.props.name).includes('Manual Book TIA')){
formData.append("documentMonth", null); formData.append("documentMonth", null);
formData.append("documentPeriode", null); formData.append("documentPeriode", null);
formData.append("companyId", 1);
} else { } else {
formData.append("documentMonth", this.state.monthId.month_id); formData.append("documentMonth", this.state.monthId.month_id);
formData.append("documentPeriode", this.state.periode.periode); formData.append("documentPeriode", this.state.periode.periode);
}
formData.append("companyId", this.state.getPerusahaan.company_id); formData.append("companyId", this.state.getPerusahaan.company_id);
}
formData.append("settingId", this.state.getDocument.document_category_id); formData.append("settingId", this.state.getDocument.document_category_id);
formData.append("description", this.state.description); formData.append("description", this.state.description);
formData.append("extension", this.state.fileType); formData.append("extension", this.state.fileType);
...@@ -359,6 +361,7 @@ export default class EditManagementDoc extends Component { ...@@ -359,6 +361,7 @@ export default class EditManagementDoc extends Component {
</div> </div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20, paddingTop: 20 }}> <div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20, paddingTop: 20 }}>
{this.state.disabledPeriode === false ?
<div className="column-1"> <div className="column-1">
<div style={{ padding: 10, borderRadius: 5 }}> <div style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete <Autocomplete
...@@ -378,6 +381,8 @@ export default class EditManagementDoc extends Component { ...@@ -378,6 +381,8 @@ export default class EditManagementDoc extends Component {
/> />
</div> </div>
</div> </div>
:true}
{this.state.disabledPeriode === false ?
<div className="column-2"> <div className="column-2">
<div style={{ padding: 10, borderRadius: 5 }}> <div style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete <Autocomplete
...@@ -402,8 +407,33 @@ export default class EditManagementDoc extends Component { ...@@ -402,8 +407,33 @@ export default class EditManagementDoc extends Component {
/> />
</div> </div>
</div> </div>
:
<div className="column-1">
<div style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete
{...this.state.document}
// debug
clearOnEscape
id="tipe"
onChange={(event, newInputValue) => this.setState({ getDocument: newInputValue },
() => newInputValue === null ? this.setState({ disabledPeriode: false })
: newInputValue.document_category_name === 'Manual Book TIA 4.0' ?
this.setState({ disabledPeriode: true }, () => this.clearMessage())
: this.setState({ disabledPeriode: false }, () => this.clearMessage())
)}
renderInput={(params) =>
<TextField {...params}
error={this.state.errorDocument}
helperText={this.state.msgErrorDocument}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
label="Category" />}
value={this.state.getDocument}
/>
</div>
</div>
}
{this.state.disabledPeriode === false ? {this.state.disabledPeriode === false ?
// {String(this.state.name).includes('Manual Book TIA') ? false : (
<div className="column-1"> <div className="column-1">
<div style={{ padding: 10, borderRadius: 5 }}> <div style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete <Autocomplete
...@@ -424,10 +454,8 @@ export default class EditManagementDoc extends Component { ...@@ -424,10 +454,8 @@ export default class EditManagementDoc extends Component {
/> />
</div> </div>
</div> </div>
// )}
: true } : true }
{this.state.disabledPeriode === false ? {this.state.disabledPeriode === false ?
// {String(this.state.name).includes('Manual Book TIA') ? false : (
<div className="column-2"> <div className="column-2">
<div style={{ padding: 10, borderRadius: 5 }}> <div style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete <Autocomplete
...@@ -448,7 +476,6 @@ export default class EditManagementDoc extends Component { ...@@ -448,7 +476,6 @@ export default class EditManagementDoc extends Component {
/> />
</div> </div>
</div> </div>
// )}
: true} : true}
</div> </div>
<div style={{ paddingLeft: 30, paddingRight: 30, paddingTop: 10 }}> <div style={{ paddingLeft: 30, paddingRight: 30, paddingTop: 10 }}>
......
...@@ -696,6 +696,7 @@ export default class Perusahaan extends Component { ...@@ -696,6 +696,7 @@ export default class Perusahaan extends Component {
{this.state.messageAlert} {this.state.messageAlert}
</Alert> </Alert>
</Snackbar> </Snackbar>
{this.state.loading && loadingComponent}
{this.state.visiblePerusahaan === true ? {this.state.visiblePerusahaan === true ?
this.state.load && ( this.state.load && (
<div> <div>
...@@ -790,7 +791,6 @@ export default class Perusahaan extends Component { ...@@ -790,7 +791,6 @@ export default class Perusahaan extends Component {
</div> </div>
</div> </div>
<div style={{ padding: 25 }}> <div style={{ padding: 25 }}>
{this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
theme={getMuiTheme()} theme={getMuiTheme()}
...@@ -811,6 +811,7 @@ export default class Perusahaan extends Component { ...@@ -811,6 +811,7 @@ export default class Perusahaan extends Component {
onClickClose={() => this.setState({ visibleVisual: false, visiblePerusahaan: true })} onClickClose={() => this.setState({ visibleVisual: false, visiblePerusahaan: true })}
height={this.props.height} height={this.props.height}
updateHierarchy={this.updateHierarchy.bind(this)} updateHierarchy={this.updateHierarchy.bind(this)}
handleLoading={() => this.setState({loading: true}, () => console.log('aksdkas'))}
/> />
: :
<div> <div>
......
...@@ -185,7 +185,10 @@ export default class VisualPerusahaan extends Component { ...@@ -185,7 +185,10 @@ export default class VisualPerusahaan extends Component {
<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>
<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.props.handleLoading()
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>
......
...@@ -63,7 +63,7 @@ export default class ReportItems extends Component { ...@@ -63,7 +63,7 @@ export default class ReportItems extends Component {
invalidTemplate: false, invalidTemplate: false,
loading: false loading: false
} }
this.myRef = React.createRef()
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
} }
...@@ -824,6 +824,8 @@ export default class ReportItems extends Component { ...@@ -824,6 +824,8 @@ export default class ReportItems extends Component {
this.setState({ alert: false }) this.setState({ alert: false })
} }
scrollToMyRef = () => window.scrollTo(0, this.myRef.current.offsetTop)
render() { render() {
const columns = [{ const columns = [{
name: "Action", name: "Action",
...@@ -1049,7 +1051,7 @@ export default class ReportItems extends Component { ...@@ -1049,7 +1051,7 @@ export default class ReportItems extends Component {
</div> </div>
); );
return ( return (
<div style={{ height: this.props.height }}> <div style={{ height: this.props.height }} ref={this.myRef}>
{/* <Row> */} {/* <Row> */}
<div className={"main-color"} style={{ height: 195, width: '100%' }} /> <div className={"main-color"} style={{ height: 195, width: '100%' }} />
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}> <Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
...@@ -1057,6 +1059,7 @@ export default class ReportItems extends Component { ...@@ -1057,6 +1059,7 @@ export default class ReportItems extends Component {
{this.state.messageAlert} {this.state.messageAlert}
</Alert> </Alert>
</Snackbar> </Snackbar>
{this.state.loading && loadingComponent}
{this.state.itemReport === true ? {this.state.itemReport === true ?
this.state.load && ( this.state.load && (
<div> <div>
...@@ -1150,7 +1153,6 @@ export default class ReportItems extends Component { ...@@ -1150,7 +1153,6 @@ export default class ReportItems extends Component {
</div> </div>
</div> </div>
<div style={{ padding: 25 }}> <div style={{ padding: 25 }}>
{this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
theme={getMuiTheme()} theme={getMuiTheme()}
...@@ -1170,6 +1172,8 @@ export default class ReportItems extends Component { ...@@ -1170,6 +1172,8 @@ export default class ReportItems extends Component {
buttonEdit={this.state.buttonEdit} buttonEdit={this.state.buttonEdit}
onClickClose={() => this.setState({ visualisasi: false, itemReport: true }, () => this.getData())} onClickClose={() => this.setState({ visualisasi: false, itemReport: true }, () => this.getData())}
height={this.props.height} height={this.props.height}
handleLoading={() => this.setState({ loading: true })}
scrollToTop={() => this.scrollToMyRef()}
/> />
: :
<div> <div>
......
...@@ -27,6 +27,7 @@ export default class CreateReportItems extends Component { ...@@ -27,6 +27,7 @@ export default class CreateReportItems extends Component {
uom: '', uom: '',
weight: '', weight: '',
formula: '', formula: '',
formulasum: '',
realVal: '', realVal: '',
condition: null, condition: null,
date: new Date(), date: new Date(),
...@@ -57,6 +58,7 @@ export default class CreateReportItems extends Component { ...@@ -57,6 +58,7 @@ export default class CreateReportItems extends Component {
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
disabledFormula: true, disabledFormula: true,
disabledFormulaSum: true,
disabledCondt: true, disabledCondt: true,
disabledValue: true, disabledValue: true,
options: ['WARNING', 'STOPPER'], options: ['WARNING', 'STOPPER'],
...@@ -761,6 +763,15 @@ export default class CreateReportItems extends Component { ...@@ -761,6 +763,15 @@ export default class CreateReportItems extends Component {
condition: '', condition: '',
realVal: '' realVal: ''
}, () => this.clearMessage()) }, () => this.clearMessage())
: newInputValue.type_item_report_name === 'Formula - Summary' ?
this.setState({
disabledFormula: false,
disabledCondt: true,
disabledValue: true,
formula: '',
condition: '',
realVal: ''
}, () => this.clearMessage())
: this.setState({ : this.setState({
disabledFormula: true, disabledFormula: true,
disabledCondt: true, disabledCondt: true,
......
...@@ -783,7 +783,7 @@ export default class EditReportItems extends Component { ...@@ -783,7 +783,7 @@ export default class EditReportItems extends Component {
style={{ width: '100%' }} style={{ width: '100%' }}
id="formula" id="formula"
label="Formula" label="Formula"
disabled={this.state.InputType == null ? true : (this.state.InputType.type_item_report_name === 'Formula' || this.state.InputType.type_item_report_name === 'Validation' ? false : true)} disabled={this.state.InputType == null ? true : (this.state.InputType.type_item_report_name === 'Formula' || this.state.InputType.type_item_report_name === 'Validation' || this.state.InputType.type_item_report_name === 'Formula - Summary' ? false : true)}
name="formula" name="formula"
error={this.state.errorFormula} error={this.state.errorFormula}
helperText={this.state.msgErrorFormula} helperText={this.state.msgErrorFormula}
......
...@@ -334,7 +334,10 @@ export default class VisualReportItems extends Component { ...@@ -334,7 +334,10 @@ export default class VisualReportItems extends Component {
<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>
<button onClick={() => this.handleSave()}> <button onClick={() => {
this.props.handleLoading()
this.props.scrollToTop()
this.handleSave()}}>
<div style={{ width: 102, height: 30, marginLeft: 25, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor: "pointer" }}> <div 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>
......
...@@ -315,10 +315,20 @@ export default class OperatingIndicator extends Component { ...@@ -315,10 +315,20 @@ export default class OperatingIndicator extends Component {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{val === "submitted" || val === "approved" ? {val === "submitted" || val === "approved" ?
<img src={Images.ceklis} style={{ width: 31, height: 24 }} /> : <span>COMPLETED</span> :
val === "draft" ?
<span>DRAFT</span> :
val === "revision" ? val === "revision" ?
<span>Revisi</span> : <span>REVISION</span> :
null val === "approval_proccess" ?
<span>APPROVAL PROCCESS</span> :
val === "approval_review" ?
<span>APPROVAL REVIEW</span> :
val === "not-yet" ?
<span>OPEN</span> :
val === "CLOSED" ?
<span>CLOSED</span> :
<img src={Images.cross} style={{ width: 31, height: 24 }} />
} }
</div > </div >
); );
......
This diff is collapsed.
This diff is collapsed.
...@@ -28,7 +28,7 @@ const arraySide = [ ...@@ -28,7 +28,7 @@ const arraySide = [
{ {
img: Images.outlookperformance, img: Images.outlookperformance,
label: 'Outlook Performance Appraisal', label: 'Outlook Performance Appraisal',
path: 'beranda', path: 'outlook-performance',
subItem: null subItem: 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