dushibaiyu 6 år sedan
incheckning
deeeffe214

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+ 
+*.pro.user
+*.pro.user.*

+ 56 - 0
JxcClient.pro

@@ -0,0 +1,56 @@
+QT       += core gui network serialport sql printsupport
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+CONFIG += c++11
+
+# The following define makes your compiler emit warnings if you use
+# any Qt feature that has been marked deprecated (the exact warnings
+# depend on your compiler). Please consult the documentation of the
+# deprecated API in order to know how to port your code away from it.
+DEFINES += QT_DEPRECATED_WARNINGS
+
+# You can also make your code fail to compile if it uses deprecated APIs.
+# In order to do so, uncomment the following line.
+# You can also select to disable deprecated APIs only up to a certain version of Qt.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += \
+    configinfo.cpp \
+    globalinfo.cpp \
+    handle/code39.cpp \
+    handle/danjumuban.cpp \
+    handle/database.cpp \
+    handle/httprequest.cpp \
+    handle/remotepackconfig.cpp \
+    packinfo.cpp \
+    widget/autopackform.cpp \
+    widget/loginform.cpp \
+    main.cpp \
+    mainwindow.cpp \
+    widget/selectvalueform.cpp
+
+HEADERS += \
+    configinfo.h \
+    globalinfo.h \
+    handle/code39.h \
+    handle/danjumuban.h \
+    handle/database.h \
+    handle/httprequest.h \
+    handle/remotepackconfig.h \
+    packinfo.h \
+    widget/autopackform.h \
+    widget/loginform.h \
+    mainwindow.h \
+    widget/selectvalueform.h
+
+FORMS += \
+    widget/autopackform.ui \
+    widget/loginform.ui \
+    mainwindow.ui \
+    widget/selectvalueform.ui
+
+# Default rules for deployment.
+qnx: target.path = /tmp/$${TARGET}/bin
+else: unix:!android: target.path = /opt/$${TARGET}/bin
+!isEmpty(target.path): INSTALLS += target

+ 8 - 0
configinfo.cpp

@@ -0,0 +1,8 @@
+#include "configinfo.h"
+
+ConfigInfo::ConfigInfo()
+{
+    baseUrl = "http://erp.itwsw.cn/api";
+    packId = 1031;
+    printerName = "Deli DL-820T";
+}

+ 58 - 0
configinfo.h

@@ -0,0 +1,58 @@
+#ifndef CONFIGINFO_H
+#define CONFIGINFO_H
+
+#include <QString>
+
+class ConfigInfo
+{
+public:
+    ConfigInfo();
+
+    QString baseUrl;
+    quint16 packId;
+    QString printerName;
+};
+
+struct UserInfo
+{
+    QString userName;
+    int userId;
+    int accountId;
+    QString name;
+    QString headPortrait;
+    bool isVip;
+    QString acessToken;
+
+};
+
+struct ProjectInfo
+{
+    int goods_id;//	int	商品ID
+    QString batch_no;//	string	批号
+    QString category;//	string	类型
+    QString product_type_code;//	string	品种
+    QString spec_role;//	string	规格录入
+    QString denier;//	string	旦数(D)
+    QString dtex;//	string	分特(dt)
+    QString fiber;//	string	孔数(F)
+    QString specs;//	string	规格
+    QString color;//	string	颜色
+    QString twist_type;//	string	捻向
+    QString bucket_color;//	string	管色
+    QString box_weight;//	string	皮重
+    QString bucket_weight;//	string	筒重
+    QString machine_no;//	string	机台
+    QString carton_type;//	string	纸箱
+    QString limit_number;//	string	限制打包
+    QString bucket_number;//	string	筒数
+    QString cake_float;//	string	丝饼浮动
+    QString box_float;//	string	纸箱浮动
+    QString box_rule;//	string	箱号规则
+    QString customer;//	string	箱单抬头
+    QString remark;//	string	备注
+    bool is_disable;//	bool	是否禁用
+    qint64 create_time;//	int	创建时间
+    qint64 modified_time;//	int	更新时间
+};
+
+#endif // CONFIGINFO_H

+ 24 - 0
globalinfo.cpp

@@ -0,0 +1,24 @@
+#include "globalinfo.h"
+
+GlobalInfo::GlobalInfo(QObject *parent) : QObject(parent)
+{
+
+}
+
+
+GlobalInfo * GlobalInfo::this_()
+{
+    static GlobalInfo glo;
+    return  & glo;
+}
+
+
+QString GlobalInfo::packNum()
+{
+//    auto ret = _config.packId;
+    if(pack_num.length() == 4) return  pack_num;
+    pack_num = QString::asprintf("%04d",_config.packId);
+    if(pack_num.length() > 4)
+        pack_num = pack_num.right(4);
+    return pack_num;
+}

+ 33 - 0
globalinfo.h

@@ -0,0 +1,33 @@
+#ifndef GLOBALINFO_H
+#define GLOBALINFO_H
+
+#include <QObject>
+#include "configinfo.h"
+
+class GlobalInfo : public QObject
+{
+    Q_OBJECT
+private:
+    explicit GlobalInfo(QObject *parent = nullptr);
+
+    ConfigInfo _config;
+    UserInfo _users;
+public:
+    static GlobalInfo * this_();
+
+    inline const ConfigInfo & config() const {return _config;}
+
+    inline void setUser(const UserInfo & users){_users = users;}
+    inline const UserInfo & user() const {return _users;}
+
+    QString packNum();
+signals:
+
+public slots:
+
+private:
+    QString pack_num;
+};
+
+
+#endif // GLOBALINFO_H

+ 187 - 0
handle/code39.cpp

@@ -0,0 +1,187 @@
+#include "code39.h"
+
+QMap<QString,QString> InitMap()
+{
+//    if(!map.isEmpty()) return;
+    QMap<QString,QString> ret;
+    ret.insert("A","110101001011");
+    ret.insert("B","101101001011");
+    ret.insert("C","110110100101");
+    ret.insert("D","101011001011");
+    ret.insert("E","110101100101");
+    ret.insert("F","101101100101");
+    ret.insert("G","101010011011");
+    ret.insert("H","110101001101");
+    ret.insert("I","101101001101");
+    ret.insert("J","101011001101");
+    ret.insert("K","110101010011");
+    ret.insert("L","101101010011");
+    ret.insert("M","110110101001");
+    ret.insert("N","101011010011");
+    ret.insert("O","110101101001");
+    ret.insert("P","101101101001");
+    ret.insert("Q","101010110011");
+    ret.insert("R","110101011001");
+    ret.insert("S","101101011001");
+    ret.insert("T","101011011001");
+    ret.insert("U","110010101011");
+    ret.insert("V","100110101011");
+    ret.insert("W","110011010101");
+    ret.insert("X","100101101011");
+    ret.insert("Y","110010110101");
+    ret.insert("Z","100110110101");
+    ret.insert("0","101001101101");
+    ret.insert("1","110100101011");
+    ret.insert("2","101100101011");
+    ret.insert("3","110110010101");
+    ret.insert("4","101001101011");
+    ret.insert("5","110100110101");
+    ret.insert("6","101100110101");
+    ret.insert("7","101001011011");
+    ret.insert("8","110100101101");
+    ret.insert("9","101100101101");
+    ret.insert("+","100101001001");
+    ret.insert("-","100101011011");
+    ret.insert("*","100101101101");
+    ret.insert("/","100100101001");
+    ret.insert("%","101001001001");
+    ret.insert("$","100100100101");
+    ret.insert(".","110010101101");
+    ret.insert(" ","100110101101");
+    return ret;
+}
+
+static QMap<QString,QString> map = InitMap();
+
+Code39::Code39()
+{
+
+//    InitMap();
+}
+
+
+
+void Code39::draw(QPainter & painter, QRect & pos,QString & barcode)
+{
+    QString BinaryNum = CodeBinary(barcode);
+    int MAXHEIGHT = pos.height();
+    int MAXWIDTH = pos.width();
+    int FONTHEIGHT=10; //预留10px的左右空白;
+    int widght = MAXWIDTH - FONTHEIGHT;
+    //设定条码线条宽度px
+    int LineWidth = widght / BinaryNum.size();
+    int move= (MAXWIDTH-LineWidth*BinaryNum.size())/2;
+    //QBitmap bmp(MAXWIDTH,MAXHEIGHT+FONTHEIGHT);
+//    QPainter painter(&image);
+    painter.save();
+    painter.setWindow(pos);
+    QPen white,black;
+    //    painter.setRenderHint(QPainter::Antialiasing,true);//弧线圆润
+    white.setColor(QColor(255,255,255));
+    black.setColor(QColor(0,0,0));
+    white.setWidth(LineWidth);
+    black.setWidth(LineWidth);
+
+    //背景充填白色
+    painter.setPen(white);
+    painter.drawRect(0,0,MAXWIDTH,MAXHEIGHT+FONTHEIGHT);
+
+    //画线
+    for(int i=0;i<BinaryNum.size();i++)
+    {
+        if(BinaryNum.at(i)=='1') painter.setPen(black);
+        else painter.setPen(white);
+        painter.drawLine(i*LineWidth+LineWidth/2+move,0,i*LineWidth+LineWidth/2+move,MAXHEIGHT);
+    }
+
+//    qDebug()<<barcode<<endl;
+    //添加底部条形码字符
+    painter.setPen(black);
+    painter.setRenderHint(QPainter::Antialiasing,true);
+    painter.setRenderHint(QPainter::TextAntialiasing,true);
+    painter.setRenderHint(QPainter::HighQualityAntialiasing,true);
+    QFont font;
+    font.setFamily("宋体");
+    font.setPixelSize(10);
+    font.setWeight(QFont::ExtraLight);
+    painter.setFont(font);
+    painter.drawText(5,30,MAXWIDTH,10,Qt::AlignCenter,/*"S/N:" +*/ barcode);
+
+    painter.restore();
+}
+/*
+QImage Code39::draw(QString BinaryNum,QString barcode)
+{
+    int MAXWIDTH;
+    int MAXHEIGHT=30;
+    int FONTHEIGHT=10;
+
+    //设定条码线条宽度px
+    int LineWidth=1;
+    //预留10px的左右空白;
+    MAXWIDTH=LineWidth*BinaryNum.size()+5;
+
+    //计算条线宽度时,精度丢失造成条码右边空白,进行右移居中
+    int move=(MAXWIDTH-LineWidth*BinaryNum.size())/2;
+
+    QSize size(MAXWIDTH,MAXHEIGHT+FONTHEIGHT);
+    QImage image(size,QImage::Format_ARGB32);
+    image.fill(qRgba(255, 255, 255, 0));
+
+    //QBitmap bmp(MAXWIDTH,MAXHEIGHT+FONTHEIGHT);
+    QPainter painter(&image);
+    QPen white,black;
+    //    painter.setRenderHint(QPainter::Antialiasing,true);//弧线圆润
+    white.setColor(QColor(255,255,255));
+    black.setColor(QColor(0,0,0));
+    white.setWidth(LineWidth);
+    black.setWidth(LineWidth);
+
+    //背景充填白色
+    painter.setPen(white);
+    painter.drawRect(0,0,MAXWIDTH,MAXHEIGHT+FONTHEIGHT);
+
+    //画线
+    for(int i=0;i<BinaryNum.size();i++)
+    {
+        if(BinaryNum.at(i)=='1') painter.setPen(black);
+        else painter.setPen(white);
+        painter.drawLine(i*LineWidth+LineWidth/2+move,0,i*LineWidth+LineWidth/2+move,MAXHEIGHT);
+    }
+
+//    qDebug()<<barcode<<endl;
+    //添加底部条形码字符
+    painter.setPen(black);
+    painter.setRenderHint(QPainter::Antialiasing,true);
+    painter.setRenderHint(QPainter::TextAntialiasing,true);
+    painter.setRenderHint(QPainter::HighQualityAntialiasing,true);
+    QFont font;
+    font.setFamily("宋体");
+    font.setPixelSize(10);
+    font.setWeight(QFont::ExtraLight);
+    painter.setFont(font);
+    painter.drawText(5,30,MAXWIDTH,10,Qt::AlignCenter,/*"S/N:"barcode);
+//    bool isSaved = image.save(path + barcode + ".bmp");
+//    qDebug()<<isSaved;
+//    return image;
+//}*/
+
+
+QString Code39::CodeBinary(QString barcode)
+{
+    barcode="*"+barcode+"*";
+    QString str="";
+    for(int i=0;i<barcode.size();i++)
+    {
+        str+= map[barcode.at(i)]+"0";//每个字符的二进制逻辑码之间,用“0”隔开(加一条白线)
+    }
+    return str;
+}
+
+
+
+//void Code39::reset(QString BarCode, QString SavePath)
+//{
+////    barcode=BarCode;
+////    path=SavePath;
+//}

+ 29 - 0
handle/code39.h

@@ -0,0 +1,29 @@
+#ifndef CODE39_H
+#define CODE39_H
+
+#include <QDebug>
+#include <QDateTime>
+#include <QMessageBox>
+#include <QFont>
+#include <QBitmap>
+#include <QPainter>
+#include <QtPrintSupport>
+
+class Code39
+{
+public:
+    Code39();
+
+private:
+//    static QMap<QString,QString> map;
+
+public:
+    void draw(QPainter & painter, QRect & pos, QString &barcode);
+    QString CodeBinary(QString barcode);
+
+private:
+//    static void InitMap();
+
+};
+
+#endif // CODE39_H

+ 221 - 0
handle/danjumuban.cpp

@@ -0,0 +1,221 @@
+#include "danjumuban.h"
+#include "QtPrintSupport"
+#include "QDateTime"
+#include "globalinfo.h"
+
+DanJuMuBan::DanJuMuBan()
+{
+ //   path = QDir::currentPath();
+}
+
+QImage DanJuMuBan::printBoxInfo(QString bar,QSharedPointer<BoxInfo> info)
+{
+//    if(datalist.isEmpty()){
+//        return;
+//    }
+    QSharedPointer<PackInfo> pinfo = info->parentPack();
+    if(pinfo.isNull()) return QImage();
+    QSize size(MAXWIDTH*5,MAXHEIGHT*5);
+    QImage image(size,QImage::Format_ARGB32);
+    image.fill(qRgba(255, 255, 255, 255));
+    QPainter painter(&image);
+    painter.drawRect(5*5,5*5,90*5,15*5);
+    painter.drawRect(5*5,20*5,90*5,35*5);
+    painter.drawLine(20*5,20*5,20*5,55*5);
+    painter.drawLine(50*5,20*5,50*5,55*5);
+    painter.drawLine(66*5,20*5,66*5,55*5);
+    painter.drawLine(5*5,27*5,95*5,27*5);
+    painter.drawLine(5*5,34*5,95*5,34*5);
+    painter.drawLine(5*5,41*5,95*5,41*5);
+    painter.drawLine(5*5,48*5,95*5,48*5);
+    painter.drawRect(5*5,55*5,90*5,15*5);
+    painter.drawRect(5*5,70*5,90*5,7*5);
+
+    QRect target(0*5, 57*5, 100*5, 60*5);
+//    QRect source(-10*5, 0, 65*5, 40*5);
+    barCode.draw(painter,target,bar);
+//    painter.drawImage(target,barCode.draw(barCode.CodeBinary(bar),bar),source);
+
+    painter.setRenderHint(QPainter::Antialiasing,true);
+    painter.setRenderHint(QPainter::TextAntialiasing,true);
+    painter.setRenderHint(QPainter::HighQualityAntialiasing,true);
+    QFont font;
+    font.setFamily("宋体");
+    font.setPixelSize(40);
+    font.setWeight(QFont::ExtraLight);
+    painter.setFont(font);
+    painter.drawText(6*5,15*5,pinfo->info().customer);
+
+    font.setPixelSize(20);
+    font.setBold(true);
+    painter.setFont(font);
+    painter.drawText(8*5,25*5,QStringLiteral("品名"));
+    painter.drawText(53*5,25*5,QStringLiteral("毛重"));
+    painter.drawText(8*5,32*5,QStringLiteral("批号"));
+    painter.drawText(53*5,32*5,QStringLiteral("净重"));
+    painter.drawText(8*5,39*5,QStringLiteral("规格"));
+    painter.drawText(53*5,39*5,QStringLiteral("筒数"));
+    painter.drawText(8*5,46*5,QStringLiteral("等级"));
+    painter.drawText(53*5,46*5,QStringLiteral("捻向"));
+    painter.drawText(8*5,53*5,QStringLiteral("箱号"));
+    painter.drawText(50*5,53*5,QStringLiteral("纸管颜色"));
+
+    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,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,32*5,QString("%1 kg").arg(info->net_weight / 1000.00));//datalist.at(1));
+
+    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(67*5,46*5,pinfo->info().twist_type);//datalist.at(4));
+    painter.drawText(21*5,53*5,info->caseNumber());//datalist.at(5));
+    painter.drawText(67*5,53*5,pinfo->info().bucket_color);//datalist.at(6));
+
+
+//    painter.drawText(4*5,75*5," 电话"+telephone+"传真"+fax);
+
+//    print(image);
+    return image;
+
+//    image.save(path+"\\xiangdan\\code"+bar+".bmp");
+}
+
+QImage DanJuMuBan::printPackInfo(QString bar, QSharedPointer<PackInfo> info)
+{
+    QSize size(MAXWIDTH*5,MAXHEIGHT*5);
+    QImage image(size,QImage::Format_ARGB32);
+    image.fill(qRgba(255, 255, 255, 255));
+    QPainter painter(&image);
+    painter.drawRect(4*5,4*5,92*5,68*5);
+
+    painter.drawLine(50*5,0,50*5,80*5);
+    painter.drawLine(4*5,16*5,96*5,16*5);
+    painter.drawLine(4*5,22*5,96*5,22*5);
+    painter.drawLine(4*5,28*5,96*5,28*5);
+    painter.drawLine(4*5,34*5,96*5,34*5);
+    painter.drawLine(4*5,40*5,96*5,40*5);
+    painter.drawLine(4*5,46*5,96*5,46*5);
+    painter.drawLine(4*5,52*5,96*5,52*5);
+    painter.drawLine(4*5,58*5,96*5,58*5);
+    painter.drawLine(4*5,65*5,96*5,65*5);
+
+    QFont font;
+    font.setFamily("宋体");
+    font.setPixelSize(30);
+    font.setWeight(QFont::ExtraLight);
+    painter.setFont(font);
+    painter.drawText(38*5,10*5,QStringLiteral("入 库 单"));
+
+
+    font.setPixelSize(20);
+    painter.setFont(font);
+    painter.drawText(8*5,15*5,QStringLiteral("规格:"));
+    painter.drawText(59*5,15*5,QStringLiteral("类型:"));
+    painter.drawText(8*5,21*5,QStringLiteral("批号:"));
+    painter.drawText(59*5,21*5,QStringLiteral("等级:"));
+
+    font.setPixelSize(15);
+    painter.setFont(font);
+    painter.drawText(9*5,27*5,QStringLiteral("1."));
+    painter.drawText(9*5,33*5,QStringLiteral("2."));
+    painter.drawText(9*5,39*5,QStringLiteral("3."));
+    painter.drawText(9*5,45*5,QStringLiteral("4."));
+    painter.drawText(9*5,51*5,QStringLiteral("5."));
+    painter.drawText(9*5,57*5,QStringLiteral("6."));
+
+    painter.drawText(28*5,27*5,QStringLiteral("7."));
+    painter.drawText(28*5,33*5,QStringLiteral("8."));
+    painter.drawText(28*5,39*5,QStringLiteral("9."));
+    painter.drawText(28*5,45*5,QStringLiteral("10."));
+    painter.drawText(28*5,51*5,QStringLiteral("11."));
+    painter.drawText(28*5,57*5,QStringLiteral("12."));
+
+    painter.drawText(47*5,27*5,QStringLiteral("13."));
+    painter.drawText(47*5,33*5,QStringLiteral("14."));
+    painter.drawText(47*5,39*5,QStringLiteral("15."));
+    painter.drawText(47*5,45*5,QStringLiteral("16."));
+    painter.drawText(47*5,51*5,QStringLiteral("17."));
+    painter.drawText(47*5,57*5,QStringLiteral("18."));
+
+    painter.drawText(66*5,27*5,QStringLiteral("19."));
+    painter.drawText(66*5,33*5,QStringLiteral("20."));
+
+    painter.drawText(8*5,64*5,QStringLiteral("总数"));
+    painter.drawText(38*5,64*5,QStringLiteral("总重量"));
+    painter.drawText(68*5,64*5,QStringLiteral("总筒数"));
+
+    QRect target(0*5, 67*5, 100*5, 60*5);
+    barCode.draw(painter,target,bar);
+//    QRect source(-10*5, 0, 60*5, 40*5);
+//    painter.drawImage(target,barCode.draw(barCode.CodeBinary(bar),bar),source);
+//    barCode.draw(barCode.CodeBinary(bar),bar,&image);
+    font.setPixelSize(20);
+    font.setFamily("黑体");
+//    font.setBold(true);
+    painter.setFont(font);
+    painter.drawText(19*5,15*5,info->info().specs);//QStringLiteral("规格"));
+    painter.drawText(70*5,15*5,info->info().category);//QStringLiteral("类型"));
+    painter.drawText(19*5,21*5,info->info().batch_no);//QStringLiteral("批号"));
+    painter.drawText(70*5,21*5,QString::number(info->level_id));//info.at(0));
+    for(int i = 0; i < 20; ++i)
+    {
+        QString code = "";
+        if(i < info->boxes().size()) code = info->boxes().at(i)->caseNumber();
+        int line = i / 5;
+        int cloun = i % 5;
+        painter.drawText((13 + line * 19)*5,(27.5 + cloun * 6 )*5 ,code);
+    }
+/*
+    painter.drawText(13*5,27.5*5,info.at(1));
+    painter.drawText(13*5,33.5*5,info.at(2));
+    painter.drawText(13*5,39.5*5,info.at(3));
+    painter.drawText(13*5,45.5*5,info.at(4));
+    painter.drawText(13*5,51.5*5,info.at(5));
+    painter.drawText(13*5,57.5*5,info.at(6));
+
+    painter.drawText(32*5,27.5*5,info.at(7));
+    painter.drawText(32*5,33.5*5,info.at(8));
+    painter.drawText(32*5,39.5*5,info.at(9));
+    painter.drawText(32*5,45.5*5,info.at(10));
+    painter.drawText(32*5,51.5*5,info.at(11));
+    painter.drawText(32*5,57.5*5,info.at(12));
+
+    painter.drawText(51*5,27.5*5,info.at(13));
+    painter.drawText(51*5,33.5*5,info.at(14));
+    painter.drawText(51*5,39.5*5,info.at(15));
+    painter.drawText(51*5,45.5*5,info.at(16));
+    painter.drawText(51*5,51.5*5,info.at(17));
+    painter.drawText(51*5,57.5*5,info.at(18));
+
+    painter.drawText(70*5,27.5*5,info.at(19));
+    painter.drawText(70*5,33.5*5,info.at(20));
+*/
+    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(78*5,64*5,QString::number(info->tube_number()));
+
+
+//    print(image);
+
+//    image.save(path+"\\rukudan\\code"+bar+".bmp");
+    return image;
+}
+
+void DanJuMuBan::print(QImage image)
+{
+        QPrinter printer;
+        printer.setPageSize(QPrinter::Custom);
+        printer.setPageSizeMM(QSizeF(100,70));
+        printer.setPrinterName(GlobalInfo::this_()->config().printerName);
+        QPainter painter(&printer);                         // 创建一个QPainter对象,并指定绘图设备为一个QPainter对象
+        QRect rect =painter.viewport();                     // 获得QPainter对象的视图矩形区域
+        QSize size(image.width(),image.height());                            // 获得图像的大小
+        /* 按照图形的比例大小重新设置视图矩形区域 */
+        size.scale(rect.size(),Qt::KeepAspectRatio);
+        painter.setViewport(rect.x(),rect.y(),size.width()+50,size.height());
+        painter.setWindow(image.rect());                      // 设置QPainter窗口大小为图像的大小
+        painter.drawImage(0,0,image);                         // 打印图像
+//    }
+}

+ 44 - 0
handle/danjumuban.h

@@ -0,0 +1,44 @@
+#ifndef DANJUMUBAN_H
+#define DANJUMUBAN_H
+
+#include <QObject>
+#include <QPainter>
+#include <QtPrintSupport>
+#include "code39.h"
+#include <QList>
+#include "QPrintDialog"
+#include "packinfo.h"
+
+class DanJuMuBan
+{
+public:
+    DanJuMuBan();
+    //箱单
+    QImage printBoxInfo(QString bar,QSharedPointer<BoxInfo> info);//QList<QString> datalist,const QString company);
+    // 码单
+    QImage printPackInfo(QString bar, QSharedPointer<PackInfo> info);
+    void print(QImage image);
+private:
+    int MAXWIDTH=100;
+    int MAXHEIGHT=80;
+    int FONTHEIGHT=10;
+    Code39 barCode;
+//    QString pinming;
+//    QString maozhong;
+//    QString pihao;
+//    QString jingzhong;
+//    QString guige;
+//    QString tongshu;
+//    QString dengji;
+//    QString nianxiang;
+//    QString xianghao;
+//    QString guanse;
+//    QString path;
+//    QDateTime datetime;
+
+//    QString company = "南通市华安袜业有限公司";
+//    QString telephone = "0513-88249588";
+//    QString fax = "0513-88249589";
+};
+
+#endif // DANJUMUBAN_H

+ 216 - 0
handle/database.cpp

@@ -0,0 +1,216 @@
+#include "database.h"
+#include "QSqlRecord"
+
+Database::Database(QObject *parent) :
+    QObject(parent)
+{
+
+}
+
+Database::~Database()
+{
+    _database.close();
+}
+
+void Database::SetTableName(QString table)
+{
+    _tableName = table + ".db";
+}
+
+bool Database::openDB()
+{
+    _database = QSqlDatabase::addDatabase("QSQLITE","db");
+//    _database.setDatabaseName(_tableName);
+    _database.setDatabaseName(".//qtDb.db");
+    return _database.open();
+}
+
+bool Database::createDatabase()
+{
+    QSqlDatabase db = QSqlDatabase::database("db"); //建立数据库连接
+    QSqlQuery query(db);
+
+//    query.exec("DROP TABLE dabaodata");
+
+    bool success = query.exec("CREATE TABLE dabaodata ("
+                              "goods_id INTEGER NOT NULL,"
+                              "code_single INTEGER NOT NULL,"
+                              "level_id INTEGER NOT NULL,"
+                              "tube_number INTEGER NOT NULL,"
+                              "gross_weight DOUBLE NOT NULL,"
+                              "net_weight DOUBLE NOT NULL,"
+                              "machine_no VARCHAR(5),"
+                              "packing_time VARCHAR(15),"
+                              "packing_type VARCHAR(10),"
+                              "carton_type VARCHAR(5) NOT NULL,"
+                              "operator INTEGER NOT NULL,"
+                              "case_number INTEGER NOT NULL,"
+                              "backet_weight DOUBLE NOT NULL,"
+                              "sort VARCHAR NOT NULL,"
+                              "tongbu VARCHAR(1) DEFAULT 0,"
+                              "remark VARCHAR);");
+
+
+    if(success)
+    {
+        qDebug() << QObject::tr("数据库表创建成功!\n");
+        return true;
+    }
+    else
+    {
+        qDebug() << QObject::tr("数据库表创建失败!\n");
+        return false;
+    }
+}
+
+bool Database::changeState(QString xianghao)
+{
+    QSqlDatabase db = QSqlDatabase::database("db"); //建立数据库连接
+    QSqlQuery query(db);
+
+    bool success = query.exec("update dabaodata set tongbu=1 where case_number="+xianghao);
+    if(success)
+    {
+        return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+
+bool Database::insert(QString &table, QStringList &names, QStringList &values)
+{
+    if(names.size() != values.size())
+    {
+        return false;
+    }
+
+//    QSqlQuery query(QSqlDatabase::database());
+
+    QSqlDatabase db = QSqlDatabase::database("db"); //建立数据库连接
+    QSqlQuery query(db);
+
+    QString sql = QString("insert into ") + table + QString("(");
+
+    int i;
+    for(i = 0; i < names.size(); i++)
+    {
+        sql = sql + names.value(i);
+        if(i != names.size()-1)
+        {
+            sql += QString(",");
+        }
+        else
+        {
+            sql += QString(")");
+        }
+    }
+
+    sql = sql + QString("values (");
+
+    for(i = 0; i < values.size(); i++)
+    {
+        sql = sql + QString("'") + values.value(i) + QString("'");
+        if (i != values.size()-1)
+        {
+            sql += QString(",");
+        }
+    }
+    sql += QString(")");
+
+
+
+    return (query.exec(sql)) ? true : false;
+}
+
+bool Database::update(QString &table, QStringList &names, QStringList &values, QString &expression)
+{
+    if (names.size() != values.size())
+        return false;
+    //UPDATE 表名称 SET 列名称 = 新值 WHERE 列名称 = 某值
+//    QSqlQuery query(QSqlDatabase::database());
+
+    QSqlDatabase db = QSqlDatabase::database("db"); //建立数据库连接
+    QSqlQuery query(db);
+
+    QString sql = QString("update ")+table+QString(" set ");
+    for (int i = 0; i < names.size(); i++)
+    {
+        sql += names.value(i);
+        sql += QString(" = '");
+        sql = sql + values.value(i);
+        sql = sql + QString("'");
+        if (i != names.size()-1)
+            sql = sql + QString(" ,");
+    }
+    sql = sql + QString(" where ") + expression;
+    return (query.exec(sql)) ? true : false;
+}
+
+bool Database::del(QString &table, QString &expression)
+{
+    //DELETE FROM 表名称 WHERE 列名称 = 值
+    QSqlQuery query(QSqlDatabase::database());
+    QString sql = QString("delete from ") + table + QString(" where ") + expression;
+    return (query.exec(sql)) ? true : false;
+}
+
+QList<QStringList> Database::GetValues(QString &table, QStringList &values)
+{
+    dbmxdata.clear();
+    dbmxlist.clear();
+    QSqlDatabase db = QSqlDatabase::database("db"); //建立数据库连接
+    QSqlQuery query(db);
+
+    QString sql = QString("select * from ") + table;
+    query.exec(sql);
+    while (query.next())
+    {
+        for(int i = 0;i <= values.size()-1;i++){
+//            qDebug()<<values.at(i) << query.value(values.at(i)).toString();
+            dbmxdata.append(query.value(values.at(i)).toString());
+        }
+        dbmxlist.append(dbmxdata);
+        dbmxdata.clear();
+    }
+    return dbmxlist;
+}
+
+//void Database::connectDB(QString dbName, QString username, QString password)
+//{
+//    if (QSqlDatabase::contains("qt_sql_default_connection"))
+//    {
+//        database = QSqlDatabase::database("qt_sql_default_connection");
+//    }
+//    else
+//    {
+//        database = QSqlDatabase::addDatabase("QSQLITE");
+//        database.setDatabaseName(dbName);
+//        database.setUserName(username);
+//        database.setPassword(password);
+//    }
+
+//    if (!database.open())
+//    {
+//        qDebug() << "Error: Failed to connect database." << database.lastError();
+//    }
+//    else
+//    {
+//        QSqlQuery sql_query;
+//        QString create_sql;
+////        create_sql = "create table login (name varchar(100), logintime DATETIME)";
+//        sql_query.prepare(create_sql);
+//        if(!sql_query.exec())
+//        {
+//            qDebug() << "Error: Fail to create table." << sql_query.lastError();
+//        }
+//        else
+//        {
+//            qDebug() << "Table created!";
+//        }
+//    }
+
+//}
+
+

+ 58 - 0
handle/database.h

@@ -0,0 +1,58 @@
+#ifndef DATABASE_H
+#define DATABASE_H
+
+#include <QDebug>
+#include <QSqlDatabase>
+#include <QSqlError>
+#include <QSqlQuery>
+#include <QSqlTableModel>
+
+struct dabao
+{
+    int goods_id;
+    int code_single;
+    int quantity;
+    int level_id;
+    int tube_number;
+    double gross_weight;
+    double net_weight;
+    QString machine_no;
+    QString packing_time;
+    QString packing_type;
+    QString carton_type;
+    int user_id;
+    int case_number;
+    double backet_weight;
+    QString sort;
+    QString tongbu;
+    QString remark;
+};
+
+class Database : public QObject
+{
+    Q_OBJECT
+public:
+    explicit Database(QObject *parent = 0);
+    ~Database();
+//    void connectDB(QString dbName, QString username, QString password);
+//    void insertData();
+//    void deleteData();
+    void SetTableName(QString table);
+    bool openDB();
+    bool createDatabase();
+    bool changeState(QString xianghao);
+    bool insert(QString &table, QStringList &names, QStringList &values);
+    bool update(QString &table, QStringList &names, QStringList &values, QString &expression);
+    bool del(QString &table, QString &expression);
+    QList<QStringList> GetValues(QString &table, QStringList &values);
+
+
+private:
+    QSqlDatabase _database;
+    QSqlTableModel *model;
+    QString _tableName;
+    QList<QStringList> dbmxlist;
+    QStringList dbmxdata;
+};
+
+#endif // DATABASE_H

+ 119 - 0
handle/httprequest.cpp

@@ -0,0 +1,119 @@
+#include "httprequest.h"
+#include <QUrl>
+#include <QJsonParseError>
+#include <QNetworkReply>
+
+HttpRequest::HttpRequest(QObject *parent) : QObject(parent)
+{
+    connect(&_manager, &QNetworkAccessManager::finished, this, &HttpRequest::finishRequest);
+}
+
+
+void HttpRequest::get(const QString & url)
+{
+    QNetworkRequest req;
+    req.setUrl(QUrl(url));
+    initRequest(req);
+    _manager.get(req);
+}
+
+void HttpRequest::post(const QString & url, const QJsonObject & body)
+{
+     QNetworkRequest req;
+     initRequest(req, 1);
+     req.setHeader(QNetworkRequest::ContentTypeHeader,"application/json");
+     _manager.post(req, QJsonDocument(body).toJson());
+}
+
+void HttpRequest::post(const QString & url, const QMap<QString, QString> &body)
+{
+    QNetworkRequest req;
+    QHttpMultiPart * part = new QHttpMultiPart();
+    part->setContentType(QHttpMultiPart::FormDataType);
+    req.setUrl(QUrl(url));
+    initRequest(req, 1);
+    auto v = QString("multipart/form-data;boundary=%1").arg(QString(part->boundary()));
+    req.setHeader(QNetworkRequest::ContentTypeHeader,v);
+    initMultiPart(*part, body);
+    auto rep = _manager.post(req, part);
+    part->setParent(rep);
+
+}
+
+//void HttpRequest::post(const QString & url,const QMap<QString,QVariant> body)
+//{
+////    qDebug()<<body;
+//    QNetworkRequest req;
+//    QHttpMultiPart * part = new QHttpMultiPart();
+//    part->setContentType(QHttpMultiPart::FormDataType);
+//    req.setUrl(QUrl(url));
+//    initRequest(req, 1);
+//    auto v = QString("multipart/form-data;boundary=%1").arg(QString(part->boundary()));
+//    req.setHeader(QNetworkRequest::ContentTypeHeader,v);
+//    initMultiPart(*part, body);
+//    auto rep = _manager.post(req, part);
+//    part->setParent(rep);
+
+//}
+
+void HttpRequest::finishRequest(QNetworkReply * reply)
+{
+    if (reply->error()){
+        qDebug()<<"Error!"<<endl;
+        emit result(500, QJsonObject());
+    }else{
+        QByteArray byte_array = reply->readAll();
+        QJsonParseError json_error;
+        QJsonDocument parse_document = QJsonDocument::fromJson(byte_array, &json_error);
+        if(json_error.error == QJsonParseError::NoError)
+        {
+            if(parse_document.isObject())
+            {
+                emit result(200, parse_document.object());
+                reply->deleteLater();
+                return;
+            }
+        }
+        emit result(200, QJsonObject());
+    }
+    reply->deleteLater();
+}
+
+void HttpRequest::initRequest(QNetworkRequest & req, bool post)
+{
+    if(!_aid.isEmpty()){
+        req.setRawHeader("Auid",_aid.toUtf8());
+        req.setRawHeader("Access-Token",_token.toUtf8());
+    }
+//    if(post)
+//    {
+//        req.setHeader(QNetworkRequest::ContentTypeHeader,"multipart/form-data");
+//    }
+}
+
+void HttpRequest::initMultiPart(QHttpMultiPart & part,const QMap<QString,QString> body)
+{
+    for(auto begin = body.begin(); begin != body.end(); ++begin){
+        QHttpPart textPart;
+        textPart.setHeader(QNetworkRequest::ContentDispositionHeader, QString("form-data; name=\"%1\"").arg(begin.key()));
+        textPart.setBody(begin.value().toUtf8());
+        part.append(textPart);
+    }
+}
+
+//void HttpRequest::initMultiPart(QHttpMultiPart & part,const QMap<QString,QVariant> body)
+//{
+//    for(auto begin = body.begin(); begin != body.end(); ++begin){
+//        QHttpPart textPart;
+//        textPart.setHeader(QNetworkRequest::ContentDispositionHeader, QString("form-data; name=\"%1\"").arg(begin.key()));
+//        if(begin.value().typeName()=="QString")
+//        {
+//            textPart.setBody(begin.value().toString().toUtf8());
+//        }
+//        else
+//        {
+//            textPart.setBody(begin.value().toByteArray());
+//        }
+//        part.append(textPart);
+//    }
+//}

+ 59 - 0
handle/httprequest.h

@@ -0,0 +1,59 @@
+#ifndef HTTPREQUEST_H
+#define HTTPREQUEST_H
+
+#include <QObject>
+#include <QMap>
+#include <QJsonObject>
+#include <QNetworkAccessManager>
+#include <QNetworkRequest>
+#include <QHttpMultiPart>
+
+class HttpRequest : public QObject
+{
+    Q_OBJECT
+
+public:
+    explicit HttpRequest(QObject *parent = nullptr);
+
+    inline void setUserToken(const QString & aid, const QString & token)
+    {
+        _aid = aid;
+        _token = token;
+    }
+
+    inline QString getUser()
+    {
+        return _aid;
+    }
+    inline QString getUserToken()
+    {
+        return _token;
+    }
+
+signals:
+    void result(int code, const QJsonObject & body);
+
+public slots:
+    void get(const QString & url);
+    void post(const QString & url, const QMap<QString,QString>  & body);
+    void post(const QString & url, const QJsonObject & body);
+//    void post(const QString & url, const QMap<QString,QVariant> body);
+
+
+private slots:
+    void finishRequest(QNetworkReply*);
+
+private:
+    void initRequest(QNetworkRequest & req, bool post = false);
+    void initMultiPart(QHttpMultiPart & part,const QMap<QString,QString> body);
+//    void initMultiPart(QHttpMultiPart & part,const QMap<QString,QVariant> body);
+
+
+private:
+    QString _aid;
+    QString _token;
+    QNetworkAccessManager _manager;
+
+};
+
+#endif // HTTPREQUEST_H

+ 85 - 0
handle/remotepackconfig.cpp

@@ -0,0 +1,85 @@
+#include "remotepackconfig.h"
+#include "globalinfo.h"
+
+RemotePackConfig::RemotePackConfig(QObject *parent) : QObject(parent)
+{
+    connect(&_request,&HttpRequest::result,this,&RemotePackConfig::result);
+}
+
+void RemotePackConfig::refConfig()
+{
+    GlobalInfo * glo = GlobalInfo::this_();
+//    _aid = QString::number(body["user_id"].toInt());
+//    _token = body["access_token"].toString();
+    _request.setUserToken(QString::number( glo->user().accountId) ,glo->user().acessToken);
+    QString url = glo->config().baseUrl +  "/v1/configuration";
+    _request.get(url);
+}
+
+void RemotePackConfig::result(int code, const QJsonObject & body)
+{
+    int ecode = body.value("code").toInt(404);
+    if(ecode != 200){
+        emit configUpdateError(ecode,body.value("message").toString(""));
+        return;
+    }
+    QJsonArray object = body.value("data").toArray();
+    _config.jitai = getConfig(object, "A1000100");//机台
+    _config.dangchegongbanci = getConfig(object, "A1000101");//挡车工班次
+    _config.dabaogongbanci = getConfig(object, "A1000102");//机台
+    _config.xiangzhong = getConfig(object, "A1000103");//箱重
+
+    _config.tongzhong = getConfig(object, "A1000104");//筒重
+
+    _config.guanse = getConfig(object, "A1000105");//管色
+    _config.nianxiang = getConfig(object, "A1000106");//捻向
+    _config.zhixiang = getConfig(object, "A1000107");//纸箱
+    _config.mashu = getConfig(object, "A1000108");//码数
+
+    _config.chezhong = getConfig(object, "A1000109");//车重
+
+    _config.ganghao = getConfig(object, "A1000110");//缸号
+    _config.xianghaoxianshiguize = getConfig(object, "A1000111");//箱号显示规则
+    _config.dabaojiruku = getConfig(object, "A1000112");//打包即入库
+
+    _config.dabaoriqishijianxianshifangshi = getConfig(object, "A100013");//打包日期时间显示方式
+    emit configUpdate(_config);
+}
+
+QStringList RemotePackConfig::getConfig(const QJsonArray & data,const QString & key)
+{
+//        QJsonArray data_array = data;
+    QStringList list;
+        int nSize = data.size();
+        for (int i = 0; i < nSize; ++i) {
+            QJsonValue data_content = data.at(i);
+            if (data_content.isObject()) {
+                QJsonObject data_object = data_content.toObject();
+                if(data_object["key"]==key){
+                    QJsonValue value = data_object.value("value");
+                    if (value.isArray()) {
+                        QJsonArray value_array = value.toArray();
+                        int vSize = value_array.size();
+                        for(int i = 0; i < vSize; ++i){
+                            QJsonValue value_content = value_array.at(i);
+                            if(value_content.isObject()){
+                                QJsonObject value_object = value_content.toObject();
+                                QString option;
+                                if(value_object["value"].isString())
+                                {
+                                    option = value_object["value"].toString();
+                                }
+                                if(value_object["value"].isDouble())
+                                {
+                                    double mid_key = value_object["value"].toDouble();
+                                    option = QString::number(mid_key);
+                                }
+                                list.append(option);
+                            }
+                        }
+                    }
+                }
+            }
+}
+        return list;
+}

+ 47 - 0
handle/remotepackconfig.h

@@ -0,0 +1,47 @@
+#ifndef REMOTEPACKCONFIG_H
+#define REMOTEPACKCONFIG_H
+
+#include <QObject>
+#include "httprequest.h"
+#include <QJsonArray>
+
+struct RPConfig
+{
+    QStringList jitai;//机台
+    QStringList dangchegongbanci;//挡车工班次
+    QStringList dabaogongbanci;//机台
+    QStringList xiangzhong;//箱重
+    QStringList tongzhong;//筒重
+    QStringList guanse;//管色
+    QStringList nianxiang;//捻向
+    QStringList zhixiang;//纸箱
+    QStringList mashu;//码数
+    QStringList chezhong;//车重
+    QStringList ganghao;//缸号
+    QStringList xianghaoxianshiguize;//箱号显示规则
+    QStringList dabaojiruku;//打包即入库
+    QStringList dabaoriqishijianxianshifangshi;//打包日期时间显示方式
+};
+
+class RemotePackConfig : public QObject
+{
+    Q_OBJECT
+public:
+    explicit RemotePackConfig(QObject *parent = nullptr);
+
+    inline HttpRequest & request() {return  _request;}
+signals:
+    void configUpdate(RPConfig & config);
+    void configUpdateError(int code,const QString & msg);
+public slots:
+    void refConfig();
+private slots:
+    void result(int code, const QJsonObject & body);
+private:
+    QStringList getConfig(const QJsonArray & obj, const QString & key);
+private:
+    HttpRequest _request;
+    RPConfig  _config;
+};
+
+#endif // REMOTEPACKCONFIG_H

+ 11 - 0
main.cpp

@@ -0,0 +1,11 @@
+#include "mainwindow.h"
+
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    MainWindow w;
+    w.show();
+    return a.exec();
+}

+ 15 - 0
mainwindow.cpp

@@ -0,0 +1,15 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
+MainWindow::MainWindow(QWidget *parent)
+    : QMainWindow(parent)
+    , ui(new Ui::MainWindow)
+{
+    ui->setupUi(this);
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+}
+

+ 21 - 0
mainwindow.h

@@ -0,0 +1,21 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+
+QT_BEGIN_NAMESPACE
+namespace Ui { class MainWindow; }
+QT_END_NAMESPACE
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    MainWindow(QWidget *parent = nullptr);
+    ~MainWindow();
+
+private:
+    Ui::MainWindow *ui;
+};
+#endif // MAINWINDOW_H

+ 301 - 0
mainwindow.ui

@@ -0,0 +1,301 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>600</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <layout class="QHBoxLayout" name="horizontalLayout">
+    <item>
+     <widget class="QStackedWidget" name="stackedWidget">
+      <widget class="QWidget" name="pageMain">
+       <layout class="QHBoxLayout" name="horizontalLayout_2">
+        <item>
+         <layout class="QVBoxLayout" name="verticalLayout">
+          <item>
+           <widget class="QWidget" name="widget" native="true">
+            <property name="maximumSize">
+             <size>
+              <width>999999</width>
+              <height>52</height>
+             </size>
+            </property>
+            <property name="styleSheet">
+             <string notr="true">background-color: rgb(0, 170, 255);</string>
+            </property>
+            <layout class="QGridLayout" name="gridLayout_5">
+             <item row="0" column="0">
+              <widget class="QLabel" name="label_9">
+               <property name="minimumSize">
+                <size>
+                 <width>0</width>
+                 <height>30</height>
+                </size>
+               </property>
+               <property name="maximumSize">
+                <size>
+                 <width>16777215</width>
+                 <height>30</height>
+                </size>
+               </property>
+               <property name="styleSheet">
+                <string notr="true">font: 12pt &quot;黑体&quot;;
+color: rgb(255, 255, 255);</string>
+               </property>
+               <property name="text">
+                <string>打包选择</string>
+               </property>
+              </widget>
+             </item>
+             <item row="0" column="1">
+              <widget class="QLabel" name="p2_user_lb">
+               <property name="minimumSize">
+                <size>
+                 <width>100</width>
+                 <height>30</height>
+                </size>
+               </property>
+               <property name="maximumSize">
+                <size>
+                 <width>16777215</width>
+                 <height>30</height>
+                </size>
+               </property>
+               <property name="text">
+                <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;right&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </widget>
+          </item>
+          <item>
+           <layout class="QGridLayout" name="gridLayout_4">
+            <item row="0" column="0">
+             <widget class="QPushButton" name="pushDingZHong">
+              <property name="minimumSize">
+               <size>
+                <width>80</width>
+                <height>115</height>
+               </size>
+              </property>
+              <property name="styleSheet">
+               <string notr="true">background-color: rgb(0, 170, 255);</string>
+              </property>
+              <property name="text">
+               <string>定重箱单打印</string>
+              </property>
+              <property name="iconSize">
+               <size>
+                <width>20</width>
+                <height>20</height>
+               </size>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="1">
+             <widget class="QPushButton" name="pushBuDingZhong">
+              <property name="minimumSize">
+               <size>
+                <width>80</width>
+                <height>115</height>
+               </size>
+              </property>
+              <property name="styleSheet">
+               <string notr="true">background-color: rgb(0, 255, 127);</string>
+              </property>
+              <property name="text">
+               <string>不定重箱单打印</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="2">
+             <widget class="QPushButton" name="pushXiaoBiaoqian">
+              <property name="minimumSize">
+               <size>
+                <width>80</width>
+                <height>115</height>
+               </size>
+              </property>
+              <property name="styleSheet">
+               <string notr="true">background-color: rgb(0, 170, 255);</string>
+              </property>
+              <property name="text">
+               <string>小标签打印</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="3">
+             <widget class="QPushButton" name="pushConfig">
+              <property name="minimumSize">
+               <size>
+                <width>80</width>
+                <height>115</height>
+               </size>
+              </property>
+              <property name="styleSheet">
+               <string notr="true">background-color: rgb(0, 85, 255);</string>
+              </property>
+              <property name="text">
+               <string>硬件配置</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="0">
+             <widget class="QPushButton" name="pushList">
+              <property name="minimumSize">
+               <size>
+                <width>80</width>
+                <height>115</height>
+               </size>
+              </property>
+              <property name="styleSheet">
+               <string notr="true">background-color: rgb(255, 170, 0);</string>
+              </property>
+              <property name="text">
+               <string>打包明细</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="1">
+             <widget class="QPushButton" name="pushBanZiDong">
+              <property name="minimumSize">
+               <size>
+                <width>80</width>
+                <height>115</height>
+               </size>
+              </property>
+              <property name="styleSheet">
+               <string notr="true">background-color: rgb(85, 255, 0);</string>
+              </property>
+              <property name="text">
+               <string>半自动箱单打印</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="2">
+             <widget class="QPushButton" name="pushAuto">
+              <property name="minimumSize">
+               <size>
+                <width>80</width>
+                <height>115</height>
+               </size>
+              </property>
+              <property name="styleSheet">
+               <string notr="true">background-color: rgb(0, 170, 255);</string>
+              </property>
+              <property name="text">
+               <string>自动箱单打印</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="pageLogin">
+       <layout class="QVBoxLayout" name="verticalLayout_2">
+        <item>
+         <spacer name="verticalSpacer">
+          <property name="orientation">
+           <enum>Qt::Vertical</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>20</width>
+            <height>150</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_3">
+          <item>
+           <spacer name="horizontalSpacer">
+            <property name="orientation">
+             <enum>Qt::Horizontal</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>40</width>
+              <height>20</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+          <item>
+           <widget class="QWidget" name="widgetLogin" native="true">
+            <property name="minimumSize">
+             <size>
+              <width>350</width>
+              <height>200</height>
+             </size>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>350</width>
+              <height>200</height>
+             </size>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <spacer name="horizontalSpacer_2">
+            <property name="orientation">
+             <enum>Qt::Horizontal</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>40</width>
+              <height>20</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <spacer name="verticalSpacer_2">
+          <property name="orientation">
+           <enum>Qt::Vertical</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>20</width>
+            <height>150</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </widget>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>800</width>
+     <height>33</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 68 - 0
packinfo.cpp

@@ -0,0 +1,68 @@
+#include "packinfo.h"
+#include "globalinfo.h"
+#include <QDateTime>
+
+int PackInfo::lastMin = 0;
+int PackInfo::lastNum = 1;
+
+PackInfo::PackInfo(const ProjectInfo & info) : _info(info)
+{
+    code_single = buildPackId();
+}
+
+
+BoxInfo::BoxInfo(QSharedPointer<PackInfo> pack,QString code):case_number(code),parent(pack)
+{}
+
+
+QString PackInfo::buildPackId()
+{
+    QDateTime now = QDateTime::currentDateTime();
+    int min = now.time().minute();
+    if(min != lastMin) lastNum = 1;
+    else lastNum ++;
+    QString packId = GlobalInfo::this_()->packNum() + now.toString("yyMMddhhmm") + QString::asprintf("%03d",lastNum);
+    if(lastNum > 999) return QString();
+    return packId;
+}
+
+QString PackInfo::buildBoxId()
+{
+     int nowNum = boxes().size() + 1;
+     QDateTime now = QDateTime::currentDateTime();
+     QString id = now.toString("yyMMddhhmmss") + GlobalInfo::this_()->packNum() + QString::asprintf("%03d",nowNum);
+     return id;
+}
+
+int PackInfo::tube_number()
+{
+    int ret = 0;
+    for(int i = 0; i < _boxes.size();++i){
+        ret += _boxes.at(i)->tube_number;
+    }
+    return ret;
+}
+
+int PackInfo::gross_weight()
+{
+    int ret = 0;
+    for(int i = 0; i < _boxes.size();++i){
+        ret += _boxes.at(i)->gross_weight;
+    }
+    return ret;
+}
+
+int PackInfo::net_weight()
+{
+    int ret = 0;
+    for(int i = 0; i < _boxes.size();++i){
+        ret += _boxes.at(i)->net_weight;
+    }
+    return ret;
+}
+
+QSharedPointer<BoxInfo> PackInfo::addBoxInfo()
+{
+    QSharedPointer<BoxInfo> ret(new BoxInfo(sharedFromThis(),buildBoxId()));
+    return ret;
+}

+ 74 - 0
packinfo.h

@@ -0,0 +1,74 @@
+#ifndef PACKINFO_H
+#define PACKINFO_H
+
+#include <QString>
+#include <QSharedPointer>
+#include "configinfo.h"
+
+class PackInfo;
+
+struct BoxInfo
+{
+
+    inline QSharedPointer<PackInfo> parentPack() {
+        return parent.toStrongRef();
+    }
+
+    inline QString caseNumber() {return case_number;}
+
+    int  box_weight = 0;//	是	int	皮重 单位:克
+    int  tube_number = 0;//	是	int	筒数
+    int  bucket_weight = 0;//	是	int	总筒重 单位:克
+    int gross_weight = 0;//	是	int	毛重 单位:克
+    int net_weight = 0;//	是	int	净重 单位:克
+    QString sort;//	是	string	排序
+    QString remark;//	否	string	备注
+private:
+    BoxInfo(QSharedPointer<PackInfo> pack,QString code);
+    QString case_number;//	是	string	箱号
+    QWeakPointer<PackInfo> parent;
+    friend class PackInfo;
+};
+
+class PackInfo : public QEnableSharedFromThis<PackInfo>
+{
+public:
+    PackInfo(const ProjectInfo & info);
+
+    //QString code_single	是	string	码单
+    int quantity = 0;//	是	int	箱数
+    int level_id = 0;//	是	int	等级ID
+    QString level;
+//    int tube_number;//	是	int	筒数
+//    int gross_weight;//	是	int	毛重 单位:克
+//    int net_weight;//	是	int	净重 单位:克
+    int machine_no = 0;//	是	string	机台
+    int packing_time = 0;//	是	string	打包时间
+    int packing_type = 0;//	是	string	打包类型
+    QString carton_type;//	是	string	纸箱
+    int operator_id = 0;//	是	int	操作员ID
+//    details	是	array	成品详情
+    QString remark;//	否	string
+
+    inline const QList<QSharedPointer<BoxInfo>> & boxes() const {return _boxes;}
+    inline const ProjectInfo & info() const {return _info;}
+
+    int tube_number();
+    int gross_weight();
+    int net_weight();
+
+    QSharedPointer<BoxInfo> addBoxInfo();
+
+private:
+    QString buildPackId();
+    QString buildBoxId();
+private:
+    QList<QSharedPointer<BoxInfo>> _boxes;
+    ProjectInfo _info;
+    QString code_single;
+    int goods_id;
+    static int lastMin;
+    static int lastNum;
+};
+
+#endif // PACKINFO_H

+ 82 - 0
widget/autopackform.cpp

@@ -0,0 +1,82 @@
+#include "autopackform.h"
+#include "ui_autopackform.h"
+#include "globalinfo.h"
+
+AutoPackForm::AutoPackForm(QWidget *parent) :
+    QWidget(parent),
+    ui(new Ui::AutoPackForm)
+{
+    ui->setupUi(this);
+}
+
+AutoPackForm::~AutoPackForm()
+{
+    delete ui;
+}
+
+void AutoPackForm::on_pushBack_clicked()
+{
+    doSend(packinfo);
+    emit back();
+}
+
+void AutoPackForm::init()
+{
+    ui->pushStart->setChecked(false);
+    ui->widget->setEnabled(true);
+//    ui->madan
+}
+
+void AutoPackForm::on_addPackList_clicked()
+{
+    doSend(packinfo);
+    packinfo.reset(new PackInfo(_info));
+    packinfo->operator_id = GlobalInfo::this_()->user().userId;
+}
+
+void AutoPackForm::upconfig(const RPConfig & config)
+{
+    ui->jitai->clear();
+    ui->jitai->addItems(config.jitai);
+
+    ui->dengji->clear();
+
+    ui->tongzhong->clear();
+    ui->tongzhong->addItems(config.tongzhong);
+
+    ui->guanse->clear();
+    ui->guanse->addItems(config.guanse);
+
+    ui->nianxiang->clear();
+    ui->nianxiang->addItems(config.nianxiang);
+
+    ui->zhixiang->clear();
+    ui->zhixiang->addItems(config.zhixiang);
+
+    ui->xiangdan->clear();
+    ui->madan->clear();
+
+}
+
+void AutoPackForm::on_pushStart_clicked()
+{
+    if(ui->pushStart->isChecked()){
+        ui->pushStart->setChecked(true);
+        ui->widget->setEnabled(false);
+        ui->handleRead->setEnabled(true);
+    } else {
+        init();
+    }
+}
+
+void AutoPackForm::doSend(QSharedPointer<PackInfo> &info)
+{
+    if(info.isNull()) return;
+}
+
+void AutoPackForm::on_addBoxList_clicked()
+{
+    if(packinfo.isNull()) return;
+    auto box = packinfo->addBoxInfo();
+
+}

+ 46 - 0
widget/autopackform.h

@@ -0,0 +1,46 @@
+#ifndef AUTOPACKFORM_H
+#define AUTOPACKFORM_H
+
+#include <QWidget>
+#include "globalinfo.h"
+#include "handle/remotepackconfig.h"
+#include "packinfo.h"
+
+namespace Ui {
+class AutoPackForm;
+}
+
+class AutoPackForm : public QWidget
+{
+    Q_OBJECT
+
+public:
+    explicit AutoPackForm(QWidget *parent = nullptr);
+    ~AutoPackForm();
+
+    inline void setProInfo(const ProjectInfo & info){_info = info;}
+
+public slots:
+    void upconfig(const RPConfig & config);
+    void init();
+signals:
+    void back();
+
+private slots:
+    void on_pushBack_clicked();
+
+    void on_addPackList_clicked();
+
+
+    void doSend(QSharedPointer<PackInfo> & info);
+    void on_pushStart_clicked();
+
+    void on_addBoxList_clicked();
+
+private:
+    Ui::AutoPackForm *ui;
+    ProjectInfo _info;
+    QSharedPointer<PackInfo> packinfo;
+};
+
+#endif // AUTOPACKFORM_H

+ 769 - 0
widget/autopackform.ui

@@ -0,0 +1,769 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>AutoPackForm</class>
+ <widget class="QWidget" name="AutoPackForm">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>1087</width>
+    <height>653</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_3">
+   <item>
+    <widget class="QWidget" name="widget_4" native="true">
+     <property name="minimumSize">
+      <size>
+       <width>0</width>
+       <height>30</height>
+      </size>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_9">
+      <property name="topMargin">
+       <number>0</number>
+      </property>
+      <property name="bottomMargin">
+       <number>0</number>
+      </property>
+      <item>
+       <widget class="QPushButton" name="pushBack">
+        <property name="text">
+         <string>&lt;返回主页</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="horizontalSpacer_2">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>452</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QLabel" name="label_20">
+        <property name="text">
+         <string>自动打包</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="horizontalSpacer_3">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>451</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QWidget" name="widget_3" native="true">
+     <property name="styleSheet">
+      <string notr="true">background-color: rgb(0, 170, 255);</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_15">
+      <item>
+       <layout class="QVBoxLayout" name="verticalLayout">
+        <property name="spacing">
+         <number>0</number>
+        </property>
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_2">
+          <item>
+           <widget class="QLabel" name="label_8">
+            <property name="minimumSize">
+             <size>
+              <width>0</width>
+              <height>20</height>
+             </size>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>16777215</width>
+              <height>30</height>
+             </size>
+            </property>
+            <property name="text">
+             <string>毛重</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="label_14">
+            <property name="minimumSize">
+             <size>
+              <width>0</width>
+              <height>20</height>
+             </size>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>16777215</width>
+              <height>30</height>
+             </size>
+            </property>
+            <property name="text">
+             <string>皮重</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="label_9">
+            <property name="minimumSize">
+             <size>
+              <width>0</width>
+              <height>20</height>
+             </size>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>16777215</width>
+              <height>30</height>
+             </size>
+            </property>
+            <property name="text">
+             <string>筒数</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="label_15">
+            <property name="minimumSize">
+             <size>
+              <width>0</width>
+              <height>20</height>
+             </size>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>16777215</width>
+              <height>30</height>
+             </size>
+            </property>
+            <property name="text">
+             <string>净重</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_4">
+          <item>
+           <widget class="QLineEdit" name="grossWeight_2">
+            <property name="minimumSize">
+             <size>
+              <width>100</width>
+              <height>100</height>
+             </size>
+            </property>
+            <property name="text">
+             <string>0</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLineEdit" name="tareWeight_2">
+            <property name="minimumSize">
+             <size>
+              <width>100</width>
+              <height>100</height>
+             </size>
+            </property>
+            <property name="text">
+             <string>0</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLineEdit" name="tongshu">
+            <property name="minimumSize">
+             <size>
+              <width>100</width>
+              <height>100</height>
+             </size>
+            </property>
+            <property name="text">
+             <string>0</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLineEdit" name="netWeight_2">
+            <property name="minimumSize">
+             <size>
+              <width>100</width>
+              <height>100</height>
+             </size>
+            </property>
+            <property name="text">
+             <string>0</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <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="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="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>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QWidget" name="widgetTotle" native="true">
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_3">
+        <item>
+         <widget class="QLabel" name="label_16">
+          <property name="text">
+           <string>筒重:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLabel" name="label_17">
+          <property name="text">
+           <string>毛重:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLabel" name="label_18">
+          <property name="text">
+           <string>净重:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QPushButton" name="pushButton_16">
+          <property name="text">
+           <string>未同步列表</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QPushButton" name="pushButton_17">
+          <property name="text">
+           <string>同步</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QPushButton" name="pushButton_18">
+          <property name="text">
+           <string>PushButton</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QPushButton" name="pushButton_19">
+          <property name="text">
+           <string>批量修改</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="horizontalSpacer">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_5">
+     <property name="spacing">
+      <number>0</number>
+     </property>
+     <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>
+     <item>
+      <widget class="QWidget" name="widget" native="true">
+       <property name="minimumSize">
+        <size>
+         <width>450</width>
+         <height>402</height>
+        </size>
+       </property>
+       <layout class="QVBoxLayout" name="verticalLayout_16">
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_10">
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_4">
+            <item>
+             <widget class="QLabel" name="label">
+              <property name="text">
+               <string>码数</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QSpinBox" name="spinBox">
+              <property name="minimum">
+               <number>0</number>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout_6">
+            <property name="spacing">
+             <number>0</number>
+            </property>
+            <item>
+             <widget class="QRadioButton" name="buding">
+              <property name="minimumSize">
+               <size>
+                <width>71</width>
+                <height>41</height>
+               </size>
+              </property>
+              <property name="text">
+               <string>筒重不定</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QRadioButton" name="guding">
+              <property name="enabled">
+               <bool>true</bool>
+              </property>
+              <property name="minimumSize">
+               <size>
+                <width>71</width>
+                <height>41</height>
+               </size>
+              </property>
+              <property name="text">
+               <string>筒重固定</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout_7">
+            <property name="spacing">
+             <number>0</number>
+            </property>
+            <item>
+             <widget class="QCheckBox" name="autoRead">
+              <property name="minimumSize">
+               <size>
+                <width>71</width>
+                <height>41</height>
+               </size>
+              </property>
+              <property name="text">
+               <string>自动读数</string>
+              </property>
+              <property name="checked">
+               <bool>true</bool>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QPushButton" name="handleRead">
+              <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>
+         <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>
+          <item>
+           <widget class="QCheckBox" name="autoPush">
+            <property name="text">
+             <string>6筒自动打包</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_13">
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_5">
+            <item>
+             <widget class="QLabel" name="label_2">
+              <property name="text">
+               <string>预设</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QSpinBox" name="spinBox_2">
+              <property name="value">
+               <number>20</number>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_6">
+            <item>
+             <widget class="QLabel" name="label_3">
+              <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_4">
+              <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_5">
+              <property name="text">
+               <string>筒重</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="tongzhong"/>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_14">
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_9">
+            <item>
+             <widget class="QLabel" name="label_6">
+              <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_7">
+              <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_10">
+              <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_11">
+              <property name="text">
+               <string>箱单</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="xiangdan">
+              <property name="enabled">
+               <bool>false</bool>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_12">
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_13">
+            <item>
+             <widget class="QLabel" name="label_12">
+              <property name="text">
+               <string>码单</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="madan">
+              <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_13">
+              <property name="text">
+               <string>箱单抬头</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QLineEdit" name="taitou"/>
+            </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>
+       </layout>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 76 - 0
widget/loginform.cpp

@@ -0,0 +1,76 @@
+#include "loginform.h"
+#include "ui_loginform.h"
+#include <QMessageBox>
+#include "globalinfo.h"
+
+LoginForm::LoginForm(QWidget *parent) :
+    QWidget(parent),
+    ui(new Ui::LoginForm),_request(nullptr)
+{
+    ui->setupUi(this);
+    connect(this,&LoginForm::loginFinish,this,&LoginForm::clear);
+    ui->status->setVisible(false);
+    this->setEnabled(true);
+}
+
+LoginForm::~LoginForm()
+{
+    delete ui;
+}
+
+void LoginForm::on_pushLogin_clicked()
+{
+    auto glo = GlobalInfo::this_();
+    auto uname = this->ui->lineUser->text();
+    auto upass = this->ui->linePass->text();
+    auto url = glo->config().baseUrl + "/v1/signin";
+    QMap<QString,QString> params;
+    params.insert("password",uname);
+    params.insert("username",upass);
+    request()->post(url,params);
+    ui->status->setVisible(true);
+    this->setEnabled(false);
+}
+
+
+void  LoginForm::clear(){
+    if(_request){
+        delete  _request;
+        _request = nullptr;
+    }
+}
+
+HttpRequest  * LoginForm::request()
+{
+
+    if(!_request){
+        _request = new HttpRequest(this);
+        connect(_request,&HttpRequest::result,this,&LoginForm::result);
+    }
+    return _request;
+}
+
+
+void LoginForm::result(int code, const QJsonObject & body)
+{
+    ui->status->setVisible(false);
+    this->setEnabled(true);
+    QString message = body["message"].toString();
+    if(body.value("code").toInt(404) != 200){
+        QMessageBox msg(QMessageBox::Information, "错误", "用户名或密码错误", QMessageBox::Ok, this);
+        msg.show();
+//        ui->username->clear();
+//        ui->password->clear();
+        return;
+    }
+    auto data  = body.value("data").toObject();
+    UserInfo user;
+    user.accountId = data["account_id"].toInt();
+    user.userId = data["user_id"].toInt();
+    user.userName = data["name"].toString();
+    user.headPortrait = data["head_portrait"].toString();
+    user.isVip = data["is_vip"].toInt(-1) == 1 ? true : false;
+    user.acessToken = data["access_token"].toString();
+    GlobalInfo::this_()->setUser(user);
+    emit loginFinish();
+}

+ 34 - 0
widget/loginform.h

@@ -0,0 +1,34 @@
+#ifndef LOGINFORM_H
+#define LOGINFORM_H
+
+#include <QWidget>
+#include <handle/httprequest.h>
+
+namespace Ui {
+class LoginForm;
+}
+
+class LoginForm : public QWidget
+{
+    Q_OBJECT
+
+public:
+    explicit LoginForm(QWidget *parent = nullptr);
+    ~LoginForm();
+
+signals:
+    void loginFinish();
+private slots:
+    void on_pushLogin_clicked();
+
+    void result(int code, const QJsonObject & body);
+
+    void clear();
+private:
+    HttpRequest  * request();
+private:
+    Ui::LoginForm *ui;
+    HttpRequest  * _request;
+};
+
+#endif // LOGINFORM_H

+ 107 - 0
widget/loginform.ui

@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>LoginForm</class>
+ <widget class="QWidget" name="LoginForm">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>350</width>
+    <height>200</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <widget class="QLabel" name="label">
+   <property name="geometry">
+    <rect>
+     <x>40</x>
+     <y>50</y>
+     <width>58</width>
+     <height>18</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>用户名:</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_2">
+   <property name="geometry">
+    <rect>
+     <x>40</x>
+     <y>90</y>
+     <width>58</width>
+     <height>18</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>密码:</string>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="lineUser">
+   <property name="geometry">
+    <rect>
+     <x>120</x>
+     <y>40</y>
+     <width>191</width>
+     <height>32</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="linePass">
+   <property name="geometry">
+    <rect>
+     <x>120</x>
+     <y>80</y>
+     <width>191</width>
+     <height>32</height>
+    </rect>
+   </property>
+   <property name="echoMode">
+    <enum>QLineEdit::Password</enum>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushLogin">
+   <property name="geometry">
+    <rect>
+     <x>70</x>
+     <y>120</y>
+     <width>181</width>
+     <height>51</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>登陆</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushButton_2">
+   <property name="geometry">
+    <rect>
+     <x>297</x>
+     <y>163</y>
+     <width>51</width>
+     <height>31</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>设置</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="status">
+   <property name="geometry">
+    <rect>
+     <x>80</x>
+     <y>10</y>
+     <width>201</width>
+     <height>21</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>正在登陆中······</string>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 135 - 0
widget/selectvalueform.cpp

@@ -0,0 +1,135 @@
+#include "selectvalueform.h"
+#include "ui_selectvalueform.h"
+#include "globalinfo.h"
+#include <QJsonArray>
+
+SelectValueForm::SelectValueForm(QWidget *parent) :
+    QWidget(parent),
+    ui(new Ui::SelectValueForm),nowPage(0),pageListNum(20),totlePage(1),totleNum(0)
+{
+    ui->setupUi(this);
+    connect(&_request,&HttpRequest::result,this,&SelectValueForm::result);
+    ui->widget->hide();
+}
+
+SelectValueForm::~SelectValueForm()
+{
+    delete ui;
+}
+
+void SelectValueForm::getInfo(int page, int pageListNum)
+{
+    nowPage = page;
+    this->pageListNum = pageListNum;
+    auto glo = GlobalInfo::this_();
+     auto url = glo->config().baseUrl + QString("/v1/goods/list?page=%1&limit=%2").arg(nowPage).arg(pageListNum);
+     _request.get(url);
+
+}
+
+void SelectValueForm::result(int code, const QJsonObject & body)
+{
+    if(body.value("code").toInt(404) != 200){
+        nowPage = 0;
+        pageListNum = 20;
+        totlePage = 0;
+        totleNum = 0;
+        return;
+    }
+    currtInfo.clear();
+    totleNum = body.value("total").toInt();
+    QJsonArray ary = body.value("data").toArray();
+    for(int i =0; i < ary.size(); ++i){
+        parseObject(ary.at(i).toObject());
+    }
+    refPage();
+}
+
+
+void SelectValueForm::parseObject(const QJsonObject & obj)
+{
+    ProjectInfo info;
+    info.dtex = obj.value("detx").toString();
+
+    info.goods_id = obj.value("goods_id").toInt();
+    info.batch_no = obj.value("batch_no").toString();
+    info.category = obj.value("category").toString();
+    info.product_type_code = obj.value("product_type_code").toString();
+    info.spec_role = obj.value("spec_role").toString();
+    info.denier = obj.value("denier").toString();
+//    info.dtex = obj.value("detx").toString();
+    info.fiber = obj.value("fiber").toString();
+    info.specs = obj.value("specs").toString();
+    info.color = obj.value("color").toString();
+    info.twist_type = obj.value("twist_type").toString();
+    info.bucket_color = obj.value("bucket_color").toString();
+    info.box_weight = obj.value("box_weight").toString();
+    info.bucket_weight = obj.value("bucket_weight").toString();
+    info.machine_no = obj.value("machine_no").toString();
+    info.carton_type = obj.value("carton_type").toString();
+    info.limit_number = obj.value("limit_number").toString();
+    info.bucket_number = obj.value("bucket_number").toString();
+    info.cake_float = obj.value("cake_float").toString();
+    info.box_float = obj.value("box_float").toString();
+    info.box_rule = obj.value("box_rule").toString();
+    info.customer = obj.value("customer").toString();
+    info.remark = obj.value("remark").toString();
+    info.is_disable  = obj.value("is_disable").toBool();
+    info.create_time = obj.value("create_time").toInt();
+    info.modified_time = obj.value("modified_time").toInt();
+
+    currtInfo.append(info);
+
+}
+
+void SelectValueForm::refPage()
+{
+    ui->tableWidget->clearContents();
+    ui->tableWidget->setRowCount(0);
+    for(int i = 0; i < currtInfo.size(); ++i){
+        auto & v = currtInfo.at(i);
+        ui->tableWidget->insertRow(i);
+        ui->tableWidget->setItem(i,0,new QTableWidgetItem(v.batch_no));
+        ui->tableWidget->setItem(i,1,new QTableWidgetItem(v.specs));
+        ui->tableWidget->setItem(i,2,new QTableWidgetItem(v.product_type_code));
+        ui->tableWidget->setItem(i,3,new QTableWidgetItem(v.category));
+        ui->tableWidget->setItem(i,4,new QTableWidgetItem(v.machine_no));
+        ui->tableWidget->setItem(i,5,new QTableWidgetItem(v.bucket_color));
+        ui->tableWidget->setItem(i,6,new QTableWidgetItem(v.twist_type));
+        ui->tableWidget->setItem(i,7,new QTableWidgetItem(v.color));
+    }
+    this->ui->labelTotle->setText(QString::number(totleNum));
+    totlePage = totleNum / pageListNum;
+    if(totleNum % pageListNum > 0)
+        totlePage ++;
+    this->ui->labelPages->setText(QString("%1/%2").arg(nowPage).arg(totlePage));
+}
+
+void SelectValueForm::on_pushPrev_clicked()
+{
+    if(nowPage > 0) {
+        nowPage --;
+        getInfo(nowPage);
+    }
+}
+
+void SelectValueForm::on_pushNext_clicked()
+{
+    if(nowPage < totlePage){
+        nowPage ++;
+        getInfo(nowPage);
+    }
+}
+
+void SelectValueForm::on_pushButton_2_clicked()
+{
+    int now = ui->tableWidget->currentRow();
+    if(now >=0 && now < currtInfo.size()){
+        emit selectProject(currtInfo.at(now),status);
+    }
+}
+
+void SelectValueForm::on_pushButton_3_clicked()
+{
+    emit back();
+}

+ 55 - 0
widget/selectvalueform.h

@@ -0,0 +1,55 @@
+#ifndef SELECTVALUEFORM_H
+#define SELECTVALUEFORM_H
+
+#include <QWidget>
+#include "configinfo.h"
+#include "handle/httprequest.h"
+
+namespace Ui {
+class SelectValueForm;
+}
+
+class SelectValueForm : public QWidget
+{
+    Q_OBJECT
+
+public:
+    explicit SelectValueForm(QWidget *parent = nullptr);
+    ~SelectValueForm();
+
+    void getInfo(int page, int pageListNum = 20);
+
+    inline void setStatus(int staus){status = staus;}
+signals:
+    void back();
+    void selectProject(const ProjectInfo & info, int status);
+
+
+private slots:
+    void result(int code, const QJsonObject & body);
+
+    void refPage();
+
+    void parseObject(const QJsonObject & obj);
+
+    void on_pushPrev_clicked();
+
+    void on_pushNext_clicked();
+
+    void on_pushButton_2_clicked();
+
+    void on_pushButton_3_clicked();
+
+
+private:
+    Ui::SelectValueForm *ui;
+    int nowPage;
+    int pageListNum;
+    int totlePage;
+    int totleNum;
+    QList<ProjectInfo>  currtInfo;
+    HttpRequest _request;
+    int status;
+};
+
+#endif // SELECTVALUEFORM_H

+ 415 - 0
widget/selectvalueform.ui

@@ -0,0 +1,415 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>SelectValueForm</class>
+ <widget class="QWidget" name="SelectValueForm">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>904</width>
+    <height>560</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_4">
+   <item>
+    <widget class="QWidget" name="widget_3" native="true">
+     <layout class="QHBoxLayout" name="horizontalLayout_6">
+      <item>
+       <widget class="QPushButton" name="pushButton_3">
+        <property name="text">
+         <string>&lt;返回主页</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="horizontalSpacer_5">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>346</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QLabel" name="label_10">
+        <property name="text">
+         <string>选择打包商品</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="horizontalSpacer_6">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>346</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_9">
+     <item>
+      <widget class="QWidget" name="widget" native="true">
+       <property name="minimumSize">
+        <size>
+         <width>211</width>
+         <height>491</height>
+        </size>
+       </property>
+       <property name="styleSheet">
+        <string notr="true">background-color: rgb(255, 255, 255);</string>
+       </property>
+       <widget class="QPushButton" name="pushButton">
+        <property name="geometry">
+         <rect>
+          <x>60</x>
+          <y>290</y>
+          <width>91</width>
+          <height>31</height>
+         </rect>
+        </property>
+        <property name="styleSheet">
+         <string notr="true"/>
+        </property>
+        <property name="text">
+         <string>搜索</string>
+        </property>
+        <property name="icon">
+         <iconset>
+          <normaloff>:/image/sousuo.png</normaloff>:/image/sousuo.png</iconset>
+        </property>
+        <property name="iconSize">
+         <size>
+          <width>124</width>
+          <height>32</height>
+         </size>
+        </property>
+       </widget>
+       <widget class="QWidget" name="layoutWidget_2">
+        <property name="geometry">
+         <rect>
+          <x>0</x>
+          <y>10</y>
+          <width>191</width>
+          <height>239</height>
+         </rect>
+        </property>
+        <layout class="QVBoxLayout" name="verticalLayout">
+         <item>
+          <widget class="QLabel" name="label">
+           <property name="text">
+            <string>筛选</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout">
+           <item>
+            <widget class="QLabel" name="label_2">
+             <property name="text">
+              <string>旦数</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QComboBox" name="comboBox">
+             <property name="styleSheet">
+              <string notr="true">background-color: rgb(255, 255, 255,0);</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_2">
+           <item>
+            <widget class="QLabel" name="label_3">
+             <property name="text">
+              <string>分特</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QComboBox" name="comboBox_2">
+             <property name="styleSheet">
+              <string notr="true">background-color: rgb(255, 255, 255,0);</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_3">
+           <item>
+            <widget class="QLabel" name="label_4">
+             <property name="text">
+              <string>孔数</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QComboBox" name="comboBox_3">
+             <property name="styleSheet">
+              <string notr="true">background-color: rgb(255, 255, 255,0);</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_4">
+           <item>
+            <widget class="QLabel" name="label_5">
+             <property name="text">
+              <string>类型</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QComboBox" name="comboBox_4">
+             <property name="styleSheet">
+              <string notr="true">background-color: rgb(255, 255, 255,0);</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_5">
+           <item>
+            <widget class="QLabel" name="label_6">
+             <property name="text">
+              <string>机台</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QComboBox" name="comboBox_5">
+             <property name="styleSheet">
+              <string notr="true">background-color: rgb(255, 255, 255,0);</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </widget>
+      </widget>
+     </item>
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <property name="spacing">
+        <number>0</number>
+       </property>
+       <item>
+        <widget class="QTableWidget" name="tableWidget">
+         <property name="editTriggers">
+          <set>QAbstractItemView::NoEditTriggers</set>
+         </property>
+         <property name="selectionMode">
+          <enum>QAbstractItemView::SingleSelection</enum>
+         </property>
+         <property name="selectionBehavior">
+          <enum>QAbstractItemView::SelectRows</enum>
+         </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>
+         <column>
+          <property name="text">
+           <string>捻向</string>
+          </property>
+         </column>
+         <column>
+          <property name="text">
+           <string>颜色</string>
+          </property>
+         </column>
+        </widget>
+       </item>
+       <item>
+        <widget class="QWidget" name="widget_2" native="true">
+         <property name="minimumSize">
+          <size>
+           <width>671</width>
+           <height>91</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>99999</width>
+           <height>91</height>
+          </size>
+         </property>
+         <property name="styleSheet">
+          <string notr="true">background-color: rgb(255, 255, 255);</string>
+         </property>
+         <layout class="QVBoxLayout" name="verticalLayout_3">
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout_7">
+            <item>
+             <spacer name="horizontalSpacer">
+              <property name="orientation">
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeType">
+               <enum>QSizePolicy::Expanding</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>40</width>
+                <height>20</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+            <item>
+             <widget class="QPushButton" name="pushPrev">
+              <property name="text">
+               <string>上一页</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QLabel" name="labelPages">
+              <property name="text">
+               <string>%1/%2</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QPushButton" name="pushNext">
+              <property name="text">
+               <string>下一页</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <spacer name="horizontalSpacer_3">
+              <property name="orientation">
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeType">
+               <enum>QSizePolicy::Minimum</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>40</width>
+                <height>20</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+            <item>
+             <widget class="QLabel" name="label_7">
+              <property name="text">
+               <string>一共</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QLabel" name="labelTotle">
+              <property name="text">
+               <string>%1</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QLabel" name="label_9">
+              <property name="text">
+               <string>条</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <spacer name="horizontalSpacer_2">
+              <property name="orientation">
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>40</width>
+                <height>20</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout_8">
+            <item>
+             <spacer name="horizontalSpacer_4">
+              <property name="orientation">
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>40</width>
+                <height>20</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+            <item>
+             <widget class="QPushButton" name="pushButton_2">
+              <property name="text">
+               <string>确定</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>