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
Hide 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 {
Typography
,
MenuItem
,
Tooltip
,
Switch
,
}
from
'@material-ui/core'
import
{
dropdownListSupplier
}
from
'app/apis/Functions/dropdown'
import
{
createMerchant
}
from
'app/apis/Functions/merchant'
...
...
@@ -30,6 +31,8 @@ const SimpleForm = (props) => {
const
[
invoice
,
setInvoice
]
=
useState
(
false
)
const
[
payment
,
setPayment
]
=
useState
(
false
)
const
[
isAuto
,
setAuto
]
=
useState
(
false
)
const
[
isInvoiceAuto
,
setInvoiceAuto
]
=
useState
(
false
)
const
[
listDrop
,
setListDrop
]
=
useState
([])
const
{
t
}
=
useTranslation
()
const
location
=
useLocation
()
...
...
@@ -91,6 +94,7 @@ const SimpleForm = (props) => {
is_connect_hddt
:
invoice
,
is_connect_qr
:
payment
,
is_hddt_nomal
:
isAuto
,
is_invoice_auto
:
isInvoiceAuto
,
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
...
...
@@ -537,6 +541,37 @@ const SimpleForm = (props) => {
<
/Grid
>
)
:
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
>
<
FormControlLabel
className
=
"min-w-288"
...
...
src/app/views/Merchant/Update.js
View file @
bb2285ca
...
...
@@ -12,6 +12,7 @@ import {
Typography
,
MenuItem
,
Tooltip
,
Switch
,
}
from
'@material-ui/core'
import
{
updateMerchant
,
detailMerchant
}
from
'app/apis/Functions/merchant'
...
...
@@ -32,7 +33,7 @@ const SimpleForm = (props) => {
const
[
payment
,
setPayment
]
=
useState
(
false
)
const
[
isAuto
,
setAuto
]
=
useState
(
false
)
const
[
listDrop
,
setListDrop
]
=
useState
([])
const
[
isInvoiceAuto
,
setInvoiceAuto
]
=
useState
(
false
)
const
{
t
}
=
useTranslation
()
const
location
=
useLocation
()
useEffect
(()
=>
{
...
...
@@ -99,7 +100,7 @@ const SimpleForm = (props) => {
setPayment(res.data.data?.is_connect_qr)
setIsStore(res.data.data?.is_admin_store)
setAuto(res.data.data?.is_hddt_nomal)
setInvoiceAuto(res.data.data?.is_invoice_auto)
} else if (res.data.code == 401) {
setTimeout(() => {
history.push('/')
...
...
@@ -121,6 +122,7 @@ const SimpleForm = (props) => {
is_connect_hddt: invoice,
is_connect_qr: payment,
is_hddt_nomal: isAuto,
is_invoice_auto: isInvoiceAuto,
})
props.hideLoading()
if (res.data.code == 200) {
...
...
@@ -547,6 +549,36 @@ const SimpleForm = (props) => {
/>
</Grid>
) : 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>
<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