telephone-clients 3.0.104-55 → 3.0.104-56

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