vue2-client 1.2.6 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/package.json +89 -89
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +39 -14
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +225 -26
- package/src/base-client/components/common/XForm/XFormItem.vue +51 -5
- package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +2 -3
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +2 -2
- package/src/config/CreateQueryConfig.js +40 -0
- package/src/config/default/setting.config.js +1 -0
- package/src/pages/login/Login.vue +8 -4
- package/src/pages/system/ticket/index.vue +427 -0
- package/src/pages/system/ticket/submitTicketSuccess.vue +249 -0
- package/src/router/async/config.async.js +1 -0
- package/src/router/async/router.map.js +59 -57
- package/src/services/api/EmployeeDetailsViewApi.js +0 -4
- package/src/utils/util.js +34 -4
- package/vue.config.js +0 -10
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<!-- 显示成功页抽屉 -->
|
|
4
|
+
<submit-ticket-success
|
|
5
|
+
:visible.sync="successVisible"
|
|
6
|
+
:serialNumber="serialNumber"
|
|
7
|
+
:category-str="categoryStr"
|
|
8
|
+
v-if="serialNumber"
|
|
9
|
+
/>
|
|
10
|
+
<!-- 两个使用手册弹框 -->
|
|
11
|
+
<a-modal
|
|
12
|
+
title="向日葵使用指南"
|
|
13
|
+
:visible="sunClientManualVisible"
|
|
14
|
+
@ok="sunClientManualVisible = false"
|
|
15
|
+
@cancel="sunClientManualVisible = false"
|
|
16
|
+
width="1000px"
|
|
17
|
+
>
|
|
18
|
+
<h1>一、安装</h1>
|
|
19
|
+
<hr/>
|
|
20
|
+
<div style="padding-left: 100px;padding-top: 20px">
|
|
21
|
+
<img src="@vue2-client/assets/img/SunClientManual/1.png" style="width: 800px">
|
|
22
|
+
<br/>
|
|
23
|
+
<br/>
|
|
24
|
+
<p style="line-height: 30px;font-size: 1.5em;text-indent: 2em">运行下载好的安装包,按需要手动选择安装路径后,一路点下一步完成安装</p>
|
|
25
|
+
<br/>
|
|
26
|
+
<br/>
|
|
27
|
+
</div>
|
|
28
|
+
<h1>二、运行</h1>
|
|
29
|
+
<hr/>
|
|
30
|
+
<div style="padding-left: 100px;padding-top: 20px">
|
|
31
|
+
<p style="line-height: 30px;font-size: 1.5em;text-indent: 2em">在桌面或开始菜单中打开向日葵软件</p>
|
|
32
|
+
<img src="@vue2-client/assets/img/SunClientManual/2.png" style="width: 800px">
|
|
33
|
+
<br/>
|
|
34
|
+
<br/>
|
|
35
|
+
<p style="line-height: 30px;font-size: 1.5em;text-indent: 2em">显示此页面时,您已成功运行向日葵</p>
|
|
36
|
+
<br/>
|
|
37
|
+
<br/>
|
|
38
|
+
</div>
|
|
39
|
+
<h1>三、截图</h1>
|
|
40
|
+
<hr/>
|
|
41
|
+
<div style="padding-left: 100px;padding-top: 20px">
|
|
42
|
+
<p style="line-height: 30px;font-size: 1.5em;text-indent: 2em">点击软件界面中眼睛样子的按钮,使验证码正常显示</p>
|
|
43
|
+
<br/>
|
|
44
|
+
<br/>
|
|
45
|
+
<img src="@vue2-client/assets/img/SunClientManual/3.png" style="width: 800px">
|
|
46
|
+
<br/>
|
|
47
|
+
<br/>
|
|
48
|
+
<br/>
|
|
49
|
+
<p style="line-height: 30px;font-size: 1.5em;text-indent: 2em">
|
|
50
|
+
使用qq,微信,或者任何截图软件。截取屏幕中 “本机识别码” 和 “本机验证码”。
|
|
51
|
+
确保该值清晰可辨别
|
|
52
|
+
</p>
|
|
53
|
+
<br/>
|
|
54
|
+
<br/>
|
|
55
|
+
<img src="@vue2-client/assets/img/SunClientManual/4.png" style="width: 800px">
|
|
56
|
+
<br/>
|
|
57
|
+
<br/>
|
|
58
|
+
<p style="line-height: 30px;font-size: 1.5em;text-indent: 2em">
|
|
59
|
+
将您截好的图片,通过表单提交页面,下方 “+” (加号)的按钮,提交给我们。
|
|
60
|
+
这样我们的工作人员就可以远程协助您,排查、解决问题
|
|
61
|
+
</p>
|
|
62
|
+
<br/>
|
|
63
|
+
<br/>
|
|
64
|
+
</div>
|
|
65
|
+
</a-modal>
|
|
66
|
+
<a-modal
|
|
67
|
+
title="ToDesk使用指南"
|
|
68
|
+
:visible="toDeskManualVisible"
|
|
69
|
+
@ok="toDeskManualVisible = false"
|
|
70
|
+
@cancel="toDeskManualVisible = false"
|
|
71
|
+
width="1000px"
|
|
72
|
+
>
|
|
73
|
+
<h1>一、安装</h1>
|
|
74
|
+
<hr/>
|
|
75
|
+
<div style="padding-left: 100px;padding-top: 20px">
|
|
76
|
+
<img src="@vue2-client/assets/img/ToDeskManual/1.png" style="width: 800px">
|
|
77
|
+
<br/>
|
|
78
|
+
<br/>
|
|
79
|
+
<p style="line-height: 30px;font-size: 1.5em;text-indent: 2em">运行下载好的安装包,按需要手动选择安装路径后,一路点下一步完成安装</p>
|
|
80
|
+
<br/>
|
|
81
|
+
<br/>
|
|
82
|
+
</div>
|
|
83
|
+
<h1>二、运行</h1>
|
|
84
|
+
<hr/>
|
|
85
|
+
<div style="padding-left: 100px;padding-top: 20px">
|
|
86
|
+
<p style="line-height: 30px;font-size: 1.5em;text-indent: 2em">在桌面或开始菜单中打开ToDesk软件</p>
|
|
87
|
+
<img src="@vue2-client/assets/img/ToDeskManual/2.png" style="width: 800px">
|
|
88
|
+
<br/>
|
|
89
|
+
<br/>
|
|
90
|
+
<p style="line-height: 30px;font-size: 1.5em;text-indent: 2em">显示此页面时,您已成功运行ToDesk</p>
|
|
91
|
+
<br/>
|
|
92
|
+
<br/>
|
|
93
|
+
</div>
|
|
94
|
+
<h1>三、截图</h1>
|
|
95
|
+
<hr/>
|
|
96
|
+
<div style="padding-left: 100px;padding-top: 20px">
|
|
97
|
+
<p style="line-height: 30px;font-size: 1.5em;text-indent: 2em">点击软件界面中眼睛样子的按钮,使临时密码正常显示</p>
|
|
98
|
+
<br/>
|
|
99
|
+
<br/>
|
|
100
|
+
<img src="@vue2-client/assets/img/ToDeskManual/3.png" style="width: 800px">
|
|
101
|
+
<br/>
|
|
102
|
+
<br/>
|
|
103
|
+
<br/>
|
|
104
|
+
<p style="line-height: 30px;font-size: 1.5em;text-indent: 2em">
|
|
105
|
+
使用qq,微信,或者任何截图软件。截取屏幕中 “设备代码” 和 “临时密码”。
|
|
106
|
+
确保该值清晰可辨别
|
|
107
|
+
</p>
|
|
108
|
+
<br/>
|
|
109
|
+
<br/>
|
|
110
|
+
<img src="@vue2-client/assets/img/ToDeskManual/4.png" style="width: 800px">
|
|
111
|
+
<br/>
|
|
112
|
+
<br/>
|
|
113
|
+
<p style="line-height: 30px;font-size: 1.5em;text-indent: 2em">
|
|
114
|
+
将您截好的图片,通过表单提交页面,下方 “+” (加号)的按钮,提交给我们。
|
|
115
|
+
这样我们的工作人员就可以远程协助您,排查、解决问题
|
|
116
|
+
</p>
|
|
117
|
+
<br/>
|
|
118
|
+
<br/>
|
|
119
|
+
</div>
|
|
120
|
+
</a-modal>
|
|
121
|
+
<a-card>
|
|
122
|
+
<div style="text-align: right">
|
|
123
|
+
<p>欢迎您:{{ currUser.name }},<a @click="logout">退出登录</a></p>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="submitTicketTitle">
|
|
126
|
+
<span>奥枫问题反馈平台</span>
|
|
127
|
+
</div>
|
|
128
|
+
<a-tabs>
|
|
129
|
+
<a-tab-pane :key="1" tab="工单提交">
|
|
130
|
+
<!-- 表格主体 -->
|
|
131
|
+
<a-row>
|
|
132
|
+
<a-col :span="18">
|
|
133
|
+
<a-form :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }">
|
|
134
|
+
<!-- 问题类型单选框 -->
|
|
135
|
+
<a-form-item label="问题类型">
|
|
136
|
+
<a-radio-group v-model="form.category" v-for="(item,index) in $appdata.getDictionaryList('ticketCategoryMap')" :key="index">
|
|
137
|
+
<a-radio :value="item.value" class="radio-item">
|
|
138
|
+
{{ item.label }}
|
|
139
|
+
</a-radio>
|
|
140
|
+
</a-radio-group>
|
|
141
|
+
<br/>
|
|
142
|
+
<strong v-show="showCategoryAlert" style="color: red">类型不允许为空!</strong>
|
|
143
|
+
</a-form-item>
|
|
144
|
+
<!-- 问题描述框 -->
|
|
145
|
+
<a-form-item label="问题详情描述">
|
|
146
|
+
<a-textarea allow-clear v-model="form.desc" placeholder="请用一句话描述您的问题,必要时请注明客户编号,表号,系统功能项等信息"/>
|
|
147
|
+
</a-form-item>
|
|
148
|
+
<!-- 图片上传 -->
|
|
149
|
+
<a-form-item :wrapper-col="{ span: 12 }" label="问题截图">
|
|
150
|
+
<div class="clearfix">
|
|
151
|
+
<a-upload
|
|
152
|
+
name="avatar"
|
|
153
|
+
list-type="picture-card"
|
|
154
|
+
:before-upload="beforeUpload"
|
|
155
|
+
action="/webmeteruploadapi/upload"
|
|
156
|
+
:file-list="fileList"
|
|
157
|
+
@preview="handlePreview"
|
|
158
|
+
@change="handleChange"
|
|
159
|
+
:remove="remove"
|
|
160
|
+
>
|
|
161
|
+
<div v-if="fileList.length < 5">
|
|
162
|
+
<a-icon type="plus" />
|
|
163
|
+
<div class="ant-upload-text">点击上传</div>
|
|
164
|
+
</div>
|
|
165
|
+
</a-upload>
|
|
166
|
+
<a-modal
|
|
167
|
+
:visible="previewVisible"
|
|
168
|
+
:footer="null"
|
|
169
|
+
@cancel="handleCancel"
|
|
170
|
+
>
|
|
171
|
+
<img style="width: 100%" :src="previewImage" alt="图片上传"/>
|
|
172
|
+
</a-modal>
|
|
173
|
+
</div>
|
|
174
|
+
</a-form-item>
|
|
175
|
+
<!-- 表单底部按钮 -->
|
|
176
|
+
<a-form-item :wrapper-col="{ span: 12, offset: 5 }">
|
|
177
|
+
<a-button type="primary" @click="onSubmit" style="margin-right: 20px" :disabled="showCategoryAlert">
|
|
178
|
+
提交
|
|
179
|
+
</a-button>
|
|
180
|
+
</a-form-item>
|
|
181
|
+
</a-form>
|
|
182
|
+
</a-col>
|
|
183
|
+
<a-col :span="6">
|
|
184
|
+
<a-card title="远程方式快捷下载">
|
|
185
|
+
<a-space direction="vertical">
|
|
186
|
+
<a-row :gutter="16">
|
|
187
|
+
<a-col
|
|
188
|
+
:lg="24"
|
|
189
|
+
:md="24"
|
|
190
|
+
:sm="24"
|
|
191
|
+
:xl="12"
|
|
192
|
+
:xs="24"
|
|
193
|
+
:xxl="12">
|
|
194
|
+
<img @click="toSunClientClick" style="width: 128px;height:128px;cursor: pointer" src="@vue2-client/assets/img/SunClientDownload.png"/>
|
|
195
|
+
<p style="padding-top:10px;text-align: center"><a @click="sunClientManualVisible = true">向日葵使用说明</a></p>
|
|
196
|
+
</a-col>
|
|
197
|
+
<a-col
|
|
198
|
+
:lg="24"
|
|
199
|
+
:md="24"
|
|
200
|
+
:sm="24"
|
|
201
|
+
:xl="12"
|
|
202
|
+
:xs="24"
|
|
203
|
+
:xxl="12">
|
|
204
|
+
<img @click="toDeskClick" style="width: 128px;height:128px;cursor: pointer" src="@vue2-client/assets/img/ToDeskDownload.png">
|
|
205
|
+
<p style="padding-top:10px;text-align: center"><a @click="toDeskManualVisible = true">ToDesk使用说明</a></p>
|
|
206
|
+
</a-col>
|
|
207
|
+
</a-row>
|
|
208
|
+
</a-space>
|
|
209
|
+
</a-card>
|
|
210
|
+
</a-col>
|
|
211
|
+
</a-row>
|
|
212
|
+
</a-tab-pane>
|
|
213
|
+
<a-tab-pane :key="2" tab="历史工单">
|
|
214
|
+
<!-- 查询表单 -->
|
|
215
|
+
<x-form-table
|
|
216
|
+
title="已提交工单"
|
|
217
|
+
:queryParamsName="queryParamsName"
|
|
218
|
+
:fixed-query-form="fixedQueryForm"
|
|
219
|
+
@action="toDetail">
|
|
220
|
+
</x-form-table>
|
|
221
|
+
</a-tab-pane>
|
|
222
|
+
</a-tabs>
|
|
223
|
+
</a-card>
|
|
224
|
+
</div>
|
|
225
|
+
</template>
|
|
226
|
+
|
|
227
|
+
<script>
|
|
228
|
+
import { post } from '@vue2-client/services/api/restTools'
|
|
229
|
+
import { TicketDetailsViewApi } from '@vue2-client/services/api/TicketDetailsViewApi'
|
|
230
|
+
import { logout } from '@/services/user'
|
|
231
|
+
import { mapState } from 'vuex'
|
|
232
|
+
|
|
233
|
+
export default {
|
|
234
|
+
name: 'submitTicket',
|
|
235
|
+
data () {
|
|
236
|
+
return {
|
|
237
|
+
// 查询配置文件名
|
|
238
|
+
queryParamsName: 'TicketQueryForCustomer',
|
|
239
|
+
// 控制成功页面显示
|
|
240
|
+
successVisible: false,
|
|
241
|
+
// 控制预览显示
|
|
242
|
+
previewVisible: false,
|
|
243
|
+
// 图片真实地址
|
|
244
|
+
previewImage: '',
|
|
245
|
+
// 图片列表
|
|
246
|
+
fileList: [],
|
|
247
|
+
// 表单数据
|
|
248
|
+
form: {
|
|
249
|
+
name: '',
|
|
250
|
+
category: undefined,
|
|
251
|
+
desc: ''
|
|
252
|
+
},
|
|
253
|
+
// 获取序列号使用
|
|
254
|
+
data: {
|
|
255
|
+
priority: 2,
|
|
256
|
+
category: 0,
|
|
257
|
+
time: this.dataFormat(new Date())
|
|
258
|
+
},
|
|
259
|
+
// 工单序列号
|
|
260
|
+
serialNumber: '',
|
|
261
|
+
// 类别未填写警告信息控制
|
|
262
|
+
showCategoryAlert: true,
|
|
263
|
+
// 向日葵使用指南可见性
|
|
264
|
+
sunClientManualVisible: false,
|
|
265
|
+
// 向日葵使用指南可见性
|
|
266
|
+
toDeskManualVisible: false,
|
|
267
|
+
// 为工单查询指定条件
|
|
268
|
+
fixedQueryForm: {},
|
|
269
|
+
// 工单类型在字典中显示的文字值
|
|
270
|
+
categoryStr: '',
|
|
271
|
+
// 当前登陆用户手机号
|
|
272
|
+
phoneNumber: ''
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
mounted () {
|
|
276
|
+
this.getCurrentUserPhone()
|
|
277
|
+
this.fixedQueryForm['t_uploader'] = this.currUser.ename
|
|
278
|
+
},
|
|
279
|
+
methods: {
|
|
280
|
+
toDetail (record, id) {
|
|
281
|
+
this.serialNumber = id + ''
|
|
282
|
+
this.successVisible = true
|
|
283
|
+
},
|
|
284
|
+
getBase64 (file) {
|
|
285
|
+
return new Promise((resolve, reject) => {
|
|
286
|
+
const reader = new FileReader()
|
|
287
|
+
reader.readAsDataURL(file)
|
|
288
|
+
reader.onload = () => resolve(reader.result)
|
|
289
|
+
reader.onerror = error => reject(error)
|
|
290
|
+
})
|
|
291
|
+
},
|
|
292
|
+
// 获取当前用户手机号
|
|
293
|
+
getCurrentUserPhone () {
|
|
294
|
+
if (this.currUser.f_user_telephone === undefined) {
|
|
295
|
+
this.phoneNumber = '未定义'
|
|
296
|
+
} else {
|
|
297
|
+
this.phoneNumber = this.currUser.f_user_telephone
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
// 图像修改检测
|
|
301
|
+
handleChange ({ fileList }) {
|
|
302
|
+
this.fileList = fileList.filter((item) => {
|
|
303
|
+
return item.status === 'done' || item.status === 'uploading'
|
|
304
|
+
})
|
|
305
|
+
},
|
|
306
|
+
// 在上传页面,点击图片上的垃圾桶,撤销上传
|
|
307
|
+
remove (file) {
|
|
308
|
+
return post(TicketDetailsViewApi.revocationImage, {
|
|
309
|
+
file: file
|
|
310
|
+
})
|
|
311
|
+
.then(res => {
|
|
312
|
+
if (res.data === 'success') {
|
|
313
|
+
this.$message.success('删除成功')
|
|
314
|
+
}
|
|
315
|
+
this.fileList = this.fileList.filter((item) => {
|
|
316
|
+
return item.response.name !== file.response.name
|
|
317
|
+
})
|
|
318
|
+
}, err => {
|
|
319
|
+
console.log(err)
|
|
320
|
+
})
|
|
321
|
+
},
|
|
322
|
+
// 上传头像前校验
|
|
323
|
+
beforeUpload (file) {
|
|
324
|
+
const isJpgOrPng =
|
|
325
|
+
file.type === 'image/jpeg' ||
|
|
326
|
+
file.type === 'image/jpg' ||
|
|
327
|
+
file.type === 'image/png'
|
|
328
|
+
const Lt2M = file.size / 1024 / 1024 < 2
|
|
329
|
+
if (!Lt2M) {
|
|
330
|
+
this.$message.error('图片不得大于2MB!')
|
|
331
|
+
}
|
|
332
|
+
if (!isJpgOrPng) {
|
|
333
|
+
this.$message.error('只能上传jpg/png格式的图片')
|
|
334
|
+
}
|
|
335
|
+
return isJpgOrPng && Lt2M
|
|
336
|
+
},
|
|
337
|
+
handleCancel () {
|
|
338
|
+
this.previewVisible = false
|
|
339
|
+
},
|
|
340
|
+
// 处理预览图像
|
|
341
|
+
async handlePreview (file) {
|
|
342
|
+
if (!file.url && !file.preview) {
|
|
343
|
+
file.preview = await this.getBase64(file.originFileObj)
|
|
344
|
+
}
|
|
345
|
+
this.previewImage = file.url || file.preview
|
|
346
|
+
this.previewVisible = true
|
|
347
|
+
},
|
|
348
|
+
// 提交按钮逻辑
|
|
349
|
+
onSubmit () {
|
|
350
|
+
// 根据当前日期调用logic获取订单序列号
|
|
351
|
+
return post(TicketDetailsViewApi.getTicketSerialNumber, {
|
|
352
|
+
priority: this.data.priority,
|
|
353
|
+
category: this.data.category,
|
|
354
|
+
time: this.dataFormat(new Date())
|
|
355
|
+
})
|
|
356
|
+
.then(res => {
|
|
357
|
+
const serialNumber = res
|
|
358
|
+
// 拿到序列号,将数据保存到数据库中
|
|
359
|
+
this.categoryStr = this.$appdata.getDictionaryList('ticketCategoryMap')[this.form.category].label
|
|
360
|
+
return post(TicketDetailsViewApi.addTicket, {
|
|
361
|
+
uploader: this.currUser.ename,
|
|
362
|
+
description: this.form.desc,
|
|
363
|
+
category: this.form.category,
|
|
364
|
+
serial_number: serialNumber,
|
|
365
|
+
images: this.fileList,
|
|
366
|
+
categoryStr: this.categoryStr,
|
|
367
|
+
phoneNumber: this.phoneNumber
|
|
368
|
+
})
|
|
369
|
+
.then(res => {
|
|
370
|
+
this.serialNumber = serialNumber
|
|
371
|
+
this.successVisible = true
|
|
372
|
+
this.fileList = []
|
|
373
|
+
this.form.category = ''
|
|
374
|
+
this.form.desc = ''
|
|
375
|
+
this.showCategoryAlert = true
|
|
376
|
+
}, err => {
|
|
377
|
+
console.log(err)
|
|
378
|
+
})
|
|
379
|
+
}, err => {
|
|
380
|
+
console.log(err)
|
|
381
|
+
})
|
|
382
|
+
},
|
|
383
|
+
// 格式化时间,为后台提供yyyyMMdd格式数据,方便后台使用
|
|
384
|
+
dataFormat (time) {
|
|
385
|
+
return `${
|
|
386
|
+
time.getFullYear()}${time.getMonth() + 1 >= 10 ? (time.getMonth() + 1) : '0' +
|
|
387
|
+
(time.getMonth() + 1)}${time.getDate() >= 10 ? time.getDate() : '0' +
|
|
388
|
+
time.getDate()
|
|
389
|
+
}`
|
|
390
|
+
},
|
|
391
|
+
// 点击向日葵链接
|
|
392
|
+
toSunClientClick () {
|
|
393
|
+
window.open('https://sunlogin.oray.com/download')
|
|
394
|
+
},
|
|
395
|
+
// 点击ToDesk链接
|
|
396
|
+
toDeskClick () {
|
|
397
|
+
window.open('https://www.todesk.com/download.html')
|
|
398
|
+
},
|
|
399
|
+
logout () {
|
|
400
|
+
logout()
|
|
401
|
+
this.$router.push('/login')
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
computed: {
|
|
405
|
+
...mapState('account', { currUser: 'user' })
|
|
406
|
+
},
|
|
407
|
+
watch: {
|
|
408
|
+
// 监控类别的改变,当类别改变,校验通过
|
|
409
|
+
'form.category' (newVal) {
|
|
410
|
+
const numReg = new RegExp(/^[0-9]+$/)
|
|
411
|
+
this.showCategoryAlert = !numReg.test(newVal)
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
</script>
|
|
416
|
+
|
|
417
|
+
<style scoped>
|
|
418
|
+
.radio-item{
|
|
419
|
+
margin-right: 140px;
|
|
420
|
+
}
|
|
421
|
+
.submitTicketTitle{
|
|
422
|
+
font-size: 40px;
|
|
423
|
+
vertical-align: middle;
|
|
424
|
+
text-align: center;
|
|
425
|
+
margin-bottom: 40px;
|
|
426
|
+
}
|
|
427
|
+
</style>
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a-card class="result-success" :bordered="false">
|
|
3
|
+
<result :is-success="icon" :description="description" :title="title">
|
|
4
|
+
<template slot="action">
|
|
5
|
+
<span style="margin-right: 10px" v-if="countDown > 0">{{ countDownFormat() }}</span>
|
|
6
|
+
<a-button type="primary" v-if="UrgentAvailable" :disabled="urgentAccess" style="margin-right: 20px" @click="urgent">请求加急处理</a-button>
|
|
7
|
+
<a-button type="danger" @click="closeBtn" >撤销工单</a-button>
|
|
8
|
+
</template>
|
|
9
|
+
<a-modal
|
|
10
|
+
title="关闭工单"
|
|
11
|
+
:visible="closeVisible"
|
|
12
|
+
@ok="handleCloseOk"
|
|
13
|
+
@cancel="handleCloseCancel"
|
|
14
|
+
:zIndex="1002"
|
|
15
|
+
>
|
|
16
|
+
<p>是否确认手动关闭工单?</p>
|
|
17
|
+
<p style="color: red">(该操作不可撤销,请谨慎操作!)</p>
|
|
18
|
+
</a-modal>
|
|
19
|
+
<div>
|
|
20
|
+
<div class="project-name">工单处理进度</div>
|
|
21
|
+
<detail-list size="small" style="max-width: 800px; margin-bottom: 8px">
|
|
22
|
+
<detail-list-item term="工单编号">{{ serialNumber }}</detail-list-item>
|
|
23
|
+
<detail-list-item term="负责人">{{ details.name }}</detail-list-item>
|
|
24
|
+
<detail-list-item term="提交时间">2016-12-12</detail-list-item>
|
|
25
|
+
</detail-list>
|
|
26
|
+
<a-steps :current="step" progressDot>
|
|
27
|
+
<a-step title="工单提交">
|
|
28
|
+
<a-step-item-group slot="description">
|
|
29
|
+
<a-step-item :title="details.uploader" />
|
|
30
|
+
<a-step-item :title="details.createdTime"/>
|
|
31
|
+
</a-step-item-group>
|
|
32
|
+
</a-step>
|
|
33
|
+
<a-step title="工单处理中" >
|
|
34
|
+
<a-step-item-group slot="description">
|
|
35
|
+
<a-step-item :title="details.name" v-if="step >= 1" />
|
|
36
|
+
<a-step-item :title="details.confirmTime" v-if="step >= 1"/>
|
|
37
|
+
</a-step-item-group>
|
|
38
|
+
</a-step>
|
|
39
|
+
<a-step title="工单完成" >
|
|
40
|
+
<a-step-item-group slot="description">
|
|
41
|
+
<a-step-item :title="details.finishedTime" v-if="step >= 2"/>
|
|
42
|
+
</a-step-item-group>
|
|
43
|
+
</a-step>
|
|
44
|
+
</a-steps>
|
|
45
|
+
</div>
|
|
46
|
+
</result>
|
|
47
|
+
</a-card>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script>
|
|
51
|
+
import Result from '@vue2-client/components/result/Result'
|
|
52
|
+
import DetailList from '@vue2-client/components/tool/DetailList'
|
|
53
|
+
import AStepItem from '@vue2-client/components/tool/AStepItem'
|
|
54
|
+
import { TicketDetailsViewApi } from '@vue2-client/services/api/TicketDetailsViewApi'
|
|
55
|
+
import { post } from '@vue2-client/services/api/restTools'
|
|
56
|
+
import { formatDate } from '@vue2-client/utils/util'
|
|
57
|
+
|
|
58
|
+
const AStepItemGroup = AStepItem.Group
|
|
59
|
+
const DetailListItem = DetailList.Item
|
|
60
|
+
|
|
61
|
+
export default {
|
|
62
|
+
name: 'submitTicketSuccess',
|
|
63
|
+
components: { AStepItemGroup, AStepItem, DetailListItem, DetailList, Result },
|
|
64
|
+
data () {
|
|
65
|
+
return {
|
|
66
|
+
title: '提交成功',
|
|
67
|
+
description: '您创建的工单已成功提交,请保持电话畅通,我们的工作人员将尽快与您取得联系。' +
|
|
68
|
+
'如果需要加急,请在倒计时结束后点击加急按钮,加急后我们将优先处理您的工单',
|
|
69
|
+
// 工单序列号
|
|
70
|
+
serialNumber: '',
|
|
71
|
+
// 工单详情
|
|
72
|
+
details: {
|
|
73
|
+
uploader: '',
|
|
74
|
+
status: '',
|
|
75
|
+
name: '',
|
|
76
|
+
priority: undefined,
|
|
77
|
+
createdTime: '',
|
|
78
|
+
confirmTime: '',
|
|
79
|
+
finishedTime: ''
|
|
80
|
+
},
|
|
81
|
+
// 控制加急按钮
|
|
82
|
+
urgentAccess: true,
|
|
83
|
+
// 倒计时
|
|
84
|
+
countDown: 0,
|
|
85
|
+
// 控制加急按钮显示
|
|
86
|
+
UrgentAvailable: true,
|
|
87
|
+
// 刷新页面的定时器
|
|
88
|
+
timer: undefined,
|
|
89
|
+
// 取消工单确认框可见性
|
|
90
|
+
closeVisible: false,
|
|
91
|
+
// 控制页面大图标
|
|
92
|
+
icon: true
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
mounted () {
|
|
96
|
+
this.serialNumber = this.$route.query.serialNumber
|
|
97
|
+
this.getTicketDetail()
|
|
98
|
+
this.refresh()
|
|
99
|
+
this.countDown = 0
|
|
100
|
+
},
|
|
101
|
+
beforeDestroy () {
|
|
102
|
+
clearInterval(this.timer)
|
|
103
|
+
},
|
|
104
|
+
methods: {
|
|
105
|
+
format (date, format) {
|
|
106
|
+
return formatDate(date, format)
|
|
107
|
+
},
|
|
108
|
+
// 关闭工单确认后操作
|
|
109
|
+
handleCloseOk () {
|
|
110
|
+
return post(TicketDetailsViewApi.manualCloseTicketByCustomer, {
|
|
111
|
+
serialNumber: this.serialNumber,
|
|
112
|
+
time: new Date()
|
|
113
|
+
})
|
|
114
|
+
.then(res => {
|
|
115
|
+
this.closeVisible = false
|
|
116
|
+
this.title = '工单已关闭'
|
|
117
|
+
this.description = ''
|
|
118
|
+
this.icon = false
|
|
119
|
+
clearInterval(this.timer)
|
|
120
|
+
}, err => {
|
|
121
|
+
console.error(err)
|
|
122
|
+
})
|
|
123
|
+
},
|
|
124
|
+
// 关闭工单取消后业务逻辑
|
|
125
|
+
handleCloseCancel () {
|
|
126
|
+
this.closeVisible = false
|
|
127
|
+
},
|
|
128
|
+
// 关闭工单按钮
|
|
129
|
+
closeBtn () {
|
|
130
|
+
this.closeVisible = true
|
|
131
|
+
},
|
|
132
|
+
// 过10s刷新一下页面数据
|
|
133
|
+
refresh () {
|
|
134
|
+
this.timer = setInterval(() => {
|
|
135
|
+
this.getTicketDetail()
|
|
136
|
+
}, 10 * 1000)
|
|
137
|
+
},
|
|
138
|
+
// 对工单进行加急处理
|
|
139
|
+
urgent () {
|
|
140
|
+
return post(TicketDetailsViewApi.rushTicket, {
|
|
141
|
+
serialNumber: this.serialNumber
|
|
142
|
+
})
|
|
143
|
+
.then(res => {
|
|
144
|
+
if (res === 1) {
|
|
145
|
+
this.$message.success(
|
|
146
|
+
'操作成功',
|
|
147
|
+
5
|
|
148
|
+
)
|
|
149
|
+
this.description = '您的工单已经被加急处理,我们的工作人员会优先处理您的请求。'
|
|
150
|
+
this.UrgentAvailable = false
|
|
151
|
+
} else {
|
|
152
|
+
this.$message.error(
|
|
153
|
+
'操作失败',
|
|
154
|
+
5
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
}, err => {
|
|
158
|
+
console.log(err)
|
|
159
|
+
})
|
|
160
|
+
},
|
|
161
|
+
// 格式化倒计时
|
|
162
|
+
countDownFormat () {
|
|
163
|
+
const hours = '00'
|
|
164
|
+
let mins = Math.floor(this.countDown / 60)
|
|
165
|
+
let secs = this.countDown % 60
|
|
166
|
+
if (mins < 10) {
|
|
167
|
+
mins = '0' + mins
|
|
168
|
+
}
|
|
169
|
+
if (secs < 10) {
|
|
170
|
+
secs = '0' + secs
|
|
171
|
+
}
|
|
172
|
+
return hours + ':' + mins + ':' + secs
|
|
173
|
+
},
|
|
174
|
+
// 设置用于控制加急按钮倒计时定时器,加急按钮5分钟后才可点击
|
|
175
|
+
setTimer () {
|
|
176
|
+
this.countDown = 5
|
|
177
|
+
const time = setInterval(() => {
|
|
178
|
+
this.countDown--
|
|
179
|
+
if (this.countDown <= 0) {
|
|
180
|
+
this.urgentAccess = false
|
|
181
|
+
clearInterval(time)
|
|
182
|
+
this.countDown = -1
|
|
183
|
+
}
|
|
184
|
+
}, 1000)
|
|
185
|
+
},
|
|
186
|
+
// 获取工单详情
|
|
187
|
+
getTicketDetail () {
|
|
188
|
+
return post(TicketDetailsViewApi.getTicketDetailsForUploader, {
|
|
189
|
+
serialNumber: this.serialNumber
|
|
190
|
+
})
|
|
191
|
+
.then(res => {
|
|
192
|
+
this.details.uploader = res.uploader
|
|
193
|
+
// 判断负责人有没有值
|
|
194
|
+
if (res.name === undefined) {
|
|
195
|
+
this.details.name = ''
|
|
196
|
+
} else {
|
|
197
|
+
this.details.name = res.name
|
|
198
|
+
}
|
|
199
|
+
// 判断工单被确认时间
|
|
200
|
+
if (res.confirmtime === undefined) {
|
|
201
|
+
this.details.confirmTime = ''
|
|
202
|
+
} else {
|
|
203
|
+
this.details.confirmTime = this.format(res.confirmtime, 'yyyy-MM-dd hh:mm:ss')
|
|
204
|
+
}
|
|
205
|
+
// 判断工单完成时间
|
|
206
|
+
if (res.finishedtime === undefined) {
|
|
207
|
+
this.details.finishedTime = ''
|
|
208
|
+
} else {
|
|
209
|
+
this.details.finishedTime = this.format(res.finishedtime, 'yyyy-MM-dd hh:mm:ss')
|
|
210
|
+
}
|
|
211
|
+
this.details.createdTime = this.format(res.createdtime, 'yyyy-MM-dd hh:mm:ss')
|
|
212
|
+
this.details.status = res.status
|
|
213
|
+
this.details.priority = res.priority
|
|
214
|
+
|
|
215
|
+
// 如果当前状态为一般,设置定时器,五分钟后允许加急
|
|
216
|
+
if (this.details.priority > 1 && this.countDown === 0) {
|
|
217
|
+
this.setTimer()
|
|
218
|
+
}
|
|
219
|
+
}, err => {
|
|
220
|
+
console.log(err)
|
|
221
|
+
})
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
computed: {
|
|
225
|
+
// 用于进度条,进度显示控制
|
|
226
|
+
step () {
|
|
227
|
+
if (this.details.status !== 0 && this.details.status !== 1) {
|
|
228
|
+
return 2
|
|
229
|
+
} else {
|
|
230
|
+
return this.details.status
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
</script>
|
|
236
|
+
|
|
237
|
+
<style scoped lang="less">
|
|
238
|
+
.result-success{
|
|
239
|
+
.action:not(:first-child){
|
|
240
|
+
margin-left: 8px;
|
|
241
|
+
}
|
|
242
|
+
.project-name{
|
|
243
|
+
font-size: 16px;
|
|
244
|
+
color: @title-color;
|
|
245
|
+
font-weight: 500;
|
|
246
|
+
margin-bottom: 20px;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
</style>
|