|
@@ -335,10 +335,12 @@ async def get_emergency_contact_id_info(
|
|
|
|
|
|
for type_parent_id in type_parent_id_list:
|
|
|
dict_data = get_dict_data_info(db, 'three_proofing', type_parent_id)
|
|
|
- type_data = {"type_parent_id": type_parent_id, "type_parent": dict_data.dict_label, "children": []}
|
|
|
- for type_info in get_person_type_by_person_id_and_type_parent_id(db, contact.id, type_parent_id):
|
|
|
- type_data_info = get_type_info_by_id(db, type_info.type_id)
|
|
|
- type_data['children'].append({"id": type_info.type_id, "label": type_data_info.type_name})
|
|
|
+ type_data = {"type_parent_id": type_parent_id, "type_parent": dict_data.dict_label,"children":[],"labelData":[]}
|
|
|
+ for type_info in get_person_type_by_person_id_and_type_parent_id(db,contact.id,type_parent_id):
|
|
|
+ type_data_info = get_type_info_by_id(db,type_info.type_id)
|
|
|
+ # type_data['children'].append({"id": type_info.type_id, "label": type_data_info.type_name})
|
|
|
+ type_data['children'].append(type_info.type_id)
|
|
|
+ type_data['labelData'].append( type_data_info.type_name)
|
|
|
other_info = get_person_other_info_by_person_id_and_type_parent_id(db, contact.id, type_parent_id)
|
|
|
if other_info:
|
|
|
type_data['dept_name'] = other_info.dept_name
|
|
@@ -347,12 +349,15 @@ async def get_emergency_contact_id_info(
|
|
|
other_type_list = get_person_other_type_by_person_id_and_type_parent_id(db, contact.id, type_parent_id)
|
|
|
if other_type_list:
|
|
|
type_data['children2'] = []
|
|
|
+ type_data['other_type_label'] = []
|
|
|
for other_type in other_type_list:
|
|
|
other_type_info = get_other_type_info_by_id(db, other_type.other_type_id)
|
|
|
- label = ''
|
|
|
+ label= ''
|
|
|
if other_type_info:
|
|
|
label = other_type_info.type_name
|
|
|
- type_data['children2'].append({"id": other_type.other_type_id, "label": label})
|
|
|
+ # type_data['children2'].append({"id": other_type.other_type_id, "label": label})
|
|
|
+ type_data['children2'].append(other_type.other_type_id)
|
|
|
+ type_data['other_type_label'].append(label)
|
|
|
|
|
|
contact_result['type_list'].append(type_data)
|
|
|
# 返回结果
|