vue2-client 1.2.108 → 1.2.111

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 CHANGED
@@ -1,6 +1,16 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
+ **1.2.111 -2022-09-01 @江超**
5
+ - 修复获取字典数据时错误的v4版本判断
6
+
7
+ **1.2.110 -2022-08-31 @杨亚文**
8
+ - 修改请求后只有当返回的token有值时才设置cookie
9
+
10
+ **1.2.109 -2022-08-28 @张振宇**
11
+ - 功能新增:
12
+ - 修改确认按钮位置
13
+
4
14
  **1.2.108 -2022-08-23 @江超**
5
15
  - 功能新增:
6
16
  - XFormTable增加selectRow事件
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.2.108",
3
+ "version": "1.2.111",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -1,79 +1,71 @@
1
- import { manageApi, post } from '@vue2-client/services/api'
2
- import { handleTree } from '@vue2-client/utils/util'
3
-
4
- const GetAppDataService = {
5
- install (Vue) {
6
- // 给vue增添对话框显示方法
7
- Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
8
- },
9
- async load () {
10
- const params = {}
11
- await post(manageApi.getDictionaryValue, {}).then((res) => {
12
- // 从本地缓存中读取compatible
13
- const setting = localStorage.getItem('compatible')
14
- // 判断是否是V4环境
15
- if (setting === 'V4') {
16
- // 如果是V4,从返回值中,data取值
17
- Object.assign(params, res.data)
18
- } else {
19
- Object.assign(params, res)
20
- }
21
- const badgeItemArray = {}
22
- for (const key of Object.keys(params)) {
23
- badgeItemArray[key] = {}
24
- for (const item of params[key]) {
25
- if (item.status) {
26
- badgeItemArray[key][item.value] = {
27
- status: item.status,
28
- text: item.text
29
- }
30
- }
31
- }
32
- }
33
- // 追加参数
34
- localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
35
- localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
36
- })
37
- // 获取省市区数据
38
- await post(manageApi.getDivisionsOhChina, {}).then((res) => {
39
- // 追加参数
40
- localStorage.setItem(process.env.VUE_APP_DIVISIONSOHCHINA, JSON.stringify(res))
41
- })
42
- },
43
- // 返回树形省市区
44
- getDivisionsOhChinaForTree () {
45
- const str = localStorage.getItem(process.env.VUE_APP_DIVISIONSOHCHINA)
46
- return handleTree(JSON.parse(str), 'code', 'parentcode')
47
- },
48
- // 返回列表省市区
49
- getDivisionsOhChinaForList () {
50
- const str = localStorage.getItem(process.env.VUE_APP_DIVISIONSOHCHINA)
51
- return JSON.parse(str)
52
- },
53
- getDictionaryList (key) {
54
- const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
55
- const object = JSON.parse(str)
56
- return object[key]
57
- },
58
- getParam (key, value) {
59
- const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
60
- const object = JSON.parse(str)
61
- const result = object[key]
62
- if (result && result.hasOwnProperty(value)) {
63
- return result[value]
64
- } else {
65
- return null
66
- }
67
- },
68
- getParams () {
69
- const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
70
- const object = JSON.parse(str)
71
- return object
72
- },
73
- getSingleValues () {
74
- const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
75
- const object = JSON.parse(str)
76
- return object
77
- }
78
- }
79
- export default GetAppDataService
1
+ import { manageApi, post } from '@vue2-client/services/api'
2
+ import { handleTree } from '@vue2-client/utils/util'
3
+
4
+ const GetAppDataService = {
5
+ install (Vue) {
6
+ // 给vue增添对话框显示方法
7
+ Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
8
+ },
9
+ async load () {
10
+ const params = {}
11
+ await post(manageApi.getDictionaryValue, {}).then((res) => {
12
+ Object.assign(params, res)
13
+ const badgeItemArray = {}
14
+ for (const key of Object.keys(params)) {
15
+ badgeItemArray[key] = {}
16
+ for (const item of params[key]) {
17
+ if (item.status) {
18
+ badgeItemArray[key][item.value] = {
19
+ status: item.status,
20
+ text: item.text
21
+ }
22
+ }
23
+ }
24
+ }
25
+ // 追加参数
26
+ localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
27
+ localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
28
+ })
29
+ // 获取省市区数据
30
+ await post(manageApi.getDivisionsOhChina, {}).then((res) => {
31
+ // 追加参数
32
+ localStorage.setItem(process.env.VUE_APP_DIVISIONSOHCHINA, JSON.stringify(res))
33
+ })
34
+ },
35
+ // 返回树形省市区
36
+ getDivisionsOhChinaForTree () {
37
+ const str = localStorage.getItem(process.env.VUE_APP_DIVISIONSOHCHINA)
38
+ return handleTree(JSON.parse(str), 'code', 'parentcode')
39
+ },
40
+ // 返回列表省市区
41
+ getDivisionsOhChinaForList () {
42
+ const str = localStorage.getItem(process.env.VUE_APP_DIVISIONSOHCHINA)
43
+ return JSON.parse(str)
44
+ },
45
+ getDictionaryList (key) {
46
+ const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
47
+ const object = JSON.parse(str)
48
+ return object[key]
49
+ },
50
+ getParam (key, value) {
51
+ const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
52
+ const object = JSON.parse(str)
53
+ const result = object[key]
54
+ if (result && result.hasOwnProperty(value)) {
55
+ return result[value]
56
+ } else {
57
+ return null
58
+ }
59
+ },
60
+ getParams () {
61
+ const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
62
+ const object = JSON.parse(str)
63
+ return object
64
+ },
65
+ getSingleValues () {
66
+ const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
67
+ const object = JSON.parse(str)
68
+ return object
69
+ }
70
+ }
71
+ export default GetAppDataService
@@ -35,9 +35,9 @@
35
35
  </a-tab-pane>
36
36
  <a-drawer
37
37
  placement="right"
38
- title="待确认制度详情"
39
38
  :width="screenWidth * 0.5"
40
39
  :visible="institutionDetailVisible"
40
+ :closable="false"
41
41
  @close="onClose"
42
42
  >
43
43
  <institution-detail
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div>
2
+ <div style="position: relative;">
3
3
  <h2 style="text-align: center">{{ institutionData.f_title }}</h2>
4
4
  <p>简述: {{ institutionData.f_sketch }}</p>
5
5
  <p>生效时间: {{ format(institutionData.f_effective_date) }}</p>
@@ -34,7 +34,7 @@
34
34
  @load="previewDocLoading = false" />
35
35
  </div>
36
36
  </a-modal>
37
- <a-button type="primary" @click="confirm_institution">确认</a-button>
37
+ <a-button class="submit_btn" type="primary" @click="confirm_institution">确认</a-button>
38
38
  </div>
39
39
  </template>
40
40
 
@@ -140,6 +140,11 @@ const fileServer = 'http://123.60.214.109:8406'
140
140
  </script>
141
141
 
142
142
  <style lang="less" scoped>
143
+ .submit_btn{
144
+ position: absolute;
145
+ right:0;
146
+ top: 0;
147
+ }
143
148
  .content {
144
149
  height: 80vh;
145
150
  img {
@@ -1,12 +1,9 @@
1
1
  <template>
2
2
  <div>
3
3
  <!-- 显示成功页抽屉 -->
4
- <submit-ticket-success
5
- :visible.sync="successVisible"
6
- :serialNumber="serialNumber"
7
- :category-str="categoryStr"
8
- v-if="serialNumber"
9
- />
4
+ <a-modal v-model="successVisible" title="工单状态" width="70%" :footer="null" destroy-on-close>
5
+ <submit-ticket-success v-if="serialNumber" :serialNumber="serialNumber" />
6
+ </a-modal>
10
7
  <!-- 两个使用手册弹框 -->
11
8
  <a-modal
12
9
  title="向日葵使用指南"
@@ -118,9 +115,24 @@
118
115
  <br/>
119
116
  </div>
120
117
  </a-modal>
121
- <a-card v-if="visible">
118
+ <a-modal
119
+ title="填写信息"
120
+ :visible="infoFormVisible"
121
+ @ok="onInfoFormSubmit"
122
+ @cancel="infoFormVisible = false">
123
+ <a-form-model
124
+ ref="infoFormRef"
125
+ :model="infoForm"
126
+ :label-col="{ span: 5 }"
127
+ :wrapper-col="{ span: 18 }">
128
+ <a-form-model-item label="客户名称" prop="customerName" :rules="{ required: true, message: '请输入客户名称' }">
129
+ <a-input v-model="infoForm.customerName" placeholder="请输入客户名称查询历史工单" />
130
+ </a-form-model-item>
131
+ </a-form-model>
132
+ </a-modal>
133
+ <a-card>
122
134
  <div style="text-align: right">
123
- <p>欢迎您:{{ currUser.ename }}</p>
135
+ <p>欢迎您!{{ currUser.ename }}</p>
124
136
  </div>
125
137
  <div class="submitTicketTitle">
126
138
  <span>奥枫问题反馈平台</span>
@@ -131,13 +143,19 @@
131
143
  <a-row v-if="tabActiveKey === 'workSubmit'">
132
144
  <a-col :span="18">
133
145
  <a-form :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }">
146
+ <!-- 客户名称输入 -->
147
+ <a-form-item v-if="!currUser.ename" label="客户名称">
148
+ <a-input v-model="customerName" placeholder="请输入客户名称"/>
149
+ <strong v-show="showCustomerNameAlert" style="color: red">客户名称不能为空!</strong>
150
+ </a-form-item>
134
151
  <!-- 问题类型单选框 -->
135
152
  <a-form-item label="问题类型">
136
- <a-radio-group v-model="form.category" v-for="(item,index) in $appdata.getDictionaryList('ticketCategoryMap')" :key="index">
153
+ <a-radio-group v-model="form.category" v-for="(item,index) in ticketCategoryMap" :key="index">
137
154
  <a-radio :value="item.value" class="radio-item">
138
155
  {{ item.label }}
139
156
  </a-radio>
140
157
  </a-radio-group>
158
+ <a-spin :spinning="ticketCategoryMapLoading" />
141
159
  <br/>
142
160
  <strong v-show="showCategoryAlert" style="color: red">类型不允许为空!</strong>
143
161
  </a-form-item>
@@ -153,21 +171,7 @@
153
171
  <!-- 图片上传 -->
154
172
  <a-form-item :wrapper-col="{ span: 12 }" label="问题截图">
155
173
  <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>
174
+ <upload :model="uploadModel" @setFiles="setFiles" />
171
175
  <a-modal
172
176
  :visible="previewVisible"
173
177
  :footer="null"
@@ -179,7 +183,7 @@
179
183
  </a-form-item>
180
184
  <!-- 表单底部按钮 -->
181
185
  <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
182
- <a-button type="primary" @click="onSubmit" style="margin-right: 20px" :disabled="showCategoryAlert || showPhoneAlert">
186
+ <a-button type="primary" @click="onSubmit" style="margin-right: 20px" :disabled="showCategoryAlert || showPhoneAlert || !validCustomerName">
183
187
  提交
184
188
  </a-button>
185
189
  </a-form-item>
@@ -239,14 +243,13 @@
239
243
 
240
244
  <script>
241
245
  import { TicketDetailsViewApi, post } from '@vue2-client/services/api'
242
- import { logout } from '@vue2-client/services/user'
243
246
  import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
244
- import Vue from 'vue'
247
+ import submitTicketSuccess from './submitTicketSuccess'
245
248
 
246
249
  export default {
247
250
  name: 'submitTicket',
248
251
  components: {
249
- XFormTable
252
+ XFormTable, submitTicketSuccess
250
253
  },
251
254
  data () {
252
255
  return {
@@ -267,42 +270,66 @@ export default {
267
270
  desc: undefined,
268
271
  phone: ''
269
272
  },
270
- // 获取序列号使用
271
- data: {
272
- priority: 2,
273
- category: 0,
274
- time: this.dataFormat(new Date())
275
- },
276
273
  // 工单序列号
277
274
  serialNumber: '',
278
275
  // 类别未填写警告信息控制
279
276
  showCategoryAlert: true,
280
277
  showPhoneAlert: true,
278
+ showCustomerNameAlert: true,
281
279
  // 向日葵使用指南可见性
282
280
  sunClientManualVisible: false,
283
281
  // 向日葵使用指南可见性
284
282
  toDeskManualVisible: false,
285
283
  // 为工单查询指定条件
286
284
  fixedQueryForm: {},
287
- // 工单类型在字典中显示的文字值
288
- categoryStr: '',
289
285
  // 用户信息
290
286
  currUser: {
291
- ename: '',
292
- phoneNumber: ''
287
+ ename: ''
293
288
  },
294
- visible: false,
295
- tabActiveKey: 'workSubmit'
289
+ tabActiveKey: 'workSubmit',
290
+ uploadModel,
291
+ // 客户名称
292
+ customerName: undefined,
293
+ // 问题类型选项
294
+ ticketCategoryMap: [],
295
+ ticketCategoryMapLoading: false,
296
+ // 未传入客户名称信息手动输入弹框
297
+ infoFormVisible: false,
298
+ infoForm: {
299
+ customerName: ''
300
+ }
296
301
  }
297
302
  },
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
- })
303
+ computed: {
304
+ // 检查客户名称是否为空
305
+ validCustomerName () {
306
+ return this.currUser.ename || this.customerName ? true : false
307
+ }
304
308
  },
305
- mounted () {
309
+ created () {
310
+ document.title = '奥枫问题反馈平台'
311
+ const dictionary = this.$appdata.getParams()
312
+ if (dictionary && dictionary['ticketCategoryMap']) {
313
+ console.log('pre', dictionary['ticketCategoryMap'])
314
+ this.ticketCategoryMap = dictionary['ticketCategoryMap']
315
+ } else {
316
+ this.ticketCategoryMapLoading = true
317
+ this.$appdata.load().then(() => {
318
+ this.ticketCategoryMap = this.$appdata.getDictionaryList('ticketCategoryMap')
319
+ console.log('load', this.ticketCategoryMap)
320
+ this.ticketCategoryMapLoading = false
321
+ })
322
+ }
323
+ let customerName = this.$route.query.orgName
324
+ // 分割客户名称
325
+ if (customerName) {
326
+ const partArr = customerName.split('.')
327
+ if (partArr.length === 5) {
328
+ customerName = `${partArr[1]}.${partArr[4]}`
329
+ }
330
+ }
331
+ this.currUser.ename = customerName
332
+ this.fixedQueryForm['t_uploader'] = this.currUser.ename
306
333
  },
307
334
  methods: {
308
335
  toDetail (record, id) {
@@ -317,42 +344,8 @@ export default {
317
344
  reader.onerror = error => reject(error)
318
345
  })
319
346
  },
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
347
+ setFiles (fileIds) {
348
+ this.fileList = fileIds
356
349
  },
357
350
  handleCancel () {
358
351
  this.previewVisible = false
@@ -367,50 +360,25 @@ export default {
367
360
  },
368
361
  // 提交按钮逻辑
369
362
  onSubmit () {
370
- // 根据当前日期调用logic获取订单序列号
371
- return post(TicketDetailsViewApi.getTicketSerialNumber, {
372
- priority: this.data.priority,
373
- category: this.data.category,
374
- time: this.dataFormat(new Date())
363
+ let customerName = this.currUser.ename
364
+ if (!customerName) {
365
+ customerName = this.customerName
366
+ }
367
+ const form = {
368
+ customerName,
369
+ problemType: this.form.category,
370
+ contact: this.form.phone,
371
+ problemDetail: this.form.desc,
372
+ Images: this.fileList
373
+ }
374
+ if (!this.form.desc) {
375
+ form.problemDetail = '该用户没有填写描述信息'
376
+ }
377
+ post(TicketDetailsViewApi.createTicket, { form }).then((res) => {
378
+ this.serialNumber = res
379
+ this.successVisible = true
380
+ this.$message.success('创建成功')
375
381
  })
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
382
  },
415
383
  // 点击向日葵链接
416
384
  toSunClientClick () {
@@ -420,13 +388,22 @@ export default {
420
388
  toDeskClick () {
421
389
  window.open('https://www.todesk.com/download.html')
422
390
  },
423
- logout () {
424
- logout()
425
- this.$router.push('/login')
426
- },
427
391
  // 切换标签页
428
392
  changeTab (id) {
393
+ if (id === 'workHistory' && !this.fixedQueryForm.t_uploader) {
394
+ this.infoFormVisible = true
395
+ return
396
+ }
429
397
  this.tabActiveKey = id
398
+ },
399
+ onInfoFormSubmit () {
400
+ this.$refs.infoFormRef.validate(valid => {
401
+ if (valid) {
402
+ this.fixedQueryForm['t_uploader'] = this.infoForm.customerName
403
+ this.tabActiveKey = 'workHistory'
404
+ this.infoFormVisible = false
405
+ }
406
+ })
430
407
  }
431
408
  },
432
409
  watch: {
@@ -438,9 +415,13 @@ export default {
438
415
  'form.phone' (newVal) {
439
416
  const numReg = new RegExp(/^[0-9]+$/)
440
417
  this.showPhoneAlert = !numReg.test(newVal)
418
+ },
419
+ 'customerName' (newVal) {
420
+ this.showCustomerNameAlert = !newVal
441
421
  }
442
422
  }
443
423
  }
424
+ const uploadModel = JSON.parse('{"addOrEdit":"all","resUploadStock":1,"pathKey":"cs","rule":{"type":"string","required":"false"},"isOnlyAddOrEdit":true,"acceptCount":5,"type":"image","accept":[".jpg,.jpeg,.ico,.gif,svg,.webp,.png,.bmp,.pjpeg,"],"stockAlias":"webmeter","fileRootPath":"D:\\\\nginx-resource\\\\resource\\\\","name":"图片","resUploadMode":"server","model":"Images"}')
444
425
  </script>
445
426
 
446
427
  <style scoped>
@@ -2,9 +2,9 @@
2
2
  <a-card class="result-success" :bordered="false">
3
3
  <result :is-success="icon" :description="description" :title="title">
4
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>
5
+ <span style="margin-right: 10px" v-if="countDown > 0">{{ countDown }}</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
8
  </template>
9
9
  <a-modal
10
10
  title="关闭工单"
@@ -20,8 +20,8 @@
20
20
  <div class="project-name">工单处理进度</div>
21
21
  <detail-list size="small" style="max-width: 800px; margin-bottom: 8px">
22
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>
23
+ <detail-list-item v-if="details.name" term="负责人">{{ details.name }}</detail-list-item>
24
+ <detail-list-item term="提交时间">{{ details.createdTime}}</detail-list-item>
25
25
  </detail-list>
26
26
  <a-steps :current="step" progressDot>
27
27
  <a-step title="工单提交">
@@ -60,19 +60,20 @@ const DetailListItem = DetailList.Item
60
60
  export default {
61
61
  name: 'submitTicketSuccess',
62
62
  components: { AStepItemGroup, AStepItem, DetailListItem, DetailList, Result },
63
+ props: {
64
+ // 工单序列号
65
+ serialNumber: String,
66
+ },
63
67
  data () {
64
68
  return {
65
69
  title: '提交成功',
66
- description: '您创建的工单已成功提交,请保持电话畅通,我们的工作人员将尽快与您取得联系。' +
67
- '如果需要加急,请在倒计时结束后点击加急按钮,加急后我们将优先处理您的工单',
68
- // 工单序列号
69
- serialNumber: '',
70
+ description: '您创建的工单已成功提交,请保持电话畅通,我们的工作人员将尽快与您取得联系。', // +
71
+ // '如果需要加急,请在倒计时结束后点击加急按钮,加急后我们将优先处理您的工单',
70
72
  // 工单详情
71
73
  details: {
72
74
  uploader: '',
73
75
  status: '',
74
76
  name: '',
75
- priority: undefined,
76
77
  createdTime: '',
77
78
  confirmTime: '',
78
79
  finishedTime: ''
@@ -83,9 +84,6 @@ export default {
83
84
  countDown: 0,
84
85
  // 控制加急按钮显示
85
86
  UrgentAvailable: true,
86
- // 刷新页面的定时器
87
- time: undefined,
88
- timer: undefined,
89
87
  // 取消工单确认框可见性
90
88
  closeVisible: false,
91
89
  // 控制页面大图标
@@ -93,14 +91,7 @@ export default {
93
91
  }
94
92
  },
95
93
  mounted () {
96
- this.serialNumber = this.$route.query.serialNumber
97
94
  this.getTicketDetail()
98
- this.refresh()
99
- this.countDown = 0
100
- },
101
- beforeDestroy () {
102
- this.stopTimer()
103
- this.stopTimer2()
104
95
  },
105
96
  methods: {
106
97
  format (date, format) {
@@ -117,7 +108,6 @@ export default {
117
108
  this.title = '工单已关闭'
118
109
  this.description = ''
119
110
  this.icon = false
120
- this.stopTimer()
121
111
  }, err => {
122
112
  console.error(err)
123
113
  })
@@ -130,14 +120,6 @@ export default {
130
120
  closeBtn () {
131
121
  this.closeVisible = true
132
122
  },
133
- // 过10s刷新一下页面数据
134
- refresh () {
135
- if (this.timer === undefined) {
136
- this.timer = setInterval(() => {
137
- this.getTicketDetail()
138
- }, 10 * 1000)
139
- }
140
- },
141
123
  // 对工单进行加急处理
142
124
  urgent () {
143
125
  return post(TicketDetailsViewApi.rushTicket, {
@@ -161,33 +143,6 @@ export default {
161
143
  console.log(err)
162
144
  })
163
145
  },
164
- // 格式化倒计时
165
- countDownFormat () {
166
- const hours = '00'
167
- let mins = Math.floor(this.countDown / 60)
168
- let secs = this.countDown % 60
169
- if (mins < 10) {
170
- mins = '0' + mins
171
- }
172
- if (secs < 10) {
173
- secs = '0' + secs
174
- }
175
- return hours + ':' + mins + ':' + secs
176
- },
177
- // 设置用于控制加急按钮倒计时定时器,加急按钮5分钟后才可点击
178
- setTimer () {
179
- this.countDown = 5
180
- if (this.time === undefined) {
181
- this.time = setInterval(() => {
182
- this.countDown--
183
- if (this.countDown <= 0) {
184
- this.urgentAccess = false
185
- this.stopTimer2()
186
- this.countDown = -1
187
- }
188
- }, 1000)
189
- }
190
- },
191
146
  // 获取工单详情
192
147
  getTicketDetail () {
193
148
  return post(TicketDetailsViewApi.getTicketDetailsForUploader, {
@@ -215,30 +170,10 @@ export default {
215
170
  }
216
171
  this.details.createdTime = this.format(res.createdtime, 'yyyy-MM-dd hh:mm:ss')
217
172
  this.details.status = res.status
218
- this.details.priority = res.priority
219
-
220
- // 如果当前状态为一般,设置定时器,五分钟后允许加急
221
- if (this.details.priority > 1 && this.countDown === 0) {
222
- this.setTimer()
223
- }
224
173
  }, err => {
225
174
  console.log(err)
226
175
  })
227
176
  },
228
- // 停止定时器
229
- stopTimer () {
230
- if (this.timer) {
231
- clearInterval(this.timer)
232
- this.timer = undefined
233
- }
234
- },
235
- // 停止定时器2
236
- stopTimer2 () {
237
- if (this.time) {
238
- clearInterval(this.time)
239
- this.time = undefined
240
- }
241
- }
242
177
  },
243
178
  computed: {
244
179
  // 用于进度条,进度显示控制
@@ -32,7 +32,9 @@ const TicketDetailsViewApi = {
32
32
  // 提交用户填写附加信息
33
33
  AddonDescriptionToTicket: '/webmeterapi/AddonDescriptionToTicket',
34
34
  // 获取用户填写附加信息
35
- getAddonDescription: '/webmeterapi/getAddonDescription'
35
+ getAddonDescription: '/webmeterapi/getAddonDescription',
36
+ // 发起售后工单流程
37
+ createTicket: '/webmeterapi/createTicket'
36
38
  }
37
39
 
38
40
  export { TicketDetailsViewApi }
@@ -58,8 +58,10 @@ async function request (url, method, params, config) {
58
58
  function setAuthorizationV4 (auth, authType = AUTH_TYPE.BEARER) {
59
59
  switch (authType) {
60
60
  case AUTH_TYPE.BEARER:
61
- Cookie.set(v4TokenName, 'Bearer ' + auth.token)
62
- Cookie.set(v4TokenExpire, 'Bearer ' + auth.expire)
61
+ if (auth.token) {
62
+ Cookie.set(v4TokenName, 'Bearer ' + auth.token)
63
+ Cookie.set(v4TokenExpire, 'Bearer ' + auth.expire)
64
+ }
63
65
  break
64
66
  case AUTH_TYPE.BASIC:
65
67
  case AUTH_TYPE.AUTH1:
@@ -95,7 +97,9 @@ function removeAuthorizationV4 (authType = AUTH_TYPE.BEARER) {
95
97
  function setAuthorization (auth, authType = AUTH_TYPE.BEARER) {
96
98
  switch (authType) {
97
99
  case AUTH_TYPE.BEARER:
98
- Cookie.set(xsrfHeaderName, 'Bearer ' + auth.token, { expires: auth.expireAt })
100
+ if (auth.token){
101
+ Cookie.set(xsrfHeaderName, 'Bearer ' + auth.token, { expires: auth.expireAt })
102
+ }
99
103
  break
100
104
  case AUTH_TYPE.BASIC:
101
105
  case AUTH_TYPE.AUTH1: