Commit 756f75c9 by xiaoqing.gu

1、修改版本号 3.0.2.4 2、杯贴打印模板化改造 3、未登录退出阻塞bug修复 4、取消pos编号 5、posorderpool加入堂食订单的概念 6、悬浮窗提示展示bug修复

parent 1a997b69
......@@ -784,6 +784,247 @@ bool NewPrintLib::DoLabelPrint(const QString &config, OrderObject *order)
return PrintLabel(config, order);
}
bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &context, OrderObject *order)
{
OrderObject tmporder = *order;
QLOG_DEBUG() << "input1:" << tmporder._orderObject;
if(!_load_flag && !LoadFunction())
{
QLOG_ERROR() << "NewPrintLib::DoPrint failed";
return false;
}
char *prtconfig = NULL;
QByteArray prtconfigdata = config.toLocal8Bit();
CONSTCHARTOCHAR(prtconfigdata, prtconfig);
char *xml = NULL;
QByteArray xmldata = context.toLocal8Bit();
CONSTCHARTOCHAR(xmldata, xml);
char *orderinfo = NULL;
//根据订单号填写打印模板的表头
QJsonObject orderObj = tmporder._orderObject;
int type = -100;
if(orderObj.contains("order_type")) {
type = orderObj["order_type"].toInt();
}
QLOG_DEBUG() << "NewPrintLib::type:" << type;
//表头设置
QString channel = orderObj["channel"].toString();
QLOG_DEBUG() << "NewPrintLib::channel:" << channel;
if(QString("saas").compare(channel, Qt::CaseInsensitive) == 0)
{
switch(type) {
case TimelyTakeout:
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYTAKEOUT));
break;
case AppointmentTakeout:
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTTAKEOUT));
break;
case TimelyDining:
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE));
break;
case AppointmentDining:
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTINVITE));
break;
case TimelyInvite:
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE));
break;
case AppointmentInvite:
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTINVITE));
break;
default:
break;
}
} else {
switch(type) {
case TimelyTakeout:
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_TIMELYTAKEOUT));
break;
case AppointmentTakeout:
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_APPOINTMENTTAKEOUT));
break;
case TimelyDining:
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE));
break;
case AppointmentDining:
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_APPOINTMENTINVITE));
break;
case TimelyInvite:
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE));
break;
case AppointmentInvite:
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_APPOINTMENTINVITE));
break;
default:
break;
}
}
//将订单的预约时间拿过来转换成订单需要的QString类型
int delivery_time = orderObj["delivery_time"].toInt();
QLOG_DEBUG() << "prt_type" << type;
QString prt_delivery_time;
if(type == 1)
{
prt_delivery_time = QString::fromLocal8Bit(PRT_DELIVERY_TIME_TAKEOUT);
}
else if(type == 3 || type == 5)
{
prt_delivery_time = QString::fromLocal8Bit(PRT_DELIVERY_TIME_INVITE);
}
else
{
prt_delivery_time = QDateTime::fromTime_t(delivery_time).toString("yyyy/MM/dd hh:mm:ss");
}
tmporder._orderObject.insert("prt_delivery_time", prt_delivery_time);
QLOG_DEBUG() << "NewNew tmporder._orderObject :" << tmporder._orderObject;
QByteArray orderdata = QString(QJsonDocument(tmporder._orderObject).toJson()).toLocal8Bit();
CONSTCHARTOCHAR(orderdata, orderinfo);
//! TODO 解析遍历商品,杯贴打印单个商品,并且打印商品序列、商品名、单价、配料 下单时间 门店
//! 解析出来的数据重新组装orderinfo,再调f_DoLabPrintWithXml,一个一个商品打印
QString deliveryTime;
QString datetime;
int tmpdelitime = order->srcdlv_time;
if(order->delivery_time==0)
{
deliveryTime = QDateTime::currentDateTime().toString("hh:mm");
datetime = QDateTime::currentDateTime().toString("MM/dd");
}else{
deliveryTime = QDateTime::fromTime_t(order->delivery_time).toString("hh:mm");
datetime = QDateTime::currentDateTime().toString("MM/dd");
}
int allprod = 0;
foreach(ProductObject* dish,order->proList)
{
allprod += dish->product_amount;
}
int index = 0;
foreach(ProductObject* dish,order->proList)
{
int num = dish->product_amount;
while(num > 0)
{
QString title = QString(" %2 %4/%5").arg(datetime, QString::number(++index), QString::number(allprod));
QString tmptitle;
if(QString("saas").compare(order->channel) == 0)
{
if(order->order_type == 3 || order->order_type == 4 || order->order_type == 5)
{
// tmptitle = QString("\xE9\x9D\x9E\xE7\xA0\x81\xE8\x87\xAA\xE6\x8F\x90").append(order->code).append(" ").append(title);
tmptitle = QString("\xE8\x87\xAA\xE6\x8F\x90").append(order->code).append(" ").append(title);
}
else if(order->order_type == 6)
{
// tmptitle = QString("\xE9\x9D\x9E\xE7\xA0\x81\xE9\xA2\x84\xE7\xBA\xA6").append(order->code).append(" ").append(title);
tmptitle = QString("\xE9\xA2\x84\xE7\xBA\xA6").append(order->code).append(" ").append(title);
}
else
{
// tmptitle = QString("\xE9\x9D\x9E\xE7\xA0\x81\xE5\xA4\x96\xE5\x8D\x96").append(QString::number(order->order_index)).append(" ").append(title);
tmptitle = QString("\xE5\xA4\x96\xE5\x8D\x96").append(QString::number(order->order_index)).append(" ").append(title);
}
}
else
{
QString tmpstr = order->channel_name;
tmptitle = tmpstr.append(QString::number(order->order_index)).append(" ").append(title);;
}
QString prodname = dish->name;
qDebug() << "input9:" << prodname;
QString property_tags;
if(!dish->property_tags.isEmpty())
{
property_tags.append(dish->property_tags);
property_tags.append(",");
}
if(!dish->sub_products.isEmpty())
{
foreach(ProductObject* sub_dish,dish->sub_products)
{
property_tags.append(sub_dish->name);
property_tags.append(",");
}
}
property_tags.remove(property_tags.length()-1,1);
QString sendtimes = QString("");
if(tmpdelitime != 0 /*&& (order->order_type == 1 || order->order_type == 2)*/)
{
sendtimes.append(QDateTime::fromTime_t(order->delivery_time).toString("yyyy-MM-dd hh:mm:ss"));
}
QJsonObject prdObj;
prdObj.insert("prt_title", tmptitle);
prdObj.insert("prt_singleproduct", prodname.append(QString("\x20\xC2\xA5")).append(QString::number(dish->price/100.0, 'f', 2)));
prdObj.insert("prt_property", property_tags);
prdObj.insert("prt_sendtimes", sendtimes);
prdObj.insert("prt_store", order->store_name);
char *singlePrdPrt = NULL;
QByteArray singlePrd = QString(QJsonDocument(prdObj).toJson()).toLocal8Bit();
CONSTCHARTOCHAR(singlePrd, singlePrdPrt);
char err[1024] = {0};
qDebug() << "input singleprdprt:" << singlePrdPrt;
f_DoLabPrintWithXml(prtconfig, singlePrdPrt, xml, err);
if(strlen(err) > 0)
{
QLOG_ERROR() << "f_DoPrintWithXml failed error : " << err;
}
delete [] singlePrdPrt;
-- num;
}
}
delete [] prtconfig;
delete [] xml;
QLOG_DEBUG() << "f_DoPrintWithXml success";
return true;
}
bool NewPrintLib::LoadFunction()
{
QLibrary lib;
......@@ -805,6 +1046,7 @@ bool NewPrintLib::LoadFunction()
f_printBarcode = (PrintBarCode)lib.resolve("PrintBarCode");
f_printqrcode = (PrintQRCode)lib.resolve("PrintQRCode");
f_DoPrintWithXml = (DoPrintWithXml)lib.resolve("DoPrintWithXml");
f_DoLabPrintWithXml = (DoLabPrintWithXml)lib.resolve("DoLabPrintWithXml");
if(!(f_unloaddll && f_loadaddress && f_labprtiopen && f_labprtline
&& f_labprtclose && f_prtopen && f_prtclose && f_freeline
......
......@@ -29,6 +29,8 @@ typedef bool (*PrintQRCode)(char data[], int type, int leftMargin, int width);
typedef void (*DoPrintWithXml)(char *prtstr, char *orderStr, char*xmlStr, char* error);
typedef void (*DoLabPrintWithXml)(char *prtstr, char *orderStr, char*xmlStr, char* error);
class NewPrintLib
{
public:
......@@ -68,6 +70,15 @@ public:
*/
bool DoLabelPrint(const QString &config, OrderObject *order);
/*!
* \brief DoLabelModelPrint 杯贴打印
* \param connect 打印模板上下文
* \param config 打印配置
* \param order 订单对象
* \return true:成功 false:失败
*/
bool DoLabelModelPrint(const QString &config, const QString &context, OrderObject *order);
private:
bool LoadFunction();
......@@ -111,6 +122,8 @@ private:
DoPrintWithXml f_DoPrintWithXml;
DoLabPrintWithXml f_DoLabPrintWithXml;
bool _load_flag;
};
......
......@@ -8,7 +8,7 @@
DriverInfoGetWork::DriverInfoGetWork(WorkObject *parent) : WorkObject(parent)
{
_islogin = false;
FMApplication::subscibeEvent(this, PosEvent::s_get_order_status);
FMApplication::subscibeEvent(this, PosEvent::s_token_change);
FMApplication::subscibeEvent(this, PosEvent::s_login_storeinfo);
......@@ -69,6 +69,8 @@ bool DriverInfoGetWork::event(QEvent *e)
_storeinfo = storeinfo;
_islogin = true;
return true;
}
......@@ -96,11 +98,13 @@ void DriverInfoGetWork::workstart()
loop.exec();
}
//加入登陆标志位,防止未登录线程启动后阻塞,导致未登录退出阻塞
if(_islogin)
{
QEventLoop loop;
connect(this, &DriverInfoGetWork::quitGetWork, &loop, &QEventLoop::quit);
loop.exec();
}
QLOG_DEBUG() << "DriverInfoGetWork::workstart loop start";
......
......@@ -45,6 +45,8 @@ private:
QString _url;
bool _islogin;
};
class GetDriverInfoDataProcess
......
......@@ -131,7 +131,7 @@ private:
{
QString partnerid = storeinfo[JSON_KEY_PARTNERID].toString();
QString storeid = storeinfo[JSON_STOREID].toString();
QString stationid = storeinfo[JSON_STATIONID].toString();
QString stationid = storeinfo[JSON_STOREID].toString();
QString tmp = partnerid + storeid + stationid;
QLOG_DEBUG() << "Store Info : " << tmp;
......@@ -182,13 +182,13 @@ private:
static bool getLogingRequest(const QVariantMap &json, QJsonObject &data)
{
if(!json.contains(JSON_STOREID) || !json.contains(JSON_STATIONID) ||
if(!json.contains(JSON_STOREID) || /*!json.contains(JSON_STATIONID) ||*/
!json.contains(JSON_KEY_USERID) || !json.contains(JSON_KEY_PWD) ||
!json.contains(JSON_KEY_PARTNERID))
return false;
data.insert(JSON_STOREID, json[JSON_STOREID].toString());
data.insert(JSON_DEVICEID, json[JSON_STATIONID].toString());
data.insert(JSON_DEVICEID,json[JSON_STOREID].toString());
data.insert(JSON_KEY_USERID, json[JSON_KEY_USERID].toString());
data.insert(JSON_KEY_PWD, json[JSON_KEY_PWD].toString());
//data.insert(JSON_KEY_PARTNERID, json[JSON_KEY_PARTNERID].toInt());
......@@ -199,7 +199,7 @@ private:
static bool getOrderRequest(const QVariantMap &json, QJsonObject &data, QString timestamp, QString token, QString autoconfirm)
{
if(!json.contains(JSON_STOREID) || !json.contains(JSON_STATIONID) ||
if(!json.contains(JSON_STOREID) || /*!json.contains(JSON_STATIONID) ||*/
!json.contains(JSON_KEY_USERID) || !json.contains(JSON_KEY_PWD) ||
!json.contains(JSON_KEY_PARTNERID))
return false;
......@@ -221,11 +221,12 @@ private:
static bool getBindRequest(const QVariantMap &json, QJsonObject &data)
{
if(!json.contains(JSON_STOREID) || !json.contains(JSON_STATIONID))
// if(!json.contains(JSON_STOREID) || !json.contains(JSON_STATIONID))
if(!json.contains(JSON_STOREID))
return false;
data.insert(JSON_STOREID, json[JSON_STOREID].toString());
data.insert(JSON_DEVICEID, json[JSON_STATIONID].toString());
data.insert(JSON_DEVICEID, json[JSON_STOREID].toString());
//data.insert(JSON_KEY_PARTNERID, json[JSON_KEY_PARTNERID].toInt());
data.insert(JSON_KEY_PARTNERID, json[JSON_KEY_PARTNERID].toString());
data.insert(JSON_KEY_APPVER, DEFAULT_APP_VER);
......
......@@ -184,6 +184,10 @@ bool orderprintwork::GetPrtTemplet(int prttype, int pagew, QString &context, con
file.setFileName(qApp->applicationDirPath() + "/" + XML_BACK_TEMPLATE);
}
}
else if(prttype == 1)
{
file.setFileName(qApp->applicationDirPath() + "/" + XML_LABEL_TEMPLATE);
}
QLOG_DEBUG() << "file : " << file.fileName();
......@@ -247,6 +251,7 @@ void orderprintwork::DoLabelPrint(const QString &prtname, const QString &orderid
{
QString strconfig;
OrderObject order;
QString context;
if(!PosOrderPool::GetOrderObject(orderid, order))
{
......@@ -258,7 +263,21 @@ void orderprintwork::DoLabelPrint(const QString &prtname, const QString &orderid
QLOG_DEBUG() << "strconfig:" << strconfig;
int page = config[PRT_CONF_PAPERWIDTH].toString().toInt();
if(page == 0)
page = 56;
if(!GetPrtTemplet(0, page, context, order))
{
QLOG_ERROR() << "orderprintwork::DoLabelPrint::GetPrtTemplet failed";
return ;
}
flag = NewPrintLib::GetInstance().DoLabelPrint(strconfig, &order);
// flag = NewPrintLib::GetInstance().DoLabelModelPrint(strconfig, context, &order);
QLOG_DEBUG() << "DoLabelPrint NewPrintLib::GetInstance flag : " << flag;
}
void orderprintwork::ResultShow(const QString &orderid, bool flag)
......
......@@ -833,7 +833,12 @@ void PosOrderPool::UpdateOrderNum(const OrderObject *order, const OrderObject *o
}
else if(orderold->order_type == TimelyInvite || orderold->order_type == AppointmentInvite)
{
QLOG_DEBUG() << "OLD DECTAKEOUT UpdateOrderNum input 0 : " << orderold->order_id;
QLOG_DEBUG() << "OLD DECSELF UpdateOrderNum input 0 : " << orderold->order_id;
DECSELF(status, s_self_new, s_self_make, s_self_refund);
}
else if(orderold->order_type == TimelyDining || orderold->order_type == AppointmentDining)
{
QLOG_DEBUG() << "OLD DECSELF UpdateOrderNum input 0 : " << orderold->order_id;
DECSELF(status, s_self_new, s_self_make, s_self_refund);
}
......@@ -859,6 +864,11 @@ void PosOrderPool::UpdateOrderNum(const OrderObject *order, const OrderObject *o
QLOG_DEBUG() << "NEW INCSELF UpdateOrderNum input 0 : " << order->order_id;
INCSELF(status, s_self_new, s_self_make, s_self_refund);
}
else if(order->order_type == TimelyDining || order->order_type == AppointmentDining)
{
QLOG_DEBUG() << "NEW INCSELF UpdateOrderNum input 0 : " << order->order_id;
INCSELF(status, s_self_new, s_self_make, s_self_refund);
}
}
}
......@@ -21,7 +21,7 @@ LIBS += -L$$PWD/lib -llibeay32 -lssleay32 -lwinspool
LIBS += -lWs2_32
LIBS += -lDbghelp
#DEFINES += USE_QAACTION
DEFINES += USE_QAACTION
DEFINES += FM_NEW_UI
#DEFINES += FM_TEST
......@@ -167,10 +167,10 @@ FORMS += \
view/mainbtn.ui \
view/newdetailform.ui \
view/prttypeform.ui \
view/newloginform.ui \
view/newpickupform.ui \
view/newchangeshiftsform.ui \
view/newfloatform.ui
view/newfloatform.ui \
view/newloginform.ui
CONFIG(release, debug|release){
QMAKE_LFLAGS += /DEBUG
......
......@@ -4,8 +4,8 @@
#include <winver.h>
#endif
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,0,2,3
PRODUCTVERSION 3,0,2,3
FILEVERSION 3,0,2,4
PRODUCTVERSION 3,0,2,4
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
......@@ -22,12 +22,12 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
VALUE "CompanyName", "ShangHai Freemud Co., Ltd."
VALUE "FileDescription", "FREEMUD Manager System"
VALUE "FileVersion", "3.0.2.3"
VALUE "FileVersion", "3.0.2.4"
VALUE "InternalName", "FREEMUD"
VALUE "LegalCopyright", "Copyright (C)2017-2020"
VALUE "OriginalFilename", "fmTakeout.exe"
VALUE "ProductName", "fmTakeout"
VALUE "ProductVersion", "3.0.2.3"
VALUE "ProductVersion", "3.0.2.4"
END
END
BLOCK "VarFileInfo"
......
......@@ -137,8 +137,8 @@ bool NewFloatForm::event(QEvent *e)
refundstatus != ApplicationRefundOrder && refundstatus != ApplicationPartialRefundOrder && refundstatus != RefusingRefundOrder)
{
//m_play_flag = false;
if(ui->widget_back_synshow->isHidden())
ui->widget_back_synshow->show();
// if(ui->widget_back_synshow->isHidden())
// ui->widget_back_synshow->show();
onStartRemind(0);
return true;
}
......@@ -146,8 +146,8 @@ bool NewFloatForm::event(QEvent *e)
if((refundstatus == ApplicationRefundOrder || refundstatus == ApplicationPartialRefundOrder))
{
//m_play_flag = false;
if(ui->widget_back_synshow->isHidden())
ui->widget_back_synshow->show();
// if(ui->widget_back_synshow->isHidden())
// ui->widget_back_synshow->show();
onStartRemind(1);
return true;
}
......@@ -254,8 +254,8 @@ bool NewFloatForm::event(QEvent *e)
QLOG_DEBUG() << "pickuporderremind : " << orderid;
//m_play_flag = false;
if(ui->widget_back_synshow->isHidden())
ui->widget_back_synshow->show();
// if(ui->widget_back_synshow->isHidden())
// ui->widget_back_synshow->show();
onStartRemind(0);
return true;
}
......@@ -560,10 +560,10 @@ void NewFloatForm::onStartRemind(int type)
if(pos().x() > tmpdesktopSize.width() - 2*(ui->widget_base->width()))
{
ui->widget_front_synshow->show();
ui->label_front_newmsg->setText(QString::fromLocal8Bit("新订单"));
ui->label_front_newmsg->setText(QString::fromLocal8Bit(" 新订单"));
} else {
ui->widget_back_synshow->show();
ui->label_back_newmsg->setText(QString::fromLocal8Bit("新订单"));
ui->label_back_newmsg->setText(QString::fromLocal8Bit(" 新订单"));
}
if(!ui->widget_base_frame->isHidden())
ui->widget_base_frame->hide();
......@@ -571,12 +571,12 @@ void NewFloatForm::onStartRemind(int type)
else if(!ui->widget_back_synshow->isHidden() && m_is_login)
{
// ui->widget_back_synshow->hide();
ui->label_back_newmsg->setText(QString::fromLocal8Bit("新订单"));
ui->label_back_newmsg->setText(QString::fromLocal8Bit(" 新订单"));
if(ui->widget_base_frame->isHidden())
ui->widget_base_frame->show();
} else if(!ui->widget_front_synshow->isHidden() && m_is_login) {
// ui->widget_front_synshow->hide();
ui->label_front_newmsg->setText(QString::fromLocal8Bit("新订单"));
ui->label_front_newmsg->setText(QString::fromLocal8Bit(" 新订单"));
if(ui->widget_base_frame->isHidden())
ui->widget_base_frame->show();
}
......@@ -590,10 +590,10 @@ void NewFloatForm::onStartRemind(int type)
if(pos().x() > tmpdesktopSize.width() - 2*(ui->widget_base->width()))
{
ui->widget_front_synshow->show();
ui->label_front_newmsg->setText(QString::fromLocal8Bit("新退单"));
ui->label_front_newmsg->setText(QString::fromLocal8Bit(" 新退单"));
} else {
ui->widget_back_synshow->show();
ui->label_back_newmsg->setText(QString::fromLocal8Bit("新退单"));
ui->label_back_newmsg->setText(QString::fromLocal8Bit(" 新退单"));
}
if(!ui->widget_base_frame->isHidden())
ui->widget_base_frame->hide();
......@@ -601,12 +601,12 @@ void NewFloatForm::onStartRemind(int type)
else if(!ui->widget_back_synshow->isHidden() && m_is_login)
{
// ui->widget_back_synshow->hide();
ui->label_back_newmsg->setText(QString::fromLocal8Bit("新退单"));
ui->label_back_newmsg->setText(QString::fromLocal8Bit(" 新退单"));
if(ui->widget_base_frame->isHidden())
ui->widget_base_frame->show();
} else if(!ui->widget_front_synshow->isHidden() && m_is_login) {
// ui->widget_front_synshow->hide();
ui->label_front_newmsg->setText(QString::fromLocal8Bit("新退单"));
ui->label_front_newmsg->setText(QString::fromLocal8Bit(" 新退单"));
if(ui->widget_base_frame->isHidden())
ui->widget_base_frame->show();
}
......
......@@ -108,9 +108,12 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>45</width>
<width>48</width>
<height>20</height>
</size>
</property>
......@@ -126,7 +129,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>45</width>
<width>48</width>
<height>20</height>
</size>
</property>
......
......@@ -105,16 +105,15 @@ void NewLoginForm::SetStoreInfo()
QString partnerid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_PARNETID).toString();
QString userid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_USERID).toString();
QString pwd = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_PWD).toString();
QString stationid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_STATIONIID).toString();
// QString stationid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_STATIONIID).toString();
if(storeid.isEmpty() || partnerid.isEmpty() || userid.isEmpty() || pwd.isEmpty() || stationid.isEmpty())
if(storeid.isEmpty() || partnerid.isEmpty() || userid.isEmpty() || pwd.isEmpty() /*|| stationid.isEmpty()*/)
return ;
ui->lineEdit_partnerid_2->setText(partnerid);
ui->lineEdit_storeid_2->setText(storeid);
// ui->lineEdit_posno_2->setText(stationid);
ui->lineEdit_account_2->setText(userid);
ui->lineEdit_pwd_2->setText(pwd);
if(ui->checkBox_rememberPwd->isChecked())
ui->lineEdit_pwd_2->setText(pwd);
......
......@@ -541,7 +541,7 @@ void NewMainForm::SetMainBtnCheck(MainBtn *wgt)
else
var->setChecked(false);
//qDebug() << "&&&&&&&&&&&&" << var->property("type").toString();
qDebug() << "&&&&&&&&&&&&" << var->property("type").toString();
}
}
......@@ -616,6 +616,14 @@ bool NewMainForm::event(QEvent *e)
if(var->getMainBtnType().compare("refund",Qt::CaseInsensitive) == 0)
{
var->SetText((QString::fromUtf8("\xE9\x80\x80\xE5\x8D\x95") + QString("(%1)").arg(QString::number(tk_refund + self_refund))), MAIN_REFUND);
if(_type == 1)
{
var->setChecked(true);
}
else
{
var->setChecked(false);
}
}
}
......@@ -693,6 +701,14 @@ bool NewMainForm::event(QEvent *e)
if(var->getMainBtnType().compare("refund",Qt::CaseInsensitive) == 0)
{
var->SetText((QString::fromUtf8("\xE9\x80\x80\xE5\x8D\x95") + QString("(%1)").arg(QString::number(tk_refund + self_refund))), MAIN_REFUND);
if(_type == 1)
{
var->setChecked(true);
}
else
{
var->setChecked(false);
}
}
}
......@@ -1676,9 +1692,11 @@ bool NewMainForm::GetContext(QString &context)
QString bakfilename = path + "/test_back.xml";
QString filename = path + "/test_ticket.xml";
QString labelname = path + "/test_label.xml";
QLOG_DEBUG() << "bakfilename" << bakfilename;
QLOG_DEBUG() << "filename" << filename;
QLOG_DEBUG() << "labelname" << labelname;
if(_prttype == 0)
{
......@@ -1710,6 +1728,21 @@ bool NewMainForm::GetContext(QString &context)
return true;
}
}
// else if(_prttype == 1)
// {
// QFile file(labelname);
// if(file.open(QFile::ReadOnly))
// {
// QByteArray data = file.readAll();
// context = QString::fromUtf8(data);
// file.close();
// return true;
// }
// }
return false;
}
......@@ -1798,6 +1831,14 @@ void NewMainForm::on_newmainbtn_prttest_clicked()
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;
qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
......@@ -1817,6 +1858,7 @@ void NewMainForm::on_newmainbtn_prttest_clicked()
flag = lib.DoPrint(prtconfig, context, &order);
else if(_prttype == 1)
flag = lib.DoLabelPrint(prtconfig, &order);
// flag = lib.DoLabelModelPrint(prtconfig, context, &order);
else if(_prttype == 2)
flag = lib.DoBackPrint(pagerepart, prodrepart, pagenum, list, prtconfig, context, &order);
......
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