Commit d4225d04 authored by 陈万宝's avatar 陈万宝

feat:更新库存

parent 955cdc3a
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment