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

feat: 更新数据

parent 1a2c0276
...@@ -167,7 +167,7 @@ const FormInformationBasic = forwardRef((props, ref) => { ...@@ -167,7 +167,7 @@ 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) {
shopGetByProductType(5); shopGetByProductType(5);
queryShopList({ shopId: editData?.productRefShopId }); queryShopList({ shopId: editData?.productRefShopId });
setShopIdSource(editData?.productRefShopId); setShopIdSource(editData?.productRefShopId);
......
...@@ -632,23 +632,25 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -632,23 +632,25 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
let tempEdit = JSON.parse(JSON.stringify(editData)); let tempEdit = JSON.parse(JSON.stringify(editData));
tempEdit = Object.assign({}, editData, { ...tempEdit.takeawayItem }); tempEdit = Object.assign({}, editData, { ...tempEdit.takeawayItem });
console.log('tempEdit', tempEdit); console.log('tempEdit', tempEdit);
tempEdit.saleTimes = tempEdit?.saleTimes?.length if (Object.keys(tempEdit).length) {
? tempEdit?.saleTimes?.map(item => [moment(item[0]), moment(item[1])]) tempEdit.saleTimes = tempEdit?.saleTimes?.length
: []; ? tempEdit?.saleTimes?.map(item => [moment(item[0]), moment(item[1])])
if (tempEdit?.saleTimes && !(tempEdit?.weight)) { : [];
setRepertoryType('1'); if (tempEdit?.saleTimes && !tempEdit?.weight) {
} else { setRepertoryType('1');
setRepertoryType('2'); } else {
form.setFieldsValue({ weight: tempEdit?.weight }); setRepertoryType('2');
form.setFieldsValue({ weight: tempEdit?.weight });
form.setFieldsValue(tempEdit);
form.setFieldsValue({ specs: tempEdit?.specs });
}
onCardSuccessImageList(tempEdit?.detailImageList);
if (tempEdit && tempEdit?.saleTimeType) {
setTimeType(tempEdit?.saleTimeType);
}
form.setFieldsValue(tempEdit); form.setFieldsValue(tempEdit);
form.setFieldsValue({ specs: tempEdit?.specs });
}
onCardSuccessImageList(tempEdit?.detailImageList);
if (tempEdit && tempEdit?.saleTimeType) {
setTimeType(tempEdit?.saleTimeType);
} }
form.setFieldsValue(tempEdit); getFormValues();
// getFormValues();
} }
}, [customer.isEdit, editData]); }, [customer.isEdit, editData]);
useEffect(() => { useEffect(() => {
......
...@@ -331,7 +331,7 @@ const ServiceGoods = options => { ...@@ -331,7 +331,7 @@ const ServiceGoods = options => {
setVisibleCacheEdit(false); setVisibleCacheEdit(false);
setIsUseCache(true); setIsUseCache(true);
const info = localStorage.get(localAutoSaveKey); const info = localStorage.get(localAutoSaveKey);
if (info) { if (info && info.type !== 5) {
onSetData(info); onSetData(info);
} }
}; };
...@@ -383,7 +383,7 @@ const ServiceGoods = options => { ...@@ -383,7 +383,7 @@ const ServiceGoods = options => {
useEffect(() => { useEffect(() => {
if (options.visible && !isEdit) { if (options.visible && !isEdit) {
const info = localStorage.get(localAutoSaveKey); const info = localStorage.get(localAutoSaveKey);
if (info) { if (info && info.type !== 5) {
setVisibleCacheEdit(true); setVisibleCacheEdit(true);
return; return;
} }
...@@ -403,7 +403,6 @@ const ServiceGoods = options => { ...@@ -403,7 +403,6 @@ const ServiceGoods = options => {
); );
useEffect(() => { useEffect(() => {
// 外卖类型 // 外卖类型
console.log('takeAway', takeAway);
if (Object.keys(takeAway)?.length) { if (Object.keys(takeAway)?.length) {
const { spuId = '', groupId = '' } = takeAway; const { spuId = '', groupId = '' } = takeAway;
if (spuId) { if (spuId) {
......
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