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
6dc92ec6
Commit
6dc92ec6
authored
Oct 02, 2024
by
tdgiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
8814a3d1
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
247 additions
and
165 deletions
+247
-165
dropdown.js
src/app/apis/Functions/dropdown.js
+10
-0
url.js
src/app/apis/url.js
+2
-0
AuthGuard.jsx
src/app/auth/AuthGuard.jsx
+59
-64
detail.js
src/app/views/PaymentSupplier/detail.js
+12
-12
Index.js
src/app/views/Reconciliation/ListTrans/Index.js
+2
-5
Table.js
src/app/views/Reconciliation/ListTrans/Table.js
+4
-4
Index.js
src/app/views/Reconciliation/Setting/Index.js
+6
-3
Update.js
src/app/views/Reconciliation/Setting/Update.js
+17
-13
View.js
src/app/views/Reconciliation/Setting/View.js
+39
-8
Detail.js
src/app/views/Reconciliation/Sheet/Detail.js
+1
-17
Dialog.js
src/app/views/Reconciliation/Sheet/Dialog/Dialog.js
+8
-2
Index.js
src/app/views/Reconciliation/Sheet/Dialog/Index.js
+42
-3
View.js
src/app/views/Reconciliation/Sheet/Dialog/View.js
+26
-14
Index.js
src/app/views/Reconciliation/Sheet/Index.js
+2
-2
Index.js
src/app/views/Reconciliation/Sheet/ListTrans/Index.js
+1
-0
Table.js
src/app/views/Reconciliation/Sheet/ListTrans/Table.js
+1
-1
View.js
src/app/views/Reconciliation/Sheet/ListTrans/View.js
+2
-0
Table.js
src/app/views/Reconciliation/Sheet/Table.js
+1
-1
Update.js
src/app/views/Reconciliation/Sheet/Update.js
+2
-6
View.js
src/app/views/Reconciliation/Sheet/View.js
+10
-10
No files found.
src/app/apis/Functions/dropdown.js
View file @
6dc92ec6
...
@@ -104,3 +104,13 @@ export const dropdownListPayType = async (body) =>
...
@@ -104,3 +104,13 @@ export const dropdownListPayType = async (body) =>
GetData
(
url
.
dropdownListPayType
,
body
)
GetData
(
url
.
dropdownListPayType
,
body
)
.
then
((
res
)
=>
res
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
.
catch
((
err
)
=>
null
)
export
const
dropdownStoreNew
=
async
(
id
)
=>
GetData
(
`
${
url
.
dropdownStore
}
`
,
{})
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
dropdownPaymentType
=
async
(
body
)
=>
GetData
(
url
.
dropdownPaymentType
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
src/app/apis/url.js
View file @
6dc92ec6
...
@@ -192,4 +192,6 @@ export default {
...
@@ -192,4 +192,6 @@ export default {
dropdownStoreStatus
:
`
${
root
}
/dropdown/getlistStoreStatus`
,
dropdownStoreStatus
:
`
${
root
}
/dropdown/getlistStoreStatus`
,
dropdownProvider
:
`
${
root
}
/dropdown/Provider`
,
dropdownProvider
:
`
${
root
}
/dropdown/Provider`
,
dropdownListPayType
:
`
${
root
}
/dropdown/getListPayType`
,
dropdownListPayType
:
`
${
root
}
/dropdown/getListPayType`
,
dropdownPaymentType
:
`
${
root
}
/dropdown/paymentType`
,
}
}
src/app/auth/AuthGuard.jsx
View file @
6dc92ec6
import
React
,
{
import
React
,
{
useContext
,
useEffect
,
useState
}
from
'react'
useContext
,
useEffect
,
useState
,
}
from
'react'
import
{
Redirect
,
useLocation
}
from
'react-router-dom'
import
{
Redirect
,
useLocation
}
from
'react-router-dom'
import
AppContext
from
"../contexts/AppContext"
;
import
AppContext
from
'../contexts/AppContext'
import
useAuth
from
'app/hooks/useAuth'
import
useAuth
from
'app/hooks/useAuth'
import
{
makeStyles
,
useTheme
}
from
"@material-ui/core/styles"
;
import
{
makeStyles
,
useTheme
}
from
'@material-ui/core/styles'
import
{
import
KEY
from
'app/assets/Key'
Backdrop
,
import
localStorageService
from
'app/services/localStorageService'
CircularProgress
,
}
from
"@material-ui/core"
;
import
{
connect
}
from
"react-redux"
;
const
useStyles
=
makeStyles
((
theme
)
=>
({
import
{
Backdrop
,
CircularProgress
}
from
'@material-ui/core'
import
{
connect
}
from
'react-redux'
const
useStyles
=
makeStyles
((
theme
)
=>
({
backdrop
:
{
backdrop
:
{
zIndex
:
theme
.
zIndex
.
drawer
+
1
,
zIndex
:
theme
.
zIndex
.
drawer
+
1
,
color
:
"#fff"
,
color
:
'#fff'
,
},
},
}));
}))
const
getUserRoleAuthStatus
=
(
pathname
,
user
)
=>
{
const
getUserRoleAuthStatus
=
(
pathname
,
user
)
=>
{
const
token
=
localStorageService
.
getItem
(
KEY
.
API_TOKEN
)
//return true
if
(
token
)
{
if
(
pathname
===
'/dashboard/default'
||
pathname
===
'/'
||
pathname
==
"/dashboard"
||
pathname
==
"/my-profile"
||
pathname
==
"/change-password"
)
//return true
return
true
if
(
pathname
===
'/dashboard/default'
||
pathname
===
'/'
||
pathname
==
'/dashboard'
||
pathname
==
'/my-profile'
||
pathname
==
'/change-password'
)
return
true
if
(
user
){
if
(
user
)
{
if
(
user
.
is_sysadmin
){
if
(
user
.
is_sysadmin
)
{
return
true
return
true
}
else
{
}
else
{
let
flag
=
false
let
flag
=
false
;
user
.
listPath
.
map
((
e
)
=>
{
user
.
listPath
.
map
(
e
=>
{
if
(
e
==
pathname
)
flag
=
true
if
(
e
==
pathname
)
})
flag
=
true
return
flag
}
})
}
return
flag
return
false
}
else
{
return
false
}
}
}
}
return
false
};
const
AuthGuard
=
({
children
,
modalLoading
})
=>
{
const
AuthGuard
=
({
children
,
modalLoading
})
=>
{
const
classes
=
useStyles
();
const
classes
=
useStyles
()
const
{
const
{
isAuthenticated
,
user
}
=
useAuth
()
isAuthenticated
,
user
}
=
useAuth
()
const
[
previouseRoute
,
setPreviousRoute
]
=
useState
(
null
)
const
[
previouseRoute
,
setPreviousRoute
]
=
useState
(
null
)
const
{
pathname
}
=
useLocation
()
const
{
pathname
}
=
useLocation
()
const
isUserRoleAuthenticated
=
getUserRoleAuthStatus
(
pathname
,
user
)
;
const
isUserRoleAuthenticated
=
getUserRoleAuthStatus
(
pathname
,
user
)
let
authenticated
=
isAuthenticated
&&
isUserRoleAuthenticated
;
let
authenticated
=
isAuthenticated
&&
isUserRoleAuthenticated
// IF YOU NEED ROLE BASED AUTHENTICATION,
// IF YOU NEED ROLE BASED AUTHENTICATION,
// UNCOMMENT ABOVE TWO LINES, getUserRoleAuthStatus METHOD AND user VARIABLE
// UNCOMMENT ABOVE TWO LINES, getUserRoleAuthStatus METHOD AND user VARIABLE
// AND COMMENT OUT BELOW LINE
// AND COMMENT OUT BELOW LINE
// let authenticated = isAuthenticated
// let authenticated = isAuthenticated
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
previouseRoute
!==
null
)
setPreviousRoute
(
pathname
)
if
(
previouseRoute
!==
null
)
setPreviousRoute
(
pathname
)
},
[
pathname
,
previouseRoute
])
},
[
pathname
,
previouseRoute
])
if
(
authenticated
)
if
(
authenticated
)
return
<>
return
(
<
Backdrop
<>
className=
{
classes
.
backdrop
}
<
Backdrop
open=
{
modalLoading
.
isVisible
}
className=
{
classes
.
backdrop
}
>
open=
{
modalLoading
.
isVisible
}
<
CircularProgress
color=
"inherit"
/>
>
</
Backdrop
>
<
CircularProgress
color=
"inherit"
/>
{
children
}
</
Backdrop
>
</>
{
children
}
</>
)
else
{
else
{
return
(
return
(
<
Redirect
<
Redirect
...
@@ -90,11 +88,9 @@ const AuthGuard = ({ children,modalLoading }) => {
...
@@ -90,11 +88,9 @@ const AuthGuard = ({ children,modalLoading }) => {
}
}
}
}
const
mapStateToProps
=
(
state
)
=>
{
const
mapStateToProps
=
(
state
)
=>
{
return
{
return
{
modalLoading
:
state
.
ModalLoadingReducer
,
modalLoading
:
state
.
ModalLoadingReducer
,
};
}
};
}
export
default
connect
(
mapStateToProps
,
{})(
AuthGuard
);
export
default
connect
(
mapStateToProps
,
{})(
AuthGuard
)
\ No newline at end of file
src/app/views/PaymentSupplier/detail.js
View file @
6dc92ec6
...
@@ -372,18 +372,18 @@ const SimpleForm = (props) => {
...
@@ -372,18 +372,18 @@ const SimpleForm = (props) => {
name
:
'30 ngày'
,
name
:
'30 ngày'
,
value
:
30
,
value
:
30
,
},
},
{
//
{
name
:
'90 ngày'
,
//
name: '90 ngày',
value
:
90
,
//
value: 90,
},
//
},
{
//
{
name
:
'180 ngày'
,
//
name: '180 ngày',
value
:
180
,
//
value: 180,
},
//
},
{
//
{
name
:
'1 năm'
,
//
name: '1 năm',
value
:
365
,
//
value: 365,
},
//
},
].
map
((
e
)
=>
(
].
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
value
}
>
<
MenuItem
value
=
{
e
.
value
}
>
{
e
.
name
}
{
e
.
name
}
...
...
src/app/views/Reconciliation/ListTrans/Index.js
View file @
6dc92ec6
...
@@ -65,6 +65,7 @@ const ToolNotificate = (props) => {
...
@@ -65,6 +65,7 @@ const ToolNotificate = (props) => {
res
=
await
listTransReconciliation
({
res
=
await
listTransReconciliation
({
page_no
:
0
,
page_no
:
0
,
page_size
:
pageSize
,
page_size
:
pageSize
,
text
:
searchDebount
,
date_from
:
startDate
?
convertDate
(
startDate
)
:
null
,
date_from
:
startDate
?
convertDate
(
startDate
)
:
null
,
date_to
:
endDate
?
convertDate
(
endDate
)
:
null
,
date_to
:
endDate
?
convertDate
(
endDate
)
:
null
,
product_code
:
product
?
product
:
null
,
product_code
:
product
?
product
:
null
,
...
@@ -76,6 +77,7 @@ const ToolNotificate = (props) => {
...
@@ -76,6 +77,7 @@ const ToolNotificate = (props) => {
res
=
await
listTransReconciliation
({
res
=
await
listTransReconciliation
({
page_no
:
pageIndex
+
1
,
page_no
:
pageIndex
+
1
,
page_size
:
pageSize
,
page_size
:
pageSize
,
text
:
searchDebount
,
date_from
:
startDate
?
convertDate
(
startDate
)
:
null
,
date_from
:
startDate
?
convertDate
(
startDate
)
:
null
,
date_to
:
endDate
?
convertDate
(
endDate
)
:
null
,
date_to
:
endDate
?
convertDate
(
endDate
)
:
null
,
product_code
:
product
?
product
:
null
,
product_code
:
product
?
product
:
null
,
...
@@ -90,11 +92,6 @@ const ToolNotificate = (props) => {
...
@@ -90,11 +92,6 @@ const ToolNotificate = (props) => {
const
newList
=
res
.
data
.
data
?.
data
?.
map
((
e
,
i
)
=>
{
const
newList
=
res
.
data
.
data
?.
data
?.
map
((
e
,
i
)
=>
{
return
{
return
{
...
e
,
...
e
,
statusReconciliationName
:
renderStatusName
(
e
?.
statusReconciliation
),
index
:
i
+
1
+
pageIndex
*
pageSize
,
index
:
i
+
1
+
pageIndex
*
pageSize
,
}
}
})
})
...
...
src/app/views/Reconciliation/ListTrans/Table.js
View file @
6dc92ec6
...
@@ -35,7 +35,7 @@ const columns = [
...
@@ -35,7 +35,7 @@ const columns = [
},
},
{
{
id
:
'order_code'
,
id
:
'order_code'
,
label
:
'Mã
hoá đơn
'
,
label
:
'Mã
giao dịch
'
,
align
:
'left'
,
align
:
'left'
,
minWidth
:
160
,
minWidth
:
160
,
},
},
...
@@ -197,15 +197,15 @@ function TableList(props) {
...
@@ -197,15 +197,15 @@ function TableList(props) {
style
=
{{
style
=
{{
padding
:
5
,
padding
:
5
,
backgroundColor
:
renderStatusBg
(
backgroundColor
:
renderStatusBg
(
row
?.
status
R
econciliation
row
?.
status
_r
econciliation
),
),
color
:
renderStatusColor
(
color
:
renderStatusColor
(
row
?.
status
R
econciliation
row
?.
status
_r
econciliation
),
),
borderRadius
:
10
,
borderRadius
:
10
,
}}
}}
>
>
{
row
?.
status
ReconciliationN
ame
}
{
row
?.
status
_reconciliation_n
ame
}
<
/Typography
>
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
<
/TableRow
>
<
/TableRow
>
...
...
src/app/views/Reconciliation/Setting/Index.js
View file @
6dc92ec6
...
@@ -24,6 +24,7 @@ const ToolNotificate = (props) => {
...
@@ -24,6 +24,7 @@ const ToolNotificate = (props) => {
const
[
listGroup
,
setListGroup
]
=
useState
([])
const
[
listGroup
,
setListGroup
]
=
useState
([])
const
[
group
,
setGroup
]
=
useState
()
const
[
group
,
setGroup
]
=
useState
()
const
{
user
}
=
useAuth
()
const
{
user
}
=
useAuth
()
const
[
type
,
setType
]
=
useState
()
const
[
data
,
setData
]
=
useState
([])
const
[
data
,
setData
]
=
useState
([])
...
@@ -54,7 +55,7 @@ const ToolNotificate = (props) => {
...
@@ -54,7 +55,7 @@ const ToolNotificate = (props) => {
page_no
:
0
,
page_no
:
0
,
page_size
:
pageSize
,
page_size
:
pageSize
,
status
,
status
,
// type: 3
,
type
:
type
?
type
:
0
,
})
})
}
else
{
}
else
{
res
=
await
listProviderSetting
({
res
=
await
listProviderSetting
({
...
@@ -62,7 +63,7 @@ const ToolNotificate = (props) => {
...
@@ -62,7 +63,7 @@ const ToolNotificate = (props) => {
page_no
:
pageIndex
+
1
,
page_no
:
pageIndex
+
1
,
page_size
:
pageSize
,
page_size
:
pageSize
,
status
,
status
,
// type: 3
,
type
:
type
?
type
:
0
,
})
})
}
}
...
@@ -88,7 +89,7 @@ const ToolNotificate = (props) => {
...
@@ -88,7 +89,7 @@ const ToolNotificate = (props) => {
},
[
pageIndex
])
},
[
pageIndex
])
useEffect
(()
=>
{
useEffect
(()
=>
{
getData
(
true
)
getData
(
true
)
},
[
searchDebount
,
status
,
store
,
group
])
},
[
searchDebount
,
status
,
store
,
group
,
type
])
const
removeItem
=
async
(
id
)
=>
{
const
removeItem
=
async
(
id
)
=>
{
// props.showLoading()
// props.showLoading()
...
@@ -132,6 +133,8 @@ const ToolNotificate = (props) => {
...
@@ -132,6 +133,8 @@ const ToolNotificate = (props) => {
listGroup
=
{
listGroup
}
listGroup
=
{
listGroup
}
group
=
{
group
}
group
=
{
group
}
setGroup
=
{
setGroup
}
setGroup
=
{
setGroup
}
type
=
{
type
}
setType
=
{
setType
}
/
>
/
>
)
)
}
}
...
...
src/app/views/Reconciliation/Setting/Update.js
View file @
6dc92ec6
...
@@ -28,6 +28,8 @@ import {
...
@@ -28,6 +28,8 @@ import {
convertDate
,
convertDate
,
convertTimeApi
,
convertTimeApi
,
replaceItemInArray
,
replaceItemInArray
,
toPriceVnd
,
toPriceVndInput
,
}
from
'app/config/Function'
}
from
'app/config/Function'
import
{
connect
}
from
'react-redux'
import
{
connect
}
from
'react-redux'
...
@@ -137,7 +139,7 @@ const SimpleForm = (props) => {
...
@@ -137,7 +139,7 @@ const SimpleForm = (props) => {
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
history
.
push
(
'/reconciliation/setting'
)
history
.
push
(
'/reconciliation/setting'
)
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
toast
.
success
(
'Cập nhật
nhà cung cấp thiết bị
thành công!'
,
{
toast
.
success
(
'Cập nhật
cấu hình đối soát
thành công!'
,
{
theme
:
'colored'
,
theme
:
'colored'
,
})
})
}
}
...
@@ -172,7 +174,13 @@ const SimpleForm = (props) => {
...
@@ -172,7 +174,13 @@ const SimpleForm = (props) => {
event
.
target
.
name
==
'money'
||
event
.
target
.
name
==
'money'
||
event
.
target
.
name
==
'length'
event
.
target
.
name
==
'length'
)
{
)
{
const
inputValue
=
event
.
target
.
value
let
inputValue
if
(
event
.
target
.
name
==
'money'
)
{
inputValue
=
event
.
target
.
value
.
split
(
'.'
).
join
(
''
)
}
else
{
inputValue
=
event
.
target
.
value
}
console
.
log
(
'inputValue'
,
inputValue
)
// Kiểm tra nếu input là số nguyên hoặc số thập phân
// Kiểm tra nếu input là số nguyên hoặc số thập phân
const
regex
=
/^-
?\d
*
\.?\d
*$/
const
regex
=
/^-
?\d
*
\.?\d
*$/
if
(
regex
.
test
(
inputValue
))
{
if
(
regex
.
test
(
inputValue
))
{
...
@@ -180,7 +188,7 @@ const SimpleForm = (props) => {
...
@@ -180,7 +188,7 @@ const SimpleForm = (props) => {
let
newList
=
[...
listMoney
]
let
newList
=
[...
listMoney
]
const
temp
=
{
const
temp
=
{
...
listMoney
[
index
],
...
listMoney
[
index
],
[
event
.
target
.
name
]:
event
.
target
.
v
alue
,
[
event
.
target
.
name
]:
inputV
alue
,
}
}
newList
=
replaceItemInArray
(
newList
,
index
,
temp
)
newList
=
replaceItemInArray
(
newList
,
index
,
temp
)
setListMoney
(
newList
)
setListMoney
(
newList
)
...
@@ -306,11 +314,11 @@ const SimpleForm = (props) => {
...
@@ -306,11 +314,11 @@ const SimpleForm = (props) => {
onChange
=
{
handleChange
}
onChange
=
{
handleChange
}
type
=
"text"
type
=
"text"
name
=
"percent"
name
=
"percent"
value
=
{
percent
||
''
}
validators
=
{[
'isFloat'
]}
validators
=
{[
'required'
]}
errorMessages
=
{[
errorMessages
=
{[
'
Không được để trống trường này
'
,
'
Trường này phải nhập số
'
,
]}
]}
value
=
{
percent
||
''
}
/
>
/
>
<
/Grid
>
<
/Grid
>
)
:
(
)
:
(
...
@@ -377,9 +385,9 @@ const SimpleForm = (props) => {
...
@@ -377,9 +385,9 @@ const SimpleForm = (props) => {
label
=
"Hoa hồng *"
label
=
"Hoa hồng *"
fullWidth
fullWidth
name
=
"money"
name
=
"money"
value
=
{
value
=
{
toPriceVndInput
(
listMoney
[
index
].
money
listMoney
[
index
].
money
}
)
}
variant
=
"outlined"
variant
=
"outlined"
InputProps
=
{{
InputProps
=
{{
endAdornment
:
(
endAdornment
:
(
...
@@ -431,16 +439,12 @@ const SimpleForm = (props) => {
...
@@ -431,16 +439,12 @@ const SimpleForm = (props) => {
<
Grid
xs
=
{
6
}
sm
=
{
6
}
item
>
<
Grid
xs
=
{
6
}
sm
=
{
6
}
item
>
<
SelectValidator
<
SelectValidator
variant
=
{
'outlined'
}
variant
=
{
'outlined'
}
label
=
{
'Chu kỳ đối soát
*
'
}
label
=
{
'Chu kỳ đối soát'
}
className
=
"mb-4 w-full"
className
=
"mb-4 w-full"
value
=
{
reconciliationCycle
||
''
}
value
=
{
reconciliationCycle
||
''
}
displayEmpty
displayEmpty
name
=
"reconciliationCycle"
name
=
"reconciliationCycle"
onChange
=
{
handleChange
}
onChange
=
{
handleChange
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
]}
>
>
{[
{[
{
{
...
...
src/app/views/Reconciliation/Setting/View.js
View file @
6dc92ec6
...
@@ -32,14 +32,8 @@ function CustomerView(props) {
...
@@ -32,14 +32,8 @@ function CustomerView(props) {
pageIndex
,
pageIndex
,
totalRecords
,
totalRecords
,
status
,
type
,
setStatus
,
setType
,
store
,
setStore
,
listDrop
,
listGroup
,
group
,
setGroup
,
}
=
props
}
=
props
const
handleChange
=
(
event
)
=>
{
const
handleChange
=
(
event
)
=>
{
setAge
(
event
.
target
.
value
)
setAge
(
event
.
target
.
value
)
...
@@ -93,7 +87,44 @@ function CustomerView(props) {
...
@@ -93,7 +87,44 @@ function CustomerView(props) {
}}
}}
/
>
/
>
<
/Grid
>
<
/Grid
>
<
Grid
item
lg
=
{
4
}
md
=
{
4
}
sm
=
{
4
}
xs
=
{
4
}
>
<
FormControl
variant
=
"outlined"
fullWidth
>
<
InputLabel
htmlFor
=
"outlined-age-native-simple"
>
Lo
ạ
i
hoa
h
ồ
ng
<
/InputLabel
>
<
Select
label
=
"Loại hoa hồng"
value
=
{
type
}
onChange
=
{(
e
)
=>
setType
(
e
.
target
.
value
)}
inputProps
=
{{
name
:
'age'
,
id
:
'outlined-age-native-simple'
,
}}
>
<
MenuItem
value
=
""
>
<
em
>
T
ấ
t
c
ả
<
/em
>
<
/MenuItem
>
{[
{
name
:
'Số tiền cố định'
,
value
:
2
,
id
:
2
,
},
{
name
:
'Theo phần trăm'
,
value
:
1
,
id
:
1
,
},
].
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
))}
<
/Select
>
<
/FormControl
>
<
/Grid
>
<
/Grid
>
<
/Grid
>
{
/* {checkRole(user, '/reconciliation/setting/create') ? (
{
/* {checkRole(user, '/reconciliation/setting/create') ? (
<Link to="/reconciliation/setting/create">
<Link to="/reconciliation/setting/create">
<Button
<Button
...
...
src/app/views/Reconciliation/Sheet/Detail.js
View file @
6dc92ec6
...
@@ -220,27 +220,11 @@ const SimpleForm = (props) => {
...
@@ -220,27 +220,11 @@ const SimpleForm = (props) => {
color
:
'#000000'
,
color
:
'#000000'
,
fontSize
:
16
,
fontSize
:
16
,
marginBottom
:
10
,
marginBottom
:
10
,
height
:
65
,
}}
}}
>
>
{
idPaymentPartner
}
{
idPaymentPartner
}
<
/Typography
>
<
/Typography
>
<
Typography
style
=
{{
color
:
'#344054'
,
fontSize
:
14
,
}}
>
Ng
ườ
i
t
ạ
o
<
/Typography
>
<
Typography
style
=
{{
color
:
'#000000'
,
fontSize
:
14
,
}}
>
{
create_by
}
<
/Typography
>
<
/Card
>
<
/Card
>
<
/Grid
>
<
/Grid
>
<
Grid
item
lg
=
{
4
}
md
=
{
4
}
sm
=
{
6
}
xs
=
{
6
}
>
<
Grid
item
lg
=
{
4
}
md
=
{
4
}
sm
=
{
6
}
xs
=
{
6
}
>
...
...
src/app/views/Reconciliation/Sheet/Dialog/Dialog.js
View file @
6dc92ec6
...
@@ -56,8 +56,13 @@ const DialogActions = withStyles((theme) => ({
...
@@ -56,8 +56,13 @@ const DialogActions = withStyles((theme) => ({
}))(
MuiDialogActions
)
}))(
MuiDialogActions
)
const
CustomizedDialogs
=
(
props
)
=>
{
const
CustomizedDialogs
=
(
props
)
=>
{
const
{
onSelectCustomer
,
cusomterSelect
,
idPaymentPartner
,
onAddTrans
}
=
const
{
props
onSelectCustomer
,
cusomterSelect
,
idPaymentPartner
,
onAddTrans
,
id
,
}
=
props
const
[
open
,
setOpen
]
=
useState
(
false
)
const
[
open
,
setOpen
]
=
useState
(
false
)
const
handleClickOpen
=
()
=>
{
const
handleClickOpen
=
()
=>
{
...
@@ -112,6 +117,7 @@ const CustomizedDialogs = (props) => {
...
@@ -112,6 +117,7 @@ const CustomizedDialogs = (props) => {
onAddTrans
(
list
)
onAddTrans
(
list
)
handleClose
()
handleClose
()
}}
}}
id
=
{
id
}
/
>
/
>
<
/DialogContent
>
<
/DialogContent
>
<
/Dialog
>
<
/Dialog
>
...
...
src/app/views/Reconciliation/Sheet/Dialog/Index.js
View file @
6dc92ec6
...
@@ -8,10 +8,16 @@ import { showLoading, hideLoading } from 'app/redux/actions/loadingAction'
...
@@ -8,10 +8,16 @@ import { showLoading, hideLoading } from 'app/redux/actions/loadingAction'
import
{
toast
}
from
'react-toastify'
import
{
toast
}
from
'react-toastify'
import
useDebounce
from
'app/hooks/useDebounce'
import
useDebounce
from
'app/hooks/useDebounce'
import
{
useTranslation
}
from
'react-i18next'
import
{
useTranslation
}
from
'react-i18next'
import
{
dropdownMerchant
,
dropdownStore
}
from
'app/apis/Functions/dropdown'
import
{
dropdownMerchant
,
dropdownStoreNew
,
dropdownPaymentType
,
}
from
'app/apis/Functions/dropdown'
import
useAuth
from
'app/hooks/useAuth'
const
ToolNotificate
=
(
props
)
=>
{
const
ToolNotificate
=
(
props
)
=>
{
const
{
customSelect
,
handleClose
,
idPaymentPartner
,
onAddTrans
}
=
props
const
{
customSelect
,
handleClose
,
idPaymentPartner
,
onAddTrans
,
id
}
=
props
const
[
listSelected
,
setListSelected
]
=
useState
([])
const
[
listSelected
,
setListSelected
]
=
useState
([])
const
[
txtSearch
,
setTxtSearch
]
=
useState
(
''
)
const
[
txtSearch
,
setTxtSearch
]
=
useState
(
''
)
const
[
applications
,
setApplications
]
=
useState
(
''
)
const
[
applications
,
setApplications
]
=
useState
(
''
)
...
@@ -26,6 +32,15 @@ const ToolNotificate = (props) => {
...
@@ -26,6 +32,15 @@ const ToolNotificate = (props) => {
const
[
data
,
setData
]
=
useState
([])
const
[
data
,
setData
]
=
useState
([])
const
[
type
,
setType
]
=
useState
()
const
[
type
,
setType
]
=
useState
()
const
[
listType
,
setListType
]
=
useState
([])
const
[
listType
,
setListType
]
=
useState
([])
const
[
store
,
setStore
]
=
useState
()
const
[
listStore
,
setListStore
]
=
useState
([])
const
[
listMedthodPay
,
setListMethodPay
]
=
useState
([])
const
{
user
}
=
useAuth
()
useEffect
(()
=>
{
getDropdownStore
()
},
[])
const
changeDateRange
=
(
start
,
end
)
=>
{
const
changeDateRange
=
(
start
,
end
)
=>
{
setStartDate
(
start
)
setStartDate
(
start
)
...
@@ -47,9 +62,9 @@ const ToolNotificate = (props) => {
...
@@ -47,9 +62,9 @@ const ToolNotificate = (props) => {
payment_gate_code
:
props
?.
idPaymentPartner
,
payment_gate_code
:
props
?.
idPaymentPartner
,
order_code
:
searchDebount
,
order_code
:
searchDebount
,
type_payment
:
type
||
type
,
type_payment
:
type
||
type
,
reconciliation_id
:
id
,
})
})
console
.
log
(
'res.data'
,
res
.
data
)
props
.
hideLoading
()
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
const
newList
=
res
.
data
.
data
?.
map
((
e
,
i
)
=>
{
const
newList
=
res
.
data
.
data
?.
map
((
e
,
i
)
=>
{
...
@@ -81,6 +96,26 @@ const ToolNotificate = (props) => {
...
@@ -81,6 +96,26 @@ const ToolNotificate = (props) => {
}
}
}
}
const
getDropdownStore
=
async
()
=>
{
const
res
=
await
dropdownStoreNew
()
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
const
newList
=
res
.
data
.
data
.
map
((
e
)
=>
{
return
{
...
e
,
name
:
e
.
store_name
}
})
setListStore
(
newList
)
}
const
res2
=
await
dropdownPaymentType
()
if
(
res2
.
data
.
code
==
200
&&
res2
.
data
.
data
)
{
const
newList
=
res2
.
data
.
data
.
map
((
e
)
=>
{
return
{
...
e
,
id
:
e
.
code
}
})
setListMethodPay
(
newList
)
}
}
return
(
return
(
<
LogAuth
<
LogAuth
data
=
{
data
}
data
=
{
data
}
...
@@ -100,6 +135,10 @@ const ToolNotificate = (props) => {
...
@@ -100,6 +135,10 @@ const ToolNotificate = (props) => {
listSelected
=
{
listSelected
}
listSelected
=
{
listSelected
}
setListSelected
=
{
setListSelected
}
setListSelected
=
{
setListSelected
}
onAdd
=
{
onAdd
}
onAdd
=
{
onAdd
}
store
=
{
store
}
setStore
=
{
setStore
}
listStore
=
{
listStore
}
listMedthodPay
=
{
listMedthodPay
}
/
>
/
>
)
)
}
}
...
...
src/app/views/Reconciliation/Sheet/Dialog/View.js
View file @
6dc92ec6
...
@@ -48,6 +48,7 @@ function CustomerView(props) {
...
@@ -48,6 +48,7 @@ function CustomerView(props) {
listSelected
,
listSelected
,
setListSelected
,
setListSelected
,
onAdd
,
onAdd
,
listMedthodPay
,
}
=
props
}
=
props
const
handleChange
=
(
event
)
=>
{
const
handleChange
=
(
event
)
=>
{
...
@@ -94,20 +95,31 @@ function CustomerView(props) {
...
@@ -94,20 +95,31 @@ function CustomerView(props) {
<
MenuItem
value
=
""
>
<
MenuItem
value
=
""
>
<
em
>
T
ấ
t
c
ả
<
/em
>
<
em
>
T
ấ
t
c
ả
<
/em
>
<
/MenuItem
>
<
/MenuItem
>
{[
{
listMedthodPay
.
map
((
e
)
=>
(
{
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
id
:
'QR'
,
))}
name
:
'QR'
,
<
/Select
>
},
<
/FormControl
>
{
<
/Grid
>
id
:
'CASH'
,
name
:
'Tiền mặt'
,
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
sm
=
{
3
}
xs
=
{
3
}
>
},
<
FormControl
variant
=
"outlined"
fullWidth
>
{
<
InputLabel
htmlFor
=
"outlined-age-native-simple"
>
id
:
'DEBT'
,
C
â
y
x
ă
ng
name
:
'Công nợ'
,
<
/InputLabel
>
},
<
Select
].
map
((
e
)
=>
(
label
=
"Cây xăng"
value
=
{
store
}
onChange
=
{(
e
)
=>
setStore
(
e
.
target
.
value
)}
inputProps
=
{{
name
:
'age'
,
id
:
'outlined-age-native-simple'
,
}}
>
<
MenuItem
value
=
""
>
<
em
>
T
ấ
t
c
ả
<
/em
>
<
/MenuItem
>
{
listStore
.
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
))}
))}
<
/Select
>
<
/Select
>
...
...
src/app/views/Reconciliation/Sheet/Index.js
View file @
6dc92ec6
...
@@ -45,7 +45,7 @@ const ToolNotificate = (props) => {
...
@@ -45,7 +45,7 @@ const ToolNotificate = (props) => {
if
(
init
)
{
if
(
init
)
{
setPageIndex
(
0
)
setPageIndex
(
0
)
res
=
await
listSheetReconciliation
({
res
=
await
listSheetReconciliation
({
order_code
:
searchDebount
,
text
:
searchDebount
,
page_no
:
0
,
page_no
:
0
,
page_size
:
pageSize
,
page_size
:
pageSize
,
date_from
:
startDate
?
convertDate
(
startDate
)
:
null
,
date_from
:
startDate
?
convertDate
(
startDate
)
:
null
,
...
@@ -55,7 +55,7 @@ const ToolNotificate = (props) => {
...
@@ -55,7 +55,7 @@ const ToolNotificate = (props) => {
})
})
}
else
{
}
else
{
res
=
await
listSheetReconciliation
({
res
=
await
listSheetReconciliation
({
order_code
:
searchDebount
,
text
:
searchDebount
,
page_no
:
pageIndex
+
1
,
page_no
:
pageIndex
+
1
,
page_size
:
pageSize
,
page_size
:
pageSize
,
from_date
:
startDate
?
convertDate
(
startDate
)
:
null
,
from_date
:
startDate
?
convertDate
(
startDate
)
:
null
,
...
...
src/app/views/Reconciliation/Sheet/ListTrans/Index.js
View file @
6dc92ec6
...
@@ -204,6 +204,7 @@ const ToolNotificate = (props) => {
...
@@ -204,6 +204,7 @@ const ToolNotificate = (props) => {
removeItem
=
{
removeItem
}
removeItem
=
{
removeItem
}
onAddTrans
=
{
onAddTrans
}
onAddTrans
=
{
onAddTrans
}
total
=
{
total
}
total
=
{
total
}
id
=
{
props
.
id
}
/
>
/
>
)
)
}
}
...
...
src/app/views/Reconciliation/Sheet/ListTrans/Table.js
View file @
6dc92ec6
...
@@ -37,7 +37,7 @@ const columns = [
...
@@ -37,7 +37,7 @@ const columns = [
{
{
id
:
'order_code'
,
id
:
'order_code'
,
label
:
'Mã
hoá đơn
'
,
label
:
'Mã
giao dịch
'
,
align
:
'left'
,
align
:
'left'
,
minWidth
:
170
,
minWidth
:
170
,
},
},
...
...
src/app/views/Reconciliation/Sheet/ListTrans/View.js
View file @
6dc92ec6
...
@@ -50,6 +50,7 @@ function CustomerView(props) {
...
@@ -50,6 +50,7 @@ function CustomerView(props) {
removeItem
,
removeItem
,
onAddTrans
,
onAddTrans
,
total
,
total
,
id
,
}
=
props
}
=
props
const
handleChange
=
(
event
)
=>
{
const
handleChange
=
(
event
)
=>
{
...
@@ -104,6 +105,7 @@ function CustomerView(props) {
...
@@ -104,6 +105,7 @@ function CustomerView(props) {
<
DialogTrans
<
DialogTrans
idPaymentPartner
=
{
idPaymentPartner
}
idPaymentPartner
=
{
idPaymentPartner
}
onAddTrans
=
{
onAddTrans
}
onAddTrans
=
{
onAddTrans
}
id
=
{
id
}
/
>
/
>
<
/Grid
>
<
/Grid
>
)
:
null
}
)
:
null
}
...
...
src/app/views/Reconciliation/Sheet/Table.js
View file @
6dc92ec6
...
@@ -137,7 +137,7 @@ function TableList(props) {
...
@@ -137,7 +137,7 @@ function TableList(props) {
))}
))}
<
TableCell
<
TableCell
style
=
{{
style
=
{{
width
:
1
0
0
,
width
:
1
2
0
,
backgroundColor
:
colors
.
headerTable
,
backgroundColor
:
colors
.
headerTable
,
}}
}}
>
>
...
...
src/app/views/Reconciliation/Sheet/Update.js
View file @
6dc92ec6
...
@@ -74,8 +74,6 @@ const SimpleForm = (props) => {
...
@@ -74,8 +74,6 @@ const SimpleForm = (props) => {
props
.
showLoading
()
props
.
showLoading
()
const
res
=
await
updateSheetReconciliation
({
const
res
=
await
updateSheetReconciliation
({
...
newValue
,
...
newValue
,
status
:
1
,
})
})
props
.
hideLoading
()
props
.
hideLoading
()
...
@@ -102,10 +100,7 @@ const SimpleForm = (props) => {
...
@@ -102,10 +100,7 @@ const SimpleForm = (props) => {
}
}
console
.
log
(
'state'
,
state
)
console
.
log
(
'state'
,
state
)
const
{
code
,
idPaymentPartner
,
note
}
=
state
const
{
code
,
idPaymentPartner
,
note
}
=
state
console
.
log
(
console
.
log
(
'location.state'
,
location
.
state
.
id
)
'location.state?.idPaymentPartner'
,
location
.
state
?.
idPaymentPartner
)
return
(
return
(
<
div
className
=
"m-sm-30"
>
<
div
className
=
"m-sm-30"
>
<
div
className
=
"mb-sm-30"
>
<
div
className
=
"mb-sm-30"
>
...
@@ -219,6 +214,7 @@ const SimpleForm = (props) => {
...
@@ -219,6 +214,7 @@ const SimpleForm = (props) => {
idPaymentPartner
=
{
idPaymentPartner
=
{
location
.
state
?.
idPaymentPartner
location
.
state
?.
idPaymentPartner
}
}
id
=
{
location
.
state
.
id
}
/
>
/
>
<
/Grid
>
<
/Grid
>
<
/Grid
>
<
/Grid
>
...
...
src/app/views/Reconciliation/Sheet/View.js
View file @
6dc92ec6
...
@@ -99,17 +99,17 @@ function CustomerView(props) {
...
@@ -99,17 +99,17 @@ function CustomerView(props) {
<
em
>
T
ấ
t
c
ả
<
/em
>
<
em
>
T
ấ
t
c
ả
<
/em
>
<
/MenuItem
>
<
/MenuItem
>
{[
{[
{
//
{
name
:
'Nháp'
,
//
name: 'Nháp',
value
:
1
,
//
value: 1,
id
:
1
,
//
id: 1,
},
//
},
{
//
{
name
:
'Chưa đối soát'
,
//
name: 'Chưa đối soát',
value
:
2
,
//
value: 2,
id
:
2
,
//
id: 2,
},
//
},
{
{
name
:
'Đang đối soát'
,
name
:
'Đang đối soát'
,
value
:
3
,
value
:
3
,
...
...
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