в процессе 1

This commit is contained in:
2025-12-18 11:27:29 +03:00
parent c8ca0e32ad
commit b0abac8352
9 changed files with 138 additions and 34 deletions

View File

@@ -56,5 +56,6 @@
<file>resources/icons/eye.png</file> <file>resources/icons/eye.png</file>
<file>resources/icons/exchange.png</file> <file>resources/icons/exchange.png</file>
<file>resources/icons/link.png</file> <file>resources/icons/link.png</file>
<file>resources/icons/new.png</file>
</qresource> </qresource>
</RCC> </RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -529,7 +529,7 @@ void AMMtasksWidget::on_btnStatus_clicked()
if(!task.getID()) if(!task.getID())
return; return;
dlgStatusTask = new DialogChekerTask(connectorToServer, CheckerTask::TypeChecker::amm_status, this); dlgStatusTask = new DialogChekerTask(connectorToServer, CheckerTask::TypeChecker::amm_check, this);
dlgStatusTask->setTask(&task); dlgStatusTask->setTask(&task);
dlgStatusTask->exec(); dlgStatusTask->exec();

View File

@@ -14,30 +14,31 @@ CheckerTask::CheckerTask(ConnectorToServer* connectorToServer, TypeChecker type,
{ {
ui->setupUi(this); ui->setupUi(this);
ui->btnNew->setObjectName("btnNew");
ui->btnCheckup->setObjectName("btnCheckup");
ui->btnWrong->setObjectName("btnWrong");
ui->btnCompleted->setObjectName("btnCompleted");
this->type = type; this->type = type;
if(type == TypeChecker::fim_check) if(type == TypeChecker::fim_check)
{ {
fimTasksWidget = new FIMtasksWidget(nullptr, TypeListTreeAMMFIM::listOneTask, this); fimTasksWidget = new FIMtasksWidget(nullptr, TypeListTreeAMMFIM::listOneTask, this);
ui->verticalLayout_3->addWidget(fimTasksWidget); ui->verticalLayout_3->addWidget(fimTasksWidget);
ui->lblName->setVisible(false); ui->lblName->setVisible(false);
ui->lblDMcode->setVisible(false); ui->lblDMcode->setVisible(false);
ui->plainText->setReadOnly(true); ui->plainText->setReadOnly(true);
ui->plainText->setObjectName("plainText"); ui->plainText->setObjectName("plainText");
} }
else if(type == TypeChecker::amm_status) else if(type == TypeChecker::amm_check)
{ {
ui->plainText->setVisible(false); ui->plainText->setVisible(false);
ui->label->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->btnWrong->setEnabled(false);
ui->btnCheckup->setEnabled(false);
} }
} }
@@ -70,12 +71,14 @@ void CheckerTask::setTask(TaskAmmFim* task)
//Репорт //Репорт
outReport(this->task.report); outReport(this->task.report);
} }
else if(type == TypeChecker::amm_status) else if(type == TypeChecker::amm_check)
{ {
/*
if(this->task.status == "new") if(this->task.status == "new")
ui->btnRight->setEnabled(true); ui->btnCompleted->setEnabled(true);
else else
ui->btnWrong->setEnabled(true); ui->btnWrong->setEnabled(true);
*/
ui->lblName->setText(task->ammProcedure.title); ui->lblName->setText(task->ammProcedure.title);
ui->lblDMcode->setText(task->ammProcedure.dmCode); ui->lblDMcode->setText(task->ammProcedure.dmCode);
@@ -100,7 +103,7 @@ void CheckerTask::setTask(TaskAmmFim* task)
else else
{ {
ui->lblStatusCurrText->setText(tr("new")); 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() void CheckerTask::on_btnWrong_clicked()
{ {
TypeQueryToDB typeQuery; TypeQueryToDB typeQuery;
@@ -169,7 +173,57 @@ void CheckerTask::on_btnWrong_clicked()
status = "failed"; status = "failed";
msgString = tr("Change task status?\nThe status will be set:\n'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; typeQuery = TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_AMM_TO_TRAINEE;
status = "new"; status = "new";
@@ -184,7 +238,8 @@ void CheckerTask::on_btnWrong_clicked()
} }
} }
void CheckerTask::on_btnRight_clicked() //НА ПРОВЕРКЕ
void CheckerTask::on_btnCheckup_clicked()
{ {
TypeQueryToDB typeQuery; TypeQueryToDB typeQuery;
QString status; QString status;
@@ -193,14 +248,8 @@ void CheckerTask::on_btnRight_clicked()
if(type == TypeChecker::fim_check) if(type == TypeChecker::fim_check)
{ {
typeQuery = TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE; typeQuery = TypeQueryToDB::TYPE_QUERY_CHANGE_STATUS_REPORT_TASK_FIM_TO_TRAINEE;
status = "completed"; status = "checkup";
msgString = tr("Change task status?\nThe status will be set:\n'completed'"); msgString = tr("Change task status?\nThe status will be set:\n'checkup'");
}
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'");
} }
if(SpecMsgBox::WarningYesNo(this, msgString) == QDialog::Accepted) if(SpecMsgBox::WarningYesNo(this, msgString) == QDialog::Accepted)

View File

@@ -21,9 +21,7 @@ class CheckerTask : public QWidget
public: public:
enum TypeChecker enum TypeChecker
{ {
amm_status,
amm_check, amm_check,
fim_status,
fim_check fim_check
}; };
@@ -42,7 +40,9 @@ public:
private slots: private slots:
void on_btnWrong_clicked(); void on_btnWrong_clicked();
void on_btnRight_clicked(); void on_btnCompleted_clicked();
void on_btnNew_clicked();
void on_btnCheckup_clicked();
private: private:
void outReport(FIMReport report); void outReport(FIMReport report);

View File

@@ -53,6 +53,9 @@
<property name="pixmap"> <property name="pixmap">
<pixmap resource="../InstructorsAndTrainees.qrc">:/resources/icons/rectGray.png</pixmap> <pixmap resource="../InstructorsAndTrainees.qrc">:/resources/icons/rectGray.png</pixmap>
</property> </property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@@ -159,6 +162,58 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QToolButton" name="btnNew">
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="text">
<string>New</string>
</property>
<property name="icon">
<iconset resource="../InstructorsAndTrainees.qrc">
<normaloff>:/resources/icons/new.png</normaloff>:/resources/icons/new.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="btnCheckup">
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="text">
<string>Checkup</string>
</property>
<property name="icon">
<iconset resource="../InstructorsAndTrainees.qrc">
<normaloff>:/resources/icons/circleYellow.png</normaloff>:/resources/icons/circleYellow.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> <item>
<widget class="QToolButton" name="btnWrong"> <widget class="QToolButton" name="btnWrong">
<property name="minimumSize"> <property name="minimumSize">
@@ -186,7 +241,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="btnRight"> <widget class="QToolButton" name="btnCompleted">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>50</width> <width>50</width>
@@ -194,7 +249,7 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>Right</string> <string>Completed</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../InstructorsAndTrainees.qrc"> <iconset resource="../InstructorsAndTrainees.qrc">

View File

@@ -17,13 +17,11 @@ DialogChekerTask::DialogChekerTask(ConnectorToServer* connectorToServer, Checker
switch (type) switch (type)
{ {
case CheckerTask::TypeChecker::fim_check: case CheckerTask::TypeChecker::fim_check:
case CheckerTask::TypeChecker::amm_check:
this->setWindowTitle(tr("Check Task")); this->setWindowTitle(tr("Check Task"));
this->setMinimumSize(1400, 700); this->setMinimumSize(1400, 700);
this->setWindowState(Qt::WindowMaximized); this->setWindowState(Qt::WindowMaximized);
break; break;
case CheckerTask::TypeChecker::fim_status: case CheckerTask::TypeChecker::amm_check:
case CheckerTask::TypeChecker::amm_status:
this->setWindowTitle(tr("Status Task")); this->setWindowTitle(tr("Status Task"));
this->setMinimumSize(400, 200); this->setMinimumSize(400, 200);
break; break;

View File

@@ -191,10 +191,11 @@ void FIMtasksWidget::on_treeWidgetItemClicked(QTreeWidgetItem *item, int column)
ui->btnDelete->setEnabled(true); ui->btnDelete->setEnabled(true);
if(task.status != "new") ui->btnCheck->setEnabled(true);
/*if(task.status != "new")
ui->btnCheck->setEnabled(true); ui->btnCheck->setEnabled(true);
else else
ui->btnCheck->setEnabled(false); ui->btnCheck->setEnabled(false);*/
} }
else else
{ {

View File

@@ -525,7 +525,7 @@ void TaskAMMFIMTreePreparation::slot_prepareAMMListItemsForTrainee(QList<TaskAmm
else else
{ {
item->setText(ColumnsTreeAMM::clmnAMM_status, tr("new")); item->setText(ColumnsTreeAMM::clmnAMM_status, tr("new"));
item->setIcon(ColumnsTreeAMM::clmnAMM_status, QIcon(QStringLiteral(":/resources/icons/circleGray.png"))); item->setIcon(ColumnsTreeAMM::clmnAMM_status, QIcon(QStringLiteral(":/resources/icons/new.png")));
} }
item->setToolTip(0, text); item->setToolTip(0, text);
@@ -598,7 +598,7 @@ void TaskAMMFIMTreePreparation::slot_prepareFIMListItems(QByteArray array)
else else
{ {
itemTask->setText(ColumnsTreeFIM::clmnFIM_status, tr("new")); itemTask->setText(ColumnsTreeFIM::clmnFIM_status, tr("new"));
itemTask->setIcon(ColumnsTreeFIM::clmnFIM_status, QIcon(QStringLiteral(":/resources/icons/circleGray.png"))); itemTask->setIcon(ColumnsTreeFIM::clmnFIM_status, QIcon(QStringLiteral(":/resources/icons/new.png")));
} }
@@ -691,7 +691,7 @@ void TaskAMMFIMTreePreparation::slot_prepareFIMListItemsForTrainee(QList<TaskAmm
else else
{ {
itemTask->setText(ColumnsTreeFIM::clmnFIM_status, tr("new")); itemTask->setText(ColumnsTreeFIM::clmnFIM_status, tr("new"));
itemTask->setIcon(ColumnsTreeFIM::clmnFIM_status, QIcon(QStringLiteral(":/resources/icons/circleGray.png"))); itemTask->setIcon(ColumnsTreeFIM::clmnFIM_status, QIcon(QStringLiteral(":/resources/icons/new.png")));
} }