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
bfd45510
Commit
bfd45510
authored
Jul 17, 2022
by
Arfin Syadziy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev/arfin' into 'ENV-DEV-CR-CAFRM'
Dev/arfin See merge request
!1599
parents
8bde7f1c
ed408605
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
159 additions
and
224 deletions
+159
-224
CafrmDocument.js
src/container/CAFRM/CafrmDocument.js
+100
-128
CreateCarfmDocument.js
src/container/CAFRM/CreateCarfmDocument.js
+52
-89
TableCafrmDocument.js
src/container/CAFRM/TableCafrmDocument.js
+5
-6
DocumentManagement.js
src/container/DocumentManagement/DocumentManagement.js
+1
-0
homeRoutes.js
src/router/homeRoutes.js
+1
-1
No files found.
src/container/C
RFM/Carf
mDocument.js
→
src/container/C
AFRM/Cafr
mDocument.js
View file @
bfd45510
This diff is collapsed.
Click to expand it.
src/container/C
RFM/CreateCarfmDoc
.js
→
src/container/C
AFRM/CreateCarfmDocument
.js
View file @
bfd45510
...
@@ -19,6 +19,7 @@ export default class CreateCarfmDoc extends Component {
...
@@ -19,6 +19,7 @@ export default class CreateCarfmDoc extends Component {
super
(
props
)
super
(
props
)
this
.
state
=
{
this
.
state
=
{
perusahaan
:
null
,
perusahaan
:
null
,
perusahaanData
:
null
,
getPerusahaan
:
null
,
getPerusahaan
:
null
,
errorPerusahaan
:
false
,
errorPerusahaan
:
false
,
msgErrorPerusahaan
:
''
,
msgErrorPerusahaan
:
''
,
...
@@ -45,29 +46,24 @@ export default class CreateCarfmDoc extends Component {
...
@@ -45,29 +46,24 @@ export default class CreateCarfmDoc extends Component {
fileType
:
''
,
fileType
:
''
,
docId
:
''
,
docId
:
''
,
sizeUpload
:
"1"
,
sizeUpload
:
"1"
,
menuName
:
null
,
isClickSave
:
0
saveDisable
:
false
,
submitVal
:
0
}
}
}
}
async
componentDidMount
()
{
componentDidMount
()
{
this
.
props
.
handleLoading
(
1
)
this
.
getDataCompany
()
await
this
.
getMenuName
()
this
.
getPeriode
()
await
this
.
getDataCompany
()
this
.
getMonth
()
await
this
.
getPeriode
()
this
.
getFileSize
()
await
this
.
getMonth
()
await
this
.
getFileSize
()
this
.
props
.
handleLoading
(
0
)
}
}
async
getFileSize
()
{
getFileSize
()
{
let
body
=
{
let
body
=
{
group
:
'MAX_FILE_SIZE'
,
group
:
'MAX_FILE_SIZE'
,
company_id
:
0
,
company_id
:
0
,
type
:
'MAX_FILE_SIZE'
type
:
'MAX_FILE_SIZE'
}
}
a
wait
a
pi
.
create
().
getAllSettingByType
(
body
).
then
(
response
=>
{
api
.
create
().
getAllSettingByType
(
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"
)
{
...
@@ -95,8 +91,8 @@ export default class CreateCarfmDoc extends Component {
...
@@ -95,8 +91,8 @@ export default class CreateCarfmDoc extends Component {
})
})
}
}
async
getDataCompany
()
{
getDataCompany
()
{
a
wait
a
pi
.
create
().
getPerusahaanUserActive
().
then
((
response
)
=>
{
api
.
create
().
getPerusahaanUserActive
().
then
((
response
)
=>
{
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
...
@@ -111,10 +107,10 @@ export default class CreateCarfmDoc extends Component {
...
@@ -111,10 +107,10 @@ export default class CreateCarfmDoc extends Component {
// company_name: 'Default'
// company_name: 'Default'
// })
// })
let
typeProps
=
{
let
typeProps
=
{
options
:
typeData
.
sort
((
a
,
b
)
=>
a
.
company_name
.
localeCompare
(
b
.
company_name
)
),
options
:
typeData
.
sort
((
a
,
b
)
=>
a
.
company_name
-
b
.
company_name
),
getOptionLabel
:
(
option
)
=>
option
.
company_name
,
getOptionLabel
:
(
option
)
=>
option
.
company_name
,
};
};
this
.
setState
({
perusahaan
:
typeProps
},
()
=>
console
.
log
(
this
.
state
.
perusahaan
)
)
this
.
setState
({
perusahaan
:
typeProps
}
)
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
...
@@ -131,30 +127,8 @@ export default class CreateCarfmDoc extends Component {
...
@@ -131,30 +127,8 @@ export default class CreateCarfmDoc extends Component {
})
})
}
}
async
getMenuName
(){
getPeriode
()
{
api
.
create
().
getPeriodeTransaction
().
then
(
response
=>
{
await
api
.
create
().
getMenuByUser
().
then
(
response
=>
{
if
(
response
.
data
){
if
(
response
.
data
.
status
===
'success'
){
response
.
data
.
data
.
map
(
(
item
)
=>
{
if
(
item
.
menu_id
==
this
.
props
.
submenu_id
){
this
.
setState
({
menuName
:
item
.
menu_name
}
);
}
}
)
}
}
}
)
}
async
getPeriode
()
{
await
api
.
create
().
getPeriodeTransaction
().
then
(
response
=>
{
let
dateNow
=
new
Date
let
dateNow
=
new
Date
let
year
=
format
(
dateNow
,
'yyyy'
)
let
year
=
format
(
dateNow
,
'yyyy'
)
if
(
response
.
data
)
{
if
(
response
.
data
)
{
...
@@ -185,8 +159,8 @@ export default class CreateCarfmDoc extends Component {
...
@@ -185,8 +159,8 @@ export default class CreateCarfmDoc extends Component {
})
})
}
}
async
getMonth
()
{
getMonth
()
{
a
wait
a
pi
.
create
().
getMonthTransaction
().
then
(
response
=>
{
api
.
create
().
getMonthTransaction
().
then
(
response
=>
{
let
dateNow
=
new
Date
let
dateNow
=
new
Date
// let bulan = format(dateNow, 'MMMM')
// let bulan = format(dateNow, 'MMMM')
if
(
response
.
data
)
{
if
(
response
.
data
)
{
...
@@ -261,7 +235,8 @@ export default class CreateCarfmDoc extends Component {
...
@@ -261,7 +235,8 @@ export default class CreateCarfmDoc extends Component {
}
}
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'
,
saveDisable
:
false
})
this
.
setState
({
alert
:
true
,
messageAlert
:
'File Cannot be Empty'
,
tipeAlert
:
'warning'
,
saveDisable
:
false
})
}
else
if
(
this
.
state
.
submitVal
===
1
)
{
}
else
{
console
.
log
(
this
.
state
.
isClickSave
+
" ===> di luar"
);
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"
,
this
.
state
.
getPerusahaan
.
company_id
);
...
@@ -271,7 +246,7 @@ export default class CreateCarfmDoc extends Component {
...
@@ -271,7 +246,7 @@ export default class CreateCarfmDoc extends Component {
formData
.
append
(
"documentPeriode"
,
this
.
state
.
periode
.
periode
);
formData
.
append
(
"documentPeriode"
,
this
.
state
.
periode
.
periode
);
formData
.
append
(
"documentMonth"
,
this
.
state
.
monthId
.
month_id
);
formData
.
append
(
"documentMonth"
,
this
.
state
.
monthId
.
month_id
);
this
.
setState
({
formData
},
()
=>
{
this
.
setState
({
formData
},
()
=>
{
this
.
props
.
createDocument
(
this
.
state
.
formData
,
)
this
.
props
.
createDocument
(
this
.
state
.
formData
)
})
})
}
}
}
}
...
@@ -338,13 +313,12 @@ export default class CreateCarfmDoc extends Component {
...
@@ -338,13 +313,12 @@ export default class CreateCarfmDoc extends Component {
<
/div
>
<
/div
>
<
div
className
=
"column-2"
>
<
div
className
=
"column-2"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
,
marginTop
:
"1.2em"
}}
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
,
marginTop
:
"1.2em"
}}
>
<
TextField
<
TextField
value
=
{
this
.
state
.
menuName
}
value
=
{
this
.
props
.
menuName
}
InputProps
=
{{
style
:
{
fontSize
:
11
}
}}
InputProps
=
{{
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
placeholder
=
"Category"
placeholder
=
"Category"
disabled
size
=
"medium"
size
=
"medium"
fullWidth
=
{
true
}
fullWidth
=
{
true
}
/
>
/
>
...
@@ -459,21 +433,10 @@ export default class CreateCarfmDoc extends Component {
...
@@ -459,21 +433,10 @@ export default class CreateCarfmDoc extends Component {
disabled
=
{
this
.
state
.
saveDisable
}
disabled
=
{
this
.
state
.
saveDisable
}
type
=
"button"
type
=
"button"
onClick
=
{()
=>
onClick
=
{()
=>
{
this
.
state
.
isClickSave
==
1
?
null
:
this
.
props
.
handleLoading
(
1
);
this
.
setState
({
isClickSave
:
1
},
()
=>
{
this
.
setState
({
saveDisable
:
true
,
submitVal
:
this
.
state
.
submitVal
+
1
},
console
.
log
());
setTimeout
(()
=>
{
this
.
validasi
()
this
.
validasi
()
console
.
log
(
"vlidasi "
+
this
.
validasi
());
})
},
100
)
this
.
props
.
handleLoading
(
0
);
}
}
}
>
>
<
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'
}}
>
...
...
src/container/C
RFM/Table
Document.js
→
src/container/C
AFRM/TableCafrm
Document.js
View file @
bfd45510
...
@@ -57,7 +57,6 @@ export default class TableDocument extends Component {
...
@@ -57,7 +57,6 @@ export default class TableDocument extends Component {
let
dataTable
=
[]
let
dataTable
=
[]
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
let
indexId
=
this
.
props
.
userCompActive
.
findIndex
((
val
)
=>
val
==
item
.
company_id
)
let
indexId
=
this
.
props
.
userCompActive
.
findIndex
((
val
)
=>
val
==
item
.
company_id
)
if
(
indexId
!==
-
1
)
{
if
(
indexId
!==
-
1
)
{
dataTable
.
push
(
[
dataTable
.
push
(
[
index
,
index
,
...
@@ -73,22 +72,22 @@ export default class TableDocument extends Component {
...
@@ -73,22 +72,22 @@ export default class TableDocument extends Component {
item
.
values
item
.
values
])
])
}
}
})
})
// console.log(dataTable)
this
.
setState
({
dataTable
,
loading
:
false
})
let
docPath
=
response
.
data
.
data
.
map
((
item
)
=>
{
let
docPath
=
response
.
data
.
data
.
map
((
item
)
=>
{
return
[
return
[
item
.
document_filepath
item
.
document_filepath
]
]
})
})
this
.
setState
({
docPath
,
loading
:
false
})
let
docId
=
response
.
data
.
data
.
map
((
item
)
=>
{
let
docId
=
response
.
data
.
data
.
map
((
item
)
=>
{
return
[
return
[
item
.
document_id
item
.
document_id
]
]
})
})
this
.
setState
({
docId
,
loading
:
false
})
// console.log(dataTable)
this
.
setState
({
dataTable
,
docPath
,
docId
,
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"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
...
...
src/container/DocumentManagement/DocumentManagement.js
View file @
bfd45510
...
@@ -22,6 +22,7 @@ export default class DocumentManagement extends Component {
...
@@ -22,6 +22,7 @@ export default class DocumentManagement extends Component {
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
state
=
{
this
.
state
=
{
alert
:
false
,
tab
:
0
,
tab
:
0
,
listData
:
[],
listData
:
[],
id
:
0
,
id
:
0
,
...
...
src/router/homeRoutes.js
View file @
bfd45510
...
@@ -20,7 +20,7 @@ import SubHolding from '../container/Reports/SubHolding';
...
@@ -20,7 +20,7 @@ import SubHolding from '../container/Reports/SubHolding';
import
SummaryTriputra
from
'../container/SummaryTriputra/SummaryOfTriputra'
;
import
SummaryTriputra
from
'../container/SummaryTriputra/SummaryOfTriputra'
;
import
MasterDataCAT
from
'../container/MasterData/MasterDataCAT/MasterDataCAT'
;
import
MasterDataCAT
from
'../container/MasterData/MasterDataCAT/MasterDataCAT'
;
import
ProgressReport
from
'../container/ProgressReport/ProgressReport'
;
import
ProgressReport
from
'../container/ProgressReport/ProgressReport'
;
import
CarfmDocument
from
"../container/C
RFM/Carf
mDocument"
;
import
CarfmDocument
from
"../container/C
AFRM/Cafr
mDocument"
;
const
routes
=
[
const
routes
=
[
{
{
...
...
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