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

feat: 更新数据

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