Commit 879b10e6 authored by 陈万宝's avatar 陈万宝

feat: 修改回显数据问题

parent da0bdbcd
......@@ -175,6 +175,12 @@ const FormInformationBasic = forwardRef((props, ref) => {
}
setIsEditTakeaway(true);
}
if (editData?.categoryId?.length) {
editData.categoryId = editData.categoryId.filter(item => !!item);
}
if (editData?.storageRackIds?.length) {
editData.storageRackIds = editData?.storageRackIds.map(item => `${item}`);
}
form.setFieldsValue(editData);
if (editData?.commonImageList?.length) {
onTakeawayImageList(editData?.commonImageList);
......@@ -190,7 +196,7 @@ const FormInformationBasic = forwardRef((props, ref) => {
}
const temp = {
productRefShopId: shopId ? [`${shopId}`] : [],
storageRackIds: groupId ? [+groupId] : [],
storageRackIds: groupId ? [`${groupId}`] : [],
};
form.setFieldsValue(temp);
}, [groupShopData]);
......
......@@ -576,13 +576,13 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
// 多规格
setRepertoryType('2');
const specList = editData?.specList;
const weight = specList.filter(item => item.specGroupName === '份量');
const weight = specList.filter(item => item?.specGroupName === '份量');
const tempWeightName = JSON.parse(sessionStorage.getItem('weightUnits'));
if (weight?.length) {
weight.forEach(item => {
if (item?.specs?.length) {
item.specs.forEach(itm => {
if (itm?.unit && tempWeightName.includes(itm?.unit)) {
if (itm?.unit && tempWeightName?.includes(itm?.unit)) {
itm.quantity =
itm?.quantity?.indexOf('约') > -1
? itm?.quantity.slice(1)
......
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