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
Hide 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 {
changeStatusInvoiceSupp
:
`
${
root
}
/supplierInvoice/changeStatus`
,
//supplier
urlGetListSupplier
:
`
${
root
}
/supplierconstruction/paging`
,
urlCreateSupplier
:
`
${
root
}
/supplierconstruction/create`
,
urlUpdateSupplier
:
`
${
root
}
/supplierconstruction/update`
,
urlDeleteSupplier
:
`
${
root
}
/supplierconstruction/delete`
,
urlDetailSupplier
:
`
${
root
}
/supplierconstruction`
,
changeStatusSupplier
:
`
${
root
}
/supplierconstruction/changeStatus`
,
// urlGetListSupplier: `${root}/supplierconstruction/paging`,
// urlCreateSupplier: `${root}/supplierconstruction/create`,
// urlUpdateSupplier: `${root}/supplierconstruction/update`,
// urlDeleteSupplier: `${root}/supplierconstruction/delete`,
// urlDetailSupplier: `${root}/supplierconstruction`,
// 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
logAuth
:
`
${
root
}
/logging/listLogin`
,
...
...
src/app/views/Merchant/Update.js
View file @
691ab984
...
...
@@ -99,6 +99,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)
} else if (res.data.code == 401) {
setTimeout(() => {
history.push('/')
...
...
src/app/views/Ncc/Create.js
View file @
691ab984
...
...
@@ -39,8 +39,6 @@ const SimpleForm = (props) => {
const
{
t
}
=
useTranslation
()
console
.
log
(
'user'
,
user
)
const
history
=
useHistory
()
const
handleSubmit
=
async
(
event
)
=>
{
...
...
@@ -48,6 +46,7 @@ const SimpleForm = (props) => {
props
.
showLoading
()
const
res
=
await
createSupplier
({
...
newValue
,
type
:
parseInt
(
newValue
?.
type
),
status
:
1
,
})
console
.
log
(
res
)
...
...
@@ -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
(
<
div
className
=
"m-sm-30"
>
<
div
className
=
"mb-sm-30"
>
...
...
@@ -92,6 +91,45 @@ const SimpleForm = (props) => {
<
SimpleCard
>
<
ValidatorForm
onSubmit
=
{
handleSubmit
}
onError
=
{()
=>
null
}
>
<
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
}
>
<
TextValidator
variant
=
"outlined"
...
...
@@ -99,8 +137,8 @@ const SimpleForm = (props) => {
label
=
"Mã nhà cung cấp *"
onChange
=
{
handleChange
}
type
=
"text"
name
=
"
supp
_code"
value
=
{
supp
_code
||
''
}
name
=
"
provider
_code"
value
=
{
provider
_code
||
''
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
...
...
@@ -114,8 +152,8 @@ const SimpleForm = (props) => {
label
=
"Tên nhà cung cấp *"
onChange
=
{
handleChange
}
type
=
"text"
name
=
"
supp
_name"
value
=
{
supp
_name
||
''
}
name
=
"
provider
_name"
value
=
{
provider
_name
||
''
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'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) => {
const
[
data
,
setData
]
=
useState
([])
const
handeChangeActive
=
async
(
id
Guid
,
status_id
)
=>
{
const
handeChangeActive
=
async
(
id
,
status_id
)
=>
{
props
.
showLoading
()
const
res
=
await
changeStatusSupplier
({
id
Guid
,
status_id
})
const
res
=
await
changeStatusSupplier
({
id
,
status_id
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
getData
()
...
...
@@ -92,9 +92,9 @@ const ToolNotificate = (props) => {
getData
(
true
)
},
[
searchDebount
,
status
,
store
,
group
])
const
removeItem
=
async
(
id
Guid
)
=>
{
const
removeItem
=
async
(
id
)
=>
{
props
.
showLoading
()
const
res
=
await
deleteSupplier
({
id
Guid
})
const
res
=
await
deleteSupplier
({
id
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
getData
(
true
)
...
...
src/app/views/Ncc/Table.js
View file @
691ab984
...
...
@@ -38,14 +38,14 @@ const columns = [
minWidth
:
50
,
},
{
id
:
'
supp
_code'
,
id
:
'
provider
_code'
,
label
:
'Mã nhà cung cấp'
,
align
:
'center'
,
minWidth
:
150
,
},
{
id
:
'
supp
_name'
,
id
:
'
provider
_name'
,
label
:
'Tên nhà cung cấp'
,
align
:
'left'
,
minWidth
:
200
,
...
...
@@ -208,7 +208,7 @@ function TableList(props) {
setSelected
({
...
row
,
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
)
}}
...
...
src/app/views/Ncc/Update.js
View file @
691ab984
...
...
@@ -45,7 +45,7 @@ const SimpleForm = (props) => {
props
.
showLoading
()
try
{
const
res
=
await
detailSupplier
(
location
.
state
,
{})
setState
(
res
.
data
.
data
)
setState
(
{
...
res
.
data
.
data
,
type
:
`
${
res
.
data
.
data
.
type
}
`
}
)
}
catch
(
err
)
{
toast
.
error
(
t
(
err
),
{
theme
:
'colored'
,
...
...
@@ -60,6 +60,7 @@ const SimpleForm = (props) => {
props
.
showLoading
()
const
res
=
await
updateSupplier
({
...
newValue
,
type
:
parseInt
(
newValue
?.
type
),
})
console
.
log
(
res
)
props
.
hideLoading
()
...
...
@@ -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
(
<
div
className
=
"m-sm-30"
>
<
div
className
=
"mb-sm-30"
>
...
...
@@ -103,6 +104,45 @@ const SimpleForm = (props) => {
<
SimpleCard
>
<
ValidatorForm
onSubmit
=
{
handleSubmit
}
onError
=
{()
=>
null
}
>
<
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
}
>
<
TextValidator
variant
=
"outlined"
...
...
@@ -110,9 +150,9 @@ const SimpleForm = (props) => {
label
=
"Mã nhà cung cấp *"
onChange
=
{
handleChange
}
type
=
"text"
name
=
"
supp
_code"
name
=
"
provider
_code"
disabled
=
{
true
}
value
=
{
supp
_code
||
''
}
value
=
{
provider
_code
||
''
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
...
...
@@ -126,8 +166,8 @@ const SimpleForm = (props) => {
label
=
"Tên nhà cung cấp *"
onChange
=
{
handleChange
}
type
=
"text"
name
=
"
supp
_name"
value
=
{
supp
_name
||
''
}
name
=
"
provider
_name"
value
=
{
provider
_name
||
''
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'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