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
2e1f9cf7
Commit
2e1f9cf7
authored
Apr 27, 2021
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
楼顶去空
Signed-off-by:
cellee
<
893264950@qq.com
>
parent
4ad66726
Changes
59
Show whitespace changes
Inline
Side-by-side
Showing
59 changed files
with
1929 additions
and
2302 deletions
+1929
-2302
config.ts
config/config.ts
+23
-8
package.json
package.json
+30
-30
favicon.ico
public/favicon.ico
+0
-0
PdfUpload.tsx
src/components/Form/PdfUpload.tsx
+30
-15
ZipCode.tsx
src/components/Form/ZipCode.tsx
+3
-3
SearchOptions.jsx
src/components/SearchOptions/SearchOptions.jsx
+2
-2
SearchOptionsTow.tsx
src/components/SearchOptions/SearchOptionsTow.tsx
+2
-2
TableShow.tsx
src/components/TableShow/TableShow.tsx
+5
-7
TreeAction.tsx
src/components/TreeAction/TreeAction.tsx
+1
-1
menu.ts
src/locales/en-US/menu.ts
+5
-4
menu.ts
src/locales/zh-CN/menu.ts
+3
-2
CommunityService.ts
src/models/CommunityManagement/CommunityService.ts
+31
-13
FacilityBookings.ts
src/models/CommunityManagement/FacilityBookings.ts
+1
-1
communityNotice.ts
src/models/communityNotice.ts
+91
-83
AccountManagement.tsx
...AccountManagement/AccountManagement/AccountManagement.tsx
+85
-66
service.tsx
src/pages/AccountManagement/Service/service.tsx
+2
-2
serviceDetail.tsx
src/pages/AccountManagement/Service/serviceDetail.tsx
+1
-1
serviceEdit.tsx
src/pages/AccountManagement/Service/serviceEdit.tsx
+2
-2
Card.tsx
src/pages/CommercialService/Card.tsx
+8
-6
CardAdd.tsx
src/pages/CommercialService/CardAdd.tsx
+2
-10
CardDetail.tsx
src/pages/CommercialService/CardDetail.tsx
+169
-50
Detail.tsx
src/pages/CommercialService/Detail.tsx
+4
-2
MoveOutDetail.tsx
src/pages/CommercialService/MoveOutDetail.tsx
+281
-0
PropertyServices.tsx
src/pages/CommercialService/PropertyServices.tsx
+16
-5
Renovation.tsx
src/pages/CommercialService/Renovation.tsx
+148
-37
RenovationDetail.tsx
src/pages/CommercialService/RenovationDetail.tsx
+13
-8
Detail.less
src/pages/CommercialService/css/Detail.less
+174
-169
Adds.tsx
src/pages/CommunityManagement/CellList/Adds.tsx
+5
-5
Adds3.tsx
src/pages/CommunityManagement/CellList/Adds3.tsx
+0
-666
CellList.tsx
src/pages/CommunityManagement/CellList/CellList.tsx
+3
-3
Details.tsx
src/pages/CommunityManagement/CellList/Details.tsx
+9
-10
Add.tsx
src/pages/CommunityManagement/CommunityAnnouncement/Add.tsx
+1
-1
CommunityAnnouncement.tsx
...anagement/CommunityAnnouncement/CommunityAnnouncement.tsx
+1
-1
Detail copy.tsx
...CommunityManagement/CommunityAnnouncement/Detail copy.tsx
+1
-1
Detail.tsx
...ages/CommunityManagement/CommunityAnnouncement/Detail.tsx
+1
-1
BookingDetail.tsx
...es/CommunityManagement/FacilityBookings/BookingDetail.tsx
+3
-2
Bookings.tsx
src/pages/CommunityManagement/FacilityBookings/Bookings.tsx
+5
-5
Facility.tsx
src/pages/CommunityManagement/FacilityBookings/Facility.tsx
+1
-1
FacilityBookings.tsx
...CommunityManagement/FacilityBookings/FacilityBookings.tsx
+2
-2
FacilityTow.tsx
...ages/CommunityManagement/FacilityBookings/FacilityTow.tsx
+1
-1
VisitorRecord.tsx
...pages/CommunityManagement/VisitorRecord/VisitorRecord.tsx
+1
-1
VisitorRecord.tsx
...pages/CommunityManagement/visitorRecord/VisitorRecord.tsx
+1
-1
Contract.tsx
src/pages/ContractManagement/Contract.tsx
+19
-19
ContractContent copy.tsx
src/pages/ContractManagement/ContractContent copy.tsx
+0
-549
ContractContent.tsx
src/pages/ContractManagement/ContractContent.tsx
+139
-76
ContractDetail.tsx
src/pages/ContractManagement/ContractDetail.tsx
+114
-60
Order.tsx
src/pages/OrderManagement/Order.tsx
+64
-42
OrderManagement.tsx
src/pages/OrderManagement/OrderManagement.tsx
+321
-264
ChargeManager.tsx
src/pages/PropertyManagement/ChargeManager.tsx
+1
-1
Users.tsx
src/pages/UserManagement/LIFEUserManagement/Users.tsx
+6
-1
UsersAdd.tsx
src/pages/UserManagement/LIFEUserManagement/UsersAdd.tsx
+12
-5
UsersDetail.tsx
src/pages/UserManagement/LIFEUserManagement/UsersDetail.tsx
+3
-1
AccoutingContent.tsx
...Management/ServiceProviderManagement/AccoutingContent.tsx
+1
-1
Detail.tsx
...pages/UserManagement/ServiceProviderManagement/Detail.tsx
+2
-2
Edit.tsx
src/pages/UserManagement/ServiceProviderManagement/Edit.tsx
+1
-1
Template.tsx
src/pages/template/小区公告添加/Template.tsx
+49
-24
Template.tsx
src/pages/template/服务商详情/Template.tsx
+20
-19
params.ts
src/utils/params.ts
+4
-1
power.js
src/utils/power.js
+6
-6
No files found.
config/config.ts
View file @
2e1f9cf7
/*
/*
* @Author: your name
* @Author: your name
* @Date: 2020-12-01 18:40:06
* @Date: 2020-12-01 18:40:06
* @LastEditTime: 2021-0
3-03 15:04:15
* @LastEditTime: 2021-0
4-26 17:35:57
* @LastEditors: Please set LastEditors
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @Description: In User Settings Edit
* @FilePath: \tostumi\config\config.ts
* @FilePath: \tostumi\config\config.ts
...
@@ -19,6 +19,7 @@ export default defineConfig({
...
@@ -19,6 +19,7 @@ export default defineConfig({
dva
:
{
dva
:
{
hmr
:
true
,
hmr
:
true
,
},
},
favicon
:
'favicon.ico'
,
locale
:
{
locale
:
{
// default zh-CN //zh-CN
// default zh-CN //zh-CN
default
:
'en-US'
,
default
:
'en-US'
,
...
@@ -26,6 +27,7 @@ export default defineConfig({
...
@@ -26,6 +27,7 @@ export default defineConfig({
antd
:
true
,
antd
:
true
,
baseNavigator
:
true
,
baseNavigator
:
true
,
},
},
// ssr: {},
dynamicImport
:
{
dynamicImport
:
{
loading
:
'@/components/PageLoading/index'
,
loading
:
'@/components/PageLoading/index'
,
},
},
...
@@ -231,19 +233,31 @@ export default defineConfig({
...
@@ -231,19 +233,31 @@ export default defineConfig({
{
path
:
'./Edit'
,
component
:
'./CommercialService/Detail'
},
{
path
:
'./Edit'
,
component
:
'./CommercialService/Detail'
},
],
],
},
},
// 4-21 去除保质期服务
// {
// path: './ShelfLifeService',
// name: 'shelflifeservice',
// routes: [
// { path: './', component: './CommercialService/PropertyServices' },
// { path: './Detail', component: './CommercialService/Detail' },
// { path: './Edit', component: './CommercialService/Detail' },
// ],
// },
// 4-21 新增迁出申请
{
{
path
:
'./
ShelfLifeService
'
,
path
:
'./
MoveOut
'
,
name
:
'
shelflifeservice
'
,
name
:
'
moveout
'
,
routes
:
[
routes
:
[
{
path
:
'./'
,
component
:
'./CommercialService/PropertyServices'
},
{
path
:
'./'
,
component
:
'./CommercialService/Renovation'
},
{
path
:
'./Detail'
,
component
:
'./CommercialService/Detail'
},
{
path
:
'./Detail/:id'
,
component
:
'./CommercialService/MoveOutDetail'
},
{
path
:
'./Edit'
,
component
:
'./CommercialService/Detail'
},
],
],
},
},
// ------共享编辑与详情-------
{
path
:
'./OwnerComplaints/Detail'
,
component
:
'./CommercialService/Detail'
},
{
path
:
'./OwnerComplaints/Detail'
,
component
:
'./CommercialService/Detail'
},
{
path
:
'./OwnerComplaints/Edit'
,
component
:
'./CommercialService/Detail'
},
{
path
:
'./OwnerComplaints/Edit'
,
component
:
'./CommercialService/Detail'
},
],
],
},
},
// 2-21 暂无订单功能 取消
// {
// {
// path: '/OrderManagement',
// path: '/OrderManagement',
// name: 'ordermanagement',
// name: 'ordermanagement',
...
@@ -256,8 +270,8 @@ export default defineConfig({
...
@@ -256,8 +270,8 @@ export default defineConfig({
icon
:
'SwitcherOutlined'
,
icon
:
'SwitcherOutlined'
,
routes
:
[
routes
:
[
{
path
:
'./'
,
component
:
'./ContractManagement/Contract'
},
{
path
:
'./'
,
component
:
'./ContractManagement/Contract'
},
{
path
:
'./Detail'
,
component
:
'./ContractManagement/ContractDetail'
},
{
path
:
'./Detail
/:id
'
,
component
:
'./ContractManagement/ContractDetail'
},
{
path
:
'./Edit'
,
component
:
'./ContractManagement/ContractContent'
},
{
path
:
'./Edit
/:id
'
,
component
:
'./ContractManagement/ContractContent'
},
{
{
path
:
'./Add'
,
path
:
'./Add'
,
component
:
'./ContractManagement/ContractContent'
,
component
:
'./ContractManagement/ContractContent'
,
...
@@ -405,6 +419,7 @@ export default defineConfig({
...
@@ -405,6 +419,7 @@ export default defineConfig({
name
:
'companyinformation'
,
name
:
'companyinformation'
,
component
:
'./AccountManagement/CompanyInformation/CompanyInformation'
,
component
:
'./AccountManagement/CompanyInformation/CompanyInformation'
,
},
},
// 3-21 去除语言切换
// {
// {
// path: './LanguageSettings',
// path: './LanguageSettings',
// name: 'languagesettings',
// name: 'languagesettings',
...
...
package.json
View file @
2e1f9cf7
...
@@ -45,66 +45,66 @@
...
@@ -45,66 +45,66 @@
"not ie <= 10"
"not ie <= 10"
],
],
"dependencies"
:
{
"dependencies"
:
{
"
@ant-design/icons
"
:
"
^4.
0.0
"
,
"
@ant-design/icons
"
:
"
^4.
6.2
"
,
"
@ant-design/pro-layout
"
:
"
^5.0.16
"
,
"
@ant-design/pro-layout
"
:
"
^5.0.16
"
,
"
@ant-design/pro-table
"
:
"
2.3.4
"
,
"
@ant-design/pro-table
"
:
"
2.3.4
"
,
"
@bundled-es-modules/pdfjs-dist
"
:
"
^2.2.228-alpha1
"
,
"
@bundled-es-modules/pdfjs-dist
"
:
"
^2.2.228-alpha1
"
,
"
antd
"
:
"
4.7.3
"
,
"
antd
"
:
"
4.7.3
"
,
"
axios
"
:
"
^0.21.
0
"
,
"
axios
"
:
"
^0.21.
1
"
,
"
classnames
"
:
"
^2.
2.6
"
,
"
classnames
"
:
"
^2.
3.1
"
,
"
js-export-excel
"
:
"
^1.1.2
"
,
"
js-export-excel
"
:
"
^1.1.2
"
,
"
js-file-download
"
:
"
^0.4.12
"
,
"
js-file-download
"
:
"
^0.4.12
"
,
"
lodash
"
:
"
^4.17.
1
1
"
,
"
lodash
"
:
"
^4.17.
2
1
"
,
"
moment
"
:
"
^2.25.3
"
,
"
moment
"
:
"
^2.25.3
"
,
"
omit.js
"
:
"
^1.0.2
"
,
"
omit.js
"
:
"
^1.0.2
"
,
"
path-to-regexp
"
:
"
2.4.0
"
,
"
path-to-regexp
"
:
"
2.4.0
"
,
"
pdfjs
"
:
"
^2.
3.9
"
,
"
pdfjs
"
:
"
^2.
4.3
"
,
"
qs
"
:
"
^6.
9.4
"
,
"
qs
"
:
"
^6.
10.1
"
,
"
react
"
:
"
^16.8.6
"
,
"
react
"
:
"
^16.8.6
"
,
"
react-dom
"
:
"
^16.8.6
"
,
"
react-dom
"
:
"
^16.8.6
"
,
"
react-helmet-async
"
:
"
^1.0.4
"
,
"
react-file-viewer
"
:
"
^1.2.1
"
,
"
react-pdf
"
:
"
^5.0.0
"
,
"
react-helmet-async
"
:
"
^1.0.9
"
,
"
react-pdf
"
:
"
^5.2.0
"
,
"
react-pdf-js
"
:
"
^5.1.0
"
,
"
react-pdf-js
"
:
"
^5.1.0
"
,
"
react-persist
"
:
"
^1.0.2
"
,
"
react-persist
"
:
"
^1.0.2
"
,
"
react-file-viewer
"
:
"
^1.2.1
"
,
"
redux-persist
"
:
"
^6.0.0
"
,
"
redux-persist
"
:
"
^6.0.0
"
,
"
umi
"
:
"
^3.
1.2
"
,
"
umi
"
:
"
^3.
4.11
"
,
"
umi-request
"
:
"
^1.0.8
"
,
"
umi-request
"
:
"
^1.0.8
"
,
"
use-merge-value
"
:
"
^1.0.1
"
"
use-merge-value
"
:
"
^1.0.1
"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"
@ant-design/pro-cli
"
:
"
^1.0.
1
8
"
,
"
@ant-design/pro-cli
"
:
"
^1.0.
2
8
"
,
"
@types/classnames
"
:
"
^2.
2.7
"
,
"
@types/classnames
"
:
"
^2.
3.1
"
,
"
@types/express
"
:
"
^4.17.
0
"
,
"
@types/express
"
:
"
^4.17.
11
"
,
"
@types/history
"
:
"
^4.7.2
"
,
"
@types/history
"
:
"
^4.7.2
"
,
"
@types/jest
"
:
"
^26.0.
0
"
,
"
@types/jest
"
:
"
^26.0.
22
"
,
"
@types/lodash
"
:
"
^4.14.1
44
"
,
"
@types/lodash
"
:
"
^4.14.1
68
"
,
"
@types/qs
"
:
"
^6.
5.3
"
,
"
@types/qs
"
:
"
^6.
9.6
"
,
"
@types/react
"
:
"
^16.
9.17
"
,
"
@types/react
"
:
"
^16.
14.5
"
,
"
@types/react-dom
"
:
"
^16.
8.4
"
,
"
@types/react-dom
"
:
"
^16.
9.12
"
,
"
@types/react-helmet
"
:
"
^5.0.13
"
,
"
@types/react-helmet
"
:
"
^5.0.13
"
,
"
@umijs/fabric
"
:
"
^2.
0.5
"
,
"
@umijs/fabric
"
:
"
^2.
5.7
"
,
"
@umijs/plugin-blocks
"
:
"
^2.
0.5
"
,
"
@umijs/plugin-blocks
"
:
"
^2.
2.2
"
,
"
@umijs/preset-ant-design-pro
"
:
"
^1.2.0
"
,
"
@umijs/preset-ant-design-pro
"
:
"
^1.2.0
"
,
"
@umijs/preset-react
"
:
"
^1.
4.8
"
,
"
@umijs/preset-react
"
:
"
^1.
8.6
"
,
"
@umijs/preset-ui
"
:
"
^2.
0
.9
"
,
"
@umijs/preset-ui
"
:
"
^2.
2
.9
"
,
"
carlo
"
:
"
^0.9.46
"
,
"
carlo
"
:
"
^0.9.46
"
,
"
chalk
"
:
"
^4.
0.0
"
,
"
chalk
"
:
"
^4.
1.1
"
,
"
cross-env
"
:
"
^7.0.
2
"
,
"
cross-env
"
:
"
^7.0.
3
"
,
"
cross-port-killer
"
:
"
^1.
1.1
"
,
"
cross-port-killer
"
:
"
^1.
3.0
"
,
"
detect-installer
"
:
"
^1.0.1
"
,
"
detect-installer
"
:
"
^1.0.1
"
,
"
enzyme
"
:
"
^3.11.0
"
,
"
enzyme
"
:
"
^3.11.0
"
,
"
eslint
"
:
"
^7.
1
.0
"
,
"
eslint
"
:
"
^7.
24
.0
"
,
"
express
"
:
"
^4.17.1
"
,
"
express
"
:
"
^4.17.1
"
,
"
gh-pages
"
:
"
^3.0.0
"
,
"
gh-pages
"
:
"
^3.0.0
"
,
"
husky
"
:
"
^4.
0.7
"
,
"
husky
"
:
"
^4.
3.8
"
,
"
jsdom-global
"
:
"
^3.0.2
"
,
"
jsdom-global
"
:
"
^3.0.2
"
,
"
lint-staged
"
:
"
^10.
0.0
"
,
"
lint-staged
"
:
"
^10.
5.4
"
,
"
mockjs
"
:
"
^1.0.1-beta3
"
,
"
mockjs
"
:
"
^1.0.1-beta3
"
,
"
prettier
"
:
"
^2.
0
.1
"
,
"
prettier
"
:
"
^2.
2
.1
"
,
"
pro-download
"
:
"
1.0.1
"
,
"
pro-download
"
:
"
1.0.1
"
,
"
puppeteer-core
"
:
"
^3.0.0
"
,
"
puppeteer-core
"
:
"
^3.0.0
"
,
"
stylelint
"
:
"
^13.
0
.0
"
"
stylelint
"
:
"
^13.
12
.0
"
},
},
"engines"
:
{
"engines"
:
{
"node"
:
">=10.0.0"
"node"
:
">=10.0.0"
...
...
public/favicon.ico
0 → 100644
View file @
2e1f9cf7
4.19 KB
src/components/Form/PdfUpload.tsx
View file @
2e1f9cf7
/*
/*
* @Author: your name
* @Author: your name
* @Date: 2021-02-01 14:54:48
* @Date: 2021-02-01 14:54:48
* @LastEditTime: 2021-0
3-03 10:08
:06
* @LastEditTime: 2021-0
4-26 15:14
:06
* @LastEditors: Please set LastEditors
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\components\Form\PdfUpload.tsx
* @FilePath: \tostumi\src\components\Form\PdfUpload.tsx
*/
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Input
,
Upload
,
message
,
Button
,
Modal
,
Pagination
}
from
'antd'
;
import
{
Input
,
Upload
,
message
,
Button
,
Modal
,
Pagination
,
Spin
}
from
'antd'
;
import
{
import
{
LoadingOutlined
,
LoadingOutlined
,
PlusOutlined
,
PlusOutlined
,
...
@@ -15,8 +15,9 @@ import {
...
@@ -15,8 +15,9 @@ import {
FilePdfOutlined
,
FilePdfOutlined
,
}
from
'@ant-design/icons'
;
}
from
'@ant-design/icons'
;
import
PDF
from
'react-pdf-js'
;
import
{
Document
,
Page
}
from
'react-pdf'
;
import
{
pdfjs
}
from
'react-pdf'
;
pdfjs
.
GlobalWorkerOptions
.
workerSrc
=
`//cdnjs.cloudflare.com/ajax/libs/pdf.js/
${
pdfjs
.
version
}
/pdf.worker.min.js`
;
import
'./zip.less'
;
import
'./zip.less'
;
interface
PriceInputProps
{
interface
PriceInputProps
{
detailvalue
?:
any
;
detailvalue
?:
any
;
...
@@ -237,7 +238,7 @@ const PdfUpload: React.FC<PriceInputProps> = ({
...
@@ -237,7 +238,7 @@ const PdfUpload: React.FC<PriceInputProps> = ({
// 点击预览
// 点击预览
const
handlePreview
=
async
(
file
:
any
)
=>
{
const
handlePreview
=
async
(
file
:
any
)
=>
{
// console.log(file);
// console.log(file);
setPdfUrl
(
file
);
setPdfUrl
(
{
...
file
}
);
setModalVisible
(
true
);
setModalVisible
(
true
);
};
};
...
@@ -276,8 +277,9 @@ const PdfUpload: React.FC<PriceInputProps> = ({
...
@@ -276,8 +277,9 @@ const PdfUpload: React.FC<PriceInputProps> = ({
};
};
// pdf 总页数
// pdf 总页数
const
onDocumentLoadSuccess
=
(
pages
:
any
)
=>
{
const
onDocumentLoadSuccess
=
({
numPages
}:
any
)
=>
{
setNumPages
(
pages
);
//numPages是总页数
setNumPages
(
numPages
);
};
};
// 切换pdf 总数
// 切换pdf 总数
...
@@ -304,6 +306,12 @@ const PdfUpload: React.FC<PriceInputProps> = ({
...
@@ -304,6 +306,12 @@ const PdfUpload: React.FC<PriceInputProps> = ({
onChange
&&
onChange
(
list
);
onChange
&&
onChange
(
list
);
};
};
// 文件失效
const
onError
=
()
=>
{
message
.
error
(
'file error !'
);
setModalVisible
(
false
);
};
return
(
return
(
<>
<>
{
imgList
.
map
((
item
:
any
,
index
:
any
)
=>
{
{
imgList
.
map
((
item
:
any
,
index
:
any
)
=>
{
...
@@ -383,22 +391,29 @@ const PdfUpload: React.FC<PriceInputProps> = ({
...
@@ -383,22 +391,29 @@ const PdfUpload: React.FC<PriceInputProps> = ({
<
Modal
<
Modal
title=
{
PdfUrl
!=
null
?
PdfUrl
.
name
:
'File Preview'
}
title=
{
PdfUrl
!=
null
?
PdfUrl
.
name
:
'File Preview'
}
visible=
{
ModalVisible
}
visible=
{
ModalVisible
}
width=
{
65
0
}
width=
{
80
0
}
onCancel=
{
handleCancel
}
onCancel=
{
handleCancel
}
style=
{
{
textAlign
:
'center'
}
}
style=
{
{
textAlign
:
'center'
}
}
footer=
{
null
}
footer=
{
null
}
>
>
<>
<>
<
PDF
<
Document
file=
{
PdfUrl
?
PdfUrl
.
url
:
null
}
file=
{
PdfUrl
?
PdfUrl
.
url
:
null
}
//文件路径
page=
{
pageNumber
}
onLoadSuccess=
{
onDocumentLoadSuccess
}
//成功加载文档后调用
scale=
{
1
}
// onLoadError={console.error} //加载失败时调用
onDocumentComplete=
{
onDocumentLoadSuccess
}
loading=
{
<
Spin
indicator=
{
<
LoadingOutlined
spin
/>
}
/>
}
//加载时提示语句
onLoadError=
{
onError
}
>
<
Page
key=
{
PdfUrl
?
PdfUrl
.
id
:
null
}
pageNumber=
{
pageNumber
}
//当前页页码
scale=
{
1.25
}
/>
/>
</
Document
>
<
Pagination
<
Pagination
style=
{
{
textAlign
:
'center'
,
marginTop
:
10
,
display
:
'block'
}
}
style=
{
{
textAlign
:
'center'
,
marginTop
:
10
,
display
:
'block'
}
}
simple
simple
c
urrent=
{
pageNumber
}
defaultC
urrent=
{
pageNumber
}
total=
{
numPages
*
10
}
total=
{
numPages
*
10
}
onChange=
{
onChangePage
}
onChange=
{
onChangePage
}
/>
/>
...
...
src/components/Form/ZipCode.tsx
View file @
2e1f9cf7
/*
/*
* @Author: your name
* @Author: your name
* @Date: 2021-01-30 16:16:41
* @Date: 2021-01-30 16:16:41
* @LastEditTime: 2021-0
2-20 11:32:44
* @LastEditTime: 2021-0
4-23 18:50:35
* @LastEditors: Please set LastEditors
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\components\Form\ZipCode.tsx
* @FilePath: \tostumi\src\components\Form\ZipCode.tsx
...
@@ -92,7 +92,7 @@ const ZipCode: React.FC<PriceInputProps> = ({
...
@@ -92,7 +92,7 @@ const ZipCode: React.FC<PriceInputProps> = ({
// value={value.residentialAddress || number}
// value={value.residentialAddress || number}
onChange=
{
onNumberChange
}
onChange=
{
onNumberChange
}
style=
{
{
width
:
'360px'
}
}
style=
{
{
width
:
'360px'
}
}
placeholder=
"Please enter
community
adds"
placeholder=
"Please enter
Estate
adds"
disabled=
{
disabled
}
disabled=
{
disabled
}
value=
{
details
?
details
.
residentialAddress
:
null
}
value=
{
details
?
details
.
residentialAddress
:
null
}
/>
/>
...
@@ -105,7 +105,7 @@ const ZipCode: React.FC<PriceInputProps> = ({
...
@@ -105,7 +105,7 @@ const ZipCode: React.FC<PriceInputProps> = ({
// value={value.residentialName || number}
// value={value.residentialName || number}
onChange=
{
onNumberChange
}
onChange=
{
onNumberChange
}
style=
{
{
marginRight
:
'10px'
,
width
:
'240px'
}
}
style=
{
{
marginRight
:
'10px'
,
width
:
'240px'
}
}
placeholder=
"Please enter
community
name"
placeholder=
"Please enter
Estate
name"
onBlur=
{
onblurs
}
onBlur=
{
onblurs
}
disabled=
{
disabled
}
disabled=
{
disabled
}
value=
{
details
?
details
.
residentialName
:
null
}
value=
{
details
?
details
.
residentialName
:
null
}
...
...
src/components/SearchOptions/SearchOptions.jsx
View file @
2e1f9cf7
...
@@ -67,7 +67,7 @@ class SearchOptions extends React.Purecomponent {
...
@@ -67,7 +67,7 @@ class SearchOptions extends React.Purecomponent {
<
Select
<
Select
showSearch
showSearch
value=
{
this
.
state
.
value
}
value=
{
this
.
state
.
value
}
placeholder=
{
'
Community
Name'
}
placeholder=
{
'
Estate
Name'
}
optionFilterProp=
"children"
optionFilterProp=
"children"
filterOption=
{
(
input
,
option
)
=>
filterOption=
{
(
input
,
option
)
=>
option
.
children
.
toLowerCase
().
indexOf
(
input
.
toLowerCase
())
>=
0
option
.
children
.
toLowerCase
().
indexOf
(
input
.
toLowerCase
())
>=
0
...
@@ -81,7 +81,7 @@ class SearchOptions extends React.Purecomponent {
...
@@ -81,7 +81,7 @@ class SearchOptions extends React.Purecomponent {
notFoundContent=
{
notFoundContent=
{
<
div
>
<
div
>
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
Please enter the correct
Community
Name!
Please enter the correct
Estate
Name!
</
div
>
</
div
>
}
}
style=
{
{
width
:
200
}
}
style=
{
{
width
:
200
}
}
...
...
src/components/SearchOptions/SearchOptionsTow.tsx
View file @
2e1f9cf7
...
@@ -49,7 +49,7 @@ const SearchOptionsTow = (porps: any) => {
...
@@ -49,7 +49,7 @@ const SearchOptionsTow = (porps: any) => {
mode=
"multiple"
mode=
"multiple"
autoClearSearchValue
autoClearSearchValue
style=
{
{
width
:
320
}
}
style=
{
{
width
:
320
}
}
placeholder=
"
Community
Name"
placeholder=
"
Estate
Name"
optionFilterProp=
"children"
optionFilterProp=
"children"
onChange=
{
onChange
}
onChange=
{
onChange
}
value=
{
value
}
value=
{
value
}
...
@@ -63,7 +63,7 @@ const SearchOptionsTow = (porps: any) => {
...
@@ -63,7 +63,7 @@ const SearchOptionsTow = (porps: any) => {
showSearch
showSearch
allowClear
allowClear
style=
{
{
width
:
200
}
}
style=
{
{
width
:
200
}
}
placeholder=
"
Community
Name"
placeholder=
"
Estate
Name"
optionFilterProp=
"children"
optionFilterProp=
"children"
onChange=
{
onChange
}
onChange=
{
onChange
}
value=
{
value
}
value=
{
value
}
...
...
src/components/TableShow/TableShow.tsx
View file @
2e1f9cf7
...
@@ -77,13 +77,11 @@ const TableShow = (props: any) => {
...
@@ -77,13 +77,11 @@ const TableShow = (props: any) => {
<
Row
gutter=
{
16
}
style=
{
{
marginLeft
:
9
}
}
>
<
Row
gutter=
{
16
}
style=
{
{
marginLeft
:
9
}
}
>
<
Col
>
Address:
</
Col
>
<
Col
>
Address:
</
Col
>
<
Col
>
<
Col
>
{
item
.
owner
.
buildingNumber
+
<
span
>
{
item
.
owner
.
buildingNumber
?
item
.
owner
.
buildingNumber
+
' #'
:
''
}
</
span
>
' #'
+
<
span
>
item
.
owner
.
floorNumber
+
{
item
.
owner
.
floorNumber
}
-
{
item
.
owner
.
roomNumber
}
{
' , '
}
' -'
+
</
span
>
item
.
owner
.
roomNumber
+
<
span
>
{
item
.
owner
.
addressAndpostalCode
}
</
span
>
', '
+
item
.
owner
.
addressAndpostalCode
}
</
Col
>
</
Col
>
</
Row
>
</
Row
>
{
item
.
unit
.
map
((
unit
:
any
,
uindex
:
any
)
=>
{
{
item
.
unit
.
map
((
unit
:
any
,
uindex
:
any
)
=>
{
...
...
src/components/TreeAction/TreeAction.tsx
View file @
2e1f9cf7
...
@@ -144,7 +144,7 @@ const treeData = [
...
@@ -144,7 +144,7 @@ const treeData = [
],
],
},
},
{
{
title
:
'
Community
management'
,
title
:
'
Estate
management'
,
key
:
'G'
,
key
:
'G'
,
children
:
[
children
:
[
{
title
:
'View community'
,
key
:
'20'
},
{
title
:
'View community'
,
key
:
'20'
},
...
...
src/locales/en-US/menu.ts
View file @
2e1f9cf7
/*
/*
* @Author: your name
* @Author: your name
* @Date: 2020-12-14 18:52:22
* @Date: 2020-12-14 18:52:22
* @LastEditTime: 2021-0
3-31 17:33:33
* @LastEditTime: 2021-0
4-22 15:18:20
* @LastEditors: Please set LastEditors
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\locales\en-US\menu.ts
* @FilePath: \tostumi\src\locales\en-US\menu.ts
...
@@ -64,17 +64,18 @@ export default {
...
@@ -64,17 +64,18 @@ export default {
'menu.usemanagement.serviceproviders'
:
'Service Provider Management'
,
'menu.usemanagement.serviceproviders'
:
'Service Provider Management'
,
'menu.propertymanagement'
:
'Property Fee Management'
,
'menu.propertymanagement'
:
'Property Fee Management'
,
'menu.commercialservice'
:
'Service Requests'
,
'menu.commercialservice'
:
'Service Requests'
,
'menu.commercialservice.communitymaintenance'
:
'
Community
maintenance'
,
'menu.commercialservice.communitymaintenance'
:
'
Estate
maintenance'
,
'menu.commercialservice.ownercomplaints'
:
'Complaints'
,
'menu.commercialservice.ownercomplaints'
:
'Complaints'
,
'menu.commercialservice.problemfeedback'
:
'Feedback'
,
'menu.commercialservice.problemfeedback'
:
'Feedback'
,
'menu.commercialservice.renovationapplication'
:
'Renovation Application'
,
'menu.commercialservice.renovationapplication'
:
'Renovation Application'
,
'menu.commercialservice.moveout'
:
'Move Out Request'
,
'menu.commercialservice.accessCardapplication'
:
'Access Card Application'
,
'menu.commercialservice.accessCardapplication'
:
'Access Card Application'
,
'menu.commercialservice.reportonline'
:
'Report Matters'
,
'menu.commercialservice.reportonline'
:
'Report Matters'
,
'menu.commercialservice.shelflifeservice'
:
'Warranty Period Service'
,
'menu.commercialservice.shelflifeservice'
:
'Warranty Period Service'
,
'menu.ordermanagement'
:
'Order Management'
,
'menu.ordermanagement'
:
'Order Management'
,
'menu.contractmanagement'
:
'Contract Management'
,
'menu.contractmanagement'
:
'Contract Management'
,
'menu.communitymanagement'
:
'
Community
Management'
,
'menu.communitymanagement'
:
'
Estate
Management'
,
'menu.communitymanagement.celllist'
:
'
Community
'
,
'menu.communitymanagement.celllist'
:
'
Estate
'
,
'menu.communitymanagement.communityannouncement'
:
'Announcements'
,
'menu.communitymanagement.communityannouncement'
:
'Announcements'
,
'menu.communitymanagement.facilitybookings'
:
'Facility Bookings'
,
'menu.communitymanagement.facilitybookings'
:
'Facility Bookings'
,
'menu.communitymanagement.visitorrecord'
:
'Visitor Records'
,
'menu.communitymanagement.visitorrecord'
:
'Visitor Records'
,
...
...
src/locales/zh-CN/menu.ts
View file @
2e1f9cf7
/*
/*
* @Author: your name
* @Author: your name
* @Date: 2020-12-14 18:52:22
* @Date: 2020-12-14 18:52:22
* @LastEditTime: 2021-0
3-01 10:05:23
* @LastEditTime: 2021-0
4-21 14:56:22
* @LastEditors:
your name
* @LastEditors:
Please set LastEditors
* @Description: In User Settings Edit
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\locales\zh-CN\menu.ts
* @FilePath: \tostumi\src\locales\zh-CN\menu.ts
*/
*/
...
@@ -68,6 +68,7 @@ export default {
...
@@ -68,6 +68,7 @@ export default {
'menu.commercialservice.ownercomplaints'
:
'业主投诉'
,
'menu.commercialservice.ownercomplaints'
:
'业主投诉'
,
'menu.commercialservice.problemfeedback'
:
'问题反馈'
,
'menu.commercialservice.problemfeedback'
:
'问题反馈'
,
'menu.commercialservice.renovationapplication'
:
'装修申请'
,
'menu.commercialservice.renovationapplication'
:
'装修申请'
,
'menu.commercialservice.moveout'
:
'迁出申请'
,
'menu.commercialservice.accessCardapplication'
:
'住户卡申请'
,
'menu.commercialservice.accessCardapplication'
:
'住户卡申请'
,
'menu.commercialservice.reportonline'
:
'在线报事'
,
'menu.commercialservice.reportonline'
:
'在线报事'
,
'menu.commercialservice.shelflifeservice'
:
'保质期服务'
,
'menu.commercialservice.shelflifeservice'
:
'保质期服务'
,
...
...
src/models/CommunityManagement/CommunityService.ts
View file @
2e1f9cf7
...
@@ -13,6 +13,7 @@ export default {
...
@@ -13,6 +13,7 @@ export default {
CurDataDetail
:
null
,
CurDataDetail
:
null
,
Data7
:
null
,
Data7
:
null
,
Data8
:
null
,
Data8
:
null
,
Data9
:
null
,
// 迁出申请列表
Result
:
null
,
Result
:
null
,
DataSaveDetail
:
null
,
DataSaveDetail
:
null
,
loadding
:
false
,
loadding
:
false
,
...
@@ -37,6 +38,9 @@ export default {
...
@@ -37,6 +38,9 @@ export default {
returnPage8
(
state
:
object
,
{
Data8
}:
any
)
{
returnPage8
(
state
:
object
,
{
Data8
}:
any
)
{
return
{
...
state
,
Data8
};
return
{
...
state
,
Data8
};
},
},
returnPage9
(
state
:
object
,
{
Data9
}:
any
)
{
return
{
...
state
,
Data9
};
},
returnResult
(
state
:
object
,
{
Result
}:
any
)
{
returnResult
(
state
:
object
,
{
Result
}:
any
)
{
return
{
...
state
,
Result
};
return
{
...
state
,
Result
};
},
},
...
@@ -44,8 +48,8 @@ export default {
...
@@ -44,8 +48,8 @@ export default {
return
{
...
state
,
DataSaveDetail
};
return
{
...
state
,
DataSaveDetail
};
},
},
returnLoadding
(
state
:
object
,
{
loadding
}:
{
loadding
:
boolean
})
{
returnLoadding
(
state
:
object
,
{
loadding
}:
{
loadding
:
boolean
})
{
return
{
...
state
,
loadding
}
return
{
...
state
,
loadding
}
;
}
}
,
},
},
effects
:
{
effects
:
{
...
@@ -67,7 +71,7 @@ export default {
...
@@ -67,7 +71,7 @@ export default {
// message.error(`${resp.error_code}:${resp.error_msg}`);
// message.error(`${resp.error_code}:${resp.error_msg}`);
// }
// }
if
(
resp
.
error_code
!==
'0000'
)
{
if
(
resp
.
error_code
!==
'0000'
)
{
message
.
error
(
`
${
resp
.
error_code
}
:
${
resp
.
error_msg
||
"unkonw error"
}
`
);
message
.
error
(
`
${
resp
.
error_code
}
:
${
resp
.
error_msg
||
'unkonw error'
}
`
);
history
.
go
(
-
1
);
history
.
go
(
-
1
);
}
else
{
}
else
{
switch
(
playload
.
index
)
{
switch
(
playload
.
index
)
{
...
@@ -99,7 +103,17 @@ export default {
...
@@ -99,7 +103,17 @@ export default {
}
=
{
}
=
{
community
:
tmp
.
communityName
||
tmp
.
communityName
,
community
:
tmp
.
communityName
||
tmp
.
communityName
,
address
:
tmp
.
addressAndpostalCode
||
tmp
.
residentialAddress
,
address
:
tmp
.
addressAndpostalCode
||
tmp
.
residentialAddress
,
home
:
(
tmp
.
buildingNumber
||
tmp
.
communityBuild
)
+
' #'
+
(
tmp
.
floorNumber
||
tmp
.
communityFloor
)
+
'-'
+
(
tmp
.
roomNumber
||
tmp
.
communtiyRoom
),
home
:
tmp
.
buildingNumber
||
tmp
.
communityBuild
?
(
tmp
.
buildingNumber
||
tmp
.
communityBuild
)
+
' #'
+
(
tmp
.
floorNumber
||
tmp
.
communityFloor
)
+
'-'
+
(
tmp
.
roomNumber
||
tmp
.
communtiyRoom
)
:
(
tmp
.
floorNumber
||
tmp
.
communityFloor
)
+
'-'
+
(
tmp
.
roomNumber
||
tmp
.
communtiyRoom
),
name
:
tmp
.
owerName
||
tmp
.
ownerFamilyName
,
name
:
tmp
.
owerName
||
tmp
.
ownerFamilyName
,
phone
:
tmp
.
owerPhone
||
tmp
.
ownerFamilyPhone
,
phone
:
tmp
.
owerPhone
||
tmp
.
ownerFamilyPhone
,
email
:
tmp
.
owerEmail
||
tmp
.
ownerFamilyEmail
,
email
:
tmp
.
owerEmail
||
tmp
.
ownerFamilyEmail
,
...
@@ -119,6 +133,7 @@ export default {
...
@@ -119,6 +133,7 @@ export default {
case
33
:
case
33
:
case
34
:
case
34
:
case
22
:
case
22
:
case
76
:
// message.success('Success Operation!', 3);
// message.success('Success Operation!', 3);
history
.
go
(
-
1
);
history
.
go
(
-
1
);
// history.push("/CommercialService/CommunityMaintenance")
// history.push("/CommercialService/CommunityMaintenance")
...
@@ -129,6 +144,12 @@ export default {
...
@@ -129,6 +144,12 @@ export default {
yield
put
({
type
:
'returnPage8'
,
Data8
});
yield
put
({
type
:
'returnPage8'
,
Data8
});
}
}
break
;
break
;
case
74
:
{
const
Data9
=
resp
;
yield
put
({
type
:
'returnPage9'
,
Data9
});
}
break
;
case
31
:
case
31
:
{
{
const
Data7
=
resp
;
const
Data7
=
resp
;
...
@@ -142,17 +163,14 @@ export default {
...
@@ -142,17 +163,14 @@ export default {
}
}
break
;
break
;
case
37
:
case
37
:
{
const
DataSaveDetail
=
resp
;
yield
put
({
type
:
'returnDataSaveDetail'
,
DataSaveDetail
});
}
break
;
case
36
:
case
36
:
case
75
:
{
{
const
DataSaveDetail
=
resp
;
const
DataSaveDetail
=
resp
;
yield
put
({
type
:
'returnDataSaveDetail'
,
DataSaveDetail
});
yield
put
({
type
:
'returnDataSaveDetail'
,
DataSaveDetail
});
}
}
break
;
break
;
case
40
:
case
40
:
{
{
const
Data
=
resp
;
const
Data
=
resp
;
...
@@ -180,22 +198,22 @@ export default {
...
@@ -180,22 +198,22 @@ export default {
yield
put
({
type
:
'returnCurDataDetail'
,
CurDataDetail
});
yield
put
({
type
:
'returnCurDataDetail'
,
CurDataDetail
});
},
},
*
ResultClear
({
},
{
put
}:
any
)
{
*
ResultClear
({},
{
put
}:
any
)
{
const
Result
=
null
;
const
Result
=
null
;
yield
put
({
type
:
'returnResult'
,
Result
});
yield
put
({
type
:
'returnResult'
,
Result
});
},
},
*
DataSaveDetailClear
({
},
{
put
}:
any
)
{
*
DataSaveDetailClear
({},
{
put
}:
any
)
{
const
DataSaveDetail
=
null
;
const
DataSaveDetail
=
null
;
yield
put
({
type
:
'returnDataSaveDetail'
,
DataSaveDetail
});
yield
put
({
type
:
'returnDataSaveDetail'
,
DataSaveDetail
});
},
},
*
DataSaveClear
({
},
{
put
}:
any
)
{
*
DataSaveClear
({},
{
put
}:
any
)
{
const
DataSave
=
null
;
const
DataSave
=
null
;
yield
put
({
type
:
'returnDataSave'
,
DataSave
});
yield
put
({
type
:
'returnDataSave'
,
DataSave
});
},
},
*
Data7Clear
({
},
{
put
}:
any
)
{
*
Data7Clear
({},
{
put
}:
any
)
{
const
Data7
=
null
;
const
Data7
=
null
;
yield
put
({
type
:
'returnPage7'
,
Data7
});
yield
put
({
type
:
'returnPage7'
,
Data7
});
},
},
...
...
src/models/CommunityManagement/FacilityBookings.ts
View file @
2e1f9cf7
...
@@ -129,7 +129,7 @@ export default {
...
@@ -129,7 +129,7 @@ export default {
if
(
JSON
.
stringify
(
Data3
)
==
'{}'
)
{
if
(
JSON
.
stringify
(
Data3
)
==
'{}'
)
{
Data3
=
false
;
Data3
=
false
;
// 提示小区没有设施
// 提示小区没有设施
message
.
warning
(
'There Are No Facilities In The
Community
!'
);
message
.
warning
(
'There Are No Facilities In The
Estate
!'
);
}
}
yield
put
({
type
:
'returnPage3'
,
Data3
});
yield
put
({
type
:
'returnPage3'
,
Data3
});
}
}
...
...
src/models/communityNotice.ts
View file @
2e1f9cf7
import
{
getAllNotice
,
getAllDevice
,
saveDevice
,
delDevice
,
getDeviceNum
,
getNewAddBug
,
importUserDeviceListExcel
,
import
{
getUserDevice
,
saveUserDevice
,
getTargetKeys
,
getNewAdd
,
importUserListExcel
,
getDeviceDetails
}
from
'@/services/communityNotice'
;
getAllNotice
,
import
{
getRegion
,
getRegionList
}
from
'@/services/region'
;
getAllDevice
,
saveDevice
,
delDevice
,
getDeviceNum
,
getNewAddBug
,
importUserDeviceListExcel
,
getUserDevice
,
saveUserDevice
,
getTargetKeys
,
getNewAdd
,
importUserListExcel
,
getDeviceDetails
,
}
from
'@/services/communityNotice'
;
import
{
getRegion
,
getRegionList
}
from
'@/services/region'
;
export
default
{
export
default
{
namespace
:
'communityNoticeModel'
,
namespace
:
'communityNoticeModel'
,
state
:
{
state
:
{
data
:
[],
data
:
[],
},
},
effects
:
{
effects
:
{
*
getAllNotice
({
callback
,
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
getAllNotice
,
payload
);
*
getAllNotice
({
callback
,
payload
},{
call
,
put
})
{
const
response
=
yield
call
(
getAllNotice
,
payload
);
yield
put
({
yield
put
({
type
:
"getAll"
,
type
:
'getAll'
,
});
});
if
(
callback
)
callback
(
response
);
if
(
callback
)
callback
(
response
);
},
},
*
getAllDevice
({
callback
,
payload
},
{
call
,
put
})
{
*
getAllDevice
({
callback
,
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
getAllDevice
,
payload
);
const
response
=
yield
call
(
getAllDevice
,
payload
);
yield
put
({
yield
put
({
type
:
"getAll"
,
type
:
'getAll'
,
});
});
if
(
callback
)
callback
(
response
);
if
(
callback
)
callback
(
response
);
},
},
*
getRegion
({
callback
,
payload
},
{
call
,
put
})
{
*
getRegion
({
callback
,
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
getRegion
,
payload
);
const
response
=
yield
call
(
getRegion
,
payload
);
yield
put
({
yield
put
({
type
:
"getRegions"
,
type
:
'getRegions'
,
});
});
if
(
callback
)
callback
(
response
);
if
(
callback
)
callback
(
response
);
},
},
*
saveDevice
({
callback
,
payload
},
{
call
,
put
})
{
*
saveDevice
({
callback
,
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
saveDevice
,
payload
);
const
response
=
yield
call
(
saveDevice
,
payload
);
yield
put
({
yield
put
({
type
:
"save"
,
type
:
'save'
,
});
});
if
(
callback
)
callback
(
response
);
if
(
callback
)
callback
(
response
);
},
},
*
delDevice
({
callback
,
payload
},
{
call
,
put
})
{
*
delDevice
({
callback
,
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
delDevice
,
payload
);
const
response
=
yield
call
(
delDevice
,
payload
);
yield
put
({
yield
put
({
type
:
"del"
,
type
:
'del'
,
});
});
if
(
callback
)
callback
(
response
);
if
(
callback
)
callback
(
response
);
},
},
*
getRegionList
({
callback
,
payload
},
{
call
,
put
})
{
*
getRegionList
({
callback
,
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
getRegionList
,
payload
);
const
response
=
yield
call
(
getRegionList
,
payload
);
yield
put
({
yield
put
({
type
:
"regionList"
,
type
:
'regionList'
,
});
});
if
(
callback
)
callback
(
response
);
if
(
callback
)
callback
(
response
);
},
},
*
getDeviceNum
({
callback
,
payload
},
{
call
,
put
})
{
*
getDeviceNum
({
callback
,
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
getDeviceNum
,
payload
);
const
response
=
yield
call
(
getDeviceNum
,
payload
);
yield
put
({
yield
put
({
type
:
"num"
,
type
:
'num'
,
});
});
if
(
callback
)
callback
(
response
);
if
(
callback
)
callback
(
response
);
},
},
*
getUserDevice
({
callback
,
payload
},
{
call
,
put
})
{
*
getUserDevice
({
callback
,
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
getUserDevice
,
payload
);
const
response
=
yield
call
(
getUserDevice
,
payload
);
yield
put
({
yield
put
({
type
:
"userDevice"
,
type
:
'userDevice'
,
});
});
if
(
callback
)
callback
(
response
);
if
(
callback
)
callback
(
response
);
},
},
*
saveUserDevice
({
callback
,
payload
},
{
call
,
put
})
{
*
saveUserDevice
({
callback
,
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
saveUserDevice
,
payload
);
const
response
=
yield
call
(
saveUserDevice
,
payload
);
yield
put
({
yield
put
({
type
:
"userDeviceSave"
,
type
:
'userDeviceSave'
,
});
});
if
(
callback
)
callback
(
response
);
if
(
callback
)
callback
(
response
);
},
},
*
getTargetKeys
({
callback
,
payload
},
{
call
,
put
})
{
*
getTargetKeys
({
callback
,
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
getTargetKeys
,
payload
);
const
response
=
yield
call
(
getTargetKeys
,
payload
);
yield
put
({
yield
put
({
type
:
"targetKeys"
,
type
:
'targetKeys'
,
});
});
if
(
callback
)
callback
(
response
);
if
(
callback
)
callback
(
response
);
},
},
*
getNewAdd
({
callback
,
payload
},
{
call
,
put
})
{
*
getNewAdd
({
callback
,
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
getNewAdd
,
payload
);
const
response
=
yield
call
(
getNewAdd
,
payload
);
yield
put
({
yield
put
({
type
:
"newAdd"
,
type
:
'newAdd'
,
});
});
if
(
callback
)
callback
(
response
);
if
(
callback
)
callback
(
response
);
},
},
*
getNewAddBug
({
callback
,
payload
},
{
call
,
put
})
{
*
getNewAddBug
({
callback
,
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
getNewAddBug
,
payload
);
const
response
=
yield
call
(
getNewAddBug
,
payload
);
yield
put
({
yield
put
({
type
:
"newAddBug"
,
type
:
'newAddBug'
,
});
});
if
(
callback
)
callback
(
response
);
if
(
callback
)
callback
(
response
);
},
},
*
importUserListExcel
({
callback
,
payload
},
{
call
,
put
})
{
*
importUserListExcel
({
callback
,
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
importUserListExcel
,
payload
);
const
response
=
yield
call
(
importUserListExcel
,
payload
);
yield
put
({
yield
put
({
type
:
"importListExcel"
,
type
:
'importListExcel'
,
});
});
if
(
callback
)
callback
(
response
);
if
(
callback
)
callback
(
response
);
},
},
*
importUserDeviceListExcel
({
callback
,
payload
},
{
call
,
put
})
{
*
importUserDeviceListExcel
({
callback
,
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
importUserDeviceListExcel
,
payload
);
const
response
=
yield
call
(
importUserDeviceListExcel
,
payload
);
yield
put
({
yield
put
({
type
:
"importDeviceListExcel"
,
type
:
'importDeviceListExcel'
,
});
});
if
(
callback
)
callback
(
response
);
if
(
callback
)
callback
(
response
);
},
},
*
getDeviceDetails
({
callback
,
payload
},
{
call
,
put
})
{
*
getDeviceDetails
({
callback
,
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
getDeviceDetails
,
payload
);
const
response
=
yield
call
(
getDeviceDetails
,
payload
);
yield
put
({
yield
put
({
type
:
"deviceDetails"
,
type
:
'deviceDetails'
,
});
});
if
(
callback
)
callback
(
response
);
if
(
callback
)
callback
(
response
);
},
},
},
},
reducers
:
{
reducers
:
{
getAll
(
state
,
action
)
{
getAll
(
state
,
action
)
{
return
{
return
{
...
state
,
...
state
,
data
:
action
.
payload
||
{},
data
:
action
.
payload
||
{},
};
};
},
},
getRegions
(
state
,
action
)
{
getRegions
(
state
,
action
)
{
return
{
return
{
...
state
,
...
state
,
data
:
action
.
payload
||
{},
data
:
action
.
payload
||
{},
};
};
},
},
save
(
state
,
action
)
{
save
(
state
,
action
)
{
return
{
return
{
...
state
,
...
state
,
data
:
action
.
payload
||
{},
data
:
action
.
payload
||
{},
};
};
},
},
del
(
state
,
action
)
{
del
(
state
,
action
)
{
return
{
return
{
...
state
,
...
state
,
data
:
action
.
payload
||
{},
data
:
action
.
payload
||
{},
};
};
},
},
regionList
(
state
,
action
)
{
regionList
(
state
,
action
)
{
return
{
return
{
...
state
,
...
state
,
data
:
action
.
payload
||
{},
data
:
action
.
payload
||
{},
};
};
},
},
num
(
state
,
action
)
{
num
(
state
,
action
)
{
return
{
return
{
...
state
,
...
state
,
data
:
action
.
payload
||
{},
data
:
action
.
payload
||
{},
};
};
},
},
userDevice
(
state
,
action
)
{
userDevice
(
state
,
action
)
{
return
{
return
{
...
state
,
...
state
,
data
:
action
.
payload
||
{},
data
:
action
.
payload
||
{},
};
};
},
},
userDeviceSave
(
state
,
action
)
{
userDeviceSave
(
state
,
action
)
{
return
{
return
{
...
state
,
...
state
,
data
:
action
.
payload
||
{},
data
:
action
.
payload
||
{},
};
};
},
},
targetKeys
(
state
,
action
)
{
targetKeys
(
state
,
action
)
{
return
{
return
{
...
state
,
...
state
,
data
:
action
.
payload
||
{},
data
:
action
.
payload
||
{},
};
};
},
},
newAdd
(
state
,
action
)
{
newAdd
(
state
,
action
)
{
return
{
return
{
...
state
,
...
state
,
data
:
action
.
payload
||
{},
data
:
action
.
payload
||
{},
};
};
},
},
newAddBug
(
state
,
action
)
{
newAddBug
(
state
,
action
)
{
return
{
return
{
...
state
,
...
state
,
data
:
action
.
payload
||
{},
data
:
action
.
payload
||
{},
};
};
},
},
importListExcel
(
state
,
action
)
{
importListExcel
(
state
,
action
)
{
return
{
return
{
...
state
,
...
state
,
data
:
action
.
payload
||
{},
data
:
action
.
payload
||
{},
};
};
},
},
importDeviceListExcel
(
state
,
action
)
{
importDeviceListExcel
(
state
,
action
)
{
return
{
return
{
...
state
,
...
state
,
data
:
action
.
payload
||
{},
data
:
action
.
payload
||
{},
};
};
},
},
deviceDetails
(
state
,
action
)
{
deviceDetails
(
state
,
action
)
{
return
{
return
{
...
state
,
...
state
,
data
:
action
.
payload
||
{},
data
:
action
.
payload
||
{},
};
};
},
},
},
},
};
};
src/pages/AccountManagement/AccountManagement/AccountManagement.tsx
View file @
2e1f9cf7
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
import
{
Input
,
Button
,
Table
,
Space
,
Pagination
,
Form
,
Select
,
Layout
}
from
'antd'
;
import
{
Input
,
Button
,
Table
,
Space
,
Pagination
,
Form
,
Select
,
Layout
}
from
'antd'
;
const
{
Option
}
=
Select
;
const
{
Option
}
=
Select
;
...
@@ -17,90 +17,109 @@ import { RA, translate } from '@/utils/method';
...
@@ -17,90 +17,109 @@ import { RA, translate } from '@/utils/method';
import
{
EyeTwoTone
,
EyeInvisibleOutlined
,
StarTwoTone
}
from
'@ant-design/icons'
;
import
{
EyeTwoTone
,
EyeInvisibleOutlined
,
StarTwoTone
}
from
'@ant-design/icons'
;
import
{
validateMessages
}
from
'@/utils/params'
;
import
{
validateMessages
}
from
'@/utils/params'
;
const
authorizeLevel
=
[
"Administrator"
,
"Secondary Administrator"
,
"Three Level Administrator"
]
const
authorizeLevel
=
[
'Administrator'
,
'Secondary Administrator'
,
'Three Level Administrator'
];
const
user_state
=
[[
0
,
"enabled"
],[
1
,
"Disabled"
]]
const
user_state
=
[
const
module
=
"Account"
[
0
,
'enabled'
],
const
AccountManagement
=
(
props
:
any
)
=>
{
[
1
,
'Disabled'
],
];
const
module
=
'Account'
;
const
AccountManagement
=
(
props
:
any
)
=>
{
const
{
dispatch
}
=
props
;
const
{
dispatch
}
=
props
;
const
formRef
=
useRef
(
null
)
const
formRef
=
useRef
(
null
)
;
const
onFinish
=
(
values
:
any
)
=>
{
const
onFinish
=
(
values
:
any
)
=>
{
console
.
log
(
values
)
console
.
log
(
values
)
;
var
tmp
=
{
var
tmp
=
{
"id"
:
"null"
,
id
:
'null'
,
"oneself"
:
0
,
oneself
:
0
,
"userStatus"
:
1
,
userStatus
:
1
,
"tosUserName"
:
null
,
tosUserName
:
null
,
"tosUserPwd"
:
null
,
tosUserPwd
:
null
,
"tosUserPhone"
:
null
,
tosUserPhone
:
null
,
"tosUserEmail"
:
null
,
tosUserEmail
:
null
,
"tosuserLevel"
:
null
,
tosuserLevel
:
null
,
"tosUserToCompany"
:
"1"
,
tosUserToCompany
:
'1'
,
"tosUserServiceCell"
:
""
,
tosUserServiceCell
:
''
,
}
}
;
var
tmp2
=
{}
var
tmp2
=
{}
;
translate
(
tmp
,
values
,
[
translate
(
tmp
,
values
,
[
[
"tosUserName"
,
"Account"
],
[
'tosUserName'
,
'Account'
],
[
"tosUserPwd"
,
"Password"
],
[
'tosUserPwd'
,
'Password'
],
[
"tosUserPhone"
,
"phone"
],
[
'tosUserPhone'
,
'phone'
],
[
"tosUserEmail"
,
"email"
],
[
'tosUserEmail'
,
'email'
],
[
"tosuserLevel"
,
"tosuserLevel"
],
[
'tosuserLevel'
,
'tosuserLevel'
],
])
])
;
translate
(
tmp2
,
values
,
[
translate
(
tmp2
,
values
,
[
[
"userName"
,
"Account"
],
[
'userName'
,
'Account'
],
[
"userPassword"
,
"Password"
],
[
'userPassword'
,
'Password'
],
[
"permissionArray"
,
"premission"
],
[
'permissionArray'
,
'premission'
],
])
])
;
RA
(
41
,
tmp
,
module
,
dispatch
)
RA
(
41
,
tmp
,
module
,
dispatch
)
;
RA
(
42
,
tmp2
,
module
,
dispatch
)
RA
(
42
,
tmp2
,
module
,
dispatch
);
}
}
;
return
(
return
(
<
div
className=
{
styles
.
base
}
>
<
div
className=
{
styles
.
base
}
>
{
/* 头部组件v1.2 */
}
{
/* 头部组件v1.2 */
}
<
TitleBack
title=
"Admin Account Adding"
/>
<
TitleBack
title=
"Admin Account Adding"
/>
<
Form
ref=
{
formRef
}
name=
"basic"
onFinish=
{
onFinish
}
validateMessages=
{
validateMessages
}
>
<
Form
ref=
{
formRef
}
name=
"basic"
onFinish=
{
onFinish
}
validateMessages=
{
validateMessages
}
>
<
Form
.
Item
name=
"Account"
label=
"Account"
rules=
{
[{
required
:
true
}]
}
>
<
Input
placeholder=
"account Name"
style=
{
{
width
:
200
}
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"Password"
label=
"Password"
rules=
{
[{
required
:
true
}]
}
>
<
Input
.
Password
type=
""
placeholder=
"password"
iconRender=
{
(
visible
)
=>
(
visible
?
<
EyeTwoTone
/>
:
<
EyeInvisibleOutlined
/>)
}
style=
{
{
width
:
200
}
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"Account"
label=
"Account"
rules=
{
[{
required
:
true
}]
}
><
Input
placeholder=
"account Name"
style=
{
{
width
:
200
}
}
/></
Form
.
Item
>
<
Form
.
Item
label=
"Contact Details"
>
<
Form
.
Item
name=
"Password"
label=
"Password"
rules=
{
[{
required
:
true
}]
}
><
Input
.
Password
type=
""
placeholder=
"password"
iconRender=
{
visible
=>
(
visible
?
<
EyeTwoTone
/>
:
<
EyeInvisibleOutlined
/>)
}
style=
{
{
width
:
200
}
}
/></
Form
.
Item
>
<
Form
.
Item
label=
"Contact Details"
>
<
Input
.
Group
compact
>
<
Input
.
Group
compact
>
<
Form
.
Item
name=
"phone"
style=
{
{
marginRight
:
16
}
}
rules=
{
[{
required
:
true
}]
}
><
Input
placeholder=
"Phone number"
></
Input
></
Form
.
Item
>
<
Form
.
Item
name=
"phone"
style=
{
{
marginRight
:
16
}
}
rules=
{
[{
required
:
true
}]
}
>
<
Form
.
Item
name=
"email"
rules=
{
[{
required
:
true
}]
}
><
Input
placeholder=
"Email"
></
Input
></
Form
.
Item
>
<
Input
placeholder=
"Phone number"
></
Input
>
</
Form
.
Item
>
<
Form
.
Item
name=
"email"
rules=
{
[{
required
:
true
}]
}
>
<
Input
placeholder=
"Email"
></
Input
>
</
Form
.
Item
>
</
Input
.
Group
>
</
Input
.
Group
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
name=
"community"
label=
"Community"
><
SelectCommunity
></
SelectCommunity
></
Form
.
Item
>
<
Form
.
Item
name=
"community"
label=
"Estate"
>
<
SelectCommunity
></
SelectCommunity
>
</
Form
.
Item
>
<
Form
.
Item
label=
"Level"
name=
"tosuserLevel"
wrapperCol=
{
{
offset
:
2
}
}
>
<
Form
.
Item
label=
"Level"
name=
"tosuserLevel"
wrapperCol=
{
{
offset
:
2
}
}
>
<
Select
placeholder=
"Level"
style=
{
{
width
:
240
}
}
>
<
Select
placeholder=
"Level"
style=
{
{
width
:
240
}
}
>
{
{
authorizeLevel
.
map
((
item
,
index
)
=>
{
authorizeLevel
.
map
((
item
,
index
)
=>
{
return
(
return
<
Option
key=
{
""
+
index
}
value=
{
""
+
index
+
1
}
>
{
item
}
</
Option
>
<
Option
key=
{
''
+
index
}
value=
{
''
+
index
+
1
}
>
})
{
item
}
}
</
Option
>
);
})
}
</
Select
>
</
Select
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
name=
"premission"
label=
"Permission"
wrapperCol=
{
{
offset
:
1
}
}
>
<
Form
.
Item
name=
"premission"
label=
"Permission"
wrapperCol=
{
{
offset
:
1
}
}
>
<
TreeAction
/>
<
TreeAction
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Line
></
Line
>
<
Line
></
Line
>
<
Form
.
Item
wrapperCol=
{
{
...
Layout
.
wrapperCol
,
offset
:
3
}
}
><
Button
type=
"primary"
htmlType=
"submit"
>
Submit
</
Button
></
Form
.
Item
>
<
Form
.
Item
wrapperCol=
{
{
...
Layout
.
wrapperCol
,
offset
:
3
}
}
>
<
Button
type=
"primary"
htmlType=
"submit"
>
Submit
</
Button
>
</
Form
.
Item
>
</
Form
>
</
Form
>
</
div
>
</
div
>
);
);
};
};
function
mapStateToProps
(
state
:
any
)
{
function
mapStateToProps
(
state
:
any
)
{
const
{
Data
}
=
state
.
Account
;
const
{
Data
}
=
state
.
Account
;
return
{
return
{
Data
Data
,
};
};
}
}
export
default
connect
(
mapStateToProps
)(
AccountManagement
);
export
default
connect
(
mapStateToProps
)(
AccountManagement
);
src/pages/AccountManagement/Service/service.tsx
View file @
2e1f9cf7
...
@@ -15,7 +15,7 @@ import moment from 'moment';
...
@@ -15,7 +15,7 @@ import moment from 'moment';
const
service
=
(
props
:
any
)
=>
{
const
service
=
(
props
:
any
)
=>
{
const
columns
=
[
const
columns
=
[
{
{
title
:
'
Community
'
,
title
:
'
Estate
'
,
dataIndex
:
'communityName'
,
dataIndex
:
'communityName'
,
key
:
'communityName'
,
key
:
'communityName'
,
width
:
240
,
width
:
240
,
...
@@ -144,7 +144,7 @@ const service = (props: any) => {
...
@@ -144,7 +144,7 @@ const service = (props: any) => {
toolBarRender=
{
false
}
toolBarRender=
{
false
}
scroll=
{
{
x
:
980
}
}
scroll=
{
{
x
:
980
}
}
options=
{
false
}
options=
{
false
}
headerTitle=
"
Community
List"
headerTitle=
"
Estate
List"
/>
/>
{
Data
?
(
{
Data
?
(
<
div
className=
"pages"
>
<
div
className=
"pages"
>
...
...
src/pages/AccountManagement/Service/serviceDetail.tsx
View file @
2e1f9cf7
...
@@ -150,7 +150,7 @@ const service = (props: any) => {
...
@@ -150,7 +150,7 @@ const service = (props: any) => {
onFinish=
{
onFinish
}
onFinish=
{
onFinish
}
>
>
{
/* 小区名 */
}
{
/* 小区名 */
}
<
Form
.
Item
label=
"
Community
"
name=
"communityName"
rules=
{
[{
required
:
true
}]
}
>
<
Form
.
Item
label=
"
Estate
"
name=
"communityName"
rules=
{
[{
required
:
true
}]
}
>
<
SearchOptionsCommnity
<
SearchOptionsCommnity
// ubmit={extendName}
// ubmit={extendName}
opname=
{
opname
}
opname=
{
opname
}
...
...
src/pages/AccountManagement/Service/serviceEdit.tsx
View file @
2e1f9cf7
/*
/*
* @Author: your name
* @Author: your name
* @Date: 2021-03-02 14:39:40
* @Date: 2021-03-02 14:39:40
* @LastEditTime: 2021-0
3-18 10:40:22
* @LastEditTime: 2021-0
4-22 15:18:59
* @LastEditors: Please set LastEditors
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\pages\AccountManagement\Service\serviceEdit.tsx
* @FilePath: \tostumi\src\pages\AccountManagement\Service\serviceEdit.tsx
...
@@ -124,7 +124,7 @@ const service = (props: any) => {
...
@@ -124,7 +124,7 @@ const service = (props: any) => {
onFinish=
{
onFinish
}
onFinish=
{
onFinish
}
>
>
{
/* 小区名 */
}
{
/* 小区名 */
}
<
Form
.
Item
label=
"
Community
"
name=
"communityName"
rules=
{
[{
required
:
true
}]
}
>
<
Form
.
Item
label=
"
Estate
"
name=
"communityName"
rules=
{
[{
required
:
true
}]
}
>
<
SearchOptionsCommnity
<
SearchOptionsCommnity
// ubmit={extendName}
// ubmit={extendName}
opname=
{
opname
}
opname=
{
opname
}
...
...
src/pages/CommercialService/Card.tsx
View file @
2e1f9cf7
...
@@ -3,7 +3,7 @@ import { Table, Space, Button, message } from 'antd';
...
@@ -3,7 +3,7 @@ import { Table, Space, Button, message } from 'antd';
import
{
connect
,
history
}
from
'umi'
;
import
{
connect
,
history
}
from
'umi'
;
import
{
RA
,
urlEncode
,
filterObjbyTg
,
Clear
}
from
'@/utils/method'
;
import
{
RA
,
urlEncode
,
filterObjbyTg
,
Clear
}
from
'@/utils/method'
;
import
{
objectColumns
}
from
'@/utils/string'
;
import
{
objectColumns
}
from
'@/utils/string'
;
import
{
timestampToTime
}
from
'@/utils/time
'
;
import
moment
from
'moment
'
;
import
TitleSearch
from
'../../components/TitleSearch/TitleSearch'
;
import
TitleSearch
from
'../../components/TitleSearch/TitleSearch'
;
let
readyData
:
any
=
{
let
readyData
:
any
=
{
...
@@ -33,7 +33,7 @@ const Card = (props: any) => {
...
@@ -33,7 +33,7 @@ const Card = (props: any) => {
];
];
const
columns
=
objectColumns
([
const
columns
=
objectColumns
([
[
'
Community
'
,
'community_name'
],
[
'
Estate
'
,
'community_name'
],
[
[
'Requestor'
,
'Requestor'
,
'apply_name'
,
'apply_name'
,
...
@@ -47,9 +47,11 @@ const Card = (props: any) => {
...
@@ -47,9 +47,11 @@ const Card = (props: any) => {
'Unit No'
,
'Unit No'
,
null
,
null
,
(
text
:
any
,
record
:
any
)
=>
(
(
text
:
any
,
record
:
any
)
=>
(
<
Space
size=
"middle"
>
<>
{
record
.
build_number
+
' #'
+
record
.
floor_number
+
'-'
+
record
.
room_number
}
{
record
.
build_number
?
<
span
>
{
record
.
build_number
}
#
</
span
>
:
''
}
</
Space
>
<
span
>
{
record
.
floor_number
}
-
</
span
>
<
span
>
{
record
.
room_number
}
</
span
>
</>
),
),
],
],
[
[
...
@@ -61,7 +63,7 @@ const Card = (props: any) => {
...
@@ -61,7 +63,7 @@ const Card = (props: any) => {
'Application Time'
,
'Application Time'
,
null
,
null
,
(
text
:
any
,
record
:
any
)
=>
(
(
text
:
any
,
record
:
any
)
=>
(
<
Space
size=
"middle"
>
{
timestampToTime
(
record
.
create_time
.
time
)
}
</
Space
>
<
Space
size=
"middle"
>
{
moment
(
text
.
time
).
format
(
'MM.DD HH:mm'
)
}
</
Space
>
),
),
],
],
[
[
...
...
src/pages/CommercialService/CardAdd.tsx
View file @
2e1f9cf7
...
@@ -42,8 +42,7 @@ const CardAdd = (props: any) => {
...
@@ -42,8 +42,7 @@ const CardAdd = (props: any) => {
}
}
values
.
communityName
=
communityName
;
values
.
communityName
=
communityName
;
values
.
buildNumber
=
'BLK '
+
values
.
buildNumber
;
values
.
buildNumber
=
values
.
buildNumber
?
'BLK '
+
values
.
buildNumber
:
''
;
console
.
log
(
values
);
setLoading
(
true
);
setLoading
(
true
);
RA
(
35
,
values
,
module
,
dispatch
);
RA
(
35
,
values
,
module
,
dispatch
);
};
};
...
@@ -86,7 +85,7 @@ const CardAdd = (props: any) => {
...
@@ -86,7 +85,7 @@ const CardAdd = (props: any) => {
<
TitleBack
title=
"New Application For Access Card"
/>
<
TitleBack
title=
"New Application For Access Card"
/>
<
Form
form=
{
form
}
name=
"basic"
onFinish=
{
onFinish
}
validateMessages=
{
validateMessages
}
>
<
Form
form=
{
form
}
name=
"basic"
onFinish=
{
onFinish
}
validateMessages=
{
validateMessages
}
>
<
Spin
spinning=
{
loading
}
>
<
Spin
spinning=
{
loading
}
>
<
Form
.
Item
labelCol=
{
{
span
:
3
}
}
label=
"
Community
"
style=
{
{
marginBottom
:
0
}
}
>
<
Form
.
Item
labelCol=
{
{
span
:
3
}
}
label=
"
Estate
"
style=
{
{
marginBottom
:
0
}
}
>
<
Input
.
Group
compact
>
<
Input
.
Group
compact
>
<
Form
.
Item
name=
"communityName"
style=
{
{
marginRight
:
20
}
}
>
<
Form
.
Item
name=
"communityName"
style=
{
{
marginRight
:
20
}
}
>
<
SearchOptionsCommnity
opname=
{
extendName
}
/>
<
SearchOptionsCommnity
opname=
{
extendName
}
/>
...
@@ -95,13 +94,6 @@ const CardAdd = (props: any) => {
...
@@ -95,13 +94,6 @@ const CardAdd = (props: any) => {
name=
"buildNumber"
name=
"buildNumber"
style=
{
{
marginRight
:
16
}
}
style=
{
{
marginRight
:
16
}
}
className=
{
styles
.
buildNumber
}
className=
{
styles
.
buildNumber
}
rules=
{
[
{
required
:
true
,
pattern
:
/^
[
a-zA-Z0-9
]
+$/
,
message
:
'Only numbers and letters can be entered'
,
},
]
}
>
>
<
Input
style=
{
{
width
:
80
}
}
placeholder=
"BLK"
/>
<
Input
style=
{
{
width
:
80
}
}
placeholder=
"BLK"
/>
</
Form
.
Item
>
</
Form
.
Item
>
...
...
src/pages/CommercialService/CardDetail.tsx
View file @
2e1f9cf7
...
@@ -11,6 +11,8 @@ import { RadioChangeEvent } from 'antd/lib/radio';
...
@@ -11,6 +11,8 @@ import { RadioChangeEvent } from 'antd/lib/radio';
const
module
=
'CommunityService'
;
const
module
=
'CommunityService'
;
import
{
BookingsTip
}
from
'@/utils/tip'
;
// const apply_status = [[0, "审核中"], [1, "批准"], [2, "拒绝"], [3, "领取"]]
// const apply_status = [[0, "审核中"], [1, "批准"], [2, "拒绝"], [3, "领取"]]
const
apply_status
=
[
const
apply_status
=
[
[
0
,
'Pending'
],
[
0
,
'Pending'
],
...
@@ -52,7 +54,7 @@ const CardDetail = (props: any) => {
...
@@ -52,7 +54,7 @@ const CardDetail = (props: any) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
DataSaveDetail
)
{
if
(
DataSaveDetail
)
{
console
.
log
(
DataSaveDetail
);
//
console.log(DataSaveDetail);
setListData
(
DataSaveDetail
.
data
.
rows
.
list
[
0
]);
setListData
(
DataSaveDetail
.
data
.
rows
.
list
[
0
]);
setOnwerDetail
(
DataSaveDetail
.
data
.
rows
.
onwerDetail
);
setOnwerDetail
(
DataSaveDetail
.
data
.
rows
.
onwerDetail
);
setLoading
(
false
);
setLoading
(
false
);
...
@@ -69,21 +71,52 @@ const CardDetail = (props: any) => {
...
@@ -69,21 +71,52 @@ const CardDetail = (props: any) => {
const
userInfo
=
localStorage
.
getItem
(
'userInfo'
)
||
''
;
const
userInfo
=
localStorage
.
getItem
(
'userInfo'
)
||
''
;
const
{
id
}
=
JSON
.
parse
(
userInfo
).
userModel
;
const
{
id
}
=
JSON
.
parse
(
userInfo
).
userModel
;
var
sta
=
''
;
if
(
listData
.
apply_status
==
0
)
{
// 0 从没回复
if
(
values
.
applyStatus
==
2
)
{
sta
=
'2'
;
}
else
{
sta
=
values
.
applyStatusType
&&
values
.
applyStatusType
==
3
?
'3'
:
'1'
;
}
}
else
if
(
listData
.
apply_status
==
1
)
{
sta
=
values
.
applyStatusType
&&
values
.
applyStatusType
==
3
?
'3'
:
'1'
;
}
const
tmp
=
{
const
tmp
=
{
communityId
:
listData
.
communityId
,
communityId
:
listData
.
communityId
,
id
:
listData
.
id
,
id
:
listData
.
id
,
ownerId
:
listData
.
ownerId
,
ownerId
:
listData
.
ownerId
,
replyId
:
id
,
replyId
:
id
,
applyStatus
:
values
.
applyStatus
,
applyStatus
:
sta
,
replyContent
:
replyContent
:
listData
.
apply_status
!==
0
&&
values
.
applyStatus
===
'3'
listData
.
apply_status
!==
0
&&
values
.
applyStatus
Type
==
3
?
listData
.
reply_content
?
listData
.
reply_content
:
values
.
replyContent
,
:
values
.
replyContent
,
type
:
'7'
,
type
:
'7'
,
houseCardNumber
:
values
.
houseCardNumber
,
};
};
// console.log(sta);
// console.log(listData);
// console.log(values);
// console.log(tmp);
RA
(
34
,
tmp
,
module
,
dispatch
);
RA
(
34
,
tmp
,
module
,
dispatch
);
setLoading
(
true
);
setLoading
(
true
);
};
};
// 只能输入字母数字限制
const
inputNumberStr
=
(
rule
:
any
,
value
:
any
,
callback
:
any
)
=>
{
if
(
value
)
{
if
(
/^
[
a-zA-Z0-9
]
+$/g
.
test
(
value
))
{
callback
();
}
else
{
callback
(
new
Error
(
'Only numbers and letters can be entered!'
));
}
}
else
{
callback
(
new
Error
(
'Required!'
));
}
};
return
(
return
(
<
Spin
size=
"large"
spinning=
{
loading
}
>
<
Spin
size=
"large"
spinning=
{
loading
}
>
<
div
style=
{
{
width
:
'100%'
,
minWidth
:
1020
,
padding
:
34
,
backgroundColor
:
'#ffffff'
}
}
>
<
div
style=
{
{
width
:
'100%'
,
minWidth
:
1020
,
padding
:
34
,
backgroundColor
:
'#ffffff'
}
}
>
...
@@ -91,18 +124,25 @@ const CardDetail = (props: any) => {
...
@@ -91,18 +124,25 @@ const CardDetail = (props: any) => {
<>
<>
<
TitleBack
<
TitleBack
sublist=
{
[
sublist=
{
[
'Status : '
+
apply_status
[
listData
.
apply_status
][
1
],
'Status : '
+
apply_status
&&
'Time : '
+
moment
(
listData
.
create_time
.
time
).
format
(
'DD-MM-YYYY'
),
apply_status
[
listData
.
apply_status
]
&&
apply_status
[
listData
.
apply_status
][
1
]
?
apply_status
[
listData
.
apply_status
][
1
]
:
''
,
'Time : '
+
listData
&&
listData
.
create_time
&&
listData
.
create_time
.
time
?
moment
(
listData
.
create_time
.
time
).
format
(
'DD-MM-YYYY'
)
:
''
,
]
}
]
}
title=
"Access Card Application Details"
title=
"Access Card Application Details"
/>
/>
<
Row
gutter=
{
8
}
>
<
Row
gutter=
{
8
}
>
<
Col
>
Community
:
</
Col
>
<
Col
>
Estate
:
</
Col
>
<
Col
span=
{
3
}
>
{
listData
.
community_name
}
</
Col
>
<
Col
span=
{
3
}
>
{
listData
.
community_name
}
</
Col
>
<
Col
>
Unit:
</
Col
>
<
Col
>
Unit:
</
Col
>
<
Col
>
<
Col
>
{
listData
.
build_number
+
' #'
+
listData
.
floor_number
+
'-'
+
listData
.
room_number
}
{
listData
.
build_number
?
listData
.
build_number
+
' #'
:
''
}
{
listData
.
floor_number
+
'-'
+
listData
.
room_number
}
</
Col
>
</
Col
>
</
Row
>
</
Row
>
...
@@ -135,7 +175,7 @@ const CardDetail = (props: any) => {
...
@@ -135,7 +175,7 @@ const CardDetail = (props: any) => {
<
Col
>
{
apply_relation_owner
[
parseInt
(
listData
.
apply_relation_owner
)]
}
</
Col
>
<
Col
>
{
apply_relation_owner
[
parseInt
(
listData
.
apply_relation_owner
)]
}
</
Col
>
</
Row
>
</
Row
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
3
}
>
Reason
:
</
Col
>
<
Col
span=
{
4
}
>
Decription of Work
:
</
Col
>
<
Col
>
<
Col
>
<
TextArea
<
TextArea
disabled
disabled
...
@@ -147,9 +187,14 @@ const CardDetail = (props: any) => {
...
@@ -147,9 +187,14 @@ const CardDetail = (props: any) => {
<
Line
/>
<
Line
/>
{
listData
.
apply_status
===
0
?
(
{
listData
.
apply_status
===
0
?
(
<
Form
ref=
{
formRef
}
name=
"basic"
onFinish=
{
onFinish
}
>
<
Form
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
ref=
{
formRef
}
<
Col
span=
{
3
}
>
Approval For Application:
</
Col
>
name=
"basic"
initialValues=
{
{
remember
:
true
}
}
onFinish=
{
onFinish
}
>
<
Row
gutter=
{
24
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
4
}
>
Approval For Application:
</
Col
>
<
Col
span=
{
6
}
>
<
Col
span=
{
6
}
>
<
Form
.
Item
<
Form
.
Item
name=
"applyStatus"
name=
"applyStatus"
...
@@ -170,32 +215,77 @@ const CardDetail = (props: any) => {
...
@@ -170,32 +215,77 @@ const CardDetail = (props: any) => {
</
Col
>
</
Col
>
</
Row
>
</
Row
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
{
/* 新增房卡号 */
}
<
Col
span=
{
3
}
>
Reply:
</
Col
>
{
/* 同意才需要卡号 */
}
{
!
isShowText
?
(
<
Row
gutter=
{
24
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
4
}
>
<
span
>
Room card number:
</
span
>
</
Col
>
<
Col
>
<
Form
.
Item
name=
"houseCardNumber"
rules=
{
[
{
required
:
true
,
message
:
'Please Room card number!'
,
validator
:
inputNumberStr
,
},
]
}
>
<
input
defaultValue=
{
''
}
placeholder=
"Room card number"
maxLength=
{
24
}
style=
{
{
width
:
300
,
border
:
'1px solid #d9d9d9'
,
padding
:
6
}
}
/>
</
Form
.
Item
>
</
Col
>
</
Row
>
)
:
(
''
)
}
<
Row
gutter=
{
24
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
4
}
>
Remarks:
</
Col
>
<
Col
>
<
Col
>
<
Form
.
Item
<
Form
.
Item
name=
"replyContent"
name=
"replyContent"
rules=
{
[{
required
:
isShowText
,
max
:
300
,
message
:
'*it is required!'
}]
}
rules=
{
isShowText
?
[{
required
:
isShowText
,
max
:
300
,
message
:
'*it is required!'
}]
:
[]
}
>
>
<
TextArea
style=
{
{
width
:
300
,
height
:
100
,
padding
:
8
}
}
/>
<
TextArea
placeholder=
"Remarks"
style=
{
{
width
:
300
,
height
:
100
,
padding
:
8
}
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
{
/* 同意才可以选择是否领取 */
}
{
!
isShowText
?
(
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
3
}
style=
{
{
marginTop
:
5
}
}
>
<
Col
span=
{
4
}
style=
{
{
marginTop
:
5
}
}
>
Card Receiv
ed:
Card Issu
ed:
</
Col
>
</
Col
>
<
Col
span=
{
4
}
>
<
Col
span=
{
4
}
>
<
Form
.
Item
name=
"applyStatus"
>
<
Form
.
Item
name=
"applyStatusType"
>
<
Radio
.
Group
>
<
Radio
.
Group
defaultValue=
{
4
}
>
<
Radio
value=
"3"
>
Receive
</
Radio
>
<
Radio
value=
{
3
}
>
Yes
</
Radio
>
<
Radio
value=
{
4
}
>
No
</
Radio
>
</
Radio
.
Group
>
</
Radio
.
Group
>
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
)
:
(
''
)
}
<
Row
>
<
Row
>
<
Col
span=
{
3
}
/>
<
Col
span=
{
4
}
/>
<
Col
>
<
Col
>
<
Form
.
Item
>
<
Form
.
Item
>
<
Button
type=
"primary"
htmlType=
"submit"
>
<
Button
type=
"primary"
htmlType=
"submit"
>
...
@@ -208,14 +298,14 @@ const CardDetail = (props: any) => {
...
@@ -208,14 +298,14 @@ const CardDetail = (props: any) => {
)
:
(
)
:
(
<>
<>
<
Row
>
<
Row
>
<
Col
span=
{
3
}
>
Attended By:
</
Col
>
<
Col
span=
{
4
}
>
Attended By:
</
Col
>
<
Col
span=
{
3
}
>
{
listData
.
replyName
}
</
Col
>
<
Col
span=
{
3
}
>
{
listData
.
replyName
}
</
Col
>
<
Col
span=
{
3
}
>
Contact Details:
</
Col
>
<
Col
span=
{
3
}
>
Contact Details:
</
Col
>
<
Col
>
{
listData
.
replyContact
}
</
Col
>
<
Col
>
{
listData
.
replyContact
}
</
Col
>
</
Row
>
</
Row
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Row
gutter=
{
24
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
3
}
>
Examine:
</
Col
>
<
Col
span=
{
4
}
>
Examine:
</
Col
>
<
Col
span=
{
5
}
>
<
Col
span=
{
8
}
>
<
Radio
.
Group
value=
{
listData
.
apply_status
===
2
?
'2'
:
'1'
}
>
<
Radio
.
Group
value=
{
listData
.
apply_status
===
2
?
'2'
:
'1'
}
>
<
Radio
.
Button
value=
"1"
disabled=
{
listData
.
apply_status
===
2
}
>
<
Radio
.
Button
value=
"1"
disabled=
{
listData
.
apply_status
===
2
}
>
Approve
Approve
...
@@ -231,8 +321,33 @@ const CardDetail = (props: any) => {
...
@@ -231,8 +321,33 @@ const CardDetail = (props: any) => {
</
Col
>
</
Col
>
</
Row
>
</
Row
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
{
/* 新增房卡号 */
}
<
Col
span=
{
3
}
>
Reply:
</
Col
>
{
listData
.
apply_status
!==
2
?
(
<
Row
gutter=
{
24
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
4
}
>
<
span
>
Room card number:
</
span
>
</
Col
>
<
Col
>
<
input
defaultValue=
{
listData
.
houseCardNumber
}
placeholder=
"Room card number"
maxLength=
{
24
}
style=
{
{
width
:
300
,
border
:
'1px solid #d9d9d9'
,
padding
:
6
,
color
:
listData
.
apply_status
===
2
?
'red'
:
''
,
}
}
disabled
/>
</
Col
>
</
Row
>
)
:
(
''
)
}
<
Row
gutter=
{
24
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
4
}
>
Remarks:
</
Col
>
<
Col
>
<
Col
>
<
TextArea
<
TextArea
disabled
disabled
...
@@ -248,21 +363,27 @@ const CardDetail = (props: any) => {
...
@@ -248,21 +363,27 @@ const CardDetail = (props: any) => {
</
Row
>
</
Row
>
{
listData
.
apply_status
===
1
?
(
{
listData
.
apply_status
===
1
?
(
<
Form
ref=
{
formRef
}
name=
"basic"
onFinish=
{
onFinish
}
>
<
Form
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
ref=
{
formRef
}
<
Col
span=
{
3
}
style=
{
{
marginTop
:
5
}
}
>
initialValues=
{
{
remember
:
true
}
}
Card Received:
name=
"basic"
onFinish=
{
onFinish
}
>
<
Row
gutter=
{
24
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
4
}
style=
{
{
marginTop
:
5
}
}
>
Card Issued:
</
Col
>
</
Col
>
<
Col
span=
{
4
}
>
<
Col
span=
{
4
}
>
<
Form
.
Item
name=
"applyStatus"
>
<
Form
.
Item
name=
"applyStatusType"
>
<
Radio
.
Group
>
<
Radio
.
Group
defaultValue=
{
listData
.
apply_status
==
3
?
3
:
4
}
>
<
Radio
value=
"3"
>
Receive
</
Radio
>
<
Radio
value=
{
3
}
>
Yes
</
Radio
>
<
Radio
value=
{
4
}
>
No
</
Radio
>
</
Radio
.
Group
>
</
Radio
.
Group
>
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
<
Row
>
<
Row
>
<
Col
span=
{
3
}
/>
<
Col
span=
{
4
}
/>
<
Col
>
<
Col
>
<
Form
.
Item
>
<
Form
.
Item
>
<
Button
type=
"primary"
htmlType=
"submit"
>
<
Button
type=
"primary"
htmlType=
"submit"
>
...
@@ -273,16 +394,14 @@ const CardDetail = (props: any) => {
...
@@ -273,16 +394,14 @@ const CardDetail = (props: any) => {
</
Row
>
</
Row
>
</
Form
>
</
Form
>
)
:
(
)
:
(
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Row
gutter=
{
24
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
3
}
style=
{
{
marginTop
:
5
}
}
>
<
Col
span=
{
4
}
style=
{
{
marginTop
:
5
}
}
>
Card
Receiv
ed:
Card
Issu
ed:
</
Col
>
</
Col
>
<
Col
span=
{
4
}
>
<
Col
span=
{
4
}
>
<
Radio
.
Group
<
Radio
.
Group
defaultValue=
{
listData
.
apply_status
==
3
?
3
:
4
}
disabled
>
value=
{
listData
.
apply_status
===
3
?
'3'
:
''
}
<
Radio
value=
{
3
}
>
Yes
</
Radio
>
disabled=
{
listData
.
apply_status
!==
3
}
<
Radio
value=
{
4
}
>
No
</
Radio
>
>
<
Radio
value=
"3"
>
Receive
</
Radio
>
</
Radio
.
Group
>
</
Radio
.
Group
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
...
...
src/pages/CommercialService/Detail.tsx
View file @
2e1f9cf7
...
@@ -26,7 +26,7 @@ const Detail = (props: any) => {
...
@@ -26,7 +26,7 @@ const Detail = (props: any) => {
const
[
headTitle
,
setHeadTitle
]
=
useState
(
''
);
const
[
headTitle
,
setHeadTitle
]
=
useState
(
''
);
const
headTitles
=
[
const
headTitles
=
[
'Reply To
Community
maintenance'
,
'Reply To
Estate
maintenance'
,
'Reply To Warranty Period Service'
,
'Reply To Warranty Period Service'
,
'Reply To Owner Complaints'
,
'Reply To Owner Complaints'
,
'Reply To Report Online'
,
'Reply To Report Online'
,
...
@@ -68,6 +68,8 @@ const Detail = (props: any) => {
...
@@ -68,6 +68,8 @@ const Detail = (props: any) => {
fromRef
.
current
.
setFieldsValue
(
tmp
);
fromRef
.
current
.
setFieldsValue
(
tmp
);
}
}
setLoading
(
false
);
setLoading
(
false
);
console
.
log
(
CurDataDetail
);
}
}
},
[
CurDataDetail
]);
},
[
CurDataDetail
]);
...
@@ -191,7 +193,7 @@ const Detail = (props: any) => {
...
@@ -191,7 +193,7 @@ const Detail = (props: any) => {
</
Row
>
</
Row
>
)
:
null
}
)
:
null
}
<
Row
gutter=
{
16
}
style=
{
{
marginTop
:
20
}
}
>
<
Row
gutter=
{
16
}
style=
{
{
marginTop
:
20
}
}
>
<
Col
span=
{
3
}
>
Solution
&
Conclusio
n:
</
Col
>
<
Col
span=
{
3
}
>
Action Take
n:
</
Col
>
<
Col
>
<
Col
>
<
Form
.
Item
name=
"replyContent"
rules=
{
[{
required
:
true
,
max
:
300
}]
}
>
<
Form
.
Item
name=
"replyContent"
rules=
{
[{
required
:
true
,
max
:
300
}]
}
>
<
TextArea
<
TextArea
...
...
src/pages/CommercialService/MoveOutDetail.tsx
0 → 100644
View file @
2e1f9cf7
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Row
,
Col
,
Button
,
Form
,
Radio
,
message
,
Spin
,
Input
}
from
'antd'
;
import
{
connect
,
history
}
from
'umi'
;
import
{
RA
,
getCookie
,
Clear
}
from
'@/utils/method'
;
import
TitleBack
from
'@/components/TitleBack/TitleBack'
;
import
Line
from
'@/components/Line/Line'
;
import
TextArea
from
'antd/lib/input/TextArea'
;
import
{
timestampToTime
}
from
'@/utils/time'
;
import
{
RadioChangeEvent
}
from
'antd/lib/radio'
;
import
moment
from
'moment'
;
import
'./css/Detail.less'
;
const
module
=
'CommunityService'
;
const
decoration_status
=
[
[
0
,
'Pending'
],
[
1
,
'Approved'
],
[
2
,
'Rejected'
],
];
const
RenovationDetail
=
(
props
:
any
)
=>
{
const
{
dispatch
,
DataSaveDetail
,
location
,
match
,
user
}
=
props
;
const
formRef
=
useRef
(
null
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
listData
,
setListData
]
=
useState
(
null
)
as
any
;
const
[
onwerDetail
,
setOnwerDetail
]
=
useState
(
null
)
as
any
;
const
[
isShowText
,
setIsShowText
]
=
useState
(
false
);
const
onRadioChange
=
(
e
:
RadioChangeEvent
)
=>
{
if
(
e
.
target
.
value
===
'2'
)
{
setIsShowText
(
true
);
}
else
{
setIsShowText
(
false
);
}
};
// match 是路由属性
useEffect
(()
=>
{
if
(
match
.
params
.
id
)
{
RA
(
75
,
{
id
:
match
.
params
.
id
},
module
,
dispatch
);
}
else
{
history
.
go
(
-
1
);
}
},
[
match
]);
// useEffect(() => {
// // 发起请求拿取数据
// if (location.query.id) {
// setLoading(true);
// RA(37, { ...location.query }, module, dispatch);
// } else {
// history.go(-1);
// }
// return () => {
// Clear(module + '/DataSaveDetailClear', dispatch);
// };
// }, []);
useEffect
(()
=>
{
if
(
DataSaveDetail
)
{
setListData
(
DataSaveDetail
.
data
.
rows
.
list
[
0
]);
setOnwerDetail
(
DataSaveDetail
.
data
.
rows
.
onwerDetail
);
setLoading
(
false
);
}
},
[
DataSaveDetail
]);
const
onFinish
=
(
values
:
any
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
// if (permissionArr.indexOf('28') < 0) {
// message.error('No Permissions!!!', 3);
// return;
// }
if
(
values
.
decorationStatus
===
'2'
&&
(
values
.
replyView
===
undefined
||
values
.
replyView
.
trim
()
===
''
)
)
{
message
.
warning
(
'Replies must be entered!'
);
return
;
}
const
tmp
=
{
communityId
:
listData
.
communityId
,
id
:
listData
.
id
,
ownerId
:
user
.
currentUser
.
userModel
.
id
,
handleStatus
:
values
.
decorationStatus
,
replyName
:
user
.
currentUser
.
userModel
.
tosUserName
,
replyPhone
:
user
.
currentUser
.
userModel
.
tosUserPhone
,
replyView
:
values
.
replyView
,
type
:
'8'
,
};
RA
(
76
,
tmp
,
module
,
dispatch
);
setLoading
(
true
);
};
return
(
<
Spin
size=
"large"
spinning=
{
loading
}
>
<
div
style=
{
{
width
:
'100%'
,
minWidth
:
1020
,
padding
:
34
,
backgroundColor
:
'#ffffff'
}
}
>
{
listData
!==
null
&&
onwerDetail
!==
null
?
(
<>
<
TitleBack
sublist=
{
[
'Status : '
+
decoration_status
&&
decoration_status
[
listData
.
handleStatus
]
&&
decoration_status
[
listData
.
handleStatus
][
1
]
?
decoration_status
[
listData
.
handleStatus
][
1
]
:
''
,
'Time : '
+
listData
.
createTime
?
timestampToTime
(
listData
.
createTime
.
time
)
:
''
,
]
}
title=
{
listData
.
handleStatus
===
0
?
'Remarks to move out details'
:
'Move out Details'
}
/>
<
Row
gutter=
{
8
}
>
<
Col
>
Estate:
</
Col
>
<
Col
span=
{
3
}
>
{
onwerDetail
.
communityName
}
</
Col
>
<
Col
>
Unit:
</
Col
>
<
Col
>
{
onwerDetail
.
buildingNumber
?
onwerDetail
.
buildingNumber
+
' #'
:
''
}
{
onwerDetail
.
floorNumber
}
-
{
onwerDetail
.
roomNumber
}
</
Col
>
</
Row
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
>
Address:
</
Col
>
<
Col
>
{
onwerDetail
.
addressAndpostalCode
}
</
Col
>
</
Row
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
>
Owner Name:
</
Col
>
<
Col
span=
{
3
}
>
{
onwerDetail
.
owerName
}
{
onwerDetail
.
deleted
===
1
&&
'(Canceled)'
}
</
Col
>
<
Col
>
Contact Details:
</
Col
>
<
Col
span=
{
3
}
>
{
onwerDetail
.
owerPhone
}
</
Col
>
<
Col
>
{
onwerDetail
.
owerEmail
}
</
Col
>
</
Row
>
<
Line
/>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
3
}
>
Applicant:
</
Col
>
<
Col
span=
{
3
}
>
{
listData
.
name
}
</
Col
>
<
Col
>
Contact Details:
</
Col
>
<
Col
span=
{
3
}
>
{
listData
.
phone
}
</
Col
>
</
Row
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
3
}
>
Move Out Date:
</
Col
>
<
Col
span=
{
5
}
>
{
moment
(
listData
.
communityMoveOutBeginTime
).
format
(
'DD-MM-YYYY'
)
}
</
Col
>
<
Col
span=
{
5
}
>
{
moment
(
listData
.
communityMoveOutendTime
).
format
(
'DD-MM-YYYY'
)
}
</
Col
>
</
Row
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
3
}
>
Description :
</
Col
>
<
Col
>
<
TextArea
autoSize
disabled
value=
{
listData
.
content
}
style=
{
{
width
:
300
,
minHeight
:
100
,
padding
:
8
,
resize
:
'none'
}
}
/>
</
Col
>
</
Row
>
<
Line
/>
{
listData
.
handleStatus
==
0
?
(
<>
<
Form
ref=
{
formRef
}
name=
"basic"
onFinish=
{
onFinish
}
>
{
/* <Row gutter={8} style={{ marginTop: 16 }}>
<Col>Replier:</Col>
<Col span={3}>{user.currentUser.userModel.tosUserName}</Col>
<Col>Contact Details:</Col>
<Col>{user.currentUser.userModel.tosUserPhone}</Col>
</Row> */
}
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
3
}
>
Approval For Application:
</
Col
>
<
Col
>
<
Form
.
Item
name=
"decorationStatus"
rules=
{
[
{
required
:
true
,
message
:
'Please choose Approve or Reject the application! '
,
},
]
}
>
<
Radio
.
Group
onChange=
{
onRadioChange
}
>
<
Radio
.
Button
value=
"1"
>
Approve
</
Radio
.
Button
>
{
' '
}
<
Radio
.
Button
style=
{
{
marginLeft
:
10
}
}
value=
"2"
>
Reject
</
Radio
.
Button
>
</
Radio
.
Group
>
</
Form
.
Item
>
</
Col
>
</
Row
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
3
}
>
Remarks:
</
Col
>
<
Col
>
<
Form
.
Item
name=
"replyView"
rules=
{
[{
required
:
isShowText
,
max
:
300
,
message
:
'*it is required!'
}]
}
>
<
TextArea
style=
{
{
width
:
300
,
height
:
100
,
padding
:
8
}
}
/>
</
Form
.
Item
>
</
Col
>
</
Row
>
<
Row
>
<
Col
span=
{
3
}
/>
<
Col
>
<
Form
.
Item
>
<
Button
type=
"primary"
htmlType=
"submit"
>
Submit
</
Button
>
</
Form
.
Item
>
</
Col
>
</
Row
>
</
Form
>
</>
)
:
(
<>
<
Row
>
<
Col
span=
{
3
}
>
Attended By:
</
Col
>
<
Col
span=
{
3
}
>
{
listData
.
replyName
}
</
Col
>
<
Col
span=
{
3
}
>
Contact Details:
</
Col
>
<
Col
>
{
listData
.
replyPhone
}
</
Col
>
</
Row
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
3
}
>
Approval For Application:
</
Col
>
<
Col
>
<
Radio
.
Group
value=
{
listData
.
handleStatus
}
>
<
Radio
.
Button
value=
{
1
}
disabled=
{
listData
.
handleStatus
!==
1
}
>
Approve
</
Radio
.
Button
>
{
' '
}
<
Radio
.
Button
style=
{
{
marginLeft
:
10
}
}
value=
{
2
}
disabled=
{
listData
.
handleStatus
!==
2
}
>
Reject
</
Radio
.
Button
>
</
Radio
.
Group
>
</
Col
>
</
Row
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
3
}
>
Remarks:
</
Col
>
<
Col
>
<
TextArea
style=
{
{
width
:
300
,
minHeight
:
100
,
padding
:
8
,
resize
:
'none'
,
color
:
listData
.
handleStatus
===
'2'
?
'red'
:
''
,
}
}
disabled
value=
{
listData
.
replyView
}
/>
</
Col
>
</
Row
>
</>
)
}
</>
)
:
null
}
</
div
>
</
Spin
>
);
};
function
map
(
state
:
any
)
{
const
{
DataSaveDetail
}
=
state
[
module
];
const
{
user
}
=
state
;
return
{
DataSaveDetail
,
user
};
}
export
default
connect
(
map
)(
RenovationDetail
);
src/pages/CommercialService/PropertyServices.tsx
View file @
2e1f9cf7
...
@@ -3,7 +3,7 @@ import { connect, history } from 'umi';
...
@@ -3,7 +3,7 @@ import { connect, history } from 'umi';
import
{
Table
,
Space
,
message
}
from
'antd'
;
import
{
Table
,
Space
,
message
}
from
'antd'
;
import
{
RA
,
urlEncode
,
filterObj
,
filterObjbyTg
}
from
'@/utils/method'
;
import
{
RA
,
urlEncode
,
filterObj
,
filterObjbyTg
}
from
'@/utils/method'
;
import
styles
from
'./css/index.less'
;
import
styles
from
'./css/index.less'
;
import
{
timestampToTime3
}
from
'../../utils/time
'
;
import
moment
from
'moment
'
;
import
TitleSearch
from
'../../components/TitleSearch/TitleSearch'
;
import
TitleSearch
from
'../../components/TitleSearch/TitleSearch'
;
const
pathname
=
[
const
pathname
=
[
...
@@ -46,7 +46,7 @@ const PropertyServices = (props: any) => {
...
@@ -46,7 +46,7 @@ const PropertyServices = (props: any) => {
// const [readyData, setReadyData] = useState(null);
// const [readyData, setReadyData] = useState(null);
const
columns
=
[
const
columns
=
[
{
title
:
'
Community
'
,
dataIndex
:
'community_name'
},
{
title
:
'
Estate
'
,
dataIndex
:
'community_name'
},
{
{
title
:
'Requestor'
,
title
:
'Requestor'
,
dataIndex
:
'owner_name'
,
dataIndex
:
'owner_name'
,
...
@@ -60,8 +60,10 @@ const PropertyServices = (props: any) => {
...
@@ -60,8 +60,10 @@ const PropertyServices = (props: any) => {
},
},
{
{
title
:
parseInt
(
serviceTypeGobal
)
-
1
===
0
?
'Attended By'
:
'Description'
,
// title: parseInt(serviceTypeGobal) - 1 === 0 ? 'Attended By' : 'Description',
dataIndex
:
parseInt
(
serviceTypeGobal
)
-
1
===
0
?
'handle_name'
:
'service_content'
,
// dataIndex: parseInt(serviceTypeGobal) - 1 === 0 ? 'handle_name' : 'service_content',
title
:
'Description'
,
dataIndex
:
'service_content'
,
ellipsis
:
true
,
ellipsis
:
true
,
// width: 400,
// width: 400,
render
:
(
text
:
any
)
=>
<
span
>
{
text
!=
null
?
text
:
''
}
</
span
>,
render
:
(
text
:
any
)
=>
<
span
>
{
text
!=
null
?
text
:
''
}
</
span
>,
...
@@ -70,7 +72,7 @@ const PropertyServices = (props: any) => {
...
@@ -70,7 +72,7 @@ const PropertyServices = (props: any) => {
{
{
title
:
'Submission Time'
,
title
:
'Submission Time'
,
dataIndex
:
'create_time'
,
dataIndex
:
'create_time'
,
render
:
(
text
:
any
)
=>
<
Space
size=
"middle"
>
{
timestampToTime3
(
text
.
time
)
}
</
Space
>,
render
:
(
text
:
any
)
=>
<
Space
size=
"middle"
>
{
moment
(
text
.
time
).
format
(
'MM.DD HH:mm'
)
}
</
Space
>,
},
},
{
{
title
:
'Status'
,
title
:
'Status'
,
...
@@ -151,6 +153,10 @@ const PropertyServices = (props: any) => {
...
@@ -151,6 +153,10 @@ const PropertyServices = (props: any) => {
pathname
.
forEach
((
item
,
index
)
=>
{
pathname
.
forEach
((
item
,
index
)
=>
{
if
(
location
.
pathname
.
indexOf
(
item
)
>
-
1
)
{
if
(
location
.
pathname
.
indexOf
(
item
)
>
-
1
)
{
serviceType
=
`
${
index
+
1
}
`
;
serviceType
=
`
${
index
+
1
}
`
;
// console.log(serviceType);
// console.log(index);
// console.log(location.pathname);
// console.log(pathname);
setServiceType
(
serviceType
);
setServiceType
(
serviceType
);
}
}
});
});
...
@@ -175,6 +181,11 @@ const PropertyServices = (props: any) => {
...
@@ -175,6 +181,11 @@ const PropertyServices = (props: any) => {
};
};
// 获取数据
// 获取数据
setLoading
(
true
);
setLoading
(
true
);
// console.log(serviceType);
// console.log(tmp);
// console.log(pageNum);
RA
(
RA
(
40
,
40
,
{
{
...
...
src/pages/CommercialService/Renovation.tsx
View file @
2e1f9cf7
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Table
,
Space
,
message
}
from
'antd'
;
import
{
Table
,
Space
,
message
,
Tag
}
from
'antd'
;
import
{
connect
,
history
}
from
'umi'
;
import
{
connect
,
history
}
from
'umi'
;
import
{
RA
,
urlEncode
,
filterObjbyTg
}
from
'@/utils/method'
;
import
{
RA
,
urlEncode
,
filterObjbyTg
}
from
'@/utils/method'
;
import
{
objectColumns
,
stringTab
}
from
'@/utils/string'
;
import
{
objectColumns
,
stringTab
}
from
'@/utils/string'
;
import
{
timestampToTime
}
from
'@/utils/time'
;
import
{
timestampToTime
}
from
'@/utils/time'
;
import
TitleSearch
from
'../../components/TitleSearch/TitleSearch'
;
import
TitleSearch
from
'@/components/TitleSearch/TitleSearch'
;
import
moment
from
'moment'
;
const
module
=
'CommunityService'
;
const
module
=
'CommunityService'
;
...
@@ -18,12 +19,24 @@ const Renovation = (props: any) => {
...
@@ -18,12 +19,24 @@ const Renovation = (props: any) => {
[
2
,
'Rejected'
],
[
2
,
'Rejected'
],
];
];
const
{
dispatch
,
Data8
,
location
}
=
props
;
const
{
dispatch
,
Data
9
,
Data
8
,
location
}
=
props
;
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
readyData
,
setReadyData
]
=
useState
(
null
);
const
[
readyData
,
setReadyData
]
=
useState
(
null
);
// 地址 默认是装修申请
const
[
urlType
,
setUrlType
]
=
useState
(
0
);
// 地址看是哪一个
const
WebUrl
=
[
'RenovationApplication'
,
// 装修申请
'MoveOut'
,
// 迁出申请
];
// let { log } = console;
// 装修申请的表格
const
columns
=
objectColumns
([
const
columns
=
objectColumns
([
[
'
Community
'
,
'communityName'
],
[
'
Estate
'
,
'communityName'
],
[
[
'Applicant'
,
'Applicant'
,
'applyforName'
,
'applyforName'
,
...
@@ -38,13 +51,14 @@ const Renovation = (props: any) => {
...
@@ -38,13 +51,14 @@ const Renovation = (props: any) => {
null
,
null
,
(
text
:
any
,
record
:
any
)
=>
(
(
text
:
any
,
record
:
any
)
=>
(
<
div
>
<
div
>
{
record
.
communityBuildDecorate
}
#
{
record
.
communityFloorDecorate
}
-
{
record
.
communityBuildDecorate
?
<
span
>
{
record
.
communityBuildDecorate
}
#
</
span
>
:
''
}
{
record
.
communityRoomDecoate
}
<
span
>
{
record
.
communityFloorDecorate
}
-
</
span
>
<
span
>
{
record
.
communityRoomDecoate
}
</
span
>
</
div
>
</
div
>
),
),
],
],
[
'Content'
,
'decorationContent'
,
(
text
:
any
)
=>
<
div
>
{
stringTab
(
text
)
}
</
div
>],
[
'Content'
,
'decorationContent'
,
(
text
:
any
)
=>
<
div
>
{
stringTab
(
text
)
}
</
div
>],
[
'Application Time'
,
'createTime'
,
(
text
:
any
)
=>
<
div
>
{
timestampToTime
(
text
.
time
)
}
</
div
>
],
[
'Application Time'
,
'createTime'
,
(
text
:
any
)
=>
moment
(
text
.
time
).
format
(
'MM.DD HH:mm'
)
],
[
'status'
,
'decorationStatus'
,
(
text
:
any
)
=>
<
div
>
{
decorationStatus
[
parseInt
(
text
)][
1
]
}
</
div
>],
[
'status'
,
'decorationStatus'
,
(
text
:
any
)
=>
<
div
>
{
decorationStatus
[
parseInt
(
text
)][
1
]
}
</
div
>],
[
[
'Actions'
,
'Actions'
,
...
@@ -57,6 +71,71 @@ const Renovation = (props: any) => {
...
@@ -57,6 +71,71 @@ const Renovation = (props: any) => {
),
),
],
],
]);
]);
// 迁出申请的表格格式
const
columns2
=
[
{
title
:
'Estate'
,
dataIndex
:
'communityName'
,
key
:
'communityName'
,
},
{
title
:
'Unit'
,
dataIndex
:
'id'
,
key
:
'id'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<>
{
record
.
communityBuild
?
<
span
>
{
record
.
communityBuild
}
#
</
span
>
:
''
}
<
span
>
{
record
.
communityFloor
}
-
</
span
>
<
span
>
{
record
.
communityRoom
}
</
span
>
</>
),
},
{
title
:
'Requestor'
,
dataIndex
:
'name'
,
key
:
'name'
,
render
:
(
text
:
string
,
record
:
{
exist
:
string
})
=>
{
return
(
<
div
>
{
text
}
{
record
.
exist
===
'1'
&&
'(Canceled)'
}
</
div
>
);
},
},
{
title
:
'Description'
,
dataIndex
:
'content'
,
key
:
'content'
,
},
{
title
:
'Submission Time'
,
dataIndex
:
'createTime'
,
key
:
'createTime'
,
// render: (text: any) => moment(text.time).format('MMMM Do YYYY, h:mm'),
render
:
(
text
:
any
)
=>
moment
(
text
.
time
).
format
(
'MM.DD HH:mm'
),
},
{
title
:
'Status'
,
dataIndex
:
'handleStatus'
,
key
:
'handleStatus'
,
render
:
(
text
:
any
)
=>
(
// <Tag color={text == 0 ? 'lime' : text == 1 ? 'cyan' : 'magenta'}>
// {decorationStatus[parseInt(text)][1]}
// </Tag>,
<
span
>
{
decorationStatus
[
parseInt
(
text
)][
1
]
}
</
span
>
),
},
{
title
:
'Action'
,
dataIndex
:
'operation'
,
key
:
'operation'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
a
onClick=
{
()
=>
goToDetail
(
record
)
}
>
{
record
.
handleStatus
==
0
?
'Reply'
:
'Details'
}
</
a
>
),
},
];
useEffect
(()
=>
{
useEffect
(()
=>
{
pageNum
=
1
;
pageNum
=
1
;
// 分页设置
// 分页设置
...
@@ -77,24 +156,36 @@ const Renovation = (props: any) => {
...
@@ -77,24 +156,36 @@ const Renovation = (props: any) => {
setReadyData
(
tmp
);
setReadyData
(
tmp
);
// 获取数据
// 获取数据
setLoading
(
true
);
setLoading
(
true
);
RA
(
23
,
// 看是哪一个
{
// 细分类:页面指令
let
serviceType
:
any
=
null
;
// console.log(location);
WebUrl
.
forEach
((
item
,
index
)
=>
{
if
(
location
.
pathname
.
indexOf
(
item
)
>
-
1
)
{
setUrlType
(
index
);
serviceType
=
index
;
}
});
// console.log(WebUrl[serviceType]);
// 搜索条件
let
objs
=
{
...
tmp
,
...
tmp
,
handleStatus
:
handleStatus
:
location
.
query
.
handleStatus
!==
undefined
?
parseInt
(
location
.
query
.
handleStatus
)
:
null
,
location
.
query
.
handleStatus
!==
undefined
?
parseInt
(
location
.
query
.
handleStatus
)
:
null
,
pageNum
,
pageNum
,
},
};
module
,
dispatch
,
// 请求
);
RA
(
serviceType
==
0
?
23
:
74
,
objs
,
module
,
dispatch
);
},
[
location
]);
},
[
location
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
Data8
!=
null
)
{
if
(
Data
9
!=
null
||
Data
8
!=
null
)
{
setLoading
(
false
);
setLoading
(
false
);
}
}
},
[
Data8
]);
},
[
Data
9
,
Data
8
]);
// 页面搜索
// 页面搜索
const
ClickTitleSearch
=
(
comment
:
any
)
=>
{
const
ClickTitleSearch
=
(
comment
:
any
)
=>
{
...
@@ -108,7 +199,9 @@ const Renovation = (props: any) => {
...
@@ -108,7 +199,9 @@ const Renovation = (props: any) => {
message
.
error
(
'No Permissions!!!'
,
3
);
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
return
;
}
}
history
.
push
(
'./RenovationApplication/Detail?id='
+
values
.
id
);
urlType
==
0
?
history
.
push
(
'./RenovationApplication/Detail?id='
+
values
.
id
)
:
history
.
push
(
'./MoveOut/Detail/'
+
values
.
id
);
};
};
const
PageChange
=
(
values
:
any
)
=>
{
const
PageChange
=
(
values
:
any
)
=>
{
...
@@ -129,6 +222,8 @@ const Renovation = (props: any) => {
...
@@ -129,6 +222,8 @@ const Renovation = (props: any) => {
defaultValue=
{
readyData
}
defaultValue=
{
readyData
}
onSubmit=
{
ClickTitleSearch
}
onSubmit=
{
ClickTitleSearch
}
/>
/>
{
urlType
==
0
?
(
<
Table
<
Table
loading=
{
loading
}
loading=
{
loading
}
rowKey=
"id"
rowKey=
"id"
...
@@ -143,13 +238,29 @@ const Renovation = (props: any) => {
...
@@ -143,13 +238,29 @@ const Renovation = (props: any) => {
showSizeChanger
:
false
,
showSizeChanger
:
false
,
}
}
}
}
/>
/>
)
:
(
<
Table
loading=
{
loading
}
rowKey=
"id"
style=
{
{
marginTop
:
16
}
}
dataSource=
{
Data9
!==
null
?
Data9
.
data
.
rows
:
null
}
columns=
{
columns2
}
onChange=
{
PageChange
}
pagination=
{
{
current
:
parseInt
(
pageNum
),
pageSize
:
Data9
!==
null
?
Data9
.
data
.
page
.
curPageSize
:
null
,
total
:
Data9
!==
null
?
Data9
.
data
.
page
.
totalRow
:
null
,
showSizeChanger
:
false
,
}
}
/>
)
}
</>
</>
</
div
>
</
div
>
);
);
};
};
function
map
(
state
:
any
)
{
function
map
(
state
:
any
)
{
const
{
Data8
}
=
state
[
module
];
const
{
Data
9
,
Data
8
}
=
state
[
module
];
return
{
Data8
};
return
{
Data
9
,
Data
8
};
}
}
export
default
connect
(
map
)(
Renovation
);
export
default
connect
(
map
)(
Renovation
);
src/pages/CommercialService/RenovationDetail.tsx
View file @
2e1f9cf7
...
@@ -90,18 +90,23 @@ const RenovationDetail = (props: any) => {
...
@@ -90,18 +90,23 @@ const RenovationDetail = (props: any) => {
<>
<>
<
TitleBack
<
TitleBack
sublist=
{
[
sublist=
{
[
'Status : '
+
decoration_status
[
listData
.
decorationStatus
][
1
],
'Status : '
+
decoration_status
&&
'Time : '
+
timestampToTime
(
listData
.
createTime
.
time
),
decoration_status
[
listData
.
decorationStatus
]
&&
decoration_status
[
listData
.
decorationStatus
][
1
]
?
decoration_status
[
listData
.
decorationStatus
][
1
]
:
''
,
'Time: '
+
timestampToTime
(
listData
.
createTime
.
time
),
]
}
]
}
title=
{
listData
.
decorationStatus
===
0
?
'Renovation Reply'
:
'Renovation Detail'
}
title=
{
listData
.
decorationStatus
===
0
?
'Renovation Reply'
:
'Renovation Detail'
}
/>
/>
<
Row
gutter=
{
8
}
>
<
Row
gutter=
{
8
}
>
<
Col
>
Community
:
</
Col
>
<
Col
>
Estate
:
</
Col
>
<
Col
span=
{
3
}
>
{
onwerDetail
.
communityName
}
</
Col
>
<
Col
span=
{
3
}
>
{
onwerDetail
.
communityName
}
</
Col
>
<
Col
>
Unit:
</
Col
>
<
Col
>
Unit:
</
Col
>
<
Col
>
<
Col
>
{
onwerDetail
.
buildingNumber
}
#
{
onwerDetail
.
floorNumber
}
-
{
onwerDetail
.
roomNumber
}
{
onwerDetail
.
buildingNumber
?
onwerDetail
.
buildingNumber
+
' #'
:
''
}
{
onwerDetail
.
floorNumber
}
-
{
onwerDetail
.
roomNumber
}
</
Col
>
</
Col
>
</
Row
>
</
Row
>
...
@@ -131,12 +136,12 @@ const RenovationDetail = (props: any) => {
...
@@ -131,12 +136,12 @@ const RenovationDetail = (props: any) => {
<
Col
>
{
listData
.
contactEmail
}
</
Col
>
<
Col
>
{
listData
.
contactEmail
}
</
Col
>
</
Row
>
</
Row
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
3
}
>
Time
:
</
Col
>
<
Col
span=
{
3
}
>
Duration of Work
:
</
Col
>
<
Col
span=
{
3
}
>
{
timestampToTime
(
listData
.
decorationBeginTime
)
}
</
Col
>
<
Col
span=
{
3
}
>
{
timestampToTime
(
listData
.
decorationBeginTime
)
}
</
Col
>
<
Col
>
{
timestampToTime
(
listData
.
decorationEndTime
)
}
</
Col
>
<
Col
>
{
timestampToTime
(
listData
.
decorationEndTime
)
}
</
Col
>
</
Row
>
</
Row
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
3
}
>
Reason
:
</
Col
>
<
Col
span=
{
3
}
>
Description of Work
:
</
Col
>
<
Col
>
<
Col
>
<
TextArea
<
TextArea
autoSize
autoSize
...
@@ -174,7 +179,7 @@ const RenovationDetail = (props: any) => {
...
@@ -174,7 +179,7 @@ const RenovationDetail = (props: any) => {
</
Row
>
</
Row
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
3
}
>
Re
ply
:
</
Col
>
<
Col
span=
{
3
}
>
Re
marks
:
</
Col
>
<
Col
>
<
Col
>
<
Form
.
Item
<
Form
.
Item
name=
"replyView"
name=
"replyView"
...
@@ -225,7 +230,7 @@ const RenovationDetail = (props: any) => {
...
@@ -225,7 +230,7 @@ const RenovationDetail = (props: any) => {
</
Row
>
</
Row
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Row
gutter=
{
8
}
style=
{
{
marginTop
:
16
}
}
>
<
Col
span=
{
3
}
>
Re
ply
:
</
Col
>
<
Col
span=
{
3
}
>
Re
marks
:
</
Col
>
<
Col
>
<
Col
>
<
TextArea
<
TextArea
style=
{
{
style=
{
{
...
...
src/pages/CommercialService/css/Detail.less
View file @
2e1f9cf7
...
@@ -8,210 +8,215 @@
...
@@ -8,210 +8,215 @@
min-width: 1020px;
min-width: 1020px;
}
}
//头部组件
//头部组件
.box{
.box
{
width: 100%;
width: 100%;
height: 64px;
height: 64px;
position: relative;
position: relative;
}
}
.item1{
.item1
{
position: absolute;
position: absolute;
width: 180px;
width: 180px;
text-align: center;
text-align: center;
border-left: 5px solid rgba(24,144,255,
1);
border-left: 5px solid rgba(24, 144, 255,
1);
font-family:
'Source Han Sans CN';
font-family:
'Source Han Sans CN';
font-size: 18px;
font-size: 18px;
font-weight: 600;
font-weight: 600;
color: #000000;
color: #000000;
}
}
.item3{
.item3
{
width:
80px;
width:
80px;
height: 32px;
height: 32px;
position: absolute;
position: absolute;
right: 0;
right: 0;
outline: none;
outline: none;
background:
none;
background:
none;
cursor: pointer;
cursor: pointer;
border:1px solid rgba(217,217,217,
1);
border: 1px solid rgba(217, 217, 217,
1);
border-radius:
2px;
border-radius:
2px;
}
}
//内容组件
//内容组件
.box1{
.box1
{
width: 100%;
width: 100%;
height: 36px;
height: 36px;
position: relative;
position: relative;
}
}
.box1item1{
.box1item1
{
position: absolute;
position: absolute;
}
}
.box1item2{
.box1item2
{
position: absolute;
position: absolute;
left: 215px;
left: 215px;
}
}
.box2{
.box2
{
width: 100%;
width: 100%;
height: 36px;
height: 36px;
position: relative;
position: relative;
}
}
.box2item1{
.box2item1
{
position: absolute;
position: absolute;
}
}
.box2item2{
.box2item2
{
position: absolute;
position: absolute;
left: 430px;
left: 430px;
}
}
.box3{
.box3
{
width: 100%;
width: 100%;
height: 36px;
height: 36px;
position: relative;
position: relative;
}
}
.box3item1{
.box3item1
{
position: absolute;
position: absolute;
}
}
.box3item2{
.box3item2
{
position: absolute;
position: absolute;
left: 132px;
left: 132px;
}
}
.box3item3{
.box3item3
{
position: absolute;
position: absolute;
left: 315px;
left: 315px;
}
}
.box3item4{
.box3item4
{
position: absolute;
position: absolute;
left: 445px;
left: 445px;
}
}
.box3item5{
.box3item5
{
position: absolute;
position: absolute;
left: 588px;
left: 588px;
}
}
.box4{
.box4
{
width: 100%;
width: 100%;
height: 90px;
height: 90px;
position: relative;
position: relative;
margin-bottom: 28px;
margin-bottom: 28px;
}
}
.box4item1{
.box4item1
{
position: absolute;
position: absolute;
}
}
.box4item2{
.box4item2
{
position: absolute;
position: absolute;
left: 193px;
left: 193px;
top:
10px;
top:
10px;
width: 394px;
width: 394px;
height: 80px;
height: 80px;
background-color: rgba(244,244,244,
1);
background-color: rgba(244, 244, 244,
1);
overflow-y: auto;
overflow-y: auto;
padding: 8px;
padding: 8px;
}
}
.box5{
.box5
{
width: 100%;
width: 100%;
height: 80px;
height: 80px;
position: relative;
position: relative;
}
}
.box5item1{
.box5item1
{
position: absolute;
position: absolute;
}
}
.box5item2{
.box5item2
{
position: absolute;
position: absolute;
left: 193px;
left: 193px;
}
}
.box5item3{
.box5item3
{
position: absolute;
position: absolute;
left: 311px;
left: 311px;
}
}
.box5item4{
.box5item4
{
position: absolute;
position: absolute;
left: 429px;
left: 429px;
}
}
// 线栏
// 线栏
.line{
.line
{
width: 100%;
width: 100%;
height: 1px;
height: 1px;
border-top: 1px solid rgba(217,217,217,
1);
border-top: 1px solid rgba(217, 217, 217,
1);
margin-top: 28px;
margin-top: 28px;
margin-bottom: 28px;
margin-bottom: 28px;
}
}
.box6{
.box6
{
width: 100%;
width: 100%;
height: 32px;
height: 32px;
position: relative;
position: relative;
margin-bottom: 28px;
margin-bottom: 28px;
line-height: 32px;
line-height: 32px;
}
}
.box6item1{
.box6item1
{
position: absolute;
position: absolute;
}
}
.box6item2{
.box6item2
{
position: absolute;
position: absolute;
left: 193px;
left: 193px;
}
}
.box6item3{
.box6item3
{
position: absolute;
position: absolute;
left: 498px;
left: 498px;
}
}
.box6item4{
.box6item4
{
position: absolute;
position: absolute;
left: 626px;
left: 626px;
}
}
.box7{
.box7
{
width: 100%;
width: 100%;
height: 80px;
height: 80px;
position: relative;
position: relative;
margin-bottom: 28px;
margin-bottom: 28px;
}
}
.box7item1{
.box7item1
{
position: absolute;
position: absolute;
}
}
.box7item2{
.box7item2
{
position: absolute;
position: absolute;
left: 193px;
left: 193px;
}
}
.box8{
.box8
{
width: 100%;
width: 100%;
height: 200px;
height: 200px;
position: relative;
position: relative;
}
}
.box8min{
.box8min
{
width: 100%;
width: 100%;
height: 100px;
height: 100px;
position: relative;
position: relative;
}
}
.box8item1{
.box8item1
{
position: absolute;
position: absolute;
}
}
.box8item2{
.box8item2
{
position: absolute;
position: absolute;
left: 193px;
left: 193px;
}
}
.box8item3{
.box8item3
{
position: absolute;
position: absolute;
left: 800px;
left: 800px;
}
}
.box8item01{
.box8item01
{
position: absolute;
position: absolute;
}
}
.box8item02{
.box8item02
{
position: absolute;
position: absolute;
left: 20px;
left: 20px;
}
}
.box8item03{
.box8item03
{
position: absolute;
position: absolute;
left: 20px;
left: 20px;
}
}
.diys {
display: flex;
justify-content: space-between;
align-items: center;
.ant-form-item {
&:nth-child(1) {
margin-right: 20px;
}
}
}
src/pages/CommunityManagement/CellList/Adds.tsx
View file @
2e1f9cf7
...
@@ -111,8 +111,8 @@ const Adds = (props: any) => {
...
@@ -111,8 +111,8 @@ const Adds = (props: any) => {
type
:
imgUrl
.
name
.
match
(
/
\.([^\.]
+
)
$/
)[
1
].
toLowerCase
(),
type
:
imgUrl
.
name
.
match
(
/
\.([^\.]
+
)
$/
)[
1
].
toLowerCase
(),
url
:
imgUrl
.
url
,
url
:
imgUrl
.
url
,
};
};
setpreviewImage
(
info
);
//
setpreviewImage(info);
setpreviewVisible
(
true
);
//
setpreviewVisible(true);
// openDows(imgUrl.url, imgUrl.name);
// openDows(imgUrl.url, imgUrl.name);
}
}
},
[
imgUrl
]);
},
[
imgUrl
]);
...
@@ -203,7 +203,7 @@ const Adds = (props: any) => {
...
@@ -203,7 +203,7 @@ const Adds = (props: any) => {
:
values
.
residentialPhone
;
:
values
.
residentialPhone
;
values
.
residentialHotlineName
=
residentialHotlineName
values
.
residentialHotlineName
=
residentialHotlineName
?
undeFi
(
residentialHotlineName
)
?
undeFi
(
residentialHotlineName
)
:
'
Community
Hotline'
;
:
'
Estate
Hotline'
;
// 没选的话就上面小区时间
// 没选的话就上面小区时间
if
(
time
)
{
if
(
time
)
{
...
@@ -313,7 +313,7 @@ const Adds = (props: any) => {
...
@@ -313,7 +313,7 @@ const Adds = (props: any) => {
<
div
className=
"form"
>
<
div
className=
"form"
>
<
h3
className=
"capi"
>
<
h3
className=
"capi"
>
<
EditOutlined
/>
<
EditOutlined
/>
{
match
&&
match
.
params
.
id
?
'edit'
:
'Create New'
}
community
{
match
&&
match
.
params
.
id
?
'edit'
:
'Create New'
}
Estate
<
div
className=
"back"
>
<
div
className=
"back"
>
<
Button
onClick=
{
goToReturn
}
>
<
Button
onClick=
{
goToReturn
}
>
<
LeftOutlined
/>
<
LeftOutlined
/>
...
@@ -334,7 +334,7 @@ const Adds = (props: any) => {
...
@@ -334,7 +334,7 @@ const Adds = (props: any) => {
{
/* 小区邮编、地址和名称 */
}
{
/* 小区邮编、地址和名称 */
}
<
Form
.
Item
<
Form
.
Item
name=
"des"
name=
"des"
label=
"
Community
Name"
label=
"
Estate
Name"
rules=
{
[{
validator
:
checkPrice
}]
}
rules=
{
[{
validator
:
checkPrice
}]
}
style=
{
{
marginBottom
:
15
}
}
style=
{
{
marginBottom
:
15
}
}
className=
"must"
className=
"must"
...
...
src/pages/CommunityManagement/CellList/Adds3.tsx
deleted
100644 → 0
View file @
4ad66726
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
connect
}
from
'dva'
;
import
{
LeftOutlined
,
EditOutlined
,
LoadingOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
Form
,
Input
,
Image
,
Button
,
TimePicker
,
Checkbox
,
Upload
,
message
,
Spin
,
Modal
,
Pagination
,
}
from
'antd'
;
// 样式
import
'./celllist.less'
;
import
{
RA
}
from
'@/utils/method'
;
import
{
history
}
from
'umi'
;
import
{
village
}
from
'@/utils/tip'
;
import
moment
from
'moment'
;
import
{
getNumber
}
from
'@/utils/string'
;
// 正则
import
FileViewer
from
'react-file-viewer'
;
import
PDF
from
'react-pdf-js'
;
const
{
RangePicker
}
=
TimePicker
;
const
Adds
=
(
props
:
any
)
=>
{
const
module
=
'CellList'
;
const
{
Data
,
dispatch
,
loading
,
imgUrl
,
Result
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
[
PropertyFee
,
setPropertyFee
]
=
useState
([
'1'
]);
// 表单物业费提交值
const
[
loubaUpload
,
setLouba
]
=
useState
([]
as
any
);
// 楼巴上传列表
const
[
guideUpload
,
setGuide
]
=
useState
([]
as
any
);
// 物业办事指南列表
const
[
periodUpload
,
setPeriod
]
=
useState
([]
as
any
);
// 保质期服务列表
// 监听用户填写小区名 以及后续禁止输入 提示信息
const
[
codename
,
setCodeName
]
=
useState
(
''
);
const
[
codeStrat
,
setcodeStrat
]
=
useState
(
false
);
const
[
tipMain
,
setTipMain
]
=
useState
(
''
);
const
[
previewVisible
,
setpreviewVisible
]
=
useState
(
false
);
// 预览弹窗显示隐藏
const
[
previewImage
,
setpreviewImage
]
=
useState
({}
as
any
);
// 预览图片信息
//pdf 页码内容
const
[
numPages
,
setNumPages
]
=
useState
(
1
as
any
);
// 总页码数
const
[
pageNumber
,
setPageNumber
]
=
useState
(
1
);
// 当前页码数
const
[
imgLoad
,
setimgLoad
]
=
useState
(
false
);
//图片上传 load状态
// 赋值
useEffect
(()
=>
{
// 如果是添加传来没有值的时候 就清空 否则 赋值给表单
if
(
Data
)
{
// 返回列表
form
.
setFieldsValue
({
// 必填的
des
:
{
residentialZipCode
:
Data
.
residentialZipCode
.
substring
(
Data
.
residentialZipCode
.
length
-
6
,
Data
.
residentialZipCode
.
length
,
),
residentialAddress
:
Data
.
residentialAddress
,
residentialName
:
Data
.
residentialName
,
},
workingHours
:
[
moment
(
Data
.
residentialStartWorking
,
'HH:mm'
),
moment
(
Data
.
residentialEndWorking
,
'HH:mm'
),
],
info
:
{
tel
:
Data
.
residentialPhone
,
email
:
Data
.
residentialEmail
,
},
residentialManagerUserName
:
Data
.
residentialManagerUserName
,
help
:
{
residentialHotlineName
:
Data
.
residentialHotlineName
,
residentialHotline
:
Data
.
residentialHotline
,
time
:
[
moment
(
Data
.
residentialHotlineServieStartTime
,
'HH:mm'
),
moment
(
Data
.
residentialHotlineServieEndTime
,
'HH:mm'
),
],
},
});
// 上传
setLouba
(
Data
.
balouscheduleUrl
?
[
backUpload
(
Data
.
balouscheduleUrl
,
Data
.
id
)]
:
[]);
setGuide
(
Data
.
serviceGuideUrl
?
[
backUpload
(
Data
.
serviceGuideUrl
,
Data
.
id
)]
:
[]);
// setPeriod(Data.lifeServiceUrl ? [backUpload(Data.lifeServiceUrl, Data.id)] : []);
// 小区名 -- 上传需要
setCodeName
(
Data
.
residentialName
);
setcodeStrat
(
true
);
setTipMain
(
'Binding Content Already Exists, Cannot Be Modified!'
);
}
else
{
// console.log('新建');
}
},
[
Data
]);
// 提交成功与否
useEffect
(()
=>
{
if
(
Result
!=
null
)
{
// 如果不是编辑的话就更新本地小区
if
(
!
Data
)
{
dispatch
({
type
:
'Init/addCommunityget'
,
playload
:
{
Result
:
new
Array
(
Result
.
data
)
}
});
}
// 提示跳转
// message.success(`Information saved successfully!`);
history
.
push
(
'/CommunityManagement/CellList'
);
}
},
[
Result
,
Data
]);
// 监听编辑预览是否获取到地址以及发生改变
useEffect
(()
=>
{
if
(
imgUrl
!=
null
)
{
let
info
=
{
uid
:
'1'
,
name
:
imgUrl
.
name
,
status
:
'done'
,
type
:
imgUrl
.
name
.
match
(
/
\.([^\.]
+
)
$/
)[
1
].
toLowerCase
(),
url
:
imgUrl
.
url
,
};
setpreviewImage
(
info
);
setpreviewVisible
(
true
);
// openDows(imgUrl.url, imgUrl.name);
}
},
[
imgUrl
]);
// 编辑 返回上传格式 和 地址
function
backUpload
(
str
:
any
,
index
:
number
,
url
?:
any
)
{
let
a
=
{
uid
:
str
+
index
,
name
:
str
,
status
:
'done'
,
type
:
str
.
match
(
/
\.([^\.]
+
)
$/
)[
1
].
toLowerCase
(),
url
:
'Transfer'
,
// 需要调取接口
};
return
a
;
}
// 上传设置
const
uploads
=
{
name
:
'file'
,
accept
:
'.jpg,.png,.pdf'
,
action
:
'/tos/image/upload'
,
data
:
{
imageType
:
'tosCreateCommunity'
,
extends
:
codename
},
};
// 文件上传判断
function
beforeUpload
(
file
:
any
)
{
// 文件大小判断
const
isLt2M
=
file
.
size
/
1024
/
1024
<
2
;
if
(
!
isLt2M
)
{
message
.
error
(
'File must be less than or equal to 2MB!'
);
}
return
isLt2M
;
}
// 上传返回格式
function
BackFormat
(
name
:
any
,
url
:
any
)
{
let
imgs
=
[
{
uid
:
'-1'
,
name
:
name
,
status
:
'done'
,
type
:
name
.
match
(
/
\.([^\.]
+
)
$/
)[
1
].
toLowerCase
(),
url
:
url
,
},
];
return
imgs
;
}
// 楼巴上传
const
upload1
=
{
onChange
({
file
}:
any
)
{
file
.
status
===
'uploading'
?
setimgLoad
(
true
)
:
setimgLoad
(
false
);
if
(
file
.
status
===
'done'
)
{
let
data
=
file
.
response
.
data
;
setLouba
(
BackFormat
(
data
.
imageName
,
data
.
url
));
setcodeStrat
(
true
);
setTipMain
(
'Binding Content Already Exists, Cannot Be Modified!'
);
}
// 结果
uploadMsg
(
file
);
},
};
// 指南上传
const
upload2
=
{
onChange
({
file
,
fileList
}:
any
)
{
file
.
status
===
'uploading'
?
setimgLoad
(
true
)
:
setimgLoad
(
false
);
if
(
file
.
status
===
'done'
)
{
let
data
=
file
.
response
.
data
;
setGuide
(
BackFormat
(
data
.
imageName
,
data
.
url
));
setcodeStrat
(
true
);
setTipMain
(
'Binding Content Already Exists, Cannot Be Modified!'
);
}
// 结果
uploadMsg
(
file
);
},
};
// 保质期上传
// const upload3 = {
// onChange({ file }: any) {
// file.status === 'uploading' ? setimgLoad(true) : setimgLoad(false);
// if (file.status === 'done') {
// let data = file.response.data;
// setPeriod(BackFormat(data.imageName, data.url));
// setcodeStrat(true);
// setTipMain('Binding Content Already Exists, Cannot Be Modified!');
// }
// // 结果
// uploadMsg(file);
// },
// };
// 上传提示
function
uploadMsg
(
file
:
any
)
{
if
(
file
.
status
===
'done'
)
{
// message.success(`${file.name} File Uploaded Successfully`);
}
else
if
(
file
.
status
===
'error'
)
{
message
.
error
(
`
${
file
.
name
}
File Upload Failed.`
);
}
}
// 多选选择改变值
function
onChange
(
checkedValues
:
any
)
{
// 修改选择值
setPropertyFee
(
checkedValues
);
}
// undefind 验证
function
undeFi
(
e
:
any
)
{
if
(
typeof
e
==
'undefined'
)
{
return
null
;
}
else
{
return
e
;
}
}
// 表单验证
const
onFinish
=
(
values
:
any
)
=>
{
let
{
residentialZipCode
}
=
values
.
des
;
let
tel
=
values
.
info
.
tel
;
if
(
values
.
residentialManagerUserName
.
length
<
2
)
{
message
.
error
(
'Please Enter 2-digit Administrator Name!'
);
}
else
if
(
residentialZipCode
.
length
<
6
)
{
message
.
error
(
'Please Enter The Correct Name!'
);
}
else
if
(
tel
.
length
!=
8
&&
tel
.
length
!=
11
)
{
message
.
error
(
'Incorrect Contact Information!'
);
}
else
{
onUpDate
(
values
);
}
};
// 表单提交
function
onUpDate
(
values
:
any
)
{
// 额外判断
let
obj
:
any
=
new
Object
();
obj
.
propertyFee
=
PropertyFee
;
// 小区信息;
let
{
residentialZipCode
,
residentialAddress
,
residentialName
}
=
values
.
des
;
obj
.
residentialZipCode
=
`SINGAPORE
${
residentialZipCode
}
`
;
obj
.
residentialAddress
=
residentialAddress
;
obj
.
residentialName
=
residentialName
;
// 小区时间与管理员
obj
.
residentialManagerUserName
=
undeFi
(
values
.
residentialManagerUserName
);
obj
.
residentialStartWorking
=
values
.
workingHours
[
0
].
format
(
'HH:mm'
);
obj
.
residentialEndWorking
=
values
.
workingHours
[
1
].
format
(
'HH:mm'
);
obj
.
residentialPhone
=
values
.
info
.
tel
;
obj
.
residentialEmail
=
values
.
info
.
email
;
// 上传内容
obj
.
balouscheduleUrl
=
undeFi
(
loubaUpload
.
map
((
item
:
any
)
=>
item
.
name
)[
0
]);
obj
.
serviceGuideUrl
=
undeFi
(
guideUpload
.
map
((
item
:
any
)
=>
item
.
name
)[
0
]);
// obj.lifeServiceUrl = undeFi(periodUpload.map((item: any) => item.name)[0]);
// 小区热线
// 表单结构存在数据不存在情况, 所以要多判断一次
if
(
values
.
help
)
{
obj
.
residentialHotlineName
=
values
.
help
.
residentialHotlineName
?
undeFi
(
values
.
help
.
residentialHotlineName
)
:
'Community Hotline'
;
obj
.
residentialHotline
=
values
.
help
.
residentialHotline
?
undeFi
(
values
.
help
.
residentialHotline
)
:
values
.
info
.
tel
;
// 编辑的时候 为空 判断
if
(
values
.
help
.
time
)
{
obj
.
residentialHotlineServieStartTime
=
undeFi
(
values
.
help
.
time
[
0
]).
format
(
'HH:mm'
);
obj
.
residentialHotlineServieEndTime
=
undeFi
(
values
.
help
.
time
[
1
]).
format
(
'HH:mm'
);
}
else
{
obj
.
residentialHotlineServieStartTime
=
values
.
workingHours
[
0
].
format
(
'HH:mm'
);
obj
.
residentialHotlineServieEndTime
=
values
.
workingHours
[
1
].
format
(
'HH:mm'
);
}
}
else
{
obj
.
residentialHotlineName
=
values
.
info
.
tel
;
obj
.
residentialHotline
=
values
.
info
.
tel
;
obj
.
residentialHotlineServieStartTime
=
values
.
workingHours
[
0
].
format
(
'HH:mm'
);
obj
.
residentialHotlineServieEndTime
=
values
.
workingHours
[
1
].
format
(
'HH:mm'
);
}
if
(
Data
)
{
obj
.
id
=
Data
.
id
;
}
console
.
log
(
values
);
console
.
log
(
obj
);
// 上传
RA
(
29
,
obj
,
'CellList'
,
dispatch
);
}
// 返回
const
goToReturn
=
()
=>
{
history
.
go
(
-
1
);
};
// 小区名输入监听ant
function
insdInp
(
value
:
string
)
{
setCodeName
(
value
);
return
value
;
}
// 正则手机号
const
keyup_tool
=
(
value
:
any
)
=>
{
return
getNumber
(
value
.
replace
(
/
[^\d
^
\.]
+/g
,
''
));
};
// 手机号
const
keyup_communityManagerFee
=
(
e
:
any
)
=>
{
e
.
target
.
value
=
keyup_tool
(
e
.
target
.
value
);
};
// 上传按钮
const
uploadButton
=
(
<
div
>
{
imgLoad
?
<
LoadingOutlined
/>
:
<
PlusOutlined
/>
}
<
div
style=
{
{
marginTop
:
8
}
}
>
Upload
</
div
>
</
div
>
);
// 文件预览
const
handlePreview
=
async
(
file
:
any
)
=>
{
if
(
file
.
url
==
'Transfer'
)
{
// 这是编辑的预览, 需要发送一个请求
let
msg
=
{
// userToken: '',
// type: ans.substr(ans.lastIndexOf('.') + 1),
type
:
'tosCommunityFileService'
,
fileName
:
file
.
name
,
extends
:
Data
.
residentialName
,
};
RA
(
47
,
msg
,
module
,
dispatch
);
}
else
{
setpreviewImage
(
file
);
setpreviewVisible
(
true
);
}
};
// 点击移除图片
const
handRemove
=
(
key
:
any
)
=>
{
key
==
1
?
setLouba
([])
:
key
==
2
?
setGuide
([])
:
setPeriod
([]);
};
// 点击遮罩回调
const
handleCancel
=
()
=>
{
setpreviewVisible
(
false
);
// 每次关闭预览都要清掉弹窗图片信息 -- 防止编辑打开页面直接弹出窗口
setpreviewImage
({});
dispatch
({
type
:
module
+
'/urlRemove'
});
};
// pdf 总页数
const
onDocumentLoadSuccess
=
(
pages
:
any
)
=>
{
setNumPages
(
pages
);
};
// 切换pdf 总数
const
onChangePage
=
(
page
:
any
)
=>
{
setPageNumber
(
page
);
};
return
(
<>
<
Spin
spinning=
{
loading
}
tip=
"loading..."
size=
"large"
>
<
div
className=
"form"
>
<
h3
className=
"capi"
>
<
EditOutlined
/>
{
Data
?
'edit'
:
'Create New'
}
community
<
div
className=
"back"
>
<
Button
onClick=
{
goToReturn
}
>
<
LeftOutlined
/>
Back
</
Button
>
</
div
>
</
h3
>
<
Form
name=
"basic"
form=
{
form
}
onFinish=
{
onFinish
}
wrapperCol=
{
{
span
:
18
}
}
layout=
"horizontal"
labelAlign=
"left"
scrollToFirstError=
{
true
}
>
<
Form
.
Item
label=
"Community Name"
name=
"des"
rules=
{
[{
required
:
false
}]
}
className=
"must"
>
<
Input
.
Group
compact
>
<
Form
.
Item
name=
{
[
'des'
,
'residentialZipCode'
]
}
noStyle
rules=
{
village
[
0
]
as
any
}
>
<
Input
style=
{
{
marginRight
:
'10px'
,
width
:
120
}
}
placeholder=
"6 Postcode"
maxLength=
{
6
}
onKeyUp=
{
keyup_communityManagerFee
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
{
[
'des'
,
'residentialAddress'
]
}
noStyle
rules=
{
village
[
1
]
as
any
}
>
<
Input
style=
{
{
width
:
'360px'
}
}
placeholder=
"Please enter community adds"
disabled=
{
codeStrat
}
/>
</
Form
.
Item
>
<
div
className=
"li"
>
<
Form
.
Item
name=
{
[
'des'
,
'residentialName'
]
}
normalize=
{
insdInp
}
noStyle
rules=
{
village
[
2
]
as
any
}
>
<
Input
style=
{
{
marginRight
:
'10px'
,
width
:
'260px'
}
}
placeholder=
"Please enter community name"
disabled=
{
codeStrat
}
/>
</
Form
.
Item
>
{
/* 不可修改提示 */
}
<
span
className=
"redFs"
>
{
tipMain
}
</
span
>
</
div
>
</
Input
.
Group
>
</
Form
.
Item
>
<
Form
.
Item
label=
"Working Hours"
name=
"workingHours"
rules=
{
village
[
3
]
as
any
}
>
<
RangePicker
minuteStep=
{
60
}
format=
"HH:mm"
placeholder=
{
[
'Start Time'
,
'End Time'
]
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"Community Telephone"
name=
"info"
rules=
{
[{
required
:
false
}]
}
className=
"must"
>
<
Input
.
Group
compact
>
<
Form
.
Item
name=
{
[
'info'
,
'tel'
]
}
noStyle
rules=
{
village
[
4
]
as
any
}
>
<
Input
style=
{
{
marginRight
:
'10px'
,
width
:
'160px'
}
}
placeholder=
"Please enter phone"
maxLength=
{
11
}
onKeyUp=
{
keyup_communityManagerFee
}
/>
</
Form
.
Item
>
<
Button
type=
"text"
>
-
</
Button
>
<
Form
.
Item
name=
{
[
'info'
,
'email'
]
}
noStyle
rules=
{
village
[
5
]
as
any
}
>
<
Input
style=
{
{
marginLeft
:
'10px'
,
width
:
'180px'
}
}
placeholder=
"Please enter email"
/>
</
Form
.
Item
>
</
Input
.
Group
>
</
Form
.
Item
>
<
Form
.
Item
label=
"Administrator"
name=
"residentialManagerUserName"
rules=
{
village
[
6
]
as
any
}
>
<
Input
style=
{
{
width
:
'160px'
}
}
placeholder=
"Name"
maxLength=
{
30
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"Property Fee"
name=
"propertyFee"
style=
{
{
marginBottom
:
'0'
}
}
>
<
Checkbox
onChange=
{
onChange
}
disabled
>
Online Payment
</
Checkbox
>
<
Checkbox
onChange=
{
onChange
}
checked
>
Offline Payment
</
Checkbox
>
</
Form
.
Item
>
<
hr
/>
{
/* 上传部分 */
}
<
Form
.
Item
label=
"Shuttle Bus Timetable"
name=
"balouscheduleFile"
style=
{
{
marginBottom
:
'0'
,
minHeight
:
159
}
}
>
<
Upload
{
...
uploads
}
{
...
upload1
}
fileList=
{
loubaUpload
}
beforeUpload=
{
beforeUpload
}
listType=
"picture-card"
disabled=
{
codename
==
''
?
true
:
false
}
onPreview=
{
()
=>
handlePreview
(
loubaUpload
[
0
])
}
// 预览
onRemove=
{
()
=>
handRemove
(
1
)
}
//移除
>
{
loubaUpload
.
length
>=
1
?
null
:
uploadButton
}
</
Upload
>
<
div
className=
"tip"
>
<
span
>
Support Files:.jpg, .png, .pdf
</
span
>
</
div
>
</
Form
.
Item
>
{
/* 上传部分 */
}
<
Form
.
Item
label=
"Property Guide"
name=
"serviceGuideFile"
style=
{
{
marginBottom
:
'0'
,
minHeight
:
159
}
}
>
<
Upload
{
...
uploads
}
{
...
upload2
}
fileList=
{
guideUpload
}
beforeUpload=
{
beforeUpload
}
listType=
"picture-card"
disabled=
{
codename
==
''
?
true
:
false
}
onPreview=
{
()
=>
handlePreview
(
guideUpload
[
0
])
}
// 预览
onRemove=
{
()
=>
handRemove
(
2
)
}
//移除
>
{
guideUpload
.
length
>=
1
?
null
:
uploadButton
}
</
Upload
>
<
div
className=
"tip"
>
<
span
>
Support Files:.jpg, .png, .pdf
</
span
>
</
div
>
</
Form
.
Item
>
{
/* 上传部分 */
}
{
/* <Form.Item
label="Warranty Period Service"
name="lifeServiceFile"
style={{ marginBottom: '0', minHeight: 159 }}
>
<Upload
{...uploads}
{...upload3}
fileList={periodUpload}
beforeUpload={beforeUpload}
listType="picture-card"
disabled={codename == '' ? true : false}
onPreview={() => handlePreview(periodUpload[0])} // 预览
onRemove={() => handRemove(3)} //移除
>
{periodUpload.length >= 1 ? null : uploadButton}
</Upload>
<div className="tip">
<span>Support Files:.jpg, .png, .pdf</span>
</div>
</Form.Item> */
}
<
hr
/>
{
/* 帮助中心 */
}
<
Form
.
Item
label=
"Help Center"
name=
"help"
>
<
Input
.
Group
compact
>
<
Form
.
Item
name=
{
[
'help'
,
'residentialHotlineName'
]
}
noStyle
>
<
Input
style=
{
{
marginRight
:
'10px'
,
width
:
'160px'
}
}
placeholder=
"Name Of Hotline"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
{
[
'help'
,
'residentialHotline'
]
}
noStyle
>
<
Input
style=
{
{
marginRight
:
'10px'
,
width
:
'180px'
}
}
placeholder=
"Hotline"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
{
[
'help'
,
'time'
]
}
noStyle
>
<
RangePicker
format=
"HH:mm"
placeholder=
{
[
'Start Time'
,
'End Time'
]
}
/>
</
Form
.
Item
>
</
Input
.
Group
>
</
Form
.
Item
>
<
hr
/>
{
/* 提交 */
}
<
Form
.
Item
label=
""
colon=
{
false
}
>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
loading
}
>
Submit
</
Button
>
</
Form
.
Item
>
</
Form
>
</
div
>
{
/* 附件预览 */
}
<
Modal
title=
{
previewImage
!=
null
?
previewImage
.
name
:
'File Preview'
}
visible=
{
previewVisible
}
width=
{
800
}
onCancel=
{
handleCancel
}
style=
{
{
textAlign
:
'center'
}
}
footer=
{
null
}
>
{
previewImage
!=
null
?
(
previewImage
.
type
==
'pdf'
?
(
// pdf 换一种
<>
<
PDF
file=
{
previewImage
.
url
}
page=
{
pageNumber
}
scale=
{
1.25
}
onDocumentComplete=
{
onDocumentLoadSuccess
}
/>
<
Pagination
style=
{
{
textAlign
:
'center'
,
marginTop
:
10
,
display
:
'block'
}
}
simple
defaultCurrent=
{
pageNumber
}
total=
{
numPages
*
10
}
onChange=
{
onChangePage
}
/>
</>
)
:
previewImage
.
type
==
'jpg'
||
previewImage
.
type
==
'png'
?
(
// 图片用指定格式
<
Image
src=
{
previewImage
.
url
}
preview=
{
false
}
style=
{
{
margin
:
'0 auto'
,
textAlign
:
'center'
}
}
/>
)
:
(
<
FileViewer
fileType=
{
previewImage
.
type
}
filePath=
{
previewImage
.
url
}
/>
)
)
:
(
''
)
}
</
Modal
>
</
Spin
>
</>
);
};
// export default Adds;
function
map
(
state
:
any
)
{
// console.log(state);
const
Data
=
state
.
CellList
.
DataSave
;
const
{
imgUrl
,
Result
}
=
state
.
CellList
;
const
loading
=
state
.
loading
.
models
.
CellList
?
state
.
loading
.
models
.
CellList
:
false
;
return
{
Data
,
loading
,
Result
,
imgUrl
};
}
export
default
connect
(
map
)(
Adds
);
src/pages/CommunityManagement/CellList/CellList.tsx
View file @
2e1f9cf7
...
@@ -13,7 +13,7 @@ import './celllist.less';
...
@@ -13,7 +13,7 @@ import './celllist.less';
const
CellLists
=
(
props
:
any
)
=>
{
const
CellLists
=
(
props
:
any
)
=>
{
const
columns
=
objectColumns
([
const
columns
=
objectColumns
([
[
'
Community
'
,
'residentialName'
],
[
'
Estate
'
,
'residentialName'
],
[
'Administrator'
,
'residentialManagerUserName'
],
[
'Administrator'
,
'residentialManagerUserName'
],
[
[
'Operation Hours'
,
'Operation Hours'
,
...
@@ -131,7 +131,7 @@ const CellLists = (props: any) => {
...
@@ -131,7 +131,7 @@ const CellLists = (props: any) => {
checklist=
{
Init
?
Init
.
CommunityList
:
null
}
checklist=
{
Init
?
Init
.
CommunityList
:
null
}
onSubmit=
{
CallBackTitleSearch
}
onSubmit=
{
CallBackTitleSearch
}
push=
{
{
push=
{
{
name
:
'Create New
Community
'
,
name
:
'Create New
Estate
'
,
url
:
'/CommunityManagement/CellList/Add'
,
url
:
'/CommunityManagement/CellList/Add'
,
}
}
}
}
/>
/>
...
@@ -164,7 +164,7 @@ const CellLists = (props: any) => {
...
@@ -164,7 +164,7 @@ const CellLists = (props: any) => {
reload
:
false
,
reload
:
false
,
setting
:
false
,
setting
:
false
,
}
}
}
}
headerTitle="
Community
List"
headerTitle="
Estate
List"
// pagination=
{
{
defaultCurrent
:
1
,
total
:
Data
.
totalRow
}
}
// pagination=
{
{
defaultCurrent
:
1
,
total
:
Data
.
totalRow
}
}
/
>
/
>
{
village
.
page
?
(
{
village
.
page
?
(
...
...
src/pages/CommunityManagement/CellList/Details.tsx
View file @
2e1f9cf7
...
@@ -153,7 +153,7 @@ const Detail = (props: any) => {
...
@@ -153,7 +153,7 @@ const Detail = (props: any) => {
<
div
className=
"form"
style=
{
{
width
:
'100%'
,
minHeight
:
'20vh'
}
}
>
<
div
className=
"form"
style=
{
{
width
:
'100%'
,
minHeight
:
'20vh'
}
}
>
<
h3
>
<
h3
>
<
EyeOutlined
/>
<
EyeOutlined
/>
Community
Details
Estate
Details
<
div
className=
"back"
>
<
div
className=
"back"
>
<
Button
onClick=
{
goToReturn
}
>
<
Button
onClick=
{
goToReturn
}
>
<
LeftOutlined
/>
<
LeftOutlined
/>
...
@@ -167,7 +167,7 @@ const Detail = (props: any) => {
...
@@ -167,7 +167,7 @@ const Detail = (props: any) => {
<
div
className=
"celBox"
>
<
div
className=
"celBox"
>
{
/* 激活码 */
}
{
/* 激活码 */
}
<
div
className=
"code"
>
<
div
className=
"code"
>
<
li
>
Community
Activation Code
</
li
>
<
li
>
Estate
Activation Code
</
li
>
<
div
<
div
style=
{
{
style=
{
{
width
:
122
,
width
:
122
,
...
@@ -185,12 +185,12 @@ const Detail = (props: any) => {
...
@@ -185,12 +185,12 @@ const Detail = (props: any) => {
{
/* 详情 */
}
{
/* 详情 */
}
<
div
className=
"list-item"
>
<
div
className=
"list-item"
>
<
div
className=
"item"
>
<
div
className=
"item"
>
<
label
>
Community
Name:
</
label
>
<
label
>
Estate
Name:
</
label
>
<
span
>
{
detailData
.
communityData
.
residentialName
}
</
span
>
<
span
>
{
detailData
.
communityData
.
residentialName
}
</
span
>
</
div
>
</
div
>
{
/* ---------- */
}
{
/* ---------- */
}
<
div
className=
"item"
>
<
div
className=
"item"
>
<
label
>
Community
Address:
</
label
>
<
label
>
Estate
Address:
</
label
>
<
span
>
<
span
>
{
detailData
.
communityData
.
residentialAddress
}
SINGAPORE
{
detailData
.
communityData
.
residentialAddress
}
SINGAPORE
{
/* 这是去掉 新加坡 英文字段 */
}
{
/* 这是去掉 新加坡 英文字段 */
}
...
@@ -373,7 +373,7 @@ const Detail = (props: any) => {
...
@@ -373,7 +373,7 @@ const Detail = (props: any) => {
onClick=
{
openModel
}
onClick=
{
openModel
}
>
>
{
' '
}
{
' '
}
<
span
className=
"capi"
>
Close the
community
</
span
>
<
span
className=
"capi"
>
Close the
Estate
</
span
>
</
Button
>
</
Button
>
</
div
>
</
div
>
)
:
(
)
:
(
...
@@ -382,7 +382,7 @@ const Detail = (props: any) => {
...
@@ -382,7 +382,7 @@ const Detail = (props: any) => {
{
/* 确认关闭框 */
}
{
/* 确认关闭框 */
}
<
Modal
<
Modal
title=
"Are You Sure You Want To Close The
Community
?"
title=
"Are You Sure You Want To Close The
Estate
?"
visible=
{
ModelFee
}
visible=
{
ModelFee
}
centered=
{
true
}
centered=
{
true
}
onCancel=
{
handleCancel
}
onCancel=
{
handleCancel
}
...
@@ -393,9 +393,8 @@ const Detail = (props: any) => {
...
@@ -393,9 +393,8 @@ const Detail = (props: any) => {
confirmLoading=
{
loading
}
confirmLoading=
{
loading
}
>
>
<
p
className=
"capi"
>
<
p
className=
"capi"
>
Close the community will delete
{
' '
}
Close the Estate will delete
<
span
style=
{
{
color
:
'red'
}
}
>
all owners
</
span
>
<
span
style=
{
{
color
:
'red'
}
}
>
all owners
</
span
>
in the Estate .
in the community .
</
p
>
</
p
>
<
p
className=
"capi"
>
please operate carefully!
</
p
>
<
p
className=
"capi"
>
please operate carefully!
</
p
>
</
Modal
>
</
Modal
>
...
@@ -409,7 +408,7 @@ const Detail = (props: any) => {
...
@@ -409,7 +408,7 @@ const Detail = (props: any) => {
// '关闭小区后的下载预约费用列表或者返回'
// '关闭小区后的下载预约费用列表或者返回'
<
Result
<
Result
status=
"success"
status=
"success"
title=
"
Community
Deleted Successfully!"
title=
"
Estate
Deleted Successfully!"
subTitle=
"There is booking facility information of transaction in the current community, please select download."
subTitle=
"There is booking facility information of transaction in the current community, please select download."
extra=
{
[
extra=
{
[
ModelResult
&&
ModelResult
.
downloadExcelUrl
?
(
ModelResult
&&
ModelResult
.
downloadExcelUrl
?
(
...
...
src/pages/CommunityManagement/CommunityAnnouncement/Add.tsx
View file @
2e1f9cf7
...
@@ -170,7 +170,7 @@ const Add = (props: any) => {
...
@@ -170,7 +170,7 @@ const Add = (props: any) => {
onFinish=
{
onFinish
}
onFinish=
{
onFinish
}
validateMessages=
{
validateMessages
}
validateMessages=
{
validateMessages
}
>
>
<
Form
.
Item
name=
{
'community'
}
className=
"diyItem"
label=
"
Community
"
rules=
{
Notice
[
0
]
}
>
<
Form
.
Item
name=
{
'community'
}
className=
"diyItem"
label=
"
Estate
"
rules=
{
Notice
[
0
]
}
>
<
SelectCommunity
<
SelectCommunity
checklist=
{
DataSave
==
null
?
null
:
DataSave
.
communityNum
.
split
(
','
)
}
checklist=
{
DataSave
==
null
?
null
:
DataSave
.
communityNum
.
split
(
','
)
}
/>
/>
...
...
src/pages/CommunityManagement/CommunityAnnouncement/CommunityAnnouncement.tsx
View file @
2e1f9cf7
...
@@ -22,7 +22,7 @@ const CommunityAnnouncement = (props: any) => {
...
@@ -22,7 +22,7 @@ const CommunityAnnouncement = (props: any) => {
// 表头
// 表头
const
columns
:
any
=
[
const
columns
:
any
=
[
{
{
title
:
'
Community
'
,
title
:
'
Estate
'
,
dataIndex
:
'communityNum'
,
dataIndex
:
'communityNum'
,
width
:
240
,
width
:
240
,
ellipsis
:
{
ellipsis
:
{
...
...
src/pages/CommunityManagement/CommunityAnnouncement/Detail copy.tsx
View file @
2e1f9cf7
...
@@ -113,7 +113,7 @@ const Detail = (props: any) => {
...
@@ -113,7 +113,7 @@ const Detail = (props: any) => {
{
hanFunStart
(
DataSave
.
noticStatus
)
}
{
hanFunStart
(
DataSave
.
noticStatus
)
}
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
{
/* 生效小区 */
}
{
/* 生效小区 */
}
<
Descriptions
.
Item
label=
"Effective
Community:
"
span=
{
3
}
>
<
Descriptions
.
Item
label=
"Effective
Estate
"
span=
{
3
}
>
{
CommunityLists
(
DataSave
.
communityNum
)
}
{
CommunityLists
(
DataSave
.
communityNum
)
}
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
{
/* 内容 */
}
{
/* 内容 */
}
...
...
src/pages/CommunityManagement/CommunityAnnouncement/Detail.tsx
View file @
2e1f9cf7
...
@@ -79,7 +79,7 @@ const Add = (props: any) => {
...
@@ -79,7 +79,7 @@ const Add = (props: any) => {
// {...layout}
// {...layout}
validateMessages=
{
validateMessages
}
validateMessages=
{
validateMessages
}
>
>
<
Form
.
Item
name=
{
'community'
}
className=
"diyItem"
label=
"
Community
"
rules=
{
Notice
[
0
]
}
>
<
Form
.
Item
name=
{
'community'
}
className=
"diyItem"
label=
"
Estate
"
rules=
{
Notice
[
0
]
}
>
<
ShowOptions
<
ShowOptions
list=
{
DataSave
?
DataSave
.
communityNum
.
split
(
','
)
:
[]
}
list=
{
DataSave
?
DataSave
.
communityNum
.
split
(
','
)
:
[]
}
defaultValue=
{
'Put It Away'
}
defaultValue=
{
'Put It Away'
}
...
...
src/pages/CommunityManagement/FacilityBookings/BookingDetail.tsx
View file @
2e1f9cf7
...
@@ -161,14 +161,15 @@ const BookingDetail = (props: any) => {
...
@@ -161,14 +161,15 @@ const BookingDetail = (props: any) => {
<
hr
/>
<
hr
/>
<
Descriptions
>
<
Descriptions
>
<
Descriptions
.
Item
label=
"
Community
"
>
{
DataSave
.
communityName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"
Estate
"
>
{
DataSave
.
communityName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Facility"
>
{
DataSave
.
categoriesName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Facility"
>
{
DataSave
.
categoriesName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Schedule"
>
<
Descriptions
.
Item
label=
"Schedule"
>
{
DataSave
.
subscribeDate
}
{
ExtractTime
}
{
DataSave
.
subscribeDate
}
{
ExtractTime
}
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"User Name"
>
{
DataSave
.
accountName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"User Name"
>
{
DataSave
.
accountName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Unit No."
>
<
Descriptions
.
Item
label=
"Unit No."
>
{
DataSave
.
buildNumber
}
#
{
DataSave
.
floorNumber
}
-
{
DataSave
.
roomNumber
}
{
DataSave
.
buildNumber
?
DataSave
.
buildNumber
+
' #'
:
''
}
{
DataSave
.
floorNumber
}
-
{
DataSave
.
roomNumber
}
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Contact Number"
>
{
DataSave
.
accountPhone
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Contact Number"
>
{
DataSave
.
accountPhone
}
</
Descriptions
.
Item
>
</
Descriptions
>
</
Descriptions
>
...
...
src/pages/CommunityManagement/FacilityBookings/Bookings.tsx
View file @
2e1f9cf7
...
@@ -142,11 +142,11 @@ const Bookings = (props: any) => {
...
@@ -142,11 +142,11 @@ const Bookings = (props: any) => {
// 监听输入框是否全部输入完毕
// 监听输入框是否全部输入完毕
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
Unit
.
buildNumber
&&
Unit
.
floorNumber
&&
Unit
.
roomNumber
)
{
if
(
Unit
.
floorNumber
&&
Unit
.
roomNumber
)
{
RA
(
58
,
{
RA
(
58
,
{
facilitiesId
:
curString
.
facilitiesId
,
facilitiesId
:
curString
.
facilitiesId
,
communityName
:
comminityValues
,
communityName
:
comminityValues
,
buildNumber
:
`BLK
${
Unit
.
buildNumber
}
`
,
buildNumber
:
Unit
.
buildNumber
?
`BLK
${
Unit
.
buildNumber
}
`
:
''
,
floorNumber
:
Unit
.
floorNumber
,
floorNumber
:
Unit
.
floorNumber
,
roomNumber
:
Unit
.
roomNumber
,
roomNumber
:
Unit
.
roomNumber
,
subscribeDate
:
Time
,
subscribeDate
:
Time
,
...
@@ -361,12 +361,12 @@ const Bookings = (props: any) => {
...
@@ -361,12 +361,12 @@ const Bookings = (props: any) => {
<
TitleBack
title=
"Facility Bookings"
/>
<
TitleBack
title=
"Facility Bookings"
/>
<
div
className=
{
styles
.
box1
}
>
<
div
className=
{
styles
.
box1
}
>
<
div
className=
{
styles
.
box1item1
}
>
Community
:
</
div
>
<
div
className=
{
styles
.
box1item1
}
>
Estate
:
</
div
>
<
div
className=
{
styles
.
box1item2
}
>
<
div
className=
{
styles
.
box1item2
}
>
<
Spin
spinning=
{
loading
}
tip=
"Finding..."
>
<
Spin
spinning=
{
loading
}
tip=
"Finding..."
>
<
SearchOptionsCommnity
<
SearchOptionsCommnity
alone=
{
true
}
alone=
{
true
}
placeholder=
{
'
Community
Name'
}
placeholder=
{
'
Estate
Name'
}
opname=
{
getFacility
}
opname=
{
getFacility
}
defaultName=
{
DataSave
!=
null
?
DataSave
.
communityName
:
null
}
defaultName=
{
DataSave
!=
null
?
DataSave
.
communityName
:
null
}
// onSubmit={getFacility}
// onSubmit={getFacility}
...
@@ -457,7 +457,7 @@ const Bookings = (props: any) => {
...
@@ -457,7 +457,7 @@ const Bookings = (props: any) => {
<
span
className=
"jio"
style=
{
{
marginLeft
:
0
}
}
>
<
span
className=
"jio"
style=
{
{
marginLeft
:
0
}
}
>
BLK
BLK
</
span
>
</
span
>
<
Form
.
Item
name=
"buildNumber"
rules=
{
BookingsTip
[
2
]
}
>
<
Form
.
Item
name=
"buildNumber"
>
<
Input
<
Input
placeholder=
"Blk"
placeholder=
"Blk"
style=
{
{
width
:
80
}
}
style=
{
{
width
:
80
}
}
...
...
src/pages/CommunityManagement/FacilityBookings/Facility.tsx
View file @
2e1f9cf7
...
@@ -319,7 +319,7 @@ const Facility = (props: any) => {
...
@@ -319,7 +319,7 @@ const Facility = (props: any) => {
validateMessages=
{
validateMessages
}
validateMessages=
{
validateMessages
}
>
>
{
/* 选择小区 */
}
{
/* 选择小区 */
}
<
Form
.
Item
label=
"
Community
"
name=
"communityName"
rules=
{
NewFaci
[
0
]
}
>
<
Form
.
Item
label=
"
Estate
"
name=
"communityName"
rules=
{
NewFaci
[
0
]
}
>
<
SearchOptionsCommnity
<
SearchOptionsCommnity
// ubmit={extendName}
// ubmit={extendName}
defaultName=
{
DataSave
!=
null
?
DataSave
.
communityName
:
null
}
defaultName=
{
DataSave
!=
null
?
DataSave
.
communityName
:
null
}
...
...
src/pages/CommunityManagement/FacilityBookings/FacilityBookings.tsx
View file @
2e1f9cf7
...
@@ -139,7 +139,7 @@ const FacilityBookings = (props: any) => {
...
@@ -139,7 +139,7 @@ const FacilityBookings = (props: any) => {
// 表头
// 表头
const
key
=
[
const
key
=
[
[
'
Community
'
,
'communityName'
],
[
'
Estate
'
,
'communityName'
],
[
'User Name'
,
'accountName'
],
[
'User Name'
,
'accountName'
],
[
'Facility'
,
'categoriesName'
],
[
'Facility'
,
'categoriesName'
],
[
[
...
@@ -167,7 +167,7 @@ const FacilityBookings = (props: any) => {
...
@@ -167,7 +167,7 @@ const FacilityBookings = (props: any) => {
],
],
];
];
const
key2
=
[
const
key2
=
[
[
'
Community
'
,
'community'
],
[
'
Estate
'
,
'community'
],
[
[
'Facilities'
,
'Facilities'
,
'facilities'
,
'facilities'
,
...
...
src/pages/CommunityManagement/FacilityBookings/FacilityTow.tsx
View file @
2e1f9cf7
...
@@ -301,7 +301,7 @@ const FacilityTow = (props: any) => {
...
@@ -301,7 +301,7 @@ const FacilityTow = (props: any) => {
{
/* 设施切换 */
}
{
/* 设施切换 */
}
<
div
className=
{
'FacilityName'
}
>
<
div
className=
{
'FacilityName'
}
>
<
label
>
Community
:
</
label
>
{
DataSave
?
DataSave
.
community
:
''
}
<
label
>
Estate
:
</
label
>
{
DataSave
?
DataSave
.
community
:
''
}
</
div
>
</
div
>
<
Tabs
defaultActiveKey=
"0"
tabPosition=
"top"
onTabClick=
{
(
key
)
=>
onTabClicks
(
key
)
}
>
<
Tabs
defaultActiveKey=
"0"
tabPosition=
"top"
onTabClick=
{
(
key
)
=>
onTabClicks
(
key
)
}
>
...
...
src/pages/CommunityManagement/VisitorRecord/VisitorRecord.tsx
View file @
2e1f9cf7
...
@@ -36,7 +36,7 @@ const VisitorRecord = (props: any) => {
...
@@ -36,7 +36,7 @@ const VisitorRecord = (props: any) => {
dataIndex
:
'updateTime'
,
dataIndex
:
'updateTime'
,
render
:
(
text
:
any
)
=>
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
render
:
(
text
:
any
)
=>
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
},
},
{
title
:
'
Community
'
,
dataIndex
:
'visitorCommunity'
},
{
title
:
'
Estate
'
,
dataIndex
:
'visitorCommunity'
},
{
{
title
:
'Unit No.'
,
title
:
'Unit No.'
,
dataIndex
:
'inviterAddress'
,
dataIndex
:
'inviterAddress'
,
...
...
src/pages/CommunityManagement/visitorRecord/VisitorRecord.tsx
View file @
2e1f9cf7
...
@@ -36,7 +36,7 @@ const VisitorRecord = (props: any) => {
...
@@ -36,7 +36,7 @@ const VisitorRecord = (props: any) => {
dataIndex
:
'updateTime'
,
dataIndex
:
'updateTime'
,
render
:
(
text
:
any
)
=>
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
render
:
(
text
:
any
)
=>
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
},
},
{
title
:
'
Community
'
,
dataIndex
:
'visitorCommunity'
},
{
title
:
'
Estate
'
,
dataIndex
:
'visitorCommunity'
},
{
{
title
:
'Unit No.'
,
title
:
'Unit No.'
,
dataIndex
:
'inviterAddress'
,
dataIndex
:
'inviterAddress'
,
...
...
src/pages/ContractManagement/Contract.tsx
View file @
2e1f9cf7
...
@@ -46,22 +46,22 @@ const Contract = (props: any) => {
...
@@ -46,22 +46,22 @@ const Contract = (props: any) => {
};
};
// 表头
// 表头
const
columns
=
[
const
columns
=
[
{
//
{
title
:
'Contract Number'
,
//
title: 'Contract Number',
render
:
function
(
record
:
any
)
{
//
render: function (record: any) {
let
mom
=
moment
(
record
.
contractValidEndDate
).
diff
(
moment
(),
'months'
);
//
let mom = moment(record.contractValidEndDate).diff(moment(), 'months');
// console.log(mom);
//
// console.log(mom);
if
(
mom
<
3
)
{
//
if (mom < 3) {
return
(
//
return (
<
Tooltip
title=
"Due Soon"
placement=
"right"
color=
{
'red'
}
key=
{
record
.
id
}
>
//
<Tooltip title="Due Soon" placement="right" color={'red'} key={record.id}>
<
span
className=
{
styles
.
red
}
>
{
record
.
contractNumber
}
</
span
>
//
<span className={styles.red}>{record.contractNumber}</span>
</
Tooltip
>
//
</Tooltip>
);
//
);
}
else
{
//
} else {
return
<
span
>
{
record
.
contractNumber
}
</
span
>;
//
return <span>{record.contractNumber}</span>;
}
//
}
},
//
},
},
// 合同编号
//
}, // 合同编号
{
{
title
:
' Contract Party'
,
title
:
' Contract Party'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
render
:
(
text
:
any
,
record
:
any
)
=>
(
...
@@ -73,7 +73,7 @@ const Contract = (props: any) => {
...
@@ -73,7 +73,7 @@ const Contract = (props: any) => {
),
),
},
//合同方
},
//合同方
{
title
:
'Contract Title'
,
dataIndex
:
'contractTitle'
},
// 合同标题
{
title
:
'Contract Title'
,
dataIndex
:
'contractTitle'
},
// 合同标题
{
title
:
'
Community
Name'
,
dataIndex
:
'communityName'
},
// 小区名
{
title
:
'
Estate
Name'
,
dataIndex
:
'communityName'
},
// 小区名
{
title
:
'Contacts'
,
dataIndex
:
'communityAccount'
},
// 联系人
{
title
:
'Contacts'
,
dataIndex
:
'communityAccount'
},
// 联系人
{
title
:
'Phone'
,
dataIndex
:
'communityPhone'
},
// 联系电话
{
title
:
'Phone'
,
dataIndex
:
'communityPhone'
},
// 联系电话
{
title
:
'Start Date'
,
dataIndex
:
'contractValidStartDate'
},
// 生效时间
{
title
:
'Start Date'
,
dataIndex
:
'contractValidStartDate'
},
// 生效时间
...
@@ -85,14 +85,14 @@ const Contract = (props: any) => {
...
@@ -85,14 +85,14 @@ const Contract = (props: any) => {
<
Space
size=
"middle"
>
<
Space
size=
"middle"
>
<
a
<
a
onClick=
{
()
=>
{
onClick=
{
()
=>
{
Jump
(
record
,
'Edit'
);
Jump
(
record
,
`Edit/${record.id}`
);
}
}
}
}
>
>
Edit
Edit
</
a
>
</
a
>
<
a
<
a
onClick=
{
()
=>
{
onClick=
{
()
=>
{
Jump
(
record
,
'Detail'
);
Jump
(
record
,
`Detail/${record.id}`
);
}
}
}
}
>
>
Detail
Detail
...
...
src/pages/ContractManagement/ContractContent copy.tsx
deleted
100644 → 0
View file @
4ad66726
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
styles
from
'./ContractContent.less'
;
import
{
Input
,
Form
,
message
,
Upload
,
Button
,
DatePicker
,
Pagination
,
Modal
,
Spin
,
Image
,
}
from
'antd'
;
import
{
PlusOutlined
,
LeftOutlined
,
LoadingOutlined
}
from
'@ant-design/icons'
;
import
{
Link
,
useIntl
,
connect
,
Dispatch
,
Loading
}
from
'umi'
;
import
{
RA
}
from
'@/services/tos'
;
import
LINE
from
'../../components/Line/Line'
;
import
TextArea
from
'antd/lib/input/TextArea'
;
import
moment
from
'moment'
;
import
'./ContractContent.less'
;
// 配置英文
import
'moment/locale/en-au'
;
import
locale
from
'antd/es/date-picker/locale/en_US'
;
import
SearchOptionsCommnity
from
'@/components/SearchOptions/SearchOptionsCommnity'
;
import
{
tipList
}
from
'@/utils/tip'
;
import
FileViewer
from
'react-file-viewer'
;
import
PDF
from
'react-pdf-js'
;
import
{
randomString
}
from
'@/utils/string'
;
const
ContractContent
=
(
props
:
any
)
=>
{
const
{
Contract
,
dispatch
,
FileImg
,
loading
}
=
props
;
const
{
DataSaveDetail
}
=
Contract
;
const
{
RangePicker
}
=
DatePicker
;
// 日期组件
const
[
form
]
=
Form
.
useForm
();
// 表单
const
RA
=
(
index
:
any
,
values
:
any
)
=>
{
dispatch
({
type
:
'Contract/RA'
,
playload
:
{
index
:
index
,
body
:
values
}
});
};
// 设置之前时间不能选择
function
disabledDate
(
current
:
any
)
{
return
current
&&
current
<=
moment
().
subtract
(
1
,
'days'
).
endOf
(
'day'
);
}
const
[
fileList
,
setFileList
]
=
useState
([]
as
any
);
// 图片列表
const
[
uploadUp
,
setUploadUp
]
=
useState
(
true
);
// 禁止上传 直到选择了小区后
const
[
comtyName
,
setComtyName
]
=
useState
(
null
);
// 小区名字
const
[
tipTime
,
setTipTime
]
=
useState
([
'previous month'
,
'two months'
]
as
any
);
//提示时间
const
[
tipModal
,
settipModal
]
=
useState
(
false
);
//附件弹窗
const
[
fileInfo
,
setfileInfo
]
=
useState
(
null
as
any
);
//附件内容
//pdf 页码内容
const
[
numPages
,
setNumPages
]
=
useState
(
1
as
any
);
// 总页码数
const
[
pageNumber
,
setPageNumber
]
=
useState
(
1
);
// 当前页码数
const
[
imgInfo
,
setimgInfo
]
=
useState
(
null
as
any
);
//本地图片预览
const
[
previewVisible
,
setPreviewVisible
]
=
useState
(
false
);
//本地图片预览弹窗
const
[
imgLoad
,
setimgLoad
]
=
useState
(
false
);
//本地图片预览
useEffect
(()
=>
{
// 如果是添加传来没有值的时候 就清空 否则 赋值给表单
if
(
DataSaveDetail
==
null
)
{
// 清空表单
form
.
resetFields
();
}
else
{
// 发起图片请求
let
objData
=
{
type
:
'tosContractPreview'
,
fileName
:
DataSaveDetail
.
contractFileName
,
extends
:
DataSaveDetail
.
communityName
,
};
RA
(
47
,
objData
);
// 打开禁止
setUploadUp
(
false
);
// 提示时间
let
a1
=
moment
(
DataSaveDetail
.
contractValidEndDate
)
.
subtract
(
2
,
'month'
)
.
format
(
'YYYY-MM-DD'
);
let
a2
=
moment
(
DataSaveDetail
.
contractValidEndDate
)
.
subtract
(
1
,
'month'
)
.
format
(
'YYYY-MM-DD'
);
setTipTime
([
a1
,
a2
]);
// 给到上传绑定
setComtyName
(
DataSaveDetail
.
communityName
);
// 表单内容
form
.
setFieldsValue
({
...
DataSaveDetail
,
upload
:
'ok'
,
time
:
[
moment
(
DataSaveDetail
.
contractValidStartDate
),
moment
(
DataSaveDetail
.
contractValidEndDate
),
],
});
}
},
[
DataSaveDetail
]);
// 监听上传图片列表
useEffect
(()
=>
{
if
(
FileImg
!=
null
)
{
let
obj
=
new
Array
();
for
(
var
i
in
FileImg
)
{
let
a
=
{
uid
:
i
,
name
:
FileImg
[
i
].
fileName
,
status
:
'done'
,
type
:
FileImg
[
i
].
fileName
.
match
(
/
\.([^\.]
+
)
$/
)[
1
].
toLowerCase
(),
url
:
FileImg
[
i
].
fileUrl
,
};
console
.
log
();
obj
.
push
(
a
);
}
setFileList
([...
obj
]);
}
else
{
setFileList
([]);
}
},
[
FileImg
]);
// 监听列表
useEffect
(()
=>
{
if
(
fileList
.
length
==
0
)
{
form
.
setFieldsValue
[
'upload'
]
=
null
;
}
},
[
fileList
]);
// 返回
const
goToReturn
=
()
=>
{
// console.log(fileList)
history
.
back
();
};
// 提交
const
onFinish
=
(
values
:
any
)
=>
{
// 判断有没有文件
if
(
fileList
.
length
==
0
)
{
message
.
error
(
'Please upload the attachment!'
);
}
else
{
values
.
contractValidStartDate
=
values
.
time
[
0
].
format
(
'YYYY-MM-DD'
);
values
.
contractValidEndDate
=
values
.
time
[
1
].
format
(
'YYYY-MM-DD'
);
let
data
=
new
Array
();
for
(
let
i
=
0
;
i
<
fileList
.
length
;
i
++
)
{
data
.
push
(
fileList
[
i
].
name
);
}
values
.
contractFileNameList
=
data
;
// 编辑
if
(
DataSaveDetail
!=
null
)
{
values
.
id
=
DataSaveDetail
.
id
;
}
RA
(
27
,
values
);
// RA(27, values)
}
};
// 上传文件设置
const
uploadProps
=
{
accept
:
'.docx,.jpg,.png,.pdf'
,
action
:
'/tos/image/upload'
,
data
:
{
imageType
:
'tosContract'
,
extends
:
comtyName
},
fileList
:
fileList
,
onChange
:
({
file
}:
{
file
:
any
})
=>
{
console
.
log
(
file
);
if
(
file
.
status
===
'uploading'
)
{
setimgLoad
(
true
);
}
if
(
file
.
status
===
'error'
)
{
message
.
error
(
file
.
name
+
' Upload failed !'
);
setimgLoad
(
false
);
}
if
(
file
.
status
===
'done'
)
{
// message.success(file.name + ' Upload Successful !');
// 实现在线预览
let
obj
=
{
uid
:
randomString
(
12
),
name
:
file
.
name
,
status
:
'done'
,
type
:
file
.
name
.
match
(
/
\.([^\.]
+
)
$/
)[
1
].
toLowerCase
(),
url
:
file
.
response
.
data
,
};
setFileList
([...
fileList
,
obj
]);
// 添加到表单
form
.
setFieldsValue
({
upload
:
'ok'
,
});
setimgLoad
(
false
);
}
},
};
// // 设置提示倒计时
const
changeTime
=
(
data
:
any
,
dateStrings
:
any
)
=>
{
if
(
data
!=
null
)
{
let
a1
=
moment
(
data
[
1
]).
subtract
(
2
,
'month'
).
format
(
'YYYY-MM-DD'
);
let
a2
=
moment
(
data
[
1
]).
subtract
(
1
,
'month'
).
format
(
'YYYY-MM-DD'
);
setTipTime
([
a1
,
a2
]);
}
};
// 选择小区名字并赋值
const
opname
=
(
value
:
any
)
=>
{
// 打开上传 如果选择了 小区就打开 否则 禁止上传
value
?
setUploadUp
(
false
)
:
setUploadUp
(
true
);
// 如果切换了 清掉上传的图片
if
(
value
!=
comtyName
)
{
setFileList
([]);
}
setComtyName
(
value
);
// 赋值小区名字 给到上传
form
.
setFieldsValue
({
communityName
:
value
,
});
};
//本地图预览处理
function
getBase64
(
file
:
any
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
reader
=
new
FileReader
();
reader
.
readAsDataURL
(
file
);
reader
.
onload
=
()
=>
resolve
(
reader
.
result
);
reader
.
onerror
=
(
error
)
=>
reject
(
error
);
});
}
//点击预览
const
onPreviews
=
async
(
file
:
any
)
=>
{
// 有值的话 就是本地预览
if
(
file
.
size
)
{
if
(
!
file
.
url
&&
!
file
.
preview
)
{
file
.
preview
=
await
getBase64
(
file
.
originFileObj
);
}
let
info
=
{
previewImage
:
file
.
url
||
file
.
preview
,
previewTitle
:
file
.
name
||
file
.
url
.
substring
(
file
.
url
.
lastIndexOf
(
'/'
)
+
1
),
};
setPreviewVisible
(
true
);
// 弹窗
setimgInfo
(
info
);
// 图片信息
}
else
{
setfileInfo
(
file
);
// 设置选择的文件
console
.
log
(
file
);
settipModal
(
true
);
}
};
// 关闭预览弹窗
const
handleCancel
=
()
=>
{
settipModal
(
false
);
};
// pdf 总页数
const
onDocumentLoadSuccess
=
(
pages
:
any
)
=>
{
setNumPages
(
pages
);
};
// const onDocumentLoadSuccess = ({ numPages }: any) => {
// //numPages是总页数
// setNumPages(numPages);
// };
// 切换pdf 总数
const
onChangePage
=
(
page
:
any
)
=>
{
setPageNumber
(
page
);
};
// 文件上传判断
function
beforeUpload
(
file
:
any
)
{
// 文件大小判断
const
isLt2M
=
file
.
size
/
1024
/
1024
<
2
;
if
(
!
isLt2M
)
{
message
.
error
(
'File must be less than or equal to 2MB!'
);
}
return
isLt2M
;
}
// 移除文件
const
onRemove
=
async
(
file
:
any
)
=>
{
let
fileListArr
=
fileList
;
for
(
let
i
in
fileListArr
)
{
if
(
fileListArr
[
i
].
uid
==
file
.
uid
)
{
fileListArr
.
splice
(
i
,
1
);
}
}
setFileList
([...
fileListArr
]);
};
// 文件上传按钮
const
uploadButton
=
(
<
div
>
{
imgLoad
?
<
LoadingOutlined
/>
:
<
PlusOutlined
/>
}
<
div
style=
{
{
marginTop
:
5
}
}
>
Upload
</
div
>
</
div
>
);
return
(
<>
<
Spin
spinning=
{
loading
}
>
<
div
className=
{
styles
.
base
}
>
{
/* 头部组件 */
}
<
div
className=
{
styles
.
box
}
>
<
div
className=
{
styles
.
item1
}
>
{
DataSaveDetail
?
'Edit'
:
'Add'
}
Contract
</
div
>
<
button
className=
{
styles
.
item3
}
onClick=
{
goToReturn
}
>
<
LeftOutlined
/>
Back
</
button
>
</
div
>
{
/* 表单 initialValues={defForm} */
}
<
Form
// ref={formRef}
autoComplete=
"off"
form=
{
form
}
name=
"basic"
initialValues=
{
DataSaveDetail
}
onFinish=
{
onFinish
}
// initialValues={defForm}
>
<
div
className=
"contract_box"
>
<
div
className=
"list2"
>
<
Form
.
Item
name=
"contractNumber"
label=
"Contract Number"
rules=
{
[{
required
:
true
,
message
:
`${tipList[0]}`
}]
}
>
<
Input
style=
{
{
width
:
200
}
}
placeholder=
"Contract Number"
/>
</
Form
.
Item
>
</
div
>
{
/* 合同编号、甲方、乙方 */
}
<
div
className=
"list_1"
>
<
div
className=
"item_1"
>
<
Form
.
Item
name=
"contractPartyA"
label=
"Contract Party A"
rules=
{
[{
required
:
true
,
message
:
`${tipList[1]}`
}]
}
>
<
Input
style=
{
{
width
:
300
}
}
placeholder=
"Contract Party A"
/>
</
Form
.
Item
>
</
div
>
<
div
className=
"item_1"
>
<
Form
.
Item
name=
"contractPartyB"
label=
"Contract Party B"
rules=
{
[{
required
:
true
,
message
:
`${tipList[2]}`
}]
}
>
<
Input
style=
{
{
width
:
300
}
}
placeholder=
"Contract Party B"
/>
</
Form
.
Item
>
</
div
>
</
div
>
{
/* 小区 */
}
<
div
className=
"list2"
>
<
div
className=
"main"
>
<
Form
.
Item
labelAlign=
"right"
name=
"communityName"
label=
"Community Name"
rules=
{
[{
required
:
true
,
message
:
`${tipList[3]}`
}]
}
>
<
SearchOptionsCommnity
defaultName=
{
DataSaveDetail
?
DataSaveDetail
.
communityName
:
null
}
// ubmit={extendName}
opname=
{
opname
}
/>
</
Form
.
Item
>
</
div
>
</
div
>
{
/* 合同标题 */
}
<
div
className=
"list2"
>
<
Form
.
Item
labelAlign=
"right"
name=
"contractTitle"
label=
"Contract Title"
rules=
{
[{
required
:
true
,
message
:
`${tipList[4]}`
}]
}
>
<
Input
style=
{
{
width
:
500
}
}
placeholder=
"Contract Title"
/>
</
Form
.
Item
>
</
div
>
{
/* 起止时间 */
}
<
div
className=
"list2"
>
<
Form
.
Item
name=
"time"
labelAlign=
"right"
label=
"Contract Time"
rules=
{
[{
required
:
true
,
message
:
`${tipList[5]}`
}]
}
>
<
RangePicker
locale=
{
locale
}
defaultValue=
{
DataSaveDetail
?
DataSaveDetail
.
time
:
null
}
// disabledDate={disabledDate} // 时间限制
placeholder=
{
[
'Effective Date'
,
'Expiration Date'
]
}
onChange=
{
changeTime
}
/>
</
Form
.
Item
>
</
div
>
{
/* 附件上传 */
}
<
div
className=
"list2"
>
<
Form
.
Item
labelAlign=
"right"
name=
"upload"
label=
"Contract Annex"
rules=
{
[{
required
:
true
,
message
:
`Please upload the attachment!`
}]
}
>
<
Upload
{
...
uploadProps
}
listType=
{
'picture-card'
}
disabled=
{
uploadUp
}
beforeUpload=
{
beforeUpload
}
onPreview=
{
onPreviews
}
onRemove=
{
onRemove
}
>
{
fileList
.
length
>=
3
?
null
:
uploadButton
}
</
Upload
>
</
Form
.
Item
>
</
div
>
{
/* 合同内容 */
}
<
div
className=
"list2"
>
<
div
className=
{
styles
.
box8item2x1
}
>
<
Form
.
Item
rules=
{
[{
required
:
true
,
message
:
`${tipList[5]}`
}]
}
label=
"Contract Remarks"
name=
"contractRemindContent"
style=
{
{
marginBottom
:
0
}
}
>
<
TextArea
style=
{
{
padding
:
8
,
width
:
600
}
}
placeholder=
"Remarks"
showCount=
{
true
}
autoSize=
{
{
minRows
:
6
,
maxRows
:
6
}
}
></
TextArea
>
</
Form
.
Item
>
</
div
>
<
div
className=
{
styles
.
box8item2x2
}
style=
{
{
marginLeft
:
150
,
textTransform
:
'capitalize'
}
}
>
<
p
style=
{
{
marginBottom
:
0
}
}
>
The system will send e-mail notification in the
{
' '
}
<
span
style=
{
{
color
:
'red'
}
}
>
{
tipTime
[
0
]
}
</
span
>
and
{
' '
}
<
span
style=
{
{
color
:
'red'
}
}
>
{
tipTime
[
1
]
}
</
span
>
that the contract is about to
expire !
</
p
>
<
p
style=
{
{
marginBottom
:
0
}
}
>
<
span
style=
{
{
color
:
'red'
}
}
>
*
</
span
>
If the time has passed, it will not be
sent
</
p
>
{
/* <span style={{color:'#f00'}}> {stateTime}</span> */
}
</
div
>
</
div
>
<
div
>
<
LINE
/>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
loading
}
>
Submit
</
Button
>
</
div
>
</
div
>
</
Form
>
{
/* 附件预览 */
}
<
Modal
title=
{
fileInfo
!=
null
?
fileInfo
.
name
:
'File Preview'
}
visible=
{
tipModal
}
width=
{
800
}
onCancel=
{
handleCancel
}
style=
{
{
textAlign
:
'center'
}
}
footer=
{
null
}
>
{
fileInfo
!=
null
?
(
fileInfo
.
type
==
'pdf'
?
(
// pdf 换一种
<>
<
PDF
file=
{
fileInfo
.
url
}
// file=
{
stringSplit
(
fileInfo
.
url
,
'
m
/
cash
')}
page=
{
pageNumber
}
scale=
{
1.25
}
onDocumentComplete=
{
onDocumentLoadSuccess
}
/>
<
Pagination
style=
{
{
textAlign
:
'center'
,
marginTop
:
10
,
display
:
'block'
}
}
simple
defaultCurrent=
{
pageNumber
}
total=
{
numPages
*
10
}
onChange=
{
onChangePage
}
/>
</>
)
:
fileInfo
.
type
==
'jpg'
||
fileInfo
.
type
==
'png'
?
(
// 图片用指定格式
<
Image
src=
{
fileInfo
.
url
}
preview=
{
false
}
style=
{
{
margin
:
'0 auto'
,
textAlign
:
'center'
}
}
/>
)
:
(
<
FileViewer
fileType=
{
fileInfo
.
type
}
filePath=
{
fileInfo
.
url
}
// filePath=
{
stringSplit
(
fileInfo
.
url
,
'
m
/
cash
')}
/>
)
)
:
(
''
)
}
</
Modal
>
{
/* 本地附件预览 */
}
{
imgInfo
!=
null
?
(
<
Modal
visible=
{
previewVisible
}
title=
{
imgInfo
.
previewTitle
}
footer=
{
null
}
onCancel=
{
()
=>
{
setPreviewVisible
(
false
);
}
}
>
<
img
alt=
"example"
style=
{
{
width
:
'100%'
}
}
src=
{
imgInfo
.
previewImage
}
/>
</
Modal
>
)
:
(
''
)
}
</
div
>
</
Spin
>
</>
);
};
function
mapStateToProps
(
state
:
any
)
{
const
{
ContractModel
,
Contract
}
=
state
;
const
FileImg
=
Contract
.
FileImg
;
const
loading
=
state
.
loading
.
models
.
Contract
||
false
;
return
{
ContractModel
,
Contract
,
FileImg
,
loading
,
};
}
export
default
connect
(
mapStateToProps
)(
ContractContent
);
src/pages/ContractManagement/ContractContent.tsx
View file @
2e1f9cf7
...
@@ -24,7 +24,9 @@ import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommn
...
@@ -24,7 +24,9 @@ import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommn
import
{
tipList
}
from
'@/utils/tip'
;
import
{
tipList
}
from
'@/utils/tip'
;
import
FileViewer
from
'react-file-viewer'
;
import
FileViewer
from
'react-file-viewer'
;
import
PDF
from
'react-pdf-js'
;
import
{
Document
,
Page
}
from
'react-pdf'
;
import
{
pdfjs
}
from
'react-pdf'
;
pdfjs
.
GlobalWorkerOptions
.
workerSrc
=
`//cdnjs.cloudflare.com/ajax/libs/pdf.js/
${
pdfjs
.
version
}
/pdf.worker.min.js`
;
import
{
randomString
}
from
'@/utils/string'
;
import
{
randomString
}
from
'@/utils/string'
;
...
@@ -35,7 +37,6 @@ const contentState = {
...
@@ -35,7 +37,6 @@ const contentState = {
fileList
:
[],
// 图片列表
fileList
:
[],
// 图片列表
uploadUp
:
true
,
// 禁止上传 直到选择了小区后
uploadUp
:
true
,
// 禁止上传 直到选择了小区后
comtyName
:
null
,
// 已选小区名字
comtyName
:
null
,
// 已选小区名字
tipTime
:
[
'previous month'
,
'two months'
,
'there months'
],
//时间提示
tipModal
:
false
,
//附件弹窗
tipModal
:
false
,
//附件弹窗
fileInfo
:
null
,
//附件内容
fileInfo
:
null
,
//附件内容
numPages
:
1
,
// pdf 总页码数
numPages
:
1
,
// pdf 总页码数
...
@@ -56,9 +57,6 @@ const contentReducer = (state: any, action: any) => {
...
@@ -56,9 +57,6 @@ const contentReducer = (state: any, action: any) => {
case
'setComtyName'
:
// 小区名字
case
'setComtyName'
:
// 小区名字
return
{
...
state
,
comtyName
:
action
.
payload
};
return
{
...
state
,
comtyName
:
action
.
payload
};
case
'setTipTime'
:
// 时间提示
return
{
...
state
,
tipTime
:
action
.
payload
};
case
'settipModal'
:
// 附件弹窗
case
'settipModal'
:
// 附件弹窗
return
{
...
state
,
tipModal
:
action
.
payload
};
return
{
...
state
,
tipModal
:
action
.
payload
};
...
@@ -88,7 +86,7 @@ const contentReducer = (state: any, action: any) => {
...
@@ -88,7 +86,7 @@ const contentReducer = (state: any, action: any) => {
/******* useState 改造 useReducer *********/
/******* useState 改造 useReducer *********/
const
ContractContent
=
(
props
:
any
)
=>
{
const
ContractContent
=
(
props
:
any
)
=>
{
const
{
Contract
,
dispatch
,
FileImg
,
loading
}
=
props
;
const
{
Contract
,
dispatch
,
FileImg
,
loading
,
match
}
=
props
;
const
{
DataSaveDetail
}
=
Contract
;
const
{
DataSaveDetail
}
=
Contract
;
const
{
RangePicker
}
=
DatePicker
;
// 日期组件
const
{
RangePicker
}
=
DatePicker
;
// 日期组件
...
@@ -100,9 +98,17 @@ const ContractContent = (props: any) => {
...
@@ -100,9 +98,17 @@ const ContractContent = (props: any) => {
/* 使用 useReducer */
/* 使用 useReducer */
const
[
state
,
dispatchs
]
=
useReducer
(
contentReducer
,
contentState
);
const
[
state
,
dispatchs
]
=
useReducer
(
contentReducer
,
contentState
);
// useEffect(() => {
// if (match.params.id) {
// RA(64, { id: match.params.id }, module, dispatch);
// }
// }, [match]);
useEffect
(()
=>
{
useEffect
(()
=>
{
// 如果是添加传来没有值的时候 就清空 否则 赋值给表单
// 如果存在id且 传过来的值没有的话 就返回列表
if
(
DataSaveDetail
==
null
)
{
if
(
DataSaveDetail
==
null
&&
match
.
params
.
id
)
{
history
.
go
(
-
1
);
}
else
if
(
DataSaveDetail
==
null
)
{
// 清空表单
// 清空表单
form
.
resetFields
();
form
.
resetFields
();
}
else
{
}
else
{
...
@@ -119,15 +125,16 @@ const ContractContent = (props: any) => {
...
@@ -119,15 +125,16 @@ const ContractContent = (props: any) => {
dispatchs
({
type
:
'setUploadUp'
,
payload
:
false
});
dispatchs
({
type
:
'setUploadUp'
,
payload
:
false
});
// 提示时间
// 提示时间
let
a1
=
timeOver
(
DataSaveDetail
.
contractValidEndDate
,
2
);
//
let a1 = timeOver(DataSaveDetail.contractValidEndDate, 2);
let
a2
=
timeOver
(
DataSaveDetail
.
contractValidEndDate
,
1
);
//
let a2 = timeOver(DataSaveDetail.contractValidEndDate, 1);
let
a3
=
timeOver
(
DataSaveDetail
.
contractValidEndDate
,
3
);
//
let a3 = timeOver(DataSaveDetail.contractValidEndDate, 3);
// setTipTime([a1, a2]);
// setTipTime([a1, a2]);
dispatchs
({
type
:
'setTipTime'
,
payload
:
[
a3
,
a1
,
a2
]
});
//
dispatchs({ type: 'setTipTime', payload: [a3, a1, a2] });
// 给到上传绑定
// 给到上传绑定
// setComtyName(DataSaveDetail.communityName);
// setComtyName(DataSaveDetail.communityName);
dispatchs
({
type
:
'setComtyName'
,
payload
:
DataSaveDetail
.
communityName
});
dispatchs
({
type
:
'setComtyName'
,
payload
:
DataSaveDetail
.
communityName
});
// 表单内容
// 表单内容
form
.
setFieldsValue
({
form
.
setFieldsValue
({
...
@@ -137,9 +144,14 @@ const ContractContent = (props: any) => {
...
@@ -137,9 +144,14 @@ const ContractContent = (props: any) => {
moment
(
DataSaveDetail
.
contractValidStartDate
),
moment
(
DataSaveDetail
.
contractValidStartDate
),
moment
(
DataSaveDetail
.
contractValidEndDate
),
moment
(
DataSaveDetail
.
contractValidEndDate
),
],
],
license
:
[
moment
(
DataSaveDetail
.
licenseStartTime
),
moment
(
DataSaveDetail
.
licenseEndTime
)],
lnsurancePolicy
:
[
moment
(
DataSaveDetail
.
lnsurancePolicyStartTime
),
moment
(
DataSaveDetail
.
lnsurancePolicyEndTime
),
],
});
});
}
}
},
[
DataSaveDetail
]);
},
[
DataSaveDetail
,
match
]);
// 时间转换
// 时间转换
const
timeOver
=
(
time
:
any
,
day
:
any
)
=>
{
const
timeOver
=
(
time
:
any
,
day
:
any
)
=>
{
...
@@ -190,14 +202,26 @@ const ContractContent = (props: any) => {
...
@@ -190,14 +202,26 @@ const ContractContent = (props: any) => {
if
(
state
.
fileList
.
length
==
0
)
{
if
(
state
.
fileList
.
length
==
0
)
{
message
.
error
(
'Please upload the contract annex!'
);
message
.
error
(
'Please upload the contract annex!'
);
}
else
{
}
else
{
// 合同起止时间
values
.
contractValidStartDate
=
values
.
time
[
0
].
format
(
'YYYY-MM-DD'
);
values
.
contractValidStartDate
=
values
.
time
[
0
].
format
(
'YYYY-MM-DD'
);
values
.
contractValidEndDate
=
values
.
time
[
1
].
format
(
'YYYY-MM-DD'
);
values
.
contractValidEndDate
=
values
.
time
[
1
].
format
(
'YYYY-MM-DD'
);
// 执照起止时间
values
.
licenseStartTime
=
values
.
license
[
0
].
format
(
'YYYY-MM-DD'
);
values
.
licenseEndTime
=
values
.
license
[
1
].
format
(
'YYYY-MM-DD'
);
// 保险起止时间
values
.
lnsurancePolicyStartTime
=
values
.
lnsurancePolicy
[
0
].
format
(
'YYYY-MM-DD'
);
values
.
lnsurancePolicyEndTime
=
values
.
lnsurancePolicy
[
1
].
format
(
'YYYY-MM-DD'
);
let
data
=
new
Array
();
let
data
=
new
Array
();
for
(
let
i
=
0
;
i
<
state
.
fileList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
state
.
fileList
.
length
;
i
++
)
{
data
.
push
(
state
.
fileList
[
i
].
name
);
data
.
push
(
state
.
fileList
[
i
].
name
);
}
}
values
.
contractFileNameList
=
data
;
values
.
contractFileNameList
=
data
;
delete
values
.
lnsurancePolicy
;
delete
values
.
license
;
delete
values
.
time
;
// 编辑
// 编辑
if
(
DataSaveDetail
!=
null
)
{
if
(
DataSaveDetail
!=
null
)
{
values
.
id
=
DataSaveDetail
.
id
;
values
.
id
=
DataSaveDetail
.
id
;
...
@@ -215,7 +239,7 @@ const ContractContent = (props: any) => {
...
@@ -215,7 +239,7 @@ const ContractContent = (props: any) => {
data
:
{
imageType
:
'tosContract'
,
extends
:
state
.
comtyName
},
data
:
{
imageType
:
'tosContract'
,
extends
:
state
.
comtyName
},
fileList
:
state
.
fileList
,
fileList
:
state
.
fileList
,
onChange
:
({
file
}:
{
file
:
any
})
=>
{
onChange
:
({
file
}:
{
file
:
any
})
=>
{
console
.
log
(
file
);
//
console.log(file);
if
(
file
.
status
===
'uploading'
)
{
if
(
file
.
status
===
'uploading'
)
{
// setimgLoad(true);
// setimgLoad(true);
dispatchs
({
type
:
'setimgLoad'
,
payload
:
true
});
dispatchs
({
type
:
'setimgLoad'
,
payload
:
true
});
...
@@ -251,15 +275,15 @@ const ContractContent = (props: any) => {
...
@@ -251,15 +275,15 @@ const ContractContent = (props: any) => {
};
};
// // 设置提示倒计时
// // 设置提示倒计时
const
changeTime
=
(
data
:
any
,
dateStrings
:
any
)
=>
{
//
const changeTime = (data: any, dateStrings: any) => {
if
(
data
!=
null
)
{
//
if (data != null) {
let
a1
=
timeOver
(
data
[
1
],
2
);
//
let a1 = timeOver(data[1], 2);
let
a2
=
timeOver
(
data
[
1
],
1
);
//
let a2 = timeOver(data[1], 1);
let
a3
=
timeOver
(
data
[
1
],
3
);
//
let a3 = timeOver(data[1], 3);
// setTipTime([a1, a2]);
//
// setTipTime([a1, a2]);
dispatchs
({
type
:
'setTipTime'
,
payload
:
[
a3
,
a1
,
a2
]
});
//
dispatchs({ type: 'setTipTime', payload: [a3, a1, a2] });
}
//
}
};
//
};
// 选择小区名字并赋值
// 选择小区名字并赋值
const
opname
=
(
value
:
any
)
=>
{
const
opname
=
(
value
:
any
)
=>
{
...
@@ -320,16 +344,11 @@ const ContractContent = (props: any) => {
...
@@ -320,16 +344,11 @@ const ContractContent = (props: any) => {
};
};
// pdf 总页数
// pdf 总页数
const
onDocumentLoadSuccess
=
(
pages
:
any
)
=>
{
const
onDocumentLoadSuccess
=
(
{
numPages
}
:
any
)
=>
{
//
setNumPages(pages);
//
numPages是总页数
dispatchs
({
type
:
'setNumPages'
,
payload
:
p
ages
});
dispatchs
({
type
:
'setNumPages'
,
payload
:
numP
ages
});
};
};
// const onDocumentLoadSuccess = ({ numPages }: any) => {
// //numPages是总页数
// setNumPages(numPages);
// };
// 切换pdf 总数
// 切换pdf 总数
const
onChangePage
=
(
page
:
any
)
=>
{
const
onChangePage
=
(
page
:
any
)
=>
{
// setPageNumber(page);
// setPageNumber(page);
...
@@ -366,6 +385,13 @@ const ContractContent = (props: any) => {
...
@@ -366,6 +385,13 @@ const ContractContent = (props: any) => {
</
div
>
</
div
>
);
);
// word 失效
const
onError
=
()
=>
{
message
.
error
(
'file error !'
);
// settipModal(false);
dispatchs
({
type
:
'settipModal'
,
payload
:
false
});
};
return
(
return
(
<>
<>
<
Spin
spinning=
{
loading
}
>
<
Spin
spinning=
{
loading
}
>
...
@@ -389,11 +415,11 @@ const ContractContent = (props: any) => {
...
@@ -389,11 +415,11 @@ const ContractContent = (props: any) => {
// initialValues={defForm}
// initialValues={defForm}
>
>
<
div
className=
"contract_box"
>
<
div
className=
"contract_box"
>
<
div
className=
"list2"
>
{
/*
<div className="list2">
<Form.Item name="contractNumber" label="Contract Number" rules={tipList[0]}>
<Form.Item name="contractNumber" label="Contract Number" rules={tipList[0]}>
<Input style={{ width: 200 }} placeholder="Contract Number" maxLength={25} />
<Input style={{ width: 200 }} placeholder="Contract Number" maxLength={25} />
</Form.Item>
</Form.Item>
</
div
>
</div>
*/
}
{
/* 合同编号、甲方、乙方 */
}
{
/* 合同编号、甲方、乙方 */
}
<
div
className=
"list_1"
>
<
div
className=
"list_1"
>
{
/* <div className="item_1">
{
/* <div className="item_1">
...
@@ -417,7 +443,7 @@ const ContractContent = (props: any) => {
...
@@ -417,7 +443,7 @@ const ContractContent = (props: any) => {
<
Form
.
Item
<
Form
.
Item
labelAlign=
"right"
labelAlign=
"right"
name=
"communityName"
name=
"communityName"
label=
"
Community
Name"
label=
"
Estate
Name"
rules=
{
tipList
[
3
]
}
rules=
{
tipList
[
3
]
}
>
>
<
SearchOptionsCommnity
<
SearchOptionsCommnity
...
@@ -442,12 +468,17 @@ const ContractContent = (props: any) => {
...
@@ -442,12 +468,17 @@ const ContractContent = (props: any) => {
{
/* 起止时间 */
}
{
/* 起止时间 */
}
<
div
className=
"list2"
>
<
div
className=
"list2"
>
<
Form
.
Item
name=
"time"
labelAlign=
"right"
label=
"Contract Time"
rules=
{
tipList
[
5
]
}
>
<
Form
.
Item
name=
"time"
labelAlign=
"right"
label=
"Contract Duration"
rules=
{
tipList
[
5
]
}
>
<
RangePicker
<
RangePicker
defaultValue=
{
DataSaveDetail
?
DataSaveDetail
.
time
:
null
}
defaultValue=
{
DataSaveDetail
?
DataSaveDetail
.
time
:
null
}
// disabledDate={disabledDate} // 时间限制
// disabledDate={disabledDate} // 时间限制
placeholder=
{
[
'Effective Date'
,
'Expir
ation
Date'
]
}
placeholder=
{
[
'Effective Date'
,
'Expir
y
Date'
]
}
onChange=
{
changeTime
}
//
onChange={changeTime}
/>
/>
</
Form
.
Item
>
</
Form
.
Item
>
</
div
>
</
div
>
...
@@ -473,41 +504,65 @@ const ContractContent = (props: any) => {
...
@@ -473,41 +504,65 @@ const ContractContent = (props: any) => {
</
Form
.
Item
>
</
Form
.
Item
>
</
div
>
</
div
>
{
/* 合同内容 */
}
{
/* --------------------------4.21新增------------------------- */
}
{
/* 许可证编号 */
}
<
div
className=
"list2"
>
<
div
className=
"list2"
>
<
div
className=
{
styles
.
box8item2x1
}
>
<
Form
.
Item
<
Form
.
Item
rules=
{
tipList
[
7
]
}
labelAlign=
"right"
label=
"Contract Remarks
"
name=
"licenseNo
"
name=
"contractRemindContent
"
label=
"License No
"
style=
{
{
marginBottom
:
0
}
}
rules=
{
tipList
[
4
]
}
>
>
<
TextArea
<
Input
style=
{
{
width
:
500
}
}
placeholder=
"License No"
/>
style=
{
{
padding
:
'8px 0'
,
width
:
600
}
}
placeholder=
"Remarks"
showCount=
{
true
}
autoSize=
{
{
minRows
:
6
,
maxRows
:
6
}
}
></
TextArea
>
</
Form
.
Item
>
</
Form
.
Item
>
</
div
>
</
div
>
<
div
className=
{
styles
.
box8item2x2
}
{
/* 许可证编号起止时间 */
}
style=
{
{
marginLeft
:
150
,
textTransform
:
'capitalize'
}
}
<
div
className=
"list2"
>
<
Form
.
Item
name=
"license"
labelAlign=
"right"
label=
"License Duration"
rules=
{
tipList
[
5
]
}
>
<
RangePicker
defaultValue=
{
DataSaveDetail
?
DataSaveDetail
.
time
:
null
}
// disabledDate={disabledDate} // 时间限制
placeholder=
{
[
'Effective Date'
,
'Expiry Date'
]
}
// onChange={changeTime}
/>
</
Form
.
Item
>
</
div
>
{
/* 保险编号 */
}
<
div
className=
"list2"
>
<
Form
.
Item
labelAlign=
"right"
name=
"lnsurancePolicyNo"
label=
"lnsurance Policy No"
rules=
{
tipList
[
4
]
}
>
>
<
p
style=
{
{
marginBottom
:
0
}
}
>
<
Input
style=
{
{
width
:
500
}
}
placeholder=
"lnsurance Policy No"
/>
The system will send email on
{
' '
}
</
Form
.
Item
>
<
span
style=
{
{
color
:
'red'
}
}
>
{
state
.
tipTime
[
0
]
}
</
span
>
,
{
' '
}
<
span
style=
{
{
color
:
'red'
}
}
>
{
state
.
tipTime
[
1
]
}
</
span
>
and
{
' '
}
<
span
style=
{
{
color
:
'red'
}
}
>
{
state
.
tipTime
[
2
]
}
</
span
>
before the contract is
about to expire!
</
p
>
<
p
style=
{
{
marginBottom
:
0
}
}
>
<
span
style=
{
{
color
:
'red'
}
}
>
*
</
span
>
If the time has passed, it will not be
sent
</
p
>
{
/* <span style={{color:'#f00'}}> {stateTime}</span> */
}
</
div
>
</
div
>
{
/* 保险编号起止时间 */
}
<
div
className=
"list2"
>
<
Form
.
Item
name=
"lnsurancePolicy"
labelAlign=
"right"
label=
"Policy Tenure"
rules=
{
tipList
[
5
]
}
>
<
RangePicker
defaultValue=
{
DataSaveDetail
?
DataSaveDetail
.
time
:
null
}
// disabledDate={disabledDate} // 时间限制
placeholder=
{
[
'Effective Date'
,
'Expiry Date'
]
}
// onChange={changeTime}
/>
</
Form
.
Item
>
</
div
>
</
div
>
<
LINE
/>
<
LINE
/>
<
div
style=
{
{
marginLeft
:
150
}
}
>
<
div
style=
{
{
marginLeft
:
150
}
}
>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
loading
}
>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
loading
}
>
...
@@ -530,13 +585,19 @@ const ContractContent = (props: any) => {
...
@@ -530,13 +585,19 @@ const ContractContent = (props: any) => {
state
.
fileInfo
.
type
==
'pdf'
?
(
state
.
fileInfo
.
type
==
'pdf'
?
(
// pdf 换一种
// pdf 换一种
<>
<>
<
PDF
<
Document
file=
{
state
.
fileInfo
.
url
}
file=
{
state
.
fileInfo
.
url
}
//文件路径
// file=
{
stringSplit
(
fileInfo
.
url
,
'
m
/
cash
')}
onLoadSuccess=
{
onDocumentLoadSuccess
}
//成功加载文档后调用
page=
{
state
.
pageNumber
}
// onLoadError=
{
console
.
error
}
//加载失败时调用
loading=
{
<
Spin
indicator=
{
<
LoadingOutlined
spin
/>
}
/>
}
//加载时提示语句
onLoadError=
{
onError
}
>
<
Page
key=
{
state
.
fileInfo
.
id
}
pageNumber=
{
state
.
pageNumber
}
//当前页页码
scale=
{
1.25
}
scale=
{
1.25
}
onDocumentComplete=
{
onDocumentLoadSuccess
}
/>
/>
</
Document
>
<
Pagination
<
Pagination
style=
{
{
textAlign
:
'center'
,
marginTop
:
10
,
display
:
'block'
}
}
style=
{
{
textAlign
:
'center'
,
marginTop
:
10
,
display
:
'block'
}
}
simple
simple
...
@@ -557,6 +618,8 @@ const ContractContent = (props: any) => {
...
@@ -557,6 +618,8 @@ const ContractContent = (props: any) => {
<
FileViewer
<
FileViewer
fileType=
{
state
.
fileInfo
.
type
}
fileType=
{
state
.
fileInfo
.
type
}
filePath=
{
state
.
fileInfo
.
url
}
filePath=
{
state
.
fileInfo
.
url
}
key=
{
state
.
fileInfo
.
url
}
onError=
{
onError
}
// filePath=
{
stringSplit
(
fileInfo
.
url
,
'
m
/
cash
')}
// filePath=
{
stringSplit
(
fileInfo
.
url
,
'
m
/
cash
')}
/>
/>
)
)
...
...
src/pages/ContractManagement/ContractDetail.tsx
View file @
2e1f9cf7
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
styles
from
'./ContractContent.less'
;
import
styles
from
'./ContractContent.less'
;
import
{
Input
,
Form
,
message
,
Upload
,
DatePicker
,
Pagination
,
Modal
,
Spin
,
Image
}
from
'antd'
;
import
{
Input
,
Form
,
message
,
Upload
,
DatePicker
,
Pagination
,
Modal
,
Spin
,
Image
}
from
'antd'
;
import
{
LeftOutlined
}
from
'@ant-design/icons'
;
import
{
LeftOutlined
,
LoadingOutlined
}
from
'@ant-design/icons'
;
import
{
connect
,
history
}
from
'umi'
;
import
{
connect
,
history
}
from
'umi'
;
import
LINE
from
'../../components/Line/Line'
;
import
LINE
from
'../../components/Line/Line'
;
const
{
TextArea
}
=
Input
;
import
{
Document
,
Page
}
from
'react-pdf'
;
import
{
pdfjs
}
from
'react-pdf'
;
import
PDF
from
'react-pdf-js'
;
pdfjs
.
GlobalWorkerOptions
.
workerSrc
=
`//cdnjs.cloudflare.com/ajax/libs/pdf.js/
${
pdfjs
.
version
}
/pdf.worker.min.js`
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
'./ContractContent.less'
;
import
'./ContractContent.less'
;
...
@@ -64,14 +64,14 @@ const ContractContent = (props: any) => {
...
@@ -64,14 +64,14 @@ const ContractContent = (props: any) => {
setUploadUp
(
false
);
setUploadUp
(
false
);
// 提示时间
// 提示时间
// 提示时间
//
//
提示时间
let
a1
=
timeOver
(
DataSaveDetail
.
contractValidEndDate
,
2
);
//
let a1 = timeOver(DataSaveDetail.contractValidEndDate, 2);
let
a2
=
timeOver
(
DataSaveDetail
.
contractValidEndDate
,
1
);
//
let a2 = timeOver(DataSaveDetail.contractValidEndDate, 1);
let
a3
=
timeOver
(
DataSaveDetail
.
contractValidEndDate
,
3
);
//
let a3 = timeOver(DataSaveDetail.contractValidEndDate, 3);
// setTipTime([a1, a2]);
//
//
setTipTime([a1, a2]);
setTipTime
([
a3
,
a1
,
a2
]);
//
setTipTime([a3, a1, a2]);
// 给到上传绑定
// 给到上传绑定
setComtyName
(
DataSaveDetail
.
communityName
);
setComtyName
(
DataSaveDetail
.
communityName
);
...
@@ -83,6 +83,12 @@ const ContractContent = (props: any) => {
...
@@ -83,6 +83,12 @@ const ContractContent = (props: any) => {
moment
(
DataSaveDetail
.
contractValidStartDate
),
moment
(
DataSaveDetail
.
contractValidStartDate
),
moment
(
DataSaveDetail
.
contractValidEndDate
),
moment
(
DataSaveDetail
.
contractValidEndDate
),
],
],
// 执照起止时间
license
:
[
moment
(
DataSaveDetail
.
licenseStartTime
),
moment
(
DataSaveDetail
.
licenseEndTime
)],
lnsurancePolicy
:
[
moment
(
DataSaveDetail
.
lnsurancePolicyStartTime
),
moment
(
DataSaveDetail
.
lnsurancePolicyEndTime
),
],
});
});
}
}
},
[
DataSaveDetail
]);
},
[
DataSaveDetail
]);
...
@@ -172,8 +178,8 @@ const ContractContent = (props: any) => {
...
@@ -172,8 +178,8 @@ const ContractContent = (props: any) => {
setPreviewVisible
(
true
);
// 弹窗
setPreviewVisible
(
true
);
// 弹窗
setimgInfo
(
info
);
// 图片信息
setimgInfo
(
info
);
// 图片信息
}
else
{
}
else
{
setfileInfo
(
file
);
// 设置选择的文件
setfileInfo
(
{
...
file
}
);
// 设置选择的文件
console
.
log
(
file
);
//
console.log(file);
settipModal
(
true
);
settipModal
(
true
);
}
}
};
};
...
@@ -183,16 +189,25 @@ const ContractContent = (props: any) => {
...
@@ -183,16 +189,25 @@ const ContractContent = (props: any) => {
settipModal
(
false
);
settipModal
(
false
);
};
};
// pdf 总页数
const
onDocumentLoadSuccess
=
(
pages
:
any
)
=>
{
setNumPages
(
pages
);
};
// 切换pdf 总数
// 切换pdf 总数
const
onChangePage
=
(
page
:
any
)
=>
{
const
onChangePage
=
(
page
:
any
)
=>
{
setPageNumber
(
page
);
setPageNumber
(
page
);
};
};
// 文件失效
const
onError
=
()
=>
{
message
.
error
(
'file error !'
);
settipModal
(
false
);
};
// pdf 总页数
const
onDocumentLoadSuccess
=
({
numPages
}:
any
)
=>
{
//numPages是总页数
setNumPages
(
numPages
);
};
// const temp = require('@/assets/d1.pdf');
return
(
return
(
<>
<>
<
Spin
spinning=
{
loading
}
>
<
Spin
spinning=
{
loading
}
>
...
@@ -214,7 +229,7 @@ const ContractContent = (props: any) => {
...
@@ -214,7 +229,7 @@ const ContractContent = (props: any) => {
initialValues=
{
DataSaveDetail
}
initialValues=
{
DataSaveDetail
}
>
>
<
div
className=
"contract_box"
>
<
div
className=
"contract_box"
>
<
div
className=
"list2"
>
{
/*
<div className="list2">
<Form.Item
<Form.Item
name="contractNumber"
name="contractNumber"
label="Contract Number"
label="Contract Number"
...
@@ -222,7 +237,7 @@ const ContractContent = (props: any) => {
...
@@ -222,7 +237,7 @@ const ContractContent = (props: any) => {
>
>
<Input style={{ width: 200 }} disabled placeholder="Contract Number" />
<Input style={{ width: 200 }} disabled placeholder="Contract Number" />
</Form.Item>
</Form.Item>
</
div
>
</div>
*/
}
{
/* 合同编号、甲方、乙方 */
}
{
/* 合同编号、甲方、乙方 */
}
<
div
className=
"list_1"
>
<
div
className=
"list_1"
>
<
div
className=
"item_1"
>
<
div
className=
"item_1"
>
...
@@ -241,7 +256,7 @@ const ContractContent = (props: any) => {
...
@@ -241,7 +256,7 @@ const ContractContent = (props: any) => {
<
Form
.
Item
<
Form
.
Item
labelAlign=
"right"
labelAlign=
"right"
name=
"communityName"
name=
"communityName"
label=
"
Community
Name"
label=
"
Estate
Name"
rules=
{
[{
required
:
true
,
message
:
`${tipList[3]}`
}]
}
rules=
{
[{
required
:
true
,
message
:
`${tipList[3]}`
}]
}
>
>
<
SearchOptionsCommnity
<
SearchOptionsCommnity
...
@@ -268,13 +283,13 @@ const ContractContent = (props: any) => {
...
@@ -268,13 +283,13 @@ const ContractContent = (props: any) => {
<
Form
.
Item
<
Form
.
Item
name=
"time"
name=
"time"
labelAlign=
"right"
labelAlign=
"right"
label=
"Contract
Time
"
label=
"Contract
Duration
"
rules=
{
[{
required
:
true
,
message
:
`${tipList[5]}`
}]
}
rules=
{
[{
required
:
true
,
message
:
`${tipList[5]}`
}]
}
>
>
<
RangePicker
<
RangePicker
defaultValue=
{
DataSaveDetail
?
DataSaveDetail
.
time
:
null
}
defaultValue=
{
DataSaveDetail
?
DataSaveDetail
.
time
:
null
}
disabledDate=
{
disabledDate
}
disabledDate=
{
disabledDate
}
placeholder=
{
[
'Effective Date'
,
'Expir
ation
Date'
]
}
placeholder=
{
[
'Effective Date'
,
'Expir
y
Date'
]
}
disabled
disabled
/>
/>
</
Form
.
Item
>
</
Form
.
Item
>
...
@@ -297,39 +312,65 @@ const ContractContent = (props: any) => {
...
@@ -297,39 +312,65 @@ const ContractContent = (props: any) => {
</
Form
.
Item
>
</
Form
.
Item
>
</
div
>
</
div
>
{
/* 合同内容 */
}
{
/* --------------------------4.21新增------------------------- */
}
{
/* 许可证编号 */
}
<
div
className=
"list2"
>
<
div
className=
"list2"
>
<
div
className=
{
styles
.
box8item2x1
}
>
<
Form
.
Item
<
Form
.
Item
rules=
{
[{
required
:
true
,
message
:
`${tipList[5]}`
}]
}
labelAlign=
"right"
label=
"Contract Remarks"
name=
"licenseNo"
name=
"contractRemindContent"
label=
"License No"
style=
{
{
marginBottom
:
0
}
}
rules=
{
tipList
[
4
]
}
>
<
Input
style=
{
{
width
:
500
}
}
placeholder=
"License No"
disabled
/>
</
Form
.
Item
>
</
div
>
{
/* 许可证编号起止时间 */
}
<
div
className=
"list2"
>
<
Form
.
Item
name=
"license"
labelAlign=
"right"
label=
"License Duration"
rules=
{
tipList
[
5
]
}
>
>
<
TextArea
<
RangePicker
style=
{
{
padding
:
8
,
width
:
600
}
}
defaultValue=
{
DataSaveDetail
?
DataSaveDetail
.
time
:
null
}
placeholder=
"Remarks"
// disabledDate={disabledDate} // 时间限制
showCount=
{
true
}
placeholder=
{
[
'Effective Date'
,
'Expiry Date'
]
}
// onChange={changeTime}
disabled
disabled
autoSize=
{
{
minRows
:
6
,
maxRows
:
6
}
}
/>
></
TextArea
>
</
Form
.
Item
>
</
Form
.
Item
>
</
div
>
</
div
>
<
div
className=
{
styles
.
box8item2x2
}
{
/* 保险编号 */
}
style=
{
{
marginLeft
:
150
,
textTransform
:
'capitalize'
}
}
<
div
className=
"list2"
>
<
Form
.
Item
labelAlign=
"right"
name=
"lnsurancePolicyNo"
label=
"lnsurance Policy No"
rules=
{
tipList
[
4
]
}
>
>
<
p
style=
{
{
marginBottom
:
0
}
}
>
<
Input
style=
{
{
width
:
500
}
}
placeholder=
"lnsurance Policy No"
disabled
/>
The system will send email on
<
span
style=
{
{
color
:
'red'
}
}
>
{
tipTime
[
0
]
}
</
span
>
{
' '
}
</
Form
.
Item
>
,
<
span
style=
{
{
color
:
'red'
}
}
>
{
tipTime
[
1
]
}
</
span
>
and
{
' '
}
<
span
style=
{
{
color
:
'red'
}
}
>
{
tipTime
[
2
]
}
</
span
>
before the contract is about
to expire!
</
p
>
<
p
style=
{
{
marginBottom
:
0
}
}
>
<
span
style=
{
{
color
:
'red'
}
}
>
*
</
span
>
If the time has passed, it will not be
sent
</
p
>
</
div
>
</
div
>
{
/* 保险编号起止时间 */
}
<
div
className=
"list2"
>
<
Form
.
Item
name=
"lnsurancePolicy"
labelAlign=
"right"
label=
"Policy Tenure"
rules=
{
tipList
[
5
]
}
>
<
RangePicker
defaultValue=
{
DataSaveDetail
?
DataSaveDetail
.
time
:
null
}
// disabledDate={disabledDate} // 时间限制
placeholder=
{
[
'Effective Date'
,
'Expiry Date'
]
}
// onChange={changeTime}
disabled
/>
</
Form
.
Item
>
</
div
>
</
div
>
<
div
>
<
div
>
...
@@ -346,17 +387,25 @@ const ContractContent = (props: any) => {
...
@@ -346,17 +387,25 @@ const ContractContent = (props: any) => {
onCancel=
{
handleCancel
}
onCancel=
{
handleCancel
}
style=
{
{
textAlign
:
'center'
}
}
style=
{
{
textAlign
:
'center'
}
}
footer=
{
null
}
footer=
{
null
}
forceRender=
{
true
}
>
>
{
fileInfo
!=
null
?
(
{
fileInfo
!=
null
?
(
fileInfo
.
type
==
'pdf'
?
(
fileInfo
.
type
==
'pdf'
?
(
// pdf 换一种
// pdf 换一种
<>
<>
<
PDF
<
Document
file=
{
fileInfo
.
url
}
file=
{
fileInfo
.
url
}
//文件路径
page=
{
pageNumber
}
onLoadSuccess=
{
onDocumentLoadSuccess
}
//成功加载文档后调用
// onLoadError=
{
console
.
error
}
//加载失败时调用
loading=
{
<
Spin
indicator=
{
<
LoadingOutlined
spin
/>
}
/>
}
//加载时提示语句
onLoadError=
{
onError
}
>
<
Page
key=
{
fileInfo
.
id
}
pageNumber=
{
pageNumber
}
//当前页页码
scale=
{
1.25
}
scale=
{
1.25
}
onDocumentComplete=
{
onDocumentLoadSuccess
}
/>
/>
</
Document
>
<
Pagination
<
Pagination
style=
{
{
textAlign
:
'center'
,
marginTop
:
10
,
display
:
'block'
}
}
style=
{
{
textAlign
:
'center'
,
marginTop
:
10
,
display
:
'block'
}
}
simple
simple
...
@@ -374,7 +423,12 @@ const ContractContent = (props: any) => {
...
@@ -374,7 +423,12 @@ const ContractContent = (props: any) => {
style=
{
{
margin
:
'0 auto'
,
textAlign
:
'center'
}
}
style=
{
{
margin
:
'0 auto'
,
textAlign
:
'center'
}
}
/>
/>
)
:
(
)
:
(
<
FileViewer
fileType=
{
fileInfo
.
type
}
filePath=
{
fileInfo
.
url
}
/>
<
FileViewer
key=
{
fileInfo
.
url
}
fileType=
{
fileInfo
.
type
}
filePath=
{
fileInfo
.
url
}
onError=
{
onError
}
/>
)
)
)
:
(
)
:
(
''
''
...
...
src/pages/OrderManagement/Order.tsx
View file @
2e1f9cf7
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Input
,
Tabs
,
Table
,
Space
,
Button
}
from
'antd'
;
import
{
Input
,
Tabs
,
Table
,
Space
,
Button
}
from
'antd'
;
const
{
TabPane
}
=
Tabs
;
const
{
TabPane
}
=
Tabs
;
import
{
connect
,
history
}
from
'umi'
;
import
{
connect
,
history
}
from
'umi'
;
const
orderStatus
=
[[
0
,
"已发单"
],
[
1
,
"待上门"
],
[
2
,
"进行中"
],
[
3
,
"已完成"
],
[
4
,
"已取消"
]]
const
orderStatus
=
[
const
goToDetail
=
()
=>
{
[
0
,
'已发单'
],
[
1
,
'待上门'
],
}
[
2
,
'进行中'
],
[
3
,
'已完成'
],
[
4
,
'已取消'
],
];
const
goToDetail
=
()
=>
{};
const
columns
=
objectColumns
([
const
columns
=
objectColumns
([
[
"OrderNumber"
,
"orderNumber"
],
[
'OrderNumber'
,
'orderNumber'
],
[
"Community"
,
"communityName"
],
[
'Estate'
,
'communityName'
],
[
"Owner Name"
,
"ownerName"
],
[
'Owner Name'
,
'ownerName'
],
[
"type"
,
null
,
(
text
:
any
,
record
:
any
)
=>
(<
div
>
{
orderStatus
[
record
.
orderStatus
][
1
]
}
</
div
>)],
[
'type'
,
null
,
(
text
:
any
,
record
:
any
)
=>
<
div
>
{
orderStatus
[
record
.
orderStatus
][
1
]
}
</
div
>],
[
"Content"
,
"serviceContent"
],
[
'Content'
,
'serviceContent'
],
[
"Order Time"
,
null
,
(
text
:
any
,
record
:
any
)
=>
(<
div
>
{
getStringToTime
(
record
.
orderSendTime
)
}
</
div
>)],
[
[
"Booking Time"
,
null
,
(
text
:
any
,
record
:
any
)
=>
(<
div
>
{
getStringToTime
(
record
.
orderReserveTime
)
}
</
div
>)],
'Order Time'
,
[
"Actions"
,
null
,
(
text
:
any
,
record
:
any
)
=>
(<
Space
size=
"middle"
>
<
a
onClick=
{
goToDetail
.
bind
(
this
,
record
)
}
>
Detail
</
a
></
Space
>)],
null
,
])
(
text
:
any
,
record
:
any
)
=>
<
div
>
{
getStringToTime
(
record
.
orderSendTime
)
}
</
div
>,
],
[
'Booking Time'
,
null
,
(
text
:
any
,
record
:
any
)
=>
<
div
>
{
getStringToTime
(
record
.
orderReserveTime
)
}
</
div
>,
],
[
'Actions'
,
null
,
(
text
:
any
,
record
:
any
)
=>
(
<
Space
size=
"middle"
>
{
' '
}
<
a
onClick=
{
goToDetail
.
bind
(
this
,
record
)
}
>
Detail
</
a
>
</
Space
>
),
],
]);
import
{
RA
}
from
'@/utils/method'
;
import
{
RA
}
from
'@/utils/method'
;
import
{
objectColumns
}
from
'@/utils/string'
;
import
{
objectColumns
}
from
'@/utils/string'
;
import
TitleSearch
from
'@/components/TitleSearch/TitleSearch'
;
import
TitleSearch
from
'@/components/TitleSearch/TitleSearch'
;
import
{
timestampToTime
,
getStringToTime
}
from
'@/utils/time'
;
import
{
timestampToTime
,
getStringToTime
}
from
'@/utils/time'
;
const
module
=
'OrderManagement'
;
const
module
=
"OrderManagement"
const
Order
=
(
props
:
any
)
=>
{
const
Order
=
(
props
:
any
)
=>
{
const
{
dispatch
,
Data
}
=
props
;
const
{
dispatch
,
Data
}
=
props
;
const
formRef
=
useRef
(
null
)
const
formRef
=
useRef
(
null
)
;
useEffect
(()
=>
{
useEffect
(()
=>
{
RA
(
30
,
{
orderNumber
:
""
,
serviceType
:
"0"
},
module
,
dispatch
)
RA
(
30
,
{
orderNumber
:
''
,
serviceType
:
'0'
},
module
,
dispatch
);
},
[])
},
[])
;
// useEffect(() => {
// useEffect(() => {
// if (Data != null) {
// if (Data != null) {
// console.log("首页信息")
// console.log("首页信息")
...
@@ -41,39 +60,42 @@ const Order = (props:any) => {
...
@@ -41,39 +60,42 @@ const Order = (props:any) => {
// },[Data])
// },[Data])
const
CallBackTitleSearch
=
(
value
:
any
)
=>
{
const
CallBackTitleSearch
=
(
value
:
any
)
=>
{
if
(
value
.
orderNumber
!=
null
||
value
.
serviceType
!=
null
)
{
if
(
value
.
orderNumber
!=
null
||
value
.
serviceType
!=
null
)
{
RA
(
30
,
value
,
module
,
dispatch
)
RA
(
30
,
value
,
module
,
dispatch
);
}
}
}
};
return
(
return
(
<
div
style=
{
{
width
:
"100%"
,
minWidth
:
1020
,
padding
:
34
,
backgroundColor
:
"#ffffff"
}
}
>
<
div
style=
{
{
width
:
'100%'
,
minWidth
:
1020
,
padding
:
34
,
backgroundColor
:
'#ffffff'
}
}
>
{
Data
!=
null
?
(
{
<>
Data
!=
null
?
<>
<
TitleSearch
<
TitleSearch
status=
{
[{
status=
{
[
name
:
[
"serviceType"
,
"订单状态"
],
{
data
:
orderStatus
name
:
[
'serviceType'
,
'订单状态'
],
}]
}
data
:
orderStatus
,
},
]
}
listkey=
{
[
'orderNumber'
]
}
listkey=
{
[
'orderNumber'
]
}
list=
{
[
'订单号'
]
}
list=
{
[
'订单号'
]
}
onSubmit=
{
CallBackTitleSearch
}
onSubmit=
{
CallBackTitleSearch
}
></
TitleSearch
>
></
TitleSearch
>
<
Table
loading=
{
false
}
rowKey=
"id"
style=
{
{
marginTop
:
16
}
}
<
Table
loading=
{
false
}
rowKey=
"id"
style=
{
{
marginTop
:
16
}
}
dataSource=
{
Data
.
data
.
rows
}
dataSource=
{
Data
.
data
.
rows
}
columns=
{
columns
}
columns=
{
columns
}
pagination=
{
{
current
:
1
,
total
:
Data
.
total
}
}
/>
pagination=
{
{
current
:
1
,
total
:
Data
.
total
}
}
/>
</>:
null
</>
}
)
:
null
}
</
div
>
</
div
>
);
);
};
};
function
map
(
state
:
any
)
{
function
map
(
state
:
any
)
{
const
{
Data
}
=
state
[
module
]
const
{
Data
}
=
state
[
module
];
return
{
Data
}
return
{
Data
};
}
}
export
default
connect
(
map
)(
Order
);
export
default
connect
(
map
)(
Order
);
...
...
src/pages/OrderManagement/OrderManagement.tsx
View file @
2e1f9cf7
import
React
from
'react'
;
import
React
from
'react'
;
import
{
connect
,
routerRedux
}
from
'dva'
;
import
{
connect
,
routerRedux
}
from
'dva'
;
import
{
Table
,
Button
,
Input
,
Select
,
Modal
,
Tooltip
,
Upload
,
Icon
,
Checkbox
,
Row
,
Radio
,
Tag
}
from
"antd"
;
import
{
Table
,
Button
,
Input
,
Select
,
Modal
,
Tooltip
,
Upload
,
Icon
,
Checkbox
,
Row
,
Radio
,
Tag
,
}
from
'antd'
;
import
styles
from
'./style.less'
;
import
styles
from
'./style.less'
;
import
{
ConnectState
}
from
"@/models/connect"
;
import
{
ConnectState
}
from
'@/models/connect'
;
// import XLSX from "@/pages/account/xlsx.core.min";
// import XLSX from "@/pages/account/xlsx.core.min";
import
{
router
}
from
"umi"
;
import
{
router
}
from
'umi'
;
import
CheckGroup
from
'./CheckGroup'
;
import
CheckGroup
from
'./CheckGroup'
;
import
zhCN
from
'ant-design-vue/es/locale-provider/zh_CN'
;
import
zhCN
from
'ant-design-vue/es/locale-provider/zh_CN'
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
'moment/locale/zh-cn'
;
import
'moment/locale/zh-cn'
;
class
OrderManagement
extends
React
.
Component
{
class
OrderManagement
extends
React
.
Component
{
//构造
//构造
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
...
@@ -26,11 +37,15 @@ class OrderManagement extends React.Component {
...
@@ -26,11 +37,15 @@ class OrderManagement extends React.Component {
name
:
''
,
name
:
''
,
model
:
''
,
model
:
''
,
status
:
undefined
,
status
:
undefined
,
statusList
:
[{
label
:
"在线"
,
value
:
"1"
},
{
label
:
"故障"
,
value
:
"3"
},{
label
:
"未激活"
,
value
:
"4"
}],
statusList
:
[
{
label
:
'在线'
,
value
:
'1'
},
{
label
:
'故障'
,
value
:
'3'
},
{
label
:
'未激活'
,
value
:
'4'
},
],
provinceList
:
[],
provinceList
:
[],
cityList
:
[{
name
:
"未选择省"
}],
cityList
:
[{
name
:
'未选择省'
}],
districtList
:
[{
name
:
"未选择市"
}],
districtList
:
[{
name
:
'未选择市'
}],
streetList
:
[{
name
:
"未选择区"
}],
streetList
:
[{
name
:
'未选择区'
}],
delData
:
[],
delData
:
[],
visible
:
false
,
visible
:
false
,
deviceStatus
:
''
,
deviceStatus
:
''
,
...
@@ -39,147 +54,150 @@ class OrderManagement extends React.Component {
...
@@ -39,147 +54,150 @@ class OrderManagement extends React.Component {
used
:
null
,
used
:
null
,
newAdd
:
null
,
newAdd
:
null
,
strList
:
[],
strList
:
[],
newList
:[],
newList
:
[],
authorityList
:[
authorityList
:
[
{
{
"children"
:
[
children
:
[
{
{
"children"
:
[],
children
:
[],
"hasChildren"
:
false
,
hasChildren
:
false
,
"is_admin"
:
1
,
is_admin
:
1
,
"menuid"
:
5
,
menuid
:
5
,
"name"
:
"组织架构"
,
name
:
'组织架构'
,
"parentid"
:
1
,
parentid
:
1
,
"sort"
:
10
,
sort
:
10
,
"state"
:
""
,
state
:
''
,
"is_checked"
:
true
is_checked
:
true
,
},
},
{
{
"children"
:
[],
children
:
[],
"hasChildren"
:
false
,
hasChildren
:
false
,
"is_admin"
:
1
,
is_admin
:
1
,
"menuid"
:
6
,
menuid
:
6
,
"name"
:
"员工管理"
,
name
:
'员工管理'
,
"parentid"
:
1
,
parentid
:
1
,
"sort"
:
20
,
sort
:
20
,
"state"
:
""
,
state
:
''
,
"is_checked"
:
true
is_checked
:
true
,
},
},
{
{
"children"
:
[],
children
:
[],
"hasChildren"
:
false
,
hasChildren
:
false
,
"is_admin"
:
1
,
is_admin
:
1
,
"menuid"
:
11
,
menuid
:
11
,
"name"
:
"角色管理"
,
name
:
'角色管理'
,
"parentid"
:
1
,
parentid
:
1
,
"sort"
:
30
,
sort
:
30
,
"state"
:
""
,
state
:
''
,
"is_checked"
:
false
is_checked
:
false
,
},
},
{
{
"children"
:
[],
children
:
[],
"hasChildren"
:
false
,
hasChildren
:
false
,
"is_admin"
:
1
,
is_admin
:
1
,
"menuid"
:
17
,
menuid
:
17
,
"name"
:
"企业设置"
,
name
:
'企业设置'
,
"parentid"
:
1
,
parentid
:
1
,
"sort"
:
2
,
sort
:
2
,
"state"
:
""
,
state
:
''
,
"is_checked"
:
true
is_checked
:
true
,
},
},
{
{
"children"
:
[],
children
:
[],
"hasChildren"
:
false
,
hasChildren
:
false
,
"is_admin"
:
1
,
is_admin
:
1
,
"menuid"
:
26
,
menuid
:
26
,
"name"
:
"员工管理"
,
name
:
'员工管理'
,
"parentid"
:
1
,
parentid
:
1
,
"sort"
:
1
,
sort
:
1
,
"state"
:
""
,
state
:
''
,
"is_checked"
:
false
is_checked
:
false
,
}
}
,
],
],
"hasChildren"
:
true
,
hasChildren
:
true
,
"is_admin"
:
1
,
is_admin
:
1
,
"menuid"
:
1
,
menuid
:
1
,
"name"
:
"企业"
,
name
:
'企业'
,
"parentid"
:
0
,
parentid
:
0
,
"sort"
:
20
,
sort
:
20
,
"state"
:
"closed"
,
state
:
'closed'
,
"is_checked"
:
true
is_checked
:
true
,
},
},
{
{
"children"
:
[
children
:
[
{
{
"children"
:
[],
children
:
[],
"hasChildren"
:
false
,
hasChildren
:
false
,
"is_admin"
:
1
,
is_admin
:
1
,
"menuid"
:
12
,
menuid
:
12
,
"name"
:
"供应商订单"
,
name
:
'供应商订单'
,
"parentid"
:
4
,
parentid
:
4
,
"sort"
:
10
,
sort
:
10
,
"state"
:
""
,
state
:
''
,
"is_checked"
:
true
is_checked
:
true
,
},
},
{
{
"children"
:
[],
children
:
[],
"hasChildren"
:
false
,
hasChildren
:
false
,
"is_admin"
:
1
,
is_admin
:
1
,
"menuid"
:
15
,
menuid
:
15
,
"name"
:
"供应商管理"
,
name
:
'供应商管理'
,
"parentid"
:
4
,
parentid
:
4
,
"sort"
:
20
,
sort
:
20
,
"state"
:
""
,
state
:
''
,
"is_checked"
:
false
is_checked
:
false
,
},
},
{
{
"children"
:
[],
children
:
[],
"hasChildren"
:
false
,
hasChildren
:
false
,
"is_admin"
:
1
,
is_admin
:
1
,
"menuid"
:
16
,
menuid
:
16
,
"name"
:
"成为供应商"
,
name
:
'成为供应商'
,
"parentid"
:
4
,
parentid
:
4
,
"sort"
:
30
,
sort
:
30
,
"state"
:
""
,
state
:
''
,
"is_checked"
:
true
is_checked
:
true
,
}
}
,
],
],
"hasChildren"
:
true
,
hasChildren
:
true
,
"is_admin"
:
1
,
is_admin
:
1
,
"menuid"
:
4
,
menuid
:
4
,
"name"
:
"供应商"
,
name
:
'供应商'
,
"parentid"
:
0
,
parentid
:
0
,
"sort"
:
11
,
sort
:
11
,
"state"
:
"closed"
,
state
:
'closed'
,
"is_checked"
:
true
is_checked
:
true
,
}
}
,
],
],
}
}
;
}
}
/*----------------- 方法集 ------------------*/
/*----------------- 方法集 ------------------*/
//重置
//重置
reset
=
()
=>
{
reset
=
()
=>
{
this
.
setState
({
this
.
setState
(
{
province
:
undefined
,
province
:
undefined
,
city
:
undefined
,
city
:
undefined
,
district
:
undefined
,
district
:
undefined
,
street
:
undefined
,
street
:
undefined
,
status
:
undefined
,
status
:
undefined
,
name
:
''
,
name
:
''
,
},()
=>
{
},
()
=>
{
this
.
getDevice
();
this
.
getDevice
();
});
},
);
};
};
//模态框相关
//模态框相关
showModal
=
()
=>
{
showModal
=
()
=>
{
let
flag
=
0
;
let
flag
=
0
;
const
nowUser
=
this
.
props
.
currentUser
;
const
nowUser
=
this
.
props
.
currentUser
;
if
(
nowUser
.
permission
!=
null
)
{
if
(
nowUser
.
permission
!=
null
)
{
for
(
let
i
=
0
;
i
<
nowUser
.
permission
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
nowUser
.
permission
.
length
;
i
++
)
{
if
(
nowUser
.
permission
[
i
]
==
"4"
)
{
if
(
nowUser
.
permission
[
i
]
==
'4'
)
{
if
(
this
.
state
.
delData
==
null
||
this
.
state
.
delData
.
length
<=
0
)
{
if
(
this
.
state
.
delData
==
null
||
this
.
state
.
delData
.
length
<=
0
)
{
alert
(
"未选中删除项!"
);
alert
(
'未选中删除项!'
);
return
;
return
;
}
}
flag
=
1
;
flag
=
1
;
...
@@ -188,12 +206,12 @@ class OrderManagement extends React.Component {
...
@@ -188,12 +206,12 @@ class OrderManagement extends React.Component {
});
});
}
}
}
}
}
else
{
}
else
{
//alert("找不到用户权限记录!");
//alert("找不到用户权限记录!");
//return;;
//return;;
}
}
if
(
flag
==
0
)
{
if
(
flag
==
0
)
{
alert
(
"缺少设备删除权限!"
);
alert
(
'缺少设备删除权限!'
);
}
}
};
};
handleOk
=
()
=>
{
handleOk
=
()
=>
{
...
@@ -218,30 +236,29 @@ class OrderManagement extends React.Component {
...
@@ -218,30 +236,29 @@ class OrderManagement extends React.Component {
model
:
this
.
state
.
model
,
model
:
this
.
state
.
model
,
status
:
this
.
state
.
status
,
status
:
this
.
state
.
status
,
id
:
this
.
props
.
currentUser
.
userid
,
id
:
this
.
props
.
currentUser
.
userid
,
userPhone
:
"18813787835"
userPhone
:
'18813787835'
,
};
};
this
.
props
.
dispatch
({
this
.
props
.
dispatch
({
type
:
'orderManagementModel/getOrder'
,
type
:
'orderManagementModel/getOrder'
,
payload
:
params
,
payload
:
params
,
callback
:
(
res
)
=>
{
callback
:
(
res
)
=>
{
if
(
res
)
{
if
(
res
)
{
/*this.setState({
/*this.setState({
data: res.rows,
data: res.rows,
total: res.total,
total: res.total,
})*/
})*/
if
(
res
.
error_code
==
"0000"
)
{
if
(
res
.
error_code
==
'0000'
)
{
this
.
setState
({
this
.
setState
({
data
:
res
.
data
.
rows
,
data
:
res
.
data
.
rows
,
total
:
res
.
data
.
total
,
total
:
res
.
data
.
total
,
})
})
;
}
}
if
(
res
.
error_code
==
"0001"
)
{
if
(
res
.
error_code
==
'0001'
)
{
alert
(
res
.
error_msg
);
alert
(
res
.
error_msg
);
}
else
if
(
res
.
error_code
==
"0002"
)
{
}
else
if
(
res
.
error_code
==
'0002'
)
{
alert
(
res
.
error_msg
);
alert
(
res
.
error_msg
);
}
else
if
(
res
.
error_code
==
"0008"
)
{
}
else
if
(
res
.
error_code
==
'0008'
)
{
alert
(
res
.
error_msg
);
alert
(
res
.
error_msg
);
window
.
location
.
href
=
'/'
;
window
.
location
.
href
=
'/'
;
router
.
replace
(
'/'
);
router
.
replace
(
'/'
);
...
@@ -250,44 +267,48 @@ class OrderManagement extends React.Component {
...
@@ -250,44 +267,48 @@ class OrderManagement extends React.Component {
// alert("Tos查询出错!未知错误!");
// alert("Tos查询出错!未知错误!");
// }
// }
}
}
}
}
,
});
});
};
};
//跳转到编辑页面
//跳转到编辑页面
edit
=
(
params
)
=>
{
edit
=
(
params
)
=>
{
let
flag
=
0
;
let
flag
=
0
;
const
nowUser
=
this
.
props
.
currentUser
;
const
nowUser
=
this
.
props
.
currentUser
;
if
(
nowUser
.
permission
!=
null
)
{
if
(
nowUser
.
permission
!=
null
)
{
if
(
params
==
null
)
{
if
(
params
==
null
)
{
for
(
let
i
=
0
;
i
<
nowUser
.
permission
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
nowUser
.
permission
.
length
;
i
++
)
{
if
(
nowUser
.
permission
[
i
]
==
"3"
)
{
if
(
nowUser
.
permission
[
i
]
==
'3'
)
{
flag
=
1
;
flag
=
1
;
this
.
props
.
dispatch
(
routerRedux
.
push
({
this
.
props
.
dispatch
(
routerRedux
.
push
({
pathname
:
'tosUser/create'
,
pathname
:
'tosUser/create'
,
query
:
params
,
query
:
params
,
}))
}),
);
}
}
}
}
}
else
{
}
else
{
for
(
let
i
=
0
;
i
<
nowUser
.
permission
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
nowUser
.
permission
.
length
;
i
++
)
{
if
(
nowUser
.
permission
[
i
]
==
"2"
)
{
if
(
nowUser
.
permission
[
i
]
==
'2'
)
{
flag
=
1
;
flag
=
1
;
this
.
props
.
dispatch
(
routerRedux
.
push
({
this
.
props
.
dispatch
(
routerRedux
.
push
({
pathname
:
'/tosUser/edit'
,
pathname
:
'/tosUser/edit'
,
query
:
params
,
query
:
params
,
}))
}),
);
}
}
}
}
}
}
}
else
{
}
else
{
//alert("找不到用户权限记录!");
//alert("找不到用户权限记录!");
//return;;
//return;;
}
}
if
(
flag
==
0
)
{
if
(
flag
==
0
)
{
if
(
params
==
null
)
{
if
(
params
==
null
)
{
alert
(
"缺少设备添加权限!"
);
alert
(
'缺少设备添加权限!'
);
}
else
{
}
else
{
alert
(
"缺少设备修改权限!"
);
alert
(
'缺少设备修改权限!'
);
}
}
}
}
};
};
...
@@ -296,87 +317,93 @@ class OrderManagement extends React.Component {
...
@@ -296,87 +317,93 @@ class OrderManagement extends React.Component {
edit2
=
(
params
)
=>
{
edit2
=
(
params
)
=>
{
let
flag
=
0
;
let
flag
=
0
;
const
nowUser
=
this
.
props
.
currentUser
;
const
nowUser
=
this
.
props
.
currentUser
;
if
(
nowUser
.
permission
!=
null
)
{
if
(
nowUser
.
permission
!=
null
)
{
if
(
params
==
null
)
{
if
(
params
==
null
)
{
for
(
let
i
=
0
;
i
<
nowUser
.
permission
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
nowUser
.
permission
.
length
;
i
++
)
{
if
(
nowUser
.
permission
[
i
]
==
"3"
)
{
if
(
nowUser
.
permission
[
i
]
==
'3'
)
{
flag
=
1
;
flag
=
1
;
this
.
props
.
dispatch
(
routerRedux
.
push
({
this
.
props
.
dispatch
(
routerRedux
.
push
({
pathname
:
'tosUser/edit'
,
pathname
:
'tosUser/edit'
,
query
:
params
,
query
:
params
,
}))
}),
);
}
}
}
}
}
else
{
}
else
{
for
(
let
i
=
0
;
i
<
nowUser
.
permission
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
nowUser
.
permission
.
length
;
i
++
)
{
if
(
nowUser
.
permission
[
i
]
==
"2"
)
{
if
(
nowUser
.
permission
[
i
]
==
'2'
)
{
flag
=
1
;
flag
=
1
;
this
.
props
.
dispatch
(
routerRedux
.
push
({
this
.
props
.
dispatch
(
routerRedux
.
push
({
pathname
:
'/tosUser/edit'
,
pathname
:
'/tosUser/edit'
,
query
:
params
,
query
:
params
,
}))
}),
);
}
}
}
}
}
}
}
else
{
}
else
{
//alert("找不到用户权限记录!");
//alert("找不到用户权限记录!");
//return;;
//return;;
}
}
if
(
flag
==
0
)
{
if
(
flag
==
0
)
{
if
(
params
==
null
)
{
if
(
params
==
null
)
{
alert
(
"缺少设备添加权限!"
);
alert
(
'缺少设备添加权限!'
);
}
else
{
}
else
{
alert
(
"缺少设备修改权限!"
);
alert
(
'缺少设备修改权限!'
);
}
}
}
}
};
};
//跳转到详情页面
//跳转到详情页面
details
=
(
params
)
=>
{
details
=
(
params
)
=>
{
this
.
props
.
dispatch
(
routerRedux
.
push
({
this
.
props
.
dispatch
(
routerRedux
.
push
({
pathname
:
'/orderManagement/Detail'
,
pathname
:
'/orderManagement/Detail'
,
query
:
params
,
query
:
params
,
}))
}),
);
};
};
//设备状态变更
//设备状态变更
statusChange
=
(
e
)
=>
{
statusChange
=
(
e
)
=>
{
this
.
setState
({
status
:
e
==
undefined
?
undefined
:
e
});
this
.
setState
({
status
:
e
==
undefined
?
undefined
:
e
});
};
};
//设备名称和型号修改
//设备名称和型号修改
nameAndModelChange
=
(
e
)
=>
{
nameAndModelChange
=
(
e
)
=>
{
this
.
setState
({
name
:
e
.
target
.
value
});
this
.
setState
({
name
:
e
.
target
.
value
});
};
};
//加载省
//加载省
provinceload
=
(
code
)
=>
{
provinceload
=
(
code
)
=>
{
this
.
props
.
dispatch
({
this
.
props
.
dispatch
({
type
:
'deviceModel/getRegion'
,
type
:
'deviceModel/getRegion'
,
payload
:
{
code
:
code
,
},
payload
:
{
code
:
code
},
callback
:
(
res
)
=>
{
callback
:
(
res
)
=>
{
if
(
res
)
{
if
(
res
)
{
this
.
setState
({
this
.
setState
({
provinceList
:
res
.
data
,
provinceList
:
res
.
data
,
});
});
}
}
}
}
,
});
});
};
};
//省变更
//省变更
provinceChange
=
(
e
)
=>
{
provinceChange
=
(
e
)
=>
{
if
(
e
==
undefined
)
{
if
(
e
==
undefined
)
{
this
.
setState
({
this
.
setState
({
cityList
:
[{
name
:
"未选择省"
}],
cityList
:
[{
name
:
'未选择省'
}],
districtList
:
[{
name
:
"未选择市"
}],
districtList
:
[{
name
:
'未选择市'
}],
streetList
:
[{
name
:
"未选择区"
}],
streetList
:
[{
name
:
'未选择区'
}],
province
:
undefined
,
province
:
undefined
,
city
:
undefined
,
city
:
undefined
,
district
:
undefined
,
district
:
undefined
,
street
:
undefined
,
street
:
undefined
,
})
})
;
}
else
{
}
else
{
this
.
setState
({
province
:
{
label
:
e
.
label
,}
});
this
.
setState
({
province
:
{
label
:
e
.
label
}
});
this
.
props
.
dispatch
({
this
.
props
.
dispatch
({
type
:
'deviceModel/getRegion'
,
type
:
'deviceModel/getRegion'
,
payload
:
{
code
:
e
.
key
,
},
payload
:
{
code
:
e
.
key
},
callback
:
(
res
)
=>
{
callback
:
(
res
)
=>
{
if
(
res
)
{
if
(
res
)
{
this
.
setState
({
this
.
setState
({
...
@@ -386,7 +413,7 @@ class OrderManagement extends React.Component {
...
@@ -386,7 +413,7 @@ class OrderManagement extends React.Component {
street
:
undefined
,
street
:
undefined
,
});
});
}
}
}
}
,
});
});
}
}
};
};
...
@@ -394,17 +421,17 @@ class OrderManagement extends React.Component {
...
@@ -394,17 +421,17 @@ class OrderManagement extends React.Component {
cityChange
=
(
e
)
=>
{
cityChange
=
(
e
)
=>
{
if
(
e
==
undefined
)
{
if
(
e
==
undefined
)
{
this
.
setState
({
this
.
setState
({
districtList
:
[{
name
:
"未选择市"
}],
districtList
:
[{
name
:
'未选择市'
}],
streetList
:
[{
name
:
"未选择区"
}],
streetList
:
[{
name
:
'未选择区'
}],
city
:
undefined
,
city
:
undefined
,
district
:
undefined
,
district
:
undefined
,
street
:
undefined
,
street
:
undefined
,
})
})
;
}
else
{
}
else
{
this
.
setState
({
city
:
{
label
:
e
.
label
,}
});
this
.
setState
({
city
:
{
label
:
e
.
label
}
});
this
.
props
.
dispatch
({
this
.
props
.
dispatch
({
type
:
'deviceModel/getRegion'
,
type
:
'deviceModel/getRegion'
,
payload
:
{
code
:
e
.
key
,
},
payload
:
{
code
:
e
.
key
},
callback
:
(
res
)
=>
{
callback
:
(
res
)
=>
{
if
(
res
)
{
if
(
res
)
{
this
.
setState
({
this
.
setState
({
...
@@ -413,7 +440,7 @@ class OrderManagement extends React.Component {
...
@@ -413,7 +440,7 @@ class OrderManagement extends React.Component {
street
:
undefined
,
street
:
undefined
,
});
});
}
}
}
}
,
});
});
}
}
};
};
...
@@ -421,15 +448,15 @@ class OrderManagement extends React.Component {
...
@@ -421,15 +448,15 @@ class OrderManagement extends React.Component {
districtChange
=
(
e
)
=>
{
districtChange
=
(
e
)
=>
{
if
(
e
==
undefined
)
{
if
(
e
==
undefined
)
{
this
.
setState
({
this
.
setState
({
streetList
:
[{
name
:
"未选择区"
}],
streetList
:
[{
name
:
'未选择区'
}],
district
:
undefined
,
district
:
undefined
,
street
:
undefined
,
street
:
undefined
,
})
})
;
}
else
{
}
else
{
this
.
setState
({
district
:
{
label
:
e
.
label
,}
});
this
.
setState
({
district
:
{
label
:
e
.
label
}
});
this
.
props
.
dispatch
({
this
.
props
.
dispatch
({
type
:
'deviceModel/getRegion'
,
type
:
'deviceModel/getRegion'
,
payload
:
{
code
:
e
.
key
,
},
payload
:
{
code
:
e
.
key
},
callback
:
(
res
)
=>
{
callback
:
(
res
)
=>
{
if
(
res
)
{
if
(
res
)
{
this
.
setState
({
this
.
setState
({
...
@@ -437,7 +464,7 @@ class OrderManagement extends React.Component {
...
@@ -437,7 +464,7 @@ class OrderManagement extends React.Component {
street
:
undefined
,
street
:
undefined
,
});
});
}
}
}
}
,
});
});
}
}
};
};
...
@@ -448,36 +475,36 @@ class OrderManagement extends React.Component {
...
@@ -448,36 +475,36 @@ class OrderManagement extends React.Component {
payload
:
this
.
state
.
delData
,
payload
:
this
.
state
.
delData
,
callback
:
(
res
)
=>
{
callback
:
(
res
)
=>
{
if
(
res
)
{
if
(
res
)
{
if
(
res
.
error_code
==
"0000"
)
{
if
(
res
.
error_code
==
'0000'
)
{
alert
(
res
.
error_msg
);
alert
(
res
.
error_msg
);
this
.
getDevice
();
this
.
getDevice
();
}
else
if
(
res
.
error_code
==
"0001"
)
{
}
else
if
(
res
.
error_code
==
'0001'
)
{
alert
(
res
.
error_msg
);
alert
(
res
.
error_msg
);
}
else
if
(
res
.
error_code
==
"0002"
)
{
}
else
if
(
res
.
error_code
==
'0002'
)
{
alert
(
res
.
error_msg
);
alert
(
res
.
error_msg
);
}
else
if
(
res
.
error_code
==
"0008"
)
{
}
else
if
(
res
.
error_code
==
'0008'
)
{
alert
(
res
.
error_msg
);
alert
(
res
.
error_msg
);
window
.
location
.
href
=
'/'
;
window
.
location
.
href
=
'/'
;
router
.
replace
(
'/'
);
router
.
replace
(
'/'
);
}
else
{
}
else
{
alert
(
"删除失败!未知错误!"
);
alert
(
'删除失败!未知错误!'
);
}
}
}
}
}
},
});
});
}
;
}
//显示信息
//显示信息
info
()
{
info
()
{
const
{
used
,
newAdd
,
strList
}
=
this
.
state
;
const
{
used
,
newAdd
,
strList
}
=
this
.
state
;
const
strSelect
=
strList
.
map
((
item
)
=>
(
const
strSelect
=
strList
.
map
((
item
)
=>
<
p
>
{
item
}
</
p
>);
<
p
>
{
item
}
</
p
>
));
Modal
.
info
({
Modal
.
info
({
title
:
'批量导入结果'
,
title
:
'批量导入结果'
,
content
:
(
content
:
(
<
div
>
<
div
>
<
p
>
绑定
<
span
style=
{
{
color
:
"lightgreen"
,
fontSize
:
24
}
}
>
{
newAdd
}
</
span
>
台设备,
<
p
>
以下
<
span
style=
{
{
color
:
"red"
,
fontSize
:
24
}
}
>
{
used
}
</
span
>
台设备已被占用
</
p
>
绑定
<
span
style=
{
{
color
:
'lightgreen'
,
fontSize
:
24
}
}
>
{
newAdd
}
</
span
>
台设备, 以下
<
span
style=
{
{
color
:
'red'
,
fontSize
:
24
}
}
>
{
used
}
</
span
>
台设备已被占用
</
p
>
{
strSelect
}
{
strSelect
}
</
div
>
</
div
>
),
),
...
@@ -493,7 +520,7 @@ class OrderManagement extends React.Component {
...
@@ -493,7 +520,7 @@ class OrderManagement extends React.Component {
//表格列名
//表格列名
columns
=
[
columns
=
[
{
{
title
:
'Service
Community
'
,
title
:
'Service
Estate
'
,
dataIndex
:
'communityName'
,
dataIndex
:
'communityName'
,
key
:
'communityName'
,
key
:
'communityName'
,
},
},
...
@@ -526,12 +553,7 @@ class OrderManagement extends React.Component {
...
@@ -526,12 +553,7 @@ class OrderManagement extends React.Component {
title
:
'Status'
,
title
:
'Status'
,
dataIndex
:
'orderStatus'
,
dataIndex
:
'orderStatus'
,
key
:
'orderStatus'
,
key
:
'orderStatus'
,
render
:
(
text
,
record
)
=>
(
render
:
(
text
,
record
)
=>
<
span
>
{
record
.
orderStatus
==
'0'
?
'已发单'
:
'待上门'
}
</
span
>,
<
span
>
{
record
.
orderStatus
==
'0'
?
"已发单"
:
"待上门"
}
</
span
>
),
},
},
/*{
/*{
...
@@ -555,8 +577,12 @@ class OrderManagement extends React.Component {
...
@@ -555,8 +577,12 @@ class OrderManagement extends React.Component {
key
:
'action'
,
key
:
'action'
,
render
:
(
text
,
record
)
=>
(
render
:
(
text
,
record
)
=>
(
<
span
>
<
span
>
<
Button
style=
{
{
background
:
'transparent'
,
border
:
0
,
color
:
'#1890FF'
}
}
<
Button
onClick=
{
()
=>
this
.
details
(
record
)
}
>
Details
</
Button
>
style=
{
{
background
:
'transparent'
,
border
:
0
,
color
:
'#1890FF'
}
}
onClick=
{
()
=>
this
.
details
(
record
)
}
>
Details
</
Button
>
{
/*<Button style={{background: 'transparent', border: 0, color: '#1890FF'}}*/
}
{
/*<Button style={{background: 'transparent', border: 0, color: '#1890FF'}}*/
}
{
/* onClick={() => this.edit(record)}>Edit</Button>*/
}
{
/* onClick={() => this.edit(record)}>Edit</Button>*/
}
</
span
>
</
span
>
...
@@ -565,17 +591,28 @@ class OrderManagement extends React.Component {
...
@@ -565,17 +591,28 @@ class OrderManagement extends React.Component {
];
];
//行选择
//行选择
rowSelection
=
{
rowSelection
=
{
onChange
:
(
selectedRowKeys
,
selectedRows
)
=>
{
onChange
:
(
selectedRowKeys
,
selectedRows
)
=>
{
this
.
setState
({
this
.
setState
({
delData
:
selectedRows
delData
:
selectedRows
,
});
});
},
},
};
};
//渲染
//渲染
render
()
{
render
()
{
const
{
const
{
data
,
total
,
statusList
,
provinceList
,
cityList
,
districtList
,
data
,
province
,
city
,
district
,
status
,
name
,
newList
,
authorityList
total
,
statusList
,
provinceList
,
cityList
,
districtList
,
province
,
city
,
district
,
status
,
name
,
newList
,
authorityList
,
}
=
this
.
state
;
}
=
this
.
state
;
const
uploadprops
=
{
const
uploadprops
=
{
// 这里我们只接受excel2007以后版本的文件,accept就是指定文件选择框的文件类型
// 这里我们只接受excel2007以后版本的文件,accept就是指定文件选择框的文件类型
...
@@ -591,7 +628,7 @@ class OrderManagement extends React.Component {
...
@@ -591,7 +628,7 @@ class OrderManagement extends React.Component {
const
rABS
=
true
;
const
rABS
=
true
;
const
f
=
fileList
[
0
];
const
f
=
fileList
[
0
];
const
reader
=
new
FileReader
();
const
reader
=
new
FileReader
();
reader
.
onload
=
e
=>
{
reader
.
onload
=
(
e
)
=>
{
let
dataResult
=
e
.
target
.
result
;
let
dataResult
=
e
.
target
.
result
;
if
(
!
rABS
)
dataResult
=
new
Uint8Array
(
dataResult
);
if
(
!
rABS
)
dataResult
=
new
Uint8Array
(
dataResult
);
const
workbook
=
XLSX
.
read
(
dataResult
,
{
const
workbook
=
XLSX
.
read
(
dataResult
,
{
...
@@ -600,12 +637,17 @@ class OrderManagement extends React.Component {
...
@@ -600,12 +637,17 @@ class OrderManagement extends React.Component {
// 假设我们的数据在第一个标签
// 假设我们的数据在第一个标签
const
firstWorksheet
=
workbook
.
Sheets
[
workbook
.
SheetNames
[
0
]];
const
firstWorksheet
=
workbook
.
Sheets
[
workbook
.
SheetNames
[
0
]];
// XLSX自带了一个工具把导入的数据转成json
// XLSX自带了一个工具把导入的数据转成json
const
jsonArr
=
XLSX
.
utils
.
sheet_to_json
(
firstWorksheet
,
{
header
:
1
});
const
jsonArr
=
XLSX
.
utils
.
sheet_to_json
(
firstWorksheet
,
{
header
:
1
});
// 通过自定义的方法处理Json,得到Excel原始数据传给后端,后端统一处理
// 通过自定义的方法处理Json,得到Excel原始数据传给后端,后端统一处理
const
oldDeviceList
=
[];
const
oldDeviceList
=
[];
for
(
let
i
=
0
;
i
<
jsonArr
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
jsonArr
.
length
;
i
++
)
{
//去重
//去重
if
(
!
oldDeviceList
.
includes
(
jsonArr
[
i
][
0
])
&&
jsonArr
[
i
][
0
]
!=
''
&&
jsonArr
[
i
][
0
]
!=
null
&&
jsonArr
[
i
][
0
]
!=
undefined
)
{
if
(
!
oldDeviceList
.
includes
(
jsonArr
[
i
][
0
])
&&
jsonArr
[
i
][
0
]
!=
''
&&
jsonArr
[
i
][
0
]
!=
null
&&
jsonArr
[
i
][
0
]
!=
undefined
)
{
oldDeviceList
.
push
(
jsonArr
[
i
][
0
]);
oldDeviceList
.
push
(
jsonArr
[
i
][
0
]);
}
}
}
}
...
@@ -617,16 +659,19 @@ class OrderManagement extends React.Component {
...
@@ -617,16 +659,19 @@ class OrderManagement extends React.Component {
},
},
callback
:
(
res
)
=>
{
callback
:
(
res
)
=>
{
if
(
res
)
{
if
(
res
)
{
this
.
setState
({
this
.
setState
(
{
used
:
res
.
data
.
used
,
used
:
res
.
data
.
used
,
newAdd
:
res
.
data
.
integer
,
newAdd
:
res
.
data
.
integer
,
strList
:
res
.
data
.
strList
,
strList
:
res
.
data
.
strList
,
},()
=>
{
},
()
=>
{
this
.
getDevice
();
this
.
getDevice
();
this
.
info
();
this
.
info
();
});
},
}
);
}
}
},
});
});
};
};
if
(
rABS
)
reader
.
readAsBinaryString
(
f
);
if
(
rABS
)
reader
.
readAsBinaryString
(
f
);
...
@@ -649,18 +694,24 @@ class OrderManagement extends React.Component {
...
@@ -649,18 +694,24 @@ class OrderManagement extends React.Component {
return
(
return
(
<
div
className=
{
styles
.
body
}
>
<
div
className=
{
styles
.
body
}
>
<
div
className=
{
styles
.
inputBox
}
>
<
div
className=
{
styles
.
inputBox
}
>
<
Input
className=
{
styles
.
input
}
<
Input
placeholder=
"Community"
className=
{
styles
.
input
}
placeholder=
"Estate"
value=
{
name
}
value=
{
name
}
onChange=
{
(
e
)
=>
this
.
nameAndModelChange
(
e
)
}
/>
onChange=
{
(
e
)
=>
this
.
nameAndModelChange
(
e
)
}
<
Input
className=
{
styles
.
input
}
/>
<
Input
className=
{
styles
.
input
}
placeholder=
"Service Type"
placeholder=
"Service Type"
value=
{
name
}
value=
{
name
}
onChange=
{
(
e
)
=>
this
.
nameAndModelChange
(
e
)
}
/>
onChange=
{
(
e
)
=>
this
.
nameAndModelChange
(
e
)
}
<
Input
className=
{
styles
.
input
}
/>
<
Input
className=
{
styles
.
input
}
placeholder=
"Order State"
placeholder=
"Order State"
value=
{
name
}
value=
{
name
}
onChange=
{
(
e
)
=>
this
.
nameAndModelChange
(
e
)
}
/>
onChange=
{
(
e
)
=>
this
.
nameAndModelChange
(
e
)
}
/>
{
/*<Select className={styles.input}*/
}
{
/*<Select className={styles.input}*/
}
{
/* placeholder="设备状态"*/
}
{
/* placeholder="设备状态"*/
}
{
/* onChange={(e) => this.statusChange(e)}*/
}
{
/* onChange={(e) => this.statusChange(e)}*/
}
...
@@ -690,14 +741,15 @@ class OrderManagement extends React.Component {
...
@@ -690,14 +741,15 @@ class OrderManagement extends React.Component {
{
/* value={district}>*/
}
{
/* value={district}>*/
}
{
/* {districtSelect}*/
}
{
/* {districtSelect}*/
}
{
/*</Select>*/
}
{
/*</Select>*/
}
</
div
>
</
div
>
<
div
>
<
div
>
<
Button
className=
{
styles
.
button1
}
onClick=
{
()
=>
this
.
getDevice
()
}
>
Search
</
Button
>
<
Button
className=
{
styles
.
button1
}
onClick=
{
()
=>
this
.
getDevice
()
}
>
<
Button
className=
{
styles
.
button
}
onClick=
{
()
=>
this
.
reset
()
}
>
重置
</
Button
>
Search
</
Button
>
<
Button
className=
{
styles
.
button
}
onClick=
{
()
=>
this
.
reset
()
}
>
重置
</
Button
>
{
/*<Button className={styles.button2} onClick={() => this.edit(null)}>Create New Owner</Button>*/
}
{
/*<Button className={styles.button2} onClick={() => this.edit(null)}>Create New Owner</Button>*/
}
{
/*<Upload {...uploadprops}>*/
}
{
/*<Upload {...uploadprops}>*/
}
{
/* <Tooltip title="">*/
}
{
/* <Tooltip title="">*/
}
...
@@ -710,28 +762,33 @@ class OrderManagement extends React.Component {
...
@@ -710,28 +762,33 @@ class OrderManagement extends React.Component {
</
div
>
</
div
>
<
div
>
<
div
>
<
Table
<
Table
rowKey=
{
record
=>
record
.
deviceID
}
rowKey=
{
(
record
)
=>
record
.
deviceID
}
className=
{
styles
.
table
}
className=
{
styles
.
table
}
rowSelection=
{
this
.
rowSelection
}
rowSelection=
{
this
.
rowSelection
}
columns=
{
this
.
columns
}
columns=
{
this
.
columns
}
dataSource=
{
data
}
dataSource=
{
data
}
size=
"small"
size=
"small"
pagination=
{
{
showQuickJumper
:
true
,
pageSize
:
10
,
total
:
total
}
}
pagination=
{
{
showQuickJumper
:
true
,
pageSize
:
10
,
total
:
total
}
}
/>
/>
<
Button
className=
{
styles
.
button3
}
onClick=
{
()
=>
this
.
showModal
()
}
>
Delete
</
Button
>
<
Button
className=
{
styles
.
button3
}
onClick=
{
()
=>
this
.
showModal
()
}
>
Delete
</
Button
>
</
div
>
</
div
>
<
Modal
<
Modal
title=
"确认删除?"
title=
"确认删除?"
visible=
{
this
.
state
.
visible
}
visible=
{
this
.
state
.
visible
}
onOk=
{
this
.
handleOk
}
onOk=
{
this
.
handleOk
}
onCancel=
{
this
.
handleCancel
}
>
onCancel=
{
this
.
handleCancel
}
<
div
style=
{
{
textAlign
:
"center"
}
}
><
p
style=
{
{
fontSize
:
18
}
}
>
删除信息将不可恢复
</
p
></
div
>
>
<
div
style=
{
{
textAlign
:
'center'
}
}
>
<
p
style=
{
{
fontSize
:
18
}
}
>
删除信息将不可恢复
</
p
>
</
div
>
</
Modal
>
</
Modal
>
</
div
>
</
div
>
);
);
}
}
}
}
export
default
connect
(({
user
}:
ConnectState
)
=>
({
export
default
connect
(({
user
}:
ConnectState
)
=>
({
currentUser
:
user
.
currentUser
,
currentUser
:
user
.
currentUser
,
}))(
OrderManagement
);
}))(
OrderManagement
);
src/pages/PropertyManagement/ChargeManager.tsx
View file @
2e1f9cf7
...
@@ -104,7 +104,7 @@ const ChargeManager = (props: any) => {
...
@@ -104,7 +104,7 @@ const ChargeManager = (props: any) => {
dataIndex
:
'tosOwnerName'
,
dataIndex
:
'tosOwnerName'
,
},
},
{
{
title
:
'
Community
Name'
,
title
:
'
Estate
Name'
,
dataIndex
:
'communityName'
,
dataIndex
:
'communityName'
,
},
},
{
{
...
...
src/pages/UserManagement/LIFEUserManagement/Users.tsx
View file @
2e1f9cf7
...
@@ -60,7 +60,12 @@ const Users = (props: any) => {
...
@@ -60,7 +60,12 @@ const Users = (props: any) => {
{
{
title
:
unit
,
title
:
unit
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
div
>
{
record
.
buildingNumber
+
' #'
+
record
.
floorNumber
+
'-'
+
record
.
roomNumber
}
</
div
>
// <div>{record.buildingNumber + ' #' + record.floorNumber + '-' + record.roomNumber}</div>
<
div
>
{
record
.
buildingNumber
?
<
span
>
{
record
.
buildingNumber
}
#
</
span
>
:
''
}
<
span
>
{
record
.
floorNumber
}
-
</
span
>
<
span
>
{
record
.
roomNumber
}
</
span
>
</
div
>
),
),
},
},
{
{
...
...
src/pages/UserManagement/LIFEUserManagement/UsersAdd.tsx
View file @
2e1f9cf7
...
@@ -33,15 +33,22 @@ const UsersAdd = (props: any) => {
...
@@ -33,15 +33,22 @@ const UsersAdd = (props: any) => {
}
else
{
}
else
{
values
.
communityName
=
null
;
values
.
communityName
=
null
;
}
}
if
(
checkParam
(
values
))
{
if
(
values
.
addressAndpostalCode
==
null
||
values
.
communityName
==
null
||
values
.
floorNumber
==
null
||
values
.
owerName
==
null
||
values
.
roomNumber
==
null
)
{
setLoading
(
false
);
message
.
error
(
'Error,Please finish it,not empty!'
);
}
else
{
values
.
owerPhone
=
null
;
values
.
owerPhone
=
null
;
values
.
owerEmail
=
null
;
values
.
owerEmail
=
null
;
values
.
buildingNumber
=
'BLK '
+
values
.
buildingNumber
;
values
.
buildingNumber
=
values
.
buildingNumber
?
'BLK '
+
values
.
buildingNumber
:
''
;
RA
(
14
,
values
,
module
,
dispatch
);
RA
(
14
,
values
,
module
,
dispatch
);
setLoading
(
true
);
setLoading
(
true
);
}
else
{
setLoading
(
false
);
message
.
error
(
'Error,Please finish it,not empty!'
);
}
}
};
};
...
...
src/pages/UserManagement/LIFEUserManagement/UsersDetail.tsx
View file @
2e1f9cf7
...
@@ -243,7 +243,9 @@ const UsersDetail = (props: any) => {
...
@@ -243,7 +243,9 @@ const UsersDetail = (props: any) => {
<>
<>
<
TitleBack
<
TitleBack
sublist=
{
[
sublist=
{
[
'Status : '
+
user_type_status
[
DataSave
.
enable
],
'Status : '
+
user_type_status
&&
user_type_status
[
DataSave
.
enable
]
?
user_type_status
[
DataSave
.
enable
]
:
''
,
'Create Time : '
+
timestampToTime
(
DataSave
.
createTime
.
time
),
'Create Time : '
+
timestampToTime
(
DataSave
.
createTime
.
time
),
]
}
]
}
title=
{
editFlag
?
'Edit Owner Infomation'
:
'Owner Detail'
}
title=
{
editFlag
?
'Edit Owner Infomation'
:
'Owner Detail'
}
...
...
src/pages/UserManagement/ServiceProviderManagement/AccoutingContent.tsx
View file @
2e1f9cf7
...
@@ -141,7 +141,7 @@ const AccoutingContent = (props: {
...
@@ -141,7 +141,7 @@ const AccoutingContent = (props: {
</
Button
>
</
Button
>
</
div
>
</
div
>
<
div
style=
{
{
marginBottom
:
28
,
marginTop
:
30
}
}
>
Service
Community
</
div
>
<
div
style=
{
{
marginBottom
:
28
,
marginTop
:
30
}
}
>
Service
Estate
</
div
>
<
ShowOptions
list=
{
SaveChooseData
.
serviceCommunityList
}
/>
<
ShowOptions
list=
{
SaveChooseData
.
serviceCommunityList
}
/>
</
Spin
>
</
Spin
>
)
:
(
)
:
(
...
...
src/pages/UserManagement/ServiceProviderManagement/Detail.tsx
View file @
2e1f9cf7
...
@@ -62,7 +62,7 @@ const Detail = (props: any) => {
...
@@ -62,7 +62,7 @@ const Detail = (props: any) => {
// 列表数据
// 列表数据
const
columns
=
[
const
columns
=
[
{
title
:
'User Name'
,
dataIndex
:
'saferName'
},
{
title
:
'User Name'
,
dataIndex
:
'saferName'
},
{
title
:
'Service
Community
'
,
dataIndex
:
'projectName'
},
{
title
:
'Service
Estate
'
,
dataIndex
:
'projectName'
},
{
title
:
'Job Title'
,
dataIndex
:
'jobTitle'
},
{
title
:
'Job Title'
,
dataIndex
:
'jobTitle'
},
{
{
title
:
'User Status'
,
title
:
'User Status'
,
...
@@ -168,7 +168,7 @@ const Detail = (props: any) => {
...
@@ -168,7 +168,7 @@ const Detail = (props: any) => {
</
div
>
</
div
>
<
div
className=
{
styles
.
box6
}
>
<
div
className=
{
styles
.
box6
}
>
<
div
className=
{
styles
.
box1item1
}
>
Service
Community
</
div
>
<
div
className=
{
styles
.
box1item1
}
>
Service
Estate
</
div
>
</
div
>
</
div
>
{
SaveChooseData
.
serviceCommunityList
!=
null
?
(
{
SaveChooseData
.
serviceCommunityList
!=
null
?
(
<
ShowOptions
list=
{
SaveChooseData
.
serviceCommunityList
}
defaultValue=
{
'Close'
}
/>
<
ShowOptions
list=
{
SaveChooseData
.
serviceCommunityList
}
defaultValue=
{
'Close'
}
/>
...
...
src/pages/UserManagement/ServiceProviderManagement/Edit.tsx
View file @
2e1f9cf7
...
@@ -102,7 +102,7 @@ const Edit = (props: any) => {
...
@@ -102,7 +102,7 @@ const Edit = (props: any) => {
// 提交按钮
// 提交按钮
const
onFinish
=
(
values
:
any
)
=>
{
const
onFinish
=
(
values
:
any
)
=>
{
if
(
CList
.
length
===
0
)
{
if
(
CList
.
length
===
0
)
{
// message.warning('Please select at least one service
Community
!', 3);
// message.warning('Please select at least one service
Estate
!', 3);
return
;
return
;
}
}
const
val
=
values
;
const
val
=
values
;
...
...
src/pages/template/小区公告添加/Template.tsx
View file @
2e1f9cf7
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
import
{
Input
,
Menu
,
DatePicker
,
Upload
,
Modal
,
Button
}
from
'antd'
;
import
{
Input
,
Menu
,
DatePicker
,
Upload
,
Modal
,
Button
}
from
'antd'
;
import
{
Link
,
useIntl
,
connect
,
Dispatch
}
from
'umi'
;
import
{
Link
,
useIntl
,
connect
,
Dispatch
}
from
'umi'
;
import
TextArea
from
'antd/lib/input/TextArea'
;
import
TextArea
from
'antd/lib/input/TextArea'
;
...
@@ -8,23 +8,22 @@ import TextArea from 'antd/lib/input/TextArea';
...
@@ -8,23 +8,22 @@ import TextArea from 'antd/lib/input/TextArea';
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
SelectOptions
from
'../../components/SelectOptions/index'
;
import
SelectOptions
from
'../../components/SelectOptions/index'
;
const
printContent
=
(
comment
:
any
)
=>
{
const
printContent
=
(
comment
:
any
)
=>
{
console
.
log
(
comment
)
console
.
log
(
comment
)
;
}
}
;
function
getBase64
(
file
:
Blob
)
{
function
getBase64
(
file
:
Blob
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
reader
=
new
FileReader
();
const
reader
=
new
FileReader
();
reader
.
readAsDataURL
(
file
);
reader
.
readAsDataURL
(
file
);
reader
.
onload
=
()
=>
resolve
(
reader
.
result
);
reader
.
onload
=
()
=>
resolve
(
reader
.
result
);
reader
.
onerror
=
error
=>
reject
(
error
);
reader
.
onerror
=
(
error
)
=>
reject
(
error
);
});
});
}
}
const
Template
=
()
=>
{
const
Template
=
()
=>
{
const
[
previewVisible
,
setPreviewVisible
]
=
useState
(
false
);
const
[
previewVisible
,
setPreviewVisible
]
=
useState
(
false
);
const
[
previewImage
,
setPreviewImage
]
=
useState
(
""
);
const
[
previewImage
,
setPreviewImage
]
=
useState
(
''
);
const
[
previewTitle
,
setPreviewTitle
]
=
useState
(
""
);
const
[
previewTitle
,
setPreviewTitle
]
=
useState
(
''
);
const
[
fileList
,
setFileList
]
=
useState
([]);
const
[
fileList
,
setFileList
]
=
useState
([]);
const
uploadButton
=
(
const
uploadButton
=
(
...
@@ -34,42 +33,63 @@ const Template = () => {
...
@@ -34,42 +33,63 @@ const Template = () => {
</
div
>
</
div
>
);
);
const
handleCancel
=
()
=>
{
setPreviewVisible
(
false
)
};
const
handleCancel
=
()
=>
{
setPreviewVisible
(
false
);
};
const
handlePreview
=
async
(
file
:
{
url
:
string
;
preview
:
string
;
originFileObj
:
Blob
;
name
:
any
;
})
=>
{
const
handlePreview
=
async
(
file
:
{
url
:
string
;
preview
:
string
;
originFileObj
:
Blob
;
name
:
any
;
})
=>
{
if
(
!
file
.
url
&&
!
file
.
preview
)
{
if
(
!
file
.
url
&&
!
file
.
preview
)
{
file
.
preview
=
await
getBase64
(
file
.
originFileObj
);
file
.
preview
=
await
getBase64
(
file
.
originFileObj
);
}
}
setPreviewImage
(
(
file
.
url
||
file
.
preview
)
);
setPreviewImage
(
file
.
url
||
file
.
preview
);
setPreviewVisible
(
true
);
setPreviewVisible
(
true
);
setPreviewTitle
(
file
.
name
||
file
.
url
.
substring
(
file
.
url
.
lastIndexOf
(
'/'
)
+
1
));
setPreviewTitle
(
file
.
name
||
file
.
url
.
substring
(
file
.
url
.
lastIndexOf
(
'/'
)
+
1
));
};
};
const
handleChange
=
(
Obj
:
any
)
=>
{
setFileList
(
Obj
.
fileList
)
}
const
handleChange
=
(
Obj
:
any
)
=>
{
setFileList
(
Obj
.
fileList
);
};
return
(
return
(
<
div
className=
{
styles
.
base
}
>
<
div
className=
{
styles
.
base
}
>
{
/* 头部组件 */
}
{
/* 头部组件 */
}
<
div
className=
{
styles
.
box
}
>
<
div
className=
{
styles
.
box
}
>
<
div
className=
{
styles
.
item1
}
>
Community
Announcement
</
div
>
<
div
className=
{
styles
.
item1
}
>
Estate
Announcement
</
div
>
<
button
className=
{
styles
.
item3
}
>
返回
</
button
>
<
button
className=
{
styles
.
item3
}
>
返回
</
button
>
</
div
>
</
div
>
<
SelectOptions
list=
{
[
"美国"
,
"美丽的"
,
"美好"
,
"加拿大"
,
"加油"
,
"XO"
].
sort
()
}
onSubmit=
{
printContent
}
/>
<
SelectOptions
list=
{
[
'美国'
,
'美丽的'
,
'美好'
,
'加拿大'
,
'加油'
,
'XO'
].
sort
()
}
onSubmit=
{
printContent
}
/>
<
div
className=
{
styles
.
box1
}
>
<
div
className=
{
styles
.
box1
}
>
<
div
className=
{
styles
.
box1item1
}
>
Announcement Title
</
div
>
<
div
className=
{
styles
.
box1item1
}
>
Announcement Title
</
div
>
<
div
className=
{
styles
.
box1item2
}
><
Input
style=
{
{
width
:
500
}
}
/></
div
>
<
div
className=
{
styles
.
box1item2
}
>
<
Input
style=
{
{
width
:
500
}
}
/>
</
div
>
</
div
>
</
div
>
<
div
className=
{
styles
.
box2
}
>
<
div
className=
{
styles
.
box2
}
>
<
div
className=
{
styles
.
box2item1
}
>
Announcement Title
</
div
>
<
div
className=
{
styles
.
box2item1
}
>
Announcement Title
</
div
>
<
div
className=
{
styles
.
box2item2
}
><
TextArea
autoSize=
{
false
}
style=
{
{
width
:
500
,
height
:
120
}
}
/></
div
>
<
div
className=
{
styles
.
box2item2
}
>
<
TextArea
autoSize=
{
false
}
style=
{
{
width
:
500
,
height
:
120
}
}
/>
</
div
>
</
div
>
</
div
>
<
div
className=
{
styles
.
box3
}
>
<
div
className=
{
styles
.
box3
}
>
<
Upload
action=
"https://www.mocky.io/v2/5cc8019d300000980a055e76"
listType=
"picture-card"
fileList=
{
fileList
}
onPreview=
{
handlePreview
}
onChange=
{
handleChange
}
>
<
Upload
action=
"https://www.mocky.io/v2/5cc8019d300000980a055e76"
listType=
"picture-card"
fileList=
{
fileList
}
onPreview=
{
handlePreview
}
onChange=
{
handleChange
}
>
{
fileList
.
length
>=
3
?
null
:
uploadButton
}
{
fileList
.
length
>=
3
?
null
:
uploadButton
}
</
Upload
>
</
Upload
>
<
Modal
visible=
{
previewVisible
}
title=
{
previewTitle
}
footer=
{
null
}
onCancel=
{
handleCancel
}
>
<
Modal
visible=
{
previewVisible
}
title=
{
previewTitle
}
footer=
{
null
}
onCancel=
{
handleCancel
}
>
...
@@ -77,21 +97,26 @@ const Template = () => {
...
@@ -77,21 +97,26 @@ const Template = () => {
</
Modal
>
</
Modal
>
</
div
>
</
div
>
<
div
className
=
{
styles
.
box4
}
>
<
div
className=
{
styles
.
box4
}
>
<
div
className=
{
styles
.
box4item1
}
>
Entry into Force Time
</
div
>
<
div
className=
{
styles
.
box4item1
}
>
Entry into Force Time
</
div
>
<
div
className=
{
styles
.
box4item2
}
><
DatePicker
/></
div
>
<
div
className=
{
styles
.
box4item2
}
>
<
DatePicker
/>
</
div
>
</
div
>
</
div
>
<
div
className
=
{
styles
.
box4
}
>
<
div
className=
{
styles
.
box4
}
>
<
div
className=
{
styles
.
box4item1
}
>
End Date
</
div
>
<
div
className=
{
styles
.
box4item1
}
>
End Date
</
div
>
<
div
className=
{
styles
.
box4item2
}
><
DatePicker
/></
div
>
<
div
className=
{
styles
.
box4item2
}
>
<
DatePicker
/>
</
div
>
</
div
>
</
div
>
<
div
className=
{
styles
.
line
}
></
div
>
<
div
className=
{
styles
.
line
}
></
div
>
<
Button
type=
"primary"
style=
{
{
width
:
80
,
height
:
32
}
}
>
提交
</
Button
>
<
Button
type=
"primary"
style=
{
{
width
:
80
,
height
:
32
}
}
>
提交
</
Button
>
</
div
>
</
div
>
);
);
};
};
export
default
Template
;
export
default
Template
;
src/pages/template/服务商详情/Template.tsx
View file @
2e1f9cf7
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
import
{
Input
,
Button
,
Table
,
Space
,
Pagination
,
Tooltip
,
Checkbox
}
from
'antd'
;
import
{
Input
,
Button
,
Table
,
Space
,
Pagination
,
Tooltip
,
Checkbox
}
from
'antd'
;
import
{
Link
,
useIntl
,
connect
,
Dispatch
}
from
'umi'
;
import
{
Link
,
useIntl
,
connect
,
Dispatch
}
from
'umi'
;
...
@@ -14,38 +14,36 @@ const dataSource = [
...
@@ -14,38 +14,36 @@ const dataSource = [
];
];
const
Template
=
()
=>
{
const
Template
=
()
=>
{
const
pagination
=
{
defaultCurrent
:
1
,
total
:
16
};
const
pagination
=
{
defaultCurrent
:
1
,
total
:
16
}
const
columns
=
[
const
columns
=
[
{
{
title
:
"username"
,
title
:
'username'
,
dataIndex
:
'name'
,
dataIndex
:
'name'
,
key
:
'name'
,
key
:
'name'
,
},
},
{
{
title
:
"project"
,
title
:
'project'
,
dataIndex
:
'age'
,
dataIndex
:
'age'
,
key
:
'age'
,
key
:
'age'
,
},
},
{
{
title
:
"unit"
,
title
:
'unit'
,
dataIndex
:
'address'
,
dataIndex
:
'address'
,
key
:
'address'
,
key
:
'address'
,
},
},
{
{
title
:
"status"
,
title
:
'status'
,
dataIndex
:
'address'
,
dataIndex
:
'address'
,
key
:
'address'
,
key
:
'address'
,
},
},
{
{
title
:
"submissionTime"
,
title
:
'submissionTime'
,
dataIndex
:
'address'
,
dataIndex
:
'address'
,
key
:
'address'
,
key
:
'address'
,
},
},
{
{
title
:
"actions"
,
title
:
'actions'
,
key
:
'action'
,
key
:
'action'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
Space
size=
"middle"
>
<
Space
size=
"middle"
>
...
@@ -57,14 +55,12 @@ const Template = () => {
...
@@ -57,14 +55,12 @@ const Template = () => {
return
(
return
(
<
div
className=
{
styles
.
base
}
>
<
div
className=
{
styles
.
base
}
>
{
/* 头部组件 */
}
{
/* 头部组件 */
}
<
div
className=
{
styles
.
box
}
>
<
div
className=
{
styles
.
box
}
>
<
div
className=
{
styles
.
item1
}
>
Service Provider Details
</
div
>
<
div
className=
{
styles
.
item1
}
>
Service Provider Details
</
div
>
<
button
className=
{
styles
.
item3
}
>
返回
</
button
>
<
button
className=
{
styles
.
item3
}
>
返回
</
button
>
</
div
>
</
div
>
<
div
className=
{
styles
.
box1
}
>
<
div
className=
{
styles
.
box1
}
>
<
div
className=
{
styles
.
box1item1
}
>
Company Name
</
div
>
<
div
className=
{
styles
.
box1item1
}
>
Company Name
</
div
>
<
div
className=
{
styles
.
box1item2
}
>
Free Limited
</
div
>
<
div
className=
{
styles
.
box1item2
}
>
Free Limited
</
div
>
...
@@ -72,7 +68,9 @@ const Template = () => {
...
@@ -72,7 +68,9 @@ const Template = () => {
<
div
className=
{
styles
.
box2
}
>
<
div
className=
{
styles
.
box2
}
>
<
div
className=
{
styles
.
box2item1
}
>
Office Address
</
div
>
<
div
className=
{
styles
.
box2item1
}
>
Office Address
</
div
>
<
div
className=
{
styles
.
box2item2
}
>
Albert Street, 175, Singapore, Albert, Bugis, Victoria Street,
</
div
>
<
div
className=
{
styles
.
box2item2
}
>
Albert Street, 175, Singapore, Albert, Bugis, Victoria Street,
{
' '
}
</
div
>
</
div
>
</
div
>
<
div
className=
{
styles
.
box3
}
>
<
div
className=
{
styles
.
box3
}
>
...
@@ -90,7 +88,7 @@ const Template = () => {
...
@@ -90,7 +88,7 @@ const Template = () => {
</
div
>
</
div
>
<
div
className=
{
styles
.
box6
}
>
<
div
className=
{
styles
.
box6
}
>
<
div
className=
{
styles
.
box1item1
}
>
Service
Community
</
div
>
<
div
className=
{
styles
.
box1item1
}
>
Service
Estate
</
div
>
</
div
>
</
div
>
<
div
className=
{
styles
.
box7
}
>
<
div
className=
{
styles
.
box7
}
>
...
@@ -98,13 +96,16 @@ const Template = () => {
...
@@ -98,13 +96,16 @@ const Template = () => {
</
div
>
</
div
>
{
/* 列表组件 */
}
{
/* 列表组件 */
}
<
Table
style=
{
{
marginTop
:
16
}
}
dataSource=
{
dataSource
}
columns=
{
columns
}
pagination=
{
pagination
}
/>
<
Table
style=
{
{
marginTop
:
16
}
}
<
Button
>
Cancellation
</
Button
>
dataSource=
{
dataSource
}
columns=
{
columns
}
pagination=
{
pagination
}
/>
<
Button
>
Cancellation
</
Button
>
</
div
>
</
div
>
);
);
};
};
export
default
Template
;
export
default
Template
;
src/utils/params.ts
View file @
2e1f9cf7
/*
/*
* @Author: your name
* @Author: your name
* @Date: 2020-11-19 20:34:18
* @Date: 2020-11-19 20:34:18
* @LastEditTime: 2021-0
3-03 18:02:42
* @LastEditTime: 2021-0
4-21 15:18:56
* @LastEditors: Please set LastEditors
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\utils\params.ts
* @FilePath: \tostumi\src\utils\params.ts
...
@@ -106,4 +106,7 @@ export const requestList = [
...
@@ -106,4 +106,7 @@ export const requestList = [
[
'/tos/report/reply'
,
'71 web端报告员回复'
,
{}],
[
'/tos/report/reply'
,
'71 web端报告员回复'
,
{}],
[
'/tos/community/get/address'
,
'72 根据小区名搜索小区地址'
,
{}],
[
'/tos/community/get/address'
,
'72 根据小区名搜索小区地址'
,
{}],
[
'/tos/report/delete'
,
'73 删除报告'
,
{}],
[
'/tos/report/delete'
,
'73 删除报告'
,
{}],
[
'/tos/community/moveOut/record/get'
,
'74 迁出申请列表'
,
{}],
[
'/tos/community/moveOut/record/get/detail'
,
'75 迁出申请详情'
,
{}],
[
'/tos/community/moveOut/record/reply'
,
'76 迁出申请回复'
,
{}],
];
];
src/utils/power.js
View file @
2e1f9cf7
...
@@ -217,7 +217,7 @@ export const enUsFaci = [
...
@@ -217,7 +217,7 @@ export const enUsFaci = [
children
:
[{
title
:
'View Property Fees'
,
key
:
'16'
,
disableCheckbox
:
true
}],
children
:
[{
title
:
'View Property Fees'
,
key
:
'16'
,
disableCheckbox
:
true
}],
},
},
{
{
title
:
'Commercial Service-
Community
Maintenance'
,
title
:
'Commercial Service- Maintenance'
,
key
:
'17'
,
key
:
'17'
,
disabled
:
true
,
disabled
:
true
,
children
:
[
children
:
[
...
@@ -291,14 +291,14 @@ export const enUsFaci = [
...
@@ -291,14 +291,14 @@ export const enUsFaci = [
],
],
},
},
{
{
title
:
'
Community
'
,
title
:
'
Estate
'
,
key
:
'43'
,
key
:
'43'
,
disabled
:
true
,
disabled
:
true
,
children
:
[
children
:
[
{
title
:
'View
Community
'
,
key
:
'44'
,
disableCheckbox
:
true
},
{
title
:
'View
Estate
'
,
key
:
'44'
,
disableCheckbox
:
true
},
{
title
:
'Edit
Community
'
,
key
:
'45'
,
disableCheckbox
:
true
},
{
title
:
'Edit
Estate
'
,
key
:
'45'
,
disableCheckbox
:
true
},
{
title
:
'Add
Community
'
,
key
:
'46'
,
disableCheckbox
:
true
},
{
title
:
'Add
Estate
'
,
key
:
'46'
,
disableCheckbox
:
true
},
{
title
:
'Delete
Community
'
,
key
:
'47'
,
disableCheckbox
:
true
},
{
title
:
'Delete
Estate
'
,
key
:
'47'
,
disableCheckbox
:
true
},
],
],
},
},
{
{
...
...
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