diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro index 2441e80..2f25c21 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro @@ -43,6 +43,7 @@ dialogcheckresult.cpp \ dialogdcstabinput.cpp \ formaddrsetting.cpp \ + formbizdeviceselect.cpp \ formcheckpoint.cpp \ formcommsetting.cpp \ formgageresult.cpp \ @@ -79,6 +80,7 @@ databaseconnectionmainsys.h \ dialogdcstabinput.h \ formaddrsetting.h \ + formbizdeviceselect.h \ formcommsetting.h \ formgageresult.h \ id/IdWorker.h \ @@ -139,6 +141,7 @@ dialogcheckresult.ui \ dialogdcstabinput.ui \ formaddrsetting.ui \ + formbizdeviceselect.ui \ formcheckpoint.ui \ formcommsetting.ui \ formgageresult.ui \ diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro index 2441e80..2f25c21 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro @@ -43,6 +43,7 @@ dialogcheckresult.cpp \ dialogdcstabinput.cpp \ formaddrsetting.cpp \ + formbizdeviceselect.cpp \ formcheckpoint.cpp \ formcommsetting.cpp \ formgageresult.cpp \ @@ -79,6 +80,7 @@ databaseconnectionmainsys.h \ dialogdcstabinput.h \ formaddrsetting.h \ + formbizdeviceselect.h \ formcommsetting.h \ formgageresult.h \ id/IdWorker.h \ @@ -139,6 +141,7 @@ dialogcheckresult.ui \ dialogdcstabinput.ui \ formaddrsetting.ui \ + formbizdeviceselect.ui \ formcheckpoint.ui \ formcommsetting.ui \ formgageresult.ui \ diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp new file mode 100644 index 0000000..4ebce72 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp @@ -0,0 +1,26 @@ +#include "formbizdeviceselect.h" +#include "ui_formbizdeviceselect.h" +#include "PageControl.h" + +FormBizDeviceSelect::FormBizDeviceSelect(QWidget *parent) : + QWidget(parent), + ui(new Ui::FormBizDeviceSelect) +{ + ui->setupUi(this); + + page=20; + pageIndex=-1; + PagedTableWidget *pagedTable = new PagedTableWidget(this, ui->HBoxPageLayout); + pagedTable->setData(10, page); // 每页10行 + connect(pagedTable, SIGNAL(pageChanged(int)), this,SLOT(onpageChanged(int))); + this->onpageChanged(0); +} + +FormBizDeviceSelect::~FormBizDeviceSelect() +{ + delete ui; +} + +void FormBizDeviceSelect::onpageChanged(int currPage){ + +} diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro index 2441e80..2f25c21 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro @@ -43,6 +43,7 @@ dialogcheckresult.cpp \ dialogdcstabinput.cpp \ formaddrsetting.cpp \ + formbizdeviceselect.cpp \ formcheckpoint.cpp \ formcommsetting.cpp \ formgageresult.cpp \ @@ -79,6 +80,7 @@ databaseconnectionmainsys.h \ dialogdcstabinput.h \ formaddrsetting.h \ + formbizdeviceselect.h \ formcommsetting.h \ formgageresult.h \ id/IdWorker.h \ @@ -139,6 +141,7 @@ dialogcheckresult.ui \ dialogdcstabinput.ui \ formaddrsetting.ui \ + formbizdeviceselect.ui \ formcheckpoint.ui \ formcommsetting.ui \ formgageresult.ui \ diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp new file mode 100644 index 0000000..4ebce72 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp @@ -0,0 +1,26 @@ +#include "formbizdeviceselect.h" +#include "ui_formbizdeviceselect.h" +#include "PageControl.h" + +FormBizDeviceSelect::FormBizDeviceSelect(QWidget *parent) : + QWidget(parent), + ui(new Ui::FormBizDeviceSelect) +{ + ui->setupUi(this); + + page=20; + pageIndex=-1; + PagedTableWidget *pagedTable = new PagedTableWidget(this, ui->HBoxPageLayout); + pagedTable->setData(10, page); // 每页10行 + connect(pagedTable, SIGNAL(pageChanged(int)), this,SLOT(onpageChanged(int))); + this->onpageChanged(0); +} + +FormBizDeviceSelect::~FormBizDeviceSelect() +{ + delete ui; +} + +void FormBizDeviceSelect::onpageChanged(int currPage){ + +} diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.h b/softwareDirectory/AutoVerScheme/formbizdeviceselect.h new file mode 100644 index 0000000..9bafa34 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.h @@ -0,0 +1,29 @@ +#ifndef FORMBIZDEVICESELECT_H +#define FORMBIZDEVICESELECT_H + +#include + +namespace Ui { +class FormBizDeviceSelect; +} + +class FormBizDeviceSelect : public QWidget +{ + Q_OBJECT + +public: + explicit FormBizDeviceSelect(QWidget *parent = nullptr); + ~FormBizDeviceSelect(); + +private slots: + void onpageChanged(int currPage); + +private: + int page; + int totalcount; + int pageIndex; +private: + Ui::FormBizDeviceSelect *ui; +}; + +#endif // FORMBIZDEVICESELECT_H diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro index 2441e80..2f25c21 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro @@ -43,6 +43,7 @@ dialogcheckresult.cpp \ dialogdcstabinput.cpp \ formaddrsetting.cpp \ + formbizdeviceselect.cpp \ formcheckpoint.cpp \ formcommsetting.cpp \ formgageresult.cpp \ @@ -79,6 +80,7 @@ databaseconnectionmainsys.h \ dialogdcstabinput.h \ formaddrsetting.h \ + formbizdeviceselect.h \ formcommsetting.h \ formgageresult.h \ id/IdWorker.h \ @@ -139,6 +141,7 @@ dialogcheckresult.ui \ dialogdcstabinput.ui \ formaddrsetting.ui \ + formbizdeviceselect.ui \ formcheckpoint.ui \ formcommsetting.ui \ formgageresult.ui \ diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp new file mode 100644 index 0000000..4ebce72 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp @@ -0,0 +1,26 @@ +#include "formbizdeviceselect.h" +#include "ui_formbizdeviceselect.h" +#include "PageControl.h" + +FormBizDeviceSelect::FormBizDeviceSelect(QWidget *parent) : + QWidget(parent), + ui(new Ui::FormBizDeviceSelect) +{ + ui->setupUi(this); + + page=20; + pageIndex=-1; + PagedTableWidget *pagedTable = new PagedTableWidget(this, ui->HBoxPageLayout); + pagedTable->setData(10, page); // 每页10行 + connect(pagedTable, SIGNAL(pageChanged(int)), this,SLOT(onpageChanged(int))); + this->onpageChanged(0); +} + +FormBizDeviceSelect::~FormBizDeviceSelect() +{ + delete ui; +} + +void FormBizDeviceSelect::onpageChanged(int currPage){ + +} diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.h b/softwareDirectory/AutoVerScheme/formbizdeviceselect.h new file mode 100644 index 0000000..9bafa34 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.h @@ -0,0 +1,29 @@ +#ifndef FORMBIZDEVICESELECT_H +#define FORMBIZDEVICESELECT_H + +#include + +namespace Ui { +class FormBizDeviceSelect; +} + +class FormBizDeviceSelect : public QWidget +{ + Q_OBJECT + +public: + explicit FormBizDeviceSelect(QWidget *parent = nullptr); + ~FormBizDeviceSelect(); + +private slots: + void onpageChanged(int currPage); + +private: + int page; + int totalcount; + int pageIndex; +private: + Ui::FormBizDeviceSelect *ui; +}; + +#endif // FORMBIZDEVICESELECT_H diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui b/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui new file mode 100644 index 0000000..39e247a --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui @@ -0,0 +1,551 @@ + + + FormBizDeviceSelect + + + + 0 + 0 + 869 + 550 + + + + Form + + + background-color: rgb(255, 255, 255); + + + + + + background-color: rgb(51, 69, 130); + + + + 10 + + + + + + 0 + 0 + + + + + 48 + 48 + + + + image: url(:/image/Index/u7538.svg); + + + + + + + + + + + 1 + 0 + + + + + 18 + 75 + true + + + + color: rgb(255, 255, 255); + + + 选择标准装置下的标准配套设备 + + + + + + + + + + + + + + 12 + + + 10 + + + 10 + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 查询 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 重置 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 生产厂家 + + + + 12 + + + + + + 设备类型 + + + + 12 + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + 12 + + + 10 + + + 10 + + + + + + 12 + + + + 设备名称 + + + + + + + + 12 + + + + 型号规格 + + + + + + + + 12 + + + + 出厂编号 + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 查询 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 重置 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 生产厂家 + + + + 12 + + + + + + 设备类型 + + + + 12 + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 保存 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 取消 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro index 2441e80..2f25c21 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro @@ -43,6 +43,7 @@ dialogcheckresult.cpp \ dialogdcstabinput.cpp \ formaddrsetting.cpp \ + formbizdeviceselect.cpp \ formcheckpoint.cpp \ formcommsetting.cpp \ formgageresult.cpp \ @@ -79,6 +80,7 @@ databaseconnectionmainsys.h \ dialogdcstabinput.h \ formaddrsetting.h \ + formbizdeviceselect.h \ formcommsetting.h \ formgageresult.h \ id/IdWorker.h \ @@ -139,6 +141,7 @@ dialogcheckresult.ui \ dialogdcstabinput.ui \ formaddrsetting.ui \ + formbizdeviceselect.ui \ formcheckpoint.ui \ formcommsetting.ui \ formgageresult.ui \ diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp new file mode 100644 index 0000000..4ebce72 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp @@ -0,0 +1,26 @@ +#include "formbizdeviceselect.h" +#include "ui_formbizdeviceselect.h" +#include "PageControl.h" + +FormBizDeviceSelect::FormBizDeviceSelect(QWidget *parent) : + QWidget(parent), + ui(new Ui::FormBizDeviceSelect) +{ + ui->setupUi(this); + + page=20; + pageIndex=-1; + PagedTableWidget *pagedTable = new PagedTableWidget(this, ui->HBoxPageLayout); + pagedTable->setData(10, page); // 每页10行 + connect(pagedTable, SIGNAL(pageChanged(int)), this,SLOT(onpageChanged(int))); + this->onpageChanged(0); +} + +FormBizDeviceSelect::~FormBizDeviceSelect() +{ + delete ui; +} + +void FormBizDeviceSelect::onpageChanged(int currPage){ + +} diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.h b/softwareDirectory/AutoVerScheme/formbizdeviceselect.h new file mode 100644 index 0000000..9bafa34 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.h @@ -0,0 +1,29 @@ +#ifndef FORMBIZDEVICESELECT_H +#define FORMBIZDEVICESELECT_H + +#include + +namespace Ui { +class FormBizDeviceSelect; +} + +class FormBizDeviceSelect : public QWidget +{ + Q_OBJECT + +public: + explicit FormBizDeviceSelect(QWidget *parent = nullptr); + ~FormBizDeviceSelect(); + +private slots: + void onpageChanged(int currPage); + +private: + int page; + int totalcount; + int pageIndex; +private: + Ui::FormBizDeviceSelect *ui; +}; + +#endif // FORMBIZDEVICESELECT_H diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui b/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui new file mode 100644 index 0000000..39e247a --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui @@ -0,0 +1,551 @@ + + + FormBizDeviceSelect + + + + 0 + 0 + 869 + 550 + + + + Form + + + background-color: rgb(255, 255, 255); + + + + + + background-color: rgb(51, 69, 130); + + + + 10 + + + + + + 0 + 0 + + + + + 48 + 48 + + + + image: url(:/image/Index/u7538.svg); + + + + + + + + + + + 1 + 0 + + + + + 18 + 75 + true + + + + color: rgb(255, 255, 255); + + + 选择标准装置下的标准配套设备 + + + + + + + + + + + + + + 12 + + + 10 + + + 10 + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 查询 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 重置 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 生产厂家 + + + + 12 + + + + + + 设备类型 + + + + 12 + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + 12 + + + 10 + + + 10 + + + + + + 12 + + + + 设备名称 + + + + + + + + 12 + + + + 型号规格 + + + + + + + + 12 + + + + 出厂编号 + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 查询 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 重置 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 生产厂家 + + + + 12 + + + + + + 设备类型 + + + + 12 + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 保存 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 取消 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/newverifymethod.cpp b/softwareDirectory/AutoVerScheme/newverifymethod.cpp index 4680544..5638c52 100644 --- a/softwareDirectory/AutoVerScheme/newverifymethod.cpp +++ b/softwareDirectory/AutoVerScheme/newverifymethod.cpp @@ -6,6 +6,7 @@ #include "formaddrsetting.h" #include "qfiledialog.h" #include +#include "formbizdeviceselect.h" NewVerifyMethod::NewVerifyMethod(QWidget *parent,QString sId,bool bEdit) : QWidget(parent), @@ -15,9 +16,16 @@ { ui->setupUi(this); ui->tableWidget->verticalHeader()->setParent(nullptr); - for(int i=0;i<6;i++) + for(int i=1;i<5;i++){ ui->tableWidget->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + } + ui->tableWidget->setColumnWidth(0, 60); + ui->tableWidget->setColumnWidth(5, 200); + ui->tableWidget_2->setColumnWidth(0, 60); + ui->tableWidget_2->setColumnWidth(5, 200); ui->pushButton_9->setEnabled(bEditMode); + ui->comboBoxEquipment->addItems(equipList); getMethodInfo(); } @@ -53,8 +61,9 @@ void NewVerifyMethod::showVerifyDevice() { VerifyDevice *checkWindow = new VerifyDevice; - checkWindow->newVerifyWnd=this; - checkWindow->setWindowState(Qt::WindowMaximized); + //checkWindow->newVerifyWnd=this; + //checkWindow->setWindowState(Qt::WindowMaximized); + connect(checkWindow, SIGNAL(selectStandard(QString)), this,SLOT(selectStandard(QString))); checkWindow->setWindowModality(Qt::ApplicationModal); checkWindow->show(); } @@ -83,6 +92,74 @@ form->show(); } +void NewVerifyMethod::selectStandard(QString ids){ + programInfo.standard_device_id = ids; + + ui->tableWidget->clearContents(); + ui->tableWidget->setRowCount(0); + QStringList idList; + int rowCount = 0; + int row=0; + checkId=""; + if(ids!="") + { + idList = ids.split(","); + for(const QString& id : idList) + { + checkId = id; + QList result = BaseCommonApi::getCatDeviceInfor(id); + if(result.length()>0){ + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + QTableWidgetItem* p_check = new QTableWidgetItem(); + p_check->setCheckState(Qt::Unchecked); //设置首列为 CheckBox 控件 + ui->tableWidget->setItem(row,0,p_check); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(result[0].equipment_name)); //设置数据 + ui->tableWidget->setItem(row, 2, new QTableWidgetItem("")); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(result[0].model)); //设置数据 + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(result[0].manufacture_no)); //设置数据 + QPushButton *btn_1 = new QPushButton(); + btn_1->setText(tr("设置命令")); + btn_1->setStyleSheet("QPushButton{" + "background-color:rgba(255,255,255,0);" + "color:rgba(92,170,54,100);" + "text-decoration:underline;" + "}"); + btn_1->setCursor(Qt::PointingHandCursor); + int type=1; + //connect(btn_1,SIGNAL(clicked()),this,SLOT(on_cmdButton_clicked(1,id))); + connect(btn_1, &QPushButton::clicked, this, [this,type, id]() { + on_cmdButton_clicked(type,id); + }); + btn_1->setIconSize(QSize(16,16)); + btn_1->setIcon(QIcon(":/image/Index/u2324.svg")); + QPushButton *btn_2 = new QPushButton(); + btn_2->setText(tr("设置设备接口")); + btn_2->setStyleSheet("QPushButton{" + "background-color:rgba(255,255,255,0);" + "color:rgba(92,170,54,100);" + "text-decoration:underline;" + "}"); + btn_2->setCursor(Qt::PointingHandCursor); + //connect(btn_2,SIGNAL(clicked()),this,SLOT(on_commButton_clicked(1,id))); + connect(btn_2, &QPushButton::clicked, this, [this,type, id]() { + on_commButton_clicked(type,id); + }); + btn_2->setIconSize(QSize(16,16)); + btn_2->setIcon(QIcon(":/image/Index/u2324.svg")); + QWidget *tmp_widget = new QWidget(); + QHBoxLayout *tmp_layout = new QHBoxLayout(tmp_widget); + tmp_layout->addWidget(btn_1); + tmp_layout->addWidget(btn_2); + tmp_layout->setMargin(0); + ui->tableWidget->setCellWidget(row,5,tmp_widget); + row++; + } + } + idList.clear(); + } +} void NewVerifyMethod::chooseDevices(QString bizIds,QString checkIds) { @@ -246,6 +323,10 @@ qint64 id = baseApi.generateId(); programInfo.id = QString::number(id); programInfo.check_name = ui->lineEditName->text(); + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); programInfo.remark = ui->lineEditMark->text(); @@ -259,6 +340,10 @@ } }else{ programInfo.check_name = ui->lineEditName->text(); + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); programInfo.update_time = QDateTime::currentDateTime(); @@ -277,3 +362,24 @@ { this->close(); } + +void NewVerifyMethod::on_comboBoxEquipment_currentIndexChanged(int index) +{ + QString id = QString::number(index+1); + catList.clear(); + ui->comboBoxCategory->clear(); + catList = BaseCommonApi::getitemCategoryList(id); + for(const itemCategory& item : catList){ + ui->comboBoxCategory->addItem(item.category_name); + } +} + +void NewVerifyMethod::on_pushButton_clicked() +{ + FormBizDeviceSelect *checkWindow = new FormBizDeviceSelect; + //checkWindow->newVerifyWnd=this; + checkWindow->setWindowState(Qt::WindowMaximized); + //connect(checkWindow, SIGNAL(selectStandard(QString)), this,SLOT(selectStandard(QString))); + checkWindow->setWindowModality(Qt::ApplicationModal); + checkWindow->show(); +} diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro index 2441e80..2f25c21 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro @@ -43,6 +43,7 @@ dialogcheckresult.cpp \ dialogdcstabinput.cpp \ formaddrsetting.cpp \ + formbizdeviceselect.cpp \ formcheckpoint.cpp \ formcommsetting.cpp \ formgageresult.cpp \ @@ -79,6 +80,7 @@ databaseconnectionmainsys.h \ dialogdcstabinput.h \ formaddrsetting.h \ + formbizdeviceselect.h \ formcommsetting.h \ formgageresult.h \ id/IdWorker.h \ @@ -139,6 +141,7 @@ dialogcheckresult.ui \ dialogdcstabinput.ui \ formaddrsetting.ui \ + formbizdeviceselect.ui \ formcheckpoint.ui \ formcommsetting.ui \ formgageresult.ui \ diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp new file mode 100644 index 0000000..4ebce72 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp @@ -0,0 +1,26 @@ +#include "formbizdeviceselect.h" +#include "ui_formbizdeviceselect.h" +#include "PageControl.h" + +FormBizDeviceSelect::FormBizDeviceSelect(QWidget *parent) : + QWidget(parent), + ui(new Ui::FormBizDeviceSelect) +{ + ui->setupUi(this); + + page=20; + pageIndex=-1; + PagedTableWidget *pagedTable = new PagedTableWidget(this, ui->HBoxPageLayout); + pagedTable->setData(10, page); // 每页10行 + connect(pagedTable, SIGNAL(pageChanged(int)), this,SLOT(onpageChanged(int))); + this->onpageChanged(0); +} + +FormBizDeviceSelect::~FormBizDeviceSelect() +{ + delete ui; +} + +void FormBizDeviceSelect::onpageChanged(int currPage){ + +} diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.h b/softwareDirectory/AutoVerScheme/formbizdeviceselect.h new file mode 100644 index 0000000..9bafa34 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.h @@ -0,0 +1,29 @@ +#ifndef FORMBIZDEVICESELECT_H +#define FORMBIZDEVICESELECT_H + +#include + +namespace Ui { +class FormBizDeviceSelect; +} + +class FormBizDeviceSelect : public QWidget +{ + Q_OBJECT + +public: + explicit FormBizDeviceSelect(QWidget *parent = nullptr); + ~FormBizDeviceSelect(); + +private slots: + void onpageChanged(int currPage); + +private: + int page; + int totalcount; + int pageIndex; +private: + Ui::FormBizDeviceSelect *ui; +}; + +#endif // FORMBIZDEVICESELECT_H diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui b/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui new file mode 100644 index 0000000..39e247a --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui @@ -0,0 +1,551 @@ + + + FormBizDeviceSelect + + + + 0 + 0 + 869 + 550 + + + + Form + + + background-color: rgb(255, 255, 255); + + + + + + background-color: rgb(51, 69, 130); + + + + 10 + + + + + + 0 + 0 + + + + + 48 + 48 + + + + image: url(:/image/Index/u7538.svg); + + + + + + + + + + + 1 + 0 + + + + + 18 + 75 + true + + + + color: rgb(255, 255, 255); + + + 选择标准装置下的标准配套设备 + + + + + + + + + + + + + + 12 + + + 10 + + + 10 + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 查询 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 重置 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 生产厂家 + + + + 12 + + + + + + 设备类型 + + + + 12 + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + 12 + + + 10 + + + 10 + + + + + + 12 + + + + 设备名称 + + + + + + + + 12 + + + + 型号规格 + + + + + + + + 12 + + + + 出厂编号 + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 查询 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 重置 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 生产厂家 + + + + 12 + + + + + + 设备类型 + + + + 12 + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 保存 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 取消 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/newverifymethod.cpp b/softwareDirectory/AutoVerScheme/newverifymethod.cpp index 4680544..5638c52 100644 --- a/softwareDirectory/AutoVerScheme/newverifymethod.cpp +++ b/softwareDirectory/AutoVerScheme/newverifymethod.cpp @@ -6,6 +6,7 @@ #include "formaddrsetting.h" #include "qfiledialog.h" #include +#include "formbizdeviceselect.h" NewVerifyMethod::NewVerifyMethod(QWidget *parent,QString sId,bool bEdit) : QWidget(parent), @@ -15,9 +16,16 @@ { ui->setupUi(this); ui->tableWidget->verticalHeader()->setParent(nullptr); - for(int i=0;i<6;i++) + for(int i=1;i<5;i++){ ui->tableWidget->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + } + ui->tableWidget->setColumnWidth(0, 60); + ui->tableWidget->setColumnWidth(5, 200); + ui->tableWidget_2->setColumnWidth(0, 60); + ui->tableWidget_2->setColumnWidth(5, 200); ui->pushButton_9->setEnabled(bEditMode); + ui->comboBoxEquipment->addItems(equipList); getMethodInfo(); } @@ -53,8 +61,9 @@ void NewVerifyMethod::showVerifyDevice() { VerifyDevice *checkWindow = new VerifyDevice; - checkWindow->newVerifyWnd=this; - checkWindow->setWindowState(Qt::WindowMaximized); + //checkWindow->newVerifyWnd=this; + //checkWindow->setWindowState(Qt::WindowMaximized); + connect(checkWindow, SIGNAL(selectStandard(QString)), this,SLOT(selectStandard(QString))); checkWindow->setWindowModality(Qt::ApplicationModal); checkWindow->show(); } @@ -83,6 +92,74 @@ form->show(); } +void NewVerifyMethod::selectStandard(QString ids){ + programInfo.standard_device_id = ids; + + ui->tableWidget->clearContents(); + ui->tableWidget->setRowCount(0); + QStringList idList; + int rowCount = 0; + int row=0; + checkId=""; + if(ids!="") + { + idList = ids.split(","); + for(const QString& id : idList) + { + checkId = id; + QList result = BaseCommonApi::getCatDeviceInfor(id); + if(result.length()>0){ + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + QTableWidgetItem* p_check = new QTableWidgetItem(); + p_check->setCheckState(Qt::Unchecked); //设置首列为 CheckBox 控件 + ui->tableWidget->setItem(row,0,p_check); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(result[0].equipment_name)); //设置数据 + ui->tableWidget->setItem(row, 2, new QTableWidgetItem("")); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(result[0].model)); //设置数据 + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(result[0].manufacture_no)); //设置数据 + QPushButton *btn_1 = new QPushButton(); + btn_1->setText(tr("设置命令")); + btn_1->setStyleSheet("QPushButton{" + "background-color:rgba(255,255,255,0);" + "color:rgba(92,170,54,100);" + "text-decoration:underline;" + "}"); + btn_1->setCursor(Qt::PointingHandCursor); + int type=1; + //connect(btn_1,SIGNAL(clicked()),this,SLOT(on_cmdButton_clicked(1,id))); + connect(btn_1, &QPushButton::clicked, this, [this,type, id]() { + on_cmdButton_clicked(type,id); + }); + btn_1->setIconSize(QSize(16,16)); + btn_1->setIcon(QIcon(":/image/Index/u2324.svg")); + QPushButton *btn_2 = new QPushButton(); + btn_2->setText(tr("设置设备接口")); + btn_2->setStyleSheet("QPushButton{" + "background-color:rgba(255,255,255,0);" + "color:rgba(92,170,54,100);" + "text-decoration:underline;" + "}"); + btn_2->setCursor(Qt::PointingHandCursor); + //connect(btn_2,SIGNAL(clicked()),this,SLOT(on_commButton_clicked(1,id))); + connect(btn_2, &QPushButton::clicked, this, [this,type, id]() { + on_commButton_clicked(type,id); + }); + btn_2->setIconSize(QSize(16,16)); + btn_2->setIcon(QIcon(":/image/Index/u2324.svg")); + QWidget *tmp_widget = new QWidget(); + QHBoxLayout *tmp_layout = new QHBoxLayout(tmp_widget); + tmp_layout->addWidget(btn_1); + tmp_layout->addWidget(btn_2); + tmp_layout->setMargin(0); + ui->tableWidget->setCellWidget(row,5,tmp_widget); + row++; + } + } + idList.clear(); + } +} void NewVerifyMethod::chooseDevices(QString bizIds,QString checkIds) { @@ -246,6 +323,10 @@ qint64 id = baseApi.generateId(); programInfo.id = QString::number(id); programInfo.check_name = ui->lineEditName->text(); + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); programInfo.remark = ui->lineEditMark->text(); @@ -259,6 +340,10 @@ } }else{ programInfo.check_name = ui->lineEditName->text(); + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); programInfo.update_time = QDateTime::currentDateTime(); @@ -277,3 +362,24 @@ { this->close(); } + +void NewVerifyMethod::on_comboBoxEquipment_currentIndexChanged(int index) +{ + QString id = QString::number(index+1); + catList.clear(); + ui->comboBoxCategory->clear(); + catList = BaseCommonApi::getitemCategoryList(id); + for(const itemCategory& item : catList){ + ui->comboBoxCategory->addItem(item.category_name); + } +} + +void NewVerifyMethod::on_pushButton_clicked() +{ + FormBizDeviceSelect *checkWindow = new FormBizDeviceSelect; + //checkWindow->newVerifyWnd=this; + checkWindow->setWindowState(Qt::WindowMaximized); + //connect(checkWindow, SIGNAL(selectStandard(QString)), this,SLOT(selectStandard(QString))); + checkWindow->setWindowModality(Qt::ApplicationModal); + checkWindow->show(); +} diff --git a/softwareDirectory/AutoVerScheme/newverifymethod.h b/softwareDirectory/AutoVerScheme/newverifymethod.h index 661be87..7612d3f 100644 --- a/softwareDirectory/AutoVerScheme/newverifymethod.h +++ b/softwareDirectory/AutoVerScheme/newverifymethod.h @@ -31,6 +31,11 @@ void on_pushButton_10_clicked(); + void on_comboBoxEquipment_currentIndexChanged(int index); + void selectStandard(QString ids); + + void on_pushButton_clicked(); + public: VerifyMethodManage *verifyManageWnd=nullptr; private: @@ -39,6 +44,9 @@ QString checkId=""; CheckProgramManage programInfo; bool bEditMode=true; + QStringList equipList={"多功能校准源标准装置","直流稳压电源检定装置","多功能电气安全标准器标准装置","0.02级活塞式压力计标准装置","二等铂电阻温度计标准装置","安全阀校验装置", + "精密露点仪标准装置","E2等级砝码标准装置","频谱分析仪标准装置","信号发生器标准装置","微波衰减标准装置","频率短期稳定度标准装置","示波器标准装置","铯原子频率标准装置","小功率标准装置"}; + QList catList; }; #endif // NEWVERIFYMETHOD_H diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro index 2441e80..2f25c21 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro @@ -43,6 +43,7 @@ dialogcheckresult.cpp \ dialogdcstabinput.cpp \ formaddrsetting.cpp \ + formbizdeviceselect.cpp \ formcheckpoint.cpp \ formcommsetting.cpp \ formgageresult.cpp \ @@ -79,6 +80,7 @@ databaseconnectionmainsys.h \ dialogdcstabinput.h \ formaddrsetting.h \ + formbizdeviceselect.h \ formcommsetting.h \ formgageresult.h \ id/IdWorker.h \ @@ -139,6 +141,7 @@ dialogcheckresult.ui \ dialogdcstabinput.ui \ formaddrsetting.ui \ + formbizdeviceselect.ui \ formcheckpoint.ui \ formcommsetting.ui \ formgageresult.ui \ diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp new file mode 100644 index 0000000..4ebce72 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp @@ -0,0 +1,26 @@ +#include "formbizdeviceselect.h" +#include "ui_formbizdeviceselect.h" +#include "PageControl.h" + +FormBizDeviceSelect::FormBizDeviceSelect(QWidget *parent) : + QWidget(parent), + ui(new Ui::FormBizDeviceSelect) +{ + ui->setupUi(this); + + page=20; + pageIndex=-1; + PagedTableWidget *pagedTable = new PagedTableWidget(this, ui->HBoxPageLayout); + pagedTable->setData(10, page); // 每页10行 + connect(pagedTable, SIGNAL(pageChanged(int)), this,SLOT(onpageChanged(int))); + this->onpageChanged(0); +} + +FormBizDeviceSelect::~FormBizDeviceSelect() +{ + delete ui; +} + +void FormBizDeviceSelect::onpageChanged(int currPage){ + +} diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.h b/softwareDirectory/AutoVerScheme/formbizdeviceselect.h new file mode 100644 index 0000000..9bafa34 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.h @@ -0,0 +1,29 @@ +#ifndef FORMBIZDEVICESELECT_H +#define FORMBIZDEVICESELECT_H + +#include + +namespace Ui { +class FormBizDeviceSelect; +} + +class FormBizDeviceSelect : public QWidget +{ + Q_OBJECT + +public: + explicit FormBizDeviceSelect(QWidget *parent = nullptr); + ~FormBizDeviceSelect(); + +private slots: + void onpageChanged(int currPage); + +private: + int page; + int totalcount; + int pageIndex; +private: + Ui::FormBizDeviceSelect *ui; +}; + +#endif // FORMBIZDEVICESELECT_H diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui b/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui new file mode 100644 index 0000000..39e247a --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui @@ -0,0 +1,551 @@ + + + FormBizDeviceSelect + + + + 0 + 0 + 869 + 550 + + + + Form + + + background-color: rgb(255, 255, 255); + + + + + + background-color: rgb(51, 69, 130); + + + + 10 + + + + + + 0 + 0 + + + + + 48 + 48 + + + + image: url(:/image/Index/u7538.svg); + + + + + + + + + + + 1 + 0 + + + + + 18 + 75 + true + + + + color: rgb(255, 255, 255); + + + 选择标准装置下的标准配套设备 + + + + + + + + + + + + + + 12 + + + 10 + + + 10 + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 查询 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 重置 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 生产厂家 + + + + 12 + + + + + + 设备类型 + + + + 12 + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + 12 + + + 10 + + + 10 + + + + + + 12 + + + + 设备名称 + + + + + + + + 12 + + + + 型号规格 + + + + + + + + 12 + + + + 出厂编号 + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 查询 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 重置 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 生产厂家 + + + + 12 + + + + + + 设备类型 + + + + 12 + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 保存 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 取消 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/newverifymethod.cpp b/softwareDirectory/AutoVerScheme/newverifymethod.cpp index 4680544..5638c52 100644 --- a/softwareDirectory/AutoVerScheme/newverifymethod.cpp +++ b/softwareDirectory/AutoVerScheme/newverifymethod.cpp @@ -6,6 +6,7 @@ #include "formaddrsetting.h" #include "qfiledialog.h" #include +#include "formbizdeviceselect.h" NewVerifyMethod::NewVerifyMethod(QWidget *parent,QString sId,bool bEdit) : QWidget(parent), @@ -15,9 +16,16 @@ { ui->setupUi(this); ui->tableWidget->verticalHeader()->setParent(nullptr); - for(int i=0;i<6;i++) + for(int i=1;i<5;i++){ ui->tableWidget->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + } + ui->tableWidget->setColumnWidth(0, 60); + ui->tableWidget->setColumnWidth(5, 200); + ui->tableWidget_2->setColumnWidth(0, 60); + ui->tableWidget_2->setColumnWidth(5, 200); ui->pushButton_9->setEnabled(bEditMode); + ui->comboBoxEquipment->addItems(equipList); getMethodInfo(); } @@ -53,8 +61,9 @@ void NewVerifyMethod::showVerifyDevice() { VerifyDevice *checkWindow = new VerifyDevice; - checkWindow->newVerifyWnd=this; - checkWindow->setWindowState(Qt::WindowMaximized); + //checkWindow->newVerifyWnd=this; + //checkWindow->setWindowState(Qt::WindowMaximized); + connect(checkWindow, SIGNAL(selectStandard(QString)), this,SLOT(selectStandard(QString))); checkWindow->setWindowModality(Qt::ApplicationModal); checkWindow->show(); } @@ -83,6 +92,74 @@ form->show(); } +void NewVerifyMethod::selectStandard(QString ids){ + programInfo.standard_device_id = ids; + + ui->tableWidget->clearContents(); + ui->tableWidget->setRowCount(0); + QStringList idList; + int rowCount = 0; + int row=0; + checkId=""; + if(ids!="") + { + idList = ids.split(","); + for(const QString& id : idList) + { + checkId = id; + QList result = BaseCommonApi::getCatDeviceInfor(id); + if(result.length()>0){ + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + QTableWidgetItem* p_check = new QTableWidgetItem(); + p_check->setCheckState(Qt::Unchecked); //设置首列为 CheckBox 控件 + ui->tableWidget->setItem(row,0,p_check); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(result[0].equipment_name)); //设置数据 + ui->tableWidget->setItem(row, 2, new QTableWidgetItem("")); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(result[0].model)); //设置数据 + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(result[0].manufacture_no)); //设置数据 + QPushButton *btn_1 = new QPushButton(); + btn_1->setText(tr("设置命令")); + btn_1->setStyleSheet("QPushButton{" + "background-color:rgba(255,255,255,0);" + "color:rgba(92,170,54,100);" + "text-decoration:underline;" + "}"); + btn_1->setCursor(Qt::PointingHandCursor); + int type=1; + //connect(btn_1,SIGNAL(clicked()),this,SLOT(on_cmdButton_clicked(1,id))); + connect(btn_1, &QPushButton::clicked, this, [this,type, id]() { + on_cmdButton_clicked(type,id); + }); + btn_1->setIconSize(QSize(16,16)); + btn_1->setIcon(QIcon(":/image/Index/u2324.svg")); + QPushButton *btn_2 = new QPushButton(); + btn_2->setText(tr("设置设备接口")); + btn_2->setStyleSheet("QPushButton{" + "background-color:rgba(255,255,255,0);" + "color:rgba(92,170,54,100);" + "text-decoration:underline;" + "}"); + btn_2->setCursor(Qt::PointingHandCursor); + //connect(btn_2,SIGNAL(clicked()),this,SLOT(on_commButton_clicked(1,id))); + connect(btn_2, &QPushButton::clicked, this, [this,type, id]() { + on_commButton_clicked(type,id); + }); + btn_2->setIconSize(QSize(16,16)); + btn_2->setIcon(QIcon(":/image/Index/u2324.svg")); + QWidget *tmp_widget = new QWidget(); + QHBoxLayout *tmp_layout = new QHBoxLayout(tmp_widget); + tmp_layout->addWidget(btn_1); + tmp_layout->addWidget(btn_2); + tmp_layout->setMargin(0); + ui->tableWidget->setCellWidget(row,5,tmp_widget); + row++; + } + } + idList.clear(); + } +} void NewVerifyMethod::chooseDevices(QString bizIds,QString checkIds) { @@ -246,6 +323,10 @@ qint64 id = baseApi.generateId(); programInfo.id = QString::number(id); programInfo.check_name = ui->lineEditName->text(); + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); programInfo.remark = ui->lineEditMark->text(); @@ -259,6 +340,10 @@ } }else{ programInfo.check_name = ui->lineEditName->text(); + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); programInfo.update_time = QDateTime::currentDateTime(); @@ -277,3 +362,24 @@ { this->close(); } + +void NewVerifyMethod::on_comboBoxEquipment_currentIndexChanged(int index) +{ + QString id = QString::number(index+1); + catList.clear(); + ui->comboBoxCategory->clear(); + catList = BaseCommonApi::getitemCategoryList(id); + for(const itemCategory& item : catList){ + ui->comboBoxCategory->addItem(item.category_name); + } +} + +void NewVerifyMethod::on_pushButton_clicked() +{ + FormBizDeviceSelect *checkWindow = new FormBizDeviceSelect; + //checkWindow->newVerifyWnd=this; + checkWindow->setWindowState(Qt::WindowMaximized); + //connect(checkWindow, SIGNAL(selectStandard(QString)), this,SLOT(selectStandard(QString))); + checkWindow->setWindowModality(Qt::ApplicationModal); + checkWindow->show(); +} diff --git a/softwareDirectory/AutoVerScheme/newverifymethod.h b/softwareDirectory/AutoVerScheme/newverifymethod.h index 661be87..7612d3f 100644 --- a/softwareDirectory/AutoVerScheme/newverifymethod.h +++ b/softwareDirectory/AutoVerScheme/newverifymethod.h @@ -31,6 +31,11 @@ void on_pushButton_10_clicked(); + void on_comboBoxEquipment_currentIndexChanged(int index); + void selectStandard(QString ids); + + void on_pushButton_clicked(); + public: VerifyMethodManage *verifyManageWnd=nullptr; private: @@ -39,6 +44,9 @@ QString checkId=""; CheckProgramManage programInfo; bool bEditMode=true; + QStringList equipList={"多功能校准源标准装置","直流稳压电源检定装置","多功能电气安全标准器标准装置","0.02级活塞式压力计标准装置","二等铂电阻温度计标准装置","安全阀校验装置", + "精密露点仪标准装置","E2等级砝码标准装置","频谱分析仪标准装置","信号发生器标准装置","微波衰减标准装置","频率短期稳定度标准装置","示波器标准装置","铯原子频率标准装置","小功率标准装置"}; + QList catList; }; #endif // NEWVERIFYMETHOD_H diff --git a/softwareDirectory/AutoVerScheme/newverifymethod.ui b/softwareDirectory/AutoVerScheme/newverifymethod.ui index 1b3a1f1..3ec3d96 100644 --- a/softwareDirectory/AutoVerScheme/newverifymethod.ui +++ b/softwareDirectory/AutoVerScheme/newverifymethod.ui @@ -33,6 +33,7 @@ + 14 75 true @@ -49,6 +50,7 @@ + 12 75 true @@ -71,6 +73,7 @@ + 12 75 true @@ -102,6 +105,7 @@ + 12 75 true @@ -113,42 +117,20 @@ - - + + - 75 - true + 12 - - 程序名称: - - - - - - - - - 75 - true - - - - 创建人: - - - - - - - + + 12 75 true @@ -158,13 +140,80 @@ - - + + + + + 12 + + + + + + + + + 12 + 75 + true + + + + 创建人: + + + + + + + + 12 + 75 + true + + + + 核查标准装置: + + + + + + + + 12 + + + + + + + 12 + 75 + true + + + + 程序名称: + + + + + + + + 12 + + + + + + 12 75 true @@ -174,8 +223,37 @@ - - + + + + + 12 + + + + + + + + + 12 + 75 + true + + + + 核查项分类: + + + + + + + + 12 + + + @@ -196,6 +274,7 @@ + 12 75 true @@ -215,6 +294,7 @@ + 12 75 true @@ -243,6 +323,7 @@ + 12 75 true @@ -289,6 +370,7 @@ + 12 75 true @@ -304,6 +386,7 @@ + 12 75 true @@ -323,6 +406,7 @@ + 12 75 true @@ -332,12 +416,31 @@ color: rgb(255, 255, 255); - 选择设备 + 增加标准设备 - - - :/image/Index/u7453.svg - + + + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(100, 132, 68); + + + 删除行 @@ -347,33 +450,193 @@ - 设备类型 + 选择 + + + + 12 + 设备名称 + + + 12 + + + + + + 角色 + + + + 12 + + 型号规格 + + + 12 + + 出厂编号 - - - - 生产厂家 + + + 12 + 操作 + + + 12 + + + + + + + + + + + + 12 + 75 + true + + + + 选择核查件: + + + + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + background-color: rgb(51, 69, 130); +color: rgb(255, 255, 255); + + + 增加核查件 + + + + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(100, 132, 68); + + + 删除行 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 角色 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 操作 + + + + 12 + + @@ -383,6 +646,7 @@ + 12 75 true @@ -402,6 +666,7 @@ + 12 75 true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro index 2441e80..2f25c21 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro @@ -43,6 +43,7 @@ dialogcheckresult.cpp \ dialogdcstabinput.cpp \ formaddrsetting.cpp \ + formbizdeviceselect.cpp \ formcheckpoint.cpp \ formcommsetting.cpp \ formgageresult.cpp \ @@ -79,6 +80,7 @@ databaseconnectionmainsys.h \ dialogdcstabinput.h \ formaddrsetting.h \ + formbizdeviceselect.h \ formcommsetting.h \ formgageresult.h \ id/IdWorker.h \ @@ -139,6 +141,7 @@ dialogcheckresult.ui \ dialogdcstabinput.ui \ formaddrsetting.ui \ + formbizdeviceselect.ui \ formcheckpoint.ui \ formcommsetting.ui \ formgageresult.ui \ diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp new file mode 100644 index 0000000..4ebce72 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp @@ -0,0 +1,26 @@ +#include "formbizdeviceselect.h" +#include "ui_formbizdeviceselect.h" +#include "PageControl.h" + +FormBizDeviceSelect::FormBizDeviceSelect(QWidget *parent) : + QWidget(parent), + ui(new Ui::FormBizDeviceSelect) +{ + ui->setupUi(this); + + page=20; + pageIndex=-1; + PagedTableWidget *pagedTable = new PagedTableWidget(this, ui->HBoxPageLayout); + pagedTable->setData(10, page); // 每页10行 + connect(pagedTable, SIGNAL(pageChanged(int)), this,SLOT(onpageChanged(int))); + this->onpageChanged(0); +} + +FormBizDeviceSelect::~FormBizDeviceSelect() +{ + delete ui; +} + +void FormBizDeviceSelect::onpageChanged(int currPage){ + +} diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.h b/softwareDirectory/AutoVerScheme/formbizdeviceselect.h new file mode 100644 index 0000000..9bafa34 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.h @@ -0,0 +1,29 @@ +#ifndef FORMBIZDEVICESELECT_H +#define FORMBIZDEVICESELECT_H + +#include + +namespace Ui { +class FormBizDeviceSelect; +} + +class FormBizDeviceSelect : public QWidget +{ + Q_OBJECT + +public: + explicit FormBizDeviceSelect(QWidget *parent = nullptr); + ~FormBizDeviceSelect(); + +private slots: + void onpageChanged(int currPage); + +private: + int page; + int totalcount; + int pageIndex; +private: + Ui::FormBizDeviceSelect *ui; +}; + +#endif // FORMBIZDEVICESELECT_H diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui b/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui new file mode 100644 index 0000000..39e247a --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui @@ -0,0 +1,551 @@ + + + FormBizDeviceSelect + + + + 0 + 0 + 869 + 550 + + + + Form + + + background-color: rgb(255, 255, 255); + + + + + + background-color: rgb(51, 69, 130); + + + + 10 + + + + + + 0 + 0 + + + + + 48 + 48 + + + + image: url(:/image/Index/u7538.svg); + + + + + + + + + + + 1 + 0 + + + + + 18 + 75 + true + + + + color: rgb(255, 255, 255); + + + 选择标准装置下的标准配套设备 + + + + + + + + + + + + + + 12 + + + 10 + + + 10 + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 查询 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 重置 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 生产厂家 + + + + 12 + + + + + + 设备类型 + + + + 12 + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + 12 + + + 10 + + + 10 + + + + + + 12 + + + + 设备名称 + + + + + + + + 12 + + + + 型号规格 + + + + + + + + 12 + + + + 出厂编号 + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 查询 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 重置 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 生产厂家 + + + + 12 + + + + + + 设备类型 + + + + 12 + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 保存 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 取消 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/newverifymethod.cpp b/softwareDirectory/AutoVerScheme/newverifymethod.cpp index 4680544..5638c52 100644 --- a/softwareDirectory/AutoVerScheme/newverifymethod.cpp +++ b/softwareDirectory/AutoVerScheme/newverifymethod.cpp @@ -6,6 +6,7 @@ #include "formaddrsetting.h" #include "qfiledialog.h" #include +#include "formbizdeviceselect.h" NewVerifyMethod::NewVerifyMethod(QWidget *parent,QString sId,bool bEdit) : QWidget(parent), @@ -15,9 +16,16 @@ { ui->setupUi(this); ui->tableWidget->verticalHeader()->setParent(nullptr); - for(int i=0;i<6;i++) + for(int i=1;i<5;i++){ ui->tableWidget->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + } + ui->tableWidget->setColumnWidth(0, 60); + ui->tableWidget->setColumnWidth(5, 200); + ui->tableWidget_2->setColumnWidth(0, 60); + ui->tableWidget_2->setColumnWidth(5, 200); ui->pushButton_9->setEnabled(bEditMode); + ui->comboBoxEquipment->addItems(equipList); getMethodInfo(); } @@ -53,8 +61,9 @@ void NewVerifyMethod::showVerifyDevice() { VerifyDevice *checkWindow = new VerifyDevice; - checkWindow->newVerifyWnd=this; - checkWindow->setWindowState(Qt::WindowMaximized); + //checkWindow->newVerifyWnd=this; + //checkWindow->setWindowState(Qt::WindowMaximized); + connect(checkWindow, SIGNAL(selectStandard(QString)), this,SLOT(selectStandard(QString))); checkWindow->setWindowModality(Qt::ApplicationModal); checkWindow->show(); } @@ -83,6 +92,74 @@ form->show(); } +void NewVerifyMethod::selectStandard(QString ids){ + programInfo.standard_device_id = ids; + + ui->tableWidget->clearContents(); + ui->tableWidget->setRowCount(0); + QStringList idList; + int rowCount = 0; + int row=0; + checkId=""; + if(ids!="") + { + idList = ids.split(","); + for(const QString& id : idList) + { + checkId = id; + QList result = BaseCommonApi::getCatDeviceInfor(id); + if(result.length()>0){ + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + QTableWidgetItem* p_check = new QTableWidgetItem(); + p_check->setCheckState(Qt::Unchecked); //设置首列为 CheckBox 控件 + ui->tableWidget->setItem(row,0,p_check); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(result[0].equipment_name)); //设置数据 + ui->tableWidget->setItem(row, 2, new QTableWidgetItem("")); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(result[0].model)); //设置数据 + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(result[0].manufacture_no)); //设置数据 + QPushButton *btn_1 = new QPushButton(); + btn_1->setText(tr("设置命令")); + btn_1->setStyleSheet("QPushButton{" + "background-color:rgba(255,255,255,0);" + "color:rgba(92,170,54,100);" + "text-decoration:underline;" + "}"); + btn_1->setCursor(Qt::PointingHandCursor); + int type=1; + //connect(btn_1,SIGNAL(clicked()),this,SLOT(on_cmdButton_clicked(1,id))); + connect(btn_1, &QPushButton::clicked, this, [this,type, id]() { + on_cmdButton_clicked(type,id); + }); + btn_1->setIconSize(QSize(16,16)); + btn_1->setIcon(QIcon(":/image/Index/u2324.svg")); + QPushButton *btn_2 = new QPushButton(); + btn_2->setText(tr("设置设备接口")); + btn_2->setStyleSheet("QPushButton{" + "background-color:rgba(255,255,255,0);" + "color:rgba(92,170,54,100);" + "text-decoration:underline;" + "}"); + btn_2->setCursor(Qt::PointingHandCursor); + //connect(btn_2,SIGNAL(clicked()),this,SLOT(on_commButton_clicked(1,id))); + connect(btn_2, &QPushButton::clicked, this, [this,type, id]() { + on_commButton_clicked(type,id); + }); + btn_2->setIconSize(QSize(16,16)); + btn_2->setIcon(QIcon(":/image/Index/u2324.svg")); + QWidget *tmp_widget = new QWidget(); + QHBoxLayout *tmp_layout = new QHBoxLayout(tmp_widget); + tmp_layout->addWidget(btn_1); + tmp_layout->addWidget(btn_2); + tmp_layout->setMargin(0); + ui->tableWidget->setCellWidget(row,5,tmp_widget); + row++; + } + } + idList.clear(); + } +} void NewVerifyMethod::chooseDevices(QString bizIds,QString checkIds) { @@ -246,6 +323,10 @@ qint64 id = baseApi.generateId(); programInfo.id = QString::number(id); programInfo.check_name = ui->lineEditName->text(); + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); programInfo.remark = ui->lineEditMark->text(); @@ -259,6 +340,10 @@ } }else{ programInfo.check_name = ui->lineEditName->text(); + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); programInfo.update_time = QDateTime::currentDateTime(); @@ -277,3 +362,24 @@ { this->close(); } + +void NewVerifyMethod::on_comboBoxEquipment_currentIndexChanged(int index) +{ + QString id = QString::number(index+1); + catList.clear(); + ui->comboBoxCategory->clear(); + catList = BaseCommonApi::getitemCategoryList(id); + for(const itemCategory& item : catList){ + ui->comboBoxCategory->addItem(item.category_name); + } +} + +void NewVerifyMethod::on_pushButton_clicked() +{ + FormBizDeviceSelect *checkWindow = new FormBizDeviceSelect; + //checkWindow->newVerifyWnd=this; + checkWindow->setWindowState(Qt::WindowMaximized); + //connect(checkWindow, SIGNAL(selectStandard(QString)), this,SLOT(selectStandard(QString))); + checkWindow->setWindowModality(Qt::ApplicationModal); + checkWindow->show(); +} diff --git a/softwareDirectory/AutoVerScheme/newverifymethod.h b/softwareDirectory/AutoVerScheme/newverifymethod.h index 661be87..7612d3f 100644 --- a/softwareDirectory/AutoVerScheme/newverifymethod.h +++ b/softwareDirectory/AutoVerScheme/newverifymethod.h @@ -31,6 +31,11 @@ void on_pushButton_10_clicked(); + void on_comboBoxEquipment_currentIndexChanged(int index); + void selectStandard(QString ids); + + void on_pushButton_clicked(); + public: VerifyMethodManage *verifyManageWnd=nullptr; private: @@ -39,6 +44,9 @@ QString checkId=""; CheckProgramManage programInfo; bool bEditMode=true; + QStringList equipList={"多功能校准源标准装置","直流稳压电源检定装置","多功能电气安全标准器标准装置","0.02级活塞式压力计标准装置","二等铂电阻温度计标准装置","安全阀校验装置", + "精密露点仪标准装置","E2等级砝码标准装置","频谱分析仪标准装置","信号发生器标准装置","微波衰减标准装置","频率短期稳定度标准装置","示波器标准装置","铯原子频率标准装置","小功率标准装置"}; + QList catList; }; #endif // NEWVERIFYMETHOD_H diff --git a/softwareDirectory/AutoVerScheme/newverifymethod.ui b/softwareDirectory/AutoVerScheme/newverifymethod.ui index 1b3a1f1..3ec3d96 100644 --- a/softwareDirectory/AutoVerScheme/newverifymethod.ui +++ b/softwareDirectory/AutoVerScheme/newverifymethod.ui @@ -33,6 +33,7 @@ + 14 75 true @@ -49,6 +50,7 @@ + 12 75 true @@ -71,6 +73,7 @@ + 12 75 true @@ -102,6 +105,7 @@ + 12 75 true @@ -113,42 +117,20 @@ - - + + - 75 - true + 12 - - 程序名称: - - - - - - - - - 75 - true - - - - 创建人: - - - - - - - + + 12 75 true @@ -158,13 +140,80 @@ - - + + + + + 12 + + + + + + + + + 12 + 75 + true + + + + 创建人: + + + + + + + + 12 + 75 + true + + + + 核查标准装置: + + + + + + + + 12 + + + + + + + 12 + 75 + true + + + + 程序名称: + + + + + + + + 12 + + + + + + 12 75 true @@ -174,8 +223,37 @@ - - + + + + + 12 + + + + + + + + + 12 + 75 + true + + + + 核查项分类: + + + + + + + + 12 + + + @@ -196,6 +274,7 @@ + 12 75 true @@ -215,6 +294,7 @@ + 12 75 true @@ -243,6 +323,7 @@ + 12 75 true @@ -289,6 +370,7 @@ + 12 75 true @@ -304,6 +386,7 @@ + 12 75 true @@ -323,6 +406,7 @@ + 12 75 true @@ -332,12 +416,31 @@ color: rgb(255, 255, 255); - 选择设备 + 增加标准设备 - - - :/image/Index/u7453.svg - + + + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(100, 132, 68); + + + 删除行 @@ -347,33 +450,193 @@ - 设备类型 + 选择 + + + + 12 + 设备名称 + + + 12 + + + + + + 角色 + + + + 12 + + 型号规格 + + + 12 + + 出厂编号 - - - - 生产厂家 + + + 12 + 操作 + + + 12 + + + + + + + + + + + + 12 + 75 + true + + + + 选择核查件: + + + + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + background-color: rgb(51, 69, 130); +color: rgb(255, 255, 255); + + + 增加核查件 + + + + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(100, 132, 68); + + + 删除行 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 角色 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 操作 + + + + 12 + + @@ -383,6 +646,7 @@ + 12 75 true @@ -402,6 +666,7 @@ + 12 75 true diff --git a/softwareDirectory/AutoVerScheme/verifydevice.cpp b/softwareDirectory/AutoVerScheme/verifydevice.cpp index 46c29c2..343a59d 100644 --- a/softwareDirectory/AutoVerScheme/verifydevice.cpp +++ b/softwareDirectory/AutoVerScheme/verifydevice.cpp @@ -13,9 +13,9 @@ ui->tableWidget->setColumnWidth(0, 80); for(int i=1;i<5;i++) ui->tableWidget->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); - ui->tableWidget_2->setColumnWidth(0, 80); - for(int i=1;i<5;i++) - ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); +// ui->tableWidget_2->setColumnWidth(0, 80); +// for(int i=1;i<5;i++) +// ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); getVerifyDevice(); getCheckDevice(); } @@ -34,7 +34,7 @@ int rowCount=0; int row=0; bizDeviceList.clear(); -// bizDeviceList = BaseCommonApi::getCheckDeviceList(); + bizDeviceList = BaseCommonApi::getCheckDeviceList(); QString sFilterName = ui->lineEdit->text(); QString sFilterModel = ui->lineEdit_2->text(); QString sFilterNo = ui->lineEdit_3->text(); @@ -69,42 +69,42 @@ void VerifyDevice::getCheckDevice() { - ui->tableWidget_2->clearContents(); - ui->tableWidget_2->setRowCount(0); - int rowCount=0; - int row=0; - testedDeviceList.clear(); -// testedDeviceList = BaseCommonApi::getCheckAndTestedDeviceList(); - QString sFilterName = ui->lineEdit_4->text(); - QString sFilterModel = ui->lineEdit_5->text(); - QString sFilterNo = ui->lineEdit_6->text(); - for(int i=testedDeviceList.length()-1;i>=0;i--){ - bool bAdd=true; - if(sFilterName!=""&&!testedDeviceList[i].equipment_name.contains(sFilterName)){ - bAdd=false; - } - if(sFilterModel!=""&&!testedDeviceList[i].model.contains(sFilterModel)){ - bAdd=false; - } - if(sFilterNo!=""&&!testedDeviceList[i].manufacture_no.contains(sFilterNo)){ - bAdd=false; - } - if(!bAdd){ - testedDeviceList.removeAt(i); - } - } - for (const CheckAndTestedDevice& bizDevice : testedDeviceList) { - rowCount = ui->tableWidget_2->rowCount(); - ui->tableWidget_2->insertRow(rowCount); - QTableWidgetItem* p_check = new QTableWidgetItem(); - p_check->setCheckState(Qt::Unchecked); //设置首列为 CheckBox 控件 - ui->tableWidget_2->setItem(row,0,p_check); - ui->tableWidget_2->setItem(row, 1, new QTableWidgetItem(bizDevice.equipment_name)); - ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacturer)); - row++; - } +// ui->tableWidget_2->clearContents(); +// ui->tableWidget_2->setRowCount(0); +// int rowCount=0; +// int row=0; +// testedDeviceList.clear(); +//// testedDeviceList = BaseCommonApi::getCheckAndTestedDeviceList(); +// QString sFilterName = ui->lineEdit_4->text(); +// QString sFilterModel = ui->lineEdit_5->text(); +// QString sFilterNo = ui->lineEdit_6->text(); +// for(int i=testedDeviceList.length()-1;i>=0;i--){ +// bool bAdd=true; +// if(sFilterName!=""&&!testedDeviceList[i].equipment_name.contains(sFilterName)){ +// bAdd=false; +// } +// if(sFilterModel!=""&&!testedDeviceList[i].model.contains(sFilterModel)){ +// bAdd=false; +// } +// if(sFilterNo!=""&&!testedDeviceList[i].manufacture_no.contains(sFilterNo)){ +// bAdd=false; +// } +// if(!bAdd){ +// testedDeviceList.removeAt(i); +// } +// } +// for (const CheckAndTestedDevice& bizDevice : testedDeviceList) { +// rowCount = ui->tableWidget_2->rowCount(); +// ui->tableWidget_2->insertRow(rowCount); +// QTableWidgetItem* p_check = new QTableWidgetItem(); +// p_check->setCheckState(Qt::Unchecked); //设置首列为 CheckBox 控件 +// ui->tableWidget_2->setItem(row,0,p_check); +// ui->tableWidget_2->setItem(row, 1, new QTableWidgetItem(bizDevice.equipment_name)); +// ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(bizDevice.model)); +// ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(bizDevice.manufacture_no)); +// ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacturer)); +// row++; +// } } @@ -120,23 +120,24 @@ bizIds+=","+bizDeviceList[i].id; } } - for(int i=0;itableWidget_2->rowCount();i++){ - if(ui->tableWidget_2->item(i,0)->checkState()==Qt::Checked){ - if(checkIds=="") - checkIds = testedDeviceList[i].id; - else - checkIds+=","+testedDeviceList[i].id; - } - } - if(checkIds==""){ - QMessageBox::warning(this, "提示", "请选择核查件!"); - return; - } +// for(int i=0;itableWidget_2->rowCount();i++){ +// if(ui->tableWidget_2->item(i,0)->checkState()==Qt::Checked){ +// if(checkIds=="") +// checkIds = testedDeviceList[i].id; +// else +// checkIds+=","+testedDeviceList[i].id; +// } +// } +// if(checkIds==""){ +// QMessageBox::warning(this, "提示", "请选择核查件!"); +// return; +// } if(bizIds==""){ QMessageBox::warning(this, "提示", "请选择标准设备!"); return; } - newVerifyWnd->chooseDevices(bizIds,checkIds); + emit selectStandard(bizIds); + //newVerifyWnd->chooseDevices(bizIds,checkIds); this->close(); } @@ -160,8 +161,8 @@ void VerifyDevice::on_pushButton_12_clicked() { - ui->lineEdit_4->setText(""); - ui->lineEdit_5->setText(""); - ui->lineEdit_6->setText(""); - getCheckDevice(); +// ui->lineEdit_4->setText(""); +// ui->lineEdit_5->setText(""); +// ui->lineEdit_6->setText(""); +// getCheckDevice(); } diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro index 2441e80..2f25c21 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro @@ -43,6 +43,7 @@ dialogcheckresult.cpp \ dialogdcstabinput.cpp \ formaddrsetting.cpp \ + formbizdeviceselect.cpp \ formcheckpoint.cpp \ formcommsetting.cpp \ formgageresult.cpp \ @@ -79,6 +80,7 @@ databaseconnectionmainsys.h \ dialogdcstabinput.h \ formaddrsetting.h \ + formbizdeviceselect.h \ formcommsetting.h \ formgageresult.h \ id/IdWorker.h \ @@ -139,6 +141,7 @@ dialogcheckresult.ui \ dialogdcstabinput.ui \ formaddrsetting.ui \ + formbizdeviceselect.ui \ formcheckpoint.ui \ formcommsetting.ui \ formgageresult.ui \ diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp new file mode 100644 index 0000000..4ebce72 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp @@ -0,0 +1,26 @@ +#include "formbizdeviceselect.h" +#include "ui_formbizdeviceselect.h" +#include "PageControl.h" + +FormBizDeviceSelect::FormBizDeviceSelect(QWidget *parent) : + QWidget(parent), + ui(new Ui::FormBizDeviceSelect) +{ + ui->setupUi(this); + + page=20; + pageIndex=-1; + PagedTableWidget *pagedTable = new PagedTableWidget(this, ui->HBoxPageLayout); + pagedTable->setData(10, page); // 每页10行 + connect(pagedTable, SIGNAL(pageChanged(int)), this,SLOT(onpageChanged(int))); + this->onpageChanged(0); +} + +FormBizDeviceSelect::~FormBizDeviceSelect() +{ + delete ui; +} + +void FormBizDeviceSelect::onpageChanged(int currPage){ + +} diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.h b/softwareDirectory/AutoVerScheme/formbizdeviceselect.h new file mode 100644 index 0000000..9bafa34 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.h @@ -0,0 +1,29 @@ +#ifndef FORMBIZDEVICESELECT_H +#define FORMBIZDEVICESELECT_H + +#include + +namespace Ui { +class FormBizDeviceSelect; +} + +class FormBizDeviceSelect : public QWidget +{ + Q_OBJECT + +public: + explicit FormBizDeviceSelect(QWidget *parent = nullptr); + ~FormBizDeviceSelect(); + +private slots: + void onpageChanged(int currPage); + +private: + int page; + int totalcount; + int pageIndex; +private: + Ui::FormBizDeviceSelect *ui; +}; + +#endif // FORMBIZDEVICESELECT_H diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui b/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui new file mode 100644 index 0000000..39e247a --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui @@ -0,0 +1,551 @@ + + + FormBizDeviceSelect + + + + 0 + 0 + 869 + 550 + + + + Form + + + background-color: rgb(255, 255, 255); + + + + + + background-color: rgb(51, 69, 130); + + + + 10 + + + + + + 0 + 0 + + + + + 48 + 48 + + + + image: url(:/image/Index/u7538.svg); + + + + + + + + + + + 1 + 0 + + + + + 18 + 75 + true + + + + color: rgb(255, 255, 255); + + + 选择标准装置下的标准配套设备 + + + + + + + + + + + + + + 12 + + + 10 + + + 10 + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 查询 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 重置 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 生产厂家 + + + + 12 + + + + + + 设备类型 + + + + 12 + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + 12 + + + 10 + + + 10 + + + + + + 12 + + + + 设备名称 + + + + + + + + 12 + + + + 型号规格 + + + + + + + + 12 + + + + 出厂编号 + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 查询 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 重置 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 生产厂家 + + + + 12 + + + + + + 设备类型 + + + + 12 + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 保存 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 取消 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/newverifymethod.cpp b/softwareDirectory/AutoVerScheme/newverifymethod.cpp index 4680544..5638c52 100644 --- a/softwareDirectory/AutoVerScheme/newverifymethod.cpp +++ b/softwareDirectory/AutoVerScheme/newverifymethod.cpp @@ -6,6 +6,7 @@ #include "formaddrsetting.h" #include "qfiledialog.h" #include +#include "formbizdeviceselect.h" NewVerifyMethod::NewVerifyMethod(QWidget *parent,QString sId,bool bEdit) : QWidget(parent), @@ -15,9 +16,16 @@ { ui->setupUi(this); ui->tableWidget->verticalHeader()->setParent(nullptr); - for(int i=0;i<6;i++) + for(int i=1;i<5;i++){ ui->tableWidget->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + } + ui->tableWidget->setColumnWidth(0, 60); + ui->tableWidget->setColumnWidth(5, 200); + ui->tableWidget_2->setColumnWidth(0, 60); + ui->tableWidget_2->setColumnWidth(5, 200); ui->pushButton_9->setEnabled(bEditMode); + ui->comboBoxEquipment->addItems(equipList); getMethodInfo(); } @@ -53,8 +61,9 @@ void NewVerifyMethod::showVerifyDevice() { VerifyDevice *checkWindow = new VerifyDevice; - checkWindow->newVerifyWnd=this; - checkWindow->setWindowState(Qt::WindowMaximized); + //checkWindow->newVerifyWnd=this; + //checkWindow->setWindowState(Qt::WindowMaximized); + connect(checkWindow, SIGNAL(selectStandard(QString)), this,SLOT(selectStandard(QString))); checkWindow->setWindowModality(Qt::ApplicationModal); checkWindow->show(); } @@ -83,6 +92,74 @@ form->show(); } +void NewVerifyMethod::selectStandard(QString ids){ + programInfo.standard_device_id = ids; + + ui->tableWidget->clearContents(); + ui->tableWidget->setRowCount(0); + QStringList idList; + int rowCount = 0; + int row=0; + checkId=""; + if(ids!="") + { + idList = ids.split(","); + for(const QString& id : idList) + { + checkId = id; + QList result = BaseCommonApi::getCatDeviceInfor(id); + if(result.length()>0){ + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + QTableWidgetItem* p_check = new QTableWidgetItem(); + p_check->setCheckState(Qt::Unchecked); //设置首列为 CheckBox 控件 + ui->tableWidget->setItem(row,0,p_check); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(result[0].equipment_name)); //设置数据 + ui->tableWidget->setItem(row, 2, new QTableWidgetItem("")); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(result[0].model)); //设置数据 + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(result[0].manufacture_no)); //设置数据 + QPushButton *btn_1 = new QPushButton(); + btn_1->setText(tr("设置命令")); + btn_1->setStyleSheet("QPushButton{" + "background-color:rgba(255,255,255,0);" + "color:rgba(92,170,54,100);" + "text-decoration:underline;" + "}"); + btn_1->setCursor(Qt::PointingHandCursor); + int type=1; + //connect(btn_1,SIGNAL(clicked()),this,SLOT(on_cmdButton_clicked(1,id))); + connect(btn_1, &QPushButton::clicked, this, [this,type, id]() { + on_cmdButton_clicked(type,id); + }); + btn_1->setIconSize(QSize(16,16)); + btn_1->setIcon(QIcon(":/image/Index/u2324.svg")); + QPushButton *btn_2 = new QPushButton(); + btn_2->setText(tr("设置设备接口")); + btn_2->setStyleSheet("QPushButton{" + "background-color:rgba(255,255,255,0);" + "color:rgba(92,170,54,100);" + "text-decoration:underline;" + "}"); + btn_2->setCursor(Qt::PointingHandCursor); + //connect(btn_2,SIGNAL(clicked()),this,SLOT(on_commButton_clicked(1,id))); + connect(btn_2, &QPushButton::clicked, this, [this,type, id]() { + on_commButton_clicked(type,id); + }); + btn_2->setIconSize(QSize(16,16)); + btn_2->setIcon(QIcon(":/image/Index/u2324.svg")); + QWidget *tmp_widget = new QWidget(); + QHBoxLayout *tmp_layout = new QHBoxLayout(tmp_widget); + tmp_layout->addWidget(btn_1); + tmp_layout->addWidget(btn_2); + tmp_layout->setMargin(0); + ui->tableWidget->setCellWidget(row,5,tmp_widget); + row++; + } + } + idList.clear(); + } +} void NewVerifyMethod::chooseDevices(QString bizIds,QString checkIds) { @@ -246,6 +323,10 @@ qint64 id = baseApi.generateId(); programInfo.id = QString::number(id); programInfo.check_name = ui->lineEditName->text(); + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); programInfo.remark = ui->lineEditMark->text(); @@ -259,6 +340,10 @@ } }else{ programInfo.check_name = ui->lineEditName->text(); + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); programInfo.update_time = QDateTime::currentDateTime(); @@ -277,3 +362,24 @@ { this->close(); } + +void NewVerifyMethod::on_comboBoxEquipment_currentIndexChanged(int index) +{ + QString id = QString::number(index+1); + catList.clear(); + ui->comboBoxCategory->clear(); + catList = BaseCommonApi::getitemCategoryList(id); + for(const itemCategory& item : catList){ + ui->comboBoxCategory->addItem(item.category_name); + } +} + +void NewVerifyMethod::on_pushButton_clicked() +{ + FormBizDeviceSelect *checkWindow = new FormBizDeviceSelect; + //checkWindow->newVerifyWnd=this; + checkWindow->setWindowState(Qt::WindowMaximized); + //connect(checkWindow, SIGNAL(selectStandard(QString)), this,SLOT(selectStandard(QString))); + checkWindow->setWindowModality(Qt::ApplicationModal); + checkWindow->show(); +} diff --git a/softwareDirectory/AutoVerScheme/newverifymethod.h b/softwareDirectory/AutoVerScheme/newverifymethod.h index 661be87..7612d3f 100644 --- a/softwareDirectory/AutoVerScheme/newverifymethod.h +++ b/softwareDirectory/AutoVerScheme/newverifymethod.h @@ -31,6 +31,11 @@ void on_pushButton_10_clicked(); + void on_comboBoxEquipment_currentIndexChanged(int index); + void selectStandard(QString ids); + + void on_pushButton_clicked(); + public: VerifyMethodManage *verifyManageWnd=nullptr; private: @@ -39,6 +44,9 @@ QString checkId=""; CheckProgramManage programInfo; bool bEditMode=true; + QStringList equipList={"多功能校准源标准装置","直流稳压电源检定装置","多功能电气安全标准器标准装置","0.02级活塞式压力计标准装置","二等铂电阻温度计标准装置","安全阀校验装置", + "精密露点仪标准装置","E2等级砝码标准装置","频谱分析仪标准装置","信号发生器标准装置","微波衰减标准装置","频率短期稳定度标准装置","示波器标准装置","铯原子频率标准装置","小功率标准装置"}; + QList catList; }; #endif // NEWVERIFYMETHOD_H diff --git a/softwareDirectory/AutoVerScheme/newverifymethod.ui b/softwareDirectory/AutoVerScheme/newverifymethod.ui index 1b3a1f1..3ec3d96 100644 --- a/softwareDirectory/AutoVerScheme/newverifymethod.ui +++ b/softwareDirectory/AutoVerScheme/newverifymethod.ui @@ -33,6 +33,7 @@ + 14 75 true @@ -49,6 +50,7 @@ + 12 75 true @@ -71,6 +73,7 @@ + 12 75 true @@ -102,6 +105,7 @@ + 12 75 true @@ -113,42 +117,20 @@ - - + + - 75 - true + 12 - - 程序名称: - - - - - - - - - 75 - true - - - - 创建人: - - - - - - - + + 12 75 true @@ -158,13 +140,80 @@ - - + + + + + 12 + + + + + + + + + 12 + 75 + true + + + + 创建人: + + + + + + + + 12 + 75 + true + + + + 核查标准装置: + + + + + + + + 12 + + + + + + + 12 + 75 + true + + + + 程序名称: + + + + + + + + 12 + + + + + + 12 75 true @@ -174,8 +223,37 @@ - - + + + + + 12 + + + + + + + + + 12 + 75 + true + + + + 核查项分类: + + + + + + + + 12 + + + @@ -196,6 +274,7 @@ + 12 75 true @@ -215,6 +294,7 @@ + 12 75 true @@ -243,6 +323,7 @@ + 12 75 true @@ -289,6 +370,7 @@ + 12 75 true @@ -304,6 +386,7 @@ + 12 75 true @@ -323,6 +406,7 @@ + 12 75 true @@ -332,12 +416,31 @@ color: rgb(255, 255, 255); - 选择设备 + 增加标准设备 - - - :/image/Index/u7453.svg - + + + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(100, 132, 68); + + + 删除行 @@ -347,33 +450,193 @@ - 设备类型 + 选择 + + + + 12 + 设备名称 + + + 12 + + + + + + 角色 + + + + 12 + + 型号规格 + + + 12 + + 出厂编号 - - - - 生产厂家 + + + 12 + 操作 + + + 12 + + + + + + + + + + + + 12 + 75 + true + + + + 选择核查件: + + + + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + background-color: rgb(51, 69, 130); +color: rgb(255, 255, 255); + + + 增加核查件 + + + + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(100, 132, 68); + + + 删除行 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 角色 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 操作 + + + + 12 + + @@ -383,6 +646,7 @@ + 12 75 true @@ -402,6 +666,7 @@ + 12 75 true diff --git a/softwareDirectory/AutoVerScheme/verifydevice.cpp b/softwareDirectory/AutoVerScheme/verifydevice.cpp index 46c29c2..343a59d 100644 --- a/softwareDirectory/AutoVerScheme/verifydevice.cpp +++ b/softwareDirectory/AutoVerScheme/verifydevice.cpp @@ -13,9 +13,9 @@ ui->tableWidget->setColumnWidth(0, 80); for(int i=1;i<5;i++) ui->tableWidget->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); - ui->tableWidget_2->setColumnWidth(0, 80); - for(int i=1;i<5;i++) - ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); +// ui->tableWidget_2->setColumnWidth(0, 80); +// for(int i=1;i<5;i++) +// ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); getVerifyDevice(); getCheckDevice(); } @@ -34,7 +34,7 @@ int rowCount=0; int row=0; bizDeviceList.clear(); -// bizDeviceList = BaseCommonApi::getCheckDeviceList(); + bizDeviceList = BaseCommonApi::getCheckDeviceList(); QString sFilterName = ui->lineEdit->text(); QString sFilterModel = ui->lineEdit_2->text(); QString sFilterNo = ui->lineEdit_3->text(); @@ -69,42 +69,42 @@ void VerifyDevice::getCheckDevice() { - ui->tableWidget_2->clearContents(); - ui->tableWidget_2->setRowCount(0); - int rowCount=0; - int row=0; - testedDeviceList.clear(); -// testedDeviceList = BaseCommonApi::getCheckAndTestedDeviceList(); - QString sFilterName = ui->lineEdit_4->text(); - QString sFilterModel = ui->lineEdit_5->text(); - QString sFilterNo = ui->lineEdit_6->text(); - for(int i=testedDeviceList.length()-1;i>=0;i--){ - bool bAdd=true; - if(sFilterName!=""&&!testedDeviceList[i].equipment_name.contains(sFilterName)){ - bAdd=false; - } - if(sFilterModel!=""&&!testedDeviceList[i].model.contains(sFilterModel)){ - bAdd=false; - } - if(sFilterNo!=""&&!testedDeviceList[i].manufacture_no.contains(sFilterNo)){ - bAdd=false; - } - if(!bAdd){ - testedDeviceList.removeAt(i); - } - } - for (const CheckAndTestedDevice& bizDevice : testedDeviceList) { - rowCount = ui->tableWidget_2->rowCount(); - ui->tableWidget_2->insertRow(rowCount); - QTableWidgetItem* p_check = new QTableWidgetItem(); - p_check->setCheckState(Qt::Unchecked); //设置首列为 CheckBox 控件 - ui->tableWidget_2->setItem(row,0,p_check); - ui->tableWidget_2->setItem(row, 1, new QTableWidgetItem(bizDevice.equipment_name)); - ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacturer)); - row++; - } +// ui->tableWidget_2->clearContents(); +// ui->tableWidget_2->setRowCount(0); +// int rowCount=0; +// int row=0; +// testedDeviceList.clear(); +//// testedDeviceList = BaseCommonApi::getCheckAndTestedDeviceList(); +// QString sFilterName = ui->lineEdit_4->text(); +// QString sFilterModel = ui->lineEdit_5->text(); +// QString sFilterNo = ui->lineEdit_6->text(); +// for(int i=testedDeviceList.length()-1;i>=0;i--){ +// bool bAdd=true; +// if(sFilterName!=""&&!testedDeviceList[i].equipment_name.contains(sFilterName)){ +// bAdd=false; +// } +// if(sFilterModel!=""&&!testedDeviceList[i].model.contains(sFilterModel)){ +// bAdd=false; +// } +// if(sFilterNo!=""&&!testedDeviceList[i].manufacture_no.contains(sFilterNo)){ +// bAdd=false; +// } +// if(!bAdd){ +// testedDeviceList.removeAt(i); +// } +// } +// for (const CheckAndTestedDevice& bizDevice : testedDeviceList) { +// rowCount = ui->tableWidget_2->rowCount(); +// ui->tableWidget_2->insertRow(rowCount); +// QTableWidgetItem* p_check = new QTableWidgetItem(); +// p_check->setCheckState(Qt::Unchecked); //设置首列为 CheckBox 控件 +// ui->tableWidget_2->setItem(row,0,p_check); +// ui->tableWidget_2->setItem(row, 1, new QTableWidgetItem(bizDevice.equipment_name)); +// ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(bizDevice.model)); +// ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(bizDevice.manufacture_no)); +// ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacturer)); +// row++; +// } } @@ -120,23 +120,24 @@ bizIds+=","+bizDeviceList[i].id; } } - for(int i=0;itableWidget_2->rowCount();i++){ - if(ui->tableWidget_2->item(i,0)->checkState()==Qt::Checked){ - if(checkIds=="") - checkIds = testedDeviceList[i].id; - else - checkIds+=","+testedDeviceList[i].id; - } - } - if(checkIds==""){ - QMessageBox::warning(this, "提示", "请选择核查件!"); - return; - } +// for(int i=0;itableWidget_2->rowCount();i++){ +// if(ui->tableWidget_2->item(i,0)->checkState()==Qt::Checked){ +// if(checkIds=="") +// checkIds = testedDeviceList[i].id; +// else +// checkIds+=","+testedDeviceList[i].id; +// } +// } +// if(checkIds==""){ +// QMessageBox::warning(this, "提示", "请选择核查件!"); +// return; +// } if(bizIds==""){ QMessageBox::warning(this, "提示", "请选择标准设备!"); return; } - newVerifyWnd->chooseDevices(bizIds,checkIds); + emit selectStandard(bizIds); + //newVerifyWnd->chooseDevices(bizIds,checkIds); this->close(); } @@ -160,8 +161,8 @@ void VerifyDevice::on_pushButton_12_clicked() { - ui->lineEdit_4->setText(""); - ui->lineEdit_5->setText(""); - ui->lineEdit_6->setText(""); - getCheckDevice(); +// ui->lineEdit_4->setText(""); +// ui->lineEdit_5->setText(""); +// ui->lineEdit_6->setText(""); +// getCheckDevice(); } diff --git a/softwareDirectory/AutoVerScheme/verifydevice.h b/softwareDirectory/AutoVerScheme/verifydevice.h index 5524a14..0db1ec5 100644 --- a/softwareDirectory/AutoVerScheme/verifydevice.h +++ b/softwareDirectory/AutoVerScheme/verifydevice.h @@ -26,12 +26,12 @@ void on_pushButton_13_clicked(); void on_pushButton_12_clicked(); - +signals: + void selectStandard(QString ids); private: void getVerifyDevice(); void getCheckDevice(); -public: - NewVerifyMethod *newVerifyWnd=nullptr; + private: Ui::VerifyDevice *ui; QList testedDeviceList; diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro index 2441e80..2f25c21 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro @@ -43,6 +43,7 @@ dialogcheckresult.cpp \ dialogdcstabinput.cpp \ formaddrsetting.cpp \ + formbizdeviceselect.cpp \ formcheckpoint.cpp \ formcommsetting.cpp \ formgageresult.cpp \ @@ -79,6 +80,7 @@ databaseconnectionmainsys.h \ dialogdcstabinput.h \ formaddrsetting.h \ + formbizdeviceselect.h \ formcommsetting.h \ formgageresult.h \ id/IdWorker.h \ @@ -139,6 +141,7 @@ dialogcheckresult.ui \ dialogdcstabinput.ui \ formaddrsetting.ui \ + formbizdeviceselect.ui \ formcheckpoint.ui \ formcommsetting.ui \ formgageresult.ui \ diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp new file mode 100644 index 0000000..4ebce72 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.cpp @@ -0,0 +1,26 @@ +#include "formbizdeviceselect.h" +#include "ui_formbizdeviceselect.h" +#include "PageControl.h" + +FormBizDeviceSelect::FormBizDeviceSelect(QWidget *parent) : + QWidget(parent), + ui(new Ui::FormBizDeviceSelect) +{ + ui->setupUi(this); + + page=20; + pageIndex=-1; + PagedTableWidget *pagedTable = new PagedTableWidget(this, ui->HBoxPageLayout); + pagedTable->setData(10, page); // 每页10行 + connect(pagedTable, SIGNAL(pageChanged(int)), this,SLOT(onpageChanged(int))); + this->onpageChanged(0); +} + +FormBizDeviceSelect::~FormBizDeviceSelect() +{ + delete ui; +} + +void FormBizDeviceSelect::onpageChanged(int currPage){ + +} diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.h b/softwareDirectory/AutoVerScheme/formbizdeviceselect.h new file mode 100644 index 0000000..9bafa34 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.h @@ -0,0 +1,29 @@ +#ifndef FORMBIZDEVICESELECT_H +#define FORMBIZDEVICESELECT_H + +#include + +namespace Ui { +class FormBizDeviceSelect; +} + +class FormBizDeviceSelect : public QWidget +{ + Q_OBJECT + +public: + explicit FormBizDeviceSelect(QWidget *parent = nullptr); + ~FormBizDeviceSelect(); + +private slots: + void onpageChanged(int currPage); + +private: + int page; + int totalcount; + int pageIndex; +private: + Ui::FormBizDeviceSelect *ui; +}; + +#endif // FORMBIZDEVICESELECT_H diff --git a/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui b/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui new file mode 100644 index 0000000..39e247a --- /dev/null +++ b/softwareDirectory/AutoVerScheme/formbizdeviceselect.ui @@ -0,0 +1,551 @@ + + + FormBizDeviceSelect + + + + 0 + 0 + 869 + 550 + + + + Form + + + background-color: rgb(255, 255, 255); + + + + + + background-color: rgb(51, 69, 130); + + + + 10 + + + + + + 0 + 0 + + + + + 48 + 48 + + + + image: url(:/image/Index/u7538.svg); + + + + + + + + + + + 1 + 0 + + + + + 18 + 75 + true + + + + color: rgb(255, 255, 255); + + + 选择标准装置下的标准配套设备 + + + + + + + + + + + + + + 12 + + + 10 + + + 10 + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 查询 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 重置 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 生产厂家 + + + + 12 + + + + + + 设备类型 + + + + 12 + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + 12 + + + 10 + + + 10 + + + + + + 12 + + + + 设备名称 + + + + + + + + 12 + + + + 型号规格 + + + + + + + + 12 + + + + 出厂编号 + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 查询 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 重置 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 生产厂家 + + + + 12 + + + + + + 设备类型 + + + + 12 + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 1 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(74, 102, 186); +border-radius:5px; + + + 保存 + + + + + + + + 0 + 0 + + + + + 72 + 26 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(207, 132, 33); +border-radius:5px; + + + 取消 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/newverifymethod.cpp b/softwareDirectory/AutoVerScheme/newverifymethod.cpp index 4680544..5638c52 100644 --- a/softwareDirectory/AutoVerScheme/newverifymethod.cpp +++ b/softwareDirectory/AutoVerScheme/newverifymethod.cpp @@ -6,6 +6,7 @@ #include "formaddrsetting.h" #include "qfiledialog.h" #include +#include "formbizdeviceselect.h" NewVerifyMethod::NewVerifyMethod(QWidget *parent,QString sId,bool bEdit) : QWidget(parent), @@ -15,9 +16,16 @@ { ui->setupUi(this); ui->tableWidget->verticalHeader()->setParent(nullptr); - for(int i=0;i<6;i++) + for(int i=1;i<5;i++){ ui->tableWidget->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + } + ui->tableWidget->setColumnWidth(0, 60); + ui->tableWidget->setColumnWidth(5, 200); + ui->tableWidget_2->setColumnWidth(0, 60); + ui->tableWidget_2->setColumnWidth(5, 200); ui->pushButton_9->setEnabled(bEditMode); + ui->comboBoxEquipment->addItems(equipList); getMethodInfo(); } @@ -53,8 +61,9 @@ void NewVerifyMethod::showVerifyDevice() { VerifyDevice *checkWindow = new VerifyDevice; - checkWindow->newVerifyWnd=this; - checkWindow->setWindowState(Qt::WindowMaximized); + //checkWindow->newVerifyWnd=this; + //checkWindow->setWindowState(Qt::WindowMaximized); + connect(checkWindow, SIGNAL(selectStandard(QString)), this,SLOT(selectStandard(QString))); checkWindow->setWindowModality(Qt::ApplicationModal); checkWindow->show(); } @@ -83,6 +92,74 @@ form->show(); } +void NewVerifyMethod::selectStandard(QString ids){ + programInfo.standard_device_id = ids; + + ui->tableWidget->clearContents(); + ui->tableWidget->setRowCount(0); + QStringList idList; + int rowCount = 0; + int row=0; + checkId=""; + if(ids!="") + { + idList = ids.split(","); + for(const QString& id : idList) + { + checkId = id; + QList result = BaseCommonApi::getCatDeviceInfor(id); + if(result.length()>0){ + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + QTableWidgetItem* p_check = new QTableWidgetItem(); + p_check->setCheckState(Qt::Unchecked); //设置首列为 CheckBox 控件 + ui->tableWidget->setItem(row,0,p_check); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(result[0].equipment_name)); //设置数据 + ui->tableWidget->setItem(row, 2, new QTableWidgetItem("")); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(result[0].model)); //设置数据 + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(result[0].manufacture_no)); //设置数据 + QPushButton *btn_1 = new QPushButton(); + btn_1->setText(tr("设置命令")); + btn_1->setStyleSheet("QPushButton{" + "background-color:rgba(255,255,255,0);" + "color:rgba(92,170,54,100);" + "text-decoration:underline;" + "}"); + btn_1->setCursor(Qt::PointingHandCursor); + int type=1; + //connect(btn_1,SIGNAL(clicked()),this,SLOT(on_cmdButton_clicked(1,id))); + connect(btn_1, &QPushButton::clicked, this, [this,type, id]() { + on_cmdButton_clicked(type,id); + }); + btn_1->setIconSize(QSize(16,16)); + btn_1->setIcon(QIcon(":/image/Index/u2324.svg")); + QPushButton *btn_2 = new QPushButton(); + btn_2->setText(tr("设置设备接口")); + btn_2->setStyleSheet("QPushButton{" + "background-color:rgba(255,255,255,0);" + "color:rgba(92,170,54,100);" + "text-decoration:underline;" + "}"); + btn_2->setCursor(Qt::PointingHandCursor); + //connect(btn_2,SIGNAL(clicked()),this,SLOT(on_commButton_clicked(1,id))); + connect(btn_2, &QPushButton::clicked, this, [this,type, id]() { + on_commButton_clicked(type,id); + }); + btn_2->setIconSize(QSize(16,16)); + btn_2->setIcon(QIcon(":/image/Index/u2324.svg")); + QWidget *tmp_widget = new QWidget(); + QHBoxLayout *tmp_layout = new QHBoxLayout(tmp_widget); + tmp_layout->addWidget(btn_1); + tmp_layout->addWidget(btn_2); + tmp_layout->setMargin(0); + ui->tableWidget->setCellWidget(row,5,tmp_widget); + row++; + } + } + idList.clear(); + } +} void NewVerifyMethod::chooseDevices(QString bizIds,QString checkIds) { @@ -246,6 +323,10 @@ qint64 id = baseApi.generateId(); programInfo.id = QString::number(id); programInfo.check_name = ui->lineEditName->text(); + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); programInfo.remark = ui->lineEditMark->text(); @@ -259,6 +340,10 @@ } }else{ programInfo.check_name = ui->lineEditName->text(); + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); programInfo.update_time = QDateTime::currentDateTime(); @@ -277,3 +362,24 @@ { this->close(); } + +void NewVerifyMethod::on_comboBoxEquipment_currentIndexChanged(int index) +{ + QString id = QString::number(index+1); + catList.clear(); + ui->comboBoxCategory->clear(); + catList = BaseCommonApi::getitemCategoryList(id); + for(const itemCategory& item : catList){ + ui->comboBoxCategory->addItem(item.category_name); + } +} + +void NewVerifyMethod::on_pushButton_clicked() +{ + FormBizDeviceSelect *checkWindow = new FormBizDeviceSelect; + //checkWindow->newVerifyWnd=this; + checkWindow->setWindowState(Qt::WindowMaximized); + //connect(checkWindow, SIGNAL(selectStandard(QString)), this,SLOT(selectStandard(QString))); + checkWindow->setWindowModality(Qt::ApplicationModal); + checkWindow->show(); +} diff --git a/softwareDirectory/AutoVerScheme/newverifymethod.h b/softwareDirectory/AutoVerScheme/newverifymethod.h index 661be87..7612d3f 100644 --- a/softwareDirectory/AutoVerScheme/newverifymethod.h +++ b/softwareDirectory/AutoVerScheme/newverifymethod.h @@ -31,6 +31,11 @@ void on_pushButton_10_clicked(); + void on_comboBoxEquipment_currentIndexChanged(int index); + void selectStandard(QString ids); + + void on_pushButton_clicked(); + public: VerifyMethodManage *verifyManageWnd=nullptr; private: @@ -39,6 +44,9 @@ QString checkId=""; CheckProgramManage programInfo; bool bEditMode=true; + QStringList equipList={"多功能校准源标准装置","直流稳压电源检定装置","多功能电气安全标准器标准装置","0.02级活塞式压力计标准装置","二等铂电阻温度计标准装置","安全阀校验装置", + "精密露点仪标准装置","E2等级砝码标准装置","频谱分析仪标准装置","信号发生器标准装置","微波衰减标准装置","频率短期稳定度标准装置","示波器标准装置","铯原子频率标准装置","小功率标准装置"}; + QList catList; }; #endif // NEWVERIFYMETHOD_H diff --git a/softwareDirectory/AutoVerScheme/newverifymethod.ui b/softwareDirectory/AutoVerScheme/newverifymethod.ui index 1b3a1f1..3ec3d96 100644 --- a/softwareDirectory/AutoVerScheme/newverifymethod.ui +++ b/softwareDirectory/AutoVerScheme/newverifymethod.ui @@ -33,6 +33,7 @@ + 14 75 true @@ -49,6 +50,7 @@ + 12 75 true @@ -71,6 +73,7 @@ + 12 75 true @@ -102,6 +105,7 @@ + 12 75 true @@ -113,42 +117,20 @@ - - + + - 75 - true + 12 - - 程序名称: - - - - - - - - - 75 - true - - - - 创建人: - - - - - - - + + 12 75 true @@ -158,13 +140,80 @@ - - + + + + + 12 + + + + + + + + + 12 + 75 + true + + + + 创建人: + + + + + + + + 12 + 75 + true + + + + 核查标准装置: + + + + + + + + 12 + + + + + + + 12 + 75 + true + + + + 程序名称: + + + + + + + + 12 + + + + + + 12 75 true @@ -174,8 +223,37 @@ - - + + + + + 12 + + + + + + + + + 12 + 75 + true + + + + 核查项分类: + + + + + + + + 12 + + + @@ -196,6 +274,7 @@ + 12 75 true @@ -215,6 +294,7 @@ + 12 75 true @@ -243,6 +323,7 @@ + 12 75 true @@ -289,6 +370,7 @@ + 12 75 true @@ -304,6 +386,7 @@ + 12 75 true @@ -323,6 +406,7 @@ + 12 75 true @@ -332,12 +416,31 @@ color: rgb(255, 255, 255); - 选择设备 + 增加标准设备 - - - :/image/Index/u7453.svg - + + + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(100, 132, 68); + + + 删除行 @@ -347,33 +450,193 @@ - 设备类型 + 选择 + + + + 12 + 设备名称 + + + 12 + + + + + + 角色 + + + + 12 + + 型号规格 + + + 12 + + 出厂编号 - - - - 生产厂家 + + + 12 + 操作 + + + 12 + + + + + + + + + + + + 12 + 75 + true + + + + 选择核查件: + + + + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + background-color: rgb(51, 69, 130); +color: rgb(255, 255, 255); + + + 增加核查件 + + + + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(100, 132, 68); + + + 删除行 + + + + + + + + + + 选择 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 角色 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + + 出厂编号 + + + + 12 + + + + + + 操作 + + + + 12 + + @@ -383,6 +646,7 @@ + 12 75 true @@ -402,6 +666,7 @@ + 12 75 true diff --git a/softwareDirectory/AutoVerScheme/verifydevice.cpp b/softwareDirectory/AutoVerScheme/verifydevice.cpp index 46c29c2..343a59d 100644 --- a/softwareDirectory/AutoVerScheme/verifydevice.cpp +++ b/softwareDirectory/AutoVerScheme/verifydevice.cpp @@ -13,9 +13,9 @@ ui->tableWidget->setColumnWidth(0, 80); for(int i=1;i<5;i++) ui->tableWidget->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); - ui->tableWidget_2->setColumnWidth(0, 80); - for(int i=1;i<5;i++) - ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); +// ui->tableWidget_2->setColumnWidth(0, 80); +// for(int i=1;i<5;i++) +// ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); getVerifyDevice(); getCheckDevice(); } @@ -34,7 +34,7 @@ int rowCount=0; int row=0; bizDeviceList.clear(); -// bizDeviceList = BaseCommonApi::getCheckDeviceList(); + bizDeviceList = BaseCommonApi::getCheckDeviceList(); QString sFilterName = ui->lineEdit->text(); QString sFilterModel = ui->lineEdit_2->text(); QString sFilterNo = ui->lineEdit_3->text(); @@ -69,42 +69,42 @@ void VerifyDevice::getCheckDevice() { - ui->tableWidget_2->clearContents(); - ui->tableWidget_2->setRowCount(0); - int rowCount=0; - int row=0; - testedDeviceList.clear(); -// testedDeviceList = BaseCommonApi::getCheckAndTestedDeviceList(); - QString sFilterName = ui->lineEdit_4->text(); - QString sFilterModel = ui->lineEdit_5->text(); - QString sFilterNo = ui->lineEdit_6->text(); - for(int i=testedDeviceList.length()-1;i>=0;i--){ - bool bAdd=true; - if(sFilterName!=""&&!testedDeviceList[i].equipment_name.contains(sFilterName)){ - bAdd=false; - } - if(sFilterModel!=""&&!testedDeviceList[i].model.contains(sFilterModel)){ - bAdd=false; - } - if(sFilterNo!=""&&!testedDeviceList[i].manufacture_no.contains(sFilterNo)){ - bAdd=false; - } - if(!bAdd){ - testedDeviceList.removeAt(i); - } - } - for (const CheckAndTestedDevice& bizDevice : testedDeviceList) { - rowCount = ui->tableWidget_2->rowCount(); - ui->tableWidget_2->insertRow(rowCount); - QTableWidgetItem* p_check = new QTableWidgetItem(); - p_check->setCheckState(Qt::Unchecked); //设置首列为 CheckBox 控件 - ui->tableWidget_2->setItem(row,0,p_check); - ui->tableWidget_2->setItem(row, 1, new QTableWidgetItem(bizDevice.equipment_name)); - ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacturer)); - row++; - } +// ui->tableWidget_2->clearContents(); +// ui->tableWidget_2->setRowCount(0); +// int rowCount=0; +// int row=0; +// testedDeviceList.clear(); +//// testedDeviceList = BaseCommonApi::getCheckAndTestedDeviceList(); +// QString sFilterName = ui->lineEdit_4->text(); +// QString sFilterModel = ui->lineEdit_5->text(); +// QString sFilterNo = ui->lineEdit_6->text(); +// for(int i=testedDeviceList.length()-1;i>=0;i--){ +// bool bAdd=true; +// if(sFilterName!=""&&!testedDeviceList[i].equipment_name.contains(sFilterName)){ +// bAdd=false; +// } +// if(sFilterModel!=""&&!testedDeviceList[i].model.contains(sFilterModel)){ +// bAdd=false; +// } +// if(sFilterNo!=""&&!testedDeviceList[i].manufacture_no.contains(sFilterNo)){ +// bAdd=false; +// } +// if(!bAdd){ +// testedDeviceList.removeAt(i); +// } +// } +// for (const CheckAndTestedDevice& bizDevice : testedDeviceList) { +// rowCount = ui->tableWidget_2->rowCount(); +// ui->tableWidget_2->insertRow(rowCount); +// QTableWidgetItem* p_check = new QTableWidgetItem(); +// p_check->setCheckState(Qt::Unchecked); //设置首列为 CheckBox 控件 +// ui->tableWidget_2->setItem(row,0,p_check); +// ui->tableWidget_2->setItem(row, 1, new QTableWidgetItem(bizDevice.equipment_name)); +// ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(bizDevice.model)); +// ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(bizDevice.manufacture_no)); +// ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacturer)); +// row++; +// } } @@ -120,23 +120,24 @@ bizIds+=","+bizDeviceList[i].id; } } - for(int i=0;itableWidget_2->rowCount();i++){ - if(ui->tableWidget_2->item(i,0)->checkState()==Qt::Checked){ - if(checkIds=="") - checkIds = testedDeviceList[i].id; - else - checkIds+=","+testedDeviceList[i].id; - } - } - if(checkIds==""){ - QMessageBox::warning(this, "提示", "请选择核查件!"); - return; - } +// for(int i=0;itableWidget_2->rowCount();i++){ +// if(ui->tableWidget_2->item(i,0)->checkState()==Qt::Checked){ +// if(checkIds=="") +// checkIds = testedDeviceList[i].id; +// else +// checkIds+=","+testedDeviceList[i].id; +// } +// } +// if(checkIds==""){ +// QMessageBox::warning(this, "提示", "请选择核查件!"); +// return; +// } if(bizIds==""){ QMessageBox::warning(this, "提示", "请选择标准设备!"); return; } - newVerifyWnd->chooseDevices(bizIds,checkIds); + emit selectStandard(bizIds); + //newVerifyWnd->chooseDevices(bizIds,checkIds); this->close(); } @@ -160,8 +161,8 @@ void VerifyDevice::on_pushButton_12_clicked() { - ui->lineEdit_4->setText(""); - ui->lineEdit_5->setText(""); - ui->lineEdit_6->setText(""); - getCheckDevice(); +// ui->lineEdit_4->setText(""); +// ui->lineEdit_5->setText(""); +// ui->lineEdit_6->setText(""); +// getCheckDevice(); } diff --git a/softwareDirectory/AutoVerScheme/verifydevice.h b/softwareDirectory/AutoVerScheme/verifydevice.h index 5524a14..0db1ec5 100644 --- a/softwareDirectory/AutoVerScheme/verifydevice.h +++ b/softwareDirectory/AutoVerScheme/verifydevice.h @@ -26,12 +26,12 @@ void on_pushButton_13_clicked(); void on_pushButton_12_clicked(); - +signals: + void selectStandard(QString ids); private: void getVerifyDevice(); void getCheckDevice(); -public: - NewVerifyMethod *newVerifyWnd=nullptr; + private: Ui::VerifyDevice *ui; QList testedDeviceList; diff --git a/softwareDirectory/AutoVerScheme/verifydevice.ui b/softwareDirectory/AutoVerScheme/verifydevice.ui index fd2a866..57839d5 100644 --- a/softwareDirectory/AutoVerScheme/verifydevice.ui +++ b/softwareDirectory/AutoVerScheme/verifydevice.ui @@ -273,200 +273,6 @@ - - - - - - 12 - - - 10 - - - 10 - - - - - - 12 - - - - 选择核查件: - - - - - - - - 1 - 0 - - - - - 72 - 26 - - - - - 12 - 75 - true - - - - color: rgb(255, 255, 255); -background-color: rgb(74, 102, 186); -border-radius:5px; - - - 查询 - - - - - - - - 0 - 0 - - - - - 72 - 26 - - - - - 12 - 75 - true - - - - color: rgb(255, 255, 255); -background-color: rgb(207, 132, 33); -border-radius:5px; - - - 重置 - - - - - - - - - 12 - - - 10 - - - 10 - - - - - - 12 - - - - 设备名称 - - - - - - - - 12 - - - - 型号规格 - - - - - - - - 12 - - - - 出厂编号 - - - - - - - - - - 选择 - - - - 12 - - - - - - 设备名称 - - - - 12 - - - - - - 型号规格 - - - - 12 - - - - - - 出厂编号 - - - - 12 - - - - - - 生产厂家 - - - - 12 - - - - - - -