telephone-clients 4.0.0-1-19 → 4.0.0-1-21

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,934 +1,981 @@
1
- <template xmlns:v-validate="http://www.w3.org/1999/xhtml">
2
- <div class="auto select-overspread form-horizontal auto" id="pc-repair-work">
3
- <work-busy :is-busy="saveing" v-show="saveing"></work-busy>
4
- <validator name="v">
5
- <div class="row">
6
- <div class="col-sm-6 form-group form-fix-width">
7
- <label class="font_normal_body" style="width: 30%">来电电话</label>
8
- <input style="width: 60%" type="text" readonly v-model='model.f_phone' class="form-control"></input>
9
- </div>
10
- <div class="col-sm-6 form-group form-fix-width">
11
- <label class="font_normal_body" for="f_user_name" :class="model.f_user_name ? '': 'class-error' "
12
- style="width: 30%">客户姓名</label>
13
- <input style="width: 60%" type="text" v-model='model.f_user_name' id="f_user_name" name="f_user_name"
14
- class="form-control"/>
15
- </div>
16
- <div class="col-sm-6 form-group form-fix-width">
17
- <label for="f_area" class="font_normal_body" style="width: 30%">客户类型</label>
18
- <v-select :value.sync="model.f_user_type" :value-single="true"
19
- :options='usertypes' placeholder='用户类型'
20
- close-on-select style="width: 60%">
21
- </v-select>
22
- </div>
23
-
24
- <div class="col-sm-6 form-group form-fix-width">
25
- <label class="font_normal_body " for="f_contact_phone" :class="model.f_contact_phone ? '' : 'class-error'"
26
- style="width: 30%">联系电话</label>
27
- <input style="width: 60%" type="text" v-model='model.f_contact_phone' id="f_contact_phone"
28
- class="form-control"/>
29
- </div>
30
- <div class="col-sm-12 form-group form-fix-width">
31
- <label for="f_address" class="font_normal_body" style="width: 15%">详细地址</label>
32
- <input style="width: 80%" type="text" class="form-control" v-model="model.f_address" id="f_address"
33
- placeholder="详细地址"
34
- v-el:address v-next-el="idnumber"
35
- />
36
- </div>
37
- <span class="col-sm-12" style="color: red;margin-left: 100px;"
38
- v-if="serviceList">工单编号:{{ serviceList.f_service_id }}此地址下有工单未处理完成</span>
39
- </div>
40
-
41
- <div class="col-sm-6 form-group form-fix-width" v-if="selectSendshow && operType != '修改工单'">
42
- <label class="font_normal_body" style="width: 30%">转接方式</label>
43
- <div class="form-control">
44
- <label v-for="handling1 in handling">
45
- <input style="width: 60%" type="radio"
46
- v-model="model.f_handlingtype"
47
- value="{{handling1.label}}">
48
- {{ handling1.label }}
49
- </label>
50
- </div>
51
- </div>
52
- <div class="row">
53
- <div class="col-sm-6 form-group form-fix-width">
54
- <label for="f_repair" class="font_normal_body" style="width: 30%">报修类型</label>
55
- <v-select :value.sync="model.f_repairtype" :value-single="true"
56
- :options='repairstypes' placeholder='报修类型'
57
- close-on-select style="width: 60%">
58
- </v-select>
59
- </div>
60
- <div class="col-sm-6 form-group form-fix-width" v-if="operType != '修改工单'">
61
- <label class=" font_normal_body" style="width: 30%">派单类型</label>
62
- <v-select :value.sync="model.f_handlingtype" :value-single="true"
63
- :options='handling' placeholder='请选择派单类型'
64
- close-on-select
65
- style="width: 60%"></v-select>
66
- </div>
67
- <div class="col-sm-6 form-group form-fix-width" :class="[$v.f_reciever.required ? 'select-error' : '']"
68
- v-if="meading == '转站点' && operType != '修改工单'">
69
- <label class=" font_normal_body" for="f_reciever" style="width: 30%">选择站点</label>
70
- <input style="width: 60%" type="text" v-show="false" v-model="serviceacitivity.f_reciever"
71
- v-validate:f_reciever='{ required: true }'>
72
- <right-tree islist :userid="userid" :source="source" v-on:re-res="reres" :textContent="选择站点管理员"
73
- :selectData="" v-ref:f_reciever>
74
-
75
- </right-tree>
76
- </div>
77
- <div class="col-sm-6 form-group form-fix-width" :class="[$v.f_reciever.required ? 'select-error' : '']"
78
- v-if="meading == '转维修员' && operType != '修改工单'">
79
- <label class="font_normal_body" style="width: 30%">维&ensp;修&ensp;员</label>
80
- <v-select :value="model.serviceacitivity[0].f_reciever" :value-single="true"
81
- :options='repairers' placeholder='请选择维修员'
82
- close-on-select v-on:change="repiarmancg" style="width: 60%"></v-select>
83
- </div>
84
- <div class="col-sm-6 form-group form-fix-width">
85
- <label class=" font_normal_body" style="width: 30%">工单来源</label>
86
- <v-select :value="model.f_source" :value-single="true"
87
- :options='sources' placeholder='请选择工单来源'
88
- close-on-select
89
- v-on:change="sourcechange" style="width: 60%"></v-select>
90
- </div>
91
- <div class="col-sm-6 form-group form-fix-width">
92
- <label class=" font_normal_body" style="width: 30%">截止天数</label>
93
- <v-select :value="model.day" :value-single="true"
94
- v-model="model.day"
95
- :options='days' placeholder='请选择截止天数'
96
- close-on-select
97
- v-on:change="daychange" style="width: 60%"></v-select>
98
- </div>
99
-
100
- <div class="col-sm-6 form-group form-fix-width">
101
- <label class=" font_normal_body" style="width: 30%">截止时间</label>
102
- <datepicker placeholder="请选择截至时间"
103
- :value.sync="model.f_finish_date"
104
- v-model="model.f_finish_date"
105
- :format="'yyyy-MM-dd HH:mm:ss'"
106
- style="width: 60%"
107
- :disabled="flag"></datepicker>
108
- </div>
109
-
110
- </div>
111
- <failure-edit :value="model.failure" @input="procFailure"></failure-edit>
112
-
113
- <div class="row" v-if="remarksList">
114
- <div class="col-sm-12 form-input-group form-fix-width">
115
- <label class="font_normal_body" style="width: 15%">备&emsp;&emsp;注</label>
116
- <v-select :value.sync="f_remarks"
117
- v-model="f_remarks"
118
- :options='remarksList'
119
- placeholder='请选择备注'
120
- v-on:change="modifyRemarks"
121
- :value-single="true"
122
- close-on-select
123
- style="width: 80%"></v-select>
124
- </div>
125
- </div>
126
- <div class="row">
127
- <div class="col-sm-12 form-input-group form-fix-width">
128
- <label class="font_normal_body" style="width: 15%" v-if="remarksList"></label>
129
- <label class="font_normal_body" style="width: 15%" v-if="!remarksList">{{remarksList?'':'备&emsp;&emsp;注' }}</label>
130
- <textarea style="width: 80%" name="name" rows="3" class="ver-textarea" class="form-control"
131
- v-model='model.f_remarks'></textarea>
132
-
133
- <!-- <div class="form-control" style="width: 80%;float: left;min-height: 100px;position: relative;">{{ f_remarks }}</div>-->
134
- </div>
135
- </div>
136
- <div class="row">
137
- <button type="button" name="button" class="btn btn-difault" v-if="operType !== '报修'" @click="$emit('cancel')">
138
- 取消
139
- </button>
140
- <!--<button type="button" name="button" class="btn btn-danger btn-ln fr" @click="save" :disabled='IsClickDisabled'>-->
141
- <button type="button" name="button" style="float: right" class="button_spacing button_search" @click="save" :disabled="idisabled">
142
- 提交
143
- </button>
144
- <button type="button" name="button" style="background-color: #5ac0d9;border-radius: 4px;float: right"
145
- v-if="operType == '报修'" class="button_spacing button_search" @click="cleardata()">
146
- 清空
147
- </button>
148
- </div>
149
- </validator>
150
- </div>
151
- </template>
152
-
153
- <script>
154
- import FailureEdit from '../pc/FailureEdit'
155
- import {HttpResetClass} from 'vue-client'
156
- import * as Util from '../Util'
157
-
158
- // 获取派单类型, 类型 : 转站点,转维修员,自选模式
159
- let getSendType = async function (self) {
160
- try {
161
- // 如果初始化为派维修员,则不获取配置文件
162
- if (self.meading == '转维修员') {
163
- self.model.f_handlingtype = '转维修员'
164
- } else {
165
- let http = new HttpResetClass()
166
- let result = await http.load('GET', `rs/vue/sendType.json`, {}, {resolveMsg: null, rejectMsg: null})
167
- //tag
168
- if (result.data.sendType == '自选模式') {
169
- self.selectSendshow = true
170
- } else {
171
- // 转站点/转维修员
172
- if (result.data.sendType == '转维修员') {
173
- self.model.f_handlingtype = '转维修员'
174
- }
175
- self.meading = result.data.sendType
176
- }
177
- }
178
- } catch (e) {
179
- //tag
180
- } finally {
181
- // 获取维修员
182
- if (self.meading == '转维修员') {
183
- self.repairers = []
184
- self.getEmp("维修员")
185
- }
186
- self.model.f_user_type = "民用"
187
- if (self.operType === '报修') {
188
- self.assignObj()
189
- } else if (self.operType === '重新派单') {
190
- // 通过当前登录人获取需要重新派发单子,也可对单子进行修改
191
- self.setModifyOrder()
192
- } else if (self.operType === '修改工单') {
193
- // 通过传入数据,查询出工单,选择站点将不可点击
194
- self.setModifyOrder()
195
- }
196
- }
197
- }
198
- // 工作类型对应的各项设置
199
- const config = {
200
- '报修': {
201
- url: 'af-telephone/rs/logic/callerSend'
202
- },
203
- '重新派单': {
204
- url: 'af-telephone/rs/logic/resend'
205
- },
206
- '修改工单': {
207
- url: 'af-telephone/rs/logic/modifyOrder'
208
- },
209
- }
210
-
211
- export default {
212
- title: '报修单',
213
- props: {
214
- data: { // 用户基本信息
215
- type: Object,
216
- default: null
217
- },
218
- type: { // 类型,为区分复选框,当组件重用并切重用组件同时出现,复选框id相同时会有干扰,
219
- type: String
220
- },
221
- callObj: { // 话务对象
222
- type: Object,
223
- default: null
224
- },
225
- loginUser: {
226
- type: Object
227
- },
228
- modifyOrder: { // 修改工单传入得工单信息
229
- type: Object
230
- },
231
- operType: { // 操作类型,有报修,重新派单,修改工单,其中修改时,选择站点将不可点击,重新派单和修改要先将工单查询出来
232
- type: String,
233
- default: '报修'
234
- },
235
- meading: {
236
- type: String,
237
- default: '转维修员'
238
- },
239
- telsource: {
240
- type: String,
241
- default: '转维修员'
242
- },
243
- // 其他类型工单提交,清空控制
244
- cleantf: {
245
- type: Number
246
- }
247
- },
248
- data() {
249
- return {
250
- idisabled:false,
251
- saveing: false,
252
- selectSendshow: false,
253
- // 选择小区树参数
254
- // villagedata: {
255
- // f_locationId: this.$login.f.parent.parentid,
256
- // f_locationType: 't_organization'
257
- // },
258
- addressshow: false,
259
- addressselect: false,
260
- phoneValid: false,
261
- flag: true,
262
- residential: [],
263
- row: {
264
- f_residential_area: ''
265
- },
266
- residentialquery: '',
267
- servicesource: '话务来电', // 工单来源
268
- areacondition: '',
269
- testdata: {f_equipment: ''},
270
- residentialTemplate: 'f_villagename',
271
- unitTemplate: 'f_unitname',
272
- model: {
273
- // 一次派单
274
- serviceacitivity: [{
275
- f_service_acitivity_type: '派单'
276
- }],
277
- day: '1',
278
- f_small_area: '',
279
- f_finish_date: '',
280
- f_source: '话务来电',
281
- f_service_id: '',
282
- f_contact_phone: '',
283
- f_meetunit: '',
284
- f_phone: '',
285
- f_user_name: '',
286
- failure: '',
287
- f_address: '',
288
- f_json: '',
289
- f_repair_date: Util.getNowDate(),
290
- f_card_id: '',
291
- // f_department: '', 站点选择
292
- f_reciever: '',
293
- f_user_type: '',
294
- failure_str: '',
295
- f_area: '',
296
- f_unit_name: '',
297
- f_street: '',
298
- f_residential_area: '',
299
- f_building: '',
300
- f_unit: '',
301
- f_floor: '',
302
- f_room: '',
303
- aState: null,
304
- f_handlingtype: '转维修员',
305
- f_repairtype: '',
306
- f_orgid: this.$login.f.orgid,
307
- f_orgname: this.$login.f.orgs,
308
- f_depname: this.$login.f.dops,
309
- f_depid: this.$login.f.depids,
310
- f_operator: this.$login.f.name,
311
- f_operatorid: this.$login.f.id,
312
- f_remarks:'', // 实际备注
313
- f_filiale: '',
314
- f_filiale_id: '',
315
- f_meternumber: ''//表号
316
- },
317
- f_remarks:'',// 备注快捷选择
318
- types: [],
319
- information: [], // 用来存放字表信息
320
- serviceList: null, // 用来存放查询当前地址下的未完成工单
321
- id: '', // 编写测试时会使用
322
- f_service_id: '',// 编写测试时会使用
323
- repairstypes: this.$appdata.getParam('报修类型'),
324
- usertypes: this.$appdata.getParam('用户类型'),
325
- // stands : this.$appdata.getParam('站点管理员'),
326
- sources: this.$appdata.getParam('工单来源'),
327
- days: this.$appdata.getParam('截止天数'),
328
- remarksList:this.$appdata.getParam('报修单备注可选项'), //可选备注列表
329
- handling: [{label: '转站点', value: '转站点'}, {label: '转维修员', value: '转维修员'}],
330
- source:
331
- 'dep=this.getParentByType($organization$).getSpecialResByType($department$),' +
332
- 'tool.getFullTree(dep.where(row.hasSpecialRole($派单员$)))',
333
- userid: this.$login.f.id,
334
- is_to_other: false,
335
- repairers: [] // 维修员
336
- }
337
- },
338
- ready() {
339
- // 获取sendType.json配置信息 获取派单类型 转站点,转维修员,自选模式
340
- getSendType(this)
341
- if (this.$appdata.getSingleValue('转班组长') && this.$appdata.getSingleValue('转班组长') == 'true') {
342
- this.is_to_other = true
343
- this.source = 'dep=this.getParentByType($organization$).getSpecialResByType($department$),tool.getFullTree(dep.where(row.hasSpecialRole($班组长$)))'
344
- }
345
- this.model.f_source = this.telsource == '转维修员' ? '部门派单' : '话务来电';
346
- this.model.f_finish_date = this.getSecondDay(1)
347
- },
348
- methods: {
349
- getSecondDay(val){
350
- let t = new Date();
351
- let t1 = t.getTime()
352
- val = val * 1000
353
- t.setTime(t1 + val * 60 * 60 * 24);
354
- let Y = t.getFullYear() + '-'
355
- let M = (t.getMonth() + 1 < 10 ? '0' + (t.getMonth() + 1) : t.getMonth() + 1) + '-'
356
- let D = (t.getDate() < 10 ? '0' + t.getDate() : t.getDate()) + ' '
357
- let h = (t.getHours() < 10 ? '0' + t.getHours() : t.getHours()) + ':'
358
- let m = (t.getMinutes() < 10 ? '0' + t.getMinutes() : t.getMinutes()) + ':'
359
- let s = t.getSeconds() < 10 ? '0' + t.getSeconds() : t.getSeconds()
360
- return Y + M + D + h + m + s
361
- },
362
- // 当维修员发生改变,获取维修员手机号
363
- repiarmancg(val) {
364
- if (val) {
365
- //tag
366
- if (typeof val == 'string') {
367
- this.model.serviceacitivity[0].f_reciever = val
368
- let http1 = new HttpResetClass()
369
- http1.load('POST', 'af-telephone/rs/sql/tel_singleTable_OrderBy', {
370
- data: {
371
- items: 'f_user_telephone',
372
- tablename: 't_user',
373
- condition: `name = '${val}'`,
374
- orderitem: 'id'
375
- }
376
- }, {resolveMsg: null, rejectMsg: null}).then((ress) => {
377
- this.model.f_repairman_phone = ress.data[0].f_user_telephone
378
- })
379
- }
380
- }
381
- },
382
- // 当工单来源属性发生改变
383
- sourcechange(val) {
384
- if (val == undefined || val == '') {
385
- return
386
- }
387
- this.model.f_source = val
388
- this.servicesource = val
389
- },
390
- daychange(val) {
391
- this.model.day = val
392
- if (val == '其他') {
393
- this.flag = false
394
- } else {
395
- if(val){
396
- this.flag = true
397
- this.model.f_finish_date = this.getSecondDay(val)
398
- }else {
399
- this.model.f_finish_date = this.getSecondDay(1)
400
- }
401
-
402
- }
403
- },
404
- // 获取维修员
405
- getEmp(role) {
406
- this.repairers = []
407
- // let val = {source: 'tool.getChildrenOfResName($维修员$)', userid: `${this.$login.f.id}`}
408
- let val = {
409
- source: `this.getParentByType($organization$).getChildByName($${role}$).getUsers()`,
410
- userid: `${this.$login.f.id}`
411
- }
412
- // let val = {source: 'this.getParentByType($department$).getChildByName($置换员$).getUsers()', userid: `${this.$login.f.id}`}
413
- let http = new HttpResetClass()
414
- http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
415
- // let result = res.data.filter(res=>res.orgid==this.$login.f.orgid)
416
- res.data.forEach((item) => {
417
- if (item.state == '在职') {
418
- this.repairers.push({label: `${item.name}`, value: item.name})
419
- }
420
- })
421
- })
422
- },
423
- adressslect(val) {
424
- if (val == "NO") {
425
- this.addressshow = true
426
- this.addressselect = true
427
- } else {
428
- this.addressshow = false
429
- this.addressselect = false
430
- }
431
- },
432
- // 控制地址管理组件显示与否
433
- adressoff(val) {
434
- if (val == "NO") {
435
- this.addressshow = true
436
- this.addressselect = false
437
- } else {
438
- this.addressshow = false
439
- this.addressselect = true
440
- }
441
- },
442
- // 截取字符串
443
- interceptString(val) {
444
- },
445
- // 选中地址
446
- rerefParent(val, addstr) {
447
- var rows = val.rows
448
- let num = 0
449
- this.model.f_addressjson = JSON.stringify(rows)
450
- this.model.f_addressid = val.id
451
- if (rows.length > 0) {
452
- let arrid = this.model.f_addressid.split('.')
453
- for (let i = 0; i < rows.length; i++) {
454
- if (rows[i].type === '楼号') {
455
- this.model.f_building = rows[i].name
456
- } else if (rows[i].type === '楼层') {
457
- this.model.f_floor = rows[i].name
458
- } else if (rows[i].type === '门牌号') {
459
- this.model.f_room = rows[i].name
460
- this.model.f_room_id = arrid[i]
461
- } else if (rows[i].type === '区') {
462
- this.model.f_area = rows[i].name
463
- } else if (rows[i].type === '街道') {
464
- this.model.f_street = rows[i].name
465
- } else if (rows[i].type === '小区') {
466
- this.model.f_residential_area = rows[i].name
467
- this.model.f_districtname_id = arrid[i]
468
- } else if (rows[i].type === '单元') {
469
- this.model.f_unit = rows[i].name
470
- }
471
- }
472
- }
473
- // this.address()
474
- this.model.f_address = addstr
475
- },
476
- // 选中部门
477
- reres(val) {
478
- if (val.res == undefined || val.res[0] == undefined || val.res[0] == '') {
479
- return
480
- }
481
- this.model.serviceacitivity[0].f_meetunit = val.res[0]
482
- this.model.f_meetunit = val.res[0]
483
- this.model.f_filiale_id = val.orgobj[0].parentid
484
- this.model.f_filiale = val.orgobj[0].parentname
485
- this.model.f_outlets = val.res[0]
486
- this.model.serviceacitivity[0].f_reciever = val.resids[0]
487
- },
488
- // 修改备注
489
- modifyRemarks(val){
490
- if (val){
491
- this.model.f_remarks += val
492
- }
493
- },
494
- onReady() {
495
- //tag
496
- this.$emit('ready')
497
- },
498
- onError(error) {
499
- //tag
500
- this.$emit('error', error)
501
- },
502
- add(query) {
503
- if (typeof (query) === 'string') {
504
- this.model.f_residential_area = query
505
- this.address()
506
- }
507
- },
508
- // 修改或者重派工单时,加载工单的故障信息
509
- projectCallback(item) {
510
- if (item) {
511
- return item.f_user_name
512
- }
513
-
514
- },
515
- selectUnit(query) {
516
- return this.$resetpost('af-telephone/rs/sql/tel_singleTable_OrderBy',
517
- {
518
- data: {
519
- items: 'f_unitname',
520
- tablename: 't_unitcoordinate',
521
- condition: `(f_unitname like '${query}%' or F_TRANS_PINYIN_CAPITAL(f_unitname) like '${query}%')and rownum<10`,
522
- orderitem: 'id'
523
- }
524
- }, {resolveMsg: null, rejectMsg: null}
525
- )
526
- },
527
- selectResidential(query) {
528
- return this.$resetpost('af-telephone/rs/sql/tel_singleTable_OrderBy',
529
- {
530
- data: {
531
- items: 'f_villagename',
532
- tablename: 't_villagecoordinate',
533
- condition: `(f_villagename like '${query}%' or F_TRANS_PINYIN_CAPITAL(f_villagename) like '${query}%')and rownum<10`,
534
- orderitem: 'id'
535
- }
536
- }, {resolveMsg: null, rejectMsg: null}
537
- )
538
- },
539
- async setModifyOrder() {
540
- this.meading = this.modifyOrder.f_handlingtype
541
- if (this.meading === '转维修员') {
542
- await this.getEmp('维修员')
543
- }
544
- this.model = Object.assign({}, this.model, this.modifyOrder)
545
- },
546
- assignObj() {
547
- if (this.data) {
548
- this.model.failure_str = ''
549
- this.model.f_small_area = this.data.f_slice_area
550
- this.model.f_meternumber = this.data.f_meternumber
551
- this.model.f_address = this.data.f_address
552
- this.model.f_user_name = this.data.f_user_name
553
- this.model.f_user_type = this.data.f_user_type
554
- this.model.f_contact_phone = this.data.f_user_phone
555
- this.model.f_userinfo_id = this.data.f_userinfo_id
556
- this.model.f_userinfo_code = this.data.f_userinfo_code
557
- //tag
558
- // this.residentialquery = this.data.unit_name
559
- this.model.f_card_id = this.data.card_id
560
- if (this.model.f_user_type === '民用') {
561
- this.model.f_area = this.data.f_area
562
- this.model.f_street = this.data.f_street
563
- this.model.f_residential_area = this.data.f_residential_area
564
- this.model.f_building = this.data.f_building
565
- this.model.f_unit = this.data.f_unit
566
- this.model.f_floor = this.data.f_floor
567
- this.model.f_room = this.data.f_room
568
- //this.address()
569
- }
570
- }
571
-
572
- //this.checkServerList(this.model.f_address)
573
- },
574
- // 提交
575
- getData(val) {
576
- return this.residential
577
- },
578
- // 清楚信息
579
- cleardata() {
580
- this.model = Object.assign({}, {
581
- // 一次派单
582
- serviceacitivity: [{
583
- f_service_acitivity_type: '派单',
584
- f_meetunit: this.model.serviceacitivity[0].f_meetunit,
585
- f_reciever: this.model.serviceacitivity[0].f_reciever
586
- }],
587
- day: '1',
588
- f_small_area: '',
589
- f_finish_date: '',
590
- f_meetunit: this.model.f_meetunit,
591
- f_orgstr: this.model.f_orgstr,
592
- f_outlets: this.model.f_outlets,
593
- f_service_id: '',
594
- f_contact_phone: '',
595
- f_phone: '',
596
- f_user_name: '',
597
- failure: '',
598
- f_userinfo_id: '',
599
- failure_str: '',
600
- f_address: '',
601
- f_json: '',
602
- f_repair_date: Util.getNowDate(),
603
- f_card_id: '',
604
- f_remarks: '',
605
- f_user_type: '',
606
- f_area: '',
607
- f_street: '',
608
- f_residential_area: '',
609
- f_source: this.servicesource,
610
- f_building: '',
611
- f_unit: '',
612
- f_floor: '',
613
- f_room: '',
614
- f_handlingtype: this.model.f_handlingtype,
615
- aState: null,
616
- f_orgid: this.$login.f.orgid,
617
- f_orgname: this.$login.f.orgs,
618
- f_depname: this.$login.f.dops,
619
- f_depid: this.$login.f.depids,
620
- f_operator: this.$login.f.name,
621
- f_operatorid: this.$login.f.id,
622
- f_filiale: this.model.f_filiale,
623
- f_filiale_id: this.model.f_filiale_id,
624
- f_meternumber: ''//表号
625
- }),
626
- this.modifyOrder = {}
627
- this.types = []
628
- this.data = {}
629
- this.f_remarks = ''
630
- this.model.f_finish_date = this.getSecondDay(1)
631
- },
632
- save() {
633
- this.idisabled = true
634
- //tag
635
- // 判断是否输入地址
636
- if (this.model.f_address == '' || this.model.f_address == undefined) {
637
- this.idisabled = false
638
- return this.$showAlert('请输入地址!', 'warning', 2000)
639
- }
640
- if (!this.model.f_repairtype) {
641
- this.idisabled = false
642
- return this.$showAlert('请输入报修类型!', 'warning', 2000)
643
- }
644
- // 判断是否选择工单接收人
645
- if (this.operType != '修改工单') {
646
- if (this.model.serviceacitivity[0].f_reciever == '' || this.model.serviceacitivity[0].f_reciever == undefined) {
647
- if (this.meading == '转维修员') {
648
- this.idisabled = false
649
- return this.$showAlert('请选择维修人员', 'warning', 2000)
650
- } else {
651
- this.idisabled = false
652
- return this.$showAlert('请选择站点', 'warning', 2000)
653
- }
654
- }
655
- }
656
- if (this.meading == '转维修员') {
657
- this.model.f_meetunit = this.$login.f.deps
658
- this.model.f_orgid = this.$login.f.orgid
659
- this.model.f_filiale = this.$login.f.org
660
- this.model.f_outlets = this.$login.f.deps
661
- this.model.f_filiale_id = this.$login.f.orgid
662
- }
663
- let failureStr = ''
664
- if (this.model.failure.startsWith("[")) {
665
- const failureData = JSON.parse(this.model.failure)
666
- failureData.forEach(item => {
667
- if (item.failurecase.length > 0) {
668
- failureStr += item.f_failure_type + ":" + item.failurecase.toString() + ";"
669
- } else {
670
- failureStr += item.f_failure_type + ";"
671
- }
672
- })
673
- this.model.failure_str = failureStr
674
- }
675
- let data = {
676
- model: this.model, loginUser: {
677
- name: this.loginUser.name,
678
- ename: this.loginUser.ename
679
- },
680
- user: this.data, callObj: this.callObj
681
- }
682
- // 如果是修改工单,受理人还是原始的 派单人 不做修改
683
- if (this.operType == '报修') {
684
- data.model.f_attendant = this.loginUser.name
685
- }
686
- if (data.model.failure) {
687
- data.model.f_json = this.trouble(data.model.failure)
688
- }
689
- // 获得数据发送地址
690
- let url = ''
691
- if (this.meading === '转站点') {
692
- url = config[this.operType].url
693
- } else {
694
- url = config[this.operType].url
695
- data.toRepair = '一级派单'
696
- }
697
- data.model.f_state = null
698
- this.saveing = true
699
-
700
- if (this.is_to_other) {
701
- data.is_to_other = 'true'
702
- }
703
-
704
- return this.$resetpost(url, data).then((data) => {
705
- if (data.data && data.data.id) {
706
- this.id = JSON.parse(data.data.id).id
707
-
708
- }
709
- // 清空数据
710
- this.$emit('commitsus', this.model.f_phone, this.model)
711
- this.cleardata()
712
- if (this.callObj && this.callObj.callNum) {
713
- this.callObj.callNum = null
714
- this.callObj.RecordsID = null
715
- this.model.aState = null
716
- //tag
717
- Util.afterCallBz(this.$login.f.id, this.$login.f.name)
718
- }
719
- this.saveing = false
720
- this.idisabled = false
721
- }).catch(error => {
722
- this.saveing = false
723
- this.idisabled = false
724
- })
725
- },
726
- address() {
727
- let strAddress = `${this.model.f_area ? this.model.f_area
728
- + '-' : ''}${this.model.f_street ? this.model.f_street
729
- + '-' : ''}${this.model.f_residential_area ? this.model.f_residential_area
730
- + '' : ''}${this.model.f_building ? this.model.f_building
731
- + '号楼' : ''}${this.model.f_unit ? this.model.f_unit
732
- + '单元' : ''}${this.model.f_floor ? this.model.f_floor
733
- + '层' : ''}${this.model.f_room ? this.model.f_room
734
- + '室' : ''}`
735
- this.model.f_address = strAddress
736
- },
737
- // 检查相同地址下有没有还未完成的工单
738
- checkServerList(address) {
739
- if (this.model.f_area && this.model.f_area && this.model.f_residential_area && this.model.f_building
740
- && this.model.f_unit && this.model.f_floor && this.model.f_room) {
741
- this.$console.info('开始查询')
742
- // 地址所有区域输入完成查询
743
- // this.$resetpost('af-telephone/rs/sql/getServiceActivity.sql', { condition: `f_address = '${address}' and f_single_type = '报修单'`}, {resolveMsg: null, rejectMsg: null}).then((res) => {
744
- // //有未完成工单
745
- // let ls = res.data.length
746
- // if (ls > 0) {
747
- // // 当前地址下还有工单未完成
748
- // }
749
- // })
750
- }
751
- },
752
- // 处理故障输入
753
- procFailure(value) {
754
- if (typeof (value) === 'string') {
755
- this.model.failure = value
756
- }
757
- },
758
- trouble(val) {
759
- let failureall = ''
760
- // val=[{"f_failure_type":"抽油烟机","failurecase":[],"f_equipment":""},{"f_failure_type":"抽油烟机","failurecase":[],"f_equipment":""},{"f_failure_type":"抽油烟机","failurecase":[],"f_equipment":""}]
761
-
762
- let failure = JSON.parse(val)
763
- for (let i = 0; i < failure.length; i++) {
764
- if (failure[i].failurecase.length > 0) {
765
- failureall += failure[i].f_failure_type + ":"
766
- for (let j = 0; j < failure[i].failurecase.length; j++) {
767
- failureall += failure[i].failurecase[j]
768
- if (j + 1 != failure[i].failurecase.length) {
769
- failureall += ","
770
- }
771
- }
772
- } else {
773
- failureall += failure[i].f_failure_type
774
- }
775
- if (i + 1 != failure.length) {
776
- failureall += ';'
777
- }
778
- }
779
- return failureall
780
- },
781
- },
782
- watch: {
783
- 'telsource'() {
784
- if (this.telsource == '转站点') {
785
- this.servicesource = '话务来电'
786
- } else {
787
- this.servicesource = '部门派单'
788
- }
789
- },
790
- // 转接类型
791
- 'model.f_handlingtype'() {
792
- if (this.operType === '修改工单') {
793
- return
794
- }
795
- // 清楚上次记录
796
- this.model.serviceacitivity[0].f_reciever = ''
797
- this.model.serviceacitivity[0].f_meetunit = ''
798
- this.model.f_meetunit = ''
799
- this.model.f_orgstr = ''
800
- this.model.f_outlets = ''
801
- this.model.f_repairman_phone = ''
802
- if (this.model.f_handlingtype == '转维修员') {
803
- this.meading = '转维修员'
804
- this.repairers = []
805
- this.getEmp("维修员")
806
- } else {
807
- this.repairers = []
808
- this.meading = '转站点'
809
- }
810
- },
811
- // 是否清空
812
- 'cleantf'() {
813
- this.cleardata()
814
- },
815
- 'data'() {
816
- this.assignObj()
817
- },
818
- 'model.f_contact_phone'(val) {
819
- this.phoneValid = /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/.test(this.model.f_contact_phone)
820
- },
821
- // 话务对象发生变化将来电电话赋值给f_phone
822
- 'callObj.callNum'() {
823
- this.cleardata()
824
- this.model.f_phone = this.callObj.callNum
825
- this.model.f_records_id = this.callObj.RecordsID
826
- // this.model.f_contact_phone = this.callObj.callNum
827
- this.model.f_repair_date = Util.getNowDate()
828
- },
829
- 'types.length'() {
830
- var ev = new Event("resize", {"bubbles": true, "cancelable": false});
831
- window.dispatchEvent(ev);
832
- },
833
- 'callObj.aState'() {
834
- this.model.aState = this.callObj.aState
835
- //tag
836
- }
837
- },
838
- computed: {
839
- IsClickDisabled: function () {
840
- if (this.$v.valid) {
841
- if (this.model.aState === null) {
842
- //tag
843
- return false
844
- }
845
- if (this.model.f_phone && this.model.aState === '正在保存' && this.model.aState === '置忙') {
846
- //tag
847
- return false
848
- }
849
- if (!this.model.f_phone) {
850
- //tag
851
- return false
852
- } else {
853
- //tag
854
- return true
855
- }
856
- }
857
- },
858
- getTestData() {
859
- return this.testdata
860
- },
861
- getSource() {
862
- return this.servicesource
863
- },
864
- serviceacitivity() {
865
- return this.model.serviceacitivity.find((row) => {
866
- return row.f_service_acitivity_type === '派单'
867
- })
868
- },
869
- alertObject() {
870
- let result = this.model.failure.find((value) => {
871
- return value.f_failure_type === '报警器'
872
- })
873
- if (result) {
874
- return result
875
- }
876
- return {f_equipment: ''}
877
- },
878
- gasstove() {
879
- let result = this.model.failure.find((value) => {
880
- return value.f_failure_type === '燃气灶'
881
- })
882
- if (result) {
883
- return result
884
- }
885
- return {f_equipment: ''}
886
- },
887
- furnace() {
888
- let result = this.model.failure.find((value) => {
889
- return value.f_failure_type === '壁挂炉'
890
- })
891
- if (result) {
892
- return result
893
- }
894
- return {f_equipment: ''}
895
- },
896
- heater() {
897
- let result = this.model.failure.find((value) => {
898
- return value.f_failure_type === '热水器'
899
- })
900
- if (result) {
901
- return result
902
- }
903
- return {f_equipment: ''}
904
- },
905
- lampblack() {
906
- let result = this.model.failure.find((value) => {
907
- return value.f_failure_type === '油烟机'
908
- })
909
- if (result) {
910
- return result
911
- }
912
- return {f_equipment: ''}
913
- }
914
- },
915
- events: {
916
- getPosition(val) {
917
- //tag
918
- this.$dispatch('distribute', val)
919
-
920
- }
921
- },
922
- components: {
923
- FailureEdit,
924
- 'failure-edit': FailureEdit
925
- }
926
- }
927
-
928
- </script>
929
- <style>
930
- .class-error {
931
- color: #a94442;
932
- }
933
-
934
- </style>
1
+ <template xmlns:v-validate="http://www.w3.org/1999/xhtml">
2
+ <div class="auto select-overspread form-horizontal auto" id="pc-repair-work">
3
+ <work-busy :is-busy="saveing" v-show="saveing"></work-busy>
4
+ <validator name="v">
5
+ <div class="row">
6
+ <div class="col-sm-6 form-group form-fix-width">
7
+ <label class="font_normal_body" style="width: 30%">来电电话</label>
8
+ <input style="width: 60%" type="text" readonly v-model='model.f_phone' class="form-control"></input>
9
+ </div>
10
+ <div class="col-sm-6 form-group form-fix-width">
11
+ <label class="font_normal_body" for="f_user_name" :class="model.f_user_name ? '': 'class-error' "
12
+ style="width: 30%">客户姓名</label>
13
+ <input style="width: 60%" type="text" v-model='model.f_user_name' id="f_user_name" name="f_user_name"
14
+ class="form-control"/>
15
+ </div>
16
+ <div class="col-sm-6 form-group form-fix-width">
17
+ <label for="f_area" class="font_normal_body" style="width: 30%">客户类型</label>
18
+ <v-select :value.sync="model.f_user_type" :value-single="true"
19
+ :options='usertypes' placeholder='用户类型'
20
+ close-on-select style="width: 60%">
21
+ </v-select>
22
+ </div>
23
+
24
+ <div class="col-sm-6 form-group form-fix-width">
25
+ <label class="font_normal_body " for="f_contact_phone" :class="model.f_contact_phone ? '' : 'class-error'"
26
+ style="width: 30%">联系电话</label>
27
+ <input style="width: 60%" type="text" v-model='model.f_contact_phone' id="f_contact_phone"
28
+ class="form-control"/>
29
+ </div>
30
+ <div class="col-sm-12 form-group form-fix-width">
31
+ <label for="f_address" class="font_normal_body" style="width: 15%">详细地址</label>
32
+ <input style="width: 80%" type="text" class="form-control" v-model="model.f_address" id="f_address"
33
+ placeholder="详细地址"
34
+ v-el:address v-next-el="idnumber"
35
+ />
36
+ </div>
37
+ <span class="col-sm-12" style="color: red;margin-left: 100px;"
38
+ v-if="serviceList">工单编号:{{ serviceList.f_service_id }}此地址下有工单未处理完成</span>
39
+ </div>
40
+
41
+ <div class="col-sm-6 form-group form-fix-width" v-if="selectSendshow && operType != '修改工单'">
42
+ <label class="font_normal_body" style="width: 30%">转接方式</label>
43
+ <div class="form-control">
44
+ <label v-for="handling1 in handling">
45
+ <input style="width: 60%" type="radio"
46
+ v-model="model.f_handlingtype"
47
+ value="{{handling1.label}}">
48
+ {{ handling1.label }}
49
+ </label>
50
+ </div>
51
+ </div>
52
+ <div class="row">
53
+ <div class="col-sm-6 form-group form-fix-width">
54
+ <label for="f_repair" class="font_normal_body" style="width: 30%">报修类型</label>
55
+ <v-select :value.sync="model.f_repairtype" :value-single="true"
56
+ :options='repairstypes' placeholder='报修类型' @change="getDays"
57
+ close-on-select style="width: 60%">
58
+ </v-select>
59
+ </div>
60
+ <div class="col-sm-6 form-group form-fix-width" v-if="operType != '修改工单'">
61
+ <label class=" font_normal_body" style="width: 30%">派单类型</label>
62
+ <v-select :value.sync="model.f_handlingtype" :value-single="true"
63
+ :options='handling' placeholder='请选择派单类型'
64
+ close-on-select
65
+ style="width: 60%"></v-select>
66
+ </div>
67
+ <div class="col-sm-6 form-group form-fix-width" :class="[$v.f_reciever.required ? 'select-error' : '']"
68
+ v-if="meading == '转站点' && operType != '修改工单' && !ldapV4">
69
+ <label class=" font_normal_body" for="f_reciever" style="width: 30%">选择站点</label>
70
+ <input style="width: 60%" type="text" v-show="false" v-model="serviceacitivity.f_reciever"
71
+ v-validate:f_reciever='{ required: true }'>
72
+ <right-tree islist :userid="userid" :source="source" v-on:re-res="reres" :textContent="选择站点管理员"
73
+ :selectData="" v-ref:f_reciever>
74
+
75
+ </right-tree>
76
+ </div>
77
+ <div class="col-sm-6 form-group form-fix-width" :class="[$v.f_reciever.required ? 'select-error' : '']"
78
+ v-if="meading == '转站点' && operType != '修改工单' && ldapV4">
79
+ <label class="font_normal_body" style="width: 30%">选择站点</label>
80
+ <v-select :value="model.serviceacitivity[0].f_reciever" :value-single="true"
81
+ :options='deps' placeholder='选择站点'
82
+ close-on-select v-on:change="depcg" style="width: 60%"></v-select>
83
+ </div>
84
+ <div class="col-sm-6 form-group form-fix-width" :class="[$v.f_reciever.required ? 'select-error' : '']"
85
+ v-if="meading == '转维修员' && operType != '修改工单'">
86
+ <label class="font_normal_body" style="width: 30%">维&ensp;修&ensp;员</label>
87
+ <v-select :value="model.serviceacitivity[0].f_reciever" :value-single="true"
88
+ :options='repairers' placeholder='请选择维修员'
89
+ close-on-select v-on:change="repiarmancg" style="width: 60%"></v-select>
90
+ </div>
91
+ <div class="col-sm-6 form-group form-fix-width">
92
+ <label class=" font_normal_body" style="width: 30%">工单来源</label>
93
+ <v-select :value="model.f_source" :value-single="true"
94
+ :options='sources' placeholder='请选择工单来源'
95
+ close-on-select
96
+ v-on:change="sourcechange" style="width: 60%"></v-select>
97
+ </div>
98
+ <div class="col-sm-6 form-group form-fix-width">
99
+ <label class=" font_normal_body" style="width: 30%">截止天数</label>
100
+ <v-select :value="model.day" :value-single="true"
101
+ v-model="model.day"
102
+ :options='days' placeholder='请选择截止天数'
103
+ close-on-select
104
+ v-on:change="daychange" style="width: 60%"></v-select>
105
+ </div>
106
+
107
+ <div class="col-sm-6 form-group form-fix-width">
108
+ <label class=" font_normal_body" style="width: 30%">截止时间</label>
109
+ <datepicker placeholder="请选择截至时间"
110
+ :value.sync="model.f_finish_date"
111
+ v-model="model.f_finish_date"
112
+ :format="'yyyy-MM-dd HH:mm:ss'"
113
+ style="width: 60%"
114
+ :disabled="flag"></datepicker>
115
+ </div>
116
+
117
+ </div>
118
+ <failure-edit :value="model.failure" @input="procFailure"></failure-edit>
119
+
120
+ <div class="row" v-if="remarksList">
121
+ <div class="col-sm-12 form-input-group form-fix-width">
122
+ <label class="font_normal_body" style="width: 15%">备&emsp;&emsp;注</label>
123
+ <v-select :value.sync="f_remarks"
124
+ v-model="f_remarks"
125
+ :options='remarksList'
126
+ placeholder='请选择备注'
127
+ v-on:change="modifyRemarks"
128
+ :value-single="true"
129
+ close-on-select
130
+ style="width: 80%"></v-select>
131
+ </div>
132
+ </div>
133
+ <div class="row">
134
+ <div class="col-sm-12 form-input-group form-fix-width">
135
+ <label class="font_normal_body" style="width: 15%" v-if="remarksList"></label>
136
+ <label class="font_normal_body" style="width: 15%" v-if="!remarksList">{{remarksList?'':'备&emsp;&emsp;注' }}</label>
137
+ <textarea style="width: 80%" name="name" rows="3" class="ver-textarea" class="form-control"
138
+ v-model='model.f_remarks'></textarea>
139
+
140
+ <!-- <div class="form-control" style="width: 80%;float: left;min-height: 100px;position: relative;">{{ f_remarks }}</div>-->
141
+ </div>
142
+ </div>
143
+ <div class="row">
144
+ <button type="button" name="button" class="btn btn-difault" v-if="operType !== '报修'" @click="$emit('cancel')">
145
+ 取消
146
+ </button>
147
+ <!--<button type="button" name="button" class="btn btn-danger btn-ln fr" @click="save" :disabled='IsClickDisabled'>-->
148
+ <button type="button" name="button" style="float: right" class="button_spacing button_search" @click="save" :disabled="idisabled">
149
+ 提交
150
+ </button>
151
+ <button type="button" name="button" style="background-color: #5ac0d9;border-radius: 4px;float: right"
152
+ v-if="operType == '报修'" class="button_spacing button_search" @click="cleardata()">
153
+ 清空
154
+ </button>
155
+ </div>
156
+ </validator>
157
+ </div>
158
+ </template>
159
+
160
+ <script>
161
+ import FailureEdit from '../pc/FailureEdit'
162
+ import {HttpResetClass} from 'vue-client'
163
+ import * as Util from '../Util'
164
+
165
+ // 获取派单类型, 类型 转站点,转维修员,自选模式
166
+ let getSendType = async function (self) {
167
+ try {
168
+ // 如果初始化为派维修员,则不获取配置文件
169
+ if (self.meading == '转维修员') {
170
+ self.model.f_handlingtype = '转维修员'
171
+ } else {
172
+ let http = new HttpResetClass()
173
+ let result = await http.load('GET', `rs/vue/sendType.json`, {}, {resolveMsg: null, rejectMsg: null})
174
+ //tag
175
+ if (result.data.sendType == '自选模式') {
176
+ self.selectSendshow = true
177
+ } else {
178
+ // 转站点/转维修员
179
+ if (result.data.sendType == '转维修员') {
180
+ self.model.f_handlingtype = '转维修员'
181
+ }
182
+ self.meading = result.data.sendType
183
+ }
184
+ }
185
+ } catch (e) {
186
+ //tag
187
+ } finally {
188
+ // 获取维修员
189
+ if (self.meading == '转维修员') {
190
+ self.repairers = []
191
+ self.getEmp("维修员")
192
+ }else{
193
+ self.getDep()
194
+ }
195
+ self.model.f_user_type = "民用"
196
+ if (self.operType === '报修') {
197
+ self.assignObj()
198
+ } else if (self.operType === '重新派单') {
199
+ // 通过当前登录人获取需要重新派发单子,也可对单子进行修改
200
+ self.setModifyOrder()
201
+ } else if (self.operType === '修改工单') {
202
+ // 通过传入数据,查询出工单,选择站点将不可点击
203
+ self.setModifyOrder()
204
+ }
205
+ }
206
+ }
207
+ // 工作类型对应的各项设置
208
+ const config = {
209
+ '报修': {
210
+ url: 'af-telephone/rs/logic/callerSend'
211
+ },
212
+ '重新派单': {
213
+ url: 'af-telephone/rs/logic/resend'
214
+ },
215
+ '修改工单': {
216
+ url: 'af-telephone/rs/logic/modifyOrder'
217
+ },
218
+ }
219
+
220
+ export default {
221
+ title: '报修单',
222
+ props: {
223
+ data: { // 用户基本信息
224
+ type: Object,
225
+ default: null
226
+ },
227
+ type: { // 类型,为区分复选框,当组件重用并切重用组件同时出现,复选框id相同时会有干扰,
228
+ type: String
229
+ },
230
+ callObj: { // 话务对象
231
+ type: Object,
232
+ default: null
233
+ },
234
+ loginUser: {
235
+ type: Object
236
+ },
237
+ modifyOrder: { // 修改工单传入得工单信息
238
+ type: Object
239
+ },
240
+ operType: { // 操作类型,有报修,重新派单,修改工单,其中修改时,选择站点将不可点击,重新派单和修改要先将工单查询出来
241
+ type: String,
242
+ default: '报修'
243
+ },
244
+ meading: {
245
+ type: String,
246
+ default: '转维修员'
247
+ },
248
+ telsource: {
249
+ type: String,
250
+ default: '转维修员'
251
+ },
252
+ // 其他类型工单提交,清空控制
253
+ cleantf: {
254
+ type: Number
255
+ }
256
+ },
257
+ data() {
258
+ return {
259
+ // 临时这么处理
260
+ ldapV4:this.$appdata.getSingleValue('新资源服务'),
261
+ deps:[],
262
+ depsdata:[],
263
+ idisabled:false,
264
+ saveing: false,
265
+ selectSendshow: false,
266
+ // 选择小区树参数
267
+ // villagedata: {
268
+ // f_locationId: this.$login.f.parent.parentid,
269
+ // f_locationType: 't_organization'
270
+ // },
271
+ addressshow: false,
272
+ addressselect: false,
273
+ phoneValid: false,
274
+ flag: true,
275
+ residential: [],
276
+ row: {
277
+ f_residential_area: ''
278
+ },
279
+ residentialquery: '',
280
+ servicesource: '话务来电', // 工单来源
281
+ areacondition: '',
282
+ testdata: {f_equipment: ''},
283
+ residentialTemplate: 'f_villagename',
284
+ unitTemplate: 'f_unitname',
285
+ model: {
286
+ // 一次派单
287
+ serviceacitivity: [{
288
+ f_service_acitivity_type: '派单'
289
+ }],
290
+ day: '1',
291
+ f_small_area: '',
292
+ f_finish_date: '',
293
+ f_source: '话务来电',
294
+ f_service_id: '',
295
+ f_contact_phone: '',
296
+ f_meetunit: '',
297
+ f_phone: '',
298
+ f_user_name: '',
299
+ failure: '',
300
+ f_address: '',
301
+ f_json: '',
302
+ f_repair_date: Util.getNowDate(),
303
+ f_card_id: '',
304
+ // f_department: '', 站点选择
305
+ f_reciever: '',
306
+ f_user_type: '',
307
+ failure_str: '',
308
+ f_area: '',
309
+ f_unit_name: '',
310
+ f_street: '',
311
+ f_residential_area: '',
312
+ f_building: '',
313
+ f_unit: '',
314
+ f_floor: '',
315
+ f_room: '',
316
+ aState: null,
317
+ f_handlingtype: '转维修员',
318
+ f_repairtype: '',
319
+ f_orgid: this.$login.f.orgid,
320
+ f_orgname: this.$login.f.orgs,
321
+ f_depname: this.$login.f.dops,
322
+ f_depid: this.$login.f.depids,
323
+ f_operator: this.$login.f.name,
324
+ f_operatorid: this.$login.f.id,
325
+ f_remarks:'', // 实际备注
326
+ f_filiale: '',
327
+ f_filiale_id: '',
328
+ f_meternumber: ''//表号
329
+ },
330
+ f_remarks:'',// 备注快捷选择
331
+ types: [],
332
+ information: [], // 用来存放字表信息
333
+ serviceList: null, // 用来存放查询当前地址下的未完成工单
334
+ id: '', // 编写测试时会使用
335
+ f_service_id: '',// 编写测试时会使用
336
+ repairstypes: this.$appdata.getParam('报修类型'),
337
+ usertypes: this.$appdata.getParam('用户类型'),
338
+ // stands : this.$appdata.getParam('站点管理员'),
339
+ sources: this.$appdata.getParam('工单来源'),
340
+ days: this.$appdata.getParam('截止天数'),
341
+ remarksList:this.$appdata.getParam('报修单备注可选项'), //可选备注列表
342
+ handling: [{label: '转站点', value: '转站点'}, {label: '转维修员', value: '转维修员'}],
343
+ source:
344
+ 'dep=this.getParentByType($organization$).getSpecialResByType($department$),' +
345
+ 'tool.getFullTree(dep.where(row.hasSpecialRole($派单员$)))',
346
+ userid: this.$login.f.id,
347
+ is_to_other: false,
348
+ repairers: [] // 维修员
349
+ }
350
+ },
351
+ ready() {
352
+ // 获取sendType.json配置信息 获取派单类型 转站点,转维修员,自选模式
353
+ getSendType(this)
354
+ if (this.$appdata.getSingleValue('转班组长') && this.$appdata.getSingleValue('转班组长') == 'true') {
355
+ this.is_to_other = true
356
+ this.source = 'dep=this.getParentByType($organization$).getSpecialResByType($department$),tool.getFullTree(dep.where(row.hasSpecialRole($班组长$)))'
357
+ }
358
+ this.model.f_source = this.telsource == '转维修员' ? '部门派单' : '话务来电';
359
+ this.model.f_finish_date = this.getSecondDay(1)
360
+ },
361
+ methods: {
362
+ depcg(val){
363
+ if (val) {
364
+ let dep = ''
365
+ this.depsdata.forEach((item) => {
366
+ if(item.id == val){
367
+ dep = item
368
+ }
369
+ })
370
+ this.model.serviceacitivity[0].f_meetunit = dep.name
371
+ this.model.f_meetunit = dep.name
372
+ this.model.f_outlets = dep.name
373
+ this.model.serviceacitivity[0].f_reciever = val
374
+ }
375
+ },
376
+ getDays(val){
377
+ console.log(val)
378
+ this.days = this.$appdata.getParam(val+'截止天数')
379
+ },
380
+ getSecondDay(val){
381
+ let t = new Date();
382
+ let t1 = t.getTime()
383
+ val = val * 1000
384
+ t.setTime(t1 + val * 60 * 60 * 24);
385
+ let Y = t.getFullYear() + '-'
386
+ let M = (t.getMonth() + 1 < 10 ? '0' + (t.getMonth() + 1) : t.getMonth() + 1) + '-'
387
+ let D = (t.getDate() < 10 ? '0' + t.getDate() : t.getDate()) + ' '
388
+ let h = (t.getHours() < 10 ? '0' + t.getHours() : t.getHours()) + ':'
389
+ let m = (t.getMinutes() < 10 ? '0' + t.getMinutes() : t.getMinutes()) + ':'
390
+ let s = t.getSeconds() < 10 ? '0' + t.getSeconds() : t.getSeconds()
391
+ return Y + M + D + h + m + s
392
+ },
393
+ // 当维修员发生改变,获取维修员手机号
394
+ repiarmancg(val) {
395
+ if (val) {
396
+ //tag
397
+ if (typeof val == 'string') {
398
+ this.model.serviceacitivity[0].f_reciever = val
399
+ let http1 = new HttpResetClass()
400
+ http1.load('POST', 'af-telephone/rs/sql/tel_singleTable_OrderBy', {
401
+ data: {
402
+ items: 'f_user_telephone',
403
+ tablename: 't_user',
404
+ condition: `name = '${val}'`,
405
+ orderitem: 'id'
406
+ }
407
+ }, {resolveMsg: null, rejectMsg: null}).then((ress) => {
408
+ this.model.f_repairman_phone = ress.data[0].f_user_telephone
409
+ })
410
+ }
411
+ }
412
+ },
413
+ // 当工单来源属性发生改变
414
+ sourcechange(val) {
415
+ if (val == undefined || val == '') {
416
+ return
417
+ }
418
+ this.model.f_source = val
419
+ this.servicesource = val
420
+ },
421
+ daychange(val) {
422
+ this.model.day = val
423
+ if (val == '其他') {
424
+ this.flag = false
425
+ } else {
426
+ if(val){
427
+ this.flag = true
428
+ this.model.f_finish_date = this.getSecondDay(val)
429
+ }else {
430
+ this.model.f_finish_date = this.getSecondDay(1)
431
+ }
432
+
433
+ }
434
+ },
435
+ // 获取维修员
436
+ getEmp(role) {
437
+ this.repairers = []
438
+ // let val = {source: 'tool.getChildrenOfResName($维修员$)', userid: `${this.$login.f.id}`}
439
+ let val = {
440
+ source: `this.getParentByType($organization$).getChildByName($${role}$).getUsers()`,
441
+ userid: `${this.$login.f.id}`
442
+ }
443
+ // let val = {source: 'this.getParentByType($department$).getChildByName($置换员$).getUsers()', userid: `${this.$login.f.id}`}
444
+ let http = new HttpResetClass()
445
+ http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
446
+ // let result = res.data.filter(res=>res.orgid==this.$login.f.orgid)
447
+ res.data.forEach((item) => {
448
+ if (item.state == '在职' || item.status == 0) {
449
+ this.repairers.push({label: `${item.name}`, value: item.name})
450
+ }
451
+ })
452
+ })
453
+ },
454
+ getDep() {
455
+ this.deps= []
456
+ this.depsdata=[]
457
+ let val = {
458
+ source: `dep=this.getParentByType($organization$).getSpecialResByType($department$),tool.getFullTree(dep.where(row.hasSpecialRole($派单员$)))`,
459
+ userid: `${this.$login.f.id}`
460
+ }
461
+ let http = new HttpResetClass()
462
+ http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
463
+ this.depsdata = res.data
464
+ res.data.forEach((item) => {
465
+ this.deps.push({label: `${item.name}`, value: item.id})
466
+ })
467
+ })
468
+ },
469
+ adressslect(val) {
470
+ if (val == "NO") {
471
+ this.addressshow = true
472
+ this.addressselect = true
473
+ } else {
474
+ this.addressshow = false
475
+ this.addressselect = false
476
+ }
477
+ },
478
+ // 控制地址管理组件显示与否
479
+ adressoff(val) {
480
+ if (val == "NO") {
481
+ this.addressshow = true
482
+ this.addressselect = false
483
+ } else {
484
+ this.addressshow = false
485
+ this.addressselect = true
486
+ }
487
+ },
488
+ // 截取字符串
489
+ interceptString(val) {
490
+ },
491
+ // 选中地址
492
+ rerefParent(val, addstr) {
493
+ var rows = val.rows
494
+ let num = 0
495
+ this.model.f_addressjson = JSON.stringify(rows)
496
+ this.model.f_addressid = val.id
497
+ if (rows.length > 0) {
498
+ let arrid = this.model.f_addressid.split('.')
499
+ for (let i = 0; i < rows.length; i++) {
500
+ if (rows[i].type === '楼号') {
501
+ this.model.f_building = rows[i].name
502
+ } else if (rows[i].type === '楼层') {
503
+ this.model.f_floor = rows[i].name
504
+ } else if (rows[i].type === '门牌号') {
505
+ this.model.f_room = rows[i].name
506
+ this.model.f_room_id = arrid[i]
507
+ } else if (rows[i].type === '区') {
508
+ this.model.f_area = rows[i].name
509
+ } else if (rows[i].type === '街道') {
510
+ this.model.f_street = rows[i].name
511
+ } else if (rows[i].type === '小区') {
512
+ this.model.f_residential_area = rows[i].name
513
+ this.model.f_districtname_id = arrid[i]
514
+ } else if (rows[i].type === '单元') {
515
+ this.model.f_unit = rows[i].name
516
+ }
517
+ }
518
+ }
519
+ // this.address()
520
+ this.model.f_address = addstr
521
+ },
522
+ // 选中部门
523
+ reres(val) {
524
+ if (val.res == undefined || val.res[0] == undefined || val.res[0] == '') {
525
+ return
526
+ }
527
+ this.model.serviceacitivity[0].f_meetunit = val.res[0]
528
+ this.model.f_meetunit = val.res[0]
529
+ this.model.f_filiale_id = val.orgobj[0].parentid
530
+ this.model.f_filiale = val.orgobj[0].parentname
531
+ this.model.f_outlets = val.res[0]
532
+ this.model.serviceacitivity[0].f_reciever = val.resids[0]
533
+ },
534
+ // 修改备注
535
+ modifyRemarks(val){
536
+ if (val){
537
+ this.model.f_remarks += val
538
+ }
539
+ },
540
+ onReady() {
541
+ //tag
542
+ this.$emit('ready')
543
+ },
544
+ onError(error) {
545
+ //tag
546
+ this.$emit('error', error)
547
+ },
548
+ add(query) {
549
+ if (typeof (query) === 'string') {
550
+ this.model.f_residential_area = query
551
+ this.address()
552
+ }
553
+ },
554
+ // 修改或者重派工单时,加载工单的故障信息
555
+ projectCallback(item) {
556
+ if (item) {
557
+ return item.f_user_name
558
+ }
559
+
560
+ },
561
+ selectUnit(query) {
562
+ return this.$resetpost('af-telephone/rs/sql/tel_singleTable_OrderBy',
563
+ {
564
+ data: {
565
+ items: 'f_unitname',
566
+ tablename: 't_unitcoordinate',
567
+ condition: `(f_unitname like '${query}%' or F_TRANS_PINYIN_CAPITAL(f_unitname) like '${query}%')and rownum<10`,
568
+ orderitem: 'id'
569
+ }
570
+ }, {resolveMsg: null, rejectMsg: null}
571
+ )
572
+ },
573
+ selectResidential(query) {
574
+ return this.$resetpost('af-telephone/rs/sql/tel_singleTable_OrderBy',
575
+ {
576
+ data: {
577
+ items: 'f_villagename',
578
+ tablename: 't_villagecoordinate',
579
+ condition: `(f_villagename like '${query}%' or F_TRANS_PINYIN_CAPITAL(f_villagename) like '${query}%')and rownum<10`,
580
+ orderitem: 'id'
581
+ }
582
+ }, {resolveMsg: null, rejectMsg: null}
583
+ )
584
+ },
585
+ async setModifyOrder() {
586
+ this.meading = this.modifyOrder.f_handlingtype
587
+ if (this.meading === '转维修员') {
588
+ await this.getEmp('维修员')
589
+ }
590
+ this.model = Object.assign({}, this.model, this.modifyOrder)
591
+ },
592
+ assignObj() {
593
+ if (this.data) {
594
+ this.model.failure_str = ''
595
+ this.model.f_small_area = this.data.f_slice_area
596
+ this.model.f_meternumber = this.data.f_meternumber
597
+ this.model.f_address = this.data.f_address
598
+ this.model.f_user_name = this.data.f_user_name
599
+ this.model.f_user_type = this.data.f_user_type
600
+ this.model.f_contact_phone = this.data.f_user_phone
601
+ this.model.f_userinfo_id = this.data.f_userinfo_id
602
+ this.model.f_userinfo_code = this.data.f_userinfo_code
603
+ //tag
604
+ // this.residentialquery = this.data.unit_name
605
+ this.model.f_card_id = this.data.card_id
606
+ if (this.model.f_user_type === '民用') {
607
+ this.model.f_area = this.data.f_area
608
+ this.model.f_street = this.data.f_street
609
+ this.model.f_residential_area = this.data.f_residential_area
610
+ this.model.f_building = this.data.f_building
611
+ this.model.f_unit = this.data.f_unit
612
+ this.model.f_floor = this.data.f_floor
613
+ this.model.f_room = this.data.f_room
614
+ //this.address()
615
+ }
616
+ }
617
+
618
+ //this.checkServerList(this.model.f_address)
619
+ },
620
+ // 提交
621
+ getData(val) {
622
+ return this.residential
623
+ },
624
+ // 清楚信息
625
+ cleardata() {
626
+ this.model = Object.assign({}, {
627
+ // 一次派单
628
+ serviceacitivity: [{
629
+ f_service_acitivity_type: '派单',
630
+ f_meetunit: this.model.serviceacitivity[0].f_meetunit,
631
+ f_reciever: this.model.serviceacitivity[0].f_reciever
632
+ }],
633
+ day: '1',
634
+ f_small_area: '',
635
+ f_finish_date: '',
636
+ f_meetunit: this.model.f_meetunit,
637
+ f_orgstr: this.model.f_orgstr,
638
+ f_outlets: this.model.f_outlets,
639
+ f_service_id: '',
640
+ f_contact_phone: '',
641
+ f_phone: '',
642
+ f_user_name: '',
643
+ failure: '',
644
+ f_userinfo_id: '',
645
+ failure_str: '',
646
+ f_address: '',
647
+ f_json: '',
648
+ f_repair_date: Util.getNowDate(),
649
+ f_card_id: '',
650
+ f_remarks: '',
651
+ f_user_type: '',
652
+ f_area: '',
653
+ f_street: '',
654
+ f_residential_area: '',
655
+ f_source: this.servicesource,
656
+ f_building: '',
657
+ f_unit: '',
658
+ f_floor: '',
659
+ f_room: '',
660
+ f_handlingtype: this.model.f_handlingtype,
661
+ aState: null,
662
+ f_orgid: this.$login.f.orgid,
663
+ f_orgname: this.$login.f.orgs,
664
+ f_depname: this.$login.f.dops,
665
+ f_depid: this.$login.f.depids,
666
+ f_operator: this.$login.f.name,
667
+ f_operatorid: this.$login.f.id,
668
+ f_filiale: this.model.f_filiale,
669
+ f_filiale_id: this.model.f_filiale_id,
670
+ f_meternumber: ''//表号
671
+ }),
672
+ this.modifyOrder = {}
673
+ this.types = []
674
+ this.data = {}
675
+ this.f_remarks = ''
676
+ this.model.f_finish_date = this.getSecondDay(1)
677
+ },
678
+ save() {
679
+ this.idisabled = true
680
+ //tag
681
+ // 判断是否输入地址
682
+ if (this.model.f_address == '' || this.model.f_address == undefined) {
683
+ this.idisabled = false
684
+ return this.$showAlert('请输入地址!', 'warning', 2000)
685
+ }
686
+ if (!this.model.f_repairtype) {
687
+ this.idisabled = false
688
+ return this.$showAlert('请输入报修类型!', 'warning', 2000)
689
+ }
690
+ // 判断是否选择工单接收人
691
+ if (this.operType != '修改工单') {
692
+ if (this.model.serviceacitivity[0].f_reciever == '' || this.model.serviceacitivity[0].f_reciever == undefined) {
693
+ if (this.meading == '转维修员') {
694
+ this.idisabled = false
695
+ return this.$showAlert('请选择维修人员', 'warning', 2000)
696
+ } else {
697
+ this.idisabled = false
698
+ return this.$showAlert('请选择站点', 'warning', 2000)
699
+ }
700
+ }
701
+ }
702
+ if (this.meading == '转维修员') {
703
+ this.model.f_meetunit = this.$login.f.deps
704
+ this.model.f_orgid = this.$login.f.orgid
705
+ this.model.f_filiale = this.$login.f.org
706
+ this.model.f_outlets = this.$login.f.deps
707
+ this.model.f_filiale_id = this.$login.f.orgid
708
+ }
709
+ let failureStr = ''
710
+ if (this.model.failure.startsWith("[")) {
711
+ const failureData = JSON.parse(this.model.failure)
712
+ failureData.forEach(item => {
713
+ if (item.failurecase.length > 0) {
714
+ failureStr += item.f_failure_type + ":" + item.failurecase.toString() + ";"
715
+ } else {
716
+ failureStr += item.f_failure_type + ";"
717
+ }
718
+ })
719
+ this.model.failure_str = failureStr
720
+ }
721
+ let data = {
722
+ model: this.model, loginUser: {
723
+ name: this.loginUser.name,
724
+ ename: this.loginUser.ename
725
+ },
726
+ user: this.data, callObj: this.callObj
727
+ }
728
+ // 如果是修改工单,受理人还是原始的 派单人 不做修改
729
+ if (this.operType == '报修') {
730
+ data.model.f_attendant = this.loginUser.name
731
+ }
732
+ if (data.model.failure) {
733
+ data.model.f_json = this.trouble(data.model.failure)
734
+ }
735
+ // 获得数据发送地址
736
+ let url = ''
737
+ if (this.meading === '转站点') {
738
+ url = config[this.operType].url
739
+ } else {
740
+ url = config[this.operType].url
741
+ data.toRepair = '一级派单'
742
+ }
743
+ data.model.f_state = null
744
+ this.saveing = true
745
+
746
+ if (this.is_to_other) {
747
+ data.is_to_other = 'true'
748
+ }
749
+
750
+ return this.$resetpost(url, data).then((data) => {
751
+ if (data.data && data.data.id) {
752
+ this.id = JSON.parse(data.data.id).id
753
+
754
+ }
755
+ // 清空数据
756
+ this.$emit('commitsus', this.model.f_phone, this.model)
757
+ this.cleardata()
758
+ if (this.callObj && this.callObj.callNum) {
759
+ this.callObj.callNum = null
760
+ this.callObj.RecordsID = null
761
+ this.model.aState = null
762
+ //tag
763
+ Util.afterCallBz(this.$login.f.id, this.$login.f.name)
764
+ }
765
+ this.saveing = false
766
+ this.idisabled = false
767
+ }).catch(error => {
768
+ this.saveing = false
769
+ this.idisabled = false
770
+ })
771
+ },
772
+ address() {
773
+ let strAddress = `${this.model.f_area ? this.model.f_area
774
+ + '-' : ''}${this.model.f_street ? this.model.f_street
775
+ + '-' : ''}${this.model.f_residential_area ? this.model.f_residential_area
776
+ + '' : ''}${this.model.f_building ? this.model.f_building
777
+ + '号楼' : ''}${this.model.f_unit ? this.model.f_unit
778
+ + '单元' : ''}${this.model.f_floor ? this.model.f_floor
779
+ + '层' : ''}${this.model.f_room ? this.model.f_room
780
+ + '室' : ''}`
781
+ this.model.f_address = strAddress
782
+ },
783
+ // 检查相同地址下有没有还未完成的工单
784
+ checkServerList(address) {
785
+ if (this.model.f_area && this.model.f_area && this.model.f_residential_area && this.model.f_building
786
+ && this.model.f_unit && this.model.f_floor && this.model.f_room) {
787
+ this.$console.info('开始查询')
788
+ // 地址所有区域输入完成查询
789
+ // this.$resetpost('af-telephone/rs/sql/getServiceActivity.sql', { condition: `f_address = '${address}' and f_single_type = '报修单'`}, {resolveMsg: null, rejectMsg: null}).then((res) => {
790
+ // //有未完成工单
791
+ // let ls = res.data.length
792
+ // if (ls > 0) {
793
+ // // 当前地址下还有工单未完成
794
+ // }
795
+ // })
796
+ }
797
+ },
798
+ // 处理故障输入
799
+ procFailure(value) {
800
+ if (typeof (value) === 'string') {
801
+ this.model.failure = value
802
+ }
803
+ },
804
+ trouble(val) {
805
+ let failureall = ''
806
+ // val=[{"f_failure_type":"抽油烟机","failurecase":[],"f_equipment":""},{"f_failure_type":"抽油烟机","failurecase":[],"f_equipment":""},{"f_failure_type":"抽油烟机","failurecase":[],"f_equipment":""}]
807
+
808
+ let failure = JSON.parse(val)
809
+ for (let i = 0; i < failure.length; i++) {
810
+ if (failure[i].failurecase.length > 0) {
811
+ failureall += failure[i].f_failure_type + ":"
812
+ for (let j = 0; j < failure[i].failurecase.length; j++) {
813
+ failureall += failure[i].failurecase[j]
814
+ if (j + 1 != failure[i].failurecase.length) {
815
+ failureall += ","
816
+ }
817
+ }
818
+ } else {
819
+ failureall += failure[i].f_failure_type
820
+ }
821
+ if (i + 1 != failure.length) {
822
+ failureall += ';'
823
+ }
824
+ }
825
+ return failureall
826
+ },
827
+ },
828
+ watch: {
829
+ 'telsource'() {
830
+ if (this.telsource == '转站点') {
831
+ this.servicesource = '话务来电'
832
+ } else {
833
+ this.servicesource = '部门派单'
834
+ }
835
+ },
836
+ // 转接类型
837
+ 'model.f_handlingtype'() {
838
+ if (this.operType === '修改工单') {
839
+ return
840
+ }
841
+ // 清楚上次记录
842
+ this.model.serviceacitivity[0].f_reciever = ''
843
+ this.model.serviceacitivity[0].f_meetunit = ''
844
+ this.model.f_meetunit = ''
845
+ this.model.f_orgstr = ''
846
+ this.model.f_outlets = ''
847
+ this.model.f_repairman_phone = ''
848
+ if (this.model.f_handlingtype == '转维修员') {
849
+ this.meading = '转维修员'
850
+ this.repairers = []
851
+ this.getEmp("维修员")
852
+ } else {
853
+ this.repairers = []
854
+ this.meading = '转站点'
855
+ this.getDep()
856
+ }
857
+ },
858
+ // 是否清空
859
+ 'cleantf'() {
860
+ this.cleardata()
861
+ },
862
+ 'data'() {
863
+ this.assignObj()
864
+ },
865
+ 'model.f_contact_phone'(val) {
866
+ this.phoneValid = /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/.test(this.model.f_contact_phone)
867
+ },
868
+ // 话务对象发生变化将来电电话赋值给f_phone
869
+ 'callObj.callNum'() {
870
+ this.cleardata()
871
+ this.model.f_phone = this.callObj.callNum
872
+ this.model.f_records_id = this.callObj.RecordsID
873
+ // this.model.f_contact_phone = this.callObj.callNum
874
+ this.model.f_repair_date = Util.getNowDate()
875
+ },
876
+ 'types.length'() {
877
+ var ev = new Event("resize", {"bubbles": true, "cancelable": false});
878
+ window.dispatchEvent(ev);
879
+ },
880
+ 'callObj.aState'() {
881
+ this.model.aState = this.callObj.aState
882
+ //tag
883
+ }
884
+ },
885
+ computed: {
886
+ IsClickDisabled: function () {
887
+ if (this.$v.valid) {
888
+ if (this.model.aState === null) {
889
+ //tag
890
+ return false
891
+ }
892
+ if (this.model.f_phone && this.model.aState === '正在保存' && this.model.aState === '置忙') {
893
+ //tag
894
+ return false
895
+ }
896
+ if (!this.model.f_phone) {
897
+ //tag
898
+ return false
899
+ } else {
900
+ //tag
901
+ return true
902
+ }
903
+ }
904
+ },
905
+ getTestData() {
906
+ return this.testdata
907
+ },
908
+ getSource() {
909
+ return this.servicesource
910
+ },
911
+ serviceacitivity() {
912
+ return this.model.serviceacitivity.find((row) => {
913
+ return row.f_service_acitivity_type === '派单'
914
+ })
915
+ },
916
+ alertObject() {
917
+ let result = this.model.failure.find((value) => {
918
+ return value.f_failure_type === '报警器'
919
+ })
920
+ if (result) {
921
+ return result
922
+ }
923
+ return {f_equipment: ''}
924
+ },
925
+ gasstove() {
926
+ let result = this.model.failure.find((value) => {
927
+ return value.f_failure_type === '燃气灶'
928
+ })
929
+ if (result) {
930
+ return result
931
+ }
932
+ return {f_equipment: ''}
933
+ },
934
+ furnace() {
935
+ let result = this.model.failure.find((value) => {
936
+ return value.f_failure_type === '壁挂炉'
937
+ })
938
+ if (result) {
939
+ return result
940
+ }
941
+ return {f_equipment: ''}
942
+ },
943
+ heater() {
944
+ let result = this.model.failure.find((value) => {
945
+ return value.f_failure_type === '热水器'
946
+ })
947
+ if (result) {
948
+ return result
949
+ }
950
+ return {f_equipment: ''}
951
+ },
952
+ lampblack() {
953
+ let result = this.model.failure.find((value) => {
954
+ return value.f_failure_type === '油烟机'
955
+ })
956
+ if (result) {
957
+ return result
958
+ }
959
+ return {f_equipment: ''}
960
+ }
961
+ },
962
+ events: {
963
+ getPosition(val) {
964
+ //tag
965
+ this.$dispatch('distribute', val)
966
+
967
+ }
968
+ },
969
+ components: {
970
+ FailureEdit,
971
+ 'failure-edit': FailureEdit
972
+ }
973
+ }
974
+
975
+ </script>
976
+ <style>
977
+ .class-error {
978
+ color: #a94442;
979
+ }
980
+
981
+ </style>