vue2-client 1.2.69 → 1.2.72

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.
@@ -121,7 +121,7 @@
121
121
  <a-select
122
122
  v-if="!attr.lazyLoad || attr.lazyLoad === 'false'"
123
123
  v-model="form[attr.model]"
124
- :disabled="disabled || !selectsArray[attr.group] || !selectsArray[attr.group][attr.groupIndex] || (selectsArray[attr.group][attr.groupIndex] && selectsArray[attr.group][attr.groupIndex].length === 0)"
124
+ :disabled=" attr.groupIndex>1 && (disabled || !selectsArray[attr.group] || !selectsArray[attr.group][attr.groupIndex] || (selectsArray[attr.group][attr.groupIndex] && selectsArray[attr.group][attr.groupIndex].length === 0))"
125
125
  @change="selectsItemCheck(attr.group, attr.groupIndex, form[attr.model])"
126
126
  show-search
127
127
  :getPopupContainer=" triggerNode => { return triggerNode.parentNode } "
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <div>
3
3
  <a-drawer
4
+ ref="QueryParamsDetailsView"
4
5
  title="查询配置详情"
5
6
  placement="right"
6
7
  :width="isMobile ? screenWidth : screenWidth * 0.85"
@@ -8,10 +9,19 @@
8
9
  @close="onClose"
9
10
  >
10
11
  <create-query
11
- :to-edit-json="getColumnJson()"
12
+ :to-edit-json="editJson"
12
13
  :visible.sync="createQueryVisible"
13
14
  @saveQueryParams="saveQueryParams"
14
15
  />
16
+ <a-modal
17
+ title="导入JSON配置"
18
+ :visible="importJsonVisible"
19
+ @ok="importJsonHandleOk"
20
+ :getContainer="getContainer"
21
+ @cancel="importJsonVisible = false"
22
+ >
23
+ <a-textarea v-model="ImportEditJson" placeholder="输入现有的JSON配置"/>
24
+ </a-modal>
15
25
  <a-spin :spinning="loadDetails">
16
26
  <a-page-header :title="details.f_name+(details.f_remark ? '(' + details.f_remark + ')' : '')">
17
27
  <div class="row">
@@ -40,11 +50,17 @@
40
50
  </a-tabs>
41
51
  <div v-if="!loadDetails">
42
52
  <div v-if="tabActiveKey === '1'">
43
- <a-button type="primary" @click="toCreateQuery">
44
- <a-icon :style="iconStyle" type="api"/>编辑查询配置
45
- </a-button>
53
+ <a-space>
54
+ <a-button type="primary" @click="toCreateQuery">
55
+ <a-icon :style="iconStyle" type="edit"/>编辑查询配置
56
+ </a-button>
57
+ <a-button type="primary" @click="importJsonVisible = true">
58
+ <a-icon :style="iconStyle" type="api"/>导入查询配置
59
+ </a-button>
60
+ </a-space>
61
+
46
62
  <a-card title="查询配置预览" :bordered="true" size="small" style="margin-top: 20px;">
47
- <json-viewer :copyable="{copyText: '复制', copiedText: '已复制'}" :value="getColumnJson()" :expand-depth="parseInt('100')" style="overflow: auto;max-height: 440px"></json-viewer>
63
+ <json-viewer :copyable="{copyText: '复制', copiedText: '已复制'}" :value="editJson" :expand-depth="parseInt('100')" style="overflow: auto;max-height: 440px"></json-viewer>
48
64
  </a-card>
49
65
  </div>
50
66
  </div>
@@ -89,6 +105,12 @@ export default {
89
105
  f_input_date: '',
90
106
  f_inputtor: ''
91
107
  },
108
+ // 查询表单配置json
109
+ editJson: {},
110
+ ImportEditJson: '',
111
+ // importJsonVisible
112
+ // 导入json对话框
113
+ importJsonVisible: false,
92
114
  tabList: [
93
115
  { key: '1', tab: '编辑查询配置' }
94
116
  ],
@@ -115,20 +137,28 @@ export default {
115
137
  }
116
138
  },
117
139
  methods: {
140
+ // 获取model渲染上下文
141
+ getContainer () {
142
+ // return document.getElementById('QueryParamsDetailsView')
143
+ return this.$refs.QueryParamsDetailsView.$el
144
+ },
118
145
  // 初始化组件
119
146
  initView () {
120
147
  this.tabActiveKey = '1'
148
+ this.editJson = {}
121
149
  this.getDetails(this.id)
122
150
  },
123
151
  toCreateQuery () {
124
152
  this.createQueryVisible = true
125
153
  },
126
- getColumnJson () {
127
- if (this.details.f_content) {
128
- return JSON.parse(this.details.f_content)
129
- } else {
130
- return {}
154
+ importJsonHandleOk () {
155
+ try {
156
+ const temp = JSON.parse(this.ImportEditJson)
157
+ this.editJson = temp
158
+ } catch (e) {
159
+ this.$message.warn('操作失败,输入配置不是JSON格式')
131
160
  }
161
+ this.importJsonVisible = false
132
162
  },
133
163
  onClose () {
134
164
  this.$emit('update:visible', false)
@@ -141,6 +171,9 @@ export default {
141
171
  }).then(res => {
142
172
  this.details = res
143
173
  this.loadDetails = false
174
+ if (this.details.f_content) {
175
+ this.editJson = JSON.parse(this.details.f_content)
176
+ }
144
177
  }, err => {
145
178
  this.loadDetails = false
146
179
  console.error(err)
@@ -14,39 +14,53 @@
14
14
  @cancel="handleTransferCancel"
15
15
  :zIndex="1001"
16
16
  >
17
- <a-input placeholder="请输入要转移工单的员工名" v-model="transferTo" @blur="checkEmp" @change="inputChange"/>
18
- <div class="nameOptions" v-show="nameOptionsVisible">
19
- <p class="nameOptionsItem" v-for="(item,index) in nameOptionsForChoose" :key="index" @click="chooseName(item.name)">{{ item.name }}</p>
20
- </div>
21
- <span v-if="!transferCheck" style="color: red">您输入的员工不存在,请检查后再试</span>
22
- <span v-else style="color: green">您输入的员工已确认,可以进行工单转移</span>
23
- <a-form-model-item label="留言">
24
- <a-input v-model="note" type="textarea" />
25
- </a-form-model-item>
26
- <div class="clearfix">
27
- <a-upload
28
- name="avatar"
29
- list-type="picture-card"
30
- :before-upload="beforeUpload"
31
- action="/webmeteruploadapi/upload"
32
- :file-list="fileList"
33
- @preview="handlePreview"
34
- @change="handleChange"
35
- :remove="remove"
36
- >
37
- <div v-if="fileList.length < 5">
38
- <a-icon type="plus" />
39
- <div class="ant-upload-text">点击上传</div>
17
+ <a-form-model ref="transmitFormRef" :label-col="{ span: 4 }" :wrapper-col="{ span: 16 }" :model="transmitForm" :rules="{ transferTo: { required: true, message: '移交人必填' }, note: { required: true, message: '备注不能为空' } }">
18
+ <a-form-model-item label="移交给" prop="transferTo">
19
+ <a-select
20
+ v-model="transmitForm.transferTo"
21
+ placeholder="请输入移交人"
22
+ :show-arrow="false"
23
+ :filter-option="false"
24
+ :not-found-content="null"
25
+ :options="nameOptionsFiltered"
26
+ show-search
27
+ style="width: 150px"
28
+ @search="employeeNameSearch" />
29
+ </a-form-model-item>
30
+ <a-form-model-item label="留言" prop="note">
31
+ <a-textarea v-model="transmitForm.note" :rows="3" placeholder="请输入移交留言" />
32
+ </a-form-model-item>
33
+ <a-form-model-item label="上传图片">
34
+ <div class="clearfix">
35
+ <a-upload
36
+ name="avatar"
37
+ list-type="picture-card"
38
+ :before-upload="beforeUpload"
39
+ action="/webmeteruploadapi/upload"
40
+ :file-list="fileList"
41
+ @preview="handlePreview"
42
+ @change="handleChange"
43
+ :remove="remove"
44
+ >
45
+ <div v-if="fileList.length < 5">
46
+ <a-icon type="plus" />
47
+ <div class="ant-upload-text">点击上传</div>
48
+ </div>
49
+ </a-upload>
40
50
  </div>
41
- </a-upload>
42
- <a-modal
43
- :visible="previewVisible"
44
- :footer="null"
45
- @cancel="handleCancel"
46
- >
47
- <img style="width: 100%" :src="previewImage" alt="图片上传"/>
48
- </a-modal>
49
- </div>
51
+ </a-form-model-item>
52
+ </a-form-model>
53
+ </a-modal>
54
+ <!-- 图片预览弹框 -->
55
+ <a-modal
56
+ :visible="previewVisible"
57
+ :footer="null"
58
+ :z-index="1001"
59
+ :dialog-style="{ top: '30px' }"
60
+ width="90%"
61
+ @cancel="handleCancel"
62
+ >
63
+ <img style="width: 100%" :src="previewImage" alt="上传图片"/>
50
64
  </a-modal>
51
65
  <!-- 关闭工单确认框 -->
52
66
  <a-modal
@@ -239,14 +253,13 @@
239
253
  selectedImageShow: false,
240
254
  // 当前步骤
241
255
  step: 0,
242
- // 校验转移员工是否存在
243
- transferCheck: false,
244
256
  // 移交工单窗口可见性
245
257
  transVisible: false,
246
- // 转移工单对象
247
- transferTo: '',
248
- // 新增留言
249
- note: '',
258
+ // 移交表单
259
+ transmitForm: {
260
+ transferTo: undefined,
261
+ note: ''
262
+ },
250
263
  // 控制关闭订单按钮可用性
251
264
  disableCloseBtn: false,
252
265
  // 控制关闭工单确认框显示
@@ -261,10 +274,8 @@
261
274
  timer: undefined,
262
275
  // 所有员工姓名
263
276
  nameOptions: [],
264
- // 员工姓名备选
265
- nameOptionsForChoose: [],
266
- // 员工姓名备选项显示控制
267
- nameOptionsVisible: false,
277
+ // 结果筛选的员工信息
278
+ nameOptionsFiltered: [],
268
279
  // 工单流转抽屉可见性
269
280
  workFlowVisible: false,
270
281
  // 控制小加载指示物显示
@@ -275,8 +286,6 @@
275
286
  descriptionLoading: false,
276
287
  // 用于刷新按钮倒计时显示
277
288
  btnCountdownText: 5,
278
- // 当前登陆用户在数据库表中id,临时使用,之后会替换
279
- empIdInDataBase: undefined
280
289
  }
281
290
  },
282
291
  mounted () {
@@ -300,23 +309,12 @@
300
309
  this.stopTimer()
301
310
  },
302
311
  methods: {
303
- // 转移员工姓名change事件,用于展示备选
304
- inputChange () {
305
- if (this.transferTo.length === 0) {
306
- this.nameOptionsVisible = false
307
- } else {
308
- this.nameOptionsVisible = true
309
- var inputName = this.transferTo
310
- this.nameOptionsForChoose = this.nameOptions.filter(function (element) {
311
- return element.name.indexOf(inputName) !== -1
312
- })
312
+ employeeNameSearch (input) {
313
+ if (!input) {
314
+ this.nameOptionsFiltered = []
315
+ return
313
316
  }
314
- },
315
- // 在候选框中点击了名称
316
- chooseName (name) {
317
- this.nameOptionsVisible = false
318
- this.transferTo = name
319
- this.checkEmp()
317
+ this.nameOptionsFiltered = this.nameOptions.filter(item => item.name.includes(input)).map(item => ({ label: item.name, value: item.id }))
320
318
  },
321
319
  // 获取所有员工名,供输入框备选
322
320
  getAllEmpNames () {
@@ -495,11 +493,10 @@
495
493
  },
496
494
  // 确认工单按钮业务逻辑
497
495
  confirmTicketBtn () {
498
- this.getCurrentEmpId()
499
496
  return post(TicketDetailsViewApi.confirmTicket, {
500
497
  ticketId: this.ticketId,
501
498
  time: this.format(new Date(), 'yyyy-MM-dd hh:mm:ss'),
502
- empId: this.empIdInDataBase
499
+ empId: this.currUser.id
503
500
  })
504
501
  .then(res => {
505
502
  if (res !== 0) {
@@ -514,32 +511,10 @@
514
511
  this.initView()
515
512
  })
516
513
  },
517
- // 获取当前登陆员工ID
518
- getCurrentEmpId () {
519
- return post(EmployeeDetailsViewApi.getEmployeeId, {
520
- name: this.currUser.ename
521
- })
522
- .then(res => {
523
- this.empIdInDataBase = res
524
- }, err => {
525
- console.log(err)
526
- })
527
- },
528
514
  // 转移工单按钮业务逻辑
529
515
  transferBtn () {
530
516
  this.transVisible = true
531
517
  },
532
- checkEmp () {
533
- return post(EmployeeDetailsViewApi.findEmpName, {
534
- empName: this.transferTo
535
- })
536
- .then(res => {
537
- const num = res
538
- this.transferCheck = num !== 0
539
- }, err => {
540
- console.error(err)
541
- })
542
- },
543
518
  // 获取工单状态撤销or关闭
544
519
  getStatus () {
545
520
  if (this.details.status === 2) {
@@ -554,22 +529,15 @@
554
529
  },
555
530
  // 转移工单确认后逻辑
556
531
  handleTransferOk () {
557
- if (!this.transferCheck) {
558
- this.$message.error(
559
- '请先检查您输入的员工名',
560
- 2
561
- )
562
- } else {
563
- return post(TicketDetailsViewApi.transferTicketToOthers, {
532
+ this.$refs['transmitFormRef'].validate().then(() => {
533
+ post(TicketDetailsViewApi.transferTicketToOthers, {
564
534
  ticketId: this.ticketId,
565
535
  endTime: this.format(new Date(), 'yyyy-MM-dd hh:mm:ss'),
566
- transferTo: this.transferTo,
567
- note: this.note,
536
+ ...this.transmitForm,
568
537
  images: this.fileList
569
538
  })
570
539
  .then(res => {
571
540
  const result = res
572
- this.note = ''
573
541
  this.transVisible = false
574
542
  if (result === 1) {
575
543
  this.$message.success(
@@ -577,9 +545,7 @@
577
545
  5
578
546
  )
579
547
  this.fileList = []
580
- this.transferTo = ''
581
- this.transferCheck = false
582
- this.initView()
548
+ this.$refs['transmitFormRef'].resetFields()
583
549
  } else {
584
550
  this.$message.error('工单已被他人处理或关闭,请刷新再试', 5)
585
551
  }
@@ -589,14 +555,12 @@
589
555
  console.error(err)
590
556
  this.transVisible = false
591
557
  })
592
- }
558
+ })
593
559
  },
594
560
  // 转移工单取消后逻辑
595
561
  handleTransferCancel () {
596
562
  this.transVisible = false
597
- this.transferCheck = false
598
- this.transferTo = ''
599
- this.note = ''
563
+ this.$refs['transmitFormRef'].resetFields()
600
564
  },
601
565
  // 关闭抽屉时回调
602
566
  onClose () {
@@ -837,17 +801,4 @@
837
801
  z-index: 9998;
838
802
  background-color: rgba(0,0,0,0.7);
839
803
  }
840
- .nameOptionsItem {
841
- padding-left: 5px;
842
- margin-bottom: 2px;
843
- }
844
- .nameOptionsItem:hover {
845
- background-color: rgb(209,233,255);
846
- }
847
- .nameOptionsItem:last-of-type {
848
- margin-bottom: 0px;
849
- }
850
- .nameOptions {
851
- border: rgba(0,0,0,0.4) solid 1px;
852
- }
853
804
  </style>
@@ -5,12 +5,8 @@ const EmployeeDetailsViewApi = {
5
5
  getConfirmTicketsCountWeekly: '/webmeterapi/getConfirmTicketsCountWeekly',
6
6
  // 查询:获取员工上一周完成工单数量
7
7
  getFinishedTicketsCountWeekly: '/webmeterapi/getFinishedTicketsCountWeekly',
8
- // 查询:是否存在此员工
9
- findEmpName: '/webmeterapi/findEmpName',
10
8
  // 查询:获取所有员工名,供前端展示备选项
11
9
  getAllEmployeeName: '/webmeterapi/getAllEmployeeName',
12
- // 查询:根据员工名,获取员工id
13
- getEmployeeId: '/webmeterapi/getEmployeeId'
14
10
  }
15
11
 
16
12
  export { EmployeeDetailsViewApi }