telephone-clients 3.0.103-78 → 3.0.103-79

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,753 +1,753 @@
1
- <template xmlns:v-validate="http://www.w3.org/1999/xhtml">
2
- <div class="auto select-overspread form-horizontal auto" id="pc-repair-work">
3
- <validator name="v">
4
- <div class="row">
5
- <!-- <div class="col-sm-6 form-group form-fix-width">-->
6
- <!-- <label class="font_normal_body" style="width: 30%">来电电话</label>-->
7
- <!-- <input style="width: 60%" type="text" readonly v-model='model.f_phone' class="form-control"></input>-->
8
- <!-- </div>-->
9
- <!-- <div class="col-sm-6 form-group form-fix-width" >-->
10
- <!-- <label style="width: 30%" class="font_normal_body" for="f_user_name" :class="model.f_user_name ? '': 'class-error' ">联系人</label>-->
11
- <!-- <input style="width: 60%" type="text" v-model='model.f_user_name' id="f_user_name" name="f_user_name" class="form-control"/>-->
12
- <!-- </div>-->
13
- <div class="col-sm-6 form-group form-fix-width">
14
- <label for="f_area" class="font_normal_body" style="width: 30%">用气性质</label>
15
- <v-select :value.sync="model.f_gasproperties" :value-single="true"
16
- :options='gastypes' placeholder='用气性质'
17
- close-on-select>
18
- </v-select>
19
- </div>
20
- <!-- <div class="col-sm-6 form-group form-fix-width">-->
21
- <!-- <label style="width: 30%" class="font_normal_body " for="f_contact_phone" :class="model.f_contact_phone ? '' : 'class-error'">联系电话</label>-->
22
- <!-- <input style="width: 60%" type="text" v-model='model.f_contact_phone' id="f_contact_phone" class="form-control"/>-->
23
- <!-- </div>-->
24
- <div class="col-sm-12 form-group form-fix-width">
25
- <label style="width: 15%" for="f_address" class="font_normal_body">详细地址</label>
26
- <input style="width: 65%" type="text" class="form-control" v-model="model.f_address" id="f_address"
27
- placeholder="详细地址"
28
- v-el:address v-next-el="idnumber"/>
29
- <!-- <button style="width: 15%" type="button" name="button" class="btn btn-difault" @click='adressshow'>-->
30
- <!-- 选择地址-->
31
- <!-- </button>-->
32
- </div>
33
- <div class="col-sm-12 form-group form-fix-width">
34
- <label style="width: 15%" for="f_address" class="font_normal_body">来电电话</label>
35
- <input style="width: 65%" type="number" class="form-control" v-model="model.f_phone" id="f_phone"
36
- placeholder="来电电话"
37
- v-el:address v-next-el="idnumber"/>
38
- </div>
39
- </div>
40
- <div class="row">
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 type="radio"
46
- v-model="model.f_handlingtype"
47
- value="{{handling1.label}}">
48
- {{ handling1.label }}
49
- </label>
50
- </div>
51
- </div>
52
- <div class="col-sm-6 form-group form-fix-width">
53
- <label class=" font_normal_body" style="width: 30%">派单类型</label>
54
- <v-select :value.sync="model.f_handlingtype" :value-single="true"
55
- :options='handling' placeholder='请选择派单类型'
56
- close-on-select
57
- ></v-select>
58
- </div>
59
- <div class="col-sm-6 form-group form-fix-width" v-if="meading == '转站点'">
60
- <label class=" font_normal_body" style="width: 30%">选择站点</label>
61
- <input type="text" v-show="false" v-model="serviceacitivity.f_reciever">
62
- <right-tree islist :userid="userid" :source="source" v-on:re-res="reres" :textContent="选择站点" :selectData="">
63
-
64
- </right-tree>
65
- </div>
66
- <div class="col-sm-6 form-group form-fix-width" :class="[$v.f_reciever.required ? 'select-error' : '']"
67
- v-if="meading == '转维修员'">
68
- <label class="font_normal_body" style="width: 30%">置换员</label>
69
- <v-select :value="model.serviceacitivity[0].f_reciever" :value-single="true"
70
- :options='repairers' placeholder='请选择置换员'
71
- close-on-select v-on:change="repiarmancg"></v-select>
72
- </div>
73
- <div class="col-sm-6 form-group form-fix-width">
74
- <label class=" font_normal_body" style="width: 30%">工单来源</label>
75
- <v-select :value="model.f_source" :value-single="true"
76
- :options='sources' placeholder='请选择工单来源'
77
- close-on-select
78
- v-on:change="sourcechange"></v-select>
79
- </div>
80
- <div class="col-sm-6 form-group form-fix-width">
81
- <label class=" font_normal_body" style="width: 30%">预约时间</label>
82
- <datepicker placeholder="请选择预约时间"
83
- :value.sync="model.f_yuyue_date"
84
- v-model="model.f_yuyue_date"
85
- :format="'yyyy-MM-dd HH:mm:ss'"
86
- style="width: 60%"></datepicker>
87
- </div>
88
- </div>
89
- <div class="row">
90
- <div class="col-sm-12 form-group form-fix-width">
91
- <label class="font_normal_body" style="width: 15%">备注</label>
92
- <textarea style="width: 80%" name="name" rows="2" class="ver-textarea" class="form-control"
93
- v-model='model.f_remarks'></textarea>
94
- </div>
95
- </div>
96
- <div class="row">
97
- <button type="button" name="button" class="btn btn-difault" v-if="operType !== '报修'" @click="$emit('cancel')">
98
- 取消
99
- </button>
100
- <button type="button" name="button" style="float: right" class="button_spacing button_search" @click="save">
101
- 提交
102
- </button>
103
- </div>
104
- </validator>
105
- <modal v-if="addressshow" :show.sync="true" v-ref:modal backdrop="false" width="90%" height="90%">
106
- <header slot="modal-header" class="modal-header">
107
- <h4 class="modal-title">地址管理</h4>
108
- </header>
109
- <article slot="modal-body" class="modal-body">
110
- <batch_orders @submit="rerefParent" @cancel="addressclose" :clear="rowsdata">
111
-
112
- </batch_orders>
113
- </article>
114
- <footer slot="modal-footer" class="modal-footer">
115
- <button type="button" name="button" style="float: right" class="button_spacing button_search"
116
- @click="closeAddressModal">
117
- 关闭
118
- </button>
119
- </footer>
120
- </modal>
121
- </div>
122
- </template>
123
-
124
- <script>
125
- import {HttpResetClass} from 'vue-client'
126
- import * as Util from '../../../components/Util'
127
- // 获取派单类型, 类型 : 转站点,转维修员,自选模式
128
- let getSendType = async function (self) {
129
- try {
130
- // 如果初始化为派维修员,则不获取配置文件
131
- if (self.meading == '转维修员') {
132
- self.model.f_handlingtype = '转维修员'
133
- } else {
134
- let http = new HttpResetClass()
135
- let result = await http.load('GET', `rs/vue/sendType.json`, {}, {resolveMsg: null, rejectMsg: null})
136
- //tag
137
- if (result.data.sendType == '自选模式') {
138
- self.selectSendshow = true
139
- } else {
140
- // 转站点/转维修员
141
- if (result.data.sendType == '转维修员') {
142
- self.model.f_handlingtype = '转维修员'
143
- }
144
- self.meading = result.data.sendType
145
- }
146
- }
147
- } catch (e) {
148
- //tag
149
- } finally {
150
- // 获取维修员
151
- if (self.meading == '转维修员') {
152
- self.repairers = []
153
- self.getEmp()
154
- }
155
- self.model.f_user_type = "民用"
156
- if (self.operType === '报修') {
157
- // self.assignObj()
158
- } else if (self.operType === '重新派单') {
159
- // 通过当前登录人获取需要重新派发单子,也可对单子进行修改
160
- self.setModifyOrder()
161
- } else if (self.operType === '修改工单') {
162
- // 通过传入数据,查询出工单,选择站点将不可点击
163
- self.setModifyOrder()
164
- }
165
- }
166
- }
167
- // 工作类型对应的各项设置
168
- const config = {
169
- '报修': {
170
- url: 'rs/logic/callerSendZH'
171
- },
172
- '重新派单': {
173
- url: 'rs/logic/resend'
174
- },
175
- '修改工单': {
176
- url: 'rs/logic/modifyOrder'
177
- },
178
- }
179
-
180
- export default {
181
- title: '置换通气单',
182
- props: {
183
- data: { // 用户基本信息
184
- type: Object,
185
- default: null
186
- },
187
- type: { // 类型,为区分复选框,当组件重用并切重用组件同时出现,复选框id相同时会有干扰,
188
- type: String
189
- },
190
- callObj: { // 话务对象
191
- type: Object,
192
- default: null
193
- },
194
- loginUser: {
195
- type: Object
196
- },
197
- modifyOrder: { // 修改工单传入得工单信息
198
- type: Object
199
- },
200
- operType: { // 操作类型,有报修,重新派单,修改工单,其中修改时,选择站点将不可点击,重新派单和修改要先将工单查询出来
201
- type: String,
202
- default: '报修'
203
- },
204
- meading: {
205
- type: String,
206
- default: '转维修员'
207
- }
208
- },
209
- data() {
210
- return {
211
- rowsdata: false, //
212
- saveing: false,
213
- selectSendshow: false,
214
- // 维修员信息
215
- repairers: [],
216
- // 建档时表具信息
217
- materdata: {
218
- type: Object
219
- },
220
- mattershow: false,
221
- // 小区编号
222
- districtname_id: '',
223
- servicesource: '话务来电', // 工单来源
224
- addressshow: false,
225
- addressselect: false,
226
- phoneValid: false,
227
- residential: [],
228
- row: {
229
- f_residential_area: ''
230
- },
231
- residentialquery: '',
232
- areacondition: '',
233
- testdata: {f_equipment: ''},
234
- residentialTemplate: 'f_villagename',
235
- unitTemplate: 'f_unitname',
236
- model: {
237
- // 一次派单
238
- serviceacitivity: [{
239
- f_service_acitivity_type: '派单'
240
- }],
241
- f_yuyue_date: '', // 预约时间
242
- f_source: '话务来电',
243
- f_service_id: '',
244
- f_userinfo_id: '',
245
- f_contact_phone: '',
246
- f_meetunit: '',
247
- f_phone: '',
248
- f_user_name: '',
249
- f_address: '',
250
- f_repair_date: Util.getNowDate(),
251
- f_card_id: '',
252
- f_reciever: '',
253
- f_remarks: '',
254
- f_user_type: '民用',
255
- f_gasproperties: '居民用气',
256
- f_area: '',
257
- f_unit_name: '',
258
- f_street: '',
259
- f_residential_area: '',
260
- f_building: '',
261
- f_handlingtype: '转维修员',
262
- f_unit: '',
263
- f_floor: '',
264
- f_room: '',
265
- aState: null,
266
- f_addressid: '',
267
- f_orgid: this.$login.f.orgid,
268
- f_orgname: this.$login.f.orgs,
269
- f_depname: this.$login.f.dops,
270
- f_depid: this.$login.f.depids,
271
- f_operator: this.$login.f.name,
272
- f_operatorid: this.$login.f.id,
273
- f_filiale: '',
274
- f_filiale_id: '',
275
- f_change_tag: ''
276
- },
277
- addressuser: [], // 存工单数据数组
278
- types: [],
279
- information: [], // 用来存放字表信息
280
- serviceList: null, // 用来存放查询当前地址下的未完成工单
281
- id: '', // 编写测试时会使用
282
- f_service_id: '',
283
- repairstypes: this.$appdata.getParam('报修类型'),
284
- usertypes: this.$appdata.getParam('用户类型'),
285
- gastypes: this.$appdata.getParam('用气性质'),
286
- stands: this.$appdata.getParam('站点管理员'),
287
- sources: this.$appdata.getParam('工单来源'),
288
- handling: [{label: '转站点', value: '转站点'}, {label: '转置换员', value: '转维修员'}],
289
- source:
290
- 'dep=this.getParentByType($organization$).getSpecialResByType($department$),' +
291
- 'tool.getFullTree(dep.where(row.hasSpecialRole($派单员$)))',
292
- userid: this.$login.f.id,
293
- }
294
- },
295
- ready() {
296
- // 获取sendType.json配置信息 获取派单类型 转站点,转维修员,自选模式
297
- getSendType(this)
298
- },
299
- methods: {
300
- assignObj() {
301
- if (this.data) {
302
- this.model.f_address = this.data.f_address
303
- this.model.f_user_name = this.data.f_user_name
304
- this.model.f_meternumber = this.data.f_meternumber
305
- this.model.f_user_type = this.data.f_user_type
306
- this.model.f_contact_phone = this.data.f_user_phone
307
- this.model.f_userinfo_id = this.data.f_userinfo_id
308
- this.model.f_userinfo_code = this.data.f_userinfo_code
309
- this.model.f_card_id = this.data.card_id
310
- if (this.model.f_user_type === '民用') {
311
- this.model.f_area = this.data.f_area
312
- this.model.f_street = this.data.f_street
313
- this.model.f_residential_area = this.data.f_residential_area
314
- this.model.f_building = this.data.f_building
315
- this.model.f_unit = this.data.f_unit
316
- this.model.f_floor = this.data.f_floor
317
- this.model.f_room = this.data.f_room
318
- }
319
- }
320
- },
321
- closeAddressModal() {
322
- this.addressshow = false
323
- },
324
- // 当维修员发生改变,获取维修员手机号
325
- repiarmancg(val) {
326
- if (val) {
327
- //tag
328
- if (typeof val == 'string') {
329
- this.model.serviceacitivity[0].f_reciever = val
330
- let http1 = new HttpResetClass()
331
- http1.load('POST', 'rs/sql/tel_singleTable_OrderBy', {
332
- data: {
333
- items: 'f_user_telephone',
334
- tablename: 't_user',
335
- condition: `name = '${val}'`,
336
- orderitem: 'id'
337
- }
338
- }, {resolveMsg: null, rejectMsg: null}).then((ress) => {
339
- this.model.f_repairman_phone = ress.data[0].f_user_telephone
340
- })
341
- }
342
- }
343
- },
344
- // 当工单来源属性发生改变
345
- sourcechange(val) {
346
- if (val == undefined || val == '') {
347
- return
348
- }
349
- this.model.f_source = val
350
- this.servicesource = val
351
- },
352
- adressshow() {
353
- this.addressshow = true
354
- },
355
- isshow() {
356
- this.mattershow = true
357
- },
358
- // 获取维修员
359
- getEmp() {
360
- let val = {source: 'tool.getChildrenOfResName($置换员$)', userid: `${this.$login.f.id}`}
361
- let http = new HttpResetClass()
362
- http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
363
- let result = res.data.filter(res => res.orgid == this.$login.f.orgid)
364
- result.forEach((item) => {
365
- this.repairers.push({label: `${item.name}`, value: item.name})
366
-
367
- })
368
- })
369
- },
370
- addressclose() {
371
- this.addressuser = []
372
- this.model.f_address = ''
373
- this.model.f_addressid = ''
374
- this.addressshow = false
375
- },
376
- // 控制地址管理组件显示与否
377
- // 截取字符串
378
- interceptString(val) {
379
- },
380
- // 选中地址
381
- rerefParent(val) {
382
- this.addressshow = false
383
- this.addressuser = []
384
- this.model.f_address = ''
385
- this.model.f_addressid = ''
386
- this.model.f_userinfo_id = ''
387
- if (val.length > 0) {
388
- //tag
389
- this.model.f_address = val[0].name
390
- this.model.f_addressid = val[0].id
391
- this.model.f_userinfo_id = val[0].f_userinfo_id
392
- val.forEach((item) => {
393
- var address = {
394
- f_address: item.name,
395
- id: item.id,
396
- f_userinfo_id: item.f_userinfo_id
397
- }
398
- this.addressuser.push(address)
399
- })
400
- }
401
- },
402
- // 选中部门
403
- reres(val) {
404
- if (val.res == undefined || val.res[0] == undefined || val.res[0] == '') {
405
- return
406
- }
407
- this.model.serviceacitivity[0].f_meetunit = val.res[0]
408
- this.model.f_meetunit = val.res[0]
409
- this.model.f_filiale_id = val.orgobj[0].parentid
410
- this.model.f_filiale = val.orgobj[0].parentname
411
- this.model.f_outlets = val.res[0]
412
- this.model.serviceacitivity[0].f_reciever = val.resids[0]
413
- },
414
- onReady() {
415
- //tag
416
- this.$emit('ready')
417
- },
418
- onError(error) {
419
- //tag
420
- this.$emit('error', error)
421
- },
422
- add(query) {
423
- if (typeof (query) === 'string') {
424
- this.model.f_residential_area = query
425
- this.address()
426
- }
427
- },
428
- // 修改或者重派工单时,加载工单的故障信息
429
- projectCallback(item) {
430
- if (item) {
431
- return item.f_user_name
432
- }
433
-
434
- },
435
- selectUnit(query) {
436
- return this.$resetpost('rs/sql/tel_singleTable_OrderBy',
437
- {
438
- data: {
439
- items: 'f_unitname',
440
- tablename: 't_unitcoordinate',
441
- condition: `(f_unitname like '${query}%' or F_TRANS_PINYIN_CAPITAL(f_unitname) like '${query}%')and rownum<10`,
442
- orderitem: 'id'
443
- }
444
- }, {resolveMsg: null, rejectMsg: null}
445
- )
446
- },
447
- selectResidential(query) {
448
- return this.$resetpost('rs/sql/tel_singleTable_OrderBy',
449
- {
450
- data: {
451
- items: 'f_villagename',
452
- tablename: 't_villagecoordinate',
453
- condition: `(f_villagename like '${query}%' or F_TRANS_PINYIN_CAPITAL(f_villagename) like '${query}%')and rownum<10`,
454
- orderitem: 'id'
455
- }
456
- }, {resolveMsg: null, rejectMsg: null}
457
- )
458
- },
459
- setModifyOrder() {
460
- this.model = Object.assign({}, this.model, this.modifyOrder)
461
- },
462
- // 提交
463
- getData(val) {
464
- return this.residential
465
- },
466
-
467
- // 清理信息
468
- cleardata(type) {
469
- this.model = Object.assign({}, {
470
- // 一次派单
471
- serviceacitivity: [{
472
- f_service_acitivity_type: '派单',
473
- f_meetunit: this.model.serviceacitivity[0].f_meetunit,
474
- f_reciever: this.model.serviceacitivity[0].f_reciever
475
- }],
476
- f_yuyue_date: '', // 预约时间
477
- f_meetunit: this.model.f_meetunit,
478
- f_outlets: this.model.f_outlets,
479
- f_service_id: '',
480
- f_contact_phone: '',
481
- f_phone: '',
482
- f_user_name: '',
483
- f_userinfo_id: '',
484
- failure: '',
485
- f_address: '',
486
- f_handlingtype: this.model.f_handlingtype,
487
- f_repair_date: Util.getNowDate(),
488
- f_card_id: '',
489
- f_remarks: '',
490
- f_user_type: '',
491
- f_area: '',
492
- f_street: '',
493
- f_residential_area: '',
494
- f_building: '',
495
- f_unit: '',
496
- f_floor: '',
497
- f_room: '',
498
- f_source: this.servicesource,
499
- aState: null,
500
- f_addressid: '',
501
- f_orgid: this.$login.f.orgid,
502
- f_orgname: this.$login.f.orgs,
503
- f_depname: this.$login.f.dops,
504
- f_depid: this.$login.f.depids,
505
- f_operator: this.$login.f.name,
506
- f_operatorid: this.$login.f.id,
507
- f_filiale: this.model.f_filiale,
508
- f_filiale_id: this.model.f_filiale_id
509
- }),
510
- this.modifyOrder = {}
511
- this.addressuser = []
512
- this.rowsdata = true
513
- this.types = []
514
- if (this.callObj && this.callObj.callNum && type != 'init') {
515
- this.callObj.callNum = null
516
- this.model.aState = null
517
- }
518
- },
519
- async save() {
520
- // 判断是否录入用户类型
521
- if (this.model.f_user_type == '' || this.model.f_user_type == undefined) {
522
- return this.$showAlert('请选择客户类型!', 'warning', 2000)
523
- }
524
- // 判断是否录入用气性质
525
- if (this.model.f_gasproperties == '' || this.model.f_gasproperties == undefined) {
526
- return this.$showAlert('请选择用气性质!', 'warning', 2000)
527
- }
528
- // 判断是否输入地址
529
- if (this.model.f_address == '' || this.model.f_address == undefined) {
530
- return this.$showAlert('请选择地址!', 'warning', 2000)
531
- }
532
- if (this.operType != '修改工单') {
533
- if (this.model.serviceacitivity[0].f_reciever == '' || this.model.serviceacitivity[0].f_reciever == undefined) {
534
- if (this.meading == '转维修员') {
535
- return this.$showAlert('请选择置换人员', 'warning', 2000)
536
- } else {
537
- return this.$showAlert('请选择站点', 'warning', 2000)
538
- }
539
- }
540
- }
541
- this.$emit('saveing')
542
- if (this.meading == '转维修员') {
543
- this.model.f_meetunit = this.$login.f.deps
544
- this.model.f_orgid = this.$login.f.orgid
545
- this.model.f_filiale = this.$login.f.org
546
- this.model.f_outlets = this.$login.f.deps
547
- this.model.f_filiale_id = this.$login.f.orgid
548
- }
549
- if (this.operType === '报修') {
550
- this.model.f_change_tag = "散户派工"
551
- let data = {
552
- model: this.model, loginUser: {
553
- name: this.loginUser.name,
554
- ename: this.loginUser.ename
555
- }, callObj: this.callObj
556
- }
557
- let url = ''
558
- if (this.meading === '转站点') {
559
- url = config[this.operType].url
560
- } else {
561
- url = config[this.operType].url
562
- data.toRepair = '一级派单'
563
- }
564
- let http2 = new HttpResetClass()
565
- let dataid = await http2.load('POST', url, data, {resolveMsg: null, rejectMsg: null})
566
- //tag
567
- var sendnum = 1
568
- }
569
- this.$emit('saveend')
570
- this.$emit('commitsus', this.model.f_phone)
571
- this.cleardata()
572
- if (this.operType == '修改工单') {
573
- this.$showMessage(`修改成功!`)
574
- } else {
575
- this.$showMessage(`本次下发 ${sendnum} 条置换单!`)
576
- }
577
- },
578
- async checkServerList(addressid) {
579
- if (addressid) {
580
- let http1 = new HttpResetClass()
581
- let res = await http1.load('POST', 'rs/sql/tel_getServiceActivity', {data: {condition: `f_addressid = '${addressid}'`}}, {
582
- resolveMsg: null,
583
- rejectMsg: null
584
- })
585
- //有未完成工单
586
- let ls = res.data.length
587
- var AddressService = {}
588
- if (ls > 0) {
589
- // 当前地址下还有工单未完成
590
- AddressService = {
591
- defname: res.data[0].defname,
592
- f_service_id: res.data[0].f_service_id
593
- }
594
- } else {
595
- AddressService = {
596
- defname: '无工单'
597
- }
598
- }
599
- return AddressService
600
- }
601
- },
602
- // 处理故障输入
603
- procFailure(value) {
604
- this.model.failure = value
605
- },
606
- },
607
- watch: {
608
- // 转接类型
609
- 'model.f_handlingtype'() {
610
- // 清楚上次记录
611
- this.model.serviceacitivity[0].f_reciever = ''
612
- this.model.serviceacitivity[0].f_meetunit = ''
613
- this.model.f_meetunit = ''
614
- this.model.f_outlets = ''
615
- this.model.f_repairman_phone = ''
616
- if (this.model.f_handlingtype == '转维修员') {
617
- this.meading = '转维修员'
618
- this.repairers = []
619
- this.getEmp()
620
- } else {
621
- this.repairers = []
622
- this.meading = '转站点'
623
- }
624
- },
625
- // 是否清空
626
- 'cleantf'() {
627
- this.cleardata()
628
- },
629
- 'model.f_contact_phone'(val) {
630
- this.phoneValid = /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/.test(this.model.f_contact_phone)
631
- },
632
- // 话务对象发生变化将来电电话赋值给f_phone
633
- 'callObj.callNum'() {
634
- this.cleardata('init')
635
- this.model.f_phone = this.callObj.callNum
636
- this.model.f_records_id = this.callObj.RecordsID
637
- // this.model.f_contact_phone = this.callObj.callNum
638
- this.model.f_repair_date = Util.getNowDate()
639
- },
640
- 'types.length'() {
641
- var ev = new Event("resize", {"bubbles": true, "cancelable": false});
642
- window.dispatchEvent(ev);
643
- },
644
- 'callObj.aState'() {
645
- this.model.aState = this.callObj.aState
646
- //tag
647
- },
648
- 'model.f_gasproperties'() {
649
- if (this.model.f_gasproperties != '民用用气') {
650
- this.model.f_user_type = '非民用'
651
- } else {
652
- this.model.f_user_type = '民用'
653
- }
654
- //tag
655
- },
656
- 'data'() {
657
- this.assignObj()
658
- },
659
- },
660
- computed: {
661
- IsClickDisabled: function () {
662
- if (this.$v.valid) {
663
- if (this.model.aState === null) {
664
- //tag
665
- return false
666
- }
667
- if (this.model.f_phone && this.model.aState === '正在保存' && this.model.aState === '置忙') {
668
- //tag
669
- return false
670
- }
671
- if (!this.model.f_phone) {
672
-
673
- //tag
674
- return false
675
- }
676
- //tag
677
- return true
678
- } else {
679
- //tag
680
- return true
681
- }
682
- },
683
- getTestData() {
684
- return this.testdata
685
- },
686
- serviceacitivity() {
687
- return this.model.serviceacitivity.find((row) => {
688
- return row.f_service_acitivity_type === '派单'
689
- })
690
- },
691
- alertObject() {
692
- let result = this.model.failure.find((value) => {
693
- return value.f_failure_type === '报警器'
694
- })
695
- if (result) {
696
- return result
697
- }
698
- return {f_equipment: ''}
699
- },
700
- gasstove() {
701
- let result = this.model.failure.find((value) => {
702
- return value.f_failure_type === '燃气灶'
703
- })
704
- if (result) {
705
- return result
706
- }
707
- return {f_equipment: ''}
708
- },
709
- furnace() {
710
- let result = this.model.failure.find((value) => {
711
- return value.f_failure_type === '壁挂炉'
712
- })
713
- if (result) {
714
- return result
715
- }
716
- return {f_equipment: ''}
717
- },
718
- heater() {
719
- let result = this.model.failure.find((value) => {
720
- return value.f_failure_type === '热水器'
721
- })
722
- if (result) {
723
- return result
724
- }
725
- return {f_equipment: ''}
726
- },
727
- lampblack() {
728
- let result = this.model.failure.find((value) => {
729
- return value.f_failure_type === '油烟机'
730
- })
731
- if (result) {
732
- return result
733
- }
734
- return {f_equipment: ''}
735
- }
736
- },
737
- events: {
738
- getPosition(val) {
739
- //tag
740
- this.$dispatch('distribute', val)
741
-
742
- }
743
- },
744
- components: {}
745
- }
746
-
747
- </script>
748
- <style>
749
- .class-error {
750
- color: #a94442;
751
- }
752
-
753
- </style>
1
+ <template xmlns:v-validate="http://www.w3.org/1999/xhtml">
2
+ <div class="auto select-overspread form-horizontal auto" id="pc-repair-work">
3
+ <validator name="v">
4
+ <div class="row">
5
+ <!-- <div class="col-sm-6 form-group form-fix-width">-->
6
+ <!-- <label class="font_normal_body" style="width: 30%">来电电话</label>-->
7
+ <!-- <input style="width: 60%" type="text" readonly v-model='model.f_phone' class="form-control"></input>-->
8
+ <!-- </div>-->
9
+ <!-- <div class="col-sm-6 form-group form-fix-width" >-->
10
+ <!-- <label style="width: 30%" class="font_normal_body" for="f_user_name" :class="model.f_user_name ? '': 'class-error' ">联系人</label>-->
11
+ <!-- <input style="width: 60%" type="text" v-model='model.f_user_name' id="f_user_name" name="f_user_name" class="form-control"/>-->
12
+ <!-- </div>-->
13
+ <div class="col-sm-6 form-group form-fix-width">
14
+ <label for="f_area" class="font_normal_body" style="width: 30%">用气性质</label>
15
+ <v-select :value.sync="model.f_gasproperties" :value-single="true"
16
+ :options='gastypes' placeholder='用气性质'
17
+ close-on-select>
18
+ </v-select>
19
+ </div>
20
+ <!-- <div class="col-sm-6 form-group form-fix-width">-->
21
+ <!-- <label style="width: 30%" class="font_normal_body " for="f_contact_phone" :class="model.f_contact_phone ? '' : 'class-error'">联系电话</label>-->
22
+ <!-- <input style="width: 60%" type="text" v-model='model.f_contact_phone' id="f_contact_phone" class="form-control"/>-->
23
+ <!-- </div>-->
24
+ <div class="col-sm-12 form-group form-fix-width">
25
+ <label style="width: 15%" for="f_address" class="font_normal_body">详细地址</label>
26
+ <input style="width: 65%" type="text" class="form-control" v-model="model.f_address" id="f_address"
27
+ placeholder="详细地址"
28
+ v-el:address v-next-el="idnumber"/>
29
+ <!-- <button style="width: 15%" type="button" name="button" class="btn btn-difault" @click='adressshow'>-->
30
+ <!-- 选择地址-->
31
+ <!-- </button>-->
32
+ </div>
33
+ <div class="col-sm-12 form-group form-fix-width">
34
+ <label style="width: 15%" for="f_address" class="font_normal_body">来电电话</label>
35
+ <input style="width: 65%" type="number" class="form-control" v-model="model.f_phone" id="f_phone"
36
+ placeholder="来电电话"
37
+ v-el:address v-next-el="idnumber"/>
38
+ </div>
39
+ </div>
40
+ <div class="row">
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 type="radio"
46
+ v-model="model.f_handlingtype"
47
+ value="{{handling1.label}}">
48
+ {{ handling1.label }}
49
+ </label>
50
+ </div>
51
+ </div>
52
+ <div class="col-sm-6 form-group form-fix-width">
53
+ <label class=" font_normal_body" style="width: 30%">派单类型</label>
54
+ <v-select :value.sync="model.f_handlingtype" :value-single="true"
55
+ :options='handling' placeholder='请选择派单类型'
56
+ close-on-select
57
+ ></v-select>
58
+ </div>
59
+ <div class="col-sm-6 form-group form-fix-width" v-if="meading == '转站点'">
60
+ <label class=" font_normal_body" style="width: 30%">选择站点</label>
61
+ <input type="text" v-show="false" v-model="serviceacitivity.f_reciever">
62
+ <right-tree islist :userid="userid" :source="source" v-on:re-res="reres" :textContent="选择站点" :selectData="">
63
+
64
+ </right-tree>
65
+ </div>
66
+ <div class="col-sm-6 form-group form-fix-width" :class="[$v.f_reciever.required ? 'select-error' : '']"
67
+ v-if="meading == '转维修员'">
68
+ <label class="font_normal_body" style="width: 30%">置换员</label>
69
+ <v-select :value="model.serviceacitivity[0].f_reciever" :value-single="true"
70
+ :options='repairers' placeholder='请选择置换员'
71
+ close-on-select v-on:change="repiarmancg"></v-select>
72
+ </div>
73
+ <div class="col-sm-6 form-group form-fix-width">
74
+ <label class=" font_normal_body" style="width: 30%">工单来源</label>
75
+ <v-select :value="model.f_source" :value-single="true"
76
+ :options='sources' placeholder='请选择工单来源'
77
+ close-on-select
78
+ v-on:change="sourcechange"></v-select>
79
+ </div>
80
+ <div class="col-sm-6 form-group form-fix-width">
81
+ <label class=" font_normal_body" style="width: 30%">预约时间</label>
82
+ <datepicker placeholder="请选择预约时间"
83
+ :value.sync="model.f_yuyue_date"
84
+ v-model="model.f_yuyue_date"
85
+ :format="'yyyy-MM-dd HH:mm:ss'"
86
+ style="width: 60%"></datepicker>
87
+ </div>
88
+ </div>
89
+ <div class="row">
90
+ <div class="col-sm-12 form-group form-fix-width">
91
+ <label class="font_normal_body" style="width: 15%">备注</label>
92
+ <textarea style="width: 80%" name="name" rows="2" class="ver-textarea" class="form-control"
93
+ v-model='model.f_remarks'></textarea>
94
+ </div>
95
+ </div>
96
+ <div class="row">
97
+ <button type="button" name="button" class="btn btn-difault" v-if="operType !== '报修'" @click="$emit('cancel')">
98
+ 取消
99
+ </button>
100
+ <button type="button" name="button" style="float: right" class="button_spacing button_search" @click="save">
101
+ 提交
102
+ </button>
103
+ </div>
104
+ </validator>
105
+ <modal v-if="addressshow" :show.sync="true" v-ref:modal backdrop="false" width="90%" height="90%">
106
+ <header slot="modal-header" class="modal-header">
107
+ <h4 class="modal-title">地址管理</h4>
108
+ </header>
109
+ <article slot="modal-body" class="modal-body">
110
+ <batch_orders @submit="rerefParent" @cancel="addressclose" :clear="rowsdata">
111
+
112
+ </batch_orders>
113
+ </article>
114
+ <footer slot="modal-footer" class="modal-footer">
115
+ <button type="button" name="button" style="float: right" class="button_spacing button_search"
116
+ @click="closeAddressModal">
117
+ 关闭
118
+ </button>
119
+ </footer>
120
+ </modal>
121
+ </div>
122
+ </template>
123
+
124
+ <script>
125
+ import {HttpResetClass} from 'vue-client'
126
+ import * as Util from '../../../components/Util'
127
+ // 获取派单类型, 类型 : 转站点,转维修员,自选模式
128
+ let getSendType = async function (self) {
129
+ try {
130
+ // 如果初始化为派维修员,则不获取配置文件
131
+ if (self.meading == '转维修员') {
132
+ self.model.f_handlingtype = '转维修员'
133
+ } else {
134
+ let http = new HttpResetClass()
135
+ let result = await http.load('GET', `rs/vue/sendType.json`, {}, {resolveMsg: null, rejectMsg: null})
136
+ //tag
137
+ if (result.data.sendType == '自选模式') {
138
+ self.selectSendshow = true
139
+ } else {
140
+ // 转站点/转维修员
141
+ if (result.data.sendType == '转维修员') {
142
+ self.model.f_handlingtype = '转维修员'
143
+ }
144
+ self.meading = result.data.sendType
145
+ }
146
+ }
147
+ } catch (e) {
148
+ //tag
149
+ } finally {
150
+ // 获取维修员
151
+ if (self.meading == '转维修员') {
152
+ self.repairers = []
153
+ self.getEmp()
154
+ }
155
+ self.model.f_user_type = "民用"
156
+ if (self.operType === '报修') {
157
+ // self.assignObj()
158
+ } else if (self.operType === '重新派单') {
159
+ // 通过当前登录人获取需要重新派发单子,也可对单子进行修改
160
+ self.setModifyOrder()
161
+ } else if (self.operType === '修改工单') {
162
+ // 通过传入数据,查询出工单,选择站点将不可点击
163
+ self.setModifyOrder()
164
+ }
165
+ }
166
+ }
167
+ // 工作类型对应的各项设置
168
+ const config = {
169
+ '报修': {
170
+ url: 'rs/logic/callerSendZH'
171
+ },
172
+ '重新派单': {
173
+ url: 'rs/logic/resend'
174
+ },
175
+ '修改工单': {
176
+ url: 'rs/logic/modifyOrder'
177
+ },
178
+ }
179
+
180
+ export default {
181
+ title: '置换通气单',
182
+ props: {
183
+ data: { // 用户基本信息
184
+ type: Object,
185
+ default: null
186
+ },
187
+ type: { // 类型,为区分复选框,当组件重用并切重用组件同时出现,复选框id相同时会有干扰,
188
+ type: String
189
+ },
190
+ callObj: { // 话务对象
191
+ type: Object,
192
+ default: null
193
+ },
194
+ loginUser: {
195
+ type: Object
196
+ },
197
+ modifyOrder: { // 修改工单传入得工单信息
198
+ type: Object
199
+ },
200
+ operType: { // 操作类型,有报修,重新派单,修改工单,其中修改时,选择站点将不可点击,重新派单和修改要先将工单查询出来
201
+ type: String,
202
+ default: '报修'
203
+ },
204
+ meading: {
205
+ type: String,
206
+ default: '转维修员'
207
+ }
208
+ },
209
+ data() {
210
+ return {
211
+ rowsdata: false, //
212
+ saveing: false,
213
+ selectSendshow: false,
214
+ // 维修员信息
215
+ repairers: [],
216
+ // 建档时表具信息
217
+ materdata: {
218
+ type: Object
219
+ },
220
+ mattershow: false,
221
+ // 小区编号
222
+ districtname_id: '',
223
+ servicesource: '话务来电', // 工单来源
224
+ addressshow: false,
225
+ addressselect: false,
226
+ phoneValid: false,
227
+ residential: [],
228
+ row: {
229
+ f_residential_area: ''
230
+ },
231
+ residentialquery: '',
232
+ areacondition: '',
233
+ testdata: {f_equipment: ''},
234
+ residentialTemplate: 'f_villagename',
235
+ unitTemplate: 'f_unitname',
236
+ model: {
237
+ // 一次派单
238
+ serviceacitivity: [{
239
+ f_service_acitivity_type: '派单'
240
+ }],
241
+ f_yuyue_date: '', // 预约时间
242
+ f_source: '话务来电',
243
+ f_service_id: '',
244
+ f_userinfo_id: '',
245
+ f_contact_phone: '',
246
+ f_meetunit: '',
247
+ f_phone: '',
248
+ f_user_name: '',
249
+ f_address: '',
250
+ f_repair_date: Util.getNowDate(),
251
+ f_card_id: '',
252
+ f_reciever: '',
253
+ f_remarks: '',
254
+ f_user_type: '民用',
255
+ f_gasproperties: '居民用气',
256
+ f_area: '',
257
+ f_unit_name: '',
258
+ f_street: '',
259
+ f_residential_area: '',
260
+ f_building: '',
261
+ f_handlingtype: '转维修员',
262
+ f_unit: '',
263
+ f_floor: '',
264
+ f_room: '',
265
+ aState: null,
266
+ f_addressid: '',
267
+ f_orgid: this.$login.f.orgid,
268
+ f_orgname: this.$login.f.orgs,
269
+ f_depname: this.$login.f.dops,
270
+ f_depid: this.$login.f.depids,
271
+ f_operator: this.$login.f.name,
272
+ f_operatorid: this.$login.f.id,
273
+ f_filiale: '',
274
+ f_filiale_id: '',
275
+ f_change_tag: ''
276
+ },
277
+ addressuser: [], // 存工单数据数组
278
+ types: [],
279
+ information: [], // 用来存放字表信息
280
+ serviceList: null, // 用来存放查询当前地址下的未完成工单
281
+ id: '', // 编写测试时会使用
282
+ f_service_id: '',
283
+ repairstypes: this.$appdata.getParam('报修类型'),
284
+ usertypes: this.$appdata.getParam('用户类型'),
285
+ gastypes: this.$appdata.getParam('用气性质'),
286
+ stands: this.$appdata.getParam('站点管理员'),
287
+ sources: this.$appdata.getParam('工单来源'),
288
+ handling: [{label: '转站点', value: '转站点'}, {label: '转置换员', value: '转维修员'}],
289
+ source:
290
+ 'dep=this.getParentByType($organization$).getSpecialResByType($department$),' +
291
+ 'tool.getFullTree(dep.where(row.hasSpecialRole($派单员$)))',
292
+ userid: this.$login.f.id,
293
+ }
294
+ },
295
+ ready() {
296
+ // 获取sendType.json配置信息 获取派单类型 转站点,转维修员,自选模式
297
+ getSendType(this)
298
+ },
299
+ methods: {
300
+ assignObj() {
301
+ if (this.data) {
302
+ this.model.f_address = this.data.f_address
303
+ this.model.f_user_name = this.data.f_user_name
304
+ this.model.f_meternumber = this.data.f_meternumber
305
+ this.model.f_user_type = this.data.f_user_type
306
+ this.model.f_contact_phone = this.data.f_user_phone
307
+ this.model.f_userinfo_id = this.data.f_userinfo_id
308
+ this.model.f_userinfo_code = this.data.f_userinfo_code
309
+ this.model.f_card_id = this.data.card_id
310
+ if (this.model.f_user_type === '民用') {
311
+ this.model.f_area = this.data.f_area
312
+ this.model.f_street = this.data.f_street
313
+ this.model.f_residential_area = this.data.f_residential_area
314
+ this.model.f_building = this.data.f_building
315
+ this.model.f_unit = this.data.f_unit
316
+ this.model.f_floor = this.data.f_floor
317
+ this.model.f_room = this.data.f_room
318
+ }
319
+ }
320
+ },
321
+ closeAddressModal() {
322
+ this.addressshow = false
323
+ },
324
+ // 当维修员发生改变,获取维修员手机号
325
+ repiarmancg(val) {
326
+ if (val) {
327
+ //tag
328
+ if (typeof val == 'string') {
329
+ this.model.serviceacitivity[0].f_reciever = val
330
+ let http1 = new HttpResetClass()
331
+ http1.load('POST', 'rs/sql/tel_singleTable_OrderBy', {
332
+ data: {
333
+ items: 'f_user_telephone',
334
+ tablename: 't_user',
335
+ condition: `name = '${val}'`,
336
+ orderitem: 'id'
337
+ }
338
+ }, {resolveMsg: null, rejectMsg: null}).then((ress) => {
339
+ this.model.f_repairman_phone = ress.data[0].f_user_telephone
340
+ })
341
+ }
342
+ }
343
+ },
344
+ // 当工单来源属性发生改变
345
+ sourcechange(val) {
346
+ if (val == undefined || val == '') {
347
+ return
348
+ }
349
+ this.model.f_source = val
350
+ this.servicesource = val
351
+ },
352
+ adressshow() {
353
+ this.addressshow = true
354
+ },
355
+ isshow() {
356
+ this.mattershow = true
357
+ },
358
+ // 获取维修员
359
+ getEmp() {
360
+ let val = {source: 'tool.getChildrenOfResName($置换员$)', userid: `${this.$login.f.id}`}
361
+ let http = new HttpResetClass()
362
+ http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
363
+ let result = res.data.filter(res => res.orgid == this.$login.f.orgid)
364
+ result.forEach((item) => {
365
+ this.repairers.push({label: `${item.name}`, value: item.name})
366
+
367
+ })
368
+ })
369
+ },
370
+ addressclose() {
371
+ this.addressuser = []
372
+ this.model.f_address = ''
373
+ this.model.f_addressid = ''
374
+ this.addressshow = false
375
+ },
376
+ // 控制地址管理组件显示与否
377
+ // 截取字符串
378
+ interceptString(val) {
379
+ },
380
+ // 选中地址
381
+ rerefParent(val) {
382
+ this.addressshow = false
383
+ this.addressuser = []
384
+ this.model.f_address = ''
385
+ this.model.f_addressid = ''
386
+ this.model.f_userinfo_id = ''
387
+ if (val.length > 0) {
388
+ //tag
389
+ this.model.f_address = val[0].name
390
+ this.model.f_addressid = val[0].id
391
+ this.model.f_userinfo_id = val[0].f_userinfo_id
392
+ val.forEach((item) => {
393
+ var address = {
394
+ f_address: item.name,
395
+ id: item.id,
396
+ f_userinfo_id: item.f_userinfo_id
397
+ }
398
+ this.addressuser.push(address)
399
+ })
400
+ }
401
+ },
402
+ // 选中部门
403
+ reres(val) {
404
+ if (val.res == undefined || val.res[0] == undefined || val.res[0] == '') {
405
+ return
406
+ }
407
+ this.model.serviceacitivity[0].f_meetunit = val.res[0]
408
+ this.model.f_meetunit = val.res[0]
409
+ this.model.f_filiale_id = val.orgobj[0].parentid
410
+ this.model.f_filiale = val.orgobj[0].parentname
411
+ this.model.f_outlets = val.res[0]
412
+ this.model.serviceacitivity[0].f_reciever = val.resids[0]
413
+ },
414
+ onReady() {
415
+ //tag
416
+ this.$emit('ready')
417
+ },
418
+ onError(error) {
419
+ //tag
420
+ this.$emit('error', error)
421
+ },
422
+ add(query) {
423
+ if (typeof (query) === 'string') {
424
+ this.model.f_residential_area = query
425
+ this.address()
426
+ }
427
+ },
428
+ // 修改或者重派工单时,加载工单的故障信息
429
+ projectCallback(item) {
430
+ if (item) {
431
+ return item.f_user_name
432
+ }
433
+
434
+ },
435
+ selectUnit(query) {
436
+ return this.$resetpost('rs/sql/tel_singleTable_OrderBy',
437
+ {
438
+ data: {
439
+ items: 'f_unitname',
440
+ tablename: 't_unitcoordinate',
441
+ condition: `(f_unitname like '${query}%' or F_TRANS_PINYIN_CAPITAL(f_unitname) like '${query}%')and rownum<10`,
442
+ orderitem: 'id'
443
+ }
444
+ }, {resolveMsg: null, rejectMsg: null}
445
+ )
446
+ },
447
+ selectResidential(query) {
448
+ return this.$resetpost('rs/sql/tel_singleTable_OrderBy',
449
+ {
450
+ data: {
451
+ items: 'f_villagename',
452
+ tablename: 't_villagecoordinate',
453
+ condition: `(f_villagename like '${query}%' or F_TRANS_PINYIN_CAPITAL(f_villagename) like '${query}%')and rownum<10`,
454
+ orderitem: 'id'
455
+ }
456
+ }, {resolveMsg: null, rejectMsg: null}
457
+ )
458
+ },
459
+ setModifyOrder() {
460
+ this.model = Object.assign({}, this.model, this.modifyOrder)
461
+ },
462
+ // 提交
463
+ getData(val) {
464
+ return this.residential
465
+ },
466
+
467
+ // 清理信息
468
+ cleardata(type) {
469
+ this.model = Object.assign({}, {
470
+ // 一次派单
471
+ serviceacitivity: [{
472
+ f_service_acitivity_type: '派单',
473
+ f_meetunit: this.model.serviceacitivity[0].f_meetunit,
474
+ f_reciever: this.model.serviceacitivity[0].f_reciever
475
+ }],
476
+ f_yuyue_date: '', // 预约时间
477
+ f_meetunit: this.model.f_meetunit,
478
+ f_outlets: this.model.f_outlets,
479
+ f_service_id: '',
480
+ f_contact_phone: '',
481
+ f_phone: '',
482
+ f_user_name: '',
483
+ f_userinfo_id: '',
484
+ failure: '',
485
+ f_address: '',
486
+ f_handlingtype: this.model.f_handlingtype,
487
+ f_repair_date: Util.getNowDate(),
488
+ f_card_id: '',
489
+ f_remarks: '',
490
+ f_user_type: '',
491
+ f_area: '',
492
+ f_street: '',
493
+ f_residential_area: '',
494
+ f_building: '',
495
+ f_unit: '',
496
+ f_floor: '',
497
+ f_room: '',
498
+ f_source: this.servicesource,
499
+ aState: null,
500
+ f_addressid: '',
501
+ f_orgid: this.$login.f.orgid,
502
+ f_orgname: this.$login.f.orgs,
503
+ f_depname: this.$login.f.dops,
504
+ f_depid: this.$login.f.depids,
505
+ f_operator: this.$login.f.name,
506
+ f_operatorid: this.$login.f.id,
507
+ f_filiale: this.model.f_filiale,
508
+ f_filiale_id: this.model.f_filiale_id
509
+ }),
510
+ this.modifyOrder = {}
511
+ this.addressuser = []
512
+ this.rowsdata = true
513
+ this.types = []
514
+ if (this.callObj && this.callObj.callNum && type != 'init') {
515
+ this.callObj.callNum = null
516
+ this.model.aState = null
517
+ }
518
+ },
519
+ async save() {
520
+ // 判断是否录入用户类型
521
+ if (this.model.f_user_type == '' || this.model.f_user_type == undefined) {
522
+ return this.$showAlert('请选择客户类型!', 'warning', 2000)
523
+ }
524
+ // 判断是否录入用气性质
525
+ if (this.model.f_gasproperties == '' || this.model.f_gasproperties == undefined) {
526
+ return this.$showAlert('请选择用气性质!', 'warning', 2000)
527
+ }
528
+ // 判断是否输入地址
529
+ if (this.model.f_address == '' || this.model.f_address == undefined) {
530
+ return this.$showAlert('请选择地址!', 'warning', 2000)
531
+ }
532
+ if (this.operType != '修改工单') {
533
+ if (this.model.serviceacitivity[0].f_reciever == '' || this.model.serviceacitivity[0].f_reciever == undefined) {
534
+ if (this.meading == '转维修员') {
535
+ return this.$showAlert('请选择置换人员', 'warning', 2000)
536
+ } else {
537
+ return this.$showAlert('请选择站点', 'warning', 2000)
538
+ }
539
+ }
540
+ }
541
+ this.$emit('saveing')
542
+ if (this.meading == '转维修员') {
543
+ this.model.f_meetunit = this.$login.f.deps
544
+ this.model.f_orgid = this.$login.f.orgid
545
+ this.model.f_filiale = this.$login.f.org
546
+ this.model.f_outlets = this.$login.f.deps
547
+ this.model.f_filiale_id = this.$login.f.orgid
548
+ }
549
+ if (this.operType === '报修') {
550
+ this.model.f_change_tag = "散户派工"
551
+ let data = {
552
+ model: this.model, loginUser: {
553
+ name: this.loginUser.name,
554
+ ename: this.loginUser.ename
555
+ }, callObj: this.callObj
556
+ }
557
+ let url = ''
558
+ if (this.meading === '转站点') {
559
+ url = config[this.operType].url
560
+ } else {
561
+ url = config[this.operType].url
562
+ data.toRepair = '一级派单'
563
+ }
564
+ let http2 = new HttpResetClass()
565
+ let dataid = await http2.load('POST', url, data, {resolveMsg: null, rejectMsg: null})
566
+ //tag
567
+ var sendnum = 1
568
+ }
569
+ this.$emit('saveend')
570
+ this.$emit('commitsus', this.model.f_phone)
571
+ this.cleardata()
572
+ if (this.operType == '修改工单') {
573
+ this.$showMessage(`修改成功!`)
574
+ } else {
575
+ this.$showMessage(`本次下发 ${sendnum} 条置换单!`)
576
+ }
577
+ },
578
+ async checkServerList(addressid) {
579
+ if (addressid) {
580
+ let http1 = new HttpResetClass()
581
+ let res = await http1.load('POST', 'rs/sql/tel_getServiceActivity', {data: {condition: `f_addressid = '${addressid}'`}}, {
582
+ resolveMsg: null,
583
+ rejectMsg: null
584
+ })
585
+ //有未完成工单
586
+ let ls = res.data.length
587
+ var AddressService = {}
588
+ if (ls > 0) {
589
+ // 当前地址下还有工单未完成
590
+ AddressService = {
591
+ defname: res.data[0].defname,
592
+ f_service_id: res.data[0].f_service_id
593
+ }
594
+ } else {
595
+ AddressService = {
596
+ defname: '无工单'
597
+ }
598
+ }
599
+ return AddressService
600
+ }
601
+ },
602
+ // 处理故障输入
603
+ procFailure(value) {
604
+ this.model.failure = value
605
+ },
606
+ },
607
+ watch: {
608
+ // 转接类型
609
+ 'model.f_handlingtype'() {
610
+ // 清楚上次记录
611
+ this.model.serviceacitivity[0].f_reciever = ''
612
+ this.model.serviceacitivity[0].f_meetunit = ''
613
+ this.model.f_meetunit = ''
614
+ this.model.f_outlets = ''
615
+ this.model.f_repairman_phone = ''
616
+ if (this.model.f_handlingtype == '转维修员') {
617
+ this.meading = '转维修员'
618
+ this.repairers = []
619
+ this.getEmp()
620
+ } else {
621
+ this.repairers = []
622
+ this.meading = '转站点'
623
+ }
624
+ },
625
+ // 是否清空
626
+ 'cleantf'() {
627
+ this.cleardata()
628
+ },
629
+ 'model.f_contact_phone'(val) {
630
+ this.phoneValid = /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/.test(this.model.f_contact_phone)
631
+ },
632
+ // 话务对象发生变化将来电电话赋值给f_phone
633
+ 'callObj.callNum'() {
634
+ this.cleardata('init')
635
+ this.model.f_phone = this.callObj.callNum
636
+ this.model.f_records_id = this.callObj.RecordsID
637
+ // this.model.f_contact_phone = this.callObj.callNum
638
+ this.model.f_repair_date = Util.getNowDate()
639
+ },
640
+ 'types.length'() {
641
+ var ev = new Event("resize", {"bubbles": true, "cancelable": false});
642
+ window.dispatchEvent(ev);
643
+ },
644
+ 'callObj.aState'() {
645
+ this.model.aState = this.callObj.aState
646
+ //tag
647
+ },
648
+ 'model.f_gasproperties'() {
649
+ if (this.model.f_gasproperties != '民用用气') {
650
+ this.model.f_user_type = '非民用'
651
+ } else {
652
+ this.model.f_user_type = '民用'
653
+ }
654
+ //tag
655
+ },
656
+ 'data'() {
657
+ this.assignObj()
658
+ },
659
+ },
660
+ computed: {
661
+ IsClickDisabled: function () {
662
+ if (this.$v.valid) {
663
+ if (this.model.aState === null) {
664
+ //tag
665
+ return false
666
+ }
667
+ if (this.model.f_phone && this.model.aState === '正在保存' && this.model.aState === '置忙') {
668
+ //tag
669
+ return false
670
+ }
671
+ if (!this.model.f_phone) {
672
+
673
+ //tag
674
+ return false
675
+ }
676
+ //tag
677
+ return true
678
+ } else {
679
+ //tag
680
+ return true
681
+ }
682
+ },
683
+ getTestData() {
684
+ return this.testdata
685
+ },
686
+ serviceacitivity() {
687
+ return this.model.serviceacitivity.find((row) => {
688
+ return row.f_service_acitivity_type === '派单'
689
+ })
690
+ },
691
+ alertObject() {
692
+ let result = this.model.failure.find((value) => {
693
+ return value.f_failure_type === '报警器'
694
+ })
695
+ if (result) {
696
+ return result
697
+ }
698
+ return {f_equipment: ''}
699
+ },
700
+ gasstove() {
701
+ let result = this.model.failure.find((value) => {
702
+ return value.f_failure_type === '燃气灶'
703
+ })
704
+ if (result) {
705
+ return result
706
+ }
707
+ return {f_equipment: ''}
708
+ },
709
+ furnace() {
710
+ let result = this.model.failure.find((value) => {
711
+ return value.f_failure_type === '壁挂炉'
712
+ })
713
+ if (result) {
714
+ return result
715
+ }
716
+ return {f_equipment: ''}
717
+ },
718
+ heater() {
719
+ let result = this.model.failure.find((value) => {
720
+ return value.f_failure_type === '热水器'
721
+ })
722
+ if (result) {
723
+ return result
724
+ }
725
+ return {f_equipment: ''}
726
+ },
727
+ lampblack() {
728
+ let result = this.model.failure.find((value) => {
729
+ return value.f_failure_type === '油烟机'
730
+ })
731
+ if (result) {
732
+ return result
733
+ }
734
+ return {f_equipment: ''}
735
+ }
736
+ },
737
+ events: {
738
+ getPosition(val) {
739
+ //tag
740
+ this.$dispatch('distribute', val)
741
+
742
+ }
743
+ },
744
+ components: {}
745
+ }
746
+
747
+ </script>
748
+ <style>
749
+ .class-error {
750
+ color: #a94442;
751
+ }
752
+
753
+ </style>