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
aa72cb8e
Commit
aa72cb8e
authored
Feb 19, 2021
by
Sixiang_Zzb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务商模块 编辑页面 小区设置禁止修改
parent
84c2ba32
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
29 deletions
+37
-29
Edit.tsx
src/pages/UserManagement/ServiceProviderManagement/Edit.tsx
+37
-29
No files found.
src/pages/UserManagement/ServiceProviderManagement/Edit.tsx
View file @
aa72cb8e
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Input
,
Button
,
Form
,
Spin
,
Modal
,
Checkbox
}
from
'antd'
;
import
{
Input
,
Button
,
Form
,
Spin
,
Checkbox
,
Modal
}
from
'antd'
;
import
{
connect
,
history
}
from
'umi'
;
import
{
connect
,
history
}
from
'umi'
;
import
{
RA
}
from
'@/utils/method'
;
import
{
RA
}
from
'@/utils/method'
;
import
{
CheckboxValueType
}
from
'antd/lib/checkbox/Group'
;
//
import { CheckboxValueType } from 'antd/lib/checkbox/Group';
import
SelectOptions
from
'../../../components/SelectOptions/index'
;
import
SelectOptions
from
'../../../components/SelectOptions/index'
;
import
ShowOptions
from
'@/components/ShowOptions/index'
;
import
TitleBack
from
'../../../components/TitleBack/TitleBack'
;
import
TitleBack
from
'../../../components/TitleBack/TitleBack'
;
import
styles
from
'./Edit.less'
;
import
styles
from
'./Edit.less'
;
import
type
{
CheckboxValueType
}
from
'antd/lib/checkbox/Group'
;
const
module
=
'User'
;
const
module
=
'User'
;
let
options
:
Array
<
{
label
:
string
;
value
:
number
}
>
=
[];
let
options
:
Array
<
{
label
:
string
;
value
:
number
}
>
=
[];
...
@@ -18,9 +20,7 @@ let optionsList: {
...
@@ -18,9 +20,7 @@ let optionsList: {
const
Edit
=
(
props
:
any
)
=>
{
const
Edit
=
(
props
:
any
)
=>
{
const
{
dispatch
,
CurData
,
SaveChooseData
,
CommunityList
,
DataServices
}
=
props
;
const
{
dispatch
,
CurData
,
SaveChooseData
,
CommunityList
,
DataServices
}
=
props
;
const
[
CList
,
setCList
]
=
useState
(
CommunityList
);
const
[
CList
,
setCList
]
=
useState
(
CommunityList
);
const
[
load
,
setload
]
=
useState
(
false
);
const
[
load
,
setload
]
=
useState
(
false
);
const
TosTosServiceProviderSave
=
(
values
:
any
)
=>
{
const
TosTosServiceProviderSave
=
(
values
:
any
)
=>
{
...
@@ -33,14 +33,14 @@ const Edit = (props: any) => {
...
@@ -33,14 +33,14 @@ const Edit = (props: any) => {
const
formRef
=
useRef
(
null
as
any
);
const
formRef
=
useRef
(
null
as
any
);
// 选择服务商事件
// 选择服务商事件
//
const onSelectCheckBox = (checkedValue: CheckboxValueType[]) => {
const
onSelectCheckBox
=
(
checkedValue
:
CheckboxValueType
[])
=>
{
//
if (checkedValue.indexOf('0') > -1 && checkedValue.indexOf('1') > -1) {
if
(
checkedValue
.
indexOf
(
'0'
)
>
-
1
&&
checkedValue
.
indexOf
(
'1'
)
>
-
1
)
{
//
Modal.error({
Modal
.
error
({
//
title: 'Error',
title
:
'Error'
,
//
content: <div>Accounting and security can only be selected singly.</div>,
content
:
<
div
>
Accounting and security can only be selected singly.
</
div
>,
//
});
});
//
}
}
//
};
};
// 拿取服务范围数据
// 拿取服务范围数据
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -111,8 +111,8 @@ const Edit = (props: any) => {
...
@@ -111,8 +111,8 @@ const Edit = (props: any) => {
val
.
updater
=
'admin'
;
val
.
updater
=
'admin'
;
if
(
SaveChooseData
)
{
if
(
SaveChooseData
)
{
val
.
id
=
SaveChooseData
.
id
;
val
.
id
=
SaveChooseData
.
id
;
}
val
.
serviceScopeList
=
SaveChooseData
.
serviceScopeList
;
val
.
serviceScopeList
=
SaveChooseData
.
serviceScopeList
;
}
setload
(
true
);
setload
(
true
);
TosTosServiceProviderSave
(
val
);
TosTosServiceProviderSave
(
val
);
};
};
...
@@ -159,16 +159,23 @@ const Edit = (props: any) => {
...
@@ -159,16 +159,23 @@ const Edit = (props: any) => {
<
div
className=
{
styles
.
line
}
/>
<
div
className=
{
styles
.
line
}
/>
{
SaveChooseData
!==
null
?
(
<
ShowOptions
list=
{
SaveChooseData
.
serviceCommunityList
}
defaultValue=
"Close"
/>
)
:
(
<
SelectOptions
<
SelectOptions
list=
{
CommunityList
?
CommunityList
.
sort
()
:
[]
}
list=
{
CommunityList
?
CommunityList
.
sort
()
:
[]
}
checklist=
{
SaveChooseData
!=
null
?
SaveChooseData
.
serviceCommunityList
:
null
}
//
checklist=
{
SaveChooseData
!=
null
?
SaveChooseData
.
serviceCommunityList
:
null
}
onSubmit=
{
printContent
}
onSubmit=
{
printContent
}
/>
/>
)
}
<
div
className=
{
styles
.
box2
}
>
<
div
className=
{
styles
.
box2
}
>
<
div
className=
{
styles
.
box2item1
}
>
Services Available
</
div
>
<
div
className=
{
styles
.
box2item1
}
>
Services Available
</
div
>
<
div
className=
{
styles
.
box2item2
}
>
<
div
className=
{
styles
.
box2item2
}
>
{
/* <Form.Item
{
SaveChooseData
!==
null
?
(
SaveChooseData
?.
serviceScope
)
:
(
<
Form
.
Item
name=
"serviceScopeList"
name=
"serviceScopeList"
rules=
{
[
rules=
{
[
{
{
...
@@ -176,9 +183,10 @@ const Edit = (props: any) => {
...
@@ -176,9 +183,10 @@ const Edit = (props: any) => {
message
:
'Please select at least one service available!'
,
message
:
'Please select at least one service available!'
,
},
},
]
}
]
}
> */
}
>
{
SaveChooseData
?.
serviceCommunityName
}
<
Checkbox
.
Group
options=
{
options
}
onChange=
{
onSelectCheckBox
}
/>
{
/* </Form.Item> */
}
</
Form
.
Item
>
)
}
</
div
>
</
div
>
</
div
>
</
div
>
...
...
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