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

feat: 更新数据问题

parent b313df37
...@@ -180,9 +180,9 @@ const FormInformationBasic = forwardRef((props, ref) => { ...@@ -180,9 +180,9 @@ const FormInformationBasic = forwardRef((props, ref) => {
}, [customer.isEdit, editData]); }, [customer.isEdit, editData]);
useEffect(() => { useEffect(() => {
setShopList([]); setShopList([]);
shopGetByProductType(5);
const { shopId = '', groupId = '' } = groupShopData; const { shopId = '', groupId = '' } = groupShopData;
if (shopId) { if (shopId) {
shopGetByProductType(5);
setShopIdSource(shopId); setShopIdSource(shopId);
queryShopList({ shopId }); queryShopList({ shopId });
} }
......
...@@ -630,28 +630,30 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -630,28 +630,30 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
if (customer.isUseCache) { if (customer.isUseCache) {
props.onValuesChange(editData, !0); props.onValuesChange(editData, !0);
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, ...tempEdit.infoMation });
console.log('tempEdit', tempEdit); console.log('tempEdit', tempEdit);
if (Object.keys(tempEdit).length) { if (Object.keys(tempEdit).length) {
if (tempEdit?.saleTimes) {
tempEdit.saleTimes = tempEdit?.saleTimes?.length tempEdit.saleTimes = tempEdit?.saleTimes?.length
? tempEdit?.saleTimes?.map(item => [moment(item[0]), moment(item[1])]) ? tempEdit?.saleTimes?.map(item => [moment(item[0]), moment(item[1])])
: []; : [];
if (tempEdit?.saleTimes && !tempEdit?.weight) { }
if (tempEdit?.stock === '1' && !tempEdit?.weight) {
setRepertoryType('1'); setRepertoryType('1');
} else { }
if (tempEdit?.stock === '2' && !tempEdit?.weight) {
setRepertoryType('2'); setRepertoryType('2');
form.setFieldsValue({ weight: tempEdit?.weight }); form.setFieldsValue({ weight: tempEdit?.weight });
form.setFieldsValue(tempEdit);
form.setFieldsValue({ specs: tempEdit?.specs }); form.setFieldsValue({ specs: tempEdit?.specs });
} }
if (tempEdit?.detailImageList) {
onCardSuccessImageList(tempEdit?.detailImageList); onCardSuccessImageList(tempEdit?.detailImageList);
if (tempEdit && tempEdit?.saleTimeType) {
setTimeType(tempEdit?.saleTimeType);
} }
setTimeType(tempEdit?.saleTimeType);
form.setFieldsValue(tempEdit); form.setFieldsValue(tempEdit);
}
getFormValues(); getFormValues();
} }
}
}, [customer.isEdit, editData]); }, [customer.isEdit, editData]);
useEffect(() => { useEffect(() => {
setIntactData(intactData); setIntactData(intactData);
......
...@@ -105,6 +105,7 @@ const ServiceGoods = options => { ...@@ -105,6 +105,7 @@ const ServiceGoods = options => {
console.log('productType', productType, !isEdit); console.log('productType', productType, !isEdit);
if (productType === 5) { if (productType === 5) {
setTakeawayInfoMation(e); setTakeawayInfoMation(e);
// onAutoSaveValue(Object.assign({ type: 5 }, e));
// console.log('takeawayInfoMation', takeawayInfoMation); // console.log('takeawayInfoMation', takeawayInfoMation);
} }
}; };
......
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