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
c66f055c
Commit
c66f055c
authored
Oct 27, 2020
by
Sixiang_Zzb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小区保养列表显示 bug处理
parent
0837b343
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
328 additions
and
252 deletions
+328
-252
SearchOptionsTow.tsx
src/components/SearchOptions/SearchOptionsTow.tsx
+0
-1
CommunityService.ts
src/models/CommunityManagement/CommunityService.ts
+99
-93
Detail.tsx
src/pages/CommercialService/Detail.tsx
+120
-85
PropertyServices.tsx
src/pages/CommercialService/PropertyServices.tsx
+13
-11
Renovation.tsx
src/pages/CommercialService/Renovation.tsx
+96
-62
No files found.
src/components/SearchOptions/SearchOptionsTow.tsx
View file @
c66f055c
...
...
@@ -13,7 +13,6 @@ const SearchOptionsTow = (porps: any) => {
// console.log(`selected ${value}`);
extendName
(
value
);
}
console
.
log
(
def
);
return
(
<
div
>
<
Select
...
...
src/models/CommunityManagement/CommunityService.ts
View file @
c66f055c
...
...
@@ -2,7 +2,7 @@ import * as service from '@/services/tos';
import
{
message
}
from
'antd'
;
import
{
Link
,
useIntl
,
connect
,
Dispatch
,
history
}
from
'umi'
;
import
{
routerRedux
}
from
'dva/router'
import
{
routerRedux
}
from
'dva/router'
;
import
{
timestampToTime
,
timestampToTime4
}
from
'@/utils/time'
;
import
{
picFromate
,
Fromate
}
from
'@/utils/method'
;
...
...
@@ -11,13 +11,13 @@ export default {
namespace
:
'CommunityService'
,
state
:
{
Data
:
null
,
DataSave
:
null
,
DataSave
:
null
,
CurData
:
null
,
CurDataDetail
:
null
,
Data7
:
null
,
Data8
:
null
,
Result
:
null
,
DataSaveDetail
:
null
,
DataSaveDetail
:
null
,
},
reducers
:
{
...
...
@@ -25,7 +25,7 @@ export default {
return
{
...
state
,
Data
};
},
returnDataSave
(
state
,
{
DataSave
})
{
return
{
...
state
,
DataSave
}
return
{
...
state
,
DataSave
}
;
},
returnCurData
(
state
,
{
CurData
})
{
return
{
...
state
,
CurData
};
...
...
@@ -45,99 +45,107 @@ export default {
returnDataSaveDetail
(
state
,
{
DataSaveDetail
})
{
return
{
...
state
,
DataSaveDetail
};
},
},
effects
:
{
//预订设施查询
*
RA
({
playload
},
{
call
,
put
})
{
switch
(
playload
.
index
)
{
case
40
:
{
var
Data
=
null
yield
put
({
type
:
'returnPage'
,
Data
});
}
break
;
}
const
resp
=
yield
call
(
service
.
RA
,
playload
);
console
.
log
(
resp
)
if
(
resp
.
code
==
500
||
resp
.
error_code
!=
"0000"
)
{
// window.location.href = '/500';
//预订设施查询
*
RA
({
playload
},
{
call
,
put
})
{
switch
(
playload
.
index
)
{
case
40
:
{
var
Data
=
null
;
yield
put
({
type
:
'returnPage'
,
Data
});
}
if
(
resp
.
error_code
!=
"0000"
)
{
console
.
log
(
"请求错误码:"
+
"("
+
playload
.
index
+
")"
+
resp
.
error_code
)
console
.
log
(
playload
)
}
else
{
switch
(
playload
.
index
)
{
case
21
:
{
var
tmp
=
resp
.
data
.
rows
[
0
].
tosOwerModel
;
var
tmp2
=
resp
.
data
.
rows
[
0
];
console
.
log
(
resp
.
data
.
rows
[
0
].
replyImgUrl
)
console
.
log
(
Fromate
(
resp
.
data
.
rows
[
0
].
replyImgUrl
,[[
"url"
,
null
]]))
var
CurDataDetail
=
{
community
:
tmp
.
communityName
,
address
:
tmp
.
addressAndpostalCode
,
home
:
tmp
.
buildingNumber
+
"#"
+
tmp
.
floorNumber
+
"-"
+
tmp
.
roomNumber
,
name
:
tmp
.
owerName
,
phone
:
tmp
.
accountLogin
!=
null
?
tmp
.
accountLogin
:
tmp
.
owerPhone
,
email
:
tmp
.
owerEmail
,
content
:
resp
.
data
.
rows
[
0
].
serviceContent
,
replyContent
:
resp
.
data
.
rows
[
0
].
replyContent
,
replyImgUrl
:
Fromate
(
resp
.
data
.
rows
[
0
].
replyImgUrl
,[[
"url"
,
null
]]),
status
:
tmp2
.
handleStatus
,
pictrues
:
picFromate
(
tmp2
.
imgUrl
),
time
:
timestampToTime4
(
tmp2
.
createTime
.
time
)
};
yield
put
({
type
:
'returnCurDataDetail'
,
CurDataDetail
,
});
}
break
;
case
33
:
case
22
:
{
message
.
success
(
"Success Operation!"
,
3
)
history
.
go
(
-
1
)
// history.push("/CommercialService/CommunityMaintenance")
}
break
;
case
23
:
{
let
Data8
=
resp
;
yield
put
({
type
:
'returnPage8'
,
Data8
,
});
}
break
;
case
31
:
{
let
Data7
=
resp
;
yield
put
({
type
:
'returnPage7'
,
Data7
})
}
break
;
case
35
:
{
let
Result
=
resp
;
yield
put
({
type
:
'returnResult'
,
Result
})
}
break
;
case
37
:
case
36
:
{
let
DataSaveDetail
=
resp
;
yield
put
({
type
:
'returnDataSaveDetail'
,
DataSaveDetail
,
});
}
break
;
case
40
:
{
let
Data
=
resp
;
yield
put
({
type
:
'returnPage'
,
Data
,
});
}
break
;
break
;
}
const
resp
=
yield
call
(
service
.
RA
,
playload
);
console
.
log
(
resp
);
if
(
resp
.
code
==
500
||
resp
.
error_code
!=
'0000'
)
{
// window.location.href = '/500';
}
if
(
resp
.
error_code
!=
'0000'
)
{
console
.
log
(
'请求错误码:'
+
'('
+
playload
.
index
+
')'
+
resp
.
error_code
);
console
.
log
(
playload
);
}
else
{
switch
(
playload
.
index
)
{
case
21
:
{
var
tmp
=
resp
.
data
.
rows
[
0
].
tosOwerModel
;
var
tmp2
=
resp
.
data
.
rows
[
0
];
console
.
log
(
resp
.
data
.
rows
[
0
].
replyImgUrl
);
console
.
log
(
Fromate
(
resp
.
data
.
rows
[
0
].
replyImgUrl
,
[[
'url'
,
null
]]));
var
CurDataDetail
=
{
community
:
tmp
.
communityName
,
address
:
tmp
.
addressAndpostalCode
,
home
:
tmp
.
buildingNumber
+
'#'
+
tmp
.
floorNumber
+
'-'
+
tmp
.
roomNumber
,
name
:
tmp
.
owerName
,
phone
:
tmp
.
accountLogin
!=
null
?
tmp
.
accountLogin
:
tmp
.
owerPhone
,
email
:
tmp
.
owerEmail
,
content
:
resp
.
data
.
rows
[
0
].
serviceContent
,
replyContent
:
resp
.
data
.
rows
[
0
].
replyContent
,
replyImgUrl
:
Fromate
(
resp
.
data
.
rows
[
0
].
replyImgUrl
,
[[
'url'
,
null
]]),
status
:
tmp2
.
handleStatus
,
pictrues
:
picFromate
(
tmp2
.
imgUrl
),
time
:
timestampToTime4
(
tmp2
.
createTime
.
time
),
};
yield
put
({
type
:
'returnCurDataDetail'
,
CurDataDetail
});
}
}
break
;
case
33
:
case
22
:
{
message
.
success
(
'Success Operation!'
,
3
);
history
.
go
(
-
1
);
// history.push("/CommercialService/CommunityMaintenance")
}
break
;
case
23
:
{
let
Data8
=
resp
;
yield
put
({
type
:
'returnPage8'
,
Data8
});
}
break
;
case
31
:
{
let
Data7
=
resp
;
yield
put
({
type
:
'returnPage7'
,
Data7
});
}
break
;
case
35
:
{
let
Result
=
resp
;
yield
put
({
type
:
'returnResult'
,
Result
});
}
break
;
case
37
:
case
36
:
{
let
DataSaveDetail
=
resp
;
yield
put
({
type
:
'returnDataSaveDetail'
,
DataSaveDetail
});
}
break
;
case
40
:
{
let
Data
=
resp
;
yield
put
({
type
:
'returnPage'
,
Data
});
}
break
;
}
}
},
// *TosCommunityServiceGetDetail({ playload }, { call, put }) {
// const resp = yield call(service.TosCommunityServiceGetDetail, playload);
// console.log(resp)
// if (resp.error_code !=0 ) {
// window.location.href = '/500';
// } else {
// var tmp = resp.data.rows[0].tosOwerModel;
// var tmp = resp.data.rows[0].tosOwerModel;
// var tmp2 = resp.data.rows[0];
// console.log(tmp2.imgUrl)
// // TODO:还差图片
// var CurDataDetail = {
// community: tmp.communityName,
// address: tmp.addressAndpostalCode,
...
...
@@ -154,25 +162,23 @@ export default {
// },
*
SA
({
playload
},
{
call
,
put
})
{
var
DataSave
=
playload
;
yield
put
({
type
:
'returnDataSave'
,
DataSave
,
});
yield
put
({
type
:
'returnDataSave'
,
DataSave
});
},
*
setCurData
({
playload
},
{
call
,
put
})
{
var
CurData
=
playload
;
yield
put
({
type
:
'returnCurData'
,
CurData
,
});
yield
put
({
type
:
'returnCurData'
,
CurData
});
},
*
setCurDataDetail
({
playload
},
{
call
,
put
})
{
var
CurDataDetail
=
null
yield
put
({
type
:
'returnCurDataDetail'
,
CurDataDetail
,
});
var
CurDataDetail
=
null
;
yield
put
({
type
:
'returnCurDataDetail'
,
CurDataDetail
});
},
*
ResultClear
({
},
{
put
})
{
var
Result
=
null
console
.
log
(
"清除"
)
yield
put
({
type
:
'returnResult'
,
Result
}
)
*
ResultClear
({},
{
put
})
{
var
Result
=
null
;
console
.
log
(
'清除'
);
yield
put
({
type
:
'returnResult'
,
Result
});
},
},
};
src/pages/CommercialService/Detail.tsx
View file @
c66f055c
This diff is collapsed.
Click to expand it.
src/pages/CommercialService/PropertyServices.tsx
View file @
c66f055c
...
...
@@ -10,12 +10,13 @@ import TitleSearch from '../../components/TitleSearch/TitleSearch';
import
{
RA
,
urlEncode
,
filterObj
,
filterObjbyTg
}
from
'@/utils/method'
;
const
pathname
=
[
'CommunityMaintenance'
,
'ShelfLifeService'
,
'OwnerComplaints'
,
'ReportOnline'
,
'ProblemFeedback'
,
'CommunityMaintenance'
,
// 小区保养
'ShelfLifeService'
,
// 保质期服务
'OwnerComplaints'
,
// 业主投诉
'ReportOnline'
,
// 在线报事
'ProblemFeedback'
,
// 问题反馈
];
const
handle_Status
=
[
[
0
,
'Pending'
],
[
1
,
'Processed'
],
...
...
@@ -25,7 +26,7 @@ const goToName = ['Reply', 'Detail'];
const
module
=
'CommunityService'
;
// 页码
let
pageNum
=
1
;
let
pageNum
:
number
=
1
;
const
PropertyServices
=
(
props
:
any
)
=>
{
const
{
dispatch
,
location
,
Data
}
=
props
;
...
...
@@ -38,13 +39,15 @@ const PropertyServices = (props: any) => {
const
columns
=
[
{
title
:
'Community Name'
,
dataIndex
:
'community_name'
},
{
title
:
'Ower Name'
,
dataIndex
:
'ower_name'
},
{
title
:
'service
Content'
,
dataIndex
:
'service_content'
,
title
:
parseInt
(
serviceTypeGobal
)
-
1
===
0
?
'Replier'
:
'
Content'
,
dataIndex
:
parseInt
(
serviceTypeGobal
)
-
1
===
0
?
'handle_name'
:
'service_content'
,
ellipsis
:
true
,
width
:
5
00
,
width
:
4
00
,
render
:
(
text
:
any
)
=>
<
Space
size=
"middle"
>
{
text
!=
null
?
text
:
'--'
}
</
Space
>,
},
{
title
:
'Create Time'
,
dataIndex
:
'create_time'
,
...
...
@@ -109,7 +112,6 @@ const PropertyServices = (props: any) => {
var
tmp
:
any
=
filterObjbyTg
(
location
.
query
,
[
'handleStatus'
,
'ownerName'
,
'communityName'
]);
tmp
.
handleStatus
=
handle_Status
[
parseInt
(
tmp
.
handleStatus
)];
//特殊处理
setReadyData
(
tmp
);
console
.
log
(
tmp
);
//获取数据
setLoading
(
true
);
RA
(
...
...
@@ -138,7 +140,7 @@ const PropertyServices = (props: any) => {
const
ClickTitleSearch
=
(
comment
:
any
)
=>
{
//页面搜索
comment
.
serviceType
=
serviceTypeGobal
;
//
comment.serviceType = serviceTypeGobal;
comment
.
pageNum
=
1
;
history
.
push
(
location
.
pathname
+
urlEncode
(
filterObj
(
comment
)));
};
...
...
src/pages/CommercialService/Renovation.tsx
View file @
c66f055c
...
...
@@ -10,92 +10,126 @@ import { RA, SA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
import
{
objectColumns
,
stringTab
}
from
'@/utils/string'
;
import
{
timestampToTime
}
from
'@/utils/time'
;
const
module
=
"CommunityService"
const
module
=
'CommunityService'
;
const
Renovation
=
(
props
:
any
)
=>
{
// const decoration_status = [[0, "待处理"], [1, "已批准"], [2, "已拒绝"]]
const
decoration_status
=
[[
0
,
"Pending"
],
[
1
,
"Approved"
],
[
2
,
"Rejected"
]]
const
pathname
=
[
"CommunityMaintenance"
,
"ShelfLifeService"
,
"OwnerComplaints"
,
"ReportOnline"
,
"ProblemFeedback"
]
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
[
serviceTypeGobal
,
setServiceType
]
=
useState
(
""
)
const
[
pageNum
,
setPageNum
]
=
useState
(
1
)
const
[
readyData
,
setReadyData
]
=
useState
(
null
)
const
decoration_status
=
[
[
0
,
'Pending'
],
[
1
,
'Approved'
],
[
2
,
'Rejected'
],
];
const
pathname
=
[
'CommunityMaintenance'
,
'ShelfLifeService'
,
'OwnerComplaints'
,
'ReportOnline'
,
'ProblemFeedback'
,
];
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
serviceTypeGobal
,
setServiceType
]
=
useState
(
''
);
const
[
pageNum
,
setPageNum
]
=
useState
(
1
);
const
[
readyData
,
setReadyData
]
=
useState
(
null
);
const
columns
=
objectColumns
([
[
"Community"
,
"community_name"
],
[
"Applicant"
,
"applyfor_name"
],
[
"Unit"
,
null
,
(
text
:
any
,
record
:
any
)
=>
(<
div
>
{
record
.
community_build_decorate
}
#
{
record
.
community_floor_decorate
}
-
{
record
.
community_room_decoate
}
</
div
>)],
[
"Content"
,
"decoration_content"
,
(
text
:
any
)
=>
(<
div
>
{
stringTab
(
text
)
}
</
div
>)],
[
"Request Time"
,
"create_time"
,
(
text
:
any
)
=>
(<
div
>
{
timestampToTime
(
text
.
time
)
}
</
div
>)],
[
"status"
,
"decoration_status"
,
(
text
:
any
)
=>
(<
div
>
{
decoration_status
[
parseInt
(
text
)][
1
]
}
</
div
>)],
[
"Actions"
,
"decoration_status"
,
(
text
:
any
,
record
:
any
)
=>
(<
Space
size=
"middle"
>
<
a
onClick=
{
goToDetail
.
bind
(
this
,
record
)
}
>
{
text
===
0
?
"Reply"
:
"Detail"
}
</
a
></
Space
>)],
])
[
'Community'
,
'community_name'
],
[
'Applicant'
,
'applyfor_name'
],
[
'Unit'
,
null
,
(
text
:
any
,
record
:
any
)
=>
(
<
div
>
{
record
.
community_build_decorate
}
#
{
record
.
community_floor_decorate
}
-
{
record
.
community_room_decoate
}
</
div
>
),
],
[
'Content'
,
'decoration_content'
,
(
text
:
any
)
=>
<
div
>
{
stringTab
(
text
)
}
</
div
>],
[
'Request Time'
,
'create_time'
,
(
text
:
any
)
=>
<
div
>
{
timestampToTime
(
text
.
time
)
}
</
div
>],
[
'status'
,
'decoration_status'
,
(
text
:
any
)
=>
<
div
>
{
decoration_status
[
parseInt
(
text
)][
1
]
}
</
div
>,
],
[
'Actions'
,
'decoration_status'
,
(
text
:
any
,
record
:
any
)
=>
(
<
Space
size=
"middle"
>
{
' '
}
<
a
onClick=
{
goToDetail
.
bind
(
this
,
record
)
}
>
{
text
===
0
?
'Reply'
:
'Detail'
}
</
a
>
</
Space
>
),
],
]);
const
{
dispatch
,
Data8
,
location
}
=
props
;
useEffect
(()
=>
{
if
(
Data8
!=
null
)
{
setLoading
(
false
)
}
},
[
Data8
]);
useEffect
(()
=>
{
if
(
location
!=
null
)
{
//前置数据
console
.
log
(
"前置数据"
);
let
tmp
:
any
=
filterObjbyTg
(
location
.
query
,
[
"handleStatus"
,
"ownerName"
,
"communityName"
,
"current"
])
tmp
.
handleStatus
=
decoration_status
[
parseInt
(
tmp
.
handleStatus
)]
//特殊处理
setReadyData
(
tmp
)
console
.
log
(
'前置数据'
);
let
tmp
:
any
=
filterObjbyTg
(
location
.
query
,
[
'handleStatus'
,
'ownerName'
,
'communityName'
,
'current'
,
]);
tmp
.
handleStatus
=
decoration_status
[
parseInt
(
tmp
.
handleStatus
)];
//特殊处理
setReadyData
(
tmp
);
//获取数据
setLoading
(
true
)
setLoading
(
true
)
;
RA
(
23
,
{
serviceType
:
"6"
,
id
:
""
},
module
,
dispatch
)
RA
(
23
,
{
serviceType
:
'6'
,
id
:
''
},
module
,
dispatch
);
}
},
[
location
]);
},
[
location
])
useEffect
(()
=>
{
if
(
Data8
!=
null
)
{
setLoading
(
false
);
}
},
[
Data8
]);
//页面搜索
const
ClickTitleSearch
=
(
comment
:
any
)
=>
{
let
tmp
=
filterObjbyTg
(
comment
,
[
"handleStatus"
,
"ownerName"
,
"communityName"
])
tmp
[
"current"
]
=
1
history
.
push
(
location
.
pathname
+
urlEncode
(
tmp
))
}
let
tmp
=
filterObjbyTg
(
comment
,
[
'handleStatus'
,
'ownerName'
,
'communityName'
]);
tmp
[
'current'
]
=
1
;
history
.
push
(
location
.
pathname
+
urlEncode
(
tmp
))
;
}
;
const
goToDetail
=
(
values
:
any
,
e
:
any
)
=>
{
SA
(
values
,
module
,
dispatch
)
history
.
push
(
'./RenovationApplication/Detail'
)
}
SA
(
values
,
module
,
dispatch
)
;
history
.
push
(
'./RenovationApplication/Detail'
)
;
}
;
return
(
<
div
style=
{
{
width
:
"100%"
,
minWidth
:
1020
,
padding
:
34
,
backgroundColor
:
"#ffffff"
}
}
>
{
Data8
!=
null
?
<>
<
TitleSearch
communitySelect=
{
true
}
listkey=
{
[
'ownerName'
]
}
list=
{
[
'Owner Name'
]
}
status=
{
[{
name
:
[
"handleStatus"
,
"Status"
],
data
:
decoration_status
}]
}
defaultValue=
{
readyData
}
onSubmit=
{
ClickTitleSearch
}
/>
<
Table
loading=
{
loading
}
rowKey=
"id"
style=
{
{
marginTop
:
16
}
}
dataSource=
{
Data8
.
data
.
rows
}
columns=
{
columns
}
pagination=
{
{
defaultCurrent
:
1
,
total
:
Data8
.
total
}
}
/>
</>
:
null
}
<
div
style=
{
{
width
:
'100%'
,
minWidth
:
1020
,
padding
:
34
,
backgroundColor
:
'#ffffff'
}
}
>
{
Data8
!=
null
?
(
<>
<
TitleSearch
communitySelect=
{
true
}
listkey=
{
[
'ownerName'
]
}
list=
{
[
'Owner Name'
]
}
status=
{
[{
name
:
[
'handleStatus'
,
'Status'
],
data
:
decoration_status
}]
}
defaultValue=
{
readyData
}
onSubmit=
{
ClickTitleSearch
}
/>
<
Table
loading=
{
loading
}
rowKey=
"id"
style=
{
{
marginTop
:
16
}
}
dataSource=
{
Data8
.
data
.
rows
}
columns=
{
columns
}
pagination=
{
{
defaultCurrent
:
1
,
total
:
Data8
.
total
}
}
/>
</>
)
:
null
}
</
div
>
);
};
function
map
(
state
:
any
)
{
const
{
Data8
}
=
state
[
module
]
return
{
Data8
}
const
{
Data8
}
=
state
[
module
]
;
return
{
Data8
}
;
}
export
default
connect
(
map
)(
Renovation
);
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