|
@@ -1,5 +1,5 @@
|
1
|
1
|
import React, { useEffect, useState } from 'react'
|
2
|
|
-import { PageHeader, Descriptions, List, Steps, Row, Col, Rate, Button, Statistic, Modal, Typography, notification } from 'antd'
|
|
2
|
+import { PageHeader, Descriptions, List, Steps, Row, Col, Rate, Button, Statistic, Modal, Typography, Popconfirm, notification } from 'antd'
|
3
|
3
|
import { fetch, fetchList, apis } from '@/utils/request'
|
4
|
4
|
import router from 'umi/router'
|
5
|
5
|
import Prompt from '@/components/Prompt'
|
|
@@ -33,6 +33,7 @@ const getTicketDetail = fetch(apis.ticket.ticketEdit)
|
33
|
33
|
const addDispatch = fetch(apis.ticket.addRecord)
|
34
|
34
|
const rejectTicket = fetch(apis.ticket.updateTicketStatus)
|
35
|
35
|
const updateTicketPrice = fetch(apis.ticket.updateTicketPrice)
|
|
36
|
+const endTicket = fetch(apis.ticket.endTicket)
|
36
|
37
|
|
37
|
38
|
export default props => {
|
38
|
39
|
const [loading, setLoading] = useState(false)
|
|
@@ -84,6 +85,13 @@ export default props => {
|
84
|
85
|
})
|
85
|
86
|
}
|
86
|
87
|
|
|
88
|
+ const handleFinishTicket = () => {
|
|
89
|
+ endTicket({data: {ticketId: id}}).then(res => {
|
|
90
|
+ notification.success({message: '结单成功'})
|
|
91
|
+ router.go(-1)
|
|
92
|
+ })
|
|
93
|
+ }
|
|
94
|
+
|
87
|
95
|
useEffect(() => {
|
88
|
96
|
getTicketDetail({data: {id}}).then(res => {
|
89
|
97
|
const { recordList } = res || {}
|
|
@@ -99,6 +107,13 @@ export default props => {
|
99
|
107
|
subTitle="工单详情"
|
100
|
108
|
backIcon={false}
|
101
|
109
|
style={{ borderBottom: '1px solid rgb(235, 237, 240)' }}
|
|
110
|
+ extra={[
|
|
111
|
+ <Popconfirm title="确认结束当前工单?" onConfirm={handleFinishTicket}>
|
|
112
|
+ {
|
|
113
|
+ ticketData.status !== '5' && <Button type="primary">结束工单</Button>
|
|
114
|
+ }
|
|
115
|
+ </Popconfirm>
|
|
116
|
+ ]}
|
102
|
117
|
>
|
103
|
118
|
<div style={{display: 'flex'}}>
|
104
|
119
|
<div>
|