Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
on-site-service-admin-view
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
external
on-site-service-admin-view
Commits
e2135daf
Commit
e2135daf
authored
Jul 19, 2022
by
shangtx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 完成订单
parent
1f93a039
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
order.js
src/api/order.js
+9
-0
OrderDetail.vue
src/views/order/OrderDetail.vue
+18
-4
No files found.
src/api/order.js
View file @
e2135daf
...
...
@@ -65,6 +65,15 @@ export function reDispatchWorker(data) {
})
}
export
function
finishOrder
(
data
)
{
return
axios
({
url
:
`
${
BASE_URL
}
/finish`
,
method
:
'post'
,
useFullLoading
:
true
,
data
})
}
// 订单状态
export
const
STATUS
=
{
...
...
src/views/order/OrderDetail.vue
View file @
e2135daf
...
...
@@ -125,7 +125,7 @@
</template>
<
script
>
import
ImageUpload
from
'@/components/image-upload/ImageUpload'
import
{
getDetail
,
STATUS
}
from
'@/api/order'
import
{
getDetail
,
STATUS
,
finishOrder
}
from
'@/api/order'
import
SimpleLightbox
from
'simple-lightbox'
import
ChooseValuator
from
'./ChooseValuator'
import
SendPriceModal
from
'./SendPriceModal'
...
...
@@ -155,7 +155,6 @@ export default {
},
methods
:
{
show
(
id
)
{
console
.
info
(
'id'
,
id
)
this
.
id
=
id
this
.
visible
=
true
if
(
this
.
id
)
{
...
...
@@ -189,13 +188,28 @@ export default {
fetchData
()
{
getDetail
(
this
.
id
).
then
(({
data
})
=>
{
this
.
order
=
data
console
.
info
(
'data'
,
data
)
// 判断是否已过服务时间
this
.
past
=
dayjs
().
diff
(
data
.
expectArrivalTime
,
'day'
)
>
0
this
.
$nextTick
(()
=>
{
this
.
lightbox
=
new
SimpleLightbox
({
elements
:
'#order-images a'
})
})
})
},
finish
()
{}
finish
()
{
const
_this
=
this
this
.
$confirm
({
title
:
'提示'
,
content
:
'是否结束此订单'
,
onOk
()
{
finishOrder
({
id
:
_this
.
id
}).
then
(({
code
})
=>
{
if
(
code
==
200
)
{
_this
.
$message
.
success
(
'订单已完成'
)
_this
.
fetchData
()
}
})
}
})
}
},
mounted
()
{}
}
...
...
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