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
a2d65120
Commit
a2d65120
authored
Jun 15, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改选择餐段问题
parent
2ed5394b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
26 deletions
+56
-26
GoodSortModal.jsx
src/pages/businessGoods/components/GoodSortModal.jsx
+1
-1
SaleSectionModal.jsx
src/pages/businessGoods/components/SaleSectionModal.jsx
+16
-2
index.js
src/pages/businessGoods/service/index.js
+9
-0
takeawayGoods.jsx
src/pages/businessGoods/takeawayGoods.jsx
+3
-2
takeawayGoodsInfo.jsx
src/pages/businessGoods/takeawayGoodsInfo.jsx
+25
-20
virtualGoodsInfo.jsx
src/pages/businessGoods/virtualGoodsInfo.jsx
+2
-1
No files found.
src/pages/businessGoods/components/GoodSortModal.jsx
View file @
a2d65120
...
...
@@ -48,7 +48,7 @@ const SaleDateModal = props => {
>
<
Form
name=
"basicInfo"
{
...
layout
}
form=
{
form
}
>
<
Form
.
Item
label=
"排序"
name=
"sort"
rules=
{
[{
required
:
true
,
message
:
'
请输入排序!
'
}]
}
>
<
InputNumber
max=
{
999999
}
min=
{
1
}
/>
<
InputNumber
max=
{
999999
}
min=
{
0
}
/>
</
Form
.
Item
>
</
Form
>
</
Modal
>
...
...
src/pages/businessGoods/components/SaleSectionModal.jsx
View file @
a2d65120
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
Checkbox
,
Space
,
Modal
,
notification
,
message
}
from
'
antd
'
;
import
{
mealColumn
}
from
'
../staticData/goods
'
;
import
{
apiMealInfoUpdate
}
from
'
../service
'
;
import
{
apiMealInfoUpdate
,
apiEnterpriseInfo
}
from
'
../service
'
;
const
SaleDateModal
=
props
=>
{
const
[
value
,
setValue
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
tabCateList
,
setTabCateList
]
=
useState
(
Object
.
keys
(
mealColumn
));
// 关闭弹窗
const
handleCancel
=
()
=>
{
...
...
@@ -33,6 +35,16 @@ const SaleDateModal = props => {
props
.
handleRefresh
(
value
);
};
// 获取店铺餐段通过企业ID
const
getEnterpriseMealColumn
=
async
()
=>
{
setLoading
(
true
);
const
res
=
await
apiEnterpriseInfo
(
props
.
enterpriseID
);
setLoading
(
false
);
if
(
res
&&
res
.
data
&&
res
.
data
.
mealTimePeriod
&&
res
.
data
.
mealTimePeriod
.
length
)
{
setTabCateList
(
res
.
data
.
mealTimePeriod
.
map
(
item
=>
item
.
mealPeriodType
));
}
};
useEffect
(()
=>
{
if
(
props
.
visible
)
{
let
v
=
[];
...
...
@@ -46,6 +58,7 @@ const SaleDateModal = props => {
});
}
setValue
(
v
);
getEnterpriseMealColumn
();
}
},
[
props
.
visible
]);
...
...
@@ -57,12 +70,13 @@ const SaleDateModal = props => {
maskClosable=
{
false
}
width=
"200px"
okText=
"保存"
confirmLoading=
{
loading
}
onOk=
{
handleConfirm
}
onCancel=
{
handleCancel
}
>
<
Checkbox
.
Group
onChange=
{
onChangeMeal
}
value=
{
value
}
>
<
Space
direction=
"vertical"
>
{
Object
.
keys
(
mealColumn
)
.
map
(
key
=>
(
{
tabCateList
.
map
(
key
=>
(
<
Checkbox
key=
{
key
}
value=
{
key
}
>
{
mealColumn
[
key
]
}
</
Checkbox
>
...
...
src/pages/businessGoods/service/index.js
View file @
a2d65120
...
...
@@ -162,3 +162,12 @@ export async function apiShopListByPickSelfID(param) {
prefix
:
roleApi
,
});
}
/**
* 企业团餐->根据企业ID 获取企业客户详细
* http://yapi.quantgroups.com/project/389/interface/api/65339
*/
export
async
function
apiEnterpriseInfo
(
id
)
{
return
request
.
get
(
`
${
apiPrefix
}
/enterprise/info?id=
${
id
}
`
,
{
prefix
:
roleApi
,
});
}
src/pages/businessGoods/takeawayGoods.jsx
View file @
a2d65120
...
...
@@ -28,8 +28,8 @@ const TakeawayGoods = () => {
const
[
visiblePrice
,
setVisiblePrice
]
=
useState
(
false
);
// 修改企业商品价格弹窗
const
[
visibleSort
,
setVisibleSort
]
=
useState
(
false
);
// 商品排序弹窗
const
[
enterprises
,
setEnterprises
]
=
useState
({});
// 企业列表
const
[
activeKey
,
setActiveKey
]
=
useState
(
''
);
const
[
enterpriseId
,
setEnterpriseId
]
=
useState
();
const
[
activeKey
,
setActiveKey
]
=
useState
(
''
);
// 自提点ID
const
[
enterpriseId
,
setEnterpriseId
]
=
useState
();
// 企业ID
const
[
pickSelfList
,
setPickSelfList
]
=
useState
([]);
// 取餐点列表
const
[
recordID
,
setRecordID
]
=
useState
(
''
);
// 编辑的记录ID
const
[
editItem
,
setEditItem
]
=
useState
({});
// 编辑的记录信息
...
...
@@ -219,6 +219,7 @@ const TakeawayGoods = () => {
<
SaleSectionModal
visible=
{
visibleSaleSection
}
id=
{
recordID
}
enterpriseID=
{
enterpriseId
}
item=
{
editItem
}
handleRefresh=
{
()
=>
onRefresh
()
}
handleClose=
{
()
=>
setVisibleSaleSection
(
false
)
}
...
...
src/pages/businessGoods/takeawayGoodsInfo.jsx
View file @
a2d65120
import
React
,
{
use
Ref
,
use
State
,
useEffect
}
from
'
react
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
Button
,
notification
,
Spin
,
Select
,
Row
,
Col
,
Table
,
message
}
from
'
antd
'
;
import
{
useHistory
}
from
'
react-router-dom
'
;
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
...
...
@@ -184,24 +184,28 @@ const TakeawayGoodsInfo = props => {
</
Row
>
<
Row
className=
{
style
[
'
info-box--line
'
]
}
>
<
Col
span=
{
24
}
>
<
div
className=
{
style
[
'
info-box--batch-btn
'
]
}
>
<
Button
onClick=
{
()
=>
{
setEditItem
({});
setVisibleSaleDate
(
true
);
}
}
>
批量配置日期
</
Button
>
<
Button
onClick=
{
()
=>
{
setEditItem
({});
setVisibleSaleSection
(
true
);
}
}
>
批量配置餐段
</
Button
>
</
div
>
{
dataSource
&&
dataSource
.
length
?
(
<
div
className=
{
style
[
'
info-box--batch-btn
'
]
}
>
<
Button
onClick=
{
()
=>
{
setEditItem
({});
setVisibleSaleDate
(
true
);
}
}
>
批量配置日期
</
Button
>
<
Button
onClick=
{
()
=>
{
setEditItem
({});
setVisibleSaleSection
(
true
);
}
}
>
批量配置餐段
</
Button
>
</
div
>
)
:
(
''
)
}
<
Table
columns=
{
GoodsInfoColumn
(
options
)
}
pagination=
{
false
}
...
...
@@ -219,7 +223,7 @@ const TakeawayGoodsInfo = props => {
>
确定
</
Button
>
<
Button
onClick=
{
onCancel
}
>
取消
</
Button
>
<
Button
onClick=
{
onCancel
}
>
返回
</
Button
>
</
Col
>
</
Row
>
</
Spin
>
...
...
@@ -236,6 +240,7 @@ const TakeawayGoodsInfo = props => {
{
visibleSaleSection
&&
(
<
SaleSectionModal
visible=
{
visibleSaleSection
}
enterpriseID=
{
id
}
item=
{
editItem
}
handleRefresh=
{
v
=>
refreshList
(
'
tabCate
'
,
v
)
}
handleClose=
{
()
=>
setVisibleSaleSection
(
false
)
}
...
...
src/pages/businessGoods/virtualGoodsInfo.jsx
View file @
a2d65120
...
...
@@ -225,7 +225,7 @@ const VirtualGoodsInfo = props => {
>
确定
</
Button
>
<
Button
onClick=
{
onCancel
}
>
取消
</
Button
>
<
Button
onClick=
{
onCancel
}
>
返回
</
Button
>
</
Col
>
</
Row
>
</
Spin
>
...
...
@@ -243,6 +243,7 @@ const VirtualGoodsInfo = props => {
<
SaleSectionModal
visible=
{
visibleSaleSection
}
item=
{
editItem
}
enterpriseID=
{
id
}
handleRefresh=
{
v
=>
refreshList
(
'
tabCate
'
,
v
)
}
handleClose=
{
()
=>
setVisibleSaleSection
(
false
)
}
/>
...
...
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