Commit bb2285ca by tdgiang

update codee

parent 8ab6c443
...@@ -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 xut 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"
......
...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment