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
19cc11ab
Commit
19cc11ab
authored
Sep 08, 2020
by
maple
Committed by
MrShi
Sep 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix]合同新建和编辑
(cherry picked from commit
b24ce801
)
parent
b570b13b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
122 additions
and
49 deletions
+122
-49
Contract.ts
src/models/CommunityManagement/Contract.ts
+5
-13
Contract.tsx
src/pages/ContractManagement/Contract.tsx
+4
-2
ContractContent.tsx
src/pages/ContractManagement/ContractContent.tsx
+96
-32
tos.ts
src/services/tos.ts
+4
-1
method.ts
src/utils/method.ts
+13
-1
No files found.
src/models/CommunityManagement/Contract.ts
View file @
19cc11ab
...
...
@@ -33,7 +33,7 @@ export default {
//预订设施查询
*
RA
({
playload
},
{
call
,
put
})
{
console
.
log
(
"开始请求"
)
const
resp
=
yield
call
(
service
.
RA
,
playload
);
console
.
log
(
resp
)
if
(
resp
.
code
==
500
||
resp
.
error_code
!=
"0000"
)
{
...
...
@@ -58,18 +58,10 @@ export default {
yield
put
({
type
:
'returnDataSaveDetail'
,
DataSaveDetail
});
}
break
;
case
18
:
case
14
:{
message
.
success
(
"Success Operation!"
,
3
)
// window.location.href = '/CommunityManagement/FacilityBookings';
history
.
push
(
"/UserManagement/LIFEUserManagement"
)
}
break
;
case
13
:
{
let
DataSaveDetail
=
resp
.
data
;
yield
put
({
type
:
'DataSaveDetail'
,
DataSaveDetail
});
}
break
;
case
16
:
{
console
.
log
(
"等待删除完成"
)
case
27
:
{
var
tmp
=
resp
yield
put
({
type
:
'returnResult'
,
tmp
})
history
.
back
()
}
break
;
}
...
...
src/pages/ContractManagement/Contract.tsx
View file @
19cc11ab
...
...
@@ -35,7 +35,8 @@ const Contract = (props:any) => {
SA
(
record
)
history
.
push
(
location
.
pathname
+
'/Detail'
)
}
const
goToEdit
=
()
=>
{
const
goToEdit
=
(
record
:
any
,
e
:
any
)
=>
{
SA
(
record
)
history
.
push
(
location
.
pathname
+
'/Edit'
)
}
...
...
@@ -51,6 +52,7 @@ const Contract = (props:any) => {
title
:
"Actions"
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
Space
size=
"middle"
>
<
a
onClick=
{
goToEdit
.
bind
(
this
,
record
)
}
>
Edit
</
a
>
<
a
onClick=
{
goToDetail
.
bind
(
this
,
record
)
}
>
Detail
</
a
>
</
Space
>
),
...
...
@@ -74,7 +76,7 @@ const Contract = (props:any) => {
{
/* 列表组件 */
}
{
Data
!=
null
?<
Table
rowKey=
{
"id"
}
style=
{
{
marginTop
:
16
}
}
dataSource=
{
Data
.
list
}
columns=
{
columns
}
pagination=
{
{
defaultCurrent
:
1
,
total
:
16
}
}
/>:
null
Data
!=
null
?<
Table
rowKey=
{
"id"
}
style=
{
{
marginTop
:
16
}
}
dataSource=
{
Data
.
list
}
columns=
{
columns
}
pagination=
{
{
defaultCurrent
:
1
,
total
:
Data
.
totalRow
}
}
/>:
null
}
...
...
src/pages/ContractManagement/ContractContent.tsx
View file @
19cc11ab
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
styles
from
'./ContractContent.less'
;
import
{
Input
,
Menu
,
Table
,
Space
,
Pagination
,
Tooltip
}
from
'antd'
;
import
{
Input
,
Form
,
Table
,
Space
,
Pagination
,
Tooltip
,
message
}
from
'antd'
;
import
{
Link
,
useIntl
,
connect
,
Dispatch
}
from
'umi'
;
import
{
DatePicker
}
from
'antd'
;
...
...
@@ -11,22 +11,34 @@ import { UploadOutlined } from '@ant-design/icons';
import
LINE
from
'../../components/Line/Line'
;
import
TextArea
from
'antd/lib/input/TextArea'
;
const
uploadProps
=
{
// action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
onChange
({
file
,
fileList
})
{
if
(
file
.
status
!==
'uploading'
)
{
console
.
log
(
file
,
fileList
);
}
},
};
import
moment
from
'moment'
;
import
SearchOptionsCommnity
from
'@/components/SearchOptions/SearchOptionsCommnity'
;
const
ContractContent
=
(
props
:
any
)
=>
{
const
{
dispatch
,
location
,
DataSave
,
DataSaveDetail
}
=
props
;
const
formRef
=
useRef
(
null
);
const
RA
=
(
index
:
any
,
values
:
any
)
=>
{
dispatch
({
type
:
'Contract/RA'
,
playload
:
{
index
:
index
,
body
:
values
}
})
};
const
[
editFlag
,
setEditFlag
]
=
useState
(
false
);
const
[
editFlag
,
setEditFlag
]
=
useState
(
false
);
const
[
extend
,
setExtend
]
=
useState
();
const
[
fileList
,
setFileList
]
=
useState
([]);
// const ad = [{ uid:"1",name: "A.pdf",status: "done" }]
const
uploadProps
=
{
accept
:
".pdf,"
,
action
:
"/tos/image/upload"
,
data
:
{
imageType
:
"tosContract"
,
extends
:
extend
},
fileList
:
fileList
,
onChange
({
file
,
fileList
})
{
let
tmp
=
fileList
setFileList
(
tmp
.
filter
(
file
=>
!!
file
.
status
))
if
(
file
.
status
==
'done'
)
{
console
.
log
(
fileList
);
message
.
success
(
file
.
name
,
3
)
}
},
};
useEffect
(()
=>
{
if
((
location
.
pathname
).
indexOf
(
"/Edit"
)
>-
1
)
{
setEditFlag
(
true
)
...
...
@@ -47,13 +59,36 @@ const ContractContent = (props: any) => {
useEffect
(()
=>
{
if
(
DataSaveDetail
!=
null
)
{
console
.
log
(
DataSaveDetail
)
if
(
editFlag
)
{
setExtend
(
DataSaveDetail
.
communityName
)
var
result
=
new
Array
()
if
(
DataSaveDetail
.
fileUrls
!=
null
)
{
DataSaveDetail
.
fileUrls
.
map
((
item
:
any
,
index
:
any
)
=>
{
result
.
push
({
uid
:
index
,
name
:
item
})
})
}
setFileList
(
result
)
formRef
.
current
.
setFieldsValue
({
contractFileName
:
"cleanFiles"
,
contractNumber
:
"456"
,
contractPartyA
:
"国企A"
,
contractPartyB
:
"民企B"
,
contractTitle
:
"清洁服务协议"
,
contractValidEndDate
:
moment
(
"2020-09-21"
,
"YYYY-MM-DD"
),
contractValidStartDate
:
moment
(
"2020-08-28"
,
"YYYY-MM-DD"
),
})
}
}
},
[
DataSaveDetail
])
const
goToReturn
=
()
=>
{
// console.log(fileList)
history
.
back
()
}
// communityName: "A7"
// contractFileName: "cleanFiles"
// contractNumber: "456"
...
...
@@ -68,50 +103,78 @@ const ContractContent = (props: any) => {
// extend: ""
// fileUrls: Array(1)
// 0: "http://acc-huahu
const
extendName
=
(
values
:
any
)
=>
{
console
.
log
(
values
);
setExtend
(
values
)
}
const
onFinish
=
(
values
:
any
)
=>
{
values
.
contractValidStartDate
=
values
.
contractValidStartDate
.
format
(
'YYYY-MM-DD'
)
values
.
contractValidEndDate
=
values
.
contractValidEndDate
.
format
(
'YYYY-MM-DD'
)
values
.
communityName
=
extend
var
data
=
new
Array
()
for
(
var
i
=
0
;
i
<
fileList
.
length
;
i
++
){
data
.
push
(
fileList
[
i
].
name
)
}
values
.
contractFileNameList
=
data
RA
(
27
,
values
)
console
.
log
(
values
)
}
return
(
<
div
className=
{
styles
.
base
}
>
{
/* 头部组件 */
}
<
div
className=
{
styles
.
box
}
>
<
div
className=
{
styles
.
item1
}
>
Edit Service Provider
</
div
>
<
div
className=
{
styles
.
item1
}
>
{
editFlag
?
"Edit Service Provider"
:
"Service Provider Detail"
}
</
div
>
<
button
className=
{
styles
.
item3
}
onClick=
{
goToReturn
}
>
返回
</
button
>
</
div
>
{
/* </div>
// "contractNumber":"7891222",
// "contractPartyA":"央企Q",
// "contractPartyB":"私企E",
// "communityName":"A7",
// "contractValidStartDate":"2020-07-01",
// "contractValidEndDate":"2020-08-01",
// "contractFileName":"维修协议概述",
// "contractRemindContent":"提醒内容111",
// "contractFileNameList": ["A.pdf"] */
}
<
Form
ref=
{
formRef
}
name=
"basic"
onFinish=
{
onFinish
}
>
<
div
className=
{
styles
.
box1
}
>
<
div
className=
{
styles
.
box1item1
}
>
Contract Code
</
div
>
<
div
className
=
{
styles
.
box1item2
}
>
{
editFlag
?(<
Input
style=
{
{
width
:
200
}
}
placeholder=
"Contract Code"
/
>):(
DataSaveDetail
!=
null
?
DataSaveDetail
.
contractNumber
:
null
)
}
</
div
>
<
div
className
=
{
styles
.
box1item2
}
>
{
editFlag
?(<
Form
.
Item
name=
"contractNumber"
><
Input
style=
{
{
width
:
200
}
}
placeholder=
"Contract Code"
/></
Form
.
Item
>):(
DataSaveDetail
!=
null
?
DataSaveDetail
.
contractNumber
:
null
)
}
</
div
>
<
div
className=
{
styles
.
box1item3
}
>
Contract Party A
</
div
>
<
div
className=
{
styles
.
box1item4
}
>
{
editFlag
?(<
Input
style=
{
{
width
:
200
}
}
placeholder=
"Corporate Name"
/
>):(
DataSaveDetail
!=
null
?
DataSaveDetail
.
contractPartyA
:
null
)
}
</
div
>
<
div
className=
{
styles
.
box1item4
}
>
{
editFlag
?(<
Form
.
Item
name=
"contractPartyA"
><
Input
style=
{
{
width
:
200
}
}
placeholder=
"Corporate Name"
/></
Form
.
Item
>):(
DataSaveDetail
!=
null
?
DataSaveDetail
.
contractPartyA
:
null
)
}
</
div
>
<
div
className=
{
styles
.
box1item5
}
>
Contract Party B
</
div
>
<
div
className=
{
styles
.
box1item6
}
>
{
editFlag
?(<
Input
style=
{
{
width
:
200
}
}
placeholder=
"Corporate Name"
/
>):(
DataSaveDetail
!=
null
?
DataSaveDetail
.
contractPartyB
:
null
)
}
</
div
>
<
div
className=
{
styles
.
box1item6
}
>
{
editFlag
?(<
Form
.
Item
name=
"contractPartyB"
><
Input
style=
{
{
width
:
200
}
}
placeholder=
"Corporate Name"
/></
Form
.
Item
>):(
DataSaveDetail
!=
null
?
DataSaveDetail
.
contractPartyB
:
null
)
}
</
div
>
</
div
>
<
div
className=
{
styles
.
box5
}
>
<
div
className=
{
styles
.
box5item1
}
>
Project
</
div
>
<
div
className=
{
styles
.
box5item2
}
>
{
editFlag
?(<
Input
style=
{
{
width
:
200
}
}
placeholder=
"Project Name"
/>):(
DataSaveDetail
!=
null
?
DataSaveDetail
.
communityName
:
null
)
}
</
div
>
<
div
className=
{
styles
.
box5item2
}
>
{
editFlag
?(<
SearchOptionsCommnity
defaultValue=
{
extend
}
onSubmit=
{
extendName
}
/>):(
DataSaveDetail
!=
null
?
DataSaveDetail
.
communityName
:
null
)
}
</
div
>
</
div
>
<
div
className=
{
styles
.
box4
}
>
<
div
className=
{
styles
.
box4item1
}
>
Contract Title
</
div
>
<
div
className=
{
styles
.
box4item2
}
>
{
editFlag
?(<
Input
style=
{
{
width
:
200
}
}
placeholder=
"XXXX Labor Contract"
/
>):(
DataSaveDetail
!=
null
?
DataSaveDetail
.
contractTitle
:
null
)
}
</
div
>
<
div
className=
{
styles
.
box4item2
}
>
{
editFlag
?(<
Form
.
Item
name=
"contractFileName"
><
Input
style=
{
{
width
:
200
}
}
placeholder=
"XXXX Labor Contract"
/></
Form
.
Item
>):(
DataSaveDetail
!=
null
?
DataSaveDetail
.
contractTitle
:
null
)
}
</
div
>
</
div
>
<
div
className=
{
styles
.
box6
}
>
<
div
className=
{
styles
.
box6item1
}
>
Effective Date
</
div
>
<
div
className=
{
styles
.
box6item2
}
>
{
editFlag
?
(<
DatePicker
style=
{
{
width
:
140
}
}
/
>)
:
(<
div
className=
{
styles
.
box6item2x1
}
>
{
DataSaveDetail
!=
null
?
DataSaveDetail
.
contractValidEndDate
:
null
}
</
div
>)
}
</
div
>
<
div
className=
{
styles
.
box6item3
}
>
{
editFlag
?
(<
DatePicker
style=
{
{
width
:
140
}
}
/
>)
:
(<
div
className=
{
styles
.
box6item2x1
}
>
{
DataSaveDetail
!=
null
?
DataSaveDetail
.
contractValidStartDate
:
null
}
</
div
>)
}
</
div
>
<
div
className=
{
styles
.
box6item2
}
>
{
editFlag
?
(<
Form
.
Item
name=
"contractValidStartDate"
><
DatePicker
style=
{
{
width
:
140
}
}
/></
Form
.
Item
>)
:
(<
div
className=
{
styles
.
box6item2x1
}
>
{
DataSaveDetail
!=
null
?
DataSaveDetail
.
contractValidEndDate
:
null
}
</
div
>)
}
</
div
>
<
div
className=
{
styles
.
box6item3
}
>
{
editFlag
?
(<
Form
.
Item
name=
"contractValidEndDate"
><
DatePicker
style=
{
{
width
:
140
}
}
/></
Form
.
Item
>)
:
(<
div
className=
{
styles
.
box6item2x1
}
>
{
DataSaveDetail
!=
null
?
DataSaveDetail
.
contractValidStartDate
:
null
}
</
div
>)
}
</
div
>
</
div
>
{
editFlag
?
(
<
div
className=
{
styles
.
box7p
}
>
<
div
className=
{
styles
.
box7item1
}
>
Contract
</
div
>
<
div
className=
{
styles
.
box7item0
}
>
{
extend
!=
null
?
<
Upload
{
...
uploadProps
}
>
<
Button
>
<
UploadOutlined
/>
Upload
</
Button
>
</
Upload
>
</
Upload
>:
null
}
</
div
>
</
div
>
)
:
(
...
...
@@ -129,8 +192,8 @@ const ContractContent = (props: any) => {
<
div
className=
{
styles
.
box8item2
}
>
<
div
className=
{
styles
.
box8item2x1
}
>
{
editFlag
?
(<
TextArea
autoSize=
{
false
}
style=
{
{
padding
:
8
,
width
:
600
,
height
:
194
}
}
></
TextArea
>)
:
(
<
TextArea
autoSize=
{
false
}
style=
{
{
padding
:
8
,
width
:
600
,
height
:
194
}
}
disabled
value=
{
"The contract will expire soon. Please prepare the contract plan
"
}
></
TextArea
>
editFlag
?
(<
Form
.
Item
name=
"contractRemindContent"
><
TextArea
autoSize=
{
false
}
style=
{
{
padding
:
8
,
width
:
600
,
height
:
194
}
}
></
TextArea
></
Form
.
Item
>)
:
(
<
TextArea
autoSize=
{
false
}
style=
{
{
padding
:
8
,
width
:
600
,
height
:
194
}
}
disabled
defaultValue=
{
"Please note the information...
"
}
></
TextArea
>
)
}
</
div
>
...
...
@@ -140,13 +203,14 @@ const ContractContent = (props: any) => {
{
editFlag
?
(<
div
>
<
LINE
/>
<
Button
type=
"primary"
size=
"large
"
>
Submit
</
Button
>
<
Button
type=
"primary"
htmlType=
"submit
"
>
Submit
</
Button
>
</
div
>):(<
div
/>)
}
</
Form
>
</
div
>
)
;
}
;
)
}
function
mapStateToProps
(
state
:
any
)
{
const
{
DataSave
,
Result
,
DataSaveDetail
}
=
state
.
Contract
;
...
...
src/services/tos.ts
View file @
19cc11ab
...
...
@@ -89,7 +89,8 @@ const requestList = [
[
"/tos/property/decorate/record/get"
,
"23 装修列表获取"
],
[
"/tos/tosCommunity/get"
,
"24 获取小区列表"
],
[
"/tos/tosCommunityNotic/get"
,
"25 获取小区公告列表"
],
[
"/tos/tosVisitorRecord/get"
,
"26 获取访客记录列表"
],
[
"/tos/tosVisitorRecord/get"
,
"26 获取访客记录列表"
],
[
"/tos/contract/add"
,
"27 合同新增和编辑"
],
]
const
params
=
[
...
...
@@ -101,6 +102,8 @@ function requestAuto(url:string,values:any) {
return
request
(
url
,
Body
(
values
))
}
export
function
RA
(
playload
:
any
)
{
console
.
log
(
playload
)
console
.
log
(
playload
.
index
)
var
url
=
(
requestList
[
playload
.
index
])[
0
]
console
.
log
(
playload
.
index
+
"》【发送请求】"
+
url
+
" "
+
(
requestList
[
playload
.
index
])[
1
])
console
.
log
(
"参数如下:"
)
...
...
src/utils/method.ts
View file @
19cc11ab
...
...
@@ -53,4 +53,16 @@ export const setCookie=(key:string,value: string)=>{
}
export
const
RA
=
(
index
:
any
,
values
:
any
,
module
:
string
,
dispatch
:
any
)
=>
{
dispatch
({
type
:
module
+
'/RA'
,
playload
:
{
index
:
index
,
body
:
values
}
})
};
\ No newline at end of file
export
const
RA
=
(
index
:
any
,
values
:
any
,
module
:
string
,
dispatch
:
any
)
=>
{
dispatch
({
type
:
module
+
'/RA'
,
playload
:
{
index
:
index
,
body
:
values
}
})
};
const
Fromate
=
(
values
:
any
,
valuesForm
)
=>
{
var
result
=
new
Array
()
if
(
values
!=
null
)
{
values
.
map
((
item
:
any
,
index
:
any
)
=>
{
result
.
push
({
uid
:
index
,
name
:
item
.
categoriesName
})
})
}
console
.
log
(
result
)
return
result
}
\ No newline at end of file
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