telephone-clients 3.0.104-33 → 3.0.104-34

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