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
a18e4537
Commit
a18e4537
authored
Jul 12, 2024
by
tdgiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update build
parent
03e4f965
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
70 deletions
+92
-70
Create.js
src/app/views/landingpage/package/Create.js
+24
-15
Update.js
src/app/views/landingpage/package/Update.js
+22
-13
Create.js
src/app/views/landingpage/priceProduct/Create.js
+22
-15
Index.js
src/app/views/landingpage/priceProduct/Index.js
+2
-2
Update.js
src/app/views/landingpage/priceProduct/Update.js
+22
-15
View.js
src/app/views/landingpage/register/View.js
+0
-10
No files found.
src/app/views/landingpage/package/Create.js
View file @
a18e4537
...
@@ -37,24 +37,35 @@ const SimpleForm = (props) => {
...
@@ -37,24 +37,35 @@ const SimpleForm = (props) => {
const
handleSubmit
=
async
(
event
)
=>
{
const
handleSubmit
=
async
(
event
)
=>
{
const
newValue
=
trimObject
(
state
)
const
newValue
=
trimObject
(
state
)
props
.
showLoading
()
const
res
=
await
createPackage
({
if
(
...
newValue
,
isNumeric
(
newValue
.
price
)
||
status
:
1
,
newValue
.
price
==
''
||
outstand
:
1
,
!
newValue
.
price
func_id_add
:
listChecked
,
)
{
price
:
newValue
.
price
!=
''
?
null
:
newValue
.
price
,
props
.
showLoading
()
})
const
res
=
await
createPackage
({
props
.
hideLoading
()
...
newValue
,
if
(
res
.
data
.
code
==
200
)
{
status
:
1
,
history
.
push
(
'/package'
)
outstand
:
1
,
func_id_add
:
listChecked
,
price
:
newValue
.
price
!=
''
?
newValue
.
price
:
null
,
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
toast
.
success
(
'Thêm mới gói thành công!'
,
{
history
.
push
(
'/package'
)
if
(
res
.
data
.
code
==
200
)
{
toast
.
success
(
'Thêm mới gói thành công!'
,
{
theme
:
'colored'
,
})
}
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
}
else
{
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
toast
.
warn
(
'Đơn giá không đúng định dạng'
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -136,8 +147,6 @@ const SimpleForm = (props) => {
...
@@ -136,8 +147,6 @@ const SimpleForm = (props) => {
type
=
"text"
type
=
"text"
name
=
"price"
name
=
"price"
value
=
{
toPriceVndInput
(
price
)
||
''
}
value
=
{
toPriceVndInput
(
price
)
||
''
}
validators
=
{[
'isNumber'
]}
errorMessages
=
{[
'Trường này phải nhập số '
]}
/
>
/
>
<
/Grid
>
<
/Grid
>
<
Grid
row
container
item
xs
=
{
12
}
sm
=
{
12
}
>
<
Grid
row
container
item
xs
=
{
12
}
sm
=
{
12
}
>
...
...
src/app/views/landingpage/package/Update.js
View file @
a18e4537
...
@@ -61,22 +61,33 @@ const SimpleForm = (props) => {
...
@@ -61,22 +61,33 @@ const SimpleForm = (props) => {
const
handleSubmit
=
async
(
event
)
=>
{
const
handleSubmit
=
async
(
event
)
=>
{
const
newValue
=
trimObject
(
state
)
const
newValue
=
trimObject
(
state
)
props
.
showLoading
()
const
res
=
await
updatePackage
({
if
(
...
newValue
,
isNumeric
(
newValue
.
price
)
||
func_id_add
:
listChecked
,
newValue
.
price
==
''
||
price
:
newValue
.
price
!=
''
?
null
:
newValue
.
price
,
!
newValue
.
price
})
)
{
props
.
hideLoading
()
props
.
showLoading
()
if
(
res
.
data
.
code
==
200
)
{
const
res
=
await
updatePackage
({
history
.
push
(
'/package'
)
...
newValue
,
func_id_add
:
listChecked
,
price
:
newValue
.
price
!=
''
?
newValue
.
price
:
null
,
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
toast
.
success
(
'Cập nhật gói thành công!'
,
{
history
.
push
(
'/package'
)
if
(
res
.
data
.
code
==
200
)
{
toast
.
success
(
'Cập nhật gói thành công!'
,
{
theme
:
'colored'
,
})
}
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
}
else
{
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
toast
.
warn
(
'Đơn giá không đúng định dạng'
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -157,8 +168,6 @@ const SimpleForm = (props) => {
...
@@ -157,8 +168,6 @@ const SimpleForm = (props) => {
type
=
"text"
type
=
"text"
name
=
"price"
name
=
"price"
value
=
{
toPriceVndInput
(
price
)
||
''
}
value
=
{
toPriceVndInput
(
price
)
||
''
}
validators
=
{[
'isNumber'
]}
errorMessages
=
{[
'Trường này phải nhập số '
]}
/
>
/
>
<
/Grid
>
<
/Grid
>
<
Grid
row
container
item
xs
=
{
12
}
sm
=
{
12
}
>
<
Grid
row
container
item
xs
=
{
12
}
sm
=
{
12
}
>
...
...
src/app/views/landingpage/priceProduct/Create.js
View file @
a18e4537
...
@@ -57,21 +57,32 @@ const SimpleForm = (props) => {
...
@@ -57,21 +57,32 @@ const SimpleForm = (props) => {
const
history
=
useHistory
()
const
history
=
useHistory
()
const
handleSubmit
=
async
(
event
)
=>
{
const
handleSubmit
=
async
(
event
)
=>
{
const
newValue
=
trimObject
(
state
)
const
newValue
=
trimObject
(
state
)
props
.
showLoading
()
if
(
const
res
=
await
createPriceProduct
({
isNumeric
(
newValue
.
price
)
||
...
newValue
,
newValue
.
price
==
''
||
status
:
1
,
!
newValue
.
price
})
)
{
props
.
hideLoading
()
props
.
showLoading
()
if
(
res
.
data
.
code
==
200
)
{
const
res
=
await
createPriceProduct
({
history
.
push
(
'/price-product'
)
...
newValue
,
status
:
1
,
price
:
newValue
.
price
!=
''
?
newValue
.
price
:
null
,
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
toast
.
success
(
'Tạo sản phẩm thành công!'
,
{
history
.
push
(
'/price-product'
)
if
(
res
.
data
.
code
==
200
)
{
toast
.
success
(
'Tạo sản phẩm thành công!'
,
{
theme
:
'colored'
,
})
}
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
}
else
{
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
toast
.
warn
(
'Đơn giá không đúng định dạng'
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -158,15 +169,11 @@ const SimpleForm = (props) => {
...
@@ -158,15 +169,11 @@ const SimpleForm = (props) => {
<
TextValidator
<
TextValidator
variant
=
"outlined"
variant
=
"outlined"
className
=
"mb-4 w-full"
className
=
"mb-4 w-full"
label
=
"Đơn giá
*
"
label
=
"Đơn giá"
onChange
=
{
handleChange
}
onChange
=
{
handleChange
}
name
=
"price"
name
=
"price"
type
=
"text"
type
=
"text"
value
=
{
toPriceVndInput
(
price
)
||
''
}
value
=
{
toPriceVndInput
(
price
)
||
''
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
]}
/
>
/
>
<
/Grid
>
<
/Grid
>
<
Grid
xs
=
{
6
}
sm
=
{
6
}
item
>
<
Grid
xs
=
{
6
}
sm
=
{
6
}
item
>
...
...
src/app/views/landingpage/priceProduct/Index.js
View file @
a18e4537
...
@@ -66,13 +66,13 @@ const ToolNotificate = (props) => {
...
@@ -66,13 +66,13 @@ const ToolNotificate = (props) => {
if
(
isInit
)
{
if
(
isInit
)
{
setPageIndex
(
0
)
setPageIndex
(
0
)
res
=
await
getListPriceProduct
({
res
=
await
getListPriceProduct
({
func
_name
:
searchDebount
,
cons
_name
:
searchDebount
,
page_no
:
0
,
page_no
:
0
,
page_size
:
pageSize
,
page_size
:
pageSize
,
})
})
}
else
{
}
else
{
res
=
await
getListPriceProduct
({
res
=
await
getListPriceProduct
({
func
_name
:
searchDebount
,
cons
_name
:
searchDebount
,
page_no
:
pageIndex
+
1
,
page_no
:
pageIndex
+
1
,
page_size
:
pageSize
,
page_size
:
pageSize
,
})
})
...
...
src/app/views/landingpage/priceProduct/Update.js
View file @
a18e4537
...
@@ -14,7 +14,7 @@ import { showLoading, hideLoading } from 'app/redux/actions/loadingAction'
...
@@ -14,7 +14,7 @@ import { showLoading, hideLoading } from 'app/redux/actions/loadingAction'
import
{
toast
}
from
'react-toastify'
import
{
toast
}
from
'react-toastify'
import
{
Breadcrumb
,
SimpleCard
}
from
'app/components'
import
{
Breadcrumb
,
SimpleCard
}
from
'app/components'
import
{
Link
,
useHistory
,
useLocation
}
from
'react-router-dom'
import
{
Link
,
useHistory
,
useLocation
}
from
'react-router-dom'
import
{
trimObject
,
toPriceVndInput
}
from
'app/config/Function'
import
{
trimObject
,
toPriceVndInput
,
isNumeric
}
from
'app/config/Function'
import
{
connect
}
from
'react-redux'
import
{
connect
}
from
'react-redux'
import
localStorageService
from
'app/services/localStorageService'
import
localStorageService
from
'app/services/localStorageService'
import
{
useTranslation
}
from
'react-i18next'
import
{
useTranslation
}
from
'react-i18next'
...
@@ -77,19 +77,30 @@ const SimpleForm = (props) => {
...
@@ -77,19 +77,30 @@ const SimpleForm = (props) => {
const
handleSubmit
=
async
(
event
)
=>
{
const
handleSubmit
=
async
(
event
)
=>
{
const
newValue
=
trimObject
(
state
)
const
newValue
=
trimObject
(
state
)
props
.
showLoading
()
props
.
showLoading
()
const
res
=
await
updatePriceProduct
({
if
(
...
newValue
,
isNumeric
(
newValue
.
price
)
||
})
newValue
.
price
==
''
||
props
.
hideLoading
()
!
newValue
.
price
if
(
res
.
data
.
code
==
200
)
{
)
{
history
.
push
(
'/price-product'
)
const
res
=
await
updatePriceProduct
({
...
newValue
,
price
:
newValue
.
price
!=
''
?
newValue
.
price
:
null
,
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
toast
.
success
(
'Cập nhật sản phẩm thành công!'
,
{
history
.
push
(
'/price-product'
)
if
(
res
.
data
.
code
==
200
)
{
toast
.
success
(
'Cập nhật sản phẩm thành công!'
,
{
theme
:
'colored'
,
})
}
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
}
else
{
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
)
,
{
toast
.
warn
(
'Đơn giá không đúng định dạng'
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -159,7 +170,7 @@ const SimpleForm = (props) => {
...
@@ -159,7 +170,7 @@ const SimpleForm = (props) => {
<
TextValidator
<
TextValidator
variant
=
"outlined"
variant
=
"outlined"
className
=
"mb-4 w-full"
className
=
"mb-4 w-full"
label
=
"Đơn vị tính
*
"
label
=
"Đơn vị tính"
onChange
=
{
handleChange
}
onChange
=
{
handleChange
}
type
=
"text"
type
=
"text"
name
=
"unit"
name
=
"unit"
...
@@ -175,15 +186,11 @@ const SimpleForm = (props) => {
...
@@ -175,15 +186,11 @@ const SimpleForm = (props) => {
<
TextValidator
<
TextValidator
variant
=
"outlined"
variant
=
"outlined"
className
=
"mb-4 w-full"
className
=
"mb-4 w-full"
label
=
"Đơn giá
*
"
label
=
"Đơn giá"
onChange
=
{
handleChange
}
onChange
=
{
handleChange
}
name
=
"price"
name
=
"price"
type
=
"text"
type
=
"text"
value
=
{
toPriceVndInput
(
price
)
||
''
}
value
=
{
toPriceVndInput
(
price
)
||
''
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
]}
/
>
/
>
<
/Grid
>
<
/Grid
>
{
type_caculator
&&
(
{
type_caculator
&&
(
...
...
src/app/views/landingpage/register/View.js
View file @
a18e4537
...
@@ -75,16 +75,6 @@ function CustomerView(props) {
...
@@ -75,16 +75,6 @@ function CustomerView(props) {
}}
}}
/
>
/
>
<
/Grid
>
<
/Grid
>
{
checkRole
(
user
,
'/package-function/create'
)
?
(
<
Link
to
=
"/package-function/create"
>
<
Button
variant
=
"contained"
className
=
{
'bg-light-primary'
}
>
<
span
className
=
{
'text-primary'
}
>
Th
ê
m
m
ớ
i
<
/span
>
<
/Button
>
<
/Link
>
)
:
null
}
<
/Grid
>
<
/Grid
>
<
Table
<
Table
...
...
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