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
5b5381e5
Commit
5b5381e5
authored
Mar 14, 2023
by
陈万宝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增份量单位
parent
2e5a3edf
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
825 additions
and
26 deletions
+825
-26
common.less
src/pages/ServiceGoods/common.less
+45
-0
AddMenusModal.jsx
src/pages/ServiceGoods/components/AddMenusModal.jsx
+28
-17
AddMultiSpecModal.jsx
src/pages/ServiceGoods/components/AddMultiSpecModal.jsx
+93
-0
AddRepertoryModal.jsx
src/pages/ServiceGoods/components/AddRepertoryModal.jsx
+93
-0
AddSellTimeModal.jsx
src/pages/ServiceGoods/components/AddSellTimeModal.jsx
+53
-0
FormInformationBasic.jsx
src/pages/ServiceGoods/components/FormInformationBasic.jsx
+38
-7
FormTakeaway.jsx
src/pages/ServiceGoods/components/FormTakeaway.jsx
+449
-0
config.js
src/pages/ServiceGoods/config.js
+8
-0
index.jsx
src/pages/ServiceGoods/index.jsx
+18
-2
No files found.
src/pages/ServiceGoods/common.less
View file @
5b5381e5
...
...
@@ -186,3 +186,48 @@
color: #0e75fd;
cursor: pointer;
}
.required {
:global {
.ant-form-item-label > {
::before {
display: inline-block;
margin-right: 4px;
color: #ff4d4f;
font-size: 14px;
font-family: SimSun, sans-serif;
line-height: 1;
content: '*';
}
}
.ant-form-item {
margin-bottom: 0;
}
}
}
.itemInline {
:global {
.ant-form-item-control-input-content {
display: flex;
}
.ant-form-item {
margin-bottom: 0;
}
}
}
.textStyle{
color: red;
}
.multiSpecification {
display: flex;
flex-flow: row wrap;
}
.specRepertory {
width: 50px;
background-color: #319bfe;
border-radius: 25px;
color: #fff;
height: 20px;
line-height: 20px;
text-align: center;
}
src/pages/ServiceGoods/components/AddMenusModal.jsx
View file @
5b5381e5
import
React
,
{
useState
,
useEffect
,
forwardRef
}
from
'
react
'
;
import
React
,
{
useState
,
useEffect
,
forwardRef
,
useRef
,
useImperativeHandle
}
from
'
react
'
;
import
{
Button
,
Modal
}
from
'
antd
'
;
const
AddMenusModal
=
props
=>
{
const
AddMenusModal
=
(
props
,
ref
)
=>
{
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
modalText
,
setModalText
]
=
useState
(
'
Content of the modal
'
);
const
{
open
,
setOpen
}
=
props
;
const
[
open
,
setOpen
]
=
useState
(
false
);
// const {
// open,
// setOpen,
// } = props;
useImperativeHandle
(
ref
,
()
=>
({
// changeVal 就是暴露给父组件的方法
setOpen
:
newVal
=>
{
setOpen
(
newVal
)
},
}));
const
handleOk
=
()
=>
{
setModalText
(
'
The modal will be closed after two seconds
'
);
setConfirmLoading
(
true
);
...
...
@@ -18,25 +31,23 @@ const AddMenusModal = props => {
console
.
log
(
'
Clicked cancel button
'
);
setOpen
(
false
);
};
useEffect
(()
=>
{
useEffect
(()
=>
{
console
.
log
(
'
open
'
,
open
);
},
[
open
]);
},
[
open
])
return
(
<>
{
open
&&
222
}
{
open
&&
(
<
Modal
title=
"Title"
open=
{
open
}
onOk=
{
handleOk
}
confirmLoading=
{
confirmLoading
}
onCancel=
{
handleCancel
}
>
<
p
>
{
modalText
}
</
p
>
</
Modal
>
)
}
{
open
&&
<
Modal
title=
"Title"
visible=
{
open
}
onOk=
{
handleOk
}
confirmLoading=
{
confirmLoading
}
onCancel=
{
handleCancel
}
>
<
p
>
{
modalText
}
</
p
>
</
Modal
>
}
</>
);
};
export
default
forwardRef
(
AddMenusModal
);
src/pages/ServiceGoods/components/AddMultiSpecModal.jsx
0 → 100644
View file @
5b5381e5
import
React
,
{
useState
,
useEffect
,
forwardRef
,
useRef
,
useImperativeHandle
}
from
'
react
'
;
import
{
Button
,
Modal
,
Radio
,
Form
,
InputNumber
,
Switch
}
from
'
antd
'
;
import
styles
from
'
../common.less
'
;
import
{
ENUM_SET_REPERTORY
}
from
'
../config
'
;
const
AddRepertoryModal
=
(
props
,
ref
)
=>
{
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
modalText
,
setModalText
]
=
useState
(
'
Content of the modal
'
);
const
[
openRepertory
,
setOpenRepertory
]
=
useState
(
false
);
// const {
// open,
// setOpen,
// } = props;
useImperativeHandle
(
ref
,
()
=>
({
// changeVal 就是暴露给父组件的方法
setOpenRepertory
:
newVal
=>
{
setOpenRepertory
(
newVal
);
},
}));
const
onChange3
=
()
=>
{};
const
handleOk
=
()
=>
{
setModalText
(
'
The modal will be closed after two seconds
'
);
setConfirmLoading
(
true
);
setTimeout
(()
=>
{
setOpenRepertory
(
false
);
setConfirmLoading
(
false
);
},
2000
);
};
const
handleCancel
=
()
=>
{
console
.
log
(
'
Clicked cancel button
'
);
setOpenRepertory
(
false
);
};
useEffect
(()
=>
{
console
.
log
(
'
open
'
,
openRepertory
);
},
[
openRepertory
]);
return
(
<>
{
openRepertory
&&
(
<
Modal
title=
"修改库存"
visible=
{
openRepertory
}
onOk=
{
handleOk
}
confirmLoading=
{
confirmLoading
}
onCancel=
{
handleCancel
}
>
<
Form
>
<
Form
.
Item
className=
{
styles
.
itemInline
}
>
<
Form
.
Item
name=
"receptionVolume"
label=
"剩余库存"
style=
{
{
display
:
'
flex
'
,
marginRight
:
'
8px
'
,
}
}
rules=
{
[{
required
:
true
,
message
:
'
请填写剩余库存
'
}]
}
>
<
InputNumber
min=
{
1
}
style=
{
{
width
:
200
,
display
:
'
inline-block
'
}
}
placeholder=
"请输入"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"limitPurchase"
style=
{
{
width
:
200
,
display
:
'
inline-block
'
}
}
>
<
Radio
.
Group
options=
{
ENUM_SET_REPERTORY
}
onChange=
{
onChange3
}
value=
{
1
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
name=
"receptionVolume"
label=
"最大库存"
rules=
{
[{
required
:
true
,
message
:
'
请填写最大库存
'
}]
}
>
<
InputNumber
min=
{
1
}
style=
{
{
width
:
200
}
}
placeholder=
"请输入"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"receptionVolume"
label=
"自动补足"
>
<
Switch
checkedChildren=
"开启"
unCheckedChildren=
"关闭"
defaultChecked
onChange=
{
onChange3
}
/>
</
Form
.
Item
>
<
div
className=
{
styles
.
textStyle
}
>
修改成功后,原库存将被替换,请谨慎操作!
</
div
>
</
Form
>
</
Modal
>
)
}
</>
);
};
export
default
forwardRef
(
AddRepertoryModal
);
src/pages/ServiceGoods/components/AddRepertoryModal.jsx
0 → 100644
View file @
5b5381e5
import
React
,
{
useState
,
useEffect
,
forwardRef
,
useRef
,
useImperativeHandle
}
from
'
react
'
;
import
{
Button
,
Modal
,
Radio
,
Form
,
InputNumber
,
Switch
}
from
'
antd
'
;
import
styles
from
'
../common.less
'
;
import
{
ENUM_SET_REPERTORY
}
from
'
../config
'
;
const
AddRepertoryModal
=
(
props
,
ref
)
=>
{
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
modalText
,
setModalText
]
=
useState
(
'
Content of the modal
'
);
const
[
openRepertory
,
setOpenRepertory
]
=
useState
(
false
);
// const {
// open,
// setOpen,
// } = props;
useImperativeHandle
(
ref
,
()
=>
({
// changeVal 就是暴露给父组件的方法
setOpenRepertory
:
newVal
=>
{
setOpenRepertory
(
newVal
);
},
}));
const
onChange3
=
()
=>
{};
const
handleOk
=
()
=>
{
setModalText
(
'
The modal will be closed after two seconds
'
);
setConfirmLoading
(
true
);
setTimeout
(()
=>
{
setOpenRepertory
(
false
);
setConfirmLoading
(
false
);
},
2000
);
};
const
handleCancel
=
()
=>
{
console
.
log
(
'
Clicked cancel button
'
);
setOpenRepertory
(
false
);
};
useEffect
(()
=>
{
console
.
log
(
'
open
'
,
openRepertory
);
},
[
openRepertory
]);
return
(
<>
{
openRepertory
&&
(
<
Modal
title=
"修改库存"
visible=
{
openRepertory
}
onOk=
{
handleOk
}
confirmLoading=
{
confirmLoading
}
onCancel=
{
handleCancel
}
>
<
Form
>
<
Form
.
Item
className=
{
styles
.
itemInline
}
>
<
Form
.
Item
name=
"receptionVolume"
label=
"剩余库存"
style=
{
{
display
:
'
flex
'
,
marginRight
:
'
8px
'
,
}
}
rules=
{
[{
required
:
true
,
message
:
'
请填写剩余库存
'
}]
}
>
<
InputNumber
min=
{
1
}
style=
{
{
width
:
200
,
display
:
'
inline-block
'
}
}
placeholder=
"请输入"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"limitPurchase"
style=
{
{
width
:
200
,
display
:
'
inline-block
'
}
}
>
<
Radio
.
Group
options=
{
ENUM_SET_REPERTORY
}
onChange=
{
onChange3
}
value=
{
1
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
name=
"receptionVolume"
label=
"最大库存"
rules=
{
[{
required
:
true
,
message
:
'
请填写最大库存
'
}]
}
>
<
InputNumber
min=
{
1
}
style=
{
{
width
:
200
}
}
placeholder=
"请输入"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"receptionVolume"
label=
"自动补足"
>
<
Switch
checkedChildren=
"开启"
unCheckedChildren=
"关闭"
defaultChecked
onChange=
{
onChange3
}
/>
</
Form
.
Item
>
<
div
className=
{
styles
.
textStyle
}
>
修改成功后,原库存将被替换,请谨慎操作!
</
div
>
</
Form
>
</
Modal
>
)
}
</>
);
};
export
default
forwardRef
(
AddRepertoryModal
);
src/pages/ServiceGoods/components/AddSellTimeModal.jsx
0 → 100644
View file @
5b5381e5
import
React
,
{
useState
,
useEffect
,
forwardRef
,
useRef
,
useImperativeHandle
}
from
'
react
'
;
import
{
Button
,
Modal
}
from
'
antd
'
;
const
AddSellTimeModal
=
(
props
,
ref
)
=>
{
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
modalText
,
setModalText
]
=
useState
(
'
Content of the modal
'
);
const
[
open
,
setOpen
]
=
useState
(
false
);
// const {
// open,
// setOpen,
// } = props;
useImperativeHandle
(
ref
,
()
=>
({
// changeVal 就是暴露给父组件的方法
setOpen
:
newVal
=>
{
setOpen
(
newVal
)
},
}));
const
handleOk
=
()
=>
{
setModalText
(
'
The modal will be closed after two seconds
'
);
setConfirmLoading
(
true
);
setTimeout
(()
=>
{
setOpen
(
false
);
setConfirmLoading
(
false
);
},
2000
);
};
const
handleCancel
=
()
=>
{
console
.
log
(
'
Clicked cancel button
'
);
setOpen
(
false
);
};
useEffect
(()
=>
{
console
.
log
(
'
open
'
,
open
);
},
[
open
])
return
(
<>
{
open
&&
<
Modal
title=
"Title"
visible=
{
open
}
onOk=
{
handleOk
}
confirmLoading=
{
confirmLoading
}
onCancel=
{
handleCancel
}
>
<
p
>
{
modalText
}
</
p
>
</
Modal
>
}
</>
);
};
export
default
forwardRef
(
AddSellTimeModal
);
src/pages/ServiceGoods/components/FormInformationBasic.jsx
View file @
5b5381e5
...
...
@@ -6,11 +6,12 @@ import React, {
useImperativeHandle
,
useRef
,
}
from
'
react
'
;
import
{
Cascader
,
Form
,
Input
,
Select
,
Popover
,
Button
,
Checkbox
,
Divider
}
from
'
antd
'
;
import
{
Cascader
,
Form
,
Input
,
Select
,
Popover
,
Button
,
Checkbox
,
Divider
,
Modal
}
from
'
antd
'
;
import
{
formItemLayout
}
from
'
../config
'
;
import
{
ServiceContext
}
from
'
../context
'
;
import
{
debounce
}
from
'
@/utils/utils
'
;
import
AddMenusModal
from
'
./AddMenusModal
'
;
import
UploadImage
from
'
./UploadImage
'
;
const
CreateSelectOption
=
optionList
=>
optionList
.
map
(
brandItem
=>
(
...
...
@@ -39,7 +40,8 @@ const FormInformationBasic = forwardRef((props, ref) => {
const
[
noreBrandList
,
setNoreBrandList
]
=
useState
([]);
const
customer
=
useContext
(
ServiceContext
);
const
childAddMenusModalRef
=
useRef
(
null
);
const
[
open
,
setOpen
]
=
useState
(
false
);
const
[
cardImageList
,
setCardImageList
]
=
useState
([]);
const
onCheck
=
async
()
=>
{
try
{
const
values
=
await
form
.
validateFields
();
...
...
@@ -62,12 +64,11 @@ const FormInformationBasic = forwardRef((props, ref) => {
return
null
;
}
};
// 自定义加入菜单
const
showModal
=
()
=>
{
setOpen
(
true
);
console
.
log
(
'
3333
'
,
open
);
childAddMenusModalRef
.
current
.
setOpen
(
true
);
};
// 自定义下拉
// 自定义
菜单
下拉
const
dropdownRender
=
menus
=>
(
<
div
>
{
menus
}
...
...
@@ -89,6 +90,12 @@ const FormInformationBasic = forwardRef((props, ref) => {
</
div
>
</
div
>
);
const
onCardSuccessImageList
=
imgList
=>
{
setCardImageList
(
imgList
);
form
.
setFieldsValue
({
cardImageList
:
imgList
,
});
};
const
getFormValues
=
debounce
(()
=>
{
const
values
=
form
.
getFieldsValue
();
props
.
onValuesChange
({
infoMation
:
values
});
...
...
@@ -158,7 +165,8 @@ const FormInformationBasic = forwardRef((props, ref) => {
</
Form
.
Item
>
)
}
{
/* 新增菜单分组弹框 */
}
<
AddMenusModal
open=
{
open
}
ref=
{
childAddMenusModalRef
}
/>
<
AddMenusModal
ref=
{
childAddMenusModalRef
}
/>
<
Form
.
Item
name=
"categoryId"
label=
"商品类目"
...
...
@@ -173,6 +181,29 @@ const FormInformationBasic = forwardRef((props, ref) => {
options=
{
newCategoryList
[
customer
.
productType
]
}
/>
</
Form
.
Item
>
{
/* 外卖-商品图片 */
}
{
customer
.
isTakeawayService
&&
(
<
Form
.
Item
name=
"cardImageList"
label=
"商品图片"
extra=
"支持.jpg/png格式图片,建议单张比例1:1,大小200kb左右,最多可以上传5张"
rules=
{
[
{
required
:
true
,
type
:
'
array
'
,
message
:
'
请上传商品图片!
'
,
},
]
}
>
<
UploadImage
name=
"cardImageList"
limit=
{
5
}
disabled=
{
customer
.
isDisabled
}
pictures=
{
cardImageList
}
setPictureList=
{
list
=>
onCardSuccessImageList
(
list
)
}
/>
</
Form
.
Item
>
)
}
{
!
customer
.
isTakeawayService
&&
!
customer
.
isCard
&&
(
<
Form
.
Item
...
...
src/pages/ServiceGoods/components/FormTakeaway.jsx
0 → 100644
View file @
5b5381e5
import
React
,
{
useContext
,
useState
,
useEffect
,
forwardRef
,
useImperativeHandle
,
useRef
,
}
from
'
react
'
;
import
{
Form
,
Input
,
Select
,
Button
,
Checkbox
,
Radio
,
Space
,
Modal
,
Switch
,
InputNumber
,
Cascader
,
Divider
,
}
from
'
antd
'
;
import
{
MinusCircleOutlined
,
PlusOutlined
}
from
'
@ant-design/icons
'
;
import
{
Title
}
from
'
./CommonTemplate
'
;
import
{
formItemLayout
,
ENUM_REPERTORY
,
ENUM_SET_REPERTORY
}
from
'
../config
'
;
import
{
ServiceContext
}
from
'
../context
'
;
import
{
debounce
}
from
'
@/utils/utils
'
;
import
UploadImage
from
'
./UploadImage
'
;
import
AddSellTimeModal
from
'
./AddSellTimeModal
'
;
import
styles
from
'
../common.less
'
;
import
AddRepertoryModal
from
'
./AddRepertoryModal
'
;
import
AddMultiSpecModal
from
'
./AddMultiSpecModal
'
;
const
createInitValues
=
()
=>
({
settlementMethod
:
1
,
limitPurchase
:
null
,
// 是否限购1:限购/0:不限购
limitPurchaseType
:
null
,
// 限购类型,如果限购必填1:长期限购/2:周期限购
limitPurchaseCycle
:
null
,
// 限购周期1:每天/7:7天/30:30天
limitPurchaseQuantity
:
null
,
// 限购数量
packageContent
:
''
,
appointment
:
null
,
// 预约
receptionVolume
:
null
,
});
const
TakeawayGoodsInfo
=
forwardRef
((
props
,
ref
)
=>
{
const
{
editData
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
[
initValue
,
setInitValue
]
=
useState
(
createInitValues
());
const
customer
=
useContext
(
ServiceContext
);
const
[
cardImageList
,
setCardImageList
]
=
useState
([]);
const
[
newCategoryList
,
setNewCategoryList
]
=
useState
({});
const
addSellTimeRef
=
useRef
(
null
);
const
AddRepertoryRef
=
useRef
(
null
);
const
AddMultiSpecRef
=
useRef
(
null
);
// 自定义加入菜单
const
showModal
=
()
=>
{
addSellTimeRef
.
current
.
setOpen
(
true
);
};
const
onCheck
=
async
()
=>
{
try
{
const
values
=
await
form
.
validateFields
();
return
{
...
values
,
temp
:
'
settlementItem
'
,
limitPurchase
:
values
.
limitPurchase
?
1
:
0
,
};
}
catch
(
errorInfo
)
{
return
null
;
}
};
const
getFormValues
=
debounce
(()
=>
{
const
values
=
form
.
getFieldsValue
();
props
.
onValuesChange
({
settlementItem
:
values
});
},
400
);
const
fileterBrandOptions
=
(
input
,
options
)
=>
options
.
children
.
includes
(
input
);
const
filterCategoryOptions
=
(
inputValue
,
path
)
=>
path
.
some
(
option
=>
option
.
name
.
toLowerCase
().
indexOf
(
inputValue
.
toLowerCase
())
>
-
1
);
useEffect
(()
=>
{
if
(
customer
.
isEdit
||
customer
.
isUseCache
)
{
if
(
!
editData
)
return
;
form
.
setFieldsValue
(
editData
);
setInitValue
({
...
editData
});
}
},
[
customer
.
isEdit
,
customer
.
isUseCache
,
editData
]);
useImperativeHandle
(
ref
,
()
=>
({
onCheck
,
reset
:
()
=>
{
setInitValue
(
createInitValues
());
form
.
resetFields
();
},
}));
// 上传图片
const
onCardSuccessImageList
=
imgList
=>
{
setCardImageList
(
imgList
);
form
.
setFieldsValue
({
cardImageList
:
imgList
,
});
};
const
radioChangeEvent
=
key
=>
{
const
value
=
form
.
getFieldValue
(
key
);
setInitValue
({
...
initValue
,
[
key
]:
value
,
});
};
// 自定义菜单下拉
const
dropdownRender
=
menus
=>
(
<
div
>
{
menus
}
<
Divider
style=
{
{
margin
:
0
,
}
}
/>
<
div
style=
{
{
padding
:
8
,
background
:
'
#1890ff
'
,
color
:
'
#fff
'
,
textAlign
:
'
center
'
,
}
}
onClick=
{
showModal
}
>
添加自定售卖时间
</
div
>
</
div
>
);
const
onChange3
=
()
=>
{};
// 显示加入库存弹框
const
showAddRepertoryModal
=
()
=>
{
AddRepertoryRef
.
current
.
setOpenRepertory
(
true
);
};
const
onFinish
=
values
=>
{
console
.
log
(
'
Received values of form:
'
,
values
);
};
return
(
<>
<
Form
{
...
formItemLayout
}
form=
{
form
}
name=
"register"
initialValues=
{
initValue
}
scrollToFirstError
onValuesChange=
{
getFormValues
}
>
<
Title
title=
"商品详细信息"
/>
<
Form
.
Item
name=
"receptionVolume"
label=
"商品描述"
>
<
Input
.
TextArea
showCount
maxLength=
{
200
}
style=
{
{
width
:
400
}
}
placeholder=
"请输入商品描述"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"cardImageList"
label=
"商品图片"
extra=
"支持.jpg/png格式图片,建议单张切片宽750像素,大小200kb左右,您可以拖拽图片调整顺序,最多上传5张。"
// rules={[
// {
// required: true,
// type: 'array',
// message: '请上传商品图片!',
// },
// ]}
>
<
UploadImage
name=
"cardImageList"
limit=
{
5
}
disabled=
{
customer
.
isDisabled
}
pictures=
{
cardImageList
}
setPictureList=
{
list
=>
onCardSuccessImageList
(
list
)
}
/>
</
Form
.
Item
>
<
Title
title=
"商品售卖信息"
/>
<
Form
.
Item
name=
"receptionVolume"
label=
"最少购买"
// rules={[{ required: true, message: '每日最低接待量' }]}
>
<
InputNumber
min=
{
1
}
style=
{
{
width
:
200
}
}
placeholder=
"请输入购买量"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"categoryId"
label=
"售卖时间"
// rules={[{ type: 'array', required: true, message: '请输入售卖时间!' }]}
>
<
Select
placeholder=
"请选择售卖时间!"
style=
{
{
width
:
200
}
}
disabled=
{
customer
.
isEdit
&&
customer
.
isNormal
}
// showSearch={{ filter: filterCategoryOptions }}
// fieldNames={{ label: 'name', value: 'id', children: 'children' }}
// onChange={props.onCategoryChange}
options=
{
[
{
value
:
'
全时段
'
,
label
:
'
全时段
'
,
},
]
}
dropdownRender=
{
dropdownRender
}
/>
</
Form
.
Item
>
<
AddSellTimeModal
ref=
{
addSellTimeRef
}
></
AddSellTimeModal
>
<
Form
.
Item
name=
"categoryId"
label=
"商品标签"
// rules={[{ type: 'array', required: true, message: '请输入售卖时间!' }]}
>
<
Select
placeholder=
"请选择售卖时间!"
style=
{
{
width
:
200
}
}
disabled=
{
customer
.
isEdit
&&
customer
.
isNormal
}
// showSearch={{ filter: filterCategoryOptions }}
// fieldNames={{ label: 'name', value: 'id', children: 'children' }}
// onChange={props.onCategoryChange}
options=
{
[
{
value
:
'
招牌
'
,
label
:
'
招牌
'
,
},
]
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"appointment"
label=
"单点不送"
>
<
Radio
.
Group
>
<
Radio
value=
{
1
}
>
是
</
Radio
>
<
Radio
value=
{
0
}
>
否
</
Radio
>
</
Radio
.
Group
>
开启后顾客点单则此商品不可下单
</
Form
.
Item
>
<
Form
.
Item
name=
"appointment"
label=
"列出商品"
>
<
Radio
.
Group
>
<
Radio
value=
{
1
}
>
是
</
Radio
>
<
Radio
value=
{
0
}
>
否
</
Radio
>
</
Radio
.
Group
>
开启后平台展示商品
</
Form
.
Item
>
<
Title
title=
"规格信息"
/>
<
Form
.
Item
label=
"份量"
className=
{
styles
.
required
}
>
<
Form
.
Item
name=
"receptionVolume"
style=
{
{
display
:
'
inline-block
'
,
}
}
rules=
{
[{
required
:
true
,
message
:
'
请输入分量
'
}]
}
>
<
InputNumber
min=
{
1
}
style=
{
{
width
:
200
}
}
placeholder=
"请输入数字"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"categoryId"
rules=
{
[{
type
:
'
array
'
,
required
:
true
,
message
:
'
请选择单位
'
}]
}
style=
{
{
display
:
'
inline-block
'
,
margin
:
'
0 8px
'
,
}
}
>
<
Cascader
placeholder=
"请选择单位"
disabled=
{
customer
.
isEdit
&&
customer
.
isNormal
}
showSearch=
{
{
filter
:
filterCategoryOptions
}
}
fieldNames=
{
{
label
:
'
name
'
,
value
:
'
id
'
,
children
:
'
children
'
}
}
onChange=
{
props
.
onCategoryChange
}
options=
{
newCategoryList
[
customer
.
productType
]
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
name=
"销售价格"
label=
"销售价格"
rules=
{
[{
required
:
true
,
message
:
'
请输入销售价格
'
}]
}
>
<
InputNumber
min=
{
0
}
style=
{
{
width
:
200
}
}
placeholder=
"元"
/>
</
Form
.
Item
>
{
/* <Form.Item label="限购" name="limitPurchase" valuePropName="checked">
<Checkbox onChange={() => radioChangeEvent('limitPurchase')}>
<b style={{ marginLeft: 10 }}>启用限购</b>
<span style={{ marginLeft: 10 }} className="ant-form-text">
限制每人可购买数量
</span>
</Checkbox>
</Form.Item> */
}
<
Form
.
Item
label=
"库存"
name=
"limitPurchase"
>
<
Radio
.
Group
options=
{
ENUM_REPERTORY
}
onChange=
{
onChange3
}
value=
{
1
}
buttonStyle=
"solid"
optionType=
"button"
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"单规格"
>
<
Button
type=
"primary"
size=
"small"
onClick=
{
()
=>
{
showAddRepertoryModal
(
true
);
}
}
shape=
"round"
>
添加规格
</
Button
>
</
Form
.
Item
>
<
Form
.
Item
label=
"多规格"
>
<
Button
type=
"primary"
size=
"small"
onClick=
{
()
=>
{
showAddRepertoryModal
(
true
);
}
}
shape=
"round"
>
添加规格
</
Button
>
<
Form
.
Item
name=
"receptionVolume"
label=
"多规格库存"
className=
{
styles
.
multiSpecification
}
>
<
Button
size=
"small"
style=
{
{
marginBottom
:
'
10px
'
}
}
shape=
"round"
>
一键设置库存
</
Button
>
<
Form
.
Item
label=
"多规格1"
>
<
div
className=
{
styles
.
specRepertory
}
onClick=
{
()
=>
{
showAddRepertoryModal
(
true
);
}
}
>
1/3
</
div
>
</
Form
.
Item
>
</
Form
.
Item
>
</
Form
.
Item
>
{
/* 33333 */
}
<
Form
.
Item
>
<
div
>
份量(如大小/小份、微辣/特辣)
</
div
>
<
Form
.
List
name=
"users"
>
{
(
fields
,
{
add
,
remove
})
=>
(
<>
{
fields
.
map
(({
key
,
name
,
...
restField
})
=>
(
<
Space
key=
{
key
}
style=
{
{
display
:
'
flex
'
,
marginBottom
:
8
,
}
}
align=
"baseline"
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'
first
'
]
}
rules=
{
[
{
required
:
true
,
message
:
'
Missing first name
'
,
},
]
}
>
<
Input
placeholder=
"名称"
/>
</
Form
.
Item
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'
last
'
]
}
rules=
{
[
{
required
:
true
,
message
:
'
Missing last name
'
,
},
]
}
>
<
Input
placeholder=
"约 份量(数字)"
/>
</
Form
.
Item
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'
last
'
]
}
rules=
{
[
{
required
:
true
,
message
:
'
Missing last name
'
,
},
]
}
>
<
Input
placeholder=
"约 份量(数字)"
/>
</
Form
.
Item
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'
last
'
]
}
rules=
{
[
{
required
:
true
,
message
:
'
Missing last name
'
,
},
]
}
>
<
Input
placeholder=
"销售价(元)"
/>
</
Form
.
Item
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'
last
'
]
}
rules=
{
[
{
required
:
true
,
message
:
'
Missing last name
'
,
},
]
}
>
<
Input
placeholder=
"活动价(元)"
/>
</
Form
.
Item
>
<
MinusCircleOutlined
onClick=
{
()
=>
remove
(
name
)
}
/>
</
Space
>
))
}
<
Form
.
Item
>
<
Button
type=
"dashed"
onClick=
{
()
=>
add
()
}
block
icon=
{
<
PlusOutlined
/>
}
>
Add field
</
Button
>
</
Form
.
Item
>
</>
)
}
</
Form
.
List
>
</
Form
.
Item
>
</
Form
>
{
/* 加入库存 */
}
<
AddRepertoryModal
ref=
{
AddRepertoryRef
}
/>
{
/* 加入多规格 */
}
<
AddMultiSpecModal
ref=
{
AddMultiSpecRef
}
/>
</>
);
});
export
default
TakeawayGoodsInfo
;
src/pages/ServiceGoods/config.js
View file @
5b5381e5
...
...
@@ -323,3 +323,11 @@ export const StaticColumns = customer => [
disabeldRender
:
()
=>
customer
.
isDisabled
,
},
];
export
const
ENUM_REPERTORY
=
[
{
label
:
'
单规格
'
,
value
:
'
单规格
'
},
{
label
:
'
多规格
'
,
value
:
'
多规格
'
},
]
export
const
ENUM_SET_REPERTORY
=
[
{
label
:
'
清零
'
,
value
:
'
清零
'
},
{
label
:
'
最大
'
,
value
:
'
最大
'
},
]
src/pages/ServiceGoods/index.jsx
View file @
5b5381e5
...
...
@@ -9,6 +9,7 @@ import FormRuleSetting from './components/FormRuleSetting';
import
FormRuleVPictures
from
'
./components/FormRuleVPictures
'
;
import
FormSettlementOthers
from
'
./components/FormSettlementOthers
'
;
import
FormAttr
from
'
./components/FormAttr
'
;
import
FormTakeaway
from
'
./components/FormTakeaway
'
;
import
localStorage
from
'
@/utils/localStorage
'
;
import
{
merchantBrandList
,
...
...
@@ -45,6 +46,7 @@ const ServiceGoods = options => {
const
picturesRef
=
useRef
(
null
);
const
settleOtrRef
=
useRef
(
null
);
const
attrRef
=
useRef
(
null
);
const
takeawayRef
=
useRef
(
null
);
const
[
pageId
,
setPageId
]
=
useState
(
null
);
const
[
categoryIds
,
setCategoryIds
]
=
useState
([]);
// 商品品类ID
...
...
@@ -476,7 +478,7 @@ const ServiceGoods = options => {
onValuesChange=
{
onValuesChange
}
/>,
]
}
{
productType
!==
5
&&
<>
<
Title
title=
"价格与库存"
/>
<
FormPriceOrStock
ref=
{
stockRef
}
...
...
@@ -486,6 +488,8 @@ const ServiceGoods = options => {
skuList=
{
editData
.
skuList
}
onValuesChange=
{
onValuesChange
}
/>
</>
}
{
productType
!==
5
&&
<>
<
Title
title=
"规则设置"
/>
{
productType
===
4
&&
(
<
FormRuleSetting
...
...
@@ -495,13 +499,16 @@ const ServiceGoods = options => {
onValuesChange=
{
onValuesChange
}
/>
)
}
</>
}
{
productType
!==
5
&&
<>
<
FormRuleVPictures
ref=
{
picturesRef
}
specKeyItem=
{
specKeyList
}
editData=
{
editData
.
infoImageData
}
onValuesChange=
{
onValuesChange
}
/>
</>
}
{
productType
===
4
&&
(
<
FormSettlementOthers
ref=
{
settleOtrRef
}
...
...
@@ -509,6 +516,15 @@ const ServiceGoods = options => {
onValuesChange=
{
onValuesChange
}
/>
)
}
{
productType
===
5
&&
<>
<
FormTakeaway
ref=
{
takeawayRef
}
editData=
{
editData
.
serviceItem
}
supplierIdList=
{
supplierIdList
}
onValuesChange=
{
onValuesChange
}
/>
</>
}
</
ServiceContext
.
Provider
>
</
WrapperContainer
>
</
Spin
>
...
...
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