From aa013c2f4e69e2ba4eb72081dc004d8334d59257 Mon Sep 17 00:00:00 2001
From: wumu <mayi@mayi.com>
Date: 星期一, 28 十月 2024 23:15:27 +0800
Subject: [PATCH] 1028

---
 internal_system_v1/converinfo2.cpp |   80 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 78 insertions(+), 2 deletions(-)

diff --git a/internal_system_v1/converinfo2.cpp b/internal_system_v1/converinfo2.cpp
index 0ed41dc..466e8b9 100644
--- a/internal_system_v1/converinfo2.cpp
+++ b/internal_system_v1/converinfo2.cpp
@@ -17,6 +17,7 @@
     //initUi();
     //readInfo(); // 鍔犺浇琛ㄦ牸
     addMenu(); // 澧炲姞鑿滃崟
+    disableWheelEvent(); // 绂佺敤涓嬫媺妗嗙殑婊氳疆浜嬩欢
 
     // 鑷�傚簲澶勭悊
     ui->treeWidget->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
@@ -90,25 +91,64 @@
 {
     if(m_curItem==nullptr)return;
     qDebug()<<"娣诲姞鍏徃淇℃伅,鍦ㄨ妭鐐癸細"<<m_curItem->text(0);
+    on_pushButton_laodFile_clicked();
 }
 
 void ConverInfo2::deleteInfo()
 {
     if(m_curItem==nullptr)return;
     qDebug()<<"鍒犻櫎鍏徃淇℃伅,鑺傜偣锛�"<<m_curItem->text(0);
+    auto resList = m_curItem->takeChildren();
+
+    qDebug()<<"鍒犻櫎鏁伴噺:"<<resList.size();
 }
 
 void ConverInfo2::on_treeWidget_doubleClicked(const QModelIndex &index)
 {
     QString name = index.model()->data(index).toString();
     qDebug()<<"鍙屽嚮"<<index<<name;
+    ComInfo curCominfo = m_nameAndComInfos[name];
     if(name.contains("(鏈骇)")){
         QStringList sps = name.split("(鏈骇)");
         name = sps.at(0);
+        curCominfo = m_nameAndComInfos[name];
     }else if(name.contains("(姹囨��)")){
         name = name.split("(姹囨��)").at(0);
+        qDebug()<<"姹囨�诲鐞�:";
+        // 鍋氫竴涓眹鎬荤殑澶勭悊锛屾妸鎵�鏈変笅绾х殑閮界疮鍔犺捣鏉�
+        ComInfo allCominfo = m_nameAndComInfos[name];
+        for(QString cur:m_treeNodes[name]){
+            if(name != cur){
+                ComInfo &tmp = m_nameAndComInfos[cur];
+                allCominfo.organazationNum += tmp.organazationNum;
+                allCominfo.realNum += tmp.realNum;
+                allCominfo.professionalNum += tmp.professionalNum;
+                allCominfo.CIANum += tmp.CIANum;
+                allCominfo.masterNum += tmp.masterNum;
+                allCominfo.undergraduatesNum += tmp.undergraduatesNum;
+                allCominfo.juniorNum += tmp.juniorNum;
+                allCominfo.seniorNum += tmp.seniorNum;
+                allCominfo.intermediateNum += tmp.intermediateNum;
+                allCominfo.primaryNum += tmp.primaryNum;
+                allCominfo.noTitleNum += tmp.noTitleNum;
+                allCominfo.upFiftyOldNum += tmp.upFiftyOldNum;
+                allCominfo.upThirtyOldNum += tmp.upThirtyOldNum;
+                allCominfo.downThirtyOldNum += tmp.downThirtyOldNum;
+                allCominfo.auditNum += tmp.auditNum;
+                allCominfo.accountingNum += tmp.accountingNum;
+                allCominfo.economyNum += tmp.economyNum;
+                allCominfo.lawNum += tmp.lawNum;
+                allCominfo.managerNum += tmp.managerNum;
+                allCominfo.itNum += tmp.itNum;
+                allCominfo.engineeringNum += tmp.engineeringNum;
+                allCominfo.otherNum += tmp.otherNum;
+            }
+
+        }
+        curCominfo = allCominfo;
+
     }
-    ComInfo curCominfo = m_nameAndComInfos[name];
+    //ComInfo curCominfo = m_nameAndComInfos[name];
     // 涓�銆佸崟浣嶅熀鏈儏鍐�
     ui->lineEdit_creditCode->setText(curCominfo.creditCode);
     ui->lineEdit_name->setText(QString::fromLocal8Bit( curCominfo.name));
@@ -1552,6 +1592,38 @@
         }
     }
 }
+
+void ConverInfo2::disableWheelEvent()
+{
+    ui->comboBox_ChiefDesignerLevel->installEventFilter(this);
+    ui->comboBox_comType->installEventFilter(this);
+    ui->comboBox_employmentMode->installEventFilter(this);
+    ui->comboBox_hasChiefDesigner->installEventFilter(this);
+    ui->comboBox_hasSetIntervalAudit->installEventFilter(this);
+    ui->comboBox_hasSetSeparateIA->installEventFilter(this);
+    ui->comboBox_hasUpLegal->installEventFilter(this);
+    ui->comboBox_intavalAuditLeval->installEventFilter(this);
+    ui->comboBox_leadingOrganization->installEventFilter(this);
+    ui->comboBox_scale->installEventFilter(this);
+    ui->comboBox_standardType->installEventFilter(this);
+}
+
+bool ConverInfo2::eventFilter(QObject *watched, QEvent *event)
+{
+    QString cls = watched->metaObject()->className();
+    if(cls == "QComboBox"){
+        //qDebug()<<"鍙戠幇涓嬫媺妗�";
+        if(event->type() == QEvent::Wheel){
+            //qDebug()<<"浣跨敤浜嗘粴杞�";
+            return true;  // 杩斿洖鐪熻〃绀虹鐢紝杩斿洖鍋囧垯鑳界敤
+        }
+    }else{
+        qDebug()<<"鍏朵粬绫诲瀷:"<<cls;
+    }
+
+    return QMainWindow::eventFilter(watched,event);
+
+}
 void ConverInfo2::addTreeWidgetNode(QVariant upName,QVariant name){
     // 娣诲姞宸﹁竟鏍戝舰鍥剧浉鍏�
     // 鑿滃崟鐩稿叧  褰撲笂绾у叕鍙镐负绌轰笂绾ф椂锛岃嚜宸卞綋鑷繁鐨勪笂绾э紝骞朵笖缃楀垪杩涘幓褰� 鏈骇
@@ -1563,7 +1635,8 @@
         for(int k=0;k<ui->treeWidget->topLevelItemCount();++k){
             QTreeWidgetItem *tmp = ui->treeWidget->topLevelItem(k);
             qDebug()<<k<<tmp->text(0)<<upName.toString();
-            if(upName.toString()+"(姹囨��)" == tmp->text(0)){
+            int pos = tmp->text(0).indexOf(upName.toString()+"(姹囨��)");
+            if(upName.toString()+"(姹囨��)" == tmp->text(0) || pos != -1){
                 top = tmp;
                 break;
             }
@@ -1572,11 +1645,13 @@
             if(top){ // 瀛樺湪锛屽垯娣诲姞鍒板瀛愬垪琛ㄤ腑
                 QTreeWidgetItem *top1 = new QTreeWidgetItem(top);
                 top1->setText(0,name.toString());
+                top->setText(0,upName.toString()+"(姹囨��)涓嬬骇鏁�:"+QString::number(top->childCount()-1));
             }else{ // 涓嶅瓨鍦紝鍒欐柊寤轰竴涓垪琛�
                 QTreeWidgetItem *top1 = new QTreeWidgetItem(ui->treeWidget);
                 top1->setText(0,name.toString()+"(姹囨��)");
                 QTreeWidgetItem *top2 = new QTreeWidgetItem(top1);
                 top2->setText(0,name.toString()+"(鏈骇)");
+                top1->setText(0,name.toString()+"(姹囨��)涓嬬骇鏁�:"+QString::number(top1->childCount()-1));
             }
         }
 
@@ -1588,6 +1663,7 @@
             top1->setText(0,name.toString()+"(姹囨��)");
             QTreeWidgetItem *top2 = new QTreeWidgetItem(top1);
             top2->setText(0,name.toString()+"(鏈骇)");
+            top1->setText(0,name.toString()+"(姹囨��)涓嬬骇鏁�:"+QString::number(top1->childCount()-1));
         }
 
     }

--
Gitblit v1.8.0