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
8e228715
Commit
8e228715
authored
Sep 14, 2024
by
tdgiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update code
parent
9b214793
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
557 additions
and
338 deletions
+557
-338
reconciliation.js
src/app/apis/Functions/reconciliation.js
+30
-0
url.js
src/app/apis/url.js
+6
-0
Data.js
src/app/assets/Data.js
+256
-0
translation.json
src/app/assets/languages/locates/vi/translation.json
+5
-2
Index.js
src/app/views/Reconciliation/Setting/Index.js
+36
-40
Table.js
src/app/views/Reconciliation/Setting/Table.js
+10
-70
Update.js
src/app/views/Reconciliation/Setting/Update.js
+0
-0
View.js
src/app/views/Reconciliation/Setting/View.js
+2
-36
Index.js
src/app/views/Reconciliation/Sheet/Index.js
+25
-67
Index.js
src/app/views/Reconciliation/Sheet/ListTrans/Index.js
+6
-0
Table.js
src/app/views/Reconciliation/Sheet/Table.js
+110
-63
Update.js
src/app/views/Reconciliation/Sheet/Update.js
+39
-12
View.js
src/app/views/Reconciliation/Sheet/View.js
+32
-48
No files found.
src/app/apis/Functions/reconciliation.js
View file @
8e228715
...
...
@@ -6,3 +6,33 @@ export const listTransReconciliation = async (body) =>
PostData
(
url
.
listTransReconciliation
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
listSheetReconciliation
=
async
(
body
)
=>
PostData
(
url
.
listSheetReconciliation
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
listProviderSetting
=
async
(
body
)
=>
PostData
(
url
.
listProviderSetting
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
detailProviderSetting
=
async
(
id
,
body
)
=>
GetURL
(
`
${
url
.
detailProviderSetting
}
/
${
id
}
`
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
updateProviderSetting
=
async
(
body
)
=>
PostData
(
url
.
updateProviderSetting
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
detailSheetReconciliation
=
async
(
id
,
body
)
=>
GetURL
(
`
${
url
.
detailSheetReconciliation
}
/
${
id
}
`
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
export
const
updateSheetReconciliation
=
async
(
body
)
=>
PostData
(
url
.
updateSheetReconciliation
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
null
)
src/app/apis/url.js
View file @
8e228715
...
...
@@ -120,6 +120,12 @@ export default {
//reconciliation
listTransReconciliation
:
`
${
root
}
/paymentpartner/list/trans`
,
listSheetReconciliation
:
`
${
root
}
/reconciliation/list`
,
detailSheetReconciliation
:
`
${
root
}
/reconciliation`
,
updateSheetReconciliation
:
`
${
root
}
/reconciliation/update`
,
listProviderSetting
:
`
${
root
}
/provider/paging/setting`
,
detailProviderSetting
:
`
${
root
}
/reconciliation/setting`
,
updateProviderSetting
:
`
${
root
}
/reconciliation/setting/create`
,
//Log
logAuth
:
`
${
root
}
/logging/listLogin`
,
...
...
src/app/assets/Data.js
0 → 100644
View file @
8e228715
export
const
listHour
=
[
{
name
:
'00:00'
,
value
:
'00:00'
,
},
{
name
:
'01:00'
,
value
:
'01:00'
,
},
{
name
:
'02:00'
,
value
:
'02:00'
,
},
{
name
:
'03:00'
,
value
:
'03:00'
,
},
{
name
:
'04:00'
,
value
:
'04:00'
,
},
{
name
:
'05:00'
,
value
:
'05:00'
,
},
{
name
:
'06:00'
,
value
:
'06:00'
,
},
{
name
:
'07:00'
,
value
:
'07:00'
,
},
{
name
:
'08:00'
,
value
:
'08:00'
,
},
{
name
:
'09:00'
,
value
:
'09:00'
,
},
{
name
:
'10:00'
,
value
:
'10:00'
,
},
{
name
:
'11:00'
,
value
:
'11:00'
,
},
{
name
:
'12:00'
,
value
:
'12:00'
,
},
{
name
:
'13:00'
,
value
:
'13:00'
,
},
{
name
:
'14:00'
,
value
:
'14:00'
,
},
{
name
:
'15:00'
,
value
:
'15:00'
,
},
{
name
:
'16:00'
,
value
:
'16:00'
,
},
{
name
:
'17:00'
,
value
:
'17:00'
,
},
{
name
:
'18:00'
,
value
:
'18:00'
,
},
{
name
:
'19:00'
,
value
:
'19:00'
,
},
{
name
:
'20:00'
,
value
:
'20:00'
,
},
{
name
:
'21:00'
,
value
:
'21:00'
,
},
{
name
:
'22:00'
,
value
:
'22:00'
,
},
{
name
:
'23:00'
,
value
:
'23:00'
,
},
]
export
const
listWeek
=
[
{
name
:
'Thứ 2'
,
value
:
1
,
},
{
name
:
'Thứ 3'
,
value
:
2
,
},
{
name
:
'Thứ 4'
,
value
:
3
,
},
{
name
:
'Thứ 5'
,
value
:
4
,
},
{
name
:
'Thứ 6'
,
value
:
5
,
},
{
name
:
'Thứ 7'
,
value
:
6
,
},
{
name
:
'Chủ nhật'
,
value
:
7
,
},
]
export
const
listMonth
=
[
{
name
:
'Ngày 1'
,
value
:
1
,
},
{
name
:
'Ngày 2'
,
value
:
2
,
},
{
name
:
'Ngày 3'
,
value
:
3
,
},
{
name
:
'Ngày 4'
,
value
:
4
,
},
{
name
:
'Ngày 5'
,
value
:
5
,
},
{
name
:
'Ngày 6'
,
value
:
6
,
},
{
name
:
'Ngày 7'
,
value
:
7
,
},
{
name
:
'Ngày 8'
,
value
:
8
,
},
{
name
:
'Ngày 9'
,
value
:
9
,
},
{
name
:
'Ngày 10'
,
value
:
10
,
},
{
name
:
'Ngày 11'
,
value
:
11
,
},
{
name
:
'Ngày 12'
,
value
:
12
,
},
{
name
:
'Ngày 13'
,
value
:
13
,
},
{
name
:
'Ngày 14'
,
value
:
14
,
},
{
name
:
'Ngày 15'
,
value
:
15
,
},
{
name
:
'Ngày 16'
,
value
:
16
,
},
{
name
:
'Ngày 17'
,
value
:
17
,
},
{
name
:
'Ngày 18'
,
value
:
18
,
},
{
name
:
'Ngày 19'
,
value
:
19
,
},
{
name
:
'Ngày 20'
,
value
:
20
,
},
{
name
:
'Ngày 21'
,
value
:
21
,
},
{
name
:
'Ngày 22'
,
value
:
22
,
},
{
name
:
'Ngày 23'
,
value
:
23
,
},
{
name
:
'Ngày 24'
,
value
:
24
,
},
{
name
:
'Ngày 25'
,
value
:
25
,
},
{
name
:
'Ngày 26'
,
value
:
26
,
},
{
name
:
'Ngày 27'
,
value
:
27
,
},
{
name
:
'Ngày 28'
,
value
:
28
,
},
{
name
:
'Ngày 29'
,
value
:
29
,
},
{
name
:
'Ngày 30'
,
value
:
30
,
},
{
name
:
'Ngày 31'
,
value
:
31
,
},
]
src/app/assets/languages/locates/vi/translation.json
View file @
8e228715
...
...
@@ -354,7 +354,6 @@
"ERROR_NAME_IS_EXISTS"
:
"Tên sản phẩm đã tồn tại"
,
"ERROR_MERCHAN_STORE_CODE_EXIST"
:
"Mã cây xăng đã tồn tại"
,
"ERROR_CODE_IS_EXITS"
:
"Mã code đã tồn tại"
,
"ERROR_NAME_IS_EXITS"
:
"Tên sản phẩm đã tồn tại"
,
"ERROR_MERCHAN_STORE_CODE"
:
"Mã cây xăng đã tồn tại"
,
...
...
@@ -364,8 +363,12 @@
"ERROR_NAME_PACKAGE_IS_EXITS"
:
"Tên gói đã tồn tại"
,
"ERROR_NAME_FUNCTION_IS_EXITS"
:
"Tên chức năng đã tồn tại"
,
"ERROR_USER_GROUP_EXISTS_DATA"
:
"Nhóm quyền đã có dữ liệu"
,
"ERROR_DATE_INVALID"
:
"Thời gian không hợp lệ"
,
"ERROR_DATE_INVALID"
:
"Thời gian không hợp lệ"
"ERROR_NOT_PAYMENTGATE"
:
"chưa truyền code đối tác thanh toán"
,
"ERROR_FORMAT_HOUR"
:
"Sai định dang giờ"
,
"ERROR_FORMAT_DAYOFWEEK"
:
"Sai định dang ngày trong tuần"
,
"ERROR_FORMAT_DATEOFMONTH"
:
"Sai định dang ngày trong tháng"
}
src/app/views/Reconciliation/Setting/Index.js
View file @
8e228715
import
React
,
{
useState
,
useEffect
}
from
'react'
import
ToolUserView
from
'./View'
import
{
getListSupplier
,
deleteSupplier
,
changeStatusSupplier
,
}
from
'app/apis/Functions/supplier'
import
{
listProviderSetting
}
from
'app/apis/Functions/reconciliation'
import
{
useHistory
}
from
'react-router-dom'
import
KEY
from
'app/assets/Key'
import
{
connect
}
from
'react-redux'
...
...
@@ -32,19 +28,19 @@ const ToolNotificate = (props) => {
const
[
data
,
setData
]
=
useState
([])
const
handeChangeActive
=
async
(
id
,
status_id
)
=>
{
props
.
showLoading
()
const
res
=
await
changeStatusSupplier
({
id
,
status_id
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
getData
()
toast
.
success
(
'Thay đổi trạng thái thành công!'
,
{
theme
:
'colored'
,
})
}
else
{
toast
.
error
(
'Thay đổi trạng thái thất bại!'
,
{
theme
:
'colored'
,
})
}
//
props.showLoading()
//
const res = await changeStatusSupplier({ id, status_id })
//
props.hideLoading()
//
if (res.data.code == 200) {
//
getData()
//
toast.success('Thay đổi trạng thái thành công!', {
//
theme: 'colored',
//
})
//
} else {
//
toast.error('Thay đổi trạng thái thất bại!', {
//
theme: 'colored',
//
})
//
}
}
console
.
log
(
'user'
,
user
)
...
...
@@ -53,20 +49,20 @@ const ToolNotificate = (props) => {
let
res
if
(
isInit
)
{
setPageIndex
(
0
)
res
=
await
getListSupplier
({
res
=
await
listProviderSetting
({
provider_name
:
searchDebount
,
page_no
:
0
,
page_size
:
pageSize
,
status
,
type
:
3
,
//
type: 3,
})
}
else
{
res
=
await
getListSupplier
({
res
=
await
listProviderSetting
({
provider_name
:
searchDebount
,
page_no
:
pageIndex
+
1
,
page_size
:
pageSize
,
status
,
type
:
3
,
//
type: 3,
})
}
...
...
@@ -95,24 +91,24 @@ const ToolNotificate = (props) => {
},
[
searchDebount
,
status
,
store
,
group
])
const
removeItem
=
async
(
id
)
=>
{
props
.
showLoading
()
const
res
=
await
deleteSupplier
({
id
})
props
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
getData
(
true
)
toast
.
success
(
'Xoá bản ghi thành công!'
,
{
theme
:
'colored'
,
})
}
else
if
(
res
.
data
.
code
==
401
)
{
localStorage
.
removeItem
(
KEY
.
API_TOKEN
)
setTimeout
(()
=>
{
history
.
push
(
'/'
)
},
100
)
}
else
{
toast
.
error
(
'Xoá bản ghi thất bại!'
,
{
theme
:
'colored'
,
})
}
//
props.showLoading()
//
const res = await deleteSupplier({ id })
//
props.hideLoading()
//
if (res.data.code == 200) {
//
getData(true)
//
toast.success('Xoá bản ghi thành công!', {
//
theme: 'colored',
//
})
//
} else if (res.data.code == 401) {
//
localStorage.removeItem(KEY.API_TOKEN)
//
setTimeout(() => {
//
history.push('/')
//
}, 100)
//
} else {
//
toast.error('Xoá bản ghi thất bại!', {
//
theme: 'colored',
//
})
//
}
}
return
(
...
...
src/app/views/Reconciliation/Setting/Table.js
View file @
8e228715
...
...
@@ -39,38 +39,31 @@ const columns = [
},
{
id
:
'provider_code'
,
label
:
'
Mã nhà cung cấp
'
,
label
:
'
Đối tác
'
,
align
:
'center'
,
minWidth
:
150
,
},
{
id
:
'
provider_name
'
,
label
:
'
Tên nhà cung cấp
'
,
id
:
'
type_comission
'
,
label
:
'
Loại hoa hồng
'
,
align
:
'left'
,
minWidth
:
200
,
},
{
id
:
'
phon
e'
,
label
:
'
Số điện thoại
'
,
id
:
'
type_Nam
e'
,
label
:
'
ĐVT
'
,
align
:
'left'
,
minWidth
:
'auto'
,
minWidth
:
100
,
},
{
id
:
'
email
'
,
label
:
'
Email
'
,
id
:
'
reconciliation_cycle_name
'
,
label
:
'
Chu ký đối soát
'
,
align
:
'left'
,
minWidth
:
'auto'
,
minWidth
:
150
,
},
{
id
:
'address'
,
label
:
'Địa chỉ'
,
align
:
'left'
,
minWidth
:
'auto'
,
minWidth
:
250
,
},
]
function
TableList
(
props
)
{
...
...
@@ -126,21 +119,11 @@ function TableList(props) {
{
column
.
label
}
<
/TableCell
>
))}
<
TableCell
style
=
{{
backgroundColor
:
colors
.
headerTable
,
width
:
145
,
}}
>
Tra
̣
ng
tha
́
i
<
/TableCell
>
<
TableCell
style
=
{{
textAlign
:
'center'
,
backgroundColor
:
colors
.
headerTable
,
width
:
12
0
,
width
:
6
0
,
}}
>
H
à
nh
độ
ng
...
...
@@ -178,53 +161,10 @@ function TableList(props) {
<
/TableCell
>
)
})}
<
TableCell
className
=
{
classes
.
border
}
>
<
Select
variant
=
{
'outlined'
}
labelId
=
"demo-simple-select-placeholder-label-label"
id
=
"demo-simple-select-placeholder-label"
onChange
=
{(
e
)
=>
handeChangeActive
(
row
.
id
,
e
.
target
.
value
)
}
displayEmpty
defaultValue
=
{
row
.
status
}
className
=
{
classes
.
formControl
}
>
<
MenuItem
value
=
{
1
}
>
Ho
ạ
t
độ
ng
<
/MenuItem
>
<
MenuItem
value
=
{
2
}
>
Kho
́
a
<
/MenuItem
>
<
/Select
>
<
/TableCell
>
<
TableCell
>
{
checkRole
(
user
,
'/ncc/delete'
)
?
(
<
Tooltip
title
=
"Xoá"
>
<
IconButton
onClick
=
{()
=>
{
setSelected
({
...
row
,
title
:
'Xóa NCC thiết bị'
,
content
:
`Bạn có muốn xóa NCC thiết bị
${
row
.
provider_name
}
hay không?`
,
})
setOpen
(
true
)
}}
className
=
{
classes
.
button
}
aria
-
label
=
"Delete"
>
<
Icon
color
=
"error"
>
delete
<
/Icon
>
<
/IconButton
>
<
/Tooltip
>
)
:
null
}
{
checkRole
(
user
,
'/reconciliation/setting
/update
'
'/reconciliation/setting'
)
?
(
<
Tooltip
title
=
"Cập nhật"
>
<
IconButton
...
...
@@ -232,7 +172,7 @@ function TableList(props) {
history
.
push
({
pathname
:
'/reconciliation/setting/update'
,
state
:
row
.
id
,
state
:
row
.
provider_code
,
})
}}
className
=
{
classes
.
button
}
...
...
src/app/views/Reconciliation/Setting/Update.js
View file @
8e228715
This diff is collapsed.
Click to expand it.
src/app/views/Reconciliation/Setting/View.js
View file @
8e228715
...
...
@@ -79,11 +79,12 @@ function CustomerView(props) {
sm
=
{
8
}
xs
=
{
8
}
>
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
sm
=
{
3
}
xs
=
{
3
}
>
<
Grid
item
lg
=
{
4
}
md
=
{
4
}
sm
=
{
6
}
xs
=
{
6
}
>
<
TextField
variant
=
"outlined"
className
=
"w-full"
label
=
"Nhập từ khoá"
fullWidth
onChange
=
{(
e
)
=>
{
const
text
=
e
.
target
.
value
setTimeout
(()
=>
{
...
...
@@ -92,41 +93,6 @@ function CustomerView(props) {
}}
/
>
<
/Grid
>
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
sm
=
{
3
}
xs
=
{
3
}
>
<
FormControl
variant
=
"outlined"
fullWidth
>
<
InputLabel
htmlFor
=
"outlined-age-native-simple"
>
Tr
ạ
ng
th
á
i
<
/InputLabel
>
<
Select
label
=
"Trạng thái"
value
=
{
status
}
onChange
=
{(
e
)
=>
setStatus
(
e
.
target
.
value
)}
inputProps
=
{{
name
:
'age'
,
id
:
'outlined-age-native-simple'
,
}}
>
<
MenuItem
value
=
""
>
<
em
>
T
ấ
t
c
ả
<
/em
>
<
/MenuItem
>
{[
{
id
:
1
,
name
:
'Hoạt động'
,
},
{
id
:
2
,
name
:
'Khoá'
,
},
].
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
))}
<
/Select
>
<
/FormControl
>
<
/Grid
>
<
/Grid
>
{
/* {checkRole(user, '/reconciliation/setting/create') ? (
<Link to="/reconciliation/setting/create">
...
...
src/app/views/Reconciliation/Sheet/Index.js
View file @
8e228715
import
React
,
{
useState
,
useEffect
}
from
'react'
import
LogAuth
from
'./View'
import
{
list
Transaction
}
from
'app/apis/Functions/transac
tion'
import
{
list
SheetReconciliation
}
from
'app/apis/Functions/reconcilia
tion'
import
{
useHistory
}
from
'react-router-dom'
import
{
toPriceVnd
,
convertDate
}
from
'app/config/Function'
import
{
connect
}
from
'react-redux'
...
...
@@ -8,7 +8,7 @@ import { showLoading, hideLoading } from 'app/redux/actions/loadingAction'
import
{
toast
}
from
'react-toastify'
import
useDebounce
from
'app/hooks/useDebounce'
import
{
useTranslation
}
from
'react-i18next'
import
{
dropdownMerchant
,
dropdown
Store
}
from
'app/apis/Functions/dropdown'
import
{
dropdownMerchant
,
dropdown
Provider
}
from
'app/apis/Functions/dropdown'
const
ToolNotificate
=
(
props
)
=>
{
const
[
txtSearch
,
setTxtSearch
]
=
useState
(
''
)
...
...
@@ -22,15 +22,13 @@ const ToolNotificate = (props) => {
const
[
endDate
,
setEndDate
]
=
useState
()
const
{
t
}
=
useTranslation
()
const
[
data
,
setData
]
=
useState
([])
const
[
type
,
setType
]
=
useState
()
const
[
listType
,
setListType
]
=
useState
([])
const
[
merchant
,
setMerchant
]
=
useState
()
const
[
listMerchant
,
setListMerchant
]
=
useState
([])
const
[
store
,
setStore
]
=
useState
()
const
[
listStore
,
setListStore
]
=
useState
([])
const
[
status
,
setStatus
]
=
useState
()
const
[
listProvide
,
setListProvide
]
=
useState
([])
const
[
provide
,
setProvide
]
=
useState
()
useEffect
(()
=>
{
getData
Merchant
()
getData
Dropdown
()
},
[])
const
changeDateRange
=
(
start
,
end
)
=>
{
...
...
@@ -43,32 +41,24 @@ const ToolNotificate = (props) => {
let
res
if
(
init
)
{
setPageIndex
(
0
)
res
=
await
list
Transac
tion
({
res
=
await
list
SheetReconcilia
tion
({
order_code
:
searchDebount
,
applications
,
page_no
:
0
,
page_size
:
pageSize
,
from_date
:
startDate
?
convertDate
(
startDate
)
:
null
,
to_date
:
endDate
?
convertDate
(
endDate
)
:
null
,
type_code
:
type
,
merchant_id
:
merchant
,
store_id
:
store
,
// gasoline_id: '57dd1a73-d847-4d73-9791-08dc0841e7a9',
date_from
:
startDate
?
convertDate
(
startDate
)
:
null
,
date_to
:
endDate
?
convertDate
(
endDate
)
:
null
,
status
:
status
?
status
:
0
,
idPaymentPartner
:
provide
?
provide
:
null
,
})
}
else
{
res
=
await
list
Transac
tion
({
res
=
await
list
SheetReconcilia
tion
({
order_code
:
searchDebount
,
applications
,
page_no
:
pageIndex
+
1
,
page_size
:
pageSize
,
from_date
:
startDate
?
convertDate
(
startDate
)
:
null
,
to_date
:
endDate
?
convertDate
(
endDate
)
:
null
,
type_code
:
type
,
merchant_id
:
merchant
,
store_id
:
store
,
// gasoline_id: '57dd1a73-d847-4d73-9791-08dc0841e7a9',
status
:
status
?
status
:
0
,
idPaymentPartner
:
provide
?
provide
:
null
,
})
}
...
...
@@ -96,43 +86,15 @@ const ToolNotificate = (props) => {
useEffect
(()
=>
{
getData
(
true
)
},
[
searchDebount
,
startDate
,
type
,
merchant
,
store
])
useEffect
(()
=>
{
if
(
merchant
)
{
getDropdownStore
(
merchant
)
}
setStore
()
},
[
merchant
])
const
getDataMerchant
=
async
()
=>
{
const
res
=
await
dropdownMerchant
({})
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
const
newList
=
res
.
data
.
data
.
map
((
e
)
=>
{
return
{
...
e
,
name
:
e
.
merchant_name
}
})
setListMerchant
(
newList
)
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
})
}
}
const
getDropdownStore
=
async
(
id
)
=>
{
const
res
=
await
dropdownStore
(
id
)
},
[
searchDebount
,
startDate
,
status
,
provide
])
const
getDataDropdown
=
async
()
=>
{
const
res
=
await
dropdownProvider
({})
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
console
.
log
(
'res.data.data'
,
res
.
data
.
data
)
const
newList
=
res
.
data
.
data
.
map
((
e
)
=>
{
return
{
...
e
,
name
:
e
.
store_name
}
})
setListStore
(
newList
)
}
else
{
toast
.
error
(
t
(
res
.
data
.
error
),
{
theme
:
'colored'
,
return
{
...
e
,
id
:
e
.
code
}
})
setListProvide
(
newList
)
}
}
...
...
@@ -147,15 +109,11 @@ const ToolNotificate = (props) => {
applications
=
{
applications
}
startDate
=
{
startDate
}
changeDateRange
=
{
changeDateRange
}
type
=
{
type
}
setType
=
{
setType
}
listType
=
{
listType
}
merchant
=
{
merchant
}
setMerchant
=
{
setMerchant
}
listMerchant
=
{
listMerchant
}
store
=
{
store
}
setStore
=
{
setStore
}
listStore
=
{
listStore
}
listProvide
=
{
listProvide
}
provide
=
{
provide
}
setProvide
=
{
setProvide
}
status
=
{
status
}
setStatus
=
{
setStatus
}
/
>
)
}
...
...
src/app/views/Reconciliation/Sheet/ListTrans/Index.js
View file @
8e228715
...
...
@@ -39,6 +39,7 @@ const ToolNotificate = (props) => {
}
const
getData
=
async
(
init
)
=>
{
if
(
props
?.
idReconciliation
)
{
props
.
showLoading
()
let
res
if
(
init
)
{
...
...
@@ -52,6 +53,8 @@ const ToolNotificate = (props) => {
payment_gate_code
:
null
,
statusReconciliation
:
0
,
type_payment
:
null
,
idReconciliation
:
props
?.
idReconciliation
,
is_reconciliation
:
true
,
})
}
else
{
res
=
await
listTransReconciliation
({
...
...
@@ -63,6 +66,8 @@ const ToolNotificate = (props) => {
payment_gate_code
:
null
,
statusReconciliation
:
0
,
type_payment
:
null
,
idReconciliation
:
props
?.
idReconciliation
,
is_reconciliation
:
true
,
})
}
...
...
@@ -84,6 +89,7 @@ const ToolNotificate = (props) => {
})
}
}
}
useEffect
(()
=>
{
getData
(
false
)
...
...
src/app/views/Reconciliation/Sheet/Table.js
View file @
8e228715
...
...
@@ -12,13 +12,17 @@ import {
MenuItem
,
Tooltip
,
Icon
,
Typography
,
}
from
'@material-ui/core'
import
EditIcon
from
'@material-ui/icons/Edit'
import
DeleteIcon
from
'@material-ui/icons/Delete'
import
colors
from
'app/assets/Color'
import
useStyles
from
'app/styles/Table'
import
{
Breadcrumb
,
SimpleCard
}
from
'app/components'
import
{
toPriceVnd
}
from
'app/config/Function'
import
{
checkRole
}
from
'app/config/Function'
import
useAuth
from
'app/hooks/useAuth'
import
{
useHistory
}
from
'react-router-dom'
const
columns
=
[
{
id
:
'index'
,
...
...
@@ -26,73 +30,44 @@ const columns = [
align
:
'center'
,
minWidth
:
80
,
},
{
id
:
'
store_nam
e'
,
label
:
'
Cây xăng
'
,
id
:
'
cod
e'
,
label
:
'
Mã phiếu đối soát
'
,
align
:
'left'
,
minWidth
:
160
,
},
// {
// id: 'application',
// label: 'Mã NV',
// align: 'left',
// minWidth: 140,
// },
{
id
:
'
order_code
'
,
label
:
'
Mã hoá đơn
'
,
id
:
'
idPaymentPartner
'
,
label
:
'
Đối tác
'
,
align
:
'left'
,
minWidth
:
160
,
},
{
id
:
'created_date'
,
label
:
'Ngày giao dịch'
,
align
:
'left'
,
minWidth
:
110
,
minWidth
:
80
,
},
// {
// id: 'IP',
// label: 'Loại nhiên liệu',
// align: 'left',
// minWidth: 140,
// },
{
id
:
'
product_nam
e'
,
label
:
'
Sản phẩm
'
,
id
:
'
create_dat
e'
,
label
:
'
Ngày tạo phiếu
'
,
align
:
'left'
,
minWidth
:
1
2
0
,
minWidth
:
1
1
0
,
},
{
id
:
'u
nit_pric
e'
,
label
:
'
Đơn giá
'
,
id
:
'u
pdate_dat
e'
,
label
:
'
Ngày cập nhật
'
,
align
:
'left'
,
minWidth
:
8
0
,
minWidth
:
11
0
,
},
{
id
:
'
quantity
'
,
label
:
'
Lượng nhiên liệu
'
,
id
:
'
date_reconciliation
'
,
label
:
'
Ngày đối soát
'
,
align
:
'left'
,
minWidth
:
8
0
,
minWidth
:
11
0
,
},
{
id
:
'
price
'
,
label
:
'
Thành tiền
'
,
id
:
'
totalCommission
'
,
label
:
'
Hoa hồng
'
,
align
:
'left'
,
minWidth
:
80
,
},
{
id
:
'type_payment'
,
label
:
'Phương thức thanh toán'
,
align
:
'left'
,
minWidth
:
100
,
},
{
id
:
'status_text'
,
label
:
'Trạng thái'
,
align
:
'left'
,
minWidth
:
100
,
isMonney
:
true
,
},
]
...
...
@@ -109,14 +84,26 @@ function TableList(props) {
pageIndex
,
totalRecords
,
}
=
props
let
history
=
useHistory
()
const
handleChangePage
=
(
event
,
newPage
)
=>
{
setPageIndex
(
newPage
)
}
const
handleChangeRowsPerPage
=
(
event
)
=>
{
setPageSize
(
event
.
target
.
value
)
}
const
renderStatusBg
=
(
status
)
=>
{
if
(
status
==
3
)
return
'#ECFDF3'
if
(
status
==
2
)
return
'#FFDC98'
return
'#F2F4F7'
}
const
renderStatusColor
=
(
status
)
=>
{
if
(
status
==
3
)
return
'#027A48'
if
(
status
==
2
)
return
'#F1AA1F'
return
'#344054'
}
const
{
user
}
=
useAuth
()
return
(
<
Paper
className
=
{
classes
.
root
}
>
<
TableContainer
className
=
{
classes
.
container
}
>
...
...
@@ -135,6 +122,23 @@ function TableList(props) {
{
column
.
label
}
<
/TableCell
>
))}
<
TableCell
style
=
{{
width
:
110
,
backgroundColor
:
colors
.
headerTable
,
}}
>
Tr
ạ
ng
th
á
i
<
/TableCell
>
<
TableCell
style
=
{{
textAlign
:
'center'
,
backgroundColor
:
colors
.
headerTable
,
width
:
60
,
}}
>
H
à
nh
độ
ng
<
/TableCell
>
<
/TableRow
>
<
/TableHead
>
<
TableBody
className
=
{
classes
.
columnTable
}
>
...
...
@@ -147,28 +151,71 @@ function TableList(props) {
key
=
{
row
.
id
}
>
{
columns
.
map
((
column
)
=>
{
const
avatar
=
row
[
column
.
id
]
const
data
=
row
[
column
.
id
]
return
(
<
TableCell
key
=
{
column
.
id
}
align
=
{
column
.
align
}
style
=
{{
textAlign
:
column
.
id
===
'index'
?
'center'
:
typeof
data
==
'string'
?
'left'
:
'right'
,
}}
>
{
column
.
format
?
(
<
img
src
=
{
column
.
format
(
avatar
)}
className
=
{
classes
.
image
}
/
>
)
:
(
avatar
)}
{
column
.
isMonney
?
toPriceVnd
(
data
)
:
data
}
<
/TableCell
>
)
})}
<
TableCell
style
=
{{
textAlign
:
'center'
,
}}
>
<
Typography
style
=
{{
padding
:
5
,
backgroundColor
:
renderStatusBg
(
row
?.
status
),
color
:
renderStatusColor
(
row
?.
status
),
borderRadius
:
10
,
}}
>
{
row
?.
status_name
}
<
/Typography
>
<
/TableCell
>
<
TableCell
>
{
checkRole
(
user
,
'/reconciliation/sheet'
)
?
(
<
Tooltip
title
=
"Cập nhật"
>
<
IconButton
onClick
=
{()
=>
{
history
.
push
({
pathname
:
'/reconciliation/sheet/update'
,
state
:
row
.
id
,
})
}}
className
=
{
classes
.
button
}
aria
-
label
=
"edit"
>
<
Icon
color
=
"primary"
>
edit
<
/Icon
>
<
/IconButton
>
<
/Tooltip
>
)
:
null
}
<
/TableCell
>
<
/TableRow
>
)
})}
...
...
src/app/views/Reconciliation/Sheet/Update.js
View file @
8e228715
...
...
@@ -14,7 +14,7 @@ import {
TextField
,
Icon
,
}
from
'@material-ui/core'
import
{
createFunction
}
from
'app/apis/Functions/function'
import
{
showLoading
,
hideLoading
}
from
'app/redux/actions/loadingAction'
import
{
toast
}
from
'react-toastify'
import
{
Breadcrumb
,
SimpleCard
}
from
'app/components'
...
...
@@ -28,27 +28,51 @@ import {
dropdownStore
,
}
from
'app/apis/Functions/dropdown'
import
PickerImage
from
'app/components/Input/PickerImage'
import
{
createSupplier
}
from
'app/apis/Functions/supplier'
import
{
detailSheetReconciliation
,
updateSheetReconciliation
,
}
from
'app/apis/Functions/reconciliation'
import
{
useTranslation
}
from
'react-i18next'
import
useAuth
from
'app/hooks/useAuth'
import
ListTrans
from
'./ListTrans/Index'
const
SimpleForm
=
(
props
)
=>
{
const
location
=
useLocation
()
const
[
state
,
setState
]
=
useState
({})
const
[
listDrop
,
setListDrop
]
=
useState
([])
const
[
listAction
,
setListAction
]
=
useState
([])
useEffect
(()
=>
{
getDataDefault
()
},
[])
const
{
user
}
=
useAuth
()
const
{
t
}
=
useTranslation
()
const
history
=
useHistory
()
const
getDataDefault
=
async
()
=>
{
props
.
showLoading
()
try
{
const
res
=
await
detailSheetReconciliation
(
location
.
state
,
{})
if
(
res
.
data
.
data
)
{
setState
({
...
res
.
data
.
data
})
}
}
catch
(
err
)
{
toast
.
error
(
t
(
err
),
{
theme
:
'colored'
,
})
}
props
.
hideLoading
()
}
const
handleSubmit
=
async
(
event
)
=>
{
const
newValue
=
trimObject
(
state
)
props
.
showLoading
()
const
res
=
await
createSupplier
({
const
res
=
await
updateSheetReconciliation
({
...
newValue
,
type
:
'3'
,
status
:
1
,
...
...
@@ -76,8 +100,8 @@ const SimpleForm = (props) => {
[
event
.
target
.
name
]:
event
.
target
.
value
,
})
}
const
{
provider_code
,
provider_name
,
phone
,
email
,
address
}
=
state
console
.
log
(
'state'
,
state
)
const
{
code
,
idPaymentPartner
,
note
}
=
state
return
(
<
div
className
=
"m-sm-30"
>
<
div
className
=
"mb-sm-30"
>
...
...
@@ -139,8 +163,8 @@ const SimpleForm = (props) => {
onChange
=
{
handleChange
}
disabled
=
{
true
}
type
=
"text"
name
=
"
provider_
code"
value
=
{
provider_
code
||
''
}
name
=
"code"
value
=
{
code
||
''
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
...
...
@@ -155,8 +179,8 @@ const SimpleForm = (props) => {
disabled
=
{
true
}
onChange
=
{
handleChange
}
type
=
"text"
name
=
"
provider_code
"
value
=
{
provider_code
||
''
}
name
=
"
idPaymentPartner
"
value
=
{
idPaymentPartner
||
''
}
validators
=
{[
'required'
]}
errorMessages
=
{[
'Không được để trống trường này'
,
...
...
@@ -171,8 +195,8 @@ const SimpleForm = (props) => {
label
=
"Ghi chú"
onChange
=
{
handleChange
}
type
=
"text"
name
=
"
address
"
value
=
{
address
||
''
}
name
=
"
note
"
value
=
{
note
||
''
}
/
>
<
/Grid
>
...
...
@@ -185,7 +209,10 @@ const SimpleForm = (props) => {
container
spacing
=
{
2
}
>
<
ListTrans
isDetail
=
{
false
}
/
>
<
ListTrans
isDetail
=
{
false
}
idReconciliation
=
{
location
.
state
}
/
>
<
/Grid
>
<
/Grid
>
<
/ValidatorForm
>
...
...
src/app/views/Reconciliation/Sheet/View.js
View file @
8e228715
...
...
@@ -33,15 +33,12 @@ function CustomerView(props) {
applications
,
startDate
,
changeDateRange
,
type
,
setType
,
listType
,
listMerchant
,
setMerchant
,
merchant
,
store
,
setStore
,
listStore
,
status
,
setStatus
,
provide
,
setProvide
,
listProvide
,
}
=
props
const
handleChange
=
(
event
)
=>
{
...
...
@@ -71,7 +68,7 @@ function CustomerView(props) {
container
spacing
=
{
3
}
>
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
sm
=
{
3
}
xs
=
{
3
}
>
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
sm
=
{
4
}
xs
=
{
4
}
>
<
TextField
variant
=
"outlined"
className
=
"w-full"
...
...
@@ -86,12 +83,12 @@ function CustomerView(props) {
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
sm
=
{
3
}
xs
=
{
3
}
>
<
FormControl
variant
=
"outlined"
fullWidth
>
<
InputLabel
htmlFor
=
"outlined-age-native-simple"
>
Ph
ươ
ng
th
ứ
c
thanh
to
á
n
Tr
ạ
ng
th
á
i
<
/InputLabel
>
<
Select
label
=
"
Phương thức thanh toán
"
value
=
{
type
}
onChange
=
{(
e
)
=>
set
Type
(
e
.
target
.
value
)}
label
=
"
Trạng thái
"
value
=
{
status
}
onChange
=
{(
e
)
=>
set
Status
(
e
.
target
.
value
)}
inputProps
=
{{
name
:
'age'
,
id
:
'outlined-age-native-simple'
,
...
...
@@ -102,16 +99,25 @@ function CustomerView(props) {
<
/MenuItem
>
{[
{
id
:
'QR'
,
name
:
'QR'
,
name
:
'Nháp'
,
value
:
1
,
id
:
1
,
},
{
name
:
'Chưa đối soát'
,
value
:
2
,
id
:
2
,
},
{
id
:
'CASH'
,
name
:
'Tiền mặt'
,
name
:
'Đang đối soát'
,
value
:
3
,
id
:
3
,
},
{
id
:
'DEBT'
,
name
:
'Công nợ'
,
name
:
'Đã đối soát'
,
value
:
4
,
id
:
4
,
},
].
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
...
...
@@ -122,35 +128,12 @@ function CustomerView(props) {
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
sm
=
{
3
}
xs
=
{
3
}
>
<
FormControl
variant
=
"outlined"
fullWidth
>
<
InputLabel
htmlFor
=
"outlined-age-native-simple"
>
Ph
á
p
nh
â
n
<
/InputLabel
>
<
Select
label
=
"Pháp nhân"
value
=
{
merchant
}
onChange
=
{(
e
)
=>
setMerchant
(
e
.
target
.
value
)}
inputProps
=
{{
name
:
'age'
,
id
:
'outlined-age-native-simple'
,
}}
>
<
MenuItem
value
=
""
>
<
em
>
T
ấ
t
c
ả
<
/em
>
<
/MenuItem
>
{
listMerchant
.
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
))}
<
/Select
>
<
/FormControl
>
<
/Grid
>
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
sm
=
{
3
}
xs
=
{
3
}
>
<
FormControl
variant
=
"outlined"
fullWidth
>
<
InputLabel
htmlFor
=
"outlined-age-native-simple"
>
C
â
y
x
ă
ng
Đố
i
t
á
c
<
/InputLabel
>
<
Select
label
=
"
Cây xăng
"
value
=
{
stor
e
}
onChange
=
{(
e
)
=>
set
Stor
e
(
e
.
target
.
value
)}
label
=
"
Đối tác
"
value
=
{
provid
e
}
onChange
=
{(
e
)
=>
set
Provid
e
(
e
.
target
.
value
)}
inputProps
=
{{
name
:
'age'
,
id
:
'outlined-age-native-simple'
,
...
...
@@ -159,12 +142,13 @@ function CustomerView(props) {
<
MenuItem
value
=
""
>
<
em
>
T
ấ
t
c
ả
<
/em
>
<
/MenuItem
>
{
list
Stor
e
.
map
((
e
)
=>
(
{
list
Provid
e
.
map
((
e
)
=>
(
<
MenuItem
value
=
{
e
.
id
}
>
{
e
.
name
}
<
/MenuItem
>
))}
<
/Select
>
<
/FormControl
>
<
/Grid
>
<
Grid
item
lg
=
{
3
}
md
=
{
3
}
sm
=
{
3
}
xs
=
{
3
}
>
<
DateRange
date
=
{
startDate
}
...
...
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