Revert "产品管理: 编辑: 仅信息, 多语种"

This reverts commit aae952f5e3.
perf/export-docx
Lei OT 11 months ago
parent aae952f5e3
commit c03a8fd1fe

@ -53,7 +53,7 @@ const ProductInfo = ({ ...props }) => {
const copyFields = pick(editingProduct.info, ['product_type_id']); // 'title',
const readyToSubInfo = { ...copyNewProduct.info, ...editingProduct.info, ...values.info, ...copyFields, type: copyFields.product_type_id, ...poster };
// console.log('onSave', editingProduct.info, readyToSubInfo);
const prevLgcDetailsMapped = editingProduct.lgc_details.reduce((r, c) => ({ ...r, [c.lgc]: { ...c, description: c.descriptions } }), {});
const prevLgcDetailsMapped = editingProduct.lgc_details.reduce((r, c) => ({ ...r, [c.lgc]: { ...c, description: c.descriptions } }), {}); // todo: description
const mergedLgc = { ...prevLgcDetailsMapped, ...values.lgc_details_mapped };
/** quotation */
@ -67,18 +67,13 @@ const ProductInfo = ({ ...props }) => {
travel_agency_id: activeAgency.travel_agency_id,
info: readyToSubInfo,
lgc_details: Object.values(mergedLgc),
// : ; :
// ...(isEmpty(readyToSubInfo.id) ? { quotation: Object.values(mergedQ) } : {}),
quotation: Object.values(mergedQ),
});
setLoading(false);
success ? message.success(t('Success')) : message.error(t('Failed'));
//
const _result = structuredClone(result);
// _result.quotation = editingProduct.quotation;
// const title = result.info.title || result.lgc_details?.['2']?.title || result.lgc_details?.['1']?.title || '';
appendNewProduct(_result);
setEditingProduct(_result);
appendNewProduct(result);
setEditingProduct(result);
};
return (
<>

Loading…
Cancel
Save