Commit ca353319 authored by d.arizona's avatar d.arizona

update banyak

parent e71f2433
...@@ -251,6 +251,9 @@ const create = (type = "") => { ...@@ -251,6 +251,9 @@ const create = (type = "") => {
const getRollingOutlookIsApprover = (body) => api.get('transaction/rolling_outlook/is_approver', body) const getRollingOutlookIsApprover = (body) => api.get('transaction/rolling_outlook/is_approver', body)
const uploadAttachmentRO = (body) => api.post('transaction/rolling_outlook/upload_attachment', body) const uploadAttachmentRO = (body) => api.post('transaction/rolling_outlook/upload_attachment', body)
const deleteAttachmentRO = (id) => api.post(`transaction/rolling_outlook/delete_attachment/${id}`) const deleteAttachmentRO = (id) => api.post(`transaction/rolling_outlook/delete_attachment/${id}`)
const approvalRolling = (body) => api.post('transaction/rolling_outlook/approval_rolling', body)
const createPeriodeRevisionRO = (body) => api.post('transaction/rolling_outlook/create_periode_revision', body)
const historyApprovalRO = (body) => api.post('transaction/rolling_outlook/history_approval', body)
const getRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/get_report_hierarki', body) const getRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/get_report_hierarki', body)
const checkImportRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/check_import', body) const checkImportRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/check_import', body)
...@@ -770,7 +773,10 @@ const create = (type = "") => { ...@@ -770,7 +773,10 @@ const create = (type = "") => {
uploadRollingOutlookOI, uploadRollingOutlookOI,
submitRollingOutlook, submitRollingOutlook,
getRollingOutlookCompanySubmitted, getRollingOutlookCompanySubmitted,
createPeriodeRevisionOLPA createPeriodeRevisionOLPA,
approvalRolling,
createPeriodeRevisionRO,
historyApprovalRO
} }
} }
......
...@@ -382,7 +382,7 @@ export default class OutlookPA extends Component { ...@@ -382,7 +382,7 @@ export default class OutlookPA extends Component {
"is_approver": this.state.isApprover "is_approver": this.state.isApprover
} }
api.create().getOutlookPAID(payload).then(response => { api.create().getOutlookPAID(payload).then(response => {
// console.log(response) console.log(response)
if (response) { if (response) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
......
...@@ -555,9 +555,10 @@ export default class RollingOutlook extends Component { ...@@ -555,9 +555,10 @@ export default class RollingOutlook extends Component {
historyApproval() { historyApproval() {
let body = { let body = {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"periode": this.state.periode.periode "periode": this.state.periode.periode,
"quartal": this.state.quarter.value
} }
api.create().historyApproval(body).then(response => { api.create().historyApprovalRO(body).then(response => {
console.log(response); console.log(response);
if (response.data.data.length > 0) { if (response.data.data.length > 0) {
let dataTableHistory = response.data.data.map(item => { let dataTableHistory = response.data.data.map(item => {
...@@ -569,7 +570,7 @@ export default class RollingOutlook extends Component { ...@@ -569,7 +570,7 @@ export default class RollingOutlook extends Component {
item.history_approval_date item.history_approval_date
] ]
}) })
this.setState({ dataTableHistory, visibleTableHistory: false }) this.setState({ dataTableHistory, visibleTableHistory: true })
} }
}) })
} }
...@@ -580,21 +581,23 @@ export default class RollingOutlook extends Component { ...@@ -580,21 +581,23 @@ export default class RollingOutlook extends Component {
let body = { let body = {
"approval_id": this.props.location.state == undefined ? this.state.approverID : this.state.rawData.approval_id, "approval_id": this.props.location.state == undefined ? this.state.approverID : this.state.rawData.approval_id,
"status": type, "status": type,
"detail": this.state.detailRevisiCheck "detail": this.state.detailRevisiCheck,
"quartal": this.state.quarter.value
} }
let payload = { let payload = {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"min_periode": moment(this.state.minDateRevision).format('YYYY-MM-DD'), "min_periode": moment(this.state.minDateRevision).format('YYYY-MM-DD'),
"max_periode": moment(this.state.maxDateRevision).format('YYYY-MM-DD') "max_periode": moment(this.state.maxDateRevision).format('YYYY-MM-DD'),
"quartal": this.state.quarter.value
} }
console.log(payload) console.log(payload)
api.create().approvalSubmission(body).then((res) => { api.create().approvalRolling(body).then((res) => {
console.log(res) console.log(res)
this.setState({ loading: false }, () => { this.setState({ loading: false }, () => {
this.getRollingOutlookID() this.getRollingOutlookID()
}) })
if (type == 'revision') { if (type == 'revision') {
api.create().createPeriodeRevision(payload).then((res) => console.log(res)) api.create().createPeriodeRevisionRO(payload).then((res) => console.log(res))
} }
}) })
} }
...@@ -785,7 +788,7 @@ export default class RollingOutlook extends Component { ...@@ -785,7 +788,7 @@ export default class RollingOutlook extends Component {
api.create().submitRollingOutlook(body).then(response => { api.create().submitRollingOutlook(body).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "Success") { if (response.data.status === "success") {
this.getRollingOutlookID() this.getRollingOutlookID()
} }
} }
......
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