产品管理: 提交报价数据; 产品名称

perf/export-docx
Lei OT 11 months ago
parent 4688c78dbd
commit cb0c2a9e8e

@ -56,7 +56,7 @@
"productProject": "Product project",
"Code": "Code",
"City": "City",
"Remarks": "Remarks",
"Remarks": "Memo",
"tourTime": "Tour time",
"recommendationRate": "Recommends rate",
"Name": "Name",
@ -129,7 +129,7 @@
"DisplayToC": "Display Type",
"KM": "KM",
"Description": "Description",
"Remarks": "Remarks"
"Remarks": "Memo"
},
"LgcModal": {

@ -101,7 +101,7 @@ export const useProductsAuditStatesMapVal = (value) => {
export const useProductsTypesFieldsets = (type) => {
const [isPermitted] = useAuthStore((state) => [state.isPermitted]);
const infoDefault = [['city'], ['title']];
const infoAdmin = ['title', 'code', 'remarks', 'dept']; // 'display_to_c'
const infoAdmin = ['title', 'product_title', 'code', 'remarks', 'dept']; // 'display_to_c'
const infoDisplay = isPermitted(PERM_PRODUCTS_MANAGEMENT) ? ['display_to_c'] : [];
const infoRecDisplay = isPermitted(PERM_PRODUCTS_MANAGEMENT) ? ['recommends_rate'] : [];
const infoTypesMap = {

@ -64,7 +64,7 @@ const ProductInfo = ({ ...props }) => {
travel_agency_id: activeAgency.travel_agency_id,
info: readyToSubInfo,
lgc_details: Object.values(mergedLgc),
quotation: values.quotation,
quotation: values.quotation, // || editingProduct.quotation, // ,
}).catch(ex => {
setLoading(false);
notification.error({
@ -77,6 +77,7 @@ const ProductInfo = ({ ...props }) => {
setLoading(false);
success ? message.success(t('Success')) : message.error(t('Failed'));
//
// result.quotation = isEmpty(result.quotation) ? editingProduct.quotation : result.quotation;
appendNewProduct(result);
setEditingProduct(result);
};

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

Loading…
Cancel
Save