telephone-clients 3.0.104-20 → 3.0.104-21

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,850 +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
- 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>
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>