update 报告生成流程bug
This commit is contained in:
parent
47da6b991c
commit
5cf36c8ad4
|
@ -83,8 +83,6 @@ class ReportGenerator:
|
|||
def __init__(self, **kwargs):
|
||||
# 文本数据
|
||||
self.text_model = kwargs['text_model']
|
||||
# from static.test.test_data import demo
|
||||
# self.model = demo
|
||||
# 调用模板,在临时报告文件夹中创建指定名称的PDF文档
|
||||
self.doc = MyDocTemplate(gen_pdf_path(name=kwargs['name']))
|
||||
# 内容框
|
||||
|
|
|
@ -52,12 +52,10 @@ def handle_manufacturing_content(param1, param2):
|
|||
elif section == '资质荣誉':
|
||||
# 如果资质荣誉无数据只显示第三段,有数据则删除第三段
|
||||
if len(report_data[num][p_value][section]) == 1:
|
||||
del report_content[num]['章节内容'][c_num]['小节内容'][0]
|
||||
del report_content[num]['章节内容'][c_num]['小节内容'][1]
|
||||
del report_content[num]['章节内容'][c_num]['小节内容'][2]
|
||||
del report_content[num]['章节内容'][c_num]['小节内容'][3]
|
||||
del report_content[num]['章节内容'][c_num]['小节内容'][4]
|
||||
del report_content[num]['章节内容'][c_num]['小节内容'][5]
|
||||
report_content[num]['章节内容'][c_num]['小节内容'] = list()
|
||||
insert_dict = dict()
|
||||
insert_dict['段落'] = '经查询,公司无技术、产品品质或品牌等方面的荣誉资质。'
|
||||
report_content[num]['章节内容'][c_num]['小节内容'].append(insert_dict)
|
||||
else:
|
||||
# 第一段数据
|
||||
p_0 = report_content[num]['章节内容'][c_num]['小节内容'][0]['段落']
|
||||
|
|
Loading…
Reference in New Issue