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
8f7847d3
Commit
8f7847d3
authored
Jan 23, 2023
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push notif
parent
c1892a84
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
5 deletions
+52
-5
index.js
src/api/index.js
+3
-0
ProgressReport.js
src/container/ProgressReport/ProgressReport.js
+3
-1
TableProgressReport.js
src/container/ProgressReport/TableProgressReport.js
+46
-4
No files found.
src/api/index.js
View file @
8f7847d3
...
...
@@ -493,6 +493,9 @@ const create = (type = "") => {
const
createMaintenanceMode
=
(
body
)
=>
api
.
post
(
'maintenance/mode/create_maintenance_mode'
,
body
)
const
updateMaintenanceMode
=
(
body
)
=>
api
.
post
(
'maintenance/mode/update_maintenance_mode'
,
body
)
// Reminder Manual
const
sendEmail
=
(
body
)
=>
api
.
post
(
'transaction/monitoring/reminder_progress_report'
,
body
)
// Superadmin Approve
const
getListApprover
=
(
report
,
monthlyReportId
)
=>
api
.
get
(
`transaction/
${
report
}
/get_approver/
${
monthlyReportId
}
`
)
const
getIdToken
=
(
userId
)
=>
api
.
get
(
`transaction/get_token/
${
userId
}
`
)
...
...
src/container/ProgressReport/ProgressReport.js
View file @
8f7847d3
...
...
@@ -201,7 +201,7 @@ class ReportProgress extends Component {
// report
// ])
// })
console
.
log
(
dataTable
)
//
console.log(dataTable)
this
.
setState
({
dataTable
,
loading
:
false
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
...
...
@@ -560,8 +560,10 @@ class ReportProgress extends Component {
// dataTable={this.state.dataTable}
periode
=
{
this
.
state
.
periode
?
this
.
state
.
periode
.
periode
:
null
}
quarter
=
{
this
.
state
.
quarter
.
name
}
month
=
{
this
.
state
.
month
.
month_id
}
company
=
{
this
.
state
.
company
}
typeReport
=
{
String
(
this
.
state
.
reportType
.
name
).
toLocaleUpperCase
()}
year
=
{
this
.
state
.
periodeMB
.
value
}
/
>
)}
<
/div
>
...
...
src/container/ProgressReport/TableProgressReport.js
View file @
8f7847d3
import
React
,
{
Component
}
from
"react"
;
import
{
createMuiTheme
,
FormControlLabel
,
Input
,
MuiThemeProvider
,
TableCell
,
Typography
}
from
"@material-ui/core"
;
import
MUIDataTable
from
"mui-datatables"
;
import
api
from
'../../api'
;
import
Constant
from
'../../library/Constant'
;
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable4
());
...
...
@@ -26,7 +29,46 @@ export default class TableProgressReport extends Component {
}
}
handleSendEmail
(
idCompany
)
{
// console.log(this.props);
let
data
=
this
.
props
let
q1
=
data
.
reportType
===
2
&&
data
.
quarter
===
"Q1"
let
q2
=
data
.
reportType
===
2
&&
data
.
quarter
===
"Q2"
let
q3
=
data
.
reportType
===
2
&&
data
.
quarter
===
"Q3"
console
.
log
(
q1
);
let
payload
=
{
"company_id"
:
idCompany
,
"setting_type_name"
:
data
.
reportType
===
0
?
"master_budget"
:
data
.
reportType
===
1
?
"monthly_report"
:
q1
?
"outlook_q1"
:
q2
?
"outlook_q2"
:
q3
?
"outlook_q3"
:
data
.
reportType
===
3
?
"outlook_pa"
:
null
,
"year"
:
data
.
year
,
"month"
:
data
.
reportType
===
1
?
data
.
month
:
null
}
// api.create().sendEmail(payload).then(response => {
// if (response.data) {
// if (response.ok) {
// if (response.data.status == 'success') {
// this.getData()
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
// if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
// setTimeout(() => {
// localStorage.removeItem(Constant.TOKEN)
// window.location.reload();
// }, 1000);
// }
// })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
// }
// })
}
render
()
{
let
dataTable2
=
this
.
props
.
dataTable
;
// console.log(this.props);
const
handleValue
=
(
tableMeta
,
itemName
)
=>
{
...
...
@@ -142,7 +184,7 @@ export default class TableProgressReport extends Component {
<
button
type
=
"button"
style
=
{{
background
:
'white'
}}
onClick
=
{()
=>
alert
(
tableMeta
.
rowData
[
5
])}
onClick
=
{()
=>
this
.
handleSendEmail
(
tableMeta
.
rowData
[
5
])}
>
<
div
style
=
{{
width
:
85
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
{
tableMeta
.
rowData
[
3
]
===
null
||
tableMeta
.
rowData
[
3
]
===
0
?
"Send Email"
:
"Sent"
}
<
/span
>
...
...
@@ -300,7 +342,7 @@ export default class TableProgressReport extends Component {
<
button
type
=
"button"
style
=
{{
background
:
'white'
}}
onClick
=
{()
=>
alert
(
tableMeta
.
rowData
[
5
])}
onClick
=
{()
=>
this
.
handleSendEmail
(
tableMeta
.
rowData
[
5
])}
>
<
div
style
=
{{
width
:
85
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
{
tableMeta
.
rowData
[
3
]
===
null
||
tableMeta
.
rowData
[
3
]
===
0
?
"Send Email"
:
"Sent"
}
<
/span
>
...
...
@@ -442,7 +484,7 @@ export default class TableProgressReport extends Component {
<
button
type
=
"button"
style
=
{{
background
:
'white'
}}
onClick
=
{()
=>
alert
(
tableMeta
.
rowData
[
5
])}
onClick
=
{()
=>
this
.
handleSendEmail
(
tableMeta
.
rowData
[
5
])}
>
<
div
style
=
{{
width
:
85
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
{
tableMeta
.
rowData
[
3
]
===
null
||
tableMeta
.
rowData
[
3
]
===
0
?
"Send Email"
:
"Sent"
}
<
/span
>
...
...
@@ -584,7 +626,7 @@ export default class TableProgressReport extends Component {
<
button
type
=
"button"
style
=
{{
background
:
'white'
}}
onClick
=
{()
=>
alert
(
tableMeta
.
rowData
[
5
])}
onClick
=
{()
=>
this
.
handleSendEmail
(
tableMeta
.
rowData
[
5
])}
>
<
div
style
=
{{
width
:
85
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
{
tableMeta
.
rowData
[
3
]
===
null
||
tableMeta
.
rowData
[
3
]
===
0
?
"Send Email"
:
"Sent"
}
<
/span
>
...
...
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