Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
5d3290d8
Commit
5d3290d8
authored
Oct 24, 2022
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改门店筛选问题
parent
f61bb2a3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
FormRuleSetting.jsx
src/pages/ServiceGoods/components/FormRuleSetting.jsx
+28
-1
No files found.
src/pages/ServiceGoods/components/FormRuleSetting.jsx
View file @
5d3290d8
...
...
@@ -24,6 +24,16 @@ const FormRuleSetting = forwardRef((props, ref) => {
const
[
form
]
=
Form
.
useForm
();
const
customer
=
useContext
(
ServiceContext
);
// 判断是否有禁用的店铺 禁用店铺不显示
const
getIsInShops
=
arr
=>
{
const
list
=
[];
arr
.
forEach
(
item
=>
{
// eslint-disable-next-line no-unused-expressions
supplierIdList
.
some
(
s
=>
+
s
.
id
===
+
item
)
&&
list
.
push
(
item
);
});
return
list
;
};
useEffect
(()
=>
{
if
(
customer
.
isEdit
)
{
if
(
!
editData
)
return
;
...
...
@@ -31,6 +41,16 @@ const FormRuleSetting = forwardRef((props, ref) => {
}
},
[
customer
.
isEdit
,
editData
]);
useEffect
(()
=>
{
if
((
customer
.
isEdit
,
supplierIdList
.
length
))
{
if
(
!
editData
)
return
;
const
shopIds
=
getIsInShops
(
editData
.
shopIds
);
form
.
setFieldsValue
({
shopIds
,
});
}
},
[
supplierIdList
]);
const
onCheck
=
async
()
=>
{
try
{
const
{
useTime
,
purchaseTime
,
...
values
}
=
await
form
.
validateFields
();
...
...
@@ -98,7 +118,14 @@ const FormRuleSetting = forwardRef((props, ref) => {
label=
"适用门店"
rules=
{
[{
required
:
true
,
message
:
'
请选择适用门店!
'
,
type
:
'
array
'
}]
}
>
<
Select
mode=
"multiple"
placeholder=
"请选择适用门店"
>
<
Select
mode=
"multiple"
placeholder=
"请选择适用门店"
showSearch
filterOption=
{
(
input
,
option
)
=>
option
.
props
.
children
.
toLowerCase
().
indexOf
(
input
.
toLowerCase
())
>=
0
}
>
{
(
supplierIdList
||
[]).
map
(
item
=>
(
<
Option
value=
{
+
item
.
id
}
key=
{
item
.
id
}
>
{
item
.
name
}
...
...
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