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
d4225d04
Commit
d4225d04
authored
Mar 29, 2023
by
陈万宝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:更新库存
parent
955cdc3a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
FormTakeaway.jsx
src/pages/ServiceGoods/components/FormTakeaway.jsx
+8
-3
No files found.
src/pages/ServiceGoods/components/FormTakeaway.jsx
View file @
d4225d04
...
...
@@ -143,6 +143,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
salePrice
:
salePrice
||
0
,
productStock
,
list
:
1
,
id
:
skuList
?.
length
===
1
?
skuList
[
0
].
id
:
''
,
// 单规格默认取第一个
serviceItem
:
{
description
,
// 商品描述
maxStock
,
// 最大库存
...
...
@@ -475,13 +476,12 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
editData.label = +label;
if (editData?.skuList.length) {
editData.minPurchaseNum = editData?.skuList[0]?.serviceItem.minPurchaseNum;
}
// 单规格
if (editData?.skuList.length === 1) {
let {
productStock,
specs,
serviceItem: { maxStock, saleTimeType, saleDates, saleTimes },
serviceItem: { maxStock, saleTimeType, saleDates, saleTimes
,id
},
} = editData?.skuList[0];
let { quantity, unit, salePrice } = specs[0];
editData.productStock = productStock;
...
...
@@ -491,8 +491,9 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
editData.maxStock = maxStock;
editData.categoryId = [firstCategoryId, secondCategoryId, thirdCategoryId];
editData.saleTimeType = saleTimeType;
editData.saleDates =
[1, 2, 4]
;
editData.saleDates =
saleDates
;
editData.saleTimes = saleTimes.length
editData.skuId = id
? saleTimes.map(item => {
item = [moment(item?.startTime, format), moment(item?.endTime, format)];
return item;
...
...
@@ -504,7 +505,11 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
onCardSuccessImageList(editData?.detailImageList);
getFormValues();
// setInitValue({ ...editData });
}else {
}
}
}, [customer.isEdit, editData]);
useEffect(() => {
setIntactData(intactData);
...
...
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