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
cac87ce8
Commit
cac87ce8
authored
Jun 09, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加外卖商品列表逻辑
parent
45a70a0a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
169 additions
and
67 deletions
+169
-67
SelectGoodsModal.jsx
src/pages/businessGoods/components/SelectGoodsModal.jsx
+1
-1
api.js
src/pages/businessGoods/service/api.js
+0
-17
bll.js
src/pages/businessGoods/service/bll.js
+11
-0
index.js
src/pages/businessGoods/service/index.js
+85
-0
goods.js
src/pages/businessGoods/staticData/goods.js
+2
-2
takeawayGoods.jsx
src/pages/businessGoods/takeawayGoods.jsx
+70
-47
No files found.
src/pages/businessGoods/components/SelectGoodsModal.jsx
View file @
cac87ce8
import
React
,
{
useState
}
from
'
react
'
;
import
{
Form
,
Select
,
Modal
,
Table
,
Input
,
Button
,
Pagination
}
from
'
antd
'
;
import
{
SearchOutlined
}
from
'
@ant-design/icons
'
;
import
{
apiTakeawayList
}
from
'
../service
/api
'
;
import
{
apiTakeawayList
}
from
'
../service
'
;
import
{
SelectGoodsColumn
}
from
'
../staticData/goods
'
;
import
style
from
'
../style/index.less
'
;
...
...
src/pages/businessGoods/service/api.js
deleted
100644 → 0
View file @
45a70a0a
import
request
from
'
@/utils/request
'
;
import
config
from
'
@/../config/env.config
'
;
// import qs from 'qs';
const
{
kdspApi
,
goodsApi
}
=
config
;
/**
* 获取企业外卖商品列表
* http://yapi.quantgroups.com/project/389/interface/api/64794
*/
export
async
function
apiTakeawayList
(
param
)
{
return
request
.
post
(
'
/v1/channels/products/pick/b/pageList
'
,
{
data
:
param
,
prefix
:
goodsApi
,
});
}
src/pages/businessGoods/service/bll.js
0 → 100644
View file @
cac87ce8
import
{
apiEnterpriseList
}
from
'
./index
'
;
// 获取企业列表
export
const
getEnterpriseList
=
async
(
name
=
''
)
=>
{
const
res
=
await
apiEnterpriseList
({
name
});
return
{
id
:
res
[
res
.
length
-
1
].
id
,
list
:
res
.
map
(
item
=>
({
[
item
.
id
]:
{
text
:
item
.
name
},
})),
};
};
src/pages/businessGoods/service/index.js
0 → 100644
View file @
cac87ce8
import
request
from
'
@/utils/request
'
;
import
config
from
'
@/../config/env.config
'
;
const
{
kdspApi
,
goodsApi
}
=
config
;
/**
* 获取企业外卖商品列表
* http://yapi.quantgroups.com/project/389/interface/api/64794
*/
export
async
function
apiTakeawayList
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/main/pageList
'
,
{
data
:
param
,
prefix
:
goodsApi
,
});
}
/**
* 模糊查询店铺列表
* http://yapi.quantgroups.com/project/389/interface/api/65289
*/
export
async
function
apiEnterpriseList
(
param
)
{
return
request
.
post
(
'
/api/consoles/shops/getListByName
'
,
{
data
:
param
,
prefix
:
goodsApi
,
});
}
/**
* 企业团餐-查询餐段配置
* http://yapi.quantgroups.com/project/389/interface/api/65444
*/
export
async
function
apiMealTimePeriod
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/getMealTimePeriod
'
,
{
data
:
param
,
prefix
:
goodsApi
,
});
}
/**
* 企业团餐->信息修改
* http://yapi.quantgroups.com/project/389/interface/api/65099
*/
export
async
function
apiMealInfoUpdate
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/main/update
'
,
{
data
:
param
,
prefix
:
goodsApi
,
});
}
/**
* 企业团餐->删除
* http://yapi.quantgroups.com/project/389/interface/api/65109
*/
export
async
function
apiMealInfoDel
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/main/deleteById
'
,
{
data
:
param
,
prefix
:
goodsApi
,
});
}
/**
* 企业团餐->根据企业ID查询已选择自提点
* http://yapi.quantgroups.com/project/389/interface/api/65449
*/
export
async
function
apiSelPickSelfList
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/queryByEnterpriseId
'
,
{
data
:
param
,
prefix
:
goodsApi
,
});
}
/**
* 企业团餐->查询商品 - 选择商品弹窗
* http://yapi.quantgroups.com/project/389/interface/api/65479
*/
export
async
function
apiSelGoodsList
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/sku/page
'
,
{
data
:
param
,
prefix
:
goodsApi
,
});
}
/**
* 企业团餐->添加商品保存
* http://yapi.quantgroups.com/project/389/interface/api/65094
*/
export
async
function
apiSaveGoodsList
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/add
'
,
{
data
:
param
,
prefix
:
goodsApi
,
});
}
src/pages/businessGoods/staticData/goods.js
View file @
cac87ce8
...
...
@@ -27,13 +27,13 @@ export const weekOptions = {
};
export
const
takeawayGoodsColumn
=
options
=>
{
const
{
onDel
,
companyEnum
,
shopEnum
,
onChangeFlag
,
setVisibleSaleDate
}
=
options
;
const
{
onDel
,
companyEnum
,
shopEnum
,
onChangeFlag
,
setVisibleSaleDate
,
enterprises
}
=
options
;
return
[
{
title
:
'
企业名称
'
,
dataIndex
:
'
enterpriseId
'
,
hideInTable
:
true
,
valueEnum
:
{}
,
// companyEnum,
valueEnum
:
enterprises
,
// companyEnum,
},
{
title
:
'
微店名称
'
,
...
...
src/pages/businessGoods/takeawayGoods.jsx
View file @
cac87ce8
import
React
,
{
useState
,
useRef
}
from
'
react
'
;
import
React
,
{
useState
,
use
Effect
,
use
Ref
}
from
'
react
'
;
import
{
useHistory
}
from
'
react-router-dom
'
;
import
{
ProTable
}
from
'
@ant-design/pro-components
'
;
import
{
Button
,
Space
}
from
'
antd
'
;
import
{
PlusOutlined
}
from
'
@ant-design/icons
'
;
import
{
takeawayGoodsColumn
}
from
'
./staticData/goods
'
;
import
utilStyle
from
'
@/utils/utils.less
'
;
import
{
apiTakeawayList
}
from
'
./service/api
'
;
import
{
apiTakeawayList
}
from
'
./service
'
;
import
{
getEnterpriseList
}
from
'
./service/bll
'
;
import
SaleDateModal
from
'
./components/SaleDateModal
'
;
import
SaleSectionModal
from
'
./components/SaleSectionModal
'
;
import
GoodPriceModal
from
'
./components/GoodPriceModal
'
;
...
...
@@ -14,19 +15,22 @@ import { getToUrlQuery } from '@/utils/utils';
const
BusinessCustomer
=
()
=>
{
const
history
=
useHistory
();
const
refTable
=
useRef
();
const
[
pageLoading
,
setPageLoading
]
=
useState
(
false
);
// 可售日期弹窗
const
[
visibleSaleDate
,
setVisibleSaleDate
]
=
useState
(
false
);
// 可售日期弹窗
const
[
visibleSaleSection
,
setVisibleSaleSection
]
=
useState
(
false
);
// 可售餐段弹窗
const
[
visiblePrice
,
setVisiblePrice
]
=
useState
(
false
);
// 修改企业商品价格弹窗
const
[
visibleSort
,
setVisibleSort
]
=
useState
(
false
);
// 商品排序弹窗
const
[
visibleGoods
,
setVisibleGoods
]
=
useState
(
false
);
// 添加外卖商品弹窗
const
[
enterprises
,
setEnterprises
]
=
useState
([]);
// 企业列表
const
[
activeKey
,
setActiveKey
]
=
useState
(
'
tab1
'
);
const
[
enterpriseId
,
setEnterpriseId
]
=
useState
(
'
10
'
);
const
searchList
=
async
params
=>
{
const
data
=
{
page
:
params
.
current
,
size
:
params
.
pageSize
,
data
:
params
,
};
//
return apiTakeawayList(data);
return
apiTakeawayList
(
data
);
};
const
onDel
=
async
()
=>
{};
const
onAdd
=
async
()
=>
{
...
...
@@ -41,12 +45,28 @@ const BusinessCustomer = () => {
setVisibleSaleSection
,
setVisiblePrice
,
setVisibleSort
,
setVisibleGoods
,
onDel
,
enterprises
,
};
// 获取企业列表
const
getList
=
async
name
=>
{
const
obj
=
getEnterpriseList
(
name
);
setEnterprises
(
obj
.
list
);
setEnterpriseId
(
obj
.
id
);
setPageLoading
(
true
);
};
useEffect
(()
=>
{
getList
(
''
);
// setTimeout(() => {
// // refTable.current.reload();
// }, 1000);
},
[]);
return
(
<
div
>
{
pageLoading
&&
(
<
ProTable
search=
{
{
span
:
6
,
...
...
@@ -54,6 +74,7 @@ const BusinessCustomer = () => {
collapsed
:
false
,
collapseRender
:
()
=>
null
,
}
}
actionRef=
{
refTable
}
tableClassName=
{
utilStyle
.
formTable
}
columns=
{
takeawayGoodsColumn
(
options
)
}
request=
{
params
=>
searchList
({
...
params
})
}
...
...
@@ -61,6 +82,7 @@ const BusinessCustomer = () => {
expandIconColumnIndex=
{
10
}
bordered
options=
{
false
}
form=
{
{
initialValues
:
{
enterpriseId
}
}
}
toolbar=
{
{
menu
:
{
type
:
'
tab
'
,
...
...
@@ -91,6 +113,7 @@ const BusinessCustomer = () => {
}
}
scroll=
{
{
x
:
'
100%
'
,
y
:
400
}
}
/>
)
}
{
/* 可售日期弹窗 */
}
{
visibleSaleDate
&&
(
<
SaleDateModal
visible=
{
visibleSaleDate
}
handleClose=
{
()
=>
setVisibleSaleDate
(
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