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
97e42a3b
Commit
97e42a3b
authored
Jun 29, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改获取企业餐段问题
parent
10f7fb21
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
10 deletions
+25
-10
goods.js
src/pages/businessGoods/staticData/goods.js
+2
-2
takeawayGoods.jsx
src/pages/businessGoods/takeawayGoods.jsx
+14
-4
virtualGoods.jsx
src/pages/businessGoods/virtualGoods.jsx
+9
-4
No files found.
src/pages/businessGoods/staticData/goods.js
View file @
97e42a3b
...
...
@@ -65,7 +65,7 @@ export const takeawayGoodsColumn = options => {
hideInTable
:
true
,
valueType
:
'
select
'
,
fieldProps
:
{
value
:
+
enterpriseId
,
value
:
enterpriseId
?
+
enterpriseId
:
null
,
showSearch
:
true
,
filterOption
:
(
v
,
option
)
=>
(
option
?.
label
??
''
).
toLowerCase
().
includes
(
v
.
toLowerCase
()),
onChange
:
onChangeEnterprise
,
...
...
@@ -484,7 +484,7 @@ export const virtualGoodsColumn = options => {
hideInTable
:
true
,
valueType
:
'
select
'
,
fieldProps
:
{
value
:
+
enterpriseId
,
value
:
enterpriseId
?
+
enterpriseId
:
null
,
showSearch
:
true
,
filterOption
:
(
v
,
option
)
=>
(
option
?.
label
??
''
).
toLowerCase
().
includes
(
v
.
toLowerCase
()),
onChange
:
onChangeEnterprise
,
...
...
src/pages/businessGoods/takeawayGoods.jsx
View file @
97e42a3b
...
...
@@ -27,9 +27,9 @@ const TakeawayGoods = () => {
const
[
visibleSaleSection
,
setVisibleSaleSection
]
=
useState
(
false
);
// 可售餐段弹窗
const
[
visiblePrice
,
setVisiblePrice
]
=
useState
(
false
);
// 修改企业商品价格弹窗
const
[
visibleSort
,
setVisibleSort
]
=
useState
(
false
);
// 商品排序弹窗
const
[
enterprises
,
setEnterprises
]
=
useState
(
{}
);
// 企业列表
const
[
enterprises
,
setEnterprises
]
=
useState
(
null
);
// 企业列表
const
[
activeKey
,
setActiveKey
]
=
useState
(
''
);
// 自提点ID
const
[
enterpriseId
,
setEnterpriseId
]
=
useState
();
// 企业ID
const
[
enterpriseId
,
setEnterpriseId
]
=
useState
(
''
);
// 企业ID
const
[
pickSelfList
,
setPickSelfList
]
=
useState
([]);
// 取餐点列表
const
[
recordID
,
setRecordID
]
=
useState
(
''
);
// 编辑的记录ID
const
[
editItem
,
setEditItem
]
=
useState
({});
// 编辑的记录信息
...
...
@@ -137,8 +137,10 @@ const TakeawayGoods = () => {
setEnterprises(obj.list);
setEnterpriseId(`
$
{
obj
.
id
}
`);
await getPickSelf(obj.id);
setPageLoaded(true);
} else if (!enterpriseId) {
notification.error({ message: '未找到企业' });
}
setPageLoaded(true);
};
useEffect(() => {
...
...
@@ -160,6 +162,14 @@ const TakeawayGoods = () => {
onRefresh,
};
let request = () => ({
data: [],
total: 0,
});
if (enterpriseId) {
request = params => searchList({ ...params });
}
return (
<div className={utilStyle.formPageBox}>
{pageLoaded && (
...
...
@@ -173,7 +183,7 @@ const TakeawayGoods = () => {
actionRef={refTable}
tableClassName={utilStyle.formTable}
columns={takeawayGoodsColumn(options)}
request={
params => searchList({ ...params })
}
request={
request
}
rowKey={r => r.id}
bordered
options={false}
...
...
src/pages/businessGoods/virtualGoods.jsx
View file @
97e42a3b
...
...
@@ -14,8 +14,8 @@ const VirtualGoods = () => {
const
history
=
useHistory
();
const
refTable
=
useRef
();
const
[
pageLoaded
,
setPageLoaded
]
=
useState
(
false
);
const
[
enterprises
,
setEnterprises
]
=
useState
(
{}
);
// 企业列表
const
[
enterpriseId
,
setEnterpriseId
]
=
useState
(
);
const
[
enterprises
,
setEnterprises
]
=
useState
(
null
);
// 企业列表
const
[
enterpriseId
,
setEnterpriseId
]
=
useState
(
''
);
// 选中企业ID
// 刷新列表
const
onRefresh
=
()
=>
{
...
...
@@ -90,8 +90,10 @@ const VirtualGoods = () => {
if
(
obj
.
list
&&
Object
.
keys
(
obj
.
list
).
length
)
{
setEnterprises
(
obj
.
list
);
setEnterpriseId
(
`
${
obj
.
id
}
`
);
setPageLoaded
(
true
);
}
else
if
(
!
enterpriseId
)
{
notification
.
error
({
message
:
'
未找到企业
'
});
}
setPageLoaded
(
true
);
};
useEffect
(()
=>
{
...
...
@@ -105,7 +107,10 @@ const VirtualGoods = () => {
onChangeEnterprise
,
};
let
request
=
()
=>
[];
let
request
=
()
=>
({
data
:
[],
total
:
0
,
});
if
(
enterpriseId
)
{
request
=
params
=>
searchList
({
...
params
});
}
...
...
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