diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index 78fa193..1bc5850 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -1593,6 +1593,7 @@ query.prepare("SELECT * FROM biz_business_device_measure_item_category"); }else { query.prepare("SELECT * FROM biz_business_device_measure_item_category WHERE belong_standard_equipment = :item "); + query.bindValue(":item", item); } if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index 78fa193..1bc5850 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -1593,6 +1593,7 @@ query.prepare("SELECT * FROM biz_business_device_measure_item_category"); }else { query.prepare("SELECT * FROM biz_business_device_measure_item_category WHERE belong_standard_equipment = :item "); + query.bindValue(":item", item); } if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/checkdevice.cpp b/softwareDirectory/AutoVerScheme/checkdevice.cpp index d672675..5111c11 100644 --- a/softwareDirectory/AutoVerScheme/checkdevice.cpp +++ b/softwareDirectory/AutoVerScheme/checkdevice.cpp @@ -9,13 +9,13 @@ ui(new Ui::CheckDevice) { ui->setupUi(this); - ui->tableWidget_3->setColumnWidth(0, 80); + /*ui->tableWidget_3->setColumnWidth(0, 80); for(int i=1;i<4;i++) - ui->tableWidget_3->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + ui->tableWidget_3->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch);*/ ui->tableWidget_4->setColumnWidth(0, 80); for(int i=1;i<5;i++) ui->tableWidget_4->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); - getCheckDevice(); + //getCheckDevice(); getStandardDevice(); } @@ -28,7 +28,7 @@ void CheckDevice::getCheckDevice() { - testedDeviceList.clear(); + /*testedDeviceList.clear(); ui->tableWidget_3->clearContents(); ui->tableWidget_3->setRowCount(0); int rowCount=0; @@ -60,7 +60,7 @@ ui->tableWidget_3->setItem(row, 2, new QTableWidgetItem(bizDevice.model)); ui->tableWidget_3->setItem(row, 3, new QTableWidgetItem(bizDevice.help_instruction)); row++; - } + }*/ } void CheckDevice::getStandardDevice() @@ -109,14 +109,14 @@ { QString checkIds=""; QString bizIds = ""; - for(int i=0;itableWidget_3->rowCount();i++){ + /*for(int i=0;itableWidget_3->rowCount();i++){ if(ui->tableWidget_3->item(i,0)->checkState()==Qt::Checked){ if(checkIds=="") checkIds = testedDeviceList[i].id; else checkIds+=","+testedDeviceList[i].id; } - } + }*/ for(int i=0;itableWidget_4->rowCount();i++){ if(ui->tableWidget_4->item(i,0)->checkState()==Qt::Checked){ if(bizIds=="") @@ -125,10 +125,10 @@ bizIds+=","+bizDeviceList[i].id; } } - if(checkIds==""){ + /*if(checkIds==""){ QMessageBox::warning(this, "提示", "请选择被检设备!"); return; - } + }*/ if(bizIds==""){ QMessageBox::warning(this, "提示", "请选择标准设备!"); return; @@ -139,14 +139,14 @@ void CheckDevice::on_pushButton_15_clicked() { - getCheckDevice(); + //getCheckDevice(); } void CheckDevice::on_pushButton_16_clicked() { - ui->lineEdit_7->setText(""); - ui->lineEdit_8->setText(""); - getCheckDevice(); + //ui->lineEdit_7->setText(""); + //ui->lineEdit_8->setText(""); + //getCheckDevice(); } void CheckDevice::on_pushButton_17_clicked() diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index 78fa193..1bc5850 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -1593,6 +1593,7 @@ query.prepare("SELECT * FROM biz_business_device_measure_item_category"); }else { query.prepare("SELECT * FROM biz_business_device_measure_item_category WHERE belong_standard_equipment = :item "); + query.bindValue(":item", item); } if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/checkdevice.cpp b/softwareDirectory/AutoVerScheme/checkdevice.cpp index d672675..5111c11 100644 --- a/softwareDirectory/AutoVerScheme/checkdevice.cpp +++ b/softwareDirectory/AutoVerScheme/checkdevice.cpp @@ -9,13 +9,13 @@ ui(new Ui::CheckDevice) { ui->setupUi(this); - ui->tableWidget_3->setColumnWidth(0, 80); + /*ui->tableWidget_3->setColumnWidth(0, 80); for(int i=1;i<4;i++) - ui->tableWidget_3->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + ui->tableWidget_3->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch);*/ ui->tableWidget_4->setColumnWidth(0, 80); for(int i=1;i<5;i++) ui->tableWidget_4->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); - getCheckDevice(); + //getCheckDevice(); getStandardDevice(); } @@ -28,7 +28,7 @@ void CheckDevice::getCheckDevice() { - testedDeviceList.clear(); + /*testedDeviceList.clear(); ui->tableWidget_3->clearContents(); ui->tableWidget_3->setRowCount(0); int rowCount=0; @@ -60,7 +60,7 @@ ui->tableWidget_3->setItem(row, 2, new QTableWidgetItem(bizDevice.model)); ui->tableWidget_3->setItem(row, 3, new QTableWidgetItem(bizDevice.help_instruction)); row++; - } + }*/ } void CheckDevice::getStandardDevice() @@ -109,14 +109,14 @@ { QString checkIds=""; QString bizIds = ""; - for(int i=0;itableWidget_3->rowCount();i++){ + /*for(int i=0;itableWidget_3->rowCount();i++){ if(ui->tableWidget_3->item(i,0)->checkState()==Qt::Checked){ if(checkIds=="") checkIds = testedDeviceList[i].id; else checkIds+=","+testedDeviceList[i].id; } - } + }*/ for(int i=0;itableWidget_4->rowCount();i++){ if(ui->tableWidget_4->item(i,0)->checkState()==Qt::Checked){ if(bizIds=="") @@ -125,10 +125,10 @@ bizIds+=","+bizDeviceList[i].id; } } - if(checkIds==""){ + /*if(checkIds==""){ QMessageBox::warning(this, "提示", "请选择被检设备!"); return; - } + }*/ if(bizIds==""){ QMessageBox::warning(this, "提示", "请选择标准设备!"); return; @@ -139,14 +139,14 @@ void CheckDevice::on_pushButton_15_clicked() { - getCheckDevice(); + //getCheckDevice(); } void CheckDevice::on_pushButton_16_clicked() { - ui->lineEdit_7->setText(""); - ui->lineEdit_8->setText(""); - getCheckDevice(); + //ui->lineEdit_7->setText(""); + //ui->lineEdit_8->setText(""); + //getCheckDevice(); } void CheckDevice::on_pushButton_17_clicked() diff --git a/softwareDirectory/AutoVerScheme/checkdevice.ui b/softwareDirectory/AutoVerScheme/checkdevice.ui index 4fad700..e790ff2 100644 --- a/softwareDirectory/AutoVerScheme/checkdevice.ui +++ b/softwareDirectory/AutoVerScheme/checkdevice.ui @@ -75,179 +75,7 @@ - - - - - - - 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 - - - - - - - + diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index 78fa193..1bc5850 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -1593,6 +1593,7 @@ query.prepare("SELECT * FROM biz_business_device_measure_item_category"); }else { query.prepare("SELECT * FROM biz_business_device_measure_item_category WHERE belong_standard_equipment = :item "); + query.bindValue(":item", item); } if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/checkdevice.cpp b/softwareDirectory/AutoVerScheme/checkdevice.cpp index d672675..5111c11 100644 --- a/softwareDirectory/AutoVerScheme/checkdevice.cpp +++ b/softwareDirectory/AutoVerScheme/checkdevice.cpp @@ -9,13 +9,13 @@ ui(new Ui::CheckDevice) { ui->setupUi(this); - ui->tableWidget_3->setColumnWidth(0, 80); + /*ui->tableWidget_3->setColumnWidth(0, 80); for(int i=1;i<4;i++) - ui->tableWidget_3->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + ui->tableWidget_3->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch);*/ ui->tableWidget_4->setColumnWidth(0, 80); for(int i=1;i<5;i++) ui->tableWidget_4->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); - getCheckDevice(); + //getCheckDevice(); getStandardDevice(); } @@ -28,7 +28,7 @@ void CheckDevice::getCheckDevice() { - testedDeviceList.clear(); + /*testedDeviceList.clear(); ui->tableWidget_3->clearContents(); ui->tableWidget_3->setRowCount(0); int rowCount=0; @@ -60,7 +60,7 @@ ui->tableWidget_3->setItem(row, 2, new QTableWidgetItem(bizDevice.model)); ui->tableWidget_3->setItem(row, 3, new QTableWidgetItem(bizDevice.help_instruction)); row++; - } + }*/ } void CheckDevice::getStandardDevice() @@ -109,14 +109,14 @@ { QString checkIds=""; QString bizIds = ""; - for(int i=0;itableWidget_3->rowCount();i++){ + /*for(int i=0;itableWidget_3->rowCount();i++){ if(ui->tableWidget_3->item(i,0)->checkState()==Qt::Checked){ if(checkIds=="") checkIds = testedDeviceList[i].id; else checkIds+=","+testedDeviceList[i].id; } - } + }*/ for(int i=0;itableWidget_4->rowCount();i++){ if(ui->tableWidget_4->item(i,0)->checkState()==Qt::Checked){ if(bizIds=="") @@ -125,10 +125,10 @@ bizIds+=","+bizDeviceList[i].id; } } - if(checkIds==""){ + /*if(checkIds==""){ QMessageBox::warning(this, "提示", "请选择被检设备!"); return; - } + }*/ if(bizIds==""){ QMessageBox::warning(this, "提示", "请选择标准设备!"); return; @@ -139,14 +139,14 @@ void CheckDevice::on_pushButton_15_clicked() { - getCheckDevice(); + //getCheckDevice(); } void CheckDevice::on_pushButton_16_clicked() { - ui->lineEdit_7->setText(""); - ui->lineEdit_8->setText(""); - getCheckDevice(); + //ui->lineEdit_7->setText(""); + //ui->lineEdit_8->setText(""); + //getCheckDevice(); } void CheckDevice::on_pushButton_17_clicked() diff --git a/softwareDirectory/AutoVerScheme/checkdevice.ui b/softwareDirectory/AutoVerScheme/checkdevice.ui index 4fad700..e790ff2 100644 --- a/softwareDirectory/AutoVerScheme/checkdevice.ui +++ b/softwareDirectory/AutoVerScheme/checkdevice.ui @@ -75,179 +75,7 @@ - - - - - - - 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 - - - - - - - + diff --git a/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp b/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp index ce95fc7..a696bb5 100644 --- a/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp +++ b/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp @@ -10,16 +10,18 @@ { ui->setupUi(this); ui->tableWidget_2->verticalHeader()->setParent(nullptr); //隐藏行头 - for(int i=1;i<5;i++) + for(int i=1;i<8;i++) ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); ui->tableWidget_2->setColumnWidth(0, 60); ui->tableWidget_2->setColumnWidth(5, 200); + catList = BaseCommonApi::getitemCategoryList(""); getCheckMethod(); } CheckMethodManage::~CheckMethodManage() { programList.clear(); + catList.clear(); delete ui; } @@ -138,9 +140,23 @@ //ui->tableWidget->setItem(row, 0, new QTableWidgetItem(dept.id)); ui->tableWidget_2->setItem(row, 1, new QTableWidgetItem(program.program_name)); //设置数据 - ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(program.create_name)); //设置数据 - ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(program.create_time.toString("yyyy-MM-dd"))); //设置数据 - ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(program.remark)); //设置数据 + if(program.belong_standard_equipment!=""){ + int idx = program.belong_standard_equipment.toInt()-1; + ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(equipList[idx])); + } + QString sCategory; + for (int i = 0; i < catList.length(); ++i) { + if (catList[i].id == program.equipment_item_category) { + sCategory= catList[i].category_name; // 找到匹配项,返回 true + break; + } + } + ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(sCategory)); + ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(program.equipment_name)); + ui->tableWidget_2->setItem(row, 5, new QTableWidgetItem(program.model)); + ui->tableWidget_2->setItem(row, 6, new QTableWidgetItem(program.create_name)); //设置数据 + ui->tableWidget_2->setItem(row, 7, new QTableWidgetItem(program.create_time.toString("yyyy-MM-dd"))); //设置数据 + //ui->tableWidget_2->setItem(row, 8, new QTableWidgetItem(program.remark)); //设置数据 QPushButton *btn_1 = new QPushButton(); btn_1->setText(tr("编辑")); @@ -175,7 +191,7 @@ tmp_layout->addWidget(btn_1); tmp_layout->addWidget(btn_2); tmp_layout->setMargin(0); - ui->tableWidget_2->setCellWidget(row,5,tmp_widget); + ui->tableWidget_2->setCellWidget(row,8,tmp_widget); } void CheckMethodManage::on_pushButton_10_clicked() diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index 78fa193..1bc5850 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -1593,6 +1593,7 @@ query.prepare("SELECT * FROM biz_business_device_measure_item_category"); }else { query.prepare("SELECT * FROM biz_business_device_measure_item_category WHERE belong_standard_equipment = :item "); + query.bindValue(":item", item); } if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/checkdevice.cpp b/softwareDirectory/AutoVerScheme/checkdevice.cpp index d672675..5111c11 100644 --- a/softwareDirectory/AutoVerScheme/checkdevice.cpp +++ b/softwareDirectory/AutoVerScheme/checkdevice.cpp @@ -9,13 +9,13 @@ ui(new Ui::CheckDevice) { ui->setupUi(this); - ui->tableWidget_3->setColumnWidth(0, 80); + /*ui->tableWidget_3->setColumnWidth(0, 80); for(int i=1;i<4;i++) - ui->tableWidget_3->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + ui->tableWidget_3->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch);*/ ui->tableWidget_4->setColumnWidth(0, 80); for(int i=1;i<5;i++) ui->tableWidget_4->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); - getCheckDevice(); + //getCheckDevice(); getStandardDevice(); } @@ -28,7 +28,7 @@ void CheckDevice::getCheckDevice() { - testedDeviceList.clear(); + /*testedDeviceList.clear(); ui->tableWidget_3->clearContents(); ui->tableWidget_3->setRowCount(0); int rowCount=0; @@ -60,7 +60,7 @@ ui->tableWidget_3->setItem(row, 2, new QTableWidgetItem(bizDevice.model)); ui->tableWidget_3->setItem(row, 3, new QTableWidgetItem(bizDevice.help_instruction)); row++; - } + }*/ } void CheckDevice::getStandardDevice() @@ -109,14 +109,14 @@ { QString checkIds=""; QString bizIds = ""; - for(int i=0;itableWidget_3->rowCount();i++){ + /*for(int i=0;itableWidget_3->rowCount();i++){ if(ui->tableWidget_3->item(i,0)->checkState()==Qt::Checked){ if(checkIds=="") checkIds = testedDeviceList[i].id; else checkIds+=","+testedDeviceList[i].id; } - } + }*/ for(int i=0;itableWidget_4->rowCount();i++){ if(ui->tableWidget_4->item(i,0)->checkState()==Qt::Checked){ if(bizIds=="") @@ -125,10 +125,10 @@ bizIds+=","+bizDeviceList[i].id; } } - if(checkIds==""){ + /*if(checkIds==""){ QMessageBox::warning(this, "提示", "请选择被检设备!"); return; - } + }*/ if(bizIds==""){ QMessageBox::warning(this, "提示", "请选择标准设备!"); return; @@ -139,14 +139,14 @@ void CheckDevice::on_pushButton_15_clicked() { - getCheckDevice(); + //getCheckDevice(); } void CheckDevice::on_pushButton_16_clicked() { - ui->lineEdit_7->setText(""); - ui->lineEdit_8->setText(""); - getCheckDevice(); + //ui->lineEdit_7->setText(""); + //ui->lineEdit_8->setText(""); + //getCheckDevice(); } void CheckDevice::on_pushButton_17_clicked() diff --git a/softwareDirectory/AutoVerScheme/checkdevice.ui b/softwareDirectory/AutoVerScheme/checkdevice.ui index 4fad700..e790ff2 100644 --- a/softwareDirectory/AutoVerScheme/checkdevice.ui +++ b/softwareDirectory/AutoVerScheme/checkdevice.ui @@ -75,179 +75,7 @@ - - - - - - - 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 - - - - - - - + diff --git a/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp b/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp index ce95fc7..a696bb5 100644 --- a/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp +++ b/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp @@ -10,16 +10,18 @@ { ui->setupUi(this); ui->tableWidget_2->verticalHeader()->setParent(nullptr); //隐藏行头 - for(int i=1;i<5;i++) + for(int i=1;i<8;i++) ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); ui->tableWidget_2->setColumnWidth(0, 60); ui->tableWidget_2->setColumnWidth(5, 200); + catList = BaseCommonApi::getitemCategoryList(""); getCheckMethod(); } CheckMethodManage::~CheckMethodManage() { programList.clear(); + catList.clear(); delete ui; } @@ -138,9 +140,23 @@ //ui->tableWidget->setItem(row, 0, new QTableWidgetItem(dept.id)); ui->tableWidget_2->setItem(row, 1, new QTableWidgetItem(program.program_name)); //设置数据 - ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(program.create_name)); //设置数据 - ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(program.create_time.toString("yyyy-MM-dd"))); //设置数据 - ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(program.remark)); //设置数据 + if(program.belong_standard_equipment!=""){ + int idx = program.belong_standard_equipment.toInt()-1; + ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(equipList[idx])); + } + QString sCategory; + for (int i = 0; i < catList.length(); ++i) { + if (catList[i].id == program.equipment_item_category) { + sCategory= catList[i].category_name; // 找到匹配项,返回 true + break; + } + } + ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(sCategory)); + ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(program.equipment_name)); + ui->tableWidget_2->setItem(row, 5, new QTableWidgetItem(program.model)); + ui->tableWidget_2->setItem(row, 6, new QTableWidgetItem(program.create_name)); //设置数据 + ui->tableWidget_2->setItem(row, 7, new QTableWidgetItem(program.create_time.toString("yyyy-MM-dd"))); //设置数据 + //ui->tableWidget_2->setItem(row, 8, new QTableWidgetItem(program.remark)); //设置数据 QPushButton *btn_1 = new QPushButton(); btn_1->setText(tr("编辑")); @@ -175,7 +191,7 @@ tmp_layout->addWidget(btn_1); tmp_layout->addWidget(btn_2); tmp_layout->setMargin(0); - ui->tableWidget_2->setCellWidget(row,5,tmp_widget); + ui->tableWidget_2->setCellWidget(row,8,tmp_widget); } void CheckMethodManage::on_pushButton_10_clicked() diff --git a/softwareDirectory/AutoVerScheme/checkmethodmanage.h b/softwareDirectory/AutoVerScheme/checkmethodmanage.h index 75ec0a0..3dec22e 100644 --- a/softwareDirectory/AutoVerScheme/checkmethodmanage.h +++ b/softwareDirectory/AutoVerScheme/checkmethodmanage.h @@ -32,6 +32,9 @@ Ui::CheckMethodManage *ui; QList programList; int editIdx=-1; + QStringList equipList={"多功能校准源标准装置","直流稳压电源检定装置","多功能电气安全标准器标准装置","0.02级活塞式压力计标准装置","二等铂电阻温度计标准装置","安全阀校验装置", + "精密露点仪标准装置","E2等级砝码标准装置","频谱分析仪标准装置","信号发生器标准装置","微波衰减标准装置","频率短期稳定度标准装置","示波器标准装置","铯原子频率标准装置","小功率标准装置"}; + QList catList; }; #endif // CHECKMETHODMANAGE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index 78fa193..1bc5850 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -1593,6 +1593,7 @@ query.prepare("SELECT * FROM biz_business_device_measure_item_category"); }else { query.prepare("SELECT * FROM biz_business_device_measure_item_category WHERE belong_standard_equipment = :item "); + query.bindValue(":item", item); } if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/checkdevice.cpp b/softwareDirectory/AutoVerScheme/checkdevice.cpp index d672675..5111c11 100644 --- a/softwareDirectory/AutoVerScheme/checkdevice.cpp +++ b/softwareDirectory/AutoVerScheme/checkdevice.cpp @@ -9,13 +9,13 @@ ui(new Ui::CheckDevice) { ui->setupUi(this); - ui->tableWidget_3->setColumnWidth(0, 80); + /*ui->tableWidget_3->setColumnWidth(0, 80); for(int i=1;i<4;i++) - ui->tableWidget_3->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + ui->tableWidget_3->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch);*/ ui->tableWidget_4->setColumnWidth(0, 80); for(int i=1;i<5;i++) ui->tableWidget_4->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); - getCheckDevice(); + //getCheckDevice(); getStandardDevice(); } @@ -28,7 +28,7 @@ void CheckDevice::getCheckDevice() { - testedDeviceList.clear(); + /*testedDeviceList.clear(); ui->tableWidget_3->clearContents(); ui->tableWidget_3->setRowCount(0); int rowCount=0; @@ -60,7 +60,7 @@ ui->tableWidget_3->setItem(row, 2, new QTableWidgetItem(bizDevice.model)); ui->tableWidget_3->setItem(row, 3, new QTableWidgetItem(bizDevice.help_instruction)); row++; - } + }*/ } void CheckDevice::getStandardDevice() @@ -109,14 +109,14 @@ { QString checkIds=""; QString bizIds = ""; - for(int i=0;itableWidget_3->rowCount();i++){ + /*for(int i=0;itableWidget_3->rowCount();i++){ if(ui->tableWidget_3->item(i,0)->checkState()==Qt::Checked){ if(checkIds=="") checkIds = testedDeviceList[i].id; else checkIds+=","+testedDeviceList[i].id; } - } + }*/ for(int i=0;itableWidget_4->rowCount();i++){ if(ui->tableWidget_4->item(i,0)->checkState()==Qt::Checked){ if(bizIds=="") @@ -125,10 +125,10 @@ bizIds+=","+bizDeviceList[i].id; } } - if(checkIds==""){ + /*if(checkIds==""){ QMessageBox::warning(this, "提示", "请选择被检设备!"); return; - } + }*/ if(bizIds==""){ QMessageBox::warning(this, "提示", "请选择标准设备!"); return; @@ -139,14 +139,14 @@ void CheckDevice::on_pushButton_15_clicked() { - getCheckDevice(); + //getCheckDevice(); } void CheckDevice::on_pushButton_16_clicked() { - ui->lineEdit_7->setText(""); - ui->lineEdit_8->setText(""); - getCheckDevice(); + //ui->lineEdit_7->setText(""); + //ui->lineEdit_8->setText(""); + //getCheckDevice(); } void CheckDevice::on_pushButton_17_clicked() diff --git a/softwareDirectory/AutoVerScheme/checkdevice.ui b/softwareDirectory/AutoVerScheme/checkdevice.ui index 4fad700..e790ff2 100644 --- a/softwareDirectory/AutoVerScheme/checkdevice.ui +++ b/softwareDirectory/AutoVerScheme/checkdevice.ui @@ -75,179 +75,7 @@ - - - - - - - 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 - - - - - - - + diff --git a/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp b/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp index ce95fc7..a696bb5 100644 --- a/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp +++ b/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp @@ -10,16 +10,18 @@ { ui->setupUi(this); ui->tableWidget_2->verticalHeader()->setParent(nullptr); //隐藏行头 - for(int i=1;i<5;i++) + for(int i=1;i<8;i++) ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); ui->tableWidget_2->setColumnWidth(0, 60); ui->tableWidget_2->setColumnWidth(5, 200); + catList = BaseCommonApi::getitemCategoryList(""); getCheckMethod(); } CheckMethodManage::~CheckMethodManage() { programList.clear(); + catList.clear(); delete ui; } @@ -138,9 +140,23 @@ //ui->tableWidget->setItem(row, 0, new QTableWidgetItem(dept.id)); ui->tableWidget_2->setItem(row, 1, new QTableWidgetItem(program.program_name)); //设置数据 - ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(program.create_name)); //设置数据 - ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(program.create_time.toString("yyyy-MM-dd"))); //设置数据 - ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(program.remark)); //设置数据 + if(program.belong_standard_equipment!=""){ + int idx = program.belong_standard_equipment.toInt()-1; + ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(equipList[idx])); + } + QString sCategory; + for (int i = 0; i < catList.length(); ++i) { + if (catList[i].id == program.equipment_item_category) { + sCategory= catList[i].category_name; // 找到匹配项,返回 true + break; + } + } + ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(sCategory)); + ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(program.equipment_name)); + ui->tableWidget_2->setItem(row, 5, new QTableWidgetItem(program.model)); + ui->tableWidget_2->setItem(row, 6, new QTableWidgetItem(program.create_name)); //设置数据 + ui->tableWidget_2->setItem(row, 7, new QTableWidgetItem(program.create_time.toString("yyyy-MM-dd"))); //设置数据 + //ui->tableWidget_2->setItem(row, 8, new QTableWidgetItem(program.remark)); //设置数据 QPushButton *btn_1 = new QPushButton(); btn_1->setText(tr("编辑")); @@ -175,7 +191,7 @@ tmp_layout->addWidget(btn_1); tmp_layout->addWidget(btn_2); tmp_layout->setMargin(0); - ui->tableWidget_2->setCellWidget(row,5,tmp_widget); + ui->tableWidget_2->setCellWidget(row,8,tmp_widget); } void CheckMethodManage::on_pushButton_10_clicked() diff --git a/softwareDirectory/AutoVerScheme/checkmethodmanage.h b/softwareDirectory/AutoVerScheme/checkmethodmanage.h index 75ec0a0..3dec22e 100644 --- a/softwareDirectory/AutoVerScheme/checkmethodmanage.h +++ b/softwareDirectory/AutoVerScheme/checkmethodmanage.h @@ -32,6 +32,9 @@ Ui::CheckMethodManage *ui; QList programList; int editIdx=-1; + QStringList equipList={"多功能校准源标准装置","直流稳压电源检定装置","多功能电气安全标准器标准装置","0.02级活塞式压力计标准装置","二等铂电阻温度计标准装置","安全阀校验装置", + "精密露点仪标准装置","E2等级砝码标准装置","频谱分析仪标准装置","信号发生器标准装置","微波衰减标准装置","频率短期稳定度标准装置","示波器标准装置","铯原子频率标准装置","小功率标准装置"}; + QList catList; }; #endif // CHECKMETHODMANAGE_H diff --git a/softwareDirectory/AutoVerScheme/checkmethodmanage.ui b/softwareDirectory/AutoVerScheme/checkmethodmanage.ui index 7d91671..70f3775 100644 --- a/softwareDirectory/AutoVerScheme/checkmethodmanage.ui +++ b/softwareDirectory/AutoVerScheme/checkmethodmanage.ui @@ -228,6 +228,9 @@ false + + 150 + 序号 @@ -250,6 +253,46 @@ + 检校标准装置 + + + + 12 + + + + + + 设备检定项分类 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + 创建人 @@ -270,16 +313,6 @@ - 说明 - - - - 12 - - - - - 操作 diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index 78fa193..1bc5850 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -1593,6 +1593,7 @@ query.prepare("SELECT * FROM biz_business_device_measure_item_category"); }else { query.prepare("SELECT * FROM biz_business_device_measure_item_category WHERE belong_standard_equipment = :item "); + query.bindValue(":item", item); } if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/checkdevice.cpp b/softwareDirectory/AutoVerScheme/checkdevice.cpp index d672675..5111c11 100644 --- a/softwareDirectory/AutoVerScheme/checkdevice.cpp +++ b/softwareDirectory/AutoVerScheme/checkdevice.cpp @@ -9,13 +9,13 @@ ui(new Ui::CheckDevice) { ui->setupUi(this); - ui->tableWidget_3->setColumnWidth(0, 80); + /*ui->tableWidget_3->setColumnWidth(0, 80); for(int i=1;i<4;i++) - ui->tableWidget_3->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + ui->tableWidget_3->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch);*/ ui->tableWidget_4->setColumnWidth(0, 80); for(int i=1;i<5;i++) ui->tableWidget_4->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); - getCheckDevice(); + //getCheckDevice(); getStandardDevice(); } @@ -28,7 +28,7 @@ void CheckDevice::getCheckDevice() { - testedDeviceList.clear(); + /*testedDeviceList.clear(); ui->tableWidget_3->clearContents(); ui->tableWidget_3->setRowCount(0); int rowCount=0; @@ -60,7 +60,7 @@ ui->tableWidget_3->setItem(row, 2, new QTableWidgetItem(bizDevice.model)); ui->tableWidget_3->setItem(row, 3, new QTableWidgetItem(bizDevice.help_instruction)); row++; - } + }*/ } void CheckDevice::getStandardDevice() @@ -109,14 +109,14 @@ { QString checkIds=""; QString bizIds = ""; - for(int i=0;itableWidget_3->rowCount();i++){ + /*for(int i=0;itableWidget_3->rowCount();i++){ if(ui->tableWidget_3->item(i,0)->checkState()==Qt::Checked){ if(checkIds=="") checkIds = testedDeviceList[i].id; else checkIds+=","+testedDeviceList[i].id; } - } + }*/ for(int i=0;itableWidget_4->rowCount();i++){ if(ui->tableWidget_4->item(i,0)->checkState()==Qt::Checked){ if(bizIds=="") @@ -125,10 +125,10 @@ bizIds+=","+bizDeviceList[i].id; } } - if(checkIds==""){ + /*if(checkIds==""){ QMessageBox::warning(this, "提示", "请选择被检设备!"); return; - } + }*/ if(bizIds==""){ QMessageBox::warning(this, "提示", "请选择标准设备!"); return; @@ -139,14 +139,14 @@ void CheckDevice::on_pushButton_15_clicked() { - getCheckDevice(); + //getCheckDevice(); } void CheckDevice::on_pushButton_16_clicked() { - ui->lineEdit_7->setText(""); - ui->lineEdit_8->setText(""); - getCheckDevice(); + //ui->lineEdit_7->setText(""); + //ui->lineEdit_8->setText(""); + //getCheckDevice(); } void CheckDevice::on_pushButton_17_clicked() diff --git a/softwareDirectory/AutoVerScheme/checkdevice.ui b/softwareDirectory/AutoVerScheme/checkdevice.ui index 4fad700..e790ff2 100644 --- a/softwareDirectory/AutoVerScheme/checkdevice.ui +++ b/softwareDirectory/AutoVerScheme/checkdevice.ui @@ -75,179 +75,7 @@ - - - - - - - 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 - - - - - - - + diff --git a/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp b/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp index ce95fc7..a696bb5 100644 --- a/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp +++ b/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp @@ -10,16 +10,18 @@ { ui->setupUi(this); ui->tableWidget_2->verticalHeader()->setParent(nullptr); //隐藏行头 - for(int i=1;i<5;i++) + for(int i=1;i<8;i++) ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); ui->tableWidget_2->setColumnWidth(0, 60); ui->tableWidget_2->setColumnWidth(5, 200); + catList = BaseCommonApi::getitemCategoryList(""); getCheckMethod(); } CheckMethodManage::~CheckMethodManage() { programList.clear(); + catList.clear(); delete ui; } @@ -138,9 +140,23 @@ //ui->tableWidget->setItem(row, 0, new QTableWidgetItem(dept.id)); ui->tableWidget_2->setItem(row, 1, new QTableWidgetItem(program.program_name)); //设置数据 - ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(program.create_name)); //设置数据 - ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(program.create_time.toString("yyyy-MM-dd"))); //设置数据 - ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(program.remark)); //设置数据 + if(program.belong_standard_equipment!=""){ + int idx = program.belong_standard_equipment.toInt()-1; + ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(equipList[idx])); + } + QString sCategory; + for (int i = 0; i < catList.length(); ++i) { + if (catList[i].id == program.equipment_item_category) { + sCategory= catList[i].category_name; // 找到匹配项,返回 true + break; + } + } + ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(sCategory)); + ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(program.equipment_name)); + ui->tableWidget_2->setItem(row, 5, new QTableWidgetItem(program.model)); + ui->tableWidget_2->setItem(row, 6, new QTableWidgetItem(program.create_name)); //设置数据 + ui->tableWidget_2->setItem(row, 7, new QTableWidgetItem(program.create_time.toString("yyyy-MM-dd"))); //设置数据 + //ui->tableWidget_2->setItem(row, 8, new QTableWidgetItem(program.remark)); //设置数据 QPushButton *btn_1 = new QPushButton(); btn_1->setText(tr("编辑")); @@ -175,7 +191,7 @@ tmp_layout->addWidget(btn_1); tmp_layout->addWidget(btn_2); tmp_layout->setMargin(0); - ui->tableWidget_2->setCellWidget(row,5,tmp_widget); + ui->tableWidget_2->setCellWidget(row,8,tmp_widget); } void CheckMethodManage::on_pushButton_10_clicked() diff --git a/softwareDirectory/AutoVerScheme/checkmethodmanage.h b/softwareDirectory/AutoVerScheme/checkmethodmanage.h index 75ec0a0..3dec22e 100644 --- a/softwareDirectory/AutoVerScheme/checkmethodmanage.h +++ b/softwareDirectory/AutoVerScheme/checkmethodmanage.h @@ -32,6 +32,9 @@ Ui::CheckMethodManage *ui; QList programList; int editIdx=-1; + QStringList equipList={"多功能校准源标准装置","直流稳压电源检定装置","多功能电气安全标准器标准装置","0.02级活塞式压力计标准装置","二等铂电阻温度计标准装置","安全阀校验装置", + "精密露点仪标准装置","E2等级砝码标准装置","频谱分析仪标准装置","信号发生器标准装置","微波衰减标准装置","频率短期稳定度标准装置","示波器标准装置","铯原子频率标准装置","小功率标准装置"}; + QList catList; }; #endif // CHECKMETHODMANAGE_H diff --git a/softwareDirectory/AutoVerScheme/checkmethodmanage.ui b/softwareDirectory/AutoVerScheme/checkmethodmanage.ui index 7d91671..70f3775 100644 --- a/softwareDirectory/AutoVerScheme/checkmethodmanage.ui +++ b/softwareDirectory/AutoVerScheme/checkmethodmanage.ui @@ -228,6 +228,9 @@ false + + 150 + 序号 @@ -250,6 +253,46 @@ + 检校标准装置 + + + + 12 + + + + + + 设备检定项分类 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + 创建人 @@ -270,16 +313,6 @@ - 说明 - - - - 12 - - - - - 操作 diff --git a/softwareDirectory/AutoVerScheme/newcheckmethod.cpp b/softwareDirectory/AutoVerScheme/newcheckmethod.cpp index 6c0662b..6410912 100644 --- a/softwareDirectory/AutoVerScheme/newcheckmethod.cpp +++ b/softwareDirectory/AutoVerScheme/newcheckmethod.cpp @@ -19,6 +19,7 @@ for(int i=0;i<7;i++) ui->tableWidget->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); ui->pushButton_3->setEnabled(bEditMode); + ui->comboBoxEquipment->addItems(equipList); getMethodInfo(); } @@ -33,6 +34,17 @@ if(methodId!="") { programInfo = BaseCommonApi::getVerificationProgramInfo(methodId); + ui->comboBoxEquipment->setCurrentIndex(programInfo.belong_standard_equipment.toInt()-1); + + for (int i = 0; i < catList.length(); ++i) { + if (catList[i].id == programInfo.equipment_item_category) { + ui->comboBoxCategory->setCurrentIndex(i); // 找到匹配项,返回 true + break; + } + } + ui->lineEdit_2->setText(programInfo.equipment_name ); + ui->lineEdit_3->setText(programInfo.model); + ui->lineEdit_4->setText(programInfo.help_instruction); ui->lineEditName->setText(programInfo.program_name); ui->lineEditUser->setText(programInfo.create_name); ui->dateEditTime->setDateTime(programInfo.create_time); @@ -107,6 +119,13 @@ BaseCommonApi baseApi; qint64 id = baseApi.generateId(); programInfo.id = QString::number(id); + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEdit_2->text(); + programInfo.model = ui->lineEdit_3->text(); + programInfo.help_instruction = ui->lineEdit_4->text(); programInfo.program_name = ui->lineEditName->text(); programInfo.create_name = ui->lineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); @@ -120,6 +139,13 @@ QMessageBox::warning(this, "警告", "保存失败!"); } }else{ + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEdit_2->text(); + programInfo.model = ui->lineEdit_3->text(); + programInfo.help_instruction = ui->lineEdit_4->text(); programInfo.program_name = ui->lineEditName->text(); programInfo.create_name = ui->lineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); @@ -279,3 +305,14 @@ idList.clear(); } } + +void NewCheckMethod::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); + } +} diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index 78fa193..1bc5850 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -1593,6 +1593,7 @@ query.prepare("SELECT * FROM biz_business_device_measure_item_category"); }else { query.prepare("SELECT * FROM biz_business_device_measure_item_category WHERE belong_standard_equipment = :item "); + query.bindValue(":item", item); } if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/checkdevice.cpp b/softwareDirectory/AutoVerScheme/checkdevice.cpp index d672675..5111c11 100644 --- a/softwareDirectory/AutoVerScheme/checkdevice.cpp +++ b/softwareDirectory/AutoVerScheme/checkdevice.cpp @@ -9,13 +9,13 @@ ui(new Ui::CheckDevice) { ui->setupUi(this); - ui->tableWidget_3->setColumnWidth(0, 80); + /*ui->tableWidget_3->setColumnWidth(0, 80); for(int i=1;i<4;i++) - ui->tableWidget_3->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + ui->tableWidget_3->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch);*/ ui->tableWidget_4->setColumnWidth(0, 80); for(int i=1;i<5;i++) ui->tableWidget_4->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); - getCheckDevice(); + //getCheckDevice(); getStandardDevice(); } @@ -28,7 +28,7 @@ void CheckDevice::getCheckDevice() { - testedDeviceList.clear(); + /*testedDeviceList.clear(); ui->tableWidget_3->clearContents(); ui->tableWidget_3->setRowCount(0); int rowCount=0; @@ -60,7 +60,7 @@ ui->tableWidget_3->setItem(row, 2, new QTableWidgetItem(bizDevice.model)); ui->tableWidget_3->setItem(row, 3, new QTableWidgetItem(bizDevice.help_instruction)); row++; - } + }*/ } void CheckDevice::getStandardDevice() @@ -109,14 +109,14 @@ { QString checkIds=""; QString bizIds = ""; - for(int i=0;itableWidget_3->rowCount();i++){ + /*for(int i=0;itableWidget_3->rowCount();i++){ if(ui->tableWidget_3->item(i,0)->checkState()==Qt::Checked){ if(checkIds=="") checkIds = testedDeviceList[i].id; else checkIds+=","+testedDeviceList[i].id; } - } + }*/ for(int i=0;itableWidget_4->rowCount();i++){ if(ui->tableWidget_4->item(i,0)->checkState()==Qt::Checked){ if(bizIds=="") @@ -125,10 +125,10 @@ bizIds+=","+bizDeviceList[i].id; } } - if(checkIds==""){ + /*if(checkIds==""){ QMessageBox::warning(this, "提示", "请选择被检设备!"); return; - } + }*/ if(bizIds==""){ QMessageBox::warning(this, "提示", "请选择标准设备!"); return; @@ -139,14 +139,14 @@ void CheckDevice::on_pushButton_15_clicked() { - getCheckDevice(); + //getCheckDevice(); } void CheckDevice::on_pushButton_16_clicked() { - ui->lineEdit_7->setText(""); - ui->lineEdit_8->setText(""); - getCheckDevice(); + //ui->lineEdit_7->setText(""); + //ui->lineEdit_8->setText(""); + //getCheckDevice(); } void CheckDevice::on_pushButton_17_clicked() diff --git a/softwareDirectory/AutoVerScheme/checkdevice.ui b/softwareDirectory/AutoVerScheme/checkdevice.ui index 4fad700..e790ff2 100644 --- a/softwareDirectory/AutoVerScheme/checkdevice.ui +++ b/softwareDirectory/AutoVerScheme/checkdevice.ui @@ -75,179 +75,7 @@ - - - - - - - 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 - - - - - - - + diff --git a/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp b/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp index ce95fc7..a696bb5 100644 --- a/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp +++ b/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp @@ -10,16 +10,18 @@ { ui->setupUi(this); ui->tableWidget_2->verticalHeader()->setParent(nullptr); //隐藏行头 - for(int i=1;i<5;i++) + for(int i=1;i<8;i++) ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); ui->tableWidget_2->setColumnWidth(0, 60); ui->tableWidget_2->setColumnWidth(5, 200); + catList = BaseCommonApi::getitemCategoryList(""); getCheckMethod(); } CheckMethodManage::~CheckMethodManage() { programList.clear(); + catList.clear(); delete ui; } @@ -138,9 +140,23 @@ //ui->tableWidget->setItem(row, 0, new QTableWidgetItem(dept.id)); ui->tableWidget_2->setItem(row, 1, new QTableWidgetItem(program.program_name)); //设置数据 - ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(program.create_name)); //设置数据 - ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(program.create_time.toString("yyyy-MM-dd"))); //设置数据 - ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(program.remark)); //设置数据 + if(program.belong_standard_equipment!=""){ + int idx = program.belong_standard_equipment.toInt()-1; + ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(equipList[idx])); + } + QString sCategory; + for (int i = 0; i < catList.length(); ++i) { + if (catList[i].id == program.equipment_item_category) { + sCategory= catList[i].category_name; // 找到匹配项,返回 true + break; + } + } + ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(sCategory)); + ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(program.equipment_name)); + ui->tableWidget_2->setItem(row, 5, new QTableWidgetItem(program.model)); + ui->tableWidget_2->setItem(row, 6, new QTableWidgetItem(program.create_name)); //设置数据 + ui->tableWidget_2->setItem(row, 7, new QTableWidgetItem(program.create_time.toString("yyyy-MM-dd"))); //设置数据 + //ui->tableWidget_2->setItem(row, 8, new QTableWidgetItem(program.remark)); //设置数据 QPushButton *btn_1 = new QPushButton(); btn_1->setText(tr("编辑")); @@ -175,7 +191,7 @@ tmp_layout->addWidget(btn_1); tmp_layout->addWidget(btn_2); tmp_layout->setMargin(0); - ui->tableWidget_2->setCellWidget(row,5,tmp_widget); + ui->tableWidget_2->setCellWidget(row,8,tmp_widget); } void CheckMethodManage::on_pushButton_10_clicked() diff --git a/softwareDirectory/AutoVerScheme/checkmethodmanage.h b/softwareDirectory/AutoVerScheme/checkmethodmanage.h index 75ec0a0..3dec22e 100644 --- a/softwareDirectory/AutoVerScheme/checkmethodmanage.h +++ b/softwareDirectory/AutoVerScheme/checkmethodmanage.h @@ -32,6 +32,9 @@ Ui::CheckMethodManage *ui; QList programList; int editIdx=-1; + QStringList equipList={"多功能校准源标准装置","直流稳压电源检定装置","多功能电气安全标准器标准装置","0.02级活塞式压力计标准装置","二等铂电阻温度计标准装置","安全阀校验装置", + "精密露点仪标准装置","E2等级砝码标准装置","频谱分析仪标准装置","信号发生器标准装置","微波衰减标准装置","频率短期稳定度标准装置","示波器标准装置","铯原子频率标准装置","小功率标准装置"}; + QList catList; }; #endif // CHECKMETHODMANAGE_H diff --git a/softwareDirectory/AutoVerScheme/checkmethodmanage.ui b/softwareDirectory/AutoVerScheme/checkmethodmanage.ui index 7d91671..70f3775 100644 --- a/softwareDirectory/AutoVerScheme/checkmethodmanage.ui +++ b/softwareDirectory/AutoVerScheme/checkmethodmanage.ui @@ -228,6 +228,9 @@ false + + 150 + 序号 @@ -250,6 +253,46 @@ + 检校标准装置 + + + + 12 + + + + + + 设备检定项分类 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + 创建人 @@ -270,16 +313,6 @@ - 说明 - - - - 12 - - - - - 操作 diff --git a/softwareDirectory/AutoVerScheme/newcheckmethod.cpp b/softwareDirectory/AutoVerScheme/newcheckmethod.cpp index 6c0662b..6410912 100644 --- a/softwareDirectory/AutoVerScheme/newcheckmethod.cpp +++ b/softwareDirectory/AutoVerScheme/newcheckmethod.cpp @@ -19,6 +19,7 @@ for(int i=0;i<7;i++) ui->tableWidget->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); ui->pushButton_3->setEnabled(bEditMode); + ui->comboBoxEquipment->addItems(equipList); getMethodInfo(); } @@ -33,6 +34,17 @@ if(methodId!="") { programInfo = BaseCommonApi::getVerificationProgramInfo(methodId); + ui->comboBoxEquipment->setCurrentIndex(programInfo.belong_standard_equipment.toInt()-1); + + for (int i = 0; i < catList.length(); ++i) { + if (catList[i].id == programInfo.equipment_item_category) { + ui->comboBoxCategory->setCurrentIndex(i); // 找到匹配项,返回 true + break; + } + } + ui->lineEdit_2->setText(programInfo.equipment_name ); + ui->lineEdit_3->setText(programInfo.model); + ui->lineEdit_4->setText(programInfo.help_instruction); ui->lineEditName->setText(programInfo.program_name); ui->lineEditUser->setText(programInfo.create_name); ui->dateEditTime->setDateTime(programInfo.create_time); @@ -107,6 +119,13 @@ BaseCommonApi baseApi; qint64 id = baseApi.generateId(); programInfo.id = QString::number(id); + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEdit_2->text(); + programInfo.model = ui->lineEdit_3->text(); + programInfo.help_instruction = ui->lineEdit_4->text(); programInfo.program_name = ui->lineEditName->text(); programInfo.create_name = ui->lineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); @@ -120,6 +139,13 @@ QMessageBox::warning(this, "警告", "保存失败!"); } }else{ + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEdit_2->text(); + programInfo.model = ui->lineEdit_3->text(); + programInfo.help_instruction = ui->lineEdit_4->text(); programInfo.program_name = ui->lineEditName->text(); programInfo.create_name = ui->lineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); @@ -279,3 +305,14 @@ idList.clear(); } } + +void NewCheckMethod::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); + } +} diff --git a/softwareDirectory/AutoVerScheme/newcheckmethod.h b/softwareDirectory/AutoVerScheme/newcheckmethod.h index 235d876..c6e8210 100644 --- a/softwareDirectory/AutoVerScheme/newcheckmethod.h +++ b/softwareDirectory/AutoVerScheme/newcheckmethod.h @@ -29,6 +29,8 @@ void on_pushButton_4_clicked(); void on_cmdButton_clicked(int type,QString id); void on_commButton_clicked(int type,QString id); + void on_comboBoxEquipment_currentIndexChanged(int index); + protected: void showEvent(QShowEvent *event); public: @@ -39,6 +41,9 @@ Ui::NewCheckMethod *ui; VerificationProgramInfo programInfo; bool bEditMode=true; + QStringList equipList={"多功能校准源标准装置","直流稳压电源检定装置","多功能电气安全标准器标准装置","0.02级活塞式压力计标准装置","二等铂电阻温度计标准装置","安全阀校验装置", + "精密露点仪标准装置","E2等级砝码标准装置","频谱分析仪标准装置","信号发生器标准装置","微波衰减标准装置","频率短期稳定度标准装置","示波器标准装置","铯原子频率标准装置","小功率标准装置"}; + QList catList; }; #endif // NEWCHECKMETHOD_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index 78fa193..1bc5850 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -1593,6 +1593,7 @@ query.prepare("SELECT * FROM biz_business_device_measure_item_category"); }else { query.prepare("SELECT * FROM biz_business_device_measure_item_category WHERE belong_standard_equipment = :item "); + query.bindValue(":item", item); } if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/checkdevice.cpp b/softwareDirectory/AutoVerScheme/checkdevice.cpp index d672675..5111c11 100644 --- a/softwareDirectory/AutoVerScheme/checkdevice.cpp +++ b/softwareDirectory/AutoVerScheme/checkdevice.cpp @@ -9,13 +9,13 @@ ui(new Ui::CheckDevice) { ui->setupUi(this); - ui->tableWidget_3->setColumnWidth(0, 80); + /*ui->tableWidget_3->setColumnWidth(0, 80); for(int i=1;i<4;i++) - ui->tableWidget_3->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); + ui->tableWidget_3->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch);*/ ui->tableWidget_4->setColumnWidth(0, 80); for(int i=1;i<5;i++) ui->tableWidget_4->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); - getCheckDevice(); + //getCheckDevice(); getStandardDevice(); } @@ -28,7 +28,7 @@ void CheckDevice::getCheckDevice() { - testedDeviceList.clear(); + /*testedDeviceList.clear(); ui->tableWidget_3->clearContents(); ui->tableWidget_3->setRowCount(0); int rowCount=0; @@ -60,7 +60,7 @@ ui->tableWidget_3->setItem(row, 2, new QTableWidgetItem(bizDevice.model)); ui->tableWidget_3->setItem(row, 3, new QTableWidgetItem(bizDevice.help_instruction)); row++; - } + }*/ } void CheckDevice::getStandardDevice() @@ -109,14 +109,14 @@ { QString checkIds=""; QString bizIds = ""; - for(int i=0;itableWidget_3->rowCount();i++){ + /*for(int i=0;itableWidget_3->rowCount();i++){ if(ui->tableWidget_3->item(i,0)->checkState()==Qt::Checked){ if(checkIds=="") checkIds = testedDeviceList[i].id; else checkIds+=","+testedDeviceList[i].id; } - } + }*/ for(int i=0;itableWidget_4->rowCount();i++){ if(ui->tableWidget_4->item(i,0)->checkState()==Qt::Checked){ if(bizIds=="") @@ -125,10 +125,10 @@ bizIds+=","+bizDeviceList[i].id; } } - if(checkIds==""){ + /*if(checkIds==""){ QMessageBox::warning(this, "提示", "请选择被检设备!"); return; - } + }*/ if(bizIds==""){ QMessageBox::warning(this, "提示", "请选择标准设备!"); return; @@ -139,14 +139,14 @@ void CheckDevice::on_pushButton_15_clicked() { - getCheckDevice(); + //getCheckDevice(); } void CheckDevice::on_pushButton_16_clicked() { - ui->lineEdit_7->setText(""); - ui->lineEdit_8->setText(""); - getCheckDevice(); + //ui->lineEdit_7->setText(""); + //ui->lineEdit_8->setText(""); + //getCheckDevice(); } void CheckDevice::on_pushButton_17_clicked() diff --git a/softwareDirectory/AutoVerScheme/checkdevice.ui b/softwareDirectory/AutoVerScheme/checkdevice.ui index 4fad700..e790ff2 100644 --- a/softwareDirectory/AutoVerScheme/checkdevice.ui +++ b/softwareDirectory/AutoVerScheme/checkdevice.ui @@ -75,179 +75,7 @@ - - - - - - - 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 - - - - - - - + diff --git a/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp b/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp index ce95fc7..a696bb5 100644 --- a/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp +++ b/softwareDirectory/AutoVerScheme/checkmethodmanage.cpp @@ -10,16 +10,18 @@ { ui->setupUi(this); ui->tableWidget_2->verticalHeader()->setParent(nullptr); //隐藏行头 - for(int i=1;i<5;i++) + for(int i=1;i<8;i++) ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); ui->tableWidget_2->setColumnWidth(0, 60); ui->tableWidget_2->setColumnWidth(5, 200); + catList = BaseCommonApi::getitemCategoryList(""); getCheckMethod(); } CheckMethodManage::~CheckMethodManage() { programList.clear(); + catList.clear(); delete ui; } @@ -138,9 +140,23 @@ //ui->tableWidget->setItem(row, 0, new QTableWidgetItem(dept.id)); ui->tableWidget_2->setItem(row, 1, new QTableWidgetItem(program.program_name)); //设置数据 - ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(program.create_name)); //设置数据 - ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(program.create_time.toString("yyyy-MM-dd"))); //设置数据 - ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(program.remark)); //设置数据 + if(program.belong_standard_equipment!=""){ + int idx = program.belong_standard_equipment.toInt()-1; + ui->tableWidget_2->setItem(row, 2, new QTableWidgetItem(equipList[idx])); + } + QString sCategory; + for (int i = 0; i < catList.length(); ++i) { + if (catList[i].id == program.equipment_item_category) { + sCategory= catList[i].category_name; // 找到匹配项,返回 true + break; + } + } + ui->tableWidget_2->setItem(row, 3, new QTableWidgetItem(sCategory)); + ui->tableWidget_2->setItem(row, 4, new QTableWidgetItem(program.equipment_name)); + ui->tableWidget_2->setItem(row, 5, new QTableWidgetItem(program.model)); + ui->tableWidget_2->setItem(row, 6, new QTableWidgetItem(program.create_name)); //设置数据 + ui->tableWidget_2->setItem(row, 7, new QTableWidgetItem(program.create_time.toString("yyyy-MM-dd"))); //设置数据 + //ui->tableWidget_2->setItem(row, 8, new QTableWidgetItem(program.remark)); //设置数据 QPushButton *btn_1 = new QPushButton(); btn_1->setText(tr("编辑")); @@ -175,7 +191,7 @@ tmp_layout->addWidget(btn_1); tmp_layout->addWidget(btn_2); tmp_layout->setMargin(0); - ui->tableWidget_2->setCellWidget(row,5,tmp_widget); + ui->tableWidget_2->setCellWidget(row,8,tmp_widget); } void CheckMethodManage::on_pushButton_10_clicked() diff --git a/softwareDirectory/AutoVerScheme/checkmethodmanage.h b/softwareDirectory/AutoVerScheme/checkmethodmanage.h index 75ec0a0..3dec22e 100644 --- a/softwareDirectory/AutoVerScheme/checkmethodmanage.h +++ b/softwareDirectory/AutoVerScheme/checkmethodmanage.h @@ -32,6 +32,9 @@ Ui::CheckMethodManage *ui; QList programList; int editIdx=-1; + QStringList equipList={"多功能校准源标准装置","直流稳压电源检定装置","多功能电气安全标准器标准装置","0.02级活塞式压力计标准装置","二等铂电阻温度计标准装置","安全阀校验装置", + "精密露点仪标准装置","E2等级砝码标准装置","频谱分析仪标准装置","信号发生器标准装置","微波衰减标准装置","频率短期稳定度标准装置","示波器标准装置","铯原子频率标准装置","小功率标准装置"}; + QList catList; }; #endif // CHECKMETHODMANAGE_H diff --git a/softwareDirectory/AutoVerScheme/checkmethodmanage.ui b/softwareDirectory/AutoVerScheme/checkmethodmanage.ui index 7d91671..70f3775 100644 --- a/softwareDirectory/AutoVerScheme/checkmethodmanage.ui +++ b/softwareDirectory/AutoVerScheme/checkmethodmanage.ui @@ -228,6 +228,9 @@ false + + 150 + 序号 @@ -250,6 +253,46 @@ + 检校标准装置 + + + + 12 + + + + + + 设备检定项分类 + + + + 12 + + + + + + 设备名称 + + + + 12 + + + + + + 型号规格 + + + + 12 + + + + + 创建人 @@ -270,16 +313,6 @@ - 说明 - - - - 12 - - - - - 操作 diff --git a/softwareDirectory/AutoVerScheme/newcheckmethod.cpp b/softwareDirectory/AutoVerScheme/newcheckmethod.cpp index 6c0662b..6410912 100644 --- a/softwareDirectory/AutoVerScheme/newcheckmethod.cpp +++ b/softwareDirectory/AutoVerScheme/newcheckmethod.cpp @@ -19,6 +19,7 @@ for(int i=0;i<7;i++) ui->tableWidget->horizontalHeader()->setSectionResizeMode(i,QHeaderView::Stretch); ui->pushButton_3->setEnabled(bEditMode); + ui->comboBoxEquipment->addItems(equipList); getMethodInfo(); } @@ -33,6 +34,17 @@ if(methodId!="") { programInfo = BaseCommonApi::getVerificationProgramInfo(methodId); + ui->comboBoxEquipment->setCurrentIndex(programInfo.belong_standard_equipment.toInt()-1); + + for (int i = 0; i < catList.length(); ++i) { + if (catList[i].id == programInfo.equipment_item_category) { + ui->comboBoxCategory->setCurrentIndex(i); // 找到匹配项,返回 true + break; + } + } + ui->lineEdit_2->setText(programInfo.equipment_name ); + ui->lineEdit_3->setText(programInfo.model); + ui->lineEdit_4->setText(programInfo.help_instruction); ui->lineEditName->setText(programInfo.program_name); ui->lineEditUser->setText(programInfo.create_name); ui->dateEditTime->setDateTime(programInfo.create_time); @@ -107,6 +119,13 @@ BaseCommonApi baseApi; qint64 id = baseApi.generateId(); programInfo.id = QString::number(id); + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEdit_2->text(); + programInfo.model = ui->lineEdit_3->text(); + programInfo.help_instruction = ui->lineEdit_4->text(); programInfo.program_name = ui->lineEditName->text(); programInfo.create_name = ui->lineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); @@ -120,6 +139,13 @@ QMessageBox::warning(this, "警告", "保存失败!"); } }else{ + programInfo.belong_standard_equipment = QString::number(ui->comboBoxEquipment->currentIndex()+1); + int idx = ui->comboBoxCategory->currentIndex(); + if(idx>=0&&idxlineEdit_2->text(); + programInfo.model = ui->lineEdit_3->text(); + programInfo.help_instruction = ui->lineEdit_4->text(); programInfo.program_name = ui->lineEditName->text(); programInfo.create_name = ui->lineEditUser->text(); programInfo.create_time = ui->dateEditTime->dateTime(); @@ -279,3 +305,14 @@ idList.clear(); } } + +void NewCheckMethod::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); + } +} diff --git a/softwareDirectory/AutoVerScheme/newcheckmethod.h b/softwareDirectory/AutoVerScheme/newcheckmethod.h index 235d876..c6e8210 100644 --- a/softwareDirectory/AutoVerScheme/newcheckmethod.h +++ b/softwareDirectory/AutoVerScheme/newcheckmethod.h @@ -29,6 +29,8 @@ void on_pushButton_4_clicked(); void on_cmdButton_clicked(int type,QString id); void on_commButton_clicked(int type,QString id); + void on_comboBoxEquipment_currentIndexChanged(int index); + protected: void showEvent(QShowEvent *event); public: @@ -39,6 +41,9 @@ Ui::NewCheckMethod *ui; VerificationProgramInfo programInfo; bool bEditMode=true; + QStringList equipList={"多功能校准源标准装置","直流稳压电源检定装置","多功能电气安全标准器标准装置","0.02级活塞式压力计标准装置","二等铂电阻温度计标准装置","安全阀校验装置", + "精密露点仪标准装置","E2等级砝码标准装置","频谱分析仪标准装置","信号发生器标准装置","微波衰减标准装置","频率短期稳定度标准装置","示波器标准装置","铯原子频率标准装置","小功率标准装置"}; + QList catList; }; #endif // NEWCHECKMETHOD_H diff --git a/softwareDirectory/AutoVerScheme/newcheckmethod.ui b/softwareDirectory/AutoVerScheme/newcheckmethod.ui index 5a3a031..f7c7d0f 100644 --- a/softwareDirectory/AutoVerScheme/newcheckmethod.ui +++ b/softwareDirectory/AutoVerScheme/newcheckmethod.ui @@ -117,7 +117,35 @@ - + + + + + 12 + 75 + true + + + + 型号规格: + + + + + + + + 12 + 75 + true + + + + 设备名称: + + + + @@ -131,8 +159,8 @@ - - + + 12 @@ -140,8 +168,8 @@ - - + + 12 @@ -150,43 +178,11 @@ - 创建人: + 检校标准装置: - - - - - 12 - - - - - - - - - 12 - 75 - true - - - - 创建时间: - - - - - - - - 12 - - - - - + @@ -200,7 +196,30 @@ - + + + + + 12 + 75 + true + + + + 设备检定项分类: + + + + + + + + 12 + + + + + @@ -209,6 +228,102 @@ + + + + + 12 + 75 + true + + + + 辅助字段: + + + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 12 + 75 + true + + + + 创建人: + + + + + + + + 12 + + + + + + + + + 12 + 75 + true + + + + 创建时间: + + + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 12 + + + + @@ -388,7 +503,7 @@ - 选择被检设备和标准设备: + 选择标准设备: @@ -516,7 +631,7 @@ - 检定项目及检定点设置: + 指令配置: @@ -540,7 +655,7 @@ color: rgb(255, 255, 255); - 检定设置 + 指令配置