|
|
@ -50,17 +50,16 @@ const ProductInfo = ({ ...props }) => {
|
|
|
|
// "lastedit_changed": "",
|
|
|
|
// "lastedit_changed": "",
|
|
|
|
};
|
|
|
|
};
|
|
|
|
/** lgc_details */
|
|
|
|
/** lgc_details */
|
|
|
|
const copyFields = pick(editingProduct.info, ['title', 'product_type_id']);
|
|
|
|
const copyFields = pick(editingProduct.info, ['product_type_id']); // 'title',
|
|
|
|
const readyToSubInfo = { ...copyNewProduct.info, ...values.info, ...copyFields, type: copyFields.product_type_id, ...poster };
|
|
|
|
const readyToSubInfo = { ...copyNewProduct.info, ...editingProduct.info, ...values.info, ...copyFields, type: copyFields.product_type_id, ...poster };
|
|
|
|
// console.log('onSave', editingProduct.info, readyToSubInfo);
|
|
|
|
// 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 } }), {}); // todo: description字段不一致
|
|
|
|
const mergedLgc = { ...prevLgcDetailsMapped, ...values.lgc_details_mapped };
|
|
|
|
const mergedLgc = { ...prevLgcDetailsMapped, ...values.lgc_details_mapped };
|
|
|
|
|
|
|
|
|
|
|
|
/** quotation */
|
|
|
|
/** quotation */
|
|
|
|
// todo: 报价不能为空
|
|
|
|
|
|
|
|
const prevQuotationMapped = editingProduct.quotation.reduce((r, c) => ({ ...r, [c.id]: { ...c, unit: c.unit_id, audit_state: c.audit_state_id } }), {});
|
|
|
|
const prevQuotationMapped = editingProduct.quotation.reduce((r, c) => ({ ...r, [c.id]: { ...c, unit: c.unit_id, audit_state: c.audit_state_id } }), {});
|
|
|
|
const mergedQ = { ...prevQuotationMapped, ...(values.quotation || []) };
|
|
|
|
const mergedQ = { ...prevQuotationMapped, ...(values.quotation || []) };
|
|
|
|
console.log(values);
|
|
|
|
// console.log(values);
|
|
|
|
// return false; // debug: 0
|
|
|
|
// return false; // debug: 0
|
|
|
|
/** 提交保存 */
|
|
|
|
/** 提交保存 */
|
|
|
|
setLoading(true);
|
|
|
|
setLoading(true);
|
|
|
|