Commit e0e185f3 by wuyang.zou

fix bug: 扩展退货时,增加退货商品选择;

parent 239d50c9
...@@ -213,7 +213,6 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject) ...@@ -213,7 +213,6 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject)
} }
break; break;
case OrderObject::Sendout: case OrderObject::Sendout:
case OrderObject::ToSend:
case OrderObject::Finished: case OrderObject::Finished:
case OrderObject::RequestRefund: case OrderObject::RequestRefund:
/***case:新订单、确认订单、已配送订单、待配送订单、完成订单、请求退单: 订单还没push到POS[POS没有模拟点单或没有返回小票号]***/ /***case:新订单、确认订单、已配送订单、待配送订单、完成订单、请求退单: 订单还没push到POS[POS没有模拟点单或没有返回小票号]***/
...@@ -235,6 +234,7 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject) ...@@ -235,6 +234,7 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject)
break; break;
case OrderObject::AgreeRefund: case OrderObject::AgreeRefund:
case OrderObject::Refunded: /*退单目前本佳那边不区分 OrderObject::Refunded=100*/ case OrderObject::Refunded: /*退单目前本佳那边不区分 OrderObject::Refunded=100*/
break;
case OrderObject::Cancled: case OrderObject::Cancled:
/***case:同意退单、退单、取消订单: 此退单还没push到POS[POS没有确认退单或没有返回确认退单的小票号]***/ /***case:同意退单、退单、取消订单: 此退单还没push到POS[POS没有确认退单或没有返回确认退单的小票号]***/
if(!orderObject->isCancle) if(!orderObject->isCancle)
...@@ -767,14 +767,15 @@ bool FlowControl::_RefuseRefund(const QString& orderId) ...@@ -767,14 +767,15 @@ bool FlowControl::_RefuseRefund(const QString& orderId)
return result; return result;
} }
bool FlowControl::_RefundOrder(const QString &orderId,int reasonCode,const QString& reason) bool FlowControl::_RefundOrder(const QString &orderId,int reasonCode,const QString& reason,const QString& dishesListString)
{ {
QLOG_INFO() << QString("[<<<<---FlowControl::_RefundOrder--->>>>][orderId:%1 reasonCode:%2 reason:%3 dishesListString:]")<<orderId<<reasonCode<<reason<<dishesListString;
QString error; QString error;
bool result; bool result;
QJsonObject sendJson; QJsonObject sendJson;
QJsonObject recvJson; QJsonObject recvJson;
sendJson = DataManger::GetInstance().GetRefundOrderData(reasonCode,reason,orderId,m_FmOrdersMap.value(orderId)->channel); sendJson = DataManger::GetInstance().GetRefundOrderData(reasonCode,reason,orderId,m_FmOrdersMap.value(orderId)->channel, dishesListString);
emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在通信......")); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在通信......"));
...@@ -787,8 +788,16 @@ bool FlowControl::_RefundOrder(const QString &orderId,int reasonCode,const QStri ...@@ -787,8 +788,16 @@ bool FlowControl::_RefundOrder(const QString &orderId,int reasonCode,const QStri
else{ else{
QLOG_INFO()<<"load not ssl"; QLOG_INFO()<<"load not ssl";
} }
m_procOrderSocket->SetUrl(QUrl(ConfigManger::GetInstance().GetOrderServerUrl()+ // 如果退款原因:商品已售完,使用下面接口;
ConfigManger::GetInstance().GetInterfaceName(INI_INTERFACE_CANCLE))); if(3 == reasonCode){
m_procOrderSocket->SetUrl(QUrl(ConfigManger::GetInstance().GetOrderServerUrl()+
ConfigManger::GetInstance().GetInterfaceName(INI_INTERFACE_REFUND)));
}
// 如果退款原因:其他,使用下面接口
else{
m_procOrderSocket->SetUrl(QUrl(ConfigManger::GetInstance().GetOrderServerUrl()+
ConfigManger::GetInstance().GetInterfaceName(INI_INTERFACE_CANCLE)));
}
result = m_procOrderSocket->PostRequest(sendJson, recvJson, error); result = m_procOrderSocket->PostRequest(sendJson, recvJson, error);
QLOG_INFO() << QString("[<<<<---Refund Order Finish--->>>>][result:%1][msg:%2][recvData:%3]") QLOG_INFO() << QString("[<<<<---Refund Order Finish--->>>>][result:%1][msg:%2][recvData:%3]")
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
...@@ -1709,7 +1718,7 @@ void FlowControl::onProcessOrder(const QString &operation, const QString &orderI ...@@ -1709,7 +1718,7 @@ void FlowControl::onProcessOrder(const QString &operation, const QString &orderI
_RefuseRefund(orderId); _RefuseRefund(orderId);
}else if(!operation.compare(OPERATION_REFUNDORDER)) }else if(!operation.compare(OPERATION_REFUNDORDER))
{ {
_RefundOrder(orderId,-1,QString::fromLocal8Bit("同意退款")); _RefundOrder(orderId,-1,QString::fromLocal8Bit("同意退款"),QString());
} }
} }
...@@ -1751,7 +1760,8 @@ void FlowControl::onProcessRejectOrder(const QString &orderId, const int &reason ...@@ -1751,7 +1760,8 @@ void FlowControl::onProcessRejectOrder(const QString &orderId, const int &reason
{ {
_RefuseOrder(orderId, reasonCode,reason); _RefuseOrder(orderId, reasonCode,reason);
} }
void FlowControl::onProcessRepealOrder(const QString &orderId, const int &reasonCode,const QString &reason) void FlowControl::onProcessRepealOrder(const QString &orderId, const int &reasonCode,const QString &reason,const QString& dishesListString)
{ {
_RefundOrder(orderId,reasonCode,reason); QLOG_INFO() << QString("[<<<<---FlowControl::onProcessRepealOrder: --->>>>]");
_RefundOrder(orderId,reasonCode,reason,dishesListString);
} }
...@@ -188,7 +188,7 @@ signals: ...@@ -188,7 +188,7 @@ signals:
void setStoreStatusChanged(QJsonArray); void setStoreStatusChanged(QJsonArray);
void doConfirmOrder(const QString& orderId); void doConfirmOrder(const QString& orderId);
void doRefundOrder(const QString& orderId, int reasonCode, const QString &reason); void doRefundOrder(const QString& orderId, int reasonCode, const QString &reason, const QString & dishesListString);
void doStartOperateTimer(); void doStartOperateTimer();
private slots: private slots:
...@@ -247,7 +247,7 @@ private slots: ...@@ -247,7 +247,7 @@ private slots:
* 参数:NULL * 参数:NULL
* 返回:是否成功 * 返回:是否成功
* */ * */
bool _RefundOrder(const QString& orderId, int reasonCode, const QString &reason); bool _RefundOrder(const QString& orderId, int reasonCode, const QString &reason,const QString& dishesListString);
/* 功能:获取Json对象的字符 /* 功能:获取Json对象的字符
* 参数:NULL * 参数:NULL
* 返回:Json字符串 * 返回:Json字符串
...@@ -371,7 +371,7 @@ public slots: ...@@ -371,7 +371,7 @@ public slots:
* */ * */
void onSerachOrder(const QString& text); void onSerachOrder(const QString& text);
void onProcessRejectOrder(const QString& orderId, const int& reasonCode,const QString &reason); void onProcessRejectOrder(const QString& orderId, const int& reasonCode,const QString &reason);
void onProcessRepealOrder(const QString& orderId, const int& reasonCode,const QString &reason); void onProcessRepealOrder(const QString& orderId, const int& reasonCode,const QString &reason,const QString& dishesListString);
/* 功能:获取门店营业状态 /* 功能:获取门店营业状态
* 参数:NULL * 参数:NULL
......
...@@ -127,18 +127,31 @@ QJsonObject DataManger::GetCompleteOrderData(const QString &orderId) ...@@ -127,18 +127,31 @@ QJsonObject DataManger::GetCompleteOrderData(const QString &orderId)
return rObj; return rObj;
} }
QJsonObject DataManger::GetRefundOrderData(int reasonCode,const QString &reason, const QString &orderId,const QString& channel) QJsonObject DataManger::GetRefundOrderData(int reasonCode,const QString &reason, const QString &orderId,const QString& channel,const QString& dishesListString)
{ {
QJsonObject rObj; QJsonObject rObj;
rObj.insert(JSON_ORDERID, orderId); QJsonArray productIds;
//TEST // 退单原因码==3:商品已售完;
//rObj.insert(JSON_REASON, "其它"); if(3 == reasonCode){
rObj.insert("canceledCause", reason); QString str = dishesListString;
// rObj.insert(JSON_CODE, reasonCode); if(str.length()){
QStringList list1 = str.split(";");
for(int i=0;i<list1.size();++i){
// rObj.insert(JSON_CHANNEL,channel); productIds.append(list1.at(i));
// rObj.insert(JSON_SHOPCODE, m_storeId); }
}
rObj.insert(JSON_ORDERID, orderId);
rObj.insert("productIds", productIds);
rObj.insert("canceledCause", reason);
}
// 其他退单原因;
else{
rObj.insert(JSON_ORDERID, orderId);
rObj.insert("canceledCause", reason);
//rObj.insert(JSON_CODE, reasonCode);
//rObj.insert(JSON_CHANNEL,channel);
//rObj.insert(JSON_SHOPCODE, m_storeId);
}
return rObj; return rObj;
} }
......
...@@ -69,7 +69,7 @@ public: ...@@ -69,7 +69,7 @@ public:
* 参数:[1]时间戳 * 参数:[1]时间戳
* 返回:登录数据 * 返回:登录数据
* */ * */
QJsonObject GetRefundOrderData(int reasonCode, const QString& reason, const QString& orderId, const QString &channel); QJsonObject GetRefundOrderData(int reasonCode, const QString& reason, const QString& orderId, const QString &channel,const QString& dishesListString);
/* 功能:获取拒绝退单数据 /* 功能:获取拒绝退单数据
* 参数:[1]时间戳 * 参数:[1]时间戳
* 返回:登录数据 * 返回:登录数据
......
...@@ -25,6 +25,15 @@ QString GetOperByStatus(int status, bool bRefuse) ...@@ -25,6 +25,15 @@ QString GetOperByStatus(int status, bool bRefuse)
} }
return OPERATION_SENDOUT; return OPERATION_SENDOUT;
break; break;
case 3:
if(bRefuse)
{
return OPERATION_REFUNDORDER;
}
return OPERATION_SENDOUT;
break;
case 5: case 5:
case 4: case 4:
if(bRefuse) if(bRefuse)
...@@ -68,6 +77,14 @@ QString GetOperNameByStatus(int status, bool bRefuse) ...@@ -68,6 +77,14 @@ QString GetOperNameByStatus(int status, bool bRefuse)
} }
return QString::fromLocal8Bit(OPERATIONNAME_SENDOUT); return QString::fromLocal8Bit(OPERATIONNAME_SENDOUT);
break; break;
case 3:
if(bRefuse)
{
return QString::fromLocal8Bit(OPERATIONNAME_REFUNDORDER);
}
return QString::fromLocal8Bit(OPERATIONNAME_SENDOUT);
break;
case 5: case 5:
case 4: case 4:
if(bRefuse) if(bRefuse)
......
...@@ -67,9 +67,9 @@ public: ...@@ -67,9 +67,9 @@ public:
OrderObject& operator =(const OrderObject& order); OrderObject& operator =(const OrderObject& order);
typedef enum { typedef enum {
NewOrder=2,Confirmed,Cancled,Sendout,ToSend, NewOrder=2,Confirmed,Cancled,Sendout,Refunded,
Finished,Locked=-1,RequestRefund=20, Finished,Locked=-1,RequestRefund=20,
AgreeRefund=30,RefuseRefund=40,Refunded=100 /*退单目前本佳那边不区分:Refunded=100*/ AgreeRefund=30,RefuseRefund=40 /*,Refunded=100 ToSend=6(订单状态是6时,是退单); 退单目前本佳那边不区分:Refunded=100*/
}OrderStatus; }OrderStatus;
/* 功能:从Json对象初获取数据 /* 功能:从Json对象初获取数据
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "preDefine.h" #include "preDefine.h"
#include "DTools/configManger.h" #include "DTools/configManger.h"
#include "Control/flowControl.h" #include "Control/flowControl.h"
#include "QsLog.h"
DetailForm::DetailForm(QWidget *parent) : DetailForm::DetailForm(QWidget *parent) :
QDialog(parent), QDialog(parent),
...@@ -71,7 +72,7 @@ void DetailForm::InitData(OrderObject *orderObject) ...@@ -71,7 +72,7 @@ void DetailForm::InitData(OrderObject *orderObject)
ui->detailBtn2->setText(GetOperNameByStatus(orderObject->orderStatus, true)); ui->detailBtn2->setText(GetOperNameByStatus(orderObject->orderStatus, true));
ui->detailBtn2->setProperty("operation", GetOperByStatus(orderObject->orderStatus, true)); ui->detailBtn2->setProperty("operation", GetOperByStatus(orderObject->orderStatus, true));
ui->detailBtn2->setProperty("orderId", orderObject->id); ui->detailBtn2->setProperty("orderId", orderObject->id);
if(orderObject->orderStatus != 1 && orderObject->orderStatus != 20&& orderObject->orderStatus != 2&& orderObject->orderStatus != 4) if(orderObject->orderStatus != 1 && orderObject->orderStatus != 20&& orderObject->orderStatus != 2 && orderObject->orderStatus != 3&& orderObject->orderStatus != 4)
{ {
ui->detailBtn2->hide(); ui->detailBtn2->hide();
} }
...@@ -131,23 +132,19 @@ QString DetailForm::GetProductName(dishesObject *dish) ...@@ -131,23 +132,19 @@ QString DetailForm::GetProductName(dishesObject *dish)
void DetailForm::onOperaBtnClicked() void DetailForm::onOperaBtnClicked()
{ {
QLOG_INFO() << QString("[<<<<---DetailForm::onOperaBtnClicked: begin:--->>>>]");
hide(); hide();
QPushButton *pBtn = (QPushButton*)sender(); QPushButton *pBtn = (QPushButton*)sender();
if(pBtn->text()==QString::fromLocal8Bit("拒单")||pBtn->text()==QString::fromLocal8Bit("退单")) if(pBtn->text()==QString::fromLocal8Bit("拒单")||pBtn->text()==QString::fromLocal8Bit("退单"))
{ {
// m_rejectForm->show();
// if(m_rejectForm->exec()==QDialog::Accepted)
// {
// emit processRejectOrder( pBtn->property("orderId").toString(),m_rejectForm->GetReasonCode());
// }
// }
// else if(pBtn->text()=="退单")
// {
m_refuseForm->SetOrderInfo(m_orderObject); m_refuseForm->SetOrderInfo(m_orderObject);
m_refuseForm->show(); m_refuseForm->show();
QLOG_INFO() << QString("[<<<<---DetailForm::onOperaBtnClicked: QPushButton:--->>>>]")<<pBtn->text();
if(m_refuseForm->exec()==QDialog::Accepted) if(m_refuseForm->exec()==QDialog::Accepted)
{ {
emit processRepealOrder( pBtn->property("orderId").toString(),m_refuseForm->m_reasonCode,m_refuseForm->m_reasonStr); QLOG_INFO() << QString("[<<<<---DetailForm::onOperaBtnClicked: m_refuseForm->exec()==QDialog::Accepted--->>>>]");
QLOG_INFO() << QString("[<<<<---DetailForm::onOperaBtnClicked: --->>>>]")<<m_refuseForm->m_reasonCode<<m_refuseForm->m_reasonStr<<m_refuseForm->m_refundDishesListString;
emit processRepealOrder( pBtn->property("orderId").toString(),m_refuseForm->m_reasonCode,m_refuseForm->m_reasonStr,m_refuseForm->m_refundDishesListString);
} }
} }
else else
......
...@@ -38,7 +38,6 @@ private: ...@@ -38,7 +38,6 @@ private:
void _Init(); void _Init();
RejectForm *m_rejectForm; RejectForm *m_rejectForm;
RefuseForm *m_refuseForm; RefuseForm *m_refuseForm;
QString GetProductName(dishesObject* dish); QString GetProductName(dishesObject* dish);
signals: signals:
...@@ -48,7 +47,7 @@ signals: ...@@ -48,7 +47,7 @@ signals:
* */ * */
void processOrder(const QString& operation, const QString& orderId); void processOrder(const QString& operation, const QString& orderId);
void processRejectOrder(const QString& orderId,const int& reasonCode,const QString& reason); void processRejectOrder(const QString& orderId,const int& reasonCode,const QString& reason);
void processRepealOrder(const QString& orderId,const int& reasonCode,const QString& reason); void processRepealOrder(const QString& orderId,const int& reasonCode,const QString& reason,const QString& dishesList);
private slots: private slots:
/* 功能:处理订单按钮点击 /* 功能:处理订单按钮点击
......
...@@ -284,7 +284,9 @@ QPushButton *MainForm::_GetTabBtnByOrderStatus(int orderStatus) ...@@ -284,7 +284,9 @@ QPushButton *MainForm::_GetTabBtnByOrderStatus(int orderStatus)
case OrderObject::Confirmed: case OrderObject::Confirmed:
return ui->mainBtnMake; return ui->mainBtnMake;
break; break;
case OrderObject::ToSend: case OrderObject::Refunded:
return ui->mainBtnFinsh;
break;
case OrderObject::Sendout: case OrderObject::Sendout:
return ui->mainBtnSend; return ui->mainBtnSend;
break; break;
...@@ -397,7 +399,27 @@ void MainForm::onChangeOrderStatus(OrderObject *orderObject, int oldStatus) ...@@ -397,7 +399,27 @@ void MainForm::onChangeOrderStatus(OrderObject *orderObject, int oldStatus)
table->setItem(0, 5, item5); // 下单时间 table->setItem(0, 5, item5); // 下单时间
if(table != ui->mainTableFinsh) if(table != ui->mainTableFinsh)
{ {
if(/*!table->property("operationName").toString().compare("接单")&&*/2==orderObject->orderStatus) // 订单已经支付,等待接单的订单;
if(2==orderObject->orderStatus)
{
qDebug()<<table->objectName()<<"------";
QWidget *pWdg = new QWidget(table);
QHBoxLayout *hLayout = new QHBoxLayout(pWdg);
QPushButton * pBtn = new QPushButton(pWdg);
pBtn->setFixedSize(70, 30);
pBtn->setFocusPolicy(Qt::NoFocus);
pBtn->setObjectName("mainProcBtn");
pBtn->setProperty("orderId", orderObject->id);
pBtn->setProperty("operation", table->property("operation").toString());
pBtn->setText(table->property("operationName").toString());
hLayout->addWidget(pBtn);
hLayout->setMargin(0);
pWdg->setLayout(hLayout);
table->setCellWidget(0, 6, pWdg); // 操作按钮
connect(pBtn, &QPushButton::clicked, this, &MainForm::onMainProcBtnClicked);
}
// 已经接单的订单;
if(3==orderObject->orderStatus)
{ {
qDebug()<<table->objectName()<<"------"; qDebug()<<table->objectName()<<"------";
QWidget *pWdg = new QWidget(table); QWidget *pWdg = new QWidget(table);
......
...@@ -137,6 +137,7 @@ ...@@ -137,6 +137,7 @@
#define INI_INTERFACE_HEART "heart" #define INI_INTERFACE_HEART "heart"
#define INI_INTERFACE_CONFIRM "confirm" #define INI_INTERFACE_CONFIRM "confirm"
#define INI_INTERFACE_CANCLE "cancle" #define INI_INTERFACE_CANCLE "cancle"
#define INI_INTERFACE_REFUND "refund"
// 属性名称 // 属性名称
......
#include "refdishesForm.h" #include "refdishesForm.h"
#include "ui_refdishesForm.h" #include "ui_refdishesForm.h"
#include "Control/flowControl.h" #include "Control/flowControl.h"
#include "QsLog.h"
refDishesForm::refDishesForm(QWidget *parent) : refDishesForm::refDishesForm(QWidget *parent) :
QDialog(parent), QDialog(parent),
...@@ -28,12 +29,25 @@ void refDishesForm::InitData(OrderObject *obj) ...@@ -28,12 +29,25 @@ void refDishesForm::InitData(OrderObject *obj)
int i=0; int i=0;
foreach (dishesObject *product, obj->proList) foreach (dishesObject *product, obj->proList)
{ {
QPushButton *btn = new QPushButton(this); ui->refDishesTable->setColumnWidth(0,300);
btn->setFixedSize(260, 50); ui->refDishesTable->setColumnWidth(1,165);
btn->setCheckable(true); ui->refDishesTable->verticalHeader()->setDefaultSectionSize(60);
btn->setText(product->name); QStringList header; //QString类型的List容器
btn->setObjectName(product->id); header<<QString::fromLocal8Bit("商品名")<<QString::fromLocal8Bit("商品码");
btn->setStyleSheet("QPushButton{ color: #3d3d3d; \ ui->refDishesTable->setHorizontalHeaderLabels(header);
ui->refDishesTable->insertRow(0);
QWidget *pWdg = new QWidget(ui->refDishesTable);
QHBoxLayout *hLayout = new QHBoxLayout(pWdg);
QPushButton * pBtn = new QPushButton(pWdg);
pBtn->setFixedSize(250, 50);
pBtn->setObjectName(product->id);
pBtn->setProperty("id", product->id);
pBtn->setProperty("name",product->name);
pBtn->setProperty("qty",product->qty);
pBtn->setText(product->name);
pBtn->setCheckable(true);
pBtn->setStyleSheet("QPushButton{ color: #3d3d3d; \
background-color: rgb(255, 255, 255); \ background-color: rgb(255, 255, 255); \
border: 1px solid #C0C0C0; \ border: 1px solid #C0C0C0; \
border-radius: 3px;} \ border-radius: 3px;} \
...@@ -44,36 +58,56 @@ void refDishesForm::InitData(OrderObject *obj) ...@@ -44,36 +58,56 @@ void refDishesForm::InitData(OrderObject *obj)
border-radius: 3px; \ border-radius: 3px; \
border: 1px solid rgb(24, 206, 0); \ border: 1px solid rgb(24, 206, 0); \
}"); }");
if(i<6)
{
ui->verticalLayout_left->insertWidget(0, btn);
}else
{
ui->verticalLayout_right->insertWidget(0, btn);
}
connect(btn, &QPushButton::toggled, this, &refDishesForm::onDishesBtnToggled); hLayout->addWidget(pBtn,1,Qt::AlignCenter);
//hLayout->setMargin(0);
pWdg->setLayout(hLayout);
connect(pBtn, &QPushButton::toggled, this, &refDishesForm::onDishesBtnToggled);
ui->refDishesTable->setCellWidget(0, 0, pWdg); // 商品名按钮
m_btnList.append(btn); QTableWidgetItem *item0 = new QTableWidgetItem(product->id);
i++; //item0->setTextAlignment(Qt::AlignLeft|Qt::AlignTop);
item0->setTextAlignment(Qt::AlignCenter);
item0->setFlags(Qt::NoItemFlags);
item0->setSizeHint(QSize(150,50));
item0->setCheckState(Qt::Unchecked);
ui->refDishesTable->setItem(0, 1, item0);
m_twiList.append(item0);
//m_btnList.append(btn);
//i++;
} }
} }
void refDishesForm::_Init() void refDishesForm::_Init()
{ {
ui->refDishesBtnOk->setEnabled(false); ui->refDishesBtnOk->setEnabled(false);
/*
foreach(QPushButton* btn, m_btnList) foreach(QPushButton* btn, m_btnList)
{ {
disconnect(btn, &QPushButton::toggled, this, &refDishesForm::onDishesBtnToggled); disconnect(btn, &QPushButton::toggled, this, &refDishesForm::onDishesBtnToggled);
delete btn; delete btn;
} }
m_btnList.clear(); m_btnList.clear();
*/
foreach(QTableWidgetItem* twi, m_twiList)
{
delete twi;
}
m_twiList.clear();
for(int i=0; i<ui->refDishesTable->rowCount(); i++)
{
ui->refDishesTable->removeRow(i);
}
m_dishesMap.clear(); m_dishesMap.clear();
} }
void refDishesForm::on_refDishesBtnOk_clicked() void refDishesForm::on_refDishesBtnOk_clicked()
{ {
emit updDishes("" ,m_dishesMap); //别的客户用来更新菜单用的;目前 starbucks No Need;
//emit updDishes("" ,m_dishesMap);
QLOG_INFO() << QString("[<<<<---refDishesForm::on_refDishesBtnOk_clicked: accept()--->>>>]");
accept(); accept();
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define REFDISHESFORM_H #define REFDISHESFORM_H
#include <QDialog> #include <QDialog>
#include <QTableWidgetItem>
#include "Model/orderObject.h" #include "Model/orderObject.h"
namespace Ui { namespace Ui {
...@@ -18,6 +19,8 @@ public: ...@@ -18,6 +19,8 @@ public:
void InitData(OrderObject* obj); void InitData(OrderObject* obj);
QMap<QString, int> m_dishesMap;
private slots: private slots:
void _Init(); void _Init();
void on_refDishesBtnOk_clicked(); void on_refDishesBtnOk_clicked();
...@@ -29,9 +32,9 @@ private slots: ...@@ -29,9 +32,9 @@ private slots:
private: private:
Ui::refDishesForm *ui; Ui::refDishesForm *ui;
QList<QPushButton*> m_btnList; //QList<QPushButton*> m_btnList;
QMap<QString, int> m_dishesMap; QList<QTableWidgetItem*> m_twiList;
signals: signals:
void updDishes(QString , QMap<QString, int> dishes); void updDishes(QString , QMap<QString, int> dishes);
......
...@@ -44,37 +44,6 @@ ...@@ -44,37 +44,6 @@
<string>取消</string> <string>取消</string>
</property> </property>
</widget> </widget>
<widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry">
<rect>
<x>13</x>
<y>70</y>
<width>281</width>
<height>341</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_left">
<property name="spacing">
<number>5</number>
</property>
<property name="leftMargin">
<number>5</number>
</property>
<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>
<widget class="QLabel" name="refDishesLab"> <widget class="QLabel" name="refDishesLab">
<property name="geometry"> <property name="geometry">
<rect> <rect>
...@@ -104,33 +73,65 @@ ...@@ -104,33 +73,65 @@
<string>确定</string> <string>确定</string>
</property> </property>
</widget> </widget>
<widget class="QWidget" name="verticalLayoutWidget_2"> <widget class="QTableWidget" name="refDishesTable">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>305</x> <x>20</x>
<y>70</y> <y>70</y>
<width>281</width> <width>541</width>
<height>341</height> <height>341</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_right"> <property name="layoutDirection">
<property name="rightMargin"> <enum>Qt::LeftToRight</enum>
<number>5</number> </property>
</property> <property name="frameShape">
<item> <enum>QFrame::Box</enum>
<spacer name="verticalSpacer_2"> </property>
<property name="orientation"> <property name="frameShadow">
<enum>Qt::Vertical</enum> <enum>QFrame::Raised</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="lineWidth">
<size> <number>5</number>
<width>20</width> </property>
<height>40</height> <property name="midLineWidth">
</size> <number>3</number>
</property> </property>
</spacer> <property name="horizontalScrollBarPolicy">
</item> <enum>Qt::ScrollBarAsNeeded</enum>
</layout> </property>
<property name="autoScrollMargin">
<number>50</number>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
</property>
<property name="rowCount">
<number>0</number>
</property>
<property name="columnCount">
<number>2</number>
</property>
<attribute name="horizontalHeaderVisible">
<bool>true</bool>
</attribute>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>true</bool>
</attribute>
<attribute name="horizontalHeaderHighlightSections">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderCascadingSectionResizes">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderHighlightSections">
<bool>false</bool>
</attribute>
<column/>
<column/>
</widget> </widget>
</widget> </widget>
</item> </item>
......
#include "refuseForm.h" #include "refuseForm.h"
#include "ui_refuseForm.h" #include "ui_refuseForm.h"
#include <QDebug> #include <QDebug>
#include "QsLog.h"
RefuseForm::RefuseForm(QWidget *parent) : RefuseForm::RefuseForm(QWidget *parent) :
QDialog(parent), QDialog(parent),
...@@ -43,6 +44,7 @@ void RefuseForm::on_reason1_toggled(bool checked) ...@@ -43,6 +44,7 @@ void RefuseForm::on_reason1_toggled(bool checked)
{ {
if(checked) if(checked)
{ {
m_refundDishesList.clear();
ui->refuseBtnOk->setEnabled(true); ui->refuseBtnOk->setEnabled(true);
m_reasonStr=QString::fromLocal8Bit("餐厅已打烊"); m_reasonStr=QString::fromLocal8Bit("餐厅已打烊");
m_reasonCode=2; m_reasonCode=2;
...@@ -52,15 +54,27 @@ void RefuseForm::on_reason1_toggled(bool checked) ...@@ -52,15 +54,27 @@ void RefuseForm::on_reason1_toggled(bool checked)
void RefuseForm::on_reason2_toggled(bool checked) void RefuseForm::on_reason2_toggled(bool checked)
{ {
//TODO //TODO
QLOG_INFO() << QString("[<<<<---RefuseForm::on_reason2_toggled: check:%1--->>>>]")<<checked;
if(m_orderObject!=NULL&&checked) if(m_orderObject!=NULL&&checked)
{ {
m_refundDishesList.clear();
m_refDishesForm->InitData(m_orderObject); m_refDishesForm->InitData(m_orderObject);
if(QDialog::Accepted == m_refDishesForm->exec()) if(QDialog::Accepted == m_refDishesForm->exec())
{ {
ui->refuseBtnOk->setEnabled(true); ui->refuseBtnOk->setEnabled(true);
//m_reasonCode=
m_reasonStr=QString::fromLocal8Bit("菜品已售完"); m_reasonStr=QString::fromLocal8Bit("菜品已售完");
m_reasonCode=3;
QMap<QString,int>::iterator it; //遍历map
for(it = m_refDishesForm->m_dishesMap.begin(); it != m_refDishesForm->m_dishesMap.end(); ++it) {
m_refundDishesList.append(it.key());
}
m_refundDishesListString = m_refundDishesList.join(";");
QLOG_INFO() << QString("[<<<<---RefuseForm::on_reason2_toggled: m_refDishesForm->m_dishesMap:%1--->>>>]")<<m_refDishesForm->m_dishesMap;
QLOG_INFO() << QString("[<<<<---RefuseForm::on_reason2_toggled: m_refundDishesList:%1--->>>>]")<<m_refundDishesList;
on_refuseBtnOk_clicked(); on_refuseBtnOk_clicked();
QLOG_INFO() << QString("[<<<<---RefuseForm::on_refuseBtnOk_clicked--->>>>]");
m_refundDishesList.clear();
}else }else
{ {
_Init(); _Init();
...@@ -78,6 +92,7 @@ void RefuseForm::on_reason3_toggled(bool checked) ...@@ -78,6 +92,7 @@ void RefuseForm::on_reason3_toggled(bool checked)
{ {
if(checked) if(checked)
{ {
m_refundDishesList.clear();
ui->refuseBtnOk->setEnabled(true); ui->refuseBtnOk->setEnabled(true);
m_reasonStr=QString::fromLocal8Bit("餐厅太忙"); m_reasonStr=QString::fromLocal8Bit("餐厅太忙");
m_reasonCode=5; m_reasonCode=5;
...@@ -88,6 +103,7 @@ void RefuseForm::on_reason4_toggled(bool checked) ...@@ -88,6 +103,7 @@ void RefuseForm::on_reason4_toggled(bool checked)
{ {
if(checked) if(checked)
{ {
m_refundDishesList.clear();
ui->refuseBtnOk->setEnabled(true); ui->refuseBtnOk->setEnabled(true);
m_reasonStr=QString::fromLocal8Bit("联系不上客户"); m_reasonStr=QString::fromLocal8Bit("联系不上客户");
m_reasonCode=6; m_reasonCode=6;
...@@ -98,6 +114,7 @@ void RefuseForm::on_reason5_toggled(bool checked) ...@@ -98,6 +114,7 @@ void RefuseForm::on_reason5_toggled(bool checked)
{ {
if(checked) if(checked)
{ {
m_refundDishesList.clear();
ui->refuseBtnOk->setEnabled(true); ui->refuseBtnOk->setEnabled(true);
m_reasonStr=QString::fromLocal8Bit("无人配送"); m_reasonStr=QString::fromLocal8Bit("无人配送");
m_reasonCode=-1; m_reasonCode=-1;
......
...@@ -18,9 +18,15 @@ class RefuseForm : public QDialog ...@@ -18,9 +18,15 @@ class RefuseForm : public QDialog
public: public:
explicit RefuseForm(QWidget *parent = 0); explicit RefuseForm(QWidget *parent = 0);
~RefuseForm(); ~RefuseForm();
QString m_reasonStr; QString m_reasonStr;
int m_reasonCode; int m_reasonCode;
QStringList m_refundDishesList;
QString m_refundDishesListString;
void SetOrderInfo(OrderObject*); void SetOrderInfo(OrderObject*);
private slots: private slots:
...@@ -47,6 +53,7 @@ private slots: ...@@ -47,6 +53,7 @@ private slots:
private: private:
Ui::RefuseForm *ui; Ui::RefuseForm *ui;
OrderObject* m_orderObject; OrderObject* m_orderObject;
refDishesForm* m_refDishesForm; refDishesForm* m_refDishesForm;
......
[FmServer]
;非码外卖拉取订单服务器地址
loginUrl=http://10.92.193.212:8777/pos/
orderUrl=http://10.92.193.212:8090/order/
[Interface]
;接口名称
login=entity
heart=posUpdate
pullOrder=detail?orderId=
pullOrderList =pos/listOrders
confirm=receiving?orderId=
cancle=cancellation
refund=pos/refund
getstorestate=getstorestate
updatestate=updatestate
[IpAddress]
ip=10.227.255.165
[HttpServer]
;非码外卖监听端口
port=24409
[Software]
;登录信息
;storeid=
password=posoperator@freemud.cn
posno=001
;是否自动接单
autoconfirm=0
partnerid=379d1f5c-7a60-458f-9f9b-4fd271003fca
[SSLConfig]
login=0
order=1
;前缀
;perfix=
[Server]
url=
\ No newline at end of file
[Float]
postion=@Point(1151 339)
opacity=0.5
blinkInterval=0.3
soundInterval=2
[DbInfo]
host=.
username=sa
password=sa
database=zhy
[Printer]
name=Microsoft XPS Document Writer
[OmsBtn]
postion=@Point(1350 720)
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