Commit d6d46096 by xiaoqing.gu

1、杯贴模板化 2、小票表头可自定义 3、增加取消证书功能 4、取消订单完成的确认界面 5、取消手自动接单的选项 6、用户设置界面新增注销功能

parent 4448d716
...@@ -267,7 +267,7 @@ bool NewPrintLib::GetObjList(int page_depart, int prod_depart, QStringList prodl ...@@ -267,7 +267,7 @@ bool NewPrintLib::GetObjList(int page_depart, int prod_depart, QStringList prodl
return (!orderlist.isEmpty()); return (!orderlist.isEmpty());
} }
bool NewPrintLib::DoPrint(const QString &config, const QString &context, OrderObject *order) bool NewPrintLib::DoPrint(const QString &config, const QString &context, OrderObject *order, int page)
{ {
OrderObject tmporder = *order; OrderObject tmporder = *order;
...@@ -322,54 +322,134 @@ bool NewPrintLib::DoPrint(const QString &config, const QString &context, OrderOb ...@@ -322,54 +322,134 @@ bool NewPrintLib::DoPrint(const QString &config, const QString &context, OrderOb
QLOG_DEBUG() << "NewPrintLib::channel:" << channel; QLOG_DEBUG() << "NewPrintLib::channel:" << channel;
if(QString("saas").compare(channel, Qt::CaseInsensitive) == 0) QString tableheadname = QApplication::applicationDirPath() + QString("/prtinfo/tablehead.ini");
{ QSettings m_setting(tableheadname,QSettings::IniFormat);
switch(type) { m_setting.setIniCodec("UTF-8");
case TimelyTakeout:
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYTAKEOUT)); if(QString("saas").compare(channel, Qt::CaseInsensitive) == 0)
break; {
case AppointmentTakeout: switch(type) {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTTAKEOUT)); case TimelyTakeout:
break; if(page == 56) {
case TimelyDining: if(m_setting.value("1").toString() != "") {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE)); tmporder._orderObject.insert("source_order_type" , m_setting.value("1").toString());
break; } else {
case AppointmentDining: tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYTAKEOUT));
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTINVITE)); }
break; } else {
case TimelyInvite: if(m_setting.value("5").toString() != "") {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE)); tmporder._orderObject.insert("source_order_type" , m_setting.value("5").toString());
break; } else {
case AppointmentInvite: tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYTAKEOUT));
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTINVITE)); }
break; }
default: break;
break; case AppointmentTakeout:
} if(page == 56) {
} else { if(m_setting.value("7").toString() != "") {
switch(type) { tmporder._orderObject.insert("source_order_type" , m_setting.value("7").toString());
case TimelyTakeout: } else {
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_TIMELYTAKEOUT)); tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTTAKEOUT));
break; }
case AppointmentTakeout: } else {
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_APPOINTMENTTAKEOUT)); if(m_setting.value("10").toString() != "") {
break; tmporder._orderObject.insert("source_order_type" , m_setting.value("10").toString());
case TimelyDining: } else {
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE)); tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTTAKEOUT));
break; }
case AppointmentDining: }
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_APPOINTMENTINVITE));
break; break;
case TimelyInvite: case TimelyDining:
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE)); if(page == 56) {
break; if(m_setting.value("2").toString() != "") {
case AppointmentInvite: tmporder._orderObject.insert("source_order_type" , m_setting.value("2").toString());
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_APPOINTMENTINVITE)); } else {
break; tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE));
default: }
break; } else {
} if(m_setting.value("6").toString() != "") {
} tmporder._orderObject.insert("source_order_type" , m_setting.value("6").toString());
} else {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE));
}
}
break;
case AppointmentDining:
if(page == 56) {
if(m_setting.value("8").toString() != "") {
tmporder._orderObject.insert("source_order_type" , m_setting.value("8").toString());
} else {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTINVITE));
}
} else {
if(m_setting.value("11").toString() != "") {
tmporder._orderObject.insert("source_order_type" , m_setting.value("11").toString());
} else {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTINVITE));
}
}
break;
case TimelyInvite:
if(page == 56) {
if(m_setting.value("2").toString() != "") {
tmporder._orderObject.insert("source_order_type" , m_setting.value("2").toString());
} else {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE));
}
} else {
if(m_setting.value("6").toString() != "") {
tmporder._orderObject.insert("source_order_type" , m_setting.value("6").toString());
} else {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE));
}
}
break;
case AppointmentInvite:
if(page == 56) {
if(m_setting.value("8").toString() != "") {
tmporder._orderObject.insert("source_order_type" , m_setting.value("8").toString());
} else {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTINVITE));
}
} else {
if(m_setting.value("11").toString() != "") {
tmporder._orderObject.insert("source_order_type" , m_setting.value("11").toString());
} else {
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类型 //将订单的预约时间拿过来转换成订单需要的QString类型
...@@ -566,6 +646,8 @@ bool NewPrintLib::PrintLabel(const QString &config, OrderObject *order) ...@@ -566,6 +646,8 @@ bool NewPrintLib::PrintLabel(const QString &config, OrderObject *order)
f_labprtline(0, 10, 0, tmptitle.toLocal8Bit().data()); f_labprtline(0, 10, 0, tmptitle.toLocal8Bit().data());
f_labprtline(0, 0, 0, "-----------------------------------"); f_labprtline(0, 0, 0, "-----------------------------------");
f_labprtline(10, 0, 1, prodname.append(QString("\x20\xC2\xA5")).append(QString::number(dish->price/100.0, 'f', 2)).toLocal8Bit().data()); f_labprtline(10, 0, 1, prodname.append(QString("\x20\xC2\xA5")).append(QString::number(dish->price/100.0, 'f', 2)).toLocal8Bit().data());
// f_labprtlinewithsizeandstyle(100, 100, 32, 0, 0, (QString("\xE5\x88\x98\xE5\xB8\x85")).toLocal8Bit().data());
// f_labprtlinewithsizeandstyle(70, 140, 32, 0, 0, (QString("15290352796").toLocal8Bit().data()));
} }
QString property_tags; QString property_tags;
if(!dish->property_tags.isEmpty()) if(!dish->property_tags.isEmpty())
...@@ -622,7 +704,7 @@ bool NewPrintLib::PrintLabel(const QString &config, OrderObject *order) ...@@ -622,7 +704,7 @@ bool NewPrintLib::PrintLabel(const QString &config, OrderObject *order)
return true; return true;
} }
bool NewPrintLib::DoBackPrint(int page_depart, int prod_depart, int page_num, const QStringList &stallsprods, const QString &config, const QString &context, OrderObject *order) bool NewPrintLib::DoBackPrint(int page_depart, int prod_depart, int page_num, const QStringList &stallsprods, const QString &config, const QString &context, OrderObject *order, int page)
{ {
if(!_load_flag && !LoadFunction()) if(!_load_flag && !LoadFunction())
{ {
...@@ -730,54 +812,135 @@ bool NewPrintLib::DoBackPrint(int page_depart, int prod_depart, int page_num, co ...@@ -730,54 +812,135 @@ bool NewPrintLib::DoBackPrint(int page_depart, int prod_depart, int page_num, co
QLOG_DEBUG() << "NewPrintLib::channel:" << channel; QLOG_DEBUG() << "NewPrintLib::channel:" << channel;
if(QString("saas").compare(channel, Qt::CaseInsensitive) == 0) QString tableheadname = QApplication::applicationDirPath() + QString("/prtinfo/tablehead.ini");
{ QSettings m_setting(tableheadname,QSettings::IniFormat);
switch(type) { m_setting.setIniCodec("UTF-8");
case TimelyTakeout:
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYTAKEOUT));
break; if(QString("saas").compare(channel, Qt::CaseInsensitive) == 0)
case AppointmentTakeout: {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTTAKEOUT)); switch(type) {
break; case TimelyTakeout:
case TimelyDining: if(page == 56) {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE)); if(m_setting.value("1").toString() != "") {
break; tmporder._orderObject.insert("source_order_type" , m_setting.value("1").toString());
case AppointmentDining: } else {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTINVITE)); tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYTAKEOUT));
break; }
case TimelyInvite: } else {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE)); if(m_setting.value("5").toString() != "") {
break; tmporder._orderObject.insert("source_order_type" , m_setting.value("5").toString());
case AppointmentInvite: } else {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTINVITE)); tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYTAKEOUT));
break; }
default: }
break; break;
} case AppointmentTakeout:
} else { if(page == 56) {
switch(type) { if(m_setting.value("7").toString() != "") {
case TimelyTakeout: tmporder._orderObject.insert("source_order_type" , m_setting.value("7").toString());
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_TIMELYTAKEOUT)); } else {
break; tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTTAKEOUT));
case AppointmentTakeout: }
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_APPOINTMENTTAKEOUT)); } else {
break; if(m_setting.value("10").toString() != "") {
case TimelyDining: tmporder._orderObject.insert("source_order_type" , m_setting.value("10").toString());
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE)); } else {
break; tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTTAKEOUT));
case AppointmentDining: }
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_APPOINTMENTINVITE)); }
break;
case TimelyInvite: break;
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE)); case TimelyDining:
break; if(page == 56) {
case AppointmentInvite: if(m_setting.value("2").toString() != "") {
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_APPOINTMENTINVITE)); tmporder._orderObject.insert("source_order_type" , m_setting.value("2").toString());
break; } else {
default: tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE));
break; }
} } else {
} if(m_setting.value("6").toString() != "") {
tmporder._orderObject.insert("source_order_type" , m_setting.value("6").toString());
} else {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE));
}
}
break;
case AppointmentDining:
if(page == 56) {
if(m_setting.value("8").toString() != "") {
tmporder._orderObject.insert("source_order_type" , m_setting.value("8").toString());
} else {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTINVITE));
}
} else {
if(m_setting.value("11").toString() != "") {
tmporder._orderObject.insert("source_order_type" , m_setting.value("11").toString());
} else {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTINVITE));
}
}
break;
case TimelyInvite:
if(page == 56) {
if(m_setting.value("2").toString() != "") {
tmporder._orderObject.insert("source_order_type" , m_setting.value("2").toString());
} else {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE));
}
} else {
if(m_setting.value("6").toString() != "") {
tmporder._orderObject.insert("source_order_type" , m_setting.value("6").toString());
} else {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE));
}
}
break;
case AppointmentInvite:
if(page == 56) {
if(m_setting.value("8").toString() != "") {
tmporder._orderObject.insert("source_order_type" , m_setting.value("8").toString());
} else {
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTINVITE));
}
} else {
if(m_setting.value("11").toString() != "") {
tmporder._orderObject.insert("source_order_type" , m_setting.value("11").toString());
} else {
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类型 //将订单的预约时间拿过来转换成订单需要的QString类型
int delivery_time = orderObj["delivery_time"].toInt(); int delivery_time = orderObj["delivery_time"].toInt();
...@@ -875,26 +1038,34 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex ...@@ -875,26 +1038,34 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex
QLOG_DEBUG() << "NewPrintLib::channel:" << channel; QLOG_DEBUG() << "NewPrintLib::channel:" << channel;
QString source_order_desc;
if(QString("saas").compare(channel, Qt::CaseInsensitive) == 0) if(QString("saas").compare(channel, Qt::CaseInsensitive) == 0)
{ {
switch(type) { switch(type) {
case TimelyTakeout: case TimelyTakeout:
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYTAKEOUT)); tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYTAKEOUT));
source_order_desc = QString::fromLocal8Bit(ORDER_THIRD_TIMELYTAKEOUT);
break; break;
case AppointmentTakeout: case AppointmentTakeout:
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTTAKEOUT)); tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTTAKEOUT));
source_order_desc = QString::fromLocal8Bit(ORDER_THIRD_TIMELYTAKEOUT);
break; break;
case TimelyDining: case TimelyDining:
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE)); tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE));
source_order_desc = QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE);
break; break;
case AppointmentDining: case AppointmentDining:
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTINVITE)); tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTINVITE));
source_order_desc = QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE);
break; break;
case TimelyInvite: case TimelyInvite:
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE)); tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_TIMELYINVITE));
source_order_desc = QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE);
break; break;
case AppointmentInvite: case AppointmentInvite:
tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTINVITE)); tmporder._orderObject.insert("source_order_type" , QString::fromLocal8Bit(ORDER_TYPE_APPOINTMENTINVITE));
source_order_desc = QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE);
break; break;
default: default:
break; break;
...@@ -903,21 +1074,27 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex ...@@ -903,21 +1074,27 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex
switch(type) { switch(type) {
case TimelyTakeout: case TimelyTakeout:
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_TIMELYTAKEOUT)); tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_TIMELYTAKEOUT));
source_order_desc = QString::fromLocal8Bit(ORDER_THIRD_TIMELYTAKEOUT);
break; break;
case AppointmentTakeout: case AppointmentTakeout:
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_APPOINTMENTTAKEOUT)); tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_APPOINTMENTTAKEOUT));
source_order_desc = QString::fromLocal8Bit(ORDER_THIRD_TIMELYTAKEOUT);
break; break;
case TimelyDining: case TimelyDining:
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE)); tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE));
source_order_desc = QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE);
break; break;
case AppointmentDining: case AppointmentDining:
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_APPOINTMENTINVITE)); tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_APPOINTMENTINVITE));
source_order_desc = QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE);
break; break;
case TimelyInvite: case TimelyInvite:
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE)); tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE));
source_order_desc = QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE);
break; break;
case AppointmentInvite: case AppointmentInvite:
tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_APPOINTMENTINVITE)); tmporder._orderObject.insert("source_order_type" , channel + QString::fromLocal8Bit(ORDER_THIRD_APPOINTMENTINVITE));
source_order_desc = QString::fromLocal8Bit(ORDER_THIRD_TIMELYINVITE);
break; break;
default: default:
break; break;
...@@ -929,17 +1106,21 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex ...@@ -929,17 +1106,21 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex
int delivery_time = orderObj["delivery_time"].toInt(); int delivery_time = orderObj["delivery_time"].toInt();
QLOG_DEBUG() << "prt_type" << type; QLOG_DEBUG() << "prt_type" << type;
QString prt_delivery_time; QString prt_delivery_time;
QString inviteTime;
if(type == 1) if(type == 1)
{ {
prt_delivery_time = QString::fromLocal8Bit(PRT_DELIVERY_TIME_TAKEOUT); prt_delivery_time = QString::fromLocal8Bit(PRT_DELIVERY_TIME_TAKEOUT);
inviteTime = "";
} }
else if(type == 3 || type == 5) else if(type == 3 || type == 5)
{ {
prt_delivery_time = QString::fromLocal8Bit(PRT_DELIVERY_TIME_INVITE); prt_delivery_time = QString::fromLocal8Bit(PRT_DELIVERY_TIME_INVITE);
inviteTime = "";
} }
else else
{ {
prt_delivery_time = QDateTime::fromTime_t(delivery_time).toString("yyyy/MM/dd hh:mm:ss"); prt_delivery_time = QDateTime::fromTime_t(delivery_time).toString("yyyy/MM/dd hh:mm:ss");
inviteTime = QString::fromLocal8Bit(INVITETIME) + QDateTime::fromTime_t(delivery_time).toString("MM-dd hh:mm");
} }
tmporder._orderObject.insert("prt_delivery_time", prt_delivery_time); tmporder._orderObject.insert("prt_delivery_time", prt_delivery_time);
...@@ -953,6 +1134,7 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex ...@@ -953,6 +1134,7 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex
//! TODO 解析遍历商品,杯贴打印单个商品,并且打印商品序列、商品名、单价、配料 下单时间 门店 //! TODO 解析遍历商品,杯贴打印单个商品,并且打印商品序列、商品名、单价、配料 下单时间 门店
//! 解析出来的数据重新组装orderinfo,再调f_DoLabPrintWithXml,一个一个商品打印 //! 解析出来的数据重新组装orderinfo,再调f_DoLabPrintWithXml,一个一个商品打印
QLOG_DEBUG() << "-----------------1------------------------";
QString deliveryTime; QString deliveryTime;
QString datetime; QString datetime;
...@@ -966,6 +1148,7 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex ...@@ -966,6 +1148,7 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex
deliveryTime = QDateTime::fromTime_t(order->delivery_time).toString("hh:mm"); deliveryTime = QDateTime::fromTime_t(order->delivery_time).toString("hh:mm");
datetime = QDateTime::currentDateTime().toString("MM/dd"); datetime = QDateTime::currentDateTime().toString("MM/dd");
} }
QLOG_DEBUG() << "-----------------2------------------------";
int allprod = 0; int allprod = 0;
...@@ -973,10 +1156,12 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex ...@@ -973,10 +1156,12 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex
{ {
allprod += dish->product_amount; allprod += dish->product_amount;
} }
QLOG_DEBUG() << "-----------------3------------------------";
int index = 0; int index = 0;
foreach(ProductObject* dish,order->proList) foreach(ProductObject* dish,order->proList)
{ {
QLOG_DEBUG() << "-----------------4------------------------";
int num = dish->product_amount; int num = dish->product_amount;
while(num > 0) while(num > 0)
...@@ -1033,7 +1218,7 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex ...@@ -1033,7 +1218,7 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex
if(tmpdelitime != 0 /*&& (order->order_type == 1 || order->order_type == 2)*/) 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")); sendtimes.append(QDateTime::fromTime_t(order->delivery_time).toString("MM-dd hh:mm"));
} }
//匹配杯贴打印模板,组装新的数据对象 //匹配杯贴打印模板,组装新的数据对象
...@@ -1043,14 +1228,17 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex ...@@ -1043,14 +1228,17 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex
// prdObj.insert("prt_property", property_tags); // prdObj.insert("prt_property", property_tags);
// prdObj.insert("prt_sendtimes", sendtimes); // prdObj.insert("prt_sendtimes", sendtimes);
// prdObj.insert("prt_store", order->store_name); // prdObj.insert("prt_store", order->store_name);
prdObj.insert("code", QString::number(order->order_index)); prdObj.insert("code", order->code);
prdObj.insert("order_index", QString::number(order->order_index));
prdObj.insert("order_type_desc", order->order_type_desc);
prdObj.insert("source_order_desc", source_order_desc);
prdObj.insert("datetime", datetime); prdObj.insert("datetime", datetime);
prdObj.insert("current_index", index); prdObj.insert("current_index", index);
prdObj.insert("allprod_num", allprod); prdObj.insert("allprod_num", allprod);
prdObj.insert("prod_name", prodname); prdObj.insert("prod_name", prodname);
prdObj.insert("prod_price", QString::number(dish->price/100.0, 'f', 2)); prdObj.insert("prod_price", QString::number(dish->price/100.0, 'f', 2));
prdObj.insert("property_tags", property_tags); prdObj.insert("property_tags", property_tags);
prdObj.insert("sendtimes", sendtimes); prdObj.insert("sendtimes", inviteTime);
prdObj.insert("store_name", order->store_name); prdObj.insert("store_name", order->store_name);
char *singlePrdPrt = NULL; char *singlePrdPrt = NULL;
...@@ -1075,7 +1263,7 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex ...@@ -1075,7 +1263,7 @@ bool NewPrintLib::DoLabelModelPrint(const QString &config, const QString &contex
} }
} }
QLOG_DEBUG() << "-----------------5------------------------";
delete [] prtconfig; delete [] prtconfig;
delete [] xml; delete [] xml;
......
...@@ -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 杯贴机打印
......
...@@ -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)
......
...@@ -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(10*1000); timer.start(60*1000);
loop.exec(); loop.exec();
} }
QLOG_WARN() << _socket->errorString() << _istimeout; QLOG_WARN() << _socket->errorString() << _socket->sslErrors() << _istimeout;
return !_istimeout; return !_istimeout;
} }
......
...@@ -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 锁
......
...@@ -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;
......
...@@ -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;
} }
......
...@@ -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)
{ {
......
...@@ -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;
......
...@@ -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;
}
...@@ -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
...@@ -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 "我已到店"
......
...@@ -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
......
#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)
......
...@@ -25,7 +25,6 @@ public: ...@@ -25,7 +25,6 @@ public:
}Type; }Type;
/* 功能:设置显示内容 /* 功能:设置显示内容
* 参数:[1]窗体类型[2]信息内容 * 参数:[1]窗体类型[2]信息内容
* 返回:NULL * 返回:NULL
......
#ifndef FRMINPUT_H #ifndef FRMINPUT_H
#define FRMINPUT_H #define FRMINPUT_H
//主界面软键盘
#include <QWidget> #include <QWidget>
#include <QMouseEvent> #include <QMouseEvent>
......
...@@ -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;
} }
......
...@@ -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();
}
...@@ -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;
// //
......
...@@ -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 &quot;微软雅黑&quot;;
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>
......
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