#ifndef QTELSALEPOLICYINFOINPUTWIDGET_H
#define QTELSALEPOLICYINFOINPUTWIDGET_H

#include <vector>
#include <QtWidgets/QtWidgets>
#include "DataManipulation.h"
#include "ui_QTelSalePolicyInfoInputWidget.h"

class QTelSalePolicyInfoInputWidget : public QWidget, public Ui::QTelSalePolicyInfoInputWidget
{
	Q_OBJECT

public:
	QTelSalePolicyInfoInputWidget(QWidget *parent = 0);
	~QTelSalePolicyInfoInputWidget();

public Q_SLOTS:
	void onSalerCodeChanged();
	void onQuerySalerName();
	void onAutoTraderCodeChanged();
	void onQueryAutoTraderName();
	void onSavePolicy();
	void onResetGiftsTable();
	void onGiftTableItemChanged( int row, int column );
	void onReset();

private:
	void init();
	void initWidget();
	void initSignal();
	void initData();
	void InitGiftTable();

	/************************************************
	* \brief 读取礼品列表
	* \param giftList 
	************************************************/
	void readGiftTable( vector<TelSalePolicyGift> & giftList );

private:
	string salerCode;
	string salerName;
	string salerDeptCode;
	string salerDeptName;
	string salerOfficeCode;
	string salerOfficeName;
	string autoTraderCode;
	string autoTraderName;

	vector<TelSalePolicyGift> giftsList;

	bool m_initing;
};

#endif // QTELSALEPOLICYINFOINPUTWIDGET_H
