Commit c424f3f8 by wuyang.zou

fix bug;修复部分bug

parent d48523f1
...@@ -231,8 +231,10 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject) ...@@ -231,8 +231,10 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject)
break; break;
case OrderObject::Sendout: case OrderObject::Sendout:
case OrderObject::Finished: case OrderObject::Finished:
break;
case OrderObject::RequestRefund: case OrderObject::RequestRefund:
/***case:已配送订单、待配送订单、完成订单、请求退单:***/ // 星巴克:当客户同意退款时,外卖插件收到请求退款后,直接进行退款处理;
_RefundOrder(orderObject->id,-1,QString::fromLocal8Bit("同意退款"),QString());
break; break;
case OrderObject::AgreeRefund: case OrderObject::AgreeRefund:
break; break;
...@@ -932,21 +934,21 @@ void FlowControl::onPullDishes() ...@@ -932,21 +934,21 @@ void FlowControl::onPullDishes()
QString channelCode = channel["code"].toString(); QString channelCode = channel["code"].toString();
sendJson = DataManger::GetInstance().GetPullDishesData(channelCode); sendJson = DataManger::GetInstance().GetPullDishesData(channelCode);
emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在获取[%1]品信息......").arg(channelName)); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在获取[%1]品信息......").arg(channelName));
QLOG_INFO() << QString("[<<<<---PullDishes:Dishes %1 Begin--->>>>][requestData:%2]").arg(channelName)<<sendJson; QLOG_INFO() << QString("[<<<<---PullDishes:Dishes %1 Begin--->>>>][requestData:%2]").arg(channelName)<<sendJson;
result = m_pullDishesSocket->PostRequest(sendJson, recvJson, error); result = m_pullDishesSocket->PostRequest(sendJson, recvJson, error);
QLOG_INFO() << QString("[<<<<---PullDishes:Dishes Finish--->>>>][result:%1][msg:%2][recvData:%3]") QLOG_INFO() << QString("[<<<<---PullDishes:Dishes Finish--->>>>][result:%1][msg:%2][recvData:%3]")
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("获取[%1]品信息失败![网络超时]").arg(channelName)); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("获取[%1]品信息失败![网络超时]").arg(channelName));
break; break;
}else }else
{ {
if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt()) if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt())
{ {
//result = false; //result = false;
//emit showAlert(AlertForm::ERROR, QString("获取[%1]品信息失败![%2]").arg(channelName, recvJson[JSON_MESSAGE].toString())); //emit showAlert(AlertForm::ERROR, QString("获取[%1]品信息失败![%2]").arg(channelName, recvJson[JSON_MESSAGE].toString()));
//break; //break;
}else }else
{ {
...@@ -976,7 +978,7 @@ void FlowControl::onPullDishes() ...@@ -976,7 +978,7 @@ void FlowControl::onPullDishes()
emit iniDishesData(m_dishesMap); emit iniDishesData(m_dishesMap);
}else }else
{ {
emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("未获取到品信息!")); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("未获取到品信息!"));
} }
} }
} }
...@@ -991,7 +993,7 @@ void FlowControl::onUpdDishes(QString channelCode, QMap<QString, int> dishes) ...@@ -991,7 +993,7 @@ void FlowControl::onUpdDishes(QString channelCode, QMap<QString, int> dishes)
sendJson = DataManger::GetInstance().GetUpdDishesData(channelCode, dishes); sendJson = DataManger::GetInstance().GetUpdDishesData(channelCode, dishes);
emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在同步品销售状态......")); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在同步品销售状态......"));
QLOG_INFO() << QString("[<<<<---UpdDishes:Begin--->>>>][requestData:%1]")<<sendJson; QLOG_INFO() << QString("[<<<<---UpdDishes:Begin--->>>>][requestData:%1]")<<sendJson;
result = m_pullDishesSocket->PostRequest(sendJson, recvJson, error); result = m_pullDishesSocket->PostRequest(sendJson, recvJson, error);
...@@ -999,13 +1001,13 @@ void FlowControl::onUpdDishes(QString channelCode, QMap<QString, int> dishes) ...@@ -999,13 +1001,13 @@ void FlowControl::onUpdDishes(QString channelCode, QMap<QString, int> dishes)
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("同步品销售状态失败![网络错误]")); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("同步品销售状态失败![网络错误]"));
}else }else
{ {
if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt()) if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt())
{ {
result = false; result = false;
emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("同步品销售状态失败![%1]").arg(recvJson[JSON_MESSAGE].toString())); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("同步品销售状态失败![%1]").arg(recvJson[JSON_MESSAGE].toString()));
}else }else
{ {
emit hideAlert(); emit hideAlert();
......
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
<enum>Qt::NoFocus</enum> <enum>Qt::NoFocus</enum>
</property> </property>
<property name="text"> <property name="text">
<string>餐厅已打烊</string> <string>门店已打烊</string>
</property> </property>
<property name="reasonCode" stdset="0"> <property name="reasonCode" stdset="0">
<number>6</number> <number>6</number>
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
<enum>Qt::NoFocus</enum> <enum>Qt::NoFocus</enum>
</property> </property>
<property name="text"> <property name="text">
<string>已售完</string> <string>产品已售完</string>
</property> </property>
<property name="reasonCode" stdset="0"> <property name="reasonCode" stdset="0">
<number>1</number> <number>1</number>
...@@ -203,7 +203,7 @@ ...@@ -203,7 +203,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>品价格发生变动</string> <string>品价格发生变动</string>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -225,7 +225,7 @@ ...@@ -225,7 +225,7 @@
<enum>Qt::NoFocus</enum> <enum>Qt::NoFocus</enum>
</property> </property>
<property name="text"> <property name="text">
<string>餐厅太忙</string> <string>门店太忙</string>
</property> </property>
<property name="reasonCode" stdset="0"> <property name="reasonCode" stdset="0">
<number>2</number> <number>2</number>
......
...@@ -31,6 +31,7 @@ void DetailForm::InitData(OrderObject *orderObject) ...@@ -31,6 +31,7 @@ void DetailForm::InitData(OrderObject *orderObject)
ui->detailTable0->clearContents(); ui->detailTable0->clearContents();
ui->detailTable0->setRowCount(0); ui->detailTable0->setRowCount(0);
ui->detailBtn2->show(); ui->detailBtn2->show();
ui->detailBtn3->show(); ui->detailBtn3->show();
ui->detailBtn1->hide(); ui->detailBtn1->hide();
ui->detailBtn0->hide(); ui->detailBtn0->hide();
...@@ -76,6 +77,10 @@ void DetailForm::InitData(OrderObject *orderObject) ...@@ -76,6 +77,10 @@ void DetailForm::InitData(OrderObject *orderObject)
{ {
ui->detailBtn2->hide(); ui->detailBtn2->hide();
} }
//星巴克:如果订单是客诉单,不能显示退单按钮;
if(3 == orderObject->getOrderType()){
ui->detailBtn2->hide();
}
ui->detailBtn3->setText(GetOperNameByStatus(orderObject->orderStatus)); ui->detailBtn3->setText(GetOperNameByStatus(orderObject->orderStatus));
ui->detailBtn3->setProperty("operation", GetOperByStatus(orderObject->orderStatus)); ui->detailBtn3->setProperty("operation", GetOperByStatus(orderObject->orderStatus));
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</size> </size>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>品管理</string> <string>品管理</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<property name="leftMargin"> <property name="leftMargin">
......
...@@ -393,10 +393,12 @@ void MainForm::onChangeOrderStatus(OrderObject *orderObject, int oldStatus) ...@@ -393,10 +393,12 @@ void MainForm::onChangeOrderStatus(OrderObject *orderObject, int oldStatus)
QTableWidgetItem *item2 = new QTableWidgetItem(Penny2Dollar(orderObject->totalPrice)); QTableWidgetItem *item2 = new QTableWidgetItem(Penny2Dollar(orderObject->totalPrice));
item2->setTextAlignment(Qt::AlignCenter); item2->setTextAlignment(Qt::AlignCenter);
table->setItem(0, 2, item2); // 金额 table->setItem(0, 2, item2); // 金额
QTableWidgetItem *item3 = new QTableWidgetItem(orderObject->customerName); //QTableWidgetItem *item3 = new QTableWidgetItem(orderObject->customerName);
QTableWidgetItem *item3 = new QTableWidgetItem(orderObject->consigneeName);
item3->setTextAlignment(Qt::AlignCenter); item3->setTextAlignment(Qt::AlignCenter);
table->setItem(0, 3, item3); // 姓名 table->setItem(0, 3, item3); // 姓名
QTableWidgetItem *item4 = new QTableWidgetItem(orderObject->phone); //QTableWidgetItem *item4 = new QTableWidgetItem(orderObject->phone);
QTableWidgetItem *item4 = new QTableWidgetItem(orderObject->consigneePhone);
item4->setTextAlignment(Qt::AlignCenter); item4->setTextAlignment(Qt::AlignCenter);
table->setItem(0, 4, item4); // 联系方式 table->setItem(0, 4, item4); // 联系方式
QTableWidgetItem *item5 = new QTableWidgetItem(orderObject->createTime); QTableWidgetItem *item5 = new QTableWidgetItem(orderObject->createTime);
......
...@@ -492,7 +492,7 @@ ...@@ -492,7 +492,7 @@
<enum>Qt::NoFocus</enum> <enum>Qt::NoFocus</enum>
</property> </property>
<property name="text"> <property name="text">
<string>品管理</string> <string>品管理</string>
</property> </property>
</widget> </widget>
</item> </item>
......
...@@ -41,8 +41,8 @@ void refDishesForm::InitData(OrderObject *obj) ...@@ -41,8 +41,8 @@ void refDishesForm::InitData(OrderObject *obj)
QHBoxLayout *hLayout = new QHBoxLayout(pWdg); QHBoxLayout *hLayout = new QHBoxLayout(pWdg);
QPushButton * pBtn = new QPushButton(pWdg); QPushButton * pBtn = new QPushButton(pWdg);
pBtn->setFixedSize(250, 50); pBtn->setFixedSize(250, 50);
pBtn->setObjectName(product->id); pBtn->setObjectName(product->code);
pBtn->setProperty("id", product->id); pBtn->setProperty("code", product->code);
pBtn->setProperty("name",product->name); pBtn->setProperty("name",product->name);
pBtn->setProperty("qty",product->qty); pBtn->setProperty("qty",product->qty);
pBtn->setText(product->name); pBtn->setText(product->name);
...@@ -65,7 +65,7 @@ void refDishesForm::InitData(OrderObject *obj) ...@@ -65,7 +65,7 @@ void refDishesForm::InitData(OrderObject *obj)
connect(pBtn, &QPushButton::toggled, this, &refDishesForm::onDishesBtnToggled); connect(pBtn, &QPushButton::toggled, this, &refDishesForm::onDishesBtnToggled);
ui->refDishesTable->setCellWidget(0, 0, pWdg); // 商品名按钮 ui->refDishesTable->setCellWidget(0, 0, pWdg); // 商品名按钮
QTableWidgetItem *item0 = new QTableWidgetItem(product->id); QTableWidgetItem *item0 = new QTableWidgetItem(product->code);
//item0->setTextAlignment(Qt::AlignLeft|Qt::AlignTop); //item0->setTextAlignment(Qt::AlignLeft|Qt::AlignTop);
item0->setTextAlignment(Qt::AlignCenter); item0->setTextAlignment(Qt::AlignCenter);
item0->setFlags(Qt::NoItemFlags); item0->setFlags(Qt::NoItemFlags);
......
...@@ -45,8 +45,9 @@ void RefuseForm::on_reason1_toggled(bool checked) ...@@ -45,8 +45,9 @@ void RefuseForm::on_reason1_toggled(bool checked)
if(checked) if(checked)
{ {
m_refundDishesList.clear(); m_refundDishesList.clear();
m_refundDishesListString.clear();
ui->refuseBtnOk->setEnabled(true); ui->refuseBtnOk->setEnabled(true);
m_reasonStr=QString::fromLocal8Bit("餐厅已打烊"); m_reasonStr=QString::fromLocal8Bit("门店已打烊");
m_reasonCode=2; m_reasonCode=2;
} }
} }
...@@ -58,11 +59,12 @@ void RefuseForm::on_reason2_toggled(bool checked) ...@@ -58,11 +59,12 @@ void RefuseForm::on_reason2_toggled(bool checked)
if(m_orderObject!=NULL&&checked) if(m_orderObject!=NULL&&checked)
{ {
m_refundDishesList.clear(); m_refundDishesList.clear();
m_refundDishesListString.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_reasonStr=QString::fromLocal8Bit("品已售完"); m_reasonStr=QString::fromLocal8Bit("品已售完");
m_reasonCode=3; m_reasonCode=3;
QMap<QString,int>::iterator it; //遍历map QMap<QString,int>::iterator it; //遍历map
...@@ -82,8 +84,10 @@ void RefuseForm::on_reason2_toggled(bool checked) ...@@ -82,8 +84,10 @@ void RefuseForm::on_reason2_toggled(bool checked)
} }
if(checked) if(checked)
{ {
m_refundDishesList.clear();
m_refundDishesListString.clear();
ui->refuseBtnOk->setEnabled(true); ui->refuseBtnOk->setEnabled(true);
m_reasonStr=QString::fromLocal8Bit("品已售完"); m_reasonStr=QString::fromLocal8Bit("品已售完");
m_reasonCode=3; m_reasonCode=3;
} }
} }
...@@ -93,8 +97,9 @@ void RefuseForm::on_reason3_toggled(bool checked) ...@@ -93,8 +97,9 @@ void RefuseForm::on_reason3_toggled(bool checked)
if(checked) if(checked)
{ {
m_refundDishesList.clear(); m_refundDishesList.clear();
m_refundDishesListString.clear();
ui->refuseBtnOk->setEnabled(true); ui->refuseBtnOk->setEnabled(true);
m_reasonStr=QString::fromLocal8Bit("餐厅太忙"); m_reasonStr=QString::fromLocal8Bit("门店太忙");
m_reasonCode=5; m_reasonCode=5;
} }
} }
...@@ -104,6 +109,7 @@ void RefuseForm::on_reason4_toggled(bool checked) ...@@ -104,6 +109,7 @@ void RefuseForm::on_reason4_toggled(bool checked)
if(checked) if(checked)
{ {
m_refundDishesList.clear(); m_refundDishesList.clear();
m_refundDishesListString.clear();
ui->refuseBtnOk->setEnabled(true); ui->refuseBtnOk->setEnabled(true);
m_reasonStr=QString::fromLocal8Bit("联系不上客户"); m_reasonStr=QString::fromLocal8Bit("联系不上客户");
m_reasonCode=6; m_reasonCode=6;
...@@ -115,6 +121,7 @@ void RefuseForm::on_reason5_toggled(bool checked) ...@@ -115,6 +121,7 @@ void RefuseForm::on_reason5_toggled(bool checked)
if(checked) if(checked)
{ {
m_refundDishesList.clear(); m_refundDishesList.clear();
m_refundDishesListString.clear();
ui->refuseBtnOk->setEnabled(true); ui->refuseBtnOk->setEnabled(true);
m_reasonStr=QString::fromLocal8Bit("无人配送"); m_reasonStr=QString::fromLocal8Bit("无人配送");
m_reasonCode=-1; m_reasonCode=-1;
...@@ -124,6 +131,8 @@ void RefuseForm::on_reason5_toggled(bool checked) ...@@ -124,6 +131,8 @@ void RefuseForm::on_reason5_toggled(bool checked)
void RefuseForm::_Init() void RefuseForm::_Init()
{ {
qDebug() << __FUNCTION__; qDebug() << __FUNCTION__;
m_refundDishesList.clear();
m_refundDishesListString.clear();
ui->reasonNULL->toggle(); ui->reasonNULL->toggle();
ui->refuseBtnOk->setEnabled(false); ui->refuseBtnOk->setEnabled(false);
} }
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>餐厅已打烊</string> <string>门店已打烊</string>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>品已售完</string> <string>品已售完</string>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>餐厅太忙</string> <string>门店太忙</string>
</property> </property>
</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