telephone-clients 4.0.0-1-75 → 4.0.0-1-77

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