Refactor specification handling in DocumentSettingsDialog and PDFController. Introduced primary application field for document types, updated export messages for consistency, and improved page number handling in specifications. Cleaned up unnecessary code in preview widgets.
This commit is contained in:
@@ -2585,7 +2585,7 @@ QString DataBaseController::getSpecificationTableInfo(const QString &projectName
|
||||
query.addBindValue(projectName);
|
||||
|
||||
if (!query.exec() || !query.next()) {
|
||||
setLastError("Ошибка получения информации о спецификации материалов: " + query.lastError().text());
|
||||
setLastError("Ошибка получения информации о спецификации: " + query.lastError().text());
|
||||
return QString();
|
||||
}
|
||||
|
||||
@@ -2595,7 +2595,7 @@ QString DataBaseController::getSpecificationTableInfo(const QString &projectName
|
||||
int minOrder = query.value(3).toInt();
|
||||
int maxOrder = query.value(4).toInt();
|
||||
|
||||
QString info = QString("Спецификация материалов для проекта '%1':\n"
|
||||
QString info = QString("Спецификация для проекта '%1':\n"
|
||||
"Всего строк: %2\n"
|
||||
"Заголовков: %3\n"
|
||||
"Пустых строк: %4\n"
|
||||
|
||||
@@ -113,7 +113,7 @@ bool PDFController::exportPerechenToPdf(const QString &filePath, MainController
|
||||
int pageNumber = 1;
|
||||
|
||||
// Вычисляем общее количество страниц заранее
|
||||
int totalPages = 2;
|
||||
int totalPages = 1;
|
||||
int tempRow = 0;
|
||||
while (tempRow < totalRows) {
|
||||
int rowsOnThisPage = (totalPages == 1) ? rowsOnFirstPage : rowsOnOtherPages;
|
||||
@@ -988,7 +988,18 @@ painter.drawText(mainTableRect.left()+165*mmToPixels, mainTableRect.top()+20*mmT
|
||||
painter.drawText(60*mmToPixels,0, 60*mmToPixels, 5*mmToPixels, Qt::AlignCenter,"Перв. примен.");
|
||||
|
||||
painter.drawText(0,5*mmToPixels, 60*mmToPixels, 7*mmToPixels, Qt::AlignCenter, getInscriptionValueWithProjectParams(model, projectParamModel, 24));
|
||||
painter.drawText(60*mmToPixels,5*mmToPixels, 60*mmToPixels, 7*mmToPixels, Qt::AlignCenter, getInscriptionValueWithProjectParams(model, projectParamModel, 25));
|
||||
// Определяем номер поля "Первичное применение" в зависимости от типа документа
|
||||
int primaryApplicationField = 25; // По умолчанию
|
||||
if (docType == 1) {
|
||||
primaryApplicationField = 251; // Перечень
|
||||
} else if (docType == 2) {
|
||||
primaryApplicationField = 252; // Спецификация ПП
|
||||
} else if (docType == 3) {
|
||||
primaryApplicationField = 253; // Спецификация материалов
|
||||
} else if (docType == 4) {
|
||||
primaryApplicationField = 254; // Ведомость
|
||||
}
|
||||
painter.drawText(60*mmToPixels,5*mmToPixels, 60*mmToPixels, 7*mmToPixels, Qt::AlignCenter, getInscriptionValueWithProjectParams(model, projectParamModel, primaryApplicationField));
|
||||
|
||||
|
||||
painter.restore();
|
||||
@@ -1351,7 +1362,8 @@ bool PDFController::addGostFrameA3FirstPage(QPainter &painter, const QRectF &pag
|
||||
painter.drawText(60*mmToPixels,0, 60*mmToPixels, 5*mmToPixels, Qt::AlignCenter,"Перв. примен.");
|
||||
|
||||
painter.drawText(0,5*mmToPixels, 60*mmToPixels, 7*mmToPixels, Qt::AlignCenter, getInscriptionValueWithProjectParams(model, projectParamModel, 24));
|
||||
painter.drawText(60*mmToPixels,5*mmToPixels, 60*mmToPixels, 7*mmToPixels, Qt::AlignCenter, getInscriptionValueWithProjectParams(model, projectParamModel, 25));
|
||||
// A3 формат используется только для ведомости, поэтому используем поле 254
|
||||
painter.drawText(60*mmToPixels,5*mmToPixels, 60*mmToPixels, 7*mmToPixels, Qt::AlignCenter, getInscriptionValueWithProjectParams(model, projectParamModel, 254));
|
||||
|
||||
|
||||
painter.restore();
|
||||
|
||||
@@ -203,7 +203,17 @@ void SpecificationPCBController::generateTableFromComponents()
|
||||
m_tableModel->addRow(pcbInfo);
|
||||
|
||||
m_tableModel->addRow(emptyRow);
|
||||
|
||||
SpecificationPCBRowData headerRow2;
|
||||
headerRow2.isHeader = true;
|
||||
headerRow2.format = SpecificationPCBCellData("", 0, 1, true, false, false, 100, true);
|
||||
headerRow2.zone = SpecificationPCBCellData("", 0, 1, true, false, false, 100, true);
|
||||
headerRow2.position = SpecificationPCBCellData("", 0, 1, true, false, false, 100, true);
|
||||
headerRow2.designation = SpecificationPCBCellData("", 0, 1, true, false, false, 100, true);
|
||||
headerRow2.name = SpecificationPCBCellData("Детали", 0, 1, true, false, false, 100, true);
|
||||
headerRow2.quantity = SpecificationPCBCellData("", 0, 1, true, false, false, 100, true);
|
||||
headerRow2.note = SpecificationPCBCellData("", 0, 1, true, false, false, 100, true);
|
||||
m_tableModel->addRow(headerRow2);
|
||||
m_tableModel->addRow(emptyRow);
|
||||
SpecificationPCBRowData headerRow2_1;
|
||||
headerRow2_1.isHeader = true;
|
||||
headerRow2_1.format = SpecificationPCBCellData("", 0, 1, true, false, false, 100, true);
|
||||
@@ -215,16 +225,7 @@ void SpecificationPCBController::generateTableFromComponents()
|
||||
headerRow2_1.note = SpecificationPCBCellData("", 0, 1, true, false, false, 100, true);
|
||||
m_tableModel->addRow(headerRow2_1);
|
||||
m_tableModel->addRow(emptyRow);
|
||||
SpecificationPCBRowData headerRow2;
|
||||
headerRow2.isHeader = true;
|
||||
headerRow2.format = SpecificationPCBCellData("", 0, 1, true, false, false, 100, true);
|
||||
headerRow2.zone = SpecificationPCBCellData("", 0, 1, true, false, false, 100, true);
|
||||
headerRow2.position = SpecificationPCBCellData("", 0, 1, true, false, false, 100, true);
|
||||
headerRow2.designation = SpecificationPCBCellData("", 0, 1, true, false, false, 100, true);
|
||||
headerRow2.name = SpecificationPCBCellData("Детали", 0, 1, true, false, false, 100, true);
|
||||
headerRow2.quantity = SpecificationPCBCellData("", 0, 1, true, false, false, 100, true);
|
||||
headerRow2.note = SpecificationPCBCellData("", 0, 1, true, false, false, 100, true);
|
||||
m_tableModel->addRow(headerRow2);
|
||||
|
||||
|
||||
SpecificationPCBRowData headerRow3;
|
||||
headerRow3.isHeader = true;
|
||||
|
||||
Reference in New Issue
Block a user