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
03c6c890
Commit
03c6c890
authored
Apr 06, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加新增外卖权限
parent
1cffc854
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
6 deletions
+17
-6
permission.config.js
config/permission.config.js
+1
-0
ActionBar.jsx
src/pages/GoodsManage/Takeaway/components/ActionBar.jsx
+6
-3
MinimumPurchase.jsx
...pages/GoodsManage/Takeaway/components/MinimumPurchase.jsx
+1
-0
index.jsx
src/pages/GoodsManage/Takeaway/index.jsx
+4
-0
index.jsx
src/pages/GoodsManage/index.jsx
+5
-3
No files found.
config/permission.config.js
View file @
03c6c890
...
@@ -5,6 +5,7 @@ export const GOOD_MANAGE = {
...
@@ -5,6 +5,7 @@ export const GOOD_MANAGE = {
EDITABLE
:
'
020102
'
,
// 新增/修改
EDITABLE
:
'
020102
'
,
// 新增/修改
ADD_SERVICE_GOODS
:
'
020103
'
,
// 新增服务商品
ADD_SERVICE_GOODS
:
'
020103
'
,
// 新增服务商品
ADD_NORMAL_GOODS
:
'
020104
'
,
// 新增实物商品
ADD_NORMAL_GOODS
:
'
020104
'
,
// 新增实物商品
ADD_TAKEAWAY_GOODS
:
'
020105
'
,
// 新增外卖商品
};
};
// 配送区域
// 配送区域
...
...
src/pages/GoodsManage/Takeaway/components/ActionBar.jsx
View file @
03c6c890
...
@@ -64,9 +64,12 @@ const ActionBar = options => {
...
@@ -64,9 +64,12 @@ const ActionBar = options => {
return
(
return
(
<
div
className=
{
styles
[
'
action-bar-box
'
]
}
>
<
div
className=
{
styles
[
'
action-bar-box
'
]
}
>
{
(
options
.
canAddTakeaway
&&
(
<
Button
type=
"primary"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
options
.
newGoods
}
>
<
Button
type=
"primary"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
options
.
newGoods
}
>
该分组下新增商品
该分组下新增商品
</
Button
>
</
Button
>
))
||
''
}
<
Dropdown
overlay=
{
menus
}
className=
{
styles
[
'
action-bar-box--down
'
]
}
placement=
"bottomLeft"
>
<
Dropdown
overlay=
{
menus
}
className=
{
styles
[
'
action-bar-box--down
'
]
}
placement=
"bottomLeft"
>
<
Button
type=
"primary"
>
<
Button
type=
"primary"
>
批量操作
<
DownOutlined
/>
批量操作
<
DownOutlined
/>
...
...
src/pages/GoodsManage/Takeaway/components/MinimumPurchase.jsx
View file @
03c6c890
...
@@ -32,6 +32,7 @@ const MinimumPurchase = options => {
...
@@ -32,6 +32,7 @@ const MinimumPurchase = options => {
form=
{
form
}
form=
{
form
}
labelCol=
{
{
span
:
6
}
}
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
16
}
}
wrapperCol=
{
{
span
:
16
}
}
initialValues=
{
{
minPurchaseNum
:
1
}
}
autoComplete=
"off"
autoComplete=
"off"
>
>
<
Form
.
Item
<
Form
.
Item
...
...
src/pages/GoodsManage/Takeaway/index.jsx
View file @
03c6c890
...
@@ -4,6 +4,7 @@ import { unstable_batchedUpdates } from 'react-dom';
...
@@ -4,6 +4,7 @@ import { unstable_batchedUpdates } from 'react-dom';
import
{
MenuOutlined
,
HolderOutlined
,
FormOutlined
,
CloseCircleOutlined
}
from
'
@ant-design/icons
'
;
import
{
MenuOutlined
,
HolderOutlined
,
FormOutlined
,
CloseCircleOutlined
}
from
'
@ant-design/icons
'
;
import
{
SortableContainer
,
SortableElement
,
SortableHandle
}
from
'
react-sortable-hoc
'
;
import
{
SortableContainer
,
SortableElement
,
SortableHandle
}
from
'
react-sortable-hoc
'
;
import
{
arrayMoveImmutable
}
from
'
array-move
'
;
import
{
arrayMoveImmutable
}
from
'
array-move
'
;
import
{
GOOD_MANAGE
}
from
'
@/../config/permission.config
'
;
import
GoodsGroup
from
'
./components/GoodsGroup
'
;
import
GoodsGroup
from
'
./components/GoodsGroup
'
;
import
{
apiTakeawayGoods
,
apiGoodsActionBatch
,
apiSortTakeawayGoods
}
from
'
../service
'
;
import
{
apiTakeawayGoods
,
apiGoodsActionBatch
,
apiSortTakeawayGoods
}
from
'
../service
'
;
import
styles
from
'
../style.less
'
;
import
styles
from
'
../style.less
'
;
...
@@ -174,6 +175,8 @@ const Takeaway = options => {
...
@@ -174,6 +175,8 @@ const Takeaway = options => {
shopId
,
shopId
,
};
};
const
canAddTakeaway
=
options
.
permissions
[
GOOD_MANAGE
.
ADD_TAKEAWAY_GOODS
];
return
(
return
(
<
div
className=
{
styles
.
takeawayBox
}
>
<
div
className=
{
styles
.
takeawayBox
}
>
<
Spin
spinning=
{
loading
}
>
<
Spin
spinning=
{
loading
}
>
...
@@ -182,6 +185,7 @@ const Takeaway = options => {
...
@@ -182,6 +185,7 @@ const Takeaway = options => {
<
ActionBar
<
ActionBar
selectedRowKeys=
{
selectedRowKeys
}
selectedRowKeys=
{
selectedRowKeys
}
shopId=
{
shopId
}
shopId=
{
shopId
}
canAddTakeaway=
{
canAddTakeaway
}
handleSearch=
{
getDataList
}
handleSearch=
{
getDataList
}
openModal=
{
openModal
}
openModal=
{
openModal
}
newGoods=
{
onNew
}
newGoods=
{
onNew
}
...
...
src/pages/GoodsManage/index.jsx
View file @
03c6c890
...
@@ -85,9 +85,9 @@ class goodsManage extends Component {
...
@@ -85,9 +85,9 @@ class goodsManage extends Component {
}
}
handleSearch
=
page
=>
{
handleSearch
=
page
=>
{
const
searchValue
=
this
.
searchForm
.
getFieldsValue
();
const
searchValue
=
this
.
searchForm
.
getFieldsValue
()
||
{}
;
this
.
setState
({
searchValue
});
this
.
setState
({
searchValue
});
if
(
this
.
stat
e
.
productType
!==
5
)
{
if
(
searchValu
e
.
productType
!==
5
)
{
this
.
onSelectChange
([]);
this
.
onSelectChange
([]);
const
currentPage
=
this
.
state
.
pageNo
;
const
currentPage
=
this
.
state
.
pageNo
;
this
.
setState
(
this
.
setState
(
...
@@ -413,10 +413,11 @@ class goodsManage extends Component {
...
@@ -413,10 +413,11 @@ class goodsManage extends Component {
const
canAddService
=
permissions
[
GOOD_MANAGE
.
ADD_SERVICE_GOODS
];
const
canAddService
=
permissions
[
GOOD_MANAGE
.
ADD_SERVICE_GOODS
];
const
canAddNormal
=
permissions
[
GOOD_MANAGE
.
ADD_NORMAL_GOODS
];
const
canAddNormal
=
permissions
[
GOOD_MANAGE
.
ADD_NORMAL_GOODS
];
const
canAddTakeaway
=
permissions
[
GOOD_MANAGE
.
ADD_TAKEAWAY_GOODS
];
this
.
canEditable
=
permissions
[
GOOD_MANAGE
.
EDITABLE
];
this
.
canEditable
=
permissions
[
GOOD_MANAGE
.
EDITABLE
];
return
(
return
(
<
PageHeaderWrapper
>
<
PageHeaderWrapper
>
{
canAddNormal
||
canAddService
{
canAddNormal
||
canAddService
||
canAddTakeaway
?
[
?
[
<
Button
<
Button
type=
"primary"
type=
"primary"
...
@@ -457,6 +458,7 @@ class goodsManage extends Component {
...
@@ -457,6 +458,7 @@ class goodsManage extends Component {
<
Takeaway
<
Takeaway
handleEdit=
{
this
.
handleTakeawayEdit
}
handleEdit=
{
this
.
handleTakeawayEdit
}
searchValue=
{
this
.
state
.
searchValue
}
searchValue=
{
this
.
state
.
searchValue
}
permissions=
{
permissions
}
refresh=
{
this
.
state
.
refresh
}
refresh=
{
this
.
state
.
refresh
}
/>
/>
)
:
(
)
:
(
...
...
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