Изменение статуса для ФИМ. В процессе.

This commit is contained in:
2025-12-18 10:27:10 +03:00
parent 360b740220
commit c8ca0e32ad
9 changed files with 58 additions and 42 deletions

View File

@@ -3,20 +3,20 @@
#include "ui_checkertask.h"
#include "fimtaskswidget.h"
CheckerTask::CheckerTask(ConnectorToServer* connectorToServer, QString type, QWidget *parent) :
CheckerTask::CheckerTask(ConnectorToServer* connectorToServer, TypeChecker type, QWidget *parent) :
QWidget(parent),
ui(new Ui::CheckerTask),
connectorToServer(connectorToServer),
fimTasksWidget(nullptr),
flChanged(false),
id_task(0),
type("fim")
type(TypeChecker::fim_check)
{
ui->setupUi(this);
this->type = type;
if(type == "fim")
if(type == TypeChecker::fim_check)
{
fimTasksWidget = new FIMtasksWidget(nullptr, TypeListTreeAMMFIM::listOneTask, this);
@@ -27,7 +27,7 @@ CheckerTask::CheckerTask(ConnectorToServer* connectorToServer, QString type, QWi
ui->plainText->setReadOnly(true);
ui->plainText->setObjectName("plainText");
}
else
else if(type == TypeChecker::amm_status)
{
ui->plainText->setVisible(false);
ui->label->setVisible(false);
@@ -62,7 +62,7 @@ void CheckerTask::setTask(TaskAmmFim* task)
this->task = *task;
id_task = task->getID();
if(type == "fim")
if(type == TypeChecker::fim_check)
{
//Задача
fimTasksWidget->setOneTaskFim(&this->task);
@@ -70,7 +70,7 @@ void CheckerTask::setTask(TaskAmmFim* task)
//Репорт
outReport(this->task.report);
}
else if(type == "amm")
else if(type == TypeChecker::amm_status)
{
if(this->task.status == "new")
ui->btnRight->setEnabled(true);
@@ -163,13 +163,13 @@ void CheckerTask::on_btnWrong_clicked()
QString status;
QString msgString;
if(type == "fim")
if(type == TypeChecker::fim_check)
{
typeQuery = TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE;
status = "failed";
msgString = tr("Change task status?\nThe status will be set:\n'failed'");
}
else
else if(type == TypeChecker::amm_status)
{
typeQuery = TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_AMM_TO_TRAINEE;
status = "new";
@@ -190,13 +190,13 @@ void CheckerTask::on_btnRight_clicked()
QString status;
QString msgString;
if(type == "fim")
if(type == TypeChecker::fim_check)
{
typeQuery = TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE;
status = "completed";
msgString = tr("Change task status?\nThe status will be set:\n'completed'");
}
else
else if(type == TypeChecker::amm_status)
{
typeQuery = TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_AMM_TO_TRAINEE;
status = "completed";