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
58add8ae
Commit
58add8ae
authored
Jan 12, 2024
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
)
src/app/apis/url.js
View file @
58add8ae
...
...
@@ -62,6 +62,15 @@ export default {
urlDetailProduct
:
`
${
root
}
/product`
,
changeStatusProduct
:
`
${
root
}
/product/changeStatus`
,
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
logAuth
:
`
${
root
}
/logging/listLogin`
,
logApi
:
`
${
root
}
/logging/listCallApi`
,
...
...
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
ToolUserView
from
'./View'
import
{
getList
Function
,
delete
Function
,
changeStatus
Function
,
}
from
'app/apis/Functions/
function
'
getList
Merchants
,
delete
Merchant
,
changeStatus
Merchant
,
}
from
'app/apis/Functions/
merchant
'
import
{
useHistory
}
from
'react-router-dom'
import
KEY
from
'../../assets/Key'
import
{
connect
}
from
'react-redux'
...
...
@@ -27,24 +27,10 @@ const ToolNotificate = (props) => {
const
[
data
,
setData
]
=
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
)
=>
{
props
.
showLoading
()
const
res
=
await
changeStatus
Function
({
id
,
status_id
})
const
res
=
await
changeStatus
Merchant
({
id
,
status_id
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
getData
()
...
...
@@ -60,13 +46,14 @@ const ToolNotificate = (props) => {
const
getData
=
async
()
=>
{
props
.
showLoading
()
const
res
=
await
getList
Function
({
const
res
=
await
getList
Merchants
({
name
:
searchDebount
,
page_no
:
pageIndex
+
1
,
page_size
:
pageSize
,
})
props
.
hideLoading
()
console
.
log
(
'res'
,
res
)
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
console
.
log
(
res
.
data
)
...
...
@@ -92,7 +79,7 @@ const ToolNotificate = (props) => {
const
removeItem
=
async
(
id
)
=>
{
props
.
showLoading
()
const
res
=
await
delete
Function
({
id
})
const
res
=
await
delete
Merchant
({
id
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
getData
()
...
...
src/app/views/Merchant/Table.js
View file @
58add8ae
...
...
@@ -39,34 +39,46 @@ const columns = [
},
{
id
:
'name'
,
label
:
'
Tên chức năng
'
,
id
:
'
merchant_
name'
,
label
:
'
Pháp nhân
'
,
align
:
'left'
,
minWidth
:
'auto'
,
},
{
id
:
'code'
,
label
:
'Mã
code
'
,
id
:
'
tax_
code'
,
label
:
'Mã
số thuế
'
,
align
:
'left'
,
minWidth
:
'auto'
,
},
{
id
:
'
url
'
,
label
:
'Đ
ường dẫn
'
,
id
:
'
address
'
,
label
:
'Đ
ịa chỉ
'
,
align
:
'left'
,
minWidth
:
'auto'
,
},
{
id
:
'
description
'
,
label
:
'
Mô tả
'
,
id
:
'
email
'
,
label
:
'
Email
'
,
align
:
'left'
,
minWidth
:
'auto'
,
},
{
id
:
'date_created'
,
label
:
'Ngày tạo'
,
id
:
'representative'
,
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'
,
minWidth
:
'auto'
,
},
...
...
src/app/views/Merchant/Update.js
View file @
58add8ae
...
...
@@ -47,7 +47,7 @@ const SimpleForm = (props) => {
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
history
.
push
(
'/
function
'
)
history
.
push
(
'/
merchant
'
)
if
(
res
.
data
.
code
==
200
)
{
toast
.
success
(
'Cập nhật hành động thành công!'
,
{
theme
:
'colored'
,
...
...
@@ -81,10 +81,10 @@ const SimpleForm = (props) => {
<
Breadcrumb
routeSegments
=
{[
{
name
:
'Danh sách
chức năng
'
,
path
:
'/
function
'
,
name
:
'Danh sách
pháp nhân
'
,
path
:
'/
merchant
'
,
},
{
name
:
'Cập nhật
chức năng
'
},
{
name
:
'Cập nhật
pháp nhân
'
},
]}
/
>
<
/div
>
...
...
@@ -95,7 +95,7 @@ const SimpleForm = (props) => {
<
TextValidator
variant
=
"outlined"
className
=
"mb-4 w-full"
label
=
"Tên
chức năng
*"
label
=
"Tên
pháp nhân
*"
onChange
=
{
handleChange
}
type
=
"text"
name
=
"name"
...
...
@@ -154,7 +154,7 @@ const SimpleForm = (props) => {
<
/Grid
>
<
/Grid
>
<
Grid
container
justify
=
{
'flex-end'
}
>
<
Link
to
=
"
function
"
>
<
Link
to
=
"
merchant
"
>
<
Button
style
=
{{
marginRight
:
20
,
...
...
src/app/views/Merchant/View.js
View file @
58add8ae
...
...
@@ -45,8 +45,8 @@ function CustomerView(props) {
<
Breadcrumb
routeSegments
=
{[
{
name
:
'Danh sách
chức năng
'
,
path
:
'/
function
'
,
name
:
'Danh sách
pháp nhân
'
,
path
:
'/
merchant
'
,
},
]}
/
>
...
...
@@ -66,7 +66,7 @@ function CustomerView(props) {
<
TextField
variant
=
"outlined"
className
=
"w-full"
label
=
"Tên
chức năng
"
label
=
"Tên
pháp nhân
"
onChange
=
{(
e
)
=>
{
const
text
=
e
.
target
.
value
setTimeout
(()
=>
{
...
...
@@ -75,8 +75,8 @@ function CustomerView(props) {
}}
/
>
<
/Grid
>
{
checkRole
(
user
,
'/
function
/create'
)
?
(
<
Link
to
=
"/
function
/create"
>
{
checkRole
(
user
,
'/
merchant
/create'
)
?
(
<
Link
to
=
"/
merchant
/create"
>
<
Button
variant
=
"contained"
className
=
{
'bg-light-primary'
}
...
...
src/app/views/Transaction/Index.js
View file @
58add8ae
...
...
@@ -35,7 +35,7 @@ const ToolNotificate = (props) => {
page_size
:
pageSize
,
from_date
:
startDate
?
convertDate
(
startDate
)
:
null
,
to_date
:
endDate
?
convertDate
(
endDate
)
:
null
,
gasoline_id
:
'57dd1a73-d847-4d73-9791-08dc0841e7a9'
,
//
gasoline_id: '57dd1a73-d847-4d73-9791-08dc0841e7a9',
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
...
...
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