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
9
Issues
9
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
58add8ae
Commit
58add8ae
authored
a year ago
by
tdgiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update code
parent
10a4a988
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
83 additions
and
43 deletions
+83
-43
merchant.js
src/app/apis/Functions/merchant.js
+32
-0
url.js
src/app/apis/url.js
+9
-0
Create.js
src/app/views/Merchant/Create.js
+0
-0
Index.js
src/app/views/Merchant/Index.js
+8
-21
Table.js
src/app/views/Merchant/Table.js
+22
-10
Update.js
src/app/views/Merchant/Update.js
+6
-6
View.js
src/app/views/Merchant/View.js
+5
-5
Index.js
src/app/views/Transaction/Index.js
+1
-1
No files found.
src/app/apis/Functions/merchant.js
0 → 100644
View file @
58add8ae
/* eslint-disable handle-callback-err */
import
{
PostData
,
GetURL
}
from
'../helpers'
import
url
from
'../url'
export
const
getListMerchants
=
async
(
body
)
=>
PostData
(
url
.
urlGetListMerchant
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
createMerchant
=
async
(
body
)
=>
PostData
(
url
.
urlCreateMerchant
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
updateMerchant
=
async
(
body
)
=>
PostData
(
url
.
urlUpdateMerchant
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
detailMerchant
=
async
(
id
,
body
)
=>
GetURL
(
`
${
url
.
urlDetailMerchant
}
/
${
id
}
`
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
deleteMerchant
=
async
(
body
)
=>
PostData
(
url
.
urlDeleteMerchant
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
changeStatusMerchant
=
async
(
body
)
=>
PostData
(
url
.
changeStatusMerchant
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
This diff is collapsed.
Click to expand it.
src/app/apis/url.js
View file @
58add8ae
...
@@ -62,6 +62,15 @@ export default {
...
@@ -62,6 +62,15 @@ export default {
urlDetailProduct
:
`
${
root
}
/product`
,
urlDetailProduct
:
`
${
root
}
/product`
,
changeStatusProduct
:
`
${
root
}
/product/changeStatus`
,
changeStatusProduct
:
`
${
root
}
/product/changeStatus`
,
listTransaction
:
`
${
root
}
/paymentTrans/list`
,
listTransaction
:
`
${
root
}
/paymentTrans/list`
,
//merchant:
urlGetListMerchant
:
`
${
root
}
/merchant/list`
,
urlCreateMerchant
:
`
${
root
}
/merchant/create`
,
urlUpdateMerchant
:
`
${
root
}
/merchant/update`
,
urlDeleteMerchant
:
`
${
root
}
/merchant/delete`
,
urlDetailMerchant
:
`
${
root
}
/merchant`
,
changeStatusMerchant
:
`
${
root
}
/merchant/changeStatus`
,
//Log
//Log
logAuth
:
`
${
root
}
/logging/listLogin`
,
logAuth
:
`
${
root
}
/logging/listLogin`
,
logApi
:
`
${
root
}
/logging/listCallApi`
,
logApi
:
`
${
root
}
/logging/listCallApi`
,
...
...
This diff is collapsed.
Click to expand it.
src/app/views/Merchant/Create.js
View file @
58add8ae
This diff is collapsed.
Click to expand it.
src/app/views/Merchant/Index.js
View file @
58add8ae
import
React
,
{
useState
,
useEffect
}
from
'react'
import
React
,
{
useState
,
useEffect
}
from
'react'
import
ToolUserView
from
'./View'
import
ToolUserView
from
'./View'
import
{
import
{
getList
Function
,
getList
Merchants
,
delete
Function
,
delete
Merchant
,
changeStatus
Function
,
changeStatus
Merchant
,
}
from
'app/apis/Functions/
function
'
}
from
'app/apis/Functions/
merchant
'
import
{
useHistory
}
from
'react-router-dom'
import
{
useHistory
}
from
'react-router-dom'
import
KEY
from
'../../assets/Key'
import
KEY
from
'../../assets/Key'
import
{
connect
}
from
'react-redux'
import
{
connect
}
from
'react-redux'
...
@@ -27,24 +27,10 @@ const ToolNotificate = (props) => {
...
@@ -27,24 +27,10 @@ const ToolNotificate = (props) => {
const
[
data
,
setData
]
=
useState
([])
const
[
data
,
setData
]
=
useState
([])
const
[
permissions
,
setPermissions
]
=
useState
([])
const
[
permissions
,
setPermissions
]
=
useState
([])
// useEffect(() => {
// getListPermission();
// }, []);
// const getListPermission = () => {
// let temp = localStorage.getItem(KEY.LISTPATH);
// let listPath = JSON.parse(temp);
// if (listPath) {
// const newlist = listPath.map((e) => {
// if (e.function_code) return e.function_code;
// return e.action_code;
// });
// setPermissions(newlist);
// }
// };
const
handeChangeActive
=
async
(
id
,
status_id
)
=>
{
const
handeChangeActive
=
async
(
id
,
status_id
)
=>
{
props
.
showLoading
()
props
.
showLoading
()
const
res
=
await
changeStatus
Function
({
id
,
status_id
})
const
res
=
await
changeStatus
Merchant
({
id
,
status_id
})
props
.
hideLoading
()
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
getData
()
getData
()
...
@@ -60,13 +46,14 @@ const ToolNotificate = (props) => {
...
@@ -60,13 +46,14 @@ const ToolNotificate = (props) => {
const
getData
=
async
()
=>
{
const
getData
=
async
()
=>
{
props
.
showLoading
()
props
.
showLoading
()
const
res
=
await
getList
Function
({
const
res
=
await
getList
Merchants
({
name
:
searchDebount
,
name
:
searchDebount
,
page_no
:
pageIndex
+
1
,
page_no
:
pageIndex
+
1
,
page_size
:
pageSize
,
page_size
:
pageSize
,
})
})
props
.
hideLoading
()
props
.
hideLoading
()
console
.
log
(
'res'
,
res
)
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
console
.
log
(
res
.
data
)
console
.
log
(
res
.
data
)
...
@@ -92,7 +79,7 @@ const ToolNotificate = (props) => {
...
@@ -92,7 +79,7 @@ const ToolNotificate = (props) => {
const
removeItem
=
async
(
id
)
=>
{
const
removeItem
=
async
(
id
)
=>
{
props
.
showLoading
()
props
.
showLoading
()
const
res
=
await
delete
Function
({
id
})
const
res
=
await
delete
Merchant
({
id
})
props
.
hideLoading
()
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
getData
()
getData
()
...
...
This diff is collapsed.
Click to expand it.
src/app/views/Merchant/Table.js
View file @
58add8ae
...
@@ -39,34 +39,46 @@ const columns = [
...
@@ -39,34 +39,46 @@ const columns = [
},
},
{
{
id
:
'name'
,
id
:
'
merchant_
name'
,
label
:
'
Tên chức năng
'
,
label
:
'
Pháp nhân
'
,
align
:
'left'
,
align
:
'left'
,
minWidth
:
'auto'
,
minWidth
:
'auto'
,
},
},
{
{
id
:
'code'
,
id
:
'
tax_
code'
,
label
:
'Mã
code
'
,
label
:
'Mã
số thuế
'
,
align
:
'left'
,
align
:
'left'
,
minWidth
:
'auto'
,
minWidth
:
'auto'
,
},
},
{
{
id
:
'
url
'
,
id
:
'
address
'
,
label
:
'Đ
ường dẫn
'
,
label
:
'Đ
ịa chỉ
'
,
align
:
'left'
,
align
:
'left'
,
minWidth
:
'auto'
,
minWidth
:
'auto'
,
},
},
{
{
id
:
'
description
'
,
id
:
'
email
'
,
label
:
'
Mô tả
'
,
label
:
'
Email
'
,
align
:
'left'
,
align
:
'left'
,
minWidth
:
'auto'
,
minWidth
:
'auto'
,
},
},
{
{
id
:
'date_created'
,
id
:
'representative'
,
label
:
'Ngày tạo'
,
label
:
'Người đại diện'
,
align
:
'left'
,
minWidth
:
'auto'
,
},
{
id
:
'phone_number'
,
label
:
'SĐT liên hệ'
,
align
:
'left'
,
minWidth
:
'auto'
,
},
{
id
:
'total_store'
,
label
:
'Số cây xăng'
,
align
:
'left'
,
align
:
'left'
,
minWidth
:
'auto'
,
minWidth
:
'auto'
,
},
},
...
...
This diff is collapsed.
Click to expand it.
src/app/views/Merchant/Update.js
View file @
58add8ae
...
@@ -47,7 +47,7 @@ const SimpleForm = (props) => {
...
@@ -47,7 +47,7 @@ const SimpleForm = (props) => {
})
})
props
.
hideLoading
()
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
history
.
push
(
'/
function
'
)
history
.
push
(
'/
merchant
'
)
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
toast
.
success
(
'Cập nhật hành động thành công!'
,
{
toast
.
success
(
'Cập nhật hành động thành công!'
,
{
theme
:
'colored'
,
theme
:
'colored'
,
...
@@ -81,10 +81,10 @@ const SimpleForm = (props) => {
...
@@ -81,10 +81,10 @@ const SimpleForm = (props) => {
<
Breadcrumb
<
Breadcrumb
routeSegments
=
{[
routeSegments
=
{[
{
{
name
:
'Danh sách
chức năng
'
,
name
:
'Danh sách
pháp nhân
'
,
path
:
'/
function
'
,
path
:
'/
merchant
'
,
},
},
{
name
:
'Cập nhật
chức năng
'
},
{
name
:
'Cập nhật
pháp nhân
'
},
]}
]}
/
>
/
>
<
/div
>
<
/div
>
...
@@ -95,7 +95,7 @@ const SimpleForm = (props) => {
...
@@ -95,7 +95,7 @@ const SimpleForm = (props) => {
<
TextValidator
<
TextValidator
variant
=
"outlined"
variant
=
"outlined"
className
=
"mb-4 w-full"
className
=
"mb-4 w-full"
label
=
"Tên
chức năng
*"
label
=
"Tên
pháp nhân
*"
onChange
=
{
handleChange
}
onChange
=
{
handleChange
}
type
=
"text"
type
=
"text"
name
=
"name"
name
=
"name"
...
@@ -154,7 +154,7 @@ const SimpleForm = (props) => {
...
@@ -154,7 +154,7 @@ const SimpleForm = (props) => {
<
/Grid
>
<
/Grid
>
<
/Grid
>
<
/Grid
>
<
Grid
container
justify
=
{
'flex-end'
}
>
<
Grid
container
justify
=
{
'flex-end'
}
>
<
Link
to
=
"
function
"
>
<
Link
to
=
"
merchant
"
>
<
Button
<
Button
style
=
{{
style
=
{{
marginRight
:
20
,
marginRight
:
20
,
...
...
This diff is collapsed.
Click to expand it.
src/app/views/Merchant/View.js
View file @
58add8ae
...
@@ -45,8 +45,8 @@ function CustomerView(props) {
...
@@ -45,8 +45,8 @@ function CustomerView(props) {
<
Breadcrumb
<
Breadcrumb
routeSegments
=
{[
routeSegments
=
{[
{
{
name
:
'Danh sách
chức năng
'
,
name
:
'Danh sách
pháp nhân
'
,
path
:
'/
function
'
,
path
:
'/
merchant
'
,
},
},
]}
]}
/
>
/
>
...
@@ -66,7 +66,7 @@ function CustomerView(props) {
...
@@ -66,7 +66,7 @@ function CustomerView(props) {
<
TextField
<
TextField
variant
=
"outlined"
variant
=
"outlined"
className
=
"w-full"
className
=
"w-full"
label
=
"Tên
chức năng
"
label
=
"Tên
pháp nhân
"
onChange
=
{(
e
)
=>
{
onChange
=
{(
e
)
=>
{
const
text
=
e
.
target
.
value
const
text
=
e
.
target
.
value
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -75,8 +75,8 @@ function CustomerView(props) {
...
@@ -75,8 +75,8 @@ function CustomerView(props) {
}}
}}
/
>
/
>
<
/Grid
>
<
/Grid
>
{
checkRole
(
user
,
'/
function
/create'
)
?
(
{
checkRole
(
user
,
'/
merchant
/create'
)
?
(
<
Link
to
=
"/
function
/create"
>
<
Link
to
=
"/
merchant
/create"
>
<
Button
<
Button
variant
=
"contained"
variant
=
"contained"
className
=
{
'bg-light-primary'
}
className
=
{
'bg-light-primary'
}
...
...
This diff is collapsed.
Click to expand it.
src/app/views/Transaction/Index.js
View file @
58add8ae
...
@@ -35,7 +35,7 @@ const ToolNotificate = (props) => {
...
@@ -35,7 +35,7 @@ const ToolNotificate = (props) => {
page_size
:
pageSize
,
page_size
:
pageSize
,
from_date
:
startDate
?
convertDate
(
startDate
)
:
null
,
from_date
:
startDate
?
convertDate
(
startDate
)
:
null
,
to_date
:
endDate
?
convertDate
(
endDate
)
:
null
,
to_date
:
endDate
?
convertDate
(
endDate
)
:
null
,
gasoline_id
:
'57dd1a73-d847-4d73-9791-08dc0841e7a9'
,
//
gasoline_id: '57dd1a73-d847-4d73-9791-08dc0841e7a9',
})
})
props
.
hideLoading
()
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
...
...
This diff is collapsed.
Click to expand it.
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