vue2-client 1.2.16 → 1.2.19

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,435 +1,438 @@
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
- import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
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: ''
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
- },
279
- mounted () {
280
- if (!this.currUser) {
281
- this.$router.replace('/login')
282
- return
283
- }
284
- this.getCurrentUserPhone()
285
- this.fixedQueryForm['t_uploader'] = this.currUser.ename
286
- },
287
- methods: {
288
- toDetail (record, id) {
289
- this.serialNumber = id + ''
290
- this.successVisible = true
291
- },
292
- getBase64 (file) {
293
- return new Promise((resolve, reject) => {
294
- const reader = new FileReader()
295
- reader.readAsDataURL(file)
296
- reader.onload = () => resolve(reader.result)
297
- reader.onerror = error => reject(error)
298
- })
299
- },
300
- // 获取当前用户手机号
301
- getCurrentUserPhone () {
302
- if (this.currUser.f_user_telephone === undefined) {
303
- this.phoneNumber = '未定义'
304
- } else {
305
- this.phoneNumber = this.currUser.f_user_telephone
306
- }
307
- },
308
- // 图像修改检测
309
- handleChange ({ fileList }) {
310
- this.fileList = fileList.filter((item) => {
311
- return item.status === 'done' || item.status === 'uploading'
312
- })
313
- },
314
- // 在上传页面,点击图片上的垃圾桶,撤销上传
315
- remove (file) {
316
- return post(TicketDetailsViewApi.revocationImage, {
317
- file: file
318
- })
319
- .then(res => {
320
- if (res.data === 'success') {
321
- this.$message.success('删除成功')
322
- }
323
- this.fileList = this.fileList.filter((item) => {
324
- return item.response.name !== file.response.name
325
- })
326
- }, err => {
327
- console.log(err)
328
- })
329
- },
330
- // 上传头像前校验
331
- beforeUpload (file) {
332
- const isJpgOrPng =
333
- file.type === 'image/jpeg' ||
334
- file.type === 'image/jpg' ||
335
- file.type === 'image/png'
336
- const Lt2M = file.size / 1024 / 1024 < 2
337
- if (!Lt2M) {
338
- this.$message.error('图片不得大于2MB!')
339
- }
340
- if (!isJpgOrPng) {
341
- this.$message.error('只能上传jpg/png格式的图片')
342
- }
343
- return isJpgOrPng && Lt2M
344
- },
345
- handleCancel () {
346
- this.previewVisible = false
347
- },
348
- // 处理预览图像
349
- async handlePreview (file) {
350
- if (!file.url && !file.preview) {
351
- file.preview = await this.getBase64(file.originFileObj)
352
- }
353
- this.previewImage = file.url || file.preview
354
- this.previewVisible = true
355
- },
356
- // 提交按钮逻辑
357
- onSubmit () {
358
- // 根据当前日期调用logic获取订单序列号
359
- return post(TicketDetailsViewApi.getTicketSerialNumber, {
360
- priority: this.data.priority,
361
- category: this.data.category,
362
- time: this.dataFormat(new Date())
363
- })
364
- .then(res => {
365
- const serialNumber = res
366
- // 拿到序列号,将数据保存到数据库中
367
- this.categoryStr = this.$appdata.getDictionaryList('ticketCategoryMap')[this.form.category].label
368
- return post(TicketDetailsViewApi.addTicket, {
369
- uploader: this.currUser.ename,
370
- description: this.form.desc,
371
- category: this.form.category,
372
- serial_number: serialNumber,
373
- images: this.fileList,
374
- categoryStr: this.categoryStr,
375
- phoneNumber: this.phoneNumber
376
- })
377
- .then(res => {
378
- this.serialNumber = serialNumber
379
- this.successVisible = true
380
- this.fileList = []
381
- this.form.category = ''
382
- this.form.desc = ''
383
- this.showCategoryAlert = true
384
- }, err => {
385
- console.log(err)
386
- })
387
- }, err => {
388
- console.log(err)
389
- })
390
- },
391
- // 格式化时间,为后台提供yyyyMMdd格式数据,方便后台使用
392
- dataFormat (time) {
393
- return `${
394
- time.getFullYear()}${time.getMonth() + 1 >= 10 ? (time.getMonth() + 1) : '0' +
395
- (time.getMonth() + 1)}${time.getDate() >= 10 ? time.getDate() : '0' +
396
- time.getDate()
397
- }`
398
- },
399
- // 点击向日葵链接
400
- toSunClientClick () {
401
- window.open('https://sunlogin.oray.com/download')
402
- },
403
- // 点击ToDesk链接
404
- toDeskClick () {
405
- window.open('https://www.todesk.com/download.html')
406
- },
407
- logout () {
408
- logout()
409
- this.$router.push('/login')
410
- }
411
- },
412
- computed: {
413
- ...mapState('account', { currUser: 'user' })
414
- },
415
- watch: {
416
- // 监控类别的改变,当类别改变,校验通过
417
- 'form.category' (newVal) {
418
- const numReg = new RegExp(/^[0-9]+$/)
419
- this.showCategoryAlert = !numReg.test(newVal)
420
- }
421
- }
422
- }
423
- </script>
424
-
425
- <style scoped>
426
- .radio-item{
427
- margin-right: 140px;
428
- }
429
- .submitTicketTitle{
430
- font-size: 40px;
431
- vertical-align: middle;
432
- text-align: center;
433
- margin-bottom: 40px;
434
- }
435
- </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">
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
+ import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
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
+ },
279
+ mounted () {
280
+ if (!this.currUser) {
281
+ this.$router.replace('/login')
282
+ return
283
+ }
284
+ this.getCurrentUserPhone()
285
+ this.fixedQueryForm['t_uploader'] = this.currUser.ename
286
+ },
287
+ methods: {
288
+ toDetail (record, id) {
289
+ this.serialNumber = id + ''
290
+ this.successVisible = true
291
+ },
292
+ getBase64 (file) {
293
+ return new Promise((resolve, reject) => {
294
+ const reader = new FileReader()
295
+ reader.readAsDataURL(file)
296
+ reader.onload = () => resolve(reader.result)
297
+ reader.onerror = error => reject(error)
298
+ })
299
+ },
300
+ // 获取当前用户手机号
301
+ getCurrentUserPhone () {
302
+ if (this.currUser.f_user_telephone === undefined) {
303
+ this.phoneNumber = '未定义'
304
+ } else {
305
+ this.phoneNumber = this.currUser.f_user_telephone
306
+ }
307
+ },
308
+ // 图像修改检测
309
+ handleChange ({ fileList }) {
310
+ this.fileList = fileList.filter((item) => {
311
+ return item.status === 'done' || item.status === 'uploading'
312
+ })
313
+ },
314
+ // 在上传页面,点击图片上的垃圾桶,撤销上传
315
+ remove (file) {
316
+ return post(TicketDetailsViewApi.revocationImage, {
317
+ file: file
318
+ })
319
+ .then(res => {
320
+ if (res.data === 'success') {
321
+ this.$message.success('删除成功')
322
+ }
323
+ this.fileList = this.fileList.filter((item) => {
324
+ return item.response.name !== file.response.name
325
+ })
326
+ }, err => {
327
+ console.log(err)
328
+ })
329
+ },
330
+ // 上传头像前校验
331
+ beforeUpload (file) {
332
+ const isJpgOrPng =
333
+ file.type === 'image/jpeg' ||
334
+ file.type === 'image/jpg' ||
335
+ file.type === 'image/png'
336
+ const Lt2M = file.size / 1024 / 1024 < 2
337
+ if (!Lt2M) {
338
+ this.$message.error('图片不得大于2MB!')
339
+ }
340
+ if (!isJpgOrPng) {
341
+ this.$message.error('只能上传jpg/png格式的图片')
342
+ }
343
+ return isJpgOrPng && Lt2M
344
+ },
345
+ handleCancel () {
346
+ this.previewVisible = false
347
+ },
348
+ // 处理预览图像
349
+ async handlePreview (file) {
350
+ if (!file.url && !file.preview) {
351
+ file.preview = await this.getBase64(file.originFileObj)
352
+ }
353
+ this.previewImage = file.url || file.preview
354
+ this.previewVisible = true
355
+ },
356
+ // 提交按钮逻辑
357
+ onSubmit () {
358
+ // 根据当前日期调用logic获取订单序列号
359
+ return post(TicketDetailsViewApi.getTicketSerialNumber, {
360
+ priority: this.data.priority,
361
+ category: this.data.category,
362
+ time: this.dataFormat(new Date())
363
+ })
364
+ .then(res => {
365
+ const serialNumber = res
366
+ if (this.form.desc === undefined) {
367
+ this.form.desc = '该用户没有填写描述信息'
368
+ }
369
+ // 拿到序列号,将数据保存到数据库中
370
+ this.categoryStr = this.$appdata.getDictionaryList('ticketCategoryMap')[this.form.category].label
371
+ return post(TicketDetailsViewApi.addTicket, {
372
+ uploader: this.currUser.ename,
373
+ description: this.form.desc,
374
+ category: this.form.category,
375
+ serial_number: serialNumber,
376
+ images: this.fileList,
377
+ categoryStr: this.categoryStr,
378
+ phoneNumber: this.phoneNumber
379
+ })
380
+ .then(res => {
381
+ this.serialNumber = serialNumber
382
+ this.successVisible = true
383
+ this.fileList = []
384
+ this.form.category = ''
385
+ this.form.desc = ''
386
+ this.showCategoryAlert = true
387
+ }, err => {
388
+ console.log(err)
389
+ })
390
+ }, err => {
391
+ console.log(err)
392
+ })
393
+ },
394
+ // 格式化时间,为后台提供yyyyMMdd格式数据,方便后台使用
395
+ dataFormat (time) {
396
+ return `${
397
+ time.getFullYear()}${time.getMonth() + 1 >= 10 ? (time.getMonth() + 1) : '0' +
398
+ (time.getMonth() + 1)}${time.getDate() >= 10 ? time.getDate() : '0' +
399
+ time.getDate()
400
+ }`
401
+ },
402
+ // 点击向日葵链接
403
+ toSunClientClick () {
404
+ window.open('https://sunlogin.oray.com/download')
405
+ },
406
+ // 点击ToDesk链接
407
+ toDeskClick () {
408
+ window.open('https://www.todesk.com/download.html')
409
+ },
410
+ logout () {
411
+ logout()
412
+ this.$router.push('/login')
413
+ }
414
+ },
415
+ computed: {
416
+ ...mapState('account', { currUser: 'user' })
417
+ },
418
+ watch: {
419
+ // 监控类别的改变,当类别改变,校验通过
420
+ 'form.category' (newVal) {
421
+ const numReg = new RegExp(/^[0-9]+$/)
422
+ this.showCategoryAlert = !numReg.test(newVal)
423
+ }
424
+ }
425
+ }
426
+ </script>
427
+
428
+ <style scoped>
429
+ .radio-item{
430
+ margin-right: 140px;
431
+ }
432
+ .submitTicketTitle{
433
+ font-size: 40px;
434
+ vertical-align: middle;
435
+ text-align: center;
436
+ margin-bottom: 40px;
437
+ }
438
+ </style>