产品管理: 管理: 编辑title

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

@ -101,7 +101,7 @@ export const useProductsAuditStatesMapVal = (value) => {
export const useProductsTypesFieldsets = (type) => {
const [isPermitted] = useAuthStore((state) => [state.isPermitted]);
const infoDefault = [['city'], ['title']];
const infoAdmin = ['code', 'remarks', 'dept']; // 'display_to_c'
const infoAdmin = ['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 = {

@ -50,17 +50,16 @@ const ProductInfo = ({ ...props }) => {
// "lastedit_changed": "",
};
/** lgc_details */
const copyFields = pick(editingProduct.info, ['title', 'product_type_id']);
const readyToSubInfo = { ...copyNewProduct.info, ...values.info, ...copyFields, type: copyFields.product_type_id, ...poster };
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 mergedLgc = { ...prevLgcDetailsMapped, ...values.lgc_details_mapped };
/** quotation */
// todo:
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 || []) };
console.log(values);
// console.log(values);
// return false; // debug: 0
/** 提交保存 */
setLoading(true);

@ -123,9 +123,9 @@ const InfoForm = ({ onSubmit, onReset, onValuesChange, editable: _editable, show
<Form.Item hidden name={'id'} label={'ID'}>
<Input />
</Form.Item>
<Form.Item hidden name={'title'} label={'title'}>
{/* <Form.Item hidden name={'title'} label={'title'}>
<Input />
</Form.Item>
</Form.Item> */}
{editable && (
<Form.Item>
<div className='flex justify-around'>
@ -173,6 +173,14 @@ function getFields(props) {
};
let baseChildren = [];
baseChildren = [
item(
'title',
99,
<Form.Item name='title' label={t('Title')} {...fieldProps.title} rules={[{ required: true }]}>
<Input allowClear {...fieldComProps.title} {...styleProps} {...editableProps('title')} />
</Form.Item>,
fieldProps?.title?.col || midCol
),
item(
'code',
99,

Loading…
Cancel
Save