fixed receptionist

master
HOJI 2 years ago
parent 08ede05b40
commit c478e48755

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 9.0.2, 2023-09-10T22:50:15. --> <!-- Written by QtCreator 9.0.2, 2023-09-11T04:29:46. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>

@ -1,15 +1,14 @@
#include "cellstatus.h" #include "cellstatus.h"
#include "ui_cellstatus.h" #include "ui_cellstatus.h"
#include <QMessageBox>
cellstatus::cellstatus(QWidget *parent) : cellstatus::cellstatus(QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::cellstatus) ui(new Ui::cellstatus)
{ {
ui->setupUi(this); ui->setupUi(this);
ui->pushButton->setStyleSheet("border:2px groove gray; background-color: rgb(225, 225, 225);" ui->pushButton->setStyleSheet("border:2px groove gray;background-color: rgb(0, 0, 0,30);color: rgb(255, 255, 255);"
"border-radius:5px;"); "border-radius:5px;");
ui->pushButton_2->setStyleSheet("border:2px groove gray; background-color: rgb(225, 225, 225);" ui->pushButton_2->setStyleSheet("border:2px groove gray;background-color: rgb(0, 0, 0,30);color: rgb(255, 255, 255);"
"border-radius:5px;"); "border-radius:5px;");
@ -27,6 +26,15 @@ cellstatus::~cellstatus()
delete ui; delete ui;
} }
void cellstatus::setisused(bool i){
isused = i;
}
void cellstatus::setbtn(){
ui->pushButton->setEnabled(!isused);
ui->pushButton_2->setEnabled(isused);
}
void cellstatus::setroomNum(int roomNum) void cellstatus::setroomNum(int roomNum)
{ {
this->roomNum = roomNum; this->roomNum = roomNum;
@ -39,22 +47,41 @@ void cellstatus::setDB(QSqlDatabase db)
void cellstatus::on_pushButton_clicked() void cellstatus::on_pushButton_clicked()
{ {
m_order->setDB(db);
m_order->setrootNum(roomNum); m_order->setrootNum(roomNum);
m_order->setDB(db);
m_order->show(); m_order->show();
} }
void cellstatus::on_pushButton_2_clicked() void cellstatus::on_pushButton_2_clicked()
{ {
QMessageBox::information(this, QString::fromLocal8Bit(" 预定信息 "), QString::fromLocal8Bit(" 退房成功 ")); QSqlQuery query;
query.prepare("select * from customer where room_num like :num;");
query.bindValue(":str",roomNum);
query.exec();
QString account = query.value(0).toString();
query.prepare("UPDATE customer set room_num=NULL where account = :a");
query.bindValue(":a",account);
query.exec();
query.prepare("UPDATE room set status=:QS where room_num = :num");
query.bindValue(":QS","空闲");
query.bindValue(":num",roomNum);
query.exec();
query.prepare("UPDATE room set checkout_time=NULL where room_num = :num");
query.bindValue(":num",roomNum);
query.exec();
query.prepare("UPDATE room set customer_id=NULL where room_num = :num");
query.bindValue(":num",roomNum);
query.exec();
QMessageBox::information(this," 预定信息 "," 退房成功 ");
ui->pushButton->setEnabled(true); ui->pushButton->setEnabled(true);
ui->pushButton_2->setEnabled(false); ui->pushButton_2->setEnabled(false);
emit flash();
} }
void cellstatus::onordersuccess() void cellstatus::onordersuccess()
{ {
QMessageBox::information(this, QString::fromLocal8Bit("预定信息"), QString::fromLocal8Bit("订房成功")); QMessageBox::information(this,"预定信息","订房成功");
ui->pushButton->setEnabled(false); ui->pushButton->setEnabled(false);
ui->pushButton_2->setEnabled(true); ui->pushButton_2->setEnabled(true);
emit flash();
} }

@ -6,6 +6,8 @@
#include <QSqlDatabase> #include <QSqlDatabase>
#include <QSqlQuery> #include <QSqlQuery>
#include <QSqlError> #include <QSqlError>
#include <QMessageBox>
namespace Ui { namespace Ui {
class cellstatus; class cellstatus;
} }
@ -19,6 +21,8 @@ public:
~cellstatus(); ~cellstatus();
void setroomNum(int roomNum); void setroomNum(int roomNum);
void setDB(QSqlDatabase db); void setDB(QSqlDatabase db);
void setisused(bool i);
void setbtn();
private slots: private slots:
void on_pushButton_clicked(); void on_pushButton_clicked();
@ -32,6 +36,9 @@ private:
int roomNum; int roomNum;
orderoom *m_order; orderoom *m_order;
QSqlDatabase db; QSqlDatabase db;
bool isused;
signals:
void flash();
}; };
#endif // CELLSTATUS_H #endif // CELLSTATUS_H

@ -12,7 +12,7 @@ login::login(QWidget *parent)
ui->setupUi(this); ui->setupUi(this);
QIcon logo(":/image/icon/logo.png"); QIcon logo(":/image/icon/logo.png");
this->setWindowIcon(logo); this->setWindowIcon(logo);
setWindowTitle("宜客酒店"); this->setWindowTitle("宜客酒店");
this->setFixedSize(1920,1080); this->setFixedSize(1920,1080);
bg = new QLabel(this); bg = new QLabel(this);
bg->setScaledContents(true); bg->setScaledContents(true);

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 KiB

@ -1,14 +1,37 @@
#include "orderoom.h" #include "orderoom.h"
#include "ui_orderoom.h" #include "ui_orderoom.h"
#include <QSqlDatabase> #include "registers.h"
#include <QSqlQuery>
#include <QSqlError>
#include <QDebug>
orderoom::orderoom(QWidget *parent) : orderoom::orderoom(QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::orderoom) ui(new Ui::orderoom)
{ {
ui->setupUi(this); ui->setupUi(this);
QIcon logo(":/image/icon/logo.png");
this->setWindowIcon(logo);
this->setWindowTitle("订房页面");
this->setFixedSize(800,600);
bg = new QLabel(this);
bg->setScaledContents(true);
bg->setPixmap(QPixmap(":/image/bg/order.png"));
bg->lower();
ui->tableWidget->setRowCount(0);
ui->tableWidget->setColumnCount(4);
ui->tableWidget->setHorizontalHeaderLabels({"手机号","姓名","性别","身份证号"});
ui->tableWidget->horizontalHeader()->setStyleSheet("QHeaderView::section{background-color: rgb(0, 0, 0,30);}");//表头透明度
ui->tableWidget->setStyleSheet("QTableWidget{border:2px groove gray;border-radius:15px;background-color: rgb(0, 0, 0,30);color: rgb(255, 255, 255);}");
ui->tableWidget->verticalHeader()->setVisible(false);
ui->tableWidget->setColumnWidth(0,200);
ui->tableWidget->setColumnWidth(1,100);
ui->tableWidget->setColumnWidth(2,100);
ui->tableWidget->setColumnWidth(3,375);
findcustomer = false;
} }
orderoom::~orderoom() orderoom::~orderoom()
@ -21,33 +44,66 @@ void orderoom::setrootNum(int rootNum)
this->rootNum = rootNum; this->rootNum = rootNum;
} }
void orderoom::setDB(QSqlDatabase db) void orderoom::setDB(QSqlDatabase db){
{
this->db = db; this->db = db;
} }
void orderoom::on_pushButton_2_clicked() void orderoom::on_btn_search_clicked()
{ {
QString str = ui->lineEdit->text();
QString phone = ui->lineEdit_2->text(); ui->tableWidget->setRowCount(1);
QString name = ui->lineEdit_3->text(); ui->tableWidget->clear();
QString gender = ui->lineEdit_4->text(); ui->tableWidget->setHorizontalHeaderLabels({"手机号","姓名","性别","身份证号"});
QString user_id = ui->lineEdit_5->text();
//插入记录
QString sql = QString("insert into customer(account, name, gender,id ,room_num) "
"VALUES ('%1','%2', '%3','%4','%5')")
.arg(phone).arg(name).arg(gender).arg(user_id).arg(rootNum);
QSqlQuery query; QSqlQuery query;
if(query.exec(sql)) //执行sql语句是否成功 query.prepare("select * from customer where account like :str;");
{ query.bindValue(":str",str);
qDebug()<<"insert success"; if(query.exec()){
while (query.next()){
QTableWidgetItem *twi = new QTableWidgetItem(query.value(0).toString());
twi->setTextAlignment(Qt::AlignCenter);
ui->tableWidget->setItem(0,0,twi);
for(int j = 2;j<5;j++){
QTableWidgetItem *twi = new QTableWidgetItem(query.value(j).toString());
twi->setTextAlignment(Qt::AlignCenter);
ui->tableWidget->setItem(0,j-1,twi);
}
}
}
if(ui->tableWidget->model()->index(0,0).data().toString() == NULL){
findcustomer = false;
ui->tableWidget->setRowCount(0);
}else{
findcustomer = true;
}
}
}else
void orderoom::on_btn_order_clicked()
{ {
qDebug()<<query.lastError(); if(findcustomer){
} QDate date = QDate::currentDate();
int account = ui->tableWidget->model()->index(0,0).data().toString().toInt();
QString sql1 = QString("UPDATE room set customer_id = %1 where room_num = %2").arg(account).arg(rootNum);
QString sql2 = QString("UPDATE room set status='使用' where room_num = %1").arg(rootNum);
QSqlQuery query;
query.exec(sql1);
query.exec(sql2);
query.prepare("UPDATE room set checkout_time=DATE_ADD(:date, INTERVAL 1 DAY) where room_num = :num");
query.bindValue(":date",date);
query.bindValue(":num",rootNum);
query.exec();
emit ordersuccess(); emit ordersuccess();
this->close(); this->close();
}else{
QMessageBox::warning(this,tr("提示"),("请选择入住客户!"));
} }
}
void orderoom::on_btn_registers_clicked()
{
registers *reg = new registers;
reg->show();
}

@ -2,9 +2,14 @@
#define ORDEROOM_H #define ORDEROOM_H
#include <QWidget> #include <QWidget>
#include <QLabel>
#include <QSqlDatabase> #include <QSqlDatabase>
#include <QSqlQuery> #include <QSqlQuery>
#include <QSqlError> #include <QSqlError>
#include <QDate>
#include <QMessageBox>
#include <QDebug>
namespace Ui { namespace Ui {
class orderoom; class orderoom;
} }
@ -20,12 +25,19 @@ public:
void setDB(QSqlDatabase db); void setDB(QSqlDatabase db);
private slots: private slots:
void on_pushButton_2_clicked();
void on_btn_search_clicked();
void on_btn_order_clicked();
void on_btn_registers_clicked();
private: private:
Ui::orderoom *ui; Ui::orderoom *ui;
QLabel *bg;
int rootNum; int rootNum;
QSqlDatabase db; QSqlDatabase db;
bool findcustomer;
signals: signals:
void ordersuccess(); void ordersuccess();

@ -6,70 +6,104 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>563</width> <width>800</width>
<height>432</height> <height>600</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <widget class="QWidget" name="widget" native="true">
<item row="4" column="0"> <property name="geometry">
<widget class="QLabel" name="label_5"> <rect>
<property name="text"> <x>0</x>
<string>性别:</string> <y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property> </property>
</widget> <widget class="QLineEdit" name="lineEdit">
</item> <property name="geometry">
<item row="6" column="0"> <rect>
<widget class="QPushButton" name="pushButton"> <x>200</x>
<property name="text"> <y>60</y>
<string>新建客户</string> <width>461</width>
<height>41</height>
</rect>
</property> </property>
</widget> </widget>
</item> <widget class="QPushButton" name="btn_search">
<item row="2" column="0"> <property name="geometry">
<widget class="QLabel" name="label_3"> <rect>
<x>670</x>
<y>60</y>
<width>121</width>
<height>41</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text"> <property name="text">
<string>手机号:</string> <string>检索</string>
</property> </property>
</widget> </widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="geometry">
<string/> <rect>
<x>10</x>
<y>10</y>
<width>341</width>
<height>131</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property> </property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
<string>姓名:</string> <string>检索客户信息:</string>
</property> </property>
</widget> </widget>
</item> <widget class="QWidget" name="horizontalLayoutWidget">
<item row="1" column="0" colspan="4"> <property name="geometry">
<widget class="QLabel" name="label_2"> <rect>
<property name="minimumSize"> <x>-1</x>
<y>489</y>
<width>801</width>
<height>111</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size> <size>
<width>800</width> <width>40</width>
<height>600</height> <height>20</height>
</size> </size>
</property> </property>
<property name="text"> </spacer>
<string/>
</property>
</widget>
</item> </item>
<item row="5" column="0"> <item>
<widget class="QLabel" name="label_6"> <widget class="QPushButton" name="btn_registers">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text"> <property name="text">
<string>身份证:</string> <string>新建客户</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1"> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -82,37 +116,54 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="0" column="1" colspan="2"> <item>
<widget class="QLineEdit" name="lineEdit"/> <widget class="QPushButton" name="btn_order">
</item> <property name="font">
<item row="0" column="3"> <font>
<widget class="QPushButton" name="pushButton_3"> <pointsize>12</pointsize>
<property name="text"> </font>
<string/>
</property> </property>
</widget>
</item>
<item row="2" column="1" colspan="3">
<widget class="QLineEdit" name="lineEdit_2"/>
</item>
<item row="3" column="1" colspan="3">
<widget class="QLineEdit" name="lineEdit_3"/>
</item>
<item row="4" column="1" colspan="3">
<widget class="QLineEdit" name="lineEdit_4"/>
</item>
<item row="5" column="1" colspan="3">
<widget class="QLineEdit" name="lineEdit_5"/>
</item>
<item row="6" column="3">
<widget class="QPushButton" name="pushButton_2">
<property name="text"> <property name="text">
<string>订房</string> <string>订房</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_3">
<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> </layout>
</widget> </widget>
<widget class="QTableWidget" name="tableWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>130</y>
<width>781</width>
<height>341</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 0, 0,50);
color: rgb(255, 255, 255);</string>
</property>
</widget>
</widget>
</widget>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

@ -1,88 +1,127 @@
#include "receptionist.h" #include "receptionist.h"
#include "ui_receptionist.h" #include "ui_receptionist.h"
#include "cellstatus.h" #include "cellstatus.h"
#include <QPushButton>
#include <QPainter>
#include <QTextCodec>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QDebug>
#include <QVBoxLayout> // 添加这一行
receptionist::receptionist(QWidget *parent) : receptionist::receptionist(QWidget *parent) :
QMainWindow(parent), QMainWindow(parent),
ui(new Ui::receptionist) ui(new Ui::receptionist)
{ {
// 设置主窗口大小为1920x1080 ui->setupUi(this);
QIcon logo(":/image/icon/logo.png");
this->setWindowIcon(logo);
this->setWindowTitle("宜客酒店");
this->setFixedSize(1920,1080); this->setFixedSize(1920,1080);
bg = new QLabel(this);
bg->setScaledContents(true);
bg->setPixmap(QPixmap(":/image/bg/login.png"));
bg->lower();
// 创建一个垂直布局管理器 // 设置主窗口大小为1920x1080
QVBoxLayout *layout = new QVBoxLayout(this); this->setFixedSize(1920,1080);
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL"); db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("127.0.0.1");
db.setPort(3306);
db.setDatabaseName("hotel"); db.setDatabaseName("hotel");
db.setHostName("localhost");
db.setPort(3306);
db.setUserName("root"); db.setUserName("root");
db.setPassword("111111"); db.setPassword("111111");
qDebug() << db.open(); if(db.open()){
ui->setupUi(this); qDebug("database connect succeed");
}else{
qDebug("database connect failed");
}
// 创建 QTableWidget 和其他组件 // 创建 QTableWidget 和其他组件
ui->tableWidget->setRowCount(4); ui->tableWidget->setRowCount(3);
ui->tableWidget->setColumnCount(8);
ui->tableWidget->verticalHeader()->setVisible(false); ui->tableWidget->verticalHeader()->setVisible(false);
QStringList strs = {QString::fromLocal8Bit(u8"房间号"), QString::fromLocal8Bit(u8" 房间类型 "), QString::fromLocal8Bit(u8" 是否带窗 "), ui->tableWidget->setHorizontalHeaderLabels({"房间号","房间类型","是否带窗","负责人","状态","退房时间","客户信息","操作"});
QString::fromLocal8Bit(u8" 负责人 "),QString::fromLocal8Bit(u8" 状态 "),QString::fromLocal8Bit(u8" 退房时间 "), ui->tableWidget->horizontalHeader()->setStyleSheet("QHeaderView::section{background-color: rgb(0, 0, 0,30);}");//表头透明度
QString::fromLocal8Bit(u8"客户信息"),QString::fromLocal8Bit(u8"操作")}; ui->tableWidget->setStyleSheet("QTableWidget{border:2px groove gray;border-radius:15px;background-color: rgb(0, 0, 0,30);color: rgb(255, 255, 255);}");
ui->tableWidget->setColumnCount(strs.size()); showall();
ui->tableWidget->setStyleSheet("QTableWidget{border:2px groove gray;border-radius:15px;background-color:rgba(255, 255, 255, 30%);}"); }
ui->tableWidget->horizontalHeader()->setVisible(false);
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
for(int i = 0; i < strs.size();i++) receptionist::~receptionist()
{ {
ui->tableWidget->setItem(0,i,new QTableWidgetItem(strs[i])); delete ui;
} }
void receptionist::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
bg->resize(ui->widget->size());
}
void receptionist::showall(){
QSqlQuery query; QSqlQuery query;
query.exec("select * from room"); query.exec("select * from room");
int i = 1; ui->tableWidget->setRowCount(query.size());
int i = 0;
if(query.exec()){
while(query.next()){ while(query.next()){
//数据 //数据
ui->tableWidget->setItem(i,0,new QTableWidgetItem(QString::fromLocal8Bit(query.value(0).toString().toUtf8().data()))); for(int j = 0;j<6;j++){
ui->tableWidget->setItem(i,1,new QTableWidgetItem(QString::fromLocal8Bit(query.value(1).toString().toUtf8().data()))); QTableWidgetItem *twi = new QTableWidgetItem(query.value(j).toString());
ui->tableWidget->setItem(i,2,new QTableWidgetItem(QString::fromLocal8Bit(query.value(2).toString().toUtf8().data()))); twi->setTextAlignment(Qt::AlignCenter);
ui->tableWidget->setItem(i,3,new QTableWidgetItem(QString::fromLocal8Bit(query.value(3).toString().toUtf8().data()))); ui->tableWidget->setItem(i,j,twi);
ui->tableWidget->setItem(i,4,new QTableWidgetItem(QString::fromLocal8Bit(query.value(4).toString().toUtf8().data()))); ui->tableWidget->setColumnWidth(j,259);
ui->tableWidget->setItem(i,5,new QTableWidgetItem(QString::fromLocal8Bit(query.value(5).toString().toUtf8().data()))); }
cellstatus* cell = new cellstatus(); cellstatus* cell = new cellstatus();
cell->setroomNum(query.value(0).toInt()); connect(cell,&cellstatus::flash,this,&receptionist::onflash);
cell->setDB(db); cell->setDB(db);
cell->setroomNum(query.value(0).toInt());
if(QString::compare(ui->tableWidget->model()->index(i,4).data().toString(),"使用")==0){
cell->setisused(true);
}else{
cell->setisused(false);
}
cell->setbtn();
ui->tableWidget->setCellWidget(i,7,cell); ui->tableWidget->setCellWidget(i,7,cell);
ui->tableWidget->setCellWidget(i,6,new QPushButton(QString::fromLocal8Bit("查看"))); ui->tableWidget->setCellWidget(i,6,new QPushButton("查看"));
i++; i++;
} }
}
}
// 将 QTableWidget 和其他组件添加到布局管理器中 void receptionist::search(QString str){
layout->addWidget(ui->tableWidget); // 例如,添加您的表格 int s = str.toInt();
layout->addStretch(); // 添加伸缩项,将组件推到窗口中央 ui->tableWidget->clear();
ui->tableWidget->setHorizontalHeaderLabels({"房间号","房间类型","是否带窗","负责人","状态","退房时间","客户信息","操作"});
// 将布局管理器设置为主窗口的布局 QSqlQuery query;
QWidget *centralWidget = new QWidget(this); query.prepare("select * from room where room_num like :str;");
centralWidget->setLayout(layout); query.bindValue(":str",s);
setCentralWidget(centralWidget); int i = 0;
if(query.exec()){
while (query.next()){
for(int j = 0;j<6;j++){
QTableWidgetItem *twi = new QTableWidgetItem(query.value(j).toString());
twi->setTextAlignment(Qt::AlignCenter);
ui->tableWidget->setItem(i,j,twi);
ui->tableWidget->setColumnWidth(j,259);
}
cellstatus* cell = new cellstatus();
cell->setroomNum(query.value(0).toInt());
cell->setDB(db);
ui->tableWidget->setCellWidget(i,7,cell);
ui->tableWidget->setCellWidget(i,6,new QPushButton("查看"));
}
}
} }
receptionist::~receptionist() void receptionist::on_pushButton_clicked()
{ {
delete ui; QString str = ui->lineEdit->text();
if(str == NULL){
showall();
}else{
search(str);
}
} }
void receptionist::paintEvent(QPaintEvent *) void receptionist::onflash(){
{ showall();
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
} }

@ -2,6 +2,17 @@
#define RECEPTIONIST_H #define RECEPTIONIST_H
#include <QMainWindow> #include <QMainWindow>
#include <QPushButton>
#include <QPainter>
#include <QTextCodec>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QDebug>
#include <QLabel>
#include <QTableWidgetItem>
#include <QVBoxLayout> // 添加这一行
namespace Ui { namespace Ui {
class receptionist; class receptionist;
} }
@ -16,9 +27,16 @@ public:
private: private:
Ui::receptionist *ui; Ui::receptionist *ui;
QLabel *bg;
QSqlDatabase db;
void search(QString str);
void showall();
protected: protected:
void paintEvent(QPaintEvent *e); void paintEvent(QPaintEvent *e);
private slots:
void on_pushButton_clicked();
void onflash();
}; };
#endif // RECEPTIONIST_H #endif // RECEPTIONIST_H

@ -20,46 +20,107 @@
<string>MainWindow</string> <string>MainWindow</string>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout"> <widget class="QWidget" name="widget" native="true">
<item row="0" column="2"> <property name="geometry">
<widget class="QLabel" name="label_2"> <rect>
<property name="text"> <x>0</x>
<string>房间检索:</string> <y>0</y>
<width>1920</width>
<height>1080</height>
</rect>
</property> </property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>711</width>
<height>181</height>
</rect>
</property>
<property name="font"> <property name="font">
<font> <font>
<pointsize>20</pointsize> <pointsize>70</pointsize>
</font> </font>
</property> </property>
<property name="styleSheet">
<string notr="true">color: rgb(85, 255, 255);</string>
</property>
<property name="text"> <property name="text">
<string>宜客酒店</string> <string>宜客酒店</string>
</property> </property>
</widget> </widget>
</item> <widget class="QTableWidget" name="tableWidget">
<item row="0" column="1"> <property name="geometry">
<spacer name="horizontalSpacer"> <rect>
<property name="orientation"> <x>30</x>
<enum>Qt::Horizontal</enum> <y>220</y>
<width>1861</width>
<height>831</height>
</rect>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="font">
<size> <font>
<width>40</width> <pointsize>12</pointsize>
<height>20</height> </font>
</size> </property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 0, 0,50);
color: rgb(255, 255, 255);</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>1230</x>
<y>110</y>
<width>411</width>
<height>71</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>25</pointsize>
</font>
</property>
<property name="text">
<string>房间检索:</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit">
<property name="geometry">
<rect>
<x>1470</x>
<y>130</y>
<width>321</width>
<height>41</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>1809</x>
<y>127</y>
<width>81</width>
<height>41</height>
</rect>
</property> </property>
</spacer> <property name="font">
</item> <font>
<item row="1" column="0" colspan="4"> <pointsize>12</pointsize>
<widget class="QTableWidget" name="tableWidget"/> </font>
</item> </property>
</layout> <property name="text">
<string>查找</string>
</property>
</widget>
</widget>
</widget> </widget>
<widget class="QMenuBar" name="menubar"> <widget class="QMenuBar" name="menubar">
<property name="geometry"> <property name="geometry">
@ -67,7 +128,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1920</width> <width>1920</width>
<height>21</height> <height>17</height>
</rect> </rect>
</property> </property>
</widget> </widget>

@ -5,6 +5,7 @@
<file>sea.jpg</file> <file>sea.jpg</file>
<file>stone.jpg</file> <file>stone.jpg</file>
<file>register.jpg</file> <file>register.jpg</file>
<file>order.png</file>
</qresource> </qresource>
<qresource prefix="/image/icon"> <qresource prefix="/image/icon">
<file>info.png</file> <file>info.png</file>

Loading…
Cancel
Save