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
65a675de
Commit
65a675de
authored
Aug 13, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'deni-dev(pc)' into 'master'
1 See merge request
!68
parents
436844fb
0c16c603
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
11 deletions
+35
-11
index.js
src/api/index.js
+3
-1
UnitBisnis.js
src/container/MasterData/UnitBisnis.js
+30
-8
CreateUnitBisnis.js
src/container/MasterData/formUnitBisnis/CreateUnitBisnis.js
+2
-2
No files found.
src/api/index.js
View file @
65a675de
...
...
@@ -83,6 +83,7 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
const
createUnitBisnis
=
(
body
)
=>
api
.
post
(
'/business_unit/create_business_unit'
,
body
)
const
updateUnitBisnis
=
(
body
)
=>
api
.
post
(
'/business_unit/update_business_unit'
,
body
)
const
searchUnitBisnis
=
(
body
)
=>
api
.
post
(
'/business_unit/search_business_unit'
,
body
)
const
checkUploadUnitBisnis
=
(
body
)
=>
api
.
post
(
'/business_unit/check_import'
,
body
)
// Perusahaan
const
getPerusahaan
=
()
=>
api
.
get
(
'company/get_all_company'
)
...
...
@@ -148,7 +149,8 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
createUser
,
updateUser
,
deleteUser
,
downloadTemplate
downloadTemplate
,
checkUploadUnitBisnis
}
}
...
...
src/container/MasterData/UnitBisnis.js
View file @
65a675de
...
...
@@ -37,18 +37,40 @@ export default class UnitBisnis extends Component {
fileHandler
=
(
event
)
=>
{
let
fileObj
=
event
ExcelRenderer
(
fileObj
,
(
err
,
resp
)
=>
{
console
.
log
(
resp
)
if
(
err
)
{
console
.
log
(
err
);
}
else
{
let
judul
=
resp
.
rows
[
0
]
let
isi
=
resp
.
rows
.
slice
(
1
)
// let body = isi.map((item) => {
// return {
// item
// ]
// })
console
.
log
(
JSON
.
stringify
(
isi
));
let
judul
=
resp
.
rows
[
2
]
let
isi
=
resp
.
rows
.
slice
(
3
)
let
payload
=
[]
isi
.
map
((
item
,
index
)
=>
{
payload
.
push
({
id
:
index
+
1
,
business_unit_name
:
item
[
0
],
start_date
:
item
[
1
],
end_date
:
item
[
2
],
})
})
let
body
=
{
business_unit
:
payload
}
api
.
create
().
checkUploadUnitBisnis
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
let
dataRow
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
return
[
index
+
1
,
item
.
business_unit_name
,
item
.
start_date
,
item
.
end_date
,
item
.
error
]
})
})
// console.log(JSON.stringify(payload));
this
.
setState
({
dataLoaded
:
true
,
cols
:
judul
,
...
...
src/container/MasterData/formUnitBisnis/CreateUnitBisnis.js
View file @
65a675de
...
...
@@ -204,7 +204,7 @@ export default class CreateUnitBisnis extends Component {
<
DatePicker
margin
=
"normal"
id
=
"startDate"
label
=
"Ber
laku
Hingga"
label
=
"Ber
akhir
Hingga"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
endDate
}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
'end_date'
)}
...
...
@@ -381,7 +381,7 @@ export default class CreateUnitBisnis extends Component {
<
DatePicker
margin
=
"normal"
id
=
"endDate"
label
=
"Ber
laku
Hingga"
label
=
"Ber
akhir
Hingga"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
endDate
==
""
?
null
:
this
.
state
.
endDate
}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
'end_date'
)}
...
...
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