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
bb2285ca
Commit
bb2285ca
authored
Sep 17, 2024
by
tdgiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update codee
parent
8ab6c443
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
2 deletions
+69
-2
Create.js
src/app/views/Merchant/Create.js
+35
-0
Update.js
src/app/views/Merchant/Update.js
+34
-2
No files found.
src/app/views/Merchant/Create.js
View file @
bb2285ca
...
@@ -12,6 +12,7 @@ import {
...
@@ -12,6 +12,7 @@ import {
Typography
,
Typography
,
MenuItem
,
MenuItem
,
Tooltip
,
Tooltip
,
Switch
,
}
from
'@material-ui/core'
}
from
'@material-ui/core'
import
{
dropdownListSupplier
}
from
'app/apis/Functions/dropdown'
import
{
dropdownListSupplier
}
from
'app/apis/Functions/dropdown'
import
{
createMerchant
}
from
'app/apis/Functions/merchant'
import
{
createMerchant
}
from
'app/apis/Functions/merchant'
...
@@ -30,6 +31,8 @@ const SimpleForm = (props) => {
...
@@ -30,6 +31,8 @@ const SimpleForm = (props) => {
const
[
invoice
,
setInvoice
]
=
useState
(
false
)
const
[
invoice
,
setInvoice
]
=
useState
(
false
)
const
[
payment
,
setPayment
]
=
useState
(
false
)
const
[
payment
,
setPayment
]
=
useState
(
false
)
const
[
isAuto
,
setAuto
]
=
useState
(
false
)
const
[
isAuto
,
setAuto
]
=
useState
(
false
)
const
[
isInvoiceAuto
,
setInvoiceAuto
]
=
useState
(
false
)
const
[
listDrop
,
setListDrop
]
=
useState
([])
const
[
listDrop
,
setListDrop
]
=
useState
([])
const
{
t
}
=
useTranslation
()
const
{
t
}
=
useTranslation
()
const
location
=
useLocation
()
const
location
=
useLocation
()
...
@@ -91,6 +94,7 @@ const SimpleForm = (props) => {
...
@@ -91,6 +94,7 @@ const SimpleForm = (props) => {
is_connect_hddt
:
invoice
,
is_connect_hddt
:
invoice
,
is_connect_qr
:
payment
,
is_connect_qr
:
payment
,
is_hddt_nomal
:
isAuto
,
is_hddt_nomal
:
isAuto
,
is_invoice_auto
:
isInvoiceAuto
,
})
})
props
.
hideLoading
()
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
...
@@ -537,6 +541,37 @@ const SimpleForm = (props) => {
...
@@ -537,6 +541,37 @@ const SimpleForm = (props) => {
<
/Grid
>
<
/Grid
>
)
:
null
}
)
:
null
}
{
invoice
?
(
<
Grid
item
lg
=
{
12
}
md
=
{
12
}
sm
=
{
12
}
xs
=
{
12
}
style
=
{{
paddingTop
:
20
,
}}
>
<
Switch
onChange
=
{(
event
)
=>
{
setInvoiceAuto
(
event
.
target
.
checked
)
}}
checked
=
{
isInvoiceAuto
}
color
=
"primary"
size
=
"medium"
/>
<
span
style
=
{{
fontSize
:
18
,
marginLeft
:
20
,
marginTop
:
5
,
}}
>
Cho
ph
é
p
xu
ấ
t
h
ó
a
đơ
n
t
ự
độ
ng
<
/span
>
<
/Grid
>
)
:
null
}
<
Grid
lg
=
{
12
}
md
=
{
12
}
sm
=
{
12
}
xs
=
{
12
}
item
>
<
Grid
lg
=
{
12
}
md
=
{
12
}
sm
=
{
12
}
xs
=
{
12
}
item
>
<
FormControlLabel
<
FormControlLabel
className
=
"min-w-288"
className
=
"min-w-288"
...
...
src/app/views/Merchant/Update.js
View file @
bb2285ca
...
@@ -12,6 +12,7 @@ import {
...
@@ -12,6 +12,7 @@ import {
Typography
,
Typography
,
MenuItem
,
MenuItem
,
Tooltip
,
Tooltip
,
Switch
,
}
from
'@material-ui/core'
}
from
'@material-ui/core'
import
{
updateMerchant
,
detailMerchant
}
from
'app/apis/Functions/merchant'
import
{
updateMerchant
,
detailMerchant
}
from
'app/apis/Functions/merchant'
...
@@ -32,7 +33,7 @@ const SimpleForm = (props) => {
...
@@ -32,7 +33,7 @@ const SimpleForm = (props) => {
const
[
payment
,
setPayment
]
=
useState
(
false
)
const
[
payment
,
setPayment
]
=
useState
(
false
)
const
[
isAuto
,
setAuto
]
=
useState
(
false
)
const
[
isAuto
,
setAuto
]
=
useState
(
false
)
const
[
listDrop
,
setListDrop
]
=
useState
([])
const
[
listDrop
,
setListDrop
]
=
useState
([])
const
[
isInvoiceAuto
,
setInvoiceAuto
]
=
useState
(
false
)
const
{
t
}
=
useTranslation
()
const
{
t
}
=
useTranslation
()
const
location
=
useLocation
()
const
location
=
useLocation
()
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -99,7 +100,7 @@ const SimpleForm = (props) => {
...
@@ -99,7 +100,7 @@ const SimpleForm = (props) => {
setPayment(res.data.data?.is_connect_qr)
setPayment(res.data.data?.is_connect_qr)
setIsStore(res.data.data?.is_admin_store)
setIsStore(res.data.data?.is_admin_store)
setAuto(res.data.data?.is_hddt_nomal)
setAuto(res.data.data?.is_hddt_nomal)
setInvoiceAuto(res.data.data?.is_invoice_auto)
} else if (res.data.code == 401) {
} else if (res.data.code == 401) {
setTimeout(() => {
setTimeout(() => {
history.push('/')
history.push('/')
...
@@ -121,6 +122,7 @@ const SimpleForm = (props) => {
...
@@ -121,6 +122,7 @@ const SimpleForm = (props) => {
is_connect_hddt: invoice,
is_connect_hddt: invoice,
is_connect_qr: payment,
is_connect_qr: payment,
is_hddt_nomal: isAuto,
is_hddt_nomal: isAuto,
is_invoice_auto: isInvoiceAuto,
})
})
props.hideLoading()
props.hideLoading()
if (res.data.code == 200) {
if (res.data.code == 200) {
...
@@ -547,6 +549,36 @@ const SimpleForm = (props) => {
...
@@ -547,6 +549,36 @@ const SimpleForm = (props) => {
/>
/>
</Grid>
</Grid>
) : null}
) : null}
{invoice ? (
<Grid
item
lg={12}
md={12}
sm={12}
xs={12}
style={{
paddingTop: 20,
}}
>
<Switch
onChange={(event) => {
setInvoiceAuto(event.target.checked)
}}
checked={isInvoiceAuto}
color="primary"
size="medium"
/>
<span
style={{
fontSize: 18,
marginLeft: 20,
marginTop: 5,
}}
>
Cho phép xuất hóa đơn tự động
</span>
</Grid>
) : null}
<Grid lg={12} md={12} sm={12} xs={12} item>
<Grid lg={12} md={12} sm={12} xs={12} item>
<FormControlLabel
<FormControlLabel
...
...
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