mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
в процессе 1
This commit is contained in:
@@ -14,30 +14,31 @@ CheckerTask::CheckerTask(ConnectorToServer* connectorToServer, TypeChecker type,
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->btnNew->setObjectName("btnNew");
|
||||
ui->btnCheckup->setObjectName("btnCheckup");
|
||||
ui->btnWrong->setObjectName("btnWrong");
|
||||
ui->btnCompleted->setObjectName("btnCompleted");
|
||||
|
||||
this->type = type;
|
||||
|
||||
if(type == TypeChecker::fim_check)
|
||||
{
|
||||
fimTasksWidget = new FIMtasksWidget(nullptr, TypeListTreeAMMFIM::listOneTask, this);
|
||||
|
||||
ui->verticalLayout_3->addWidget(fimTasksWidget);
|
||||
|
||||
ui->lblName->setVisible(false);
|
||||
ui->lblDMcode->setVisible(false);
|
||||
|
||||
ui->plainText->setReadOnly(true);
|
||||
ui->plainText->setObjectName("plainText");
|
||||
}
|
||||
else if(type == TypeChecker::amm_status)
|
||||
else if(type == TypeChecker::amm_check)
|
||||
{
|
||||
ui->plainText->setVisible(false);
|
||||
ui->label->setVisible(false);
|
||||
//ui->label_Task->setVisible(false);
|
||||
ui->btnRight->setText(tr("Completed"));
|
||||
ui->btnWrong->setText(tr("New"));
|
||||
ui->btnWrong->setIcon(QIcon(QStringLiteral(":/resources/icons/circleGray.png")));
|
||||
|
||||
ui->btnRight->setEnabled(false);
|
||||
ui->btnWrong->setEnabled(false);
|
||||
ui->btnCheckup->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,12 +71,14 @@ void CheckerTask::setTask(TaskAmmFim* task)
|
||||
//Репорт
|
||||
outReport(this->task.report);
|
||||
}
|
||||
else if(type == TypeChecker::amm_status)
|
||||
else if(type == TypeChecker::amm_check)
|
||||
{
|
||||
/*
|
||||
if(this->task.status == "new")
|
||||
ui->btnRight->setEnabled(true);
|
||||
ui->btnCompleted->setEnabled(true);
|
||||
else
|
||||
ui->btnWrong->setEnabled(true);
|
||||
*/
|
||||
|
||||
ui->lblName->setText(task->ammProcedure.title);
|
||||
ui->lblDMcode->setText(task->ammProcedure.dmCode);
|
||||
@@ -100,7 +103,7 @@ void CheckerTask::setTask(TaskAmmFim* task)
|
||||
else
|
||||
{
|
||||
ui->lblStatusCurrText->setText(tr("new"));
|
||||
ui->lblStatusCurrIco->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGray.png")));
|
||||
ui->lblStatusCurrIco->setPixmap(QPixmap(QStringLiteral(":/resources/icons/new.png")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,6 +160,7 @@ void CheckerTask::outReport(FIMReport report)
|
||||
}
|
||||
}
|
||||
|
||||
//НЕВЕРНО
|
||||
void CheckerTask::on_btnWrong_clicked()
|
||||
{
|
||||
TypeQueryToDB typeQuery;
|
||||
@@ -169,7 +173,57 @@ void CheckerTask::on_btnWrong_clicked()
|
||||
status = "failed";
|
||||
msgString = tr("Change task status?\nThe status will be set:\n'failed'");
|
||||
}
|
||||
else if(type == TypeChecker::amm_status)
|
||||
|
||||
if(SpecMsgBox::WarningYesNo(this, msgString) == QDialog::Accepted)
|
||||
{
|
||||
connectorToServer->sendQueryToDB(typeQuery, id_task, (void*)&status);
|
||||
this->parentWidget()->close();
|
||||
flChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
//ВЫПОЛНЕНО
|
||||
void CheckerTask::on_btnCompleted_clicked()
|
||||
{
|
||||
TypeQueryToDB typeQuery;
|
||||
QString status;
|
||||
QString msgString;
|
||||
|
||||
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 if(type == TypeChecker::amm_check)
|
||||
{
|
||||
typeQuery = TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_AMM_TO_TRAINEE;
|
||||
status = "completed";
|
||||
msgString = tr("Change task status?\nThe status will be set:\n'completed'");
|
||||
}
|
||||
|
||||
if(SpecMsgBox::WarningYesNo(this, msgString) == QDialog::Accepted)
|
||||
{
|
||||
connectorToServer->sendQueryToDB(typeQuery, id_task, (void*)&status);
|
||||
this->parentWidget()->close();
|
||||
flChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
//НОВАЯ
|
||||
void CheckerTask::on_btnNew_clicked()
|
||||
{
|
||||
TypeQueryToDB typeQuery;
|
||||
QString status;
|
||||
QString msgString;
|
||||
|
||||
if(type == TypeChecker::fim_check)
|
||||
{
|
||||
typeQuery = TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE;
|
||||
status = "new";
|
||||
msgString = tr("Change task status?\nThe status will be set:\n'new'");
|
||||
}
|
||||
else if(type == TypeChecker::amm_check)
|
||||
{
|
||||
typeQuery = TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_AMM_TO_TRAINEE;
|
||||
status = "new";
|
||||
@@ -184,7 +238,8 @@ void CheckerTask::on_btnWrong_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void CheckerTask::on_btnRight_clicked()
|
||||
//НА ПРОВЕРКЕ
|
||||
void CheckerTask::on_btnCheckup_clicked()
|
||||
{
|
||||
TypeQueryToDB typeQuery;
|
||||
QString status;
|
||||
@@ -193,14 +248,8 @@ void CheckerTask::on_btnRight_clicked()
|
||||
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 if(type == TypeChecker::amm_status)
|
||||
{
|
||||
typeQuery = TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_AMM_TO_TRAINEE;
|
||||
status = "completed";
|
||||
msgString = tr("Change task status?\nThe status will be set:\n'completed'");
|
||||
status = "checkup";
|
||||
msgString = tr("Change task status?\nThe status will be set:\n'checkup'");
|
||||
}
|
||||
|
||||
if(SpecMsgBox::WarningYesNo(this, msgString) == QDialog::Accepted)
|
||||
|
||||
Reference in New Issue
Block a user