telephone-clients 3.0.103-96 → 3.0.103-98

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,839 +1,840 @@
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
- f_address: '',
252
- f_json: '',
253
- f_repair_date: Util.getNowDate(),
254
- f_card_id: '',
255
- // f_department: '', 站点选择
256
- f_reciever:'',
257
- f_remarks: '',
258
- f_user_type: '',
259
- failure_str:'',
260
- f_area: '',
261
- f_unit_name:'',
262
- f_street: '',
263
- f_residential_area: '',
264
- f_building: '',
265
- f_unit: '',
266
- f_floor: '',
267
- f_room: '',
268
- aState: null,
269
- f_handlingtype:'转维修员',
270
- f_repairtype: '',
271
- f_orgid:this.$login.f.orgid,
272
- f_orgname:this.$login.f.orgs,
273
- f_depname:this.$login.f.dops,
274
- f_depid:this.$login.f.depids,
275
- f_operator:this.$login.f.name,
276
- f_operatorid:this.$login.f.id,
277
- f_filiale:'',
278
- f_filiale_id:''
279
- },
280
- types: [],
281
- information: [], // 用来存放字表信息
282
- serviceList: null, // 用来存放查询当前地址下的未完成工单
283
- id: '', // 编写测试时会使用
284
- f_service_id: '' ,// 编写测试时会使用
285
- repairstypes : this.$appdata.getParam('报修类型'),
286
- usertypes : this.$appdata.getParam('用户类型'),
287
- // stands : this.$appdata.getParam('站点管理员'),
288
- sources: this.$appdata.getParam('工单来源'),
289
- days:this.$appdata.getParam('截止天数'),
290
- handling:[{label:'转站点',value:'转站点'},{label:'转维修员',value:'转维修员'}],
291
- source:
292
- 'dep=this.getParentByType($organization$).getSpecialResByType($department$),' +
293
- 'tool.getFullTree(dep.where(row.hasSpecialRole($派单员$)))',
294
- userid: this.$login.f.id,
295
- repairers: [] // 维修员
296
- }
297
- },
298
- ready() {
299
- // 获取sendType.json配置信息 获取派单类型 转站点,转维修员,自选模式
300
- getSendType(this)
301
-
302
- },
303
- methods: {
304
- // 当维修员发生改变,获取维修员手机号
305
- repiarmancg(val){
306
- if(val){
307
- //tag
308
- if (typeof val=='string'){
309
- this.model.serviceacitivity[0].f_reciever = val
310
- let http1 = new HttpResetClass()
311
- http1.load('POST','rs/sql/tel_singleTable_OrderBy', {data: {
312
- items: 'f_user_telephone',
313
- tablename: 't_user',
314
- condition: `name = '${val}'`,
315
- orderitem: 'id'
316
- }}, {resolveMsg: null, rejectMsg: null}).then((ress) => {
317
- this.model.f_repairman_phone = ress.data[0].f_user_telephone
318
- })
319
- }
320
- }
321
- },
322
- // 当工单来源属性发生改变
323
- sourcechange(val){
324
- if(val == undefined || val == ''){
325
- return
326
- }
327
- this.model.f_source = val
328
- this.servicesource = val
329
- },
330
- daychange(val){
331
- if (val=='其他'){
332
- this.flag = false
333
- }else {
334
- this.flag = true
335
- var t = new Date();//你已知的时间
336
- var t1= t.getTime()
337
- val = val*1000
338
- t.setTime(t1 + val * 60 * 60 * 24);
339
- var Y = t.getFullYear() + '-'
340
- var M = (t.getMonth()+1 < 10 ? '0'+(t.getMonth()+1):t.getMonth()+1) + '-'
341
- var D = (t.getDate()< 10 ? '0'+t.getDate():t.getDate())+ ' '
342
- var h = (t.getHours() < 10 ? '0'+t.getHours():t.getHours())+ ':'
343
- var m = (t.getMinutes() < 10 ? '0'+t.getMinutes():t.getMinutes())+ ':'
344
- var s = t.getSeconds() < 10 ? '0'+t.getSeconds():t.getSeconds()
345
- this.model.f_finish_date = Y+M+D+h+m+s
346
- console.log("当前时间:"+Y+M+D+h+m+s)
347
- }
348
- },
349
- // 获取维修员
350
- getEmp (role) {
351
- // let val = {source: 'tool.getChildrenOfResName($维修员$)', userid: `${this.$login.f.id}`}
352
- let val = {source: `this.getParentByType($organization$).getChildByName($${role}$).getUsers()`, userid: `${this.$login.f.id}`}
353
- // let val = {source: 'this.getParentByType($department$).getChildByName($置换员$).getUsers()', userid: `${this.$login.f.id}`}
354
- let http = new HttpResetClass()
355
- http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
356
- // let result = res.data.filter(res=>res.orgid==this.$login.f.orgid)
357
- res.data.forEach((item) => {
358
- this.repairers.push({label: `${item.name}`, value: item.name})
359
-
360
- })
361
- })
362
- },
363
- adressslect(val){
364
- if(val == "NO"){
365
- this.addressshow = true
366
- this.addressselect = true
367
- }else{
368
- this.addressshow = false
369
- this.addressselect = false
370
- }
371
- },
372
- // 控制地址管理组件显示与否
373
- adressoff(val) {
374
- if(val == "NO"){
375
- this.addressshow = true
376
- this.addressselect = false
377
- }else{
378
- this.addressshow = false
379
- this.addressselect = true
380
- }
381
- },
382
- // 截取字符串
383
- interceptString(val){
384
- },
385
- // 选中地址
386
- rerefParent(val,addstr){
387
- var rows = val.rows
388
- let num = 0
389
- this.model.f_addressjson = JSON.stringify(rows)
390
- this.model.f_addressid = val.id
391
- if(rows.length > 0 ){
392
- let arrid = this.model.f_addressid.split('.')
393
- for (let i = 0; i < rows.length; i++) {
394
- if (rows[i].type === '楼号') {
395
- this.model.f_building = rows[i].name
396
- }else if(rows[i].type === '楼层'){
397
- this.model.f_floor = rows[i].name
398
- } else if(rows[i].type === '门牌号'){
399
- this.model.f_room = rows[i].name
400
- this.model.f_room_id = arrid[i]
401
- }else if(rows[i].type === '区'){
402
- this.model.f_area = rows[i].name
403
- } else if(rows[i].type === '街道'){
404
- this.model.f_street = rows[i].name
405
- }else if(rows[i].type === '小区'){
406
- this.model.f_residential_area = rows[i].name
407
- this.model.f_districtname_id = arrid[i]
408
- } else if(rows[i].type === '单元'){
409
- this.model.f_unit = rows[i].name
410
- }
411
- }
412
- }
413
- // this.address()
414
- this.model.f_address = addstr
415
- },
416
- // 选中部门
417
- reres(val){
418
- if(val.res == undefined || val.res[0] == undefined || val.res[0] == ''){
419
- return
420
- }
421
- this.model.serviceacitivity[0].f_meetunit = val.res[0]
422
- this.model.f_meetunit = val.res[0]
423
- this.model.f_filiale_id = val.orgobj[0].parentid
424
- this.model.f_filiale = val.orgobj[0].parentname
425
- this.model.f_outlets = val.res[0]
426
- this.model.serviceacitivity[0].f_reciever = val.resids[0]
427
- },
428
- onReady() {
429
- //tag
430
- this.$emit('ready')
431
- },
432
- onError(error) {
433
- //tag
434
- this.$emit('error', error)
435
- },
436
- add(query) {
437
- if (typeof(query) === 'string') {
438
- this.model.f_residential_area = query
439
- this.address()
440
- }
441
- },
442
- // 修改或者重派工单时,加载工单的故障信息
443
- projectCallback(item) {
444
- if (item) {
445
- return item.f_user_name
446
- }
447
-
448
- },
449
- selectUnit(query) {
450
- return this.$resetpost('rs/sql/tel_singleTable_OrderBy',
451
- {
452
- data: {
453
- items: 'f_unitname',
454
- tablename: 't_unitcoordinate',
455
- condition: `(f_unitname like '${query}%' or F_TRANS_PINYIN_CAPITAL(f_unitname) like '${query}%')and rownum<10`,
456
- orderitem: 'id'
457
- }
458
- }, {resolveMsg: null, rejectMsg: null}
459
- )
460
- },
461
- selectResidential(query) {
462
- return this.$resetpost('rs/sql/tel_singleTable_OrderBy',
463
- {
464
- data: {
465
- items: 'f_villagename',
466
- tablename: 't_villagecoordinate',
467
- condition: `(f_villagename like '${query}%' or F_TRANS_PINYIN_CAPITAL(f_villagename) like '${query}%')and rownum<10`,
468
- orderitem: 'id'
469
- }
470
- }, {resolveMsg: null, rejectMsg: null}
471
- )
472
- },
473
- async setModifyOrder() {
474
- this.meading = this.modifyOrder.f_handlingtype
475
- if(this.meading === '转维修员' ){
476
- await this.getEmp('维修员')
477
- }
478
- this.model = Object.assign({}, this.model, this.modifyOrder)
479
- },
480
- assignObj() {
481
- if (this.data) {
482
- this.model.failure_str = ''
483
- this.model.f_address = this.data.f_address
484
- this.model.f_user_name = this.data.f_user_name
485
- this.model.f_user_type = this.data.f_user_type
486
- this.model.f_contact_phone = this.data.f_user_phone
487
- this.model.f_userinfo_id = this.data.f_userinfo_id
488
- this.model.f_userinfo_code = this.data.f_userinfo_code
489
- //tag
490
- // this.residentialquery = this.data.unit_name
491
- this.model.f_card_id = this.data.card_id
492
- if (this.model.f_user_type === '民用') {
493
- this.model.f_area = this.data.f_area
494
- this.model.f_street = this.data.f_street
495
- this.model.f_residential_area = this.data.f_residential_area
496
- this.model.f_building = this.data.f_building
497
- this.model.f_unit = this.data.f_unit
498
- this.model.f_floor = this.data.f_floor
499
- this.model.f_room = this.data.f_room
500
- //this.address()
501
- }
502
- }
503
-
504
- //this.checkServerList(this.model.f_address)
505
- },
506
- // 提交
507
- getData(val) {
508
- return this.residential
509
- },
510
- // 清楚信息
511
- cleardata() {
512
- this.model = Object.assign({}, {
513
- // 一次派单
514
- serviceacitivity: [{
515
- f_service_acitivity_type: '派单',
516
- f_meetunit:this.model.serviceacitivity[0].f_meetunit,
517
- f_reciever:this.model.serviceacitivity[0].f_reciever
518
- }],
519
- f_finish_date:'',
520
- f_meetunit : this.model.f_meetunit,
521
- f_orgstr : this.model.f_orgstr,
522
- f_outlets : this.model.f_outlets,
523
- f_service_id: '',
524
- f_contact_phone: '',
525
- f_phone: '',
526
- f_user_name: '',
527
- failure: '',
528
- f_userinfo_id: '',
529
- failure_str:'',
530
- f_address: '',
531
- f_json: '',
532
- f_repair_date: Util.getNowDate(),
533
- f_card_id: '',
534
- f_remarks: '',
535
- f_user_type: '',
536
- f_area: '',
537
- f_street: '',
538
- f_residential_area: '',
539
- f_source:this.servicesource,
540
- f_building: '',
541
- f_unit: '',
542
- f_floor: '',
543
- f_room: '',
544
- f_handlingtype:this.model.f_handlingtype,
545
- aState: null,
546
- f_orgid:this.$login.f.orgid,
547
- f_orgname:this.$login.f.orgs,
548
- f_depname:this.$login.f.dops,
549
- f_depid:this.$login.f.depids,
550
- f_operator:this.$login.f.name,
551
- f_operatorid:this.$login.f.id,
552
- f_filiale:this.model.f_filiale,
553
- f_filiale_id:this.model.f_filiale_id,
554
-
555
-
556
- }),
557
- this.modifyOrder = {}
558
- this.types = []
559
- this.data = {}
560
- },
561
- save() {
562
- //tag
563
- // 判断是否输入地址
564
- if(this.model.f_address == '' || this.model.f_address == undefined) {
565
- return this.$showAlert('请输入地址!', 'warning', 2000)
566
- }
567
- if(!this.model.f_repairtype) {
568
- return this.$showAlert('请输入报修类型!', 'warning', 2000)
569
- }
570
- // 判断是否选择工单接收人
571
- if(this.operType != '修改工单'){
572
- if (this.model.serviceacitivity[0].f_reciever == '' || this.model.serviceacitivity[0].f_reciever == undefined) {
573
- if(this.meading == '转维修员'){
574
- return this.$showAlert('请选择维修人员', 'warning', 2000)
575
- }else{
576
- return this.$showAlert('请选择站点', 'warning', 2000)
577
- }
578
- }
579
- }
580
- if(this.meading == '转维修员'){
581
- this.model.f_meetunit = this.$login.f.deps
582
- this.model.f_orgid = this.$login.f.orgid
583
- this.model.f_filiale = this.$login.f.org
584
- this.model.f_outlets = this.$login.f.deps
585
- this.model.f_filiale_id = this.$login.f.orgid
586
- }
587
- let failureStr = ''
588
- if(this.model.failure.startsWith("[")){
589
- const failureData = JSON.parse(this.model.failure)
590
- failureData.forEach(item=>{
591
- if (item.failurecase.length>0){
592
- failureStr+=item.f_failure_type+":"+item.failurecase.toString()+";"
593
- }else {
594
- failureStr+=item.f_failure_type+";"
595
- }
596
- })
597
- this.model.failure_str = failureStr
598
- }
599
- let data = {
600
- model: this.model, loginUser: {
601
- name: this.loginUser.name,
602
- ename: this.loginUser.ename
603
- },
604
- user: this.data, callObj: this.callObj
605
- }
606
- // 如果是修改工单,受理人还是原始的 派单人 不做修改
607
- if(this.operType == '报修'){
608
- data.model.f_attendant = this.loginUser.name
609
- }
610
- if(data.model.failure){
611
- data.model.f_json = this.trouble(data.model.failure)
612
- }
613
- // 获得数据发送地址
614
- let url = ''
615
- if(this.meading === '转站点'){
616
- url = config[this.operType].url
617
- }else{
618
- url = config[this.operType].url
619
- data.toRepair = '一级派单'
620
- }
621
- data.model.f_state = null
622
- this.saveing = true
623
- return this.$resetpost(url, data).then((data) => {
624
- if(data.data && data.data.id){
625
- this.id = JSON.parse(data.data.id).id
626
-
627
- }
628
- // 清空数据
629
- this.$emit('commitsus',this.model.f_phone,this.model)
630
- this.cleardata()
631
- if (this.callObj && this.callObj.callNum) {
632
- this.callObj.callNum = null
633
- this.callObj.RecordsID = null
634
- this.model.aState = null
635
- //tag
636
- Util.afterCallBz(this.$login.f.id, this.$login.f.name)
637
- }
638
- this.saveing = false
639
- })
640
- },
641
- address() {
642
- let strAddress = `${this.model.f_area ? this.model.f_area
643
- + '-' : ''}${this.model.f_street ? this.model.f_street
644
- + '-' : ''}${this.model.f_residential_area ? this.model.f_residential_area
645
- + '' : ''}${this.model.f_building ? this.model.f_building
646
- + '号楼' : ''}${this.model.f_unit ? this.model.f_unit
647
- + '单元' : ''}${this.model.f_floor ? this.model.f_floor
648
- + '' : ''}${this.model.f_room ? this.model.f_room
649
- + '' : ''}`
650
- this.model.f_address = strAddress
651
- },
652
- // 检查相同地址下有没有还未完成的工单
653
- checkServerList(address) {
654
- if (this.model.f_area && this.model.f_area && this.model.f_residential_area && this.model.f_building
655
- && this.model.f_unit && this.model.f_floor && this.model.f_room) {
656
- this.$console.info('开始查询')
657
- // 地址所有区域输入完成查询
658
- // this.$resetpost('rs/sql/getServiceActivity.sql', { condition: `f_address = '${address}' and f_single_type = '报修单'`}, {resolveMsg: null, rejectMsg: null}).then((res) => {
659
- // //有未完成工单
660
- // let ls = res.data.length
661
- // if (ls > 0) {
662
- // // 当前地址下还有工单未完成
663
- // }
664
- // })
665
- }
666
- },
667
- // 处理故障输入
668
- procFailure(value) {
669
- if (typeof(value) === 'string') {
670
- this.model.failure = value
671
- }
672
- },
673
- trouble(val) {
674
- let failureall = ''
675
- // val=[{"f_failure_type":"抽油烟机","failurecase":[],"f_equipment":""},{"f_failure_type":"抽油烟机","failurecase":[],"f_equipment":""},{"f_failure_type":"抽油烟机","failurecase":[],"f_equipment":""}]
676
-
677
- let failure = JSON.parse(val)
678
- for (let i = 0; i < failure.length; i++) {
679
- if (failure[i].failurecase.length > 0) {
680
- failureall += failure[i].f_failure_type + ":"
681
- for (let j = 0; j < failure[i].failurecase.length; j++) {
682
- failureall += failure[i].failurecase[j]
683
- if (j + 1 != failure[i].failurecase.length) {
684
- failureall += ","
685
- }
686
- }
687
- } else {
688
- failureall += failure[i].f_failure_type
689
- }
690
- if (i + 1 != failure.length) {
691
- failureall += ';'
692
- }
693
- }
694
- return failureall
695
- },
696
- },
697
- watch: {
698
- // 转接类型
699
- 'model.f_handlingtype'(){
700
- if(this.operType === '修改工单'){
701
- return
702
- }
703
- // 清楚上次记录
704
- this.model.serviceacitivity[0].f_reciever = ''
705
- this.model.serviceacitivity[0].f_meetunit =''
706
- this.model.f_meetunit = ''
707
- this.model.f_orgstr = ''
708
- this.model.f_outlets = ''
709
- this.model.f_repairman_phone = ''
710
- if(this.model.f_handlingtype == '转维修员'){
711
- this.meading = '转维修员'
712
- this.repairers = []
713
- this.getEmp("维修员")
714
- }else{
715
- this.repairers = []
716
- this.meading = '转站点'
717
- }
718
- },
719
- // 是否清空
720
- 'cleantf'(){
721
- this.cleardata()
722
- },
723
- 'data' () {
724
- this.assignObj()
725
- },
726
- 'model.f_contact_phone' (val) {
727
- this.phoneValid = /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/.test(this.model.f_contact_phone)
728
- },
729
- // 话务对象发生变化将来电电话赋值给f_phone
730
- 'callObj.callNum' () {
731
- this.cleardata()
732
- this.model.f_phone = this.callObj.callNum
733
- this.model.f_records_id = this.callObj.RecordsID
734
- // this.model.f_contact_phone = this.callObj.callNum
735
- this.model.f_repair_date = Util.getNowDate()
736
- },
737
- 'types.length' () {
738
- var ev = new Event("resize", {"bubbles": true, "cancelable": false});
739
- window.dispatchEvent(ev);
740
- },
741
- 'callObj.aState'() {
742
- this.model.aState = this.callObj.aState
743
- //tag
744
- }
745
- },
746
- computed: {
747
- IsClickDisabled: function () {
748
- if (this.$v.valid) {
749
- if (this.model.aState === null) {
750
- //tag
751
- return false
752
- }
753
- if (this.model.f_phone && this.model.aState === '正在保存' && this.model.aState === '置忙') {
754
- //tag
755
- return false
756
- }
757
- if (!this.model.f_phone) {
758
- //tag
759
- return false
760
- } else {
761
- //tag
762
- return true
763
- }
764
- }
765
- },
766
- getTestData() {
767
- return this.testdata
768
- },
769
- serviceacitivity() {
770
- return this.model.serviceacitivity.find((row) => {
771
- return row.f_service_acitivity_type === '派单'
772
- })
773
- },
774
- alertObject() {
775
- let result = this.model.failure.find((value) => {
776
- return value.f_failure_type === '报警器'
777
- })
778
- if (result) {
779
- return result
780
- }
781
- return {f_equipment: ''}
782
- },
783
- gasstove() {
784
- let result = this.model.failure.find((value) => {
785
- return value.f_failure_type === '燃气灶'
786
- })
787
- if (result) {
788
- return result
789
- }
790
- return {f_equipment: ''}
791
- },
792
- furnace() {
793
- let result = this.model.failure.find((value) => {
794
- return value.f_failure_type === '壁挂炉'
795
- })
796
- if (result) {
797
- return result
798
- }
799
- return {f_equipment: ''}
800
- },
801
- heater() {
802
- let result = this.model.failure.find((value) => {
803
- return value.f_failure_type === '热水器'
804
- })
805
- if (result) {
806
- return result
807
- }
808
- return {f_equipment: ''}
809
- },
810
- lampblack() {
811
- let result = this.model.failure.find((value) => {
812
- return value.f_failure_type === '油烟机'
813
- })
814
- if (result) {
815
- return result
816
- }
817
- return {f_equipment: ''}
818
- }
819
- },
820
- events:{
821
- getPosition(val){
822
- //tag
823
- this.$dispatch('distribute',val)
824
-
825
- }
826
- },
827
- components: {
828
- FailureEdit,
829
- 'failure-edit': FailureEdit
830
- }
831
- }
832
-
833
- </script>
834
- <style>
835
- .class-error{
836
- color:#a94442;
837
- }
838
-
839
- </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
+ f_address: '',
252
+ f_json: '',
253
+ f_repair_date: Util.getNowDate(),
254
+ f_card_id: '',
255
+ // f_department: '', 站点选择
256
+ f_reciever:'',
257
+ f_remarks: '',
258
+ f_user_type: '',
259
+ failure_str:'',
260
+ f_area: '',
261
+ f_unit_name:'',
262
+ f_street: '',
263
+ f_residential_area: '',
264
+ f_building: '',
265
+ f_unit: '',
266
+ f_floor: '',
267
+ f_room: '',
268
+ aState: null,
269
+ f_handlingtype:'转维修员',
270
+ f_repairtype: '',
271
+ f_orgid:this.$login.f.orgid,
272
+ f_orgname:this.$login.f.orgs,
273
+ f_depname:this.$login.f.dops,
274
+ f_depid:this.$login.f.depids,
275
+ f_operator:this.$login.f.name,
276
+ f_operatorid:this.$login.f.id,
277
+ f_filiale:'',
278
+ f_filiale_id:''
279
+ },
280
+ types: [],
281
+ information: [], // 用来存放字表信息
282
+ serviceList: null, // 用来存放查询当前地址下的未完成工单
283
+ id: '', // 编写测试时会使用
284
+ f_service_id: '' ,// 编写测试时会使用
285
+ repairstypes : this.$appdata.getParam('报修类型'),
286
+ usertypes : this.$appdata.getParam('用户类型'),
287
+ // stands : this.$appdata.getParam('站点管理员'),
288
+ sources: this.$appdata.getParam('工单来源'),
289
+ days:this.$appdata.getParam('截止天数'),
290
+ handling:[{label:'转站点',value:'转站点'},{label:'转维修员',value:'转维修员'}],
291
+ source:
292
+ 'dep=this.getParentByType($organization$).getSpecialResByType($department$),' +
293
+ 'tool.getFullTree(dep.where(row.hasSpecialRole($派单员$)))',
294
+ userid: this.$login.f.id,
295
+ repairers: [] // 维修员
296
+ }
297
+ },
298
+ ready() {
299
+ // 获取sendType.json配置信息 获取派单类型 转站点,转维修员,自选模式
300
+ getSendType(this)
301
+
302
+ },
303
+ methods: {
304
+ // 当维修员发生改变,获取维修员手机号
305
+ repiarmancg(val){
306
+ if(val){
307
+ //tag
308
+ if (typeof val=='string'){
309
+ this.model.serviceacitivity[0].f_reciever = val
310
+ let http1 = new HttpResetClass()
311
+ http1.load('POST','rs/sql/tel_singleTable_OrderBy', {data: {
312
+ items: 'f_user_telephone',
313
+ tablename: 't_user',
314
+ condition: `name = '${val}'`,
315
+ orderitem: 'id'
316
+ }}, {resolveMsg: null, rejectMsg: null}).then((ress) => {
317
+ this.model.f_repairman_phone = ress.data[0].f_user_telephone
318
+ })
319
+ }
320
+ }
321
+ },
322
+ // 当工单来源属性发生改变
323
+ sourcechange(val){
324
+ if(val == undefined || val == ''){
325
+ return
326
+ }
327
+ this.model.f_source = val
328
+ this.servicesource = val
329
+ },
330
+ daychange(val){
331
+ if (val=='其他'){
332
+ this.flag = false
333
+ }else {
334
+ this.flag = true
335
+ var t = new Date();//你已知的时间
336
+ var t1= t.getTime()
337
+ val = val*1000
338
+ t.setTime(t1 + val * 60 * 60 * 24);
339
+ var Y = t.getFullYear() + '-'
340
+ var M = (t.getMonth()+1 < 10 ? '0'+(t.getMonth()+1):t.getMonth()+1) + '-'
341
+ var D = (t.getDate()< 10 ? '0'+t.getDate():t.getDate())+ ' '
342
+ var h = (t.getHours() < 10 ? '0'+t.getHours():t.getHours())+ ':'
343
+ var m = (t.getMinutes() < 10 ? '0'+t.getMinutes():t.getMinutes())+ ':'
344
+ var s = t.getSeconds() < 10 ? '0'+t.getSeconds():t.getSeconds()
345
+ this.model.f_finish_date = Y+M+D+h+m+s
346
+ console.log("当前时间:"+Y+M+D+h+m+s)
347
+ }
348
+ },
349
+ // 获取维修员
350
+ getEmp (role) {
351
+ // let val = {source: 'tool.getChildrenOfResName($维修员$)', userid: `${this.$login.f.id}`}
352
+ let val = {source: `this.getParentByType($organization$).getChildByName($${role}$).getUsers()`, userid: `${this.$login.f.id}`}
353
+ // let val = {source: 'this.getParentByType($department$).getChildByName($置换员$).getUsers()', userid: `${this.$login.f.id}`}
354
+ let http = new HttpResetClass()
355
+ http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
356
+ // let result = res.data.filter(res=>res.orgid==this.$login.f.orgid)
357
+ res.data.forEach((item) => {
358
+ if (item.state == '在职'){
359
+ this.repairers.push({label: `${item.name}`, value: item.name})
360
+ }
361
+ })
362
+ })
363
+ },
364
+ adressslect(val){
365
+ if(val == "NO"){
366
+ this.addressshow = true
367
+ this.addressselect = true
368
+ }else{
369
+ this.addressshow = false
370
+ this.addressselect = false
371
+ }
372
+ },
373
+ // 控制地址管理组件显示与否
374
+ adressoff(val) {
375
+ if(val == "NO"){
376
+ this.addressshow = true
377
+ this.addressselect = false
378
+ }else{
379
+ this.addressshow = false
380
+ this.addressselect = true
381
+ }
382
+ },
383
+ // 截取字符串
384
+ interceptString(val){
385
+ },
386
+ // 选中地址
387
+ rerefParent(val,addstr){
388
+ var rows = val.rows
389
+ let num = 0
390
+ this.model.f_addressjson = JSON.stringify(rows)
391
+ this.model.f_addressid = val.id
392
+ if(rows.length > 0 ){
393
+ let arrid = this.model.f_addressid.split('.')
394
+ for (let i = 0; i < rows.length; i++) {
395
+ if (rows[i].type === '楼号') {
396
+ this.model.f_building = rows[i].name
397
+ }else if(rows[i].type === '楼层'){
398
+ this.model.f_floor = rows[i].name
399
+ } else if(rows[i].type === '门牌号'){
400
+ this.model.f_room = rows[i].name
401
+ this.model.f_room_id = arrid[i]
402
+ }else if(rows[i].type === '区'){
403
+ this.model.f_area = rows[i].name
404
+ } else if(rows[i].type === '街道'){
405
+ this.model.f_street = rows[i].name
406
+ }else if(rows[i].type === '小区'){
407
+ this.model.f_residential_area = rows[i].name
408
+ this.model.f_districtname_id = arrid[i]
409
+ } else if(rows[i].type === '单元'){
410
+ this.model.f_unit = rows[i].name
411
+ }
412
+ }
413
+ }
414
+ // this.address()
415
+ this.model.f_address = addstr
416
+ },
417
+ // 选中部门
418
+ reres(val){
419
+ if(val.res == undefined || val.res[0] == undefined || val.res[0] == ''){
420
+ return
421
+ }
422
+ this.model.serviceacitivity[0].f_meetunit = val.res[0]
423
+ this.model.f_meetunit = val.res[0]
424
+ this.model.f_filiale_id = val.orgobj[0].parentid
425
+ this.model.f_filiale = val.orgobj[0].parentname
426
+ this.model.f_outlets = val.res[0]
427
+ this.model.serviceacitivity[0].f_reciever = val.resids[0]
428
+ },
429
+ onReady() {
430
+ //tag
431
+ this.$emit('ready')
432
+ },
433
+ onError(error) {
434
+ //tag
435
+ this.$emit('error', error)
436
+ },
437
+ add(query) {
438
+ if (typeof(query) === 'string') {
439
+ this.model.f_residential_area = query
440
+ this.address()
441
+ }
442
+ },
443
+ // 修改或者重派工单时,加载工单的故障信息
444
+ projectCallback(item) {
445
+ if (item) {
446
+ return item.f_user_name
447
+ }
448
+
449
+ },
450
+ selectUnit(query) {
451
+ return this.$resetpost('rs/sql/tel_singleTable_OrderBy',
452
+ {
453
+ data: {
454
+ items: 'f_unitname',
455
+ tablename: 't_unitcoordinate',
456
+ condition: `(f_unitname like '${query}%' or F_TRANS_PINYIN_CAPITAL(f_unitname) like '${query}%')and rownum<10`,
457
+ orderitem: 'id'
458
+ }
459
+ }, {resolveMsg: null, rejectMsg: null}
460
+ )
461
+ },
462
+ selectResidential(query) {
463
+ return this.$resetpost('rs/sql/tel_singleTable_OrderBy',
464
+ {
465
+ data: {
466
+ items: 'f_villagename',
467
+ tablename: 't_villagecoordinate',
468
+ condition: `(f_villagename like '${query}%' or F_TRANS_PINYIN_CAPITAL(f_villagename) like '${query}%')and rownum<10`,
469
+ orderitem: 'id'
470
+ }
471
+ }, {resolveMsg: null, rejectMsg: null}
472
+ )
473
+ },
474
+ async setModifyOrder() {
475
+ this.meading = this.modifyOrder.f_handlingtype
476
+ if(this.meading === '转维修员' ){
477
+ await this.getEmp('维修员')
478
+ }
479
+ this.model = Object.assign({}, this.model, this.modifyOrder)
480
+ },
481
+ assignObj() {
482
+ if (this.data) {
483
+ this.model.failure_str = ''
484
+ this.model.f_address = this.data.f_address
485
+ this.model.f_user_name = this.data.f_user_name
486
+ this.model.f_user_type = this.data.f_user_type
487
+ this.model.f_contact_phone = this.data.f_user_phone
488
+ this.model.f_userinfo_id = this.data.f_userinfo_id
489
+ this.model.f_userinfo_code = this.data.f_userinfo_code
490
+ //tag
491
+ // this.residentialquery = this.data.unit_name
492
+ this.model.f_card_id = this.data.card_id
493
+ if (this.model.f_user_type === '民用') {
494
+ this.model.f_area = this.data.f_area
495
+ this.model.f_street = this.data.f_street
496
+ this.model.f_residential_area = this.data.f_residential_area
497
+ this.model.f_building = this.data.f_building
498
+ this.model.f_unit = this.data.f_unit
499
+ this.model.f_floor = this.data.f_floor
500
+ this.model.f_room = this.data.f_room
501
+ //this.address()
502
+ }
503
+ }
504
+
505
+ //this.checkServerList(this.model.f_address)
506
+ },
507
+ // 提交
508
+ getData(val) {
509
+ return this.residential
510
+ },
511
+ // 清楚信息
512
+ cleardata() {
513
+ this.model = Object.assign({}, {
514
+ // 一次派单
515
+ serviceacitivity: [{
516
+ f_service_acitivity_type: '派单',
517
+ f_meetunit:this.model.serviceacitivity[0].f_meetunit,
518
+ f_reciever:this.model.serviceacitivity[0].f_reciever
519
+ }],
520
+ f_finish_date:'',
521
+ f_meetunit : this.model.f_meetunit,
522
+ f_orgstr : this.model.f_orgstr,
523
+ f_outlets : this.model.f_outlets,
524
+ f_service_id: '',
525
+ f_contact_phone: '',
526
+ f_phone: '',
527
+ f_user_name: '',
528
+ failure: '',
529
+ f_userinfo_id: '',
530
+ failure_str:'',
531
+ f_address: '',
532
+ f_json: '',
533
+ f_repair_date: Util.getNowDate(),
534
+ f_card_id: '',
535
+ f_remarks: '',
536
+ f_user_type: '',
537
+ f_area: '',
538
+ f_street: '',
539
+ f_residential_area: '',
540
+ f_source:this.servicesource,
541
+ f_building: '',
542
+ f_unit: '',
543
+ f_floor: '',
544
+ f_room: '',
545
+ f_handlingtype:this.model.f_handlingtype,
546
+ aState: null,
547
+ f_orgid:this.$login.f.orgid,
548
+ f_orgname:this.$login.f.orgs,
549
+ f_depname:this.$login.f.dops,
550
+ f_depid:this.$login.f.depids,
551
+ f_operator:this.$login.f.name,
552
+ f_operatorid:this.$login.f.id,
553
+ f_filiale:this.model.f_filiale,
554
+ f_filiale_id:this.model.f_filiale_id,
555
+
556
+
557
+ }),
558
+ this.modifyOrder = {}
559
+ this.types = []
560
+ this.data = {}
561
+ },
562
+ save() {
563
+ //tag
564
+ // 判断是否输入地址
565
+ if(this.model.f_address == '' || this.model.f_address == undefined) {
566
+ return this.$showAlert('请输入地址!', 'warning', 2000)
567
+ }
568
+ if(!this.model.f_repairtype) {
569
+ return this.$showAlert('请输入报修类型!', 'warning', 2000)
570
+ }
571
+ // 判断是否选择工单接收人
572
+ if(this.operType != '修改工单'){
573
+ if (this.model.serviceacitivity[0].f_reciever == '' || this.model.serviceacitivity[0].f_reciever == undefined) {
574
+ if(this.meading == '转维修员'){
575
+ return this.$showAlert('请选择维修人员', 'warning', 2000)
576
+ }else{
577
+ return this.$showAlert('请选择站点', 'warning', 2000)
578
+ }
579
+ }
580
+ }
581
+ if(this.meading == '转维修员'){
582
+ this.model.f_meetunit = this.$login.f.deps
583
+ this.model.f_orgid = this.$login.f.orgid
584
+ this.model.f_filiale = this.$login.f.org
585
+ this.model.f_outlets = this.$login.f.deps
586
+ this.model.f_filiale_id = this.$login.f.orgid
587
+ }
588
+ let failureStr = ''
589
+ if(this.model.failure.startsWith("[")){
590
+ const failureData = JSON.parse(this.model.failure)
591
+ failureData.forEach(item=>{
592
+ if (item.failurecase.length>0){
593
+ failureStr+=item.f_failure_type+":"+item.failurecase.toString()+";"
594
+ }else {
595
+ failureStr+=item.f_failure_type+";"
596
+ }
597
+ })
598
+ this.model.failure_str = failureStr
599
+ }
600
+ let data = {
601
+ model: this.model, loginUser: {
602
+ name: this.loginUser.name,
603
+ ename: this.loginUser.ename
604
+ },
605
+ user: this.data, callObj: this.callObj
606
+ }
607
+ // 如果是修改工单,受理人还是原始的 派单人 不做修改
608
+ if(this.operType == '报修'){
609
+ data.model.f_attendant = this.loginUser.name
610
+ }
611
+ if(data.model.failure){
612
+ data.model.f_json = this.trouble(data.model.failure)
613
+ }
614
+ // 获得数据发送地址
615
+ let url = ''
616
+ if(this.meading === '转站点'){
617
+ url = config[this.operType].url
618
+ }else{
619
+ url = config[this.operType].url
620
+ data.toRepair = '一级派单'
621
+ }
622
+ data.model.f_state = null
623
+ this.saveing = true
624
+ return this.$resetpost(url, data).then((data) => {
625
+ if(data.data && data.data.id){
626
+ this.id = JSON.parse(data.data.id).id
627
+
628
+ }
629
+ // 清空数据
630
+ this.$emit('commitsus',this.model.f_phone,this.model)
631
+ this.cleardata()
632
+ if (this.callObj && this.callObj.callNum) {
633
+ this.callObj.callNum = null
634
+ this.callObj.RecordsID = null
635
+ this.model.aState = null
636
+ //tag
637
+ Util.afterCallBz(this.$login.f.id, this.$login.f.name)
638
+ }
639
+ this.saveing = false
640
+ })
641
+ },
642
+ address() {
643
+ let strAddress = `${this.model.f_area ? this.model.f_area
644
+ + '-' : ''}${this.model.f_street ? this.model.f_street
645
+ + '-' : ''}${this.model.f_residential_area ? this.model.f_residential_area
646
+ + '' : ''}${this.model.f_building ? this.model.f_building
647
+ + '号楼' : ''}${this.model.f_unit ? this.model.f_unit
648
+ + '单元' : ''}${this.model.f_floor ? this.model.f_floor
649
+ + '' : ''}${this.model.f_room ? this.model.f_room
650
+ + '室' : ''}`
651
+ this.model.f_address = strAddress
652
+ },
653
+ // 检查相同地址下有没有还未完成的工单
654
+ checkServerList(address) {
655
+ if (this.model.f_area && this.model.f_area && this.model.f_residential_area && this.model.f_building
656
+ && this.model.f_unit && this.model.f_floor && this.model.f_room) {
657
+ this.$console.info('开始查询')
658
+ // 地址所有区域输入完成查询
659
+ // this.$resetpost('rs/sql/getServiceActivity.sql', { condition: `f_address = '${address}' and f_single_type = '报修单'`}, {resolveMsg: null, rejectMsg: null}).then((res) => {
660
+ // //有未完成工单
661
+ // let ls = res.data.length
662
+ // if (ls > 0) {
663
+ // // 当前地址下还有工单未完成
664
+ // }
665
+ // })
666
+ }
667
+ },
668
+ // 处理故障输入
669
+ procFailure(value) {
670
+ if (typeof(value) === 'string') {
671
+ this.model.failure = value
672
+ }
673
+ },
674
+ trouble(val) {
675
+ let failureall = ''
676
+ // val=[{"f_failure_type":"抽油烟机","failurecase":[],"f_equipment":""},{"f_failure_type":"抽油烟机","failurecase":[],"f_equipment":""},{"f_failure_type":"抽油烟机","failurecase":[],"f_equipment":""}]
677
+
678
+ let failure = JSON.parse(val)
679
+ for (let i = 0; i < failure.length; i++) {
680
+ if (failure[i].failurecase.length > 0) {
681
+ failureall += failure[i].f_failure_type + ":"
682
+ for (let j = 0; j < failure[i].failurecase.length; j++) {
683
+ failureall += failure[i].failurecase[j]
684
+ if (j + 1 != failure[i].failurecase.length) {
685
+ failureall += ","
686
+ }
687
+ }
688
+ } else {
689
+ failureall += failure[i].f_failure_type
690
+ }
691
+ if (i + 1 != failure.length) {
692
+ failureall += ';'
693
+ }
694
+ }
695
+ return failureall
696
+ },
697
+ },
698
+ watch: {
699
+ // 转接类型
700
+ 'model.f_handlingtype'(){
701
+ if(this.operType === '修改工单'){
702
+ return
703
+ }
704
+ // 清楚上次记录
705
+ this.model.serviceacitivity[0].f_reciever = ''
706
+ this.model.serviceacitivity[0].f_meetunit =''
707
+ this.model.f_meetunit = ''
708
+ this.model.f_orgstr = ''
709
+ this.model.f_outlets = ''
710
+ this.model.f_repairman_phone = ''
711
+ if(this.model.f_handlingtype == '转维修员'){
712
+ this.meading = '转维修员'
713
+ this.repairers = []
714
+ this.getEmp("维修员")
715
+ }else{
716
+ this.repairers = []
717
+ this.meading = '转站点'
718
+ }
719
+ },
720
+ // 是否清空
721
+ 'cleantf'(){
722
+ this.cleardata()
723
+ },
724
+ 'data' () {
725
+ this.assignObj()
726
+ },
727
+ 'model.f_contact_phone' (val) {
728
+ this.phoneValid = /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/.test(this.model.f_contact_phone)
729
+ },
730
+ // 话务对象发生变化将来电电话赋值给f_phone
731
+ 'callObj.callNum' () {
732
+ this.cleardata()
733
+ this.model.f_phone = this.callObj.callNum
734
+ this.model.f_records_id = this.callObj.RecordsID
735
+ // this.model.f_contact_phone = this.callObj.callNum
736
+ this.model.f_repair_date = Util.getNowDate()
737
+ },
738
+ 'types.length' () {
739
+ var ev = new Event("resize", {"bubbles": true, "cancelable": false});
740
+ window.dispatchEvent(ev);
741
+ },
742
+ 'callObj.aState'() {
743
+ this.model.aState = this.callObj.aState
744
+ //tag
745
+ }
746
+ },
747
+ computed: {
748
+ IsClickDisabled: function () {
749
+ if (this.$v.valid) {
750
+ if (this.model.aState === null) {
751
+ //tag
752
+ return false
753
+ }
754
+ if (this.model.f_phone && this.model.aState === '正在保存' && this.model.aState === '置忙') {
755
+ //tag
756
+ return false
757
+ }
758
+ if (!this.model.f_phone) {
759
+ //tag
760
+ return false
761
+ } else {
762
+ //tag
763
+ return true
764
+ }
765
+ }
766
+ },
767
+ getTestData() {
768
+ return this.testdata
769
+ },
770
+ serviceacitivity() {
771
+ return this.model.serviceacitivity.find((row) => {
772
+ return row.f_service_acitivity_type === '派单'
773
+ })
774
+ },
775
+ alertObject() {
776
+ let result = this.model.failure.find((value) => {
777
+ return value.f_failure_type === '报警器'
778
+ })
779
+ if (result) {
780
+ return result
781
+ }
782
+ return {f_equipment: ''}
783
+ },
784
+ gasstove() {
785
+ let result = this.model.failure.find((value) => {
786
+ return value.f_failure_type === '燃气灶'
787
+ })
788
+ if (result) {
789
+ return result
790
+ }
791
+ return {f_equipment: ''}
792
+ },
793
+ furnace() {
794
+ let result = this.model.failure.find((value) => {
795
+ return value.f_failure_type === '壁挂炉'
796
+ })
797
+ if (result) {
798
+ return result
799
+ }
800
+ return {f_equipment: ''}
801
+ },
802
+ heater() {
803
+ let result = this.model.failure.find((value) => {
804
+ return value.f_failure_type === '热水器'
805
+ })
806
+ if (result) {
807
+ return result
808
+ }
809
+ return {f_equipment: ''}
810
+ },
811
+ lampblack() {
812
+ let result = this.model.failure.find((value) => {
813
+ return value.f_failure_type === '油烟机'
814
+ })
815
+ if (result) {
816
+ return result
817
+ }
818
+ return {f_equipment: ''}
819
+ }
820
+ },
821
+ events:{
822
+ getPosition(val){
823
+ //tag
824
+ this.$dispatch('distribute',val)
825
+
826
+ }
827
+ },
828
+ components: {
829
+ FailureEdit,
830
+ 'failure-edit': FailureEdit
831
+ }
832
+ }
833
+
834
+ </script>
835
+ <style>
836
+ .class-error{
837
+ color:#a94442;
838
+ }
839
+
840
+ </style>