vue2-client 1.2.37 → 1.2.38

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.
@@ -1,440 +1,456 @@
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 v-if="visible">
122
- <div style="text-align: right">
123
- <p>欢迎您:{{ currUser.ename }}</p>
124
- </div>
125
- <div class="submitTicketTitle">
126
- <span>奥枫问题反馈平台</span>
127
- </div>
128
- <a-tabs :activeKey="tabActiveKey" @change="changeTab">
129
- <a-tab-pane key="workSubmit" tab="工单提交">
130
- <!-- 表格主体 -->
131
- <a-row v-if="tabActiveKey === 'workSubmit'">
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="workHistory" tab="历史工单">
214
- <!-- 查询表单 -->
215
- <x-form-table
216
- v-if="tabActiveKey === 'workHistory'"
217
- title="已提交工单"
218
- :queryParamsName="queryParamsName"
219
- :fixed-query-form="fixedQueryForm"
220
- @action="toDetail">
221
- </x-form-table>
222
- </a-tab-pane>
223
- </a-tabs>
224
- </a-card>
225
- </div>
226
- </template>
227
-
228
- <script>
229
- import { TicketDetailsViewApi, post } from '@vue2-client/services/api'
230
- import { logout } from '@/services/user'
231
- import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
232
- import Vue from 'vue'
233
-
234
- export default {
235
- name: 'submitTicket',
236
- components: {
237
- XFormTable
238
- },
239
- data () {
240
- return {
241
- // 查询配置文件名
242
- queryParamsName: 'TicketQueryForCustomer',
243
- // 控制成功页面显示
244
- successVisible: false,
245
- // 控制预览显示
246
- previewVisible: false,
247
- // 图片真实地址
248
- previewImage: '',
249
- // 图片列表
250
- fileList: [],
251
- // 表单数据
252
- form: {
253
- name: '',
254
- category: undefined,
255
- desc: undefined
256
- },
257
- // 获取序列号使用
258
- data: {
259
- priority: 2,
260
- category: 0,
261
- time: this.dataFormat(new Date())
262
- },
263
- // 工单序列号
264
- serialNumber: '',
265
- // 类别未填写警告信息控制
266
- showCategoryAlert: true,
267
- // 向日葵使用指南可见性
268
- sunClientManualVisible: false,
269
- // 向日葵使用指南可见性
270
- toDeskManualVisible: false,
271
- // 为工单查询指定条件
272
- fixedQueryForm: {},
273
- // 工单类型在字典中显示的文字值
274
- categoryStr: '',
275
- // 当前登陆用户手机号
276
- phoneNumber: '',
277
- // 用户信息
278
- currUser: {
279
- ename: '',
280
- phoneNumber: ''
281
- },
282
- visible: false,
283
- tabActiveKey: 'workSubmit'
284
- }
285
- },
286
- created () {
287
- Vue.$appdata.load().then(res => {
288
- this.currUser.phoneNumber = this.$route.query.personPhone ? this.$route.query.personPhone : '未定义'
289
- this.currUser.ename = this.$route.query.orgName
290
- this.fixedQueryForm['t_uploader'] = this.currUser.ename
291
- this.visible = true
292
- })
293
- },
294
- mounted () {
295
- },
296
- methods: {
297
- toDetail (record, id) {
298
- this.serialNumber = id + ''
299
- this.successVisible = true
300
- },
301
- getBase64 (file) {
302
- return new Promise((resolve, reject) => {
303
- const reader = new FileReader()
304
- reader.readAsDataURL(file)
305
- reader.onload = () => resolve(reader.result)
306
- reader.onerror = error => reject(error)
307
- })
308
- },
309
- // 图像修改检测
310
- handleChange ({ fileList }) {
311
- this.fileList = fileList.filter((item) => {
312
- return item.status === 'done' || item.status === 'uploading'
313
- })
314
- },
315
- // 在上传页面,点击图片上的垃圾桶,撤销上传
316
- remove (file) {
317
- return post(TicketDetailsViewApi.revocationImage, {
318
- file: file
319
- })
320
- .then(res => {
321
- if (res.data === 'success') {
322
- this.$message.success('删除成功')
323
- }
324
- this.fileList = this.fileList.filter((item) => {
325
- return item.response.name !== file.response.name
326
- })
327
- }, err => {
328
- console.log(err)
329
- })
330
- },
331
- // 上传头像前校验
332
- beforeUpload (file) {
333
- const isJpgOrPng =
334
- file.type === 'image/jpeg' ||
335
- file.type === 'image/jpg' ||
336
- file.type === 'image/png'
337
- const Lt2M = file.size / 1024 / 1024 < 2
338
- if (!Lt2M) {
339
- this.$message.error('图片不得大于2MB!')
340
- }
341
- if (!isJpgOrPng) {
342
- this.$message.error('只能上传jpg/png格式的图片')
343
- }
344
- return isJpgOrPng && Lt2M
345
- },
346
- handleCancel () {
347
- this.previewVisible = false
348
- },
349
- // 处理预览图像
350
- async handlePreview (file) {
351
- if (!file.url && !file.preview) {
352
- file.preview = await this.getBase64(file.originFileObj)
353
- }
354
- this.previewImage = file.url || file.preview
355
- this.previewVisible = true
356
- },
357
- // 提交按钮逻辑
358
- onSubmit () {
359
- // 根据当前日期调用logic获取订单序列号
360
- return post(TicketDetailsViewApi.getTicketSerialNumber, {
361
- priority: this.data.priority,
362
- category: this.data.category,
363
- time: this.dataFormat(new Date())
364
- })
365
- .then(res => {
366
- const serialNumber = res
367
- if (this.form.desc === undefined) {
368
- this.form.desc = '该用户没有填写描述信息'
369
- }
370
- // 拿到序列号,将数据保存到数据库中
371
- this.categoryStr = this.$appdata.getDictionaryList('ticketCategoryMap')[this.form.category].label
372
- return post(TicketDetailsViewApi.addTicket, {
373
- uploader: this.currUser.ename,
374
- description: this.form.desc,
375
- category: this.form.category,
376
- serial_number: serialNumber,
377
- images: this.fileList,
378
- categoryStr: this.categoryStr,
379
- phoneNumber: this.currUser.phoneNumber
380
- })
381
- .then(res => {
382
- this.serialNumber = serialNumber
383
- this.successVisible = true
384
- this.fileList = []
385
- this.form.category = ''
386
- this.form.desc = ''
387
- this.showCategoryAlert = true
388
- }, err => {
389
- console.log(err)
390
- })
391
- }, err => {
392
- console.log(err)
393
- })
394
- },
395
- // 格式化时间,为后台提供yyyyMMdd格式数据,方便后台使用
396
- dataFormat (time) {
397
- return `${
398
- time.getFullYear()}${time.getMonth() + 1 >= 10 ? (time.getMonth() + 1) : '0' +
399
- (time.getMonth() + 1)}${time.getDate() >= 10 ? time.getDate() : '0' +
400
- time.getDate()
401
- }`
402
- },
403
- // 点击向日葵链接
404
- toSunClientClick () {
405
- window.open('https://sunlogin.oray.com/download')
406
- },
407
- // 点击ToDesk链接
408
- toDeskClick () {
409
- window.open('https://www.todesk.com/download.html')
410
- },
411
- logout () {
412
- logout()
413
- this.$router.push('/login')
414
- },
415
- // 切换标签页
416
- changeTab (id) {
417
- this.tabActiveKey = id
418
- }
419
- },
420
- watch: {
421
- // 监控类别的改变,当类别改变,校验通过
422
- 'form.category' (newVal) {
423
- const numReg = new RegExp(/^[0-9]+$/)
424
- this.showCategoryAlert = !numReg.test(newVal)
425
- }
426
- }
427
- }
428
- </script>
429
-
430
- <style scoped>
431
- .radio-item{
432
- margin-right: 140px;
433
- }
434
- .submitTicketTitle{
435
- font-size: 40px;
436
- vertical-align: middle;
437
- text-align: center;
438
- margin-bottom: 40px;
439
- }
440
- </style>
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" alt="pic">
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" alt="pic">
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" alt="pic">
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" alt="pic">
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" alt="pic">
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" alt="pic">
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" alt="pic">
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" alt="pic">
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 v-if="visible">
122
+ <div style="text-align: right">
123
+ <p>欢迎您:{{ currUser.ename }}</p>
124
+ </div>
125
+ <div class="submitTicketTitle">
126
+ <span>奥枫问题反馈平台</span>
127
+ </div>
128
+ <a-tabs :activeKey="tabActiveKey" @change="changeTab">
129
+ <a-tab-pane key="workSubmit" tab="工单提交">
130
+ <!-- 表格主体 -->
131
+ <a-row v-if="tabActiveKey === 'workSubmit'">
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-input v-model="form.phone"></a-input>
147
+ <strong v-show="showPhoneAlert" style="color: red">联系方式填写有误!</strong>
148
+ </a-form-item>
149
+ <!-- 问题描述框 -->
150
+ <a-form-item label="问题详情描述">
151
+ <a-textarea allow-clear v-model="form.desc" placeholder="请用一句话描述您的问题,必要时请注明客户编号,表号,系统功能项等信息"/>
152
+ </a-form-item>
153
+ <!-- 图片上传 -->
154
+ <a-form-item :wrapper-col="{ span: 12 }" label="问题截图">
155
+ <div class="clearfix">
156
+ <a-upload
157
+ name="avatar"
158
+ list-type="picture-card"
159
+ :before-upload="beforeUpload"
160
+ action="/webmeteruploadapi/upload"
161
+ :file-list="fileList"
162
+ @preview="handlePreview"
163
+ @change="handleChange"
164
+ :remove="remove"
165
+ >
166
+ <div v-if="fileList.length < 5">
167
+ <a-icon type="plus" />
168
+ <div class="ant-upload-text">点击上传</div>
169
+ </div>
170
+ </a-upload>
171
+ <a-modal
172
+ :visible="previewVisible"
173
+ :footer="null"
174
+ @cancel="handleCancel"
175
+ >
176
+ <img style="width: 100%" :src="previewImage" alt="图片上传"/>
177
+ </a-modal>
178
+ </div>
179
+ </a-form-item>
180
+ <!-- 表单底部按钮 -->
181
+ <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
182
+ <a-button type="primary" @click="onSubmit" style="margin-right: 20px" :disabled="showCategoryAlert || showPhoneAlert">
183
+ 提交
184
+ </a-button>
185
+ </a-form-item>
186
+ </a-form>
187
+ </a-col>
188
+ <a-col :span="6">
189
+ <a-card title="远程方式快捷下载">
190
+ <a-space direction="vertical">
191
+ <a-row :gutter="16">
192
+ <a-col
193
+ :lg="24"
194
+ :md="24"
195
+ :sm="24"
196
+ :xl="12"
197
+ :xs="24"
198
+ :xxl="12"
199
+ style="text-align: center">
200
+ <img @click="toSunClientClick" style="width: 128px;height:128px;cursor: pointer" src="@vue2-client/assets/img/SunClientDownload.png" alt="pic"/>
201
+ <p style="padding-top:10px;text-align: center"><a @click="sunClientManualVisible = true">向日葵使用说明</a></p>
202
+ </a-col>
203
+ <a-col
204
+ :lg="24"
205
+ :md="24"
206
+ :sm="24"
207
+ :xl="12"
208
+ :xs="24"
209
+ :xxl="12"
210
+ style="text-align: center">
211
+ <img @click="toDeskClick" style="width: 128px;height:128px;cursor: pointer" src="@vue2-client/assets/img/ToDeskDownload.png" alt="pic">
212
+ <p style="padding-top:10px;text-align: center"><a @click="toDeskManualVisible = true">ToDesk使用说明</a></p>
213
+ </a-col>
214
+ </a-row>
215
+ <a-row :gutter="16" style="text-align: center">
216
+ <hr/>
217
+ <p style="color: red;font-weight: bolder;padding-top: 10px">如需远程协助,请下载向日葵</p>
218
+ <p style="color: red;font-weight: bolder">向日葵安装使用指南,请点击上方“向日葵使用说明”查看</p>
219
+ </a-row>
220
+ </a-space>
221
+ </a-card>
222
+ </a-col>
223
+ </a-row>
224
+ </a-tab-pane>
225
+ <a-tab-pane key="workHistory" tab="历史工单">
226
+ <!-- 查询表单 -->
227
+ <x-form-table
228
+ v-if="tabActiveKey === 'workHistory'"
229
+ title="已提交工单"
230
+ :queryParamsName="queryParamsName"
231
+ :fixed-query-form="fixedQueryForm"
232
+ @action="toDetail">
233
+ </x-form-table>
234
+ </a-tab-pane>
235
+ </a-tabs>
236
+ </a-card>
237
+ </div>
238
+ </template>
239
+
240
+ <script>
241
+ import { TicketDetailsViewApi, post } from '@vue2-client/services/api'
242
+ import { logout } from '@/services/user'
243
+ import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
244
+ import Vue from 'vue'
245
+
246
+ export default {
247
+ name: 'submitTicket',
248
+ components: {
249
+ XFormTable
250
+ },
251
+ data () {
252
+ return {
253
+ // 查询配置文件名
254
+ queryParamsName: 'TicketQueryForCustomer',
255
+ // 控制成功页面显示
256
+ successVisible: false,
257
+ // 控制预览显示
258
+ previewVisible: false,
259
+ // 图片真实地址
260
+ previewImage: '',
261
+ // 图片列表
262
+ fileList: [],
263
+ // 表单数据
264
+ form: {
265
+ name: '',
266
+ category: undefined,
267
+ desc: undefined,
268
+ phone: ''
269
+ },
270
+ // 获取序列号使用
271
+ data: {
272
+ priority: 2,
273
+ category: 0,
274
+ time: this.dataFormat(new Date())
275
+ },
276
+ // 工单序列号
277
+ serialNumber: '',
278
+ // 类别未填写警告信息控制
279
+ showCategoryAlert: true,
280
+ showPhoneAlert: true,
281
+ // 向日葵使用指南可见性
282
+ sunClientManualVisible: false,
283
+ // 向日葵使用指南可见性
284
+ toDeskManualVisible: false,
285
+ // 为工单查询指定条件
286
+ fixedQueryForm: {},
287
+ // 工单类型在字典中显示的文字值
288
+ categoryStr: '',
289
+ // 用户信息
290
+ currUser: {
291
+ ename: '',
292
+ phoneNumber: ''
293
+ },
294
+ visible: false,
295
+ tabActiveKey: 'workSubmit'
296
+ }
297
+ },
298
+ created () {
299
+ Vue.$appdata.load().then(res => {
300
+ this.currUser.ename = this.$route.query.orgName
301
+ this.fixedQueryForm['t_uploader'] = this.currUser.ename
302
+ this.visible = true
303
+ })
304
+ },
305
+ mounted () {
306
+ },
307
+ methods: {
308
+ toDetail (record, id) {
309
+ this.serialNumber = id + ''
310
+ this.successVisible = true
311
+ },
312
+ getBase64 (file) {
313
+ return new Promise((resolve, reject) => {
314
+ const reader = new FileReader()
315
+ reader.readAsDataURL(file)
316
+ reader.onload = () => resolve(reader.result)
317
+ reader.onerror = error => reject(error)
318
+ })
319
+ },
320
+ // 图像修改检测
321
+ handleChange ({ fileList }) {
322
+ this.fileList = fileList.filter((item) => {
323
+ return item.status === 'done' || item.status === 'uploading'
324
+ })
325
+ },
326
+ // 在上传页面,点击图片上的垃圾桶,撤销上传
327
+ remove (file) {
328
+ return post(TicketDetailsViewApi.revocationImage, {
329
+ file: file
330
+ })
331
+ .then(res => {
332
+ if (res.data === 'success') {
333
+ this.$message.success('删除成功')
334
+ }
335
+ this.fileList = this.fileList.filter((item) => {
336
+ return item.response.name !== file.response.name
337
+ })
338
+ }, err => {
339
+ console.log(err)
340
+ })
341
+ },
342
+ // 上传头像前校验
343
+ beforeUpload (file) {
344
+ const isJpgOrPng =
345
+ file.type === 'image/jpeg' ||
346
+ file.type === 'image/jpg' ||
347
+ file.type === 'image/png'
348
+ const Lt2M = file.size / 1024 / 1024 < 2
349
+ if (!Lt2M) {
350
+ this.$message.error('图片不得大于2MB!')
351
+ }
352
+ if (!isJpgOrPng) {
353
+ this.$message.error('只能上传jpg/png格式的图片')
354
+ }
355
+ return isJpgOrPng && Lt2M
356
+ },
357
+ handleCancel () {
358
+ this.previewVisible = false
359
+ },
360
+ // 处理预览图像
361
+ async handlePreview (file) {
362
+ if (!file.url && !file.preview) {
363
+ file.preview = await this.getBase64(file.originFileObj)
364
+ }
365
+ this.previewImage = file.url || file.preview
366
+ this.previewVisible = true
367
+ },
368
+ // 提交按钮逻辑
369
+ onSubmit () {
370
+ // 根据当前日期调用logic获取订单序列号
371
+ return post(TicketDetailsViewApi.getTicketSerialNumber, {
372
+ priority: this.data.priority,
373
+ category: this.data.category,
374
+ time: this.dataFormat(new Date())
375
+ })
376
+ .then(res => {
377
+ const serialNumber = res
378
+ if (this.form.desc === undefined) {
379
+ this.form.desc = '该用户没有填写描述信息'
380
+ }
381
+ // 拿到序列号,将数据保存到数据库中
382
+ this.categoryStr = this.$appdata.getDictionaryList('ticketCategoryMap')[this.form.category].label
383
+ return post(TicketDetailsViewApi.addTicket, {
384
+ uploader: this.currUser.ename,
385
+ description: this.form.desc,
386
+ category: this.form.category,
387
+ serial_number: serialNumber,
388
+ images: this.fileList,
389
+ categoryStr: this.categoryStr,
390
+ phoneNumber: this.form.phone
391
+ })
392
+ .then(res => {
393
+ this.serialNumber = serialNumber
394
+ this.successVisible = true
395
+ this.fileList = []
396
+ this.form.category = ''
397
+ this.form.desc = ''
398
+ this.showCategoryAlert = true
399
+ this.showPhoneAlert = true
400
+ }, err => {
401
+ console.log(err)
402
+ })
403
+ }, err => {
404
+ console.log(err)
405
+ })
406
+ },
407
+ // 格式化时间,为后台提供yyyyMMdd格式数据,方便后台使用
408
+ dataFormat (time) {
409
+ return `${
410
+ time.getFullYear()}${time.getMonth() + 1 >= 10 ? (time.getMonth() + 1) : '0' +
411
+ (time.getMonth() + 1)}${time.getDate() >= 10 ? time.getDate() : '0' +
412
+ time.getDate()
413
+ }`
414
+ },
415
+ // 点击向日葵链接
416
+ toSunClientClick () {
417
+ window.open('https://sunlogin.oray.com/download')
418
+ },
419
+ // 点击ToDesk链接
420
+ toDeskClick () {
421
+ window.open('https://www.todesk.com/download.html')
422
+ },
423
+ logout () {
424
+ logout()
425
+ this.$router.push('/login')
426
+ },
427
+ // 切换标签页
428
+ changeTab (id) {
429
+ this.tabActiveKey = id
430
+ }
431
+ },
432
+ watch: {
433
+ // 监控类别的改变,当类别改变,校验通过
434
+ 'form.category' (newVal) {
435
+ const numReg = new RegExp(/^[0-9]+$/)
436
+ this.showCategoryAlert = !numReg.test(newVal)
437
+ },
438
+ 'form.phone' (newVal) {
439
+ const numReg = new RegExp(/^[0-9]+$/)
440
+ this.showPhoneAlert = !numReg.test(newVal)
441
+ }
442
+ }
443
+ }
444
+ </script>
445
+
446
+ <style scoped>
447
+ .radio-item{
448
+ margin-right: 140px;
449
+ }
450
+ .submitTicketTitle{
451
+ font-size: 40px;
452
+ vertical-align: middle;
453
+ text-align: center;
454
+ margin-bottom: 40px;
455
+ }
456
+ </style>