窗口界面开发完成!

This commit is contained in:
Kane Wang 2020-12-08 17:59:27 +08:00
parent 1667755910
commit 50304c0c80
26 changed files with 335 additions and 161 deletions

View File

@ -36909,94 +36909,94 @@ static const unsigned char qt_resource_struct[] = {
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
// :/QMainFrame/Resources/8218_box1.png
0x0,0x0,0x1,0x2,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x3f,0xef,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0xe,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x6a,
// :/QMainFrame/Resources/find.png
0x0,0x0,0x1,0x22,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0xaa,0x5f,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x22,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x75,
// :/QMainFrame/Resources/print.png
0x0,0x0,0x1,0x62,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x2,0x47,0x63,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x2d,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x7c,
// :/QMainFrame/Resources/option.png
0x0,0x0,0x2,0x94,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x7,0x6,0xb8,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x2b,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x7b,
// :/QMainFrame/Resources/x.png
0x0,0x0,0x2,0x2c,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x5,0x6a,0x2d,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x34,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x80,
// :/QMainFrame/Resources/telephone.png
0x0,0x0,0x2,0xc4,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x7,0xb2,0x8,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x32,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x7e,
// :/QMainFrame/Resources/plus.png
0x0,0x0,0x2,0x52,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x6,0x5d,0x5f,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x2c,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x7b,
// :/QMainFrame/Resources/20121016085311441_easyicon_cn_128.png
0x0,0x0,0x0,0x82,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x77,0x17,
0x0,0x0,0x1,0x73,0x52,0xd3,0xd,0xf7,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x69,
// :/QMainFrame/Resources/new.png
0x0,0x0,0x2,0xe4,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x7,0xcc,0x61,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x29,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x7a,
// :/QMainFrame/Resources/CPIC.png
0x0,0x0,0x2,0x3c,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x5,0xc9,0x50,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x11,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x6c,
// :/QMainFrame/Resources/ok.png
0x0,0x0,0x1,0x38,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0xe8,0x27,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x2a,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x7a,
// :/QMainFrame/Resources/face.png
0x0,0x0,0x1,0xc8,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x4,0x29,0xa6,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x21,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x75,
// :/QMainFrame/Resources/CNY_Red.png
0x0,0x0,0x1,0xf8,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x4,0xfc,0xe0,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0xf,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x6b,
// :/QMainFrame/Resources/car2.png
0x0,0x0,0x3,0x10,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x8,0x69,0x71,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x19,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x71,
// :/QMainFrame/Resources/app.ico
0x0,0x0,0x0,0x46,0x0,0x1,0x0,0x0,0x0,0x1,0x0,0x0,0x2,0x22,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x16,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x6f,
// :/QMainFrame/Resources/save.png
0x0,0x0,0x2,0x7e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x6,0xcf,0x1,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x30,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x7d,
// :/QMainFrame/Resources/car.png
0x0,0x0,0x0,0x5a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1f,0x7e,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x18,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x70,
// :/QMainFrame/Resources/cat.png
0x0,0x0,0x0,0x6e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x55,0x58,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x1b,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x72,
// :/QMainFrame/Resources/excel.png
0x0,0x0,0x2,0x14,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x5,0x51,0x43,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x1f,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x74,
// :/QMainFrame/Resources/CPIC??.png
0x0,0x0,0x1,0x7a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x2,0x9e,0xab,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x13,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x6d,
// :/QMainFrame/Resources/dec.png
0x0,0x0,0x0,0x32,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x1d,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x73,
// :/QMainFrame/Resources/folder.png
0x0,0x0,0x0,0xd2,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xcc,0x2a,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x23,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x76,
// :/QMainFrame/Resources/edit.png
0x0,0x0,0x2,0x68,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x6,0x61,0x1b,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x1e,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x74,
// :/QMainFrame/Resources/clean.png
0x0,0x0,0x2,0xf8,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x8,0x3a,0x47,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x1c,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x73,
// :/QMainFrame/Resources/gear.png
0x0,0x0,0x2,0xae,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x7,0x5c,0x60,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x24,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x78,
// :/QMainFrame/Resources/quit.png
0x0,0x0,0x0,0xec,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xe0,0xcc,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x2e,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x7c,
// :/QMainFrame/Resources/save2.png
0x0,0x0,0x1,0x4a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x2,0x29,0x5d,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x31,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x7e,
// :/QMainFrame/Resources/manager.png
0x0,0x0,0x1,0x94,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x3,0x55,0x8f,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x28,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x79,
// :/QMainFrame/Resources/login.png
0x0,0x0,0x1,0xb0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x3,0xb9,0xe4,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x26,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x79,
// :/QMainFrame/Resources/tongji.png
0x0,0x0,0x1,0xde,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x4,0x8a,0x1,
0x0,0x0,0x1,0x73,0x52,0xd3,0xe,0x33,
0x0,0x0,0x1,0x72,0x96,0xa9,0x44,0x7f,
};

View File

@ -1,4 +1,10 @@

#include "AppParameters.h"
using namespace std;
UserInfo * pStaffInfo = nullptr;
const string SYSTEM_ADMIN = "999";
const string ADMIN = "000";
const string TEAM_LEADER = "000";

View File

@ -1,7 +1,11 @@

#pragma once
#include <iostream>
#include "../Datastructure/UserInfo/UserInfo.h"
extern UserInfo * pStaffInfo;
extern const std::string SYSTEM_ADMIN;
extern const std::string ADMIN;
extern const std::string TEAM_LEADER;

View File

@ -1,4 +1,4 @@
#include <libxl.h>
#include <libxl.h>
#include <stdexcept>
#include "LoadFromExcel.h"
#include "../../excel/excel.h"
@ -545,6 +545,15 @@ void LoadNewRepairMonitorReportFromXlsx( const std::wstring &
record._ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
record._ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
record._ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
if (record._.empty() == true)
{
//空行跳过
rowIndex++;
continue;
}
record._ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
record._ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
record._ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );

View File

@ -1094,13 +1094,12 @@ void ImportNewRepairMonitorToOracle( const std::string &
{
//rollback停止保存
string errorMessage = "报案号";
string notifyNo = QString::fromStdWString( iter->_ ).toLocal8Bit();
errorMessage.append( QString::fromStdWString( iter->_ ).toLocal8Bit() );
errorMessage.append( "保存失败,提示信息:" );
errorMessage.append( error.what() );
errorMessage.append( notifyNo );
errorMessage.append( "\n保存失败,提示信息:" );
errorMessage.append( QString::fromLocal8Bit( error.what()).toStdString() );
OCI_Rollback( pConnection );
OCI_ConnectionFree( pConnection );
OCI_Cleanup();
throw runtime_error( errorMessage );

View File

@ -1,2 +1,3 @@

#include "UserInfo.h"

View File

@ -1,4 +1,4 @@
//用户信息相关
//用户信息相关
#pragma once
#include <QString>
@ -6,12 +6,12 @@ class UserInfo
{
public:
UserInfo( const std::string & staffP13,
const std::string & staffName,
const std::string & staffPost )
: staff_p13( staffP13 ),
staff_name( staffName ),
staff_post( staffPost )
UserInfo( std::string staffP13, std::string staffName, std::string staffPost, std::string staffPostCode )
: staff_p13( std::move(staffP13) ),
staff_name( std::move(staffName) ),
staff_post( std::move(staffPost) ),
staff_post_code( std::move(staffPostCode) )
{
}
@ -19,14 +19,16 @@ public:
UserInfo( const UserInfo & other )
: staff_p13( other.staff_p13 ),
staff_name( other.staff_name ),
staff_post( other.staff_post )
staff_post( other.staff_post ),
staff_post_code( other.staff_post_code )
{
}
UserInfo( UserInfo && other )
: staff_p13( std::move(other.staff_p13) ),
staff_name( std::move(other.staff_name) ),
staff_post( std::move(other.staff_post) )
staff_post( std::move(other.staff_post) ),
staff_post_code( std::move(other.staff_post_code) )
{
}
@ -37,6 +39,7 @@ public:
staff_p13 = other.staff_p13;
staff_name = other.staff_name;
staff_post = other.staff_post;
staff_post_code = other.staff_post_code;
return *this;
}
@ -47,19 +50,11 @@ public:
staff_p13 = std::move( other.staff_p13 );
staff_name = std::move( other.staff_name );
staff_post = std::move( other.staff_post );
staff_post_code = std::move( other.staff_post_code );
return *this;
}
friend void swap( UserInfo & lhs, UserInfo & rhs ) noexcept
{
using std::swap;
swap( lhs.staff_p13, rhs.staff_p13 );
swap( lhs.staff_name, rhs.staff_name );
swap( lhs.staff_post, rhs.staff_post );
}
std::string getStaffP13() const
{
return staff_p13;
@ -90,8 +85,20 @@ public:
staff_post = staffPost;
}
std::string getStaffPostCode() const
{
return staff_post_code;
}
void setStaffPostCode( const std::string & staffPostCode )
{
staff_post_code = staffPostCode;
}
private:
std::string staff_p13;
std::string staff_name;
std::string staff_post;
std::string staff_post_code;
};

View File

@ -1,13 +1,15 @@
#include "query_user.h"
#include "query_user.h"
#include <stdexcept>
#include <ocilib.h>
#include "../../db/ocilib/db_oper.h"
#include "../Datastructure/UserInfo/UserInfo.h"
#include <ocilib.hpp>
using namespace std;
string ERROR_MESSAGE_USERERROR = "您的p13账号无权使用该系统\n请联系工作组添加!";
UserInfo queryUserInfo( const string & userName,
const string & password,
const string & tnsName,
@ -20,7 +22,7 @@ UserInfo queryUserInfo( const string & userName,
string sqlQueryStaff =
"SELECT a.staff_p13, a.staff_name, b.staff_post \n"
"SELECT a.staff_p13, a.staff_name, b.staff_post_code, b.staff_post \n"
"FROM staff_info a, \n"
"staff_post_code b \n"
"WHERE a.staff_post_code = b.staff_post_code \n"
@ -65,7 +67,7 @@ UserInfo queryUserInfo( const string & userName,
//检查结果集,如果没有返回,则说明没有此用户
if ( OCI_FetchNext( pResult ) == false )
{
throw runtime_error( "用户不存在!" );
throw runtime_error( ERROR_MESSAGE_USERERROR );
}
}
catch ( runtime_error & error )
@ -78,6 +80,7 @@ UserInfo queryUserInfo( const string & userName,
UserInfo info( OCI_GetString( pResult, 1 ),
OCI_GetString( pResult, 2 ),
OCI_GetString( pResult, 4 ),
OCI_GetString( pResult, 3 ));
OCI_ConnectionFree( pConn );

View File

@ -1,4 +1,4 @@
//查询用户、权限等相关数据
//查询用户、权限等相关数据
#pragma once
#include <iostream>

View File

@ -1,4 +1,4 @@
#include <QFileDialog>
#include <QFileDialog>
#include "QCarDealerAchievementWidget.h"
@ -77,6 +77,8 @@ void QCarDealerAchievementWidget::showCarDealerAchievement()
iter != achievementVector.end();
++iter, ++rowIndex )
{
columnIndex = 0;
//年度
pItem = new QTableWidgetItem( QString::fromStdWString( iter->getTheYear() ) );
pItem->setTextAlignment( Qt::AlignVCenter | Qt::AlignHCenter );

View File

@ -1,4 +1,4 @@
#include "QCarDealerSchemaWidget.h"
#include "QCarDealerSchemaWidget.h"
#include "../../../Data/DataManipulation/Excel/LoadFromExcel.h"
#include "../../../Data/DataManipulation/oracle/ImportToOracle.h"

View File

@ -1,6 +1,12 @@
#include <QScrollArea>
#include <QScrollArea>
#include "QDataManagementWidget.h"
#include <QMessageBox>
#include "../../../Data/AppParameters/AppParameters.h"
using namespace std;
QDataManagementWidget::QDataManagementWidget( QWidget * parent )
: QWidget( parent )
@ -19,6 +25,8 @@ void QDataManagementWidget::init()
initData();
initWidgets();
initSignal();
initWidgetByPrivileges();
}
void QDataManagementWidget::initData()
@ -102,3 +110,59 @@ void QDataManagementWidget::initWidgets()
void QDataManagementWidget::initSignal()
{
}
void QDataManagementWidget::initWidgetByPrivileges()
{
if ( pStaffInfo == nullptr )
{
QMessageBox::critical( nullptr,
"错误",
"权限错误!\n请殴打开发人员!" );
exit( 0 );
}
//状态设置
ui.pRepairOrderTab->setEnabled( false );
ui.pNewRepairMonitorTab->setEnabled( false );
ui.pRepairRecommandationTab->setEnabled( false );
ui.pCarDealerSchemaTab->setEnabled( false );
ui.pCarDealerAchievementTab->setEnabled( false );
string staffPostCode = pStaffInfo->getStaffPostCode();
if (staffPostCode == SYSTEM_ADMIN )
{
//系统管理员
ui.pRepairOrderTab->setEnabled( true );
ui.pNewRepairMonitorTab->setEnabled( true );
ui.pRepairRecommandationTab->setEnabled( true );
ui.pCarDealerSchemaTab->setEnabled( true );
ui.pCarDealerAchievementTab->setEnabled( true );
ui.tabWidget->setCurrentWidget(ui.pCarDealerAchievementTab);
}
else if (staffPostCode == ADMIN )
{
//车商管理员
ui.pRepairOrderTab->setEnabled( true );
ui.pNewRepairMonitorTab->setEnabled( true );
ui.pRepairRecommandationTab->setEnabled( true );
ui.pCarDealerSchemaTab->setEnabled( true );
ui.pCarDealerAchievementTab->setEnabled( true );
ui.tabWidget->setCurrentWidget(ui.pCarDealerSchemaTab);
}
else if (staffPostCode == TEAM_LEADER )
{
//团队长
ui.pRepairOrderTab->setEnabled( false );
ui.pNewRepairMonitorTab->setEnabled( false );
ui.pRepairRecommandationTab->setEnabled( false );
ui.pCarDealerSchemaTab->setEnabled( false );
ui.pCarDealerAchievementTab->setEnabled( true );
ui.pCarDealerAchievementTab->setFocus();
ui.tabWidget->setCurrentWidget(ui.pCarDealerAchievementTab);
}
}

View File

@ -1,4 +1,4 @@
#pragma once
#pragma once
#include <QWidget>
#include "ui_QDataManagementWidget.h"
@ -22,6 +22,8 @@ private:
void initWidgets();
void initSignal();
void initWidgetByPrivileges();
private:
Ui::QDataManagementWidget ui;

View File

@ -26,7 +26,7 @@ void QNewRepairMonitorWidget::onImport()
{
QString caption = "选择要导入的文件";
QString dir = ".";
QString filter = "Excel文件 (.xlsx)";
QString filter = "Excel文件 (*.xlsx)";
QStringList files = QFileDialog::getOpenFileNames( nullptr,
caption,
@ -72,15 +72,27 @@ void QNewRepairMonitorWidget::onImport()
string tnsName = "xmcx1";
ImportNewRepairMonitorToOracle( userName, password, tnsName, recordVector );
//showNewRepairMonitorRecords();
}
catch ( runtime_error & error )
{
QMessageBox::critical( nullptr,
"保存失败!",
error.what() );
QString::fromUtf8( error.what()) );
return;
}
//提示一下
QString messageInfo = "导入%1条记录";
QString messageCaption = "导入完成";
QMessageBox::information( nullptr,
messageCaption,
messageInfo.arg( recordVector.size() ) );
//释放内存
recordVector.clear();
}
void QNewRepairMonitorWidget::init()
@ -150,14 +162,14 @@ void QNewRepairMonitorWidget::showNewRepairMonitorRecords()
//出险地点
pItem = new QTableWidgetItem();
pItem->setText( QString::fromStdWString( iterRecord->_ ) );
pItem->setTextAlignment(Qt::AlignCenter);
pItem->setTextAlignment( Qt::AlignLeft | Qt::AlignVCenter );
ui.pTableWidgeRepairOrder->setItem( rowIndex, columnIndex++, pItem );
//事故车目前位置
pItem = new QTableWidgetItem();
pItem->setText( QString::fromStdWString( iterRecord->_ ) );
pItem->setTextAlignment(Qt::AlignCenter);
pItem->setTextAlignment( Qt::AlignLeft | Qt::AlignVCenter );
ui.pTableWidgeRepairOrder->setItem( rowIndex, columnIndex++, pItem );
@ -184,63 +196,98 @@ void QNewRepairMonitorWidget::showNewRepairMonitorRecords()
//品牌名称
pItem = new QTableWidgetItem();
pItem->setText(QString::fromStdWString(iterRecord->));
pItem->setText( QString::fromStdWString( iterRecord->_ ) );
pItem->setTextAlignment( Qt::AlignCenter );
ui.pTableWidgeRepairOrder->setItem( rowIndex, columnIndex++, pItem );
//保单号
pItem = new QTableWidgetItem();
pItem->setText(QString::fromStdWString(iterRecord->));
pItem->setText( QString::fromStdWString( iterRecord->_ ) );
pItem->setTextAlignment( Qt::AlignCenter );
ui.pTableWidgeRepairOrder->setItem( rowIndex, columnIndex++, pItem );
//标的车、三者车
pItem = new QTableWidgetItem();
pItem->setText(QString::fromStdWString(iterRecord->));
pItem->setText( QString::fromStdWString( iterRecord->_三者车_ ) );
pItem->setTextAlignment( Qt::AlignCenter );
ui.pTableWidgeRepairOrder->setItem( rowIndex, columnIndex++, pItem );
//核价金额
pItem = new QTableWidgetItem();
pItem->setText(QString::fromStdWString(iterRecord->));
pItem->setText( QString::fromStdWString( iterRecord->_ ) );
pItem->setTextAlignment( Qt::AlignCenter );
ui.pTableWidgeRepairOrder->setItem( rowIndex, columnIndex++, pItem );
//结案金额
pItem = new QTableWidgetItem();
pItem->setText(QString::fromStdWString(iterRecord->));
pItem->setText( QString::fromStdWString( iterRecord->_ ) );
pItem->setTextAlignment( Qt::AlignCenter );
ui.pTableWidgeRepairOrder->setItem( rowIndex, columnIndex++, pItem );
//接报案人分公司
pItem = new QTableWidgetItem();
pItem->setText(QString::fromStdWString(iterRecord->));
pItem->setText( QString::fromStdWString( iterRecord->_ ) );
pItem->setTextAlignment( Qt::AlignCenter );
ui.pTableWidgeRepairOrder->setItem( rowIndex, columnIndex++, pItem );
//接报案人工号
pItem = new QTableWidgetItem();
pItem->setText(QString::fromStdWString(iterRecord->));
pItem->setText( QString::fromStdWString( iterRecord->_ ) );
pItem->setTextAlignment( Qt::AlignCenter );
ui.pTableWidgeRepairOrder->setItem( rowIndex, columnIndex++, pItem );
//接报案人
pItem = new QTableWidgetItem();
pItem->setText(QString::fromStdWString(iterRecord->));
pItem->setText( QString::fromStdWString( iterRecord->_ ) );
pItem->setTextAlignment( Qt::AlignCenter );
ui.pTableWidgeRepairOrder->setItem( rowIndex, columnIndex++, pItem );
//查勘员
pItem = new QTableWidgetItem();
pItem->setText(QString::fromStdWString(iterRecord->));
pItem->setText( QString::fromStdWString( iterRecord->_ ) );
pItem->setTextAlignment( Qt::AlignCenter );
ui.pTableWidgeRepairOrder->setItem( rowIndex, columnIndex++, pItem );
//第一任务分派时间
pItem = new QTableWidgetItem();
pItem->setText( QString::fromStdWString( iterRecord->_ ) );
pItem->setTextAlignment( Qt::AlignCenter );
ui.pTableWidgeRepairOrder->setItem( rowIndex, columnIndex++, pItem );
//第一车商是否已阅读
pItem = new QTableWidgetItem();
pItem->setText( QString::fromStdWString( iterRecord->_ ) );
pItem->setTextAlignment( Qt::AlignCenter );
ui.pTableWidgeRepairOrder->setItem( rowIndex, columnIndex++, pItem );
//第一车商是否预约进厂
pItem = new QTableWidgetItem();
pItem->setText( QString::fromStdWString( iterRecord->_ ) );
pItem->setTextAlignment( Qt::AlignCenter );
ui.pTableWidgeRepairOrder->setItem( rowIndex, columnIndex++, pItem );
//第一车商是否推荐失败
pItem = new QTableWidgetItem();
pItem->setText( QString::fromStdWString( iterRecord->_ ) );
pItem->setTextAlignment( Qt::AlignCenter );
ui.pTableWidgeRepairOrder->setItem( rowIndex, columnIndex++, pItem );
//第一车商是否出厂确认
pItem = new QTableWidgetItem();
pItem->setText( QString::fromStdWString( iterRecord->_ ) );
pItem->setTextAlignment( Qt::AlignCenter );
ui.pTableWidgeRepairOrder->setItem( rowIndex, columnIndex++, pItem );

View File

@ -252,7 +252,7 @@
</column>
<column>
<property name="text">
<string>第一车商否预约进厂</string>
<string>第一车商否预约进厂</string>
</property>
<property name="textAlignment">
<set>AlignCenter</set>
@ -274,14 +274,6 @@
<set>AlignCenter</set>
</property>
</column>
<column>
<property name="text">
<string>查勘员推荐状态</string>
</property>
<property name="textAlignment">
<set>AlignCenter</set>
</property>
</column>
</widget>
</item>
</layout>

View File

@ -1,4 +1,4 @@
#include <iostream>
#include <iostream>
#include "QLoginDialog.h"
#include "../../system/system_util.h"
#include "../../data/Datastructure/UserInfo/UserInfo.h"
@ -49,13 +49,16 @@ void QLoginDialog::initWidgets()
try
{
queryStaffInfo( systemUserName );
ui.pEditUserName->setText( QString::fromLocal8Bit( pStaffInfo->getStaffName().c_str() ) );
ui.pEditStaffPost->setText( QString::fromLocal8Bit( pStaffInfo->getStaffPost().c_str() ) );
}
catch ( runtime_error & error )
{
//如果出现异常,就不让用户继续登录
QMessageBox::critical( nullptr,
"错误,请联系管理员!",
QString::fromLocal8Bit( error.what() ) );
"登录错误",
QString::fromUtf8( error.what() ) );
ui.pButtonOK->setEnabled( false );
}

View File

@ -1,5 +1,11 @@

#include <iostream>
#include <QMessageBox>
#include "QMainFrame.h"
#include "../../Data/AppParameters/AppParameters.h"
using namespace std;
QMainFrame::QMainFrame( QWidget * parent )
: QMainWindow( parent )
@ -32,3 +38,25 @@ void QMainFrame::initWidgets()
void QMainFrame::initSignal()
{
}
void QMainFrame::initWidgetByPrivileges()
{
if ( pStaffInfo == nullptr )
{
QMessageBox::critical(nullptr,
"错误",
"权限错误!\n请殴打开发人员!");
exit(0);
}
string staffPost = pStaffInfo->getStaffPost();
if ( staffPost == SYSTEM_ADMIN )
{
//系统管理员
}
}

View File

@ -1,4 +1,4 @@
#pragma once
#pragma once
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QStackedWidget>
@ -18,6 +18,8 @@ private:
void initWidgets();
void initSignal();
void initWidgetByPrivileges();
private:
Ui::QMainFrameClass ui;
QStackedWidget * pStackedWidget;

View File

@ -11,7 +11,12 @@
</rect>
</property>
<property name="windowTitle">
<string>起个啥名呢?</string>
<string>车商渠道数据管理工具</string>
</property>
<property name="windowIcon">
<iconset>
<normalon>:/QMainFrame/Resources/CPIC透明.png</normalon>
</iconset>
</property>
<widget class="QWidget" name="centralWidget"/>
<widget class="QMenuBar" name="menuBar">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 KiB

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -1,2 +1,2 @@
IDI_ICON1 ICON DISCARDABLE "car_dealer_util.ico"
IDI_ICON1 ICON DISCARDABLE "cpic.ico"

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.