#ifndef MODELSELECTFORM_H
#define MODELSELECTFORM_H

#include <QWidget>
#include "struct_/modelinfo.h"
#include "globalinfo.h"
#include <pqQtlib/core/pqapppath.h>
#include "pqQtlib/utils/pqfileutils.h"

namespace Ui {
class ModelSelectForm;
}

class ModelSelectForm : public QWidget
{
    Q_OBJECT

public:
    explicit ModelSelectForm(QWidget *parent = nullptr);
    ~ModelSelectForm();

public slots:
    void changeStackedWidget(int status);

    void changeToSelectBoxWidget();//获取箱单列表
    void changeToSelectPackWidget();//获取码单列表
    void selectBoxModelFoName(QString BaseModelName);//根据基础模板添加tablewidget
    void selectPackModelFoName(QString baseModelName);//根据基础模板添加tablewidget

signals:
    void back();
    //箱单信号
    void addBoxModel(QString baseModelName,int status,QString ModelName = nullptr);
    void showBaseBoxModel(QString baseModelName,int status,QString ModelName = nullptr);
    void editBoxModeled(QString baseModelName,int status,QString modelName);

    //码单信号
    void addPackModel(QString baseModelName,int status,QString ModelName = nullptr);
    void showBasePackModel(QString baseModelName,int status,QString ModelName = nullptr);
    void editPackModeled(QString baseModelName,int status,QString ModelName);

private slots:
    void on_backButton_clicked();

    void on_backButton_2_clicked();

private slots:
    //箱单按钮功能
    void addNewBoxModel(QString baseModelName);
    void boxModelView(QString baseModelName);
    void editBoxModel(QString baseModelName,QString ModelName);
    void delBoxModel(QString ModelName);

    //码单按钮功能
    void addNewPackModel(QString baseModelName);
    void packModelView(QString baseMOdelName);
    void editPackModel(QString baseModelName,QString ModelName);
    void delPackModel(QString ModelName);


private:
    void test();


private:
    Ui::ModelSelectForm *ui;
    GlobalInfo * glo = GlobalInfo::this_();
    QList<QSharedPointer<BoxModel>> boxModelList;
    QList<QSharedPointer<PackModel>> packModelList;

    QDir _dataDir;
};

#endif // MODELSELECTFORM_H
