error 6 лет назад
Родитель
Сommit
114794a99b

+ 1 - 1
configinfo.cpp

@@ -5,7 +5,7 @@ ConfigInfo::ConfigInfo()
     //TODO: 小宋,给每个成员设置默认值
     baseUrl = "http://erp.itwsw.cn/api";
     packId = 0;
-    printerName = "";
+    printerName = "TSC TTP-244 Pro";
     portName = "COM1";
     portBaudRate = "9600";
     portType = 0;

+ 3 - 2
handle/packinfomanger.cpp

@@ -4,6 +4,7 @@
 #include <QDateTime>
 #include <QJsonDocument>
 #include <QJsonArray>
+#include "QDebug"
 
 using namespace PQ;
 
@@ -39,8 +40,8 @@ QString PackInfoManger::setPackInfoSync(const QString & code, qint64 time, bool
         tm = QDateTime::fromSecsSinceEpoch(time);
     }
     auto dir = getDir(tm.date());
-    QString name = code +  "_sync.json";
-    QString newName = code + ".json";
+    QString name = dir.absoluteFilePath(code +  "_sync.json");
+    QString newName = dir.absoluteFilePath(code + ".json");
     if(QFile::rename(name,newName) && autoSync){
         writeAbsoluteFile(_dataDir.absoluteFilePath("auto_sync.time"),tm.toString("yyyy-MM-dd").toUtf8());
         return newName;

+ 1 - 0
handle/packinfoseed2server.cpp

@@ -34,6 +34,7 @@ void PackInfoSeed2Server::doSend()
 
 void PackInfoSeed2Server::result(int code, const QJsonObject & body)
 {
+    qDebug()<<body;
     if(code != 200 || body.isEmpty()){
         _current.clear();
         QTimer::singleShot(500,this,&PackInfoSeed2Server::doSend);

+ 11 - 8
handle/printer/boxtemlateone.cpp

@@ -1,4 +1,5 @@
 #include "boxtemlateone.h"
+#include "pqQtlib/log/pqlog.h"
 
 BoxTemlateOne::BoxTemlateOne()
 {
@@ -16,7 +17,7 @@ QImage BoxTemlateOne::doPrinter(QSharedPointer<BoxInfo> box)
 //    QLogInfo(log) << "prnter " << bar<< "  " << info->caseNumber();
     QSharedPointer<PackInfo> pinfo = box->parentPack();
     if(pinfo.isNull()) return QImage();
-    QSize size(MAXHEIGHT*5,MAXWIDTH*5);
+    QSize size(MAXWIDTH*5,MAXHEIGHT*5);
     QImage image(size,QImage::Format_ARGB32);
     image.fill(qRgba(255, 255, 255, 255));
     QPainter painter(&image);
@@ -34,7 +35,8 @@ QImage BoxTemlateOne::doPrinter(QSharedPointer<BoxInfo> box)
 
     QRect target(0*5, 57*5, 100*5, 65*5);
 //    QRect source(-10*5, 0, 65*5, 40*5);
-//    barCode.draw(painter,target,bar);
+    QString bar = box->caseNumber();
+    code.draw(painter,target,bar);
 //    painter.drawImage(target,barCode.draw(barCode.CodeBinary(bar),bar),source);
 
     painter.setRenderHint(QPainter::Antialiasing,true);
@@ -83,9 +85,9 @@ QImage BoxTemlateOne::doPrinter(QSharedPointer<BoxInfo> box)
 
 //    print(image);
 
+    QString path = PQ::PQLogManger::this_()->getSaveFilePath();
 //    if(save)
-//        image.save(path+"/xiangdan/code"+bar+".bmp");
-
+        image.save(path+"/xiangdan/code"+bar+".bmp");
     return image;
 
 //    return img;
@@ -104,7 +106,7 @@ QImage PackTemlateOne::doPrinter(QSharedPointer<PackInfo> pack)
 {
     //TODO: 小宋,迁移打印 码单的逻辑
 
-    QSize size(MAXHEIGHT*5,MAXWIDTH*5);
+    QSize size(MAXWIDTH*5,MAXHEIGHT*5);
     QImage image(size,QImage::Format_ARGB32);
     image.fill(qRgba(255, 255, 255, 255));
     QPainter painter(&image);
@@ -154,7 +156,8 @@ QImage PackTemlateOne::doPrinter(QSharedPointer<PackInfo> pack)
     }
 
     QRect target(0*5, 67*5, 100*5, 75*5);
-//    barCode.draw(painter,target,bar);
+    QString bar = pack->codeSingle();
+    code.draw(painter,target,bar);
     font.setPixelSize(20);
     font.setFamily("黑体");
 
@@ -175,9 +178,9 @@ QImage PackTemlateOne::doPrinter(QSharedPointer<PackInfo> pack)
     painter.drawText(48*5,64*5,QString("%1 kg").arg(getDecimalbit(pack->net_weight() / 1000.00)));
     painter.drawText(78*5,64*5,QString::number(pack->tube_number()));
 
+    QString path = PQ::PQLogManger::this_()->getSaveFilePath();
 //        print(image);
-//if(save)
-//        image.save(path+"/rukudan/code"+bar+".bmp");
+        image.save(path+"/rukudan/code"+bar+".bmp");
 
     return image;
 }

+ 1 - 1
handle/printer/printermanger.h

@@ -12,7 +12,7 @@ public:
 
     void setPrinter(const QSharedPointer<BaseBoxPrinter> box, const QSharedPointer<BasePackinfoPrinter> packInfo);
 
-    inline void setPrinterName(const QString & name);
+    void setPrinterName(const QString & name);
 signals:
 public slots:
     void printerBox(QSharedPointer<BoxInfo> info);

+ 1 - 1
handle/printerthreadhandle.cpp

@@ -10,7 +10,7 @@ void PrinterThreadHandle::updateConfig()
 {
     if(manger == nullptr) return;
     auto config = GlobalInfo::this_()->config();
-    manger->setPrinterName(config->printerName);//t
+    manger->setPrinterName(config->printerName);
 }
 
 void PrinterThreadHandle::start()

+ 2 - 2
handle/projectinfomanger.cpp

@@ -9,6 +9,7 @@ ProjectInfoManger::ProjectInfoManger(PackInfoManger *manger, QObject *parent) :
 {
     connect(&_requst,&HttpRequest::result,this,&ProjectInfoManger::result);
     _nowJob = 0;
+    _status = IDIL;
 }
 
 bool ProjectInfoManger::loadServerList(bool local)
@@ -61,7 +62,7 @@ void ProjectInfoManger::doSendCreate()
         // test:  调用新建批号的接口
         // docs: http://doc.vanlai.net:3001/web/#/1?page_id=59
 
-        QString url = GlobalInfo::this_()->config()->baseUrl+"v1/goods/add";
+        QString url = GlobalInfo::this_()->config()->baseUrl+"/v1/goods/add";
         _requst.setUserToken(QString::number(GlobalInfo::this_()->user().accountId),GlobalInfo::this_()->user().acessToken);
         _requst.post(url,info->toObject());
     } else {
@@ -93,7 +94,6 @@ void ProjectInfoManger::handleList()
 
 void ProjectInfoManger::result(int code, const QJsonObject & body)
 {
-//    qDebug()<<body;
     switch (_status) {
     case Load_Server_List:
         handleGetList(code,body);

+ 1 - 1
handle/seriport/rtuport.h

@@ -5,7 +5,7 @@
 #include "QDebug"
 #include <QSerialPort>
 #include "QTimer"
-#include "globalinfo.h"
+//#include "globalinfo.h"
 #include "handle/seriport/serialbasehandle.h"
 
 

+ 11 - 15
mainwindow.cpp

@@ -8,21 +8,12 @@ MainWindow::MainWindow(QWidget *parent)
 {
     ui->setupUi(this);
     connect(ui->widgetLogin,&LoginForm::loginFinish,this,&MainWindow::backMenu);
-//    connect(ui->pageSelectValue,&SelectValueForm::back,this,&MainWindow::FixedAndUncertain);
-////    connect(ui->pageAutoPack,&AutoPackForm::back,this,&MainWindow::backMenu);
-//    connect(ui->pagePackDetail,&PackDetailForm::back,this,&MainWindow::backMenu);
-//    connect(ui->pageSettings,&SettingsForm::back,this,&MainWindow::backMenu);
-//    connect(ui->pageDingZhong,&FixedWeightPackForm::back,this,&MainWindow::backMenu);
-//    connect(ui->pageBuDing,&UncertainWeightPackForm::back,this,&MainWindow::backMenu);
 
     connect(ui->pageSelectValue,&SelectValueForm::selectProject,this,&MainWindow::FixedAndUncertain);
+    connect(ui->actionSetting,&QAction::triggered,this,&MainWindow::changeToSettings);
+    connect(ui->actionPack,&QAction::triggered,this,&MainWindow::backMenu);
     ui->stackedWidget->setCurrentWidget(ui->pageLogin);
-////    connect(ui->pageAutoPack,&AutoPackForm::djmbbox,this,&MainWindow::changedjmb);
-//    connect(ui->widgetLogin,&LoginForm::SettingsClicked,this,&MainWindow::changeToSettings);
-////    connect(ui->actionQuanping,&QAction::trigger,[this](){this->showFullScreen();});
-//    connect(ui->actionMax,&QAction::trigger,[this](){this->showMaximized();});
-//    ui->checkBox->hide();
-//    qint64 time;
+
 }
 
 MainWindow::~MainWindow()
@@ -53,7 +44,7 @@ void MainWindow::on_pushAuto_clicked()
 
 void MainWindow::on_pushList_clicked()
 {
-    ui->stackedWidget->setCurrentWidget(ui->pagePackDetail);
+//    ui->stackedWidget->setCurrentWidget(ui->pagePackDetail);
 }
 
 void MainWindow::on_pushConfig_clicked()
@@ -63,6 +54,7 @@ void MainWindow::on_pushConfig_clicked()
 
 void MainWindow::pageStatusChange(const ProjectInfo & info, int status)
 {
+
 }
 
 void MainWindow::changeToSettings()
@@ -77,9 +69,10 @@ void MainWindow::backMenu()
 
 void MainWindow::FixedAndUncertain(QString batchno)
 {
-    qDebug()<<batchno;
+//    qDebug()<<batchno;
     ui->stackedWidget->setCurrentWidget(ui->pageAutoPack);
     ui->dingzhongButton->setChecked(true);
+    ui->dingzhong->setProInfo(GlobalInfo::this_()->project().value(batchno));
     ui->dingzhong->init();
 }
 
@@ -87,14 +80,17 @@ void MainWindow::changedjmb(QImage image)
 {
     ui->stackedWidget->setCurrentWidget(ui->pageTest);
     ui->djmb->setPixmap(QPixmap::fromImage(image));
+
 }
 
 void MainWindow::on_dingzhongButton_clicked()
 {
-    ui->dingzhong->init();
+    ui->stackedWidget_2->setCurrentWidget(ui->dingzhong);
+//    ui->dingzhong->init();
 }
 
 void MainWindow::on_budingButton_clicked()
 {
+    ui->stackedWidget_2->setCurrentWidget(ui->buding);
     ui->buding->init();
 }

+ 17 - 6
mainwindow.ui

@@ -18,7 +18,7 @@
     <item row="0" column="0">
      <widget class="QStackedWidget" name="stackedWidget">
       <property name="currentIndex">
-       <number>4</number>
+       <number>1</number>
       </property>
       <widget class="QWidget" name="pageMain">
        <layout class="QHBoxLayout" name="horizontalLayout_2">
@@ -424,7 +424,7 @@ color: rgb(255, 255, 255);</string>
      <x>0</x>
      <y>0</y>
      <width>1033</width>
-     <height>30</height>
+     <height>26</height>
     </rect>
    </property>
    <widget class="QMenu" name="menu">
@@ -440,14 +440,15 @@ color: rgb(255, 255, 255);</string>
      <addaction name="action_4"/>
     </widget>
     <addaction name="menu_4"/>
+    <addaction name="actionSetting"/>
     <addaction name="actionMax"/>
-    <addaction name="action"/>
+    <addaction name="actionLogout"/>
    </widget>
    <widget class="QMenu" name="menu_2">
     <property name="title">
      <string>入库</string>
     </property>
-    <addaction name="action_5"/>
+    <addaction name="actionPack"/>
     <addaction name="action_6"/>
    </widget>
    <widget class="QMenu" name="menu_3">
@@ -460,7 +461,7 @@ color: rgb(255, 255, 255);</string>
    <addaction name="menu_3"/>
   </widget>
   <widget class="QStatusBar" name="statusbar"/>
-  <action name="actionMax">
+  <action name="actionSetting">
    <property name="text">
     <string>连接设置</string>
    </property>
@@ -485,7 +486,7 @@ color: rgb(255, 255, 255);</string>
     <string>修改规格</string>
    </property>
   </action>
-  <action name="action_5">
+  <action name="actionPack">
    <property name="text">
     <string>打包</string>
    </property>
@@ -495,6 +496,16 @@ color: rgb(255, 255, 255);</string>
     <string>修改</string>
    </property>
   </action>
+  <action name="actionMax">
+   <property name="text">
+    <string>最大化</string>
+   </property>
+  </action>
+  <action name="actionLogout">
+   <property name="text">
+    <string>退出账号</string>
+   </property>
+  </action>
  </widget>
  <customwidgets>
   <customwidget>

+ 4 - 2
struct_/packinfo.cpp

@@ -60,8 +60,9 @@ BoxInfo::BoxInfo(QSharedPointer<PackInfo> pack,QString code):case_number(code),p
 QJsonObject BoxInfo::toObject()
 {
     QJsonObject ret;
+    ret.insert("case_number",case_number);
     ret.insert("box_weight",box_weight);
-    ret.insert("tube_weight",tube_number);
+    ret.insert("tube_number",tube_number);
     ret.insert("bucket_weight",bucket_weight);
     ret.insert("gross_weight",bucket_weight);
     ret.insert("net_weight",net_weight);
@@ -101,6 +102,7 @@ QJsonObject PackInfo::toObject()
     ret.insert("gross_weight",QString::number(this->gross_weight()));
     ret.insert("net_weight",QString::number(this->net_weight()));
     ret.insert("goods_id",QString::number(this->goodsID()));
+    ret.insert("code_single",this->codeSingle());
 
     ret.insert("quantity",quantity);
     ret.insert("level_id",level_id);
@@ -108,7 +110,7 @@ QJsonObject PackInfo::toObject()
     ret.insert("machine_no",machine_no);
     ret.insert("packing_time",packing_time);
     ret.insert("packing_type",packing_type);
-    ret.insert("operator_id",operator_id);
+    ret.insert("operator",operator_id);
     ret.insert("carton_type",carton_type);
     ret.insert("remark",remark);
     ret.insert("telephone",telephone);

+ 35 - 17
widget/fixedweightpackform.cpp

@@ -13,7 +13,8 @@ FixedWeightPackForm::FixedWeightPackForm(QWidget *parent) :
     connect(timer,&QTimer::timeout,this,&FixedWeightPackForm::calcData);
     timer->start(500);
     connect(glo,&GlobalInfo::dbConfigUpdated,this,&FixedWeightPackForm::upconfig);
-//    connect(&packConfig,&RemotePackConfig::dengJIConfigUp,this,&FixedWeightPackForm::upDengjiInfo);
+    connect(glo,&GlobalInfo::dengJiUped,this,&FixedWeightPackForm::upDengjiInfo);
+    connect(glo,&GlobalInfo::doInited,this,&FixedWeightPackForm::changeSpecs);
     auto dt = CacheFile::readFile("dingzhongInfo.cache");
     auto list = QString::fromUtf8(dt).split("[,]");
     if(list.size() == 2){
@@ -22,6 +23,7 @@ FixedWeightPackForm::FixedWeightPackForm(QWidget *parent) :
     }
     ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
     ui->pushStart->hide();
+    packServer = new PackInfoSeed2Server(Manger);
 }
 
 FixedWeightPackForm::~FixedWeightPackForm()
@@ -65,8 +67,11 @@ void FixedWeightPackForm::on_addPackList_clicked()
         packinfo->customer = ui->taitou->text();
         packinfo->telephone = ui->taiPhone->text();
     }
-
+//    qDebug()<<packinfo->boxes().at(0)->tube_number;
     packServer->send(packinfo);
+    GlobalInfo::this_()->packInfoManger()->savePackInfo(packinfo);
+    GlobalInfo::this_()->packInfoManger()->setPackInfoSync(packinfo->codeSingle(),packinfo->time(),true);
+    GlobalInfo::this_()->printerPack(packinfo);
 
 //    //把数据添加到数据库里
 //    aputils.insertProductSQL(packinfo);
@@ -90,7 +95,7 @@ void FixedWeightPackForm::on_pushStart_clicked()
         ui->widget_2->setEnabled(false);
         ui->pushPiLiang->setDisabled(false);
     } else {
-        init();
+//        init();
     }
 }
 
@@ -124,6 +129,7 @@ void FixedWeightPackForm::on_addBoxList_clicked()
 
 //    把box数据添加到packinfo的boxes数据表里;
     packinfo->addBoxInfoList(box);
+    GlobalInfo::this_()->printerBox(box);
 
     //添加数据库
 //    aputils.insertDetailsSQL(box,packinfo->codeSingle());
@@ -151,6 +157,7 @@ void FixedWeightPackForm::setTableWidget()
     }
 }
 
+//往tablewidget里添加数据
 void FixedWeightPackForm::addTableWidget(QSharedPointer<BoxInfo> box)
 {
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,0,new QTableWidgetItem(QString::number(ui->tableWidget->rowCount())));
@@ -186,11 +193,17 @@ void FixedWeightPackForm::init()
 //    ui->pushPiLiang->setDisabled(true);
 //    ui->widget_2->setEnabled(true);
 
+    ui->pizhong->setCurrentText(QString(_info->box_weight));
+    ui->guanse->setCurrentText(_info->bucket_color);
+    ui->zhixiang->setCurrentText(_info->carton_type);
+    ui->tongzhong->setCurrentText(_info->bucket_weight);
+
     ui->comboBox->clear();
     for(int i = 1;i<=20;i++){
         ui->comboBox->addItem(QString::number(i));
     }
     ui->comboBox->setCurrentText("20");
+    setTableWidget();
 //    specs.getInfo(0,20);
 //    setTableWidget();//检查packinfo isNull
 }
@@ -270,23 +283,28 @@ void FixedWeightPackForm::changeSpecs()
 {
     ui->tableWidget_2->clearContents();
     ui->tableWidget_2->setRowCount(0);
-//    for(int i = 0; i < specs.currtInfo.size(); ++i){
-//        auto & v = specs.currtInfo.at(i);
-//        ui->tableWidget_2->insertRow(i);
-//        auto xuanze_btn =  new QRadioButton();
-//        connect(xuanze_btn,&QPushButton::clicked,[i,this](){this->xuanZe_clicked(i);});
-//        ui->tableWidget_2->setCellWidget(i,0,xuanze_btn);
-//        ui->tableWidget_2->setItem(i,1,new QTableWidgetItem(v.specs));
-//        ui->tableWidget_2->setItem(i,2,new QTableWidgetItem(v.category));
-//        ui->tableWidget_2->setItem(i,3,new QTableWidgetItem(v.batch_no));
-//        ui->tableWidget_2->setItem(i,4,new QTableWidgetItem(v.color));
-//    }
+    prolist = GlobalInfo::this_()->project().values();
+    for(int i = 0; i < prolist.size(); ++i){
+        auto & v = prolist.at(i);
+        ui->tableWidget_2->insertRow(i);
+        auto xuanze_btn =  new QRadioButton();
+        QString batchno = prolist.at(i)->batch_no;
+        connect(xuanze_btn,&QPushButton::clicked,[batchno,this](){this->xuanZe_clicked(batchno);});
+        ui->tableWidget_2->setCellWidget(i,0,xuanze_btn);
+        ui->tableWidget_2->setItem(i,1,new QTableWidgetItem(v->specs));
+        ui->tableWidget_2->setItem(i,2,new QTableWidgetItem(v->category));
+        ui->tableWidget_2->setItem(i,3,new QTableWidgetItem(v->batch_no));
+        ui->tableWidget_2->setItem(i,4,new QTableWidgetItem(v->color));
+    }
 }
 
-void FixedWeightPackForm::xuanZe_clicked(int row)
+void FixedWeightPackForm::xuanZe_clicked(QString batchno)
 {
 //    setProInfo(specs.currtInfo.at(row));
-    packConfig.refConfig();
+//    packConfig.refConfig();
+//    qDebug()<<batchno;
+    setProInfo(GlobalInfo::this_()->project().value(batchno));
+    init();
 }
 
 void FixedWeightPackForm::del_clicked(int row)
@@ -303,5 +321,5 @@ void FixedWeightPackForm::del_clicked(int row)
 
 void FixedWeightPackForm::Makeup_clicked(int row)
 {
-    djmb.printBoxInfo(packinfo->boxInfoAt(row)->caseNumber(),packinfo->boxInfoAt(row));
+
 }

+ 4 - 2
widget/fixedweightpackform.h

@@ -6,6 +6,7 @@
 #include "QTimer"
 #include "globalinfo.h"
 #include "handle/packinfoseed2server.h"
+#include "handle/packinfomanger.h"
 
 namespace Ui {
 class FixedWeightPackForm;
@@ -41,7 +42,7 @@ public slots:
     void upDengjiInfo(/*const QList<DengJiConfigItem> & dengJis*/);
     void init();
     void changeSpecs();
-    void xuanZe_clicked(int row);
+    void xuanZe_clicked(QString batchno);
     void del_clicked(int row);
     void Makeup_clicked(int row);
 
@@ -59,10 +60,11 @@ private:
     QMap<QString,DengJiConfigItem> dengjiMap;// <name,详细信息>
     RemotePackConfig packConfig;
     HttpRequest _request;
+    QList<QSharedPointer<ProjectInfo>> prolist;
 
     GlobalInfo * glo = GlobalInfo::this_();
     PackInfoSeed2Server *packServer;
-
+    PackInfoManger *Manger = GlobalInfo::this_()->packInfoManger();
 
     double netNum = 0.00;
     int row;

+ 1 - 2
widget/packdetailform.h

@@ -5,7 +5,7 @@
 //#include "handle/remotepackconfig.h"
 #include "QMessageBox"
 #include "QTreeWidget"
-#include "handle/danjumuban.h"
+#include "globalinfo.h"
 
 namespace Ui {
 class PackDetailForm;
@@ -51,7 +51,6 @@ private:
     QStringList productSqlList;
     QStringList detailSqlList;
     QSharedPointer<PackInfo> packinfo;
-    DanJuMuBan djmb;
     int nowPageNum;
     int pageNumAll;
 };

+ 7 - 4
widget/selectvalueform.cpp

@@ -22,9 +22,9 @@ void SelectValueForm::Start()
 {
     prolist = GlobalInfo::this_()->project().values();
 
-    if(prolist.isEmpty()){
-        return;
-    }
+//    if(prolist.isEmpty()){
+//        return;
+//    }
     totleNum = prolist.size();
     refPage(nowPage);
     ui->labelTotle->setText(QString::number(totleNum));
@@ -143,5 +143,8 @@ void SelectValueForm::on_pushButton_3_clicked()
 
 void SelectValueForm::on_searchButton_clicked()
 {
-    refPage(nowPage);
+    UserInfo user = GlobalInfo::this_()->user();
+    bool isNoLine = GlobalInfo::this_()->isNoLine();
+    GlobalInfo::this_()->start(user,isNoLine);
+    qDebug()<<user.userName<<user.accountId<<user.acessToken;
 }

+ 9 - 6
widget/settingsform.cpp

@@ -8,11 +8,6 @@ SettingsForm::SettingsForm(QWidget *parent) :
 {
     ui->setupUi(this);
     Init();
-//    ui->baseUrlLine->setText(config.baseUrl);
-//    ui->printerName->setCurrentText(config.printerName);
-//    ui->portName->setCurrentText(config.portName);
-//    ui->portBaudRate->setCurrentText(config.portBaudRate);
-//    ui->comboBox_2->setCurrentIndex(config.portType);
 }
 
 SettingsForm::~SettingsForm()
@@ -40,6 +35,14 @@ void SettingsForm::Init()
     Baudlist<<"300"<<"600"<<"2400"<<"4800"<<"9600"<<"19200"<<"56000"<<"57600"<<"115200"<<"128000"<<"256000"<<"921600";
     ui->portBaudRate->addItems(Baudlist);
 
+    auto config = GlobalInfo::this_()->config();
+
+    ui->baseUrlLine->setText(config->baseUrl);
+    ui->printerName->setCurrentText(config->printerName);
+    ui->portName->setCurrentText(config->portName);
+    ui->portBaudRate->setCurrentText(config->portBaudRate);
+    ui->comboBox_2->setCurrentIndex(config->portType);
+
 }
 
 void SettingsForm::on_back_btn_clicked()
@@ -56,6 +59,6 @@ void SettingsForm::on_save_btn_clicked()
     obj.insert("portName",ui->portName->currentText());
     obj.insert("portBaudRate",ui->portBaudRate->currentText());
     obj.insert("portType",ui->comboBox_2->currentIndex());
-//    PQ::ConfigFile::writeObject("Config.json",obj);
+    PQ::ConfigFile::writeObject("Config.json",obj);
     QMessageBox::information(this,"提示","请重新启动程序,以使用新配置!");
 }

+ 2 - 0
widget/settingsform.h

@@ -4,8 +4,10 @@
 #include <QWidget>
 //#include "configinfo.h"
 #include <QSerialPortInfo>
+#include "pqQtlib/utils/pqfileutils.h"
 #include "QMessageBox"
 #include "qjsonobject.h"
+#include "globalinfo.h"
 
 
 namespace Ui {

+ 1 - 3
widget/uncertainweightpackform.cpp

@@ -71,7 +71,6 @@ void UncertainWeightPackForm::calcData()
 void UncertainWeightPackForm::on_addPackList_clicked()
 {
     if(packinfo.isNull()) return;
-    qDebug()<<"this";
 
     if(packinfo->boxes().size()>0){
         packinfo->quantity = packinfo->boxes().size();
@@ -336,7 +335,7 @@ void UncertainWeightPackForm::changeSpecs()
 void UncertainWeightPackForm::xuanZe_clicked(int row)
 {
 //    setProInfo(specs.currtInfo.at(row));
-    packConfig.refConfig();
+//    packConfig.refConfig();
 }
 
 void UncertainWeightPackForm::del_clicked(int row)
@@ -352,5 +351,4 @@ void UncertainWeightPackForm::del_clicked(int row)
 
 void UncertainWeightPackForm::Makeup_clicked(int row)
 {
-    djmb.printBoxInfo(packinfo->boxInfoAt(row)->caseNumber(),packinfo->boxInfoAt(row));
 }

+ 1 - 0
widget/uncertainweightpackform.h

@@ -9,6 +9,7 @@
 //#include "handle/autopackutils.h"
 #include "QTimer"
 //#include "handle/selectspecs.h"
+#include "QMessageBox"
 
 namespace Ui {
 class UncertainWeightPackForm;