Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmtakeout
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
李定达
fmtakeout
Commits
d6d46096
Commit
d6d46096
authored
Jul 02, 2019
by
xiaoqing.gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、杯贴模板化 2、小票表头可自定义 3、增加取消证书功能 4、取消订单完成的确认界面 5、取消手自动接单的选项 6、用户设置界面新增注销功能
parent
4448d716
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
209 additions
and
40 deletions
+209
-40
takeout/base/Print/newprintlib.cpp
+0
-0
takeout/base/Print/newprintlib.h
+2
-2
takeout/control/orderprintwork.cpp
+8
-5
takeout/control/orderpushwork.cpp
+24
-2
takeout/control/orderpushwork.h
+4
-1
takeout/control/prtmodelgetwork.cpp
+30
-0
takeout/control/prtmodelgetwork.h
+6
-0
takeout/event/posevent.cpp
+1
-0
takeout/event/posevent.h
+2
-0
takeout/model/orderObject.cpp
+10
-0
takeout/model/orderObject.h
+5
-0
takeout/preDefine.h
+3
-0
takeout/takeout.pro
+1
-0
takeout/view/alertForm.cpp
+4
-0
takeout/view/alertForm.h
+0
-1
takeout/view/frminput.h
+1
-0
takeout/view/newchangeshiftsform.cpp
+1
-1
takeout/view/newmainform.cpp
+42
-27
takeout/view/newmainform.h
+2
-0
takeout/view/newmainform.ui
+63
-1
No files found.
takeout/base/Print/newprintlib.cpp
View file @
d6d46096
This diff is collapsed.
Click to expand it.
takeout/base/Print/newprintlib.h
View file @
d6d46096
...
@@ -51,7 +51,7 @@ public:
...
@@ -51,7 +51,7 @@ public:
* \param order 订单对象
* \param order 订单对象
* \return true:成功 false:失败
* \return true:成功 false:失败
*/
*/
bool
DoPrint
(
const
QString
&
config
,
const
QString
&
context
,
OrderObject
*
order
);
bool
DoPrint
(
const
QString
&
config
,
const
QString
&
context
,
OrderObject
*
order
,
int
page
);
/*!
/*!
* \brief DoBackPrint 后厨打印
* \brief DoBackPrint 后厨打印
* \param page_depart 每种商品打印一页
* \param page_depart 每种商品打印一页
...
@@ -64,7 +64,7 @@ public:
...
@@ -64,7 +64,7 @@ public:
*/
*/
bool
DoBackPrint
(
int
page_depart
,
int
prod_depart
,
int
page_num
,
bool
DoBackPrint
(
int
page_depart
,
int
prod_depart
,
int
page_num
,
const
QStringList
&
stallsprods
,
const
QString
&
config
,
const
QStringList
&
stallsprods
,
const
QString
&
config
,
const
QString
&
context
,
OrderObject
*
order
);
const
QString
&
context
,
OrderObject
*
order
,
int
page
);
/*!
/*!
* \brief DoLabelPrint 杯贴机打印
* \brief DoLabelPrint 杯贴机打印
...
...
takeout/control/orderprintwork.cpp
View file @
d6d46096
...
@@ -104,6 +104,8 @@ bool orderprintwork::GetPrtTemplet(int prttype, int pagew, QString &context, con
...
@@ -104,6 +104,8 @@ bool orderprintwork::GetPrtTemplet(int prttype, int pagew, QString &context, con
QLOG_DEBUG
()
<<
"prttype:"
<<
prttype
;
QLOG_DEBUG
()
<<
"prttype:"
<<
prttype
;
if
(
prttype
==
0
)
if
(
prttype
==
0
)
{
{
if
(
pagew
>
56
)
if
(
pagew
>
56
)
...
@@ -113,6 +115,7 @@ bool orderprintwork::GetPrtTemplet(int prttype, int pagew, QString &context, con
...
@@ -113,6 +115,7 @@ bool orderprintwork::GetPrtTemplet(int prttype, int pagew, QString &context, con
if
(
order
.
order_type
==
1
)
if
(
order
.
order_type
==
1
)
{
{
file
.
setFileName
(
qApp
->
applicationDirPath
()
+
"/"
+
XML_TAKEOUT80_TEMPLATE
);
file
.
setFileName
(
qApp
->
applicationDirPath
()
+
"/"
+
XML_TAKEOUT80_TEMPLATE
);
}
}
else
if
(
order
.
order_type
==
2
)
else
if
(
order
.
order_type
==
2
)
{
{
...
@@ -242,7 +245,7 @@ void orderprintwork::DoPrint(const QString &prtname, const QString &orderid, con
...
@@ -242,7 +245,7 @@ void orderprintwork::DoPrint(const QString &prtname, const QString &orderid, con
return
;
return
;
}
}
flag
=
NewPrintLib
::
GetInstance
().
DoPrint
(
strconfig
,
context
,
&
order
);
flag
=
NewPrintLib
::
GetInstance
().
DoPrint
(
strconfig
,
context
,
&
order
,
page
);
QLOG_DEBUG
()
<<
"NewPrintLib::GetInstance flag : "
<<
flag
;
QLOG_DEBUG
()
<<
"NewPrintLib::GetInstance flag : "
<<
flag
;
}
}
...
@@ -268,14 +271,14 @@ void orderprintwork::DoLabelPrint(const QString &prtname, const QString &orderid
...
@@ -268,14 +271,14 @@ void orderprintwork::DoLabelPrint(const QString &prtname, const QString &orderid
if
(
page
==
0
)
if
(
page
==
0
)
page
=
56
;
page
=
56
;
if
(
!
GetPrtTemplet
(
0
,
page
,
context
,
order
))
if
(
!
GetPrtTemplet
(
1
,
page
,
context
,
order
))
{
{
QLOG_ERROR
()
<<
"orderprintwork::DoLabelPrint::GetPrtTemplet failed"
;
QLOG_ERROR
()
<<
"orderprintwork::DoLabelPrint::GetPrtTemplet failed"
;
return
;
return
;
}
}
flag
=
NewPrintLib
::
GetInstance
().
DoLabelPrint
(
strconfig
,
&
order
);
//
flag = NewPrintLib::GetInstance().DoLabelPrint(strconfig, &order);
//
flag = NewPrintLib::GetInstance().DoLabelModelPrint(strconfig, context, &order);
flag
=
NewPrintLib
::
GetInstance
().
DoLabelModelPrint
(
strconfig
,
context
,
&
order
);
QLOG_DEBUG
()
<<
"DoLabelPrint NewPrintLib::GetInstance flag : "
<<
flag
;
QLOG_DEBUG
()
<<
"DoLabelPrint NewPrintLib::GetInstance flag : "
<<
flag
;
}
}
...
@@ -362,7 +365,7 @@ void orderprintwork::DoBackPrint(const QString &prtname, const QString &orderid,
...
@@ -362,7 +365,7 @@ void orderprintwork::DoBackPrint(const QString &prtname, const QString &orderid,
return
;
return
;
}
}
flag
=
NewPrintLib
::
GetInstance
().
DoBackPrint
(
pagedepart
,
proddeprat
,
pagenum
,
prodlist
,
strconfig
,
context
,
&
order
);
flag
=
NewPrintLib
::
GetInstance
().
DoBackPrint
(
pagedepart
,
proddeprat
,
pagenum
,
prodlist
,
strconfig
,
context
,
&
order
,
page
);
}
}
//bool orderprintwork::event(QEvent *e)
//bool orderprintwork::event(QEvent *e)
...
...
takeout/control/orderpushwork.cpp
View file @
d6d46096
...
@@ -103,6 +103,27 @@ bool OrderPushWork::connectTcpServer()
...
@@ -103,6 +103,27 @@ bool OrderPushWork::connectTcpServer()
QLOG_INFO
()
<<
"ip:"
<<
ip
<<
"; port:"
<<
port
;
QLOG_INFO
()
<<
"ip:"
<<
ip
<<
"; port:"
<<
port
;
#ifdef NO_USE_SSL
_socket
=
new
QTcpSocket
();
connect
(
_socket
,
&
QTcpSocket
::
connected
,
[
this
]
()
{
_istimeout
=
false
;
emit
connected
();
});
connect
(
_socket
,
static_cast
<
void
(
QTcpSocket
::*
)(
QAbstractSocket
::
SocketError
)
>
(
&
QTcpSocket
::
error
),
this
,
&
OrderPushWork
::
quit
);
connect
(
_socket
,
&
QTcpSocket
::
readyRead
,
[
this
]
()
{
_istimeout
=
false
;
emit
readready
();
});
connect
(
_socket
,
&
QTcpSocket
::
bytesWritten
,
[
this
]
(
quint64
writebyte
)
{
_istimeout
=
false
;
emit
writeready
();
});
#else
_socket
=
new
QSslSocket
();
_socket
=
new
QSslSocket
();
connect
(
_socket
,
&
QSslSocket
::
connected
,
[
this
]
()
{
connect
(
_socket
,
&
QSslSocket
::
connected
,
[
this
]
()
{
...
@@ -121,6 +142,7 @@ bool OrderPushWork::connectTcpServer()
...
@@ -121,6 +142,7 @@ bool OrderPushWork::connectTcpServer()
_istimeout
=
false
;
_istimeout
=
false
;
emit
writeready
();
emit
writeready
();
});
});
#endif
_socket
->
addCaCertificates
(
qApp
->
applicationDirPath
()
+
"/"
+
"microwstest.sandload.cn.pem"
);
_socket
->
addCaCertificates
(
qApp
->
applicationDirPath
()
+
"/"
+
"microwstest.sandload.cn.pem"
);
...
@@ -148,12 +170,12 @@ bool OrderPushWork::connectTcpServer()
...
@@ -148,12 +170,12 @@ bool OrderPushWork::connectTcpServer()
connect
(
&
timer
,
&
QTimer
::
timeout
,
&
loop
,
&
QEventLoop
::
quit
);
connect
(
&
timer
,
&
QTimer
::
timeout
,
&
loop
,
&
QEventLoop
::
quit
);
connect
(
this
,
&
OrderPushWork
::
connected
,
&
loop
,
&
QEventLoop
::
quit
);
connect
(
this
,
&
OrderPushWork
::
connected
,
&
loop
,
&
QEventLoop
::
quit
);
timer
.
start
(
1
0
*
1000
);
timer
.
start
(
6
0
*
1000
);
loop
.
exec
();
loop
.
exec
();
}
}
QLOG_WARN
()
<<
_socket
->
errorString
()
<<
_istimeout
;
QLOG_WARN
()
<<
_socket
->
errorString
()
<<
_
socket
->
sslErrors
()
<<
_
istimeout
;
return
!
_istimeout
;
return
!
_istimeout
;
}
}
...
...
takeout/control/orderpushwork.h
View file @
d6d46096
...
@@ -172,8 +172,11 @@ private:
...
@@ -172,8 +172,11 @@ private:
//超时标识
//超时标识
bool
_istimeout
;
bool
_istimeout
;
//长连接套接字
//长连接套接字
//QTcpSocket *_socket;
#ifdef NO_USE_SSL
QTcpSocket
*
_socket
;
#else
QSslSocket
*
_socket
;
QSslSocket
*
_socket
;
#endif
//token
//token
QString
_token
;
QString
_token
;
//token 锁
//token 锁
...
...
takeout/control/prtmodelgetwork.cpp
View file @
d6d46096
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#include <QApplication>
#include <QApplication>
#include <QDir>
#include <QDir>
#include <Windows.h>
#include <Windows.h>
#include <QSettings>
prtModelGetWork
::
prtModelGetWork
(
WorkObject
*
parent
)
:
WorkObject
(
parent
)
prtModelGetWork
::
prtModelGetWork
(
WorkObject
*
parent
)
:
WorkObject
(
parent
)
{
{
...
@@ -195,12 +196,20 @@ bool prtModelGetWork::CheckPrtModelInfo(QJsonObject &json)
...
@@ -195,12 +196,20 @@ bool prtModelGetWork::CheckPrtModelInfo(QJsonObject &json)
}
else
{
}
else
{
return
false
;
return
false
;
}
}
if
(
array
.
at
(
i
).
toObject
().
contains
(
"table_head"
)
&&
array
.
at
(
i
).
toObject
().
contains
(
"print_type"
))
{
// if(array.at(i).toObject()["table_head"].toString() != 0) {
_tableHeadMap
.
insert
(
array
.
at
(
i
).
toObject
()[
"print_type"
].
toInt
(),
array
.
at
(
i
).
toObject
()[
"table_head"
].
toString
());
// }
}
}
}
QLOG_DEBUG
()
<<
"_tableHeadMap:"
<<
_tableHeadMap
;
prtModelLocalize
();
prtModelLocalize
();
logoImageLocalize
();
logoImageLocalize
();
qrCodeImageLocalize
();
qrCodeImageLocalize
();
tableHeadLocalize
();
return
true
;
return
true
;
}
}
...
@@ -216,6 +225,7 @@ bool prtModelGetWork::prtModelLocalize()
...
@@ -216,6 +225,7 @@ bool prtModelGetWork::prtModelLocalize()
bool
res
=
dir
.
mkpath
(
dir_str
);
bool
res
=
dir
.
mkpath
(
dir_str
);
qDebug
()
<<
"新建目录是否成功"
<<
res
;
qDebug
()
<<
"新建目录是否成功"
<<
res
;
}
}
QMap
<
int
,
QString
>::
iterator
it
;
QMap
<
int
,
QString
>::
iterator
it
;
for
(
it
=
_templateMap
.
begin
();
it
!=
_templateMap
.
end
();
++
it
)
{
for
(
it
=
_templateMap
.
begin
();
it
!=
_templateMap
.
end
();
++
it
)
{
QFile
file
(
QApplication
::
applicationDirPath
()
+
QString
(
"/prtinfo/%1.xml"
).
arg
(
it
.
key
()));
QFile
file
(
QApplication
::
applicationDirPath
()
+
QString
(
"/prtinfo/%1.xml"
).
arg
(
it
.
key
()));
...
@@ -259,6 +269,15 @@ bool prtModelGetWork::qrCodeImageLocalize()
...
@@ -259,6 +269,15 @@ bool prtModelGetWork::qrCodeImageLocalize()
return
true
;
return
true
;
}
}
bool
prtModelGetWork
::
tableHeadLocalize
()
{
QMap
<
int
,
QString
>::
iterator
it
;
for
(
it
=
_tableHeadMap
.
begin
();
it
!=
_tableHeadMap
.
end
();
++
it
)
{
bool
res
=
mapIntoFile
(
QString
::
number
(
it
.
key
()),
it
.
value
());
}
return
true
;
}
bool
prtModelGetWork
::
downloadImage
(
QString
url
,
QString
fileName
)
bool
prtModelGetWork
::
downloadImage
(
QString
url
,
QString
fileName
)
{
{
QNetworkAccessManager
m_networkManger
;
QNetworkAccessManager
m_networkManger
;
...
@@ -296,6 +315,17 @@ bool prtModelGetWork::downloadImage(QString url, QString fileName)
...
@@ -296,6 +315,17 @@ bool prtModelGetWork::downloadImage(QString url, QString fileName)
return
true
;
return
true
;
}
}
bool
prtModelGetWork
::
mapIntoFile
(
QString
key
,
QString
value
)
{
QString
tableheadname
=
QApplication
::
applicationDirPath
()
+
QString
(
"/prtinfo/tablehead.ini"
);
QSettings
m_setting
(
tableheadname
,
QSettings
::
IniFormat
);
m_setting
.
setIniCodec
(
"UTF-8"
);
m_setting
.
setValue
(
key
,
value
);
return
true
;
}
bool
prtModelGetWork
::
praseXmlPrtModel
(
QString
str
)
bool
prtModelGetWork
::
praseXmlPrtModel
(
QString
str
)
{
{
QDomDocument
doc
;
QDomDocument
doc
;
...
...
takeout/control/prtmodelgetwork.h
View file @
d6d46096
...
@@ -44,8 +44,12 @@ private:
...
@@ -44,8 +44,12 @@ private:
bool
qrCodeImageLocalize
();
bool
qrCodeImageLocalize
();
bool
tableHeadLocalize
();
bool
downloadImage
(
QString
url
,
QString
fileName
);
bool
downloadImage
(
QString
url
,
QString
fileName
);
bool
mapIntoFile
(
QString
key
,
QString
value
);
bool
praseXmlPrtModel
(
QString
str
);
bool
praseXmlPrtModel
(
QString
str
);
void
img_rgb2gray
();
void
img_rgb2gray
();
...
@@ -63,6 +67,7 @@ private:
...
@@ -63,6 +67,7 @@ private:
QMap
<
int
,
QString
>
_templateMap
;
QMap
<
int
,
QString
>
_templateMap
;
QMap
<
int
,
QString
>
_qrCodeMap
;
QMap
<
int
,
QString
>
_qrCodeMap
;
QMap
<
int
,
QString
>
_logoMap
;
QMap
<
int
,
QString
>
_logoMap
;
QMap
<
int
,
QString
>
_tableHeadMap
;
};
};
class
GetPrtModelDataProcess
class
GetPrtModelDataProcess
...
@@ -145,6 +150,7 @@ private:
...
@@ -145,6 +150,7 @@ private:
static
bool
getPrtModelOptRequest
(
QJsonObject
&
data
,
QString
partnerid
)
static
bool
getPrtModelOptRequest
(
QJsonObject
&
data
,
QString
partnerid
)
{
{
data
.
insert
(
JSON_KEY_PARTNERID
,
partnerid
);
data
.
insert
(
JSON_KEY_PARTNERID
,
partnerid
);
data
.
insert
(
JSON_KEY_REQUESTRESOURCE
,
1
);
return
true
;
return
true
;
}
}
...
...
takeout/event/posevent.cpp
View file @
d6d46096
...
@@ -35,6 +35,7 @@ QEvent::Type PosEvent::s_get_driver_info = static_cast<QEvent::Type>(QEvent::reg
...
@@ -35,6 +35,7 @@ QEvent::Type PosEvent::s_get_driver_info = static_cast<QEvent::Type>(QEvent::reg
QEvent
::
Type
PosEvent
::
s_need_get_driver_info
=
static_cast
<
QEvent
::
Type
>
(
QEvent
::
registerEventType
());
QEvent
::
Type
PosEvent
::
s_need_get_driver_info
=
static_cast
<
QEvent
::
Type
>
(
QEvent
::
registerEventType
());
QEvent
::
Type
PosEvent
::
s_show_pickup
=
static_cast
<
QEvent
::
Type
>
(
QEvent
::
registerEventType
());
QEvent
::
Type
PosEvent
::
s_show_pickup
=
static_cast
<
QEvent
::
Type
>
(
QEvent
::
registerEventType
());
QEvent
::
Type
PosEvent
::
s_hide_loading
=
static_cast
<
QEvent
::
Type
>
(
QEvent
::
registerEventType
());
PosEvent
::
PosEvent
(
Type
e
)
:
QEvent
(
e
)
PosEvent
::
PosEvent
(
Type
e
)
:
QEvent
(
e
)
{
{
...
...
takeout/event/posevent.h
View file @
d6d46096
...
@@ -124,6 +124,8 @@ public:
...
@@ -124,6 +124,8 @@ public:
//---------------------长按悬浮框显示扫码点餐界面--------
//---------------------长按悬浮框显示扫码点餐界面--------
static
Type
s_show_pickup
;
static
Type
s_show_pickup
;
//---------------------隐藏loading界面的信号------------
static
Type
s_hide_loading
;
private
:
private
:
//事件携带的信息,该内存你应当在堆中分配
//事件携带的信息,该内存你应当在堆中分配
void
*
_info
;
void
*
_info
;
...
...
takeout/model/orderObject.cpp
View file @
d6d46096
...
@@ -598,3 +598,13 @@ void OrderObject::setrecords(const QStringList &v)
...
@@ -598,3 +598,13 @@ void OrderObject::setrecords(const QStringList &v)
{
{
records
=
v
;
records
=
v
;
}
}
QString
OrderObject
::
getOrdertypedesc
()
const
{
return
order_type_desc
;
}
void
OrderObject
::
setOrdertypedesc
(
const
QString
&
v
)
{
order_type_desc
=
v
;
}
takeout/model/orderObject.h
View file @
d6d46096
...
@@ -75,6 +75,7 @@ public:
...
@@ -75,6 +75,7 @@ public:
Q_PROPERTY
(
QString
code
READ
getCode
WRITE
setCode
)
Q_PROPERTY
(
QString
code
READ
getCode
WRITE
setCode
)
Q_PROPERTY
(
QString
order_type_desc
READ
getOrdertypedesc
WRITE
setOrdertypedesc
)
Q_PROPERTY
(
QJsonObject
_orderObject
READ
getOrderObject
WRITE
setOrderObject
)
Q_PROPERTY
(
QJsonObject
_orderObject
READ
getOrderObject
WRITE
setOrderObject
)
...
@@ -133,6 +134,8 @@ public:
...
@@ -133,6 +134,8 @@ public:
QString
store_name
;
//门店名称
QString
store_name
;
//门店名称
QString
store_phone
;
//门店点哈
QString
store_phone
;
//门店点哈
QString
order_type_desc
;
QString
getStore_phone
()
const
;
QString
getStore_phone
()
const
;
void
setStore_phone
(
const
QString
&
value
);
void
setStore_phone
(
const
QString
&
value
);
...
@@ -252,6 +255,8 @@ protected:
...
@@ -252,6 +255,8 @@ protected:
void
setdelivery_status
(
const
int
&
v
);
void
setdelivery_status
(
const
int
&
v
);
QStringList
getrecords
()
const
;
QStringList
getrecords
()
const
;
void
setrecords
(
const
QStringList
&
v
);
void
setrecords
(
const
QStringList
&
v
);
QString
getOrdertypedesc
()
const
;
void
setOrdertypedesc
(
const
QString
&
v
);
};
};
#endif // ORDEROBJECT_H
#endif // ORDEROBJECT_H
takeout/preDefine.h
View file @
d6d46096
...
@@ -164,6 +164,7 @@
...
@@ -164,6 +164,7 @@
#define JSON_KEY_VERSION "ver"
#define JSON_KEY_VERSION "ver"
#define JSON_KEY_PARTNERID "partner_id"
#define JSON_KEY_PARTNERID "partner_id"
#define JSON_KEY_REQUESTRESOURCE "request_source"
#define JSON_KEY_PUSH_PARTNERID "partnerId"
#define JSON_KEY_PUSH_PARTNERID "partnerId"
#define JSON_KEY_PUSH_STOREID "storeId"
#define JSON_KEY_PUSH_STOREID "storeId"
...
@@ -288,6 +289,8 @@
...
@@ -288,6 +289,8 @@
#define ORDER_THIRD_APPOINTMENTTAKEOUT "外卖预约"
#define ORDER_THIRD_APPOINTMENTTAKEOUT "外卖预约"
#define ORDER_THIRD_APPOINTMENTINVITE "自提预约"
#define ORDER_THIRD_APPOINTMENTINVITE "自提预约"
#define INVITETIME "预约:"
#define PRT_DELIVERY_TIME_TAKEOUT "尽快送出"
#define PRT_DELIVERY_TIME_TAKEOUT "尽快送出"
#define PRT_DELIVERY_TIME_INVITE "我已到店"
#define PRT_DELIVERY_TIME_INVITE "我已到店"
...
...
takeout/takeout.pro
View file @
d6d46096
...
@@ -23,6 +23,7 @@ LIBS += -lDbghelp
...
@@ -23,6 +23,7 @@ LIBS += -lDbghelp
#DEFINES += USE_QAACTION
#DEFINES += USE_QAACTION
DEFINES
+=
FM_NEW_UI
DEFINES
+=
FM_NEW_UI
#DEFINES += NO_USE_SSL
#DEFINES += FM_TEST
#DEFINES += FM_TEST
#DEFINES += FM_MAIN_TEST
#DEFINES += FM_MAIN_TEST
...
...
takeout/view/alertForm.cpp
View file @
d6d46096
#include "alertForm.h"
#include "alertForm.h"
#include "ui_alertForm.h"
#include "ui_alertForm.h"
#include "event/fmapplication.h"
#include "event/posevent.h"
#include "QsLog.h"
AlertForm
::
AlertForm
(
QWidget
*
parent
)
:
AlertForm
::
AlertForm
(
QWidget
*
parent
)
:
QDialog
(
parent
),
QDialog
(
parent
),
...
@@ -15,6 +18,7 @@ AlertForm::~AlertForm()
...
@@ -15,6 +18,7 @@ AlertForm::~AlertForm()
delete
ui
;
delete
ui
;
}
}
void
AlertForm
::
SetContent
(
AlertForm
::
Type
type
,
const
QString
&
msg
)
void
AlertForm
::
SetContent
(
AlertForm
::
Type
type
,
const
QString
&
msg
)
{
{
switch
(
type
)
switch
(
type
)
...
...
takeout/view/alertForm.h
View file @
d6d46096
...
@@ -25,7 +25,6 @@ public:
...
@@ -25,7 +25,6 @@ public:
}
Type
;
}
Type
;
/* 功能:设置显示内容
/* 功能:设置显示内容
* 参数:[1]窗体类型[2]信息内容
* 参数:[1]窗体类型[2]信息内容
* 返回:NULL
* 返回:NULL
...
...
takeout/view/frminput.h
View file @
d6d46096
#ifndef FRMINPUT_H
#ifndef FRMINPUT_H
#define FRMINPUT_H
#define FRMINPUT_H
//主界面软键盘
#include <QWidget>
#include <QWidget>
#include <QMouseEvent>
#include <QMouseEvent>
...
...
takeout/view/newchangeshiftsform.cpp
View file @
d6d46096
...
@@ -252,7 +252,7 @@ void NewChangeShiftsForm::DoPrint(const QString &prtname, const QVariantMap conf
...
@@ -252,7 +252,7 @@ void NewChangeShiftsForm::DoPrint(const QString &prtname, const QVariantMap conf
QLOG_DEBUG
()
<<
"NewChangeShiftsForm::DoPrint XML : "
<<
tmpcontext
.
data
();
QLOG_DEBUG
()
<<
"NewChangeShiftsForm::DoPrint XML : "
<<
tmpcontext
.
data
();
flag
=
NewPrintLib
::
GetInstance
().
DoPrint
(
strconfig
,
context
,
&
order
);
flag
=
NewPrintLib
::
GetInstance
().
DoPrint
(
strconfig
,
context
,
&
order
,
width
);
QLOG_DEBUG
()
<<
"NewPrintLib::GetInstance flag : "
<<
flag
;
QLOG_DEBUG
()
<<
"NewPrintLib::GetInstance flag : "
<<
flag
;
}
}
...
...
takeout/view/newmainform.cpp
View file @
d6d46096
...
@@ -53,6 +53,12 @@ NewMainForm::NewMainForm(QWidget *parent) :
...
@@ -53,6 +53,12 @@ NewMainForm::NewMainForm(QWidget *parent) :
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_show_pickup
);
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_show_pickup
);
//this->show();
//this->show();
//删除界面上的手动、自动接单选择项
ui
->
newlabel_11
->
hide
();
ui
->
newmainrdbtn_auto
->
hide
();
ui
->
newmainrdbtn_self
->
hide
();
this
->
showFullScreen
();
this
->
showFullScreen
();
this
->
hide
();
this
->
hide
();
...
@@ -295,7 +301,8 @@ void NewMainForm::onShowAlert(AlertForm::Type type, const QString &msg)
...
@@ -295,7 +301,8 @@ void NewMainForm::onShowAlert(AlertForm::Type type, const QString &msg)
if
(
this
->
isVisible
())
if
(
this
->
isVisible
())
{
{
_alertForm
->
SetContent
(
type
,
msg
);
_alertForm
->
SetContent
(
type
,
msg
);
_alertForm
->
show
();
if
(
type
!=
0
)
_alertForm
->
show
();
}
}
}
}
...
@@ -737,7 +744,7 @@ bool NewMainForm::event(QEvent *e)
...
@@ -737,7 +744,7 @@ bool NewMainForm::event(QEvent *e)
else
if
(
value
.
contains
(
EVENT_KEY_STATUS
)
&&
value
[
EVENT_KEY_STATUS
].
toBool
()
==
true
)
else
if
(
value
.
contains
(
EVENT_KEY_STATUS
)
&&
value
[
EVENT_KEY_STATUS
].
toBool
()
==
true
)
{
{
if
(
!
this
->
isHidden
())
if
(
!
this
->
isHidden
())
onShowAlert
(
AlertForm
::
SUCCESS
,
value
[
EVENT_KEY_MSG
].
toString
()
);
_alertForm
->
hide
(
);
}
}
return
true
;
return
true
;
}
}
...
@@ -1730,21 +1737,21 @@ bool NewMainForm::GetContext(QString &context)
...
@@ -1730,21 +1737,21 @@ bool NewMainForm::GetContext(QString &context)
return
true
;
return
true
;
}
}
}
}
//
else if(_prttype == 1)
else
if
(
_prttype
==
1
)
//
{
{
//
QFile file(labelname);
QFile
file
(
labelname
);
//
if(file.open(QFile::ReadOnly))
if
(
file
.
open
(
QFile
::
ReadOnly
))
//
{
{
//
QByteArray data = file.readAll();
QByteArray
data
=
file
.
readAll
();
//
context = QString::fromUtf8(data);
context
=
QString
::
fromUtf8
(
data
);
//
file.close();
file
.
close
();
//
return true;
return
true
;
//
}
}
//
}
}
return
false
;
return
false
;
}
}
...
@@ -1765,7 +1772,8 @@ void NewMainForm::on_newmainbtn_prttest_clicked()
...
@@ -1765,7 +1772,8 @@ void NewMainForm::on_newmainbtn_prttest_clicked()
OrderObject
order
;
OrderObject
order
;
order
.
order_id
=
"8888888888888888"
;
order
.
order_id
=
"8888888888888888"
;
order
.
order_index
=
8888
;
order
.
order_type_desc
=
QString
::
fromUtf8
(
"
\xE8\x87\xAA\xE6\x8F\x90
"
);
order
.
order_index
=
100
;
order
.
code
=
"8888"
;
order
.
code
=
"8888"
;
order
.
store_name
=
QString
::
fromUtf8
(
"
\xE9\x9D\x9E\xE7\xA0\x81\xE6\xB5\x8B\xE8\xAF\x95\xE9\x97\xA8\xE5\xBA\x97
"
);
order
.
store_name
=
QString
::
fromUtf8
(
"
\xE9\x9D\x9E\xE7\xA0\x81\xE6\xB5\x8B\xE8\xAF\x95\xE9\x97\xA8\xE5\xBA\x97
"
);
order
.
channel
=
QString
::
fromUtf8
(
"
\x69\xE5\xBA\x94\xE7\x94\xA8\xE7\x82\xB9\xE9\xA4\x90
"
);
order
.
channel
=
QString
::
fromUtf8
(
"
\x69\xE5\xBA\x94\xE7\x94\xA8\xE7\x82\xB9\xE9\xA4\x90
"
);
...
@@ -1826,21 +1834,21 @@ void NewMainForm::on_newmainbtn_prttest_clicked()
...
@@ -1826,21 +1834,21 @@ void NewMainForm::on_newmainbtn_prttest_clicked()
QString
context
;
QString
context
;
if
((
_prttype
!=
1
&&
GetContext
(
context
)
==
false
)
||
(
_prttype
!=
1
&&
context
.
isEmpty
()))
// if((_prttype != 1 && GetContext(context) == false) || (_prttype != 1 && context.isEmpty()))
{
QLOG_ERROR
()
<<
"context:"
<<
context
;
ui
->
newmainlabel_errmsg
->
setText
(
QString
::
fromUtf8
(
"
\xE8\x8E\xB7\xE5\x8F\x96\xE6\x89\x93\xE5\x8D\xB0\xE6\xA8\xA1\xE6\x9D\xBF\xE5\xA4\xB1\xE8\xB4\xA5
"
));
return
;
}
//增加杯贴打印模板
// if((GetContext(context) == false) || (context.isEmpty()))
// {
// {
// QLOG_ERROR() << "context:" << context;
// QLOG_ERROR() << "context:" << context;
// ui->newmainlabel_errmsg->setText(QString::fromUtf8("\xE8\x8E\xB7\xE5\x8F\x96\xE6\x89\x93\xE5\x8D\xB0\xE6\xA8\xA1\xE6\x9D\xBF\xE5\xA4\xB1\xE8\xB4\xA5"));
// ui->newmainlabel_errmsg->setText(QString::fromUtf8("\xE8\x8E\xB7\xE5\x8F\x96\xE6\x89\x93\xE5\x8D\xB0\xE6\xA8\xA1\xE6\x9D\xBF\xE5\xA4\xB1\xE8\xB4\xA5"));
// return ;
// return ;
// }
// }
//增加杯贴打印模板
if
((
GetContext
(
context
)
==
false
)
||
(
context
.
isEmpty
()))
{
QLOG_ERROR
()
<<
"context:"
<<
context
;
ui
->
newmainlabel_errmsg
->
setText
(
QString
::
fromUtf8
(
"
\xE8\x8E\xB7\xE5\x8F\x96\xE6\x89\x93\xE5\x8D\xB0\xE6\xA8\xA1\xE6\x9D\xBF\xE5\xA4\xB1\xE8\xB4\xA5
"
));
return
;
}
bool
flag
=
false
;
bool
flag
=
false
;
qsrand
(
QTime
(
0
,
0
,
0
).
secsTo
(
QTime
::
currentTime
()));
qsrand
(
QTime
(
0
,
0
,
0
).
secsTo
(
QTime
::
currentTime
()));
...
@@ -1857,13 +1865,20 @@ void NewMainForm::on_newmainbtn_prttest_clicked()
...
@@ -1857,13 +1865,20 @@ void NewMainForm::on_newmainbtn_prttest_clicked()
QLOG_DEBUG
()
<<
"context:"
<<
context
;
QLOG_DEBUG
()
<<
"context:"
<<
context
;
if
(
_prttype
==
0
)
if
(
_prttype
==
0
)
flag
=
lib
.
DoPrint
(
prtconfig
,
context
,
&
order
);
flag
=
lib
.
DoPrint
(
prtconfig
,
context
,
&
order
,
80
);
else
if
(
_prttype
==
1
)
else
if
(
_prttype
==
1
)
flag
=
lib
.
DoLabelPrint
(
prtconfig
,
&
order
);
//
flag = lib.DoLabelPrint(prtconfig, &order);
//
flag = lib.DoLabelModelPrint(prtconfig, context, &order);
flag
=
lib
.
DoLabelModelPrint
(
prtconfig
,
context
,
&
order
);
else
if
(
_prttype
==
2
)
else
if
(
_prttype
==
2
)
flag
=
lib
.
DoBackPrint
(
pagerepart
,
prodrepart
,
pagenum
,
list
,
prtconfig
,
context
,
&
order
);
flag
=
lib
.
DoBackPrint
(
pagerepart
,
prodrepart
,
pagenum
,
list
,
prtconfig
,
context
,
&
order
,
80
);
if
(
!
flag
)
if
(
!
flag
)
ui
->
newmainlabel_errmsg
->
setText
(
"
\xE6\x89\x93\xE5\x8D\xB0\xE6\x8C\x87\xE4\xBB\xA4\xE5\x8F\x91\xE9\x80\x81\xE5\xA4\xB1\xE8\xB4\xA5
"
);
ui
->
newmainlabel_errmsg
->
setText
(
"
\xE6\x89\x93\xE5\x8D\xB0\xE6\x8C\x87\xE4\xBB\xA4\xE5\x8F\x91\xE9\x80\x81\xE5\xA4\xB1\xE8\xB4\xA5
"
);
}
}
void
NewMainForm
::
on_userlab_logoutBtn_clicked
()
{
QString
configfile
=
qApp
->
applicationDirPath
()
+
"/"
+
CONFIG_NAME
;
QSettings
(
configfile
,
QSettings
::
IniFormat
).
setValue
(
"info/autologin"
,
0
);
FMApplication
::
exit
();
}
takeout/view/newmainform.h
View file @
d6d46096
...
@@ -118,6 +118,8 @@ private slots:
...
@@ -118,6 +118,8 @@ private slots:
void
on_newmainbtn_prttest_clicked
();
void
on_newmainbtn_prttest_clicked
();
void
on_userlab_logoutBtn_clicked
();
private
:
private
:
Ui
::
NewMainForm
*
ui
;
Ui
::
NewMainForm
*
ui
;
//
//
...
...
takeout/view/newmainform.ui
View file @
d6d46096
...
@@ -281,6 +281,13 @@ QTabWidget#newmaintbwgt QTabBar::tab
...
@@ -281,6 +281,13 @@ QTabWidget#newmaintbwgt QTabBar::tab
{
{
background-color: rgb(255, 255, 255);
background-color: rgb(255, 255, 255);
}
#userlab_logoutBtn
{
font: 14pt
"
微软雅黑
"
;
border:2px solid rgb(230,230,230);
border-radius:5px;
background:red;
}
</string>
}
</string>
</property>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
stretch=
"0,7"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
stretch=
"0,7"
>
...
@@ -869,7 +876,7 @@ QTabWidget#newmaintbwgt QTabBar::tab
...
@@ -869,7 +876,7 @@ QTabWidget#newmaintbwgt QTabBar::tab
<enum>
QTabWidget::Rounded
</enum>
<enum>
QTabWidget::Rounded
</enum>
</property>
</property>
<property
name=
"currentIndex"
>
<property
name=
"currentIndex"
>
<number>
1
</number>
<number>
2
</number>
</property>
</property>
<property
name=
"iconSize"
>
<property
name=
"iconSize"
>
<size>
<size>
...
@@ -3803,6 +3810,61 @@ QTabWidget#newmaintbwgt QTabBar::tab
...
@@ -3803,6 +3810,61 @@ QTabWidget#newmaintbwgt QTabBar::tab
<attribute
name=
"title"
>
<attribute
name=
"title"
>
<string>
用户设置
</string>
<string>
用户设置
</string>
</attribute>
</attribute>
<layout
class=
"QGridLayout"
name=
"gridLayout_2"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QWidget"
name=
"widget_3"
native=
"true"
>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"0"
column=
"0"
>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_20"
>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_19"
>
<item>
<widget
class=
"QPushButton"
name=
"userlab_logoutBtn"
>
<property
name=
"minimumSize"
>
<size>
<width>
100
</width>
<height>
50
</height>
</size>
</property>
<property
name=
"text"
>
<string>
注销
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_44"
>
<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>
</item>
<item>
<spacer
name=
"verticalSpacer_22"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
</widget>
</item>
</item>
...
...
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