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
620ae826
Commit
620ae826
authored
Apr 11, 2023
by
baxibaba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:修改存草稿
parent
297186b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
13 deletions
+20
-13
FormInformationBasic.jsx
src/pages/ServiceGoods/components/FormInformationBasic.jsx
+7
-4
FormTakeaway.jsx
src/pages/ServiceGoods/components/FormTakeaway.jsx
+13
-9
No files found.
src/pages/ServiceGoods/components/FormInformationBasic.jsx
View file @
620ae826
...
@@ -86,7 +86,7 @@ const FormInformationBasic = forwardRef((props, ref) => {
...
@@ -86,7 +86,7 @@ const FormInformationBasic = forwardRef((props, ref) => {
// 自定义加入菜单
// 自定义加入菜单
const
showModal
=
()
=>
{
const
showModal
=
()
=>
{
if
(
shopIdSource
)
{
if
(
shopIdSource
||
editData
?.
productRefShopId
)
{
setIsModalOpen
(
true
);
setIsModalOpen
(
true
);
}
else
{
}
else
{
notification
.
error
({
message
:
'
请先选择名店在进行操作!
'
});
notification
.
error
({
message
:
'
请先选择名店在进行操作!
'
});
...
@@ -167,10 +167,12 @@ const FormInformationBasic = forwardRef((props, ref) => {
...
@@ -167,10 +167,12 @@ const FormInformationBasic = forwardRef((props, ref) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
editData
)
return
;
if
(
!
editData
)
return
;
if
(
editData
?.
productType
===
5
&&
editData
?.
name
)
{
if
(
(
editData
?.
productType
===
5
&&
editData
?.
name
)
||
customer
.
productType
===
5
)
{
shopGetByProductType
(
5
);
shopGetByProductType
(
5
);
queryShopList
({
shopId
:
editData
?.
productRefShopId
});
if
(
editData
?.
productRefShopId
)
{
setShopIdSource
(
editData
?.
productRefShopId
);
setShopIdSource
(
editData
?.
productRefShopId
);
queryShopList
({
shopId
:
editData
?.
productRefShopId
});
}
setIsEditTakeaway
(
true
);
setIsEditTakeaway
(
true
);
}
}
form
.
setFieldsValue
(
editData
);
form
.
setFieldsValue
(
editData
);
...
@@ -192,6 +194,7 @@ const FormInformationBasic = forwardRef((props, ref) => {
...
@@ -192,6 +194,7 @@ const FormInformationBasic = forwardRef((props, ref) => {
};
};
form
.
setFieldsValue
(
temp
);
form
.
setFieldsValue
(
temp
);
},
[
groupShopData
]);
},
[
groupShopData
]);
// useEffect(() => {}, [shopList, shopIdSource]);
return
(
return
(
<
Form
<
Form
{
...
formItemLayout
}
{
...
formItemLayout
}
...
...
src/pages/ServiceGoods/components/FormTakeaway.jsx
View file @
620ae826
...
@@ -345,8 +345,9 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
...
@@ -345,8 +345,9 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
const
onChange
=
()
=>
{};
const
onChange
=
()
=>
{};
const
getFormValues
=
debounce
(()
=>
{
const
getFormValues
=
debounce
(()
=>
{
const
values
=
form
.
getFieldsValue
();
const
values
=
form
.
getFieldsValue
();
console
.
log
(
values
,
'
values===
'
);
props
.
onValuesChange
({
props
.
onValuesChange
({
takeawayItem
:
JSON
.
parse
(
JSON
.
stringify
(
values
))
});
takeawayItem
:
JSON
.
parse
(
JSON
.
stringify
(
Object
.
assign
(
values
,
{
multiSpu
}))),
// { multiSpu }草稿箱回显使用
});
const
takeawayData
=
customer
.
isEdit
const
takeawayData
=
customer
.
isEdit
?
{
takeawayItem
:
Object
.
assign
({},
editData
,
values
)
}
?
{
takeawayItem
:
Object
.
assign
({},
editData
,
values
)
}
:
localStorage
.
get
(
localAutoSaveKey
)
||
{};
:
localStorage
.
get
(
localAutoSaveKey
)
||
{};
...
@@ -504,24 +505,24 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
...
@@ -504,24 +505,24 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
const res = await apiTagList();
const res = await apiTagList();
setTagList(res.data || []);
setTagList(res.data || []);
}
}
if (!unitsList.length) {
if (!unitsList
?
.length) {
const res = await apiUnits();
const res = await apiUnits();
setUnitsList(res.data || []);
setUnitsList(res.data || []);
const tempWeight = res.data.filter(item => item.name === '准确重量单位');
const tempWeight = res.data.filter(item => item.name === '准确重量单位');
const tempPeople = res.data.filter(item => item.name === '适用人数');
const tempPeople = res.data.filter(item => item.name === '适用人数');
if (tempWeight.length && tempWeight[0]?.children) {
if (tempWeight
?
.length && tempWeight[0]?.children) {
const tempWeightName = tempWeight[0]?.children.map(item => item.name);
const tempWeightName = tempWeight[0]?.children.map(item => item.name);
sessionStorage.setItem('weightUnits', JSON.stringify(tempWeightName || []));
sessionStorage.setItem('weightUnits', JSON.stringify(tempWeightName || []));
setWeightUnits(tempWeightName);
setWeightUnits(tempWeightName);
}
}
if (tempPeople.length && tempPeople[0]?.children) {
if (tempPeople
?
.length && tempPeople[0]?.children) {
const tempPeopleName = tempPeople[0]?.children.map(item => item.name);
const tempPeopleName = tempPeople[0]?.children.map(item => item.name);
sessionStorage.setItem('peopleUnits', JSON.stringify(tempPeopleName || []));
sessionStorage.setItem('peopleUnits', JSON.stringify(tempPeopleName || []));
setPeopleUnits(tempPeopleName);
setPeopleUnits(tempPeopleName);
}
}
}
}
setTempMultiSpu([]);
// setTempMultiSpu([]);// 回显时候库存无法展示
return false;
return false;
};
};
useEffect(() => {
useEffect(() => {
...
@@ -638,13 +639,15 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
...
@@ -638,13 +639,15 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
? tempEdit?.saleTimes?.map(item => [moment(item[0]), moment(item[1])])
? tempEdit?.saleTimes?.map(item => [moment(item[0]), moment(item[1])])
: [];
: [];
}
}
if (tempEdit?.stock === '1'
&& !tempEdit?.weight
) {
if (tempEdit?.stock === '1') {
setRepertoryType('1');
setRepertoryType('1');
}
}
if (tempEdit?.stock === '2'
&& !tempEdit?.weight
) {
if (tempEdit?.stock === '2') {
setRepertoryType('2');
setRepertoryType('2');
form.setFieldsValue({ weight: tempEdit?.weight });
form.setFieldsValue({ weight: tempEdit?.weight });
form.setFieldsValue({ specs: tempEdit?.specs });
form.setFieldsValue({ specs: tempEdit?.specs });
console.log('tempEdit?.multiSpu', tempEdit?.multiSpu);
setTempMultiSpu(JSON.parse(JSON.stringify(tempEdit?.multiSpu)));
}
}
if (tempEdit?.detailImageList) {
if (tempEdit?.detailImageList) {
onCardSuccessImageList(tempEdit?.detailImageList);
onCardSuccessImageList(tempEdit?.detailImageList);
...
@@ -665,7 +668,8 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
...
@@ -665,7 +668,8 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
getFormValues();
getFormValues();
}, [repertoryType]);
}, [repertoryType]);
useEffect(() => {
useEffect(() => {
setTempMultiSpu(tempMultiSpu);
// setTempMultiSpu(tempMultiSpu);
console.log('tempEdit?.multiSpu1122222', tempMultiSpu);
}, [tempMultiSpu]);
}, [tempMultiSpu]);
return (
return (
<>
<>
...
...
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