|
|
@ -35,6 +35,7 @@ const InfoForm = ({ onSubmit, onReset, onValuesChange, editable: _editable, show
|
|
|
|
form.setFieldValue('dept', { value: editingProduct?.info?.dept_id, label: editingProduct?.info?.dept_name });
|
|
|
|
form.setFieldValue('dept', { value: editingProduct?.info?.dept_id, label: editingProduct?.info?.dept_name });
|
|
|
|
const lgc_details_mapped = (editingProduct?.lgc_details || []).reduce((r, c) => ({ ...r, [c.lgc]: c }), {});
|
|
|
|
const lgc_details_mapped = (editingProduct?.lgc_details || []).reduce((r, c) => ({ ...r, [c.lgc]: c }), {});
|
|
|
|
form.setFieldValue('lgc_details_mapped', lgc_details_mapped);
|
|
|
|
form.setFieldValue('lgc_details_mapped', lgc_details_mapped);
|
|
|
|
|
|
|
|
form.setFieldValue('quotation', editingProduct?.quotation);
|
|
|
|
|
|
|
|
|
|
|
|
const editable0 = isEmpty(editingProduct) ? false : _editable; // 空对象未操作
|
|
|
|
const editable0 = isEmpty(editingProduct) ? false : _editable; // 空对象未操作
|
|
|
|
setEditable(editable0);
|
|
|
|
setEditable(editable0);
|
|
|
@ -135,7 +136,7 @@ const InfoForm = ({ onSubmit, onReset, onValuesChange, editable: _editable, show
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
<Form.Item name='quotation_mapped'>
|
|
|
|
<Form.Item name='quotation'>
|
|
|
|
<ProductInfoQuotation editable={editable} />
|
|
|
|
<ProductInfoQuotation editable={editable} />
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
</Form>
|
|
|
|
</Form>
|
|
|
@ -176,12 +177,12 @@ function getFields(props) {
|
|
|
|
let baseChildren = [];
|
|
|
|
let baseChildren = [];
|
|
|
|
baseChildren = [
|
|
|
|
baseChildren = [
|
|
|
|
item(
|
|
|
|
item(
|
|
|
|
'title',
|
|
|
|
'product_title',
|
|
|
|
99,
|
|
|
|
99,
|
|
|
|
<Form.Item name='title' label={t('Title')} {...fieldProps.title} rules={[{ required: true }]} tooltip={t('FormTooltip.Title')}>
|
|
|
|
<Form.Item name='product_title' label={t('Title')} {...fieldProps.product_title} rules={[{ required: true }]} tooltip={t('FormTooltip.Title')}>
|
|
|
|
<Input allowClear {...fieldComProps.title} {...styleProps} {...editableProps('title')} />
|
|
|
|
<Input allowClear {...fieldComProps.product_title} {...styleProps} {...editableProps('product_title')} />
|
|
|
|
</Form.Item>,
|
|
|
|
</Form.Item>,
|
|
|
|
fieldProps?.title?.col || midCol
|
|
|
|
fieldProps?.product_title?.col || midCol
|
|
|
|
),
|
|
|
|
),
|
|
|
|
item(
|
|
|
|
item(
|
|
|
|
'code',
|
|
|
|
'code',
|
|
|
@ -392,13 +393,10 @@ const formValuesMapper = (values) => {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'quotation_mapped': {
|
|
|
|
'product_title': { key: 'title' },
|
|
|
|
key: 'quotation',
|
|
|
|
|
|
|
|
transform: value => value
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let dest = {};
|
|
|
|
let dest = {};
|
|
|
|
const { city, ...omittedValue } = values;
|
|
|
|
const { city, product_title, ...omittedValue } = values;
|
|
|
|
dest = { ...omittedValue, ...objectMapper(values, destinationObject) };
|
|
|
|
dest = { ...omittedValue, ...objectMapper(values, destinationObject) };
|
|
|
|
for (const key in dest) {
|
|
|
|
for (const key in dest) {
|
|
|
|
if (Object.prototype.hasOwnProperty.call(dest, key)) {
|
|
|
|
if (Object.prototype.hasOwnProperty.call(dest, key)) {
|
|
|
|