Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bft_takeout
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guanghui.cui
bft_takeout
Commits
5b64e84b
Commit
5b64e84b
authored
Oct 29, 2017
by
guanghui.cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、小票重新打印
2、修复悬浮窗偶尔不显示bug
parent
254bed60
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
43 additions
and
49 deletions
+43
-49
fmTakeaway/DetailsForm.cpp
+5
-2
fmTakeaway/DetailsForm.h
+1
-0
fmTakeaway/FloatForm.cpp
+7
-1
fmTakeaway/FloatForm.h
+1
-0
fmTakeaway/MainForm.cpp
+22
-36
fmTakeaway/MainForm.h
+0
-1
fmTakeaway/Util/wbillcontrol.cpp
+1
-1
fmTakeaway/Util/wbillcontrol.h
+3
-3
fmTakeaway/main.cpp
+3
-5
No files found.
fmTakeaway/DetailsForm.cpp
View file @
5b64e84b
...
@@ -10,10 +10,10 @@
...
@@ -10,10 +10,10 @@
#include "DataObject/DeliverObject.h"
#include "DataObject/DeliverObject.h"
#include "DeliversForm.h"
#include "DeliversForm.h"
#include "MateChooser.h"
#include "MateChooser.h"
#include "../fmTakeaway_printer/Fmtakeaway_printer.h"
#include "MainForm.h"
#include "MainForm.h"
#include "DrinkItem.h"
#include "DrinkItem.h"
#include "Util/IniDataManger.h"
#include "Util/IniDataManger.h"
#include "Util/wbillcontrol.h"
#include <QFile>
#include <QFile>
#include <QFileInfo>
#include <QFileInfo>
#include <QPointer>
#include <QPointer>
...
@@ -39,6 +39,8 @@ DetailsForm::DetailsForm(OrderObject *orderObj, QWidget *parent) :
...
@@ -39,6 +39,8 @@ DetailsForm::DetailsForm(OrderObject *orderObj, QWidget *parent) :
this
,
SLOT
(
onError
(
QString
,
BillsManger
::
ErrorType
)));
this
,
SLOT
(
onError
(
QString
,
BillsManger
::
ErrorType
)));
connect
(
ui
->
detailsTable
,
SIGNAL
(
itemClicked
(
QTreeWidgetItem
*
,
int
)),
SLOT
(
onItemClicked
(
QTreeWidgetItem
*
,
int
)));
connect
(
ui
->
detailsTable
,
SIGNAL
(
itemClicked
(
QTreeWidgetItem
*
,
int
)),
SLOT
(
onItemClicked
(
QTreeWidgetItem
*
,
int
)));
connect
(
this
,
SIGNAL
(
reprintLable
(
const
OrderObject
*
)),
&
WBillControl
::
GetInstance
(),
SLOT
(
PrintLable
(
const
OrderObject
*
)));
}
}
DetailsForm
::~
DetailsForm
()
DetailsForm
::~
DetailsForm
()
...
@@ -786,5 +788,6 @@ void DetailsForm::onSucessful(const QString &msg, const QString &extra)
...
@@ -786,5 +788,6 @@ void DetailsForm::onSucessful(const QString &msg, const QString &extra)
void
DetailsForm
::
on_detailsBtn3_clicked
()
void
DetailsForm
::
on_detailsBtn3_clicked
()
{
{
QLOG_TRACE
()
<<
__FUNCTION__
<<
"reprinter"
;
QLOG_TRACE
()
<<
__FUNCTION__
<<
"reprinter"
;
FmTakeaway_printer
::
Instance
().
DoPrint
(
IniDataManger
::
Instance
().
GetPrinterName
(),
m_orderObj
);
emit
reprintLable
(
m_orderObj
);
//WBillControl::GetInstance().PrintLable(m_orderObj);
}
}
fmTakeaway/DetailsForm.h
View file @
5b64e84b
...
@@ -55,6 +55,7 @@ private slots:
...
@@ -55,6 +55,7 @@ private slots:
signals
:
signals
:
void
ntFormClose
();
void
ntFormClose
();
void
orderMateChanged
(
const
QString
&
order_id
);
void
orderMateChanged
(
const
QString
&
order_id
);
void
reprintLable
(
const
OrderObject
*
orderObj
);
};
};
#endif // DETAILSFORM_H
#endif // DETAILSFORM_H
fmTakeaway/FloatForm.cpp
View file @
5b64e84b
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#include <QSettings>
#include <QSettings>
#include <QApplication>
#include <QApplication>
#include "Util/IniDataManger.h"
#include "Util/IniDataManger.h"
#include "XCBOperate.h"
#include <QDebug>
#include <QDebug>
...
@@ -151,3 +151,9 @@ void FloatForm::on_floatBtnLogo_clicked()
...
@@ -151,3 +151,9 @@ void FloatForm::on_floatBtnLogo_clicked()
return
;
return
;
}
}
void
FloatForm
::
onShowFloatWnd
()
{
XCBOperate
oper
;
oper
.
update
(
this
->
winId
());
this
->
show
();
}
fmTakeaway/FloatForm.h
View file @
5b64e84b
...
@@ -20,6 +20,7 @@ public:
...
@@ -20,6 +20,7 @@ public:
public
slots
:
public
slots
:
void
onStartBlink
(
int
table_id
);
void
onStartBlink
(
int
table_id
);
void
onStopBlink
();
void
onStopBlink
();
void
onShowFloatWnd
();
private
:
private
:
Ui
::
FloatForm
*
ui
;
Ui
::
FloatForm
*
ui
;
...
...
fmTakeaway/MainForm.cpp
View file @
5b64e84b
...
@@ -357,7 +357,7 @@ void MainForm::onFloatMoved(QPoint pos)
...
@@ -357,7 +357,7 @@ void MainForm::onFloatMoved(QPoint pos)
void
MainForm
::
_InitUI
()
void
MainForm
::
_InitUI
()
{
{
this
->
setWindowFlags
(
windowFlags
()
/* | Qt::WindowStaysOnTopHint |Qt::FramelessWindowHint*/
);
this
->
setWindowFlags
(
windowFlags
()
|
Qt
::
WindowStaysOnTopHint
|
Qt
::
FramelessWindowHint
);
//this->showFullScreen();
//this->showFullScreen();
m_size
=
this
->
size
();
m_size
=
this
->
size
();
...
@@ -373,22 +373,22 @@ void MainForm::_InitUI()
...
@@ -373,22 +373,22 @@ void MainForm::_InitUI()
// ui->btnCurOpe->setChecked(false);
// ui->btnCurOpe->setChecked(false);
// 初始化打印机选项
// 初始化打印机选项
QString
iniPrinterName
=
OBJREF
(
IniDataManger
).
GetPrinterName
();
//
QString iniPrinterName = OBJREF(IniDataManger).GetPrinterName();
QStringList
printerList
;
//
QStringList printerList;
QList
<
QPrinterInfo
>
printers
=
QPrinterInfo
::
availablePrinters
();
//
QList<QPrinterInfo> printers = QPrinterInfo::availablePrinters();
foreach
(
QPrinterInfo
p
,
printers
)
{
//
foreach(QPrinterInfo p, printers) {
printerList
<<
p
.
printerName
();
//
printerList << p.printerName();
}
//
}
for
(
int
i
=
0
;
i
<
printerList
.
count
();
i
++
)
//
for(int i=0; i<printerList.count(); i++)
{
//
{
QString
name
=
(
QString
)
printerList
.
at
(
i
);
//
QString name = (QString)printerList.at(i);
ui
->
cbxPrinter
->
insertItem
(
i
,
name
);
//
ui->cbxPrinter->insertItem(i, name);
if
(
!
name
.
compare
(
iniPrinterName
))
//
if(!name.compare(iniPrinterName))
{
//
{
ui
->
cbxPrinter
->
setCurrentIndex
(
i
);
//
ui->cbxPrinter->setCurrentIndex(i);
}
//
}
}
//
}
ui
->
btnNew
->
setChecked
(
false
);
ui
->
btnNew
->
setChecked
(
false
);
// ui->btnNew->setEnabled(false);
// ui->btnNew->setEnabled(false);
...
@@ -411,9 +411,12 @@ void MainForm::_InitUI()
...
@@ -411,9 +411,12 @@ void MainForm::_InitUI()
}
}
//
//
//ui->labPrinter->hide();
ui
->
labPrinter
->
hide
();
//ui->cbxPrinter->hide();
ui
->
cbxPrinter
->
hide
();
//ui->btnTestPrint->hide();
ui
->
btnTestPrint
->
hide
();
//ui->edtSearch->hide();
//ui->labSearch->hide();
ui
->
frmSearch
->
hide
();
ui
->
lab_status
->
setText
(
"<font color='#ff0000'>未登录</font>"
);
ui
->
lab_status
->
setText
(
"<font color='#ff0000'>未登录</font>"
);
...
@@ -595,23 +598,6 @@ void MainForm::on_btnHide_clicked()
...
@@ -595,23 +598,6 @@ void MainForm::on_btnHide_clicked()
// loop.exec();
// loop.exec();
this
->
hide
();
this
->
hide
();
//#ifdef Q_OS_LINUX
// xcb_connection_t *c;
// xcb_intern_atom_reply_t *reply;
// xcb_atom_t embedAtom;
// xcb_intern_atom_cookie_t atom_cookie;
// char * strAtomName = "_XEMBED_INFO";
// c = xcb_connect(NULL,NULL);
// atom_cookie = xcb_intern_atom(c, false, strlen(strAtomName), strAtomName);
// reply = xcb_intern_atom_reply(c, atom_cookie, 0);
// embedAtom = reply->atom;
// free(reply);
// xcb_delete_property(c, (xcb_window_t)floatWId, embedAtom);
// xcb_flush(c);
//#endif
//emit updateXCB(floatWId);
XCBOperate
oper
;
oper
.
update
(
floatWId
);
emit
floatFormShow
();
emit
floatFormShow
();
return
;
return
;
}
}
...
...
fmTakeaway/MainForm.h
View file @
5b64e84b
...
@@ -97,7 +97,6 @@ signals:
...
@@ -97,7 +97,6 @@ signals:
void
ntFormClose
();
void
ntFormClose
();
void
operatorChanged
(
const
FmTakeaway_db
::
OperatorInfo
&
);
void
operatorChanged
(
const
FmTakeaway_db
::
OperatorInfo
&
);
void
updateXCB
(
WId
);
};
};
#endif // MAINFORM_H
#endif // MAINFORM_H
fmTakeaway/Util/wbillcontrol.cpp
View file @
5b64e84b
...
@@ -73,7 +73,7 @@ WBillControl::WBillControl()
...
@@ -73,7 +73,7 @@ WBillControl::WBillControl()
comd3
.
productAmount
=
1
;
comd3
.
productAmount
=
1
;
comd3
.
price
=
789
;
comd3
.
price
=
789
;
obj
.
proList
.
push_back
(
&
comd3
);
obj
.
proList
.
push_back
(
&
comd3
);
PrintLable
(
&
obj
);
//
PrintLable(&obj);
//printMenu(&obj);
//printMenu(&obj);
//printTakeout(&obj);
//printTakeout(&obj);
...
...
fmTakeaway/Util/wbillcontrol.h
View file @
5b64e84b
...
@@ -51,9 +51,6 @@ public:
...
@@ -51,9 +51,6 @@ public:
* */
* */
void
SetStoreInfo
(
const
QString
&
partner_id
,
const
QString
&
storeId
,
const
QString
&
operaId
,
const
QString
&
posId
,
const
QString
&
dbusiness
);
void
SetStoreInfo
(
const
QString
&
partner_id
,
const
QString
&
storeId
,
const
QString
&
operaId
,
const
QString
&
posId
,
const
QString
&
dbusiness
);
//打印小票
void
PrintLable
(
const
OrderObject
*
obj
);
public
slots
:
public
slots
:
/* 功能:写入销售单
/* 功能:写入销售单
* 参数:[1]订单对象[2]错误信息[3]是否是确认动作
* 参数:[1]订单对象[2]错误信息[3]是否是确认动作
...
@@ -66,6 +63,9 @@ public slots:
...
@@ -66,6 +63,9 @@ public slots:
* */
* */
void
RefundOrder
(
const
QString
&
orderId
);
void
RefundOrder
(
const
QString
&
orderId
);
//打印小票
void
PrintLable
(
const
OrderObject
*
obj
);
private
:
private
:
/* 功能:获取写入销售单数据
/* 功能:获取写入销售单数据
* 参数:[1]订单对象
* 参数:[1]订单对象
...
...
fmTakeaway/main.cpp
View file @
5b64e84b
...
@@ -93,14 +93,10 @@ int main(int argc, char *argv[])
...
@@ -93,14 +93,10 @@ int main(int argc, char *argv[])
FloatForm
f
;
FloatForm
f
;
MainForm
w
;
MainForm
w
;
XCBOperate
oper
;
w
.
setFloatWId
(
f
.
winId
());
QObject
::
connect
(
&
w
,
SIGNAL
(
updateXCB
(
WId
)),
&
oper
,
SLOT
(
update
(
WId
)));
// 链接信号槽
// 链接信号槽
QObject
::
connect
(
&
f
,
SIGNAL
(
mainFormShow
()),
&
w
,
SLOT
(
onShow
()));
QObject
::
connect
(
&
f
,
SIGNAL
(
mainFormShow
()),
&
w
,
SLOT
(
onShow
()));
QObject
::
connect
(
&
f
,
SIGNAL
(
bMoved
(
QPoint
)),
&
w
,
SLOT
(
onFloatMoved
(
QPoint
)));
QObject
::
connect
(
&
f
,
SIGNAL
(
bMoved
(
QPoint
)),
&
w
,
SLOT
(
onFloatMoved
(
QPoint
)));
QObject
::
connect
(
&
w
,
SIGNAL
(
floatFormShow
()),
&
f
,
SLOT
(
show
()));
QObject
::
connect
(
&
w
,
SIGNAL
(
floatFormShow
()),
&
f
,
SLOT
(
onShowFloatWnd
()));
QObject
::
connect
(
&
w
,
SIGNAL
(
floatStopBlink
()),
&
f
,
SLOT
(
onStopBlink
()));
QObject
::
connect
(
&
w
,
SIGNAL
(
floatStopBlink
()),
&
f
,
SLOT
(
onStopBlink
()));
QObject
::
connect
(
&
w
,
SIGNAL
(
floatStartBlink
(
int
)),
&
f
,
SLOT
(
onStartBlink
(
int
)));
QObject
::
connect
(
&
w
,
SIGNAL
(
floatStartBlink
(
int
)),
&
f
,
SLOT
(
onStartBlink
(
int
)));
...
@@ -110,6 +106,8 @@ int main(int argc, char *argv[])
...
@@ -110,6 +106,8 @@ int main(int argc, char *argv[])
QObject
::
connect
(
&
SInfoControl
::
GetInstance
(),
SIGNAL
(
getNewStoreInfo
(
QJsonObject
)),
&
BillsManger
::
Instance
(),
SLOT
(
onGetNewStoreInfo
(
QJsonObject
)));
QObject
::
connect
(
&
SInfoControl
::
GetInstance
(),
SIGNAL
(
getNewStoreInfo
(
QJsonObject
)),
&
BillsManger
::
Instance
(),
SLOT
(
onGetNewStoreInfo
(
QJsonObject
)));
w
.
move
(
0
,
0
);
w
.
move
(
0
,
0
);
XCBOperate
oper
;
oper
.
update
(
w
.
winId
());
oper
.
update
(
w
.
winId
());
w
.
show
();
w
.
show
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment