telephone-clients 4.0.0-1-33 → 4.0.0-1-34

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