Explorar o código

fix show and printf

dushibaiyu %!s(int64=6) %!d(string=hai) anos
pai
achega
376f7980b6

+ 10 - 2
configinfo.cpp

@@ -1,11 +1,17 @@
 #include "configinfo.h"
 #include "configinfo.h"
 
 
-ConfigInfo::ConfigInfo()
+ConfigInfo::ConfigInfo():m_psetting(nullptr)
 {
 {
     packId = 1031;
     packId = 1031;
     Start();
     Start();
 }
 }
 
 
+ConfigInfo::~ConfigInfo()
+{
+    if(m_psetting)
+        delete  m_psetting;
+}
+
 void ConfigInfo::Start()
 void ConfigInfo::Start()
 {
 {
 
 
@@ -20,6 +26,7 @@ void ConfigInfo::Start()
         Set("ElectronicScale","portName","COM1");
         Set("ElectronicScale","portName","COM1");
         Set("ElectronicScale","portBaudRate",9600);
         Set("ElectronicScale","portBaudRate",9600);
         Set("ElectronicScale","portType",0);
         Set("ElectronicScale","portType",0);
+        Set("hardware","savePrinter",true);
         m_psetting->sync();
         m_psetting->sync();
 //        return;
 //        return;
     }
     }
@@ -30,7 +37,7 @@ void ConfigInfo::Start()
         baseUrl = Get("url","baseUrl").toString();//服务器地址
         baseUrl = Get("url","baseUrl").toString();//服务器地址
 
 
         //本机用户信息
         //本机用户信息
-        packId = Get("user","packId").toInt();//打包点id
+//        packId = Get("user","packId").toInt();//打包点id
 
 
         //硬件
         //硬件
         printerName = Get("hardware","printerName").toString();//打印机名称
         printerName = Get("hardware","printerName").toString();//打印机名称
@@ -39,6 +46,7 @@ void ConfigInfo::Start()
         portName = Get("ElectronicScale","portName").toString();//串口名称
         portName = Get("ElectronicScale","portName").toString();//串口名称
         portBaudRate = Get("ElectronicScale","portBaudRate").toString();//串口波特率
         portBaudRate = Get("ElectronicScale","portBaudRate").toString();//串口波特率
         portType = Get("ElectronicScale","portType").toInt();
         portType = Get("ElectronicScale","portType").toInt();
+        savePrinter = Get("hardware","savePrinter").toBool();
 
 
 //   }else{
 //   }else{
 //        qDebug()<<"配置文件不存在";
 //        qDebug()<<"配置文件不存在";

+ 5 - 0
configinfo.h

@@ -12,6 +12,7 @@ class ConfigInfo
 {
 {
 public:
 public:
     ConfigInfo();
     ConfigInfo();
+    ~ConfigInfo();
 
 
     QString baseUrl;//服务器接口地址
     QString baseUrl;//服务器接口地址
     quint16 packId;
     quint16 packId;
@@ -20,6 +21,8 @@ public:
     QString portBaudRate; //电子秤串口波特率
     QString portBaudRate; //电子秤串口波特率
     int portType;
     int portType;
 
 
+    bool savePrinter;
+
 //    QString autoPackUrl;//待入库产品添加接口
 //    QString autoPackUrl;//待入库产品添加接口
 
 
 //    QString loginUrl;//登录接口
 //    QString loginUrl;//登录接口
@@ -82,6 +85,8 @@ struct ProjectInfo
     bool is_disable;//	bool	是否禁用
     bool is_disable;//	bool	是否禁用
     qint64 create_time;//	int	创建时间
     qint64 create_time;//	int	创建时间
     qint64 modified_time;//	int	更新时间
     qint64 modified_time;//	int	更新时间
+
+    QString telephone;//
 };
 };
 
 
 #endif // CONFIGINFO_H
 #endif // CONFIGINFO_H

+ 2 - 1
handle/autopackutils.cpp

@@ -47,6 +47,7 @@ void AutoPackUtils::httpResult(int emitcode, const QJsonObject body)
 void AutoPackUtils::insertDetailsSQL(QSharedPointer<BoxInfo> boxes,QString codeSingle)
 void AutoPackUtils::insertDetailsSQL(QSharedPointer<BoxInfo> boxes,QString codeSingle)
 {
 {
 //    qDebug()<<boxes->caseNumber();
 //    qDebug()<<boxes->caseNumber();
+    djmb.printBoxInfo(codeSingle,boxes);
     detailsData.code_single = codeSingle;
     detailsData.code_single = codeSingle;
     detailsData.case_number = boxes->caseNumber();
     detailsData.case_number = boxes->caseNumber();
     detailsData.box_weight = boxes->box_weight;
     detailsData.box_weight = boxes->box_weight;
@@ -69,7 +70,7 @@ void AutoPackUtils::insertProductSQL(QSharedPointer<PackInfo> packes)
 {
 {
     if(packes.isNull()) return;
     if(packes.isNull()) return;
     if(packes->boxes().isEmpty()) return;
     if(packes->boxes().isEmpty()) return;
-
+    djmb.printPackInfo(packes->codeSingle(),packes);
     productData.goods_id = packes->goodsID();
     productData.goods_id = packes->goodsID();
     productData.code_single = packes->codeSingle();
     productData.code_single = packes->codeSingle();
     productData.quantity = packes->quantity;
     productData.quantity = packes->quantity;

+ 33 - 14
handle/danjumuban.cpp

@@ -2,10 +2,22 @@
 #include "QtPrintSupport"
 #include "QtPrintSupport"
 #include "QDateTime"
 #include "QDateTime"
 #include "globalinfo.h"
 #include "globalinfo.h"
+#include <QDir>
+#include "configinfo.h"
+#include "handle/utils/cachefile.h"
 
 
 DanJuMuBan::DanJuMuBan()
 DanJuMuBan::DanJuMuBan()
 {
 {
-    path = QDir::currentPath();
+    path = QLOG::QLogManger::this_()->getSaveFilePath();
+    QDir dir(path);
+    if(!dir.exists("xiangdan"))
+        dir.mkdir("xiangdan");
+    if(!dir.exists("rukudan"))
+        dir.mkdir("rukudan");
+    log = QLOG::QLogManger::this_()->getLog("printer");
+    ConfigInfo info;
+    info.Start();
+    save = true;
 }
 }
 
 
 QImage DanJuMuBan::printBoxInfo(QString bar,QSharedPointer<BoxInfo> info)
 QImage DanJuMuBan::printBoxInfo(QString bar,QSharedPointer<BoxInfo> info)
@@ -14,6 +26,7 @@ QImage DanJuMuBan::printBoxInfo(QString bar,QSharedPointer<BoxInfo> info)
 //    if(datalist.isEmpty()){
 //    if(datalist.isEmpty()){
 //        return;
 //        return;
 //    }
 //    }
+    QLogInfo(log) << "prnter " << bar<< "  " << info->caseNumber();
     QSharedPointer<PackInfo> pinfo = info->parentPack();
     QSharedPointer<PackInfo> pinfo = info->parentPack();
     if(pinfo.isNull()) return QImage();
     if(pinfo.isNull()) return QImage();
     QSize size(MAXWIDTH*5,MAXHEIGHT*5);
     QSize size(MAXWIDTH*5,MAXHEIGHT*5);
@@ -65,9 +78,9 @@ QImage DanJuMuBan::printBoxInfo(QString bar,QSharedPointer<BoxInfo> info)
     painter.drawText(21*5,25*5,pinfo->info().product_type_code);
     painter.drawText(21*5,25*5,pinfo->info().product_type_code);
     painter.drawText(21*5,32*5,pinfo->info().batch_no);
     painter.drawText(21*5,32*5,pinfo->info().batch_no);
     painter.drawText(21*5,39*5,pinfo->info().specs);
     painter.drawText(21*5,39*5,pinfo->info().specs);
-    painter.drawText(67*5,25*5,QString("%1 kg").arg(info->gross_weight / 1000.00));//datalist.at(0));
+    painter.drawText(67*5,25*5,QString("%1 kg").arg(getDecimalbit( info->gross_weight / 1000.00)));//datalist.at(0));
 
 
-    painter.drawText(67*5,32*5,QString("%1 kg").arg(info->net_weight / 1000.00));//datalist.at(1));
+    painter.drawText(67*5,32*5,QString("%1 kg").arg(getDecimalbit(info->net_weight / 1000.00)));//datalist.at(1));
 
 
     painter.drawText(67*5,39*5,QString::number(info->tube_number));//datalist.at(2));
     painter.drawText(67*5,39*5,QString::number(info->tube_number));//datalist.at(2));
     painter.drawText(21*5,46*5,QString::number(pinfo->level_id));//datalist.at(3));
     painter.drawText(21*5,46*5,QString::number(pinfo->level_id));//datalist.at(3));
@@ -79,12 +92,13 @@ QImage DanJuMuBan::printBoxInfo(QString bar,QSharedPointer<BoxInfo> info)
     painter.drawText(21*5,53*5,info->caseNumber());//datalist.at(5));
     painter.drawText(21*5,53*5,info->caseNumber());//datalist.at(5));
 
 
 
 
-//    painter.drawText(4*5,75*5," 电话"+telephone+"传真"+fax);
+    painter.drawText(4*5,75*5," 电话:"+ pinfo->info().telephone);
 
 
     print(image);
     print(image);
-    return image;
 
 
-    image.save(path+"\\xiangdan\\code"+bar+".bmp");
+    if(save)
+        image.save(path+"/xiangdan/code"+bar+".bmp");
+    return image;
 }
 }
 
 
 void DanJuMuBan::printPackModel(QPainter & painter)
 void DanJuMuBan::printPackModel(QPainter & painter)
@@ -156,19 +170,19 @@ QImage DanJuMuBan::printPackInfo(QString bar, QSharedPointer<PackInfo> info)
     painter.drawText(70*5,21*5,QString::number(info->level_id));//info.at(0));
     painter.drawText(70*5,21*5,QString::number(info->level_id));//info.at(0));
     for(int i = 0; i < boxSize; ++i)
     for(int i = 0; i < boxSize; ++i)
     {
     {
-        QString code = QString::number(info->boxes().at(i)->net_weight);
+        QString code = getDecimalbit(info->boxes().at(i)->net_weight / 1000);
         int line = i / 5;
         int line = i / 5;
         int cloun = i % 5;
         int cloun = i % 5;
         painter.drawText((13 + line * 19)*5,(27.5 + cloun * 6 )*5 ,code);
         painter.drawText((13 + line * 19)*5,(27.5 + cloun * 6 )*5 ,code);
     }
     }
 
 
     painter.drawText(15*5,64*5,QString::number(info->boxes().size()));
     painter.drawText(15*5,64*5,QString::number(info->boxes().size()));
-    painter.drawText(48*5,64*5,QString("%1 kg").arg(info->net_weight() / 1000.00));
+    painter.drawText(48*5,64*5,QString("%1 kg").arg(getDecimalbit(info->net_weight() / 1000.00)));
     painter.drawText(78*5,64*5,QString::number(info->tube_number()));
     painter.drawText(78*5,64*5,QString::number(info->tube_number()));
 
 
         print(image);
         print(image);
-
-        image.save(path+"\\rukudan\\code"+bar+".bmp");
+if(save)
+        image.save(path+"/rukudan/code"+bar+".bmp");
 
 
     return image;
     return image;
 }
 }
@@ -210,22 +224,24 @@ QImage DanJuMuBan::mapPrintPackInfo(QMap<QString, QString> product, QStringList
     }
     }
 
 
     painter.drawText(15*5,64*5,QString::number(details.size()));
     painter.drawText(15*5,64*5,QString::number(details.size()));
-    painter.drawText(48*5,64*5,QString("%1 kg").arg(product.value("net_widget").toDouble() / 1000.00));
+    painter.drawText(48*5,64*5,QString("%1 kg").arg(getDecimalbit(product.value("net_widget").toDouble() / 1000.00)));
     painter.drawText(78*5,64*5,product.value("tube_number"));
     painter.drawText(78*5,64*5,product.value("tube_number"));
 
 
         print(image);
         print(image);
-
-        image.save(path+"\\rukudan\\code"+bar+".bmp");
+if(save)
+        image.save(path+"/rukudan/code"+bar+".bmp");
 
 
     return image;
     return image;
 }
 }
 
 
 void DanJuMuBan::print(QImage image)
 void DanJuMuBan::print(QImage image)
 {
 {
+    auto name = GlobalInfo::this_()->config().printerName;
+    QLogInfo(log) << "printer " << name;
         QPrinter printer(QPrinterInfo::printerInfo(GlobalInfo::this_()->config().printerName));
         QPrinter printer(QPrinterInfo::printerInfo(GlobalInfo::this_()->config().printerName));
         printer.setPageSize(QPrinter::Custom);
         printer.setPageSize(QPrinter::Custom);
         printer.setPageSizeMM(QSizeF(100,70));
         printer.setPageSizeMM(QSizeF(100,70));
-        printer.newPage();
+
 //        printer.setPrinterName();
 //        printer.setPrinterName();
         QPainter painter(&printer);                         // 创建一个QPainter对象,并指定绘图设备为一个QPainter对象
         QPainter painter(&printer);                         // 创建一个QPainter对象,并指定绘图设备为一个QPainter对象
         QRect rect =painter.viewport();                     // 获得QPainter对象的视图矩形区域
         QRect rect =painter.viewport();                     // 获得QPainter对象的视图矩形区域
@@ -235,6 +251,9 @@ void DanJuMuBan::print(QImage image)
         painter.setViewport(rect.x(),rect.y(),size.width()+50,size.height());
         painter.setViewport(rect.x(),rect.y(),size.width()+50,size.height());
         painter.setWindow(image.rect());                      // 设置QPainter窗口大小为图像的大小
         painter.setWindow(image.rect());                      // 设置QPainter窗口大小为图像的大小
         painter.drawImage(0,0,image);                         // 打印图像
         painter.drawImage(0,0,image);                         // 打印图像
+        painter.end();
+        auto ed = printer.newPage();
+        QLogInfo(log) << "printer  newPage:" << ed;
 //        printer
 //        printer
 //    }
 //    }
 }
 }

+ 3 - 0
handle/danjumuban.h

@@ -8,6 +8,7 @@
 #include <QList>
 #include <QList>
 #include "QPrintDialog"
 #include "QPrintDialog"
 #include "packinfo.h"
 #include "packinfo.h"
+#include <QLog/qlog.h>
 
 
 class DanJuMuBan
 class DanJuMuBan
 {
 {
@@ -42,6 +43,8 @@ private:
 //    QString company = "南通市华安袜业有限公司";
 //    QString company = "南通市华安袜业有限公司";
 //    QString telephone = "0513-88249588";
 //    QString telephone = "0513-88249588";
 //    QString fax = "0513-88249589";
 //    QString fax = "0513-88249589";
+    QLOG::QLog * log;
+    bool save;
 };
 };
 
 
 #endif // DANJUMUBAN_H
 #endif // DANJUMUBAN_H

+ 3 - 0
handle/rtuport.cpp

@@ -4,6 +4,7 @@ RtuPort::RtuPort()
 {
 {
     m_serialPort = new QSerialPort(this);
     m_serialPort = new QSerialPort(this);
     stard = false;
     stard = false;
+    _handle = nullptr;
     //设置参数
     //设置参数
 
 
 //    m_serialPort->setPortName(GlobalInfo::this_()->config().portName);
 //    m_serialPort->setPortName(GlobalInfo::this_()->config().portName);
@@ -27,11 +28,13 @@ void RtuPort::start(QString & name, int band, SerialBaseHandle * handle)
     if(m_serialPort->isOpen()) m_serialPort->close();
     if(m_serialPort->isOpen()) m_serialPort->close();
      m_serialPort->setPortName(name);
      m_serialPort->setPortName(name);
       m_serialPort->setBaudRate(band);
       m_serialPort->setBaudRate(band);
+      _handle = handle;
       m_serialPort->open(QIODevice::ReadWrite);
       m_serialPort->open(QIODevice::ReadWrite);
     if(!timer->isActive())
     if(!timer->isActive())
         timer->start(200);
         timer->start(200);
     stard = true;
     stard = true;
 
 
+
 }
 }
 
 
 void RtuPort::portWrite()
 void RtuPort::portWrite()

+ 9 - 9
handle/seriport/assictscalet2000.cpp

@@ -58,16 +58,16 @@ void AssicTScaleT2000::readData(QByteArray & data)
 {
 {
     QList<QByteArray> list = data.split(',');
     QList<QByteArray> list = data.split(',');
     auto buff = list.last();
     auto buff = list.last();
-    const char * from = buff.constData();
-    const char *to = from + buff.size();
-    const char *inner;
-    QDInfo << data ;
+//    QDInfo << data ;
     // Token is a sequence of numbers.
     // Token is a sequence of numbers.
-    for (inner = from; inner != to; ++inner)
-        if (*inner != '.' && (*inner < '0' || *inner > '9'))
-            break;
-    if (from != inner) {
-        double token = QByteArray(from, inner - from).toDouble();
+    QByteArray dt;
+    for (int i = 0; i < buff.size(); ++i){
+        auto ch = buff.at(i);
+        if (ch == '.' || ch == '-' || (ch >= '0' && ch <= '9'))
+            dt.append(ch);
+    }
+    if (!dt.isEmpty()) {
+        double token = dt.toDouble();
         scaledata _scaledata;
         scaledata _scaledata;
         _scaledata.gross_widget = token;
         _scaledata.gross_widget = token;
         GlobalInfo::this_()->SetScaleData(_scaledata);
         GlobalInfo::this_()->SetScaleData(_scaledata);

+ 40 - 0
handle/utils/cachefile.cpp

@@ -32,3 +32,43 @@ QByteArray CacheFile::readFile(const QString & name)
     }
     }
     return dt;
     return dt;
 }
 }
+
+
+QString getDecimalbit(double v,int i)
+{
+    QString tmp;
+    switch(i)
+    {
+    case 0 :
+       tmp.sprintf("%.0lf",v);
+        break;
+    case 1:
+        tmp.sprintf("%.1lf",v);
+         break;
+    case 2:
+        tmp.sprintf("%.2lf",v);
+         break;
+    case 3:
+        tmp.sprintf("%.3lf",v);
+         break;
+    case 4:
+        tmp.sprintf("%.4lf",v);
+         break;
+    case 5:
+        tmp.sprintf("%.5lf",v);
+         break;
+    case 6:
+        tmp.sprintf("%.6lf",v);
+         break;
+    case 7:
+        tmp.sprintf("%.7lf",v);
+         break;
+    case 8:
+        tmp.sprintf("%.8lf",v);
+         break;
+    default:
+        tmp.sprintf("%.9lf",v);
+         break;
+    }
+    return tmp;
+}

+ 2 - 0
handle/utils/cachefile.h

@@ -15,4 +15,6 @@ private:
     QDir dir;
     QDir dir;
 };
 };
 
 
+QString getDecimalbit(double v,int i = 2);
+
 #endif // CACHEFILE_H
 #endif // CACHEFILE_H

+ 1 - 0
main.cpp

@@ -6,6 +6,7 @@
 int main(int argc, char *argv[])
 int main(int argc, char *argv[])
 {
 {
     QApplication a(argc, argv);
     QApplication a(argc, argv);
+    QLOG::QLogManger::this_()->setSaveFilePath("D:/logs/");
     auto qtlog = QLOG::QLogManger::this_()->qDebugLog();
     auto qtlog = QLOG::QLogManger::this_()->qDebugLog();
     qtlog->setOutState(QLOG::File);
     qtlog->setOutState(QLOG::File);
     auto log = QLOG::QLogManger::this_()->baseLog();
     auto log = QLOG::QLogManger::this_()->baseLog();

+ 2 - 2
mainwindow.ui

@@ -7,7 +7,7 @@
     <x>0</x>
     <x>0</x>
     <y>0</y>
     <y>0</y>
     <width>896</width>
     <width>896</width>
-    <height>575</height>
+    <height>579</height>
    </rect>
    </rect>
   </property>
   </property>
   <property name="windowTitle">
   <property name="windowTitle">
@@ -33,7 +33,7 @@
     <item>
     <item>
      <widget class="QStackedWidget" name="stackedWidget">
      <widget class="QStackedWidget" name="stackedWidget">
       <property name="currentIndex">
       <property name="currentIndex">
-       <number>3</number>
+       <number>0</number>
       </property>
       </property>
       <widget class="QWidget" name="pageMain">
       <widget class="QWidget" name="pageMain">
        <layout class="QHBoxLayout" name="horizontalLayout_2">
        <layout class="QHBoxLayout" name="horizontalLayout_2">

+ 44 - 24
widget/autopackform.cpp

@@ -3,6 +3,7 @@
 #include "globalinfo.h"
 #include "globalinfo.h"
 #include <QMessageBox>
 #include <QMessageBox>
 #include <QTimer>
 #include <QTimer>
+#include "handle/utils/cachefile.h"
 
 
 AutoPackForm::AutoPackForm(QWidget *parent) :
 AutoPackForm::AutoPackForm(QWidget *parent) :
     QWidget(parent),
     QWidget(parent),
@@ -15,7 +16,16 @@ AutoPackForm::AutoPackForm(QWidget *parent) :
     ui->addBoxList->setDisabled(true);
     ui->addBoxList->setDisabled(true);
     ui->addPackList->setDisabled(true);
     ui->addPackList->setDisabled(true);
     netNum = 0.00;
     netNum = 0.00;
-    ui->widgetTotle->hide();
+    connect(&packConfig,&RemotePackConfig::configUpdate,this,&AutoPackForm::upconfig);
+    connect(&packConfig,&RemotePackConfig::dengJIConfigUp,this,&AutoPackForm::upDengjiInfo);
+//    ui->widgetTotle->hide();
+    CacheFile f;
+    auto dt = f.readFile("autodingzhongInfo.cache");
+    auto list = QString::fromUtf8(dt).split("[,]");
+    if(list.size() == 2){
+        ui->taitou->setText(list.at(0));
+        ui->taiPhone->setText(list.at(1));
+    }
 }
 }
 
 
 AutoPackForm::~AutoPackForm()
 AutoPackForm::~AutoPackForm()
@@ -44,21 +54,25 @@ void AutoPackForm::init()
     ui->addPackList->setDisabled(true);
     ui->addPackList->setDisabled(true);
     ui->widget->setEnabled(true);
     ui->widget->setEnabled(true);
     packConfig.refConfig();
     packConfig.refConfig();
-    connect(&packConfig,&RemotePackConfig::configUpdate,this,&AutoPackForm::upconfig);
-    connect(&packConfig,&RemotePackConfig::dengJIConfigUp,this,&AutoPackForm::upDengjiInfo);
     ui->comboBox->clear();
     ui->comboBox->clear();
     for(int i = 1;i<=20;i++){
     for(int i = 1;i<=20;i++){
         ui->comboBox->addItem(QString::number(i));
         ui->comboBox->addItem(QString::number(i));
     }
     }
     ui->comboBox->setCurrentText("20");
     ui->comboBox->setCurrentText("20");
-    on_addPackList_clicked();
+//    on_addPackList_clicked();
 }
 }
 
 
 void AutoPackForm::on_pushBack_clicked()
 void AutoPackForm::on_pushBack_clicked()
 {
 {
-    aputils.insertProductSQL(packinfo);
-    aputils.doSend(aputils.toJson(packinfo));
+    if(!packinfo.isNull()){
+        aputils.insertProductSQL(packinfo);
+        aputils.doSend(aputils.toJson(packinfo));
+    }
     emit back();
     emit back();
+    QStringList list;
+    list << ui->taitou->text() <<  ui->taiPhone->text();
+    CacheFile f;
+    f.writeFile("autodingzhongInfo.cache",list.join("[,]").toUtf8());
 }
 }
 
 
 void AutoPackForm::on_addPackList_clicked()
 void AutoPackForm::on_addPackList_clicked()
@@ -82,15 +96,12 @@ void AutoPackForm::on_addPackList_clicked()
 
 
     //发送码单 packinfo 数据, 转换为 json数据发送
     //发送码单 packinfo 数据, 转换为 json数据发送
     aputils.doSend(aputils.toJson(packinfo));
     aputils.doSend(aputils.toJson(packinfo));
-    //TODO: 初始化码单信息
-    packinfo.reset(new PackInfo(_info));
-    packinfo->operator_id = GlobalInfo::this_()->user().userId;
-    packinfo->packing_time = QDate::currentDate().toString("yy-MM-dd");
-    packinfo->packing_type = _info.category;
 }
 }
 
 
 void AutoPackForm::on_pushStart_clicked()
 void AutoPackForm::on_pushStart_clicked()
 {
 {
+    _info.customer = ui->taitou->text();
+    _info.telephone = ui->taiPhone->text();
     if(ui->pushStart->isChecked()){
     if(ui->pushStart->isChecked()){
         ui->pushStart->setChecked(true);
         ui->pushStart->setChecked(true);
         ui->addBoxList->setDisabled(false);
         ui->addBoxList->setDisabled(false);
@@ -112,7 +123,20 @@ void AutoPackForm::on_addBoxList_clicked()
             QMessageBox::information(this,tr("注意"),tr("打包数据异常"));
             QMessageBox::information(this,tr("注意"),tr("打包数据异常"));
             return;
             return;
         }
         }
-    if(packinfo.isNull()) return;
+        //当当前箱数大于等于最大箱数是启动on_addPackList_clicked();
+        if(packinfo->boxes().size()>=ui->comboBox->currentText().toInt()){
+    //        djmb.printPackInfo(packinfo->codeSingle(),packinfo);
+            on_addPackList_clicked();
+    //        qDebug()<<"这里";
+        }
+    if(packinfo.isNull()){
+        packinfo.reset(new PackInfo(_info));
+        packinfo->operator_id = GlobalInfo::this_()->user().userId;
+        packinfo->packing_time = QDate::currentDate().toString("yy-MM-dd");
+        packinfo->packing_type = _info.category;
+        ui->tableWidget->clearContents();
+        ui->tableWidget->setRowCount(0);
+    }
     auto box = packinfo->addBoxInfo();
     auto box = packinfo->addBoxInfo();
     //TODO: 添加箱单 数据
     //TODO: 添加箱单 数据
     box->box_weight = int(ui->pizhong->currentText().toDouble()*1000);
     box->box_weight = int(ui->pizhong->currentText().toDouble()*1000);
@@ -130,9 +154,10 @@ void AutoPackForm::on_addBoxList_clicked()
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,0,new QTableWidgetItem(QString::number(ui->tableWidget->rowCount())));
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,0,new QTableWidgetItem(QString::number(ui->tableWidget->rowCount())));
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,1,new QTableWidgetItem(box->caseNumber()));
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,1,new QTableWidgetItem(box->caseNumber()));
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,2,new QTableWidgetItem(QString::number(box->tube_number)));
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,2,new QTableWidgetItem(QString::number(box->tube_number)));
-    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,3,new QTableWidgetItem(QString::number(box->gross_weight)));
-    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,4,new QTableWidgetItem(QString::number(box->bucket_weight)));
-    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,5,new QTableWidgetItem(QString::number(box->net_weight)));
+    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,3,new QTableWidgetItem((box->gross_weight / 1000.00)));
+    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,4,new QTableWidgetItem(QString::number(box->bucket_weight / 1000.00)));
+    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,5,new QTableWidgetItem(QString::number(box->net_weight / 1000.00)));
+
 
 
 
 
 //    emit djmbbox(djmb.printBoxInfo(box->caseNumber(),box));
 //    emit djmbbox(djmb.printBoxInfo(box->caseNumber(),box));
@@ -145,12 +170,10 @@ void AutoPackForm::on_addBoxList_clicked()
     //添加数据库
     //添加数据库
     aputils.insertDetailsSQL(box,packinfo->codeSingle());
     aputils.insertDetailsSQL(box,packinfo->codeSingle());
 
 
-    //当当前箱数大于等于最大箱数是启动on_addPackList_clicked();
-    if(packinfo->boxes().size()>=ui->comboBox->currentText().toInt()){
-//        emit djmbbox(djmb.printPackInfo(packinfo->codeSingle(),packinfo));
-        on_addPackList_clicked();
-//        qDebug()<<"这里";
-    }
+    ui->labelTongZHong->setText(QString::number(packinfo->tube_number()));
+    ui->labelWight->setText(getDecimalbit(packinfo->gross_weight() / 1000.00));
+    ui->labelJing->setText(getDecimalbit(packinfo->net_weight() / 1000.00));
+
 }
 }
 
 
 void AutoPackForm::upconfig(const DaBaoConfig &config)
 void AutoPackForm::upconfig(const DaBaoConfig &config)
@@ -205,7 +228,4 @@ void AutoPackForm::on_handleRead_clicked()
     scaleData();
     scaleData();
 }
 }
 
 
-void AutoPackForm::on_pushSync_clicked()
-{
 
 
-}

+ 0 - 2
widget/autopackform.h

@@ -55,8 +55,6 @@ private slots:
 
 
     void on_handleRead_clicked();
     void on_handleRead_clicked();
 
 
-    void on_pushSync_clicked();
-
 private:
 private:
     Ui::AutoPackForm *ui;
     Ui::AutoPackForm *ui;
     ProjectInfo _info;
     ProjectInfo _info;

+ 14 - 18
widget/autopackform.ui

@@ -331,44 +331,37 @@ color: rgb(0, 170, 255);</string>
          </widget>
          </widget>
         </item>
         </item>
         <item>
         <item>
-         <widget class="QLabel" name="label_17">
+         <widget class="QLabel" name="labelTongZHong">
           <property name="text">
           <property name="text">
-           <string>毛重:</string>
+           <string>0</string>
           </property>
           </property>
          </widget>
          </widget>
         </item>
         </item>
         <item>
         <item>
-         <widget class="QLabel" name="label_18">
-          <property name="text">
-           <string>净重:</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QPushButton" name="pushButton_16">
+         <widget class="QLabel" name="label_17">
           <property name="text">
           <property name="text">
-           <string>未同步列表</string>
+           <string>毛重:</string>
           </property>
           </property>
          </widget>
          </widget>
         </item>
         </item>
         <item>
         <item>
-         <widget class="QPushButton" name="pushSync">
+         <widget class="QLabel" name="labelWight">
           <property name="text">
           <property name="text">
-           <string>同步</string>
+           <string>0</string>
           </property>
           </property>
          </widget>
          </widget>
         </item>
         </item>
         <item>
         <item>
-         <widget class="QPushButton" name="pushButton_18">
+         <widget class="QLabel" name="label_18">
           <property name="text">
           <property name="text">
-           <string>接续</string>
+           <string>净重:</string>
           </property>
           </property>
          </widget>
          </widget>
         </item>
         </item>
         <item>
         <item>
-         <widget class="QPushButton" name="pushButton_19">
+         <widget class="QLabel" name="labelJing">
           <property name="text">
           <property name="text">
-           <string>批量修改</string>
+           <string>0</string>
           </property>
           </property>
          </widget>
          </widget>
         </item>
         </item>
@@ -463,6 +456,9 @@ color: rgb(0, 170, 255);</string>
             </item>
             </item>
             <item>
             <item>
              <widget class="QComboBox" name="comboBox">
              <widget class="QComboBox" name="comboBox">
+              <property name="editable">
+               <bool>true</bool>
+              </property>
               <property name="currentText">
               <property name="currentText">
                <string/>
                <string/>
               </property>
               </property>
@@ -772,7 +768,7 @@ color: rgb(0, 170, 255);</string>
              </widget>
              </widget>
             </item>
             </item>
             <item>
             <item>
-             <widget class="QLineEdit" name="taitou_2"/>
+             <widget class="QLineEdit" name="taiPhone"/>
             </item>
             </item>
             <item>
             <item>
              <spacer name="verticalSpacer_2">
              <spacer name="verticalSpacer_2">

+ 56 - 17
widget/fixedweightpackform.cpp

@@ -1,5 +1,6 @@
-#include "fixedweightpackform.h"
+#include "fixedweightpackform.h"
 #include "ui_fixedweightpackform.h"
 #include "ui_fixedweightpackform.h"
+#include "handle/utils/cachefile.h"
 
 
 FixedWeightPackForm::FixedWeightPackForm(QWidget *parent) :
 FixedWeightPackForm::FixedWeightPackForm(QWidget *parent) :
     QWidget(parent),
     QWidget(parent),
@@ -9,6 +10,15 @@ FixedWeightPackForm::FixedWeightPackForm(QWidget *parent) :
     QTimer *timer = new QTimer(this);
     QTimer *timer = new QTimer(this);
     connect(timer,&QTimer::timeout,this,&FixedWeightPackForm::calcData);
     connect(timer,&QTimer::timeout,this,&FixedWeightPackForm::calcData);
     timer->start(500);
     timer->start(500);
+    connect(&packConfig,&RemotePackConfig::configUpdate,this,&FixedWeightPackForm::upconfig);
+    connect(&packConfig,&RemotePackConfig::dengJIConfigUp,this,&FixedWeightPackForm::upDengjiInfo);
+    CacheFile f;
+    auto dt = f.readFile("dingzhongInfo.cache");
+    auto list = QString::fromUtf8(dt).split("[,]");
+    if(list.size() == 2){
+        ui->taitou->setText(list.at(0));
+        ui->taiPhone->setText(list.at(1));
+    }
 }
 }
 
 
 FixedWeightPackForm::~FixedWeightPackForm()
 FixedWeightPackForm::~FixedWeightPackForm()
@@ -19,7 +29,8 @@ FixedWeightPackForm::~FixedWeightPackForm()
 //从秤中获取毛重、皮重、净重、筒数------每100毫秒一次
 //从秤中获取毛重、皮重、净重、筒数------每100毫秒一次
 void FixedWeightPackForm::calcData()
 void FixedWeightPackForm::calcData()
 {
 {
-    ui->grossWeight_2->setText(ui->type->currentText());
+    ui->grossWeight_2->setText(QString::number(GlobalInfo::this_()->GetScaleData().gross_widget));
+//    ui->grossWeight_2->setText(ui->type->currentText());
     netNum = ui->grossWeight_2->text().toDouble()-ui->pizhong->currentText().toDouble()-ui->tongshu->text().toDouble()*ui->tongzhong->currentText().toDouble();
     netNum = ui->grossWeight_2->text().toDouble()-ui->pizhong->currentText().toDouble()-ui->tongshu->text().toDouble()*ui->tongzhong->currentText().toDouble();
     if(netNum<0){
     if(netNum<0){
         netNum = 0.00;
         netNum = 0.00;
@@ -31,13 +42,22 @@ void FixedWeightPackForm::calcData()
 
 
 void FixedWeightPackForm::on_pushBack_clicked()
 void FixedWeightPackForm::on_pushBack_clicked()
 {
 {
+    if(!packinfo.isNull()){
+        aputils.insertProductSQL(packinfo);
+        aputils.doSend(aputils.toJson(packinfo));
+    }
     emit back();
     emit back();
+    QStringList list;
+    list << ui->taitou->text() <<  ui->taiPhone->text();
+    CacheFile f;
+    f.writeFile("dingzhongInfo.cache",list.join("[,]").toUtf8());
+
 }
 }
 
 
 void FixedWeightPackForm::on_addPackList_clicked()
 void FixedWeightPackForm::on_addPackList_clicked()
 {
 {
 
 
-
+    if(packinfo.isNull()) return;
     if(!packinfo.isNull()&&packinfo->boxes().size()>0){
     if(!packinfo.isNull()&&packinfo->boxes().size()>0){
         packinfo->quantity = packinfo->boxes().size();
         packinfo->quantity = packinfo->boxes().size();
         packinfo->level_id = ui->dengji->currentData().toInt();
         packinfo->level_id = ui->dengji->currentData().toInt();
@@ -54,19 +74,20 @@ void FixedWeightPackForm::on_addPackList_clicked()
     //发送码单 packinfo 数据, 转换为 json数据发送
     //发送码单 packinfo 数据, 转换为 json数据发送
     aputils.doSend(aputils.toJson(packinfo));
     aputils.doSend(aputils.toJson(packinfo));
     //TODO: 初始化码单信息
     //TODO: 初始化码单信息
-    packinfo.reset(new PackInfo(_info));
-    packinfo->operator_id = GlobalInfo::this_()->user().userId;
-    packinfo->packing_time = QDate::currentDate().toString("yy-MM-dd");
-    packinfo->packing_type = _info.category;
+    packinfo.clear();
 }
 }
 
 
 void FixedWeightPackForm::on_pushStart_clicked()
 void FixedWeightPackForm::on_pushStart_clicked()
 {
 {
+    _info.customer = ui->taitou->text();
+    _info.telephone = ui->taiPhone->text();
+
     if(ui->pushStart->isChecked()){
     if(ui->pushStart->isChecked()){
         ui->pushStart->setChecked(true);
         ui->pushStart->setChecked(true);
         ui->addBoxList->setDisabled(false);
         ui->addBoxList->setDisabled(false);
         ui->addPackList->setDisabled(false);
         ui->addPackList->setDisabled(false);
         ui->widget_2->setEnabled(false);
         ui->widget_2->setEnabled(false);
+        ui->pushPiLiang->setDisabled(false);
     } else {
     } else {
         init();
         init();
     }
     }
@@ -74,7 +95,14 @@ void FixedWeightPackForm::on_pushStart_clicked()
 
 
 void FixedWeightPackForm::on_addBoxList_clicked()
 void FixedWeightPackForm::on_addBoxList_clicked()
 {
 {
-    if(packinfo.isNull()) return;
+    if(packinfo.isNull()){
+        packinfo.reset(new PackInfo(_info));
+        packinfo->operator_id = GlobalInfo::this_()->user().userId;
+        packinfo->packing_time = QDate::currentDate().toString("yy-MM-dd");
+        packinfo->packing_type = _info.category;
+        ui->tableWidget->clearContents();
+        ui->tableWidget->setRowCount(0);
+    }
     auto box = packinfo->addBoxInfo();
     auto box = packinfo->addBoxInfo();
 
 
     box->box_weight = int(ui->pizhong->currentText().toDouble()*1000);
     box->box_weight = int(ui->pizhong->currentText().toDouble()*1000);
@@ -91,10 +119,10 @@ void FixedWeightPackForm::on_addBoxList_clicked()
     ui->tableWidget->setRowCount(ui->tableWidget->rowCount()+1);
     ui->tableWidget->setRowCount(ui->tableWidget->rowCount()+1);
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,0,new QTableWidgetItem(QString::number(ui->tableWidget->rowCount())));
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,0,new QTableWidgetItem(QString::number(ui->tableWidget->rowCount())));
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,1,new QTableWidgetItem(box->caseNumber()));
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,1,new QTableWidgetItem(box->caseNumber()));
-    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,2,new QTableWidgetItem(QString::number(box->tube_number)));
-    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,3,new QTableWidgetItem(QString::number(box->gross_weight)));
-    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,4,new QTableWidgetItem(QString::number(box->bucket_weight)));
-    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,5,new QTableWidgetItem(QString::number(box->net_weight)));
+    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,2,new QTableWidgetItem(getDecimalbit(box->tube_number / 1000.00)));
+    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,3,new QTableWidgetItem(getDecimalbit(box->gross_weight / 1000.00)));
+    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,4,new QTableWidgetItem(getDecimalbit(box->bucket_weight / 1000.00)));
+    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,5,new QTableWidgetItem(getDecimalbit(box->net_weight / 1000.00)));
 
 
 
 
 //    emit djmbbox(djmb.printBoxInfo(box->caseNumber(),box));
 //    emit djmbbox(djmb.printBoxInfo(box->caseNumber(),box));
@@ -106,11 +134,13 @@ void FixedWeightPackForm::on_addBoxList_clicked()
 
 
     //添加数据库
     //添加数据库
     aputils.insertDetailsSQL(box,packinfo->codeSingle());
     aputils.insertDetailsSQL(box,packinfo->codeSingle());
+    ui->labelTongZHong->setText(QString::number(packinfo->tube_number()));
+    ui->labelWight->setText(getDecimalbit(packinfo->gross_weight() / 1000.00));
+    ui->labelJing->setText(getDecimalbit(packinfo->net_weight() / 1000.00));
 
 
     //当当前箱数大于等于最大箱数是启动on_addPackList_clicked();
     //当当前箱数大于等于最大箱数是启动on_addPackList_clicked();
-    if(packinfo->boxes().size()>=ui->comboBox->currentText().toInt()){
+    if(packinfo->boxes().size() >= ui->comboBox->currentText().toInt()){
         on_addPackList_clicked();
         on_addPackList_clicked();
-
     }
     }
 }
 }
 
 
@@ -119,16 +149,15 @@ void FixedWeightPackForm::init()
     ui->pushStart->setChecked(false);
     ui->pushStart->setChecked(false);
     ui->addBoxList->setDisabled(true);
     ui->addBoxList->setDisabled(true);
     ui->addPackList->setDisabled(true);
     ui->addPackList->setDisabled(true);
+    ui->pushPiLiang->setDisabled(true);
     ui->widget_2->setEnabled(true);
     ui->widget_2->setEnabled(true);
     packConfig.refConfig();
     packConfig.refConfig();
-    connect(&packConfig,&RemotePackConfig::configUpdate,this,&FixedWeightPackForm::upconfig);
-    connect(&packConfig,&RemotePackConfig::dengJIConfigUp,this,&FixedWeightPackForm::upDengjiInfo);
     ui->comboBox->clear();
     ui->comboBox->clear();
     for(int i = 1;i<=20;i++){
     for(int i = 1;i<=20;i++){
         ui->comboBox->addItem(QString::number(i));
         ui->comboBox->addItem(QString::number(i));
     }
     }
     ui->comboBox->setCurrentText("20");
     ui->comboBox->setCurrentText("20");
-    on_addPackList_clicked();
+//    on_addPackList_clicked();
 }
 }
 
 
 void FixedWeightPackForm::upconfig(const DaBaoConfig &config)
 void FixedWeightPackForm::upconfig(const DaBaoConfig &config)
@@ -181,3 +210,13 @@ void FixedWeightPackForm::upDengjiInfo(const QList<DengJiConfigItem> & dengJis)
     }
     }
 }
 }
 
 
+
+void FixedWeightPackForm::on_pushPiLiang_clicked()
+{
+    int tsize = 0;
+    if(!packinfo.isNull()) tsize = packinfo->boxes().size();
+    auto size = ui->comboBox->currentText().toInt() - tsize;
+    for(int i = 0; i < size; ++i){
+        on_addBoxList_clicked();
+    }
+}

+ 2 - 0
widget/fixedweightpackform.h

@@ -35,6 +35,8 @@ private slots:
 
 
     void calcData();
     void calcData();
 
 
+    void on_pushPiLiang_clicked();
+
 public slots:
 public slots:
     void upconfig(const DaBaoConfig & config);
     void upconfig(const DaBaoConfig & config);
     void upDengjiInfo(const QList<DengJiConfigItem> & dengJis);
     void upDengjiInfo(const QList<DengJiConfigItem> & dengJis);

+ 534 - 480
widget/fixedweightpackform.ui

@@ -6,15 +6,15 @@
    <rect>
    <rect>
     <x>0</x>
     <x>0</x>
     <y>0</y>
     <y>0</y>
-    <width>1085</width>
-    <height>619</height>
+    <width>1094</width>
+    <height>668</height>
    </rect>
    </rect>
   </property>
   </property>
   <property name="windowTitle">
   <property name="windowTitle">
    <string>Form</string>
    <string>Form</string>
   </property>
   </property>
-  <layout class="QGridLayout" name="gridLayout_3">
-   <item row="0" column="0" colspan="2">
+  <layout class="QVBoxLayout" name="verticalLayout_16">
+   <item>
     <widget class="QWidget" name="widget" native="true">
     <widget class="QWidget" name="widget" native="true">
      <property name="minimumSize">
      <property name="minimumSize">
       <size>
       <size>
@@ -72,577 +72,631 @@
      </layout>
      </layout>
     </widget>
     </widget>
    </item>
    </item>
-   <item row="1" column="0">
-    <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_6">
      <item>
      <item>
-      <layout class="QHBoxLayout" name="horizontalLayout">
-       <item>
-        <widget class="QLabel" name="label">
-         <property name="text">
-          <string>合计</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_2">
-         <property name="text">
-          <string>筒数:</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_5">
-         <property name="text">
-          <string>0</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_3">
-         <property name="text">
-          <string>毛重:</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_6">
-         <property name="text">
-          <string>0</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_4">
-         <property name="text">
-          <string>净重:</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_7">
-         <property name="text">
-          <string>0</string>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </item>
-     <item>
-      <widget class="QTableWidget" name="tableWidget">
-       <property name="minimumSize">
-        <size>
-         <width>562</width>
-         <height>0</height>
-        </size>
-       </property>
-       <property name="maximumSize">
-        <size>
-         <width>9999</width>
-         <height>16777215</height>
-        </size>
-       </property>
-       <column>
-        <property name="text">
-         <string>序号</string>
-        </property>
-       </column>
-       <column>
-        <property name="text">
-         <string>箱号</string>
-        </property>
-       </column>
-       <column>
-        <property name="text">
-         <string>筒数</string>
-        </property>
-       </column>
-       <column>
-        <property name="text">
-         <string>毛重</string>
-        </property>
-       </column>
-       <column>
-        <property name="text">
-         <string>皮重</string>
-        </property>
-       </column>
-       <column>
-        <property name="text">
-         <string>净重</string>
-        </property>
-       </column>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item row="1" column="1">
-    <layout class="QGridLayout" name="gridLayout_2">
-     <item row="0" column="0">
-      <widget class="QLabel" name="label_23">
-       <property name="minimumSize">
-        <size>
-         <width>41</width>
-         <height>16</height>
-        </size>
-       </property>
-       <property name="maximumSize">
-        <size>
-         <width>41</width>
-         <height>16</height>
-        </size>
-       </property>
-       <property name="text">
-        <string>毛重</string>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="1">
-      <widget class="QLineEdit" name="grossWeight_2">
-       <property name="minimumSize">
-        <size>
-         <width>141</width>
-         <height>61</height>
-        </size>
-       </property>
-       <property name="maximumSize">
-        <size>
-         <width>141</width>
-         <height>61</height>
-        </size>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>20</pointsize>
-        </font>
-       </property>
-       <property name="text">
-        <string>0</string>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="2" rowspan="2">
-      <layout class="QVBoxLayout" name="verticalLayout_2">
-       <item>
-        <widget class="QPushButton" name="pushStart">
-         <property name="minimumSize">
-          <size>
-           <width>0</width>
-           <height>50</height>
-          </size>
-         </property>
-         <property name="styleSheet">
-          <string notr="true">background-color: rgb(255, 255, 255);
-color: rgb(0, 170, 255);</string>
-         </property>
-         <property name="text">
-          <string>开始打包</string>
-         </property>
-         <property name="checkable">
-          <bool>true</bool>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" name="horizontalLayout_8">
-         <item>
-          <widget class="QPushButton" name="addBoxList">
-           <property name="enabled">
-            <bool>true</bool>
-           </property>
-           <property name="minimumSize">
-            <size>
-             <width>0</width>
-             <height>50</height>
-            </size>
-           </property>
-           <property name="styleSheet">
-            <string notr="true">background-color: rgb(255, 255, 255);
-color: rgb(0, 170, 255);</string>
+      <widget class="QWidget" name="widget_4" native="true">
+       <layout class="QVBoxLayout" name="verticalLayout">
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout">
+          <item>
+           <widget class="QLabel" name="label">
+            <property name="text">
+             <string>合计</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="label_2">
+            <property name="text">
+             <string>筒数:</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="labelTongZHong">
+            <property name="text">
+             <string>0</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="label_3">
+            <property name="text">
+             <string>毛重:</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="labelWight">
+            <property name="text">
+             <string>0</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="label_4">
+            <property name="text">
+             <string>净重:</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="labelJing">
+            <property name="text">
+             <string>0</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <widget class="QTableWidget" name="tableWidget">
+          <property name="minimumSize">
+           <size>
+            <width>562</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="maximumSize">
+           <size>
+            <width>9999</width>
+            <height>16777215</height>
+           </size>
+          </property>
+          <column>
+           <property name="text">
+            <string>序号</string>
            </property>
            </property>
+          </column>
+          <column>
            <property name="text">
            <property name="text">
-            <string>添加箱单</string>
+            <string>箱号</string>
            </property>
            </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="addPackList">
-           <property name="enabled">
-            <bool>true</bool>
+          </column>
+          <column>
+           <property name="text">
+            <string>筒数</string>
            </property>
            </property>
-           <property name="minimumSize">
-            <size>
-             <width>0</width>
-             <height>50</height>
-            </size>
+          </column>
+          <column>
+           <property name="text">
+            <string>毛重</string>
            </property>
            </property>
-           <property name="styleSheet">
-            <string notr="true">background-color: rgb(255, 255, 255);
-color: rgb(0, 170, 255);</string>
+          </column>
+          <column>
+           <property name="text">
+            <string>皮重</string>
            </property>
            </property>
+          </column>
+          <column>
            <property name="text">
            <property name="text">
-            <string>添加码单</string>
+            <string>净重</string>
            </property>
            </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </item>
-     <item row="1" column="0">
-      <widget class="QLabel" name="label_24">
-       <property name="minimumSize">
-        <size>
-         <width>31</width>
-         <height>16</height>
-        </size>
-       </property>
-       <property name="maximumSize">
-        <size>
-         <width>31</width>
-         <height>16</height>
-        </size>
-       </property>
-       <property name="text">
-        <string>筒数</string>
-       </property>
+          </column>
+         </widget>
+        </item>
+       </layout>
       </widget>
       </widget>
      </item>
      </item>
-     <item row="1" column="1">
-      <widget class="QLineEdit" name="tongshu">
+     <item>
+      <widget class="QWidget" name="widget_3" native="true">
        <property name="minimumSize">
        <property name="minimumSize">
         <size>
         <size>
-         <width>141</width>
-         <height>61</height>
+         <width>500</width>
+         <height>0</height>
         </size>
         </size>
        </property>
        </property>
        <property name="maximumSize">
        <property name="maximumSize">
         <size>
         <size>
-         <width>141</width>
-         <height>61</height>
-        </size>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>20</pointsize>
-        </font>
-       </property>
-       <property name="text">
-        <string>0</string>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="0" colspan="3">
-      <widget class="QWidget" name="widget_2" native="true">
-       <property name="minimumSize">
-        <size>
-         <width>450</width>
-         <height>402</height>
+         <width>500</width>
+         <height>16777215</height>
         </size>
         </size>
        </property>
        </property>
-       <layout class="QGridLayout" name="gridLayout">
-        <property name="leftMargin">
-         <number>0</number>
-        </property>
-        <property name="rightMargin">
-         <number>0</number>
-        </property>
-        <item row="0" column="0">
-         <layout class="QHBoxLayout" name="horizontalLayout_2">
-          <item>
-           <layout class="QVBoxLayout" name="verticalLayout_3">
-            <item>
-             <widget class="QLabel" name="label_25">
-              <property name="text">
-               <string>包装类型</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QComboBox" name="type"/>
-            </item>
-           </layout>
-          </item>
+       <layout class="QVBoxLayout" name="verticalLayout_2">
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_4">
           <item>
           <item>
-           <layout class="QVBoxLayout" name="verticalLayout_4">
-            <item>
-             <widget class="QLabel" name="label_8">
-              <property name="text">
-               <string>码数</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QComboBox" name="comboBox">
-              <property name="currentText">
-               <string/>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <layout class="QHBoxLayout" name="horizontalLayout_7">
-            <property name="spacing">
-             <number>0</number>
+           <widget class="QLabel" name="label_23">
+            <property name="minimumSize">
+             <size>
+              <width>41</width>
+              <height>16</height>
+             </size>
             </property>
             </property>
-           </layout>
-          </item>
-         </layout>
-        </item>
-        <item row="1" column="0">
-         <layout class="QHBoxLayout" name="horizontalLayout_11">
-          <item>
-           <widget class="QCheckBox" name="xiangdanPrint">
-            <property name="text">
-             <string>打印箱单</string>
+            <property name="maximumSize">
+             <size>
+              <width>41</width>
+              <height>16</height>
+             </size>
             </property>
             </property>
-            <property name="checked">
-             <bool>true</bool>
+            <property name="text">
+             <string>毛重</string>
             </property>
             </property>
            </widget>
            </widget>
           </item>
           </item>
           <item>
           <item>
-           <widget class="QCheckBox" name="madanPrint">
-            <property name="text">
-             <string>打印码单</string>
+           <widget class="QLineEdit" name="grossWeight_2">
+            <property name="minimumSize">
+             <size>
+              <width>141</width>
+              <height>61</height>
+             </size>
             </property>
             </property>
-            <property name="checked">
-             <bool>true</bool>
+            <property name="maximumSize">
+             <size>
+              <width>141</width>
+              <height>61</height>
+             </size>
             </property>
             </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QCheckBox" name="showMaoZhong">
-            <property name="text">
-             <string>显示毛重</string>
+            <property name="font">
+             <font>
+              <pointsize>20</pointsize>
+             </font>
             </property>
             </property>
-            <property name="checked">
-             <bool>true</bool>
+            <property name="text">
+             <string>0</string>
             </property>
             </property>
            </widget>
            </widget>
           </item>
           </item>
-         </layout>
-        </item>
-        <item row="2" column="0">
-         <layout class="QHBoxLayout" name="horizontalLayout_13">
           <item>
           <item>
-           <layout class="QVBoxLayout" name="verticalLayout_5">
+           <layout class="QHBoxLayout" name="horizontalLayout_3">
             <item>
             <item>
-             <widget class="QLabel" name="label_9">
-              <property name="text">
-               <string>打包班次</string>
+             <widget class="QPushButton" name="pushStart">
+              <property name="minimumSize">
+               <size>
+                <width>0</width>
+                <height>50</height>
+               </size>
               </property>
               </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QComboBox" name="comboBox_2"/>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <layout class="QVBoxLayout" name="verticalLayout_6">
-            <item>
-             <widget class="QLabel" name="label_10">
-              <property name="text">
-               <string>机台</string>
+              <property name="styleSheet">
+               <string notr="true">background-color: rgb(255, 255, 255);
+color: rgb(0, 170, 255);</string>
               </property>
               </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QComboBox" name="jitai"/>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <layout class="QVBoxLayout" name="verticalLayout_7">
-            <item>
-             <widget class="QLabel" name="label_11">
               <property name="text">
               <property name="text">
-               <string>等级</string>
+               <string>开始打包</string>
+              </property>
+              <property name="checkable">
+               <bool>true</bool>
               </property>
               </property>
              </widget>
              </widget>
             </item>
             </item>
             <item>
             <item>
-             <widget class="QComboBox" name="dengji"/>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <layout class="QVBoxLayout" name="verticalLayout_8">
-            <item>
-             <widget class="QLabel" name="label_12">
+             <widget class="QPushButton" name="pushPiLiang">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="minimumSize">
+               <size>
+                <width>0</width>
+                <height>50</height>
+               </size>
+              </property>
+              <property name="styleSheet">
+               <string notr="true">background-color: rgb(255, 255, 255);
+color: rgb(0, 170, 255);</string>
+              </property>
               <property name="text">
               <property name="text">
-               <string>皮重</string>
+               <string>批量添加</string>
               </property>
               </property>
              </widget>
              </widget>
             </item>
             </item>
-            <item>
-             <widget class="QComboBox" name="pizhong"/>
-            </item>
            </layout>
            </layout>
           </item>
           </item>
          </layout>
          </layout>
         </item>
         </item>
-        <item row="3" column="0">
-         <layout class="QHBoxLayout" name="horizontalLayout_14">
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_5">
           <item>
           <item>
-           <layout class="QVBoxLayout" name="verticalLayout_9">
-            <item>
-             <widget class="QLabel" name="label_13">
-              <property name="text">
-               <string>管色</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QComboBox" name="guanse"/>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <layout class="QVBoxLayout" name="verticalLayout_10">
-            <item>
-             <widget class="QLabel" name="label_14">
-              <property name="text">
-               <string>捻向</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QComboBox" name="nianxiang"/>
-            </item>
-           </layout>
+           <widget class="QLabel" name="label_24">
+            <property name="minimumSize">
+             <size>
+              <width>31</width>
+              <height>16</height>
+             </size>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>31</width>
+              <height>16</height>
+             </size>
+            </property>
+            <property name="text">
+             <string>筒数</string>
+            </property>
+           </widget>
           </item>
           </item>
           <item>
           <item>
-           <layout class="QVBoxLayout" name="verticalLayout_11">
-            <item>
-             <widget class="QLabel" name="label_15">
-              <property name="text">
-               <string>纸箱</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QComboBox" name="zhixiang"/>
-            </item>
-           </layout>
+           <widget class="QLineEdit" name="tongshu">
+            <property name="minimumSize">
+             <size>
+              <width>141</width>
+              <height>61</height>
+             </size>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>141</width>
+              <height>61</height>
+             </size>
+            </property>
+            <property name="font">
+             <font>
+              <pointsize>20</pointsize>
+             </font>
+            </property>
+            <property name="text">
+             <string>0</string>
+            </property>
+           </widget>
           </item>
           </item>
           <item>
           <item>
-           <layout class="QVBoxLayout" name="verticalLayout_12">
+           <layout class="QHBoxLayout" name="horizontalLayout_8">
             <item>
             <item>
-             <widget class="QLabel" name="label_21">
-              <property name="text">
-               <string>筒重</string>
+             <widget class="QPushButton" name="addBoxList">
+              <property name="enabled">
+               <bool>true</bool>
               </property>
               </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QComboBox" name="tongzhong"/>
-            </item>
-           </layout>
-          </item>
-         </layout>
-        </item>
-        <item row="4" column="0">
-         <layout class="QHBoxLayout" name="horizontalLayout_12">
-          <item>
-           <layout class="QVBoxLayout" name="verticalLayout_13">
-            <item>
-             <widget class="QLabel" name="label_16">
-              <property name="text">
-               <string>码单</string>
+              <property name="minimumSize">
+               <size>
+                <width>0</width>
+                <height>50</height>
+               </size>
               </property>
               </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QComboBox" name="madan">
-              <property name="enabled">
-               <bool>false</bool>
+              <property name="styleSheet">
+               <string notr="true">background-color: rgb(255, 255, 255);
+color: rgb(0, 170, 255);</string>
               </property>
               </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QLabel" name="label_17">
               <property name="text">
               <property name="text">
-               <string>箱单</string>
+               <string>添加箱单</string>
               </property>
               </property>
              </widget>
              </widget>
             </item>
             </item>
             <item>
             <item>
-             <widget class="QComboBox" name="xiangdan">
+             <widget class="QPushButton" name="addPackList">
               <property name="enabled">
               <property name="enabled">
-               <bool>false</bool>
+               <bool>true</bool>
               </property>
               </property>
-             </widget>
-            </item>
-            <item>
-             <spacer name="verticalSpacer">
-              <property name="orientation">
-               <enum>Qt::Vertical</enum>
-              </property>
-              <property name="sizeHint" stdset="0">
+              <property name="minimumSize">
                <size>
                <size>
-                <width>20</width>
-                <height>40</height>
+                <width>0</width>
+                <height>50</height>
                </size>
                </size>
               </property>
               </property>
-             </spacer>
+              <property name="styleSheet">
+               <string notr="true">background-color: rgb(255, 255, 255);
+color: rgb(0, 170, 255);</string>
+              </property>
+              <property name="text">
+               <string>添加码单</string>
+              </property>
+             </widget>
             </item>
             </item>
            </layout>
            </layout>
           </item>
           </item>
+         </layout>
+        </item>
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_2">
           <item>
           <item>
-           <layout class="QVBoxLayout" name="verticalLayout_14">
+           <layout class="QVBoxLayout" name="verticalLayout_3">
             <item>
             <item>
-             <widget class="QLabel" name="label_18">
+             <widget class="QLabel" name="label_25">
               <property name="text">
               <property name="text">
-               <string>箱单抬头</string>
+               <string>包装类型</string>
               </property>
               </property>
              </widget>
              </widget>
             </item>
             </item>
             <item>
             <item>
-             <widget class="QLineEdit" name="taitou"/>
+             <widget class="QComboBox" name="type"/>
             </item>
             </item>
+           </layout>
+          </item>
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_4">
             <item>
             <item>
-             <widget class="QLabel" name="label_22">
+             <widget class="QLabel" name="label_8">
               <property name="text">
               <property name="text">
-               <string>电话</string>
+               <string>码数</string>
               </property>
               </property>
              </widget>
              </widget>
             </item>
             </item>
             <item>
             <item>
-             <widget class="QLineEdit" name="taitou_2"/>
-            </item>
-            <item>
-             <spacer name="verticalSpacer_2">
-              <property name="orientation">
-               <enum>Qt::Vertical</enum>
+             <widget class="QComboBox" name="comboBox">
+              <property name="editable">
+               <bool>true</bool>
               </property>
               </property>
-              <property name="sizeHint" stdset="0">
-               <size>
-                <width>20</width>
-                <height>40</height>
-               </size>
+              <property name="currentText">
+               <string/>
               </property>
               </property>
-             </spacer>
+             </widget>
             </item>
             </item>
            </layout>
            </layout>
           </item>
           </item>
           <item>
           <item>
-           <layout class="QVBoxLayout" name="verticalLayout_15">
-            <item>
-             <widget class="QLabel" name="label_19">
-              <property name="text">
-               <string>备注</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QTextEdit" name="beizhu"/>
-            </item>
+           <layout class="QHBoxLayout" name="horizontalLayout_7">
+            <property name="spacing">
+             <number>0</number>
+            </property>
            </layout>
            </layout>
           </item>
           </item>
          </layout>
          </layout>
         </item>
         </item>
+        <item>
+         <widget class="QWidget" name="widget_2" native="true">
+          <property name="minimumSize">
+           <size>
+            <width>450</width>
+            <height>402</height>
+           </size>
+          </property>
+          <layout class="QGridLayout" name="gridLayout">
+           <property name="leftMargin">
+            <number>0</number>
+           </property>
+           <property name="rightMargin">
+            <number>0</number>
+           </property>
+           <item row="3" column="0">
+            <layout class="QHBoxLayout" name="horizontalLayout_12">
+             <item>
+              <layout class="QVBoxLayout" name="verticalLayout_13">
+               <item>
+                <widget class="QLabel" name="label_16">
+                 <property name="text">
+                  <string>码单</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QComboBox" name="madan">
+                 <property name="enabled">
+                  <bool>false</bool>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QLabel" name="label_17">
+                 <property name="text">
+                  <string>箱单</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QComboBox" name="xiangdan">
+                 <property name="enabled">
+                  <bool>false</bool>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <spacer name="verticalSpacer">
+                 <property name="orientation">
+                  <enum>Qt::Vertical</enum>
+                 </property>
+                 <property name="sizeHint" stdset="0">
+                  <size>
+                   <width>20</width>
+                   <height>40</height>
+                  </size>
+                 </property>
+                </spacer>
+               </item>
+              </layout>
+             </item>
+             <item>
+              <layout class="QVBoxLayout" name="verticalLayout_14">
+               <item>
+                <widget class="QLabel" name="label_18">
+                 <property name="text">
+                  <string>箱单抬头</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QLineEdit" name="taitou"/>
+               </item>
+               <item>
+                <widget class="QLabel" name="label_22">
+                 <property name="text">
+                  <string>电话</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QLineEdit" name="taiPhone"/>
+               </item>
+               <item>
+                <spacer name="verticalSpacer_2">
+                 <property name="orientation">
+                  <enum>Qt::Vertical</enum>
+                 </property>
+                 <property name="sizeHint" stdset="0">
+                  <size>
+                   <width>20</width>
+                   <height>40</height>
+                  </size>
+                 </property>
+                </spacer>
+               </item>
+              </layout>
+             </item>
+             <item>
+              <layout class="QVBoxLayout" name="verticalLayout_15">
+               <item>
+                <widget class="QLabel" name="label_19">
+                 <property name="text">
+                  <string>备注</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QTextEdit" name="beizhu"/>
+               </item>
+              </layout>
+             </item>
+            </layout>
+           </item>
+           <item row="0" column="0">
+            <layout class="QHBoxLayout" name="horizontalLayout_11">
+             <item>
+              <widget class="QCheckBox" name="xiangdanPrint">
+               <property name="text">
+                <string>打印箱单</string>
+               </property>
+               <property name="checked">
+                <bool>true</bool>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QCheckBox" name="madanPrint">
+               <property name="text">
+                <string>打印码单</string>
+               </property>
+               <property name="checked">
+                <bool>true</bool>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QCheckBox" name="showMaoZhong">
+               <property name="text">
+                <string>显示毛重</string>
+               </property>
+               <property name="checked">
+                <bool>true</bool>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item row="2" column="0">
+            <layout class="QHBoxLayout" name="horizontalLayout_14">
+             <item>
+              <layout class="QVBoxLayout" name="verticalLayout_9">
+               <item>
+                <widget class="QLabel" name="label_13">
+                 <property name="text">
+                  <string>管色</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QComboBox" name="guanse"/>
+               </item>
+              </layout>
+             </item>
+             <item>
+              <layout class="QVBoxLayout" name="verticalLayout_10">
+               <item>
+                <widget class="QLabel" name="label_14">
+                 <property name="text">
+                  <string>捻向</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QComboBox" name="nianxiang"/>
+               </item>
+              </layout>
+             </item>
+             <item>
+              <layout class="QVBoxLayout" name="verticalLayout_11">
+               <item>
+                <widget class="QLabel" name="label_15">
+                 <property name="text">
+                  <string>纸箱</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QComboBox" name="zhixiang"/>
+               </item>
+              </layout>
+             </item>
+             <item>
+              <layout class="QVBoxLayout" name="verticalLayout_12">
+               <item>
+                <widget class="QLabel" name="label_21">
+                 <property name="text">
+                  <string>筒重</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QComboBox" name="tongzhong"/>
+               </item>
+              </layout>
+             </item>
+            </layout>
+           </item>
+           <item row="1" column="0">
+            <layout class="QHBoxLayout" name="horizontalLayout_13">
+             <item>
+              <layout class="QVBoxLayout" name="verticalLayout_5">
+               <item>
+                <widget class="QLabel" name="label_9">
+                 <property name="text">
+                  <string>打包班次</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QComboBox" name="comboBox_2"/>
+               </item>
+              </layout>
+             </item>
+             <item>
+              <layout class="QVBoxLayout" name="verticalLayout_6">
+               <item>
+                <widget class="QLabel" name="label_10">
+                 <property name="text">
+                  <string>机台</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QComboBox" name="jitai"/>
+               </item>
+              </layout>
+             </item>
+             <item>
+              <layout class="QVBoxLayout" name="verticalLayout_7">
+               <item>
+                <widget class="QLabel" name="label_11">
+                 <property name="text">
+                  <string>等级</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QComboBox" name="dengji"/>
+               </item>
+              </layout>
+             </item>
+             <item>
+              <layout class="QVBoxLayout" name="verticalLayout_8">
+               <item>
+                <widget class="QLabel" name="label_12">
+                 <property name="text">
+                  <string>皮重</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QComboBox" name="pizhong"/>
+               </item>
+              </layout>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+        </item>
        </layout>
        </layout>
       </widget>
       </widget>
      </item>
      </item>

+ 4 - 3
widget/packdetailform.cpp

@@ -1,5 +1,6 @@
-#include "packdetailform.h"
+#include "packdetailform.h"
 #include "ui_packdetailform.h"
 #include "ui_packdetailform.h"
+#include "handle/utils/cachefile.h"
 
 
 PackDetailForm::PackDetailForm(QWidget *parent) :
 PackDetailForm::PackDetailForm(QWidget *parent) :
     QWidget(parent),
     QWidget(parent),
@@ -69,8 +70,8 @@ void PackDetailForm::changeTreeWidget(QList<QMap<QString,QString>> productList)
             }
             }
             list.append(productList.at(i).value("code_single"));
             list.append(productList.at(i).value("code_single"));
             list.append(productList.at(i).value("batch_no"));
             list.append(productList.at(i).value("batch_no"));
-            list.append(QString::number(productList.at(i).value("gross_weight").toDouble()/1000));
-            list.append(QString::number(productList.at(i).value("net_weight").toDouble()/1000));
+            list.append(getDecimalbit(productList.at(i).value("gross_weight").toDouble()/1000.00));
+            list.append(getDecimalbit(productList.at(i).value("net_weight").toDouble()/1000.00));
             list.append(productList.at(i).value("quantity"));
             list.append(productList.at(i).value("quantity"));
 
 
 
 

+ 1 - 0
widget/settingsform.cpp

@@ -39,6 +39,7 @@ void SettingsForm::Init()
     QStringList Baudlist;
     QStringList Baudlist;
     Baudlist<<"300"<<"600"<<"2400"<<"4800"<<"9600"<<"19200"<<"56000"<<"57600"<<"115200"<<"128000"<<"256000"<<"921600";
     Baudlist<<"300"<<"600"<<"2400"<<"4800"<<"9600"<<"19200"<<"56000"<<"57600"<<"115200"<<"128000"<<"256000"<<"921600";
     ui->portBaudRate->addItems(Baudlist);
     ui->portBaudRate->addItems(Baudlist);
+    config.Start();
 }
 }
 
 
 void SettingsForm::on_back_btn_clicked()
 void SettingsForm::on_back_btn_clicked()

+ 41 - 15
widget/uncertainweightpackform.cpp

@@ -1,5 +1,7 @@
-#include "uncertainweightpackform.h"
+#include "uncertainweightpackform.h"
 #include "ui_uncertainweightpackform.h"
 #include "ui_uncertainweightpackform.h"
+#include "handle/utils/cachefile.h"
+
 
 
 UncertainWeightPackForm::UncertainWeightPackForm(QWidget *parent) :
 UncertainWeightPackForm::UncertainWeightPackForm(QWidget *parent) :
     QWidget(parent),
     QWidget(parent),
@@ -10,9 +12,18 @@ UncertainWeightPackForm::UncertainWeightPackForm(QWidget *parent) :
     QTimer *timer = new QTimer(this);
     QTimer *timer = new QTimer(this);
     connect(timer,&QTimer::timeout,this,&UncertainWeightPackForm::calcData);
     connect(timer,&QTimer::timeout,this,&UncertainWeightPackForm::calcData);
     timer->start(500);
     timer->start(500);
+    connect(&packConfig,&RemotePackConfig::configUpdate,this,&UncertainWeightPackForm::upconfig);
+    connect(&packConfig,&RemotePackConfig::dengJIConfigUp,this,&UncertainWeightPackForm::upDengjiInfo);
     ui->widget_6->setEnabled(false);
     ui->widget_6->setEnabled(false);
     //筒数限制,true限制
     //筒数限制,true限制
     istubeNumTure = false;
     istubeNumTure = false;
+    CacheFile f;
+    auto dt = f.readFile("budingzhongInfo.cache");
+    auto list = QString::fromUtf8(dt).split("[,]");
+    if(list.size() == 2){
+        ui->taitou->setText(list.at(0));
+        ui->taiPhone->setText(list.at(1));
+    }
 }
 }
 
 
 UncertainWeightPackForm::~UncertainWeightPackForm()
 UncertainWeightPackForm::~UncertainWeightPackForm()
@@ -22,7 +33,15 @@ UncertainWeightPackForm::~UncertainWeightPackForm()
 
 
 void UncertainWeightPackForm::on_pushBack_clicked()
 void UncertainWeightPackForm::on_pushBack_clicked()
 {
 {
+    if(!packinfo.isNull()){
+        aputils.insertProductSQL(packinfo);
+        aputils.doSend(aputils.toJson(packinfo));
+    }
     emit back();
     emit back();
+    QStringList list;
+    list << ui->taitou->text() <<  ui->taiPhone->text();
+    CacheFile f;
+    f.writeFile("budingzhongInfo.cache",list.join("[,]").toUtf8());
 }
 }
 
 
 //从秤中获取毛重、皮重、净重、筒数------每100毫秒一次
 //从秤中获取毛重、皮重、净重、筒数------每100毫秒一次
@@ -47,9 +66,9 @@ void UncertainWeightPackForm::calcData()
 
 
 void UncertainWeightPackForm::on_addPackList_clicked()
 void UncertainWeightPackForm::on_addPackList_clicked()
 {
 {
+    if(packinfo.isNull()) return;
 
 
-
-    if(!packinfo.isNull()&&packinfo->boxes().size()>0){
+    if(packinfo->boxes().size()>0){
         packinfo->quantity = packinfo->boxes().size();
         packinfo->quantity = packinfo->boxes().size();
         packinfo->level_id = ui->dengji->currentData().toInt();
         packinfo->level_id = ui->dengji->currentData().toInt();
         packinfo->machine_no = ui->jitai->currentText();
         packinfo->machine_no = ui->jitai->currentText();
@@ -64,15 +83,13 @@ void UncertainWeightPackForm::on_addPackList_clicked()
 
 
     //发送码单 packinfo 数据, 转换为 json数据发送
     //发送码单 packinfo 数据, 转换为 json数据发送
     aputils.doSend(aputils.toJson(packinfo));
     aputils.doSend(aputils.toJson(packinfo));
-
-    packinfo.reset(new PackInfo(_info));
-    packinfo->operator_id = GlobalInfo::this_()->user().userId;
-    packinfo->packing_time = QDate::currentDate().toString("yy-MM-dd");
-    packinfo->packing_type = _info.category;
+    packinfo.clear();
 }
 }
 
 
 void UncertainWeightPackForm::on_pushStart_clicked()
 void UncertainWeightPackForm::on_pushStart_clicked()
 {
 {
+    _info.customer = ui->taitou->text();
+    _info.telephone = ui->taiPhone->text();
     if(ui->pushStart->isChecked()){
     if(ui->pushStart->isChecked()){
         ui->pushStart->setChecked(true);
         ui->pushStart->setChecked(true);
         ui->addBoxList->setDisabled(false);
         ui->addBoxList->setDisabled(false);
@@ -92,7 +109,14 @@ void UncertainWeightPackForm::on_addBoxList_clicked()
             QMessageBox::information(this,tr("注意"),tr("筒数异常"));
             QMessageBox::information(this,tr("注意"),tr("筒数异常"));
             return;
             return;
         }
         }
-    if(packinfo.isNull()) return;
+    if(packinfo.isNull()){
+        packinfo.reset(new PackInfo(_info));
+        packinfo->operator_id = GlobalInfo::this_()->user().userId;
+        packinfo->packing_time = QDate::currentDate().toString("yy-MM-dd");
+        packinfo->packing_type = _info.category;
+        ui->tableWidget->clearContents();
+        ui->tableWidget->setRowCount(0);
+    }
     auto box = packinfo->addBoxInfo();
     auto box = packinfo->addBoxInfo();
 
 
     box->box_weight = int(ui->pizhong->currentText().toDouble()*1000);
     box->box_weight = int(ui->pizhong->currentText().toDouble()*1000);
@@ -110,9 +134,9 @@ void UncertainWeightPackForm::on_addBoxList_clicked()
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,0,new QTableWidgetItem(QString::number(ui->tableWidget->rowCount())));
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,0,new QTableWidgetItem(QString::number(ui->tableWidget->rowCount())));
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,1,new QTableWidgetItem(box->caseNumber()));
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,1,new QTableWidgetItem(box->caseNumber()));
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,2,new QTableWidgetItem(QString::number(box->tube_number)));
     ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,2,new QTableWidgetItem(QString::number(box->tube_number)));
-    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,3,new QTableWidgetItem(QString::number(box->gross_weight)));
-    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,4,new QTableWidgetItem(QString::number(box->bucket_weight)));
-    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,5,new QTableWidgetItem(QString::number(box->net_weight)));
+    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,3,new QTableWidgetItem(getDecimalbit(box->gross_weight / 1000.00)));
+    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,4,new QTableWidgetItem(getDecimalbit(box->bucket_weight / 1000.00)));
+    ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,5,new QTableWidgetItem(getDecimalbit(box->net_weight/1000.00)));
 
 
 
 
 //    emit djmbbox(djmb.printBoxInfo(box->caseNumber(),box));
 //    emit djmbbox(djmb.printBoxInfo(box->caseNumber(),box));
@@ -125,6 +149,10 @@ void UncertainWeightPackForm::on_addBoxList_clicked()
     //添加数据库
     //添加数据库
     aputils.insertDetailsSQL(box,packinfo->codeSingle());
     aputils.insertDetailsSQL(box,packinfo->codeSingle());
 
 
+    ui->labelTongZHong->setText(QString::number(packinfo->tube_number()));
+    ui->labelWight->setText(getDecimalbit(packinfo->gross_weight() / 1000.00));
+    ui->labelJing->setText(getDecimalbit(packinfo->net_weight() / 1000.00));
+
     //当当前箱数大于等于最大箱数是启动on_addPackList_clicked();
     //当当前箱数大于等于最大箱数是启动on_addPackList_clicked();
     if(packinfo->boxes().size()>=ui->mashu->currentText().toInt()){
     if(packinfo->boxes().size()>=ui->mashu->currentText().toInt()){
         on_addPackList_clicked();
         on_addPackList_clicked();
@@ -179,14 +207,12 @@ void UncertainWeightPackForm::init()
     ui->widget_5->setEnabled(true);
     ui->widget_5->setEnabled(true);
     ui->widget_7->setEnabled(true);
     ui->widget_7->setEnabled(true);
     packConfig.refConfig();
     packConfig.refConfig();
-    connect(&packConfig,&RemotePackConfig::configUpdate,this,&UncertainWeightPackForm::upconfig);
-    connect(&packConfig,&RemotePackConfig::dengJIConfigUp,this,&UncertainWeightPackForm::upDengjiInfo);
     ui->mashu->clear();
     ui->mashu->clear();
     for(int i = 1;i<=20;i++){
     for(int i = 1;i<=20;i++){
         ui->mashu->addItem(QString::number(i));
         ui->mashu->addItem(QString::number(i));
     }
     }
     ui->mashu->setCurrentText("20");
     ui->mashu->setCurrentText("20");
-    on_addPackList_clicked();
+//    on_addPackList_clicked();
 }
 }
 
 
 void UncertainWeightPackForm::upconfig(const DaBaoConfig &config)
 void UncertainWeightPackForm::upconfig(const DaBaoConfig &config)

+ 0 - 1
widget/uncertainweightpackform.h

@@ -57,7 +57,6 @@ private:
     QMap<QString,DengJiConfigItem> dengjiMap;// <name,详细信息>
     QMap<QString,DengJiConfigItem> dengjiMap;// <name,详细信息>
     RemotePackConfig packConfig;
     RemotePackConfig packConfig;
     HttpRequest _request;
     HttpRequest _request;
-    DanJuMuBan djmb;
     AutoPackUtils aputils;
     AutoPackUtils aputils;
     bool autoRead;
     bool autoRead;
 
 

+ 596 - 579
widget/uncertainweightpackform.ui

@@ -13,8 +13,8 @@
   <property name="windowTitle">
   <property name="windowTitle">
    <string>Form</string>
    <string>Form</string>
   </property>
   </property>
-  <layout class="QGridLayout" name="gridLayout_8">
-   <item row="0" column="0" colspan="2">
+  <layout class="QVBoxLayout" name="verticalLayout_5">
+   <item>
     <widget class="QWidget" name="widget" native="true">
     <widget class="QWidget" name="widget" native="true">
      <property name="minimumSize">
      <property name="minimumSize">
       <size>
       <size>
@@ -72,677 +72,694 @@
      </layout>
      </layout>
     </widget>
     </widget>
    </item>
    </item>
-   <item row="1" column="0">
-    <layout class="QGridLayout" name="gridLayout_4">
-     <item row="0" column="0">
-      <layout class="QHBoxLayout" name="horizontalLayout_2">
-       <item>
-        <widget class="QLabel" name="label_42">
-         <property name="text">
-          <string>合计</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_43">
-         <property name="text">
-          <string>筒数:</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_44">
-         <property name="text">
-          <string>0</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_45">
-         <property name="text">
-          <string>毛重:</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_46">
-         <property name="text">
-          <string>0</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_47">
-         <property name="text">
-          <string>净重:</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_48">
-         <property name="text">
-          <string>0</string>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </item>
-     <item row="1" column="0">
-      <widget class="QTableWidget" name="tableWidget">
-       <property name="minimumSize">
-        <size>
-         <width>562</width>
-         <height>0</height>
-        </size>
-       </property>
-       <property name="maximumSize">
-        <size>
-         <width>9999</width>
-         <height>16777215</height>
-        </size>
-       </property>
-       <column>
-        <property name="text">
-         <string>序号</string>
-        </property>
-       </column>
-       <column>
-        <property name="text">
-         <string>箱号</string>
-        </property>
-       </column>
-       <column>
-        <property name="text">
-         <string>筒数</string>
-        </property>
-       </column>
-       <column>
-        <property name="text">
-         <string>毛重</string>
-        </property>
-       </column>
-       <column>
-        <property name="text">
-         <string>皮重</string>
-        </property>
-       </column>
-       <column>
-        <property name="text">
-         <string>净重</string>
-        </property>
-       </column>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item row="1" column="1">
-    <widget class="QWidget" name="widget_2" native="true">
-     <property name="maximumSize">
-      <size>
-       <width>494</width>
-       <height>16777215</height>
-      </size>
-     </property>
-     <layout class="QGridLayout" name="gridLayout_7">
-      <item row="0" column="0">
-       <widget class="QLabel" name="label_25">
-        <property name="minimumSize">
-         <size>
-          <width>41</width>
-          <height>16</height>
-         </size>
-        </property>
-        <property name="maximumSize">
-         <size>
-          <width>41</width>
-          <height>16</height>
-         </size>
-        </property>
-        <property name="text">
-         <string>毛重</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="1">
-       <widget class="QLineEdit" name="grossWeight">
-        <property name="minimumSize">
-         <size>
-          <width>141</width>
-          <height>61</height>
-         </size>
-        </property>
-        <property name="maximumSize">
-         <size>
-          <width>141</width>
-          <height>61</height>
-         </size>
-        </property>
-        <property name="font">
-         <font>
-          <pointsize>20</pointsize>
-         </font>
-        </property>
-        <property name="text">
-         <string>0</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="2" rowspan="2">
-       <layout class="QVBoxLayout" name="verticalLayout_3">
-        <item>
-         <widget class="QPushButton" name="pushStart">
-          <property name="minimumSize">
-           <size>
-            <width>0</width>
-            <height>50</height>
-           </size>
-          </property>
-          <property name="styleSheet">
-           <string notr="true">background-color: rgb(255, 255, 255);
-color: rgb(0, 170, 255);</string>
-          </property>
-          <property name="text">
-           <string>开始打包</string>
-          </property>
-          <property name="checkable">
-           <bool>true</bool>
-          </property>
-         </widget>
-        </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_8">
+     <item>
+      <widget class="QWidget" name="widget_8" native="true">
+       <layout class="QVBoxLayout" name="verticalLayout_4">
         <item>
         <item>
-         <layout class="QHBoxLayout" name="horizontalLayout_15">
+         <layout class="QHBoxLayout" name="horizontalLayout_2">
           <item>
           <item>
-           <widget class="QPushButton" name="addBoxList">
-            <property name="enabled">
-             <bool>true</bool>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>0</width>
-              <height>50</height>
-             </size>
+           <widget class="QLabel" name="label_42">
+            <property name="text">
+             <string>合计</string>
             </property>
             </property>
-            <property name="styleSheet">
-             <string notr="true">background-color: rgb(255, 255, 255);
-color: rgb(0, 170, 255);</string>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="label_43">
+            <property name="text">
+             <string>筒数:</string>
             </property>
             </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="labelTongZHong">
             <property name="text">
             <property name="text">
-             <string>添加箱单</string>
+             <string>0</string>
             </property>
             </property>
            </widget>
            </widget>
           </item>
           </item>
           <item>
           <item>
-           <widget class="QPushButton" name="addPackList">
-            <property name="enabled">
-             <bool>true</bool>
+           <widget class="QLabel" name="label_45">
+            <property name="text">
+             <string>毛重:</string>
             </property>
             </property>
-            <property name="minimumSize">
-             <size>
-              <width>0</width>
-              <height>50</height>
-             </size>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="labelWight">
+            <property name="text">
+             <string>0</string>
             </property>
             </property>
-            <property name="styleSheet">
-             <string notr="true">background-color: rgb(255, 255, 255);
-color: rgb(0, 170, 255);</string>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="label_47">
+            <property name="text">
+             <string>净重:</string>
             </property>
             </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="labelJing">
             <property name="text">
             <property name="text">
-             <string>添加码单</string>
+             <string>0</string>
             </property>
             </property>
            </widget>
            </widget>
           </item>
           </item>
          </layout>
          </layout>
         </item>
         </item>
-       </layout>
-      </item>
-      <item row="1" column="0">
-       <widget class="QLabel" name="label_26">
-        <property name="minimumSize">
-         <size>
-          <width>31</width>
-          <height>16</height>
-         </size>
-        </property>
-        <property name="maximumSize">
-         <size>
-          <width>31</width>
-          <height>16</height>
-         </size>
-        </property>
-        <property name="text">
-         <string>筒数</string>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="0" colspan="3">
-       <layout class="QHBoxLayout" name="horizontalLayout_5">
-        <item>
-         <widget class="QCheckBox" name="xiangdanPrint_2">
-          <property name="text">
-           <string>打印箱单</string>
-          </property>
-          <property name="checked">
-           <bool>true</bool>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QCheckBox" name="madanPrint_2">
-          <property name="text">
-           <string>打印码单</string>
-          </property>
-          <property name="checked">
-           <bool>true</bool>
-          </property>
-         </widget>
-        </item>
         <item>
         <item>
-         <widget class="QCheckBox" name="showMaoZhong_2">
-          <property name="text">
-           <string>显示毛重</string>
-          </property>
-          <property name="checked">
-           <bool>true</bool>
+         <widget class="QTableWidget" name="tableWidget">
+          <property name="minimumSize">
+           <size>
+            <width>562</width>
+            <height>0</height>
+           </size>
           </property>
           </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QCheckBox" name="tongshuxianzhi">
-          <property name="text">
-           <string>筒数限制</string>
+          <property name="maximumSize">
+           <size>
+            <width>9999</width>
+            <height>16777215</height>
+           </size>
           </property>
           </property>
+          <column>
+           <property name="text">
+            <string>序号</string>
+           </property>
+          </column>
+          <column>
+           <property name="text">
+            <string>箱号</string>
+           </property>
+          </column>
+          <column>
+           <property name="text">
+            <string>筒数</string>
+           </property>
+          </column>
+          <column>
+           <property name="text">
+            <string>毛重</string>
+           </property>
+          </column>
+          <column>
+           <property name="text">
+            <string>皮重</string>
+           </property>
+          </column>
+          <column>
+           <property name="text">
+            <string>净重</string>
+           </property>
+          </column>
          </widget>
          </widget>
         </item>
         </item>
        </layout>
        </layout>
-      </item>
-      <item row="3" column="0" colspan="3">
-       <layout class="QHBoxLayout" name="horizontalLayout_3">
+      </widget>
+     </item>
+     <item>
+      <widget class="QWidget" name="widget_2" native="true">
+       <property name="maximumSize">
+        <size>
+         <width>494</width>
+         <height>16777215</height>
+        </size>
+       </property>
+       <layout class="QVBoxLayout" name="verticalLayout_2">
         <item>
         <item>
-         <layout class="QVBoxLayout" name="verticalLayout_18">
+         <layout class="QHBoxLayout" name="horizontalLayout_7">
           <item>
           <item>
-           <widget class="QLabel" name="label_27">
-            <property name="text">
-             <string>码数</string>
-            </property>
-           </widget>
+           <layout class="QGridLayout" name="gridLayout_7">
+            <item row="0" column="0">
+             <widget class="QLabel" name="label_25">
+              <property name="minimumSize">
+               <size>
+                <width>41</width>
+                <height>16</height>
+               </size>
+              </property>
+              <property name="maximumSize">
+               <size>
+                <width>41</width>
+                <height>16</height>
+               </size>
+              </property>
+              <property name="text">
+               <string>毛重</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="1">
+             <widget class="QLineEdit" name="grossWeight">
+              <property name="minimumSize">
+               <size>
+                <width>141</width>
+                <height>61</height>
+               </size>
+              </property>
+              <property name="maximumSize">
+               <size>
+                <width>141</width>
+                <height>61</height>
+               </size>
+              </property>
+              <property name="font">
+               <font>
+                <pointsize>20</pointsize>
+               </font>
+              </property>
+              <property name="text">
+               <string>0</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="0">
+             <widget class="QLabel" name="label_26">
+              <property name="minimumSize">
+               <size>
+                <width>31</width>
+                <height>16</height>
+               </size>
+              </property>
+              <property name="maximumSize">
+               <size>
+                <width>31</width>
+                <height>16</height>
+               </size>
+              </property>
+              <property name="text">
+               <string>筒数</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="1">
+             <widget class="QSpinBox" name="tongshu">
+              <property name="minimumSize">
+               <size>
+                <width>141</width>
+                <height>61</height>
+               </size>
+              </property>
+              <property name="font">
+               <font>
+                <pointsize>20</pointsize>
+               </font>
+              </property>
+             </widget>
+            </item>
+           </layout>
           </item>
           </item>
           <item>
           <item>
-           <widget class="QComboBox" name="mashu">
-            <property name="currentText">
-             <string/>
-            </property>
-           </widget>
+           <layout class="QVBoxLayout" name="verticalLayout_3">
+            <item>
+             <widget class="QPushButton" name="pushStart">
+              <property name="minimumSize">
+               <size>
+                <width>0</width>
+                <height>50</height>
+               </size>
+              </property>
+              <property name="styleSheet">
+               <string notr="true">background-color: rgb(255, 255, 255);
+color: rgb(0, 170, 255);</string>
+              </property>
+              <property name="text">
+               <string>开始打包</string>
+              </property>
+              <property name="checkable">
+               <bool>true</bool>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="horizontalLayout_15">
+              <item>
+               <widget class="QPushButton" name="addBoxList">
+                <property name="enabled">
+                 <bool>true</bool>
+                </property>
+                <property name="minimumSize">
+                 <size>
+                  <width>0</width>
+                  <height>50</height>
+                 </size>
+                </property>
+                <property name="styleSheet">
+                 <string notr="true">background-color: rgb(255, 255, 255);
+color: rgb(0, 170, 255);</string>
+                </property>
+                <property name="text">
+                 <string>添加箱单</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <widget class="QPushButton" name="addPackList">
+                <property name="enabled">
+                 <bool>true</bool>
+                </property>
+                <property name="minimumSize">
+                 <size>
+                  <width>0</width>
+                  <height>50</height>
+                 </size>
+                </property>
+                <property name="styleSheet">
+                 <string notr="true">background-color: rgb(255, 255, 255);
+color: rgb(0, 170, 255);</string>
+                </property>
+                <property name="text">
+                 <string>添加码单</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+           </layout>
           </item>
           </item>
          </layout>
          </layout>
         </item>
         </item>
         <item>
         <item>
-         <layout class="QHBoxLayout" name="horizontalLayout">
+         <layout class="QHBoxLayout" name="horizontalLayout_5">
           <item>
           <item>
-           <widget class="QLabel" name="label_2">
-            <property name="maximumSize">
-             <size>
-              <width>30</width>
-              <height>16777215</height>
-             </size>
-            </property>
+           <widget class="QCheckBox" name="xiangdanPrint_2">
             <property name="text">
             <property name="text">
-             <string>筒数</string>
+             <string>打印箱单</string>
+            </property>
+            <property name="checked">
+             <bool>true</bool>
             </property>
             </property>
            </widget>
            </widget>
           </item>
           </item>
           <item>
           <item>
-           <widget class="QComboBox" name="tongshuguding">
-            <property name="maximumSize">
-             <size>
-              <width>80</width>
-              <height>16777215</height>
-             </size>
+           <widget class="QCheckBox" name="madanPrint_2">
+            <property name="text">
+             <string>打印码单</string>
+            </property>
+            <property name="checked">
+             <bool>true</bool>
             </property>
             </property>
-            <item>
-             <property name="text">
-              <string>固定</string>
-             </property>
-            </item>
-            <item>
-             <property name="text">
-              <string>不固定</string>
-             </property>
-            </item>
            </widget>
            </widget>
           </item>
           </item>
-         </layout>
-        </item>
-        <item>
-         <layout class="QHBoxLayout" name="horizontalLayout_18">
-          <property name="spacing">
-           <number>0</number>
-          </property>
           <item>
           <item>
-           <widget class="QLabel" name="label">
+           <widget class="QCheckBox" name="showMaoZhong_2">
             <property name="text">
             <property name="text">
-             <string>已开启自动</string>
+             <string>显示毛重</string>
             </property>
             </property>
-            <property name="alignment">
-             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+            <property name="checked">
+             <bool>true</bool>
             </property>
             </property>
            </widget>
            </widget>
           </item>
           </item>
           <item>
           <item>
-           <widget class="QPushButton" name="handleRead_2">
-            <property name="minimumSize">
-             <size>
-              <width>71</width>
-              <height>41</height>
-             </size>
-            </property>
+           <widget class="QCheckBox" name="tongshuxianzhi">
             <property name="text">
             <property name="text">
-             <string>手动读数</string>
+             <string>筒数限制</string>
             </property>
             </property>
            </widget>
            </widget>
           </item>
           </item>
          </layout>
          </layout>
         </item>
         </item>
-       </layout>
-      </item>
-      <item row="4" column="0" colspan="3">
-       <widget class="QWidget" name="widget_3" native="true">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="minimumSize">
-         <size>
-          <width>450</width>
-          <height>0</height>
-         </size>
-        </property>
-        <layout class="QGridLayout" name="gridLayout_6">
-         <item row="0" column="0">
-          <layout class="QHBoxLayout" name="horizontalLayout_4">
-           <item>
-            <layout class="QVBoxLayout" name="verticalLayout_19">
-             <item>
-              <widget class="QLabel" name="label_28">
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_3">
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_18">
+            <item>
+             <widget class="QLabel" name="label_27">
+              <property name="text">
+               <string>码数</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="mashu">
+              <property name="editable">
+               <bool>true</bool>
+              </property>
+              <property name="currentText">
+               <string/>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout">
+            <item>
+             <widget class="QLabel" name="label_2">
+              <property name="maximumSize">
+               <size>
+                <width>30</width>
+                <height>16777215</height>
+               </size>
+              </property>
+              <property name="text">
+               <string>筒数</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="tongshuguding">
+              <property name="maximumSize">
+               <size>
+                <width>80</width>
+                <height>16777215</height>
+               </size>
+              </property>
+              <item>
                <property name="text">
                <property name="text">
-                <string>打包班次</string>
+                <string>固定</string>
                </property>
                </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QComboBox" name="dabaobanci"/>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QVBoxLayout" name="verticalLayout_20">
-             <item>
-              <widget class="QLabel" name="label_29">
+              </item>
+              <item>
                <property name="text">
                <property name="text">
-                <string>机台</string>
+                <string>不固定</string>
                </property>
                </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QComboBox" name="jitai"/>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QVBoxLayout" name="verticalLayout_21">
+              </item>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout_18">
+            <property name="spacing">
+             <number>0</number>
+            </property>
+            <item>
+             <widget class="QLabel" name="label">
+              <property name="text">
+               <string>已开启自动</string>
+              </property>
+              <property name="alignment">
+               <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QPushButton" name="handleRead_2">
+              <property name="minimumSize">
+               <size>
+                <width>71</width>
+                <height>41</height>
+               </size>
+              </property>
+              <property name="text">
+               <string>手动读数</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <widget class="QWidget" name="widget_3" native="true">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="minimumSize">
+           <size>
+            <width>450</width>
+            <height>0</height>
+           </size>
+          </property>
+          <layout class="QGridLayout" name="gridLayout_6">
+           <item row="0" column="0">
+            <layout class="QHBoxLayout" name="horizontalLayout_4">
              <item>
              <item>
-              <widget class="QLabel" name="label_30">
-               <property name="text">
-                <string>等级</string>
-               </property>
-              </widget>
+              <layout class="QVBoxLayout" name="verticalLayout_19">
+               <item>
+                <widget class="QLabel" name="label_28">
+                 <property name="text">
+                  <string>打包班次</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QComboBox" name="dabaobanci"/>
+               </item>
+              </layout>
              </item>
              </item>
              <item>
              <item>
-              <widget class="QComboBox" name="dengji"/>
+              <layout class="QVBoxLayout" name="verticalLayout_20">
+               <item>
+                <widget class="QLabel" name="label_29">
+                 <property name="text">
+                  <string>机台</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QComboBox" name="jitai"/>
+               </item>
+              </layout>
              </item>
              </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QVBoxLayout" name="verticalLayout_22">
              <item>
              <item>
-              <widget class="QLabel" name="label_31">
-               <property name="text">
-                <string>皮重</string>
-               </property>
-              </widget>
+              <layout class="QVBoxLayout" name="verticalLayout_21">
+               <item>
+                <widget class="QLabel" name="label_30">
+                 <property name="text">
+                  <string>等级</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QComboBox" name="dengji"/>
+               </item>
+              </layout>
              </item>
              </item>
              <item>
              <item>
-              <widget class="QComboBox" name="pizhong"/>
+              <layout class="QVBoxLayout" name="verticalLayout_22">
+               <item>
+                <widget class="QLabel" name="label_31">
+                 <property name="text">
+                  <string>皮重</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QComboBox" name="pizhong"/>
+               </item>
+              </layout>
              </item>
              </item>
             </layout>
             </layout>
            </item>
            </item>
           </layout>
           </layout>
-         </item>
-        </layout>
-       </widget>
-      </item>
-      <item row="5" column="0" colspan="3">
-       <widget class="QWidget" name="widget_4" native="true">
-        <layout class="QGridLayout" name="gridLayout_5">
-         <item row="0" column="0">
-          <widget class="QWidget" name="widget_5" native="true">
-           <layout class="QGridLayout" name="gridLayout_3">
-            <property name="leftMargin">
-             <number>0</number>
-            </property>
-            <property name="topMargin">
-             <number>0</number>
-            </property>
-            <property name="rightMargin">
-             <number>0</number>
-            </property>
-            <property name="bottomMargin">
-             <number>0</number>
-            </property>
-            <item row="0" column="0">
-             <layout class="QHBoxLayout" name="horizontalLayout_6">
-              <item>
-               <layout class="QVBoxLayout" name="verticalLayout_23">
+         </widget>
+        </item>
+        <item>
+         <widget class="QWidget" name="widget_4" native="true">
+          <layout class="QGridLayout" name="gridLayout_5">
+           <item row="0" column="0">
+            <widget class="QWidget" name="widget_5" native="true">
+             <layout class="QGridLayout" name="gridLayout_3">
+              <property name="leftMargin">
+               <number>0</number>
+              </property>
+              <property name="topMargin">
+               <number>0</number>
+              </property>
+              <property name="rightMargin">
+               <number>0</number>
+              </property>
+              <property name="bottomMargin">
+               <number>0</number>
+              </property>
+              <item row="0" column="0">
+               <layout class="QHBoxLayout" name="horizontalLayout_6">
                 <item>
                 <item>
-                 <widget class="QLabel" name="label_32">
-                  <property name="text">
-                   <string>管色</string>
-                  </property>
-                 </widget>
+                 <layout class="QVBoxLayout" name="verticalLayout_23">
+                  <item>
+                   <widget class="QLabel" name="label_32">
+                    <property name="text">
+                     <string>管色</string>
+                    </property>
+                   </widget>
+                  </item>
+                  <item>
+                   <widget class="QComboBox" name="guanse"/>
+                  </item>
+                 </layout>
                 </item>
                 </item>
                 <item>
                 <item>
-                 <widget class="QComboBox" name="guanse"/>
-                </item>
-               </layout>
-              </item>
-              <item>
-               <layout class="QVBoxLayout" name="verticalLayout_24">
-                <item>
-                 <widget class="QLabel" name="label_33">
-                  <property name="text">
-                   <string>捻向</string>
-                  </property>
-                 </widget>
+                 <layout class="QVBoxLayout" name="verticalLayout_24">
+                  <item>
+                   <widget class="QLabel" name="label_33">
+                    <property name="text">
+                     <string>捻向</string>
+                    </property>
+                   </widget>
+                  </item>
+                  <item>
+                   <widget class="QComboBox" name="nianxiang"/>
+                  </item>
+                 </layout>
                 </item>
                 </item>
                 <item>
                 <item>
-                 <widget class="QComboBox" name="nianxiang"/>
+                 <layout class="QVBoxLayout" name="verticalLayout_25">
+                  <item>
+                   <widget class="QLabel" name="label_34">
+                    <property name="text">
+                     <string>纸箱</string>
+                    </property>
+                   </widget>
+                  </item>
+                  <item>
+                   <widget class="QComboBox" name="zhixiang"/>
+                  </item>
+                 </layout>
                 </item>
                 </item>
                </layout>
                </layout>
               </item>
               </item>
-              <item>
-               <layout class="QVBoxLayout" name="verticalLayout_25">
+             </layout>
+            </widget>
+           </item>
+           <item row="0" column="1">
+            <widget class="QWidget" name="widget_6" native="true">
+             <layout class="QGridLayout" name="gridLayout">
+              <property name="leftMargin">
+               <number>0</number>
+              </property>
+              <property name="topMargin">
+               <number>0</number>
+              </property>
+              <property name="rightMargin">
+               <number>0</number>
+              </property>
+              <property name="bottomMargin">
+               <number>0</number>
+              </property>
+              <item row="0" column="0">
+               <layout class="QVBoxLayout" name="verticalLayout_26">
                 <item>
                 <item>
-                 <widget class="QLabel" name="label_34">
+                 <widget class="QLabel" name="label_35">
                   <property name="text">
                   <property name="text">
-                   <string>纸箱</string>
+                   <string>筒重</string>
                   </property>
                   </property>
                  </widget>
                  </widget>
                 </item>
                 </item>
                 <item>
                 <item>
-                 <widget class="QComboBox" name="zhixiang"/>
+                 <widget class="QComboBox" name="tongzhong"/>
                 </item>
                 </item>
                </layout>
                </layout>
               </item>
               </item>
              </layout>
              </layout>
-            </item>
-           </layout>
-          </widget>
-         </item>
-         <item row="0" column="1">
-          <widget class="QWidget" name="widget_6" native="true">
-           <layout class="QGridLayout" name="gridLayout">
-            <property name="leftMargin">
-             <number>0</number>
-            </property>
-            <property name="topMargin">
-             <number>0</number>
-            </property>
-            <property name="rightMargin">
-             <number>0</number>
-            </property>
-            <property name="bottomMargin">
-             <number>0</number>
-            </property>
-            <item row="0" column="0">
-             <layout class="QVBoxLayout" name="verticalLayout_26">
-              <item>
-               <widget class="QLabel" name="label_35">
-                <property name="text">
-                 <string>筒重</string>
-                </property>
-               </widget>
-              </item>
-              <item>
-               <widget class="QComboBox" name="tongzhong"/>
-              </item>
-             </layout>
-            </item>
-           </layout>
-          </widget>
-         </item>
-        </layout>
-       </widget>
-      </item>
-      <item row="6" column="0" colspan="3">
-       <widget class="QWidget" name="widget_7" native="true">
-        <layout class="QGridLayout" name="gridLayout_2">
-         <item row="0" column="0">
-          <layout class="QVBoxLayout" name="verticalLayout_27">
-           <item>
-            <widget class="QLabel" name="label_36">
-             <property name="text">
-              <string>码单</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QComboBox" name="madan_2">
-             <property name="enabled">
-              <bool>false</bool>
-             </property>
             </widget>
             </widget>
            </item>
            </item>
-           <item>
-            <widget class="QLabel" name="label_37">
-             <property name="text">
-              <string>箱单</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QComboBox" name="xiangdan_2">
-             <property name="enabled">
-              <bool>false</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer name="verticalSpacer_3">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>20</width>
-               <height>40</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
           </layout>
           </layout>
-         </item>
-         <item row="0" column="1">
-          <layout class="QVBoxLayout" name="verticalLayout_28">
-           <item>
-            <widget class="QLabel" name="label_38">
-             <property name="text">
-              <string>箱单抬头</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QLineEdit" name="taitou_3"/>
-           </item>
-           <item>
-            <widget class="QLabel" name="label_39">
-             <property name="text">
-              <string>电话</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QLineEdit" name="taitou_4"/>
-           </item>
-           <item>
-            <spacer name="verticalSpacer_4">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>20</width>
-               <height>40</height>
-              </size>
-             </property>
-            </spacer>
+         </widget>
+        </item>
+        <item>
+         <widget class="QWidget" name="widget_7" native="true">
+          <layout class="QGridLayout" name="gridLayout_2">
+           <item row="0" column="0">
+            <layout class="QVBoxLayout" name="verticalLayout_27">
+             <item>
+              <widget class="QLabel" name="label_36">
+               <property name="text">
+                <string>码单</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QComboBox" name="madan_2">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QLabel" name="label_37">
+               <property name="text">
+                <string>箱单</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QComboBox" name="xiangdan_2">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <spacer name="verticalSpacer_3">
+               <property name="orientation">
+                <enum>Qt::Vertical</enum>
+               </property>
+               <property name="sizeHint" stdset="0">
+                <size>
+                 <width>20</width>
+                 <height>40</height>
+                </size>
+               </property>
+              </spacer>
+             </item>
+            </layout>
            </item>
            </item>
-          </layout>
-         </item>
-         <item row="0" column="2">
-          <layout class="QVBoxLayout" name="verticalLayout">
-           <item>
-            <widget class="QLabel" name="label_40">
-             <property name="text">
-              <string>备注</string>
-             </property>
-            </widget>
+           <item row="0" column="1">
+            <layout class="QVBoxLayout" name="verticalLayout_28">
+             <item>
+              <widget class="QLabel" name="label_38">
+               <property name="text">
+                <string>箱单抬头</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QLineEdit" name="taitou"/>
+             </item>
+             <item>
+              <widget class="QLabel" name="label_39">
+               <property name="text">
+                <string>电话</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QLineEdit" name="taiPhone"/>
+             </item>
+             <item>
+              <spacer name="verticalSpacer_4">
+               <property name="orientation">
+                <enum>Qt::Vertical</enum>
+               </property>
+               <property name="sizeHint" stdset="0">
+                <size>
+                 <width>20</width>
+                 <height>40</height>
+                </size>
+               </property>
+              </spacer>
+             </item>
+            </layout>
            </item>
            </item>
-           <item>
-            <widget class="QTextEdit" name="beizhu"/>
+           <item row="0" column="2">
+            <layout class="QVBoxLayout" name="verticalLayout">
+             <item>
+              <widget class="QLabel" name="label_40">
+               <property name="text">
+                <string>备注</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QTextEdit" name="beizhu"/>
+             </item>
+            </layout>
            </item>
            </item>
           </layout>
           </layout>
-         </item>
-        </layout>
-       </widget>
-      </item>
-      <item row="1" column="1">
-       <widget class="QSpinBox" name="tongshu">
-        <property name="minimumSize">
-         <size>
-          <width>141</width>
-          <height>61</height>
-         </size>
-        </property>
-        <property name="font">
-         <font>
-          <pointsize>20</pointsize>
-         </font>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+     </item>
+    </layout>
    </item>
    </item>
   </layout>
   </layout>
  </widget>
  </widget>