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
245c0292
Commit
245c0292
authored
Apr 04, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改缺少门店问题
parent
89627e63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
68 deletions
+76
-68
GoodsGroup.jsx
src/pages/GoodsManage/Takeaway/components/GoodsGroup.jsx
+66
-61
index.jsx
src/pages/GoodsManage/Takeaway/index.jsx
+10
-7
No files found.
src/pages/GoodsManage/Takeaway/components/GoodsGroup.jsx
View file @
245c0292
...
...
@@ -21,13 +21,14 @@ const GoodsGroup = options => {
const
json
=
JSON
.
parse
(
user
);
const
res
=
await
apiSupplierShopList
(
json
.
id
);
if
(
res
&&
res
.
data
&&
res
.
data
.
length
>
0
)
{
setShops
(
res
.
data
.
map
(
item
=>
({
label
:
item
.
name
,
value
:
+
item
.
id
,
})),
);
options
.
changeShop
(
+
res
.
data
[
0
].
id
);
// setShops(
// res.data.map(item => ({
// label: item.name,
// value: +item.id,
// })),
// );
// options.changeShop(+res.data[0].id);
options
.
changeShop
(
0
);
}
else
{
options
.
changeShop
(
0
);
}
...
...
@@ -111,62 +112,66 @@ const GoodsGroup = options => {
return
(
<
div
className=
{
styles
.
groupBox
}
>
{
(
shops
&&
shops
.
length
&&
(
<
div
className=
{
styles
[
'
groupBox-title
'
]
}
>
<
div
className=
{
styles
[
'
groupBox-title--name
'
]
}
>
所属门店
</
div
>
<
Select
showSearch
value=
{
options
.
shopId
}
placeholder=
"请选择所属门店"
onChange=
{
options
.
changeShop
}
filterOption=
{
(
input
,
option
)
=>
(
option
?.
label
??
''
).
toLowerCase
().
includes
(
input
.
toLowerCase
())
}
options=
{
shops
}
/>
</
div
>
<>
<
div
className=
{
styles
[
'
groupBox-title
'
]
}
>
<
div
className=
{
styles
[
'
groupBox-title--name
'
]
}
>
所属门店
</
div
>
<
Select
showSearch
value=
{
options
.
shopId
}
placeholder=
"请选择所属门店"
onChange=
{
options
.
changeShop
}
filterOption=
{
(
input
,
option
)
=>
(
option
?.
label
??
''
).
toLowerCase
().
includes
(
input
.
toLowerCase
())
}
options=
{
shops
}
/>
</
div
>
<
div
className=
{
styles
[
'
groupBox-title
'
]
}
>
<
div
className=
{
styles
[
'
groupBox-title--name
'
]
}
>
商品分组
</
div
>
<
Button
onClick=
{
()
=>
setGroupEdit
(
!
groupEdit
)
}
>
{
groupEdit
?
'
完成
'
:
'
编辑分组
'
}
</
Button
>
</
div
>
<
div
className=
{
styles
[
'
groupBox-body
'
]
}
>
{
groupEdit
?
(
<
DndProvider
backend=
{
HTML5Backend
}
>
<
div
className=
{
styles
[
'
groupBox-body--dragbox
'
]
}
>
{
tags
.
map
((
item
,
index
)
=>
(
<
DragTag
changePosition=
{
changePosition
}
endChangePosition=
{
endChangePosition
}
index=
{
index
}
{
...
item
}
selected=
{
selected
}
edit=
{
handleEdit
}
del=
{
handleDelete
}
key=
{
item
.
id
}
/>
))
}
<
InsertTag
handleOpen=
{
handleEdit
}
/>
</
div
>
</
DndProvider
>
)
:
(
<
div
className=
{
styles
[
'
groupBox-body--dragbox
'
]
}
>
{
tags
.
map
(
item
=>
(
<
Tag
key=
{
item
.
id
}
onClick=
{
()
=>
onSelect
(
item
.
id
)
}
className=
{
[
styles
[
'
groupBox-body--tag-normal
'
],
selected
===
item
.
id
?
styles
[
'
groupBox-body--tag__cur
'
]
:
''
,
]
}
>
<
span
className=
{
styles
[
'
groupBox-body--tag__text
'
]
}
>
{
item
.
text
}
</
span
>
</
Tag
>
))
}
<
InsertTag
key=
"insert"
handleOpen=
{
handleEdit
}
/>
</
div
>
)
}
</
div
>
</>
))
||
''
}
<
div
className=
{
styles
[
'
groupBox-title
'
]
}
>
<
div
className=
{
styles
[
'
groupBox-title--name
'
]
}
>
商品分组
</
div
>
<
Button
onClick=
{
()
=>
setGroupEdit
(
!
groupEdit
)
}
>
{
groupEdit
?
'
完成
'
:
'
编辑分组
'
}
</
Button
>
</
div
>
<
div
className=
{
styles
[
'
groupBox-body
'
]
}
>
{
groupEdit
?
(
<
DndProvider
backend=
{
HTML5Backend
}
>
<
div
className=
{
styles
[
'
groupBox-body--dragbox
'
]
}
>
{
tags
.
map
((
item
,
index
)
=>
(
<
DragTag
changePosition=
{
changePosition
}
endChangePosition=
{
endChangePosition
}
index=
{
index
}
{
...
item
}
selected=
{
selected
}
edit=
{
handleEdit
}
del=
{
handleDelete
}
key=
{
item
.
id
}
/>
))
}
<
InsertTag
handleOpen=
{
handleEdit
}
/>
</
div
>
</
DndProvider
>
)
:
(
<
div
className=
{
styles
[
'
groupBox-body--dragbox
'
]
}
>
{
tags
.
map
(
item
=>
(
<
Tag
key=
{
item
.
id
}
onClick=
{
()
=>
onSelect
(
item
.
id
)
}
className=
{
[
styles
[
'
groupBox-body--tag-normal
'
],
selected
===
item
.
id
?
styles
[
'
groupBox-body--tag__cur
'
]
:
''
,
]
}
>
<
span
className=
{
styles
[
'
groupBox-body--tag__text
'
]
}
>
{
item
.
text
}
</
span
>
</
Tag
>
))
}
<
InsertTag
key=
"insert"
handleOpen=
{
handleEdit
}
/>
</
div
>
)
}
</
div
>
<
GroupInfo
isModalOpen=
{
isModalOpen
}
id=
{
storageId
}
...
...
src/pages/GoodsManage/Takeaway/index.jsx
View file @
245c0292
...
...
@@ -177,13 +177,16 @@ const Takeaway = options => {
<
div
className=
{
styles
.
takeawayBox
}
>
<
Spin
spinning=
{
loading
}
>
<
GoodsGroup
shopId=
{
shopId
}
changeShop=
{
setShopId
}
changeGroup=
{
setGroupId
}
/>
<
ActionBar
selectedRowKeys=
{
selectedRowKeys
}
shopId=
{
shopId
}
handleSearch=
{
getDataList
}
openModal=
{
openModal
}
newGoods=
{
onNew
}
/>
{
(
shopId
&&
(
<
ActionBar
selectedRowKeys=
{
selectedRowKeys
}
shopId=
{
shopId
}
handleSearch=
{
getDataList
}
openModal=
{
openModal
}
newGoods=
{
onNew
}
/>
))
||
''
}
<
Table
dataSource=
{
tableData
}
bordered
...
...
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