Commit a0c954fa by unknown

获取管理员权限,拒单窗口的字体大小调整

parent 1cb1995b
......@@ -176,6 +176,20 @@ bool FlowControl::_PullOrder()
{
QLOG_INFO() << QString("print failed");
}
//写入销售单
QLOG_INFO() << QString("[---begin entry order [%1]---].").arg(QString(FmPlugin::GetInstance()._GetOrderEntryData(orderObject)));
if(!FmPlugin::GetInstance().DoOrderEntry(orderObject, error))
{
//while(!FmPlugin::GetInstance().DoOrderEntry(orderObject, error, true))
//{
QLOG_INFO() << QString("entry order failed[%1]").arg(error);
//}
}
else
{
QLOG_INFO() << QString("[entry order success].");
}
}
}
......@@ -261,20 +275,6 @@ bool FlowControl::_ConfirmOrder(const QString &orderId, const DeliverObject &del
}else
{
OrderObject *orderObject = m_ordersMap.value(orderId);
emit showAlert(AlertForm::LOADING, "正在写入销售单......");
//写入销售单
QLOG_INFO() << QString("[---begin entry order [%1]---].").arg(QString(FmPlugin::GetInstance()._GetOrderEntryData(orderObject)));
if(!FmPlugin::GetInstance().DoOrderEntry(orderObject, error))
{
while(!FmPlugin::GetInstance().DoOrderEntry(orderObject, error, true))
{
QLOG_INFO() << QString("entry order failed[%1]").arg(error);
}
}
QLOG_INFO() << QString("[entry order success].");
QString remark(orderObject->remark), deliveryTime;
remark = remark.isEmpty()? "" : QString("\r\n[备注: %1]").arg(remark);
deliveryTime = QString("\r\n[期望送达时间: %1]").arg(QDateTime::fromTime_t(orderObject->delivery_time).toString("MM/dd hh:mm"));
......@@ -334,6 +334,11 @@ bool FlowControl::_RefuseOrder(const QString &orderId, int refuseCode)
bool FlowControl::_SendOrder(const QString& orderId)
{
if(m_ordersMap.value(orderId)->courier_name.isEmpty())
{
emit showAlert(AlertForm::ERROR,QString("配送员暂未接单,请等待"));
return true;
}
QString error;
bool result;
QJsonObject sendJson;
......@@ -453,14 +458,14 @@ bool FlowControl::_RefuseRefund(const QString& orderId)
return result;
}
bool FlowControl::_RefundOrder(const QString &orderId)
bool FlowControl::_RefundOrder(const QString &orderId,QString reason)
{
QString error;
bool result;
QJsonObject sendJson;
QJsonObject recvJson;
sendJson = DataManger::GetInstance().GetRefundOrderData("1",orderId);
sendJson = DataManger::GetInstance().GetRefundOrderData(reason,orderId);
emit showAlert(AlertForm::LOADING, "正在通信......");
......@@ -487,8 +492,10 @@ bool FlowControl::_RefundOrder(const QString &orderId)
//orderObject->status_desc = recvJson[JSON_STATUSDESC].toString();
emit changeOrderStatus(orderObject, oldStatus);
QString tmpstr;
QString tmpstr="";
// 撤回销售单
if(!m_ordersMap.value(orderId)->courier_name.isEmpty())
{
QLOG_INFO() << QString("[---begin refund order---].");
if(!FmPlugin::GetInstance().RefundOrder(orderId,error))
{
......@@ -498,6 +505,7 @@ bool FlowControl::_RefundOrder(const QString &orderId)
{
tmpstr = QString("\r\n[撤回销售单成功]");
}
}
emit showAlert(AlertForm::SUCCESS, QString("退单成功!%1").arg(tmpstr));
}
......@@ -536,7 +544,7 @@ void FlowControl::onProcessOrder(const QString &operation, const QString &orderI
_RefuseRefund(orderId);
}else if(!operation.compare(OPERATION_REFUNDORDER))
{
_RefundOrder(orderId);
_RefundOrder(orderId,"同意退款");
}
}
......@@ -575,9 +583,38 @@ void FlowControl::onSerachOrder(const QString &text)
emit showSearchOrderResult(orderMap);
}
void FlowControl::onProcessRejectOrder(const QString &orderId, const int &reason)
void FlowControl::onProcessRejectOrder(const QString &orderId, const int &reason,const int& reasontype)
{
if(reasontype==0)
{
_RefuseOrder(orderId, reason);
}
else
{
switch (reason) {
case 1:
_RefundOrder(orderId,"不在配送范围");
break;
case 2 :
_RefundOrder(orderId,"餐厅已打烊");
break;
case 3:
_RefundOrder(orderId,"已售完");
break;
case 4:
_RefundOrder(orderId,"菜品价格发生变化");
break;
case 6:
_RefundOrder(orderId,"联系不上用户");
break;
case 5:
_RefundOrder(orderId,"餐厅太忙");
break;
default:
break;
}
}
}
......@@ -138,7 +138,7 @@ private slots:
* 参数:NULL
* 返回:是否成功
* */
bool _RefundOrder(const QString& orderId);
bool _RefundOrder(const QString& orderId, QString reason);
/* 功能:获取Json对象的字符
* 参数:NULL
* 返回:Json字符串
......@@ -168,7 +168,7 @@ public slots:
* 返回:NULL
* */
void onSerachOrder(const QString& text);
void onProcessRejectOrder(const QString& orderId,const int& reason);
void onProcessRejectOrder(const QString& orderId, const int& reason, const int &reasontype);
};
#endif // FLOWCONTROL_H
......@@ -2,6 +2,7 @@
#include "QsLog.h"
#include <QJsonObject>
#include <QJsonDocument>
#include <QDebug>
SInfoControl &SInfoControl::GetInstance()
{
......@@ -24,7 +25,6 @@ void SInfoControl::run()
{
m_mutex.lock();
m_tcpServer = new QTcpServer(this);
if(!m_tcpServer->listen(QHostAddress::LocalHost, m_port))
{
emit listenFailed(QString("绑定端口[%1]失败!").arg(m_port));
......@@ -109,3 +109,9 @@ void SInfoControl::run()
QLOG_INFO() << "refundControl exit.";
m_mutex.unlock();
}
void SInfoControl::doclosePort()
{
m_tcpServer->close();
qDebug()<<"-------guanbi--------";
}
......@@ -33,6 +33,7 @@ public slots:
* 返回:NULL
* */
void run();
void doclosePort();
signals:
/* 功能:通知主界面监听失败
......
......@@ -53,10 +53,15 @@ void RejectForm::on_rejectRbtn2_toggled(bool)
void RejectForm::on_rejectRbtn3_toggled(bool)
{
m_rejectReason = 8;
m_rejectReason = 5;
}
void RejectForm::on_rejectRbtn4_toggled(bool)
{
m_rejectReason = 6;
}
void RejectForm::on_rejectRbtn5_toggled(bool )
{
m_rejectReason = 4;
}
......@@ -29,6 +29,7 @@ private slots:
void on_rejectRbtn2_toggled(bool);
void on_rejectRbtn3_toggled(bool);
void on_rejectRbtn4_toggled(bool);
void on_rejectRbtn5_toggled(bool);
};
#endif // REJECTFORM_H
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>226</width>
<height>267</height>
<width>299</width>
<height>351</height>
</rect>
</property>
<property name="windowTitle">
......@@ -46,6 +46,13 @@
<height>34</height>
</size>
</property>
<property name="font">
<font>
<family>宋体</family>
<pointsize>12</pointsize>
<italic>false</italic>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
......@@ -76,10 +83,31 @@
<number>10</number>
</property>
<property name="leftMargin">
<number>40</number>
<number>48</number>
</property>
<item>
<widget class="QRadioButton" name="rejectRbtn0">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>14</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
......@@ -93,6 +121,18 @@
</item>
<item>
<widget class="QRadioButton" name="rejectRbtn1">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>14</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
......@@ -106,6 +146,18 @@
</item>
<item>
<widget class="QRadioButton" name="rejectRbtn2">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>14</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
......@@ -119,18 +171,61 @@
</item>
<item>
<widget class="QRadioButton" name="rejectRbtn4">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>联系不上客户</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rejectRbtn5">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>菜品价格发生变动</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rejectRbtn3">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>14</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>无人配送</string>
<string>餐厅太忙</string>
</property>
<property name="reasonCode" stdset="0">
<number>2</number>
......@@ -171,6 +266,12 @@
<height>40</height>
</size>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
......@@ -193,6 +294,12 @@
<height>40</height>
</size>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
......@@ -211,7 +318,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>20</height>
</size>
</property>
</spacer>
......
......@@ -112,7 +112,15 @@ void DetailForm::onOperaBtnClicked()
m_rejectForm->show();
if(m_rejectForm->exec()==QDialog::Accepted)
{
emit processRejectOrder( pBtn->property("orderId").toString(),m_rejectForm->GetReasonCode());
emit processRejectOrder( pBtn->property("orderId").toString(),m_rejectForm->GetReasonCode(),0);
}
}
else if(pBtn->text()=="退单")
{
m_rejectForm->show();
if(m_rejectForm->exec()==QDialog::Accepted)
{
emit processRejectOrder( pBtn->property("orderId").toString(),m_rejectForm->GetReasonCode(),1);
}
}
else
......@@ -123,5 +131,8 @@ void DetailForm::onOperaBtnClicked()
void DetailForm::on_detailBtn1_clicked()
{
if(!m_orderObject->courier_name.isEmpty())
{
FmPrinter::GetInstance().DoPrint(ConfigManger::GetInstance().GetPrinterName(), m_orderObject);
}
}
......@@ -43,7 +43,7 @@ signals:
* 返回:NULL
* */
void processOrder(const QString& operation, const QString& orderId, const DeliverObject& deliverObj);
void processRejectOrder(const QString& orderId,const int& reason);
void processRejectOrder(const QString& orderId,const int& reason,const int& reasontype);
private slots:
/* 功能:处理订单按钮点击
......
......@@ -215,6 +215,9 @@
<height>16777215</height>
</size>
</property>
<property name="toolTipDuration">
<number>-1</number>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
......
......@@ -27,10 +27,8 @@ FloatForm::FloatForm(QWidget *parent) :
m_animation.setPropertyName("windowOpacity");
m_animation.setDuration(ConfigManger::GetInstance().GetBlinkInterval());
m_animation.setEasingCurve(QEasingCurve::InOutSine);
m_raiseTimer.setInterval(2000);
connect(&m_raiseTimer, &QTimer::timeout, this, &FloatForm::raise);
//connect(&m_mouseTimer, &QTimer::timeout, this, &FloatForm::restart);
_Init();
}
......@@ -58,14 +56,14 @@ void FloatForm::mousePressEvent(QMouseEvent *event)
m_bMousePress = true;
m_lastMousePos = event->globalPos();
m_absMove = QPoint(0,0);
//m_mouseTimer.start(5000);
}
if(event->button()==Qt::RightButton)
{
sInfoThread.terminate();
workThread.terminate();
qApp->exit(-1);
QProcess::startDetached(qApp->applicationFilePath(), QStringList(qApp->applicationFilePath()));
emit closePort();
// qApp->exit();
// QProcess::startDetached(qApp->applicationFilePath(), QStringList(qApp->applicationFilePath()));
}
}
......
......@@ -49,8 +49,6 @@ private:
int m_wavPlayInterval;
// 置顶定时器
QTimer m_raiseTimer;
//长按定时器
QTimer m_mouseTimer;
/* 功能:初始化
* 参数:NULL
......@@ -76,11 +74,11 @@ signals:
* 返回:NULL
* */
void showMainForm();
/* 功能:通知main重启
/* 功能:通知关闭端口
* 参数:NULL
* 返回:NULL
* */
void restart();
void closePort();
public slots:
/* 功能:开启提示
......
......@@ -73,7 +73,9 @@ FORMS += mainForm.ui \
padForm.ui \
RejectForm.ui
RC_FILE += fmTakeaway.rc
#RC_FILE += fmTakeaway.rc
RC_FILE += uac.rc
CONFIG(release, debug|release) {
LIBS += -L../fmPlugin/release -lfmPlugin
......@@ -83,4 +85,3 @@ CONFIG(release, debug|release) {
LIBS += -L../fmPrinter/debug -lfmPrinter
}
......@@ -52,13 +52,13 @@ void LoadTheme(const QString& theme)
int main(int argc, char *argv[])
{
// HANDLE m_hMutex = CreateMutex(NULL, FALSE, L"fmTakeaway" );
HANDLE m_hMutex = CreateMutex(NULL, FALSE, L"fmTakeaway" );
// if (GetLastError() == ERROR_ALREADY_EXISTS) {
// CloseHandle(m_hMutex);
// m_hMutex = NULL;
// return -1;
// }
if (GetLastError() == ERROR_ALREADY_EXISTS) {
CloseHandle(m_hMutex);
m_hMutex = NULL;
return -1;
}
QApplication a(argc, argv);
g_appDir = a.applicationDirPath();
......@@ -81,7 +81,8 @@ int main(int argc, char *argv[])
QObject::connect(&w, &MainForm::startRemind, &f, &FloatForm::onStartRemind);
QObject::connect(&w, &MainForm::stopRemind, &f, &FloatForm::onStopRemind);
QObject::connect(&f, &FloatForm::showMainForm, &w, &MainForm::show);
QObject::connect(&f, &FloatForm::restart, &w, &MainForm::onrestart);
QObject::connect(&f, &FloatForm::closePort,&SInfoControl::GetInstance(),&SInfoControl::doclosePort);
//QObject::connect(&f, &FloatForm::restart, &w, &MainForm::onrestart);
w.MyShow();
// 将门店信息获取控制器移到工作线程
......
......@@ -219,9 +219,7 @@ void MainForm::onShowSearchOrderResult(const QMap<QString,QString>& orderIdList)
void MainForm::onrestart()
{
}
void MainForm::_RevertBtnTable()
{
m_prevBtn->setChecked(false);
......
......@@ -466,17 +466,19 @@ QWidget
height: 0px;
}
/*---------------------------------DetailForm[ end ]---------------------------------*/
/*---------------------------------RejectDialog[start]-------------------------------------*/
#RejectDialog
/*---------------------------------RejectForm[start]-------------------------------------*/
#RejectForm
{
background-color:rgb(245,245,245);
}
#rejectLabHead
{
font: 14pt "微软雅黑";
background-color:rgb(238, 122, 42);
}
#rejectBtnOk,#rejectBtnCancle
{
font: 14pt "微软雅黑";
color: rgb(255, 255, 255);
background-color: rgb(238,122,42);
border-radius: 3px;
......@@ -487,7 +489,11 @@ QWidget
background-color: rgb(222,184,135);
border-radius: 3px;
}
/*---------------------------------RejectDialog[end]-------------------------------------*/
#rejectRbtn0,#rejectRbtn1,#rejectRbtn2,#rejectRbtn3,#rejectRbtn4,#rejectRbtn5
{
font: 14pt "微软雅黑";
}
/*---------------------------------RejectForm[end]-------------------------------------*/
......
No preview for this file type
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