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

perf/export-docx
Lei OT 11 months ago
parent 86d0d175d3
commit aae952f5e3

@ -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 } }), {}); // todo: description
const prevLgcDetailsMapped = editingProduct.lgc_details.reduce((r, c) => ({ ...r, [c.lgc]: { ...c, description: c.descriptions } }), {});
const mergedLgc = { ...prevLgcDetailsMapped, ...values.lgc_details_mapped };
/** quotation */
@ -67,13 +67,18 @@ 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'));
//
appendNewProduct(result);
setEditingProduct(result);
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);
};
return (
<>

Loading…
Cancel
Save