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
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
131 deletions
+40
-131
Dialog.js
src/app/views/Reconciliation/Sheet/Dialog/Dialog.js
+4
-1
Index.js
src/app/views/Reconciliation/Sheet/Dialog/Index.js
+19
-79
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) => ({
...
@@ -55,7 +55,7 @@ const DialogActions = withStyles((theme) => ({
}))(
MuiDialogActions
)
}))(
MuiDialogActions
)
const
CustomizedDialogs
=
(
props
)
=>
{
const
CustomizedDialogs
=
(
props
)
=>
{
const
{
onSelectCustomer
,
cusomterSelect
}
=
props
const
{
onSelectCustomer
,
cusomterSelect
,
idPaymentPartner
}
=
props
const
[
open
,
setOpen
]
=
useState
(
false
)
const
[
open
,
setOpen
]
=
useState
(
false
)
const
handleClickOpen
=
()
=>
{
const
handleClickOpen
=
()
=>
{
...
@@ -70,6 +70,7 @@ const CustomizedDialogs = (props) => {
...
@@ -70,6 +70,7 @@ const CustomizedDialogs = (props) => {
onSelectCustomer
(
item
)
onSelectCustomer
(
item
)
setOpen
(
false
)
setOpen
(
false
)
}
}
console
.
log
(
'idPaymentPartner dialog'
,
idPaymentPartner
)
return
(
return
(
<
div
style
=
{{
marginRight
:
10
}}
>
<
div
style
=
{{
marginRight
:
10
}}
>
...
@@ -102,6 +103,8 @@ const CustomizedDialogs = (props) => {
...
@@ -102,6 +103,8 @@ const CustomizedDialogs = (props) => {
<
CustomerList
<
CustomerList
customSelect
=
{
customSelect
}
customSelect
=
{
customSelect
}
handleClose
=
{
handleClose
}
handleClose
=
{
handleClose
}
idPaymentPartner
=
{
idPaymentPartner
}
open
=
{
open
}
/
>
/
>
<
/DialogContent
>
<
/DialogContent
>
<
/Dialog
>
<
/Dialog
>
...
...
src/app/views/Reconciliation/Sheet/Dialog/Index.js
View file @
8ab6c443
...
@@ -11,7 +11,7 @@ import { useTranslation } from 'react-i18next'
...
@@ -11,7 +11,7 @@ import { useTranslation } from 'react-i18next'
import
{
dropdownMerchant
,
dropdownStore
}
from
'app/apis/Functions/dropdown'
import
{
dropdownMerchant
,
dropdownStore
}
from
'app/apis/Functions/dropdown'
const
ToolNotificate
=
(
props
)
=>
{
const
ToolNotificate
=
(
props
)
=>
{
const
{
customSelect
,
handleClose
}
=
props
const
{
customSelect
,
handleClose
,
idPaymentPartner
}
=
props
const
[
listSelected
,
setListSelected
]
=
useState
([])
const
[
listSelected
,
setListSelected
]
=
useState
([])
const
[
txtSearch
,
setTxtSearch
]
=
useState
(
''
)
const
[
txtSearch
,
setTxtSearch
]
=
useState
(
''
)
const
[
applications
,
setApplications
]
=
useState
(
''
)
const
[
applications
,
setApplications
]
=
useState
(
''
)
...
@@ -26,51 +26,32 @@ const ToolNotificate = (props) => {
...
@@ -26,51 +26,32 @@ const ToolNotificate = (props) => {
const
[
data
,
setData
]
=
useState
([])
const
[
data
,
setData
]
=
useState
([])
const
[
type
,
setType
]
=
useState
()
const
[
type
,
setType
]
=
useState
()
const
[
listType
,
setListType
]
=
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
)
=>
{
const
changeDateRange
=
(
start
,
end
)
=>
{
setStartDate
(
start
)
setStartDate
(
start
)
setEndDate
(
end
)
setEndDate
(
end
)
}
}
console
.
log
(
'idPaymentPartner index'
,
idPaymentPartner
)
const
getData
=
async
(
init
)
=>
{
const
getData
=
async
(
init
)
=>
{
if
(
props
?.
idPaymentPartner
)
{
console
.
log
(
'props?.idPaymentPartner'
,
props
?.
idPaymentPartner
)
props
.
showLoading
()
props
.
showLoading
()
let
res
if
(
init
)
{
const
res
=
await
listTransReconciliation
({
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
,
date_from
:
startDate
?
convertDate
(
startDate
)
:
null
,
date_from
:
startDate
?
convertDate
(
startDate
)
:
null
,
date_to
:
endDate
?
convertDate
(
endDate
)
:
null
,
date_to
:
endDate
?
convertDate
(
endDate
)
:
null
,
product_code
:
null
,
statusReconciliation
:
1
,
payment_gate_code
:
null
,
payment_gate_code
:
props
?.
idPaymentPartner
,
statusReconciliation
:
0
,
order_code
:
searchDebount
,
type_payment
:
null
,
type_payment
:
type
||
type
,
})
})
}
console
.
log
(
'res.data'
,
res
.
data
)
props
.
hideLoading
()
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
console
.
log
(
' res.data.data
'
,
res
.
data
.
data
)
console
.
log
(
'idPaymentPartner
'
,
res
.
data
.
data
)
const
newList
=
res
.
data
.
data
?.
data
?.
map
((
e
,
i
)
=>
{
const
newList
=
res
.
data
.
data
?.
data
?.
map
((
e
,
i
)
=>
{
return
{
...
e
,
index
:
i
+
1
+
pageIndex
*
pageSize
}
return
{
...
e
,
index
:
i
+
1
+
pageIndex
*
pageSize
}
})
})
...
@@ -86,52 +67,17 @@ const ToolNotificate = (props) => {
...
@@ -86,52 +67,17 @@ const ToolNotificate = (props) => {
})
})
}
}
}
}
}
useEffect
(()
=>
{
useEffect
(()
=>
{
getData
(
false
)
console
.
log
(
'props?.open'
,
props
?.
open
)
},
[
pageIndex
]
)
console
.
log
(
'props?.open'
,
props
?.
idPaymentPartner
)
if
(
props
?.
open
)
{
useEffect
(()
=>
{
console
.
log
(
'run'
)
getData
(
true
)
getData
(
true
)
},
[
searchDebount
,
startDate
,
type
,
merchant
,
store
])
useEffect
(()
=>
{
if
(
merchant
)
{
getDropdownStore
(
merchant
)
}
}
setStore
()
},
[
searchDebount
,
startDate
,
type
,
props
])
},
[
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'
,
})
}
}
const
getDropdownStore
=
async
(
id
)
=>
{
const
res
=
await
dropdownStore
(
id
)
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
=
()
=>
{
const
onAdd
=
()
=>
{
console
.
log
(
'listSelected'
,
listSelected
)
console
.
log
(
'listSelected'
,
listSelected
)
}
}
...
@@ -150,12 +96,6 @@ const ToolNotificate = (props) => {
...
@@ -150,12 +96,6 @@ const ToolNotificate = (props) => {
type
=
{
type
}
type
=
{
type
}
setType
=
{
setType
}
setType
=
{
setType
}
listType
=
{
listType
}
listType
=
{
listType
}
merchant
=
{
merchant
}
setMerchant
=
{
setMerchant
}
listMerchant
=
{
listMerchant
}
store
=
{
store
}
setStore
=
{
setStore
}
listStore
=
{
listStore
}
customSelect
=
{
customSelect
}
customSelect
=
{
customSelect
}
handleClose
=
{
handleClose
}
handleClose
=
{
handleClose
}
listSelected
=
{
listSelected
}
listSelected
=
{
listSelected
}
...
...
src/app/views/Reconciliation/Sheet/Dialog/View.js
View file @
8ab6c443
...
@@ -69,7 +69,7 @@ function CustomerView(props) {
...
@@ -69,7 +69,7 @@ function CustomerView(props) {
<
TextField
<
TextField
variant
=
"outlined"
variant
=
"outlined"
className
=
"w-full"
className
=
"w-full"
label
=
"
Tìm kiếm
"
label
=
"
Nhập mã giao dịch
"
onChange
=
{(
e
)
=>
{
onChange
=
{(
e
)
=>
{
const
text
=
e
.
target
.
value
const
text
=
e
.
target
.
value
setTxtSearch
(
text
)
setTxtSearch
(
text
)
...
@@ -113,52 +113,7 @@ function CustomerView(props) {
...
@@ -113,52 +113,7 @@ function CustomerView(props) {
<
/Select
>
<
/Select
>
<
/FormControl
>
<
/FormControl
>
<
/Grid
>
<
/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
}
>
<
Grid
item
lg
=
{
2
}
md
=
{
2
}
sm
=
{
3
}
xs
=
{
3
}
>
<
DateRange
<
DateRange
date
=
{
startDate
}
date
=
{
startDate
}
...
...
src/app/views/Reconciliation/Sheet/ListTrans/Index.js
View file @
8ab6c443
...
@@ -38,6 +38,8 @@ const ToolNotificate = (props) => {
...
@@ -38,6 +38,8 @@ const ToolNotificate = (props) => {
setEndDate
(
end
)
setEndDate
(
end
)
}
}
console
.
log
(
'props?.idReconciliation'
,
props
?.
idReconciliation
)
const
getData
=
async
(
init
)
=>
{
const
getData
=
async
(
init
)
=>
{
if
(
props
?.
idReconciliation
)
{
if
(
props
?.
idReconciliation
)
{
props
.
showLoading
()
props
.
showLoading
()
...
@@ -158,6 +160,7 @@ const ToolNotificate = (props) => {
...
@@ -158,6 +160,7 @@ const ToolNotificate = (props) => {
setStore
=
{
setStore
}
setStore
=
{
setStore
}
listStore
=
{
listStore
}
listStore
=
{
listStore
}
isDetail
=
{
props
.
isDetail
}
isDetail
=
{
props
.
isDetail
}
idPaymentPartner
=
{
props
?.
idPaymentPartner
}
/
>
/
>
)
)
}
}
...
...
src/app/views/Reconciliation/Sheet/ListTrans/View.js
View file @
8ab6c443
...
@@ -45,6 +45,7 @@ function CustomerView(props) {
...
@@ -45,6 +45,7 @@ function CustomerView(props) {
setStore
,
setStore
,
listStore
,
listStore
,
isDetail
,
isDetail
,
idPaymentPartner
,
}
=
props
}
=
props
const
handleChange
=
(
event
)
=>
{
const
handleChange
=
(
event
)
=>
{
...
@@ -93,7 +94,7 @@ function CustomerView(props) {
...
@@ -93,7 +94,7 @@ function CustomerView(props) {
Chọn giao dịch
Chọn giao dịch
</Button> */
}
</Button> */
}
<
DialogTrans
/>
<
DialogTrans
idPaymentPartner
=
{
idPaymentPartner
}
/
>
<
/Grid
>
<
/Grid
>
)
:
null
}
)
:
null
}
...
...
src/app/views/Reconciliation/Sheet/Table.js
View file @
8ab6c443
...
@@ -203,7 +203,7 @@ function TableList(props) {
...
@@ -203,7 +203,7 @@ function TableList(props) {
history
.
push
({
history
.
push
({
pathname
:
pathname
:
'/reconciliation/sheet/update'
,
'/reconciliation/sheet/update'
,
state
:
row
.
id
,
state
:
{
...
row
}
,
})
})
}}
}}
className
=
{
classes
.
button
}
className
=
{
classes
.
button
}
...
...
src/app/views/Reconciliation/Sheet/Update.js
View file @
8ab6c443
...
@@ -57,7 +57,7 @@ const SimpleForm = (props) => {
...
@@ -57,7 +57,7 @@ const SimpleForm = (props) => {
const
getDataDefault
=
async
()
=>
{
const
getDataDefault
=
async
()
=>
{
props
.
showLoading
()
props
.
showLoading
()
try
{
try
{
const
res
=
await
detailSheetReconciliation
(
location
.
state
,
{})
const
res
=
await
detailSheetReconciliation
(
location
.
state
?.
id
,
{})
if
(
res
.
data
.
data
)
{
if
(
res
.
data
.
data
)
{
setState
({
...
res
.
data
.
data
})
setState
({
...
res
.
data
.
data
})
}
}
...
@@ -102,6 +102,10 @@ const SimpleForm = (props) => {
...
@@ -102,6 +102,10 @@ const SimpleForm = (props) => {
}
}
console
.
log
(
'state'
,
state
)
console
.
log
(
'state'
,
state
)
const
{
code
,
idPaymentPartner
,
note
}
=
state
const
{
code
,
idPaymentPartner
,
note
}
=
state
console
.
log
(
'location.state?.idPaymentPartner'
,
location
.
state
?.
idPaymentPartner
)
return
(
return
(
<
div
className
=
"m-sm-30"
>
<
div
className
=
"m-sm-30"
>
<
div
className
=
"mb-sm-30"
>
<
div
className
=
"mb-sm-30"
>
...
@@ -211,7 +215,10 @@ const SimpleForm = (props) => {
...
@@ -211,7 +215,10 @@ const SimpleForm = (props) => {
>
>
<
ListTrans
<
ListTrans
isDetail
=
{
false
}
isDetail
=
{
false
}
idReconciliation
=
{
location
.
state
}
idReconciliation
=
{
location
.
state
?.
id
}
idPaymentPartner
=
{
location
.
state
?.
idPaymentPartner
}
/
>
/
>
<
/Grid
>
<
/Grid
>
<
/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