Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TOSTUMI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
Maple
TOSTUMI
Commits
1af4a334
Commit
1af4a334
authored
Nov 06, 2020
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预订完善,基本解决
Signed-off-by:
cellee
<
893264950@qq.com
>
parent
d8a40b9f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
44 deletions
+62
-44
BookingDetail.tsx
...es/CommunityManagement/FacilityBookings/BookingDetail.tsx
+44
-29
Facility.tsx
src/pages/CommunityManagement/FacilityBookings/Facility.tsx
+8
-4
Bookings.less
...es/CommunityManagement/FacilityBookings/css/Bookings.less
+0
-1
tip.ts
src/utils/tip.ts
+10
-10
No files found.
src/pages/CommunityManagement/FacilityBookings/BookingDetail.tsx
View file @
1af4a334
...
...
@@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef } from 'react';
import
styles
from
'./css/index.less'
;
import
'./css/index.less'
;
import
{
Input
,
Input
Number
,
Descriptions
,
Spin
,
Space
,
...
...
@@ -41,15 +41,17 @@ const BookingDetail = (props: any) => {
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
[
modalItem
,
setModalIteme
]
=
useState
({
title
:
''
,
tab
:
1
});
const
[
backFeeFlag
,
setBackFeeFlag
]
=
useState
(
false
);
const
[
backFeeFlag
,
setBackFeeFlag
]
=
useState
(
false
);
// 部分退费 与 全部退费
const
[
curbackFee
,
setCurBackFee
]
=
useState
(
0
);
// 设置默认全款退费
useEffect
(()
=>
{
if
(
DataSaveDetail
!=
null
)
{
setCurBackFee
(
DataSaveDetail
.
marginFee
);
}
},
[
DataSaveDetail
]);
const
radioStyle
=
{
display
:
'block'
,
height
:
'
30px'
,
lineHeight
:
'3
0px'
};
const
radioStyle
=
{
display
:
'block'
,
height
:
'
50px'
,
lineHeight
:
'5
0px'
};
const
formRef
=
useRef
(
null
);
const
backFee
=
(
e
:
any
)
=>
{
...
...
@@ -63,8 +65,11 @@ const BookingDetail = (props: any) => {
const
onFinish
=
(
values
:
any
)
=>
{
var
val
=
values
;
if
(
val
.
backMarginFeeReason
==
null
)
{
message
.
error
(
'Back marginFee reason is empty!'
,
3
);
// 如果选择了 部分退款 则 需要填写 理由 且不为全额退款的默认值
if
(
curbackFee
==
DataSaveDetail
.
marginFee
)
{
message
.
error
(
'Please Fill In The Refund Amount Less Than The Full Amount!'
,
3
);
}
else
if
(
backFeeFlag
&&
val
.
backMarginFeeReason
==
null
)
{
message
.
error
(
'Back MarginFee Reason Is Empty!'
,
3
);
}
else
{
var
RAVAL
=
{
accountCategoriesId
:
DataSave
.
id
,
...
...
@@ -83,8 +88,9 @@ const BookingDetail = (props: any) => {
console
.
log
(
'Failed:'
,
errorInfo
);
};
// 退款金额改变
const
getBackMarginFee
=
(
e
:
any
)
=>
{
setCurBackFee
(
e
.
target
.
value
);
setCurBackFee
(
e
);
};
const
makeFee
=
()
=>
{
setModalIteme
({
title
:
'Deposit And Fee'
,
tab
:
2
});
...
...
@@ -182,28 +188,37 @@ const BookingDetail = (props: any) => {
onFinish=
{
onFinish
}
onFinishFailed=
{
onFinishFailed
}
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
>
已交管理费
</
Col
>
<
Col
span=
{
2
}
>
{
DataSaveDetail
.
managerFee
}
</
Col
>
<
Col
>
已交押金
</
Col
>
<
Col
span=
{
2
}
>
{
DataSaveDetail
.
marginFee
}
</
Col
>
</
Row
>
<
Descriptions
>
<
Descriptions
.
Item
label=
"Management Expense"
>
$
{
parseInt
(
DataSaveDetail
.
managerFee
).
toFixed
(
2
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Deposit"
>
$
{
parseInt
(
DataSaveDetail
.
marginFee
).
toFixed
(
2
)
}
</
Descriptions
.
Item
>
</
Descriptions
>
<
div
style=
{
{
marginTop
:
16
}
}
>
<
Radio
.
Group
onChange=
{
backFee
}
defaultValue=
{
1
}
>
<
Radio
value=
{
1
}
style=
{
radioStyle
}
>
全额退还
</
Radio
>
<
Radio
value=
{
2
}
style=
{
radioStyle
}
>
部分退还
{
' '
}
{
backFeeFlag
?
(
<>
<
Input
onChange=
{
getBackMarginFee
}
style=
{
{
width
:
80
}
}
/>
$
</>
)
:
null
}
</
Radio
>
</
Radio
.
Group
>
</
div
>
<
Radio
.
Group
onChange=
{
backFee
}
defaultValue=
{
1
}
>
<
Radio
value=
{
1
}
style=
{
radioStyle
}
>
Full Refund
</
Radio
>
<
Radio
value=
{
2
}
style=
{
radioStyle
}
>
Partial Refund
{
backFeeFlag
?
(
<>
<
InputNumber
placeholder=
"00.00"
min=
{
0
}
max=
{
parseInt
(
DataSaveDetail
.
marginFee
).
toFixed
(
2
)
}
maxLength=
{
6
}
step=
{
0.01
}
prefix=
"$"
onChange=
{
getBackMarginFee
}
style=
{
{
width
:
80
,
marginLeft
:
10
}
}
/>
</>
)
:
null
}
</
Radio
>
</
Radio
.
Group
>
{
backFeeFlag
?
(
<
div
style=
{
{
marginTop
:
16
}
}
>
...
...
@@ -219,7 +234,7 @@ const BookingDetail = (props: any) => {
<
div
style=
{
{
marginTop
:
16
}
}
>
<
Form
.
Item
>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
load
}
>
退还押金
Deposit Refunds
</
Button
>
</
Form
.
Item
>
</
div
>
...
...
@@ -229,7 +244,7 @@ const BookingDetail = (props: any) => {
)
:
null
}
{
DataSave
.
status
==
1
||
DataSave
.
status
==
2
?
(
<
Button
onClick=
{
showModal
}
loading=
{
load
}
>
取消预约
Cancel Reservation
</
Button
>
)
:
null
}
<
Modal
...
...
src/pages/CommunityManagement/FacilityBookings/Facility.tsx
View file @
1af4a334
...
...
@@ -45,7 +45,7 @@ const module = 'FacilityBookings';
import
moment
from
'moment'
;
const
Facility
=
(
props
:
any
)
=>
{
const
{
dispatch
,
location
,
token
,
sourceData
,
DataSave
,
Result
,
imgList
}
=
props
;
const
{
dispatch
,
location
,
token
,
sourceData
,
DataSave
,
Result
,
imgList
,
load
}
=
props
;
const
RA
=
(
index
:
any
,
values
:
any
)
=>
{
dispatch
({
type
:
'FacilityBookings/RA'
,
playload
:
{
index
:
index
,
body
:
values
}
});
...
...
@@ -457,13 +457,13 @@ const Facility = (props: any) => {
</Row> */
}
{
facilityDetail
?
(
<>
<
Button
type=
"primary"
onClick=
{
Subscribe
}
>
<
Button
type=
"primary"
onClick=
{
Subscribe
}
loading=
{
load
}
>
Subscribe
</
Button
>
</>
)
:
(
<>
<
Button
type=
"primary"
htmlType=
"submit"
>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
load
}
>
Submit
</
Button
>
</>
...
...
@@ -474,15 +474,19 @@ const Facility = (props: any) => {
};
function
mapStateToProps
(
state
:
any
)
{
console
.
log
(
state
);
const
{
sourceData
,
DataSave
,
Result
,
imgList
}
=
state
.
FacilityBookings
;
const
{
token
}
=
state
.
login
;
const
load
=
typeof
state
.
loading
.
models
.
FacilityBookings
==
'undefined'
?
true
:
state
.
loading
.
models
.
FacilityBookings
;
return
{
DataSave
,
sourceData
,
token
,
Result
,
imgList
,
load
,
};
}
export
default
connect
(
mapStateToProps
)(
Facility
);
...
...
src/pages/CommunityManagement/FacilityBookings/css/Bookings.less
View file @
1af4a334
...
...
@@ -73,7 +73,6 @@
line-height: 32px;
}
.box2item2 {
width: 336px;
padding-left: 135px;
}
// 线栏
...
...
src/utils/tip.ts
View file @
1af4a334
...
...
@@ -29,16 +29,16 @@ export const Notice = [
// 新增设施
export
const
NewFaci
=
[
[{
required
:
fals
e
,
message
:
'Please select community'
}],
[{
required
:
fals
e
,
message
:
'Please input Facility Name'
}],
[{
required
:
fals
e
,
message
:
'Please Set management fee'
}],
[{
required
:
fals
e
,
message
:
'Please Set Setting deposit'
}],
[{
required
:
fals
e
,
message
:
'Please Upload facility photos'
}],
[{
required
:
fals
e
,
message
:
'Required'
}],
[{
required
:
fals
e
,
message
:
'Required'
}],
[{
required
:
fals
e
,
message
:
'Required'
}],
[{
required
:
fals
e
,
message
:
'Required'
}],
[{
required
:
fals
e
,
message
:
'Required'
}],
[{
required
:
tru
e
,
message
:
'Please select community'
}],
[{
required
:
tru
e
,
message
:
'Please input Facility Name'
}],
[{
required
:
tru
e
,
message
:
'Please Set management fee'
}],
[{
required
:
tru
e
,
message
:
'Please Set Setting deposit'
}],
[{
required
:
tru
e
,
message
:
'Please Upload facility photos'
}],
[{
required
:
tru
e
,
message
:
'Required'
}],
[{
required
:
tru
e
,
message
:
'Required'
}],
[{
required
:
tru
e
,
message
:
'Required'
}],
[{
required
:
tru
e
,
message
:
'Required'
}],
[{
required
:
tru
e
,
message
:
'Required'
}],
];
// 设施预订
...
...
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