Commit c768bf9d by xiaoqing.gu

1、添加交接班打印的icon 2、修复打印内存泄漏的问题

parent e5ca3f7d
...@@ -48,5 +48,7 @@ ...@@ -48,5 +48,7 @@
<file>login_save.png</file> <file>login_save.png</file>
<file>login_unsave.png</file> <file>login_unsave.png</file>
<file>icon_order_detail_close.png</file> <file>icon_order_detail_close.png</file>
<file>shift_off.png</file>
<file>shift_on.png</file>
</qresource> </qresource>
</RCC> </RCC>
\ No newline at end of file
...@@ -284,12 +284,16 @@ bool NewPrintLib::DoPrint(const QString &config, const QString &context, OrderOb ...@@ -284,12 +284,16 @@ bool NewPrintLib::DoPrint(const QString &config, const QString &context, OrderOb
CONSTCHARTOCHAR(prtconfigdata, prtconfig); CONSTCHARTOCHAR(prtconfigdata, prtconfig);
char *xml = NULL; char *xml = NULL;
// QByteArray xmldata = context.toUtf8(); // QByteArray xmldata = context.toUtf8();
QByteArray xmldata = context.toLocal8Bit(); QByteArray xmldata = context.toLocal8Bit();
CONSTCHARTOCHAR(xmldata, xml); CONSTCHARTOCHAR(xmldata, xml);
char *orderinfo = NULL; char *orderinfo = NULL;
// QByteArray orderdata = QString(QJsonDocument(tmporder._orderObject).toJson()).toUtf8(); // QByteArray orderdata = QString(QJsonDocument(tmporder._orderObject).toJson()).toUtf8();
...@@ -356,7 +360,6 @@ bool NewPrintLib::DoPrint(const QString &config, const QString &context, OrderOb ...@@ -356,7 +360,6 @@ bool NewPrintLib::DoPrint(const QString &config, const QString &context, OrderOb
} }
} }
QLOG_DEBUG() << "NewNew";
//将订单的预约时间拿过来转换成订单需要的QString类型 //将订单的预约时间拿过来转换成订单需要的QString类型
int delivery_time = orderObj["delivery_time"].toInt(); int delivery_time = orderObj["delivery_time"].toInt();
...@@ -377,13 +380,12 @@ bool NewPrintLib::DoPrint(const QString &config, const QString &context, OrderOb ...@@ -377,13 +380,12 @@ bool NewPrintLib::DoPrint(const QString &config, const QString &context, OrderOb
tmporder._orderObject.insert("prt_delivery_time", prt_delivery_time); tmporder._orderObject.insert("prt_delivery_time", prt_delivery_time);
QLOG_DEBUG() << "prt_type" << type;
QLOG_DEBUG() << "NewNew tmporder._orderObject :" << tmporder._orderObject; QLOG_DEBUG() << "NewNew tmporder._orderObject :" << tmporder._orderObject;
QByteArray orderdata = QString(QJsonDocument(tmporder._orderObject).toJson()).toLocal8Bit(); QByteArray orderdata = QString(QJsonDocument(tmporder._orderObject).toJson()).toLocal8Bit();
CONSTCHARTOCHAR(orderdata, orderinfo); CONSTCHARTOCHAR(orderdata, orderinfo);
char err[1024] = {0}; char err[1024] = {0};
f_DoPrintWithXml(prtconfig, orderinfo, xml, err); f_DoPrintWithXml(prtconfig, orderinfo, xml, err);
...@@ -393,6 +395,10 @@ bool NewPrintLib::DoPrint(const QString &config, const QString &context, OrderOb ...@@ -393,6 +395,10 @@ bool NewPrintLib::DoPrint(const QString &config, const QString &context, OrderOb
QLOG_ERROR() << "f_DoPrintWithXml failed error : " << err; QLOG_ERROR() << "f_DoPrintWithXml failed error : " << err;
} }
delete [] prtconfig;
delete [] xml;
delete [] orderinfo;
QLOG_DEBUG() << "f_DoPrintWithXml success"; QLOG_DEBUG() << "f_DoPrintWithXml success";
// char* configStr; // char* configStr;
...@@ -751,6 +757,10 @@ bool NewPrintLib::DoBackPrint(int page_depart, int prod_depart, int page_num, co ...@@ -751,6 +757,10 @@ bool NewPrintLib::DoBackPrint(int page_depart, int prod_depart, int page_num, co
QLOG_ERROR() << "f_DoPrintWithXml failed error : " << err; QLOG_ERROR() << "f_DoPrintWithXml failed error : " << err;
} }
delete [] prtconfig;
delete [] xml;
delete [] orderinfo;
QLOG_DEBUG() << "f_DoPrintWithXml success"; QLOG_DEBUG() << "f_DoPrintWithXml success";
......
...@@ -105,14 +105,14 @@ void MainBtn::setChecked(bool check) ...@@ -105,14 +105,14 @@ void MainBtn::setChecked(bool check)
if(check) if(check)
{ {
ui->mainbtnlabel_name->setStyleSheet("#mainbtnlabel_name{color:rgba(255,255,255,1)}"); ui->mainbtnlabel_name->setStyleSheet("#mainbtnlabel_name{color:rgba(255,255,255,1)}");
ui->mainbtnlabel_lg->setStyleSheet("#mainbtnlabel_lg{ border-image: url(:scan_on.png)}"); ui->mainbtnlabel_lg->setStyleSheet("#mainbtnlabel_lg{ border-image: url(:shift_on.png)}");
_info = QString::fromUtf8("\xE4\xBA\xA4\xE6\x8E\xA5\xE7\x8F\xAD"); _info = QString::fromUtf8("\xE4\xBA\xA4\xE6\x8E\xA5\xE7\x8F\xAD");
QLOG_DEBUG() << "*shifts" << _info; QLOG_DEBUG() << "*shifts" << _info;
} }
else else
{ {
ui->mainbtnlabel_name->setStyleSheet("#mainbtnlabel_name{color:rgba(125,139,153,1)}"); ui->mainbtnlabel_name->setStyleSheet("#mainbtnlabel_name{color:rgba(125,139,153,1)}");
ui->mainbtnlabel_lg->setStyleSheet("#mainbtnlabel_lg{ border-image: url(:scan_off.png)}"); ui->mainbtnlabel_lg->setStyleSheet("#mainbtnlabel_lg{ border-image: url(:shift_off.png)}");
} }
return ; return ;
} }
......
...@@ -134,7 +134,7 @@ private: ...@@ -134,7 +134,7 @@ private:
data.insert(JSON_KEY_PARTNERID, map[JSON_KEY_PARTNERID].toString()); data.insert(JSON_KEY_PARTNERID, map[JSON_KEY_PARTNERID].toString());
data.insert(JSON_STOREID, map[JSON_STOREID].toString()); data.insert(JSON_STOREID, map[JSON_STOREID].toString());
data.insert(JSON_SEARCHSTARTDATE, map[JSON_KEY_TIMESTAMP].toString()); data.insert(JSON_SEARCHSTARTDATE, map[JSON_KEY_TIMESTAMP].toString());
// data.insert(JSON_SEARCHSTARTDATE, QString("2019-03-01 00:00:00")); // data.insert(JSON_SEARCHSTARTDATE, QString("2019-03-01 00:00"));
data.insert(JSON_SEARCHENDDATE, QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm")); data.insert(JSON_SEARCHENDDATE, QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm"));
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment