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
fd77b238
Commit
fd77b238
authored
Apr 11, 2023
by
陈万宝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 更新默认值
parent
d55b139b
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
319 deletions
+30
-319
AddMultiSpecModal.jsx
src/pages/ServiceGoods/components/AddMultiSpecModal.jsx
+0
-268
AddRepertoryModal.jsx
src/pages/ServiceGoods/components/AddRepertoryModal.jsx
+2
-15
FormTakeaway.jsx
src/pages/ServiceGoods/components/FormTakeaway.jsx
+27
-35
index.jsx
src/pages/ServiceGoods/index.jsx
+1
-1
No files found.
src/pages/ServiceGoods/components/AddMultiSpecModal.jsx
deleted
100644 → 0
View file @
d55b139b
This diff is collapsed.
Click to expand it.
src/pages/ServiceGoods/components/AddRepertoryModal.jsx
View file @
fd77b238
...
@@ -78,26 +78,13 @@ const AddRepertoryModal = (props, ref) => {
...
@@ -78,26 +78,13 @@ const AddRepertoryModal = (props, ref) => {
};
};
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
item
?.
serviceItem
)
{
if
(
item
?.
serviceItem
)
{
const
{
productStock
=
1
,
autoStock
=
0
,
maxStock
=
2
}
=
item
?.
serviceItem
;
const
{
productStock
=
0
,
autoStock
=
0
,
maxStock
=
0
}
=
item
?.
serviceItem
;
const
params
=
{
const
params
=
{
productStock
,
productStock
,
autoStock
:
+
autoStock
===
1
,
autoStock
:
+
autoStock
===
1
,
maxStock
,
maxStock
,
};
};
switch
(
type
)
{
case
'
all
'
:
// 统一设置
form
.
setFieldsValue
(
params
);
form
.
setFieldsValue
(
params
);
break
;
case
'
multi
'
:
// 多规格设置
form
.
setFieldsValue
(
params
);
break
;
case
'
singular
'
:
// 单规格设置
// setInitialValues(params);
form
.
setFieldsValue
(
params
);
break
;
default
:
break
;
}
}
}
},
[
openRepertory
,
item
]);
},
[
openRepertory
,
item
]);
return
(
return
(
...
...
src/pages/ServiceGoods/components/FormTakeaway.jsx
View file @
fd77b238
...
@@ -38,7 +38,7 @@ import UploadCropImage from './UploadCropImage';
...
@@ -38,7 +38,7 @@ import UploadCropImage from './UploadCropImage';
// import AddSellTimeModal from './AddSellTimeModal';
// import AddSellTimeModal from './AddSellTimeModal';
import
styles
from
'
../common.less
'
;
import
styles
from
'
../common.less
'
;
import
AddRepertoryModal
from
'
./AddRepertoryModal
'
;
import
AddRepertoryModal
from
'
./AddRepertoryModal
'
;
import
AddMultiSpecModal
from
'
./AddMultiSpecModal
'
;
//
import AddMultiSpecModal from './AddMultiSpecModal';
import
{
apiTagList
,
apiUnits
}
from
'
../service
'
;
import
{
apiTagList
,
apiUnits
}
from
'
../service
'
;
import
{
localAutoSaveKey
,
calcDescartes
}
from
'
../utils
'
;
import
{
localAutoSaveKey
,
calcDescartes
}
from
'
../utils
'
;
import
localStorage
from
'
@/utils/localStorage
'
;
import
localStorage
from
'
@/utils/localStorage
'
;
...
@@ -103,16 +103,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
...
@@ -103,16 +103,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
return
null
;
return
null
;
}
}
};
};
// // 过滤存在的sku对象
// const objectComparison = (item, itm) => {
// console.log(item, itm, '==========');
// const {
// serviceItem: { maxStock, autoStock, productStock },
// } = itm;
// const params = { maxStock, autoStock, productStock: productStock || itm.productStock };
// const temp = { ...item, ...params };
// return temp;
// };
const
takeawayCalc
=
takeawayData
=>
{
const
takeawayCalc
=
takeawayData
=>
{
// 商品基本信息编辑商品名称
// 商品基本信息编辑商品名称
...
@@ -551,6 +541,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
...
@@ -551,6 +541,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
const weight = specList?.filter(item => item.specGroupName === '份量');
const weight = specList?.filter(item => item.specGroupName === '份量');
const specs = specList?.filter(item => item.specGroupName !== '份量');
const specs = specList?.filter(item => item.specGroupName !== '份量');
const tempWeightName = JSON.parse(sessionStorage.getItem('weightUnits'));
const tempWeightName = JSON.parse(sessionStorage.getItem('weightUnits'));
if (weight?.length) {
weight.forEach(item => {
weight.forEach(item => {
if (item?.specs?.length) {
if (item?.specs?.length) {
item.specs.forEach(itm => {
item.specs.forEach(itm => {
...
@@ -561,6 +552,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
...
@@ -561,6 +552,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
});
});
}
}
});
});
}
editData.saleTimes = saleTimes?.length
editData.saleTimes = saleTimes?.length
? saleTimes.map(item => [moment(item?.startTime, format), moment(item?.endTime, format)])
? saleTimes.map(item => [moment(item?.startTime, format), moment(item?.endTime, format)])
: [];
: [];
...
@@ -592,6 +584,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
...
@@ -592,6 +584,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
const specList = editData?.specList;
const specList = editData?.specList;
const weight = specList.filter(item => item.specGroupName === '份量');
const weight = specList.filter(item => item.specGroupName === '份量');
const tempWeightName = JSON.parse(sessionStorage.getItem('weightUnits'));
const tempWeightName = JSON.parse(sessionStorage.getItem('weightUnits'));
if (weight?.length) {
weight.forEach(item => {
weight.forEach(item => {
if (item?.specs?.length) {
if (item?.specs?.length) {
item.specs.forEach(itm => {
item.specs.forEach(itm => {
...
@@ -604,6 +597,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
...
@@ -604,6 +597,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
});
});
}
}
});
});
}
editData.categoryId = [firstCategoryId, secondCategoryId, thirdCategoryId];
editData.categoryId = [firstCategoryId, secondCategoryId, thirdCategoryId];
editData.productRefShopId = editData.shopId;
editData.productRefShopId = editData.shopId;
// setTempWeight(weight)
// setTempWeight(weight)
...
@@ -1313,8 +1307,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
...
@@ -1313,8 +1307,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
intactData={intactData}
intactData={intactData}
repertoryModel={repertoryModel}
repertoryModel={repertoryModel}
/>
/>
{/* 加入多规格 */}
<AddMultiSpecModal ref={AddMultiSpecRef} />
</>
</>
);
);
});
});
...
...
src/pages/ServiceGoods/index.jsx
View file @
fd77b238
...
@@ -60,7 +60,7 @@ const ServiceGoods = options => {
...
@@ -60,7 +60,7 @@ const ServiceGoods = options => {
const
[
categoryIds
,
setCategoryIds
]
=
useState
([]);
// 商品品类ID
const
[
categoryIds
,
setCategoryIds
]
=
useState
([]);
// 商品品类ID
const
[
isEdit
,
setIsEdit
]
=
useState
(
false
);
// 是否是编辑状态
const
[
isEdit
,
setIsEdit
]
=
useState
(
false
);
// 是否是编辑状态
const
[
isUseCache
,
setIsUseCache
]
=
useState
(
false
);
// 是否使用缓存
const
[
isUseCache
,
setIsUseCache
]
=
useState
(
false
);
// 是否使用缓存
let
ptype
=
can
TakeawayService
?
5
:
4
;
let
ptype
=
can
AddService
?
4
:
5
;
ptype
=
canAddNormal
?
1
:
ptype
;
ptype
=
canAddNormal
?
1
:
ptype
;
const
[
productType
,
setProductType
]
=
useState
(
ptype
);
// 商品状态
const
[
productType
,
setProductType
]
=
useState
(
ptype
);
// 商品状态
const
[
pageLoading
,
setPageLoading
]
=
useState
(
false
);
// 页面加载状态
const
[
pageLoading
,
setPageLoading
]
=
useState
(
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