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
d4e780bb
Commit
d4e780bb
authored
Jan 15, 2024
by
tdgiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update code
parent
58add8ae
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
32 deletions
+26
-32
Create.js
src/app/views/Merchant/Create.js
+20
-26
Index.js
src/app/views/Merchant/Index.js
+1
-1
Table.js
src/app/views/Merchant/Table.js
+5
-5
Update.js
src/app/views/Merchant/Update.js
+0
-0
No files found.
src/app/views/Merchant/Create.js
View file @
d4e780bb
...
...
@@ -27,32 +27,26 @@ const SimpleForm = (props) => {
const
handleSubmit
=
async
(
event
)
=>
{
const
newValue
=
trimObject
(
state
)
console
.
log
(
'newValue'
,
newValue
)
console
.
log
(
'isStore'
,
isStore
)
console
.
log
(
'invoice'
,
invoice
)
console
.
log
(
'payment'
,
payment
)
//props.showLoading()
props
.
showLoading
()
const
res
=
await
createMerchant
({
...
newValue
,
is_admin_store
:
tru
e
,
is_connect_hddt
:
tru
e
,
is_connect_qr
:
true
,
is_admin_store
:
isStor
e
,
is_connect_hddt
:
invoic
e
,
is_connect_qr
:
payment
,
})
//props.hideLoading()
console
.
log
(
'res'
,
res
)
// 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!', {
// theme: 'colored',
// })
// }
// } else {
// toast.error(t(res.data.error), {
// theme: 'colored',
// })
// }
props
.
hideLoading
()
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!'
,
{
theme
:
'colored'
,
})
}
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
})
}
}
const
handleChange
=
(
event
)
=>
{
...
...
@@ -64,7 +58,7 @@ const SimpleForm = (props) => {
}
const
{
merchan_name
,
merchan
t
_name
,
tax_code
,
address
,
email
,
...
...
@@ -105,8 +99,8 @@ const SimpleForm = (props) => {
label
=
"Tên pháp nhân *"
onChange
=
{
handleChange
}
type
=
"text"
name
=
"merchan_name"
value
=
{
merchan_name
||
''
}
name
=
"merchan
t
_name"
value
=
{
merchan
t
_name
||
''
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
...
...
src/app/views/Merchant/Index.js
View file @
d4e780bb
...
...
@@ -30,7 +30,7 @@ const ToolNotificate = (props) => {
const
handeChangeActive
=
async
(
id
,
status_id
)
=>
{
props
.
showLoading
()
const
res
=
await
changeStatusMerchant
({
id
,
status_id
})
const
res
=
await
changeStatusMerchant
({
id
Guid
:
id
,
status_id
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
getData
()
...
...
src/app/views/Merchant/Table.js
View file @
d4e780bb
...
...
@@ -210,14 +210,14 @@ function TableList(props) {
<
/Select
>
<
/TableCell
>
<
TableCell
>
{
checkRole
(
user
,
'/
function
/delete'
)
?
(
{
checkRole
(
user
,
'/
merchant
/delete'
)
?
(
<
Tooltip
title
=
"Xoá"
>
<
IconButton
onClick
=
{()
=>
{
setSelected
({
...
row
,
title
:
'Xóa
chức năng
'
,
content
:
`Bạn có muốn xóa
chức năng
${
row
.
name
}
hay không?`
,
title
:
'Xóa
pháp nhân
'
,
content
:
`Bạn có muốn xóa
pháp nhân
${
row
.
merchant_
name
}
hay không?`
,
})
setOpen
(
true
)
}}
...
...
@@ -230,13 +230,13 @@ function TableList(props) {
<
/IconButton
>
<
/Tooltip
>
)
:
null
}
{
checkRole
(
user
,
'/
function
/update'
)
?
(
{
checkRole
(
user
,
'/
merchant
/update'
)
?
(
<
Tooltip
title
=
"Cập nhật"
>
<
IconButton
onClick
=
{()
=>
{
history
.
push
({
pathname
:
'/
function
/update'
,
'/
merchant
/update'
,
state
:
row
.
id
,
})
}}
...
...
src/app/views/Merchant/Update.js
View file @
d4e780bb
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