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
456900c2
Commit
456900c2
authored
Jan 30, 2024
by
tdgiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update code
parent
095772d3
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
285 additions
and
50 deletions
+285
-50
translation.json
src/app/assets/languages/locates/vi/translation.json
+2
-0
Index.js
src/app/views/Fee/Index.js
+5
-2
View.js
src/app/views/Fee/View.js
+37
-0
Create.js
src/app/views/GasStation/Create.js
+3
-4
Update.js
src/app/views/GasStation/Update.js
+1
-1
Index.js
src/app/views/Merchant/Index.js
+6
-3
Update.js
src/app/views/Merchant/Update.js
+1
-1
View.js
src/app/views/Merchant/View.js
+58
-12
Index.js
src/app/views/Transaction/Index.js
+64
-1
View.js
src/app/views/Transaction/View.js
+108
-26
No files found.
src/app/assets/languages/locates/vi/translation.json
View file @
456900c2
...
...
@@ -330,6 +330,8 @@
"ERROR_OCTA_TRANS_FAIL"
:
"Nạp tiền không thành công, vui lòng kiểm tra lại thông tin"
,
"EnterPhoneNumber"
:
"Nhập số điện thoại"
,
"ERROR_EMAIL_EXIST"
:
"Email đã tồn tại"
,
"ERROR_PHONE_EXIST"
:
"Số điện thoại đã tồn tại"
,
"ERROR_STATUS_NOT_APPROVED"
:
"Yêu cầu chưa được phê duyệt"
,
"ERROR_USER_NOT_ACTIVE"
:
"Tài khoản của bạn đã bị khoá. Liên hệ với đại lý tổng để được mở khoá"
...
...
src/app/views/Fee/Index.js
View file @
456900c2
...
...
@@ -24,6 +24,7 @@ const ToolNotificate = (props) => {
const
[
listModule
,
setListModule
]
=
useState
([])
const
[
listMerchant
,
setListMerchant
]
=
useState
([])
const
[
merchant
,
setMerchant
]
=
useState
()
const
[
status
,
setStatus
]
=
useState
()
const
[
module
,
setModule
]
=
useState
(
null
)
...
...
@@ -80,7 +81,7 @@ const ToolNotificate = (props) => {
to_date
:
endDate
?
convertDate
(
endDate
)
:
null
,
store_id
:
module
,
merchant_id
:
merchant
,
status
:
null
,
status
:
status
,
})
props
.
hideLoading
()
console
.
log
(
'res.data.data'
,
res
.
data
.
data
)
...
...
@@ -105,7 +106,7 @@ const ToolNotificate = (props) => {
useEffect
(()
=>
{
getData
()
},
[
searchDebount
,
pageIndex
,
startDate
,
module
,
merchant
])
},
[
searchDebount
,
pageIndex
,
startDate
,
module
,
merchant
,
status
])
return
(
<
LogAuth
...
...
@@ -125,6 +126,8 @@ const ToolNotificate = (props) => {
listMerchant
=
{
listMerchant
}
merchant
=
{
merchant
}
setMerchant
=
{
setMerchant
}
status
=
{
status
}
setStatus
=
{
setStatus
}
/
>
)
}
...
...
src/app/views/Fee/View.js
View file @
456900c2
...
...
@@ -41,6 +41,8 @@ function CustomerView(props) {
listMerchant
,
merchant
,
setMerchant
,
status
,
setStatus
,
}
=
props
const
handleChange
=
(
event
)
=>
{
...
...
@@ -99,6 +101,41 @@ function CustomerView(props) {
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
sm
=
{
3
}
xs
=
{
3
}
>
<
FormControl
variant
=
"outlined"
fullWidth
>
<
InputLabel
htmlFor
=
"outlined-age-native-simple"
>
Tr
ạ
ng
th
á
i
<
/InputLabel
>
<
Select
label
=
"Trạng thái"
value
=
{
status
}
onChange
=
{(
e
)
=>
setStatus
(
e
.
target
.
value
)}
inputProps
=
{{
name
:
'age'
,
id
:
'outlined-age-native-simple'
,
}}
>
<
MenuItem
value
=
""
>
<
em
>
T
ấ
t
c
ả
<
/em
>
<
/MenuItem
>
{[
{
id
:
1
,
name
:
'Chờ thanh toán'
,
},
{
id
:
2
,
name
:
'Đã thanh toán'
,
},
].
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
))}
<
/Select
>
<
/FormControl
>
<
/Grid
>
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
sm
=
{
3
}
xs
=
{
3
}
>
<
FormControl
variant
=
"outlined"
fullWidth
>
<
InputLabel
htmlFor
=
"outlined-age-native-simple"
>
Ph
á
p
nh
â
n
<
/InputLabel
>
<
Select
...
...
src/app/views/GasStation/Create.js
View file @
456900c2
...
...
@@ -162,7 +162,7 @@ const SimpleForm = (props) => {
].
concat
(
e
.
gas_olines
),
}
}
else
{
toast
.
warning
(
'
Tên
vòi xăng đã tồn tại'
,
{
toast
.
warning
(
'
Mã
vòi xăng đã tồn tại'
,
{
theme
:
'colored'
,
})
return
{
...
...
@@ -383,11 +383,10 @@ const SimpleForm = (props) => {
>
<
div
>
<
Typography
variant
=
"subtitle1"
>
S
ố
l
ượ
ng
v
ò
i
m
ỗ
i
tr
ụ
:{
' '
}
{
listField
.
length
}
S
ố
l
ượ
ng
tr
ụ
:
{
listField
.
length
}
<
/Typography
>
<
Typography
variant
=
"subtitle1"
>
S
ố
l
ượ
ng
tr
ụ
:
{
countFountain
()}
S
ố
l
ượ
ng
v
ò
i
:
{
countFountain
()}
<
/Typography
>
<
/div
>
<
Button
...
...
src/app/views/GasStation/Update.js
View file @
456900c2
...
...
@@ -202,7 +202,7 @@ const SimpleForm = (props) => {
].
concat
(
e
.
gas_olines
),
}
}
else
{
toast
.
warning
(
'
Tên
vòi xăng đã tồn tại'
,
{
toast
.
warning
(
'
Mã
vòi xăng đã tồn tại'
,
{
theme
:
'colored'
,
})
return
{
...
...
src/app/views/Merchant/Index.js
View file @
456900c2
...
...
@@ -18,7 +18,7 @@ const ToolNotificate = (props) => {
const
[
activeSelected
,
setActiveSeleted
]
=
useState
(
null
)
const
[
changeActive
,
setChangeActive
]
=
useState
(
1
)
const
[
status
,
setStatus
]
=
useState
()
const
[
pageIndex
,
setPageIndex
]
=
useState
(
0
)
const
[
pageSize
]
=
useState
(
10
)
const
[
totalRecords
,
setTotalRecord
]
=
useState
(
0
)
...
...
@@ -50,6 +50,7 @@ const ToolNotificate = (props) => {
text_search
:
searchDebount
,
page_no
:
pageIndex
+
1
,
page_size
:
pageSize
,
status
,
})
props
.
hideLoading
()
...
...
@@ -72,11 +73,11 @@ const ToolNotificate = (props) => {
useEffect
(()
=>
{
getData
()
},
[
searchDebount
,
pageIndex
])
},
[
searchDebount
,
pageIndex
,
status
])
const
removeItem
=
async
(
id
)
=>
{
props
.
showLoading
()
const
res
=
await
deleteMerchant
({
id
})
const
res
=
await
deleteMerchant
({
id
Guid
:
id
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
getData
()
...
...
@@ -104,6 +105,8 @@ const ToolNotificate = (props) => {
handeChangeActive
=
{
handeChangeActive
}
totalRecords
=
{
totalRecords
}
permissions
=
{
permissions
}
status
=
{
status
}
setStatus
=
{
setStatus
}
/
>
)
}
...
...
src/app/views/Merchant/Update.js
View file @
456900c2
...
...
@@ -88,7 +88,7 @@ const SimpleForm = (props) => {
if
(
res
.
data
.
code
==
200
)
{
history
.
push
(
'/merchant'
)
if
(
res
.
data
.
code
==
200
)
{
toast
.
success
(
'
Tạo
pháp nhân thành công!'
,
{
toast
.
success
(
'
Cập nhật
pháp nhân thành công!'
,
{
theme
:
'colored'
,
})
}
...
...
src/app/views/Merchant/View.js
View file @
456900c2
...
...
@@ -31,6 +31,8 @@ function CustomerView(props) {
pageIndex
,
totalRecords
,
permissions
,
status
,
setStatus
,
}
=
props
const
[
age
,
setAge
]
=
React
.
useState
(
''
)
const
{
user
}
=
useAuth
()
...
...
@@ -62,18 +64,62 @@ function CustomerView(props) {
container
spacing
=
{
3
}
>
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
sm
=
{
6
}
xs
=
{
6
}
>
<
TextField
variant
=
"outlined"
className
=
"w-full"
label
=
"Tên pháp nhân"
onChange
=
{(
e
)
=>
{
const
text
=
e
.
target
.
value
setTimeout
(()
=>
{
setTxtSearch
(
text
)
},
1000
)
}}
/
>
<
Grid
container
spacing
=
{
3
}
item
lg
=
{
8
}
md
=
{
8
}
sm
=
{
8
}
xs
=
{
8
}
>
<
Grid
item
lg
=
{
5
}
md
=
{
5
}
sm
=
{
5
}
xs
=
{
5
}
>
<
TextField
variant
=
"outlined"
className
=
"w-full"
label
=
"Tên pháp nhân"
onChange
=
{(
e
)
=>
{
const
text
=
e
.
target
.
value
setTimeout
(()
=>
{
setTxtSearch
(
text
)
},
1000
)
}}
/
>
<
/Grid
>
<
Grid
item
lg
=
{
5
}
md
=
{
5
}
sm
=
{
5
}
xs
=
{
5
}
>
<
FormControl
variant
=
"outlined"
fullWidth
>
<
InputLabel
htmlFor
=
"outlined-age-native-simple"
>
Tr
ạ
ng
th
á
i
<
/InputLabel
>
<
Select
label
=
"Trạng thái"
value
=
{
status
}
onChange
=
{(
e
)
=>
setStatus
(
e
.
target
.
value
)}
inputProps
=
{{
name
:
'age'
,
id
:
'outlined-age-native-simple'
,
}}
>
<
MenuItem
value
=
""
>
<
em
>
T
ấ
t
c
ả
<
/em
>
<
/MenuItem
>
{[
{
id
:
1
,
name
:
'Hoạt động'
,
},
{
id
:
2
,
name
:
'Khoá'
,
},
].
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
))}
<
/Select
>
<
/FormControl
>
<
/Grid
>
<
/Grid
>
{
checkRole
(
user
,
'/merchant/create'
)
?
(
<
Link
to
=
"/merchant/create"
>
...
...
src/app/views/Transaction/Index.js
View file @
456900c2
...
...
@@ -8,6 +8,8 @@ import { showLoading, hideLoading } from 'app/redux/actions/loadingAction'
import
{
toast
}
from
'react-toastify'
import
useDebounce
from
'app/hooks/useDebounce'
import
{
useTranslation
}
from
'react-i18next'
import
{
dropdownMerchant
,
dropdownStore
}
from
'app/apis/Functions/dropdown'
const
ToolNotificate
=
(
props
)
=>
{
const
[
txtSearch
,
setTxtSearch
]
=
useState
(
''
)
const
[
applications
,
setApplications
]
=
useState
(
''
)
...
...
@@ -20,6 +22,16 @@ const ToolNotificate = (props) => {
const
[
endDate
,
setEndDate
]
=
useState
()
const
{
t
}
=
useTranslation
()
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
)
...
...
@@ -35,6 +47,10 @@ const ToolNotificate = (props) => {
page_size
:
pageSize
,
from_date
:
startDate
?
convertDate
(
startDate
)
:
null
,
to_date
:
endDate
?
convertDate
(
endDate
)
:
null
,
type_code
:
type
,
merchant_id
:
merchant
,
store_id
:
store
,
// gasoline_id: '57dd1a73-d847-4d73-9791-08dc0841e7a9',
})
props
.
hideLoading
()
...
...
@@ -57,7 +73,45 @@ const ToolNotificate = (props) => {
useEffect
(()
=>
{
getData
()
},
[
searchDebount
,
pageIndex
,
startDate
])
},
[
searchDebount
,
pageIndex
,
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'
,
})
}
}
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'
,
})
}
}
return
(
<
LogAuth
...
...
@@ -70,6 +124,15 @@ const ToolNotificate = (props) => {
applications
=
{
applications
}
startDate
=
{
startDate
}
changeDateRange
=
{
changeDateRange
}
type
=
{
type
}
setType
=
{
setType
}
listType
=
{
listType
}
merchant
=
{
merchant
}
setMerchant
=
{
setMerchant
}
listMerchant
=
{
listMerchant
}
store
=
{
store
}
setStore
=
{
setStore
}
listStore
=
{
listStore
}
/
>
)
}
...
...
src/app/views/Transaction/View.js
View file @
456900c2
...
...
@@ -33,6 +33,15 @@ function CustomerView(props) {
applications
,
startDate
,
changeDateRange
,
type
,
setType
,
listType
,
listMerchant
,
setMerchant
,
merchant
,
store
,
setStore
,
listStore
,
}
=
props
const
handleChange
=
(
event
)
=>
{
...
...
@@ -57,37 +66,110 @@ function CustomerView(props) {
padding
:
10
,
marginBottom
:
20
,
}}
justify
=
{
'space-between'
}
//
justify={'space-between'}
alignItems
=
{
'center'
}
container
spacing
=
{
3
}
>
<
Grid
container
spacing
=
{
2
}
item
lg
=
{
6
}
md
=
{
6
}
sm
=
{
6
}
xs
=
{
6
}
>
<
Grid
item
>
<
TextField
variant
=
"outlined"
className
=
"w-full"
label
=
"Tìm kiếm"
onChange
=
{(
e
)
=>
{
const
text
=
e
.
target
.
value
setTxtSearch
(
text
)
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
sm
=
{
3
}
xs
=
{
3
}
>
<
TextField
variant
=
"outlined"
className
=
"w-full"
label
=
"Tìm kiếm"
onChange
=
{(
e
)
=>
{
const
text
=
e
.
target
.
value
setTxtSearch
(
text
)
}}
/
>
<
/Grid
>
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
sm
=
{
3
}
xs
=
{
3
}
>
<
FormControl
variant
=
"outlined"
fullWidth
>
<
InputLabel
htmlFor
=
"outlined-age-native-simple"
>
Ph
ươ
ng
th
ứ
c
thanh
to
á
n
<
/InputLabel
>
<
Select
label
=
"Phương thức thanh toán"
value
=
{
type
}
onChange
=
{(
e
)
=>
setType
(
e
.
target
.
value
)}
inputProps
=
{{
name
:
'age'
,
id
:
'outlined-age-native-simple'
,
}}
>
<
MenuItem
value
=
""
>
<
em
>
T
ấ
t
c
ả
<
/em
>
<
/MenuItem
>
{[
{
id
:
'QR'
,
name
:
'QR'
,
},
{
id
:
'CASH'
,
name
:
'Tiền mặt'
,
},
{
id
:
'DEBT'
,
name
:
'Công nợ'
,
},
].
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
))}
<
/Select
>
<
/FormControl
>
<
/Grid
>
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
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'
,
}}
/
>
<
/Grid
>
<
Grid
item
>
<
DateRange
date
=
{
startDate
}
changeDateRange
=
{
changeDateRange
}
/
>
<
/Grid
>
>
<
MenuItem
value
=
""
>
<
em
>
T
ấ
t
c
ả
<
/em
>
<
/MenuItem
>
{
listMerchant
.
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
))}
<
/Select
>
<
/FormControl
>
<
/Grid
>
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
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
=
{
3
}
md
=
{
3
}
sm
=
{
3
}
xs
=
{
3
}
>
<
DateRange
date
=
{
startDate
}
changeDateRange
=
{
changeDateRange
}
/
>
<
/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