From b0fd7510a66a5ec6a606d7b6104767cc510532ec Mon Sep 17 00:00:00 2001 From: Wellheor Date: Thu, 12 Oct 2023 10:54:06 +0800 Subject: [PATCH] =?UTF-8?q?=D0=A1=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86?= =?UTF-8?q?=D0=B0=20=E2=84=961=20v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- forms/forms100.py | 59 +++++++++++++++++++++++++++++++++------ results/forms/flowable.py | 2 +- 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/forms/forms100.py b/forms/forms100.py index 3b5d8ec526..494821e879 100644 --- a/forms/forms100.py +++ b/forms/forms100.py @@ -1085,7 +1085,6 @@ def form_05(request_data): style.fontName = "PTAstraSerifReg" style.fontSize = 11 style.alignment = TA_LEFT - style.leading = 4.2 * mm styleBold = deepcopy(style) styleBold.fontName = "PTAstraSerifBold" styleOrgName = deepcopy(styleBold) @@ -1105,9 +1104,9 @@ def form_05(request_data): objs = [] - space_symbol = ' ' - open_bold_tag = '' - close_bold_tag = '' + # space_symbol = ' ' + # open_bold_tag = '' + # close_bold_tag = '' order_data = [ [ @@ -1137,7 +1136,7 @@ def form_05(request_data): f'{hospital_address}', styleOrgName), Paragraph('Медицинская документация
Учетная форма № 025-1/у
Утверждена приказом Минздрава России от 15 ' 'декабря 2014 г. № 834н', styleCenterBold), - ], + ] ] header_table = Table(header_data, [200 * mm, 80 * mm], hAlign='RIGHT') @@ -1217,7 +1216,7 @@ def form_05(request_data): f'{disability_group} 18. Инвалид с детства: {disability_childhood}', style)) params_columns.append({'x': 0 * mm, 'y': -51 * mm, 'width': 279 * mm, 'height': 48 * mm, 'text': frame_data, 'left_padding': 2 * mm, 'right_padding': 2 * mm, 'bottom_padding': 2 * mm, - 'top_padding': 2, 'showBoundary': 1}) + 'top_padding': 2, 'showBoundary': 1, 'fake_width': None}) objs.append(FrameDataCol(params_columns)) frame_data = [] @@ -1248,10 +1247,54 @@ def form_05(request_data): finance_source = 'ОМС – 1; бюджета – 2; личных средств – 3; ДМС – 4; иных источников, разрешенных законодательством – 5' frame_data.append(Paragraph(f'26. Оплата за счет: {finance_source}', style)) - params_columns.append({'x': 0 * mm, 'y': -121 * mm, 'width': 279 * mm, 'height': 70 * mm, 'text': frame_data, 'left_padding': 2 * mm, 'right_padding': 2 * mm, 'bottom_padding': 2 * mm, - 'top_padding': 2, 'showBoundary': 1}) + + frame_data.append(Spacer(1, 3 * mm)) + visit_dates = [ + [ + Paragraph('27. Даты посещений (число, месяц, год): ', style), + Paragraph('', style), + Paragraph('', style), + Paragraph('', style), + Paragraph('', style), + Paragraph('', style), + Paragraph('', style), + Paragraph('', style), + ], + [ + Paragraph('', style), + Paragraph('', style), + Paragraph('', style), + Paragraph('', style), + Paragraph('', style), + Paragraph('', style), + Paragraph('', style), + Paragraph('', style), + ] + ] + + columns_widths = [40 * mm, 33.6 * mm, 33.6 * mm, 33.6 * mm, 33.6 * mm, 33.6 * mm, 33.6 * mm, 33.6 * mm] + visit_dates_table = Table(visit_dates, colWidths=columns_widths, hAlign='LEFT') + visit_dates_table.setStyle( + TableStyle( + [ + ('GRID', (0, 0), (-1, -1), 0.5, colors.black), + ('VALIGN', (0, 0), (-1, -1), 'TOP'), + ('SPAN', (0, 0), (0, 1)) + # ('TOPPADDING', (0, 0), (-1, -1), 1.5 * mm), + # ('BOTTOMPADDING', (0, 0), (-1, -1), 1.5 * mm), + + ] + ) + ) + frame_data.append(visit_dates_table) + + params_columns.append({'x': 0 * mm, 'y': -136 * mm, 'width': 279 * mm, 'height': 85 * mm, 'text': frame_data, 'left_padding': 2 * mm, 'right_padding': 2 * mm, 'bottom_padding': 2 * mm, + 'top_padding': 2, 'showBoundary': 1, 'fake_width': None}) objs.append(FrameDataCol(params_columns)) + + + def first_pages(canvas, document): canvas.saveState() canvas.restoreState() diff --git a/results/forms/flowable.py b/results/forms/flowable.py index a03fb5f32a..6530a4fc03 100644 --- a/results/forms/flowable.py +++ b/results/forms/flowable.py @@ -84,6 +84,6 @@ def draw(self): bottomPadding=params.get('bottom_padding', 0), rightPadding=params.get("right_padding", 0), topPadding=params.get("top_padding", 0), showBoundary=params.get("showBoundary", 0) ) - data_inframe = KeepInFrame(params["width"], params["height"], params["text"], vAlign='TOP', fakeWidth=False) + data_inframe = KeepInFrame(params["width"], params["height"], params["text"], vAlign='TOP', fakeWidth=params.get('fake_width', False)) current_data_frame.addFromList([data_inframe], self.canv) self.canv.restoreState()