Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CmsPetrolPay
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
11
Issues
11
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
Giang Tran
CmsPetrolPay
Commits
8ab6c443
Commit
8ab6c443
authored
Sep 14, 2024
by
tdgiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update code
parent
8e228715
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
148 deletions
+57
-148
Dialog.js
src/app/views/Reconciliation/Sheet/Dialog/Dialog.js
+4
-1
Index.js
src/app/views/Reconciliation/Sheet/Dialog/Index.js
+36
-96
View.js
src/app/views/Reconciliation/Sheet/Dialog/View.js
+2
-47
Index.js
src/app/views/Reconciliation/Sheet/ListTrans/Index.js
+3
-0
View.js
src/app/views/Reconciliation/Sheet/ListTrans/View.js
+2
-1
Table.js
src/app/views/Reconciliation/Sheet/Table.js
+1
-1
Update.js
src/app/views/Reconciliation/Sheet/Update.js
+9
-2
No files found.
src/app/views/Reconciliation/Sheet/Dialog/Dialog.js
View file @
8ab6c443
...
...
@@ -55,7 +55,7 @@ const DialogActions = withStyles((theme) => ({
}))(
MuiDialogActions
)
const
CustomizedDialogs
=
(
props
)
=>
{
const
{
onSelectCustomer
,
cusomterSelect
}
=
props
const
{
onSelectCustomer
,
cusomterSelect
,
idPaymentPartner
}
=
props
const
[
open
,
setOpen
]
=
useState
(
false
)
const
handleClickOpen
=
()
=>
{
...
...
@@ -70,6 +70,7 @@ const CustomizedDialogs = (props) => {
onSelectCustomer
(
item
)
setOpen
(
false
)
}
console
.
log
(
'idPaymentPartner dialog'
,
idPaymentPartner
)
return
(
<
div
style
=
{{
marginRight
:
10
}}
>
...
...
@@ -102,6 +103,8 @@ const CustomizedDialogs = (props) => {
<
CustomerList
customSelect
=
{
customSelect
}
handleClose
=
{
handleClose
}
idPaymentPartner
=
{
idPaymentPartner
}
open
=
{
open
}
/
>
<
/DialogContent
>
<
/Dialog
>
...
...
src/app/views/Reconciliation/Sheet/Dialog/Index.js
View file @
8ab6c443
...
...
@@ -11,7 +11,7 @@ import { useTranslation } from 'react-i18next'
import
{
dropdownMerchant
,
dropdownStore
}
from
'app/apis/Functions/dropdown'
const
ToolNotificate
=
(
props
)
=>
{
const
{
customSelect
,
handleClose
}
=
props
const
{
customSelect
,
handleClose
,
idPaymentPartner
}
=
props
const
[
listSelected
,
setListSelected
]
=
useState
([])
const
[
txtSearch
,
setTxtSearch
]
=
useState
(
''
)
const
[
applications
,
setApplications
]
=
useState
(
''
)
...
...
@@ -26,112 +26,58 @@ const ToolNotificate = (props) => {
const
[
data
,
setData
]
=
useState
([])
const
[
type
,
setType
]
=
useState
()
const
[
listType
,
setListType
]
=
useState
([])
const
[
merchant
,
setMerchant
]
=
useState
()
const
[
listMerchant
,
setListMerchant
]
=
useState
([])
const
[
store
,
setStore
]
=
useState
()
const
[
listStore
,
setListStore
]
=
useState
([])
useEffect
(()
=>
{
getDataMerchant
()
},
[])
const
changeDateRange
=
(
start
,
end
)
=>
{
setStartDate
(
start
)
setEndDate
(
end
)
}
console
.
log
(
'idPaymentPartner index'
,
idPaymentPartner
)
const
getData
=
async
(
init
)
=>
{
props
.
showLoading
()
let
res
if
(
init
)
{
setPageIndex
(
0
)
res
=
await
listTransReconciliation
({
page_no
:
0
,
page_size
:
pageSize
,
date_from
:
startDate
?
convertDate
(
startDate
)
:
null
,
date_to
:
endDate
?
convertDate
(
endDate
)
:
null
,
product_code
:
null
,
payment_gate_code
:
null
,
statusReconciliation
:
0
,
type_payment
:
null
,
})
}
else
{
res
=
await
listTransReconciliation
({
page_no
:
pageIndex
+
1
,
page_size
:
pageSize
,
if
(
props
?.
idPaymentPartner
)
{
console
.
log
(
'props?.idPaymentPartner'
,
props
?.
idPaymentPartner
)
props
.
showLoading
()
const
res
=
await
listTransReconciliation
({
date_from
:
startDate
?
convertDate
(
startDate
)
:
null
,
date_to
:
endDate
?
convertDate
(
endDate
)
:
null
,
product_code
:
null
,
payment_gate_code
:
null
,
statusReconciliation
:
0
,
type_payment
:
null
,
statusReconciliation
:
1
,
payment_gate_code
:
props
?.
idPaymentPartner
,
order_code
:
searchDebount
,
type_payment
:
type
||
type
,
})
}
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
console
.
log
(
' res.data.data'
,
res
.
data
.
data
)
const
newList
=
res
.
data
.
data
?.
data
?.
map
((
e
,
i
)
=>
{
return
{
...
e
,
index
:
i
+
1
+
pageIndex
*
pageSize
}
})
setData
(
newList
)
setTotalRecord
(
res
.
data
.
data
.
total_elements
)
}
else
if
(
res
.
data
.
code
==
401
)
{
setTimeout
(()
=>
{
history
.
push
(
'/'
)
},
100
)
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
})
console
.
log
(
'res.data'
,
res
.
data
)
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
console
.
log
(
'idPaymentPartner'
,
res
.
data
.
data
)
const
newList
=
res
.
data
.
data
?.
data
?.
map
((
e
,
i
)
=>
{
return
{
...
e
,
index
:
i
+
1
+
pageIndex
*
pageSize
}
})
setData
(
newList
)
setTotalRecord
(
res
.
data
.
data
.
total_elements
)
}
else
if
(
res
.
data
.
code
==
401
)
{
setTimeout
(()
=>
{
history
.
push
(
'/'
)
},
100
)
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
})
}
}
}
useEffect
(()
=>
{
getData
(
false
)
},
[
pageIndex
])
useEffect
(()
=>
{
getData
(
true
)
},
[
searchDebount
,
startDate
,
type
,
merchant
,
store
])
useEffect
(()
=>
{
if
(
merchant
)
{
getDropdownStore
(
merchant
)
}
setStore
()
},
[
merchant
])
const
getDataMerchant
=
async
()
=>
{
const
res
=
await
dropdownMerchant
({})
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
const
newList
=
res
.
data
.
data
.
map
((
e
)
=>
{
return
{
...
e
,
name
:
e
.
merchant_name
}
})
setListMerchant
(
newList
)
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
})
console
.
log
(
'props?.open'
,
props
?.
open
)
console
.
log
(
'props?.open'
,
props
?.
idPaymentPartner
)
if
(
props
?.
open
)
{
console
.
log
(
'run'
)
getData
(
true
)
}
}
const
getDropdownStore
=
async
(
id
)
=>
{
const
res
=
await
dropdownStore
(
id
)
},
[
searchDebount
,
startDate
,
type
,
props
])
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
console
.
log
(
'res.data.data'
,
res
.
data
.
data
)
const
newList
=
res
.
data
.
data
.
map
((
e
)
=>
{
return
{
...
e
,
name
:
e
.
store_name
}
})
setListStore
(
newList
)
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
})
}
}
const
onAdd
=
()
=>
{
console
.
log
(
'listSelected'
,
listSelected
)
}
...
...
@@ -150,12 +96,6 @@ const ToolNotificate = (props) => {
type
=
{
type
}
setType
=
{
setType
}
listType
=
{
listType
}
merchant
=
{
merchant
}
setMerchant
=
{
setMerchant
}
listMerchant
=
{
listMerchant
}
store
=
{
store
}
setStore
=
{
setStore
}
listStore
=
{
listStore
}
customSelect
=
{
customSelect
}
handleClose
=
{
handleClose
}
listSelected
=
{
listSelected
}
...
...
src/app/views/Reconciliation/Sheet/Dialog/View.js
View file @
8ab6c443
...
...
@@ -69,7 +69,7 @@ function CustomerView(props) {
<
TextField
variant
=
"outlined"
className
=
"w-full"
label
=
"
Tìm kiếm
"
label
=
"
Nhập mã giao dịch
"
onChange
=
{(
e
)
=>
{
const
text
=
e
.
target
.
value
setTxtSearch
(
text
)
...
...
@@ -113,52 +113,7 @@ function CustomerView(props) {
<
/Select
>
<
/FormControl
>
<
/Grid
>
<
Grid
item
lg
=
{
2
}
md
=
{
2
}
sm
=
{
3
}
xs
=
{
3
}
>
<
FormControl
variant
=
"outlined"
fullWidth
>
<
InputLabel
htmlFor
=
"outlined-age-native-simple"
>
Ph
á
p
nh
â
n
<
/InputLabel
>
<
Select
label
=
"Pháp nhân"
value
=
{
merchant
}
onChange
=
{(
e
)
=>
setMerchant
(
e
.
target
.
value
)}
inputProps
=
{{
name
:
'age'
,
id
:
'outlined-age-native-simple'
,
}}
>
<
MenuItem
value
=
""
>
<
em
>
T
ấ
t
c
ả
<
/em
>
<
/MenuItem
>
{
listMerchant
.
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
))}
<
/Select
>
<
/FormControl
>
<
/Grid
>
<
Grid
item
lg
=
{
2
}
md
=
{
2
}
sm
=
{
3
}
xs
=
{
3
}
>
<
FormControl
variant
=
"outlined"
fullWidth
>
<
InputLabel
htmlFor
=
"outlined-age-native-simple"
>
C
â
y
x
ă
ng
<
/InputLabel
>
<
Select
label
=
"Cây xăng"
value
=
{
store
}
onChange
=
{(
e
)
=>
setStore
(
e
.
target
.
value
)}
inputProps
=
{{
name
:
'age'
,
id
:
'outlined-age-native-simple'
,
}}
>
<
MenuItem
value
=
""
>
<
em
>
T
ấ
t
c
ả
<
/em
>
<
/MenuItem
>
{
listStore
.
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
))}
<
/Select
>
<
/FormControl
>
<
/Grid
>
<
Grid
item
lg
=
{
2
}
md
=
{
2
}
sm
=
{
3
}
xs
=
{
3
}
>
<
DateRange
date
=
{
startDate
}
...
...
src/app/views/Reconciliation/Sheet/ListTrans/Index.js
View file @
8ab6c443
...
...
@@ -38,6 +38,8 @@ const ToolNotificate = (props) => {
setEndDate
(
end
)
}
console
.
log
(
'props?.idReconciliation'
,
props
?.
idReconciliation
)
const
getData
=
async
(
init
)
=>
{
if
(
props
?.
idReconciliation
)
{
props
.
showLoading
()
...
...
@@ -158,6 +160,7 @@ const ToolNotificate = (props) => {
setStore
=
{
setStore
}
listStore
=
{
listStore
}
isDetail
=
{
props
.
isDetail
}
idPaymentPartner
=
{
props
?.
idPaymentPartner
}
/
>
)
}
...
...
src/app/views/Reconciliation/Sheet/ListTrans/View.js
View file @
8ab6c443
...
...
@@ -45,6 +45,7 @@ function CustomerView(props) {
setStore
,
listStore
,
isDetail
,
idPaymentPartner
,
}
=
props
const
handleChange
=
(
event
)
=>
{
...
...
@@ -93,7 +94,7 @@ function CustomerView(props) {
Chọn giao dịch
</Button> */
}
<
DialogTrans
/>
<
DialogTrans
idPaymentPartner
=
{
idPaymentPartner
}
/
>
<
/Grid
>
)
:
null
}
...
...
src/app/views/Reconciliation/Sheet/Table.js
View file @
8ab6c443
...
...
@@ -203,7 +203,7 @@ function TableList(props) {
history
.
push
({
pathname
:
'/reconciliation/sheet/update'
,
state
:
row
.
id
,
state
:
{
...
row
}
,
})
}}
className
=
{
classes
.
button
}
...
...
src/app/views/Reconciliation/Sheet/Update.js
View file @
8ab6c443
...
...
@@ -57,7 +57,7 @@ const SimpleForm = (props) => {
const
getDataDefault
=
async
()
=>
{
props
.
showLoading
()
try
{
const
res
=
await
detailSheetReconciliation
(
location
.
state
,
{})
const
res
=
await
detailSheetReconciliation
(
location
.
state
?.
id
,
{})
if
(
res
.
data
.
data
)
{
setState
({
...
res
.
data
.
data
})
}
...
...
@@ -102,6 +102,10 @@ const SimpleForm = (props) => {
}
console
.
log
(
'state'
,
state
)
const
{
code
,
idPaymentPartner
,
note
}
=
state
console
.
log
(
'location.state?.idPaymentPartner'
,
location
.
state
?.
idPaymentPartner
)
return
(
<
div
className
=
"m-sm-30"
>
<
div
className
=
"mb-sm-30"
>
...
...
@@ -211,7 +215,10 @@ const SimpleForm = (props) => {
>
<
ListTrans
isDetail
=
{
false
}
idReconciliation
=
{
location
.
state
}
idReconciliation
=
{
location
.
state
?.
id
}
idPaymentPartner
=
{
location
.
state
?.
idPaymentPartner
}
/
>
<
/Grid
>
<
/Grid
>
...
...
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