Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
takeout_sbk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yunpeng.song
takeout_sbk
Commits
c424f3f8
Commit
c424f3f8
authored
Jul 23, 2018
by
wuyang.zou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug;修复部分bug
parent
d48523f1
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
44 additions
and
26 deletions
+44
-26
fmTakeout/Control/flowControl.cpp
+10
-8
fmTakeout/RejectForm.ui
+4
-4
fmTakeout/detailForm.cpp
+5
-0
fmTakeout/dishesForm.ui
+1
-1
fmTakeout/mainForm.cpp
+4
-2
fmTakeout/mainForm.ui
+1
-1
fmTakeout/refdishesForm.cpp
+3
-3
fmTakeout/refuseForm.cpp
+13
-4
fmTakeout/refuseForm.ui
+3
-3
No files found.
fmTakeout/Control/flowControl.cpp
View file @
c424f3f8
...
...
@@ -231,8 +231,10 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject)
break
;
case
OrderObject
:
:
Sendout
:
case
OrderObject
:
:
Finished
:
break
;
case
OrderObject
:
:
RequestRefund
:
/***case:已配送订单、待配送订单、完成订单、请求退单:***/
// 星巴克:当客户同意退款时,外卖插件收到请求退款后,直接进行退款处理;
_RefundOrder
(
orderObject
->
id
,
-
1
,
QString
::
fromLocal8Bit
(
"同意退款"
),
QString
());
break
;
case
OrderObject
:
:
AgreeRefund
:
break
;
...
...
@@ -932,21 +934,21 @@ void FlowControl::onPullDishes()
QString
channelCode
=
channel
[
"code"
].
toString
();
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
;
result
=
m_pullDishesSocket
->
PostRequest
(
sendJson
,
recvJson
,
error
);
QLOG_INFO
()
<<
QString
(
"[<<<<---PullDishes:Dishes Finish--->>>>][result:%1][msg:%2][recvData:%3]"
)
.
arg
(
result
).
arg
(
error
)
<<
recvJson
;
if
(
!
result
)
{
emit
showAlert
(
AlertForm
::
MSGERROR
,
QString
::
fromLocal8Bit
(
"获取[%1]
菜
品信息失败![网络超时]"
).
arg
(
channelName
));
emit
showAlert
(
AlertForm
::
MSGERROR
,
QString
::
fromLocal8Bit
(
"获取[%1]
产
品信息失败![网络超时]"
).
arg
(
channelName
));
break
;
}
else
{
if
(
JSON_STATUSCODE_OK
!=
recvJson
[
JSON_STATUSCODE
].
toInt
())
{
//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;
}
else
{
...
...
@@ -976,7 +978,7 @@ void FlowControl::onPullDishes()
emit
iniDishesData
(
m_dishesMap
);
}
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)
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
;
result
=
m_pullDishesSocket
->
PostRequest
(
sendJson
,
recvJson
,
error
);
...
...
@@ -999,13 +1001,13 @@ void FlowControl::onUpdDishes(QString channelCode, QMap<QString, int> dishes)
.
arg
(
result
).
arg
(
error
)
<<
recvJson
;
if
(
!
result
)
{
emit
showAlert
(
AlertForm
::
MSGERROR
,
QString
::
fromLocal8Bit
(
"同步
菜
品销售状态失败![网络错误]"
));
emit
showAlert
(
AlertForm
::
MSGERROR
,
QString
::
fromLocal8Bit
(
"同步
产
品销售状态失败![网络错误]"
));
}
else
{
if
(
JSON_STATUSCODE_OK
!=
recvJson
[
JSON_STATUSCODE
].
toInt
())
{
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
{
emit
hideAlert
();
...
...
fmTakeout/RejectForm.ui
View file @
c424f3f8
...
...
@@ -137,7 +137,7 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>
餐厅
已打烊</string>
<string>
门店
已打烊</string>
</property>
<property name="reasonCode" stdset="0">
<number>6</number>
...
...
@@ -162,7 +162,7 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>已售完</string>
<string>
产品
已售完</string>
</property>
<property name="reasonCode" stdset="0">
<number>1</number>
...
...
@@ -203,7 +203,7 @@
</font>
</property>
<property name="text">
<string>
菜
品价格发生变动</string>
<string>
产
品价格发生变动</string>
</property>
</widget>
</item>
...
...
@@ -225,7 +225,7 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>
餐厅
太忙</string>
<string>
门店
太忙</string>
</property>
<property name="reasonCode" stdset="0">
<number>2</number>
...
...
fmTakeout/detailForm.cpp
View file @
c424f3f8
...
...
@@ -31,6 +31,7 @@ void DetailForm::InitData(OrderObject *orderObject)
ui
->
detailTable0
->
clearContents
();
ui
->
detailTable0
->
setRowCount
(
0
);
ui
->
detailBtn2
->
show
();
ui
->
detailBtn3
->
show
();
ui
->
detailBtn1
->
hide
();
ui
->
detailBtn0
->
hide
();
...
...
@@ -76,6 +77,10 @@ void DetailForm::InitData(OrderObject *orderObject)
{
ui
->
detailBtn2
->
hide
();
}
//星巴克:如果订单是客诉单,不能显示退单按钮;
if
(
3
==
orderObject
->
getOrderType
()){
ui
->
detailBtn2
->
hide
();
}
ui
->
detailBtn3
->
setText
(
GetOperNameByStatus
(
orderObject
->
orderStatus
));
ui
->
detailBtn3
->
setProperty
(
"operation"
,
GetOperByStatus
(
orderObject
->
orderStatus
));
...
...
fmTakeout/dishesForm.ui
View file @
c424f3f8
...
...
@@ -17,7 +17,7 @@
</size>
</property>
<property name="windowTitle">
<string>
菜
品管理</string>
<string>
产
品管理</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
...
...
fmTakeout/mainForm.cpp
View file @
c424f3f8
...
...
@@ -393,10 +393,12 @@ void MainForm::onChangeOrderStatus(OrderObject *orderObject, int oldStatus)
QTableWidgetItem
*
item2
=
new
QTableWidgetItem
(
Penny2Dollar
(
orderObject
->
totalPrice
));
item2
->
setTextAlignment
(
Qt
::
AlignCenter
);
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
);
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
);
table
->
setItem
(
0
,
4
,
item4
);
// 联系方式
QTableWidgetItem
*
item5
=
new
QTableWidgetItem
(
orderObject
->
createTime
);
...
...
fmTakeout/mainForm.ui
View file @
c424f3f8
...
...
@@ -492,7 +492,7 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>
菜
品管理</string>
<string>
产
品管理</string>
</property>
</widget>
</item>
...
...
fmTakeout/refdishesForm.cpp
View file @
c424f3f8
...
...
@@ -41,8 +41,8 @@ void refDishesForm::InitData(OrderObject *obj)
QHBoxLayout
*
hLayout
=
new
QHBoxLayout
(
pWdg
);
QPushButton
*
pBtn
=
new
QPushButton
(
pWdg
);
pBtn
->
setFixedSize
(
250
,
50
);
pBtn
->
setObjectName
(
product
->
id
);
pBtn
->
setProperty
(
"
id"
,
product
->
id
);
pBtn
->
setObjectName
(
product
->
code
);
pBtn
->
setProperty
(
"
code"
,
product
->
code
);
pBtn
->
setProperty
(
"name"
,
product
->
name
);
pBtn
->
setProperty
(
"qty"
,
product
->
qty
);
pBtn
->
setText
(
product
->
name
);
...
...
@@ -65,7 +65,7 @@ void refDishesForm::InitData(OrderObject *obj)
connect
(
pBtn
,
&
QPushButton
::
toggled
,
this
,
&
refDishesForm
::
onDishesBtnToggled
);
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
::
AlignCenter
);
item0
->
setFlags
(
Qt
::
NoItemFlags
);
...
...
fmTakeout/refuseForm.cpp
View file @
c424f3f8
...
...
@@ -45,8 +45,9 @@ void RefuseForm::on_reason1_toggled(bool checked)
if
(
checked
)
{
m_refundDishesList
.
clear
();
m_refundDishesListString
.
clear
();
ui
->
refuseBtnOk
->
setEnabled
(
true
);
m_reasonStr
=
QString
::
fromLocal8Bit
(
"
餐厅
已打烊"
);
m_reasonStr
=
QString
::
fromLocal8Bit
(
"
门店
已打烊"
);
m_reasonCode
=
2
;
}
}
...
...
@@ -58,11 +59,12 @@ void RefuseForm::on_reason2_toggled(bool checked)
if
(
m_orderObject
!=
NULL
&&
checked
)
{
m_refundDishesList
.
clear
();
m_refundDishesListString
.
clear
();
m_refDishesForm
->
InitData
(
m_orderObject
);
if
(
QDialog
::
Accepted
==
m_refDishesForm
->
exec
())
{
ui
->
refuseBtnOk
->
setEnabled
(
true
);
m_reasonStr
=
QString
::
fromLocal8Bit
(
"
菜
品已售完"
);
m_reasonStr
=
QString
::
fromLocal8Bit
(
"
产
品已售完"
);
m_reasonCode
=
3
;
QMap
<
QString
,
int
>::
iterator
it
;
//遍历map
...
...
@@ -82,8 +84,10 @@ void RefuseForm::on_reason2_toggled(bool checked)
}
if
(
checked
)
{
m_refundDishesList
.
clear
();
m_refundDishesListString
.
clear
();
ui
->
refuseBtnOk
->
setEnabled
(
true
);
m_reasonStr
=
QString
::
fromLocal8Bit
(
"
菜
品已售完"
);
m_reasonStr
=
QString
::
fromLocal8Bit
(
"
产
品已售完"
);
m_reasonCode
=
3
;
}
}
...
...
@@ -93,8 +97,9 @@ void RefuseForm::on_reason3_toggled(bool checked)
if
(
checked
)
{
m_refundDishesList
.
clear
();
m_refundDishesListString
.
clear
();
ui
->
refuseBtnOk
->
setEnabled
(
true
);
m_reasonStr
=
QString
::
fromLocal8Bit
(
"
餐厅
太忙"
);
m_reasonStr
=
QString
::
fromLocal8Bit
(
"
门店
太忙"
);
m_reasonCode
=
5
;
}
}
...
...
@@ -104,6 +109,7 @@ void RefuseForm::on_reason4_toggled(bool checked)
if
(
checked
)
{
m_refundDishesList
.
clear
();
m_refundDishesListString
.
clear
();
ui
->
refuseBtnOk
->
setEnabled
(
true
);
m_reasonStr
=
QString
::
fromLocal8Bit
(
"联系不上客户"
);
m_reasonCode
=
6
;
...
...
@@ -115,6 +121,7 @@ void RefuseForm::on_reason5_toggled(bool checked)
if
(
checked
)
{
m_refundDishesList
.
clear
();
m_refundDishesListString
.
clear
();
ui
->
refuseBtnOk
->
setEnabled
(
true
);
m_reasonStr
=
QString
::
fromLocal8Bit
(
"无人配送"
);
m_reasonCode
=-
1
;
...
...
@@ -124,6 +131,8 @@ void RefuseForm::on_reason5_toggled(bool checked)
void
RefuseForm
::
_Init
()
{
qDebug
()
<<
__FUNCTION__
;
m_refundDishesList
.
clear
();
m_refundDishesListString
.
clear
();
ui
->
reasonNULL
->
toggle
();
ui
->
refuseBtnOk
->
setEnabled
(
false
);
}
fmTakeout/refuseForm.ui
View file @
c424f3f8
...
...
@@ -93,7 +93,7 @@
</font>
</property>
<property name="text">
<string>
餐厅
已打烊</string>
<string>
门店
已打烊</string>
</property>
</widget>
</item>
...
...
@@ -112,7 +112,7 @@
</font>
</property>
<property name="text">
<string>
菜
品已售完</string>
<string>
产
品已售完</string>
</property>
</widget>
</item>
...
...
@@ -131,7 +131,7 @@
</font>
</property>
<property name="text">
<string>
餐厅
太忙</string>
<string>
门店
太忙</string>
</property>
</widget>
</item>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment