Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
ab220b31
Commit
ab220b31
authored
Jan 18, 2021
by
rifkaki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into rifka
parents
90007a0e
5bb9ffbb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
22 deletions
+35
-22
HomePage.js
src/container/HomePage.js
+2
-2
MonthlyReport.js
src/container/MonthlyReport.js
+33
-20
No files found.
src/container/HomePage.js
View file @
ab220b31
...
@@ -69,8 +69,6 @@ class HomePage extends Component {
...
@@ -69,8 +69,6 @@ class HomePage extends Component {
this
.
getPermissionMR
()
this
.
getPermissionMR
()
this
.
getApprMat
()
this
.
getApprMat
()
// this.getListUserSubco()
// this.getListUserSubco()
this
.
getDashboardMB
()
this
.
getDashboard
()
this
.
getMonth
()
this
.
getMonth
()
}
}
...
@@ -370,6 +368,8 @@ class HomePage extends Component {
...
@@ -370,6 +368,8 @@ class HomePage extends Component {
}
}
this
.
setState
({
isApproverMB
,
isApproverMR
})
this
.
setState
({
isApproverMB
,
isApproverMR
})
this
.
getDashboardMB
()
this
.
getDashboardMB
()
// this.getDashboardMB()
this
.
getDashboard
()
// console.log(actAM)
// console.log(actAM)
this
.
setState
({
loading
:
false
})
this
.
setState
({
loading
:
false
})
})
})
...
...
src/container/MonthlyReport.js
View file @
ab220b31
...
@@ -466,7 +466,7 @@ export default class MonthlyReport extends Component {
...
@@ -466,7 +466,7 @@ export default class MonthlyReport extends Component {
"months": this.state.month.month_id,
"months": this.state.month.month_id,
"status": selectedStatus
"status": selectedStatus
}
}
this.setState({isApprovedMB: true})
api.create().getCompanySubmittedMonthly(body).then(response => {
api.create().getCompanySubmittedMonthly(body).then(response => {
console.log(response);
console.log(response);
if (response.data) {
if (response.data) {
...
@@ -507,12 +507,12 @@ export default class MonthlyReport extends Component {
...
@@ -507,12 +507,12 @@ export default class MonthlyReport extends Component {
} else {
} else {
// console.log(this.state.listCompany)
// console.log(this.state.listCompany)
// console.log(this.state.company_submit)
// console.log(this.state.company_submit)
this
.
setState
({
listRevision
:
null
,
revision
:
null
,
dataTable
:
[],
checkApprover
:
false
,
lastRevision
:
""
,
visibleTableHistory
:
false
})
this.setState({ listRevision: null, revision: null, dataTable: [], lastRevision: "", visibleTableHistory: false })
}
}
//
//
})
})
} else {
} else {
this
.
setState
({
listRevision
:
null
,
revision
:
null
,
listCompany
:
null
,
company
:
null
,
dataTable
:
[],
checkApprover
:
false
,
lastRevision
:
""
,
visibleTableHistory
:
false
,
loading
:
false
},
()
=>
{
this.setState({ listRevision: null, revision: null, listCompany: null, company: null, dataTable: [], lastRevision: "", visibleTableHistory: false, loading: false }, () => {
document.body.style.overflow = 'unset';
document.body.style.overflow = 'unset';
})
})
}
}
...
@@ -605,7 +605,7 @@ export default class MonthlyReport extends Component {
...
@@ -605,7 +605,7 @@ export default class MonthlyReport extends Component {
console.log(response)
console.log(response)
if (this.state.btnCreate === true && this.state.btnEdit === true) {
if (this.state.btnCreate === true && this.state.btnEdit === true) {
console.log('editable');
console.log('editable');
this
.
setState
({
isApprover
:
false
,
checkApprover
:
false
})
this.setState({ isApprover:
this.state.approverTrue? true : false, checkApprover: this.state.approverTrue? true
: false })
} else {
} else {
console.log('just view');
console.log('just view');
this.setState({ isApprover: true, checkApprover: true })
this.setState({ isApprover: true, checkApprover: true })
...
@@ -883,8 +883,8 @@ export default class MonthlyReport extends Component {
...
@@ -883,8 +883,8 @@ export default class MonthlyReport extends Component {
validate() {
validate() {
this
.
setState
({
loading
:
true
},
()
=>
{
this.setState({ loading: true
, selectedStatus: this.state.listStatus
}, () => {
document
.
body
.
style
.
overflow
=
'hidden'
;
//
document.body.style.overflow = 'hidden';
})
})
let array = []
let array = []
let canSubmit = true
let canSubmit = true
...
@@ -909,7 +909,7 @@ export default class MonthlyReport extends Component {
...
@@ -909,7 +909,7 @@ export default class MonthlyReport extends Component {
console.log(response);
console.log(response);
if (response.data) {
if (response.data) {
if (response.data.status === "success") {
if (response.data.status === "success") {
this
.
get
Permission
()
this.get
MonthlyReportID
()
}
}
}
}
})
})
...
@@ -927,7 +927,7 @@ export default class MonthlyReport extends Component {
...
@@ -927,7 +927,7 @@ export default class MonthlyReport extends Component {
}
}
validateRevision() {
validateRevision() {
this
.
scrollToMyRef
()
//
this.scrollToMyRef()
let arrayRevisi = this.state.detailRevisiCheck
let arrayRevisi = this.state.detailRevisiCheck
let remarksKosong = 0
let remarksKosong = 0
arrayRevisi.map((item, index) => {
arrayRevisi.map((item, index) => {
...
@@ -944,9 +944,10 @@ export default class MonthlyReport extends Component {
...
@@ -944,9 +944,10 @@ export default class MonthlyReport extends Component {
}
}
approvalSubmission(type) {
approvalSubmission(type) {
this
.
scrollToMyRef
()
// this.scrollToMyRef()
this
.
setState
({
loading
:
true
},
()
=>
{
document
.
body
.
style
.
overflow
=
'hidden'
;
this.setState({ loading: true, selectedStatus: this.state.listStatus }, () => {
// document.body.style.overflow = 'hidden';
})
})
let body = {
let body = {
"approval_id": this.state.approverID,
"approval_id": this.state.approverID,
...
@@ -957,10 +958,11 @@ export default class MonthlyReport extends Component {
...
@@ -957,10 +958,11 @@ export default class MonthlyReport extends Component {
let payload = {
let payload = {
"company_id": this.state.company.company_id,
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode,
"periode": this.state.periode.periode,
"months": this.state.month.month_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')
}
}
// // //
console.log(payload)
console.log(payload)
// // console.log(this.props.location);
// // console.log(this.props.location);
// // console.log(body)
// // console.log(body)
api.create().approvalMonthly(body).then((res) => {
api.create().approvalMonthly(body).then((res) => {
...
@@ -970,7 +972,7 @@ export default class MonthlyReport extends Component {
...
@@ -970,7 +972,7 @@ export default class MonthlyReport extends Component {
if (type == 'revision') {
if (type == 'revision') {
api.create().createPeriodeRevisionMonthly(payload).then((res))
api.create().createPeriodeRevisionMonthly(payload).then((res))
}
}
this
.
get
Permission
()
this.get
MonthlyReportID
()
})
})
}
}
...
@@ -1254,7 +1256,7 @@ export default class MonthlyReport extends Component {
...
@@ -1254,7 +1256,7 @@ export default class MonthlyReport extends Component {
);
);
return (
return (
<
div
style
=
{{
flex
:
1
,
backgroundColor
:
'#f8f8f8'
}}
ref
=
{
this
.
myRef
}
>
<div style={{ flex: 1, backgroundColor: '#f8f8f8'
, overflow: 'scroll' }
}>
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
<Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
<Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
{this.state.messageAlert}
{this.state.messageAlert}
...
@@ -1345,7 +1347,11 @@ export default class MonthlyReport extends Component {
...
@@ -1345,7 +1347,11 @@ export default class MonthlyReport extends Component {
// this.getCompanySubmitted()
// this.getCompanySubmitted()
// } else {
// } else {
this.setState({ visibleTableHistory: false })
this.setState({ visibleTableHistory: false })
if (this.state.listCompany == null) {
this.getCompanySubmitted()
} else {
this.getRevision()
this.getRevision()
}
// }
// }
})}
})}
disableClearable
disableClearable
...
@@ -1361,7 +1367,11 @@ export default class MonthlyReport extends Component {
...
@@ -1361,7 +1367,11 @@ export default class MonthlyReport extends Component {
// this.getCompanySubmitted()
// this.getCompanySubmitted()
// } else {
// } else {
this.setState({ visibleTableHistory: false })
this.setState({ visibleTableHistory: false })
if (this.state.listCompany == null) {
this.getCompanySubmitted()
} else {
this.getRevision()
this.getRevision()
}
// }
// }
})}
})}
disableClearable
disableClearable
...
@@ -1535,6 +1545,9 @@ export default class MonthlyReport extends Component {
...
@@ -1535,6 +1545,9 @@ export default class MonthlyReport extends Component {
</div> : this.state.lastStatus === 'WAITING FOR APPROVAL' ?
</div> : this.state.lastStatus === 'WAITING FOR APPROVAL' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{`${this.state.lastStatus} - ${this.state.pic}`}</span>
<span>{`${this.state.lastStatus} - ${this.state.pic}`}</span>
</div> : this.state.lastStatus === 'REVISION' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{this.state.textRevision}</span>
</div> : this.state.lastStatus === 'APPROVED' ?
</div> : this.state.lastStatus === 'APPROVED' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{`${this.state.lastStatus}`}</span>
<span>{`${this.state.lastStatus}`}</span>
...
@@ -1655,7 +1668,7 @@ export default class MonthlyReport extends Component {
...
@@ -1655,7 +1668,7 @@ export default class MonthlyReport extends Component {
</div>
</div>
</div> : null
</div> : null
:
:
(
this
.
state
.
lastStatus
===
'SUBMIT'
||
this
.
state
.
lastStatus
===
'REVISION'
)
&&
this
.
state
.
isSubmit
===
true
?
(this.state.lastStatus === 'SUBMIT' || this.state.lastStatus === 'REVISION') && this.state.isSubmit?
<div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} >
<div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} >
<button
<button
style={{
style={{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment