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();
this->close();
}else{
QMessageBox::warning(this,tr("提示"),("请选择入住客户!"));
} }
emit ordersuccess();
this->close();
} }
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,112 +6,163 @@
<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>
</property> <width>800</width>
</widget> <height>600</height>
</item> </rect>
<item row="6" column="0"> </property>
<widget class="QPushButton" name="pushButton"> <widget class="QLineEdit" name="lineEdit">
<property name="text"> <property name="geometry">
<string>新建客户</string> <rect>
</property> <x>200</x>
</widget> <y>60</y>
</item> <width>461</width>
<item row="2" column="0"> <height>41</height>
<widget class="QLabel" name="label_3"> </rect>
<property name="text"> </property>
<string>手机号:</string> </widget>
</property> <widget class="QPushButton" name="btn_search">
</widget> <property name="geometry">
</item> <rect>
<item row="0" column="0"> <x>670</x>
<widget class="QLabel" name="label"> <y>60</y>
<property name="text"> <width>121</width>
<string/> <height>41</height>
</property> </rect>
</widget> </property>
</item> <property name="font">
<item row="3" column="0"> <font>
<widget class="QLabel" name="label_4"> <pointsize>12</pointsize>
<property name="text"> </font>
<string>姓名:</string> </property>
</property> <property name="text">
</widget> <string>检索</string>
</item> </property>
<item row="1" column="0" colspan="4"> </widget>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label">
<property name="minimumSize"> <property name="geometry">
<size> <rect>
<width>800</width> <x>10</x>
<height>600</height> <y>10</y>
</size> <width>341</width>
</property> <height>131</height>
<property name="text"> </rect>
<string/> </property>
</property> <property name="font">
</widget> <font>
</item> <pointsize>15</pointsize>
<item row="5" column="0"> </font>
<widget class="QLabel" name="label_6"> </property>
<property name="text"> <property name="text">
<string>身份证:</string> <string>检索客户信息:</string>
</property> </property>
</widget> </widget>
</item> <widget class="QWidget" name="horizontalLayoutWidget">
<item row="6" column="1"> <property name="geometry">
<spacer name="horizontalSpacer"> <rect>
<property name="orientation"> <x>-1</x>
<enum>Qt::Horizontal</enum> <y>489</y>
</property> <width>801</width>
<property name="sizeHint" stdset="0"> <height>111</height>
<size> </rect>
<width>40</width> </property>
<height>20</height> <layout class="QHBoxLayout" name="horizontalLayout">
</size> <item>
</property> <spacer name="horizontalSpacer_2">
</spacer> <property name="orientation">
</item> <enum>Qt::Horizontal</enum>
<item row="0" column="1" colspan="2"> </property>
<widget class="QLineEdit" name="lineEdit"/> <property name="sizeHint" stdset="0">
</item> <size>
<item row="0" column="3"> <width>40</width>
<widget class="QPushButton" name="pushButton_3"> <height>20</height>
<property name="text"> </size>
<string/> </property>
</property> </spacer>
</widget> </item>
</item> <item>
<item row="2" column="1" colspan="3"> <widget class="QPushButton" name="btn_registers">
<widget class="QLineEdit" name="lineEdit_2"/> <property name="font">
</item> <font>
<item row="3" column="1" colspan="3"> <pointsize>12</pointsize>
<widget class="QLineEdit" name="lineEdit_3"/> </font>
</item> </property>
<item row="4" column="1" colspan="3"> <property name="text">
<widget class="QLineEdit" name="lineEdit_4"/> <string>新建客户</string>
</item> </property>
<item row="5" column="1" colspan="3"> </widget>
<widget class="QLineEdit" name="lineEdit_5"/> </item>
</item> <item>
<item row="6" column="3"> <spacer name="horizontalSpacer">
<widget class="QPushButton" name="pushButton_2"> <property name="orientation">
<property name="text"> <enum>Qt::Horizontal</enum>
<string>订房</string> </property>
</property> <property name="sizeHint" stdset="0">
</widget> <size>
</item> <width>40</width>
</layout> <height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btn_order">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>订房</string>
</property>
</widget>
</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>
</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> </widget>
<resources/> <resources/>
<connections/> <connections/>

@ -1,77 +1,44 @@
#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++)
{
ui->tableWidget->setItem(0,i,new QTableWidgetItem(strs[i]));
}
QSqlQuery query;
query.exec("select * from room");
int i = 1;
while(query.next()){
//数据
ui->tableWidget->setItem(i,0,new QTableWidgetItem(QString::fromLocal8Bit(query.value(0).toString().toUtf8().data())));
ui->tableWidget->setItem(i,1,new QTableWidgetItem(QString::fromLocal8Bit(query.value(1).toString().toUtf8().data())));
ui->tableWidget->setItem(i,2,new QTableWidgetItem(QString::fromLocal8Bit(query.value(2).toString().toUtf8().data())));
ui->tableWidget->setItem(i,3,new QTableWidgetItem(QString::fromLocal8Bit(query.value(3).toString().toUtf8().data())));
ui->tableWidget->setItem(i,4,new QTableWidgetItem(QString::fromLocal8Bit(query.value(4).toString().toUtf8().data())));
ui->tableWidget->setItem(i,5,new QTableWidgetItem(QString::fromLocal8Bit(query.value(5).toString().toUtf8().data())));
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(QString::fromLocal8Bit("查看")));
i++;
}
// 将 QTableWidget 和其他组件添加到布局管理器中
layout->addWidget(ui->tableWidget); // 例如,添加您的表格
layout->addStretch(); // 添加伸缩项,将组件推到窗口中央
// 将布局管理器设置为主窗口的布局
QWidget *centralWidget = new QWidget(this);
centralWidget->setLayout(layout);
setCentralWidget(centralWidget);
} }
receptionist::~receptionist() receptionist::~receptionist()
@ -85,4 +52,76 @@ void receptionist::paintEvent(QPaintEvent *)
opt.init(this); opt.init(this);
QPainter p(this); QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
bg->resize(ui->widget->size());
} }
void receptionist::showall(){
QSqlQuery query;
query.exec("select * from room");
ui->tableWidget->setRowCount(query.size());
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();
connect(cell,&cellstatus::flash,this,&receptionist::onflash);
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,6,new QPushButton("查看"));
i++;
}
}
}
void receptionist::search(QString str){
int s = str.toInt();
ui->tableWidget->clear();
ui->tableWidget->setHorizontalHeaderLabels({"房间号","房间类型","是否带窗","负责人","状态","退房时间","客户信息","操作"});
QSqlQuery query;
query.prepare("select * from room where room_num like :str;");
query.bindValue(":str",s);
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("查看"));
}
}
}
void receptionist::on_pushButton_clicked()
{
QString str = ui->lineEdit->text();
if(str == NULL){
showall();
}else{
search(str);
}
}
void receptionist::onflash(){
showall();
}

@ -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>
</property> <width>1920</width>
</widget> <height>1080</height>
</item> </rect>
<item row="0" column="3"> </property>
<widget class="QLineEdit" name="lineEdit"/> <widget class="QLabel" name="label">
</item> <property name="geometry">
<item row="0" column="0"> <rect>
<widget class="QLabel" name="label"> <x>10</x>
<property name="font"> <y>20</y>
<font> <width>711</width>
<pointsize>20</pointsize> <height>181</height>
</font> </rect>
</property> </property>
<property name="text"> <property name="font">
<string>宜客酒店</string> <font>
</property> <pointsize>70</pointsize>
</widget> </font>
</item> </property>
<item row="0" column="1"> <property name="styleSheet">
<spacer name="horizontalSpacer"> <string notr="true">color: rgb(85, 255, 255);</string>
<property name="orientation"> </property>
<enum>Qt::Horizontal</enum> <property name="text">
</property> <string>宜客酒店</string>
<property name="sizeHint" stdset="0"> </property>
<size> </widget>
<width>40</width> <widget class="QTableWidget" name="tableWidget">
<height>20</height> <property name="geometry">
</size> <rect>
</property> <x>30</x>
</spacer> <y>220</y>
</item> <width>1861</width>
<item row="1" column="0" colspan="4"> <height>831</height>
<widget class="QTableWidget" name="tableWidget"/> </rect>
</item> </property>
</layout> <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 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 name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<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