Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
supplier
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
王宇航
supplier
Commits
f598e606
Commit
f598e606
authored
Jun 05, 2020
by
Wyh
Committed by
宁斌
Jun 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
6.05 自取製作完成
parent
7db7fc6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
44 deletions
+52
-44
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/model/viewModel/PageViewModel.kt
+52
-44
No files found.
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/model/viewModel/PageViewModel.kt
View file @
f598e606
...
@@ -320,8 +320,10 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
...
@@ -320,8 +320,10 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
else
->
2
else
->
2
}
}
// if (data.order_type == 2) {
// if (data.order_type == 2) {
// 是外賣
// 是外賣
if
(
status
==
3
)
{
if
(
status
==
3
)
{
//指派送貨,自取是製作完成
if
(
data
.
order_type
==
2
)
{
if
(
orderDetails
.
data
!!
[
0
].
isDelete
!=
0
)
{
if
(
orderDetails
.
data
!!
[
0
].
isDelete
!=
0
)
{
if
(
deliveryBean
!=
null
&&
deliveryBean
!!
.
data
.
isNotEmpty
())
{
if
(
deliveryBean
!=
null
&&
deliveryBean
!!
.
data
.
isNotEmpty
())
{
selectorDelivery
(
listener
,
context
,
data
,
status
,
isPush
)
selectorDelivery
(
listener
,
context
,
data
,
status
,
isPush
)
...
@@ -332,54 +334,60 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
...
@@ -332,54 +334,60 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
//第三方的單,執行重印功能
//第三方的單,執行重印功能
printOrder
(
orderDetails
,
data
,
context
,
listener
)
printOrder
(
orderDetails
,
data
,
context
,
listener
)
}
}
}
else
if
(
status
==
4
)
{
}
else
{
//結賬,彈窗確認是否結賬
//自取
if
(
orderDetails
.
data
!!
[
0
].
isDelete
==
0
)
{
repository
.
gsUpdateOrderStatus
(
data
.
Id
.
toString
(),
status
,
data
.
order_type
,
1
,
""
,
""
,
""
,
"0"
,
""
,
1
,
0
).
apply
{
//第三方物流單,沒有結賬,重印
listener
.
invoke
(
code
==
"1"
)
printOrder
(
orderDetails
,
data
,
context
,
listener
)
}
}
else
{
}
object
:
DialogUtils
(
context
,
R
.
layout
.
other_order_pause_orders
)
{
}
else
if
(
status
==
4
)
{
override
fun
initLayout
(
hepler
:
ViewHepler
,
dialog
:
Dialog
)
{
//結賬,彈窗確認是否結賬
hepler
.
setText
(
R
.
id
.
tv_warning_title
,
"是否確認結賬?"
)
if
(
orderDetails
.
data
!!
[
0
].
isDelete
==
0
)
{
hepler
.
getView
<
TextView
>(
R
.
id
.
tv_dialog_confirm
).
setOnClickListener
{
//第三方物流單,沒有結賬,重印
dialog
.
dismiss
()
printOrder
(
orderDetails
,
data
,
context
,
listener
)
launch
({
}
else
{
// updateOrderStatus(data.Id.toString(), "", status, "", "", isPush, data.order_type).apply {
object
:
DialogUtils
(
context
,
R
.
layout
.
other_order_pause_orders
)
{
override
fun
initLayout
(
hepler
:
ViewHepler
,
dialog
:
Dialog
)
{
hepler
.
setText
(
R
.
id
.
tv_warning_title
,
"是否確認結賬?"
)
hepler
.
getView
<
TextView
>(
R
.
id
.
tv_dialog_confirm
).
setOnClickListener
{
dialog
.
dismiss
()
launch
({
// updateOrderStatus(data.Id.toString(), "", status, "", "", isPush, data.order_type).apply {
// listener.invoke(success)
// listener.invoke(success)
// }
// }
repository
.
gsUpdateOrderStatus
(
data
.
Id
.
toString
(),
status
,
data
.
order_type
,
3
,
""
,
""
,
""
,
"0"
,
""
,
1
,
0
).
apply
{
repository
.
gsUpdateOrderStatus
(
data
.
Id
.
toString
(),
status
,
data
.
order_type
,
3
,
""
,
""
,
""
,
"0"
,
""
,
1
,
0
).
apply
{
listener
.
invoke
(
code
==
"1"
)
listener
.
invoke
(
code
==
"1"
)
}
}
},
{
},
{
})
})
}
hepler
.
getView
<
TextView
>(
R
.
id
.
tv_dialog_cancel
).
setOnClickListener
{
dialog
.
dismiss
()
listener
.
invoke
(
false
)
}
}
}
}.
createDialogView
().
show
()
hepler
.
getView
<
TextView
>(
R
.
id
.
tv_dialog_cancel
).
setOnClickListener
{
}
dialog
.
dismiss
()
}
else
{
listener
.
invoke
(
false
)
showLoading
(
context
)
// 確認訂單
var
third
=
false
if
(
deliveryConfig
!=
null
)
{
for
(
i
in
0
until
deliveryConfig
!!
.
data
.
list
.
size
)
{
if
(
deliveryConfig
!!
.
data
.
list
[
i
].
distributionType
==
data
.
deliveryMode
)
{
third
=
deliveryConfig
!!
.
data
.
list
[
i
].
type
==
1
break
}
}
}
}
}.
createDialogView
().
show
()
}
}
else
{
showLoading
(
context
)
// 確認訂單
var
third
=
false
if
(
deliveryConfig
!=
null
)
{
for
(
i
in
0
until
deliveryConfig
!!
.
data
.
list
.
size
)
{
if
(
deliveryConfig
!!
.
data
.
list
[
i
].
distributionType
==
data
.
deliveryMode
)
{
third
=
deliveryConfig
!!
.
data
.
list
[
i
].
type
==
1
break
}
}
}
if
(
third
)
{
// 如果是第三方物流,調用第三方接口
thirdSend
(
data
,
orderDetails
,
status
,
isPush
,
data
.
order_type
,
context
,
listener
)
}
else
{
updateOrderAndPrint
(
data
,
status
,
isPush
,
orderDetails
,
context
,
listener
)
}
}
}
if
(
third
)
{
// 如果是第三方物流,調用第三方接口
thirdSend
(
data
,
orderDetails
,
status
,
isPush
,
data
.
order_type
,
context
,
listener
)
}
else
{
updateOrderAndPrint
(
data
,
status
,
isPush
,
orderDetails
,
context
,
listener
)
}
}
// } else {
// } else {
// // 自取的確認訂單
// // 自取的確認訂單
// repository.updateSelfOrderStatus(data.Id.toString(), status.toString(), GsaCloudApplication.getRestaurantId(context).toString()).apply {
// repository.updateSelfOrderStatus(data.Id.toString(), status.toString(), GsaCloudApplication.getRestaurantId(context).toString()).apply {
...
@@ -599,12 +607,12 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
...
@@ -599,12 +607,12 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
})
})
}
}
fun
getCancelReason
(
restaurantId
:
String
,
type
:
String
){
fun
getCancelReason
(
restaurantId
:
String
,
type
:
String
)
{
launch
({
launch
({
repository
.
getCancelReason
(
restaurantId
,
type
).
apply
{
repository
.
getCancelReason
(
restaurantId
,
type
).
apply
{
}
}
},{
},
{
})
})
}
}
...
...
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