перед TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE

This commit is contained in:
2025-05-23 10:34:01 +03:00
parent ab05d1fa61
commit a3f3690e52
7 changed files with 170 additions and 24 deletions

View File

@@ -45,5 +45,6 @@
<file>resources/icons/delete.png</file>
<file>resources/icons/filter.png</file>
<file>resources/icons/check.png</file>
<file>resources/icons/circleRed.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -11,17 +11,10 @@ DialogCheckTask::DialogCheckTask(ConnectorToServer* connectorToServer, QWidget *
fimTasksWidget = new FIMtasksWidget(nullptr, FIMtasksWidget::TypeList::listOneTask, this);
ui->horizontalLayout_3->addWidget(fimTasksWidget);
ui->verticalLayout_3->addWidget(fimTasksWidget);
/*
ui->plainText->appendHtml("<b>1 Hello World</b>");
ui->plainText->appendHtml("<p>2 Hello World</p>");
ui->plainText->appendHtml("<em>3 Hello World</em>");
ui->plainText->appendHtml("<mark>4 Hello World</mark>");
ui->plainText->appendHtml("<strong>5 Hello World</strong>");
ui->plainText->appendHtml("<p style=\"color:red;\">6 Hello World</p>");
*/
ui->plainText->setReadOnly(true);
ui->plainText->setObjectName("plainText");
}
DialogCheckTask::~DialogCheckTask()
@@ -48,15 +41,59 @@ TaskAmmFim DialogCheckTask::getTask()
void DialogCheckTask::outReport(FIMReport report)
{
//Запрашиваем отчет по этой задаче
QString str;
/*
str = QString("<b>Report ID: %1</b>").arg(QString::number(report.id));
ui->plainText->appendHtml(str);
ui->plainText->appendHtml("<br>");
*/
for(FIMReportItem item : report.itemList)
{
ui->plainText->appendHtml("<b>Title: </b>");
ui->plainText->appendHtml("<p>DMcode: </p>");
ui->plainText->appendHtml("<p>Result: </p>");
ui->plainText->appendHtml("<p style=\"color:green;\">Text: </p>");
/*
//Item ID
str = QString("<p>Item ID: %1</p>").arg(QString::number(item.id));
ui->plainText->appendHtml(str);
*/
//Title
str = QString("<b>%1</b>").arg(item.procedure.title);
ui->plainText->appendHtml(str);
//DMcode
str = QString("<p>%1</p>").arg(item.procedure.dmCode);
ui->plainText->appendHtml(str);
//Result
str = QString("<p>%1</p>").arg(item.procedure.result);
ui->plainText->appendHtml(str);
//Text
str = QString("<p style=\"color:green;\">%1</p>").arg(item.text);
ui->plainText->appendHtml(str);
ui->plainText->appendHtml("<br>");
}
}
void DialogCheckTask::on_btnWrong_clicked()
{
int id = task.getID();
QString status = "failed";
if(QMessageBox::warning(this, tr("Attention!"), tr("Change task status?\nThe status will be set: 'failed'"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
{
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE, id, (void*)&status);
}
}
void DialogCheckTask::on_btnRight_clicked()
{
int id = task.getID();
QString status = "completed";
if(QMessageBox::warning(this, tr("Attention!"), tr("Change task status?\nThe status will be set: 'completed'"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
{
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE, id, (void*)&status);
}
}

View File

@@ -21,7 +21,11 @@ public:
void setTask(TaskAmmFim* task);
TaskAmmFim getTask();
private:
private slots:
void on_btnWrong_clicked();
void on_btnRight_clicked();
private:
void outReport(FIMReport report);
private:

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<height>628</height>
</rect>
</property>
<property name="windowTitle">
@@ -17,12 +17,110 @@
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3"/>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Task</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPlainTextEdit" name="plainText"/>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Completion Report</string>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>100</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QPlainTextEdit" name="plainText">
<property name="minimumSize">
<size>
<width>0</width>
<height>500</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QToolButton" name="btnWrong">
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="text">
<string>Wrong</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/resources/icons/circleRed.png</normaloff>:/resources/icons/circleRed.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnRight">
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="text">
<string>Right</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/resources/icons/circleGreen.png</normaloff>:/resources/icons/circleGreen.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
</layout>
</item>
@@ -43,6 +141,8 @@
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="../resources.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -56,6 +56,8 @@ FIMtasksWidget::FIMtasksWidget(ConnectorToServer* connectorToServer, TypeList ty
{
ui->btnDelete->setVisible(false);
ui->btnCheck->setVisible(false);
this->treeWidget->headerItem()->setHidden(true);
this->treeWidget->setSelectionMode(QAbstractItemView::SelectionMode::NoSelection);
}
}
@@ -321,7 +323,7 @@ void FIMtasksWidget::preparationTreeWidget()
reSetHeadTreeWidget();
if(type == TypeList::listCommon)
if(type == TypeList::listCommon || type == TypeList::listOneTask)
{
treeWidget->setColumnHidden(ColumnsTree::clmn_ID, true);
treeWidget->setColumnHidden(ColumnsTree::clmn_status, true);