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
691ab984
Commit
691ab984
authored
Sep 09, 2024
by
tdgiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update code
parent
1fd34b93
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
111 additions
and
26 deletions
+111
-26
url.js
src/app/apis/url.js
+12
-6
Update.js
src/app/views/Merchant/Update.js
+1
-0
Create.js
src/app/views/Ncc/Create.js
+45
-7
Index.js
src/app/views/Ncc/Index.js
+4
-4
Table.js
src/app/views/Ncc/Table.js
+3
-3
Update.js
src/app/views/Ncc/Update.js
+46
-6
No files found.
src/app/apis/url.js
View file @
691ab984
...
@@ -105,12 +105,18 @@ export default {
...
@@ -105,12 +105,18 @@ export default {
changeStatusInvoiceSupp
:
`
${
root
}
/supplierInvoice/changeStatus`
,
changeStatusInvoiceSupp
:
`
${
root
}
/supplierInvoice/changeStatus`
,
//supplier
//supplier
urlGetListSupplier
:
`
${
root
}
/supplierconstruction/paging`
,
// urlGetListSupplier: `${root}/supplierconstruction/paging`,
urlCreateSupplier
:
`
${
root
}
/supplierconstruction/create`
,
// urlCreateSupplier: `${root}/supplierconstruction/create`,
urlUpdateSupplier
:
`
${
root
}
/supplierconstruction/update`
,
// urlUpdateSupplier: `${root}/supplierconstruction/update`,
urlDeleteSupplier
:
`
${
root
}
/supplierconstruction/delete`
,
// urlDeleteSupplier: `${root}/supplierconstruction/delete`,
urlDetailSupplier
:
`
${
root
}
/supplierconstruction`
,
// urlDetailSupplier: `${root}/supplierconstruction`,
changeStatusSupplier
:
`
${
root
}
/supplierconstruction/changeStatus`
,
// changeStatusSupplier: `${root}/supplierconstruction/changeStatus`,
urlGetListSupplier
:
`
${
root
}
/provider/paging`
,
urlCreateSupplier
:
`
${
root
}
/provider/create`
,
urlUpdateSupplier
:
`
${
root
}
/provider/update`
,
urlDeleteSupplier
:
`
${
root
}
/provider/delete`
,
urlDetailSupplier
:
`
${
root
}
/provider`
,
changeStatusSupplier
:
`
${
root
}
/provider/changeStatus`
,
//Log
//Log
logAuth
:
`
${
root
}
/logging/listLogin`
,
logAuth
:
`
${
root
}
/logging/listLogin`
,
...
...
src/app/views/Merchant/Update.js
View file @
691ab984
...
@@ -99,6 +99,7 @@ const SimpleForm = (props) => {
...
@@ -99,6 +99,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)
} else if (res.data.code == 401) {
} else if (res.data.code == 401) {
setTimeout(() => {
setTimeout(() => {
history.push('/')
history.push('/')
...
...
src/app/views/Ncc/Create.js
View file @
691ab984
...
@@ -39,8 +39,6 @@ const SimpleForm = (props) => {
...
@@ -39,8 +39,6 @@ const SimpleForm = (props) => {
const
{
t
}
=
useTranslation
()
const
{
t
}
=
useTranslation
()
console
.
log
(
'user'
,
user
)
const
history
=
useHistory
()
const
history
=
useHistory
()
const
handleSubmit
=
async
(
event
)
=>
{
const
handleSubmit
=
async
(
event
)
=>
{
...
@@ -48,6 +46,7 @@ const SimpleForm = (props) => {
...
@@ -48,6 +46,7 @@ const SimpleForm = (props) => {
props
.
showLoading
()
props
.
showLoading
()
const
res
=
await
createSupplier
({
const
res
=
await
createSupplier
({
...
newValue
,
...
newValue
,
type
:
parseInt
(
newValue
?.
type
),
status
:
1
,
status
:
1
,
})
})
console
.
log
(
res
)
console
.
log
(
res
)
...
@@ -74,7 +73,7 @@ const SimpleForm = (props) => {
...
@@ -74,7 +73,7 @@ const SimpleForm = (props) => {
})
})
}
}
const
{
supp_code
,
supp_name
,
phone
,
email
,
address
}
=
state
const
{
provider_code
,
provider_name
,
phone
,
email
,
address
,
type
}
=
state
return
(
return
(
<
div
className
=
"m-sm-30"
>
<
div
className
=
"m-sm-30"
>
<
div
className
=
"mb-sm-30"
>
<
div
className
=
"mb-sm-30"
>
...
@@ -92,6 +91,45 @@ const SimpleForm = (props) => {
...
@@ -92,6 +91,45 @@ const SimpleForm = (props) => {
<
SimpleCard
>
<
SimpleCard
>
<
ValidatorForm
onSubmit
=
{
handleSubmit
}
onError
=
{()
=>
null
}
>
<
ValidatorForm
onSubmit
=
{
handleSubmit
}
onError
=
{()
=>
null
}
>
<
Grid
container
spacing
=
{
3
}
>
<
Grid
container
spacing
=
{
3
}
>
<
Grid
xs
=
{
6
}
sm
=
{
6
}
item
>
<
SelectValidator
variant
=
{
'outlined'
}
label
=
{
'Loại nhà cung cấp *'
}
className
=
"mb-4 w-full"
value
=
{
type
||
''
}
displayEmpty
name
=
"type"
onChange
=
{
handleChange
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
]}
>
{[
{
id
:
'0'
,
name
:
'Cổng thanh toán'
,
},
{
id
:
'1'
,
name
:
'Hoá đơn'
,
},
{
id
:
'2'
,
name
:
'Nhiên liệu'
,
},
{
id
:
'3'
,
name
:
'Thiết bị'
,
},
].
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
))}
<
/SelectValidator
>
<
/Grid
>
<
Grid
item
lg
=
{
6
}
md
=
{
6
}
sm
=
{
12
}
xs
=
{
12
}
>
<
Grid
item
lg
=
{
6
}
md
=
{
6
}
sm
=
{
12
}
xs
=
{
12
}
>
<
TextValidator
<
TextValidator
variant
=
"outlined"
variant
=
"outlined"
...
@@ -99,8 +137,8 @@ const SimpleForm = (props) => {
...
@@ -99,8 +137,8 @@ const SimpleForm = (props) => {
label
=
"Mã nhà cung cấp *"
label
=
"Mã nhà cung cấp *"
onChange
=
{
handleChange
}
onChange
=
{
handleChange
}
type
=
"text"
type
=
"text"
name
=
"
supp
_code"
name
=
"
provider
_code"
value
=
{
supp
_code
||
''
}
value
=
{
provider
_code
||
''
}
validators
=
{[
'required'
]}
validators
=
{[
'required'
]}
errorMessages
=
{[
errorMessages
=
{[
'Không được để trống trường này'
,
'Không được để trống trường này'
,
...
@@ -114,8 +152,8 @@ const SimpleForm = (props) => {
...
@@ -114,8 +152,8 @@ const SimpleForm = (props) => {
label
=
"Tên nhà cung cấp *"
label
=
"Tên nhà cung cấp *"
onChange
=
{
handleChange
}
onChange
=
{
handleChange
}
type
=
"text"
type
=
"text"
name
=
"
supp
_name"
name
=
"
provider
_name"
value
=
{
supp
_name
||
''
}
value
=
{
provider
_name
||
''
}
validators
=
{[
'required'
]}
validators
=
{[
'required'
]}
errorMessages
=
{[
errorMessages
=
{[
'Không được để trống trường này'
,
'Không được để trống trường này'
,
...
...
src/app/views/Ncc/Index.js
View file @
691ab984
...
@@ -31,9 +31,9 @@ const ToolNotificate = (props) => {
...
@@ -31,9 +31,9 @@ const ToolNotificate = (props) => {
const
[
data
,
setData
]
=
useState
([])
const
[
data
,
setData
]
=
useState
([])
const
handeChangeActive
=
async
(
id
Guid
,
status_id
)
=>
{
const
handeChangeActive
=
async
(
id
,
status_id
)
=>
{
props
.
showLoading
()
props
.
showLoading
()
const
res
=
await
changeStatusSupplier
({
id
Guid
,
status_id
})
const
res
=
await
changeStatusSupplier
({
id
,
status_id
})
props
.
hideLoading
()
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
getData
()
getData
()
...
@@ -92,9 +92,9 @@ const ToolNotificate = (props) => {
...
@@ -92,9 +92,9 @@ const ToolNotificate = (props) => {
getData
(
true
)
getData
(
true
)
},
[
searchDebount
,
status
,
store
,
group
])
},
[
searchDebount
,
status
,
store
,
group
])
const
removeItem
=
async
(
id
Guid
)
=>
{
const
removeItem
=
async
(
id
)
=>
{
props
.
showLoading
()
props
.
showLoading
()
const
res
=
await
deleteSupplier
({
id
Guid
})
const
res
=
await
deleteSupplier
({
id
})
props
.
hideLoading
()
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
getData
(
true
)
getData
(
true
)
...
...
src/app/views/Ncc/Table.js
View file @
691ab984
...
@@ -38,14 +38,14 @@ const columns = [
...
@@ -38,14 +38,14 @@ const columns = [
minWidth
:
50
,
minWidth
:
50
,
},
},
{
{
id
:
'
supp
_code'
,
id
:
'
provider
_code'
,
label
:
'Mã nhà cung cấp'
,
label
:
'Mã nhà cung cấp'
,
align
:
'center'
,
align
:
'center'
,
minWidth
:
150
,
minWidth
:
150
,
},
},
{
{
id
:
'
supp
_name'
,
id
:
'
provider
_name'
,
label
:
'Tên nhà cung cấp'
,
label
:
'Tên nhà cung cấp'
,
align
:
'left'
,
align
:
'left'
,
minWidth
:
200
,
minWidth
:
200
,
...
@@ -208,7 +208,7 @@ function TableList(props) {
...
@@ -208,7 +208,7 @@ function TableList(props) {
setSelected
({
setSelected
({
...
row
,
...
row
,
title
:
'Xóa NCC'
,
title
:
'Xóa NCC'
,
content
:
`Bạn có muốn xóa NCC thiết bị
${
row
.
supp
_name
}
hay không?`
,
content
:
`Bạn có muốn xóa NCC thiết bị
${
row
.
provider
_name
}
hay không?`
,
})
})
setOpen
(
true
)
setOpen
(
true
)
}}
}}
...
...
src/app/views/Ncc/Update.js
View file @
691ab984
...
@@ -45,7 +45,7 @@ const SimpleForm = (props) => {
...
@@ -45,7 +45,7 @@ const SimpleForm = (props) => {
props
.
showLoading
()
props
.
showLoading
()
try
{
try
{
const
res
=
await
detailSupplier
(
location
.
state
,
{})
const
res
=
await
detailSupplier
(
location
.
state
,
{})
setState
(
res
.
data
.
data
)
setState
(
{
...
res
.
data
.
data
,
type
:
`
${
res
.
data
.
data
.
type
}
`
}
)
}
catch
(
err
)
{
}
catch
(
err
)
{
toast
.
error
(
t
(
err
),
{
toast
.
error
(
t
(
err
),
{
theme
:
'colored'
,
theme
:
'colored'
,
...
@@ -60,6 +60,7 @@ const SimpleForm = (props) => {
...
@@ -60,6 +60,7 @@ const SimpleForm = (props) => {
props
.
showLoading
()
props
.
showLoading
()
const
res
=
await
updateSupplier
({
const
res
=
await
updateSupplier
({
...
newValue
,
...
newValue
,
type
:
parseInt
(
newValue
?.
type
),
})
})
console
.
log
(
res
)
console
.
log
(
res
)
props
.
hideLoading
()
props
.
hideLoading
()
...
@@ -85,7 +86,7 @@ const SimpleForm = (props) => {
...
@@ -85,7 +86,7 @@ const SimpleForm = (props) => {
})
})
}
}
const
{
supp_code
,
supp_name
,
phone
,
email
,
address
}
=
state
const
{
provider_code
,
provider_name
,
phone
,
email
,
address
,
type
}
=
state
return
(
return
(
<
div
className
=
"m-sm-30"
>
<
div
className
=
"m-sm-30"
>
<
div
className
=
"mb-sm-30"
>
<
div
className
=
"mb-sm-30"
>
...
@@ -103,6 +104,45 @@ const SimpleForm = (props) => {
...
@@ -103,6 +104,45 @@ const SimpleForm = (props) => {
<
SimpleCard
>
<
SimpleCard
>
<
ValidatorForm
onSubmit
=
{
handleSubmit
}
onError
=
{()
=>
null
}
>
<
ValidatorForm
onSubmit
=
{
handleSubmit
}
onError
=
{()
=>
null
}
>
<
Grid
container
spacing
=
{
3
}
>
<
Grid
container
spacing
=
{
3
}
>
<
Grid
xs
=
{
6
}
sm
=
{
6
}
item
>
<
SelectValidator
variant
=
{
'outlined'
}
label
=
{
'Loại nhà cung cấp *'
}
className
=
"mb-4 w-full"
value
=
{
type
||
''
}
displayEmpty
name
=
"type"
onChange
=
{
handleChange
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
]}
>
{[
{
id
:
'0'
,
name
:
'Cổng thanh toán'
,
},
{
id
:
'1'
,
name
:
'Hoá đơn'
,
},
{
id
:
'2'
,
name
:
'Nhiên liệu'
,
},
{
id
:
'3'
,
name
:
'Thiết bị'
,
},
].
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
))}
<
/SelectValidator
>
<
/Grid
>
<
Grid
item
lg
=
{
6
}
md
=
{
6
}
sm
=
{
12
}
xs
=
{
12
}
>
<
Grid
item
lg
=
{
6
}
md
=
{
6
}
sm
=
{
12
}
xs
=
{
12
}
>
<
TextValidator
<
TextValidator
variant
=
"outlined"
variant
=
"outlined"
...
@@ -110,9 +150,9 @@ const SimpleForm = (props) => {
...
@@ -110,9 +150,9 @@ const SimpleForm = (props) => {
label
=
"Mã nhà cung cấp *"
label
=
"Mã nhà cung cấp *"
onChange
=
{
handleChange
}
onChange
=
{
handleChange
}
type
=
"text"
type
=
"text"
name
=
"
supp
_code"
name
=
"
provider
_code"
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
supp
_code
||
''
}
value
=
{
provider
_code
||
''
}
validators
=
{[
'required'
]}
validators
=
{[
'required'
]}
errorMessages
=
{[
errorMessages
=
{[
'Không được để trống trường này'
,
'Không được để trống trường này'
,
...
@@ -126,8 +166,8 @@ const SimpleForm = (props) => {
...
@@ -126,8 +166,8 @@ const SimpleForm = (props) => {
label
=
"Tên nhà cung cấp *"
label
=
"Tên nhà cung cấp *"
onChange
=
{
handleChange
}
onChange
=
{
handleChange
}
type
=
"text"
type
=
"text"
name
=
"
supp
_name"
name
=
"
provider
_name"
value
=
{
supp
_name
||
''
}
value
=
{
provider
_name
||
''
}
validators
=
{[
'required'
]}
validators
=
{[
'required'
]}
errorMessages
=
{[
errorMessages
=
{[
'Không được để trống trường này'
,
'Không được để trống trường này'
,
...
...
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