#include <QScrollArea>
#include "QDataManagementWidget.h"


QDataManagementWidget::QDataManagementWidget( QWidget * parent )
	: QWidget( parent )
{
	ui.setupUi( this );

	init();
}

QDataManagementWidget::~QDataManagementWidget()
{
}

void QDataManagementWidget::init()
{
	initData();
	initWidgets();
	initSignal();
}

void QDataManagementWidget::initData()
{
}

void QDataManagementWidget::initWidgets()
{
	setLayout( ui.pLayoutMain );

	QScrollArea * pScrollArea       = nullptr;
	QGridLayout * pLayout           = nullptr;
	QGridLayout * pLayoutScrollArea = nullptr;

	//车商业绩表
	pScrollArea       = new QScrollArea( nullptr );
	pLayoutScrollArea = new QGridLayout;
	pLayout           = new QGridLayout;

	pLayout->setMargin(0);
	pLayoutScrollArea->setMargin(0);

	pLayout->addWidget( &achievementWidget );
	pLayoutScrollArea->addWidget( pScrollArea );
	pScrollArea->setLayout( pLayout );
	ui.pCarDealerAchievementTab->setLayout( pLayoutScrollArea );

	//车商方案表
	pScrollArea = new QScrollArea(nullptr);
	pLayoutScrollArea = new QGridLayout();
	pLayout = new QGridLayout();

	pLayoutScrollArea->setMargin(0);
	pLayout->setMargin(0);

	pLayout->addWidget(&schemaWidget);
	pLayoutScrollArea->addWidget(pScrollArea);
	pScrollArea->setLayout(pLayout);
	ui.pCarDealerSchemaTab->setLayout(pLayoutScrollArea);

	//卢霖城送返修推荐表
	pScrollArea = new QScrollArea(nullptr);
	pLayoutScrollArea = new QGridLayout();
	pLayout = new QGridLayout();

	pLayoutScrollArea->setMargin(0);
	pLayout->setMargin(0);

	pLayout->addWidget(&repairRecommendationWidget);
	pLayoutScrollArea->addWidget(pScrollArea);
	pScrollArea->setLayout(pLayout);
	ui.pRepairRecommandationTab->setLayout(pLayoutScrollArea);

	//新送返修监控
	pScrollArea = new QScrollArea(nullptr);
	pLayoutScrollArea = new QGridLayout();
	pLayout = new QGridLayout();

	pLayoutScrollArea->setMargin(0);
	pLayout->setMargin(0);

	pLayout->addWidget(&repairRecommendationWidget);
	pLayoutScrollArea->addWidget(pScrollArea);
	pScrollArea->setLayout(pLayout);
	ui.pNewRepairMonitorTab->setLayout(pLayoutScrollArea);

	//送返修工单
	pScrollArea = new QScrollArea(nullptr);
	pLayoutScrollArea = new QGridLayout();
	pLayout = new QGridLayout();

	pLayoutScrollArea->setMargin(0);
	pLayout->setMargin(0);

	pLayout->addWidget(&repairRecommendationWidget);
	pLayoutScrollArea->addWidget(pScrollArea);
	pScrollArea->setLayout(pLayout);
	ui.pRepairOrderTab->setLayout(pLayoutScrollArea);
}

void QDataManagementWidget::initSignal()
{
}
