File tree Expand file tree Collapse file tree 3 files changed +8
-22
lines changed
frontend/packages/web/src/components/business
crm-form-design/components Expand file tree Collapse file tree 3 files changed +8
-22
lines changed Original file line number Diff line number Diff line change 143143 return false ;
144144 }
145145 if ([FieldTypeEnum .SUB_PRICE , FieldTypeEnum .SUB_PRODUCT ].includes (field .type ) && field .subFields ) {
146+ const subFieldNameSet = new Set <string >();
146147 for (let j = 0 ; j < field .subFields .length ; j ++ ) {
147148 const subField = field .subFields [j ];
148- if (fieldNameSet .has (subField .name )) {
149+ if (subFieldNameSet .has (subField .name )) {
149150 Message .error (t (' crmFormDesign.repeatFieldName' ));
150151 formDesignRef .value ?.setActiveField (field );
151152 return false ;
152153 }
153- fieldNameSet .add (subField .name );
154+ subFieldNameSet .add (subField .name );
154155 }
155156 }
156157 fieldNameSet .add (field .name );
Original file line number Diff line number Diff line change 9595 if (item .type === FieldTypeEnum .SERIAL_NUMBER ) {
9696 return props .fieldList .some ((e ) => e .type === FieldTypeEnum .SERIAL_NUMBER && ! e .resourceFieldId );
9797 }
98- if (item .type === FieldTypeEnum .SUB_PRICE ) {
99- return props .fieldList .some ((e ) => e .type === FieldTypeEnum .SUB_PRICE );
100- }
101- if (item .type === FieldTypeEnum .SUB_PRODUCT ) {
102- return props .fieldList .some ((e ) => e .type === FieldTypeEnum .SUB_PRODUCT );
103- }
10498 return false ;
10599 }
106100
Original file line number Diff line number Diff line change 13161316 return null ;
13171317 });
13181318 const isNameRepeat = computed (() => {
1319- const fieldNameSet = new Set <string >();
1320- list .value .forEach ((field ) => {
1321- if (field .id !== fieldConfig .value ?.id ) {
1322- fieldNameSet .add (field .name );
1323- }
1324- if ([FieldTypeEnum .SUB_PRICE , FieldTypeEnum .SUB_PRODUCT ].includes (field .type )) {
1325- field .subFields ?.forEach ((subField ) => {
1326- if (subField .id !== fieldConfig .value ?.id ) {
1327- fieldNameSet .add (subField .name );
1328- }
1329- });
1330- }
1331- });
1332- return fieldConfig .value ? fieldNameSet .has (fieldConfig .value .name ) : false ;
1319+ return isSubTableField .value
1320+ ? parentField .value ?.subFields ?.some (
1321+ (item ) => item .id !== fieldConfig .value ?.id && item .name === fieldConfig .value ?.name
1322+ )
1323+ : list .value .some ((item ) => item .id !== fieldConfig .value ?.id && item .name === fieldConfig .value ?.name );
13331324 });
13341325
13351326 const formulaScopedFields = computed (() => (isSubTableField .value ? parentField .value ?.subFields ?? [] : list .value ));
You can’t perform that action at this time.
0 commit comments