Commit ef4b7163 by ss.dai

Merge branch 'MiYou' of https://git.oschina.net/seventeendai/takeaway into MiYou

parents 45efbcb8 b79811b9
......@@ -263,7 +263,7 @@ bool FlowControl::_ConfirmOrder(const QString &orderId, const DeliverObject &del
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))
......@@ -520,10 +520,12 @@ void FlowControl::onProcessOrder(const QString &operation, const QString &orderI
}else if(!operation.compare(OPERATION_CONFRIM))
{
_ConfirmOrder(orderId, deliverObj);
}else if(!operation.compare(OPERATION_REFUSE))
{
_RefuseOrder(orderId, 2);
}else if(!operation.compare(OPERATION_SENDOUT))
}
// else if(!operation.compare(OPERATION_REFUSE))
// {
// _RefuseOrder(orderId, 2);
// }
else if(!operation.compare(OPERATION_SENDOUT))
{
_SendOrder(orderId);
}else if(!operation.compare(OPERATION_COMPLETE))
......@@ -573,4 +575,9 @@ void FlowControl::onSerachOrder(const QString &text)
emit showSearchOrderResult(orderMap);
}
void FlowControl::onProcessRejectOrder(const QString &orderId, const int &reason)
{
_RefuseOrder(orderId, reason);
}
......@@ -168,6 +168,7 @@ public slots:
* 返回:NULL
* */
void onSerachOrder(const QString& text);
void onProcessRejectOrder(const QString& orderId,const int& reason);
};
#endif // FLOWCONTROL_H
#include "RejectForm.h"
#include "ui_RejectForm.h"
RejectForm::RejectForm(QWidget *parent) :
QDialog(parent),
ui(new Ui::RejectForm)
{
ui->setupUi(this);
this->setWindowFlags(windowFlags()|Qt::FramelessWindowHint|Qt::Dialog);
this->move(parent->pos().x()+(parent->width()-this->width())/2,
parent->pos().y()+(parent->height()-this->height())/2);
m_rejectReason = 5;
ui->rejectRbtn0->toggle();
}
RejectForm::~RejectForm()
{
delete ui;
}
int RejectForm::GetReasonCode()
{
return m_rejectReason;
}
void RejectForm::on_rejectBtnOk_clicked()
{
this->accept();
}
void RejectForm::on_rejectBtnCancle_clicked()
{
this->reject();
}
void RejectForm::on_rejectRbtn0_toggled(bool)
{
m_rejectReason = 1;
}
void RejectForm::on_rejectRbtn1_toggled(bool)
{
m_rejectReason = 2;
}
void RejectForm::on_rejectRbtn2_toggled(bool)
{
m_rejectReason = 3;
}
void RejectForm::on_rejectRbtn3_toggled(bool)
{
m_rejectReason = 8;
}
void RejectForm::on_rejectRbtn4_toggled(bool)
{
m_rejectReason = 6;
}
#ifndef REJECTFORM_H
#define REJECTFORM_H
#include <QDialog>
namespace Ui {
class RejectForm;
}
class RejectForm : public QDialog
{
Q_OBJECT
public:
explicit RejectForm(QWidget *parent = 0);
~RejectForm();
int GetReasonCode();
private:
Ui::RejectForm *ui;
int m_rejectReason;
private slots:
void on_rejectBtnOk_clicked();
void on_rejectBtnCancle_clicked();
void on_rejectRbtn0_toggled(bool);
void on_rejectRbtn1_toggled(bool);
void on_rejectRbtn2_toggled(bool);
void on_rejectRbtn3_toggled(bool);
void on_rejectRbtn4_toggled(bool);
};
#endif // REJECTFORM_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RejectForm</class>
<widget class="QDialog" name="RejectForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>226</width>
<height>267</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,0,0,0,0,0">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="rejectLabHead">
<property name="minimumSize">
<size>
<width>0</width>
<height>34</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>34</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>请选择拒单理由</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>10</number>
</property>
<property name="leftMargin">
<number>40</number>
</property>
<item>
<widget class="QRadioButton" name="rejectRbtn0">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>不在派送范围</string>
</property>
<property name="reasonCode" stdset="0">
<number>5</number>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rejectRbtn1">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>餐厅已打烊</string>
</property>
<property name="reasonCode" stdset="0">
<number>6</number>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rejectRbtn2">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>已售完</string>
</property>
<property name="reasonCode" stdset="0">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rejectRbtn4">
<property name="text">
<string>联系不上客户</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rejectRbtn3">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>无人配送</string>
</property>
<property name="reasonCode" stdset="0">
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QPushButton" name="rejectBtnOk">
<property name="minimumSize">
<size>
<width>80</width>
<height>40</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>40</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>拒单</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="rejectBtnCancle">
<property name="minimumSize">
<size>
<width>80</width>
<height>40</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>40</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>取消</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<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>
</widget>
<resources/>
<connections/>
</ui>
......@@ -11,8 +11,8 @@ DetailForm::DetailForm(QWidget *parent) :
ui(new Ui::DetailForm)
{
ui->setupUi(this);
connect(this, &DetailForm::processOrder, &FlowControl::GetInstance(), &FlowControl::onProcessOrder);
connect(this, &DetailForm::processRejectOrder, &FlowControl::GetInstance(), &FlowControl::onProcessRejectOrder);
_Init();
}
......@@ -87,6 +87,7 @@ void DetailForm::InitData(OrderObject *orderObject)
{
ui->detailBtn3->hide();
}
m_rejectForm = new RejectForm(this);
}
void DetailForm::_Init()
......@@ -106,7 +107,18 @@ void DetailForm::onOperaBtnClicked()
{
hide();
QPushButton *pBtn = (QPushButton*)sender();
emit processOrder(pBtn->property("operation").toString(), pBtn->property("orderId").toString(), DeliverObject());
if(pBtn->text()=="拒单")
{
m_rejectForm->show();
if(m_rejectForm->exec()==QDialog::Accepted)
{
emit processRejectOrder( pBtn->property("orderId").toString(),m_rejectForm->GetReasonCode());
}
}
else
{
emit processOrder(pBtn->property("operation").toString(), pBtn->property("orderId").toString(), DeliverObject());
}
}
void DetailForm::on_detailBtn1_clicked()
......
......@@ -5,6 +5,7 @@
#include <QTableWidget>
#include "Model/orderObject.h"
#include "Model/deliverObject.h"
#include "RejectForm.h"
namespace Ui {
class DetailForm;
......@@ -34,6 +35,7 @@ private:
* 返回:NULL
* */
void _Init();
RejectForm *m_rejectForm;
signals:
/* 功能:处理订单
......@@ -41,6 +43,7 @@ signals:
* 返回:NULL
* */
void processOrder(const QString& operation, const QString& orderId, const DeliverObject& deliverObj);
void processRejectOrder(const QString& orderId,const int& reason);
private slots:
/* 功能:处理订单按钮点击
......
......@@ -25,7 +25,7 @@ FloatForm::FloatForm(QWidget *parent) :
m_raiseTimer.setInterval(2000);
connect(&m_raiseTimer, &QTimer::timeout, this, &FloatForm::raise);
connect(&m_mouseTimer, &QTimer::timeout, this, &FloatForm::restart);
_Init();
}
......@@ -53,6 +53,7 @@ void FloatForm::mousePressEvent(QMouseEvent *event)
m_bMousePress = true;
m_lastMousePos = event->globalPos();
m_absMove = QPoint(0,0);
m_mouseTimer.start(5000);
}
}
......@@ -73,6 +74,7 @@ void FloatForm::mouseReleaseEvent(QMouseEvent *event)
m_bMouseMove = false;
ConfigManger::GetInstance().setFloatInitPostion(event->globalPos());
m_mouseTimer.stop();
}
void FloatForm::_Init()
......
......@@ -49,6 +49,8 @@ private:
int m_wavPlayInterval;
// 置顶定时器
QTimer m_raiseTimer;
//长按定时器
QTimer m_mouseTimer;
/* 功能:初始化
* 参数:NULL
......@@ -74,6 +76,11 @@ signals:
* 返回:NULL
* */
void showMainForm();
/* 功能:通知main重启
* 参数:NULL
* 返回:NULL
* */
void restart();
public slots:
/* 功能:开启提示
......
......@@ -37,7 +37,8 @@ SOURCES += main.cpp\
Control/sinfoControl.cpp \
DTools/sysTray.cpp \
padForm.cpp \
DTools/clickedLineEdit.cpp
DTools/clickedLineEdit.cpp \
RejectForm.cpp
HEADERS += \
mainForm.h \
......@@ -60,7 +61,8 @@ HEADERS += \
Control/sinfoControl.h \
DTools/sysTray.h \
padForm.h \
DTools/clickedLineEdit.h
DTools/clickedLineEdit.h \
RejectForm.h
FORMS += mainForm.ui \
alertForm.ui \
......@@ -68,7 +70,8 @@ FORMS += mainForm.ui \
settingForm.ui \
floatForm.ui \
detailForm.ui \
padForm.ui
padForm.ui \
RejectForm.ui
RC_FILE += fmTakeaway.rc
......
......@@ -79,6 +79,7 @@ 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);
w.MyShow();
// 将门店信息获取控制器移到工作线程
......@@ -88,6 +89,5 @@ int main(int argc, char *argv[])
QObject::connect(&sInfoThread, &QThread::started, &SInfoControl::GetInstance(), &SInfoControl::run);
QObject::connect(&SInfoControl::GetInstance(), &SInfoControl::getNewStoreInfo, &FlowControl::GetInstance(), &FlowControl::onGetNewStoreInfo);
sInfoThread.start();
return a.exec();
}
......@@ -7,6 +7,7 @@
#include "DTools/util.h"
#include <QList>
#include <QMap>
#include <QProcess>
MainForm::MainForm(QWidget *parent) :
QWidget(parent),
......@@ -210,6 +211,12 @@ void MainForm::onShowSearchOrderResult(const QMap<QString,QString>& orderIdList)
m_resultForm->show();
}
void MainForm::onrestart()
{
qApp->quit();
QProcess::startDetached(qApp->applicationFilePath(), QStringList());
}
void MainForm::_RevertBtnTable()
{
m_prevBtn->setChecked(false);
......
......@@ -230,6 +230,7 @@ public slots:
* 返回:NULL
* */
void onShowSearchOrderResult(const QMap<QString, QString> &orderIdList);
void onrestart();
};
#endif // MAINFORM_H
......@@ -466,6 +466,28 @@ QWidget
height: 0px;
}
/*---------------------------------DetailForm[ end ]---------------------------------*/
/*---------------------------------RejectDialog[start]-------------------------------------*/
#RejectDialog
{
background-color:rgb(245,245,245);
}
#rejectLabHead
{
background-color:rgb(238, 122, 42);
}
#rejectBtnOk,#rejectBtnCancle
{
color: rgb(255, 255, 255);
background-color: rgb(238,122,42);
border-radius: 3px;
}
#rejectBtnOk:pressed,#rejectBtnCancle:pressed
{
color: rgb(161, 161, 161);
background-color: rgb(222,184,135);
border-radius: 3px;
}
/*---------------------------------RejectDialog[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