telephone-clients 3.0.104-19 → 3.0.104-20

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