Commit 8f1a428f authored by 陈万宝's avatar 陈万宝

feat: 修改时间问题

parent b747ee46
...@@ -492,7 +492,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -492,7 +492,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
useEffect(() => { useEffect(() => {
if (customer.isEdit || customer.isUseCache) { if (customer.isEdit || customer.isUseCache) {
if (!editData) return; if (!editData) return;
let { label, firstCategoryId, secondCategoryId, thirdCategoryId, id } = editData; let { label, firstCategoryId, secondCategoryId, thirdCategoryId, id ,saleTimes} = editData;
editData.label = label && label.split(',')?.map(item => +item); editData.label = label && label.split(',')?.map(item => +item);
let specList = editData?.specList; let specList = editData?.specList;
let weight = specList?.filter(item => item.specGroupName === '份量'); let weight = specList?.filter(item => item.specGroupName === '份量');
...@@ -508,6 +508,11 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -508,6 +508,11 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
}); });
} }
}); });
editData.saleTimes = saleTimes.length
? saleTimes.map(item => {
return [moment(item?.startTime, format), moment(item?.endTime, format)];
})
: [];
if (editData?.skuList?.length) { if (editData?.skuList?.length) {
// editData.minPurchaseNum = editData?.skuList[0]?.serviceItem.minPurchaseNum; // editData.minPurchaseNum = editData?.skuList[0]?.serviceItem.minPurchaseNum;
// 单规格 // 单规格
...@@ -528,11 +533,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -528,11 +533,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
// editData.saleTimeType = saleTimeType; // editData.saleTimeType = saleTimeType;
// editData.saleDates = saleDates; // editData.saleDates = saleDates;
editData.autoStock = +autoStock === 1 ? true : false; editData.autoStock = +autoStock === 1 ? true : false;
editData.saleTimes = saleTimes.length
? saleTimes.map(item => {
return [moment(item?.startTime, format), moment(item?.endTime, format)];
})
: [];
editData.productRefShopId = editData.shopId; editData.productRefShopId = editData.shopId;
editData.skuId = id; editData.skuId = id;
form.setFieldsValue(editData); form.setFieldsValue(editData);
...@@ -563,11 +564,11 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -563,11 +564,11 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
editData.categoryId = [firstCategoryId, secondCategoryId, thirdCategoryId]; editData.categoryId = [firstCategoryId, secondCategoryId, thirdCategoryId];
// editData.saleTimeType = saleTimeType; // editData.saleTimeType = saleTimeType;
// editData.saleDates = saleDates; // editData.saleDates = saleDates;
editData.saleTimes = saleTimes.length // editData.saleTimes = saleTimes.length
? saleTimes.map(item => { // ? saleTimes.map(item => {
return [moment(item?.startTime, format), moment(item?.endTime, format)]; // return [moment(item?.startTime, format), moment(item?.endTime, format)];
}) // })
: []; // : [];
editData.productRefShopId = editData.shopId; editData.productRefShopId = editData.shopId;
// setTempWeight(weight) // setTempWeight(weight)
// setTempSpecs(specs) // setTempSpecs(specs)
...@@ -1206,7 +1207,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -1206,7 +1207,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
showAddRepertoryModal('multi', `${item.unique}`, item); // 多个库存 showAddRepertoryModal('multi', `${item.unique}`, item); // 多个库存
}} }}
> >
设置库存 去设置
</div> </div>
</div> </div>
</Form.Item> </Form.Item>
......
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