|
|
@@ -2,49 +2,56 @@
|
|
2
|
2
|
<div v-loading="loading" class="creat_order">
|
|
3
|
3
|
<el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="100px" class="order_form">
|
|
4
|
4
|
<el-row :gutter="24" class="clearfix">
|
|
5
|
|
- <el-col :lg="12" :xl="8" class="col_item">
|
|
|
5
|
+ <el-col :lg="24" :xl="24" class="col_item">
|
|
6
|
6
|
<el-form-item label="工单类型" prop="typeid">
|
|
7
|
7
|
<el-radio-group v-model="ruleForm.typeid" @change="changeOrderType">
|
|
8
|
8
|
<el-radio v-for="item in typeOptions" :key="item.id" :label="item.id" border>{{ item.name }}</el-radio>
|
|
9
|
9
|
</el-radio-group>
|
|
10
|
10
|
</el-form-item>
|
|
11
|
11
|
</el-col>
|
|
12
|
|
- <el-col :lg="12" :xl="8" class="col_item">
|
|
|
12
|
+ <el-col v-show="businIs" :lg="12" :xl="12" class="col_item">
|
|
|
13
|
+ <el-form-item :label="`业务办理`" prop="businesstype">
|
|
|
14
|
+ <el-select v-model="ruleForm.businesstype" :placeholder="`请选择业务办理`" class="form_select" filterable clearable>
|
|
|
15
|
+ <el-option v-for="item in busineData" :key="item.name" :label="item.name" :value="item.name"/>
|
|
|
16
|
+ </el-select>
|
|
|
17
|
+ </el-form-item>
|
|
|
18
|
+ </el-col>
|
|
|
19
|
+ <el-col :lg="12" :xl="12" class="col_item">
|
|
13
|
20
|
<el-form-item label="客户姓名" prop="name">
|
|
14
|
21
|
<el-input v-model="ruleForm.name" placeholder="请输入客户姓名"/>
|
|
15
|
22
|
</el-form-item>
|
|
16
|
23
|
</el-col>
|
|
17
|
|
- <el-col :lg="12" :xl="8" class="col_item">
|
|
|
24
|
+ <el-col :lg="12" :xl="12" class="col_item">
|
|
18
|
25
|
<el-form-item label="客户电话" prop="phone">
|
|
19
|
26
|
<el-input v-model="ruleForm.phone" placeholder="请输入客户电话"/>
|
|
20
|
27
|
</el-form-item>
|
|
21
|
28
|
</el-col>
|
|
22
|
|
- <el-col :lg="12" :xl="8" class="col_item">
|
|
|
29
|
+ <el-col :lg="12" :xl="12" class="col_item">
|
|
23
|
30
|
<el-form-item label="来电电话" prop="callintel">
|
|
24
|
31
|
<el-input v-model="ruleForm.callintel" placeholder="请输入客户来电电话"/>
|
|
25
|
32
|
</el-form-item>
|
|
26
|
33
|
</el-col>
|
|
27
|
34
|
<div v-show="afterSale">
|
|
28
|
|
- <el-col v-if="afterSale" :lg="12" :xl="8" class="col_item">
|
|
|
35
|
+ <el-col v-if="afterSale" :lg="12" :xl="12" class="col_item">
|
|
29
|
36
|
<el-form-item label="售后来源" prop="sourceid">
|
|
30
|
37
|
<el-select v-model="ruleForm.sourceid" class="form_select" filterable clearable placeholder="请选择售后来源">
|
|
31
|
38
|
<el-option v-for="item in sourceOptions" :key="item.id" :label="item.name" :value="item.id"/>
|
|
32
|
39
|
</el-select>
|
|
33
|
40
|
</el-form-item>
|
|
34
|
41
|
</el-col>
|
|
35
|
|
- <el-col :lg="12" :xl="8" class="col_item">
|
|
|
42
|
+ <el-col :lg="12" :xl="12" class="col_item">
|
|
36
|
43
|
<el-form-item label="单位名称" prop="company">
|
|
37
|
44
|
<el-input v-model="ruleForm.company" placeholder="请输入客户单位名称"/>
|
|
38
|
45
|
</el-form-item>
|
|
39
|
46
|
</el-col>
|
|
40
|
|
- <el-col :lg="12" :xl="8" class="col_item">
|
|
|
47
|
+ <el-col :lg="12" :xl="12" class="col_item">
|
|
41
|
48
|
<el-form-item label="项目名称" prop="proid">
|
|
42
|
49
|
<el-select v-model="ruleForm.proid" class="form_select" filterable clearable placeholder="请选择项目" @change="selectGet">
|
|
43
|
50
|
<el-option v-for="item in proData" :key="item.id" :label="item.project_name" :value="item.id"/>
|
|
44
|
51
|
</el-select>
|
|
45
|
52
|
</el-form-item>
|
|
46
|
53
|
</el-col>
|
|
47
|
|
- <el-col :lg="12" :xl="8" class="col_item">
|
|
|
54
|
+ <el-col :lg="12" :xl="12" class="col_item">
|
|
48
|
55
|
<el-form-item label="所在地" prop="provinceCity">
|
|
49
|
56
|
<el-cascader
|
|
50
|
57
|
v-model="provinceCity"
|
|
|
@@ -57,12 +64,12 @@
|
|
57
|
64
|
change-on-select/>
|
|
58
|
65
|
</el-form-item>
|
|
59
|
66
|
</el-col>
|
|
60
|
|
- <el-col :lg="12" :xl="8" class="col_item">
|
|
|
67
|
+ <el-col :lg="12" :xl="12" class="col_item">
|
|
61
|
68
|
<el-form-item label="具体地址" prop="address">
|
|
62
|
69
|
<el-input v-model="ruleForm.address" placeholder="请输入具体地址"/>
|
|
63
|
70
|
</el-form-item>
|
|
64
|
71
|
</el-col>
|
|
65
|
|
- <el-col :lg="12" :xl="8" class="col_item">
|
|
|
72
|
+ <el-col :lg="12" :xl="12" class="col_item">
|
|
66
|
73
|
<el-form-item label="故障设备" prop="faulty_equipment">
|
|
67
|
74
|
<el-input v-model="ruleForm.faulty_equipment" placeholder="请输入故障设备"/>
|
|
68
|
75
|
</el-form-item>
|
|
|
@@ -85,15 +92,20 @@
|
|
85
|
92
|
</el-form-item>
|
|
86
|
93
|
</el-col>
|
|
87
|
94
|
</div>
|
|
88
|
|
-
|
|
89
|
95
|
<el-col :lg="12" :xl="8" class="col_item">
|
|
90
|
96
|
<el-form-item :label="`${deptContent.deptname}部门`" prop="deptid">
|
|
91
|
|
- <el-select v-model="ruleForm.deptid" :placeholder="`请选择${deptContent.deptname}部门`" class="form_select" filterable clearable>
|
|
|
97
|
+ <el-select v-model="ruleForm.deptid" :placeholder="`请选择${deptContent.deptname}部门`" class="form_select" filterable clearable @change="deptChange">
|
|
92
|
98
|
<el-option v-for="item in deptData" :key="item.id" :label="item.name" :value="item.id"/>
|
|
93
|
99
|
</el-select>
|
|
94
|
100
|
</el-form-item>
|
|
95
|
101
|
</el-col>
|
|
96
|
|
-
|
|
|
102
|
+ <el-col :lg="12" :xl="12">
|
|
|
103
|
+ <el-form-item label="接收人" prop="touser" >
|
|
|
104
|
+ <el-select v-model="ruleForm.touser" class="form_select" filterable clearable placeholder="请选择接收人">
|
|
|
105
|
+ <el-option v-for="item in touserOptions" :key="item.id" :label="`${item.username}(${item.usercode})`" :value="item.usercode"/>
|
|
|
106
|
+ </el-select>
|
|
|
107
|
+ </el-form-item>
|
|
|
108
|
+ </el-col>
|
|
97
|
109
|
<el-col :lg="24" :xl="24">
|
|
98
|
110
|
<el-form-item :label="`${deptContent.contentName}内容`" prop="content" >
|
|
99
|
111
|
<el-input :autosize="{ minRows: 4}" v-model="ruleForm.content" :placeholder="`请输入${deptContent.contentName}内容`" type="textarea"/>
|
|
|
@@ -107,6 +119,22 @@
|
|
107
|
119
|
</el-radio-group>
|
|
108
|
120
|
</el-form-item>
|
|
109
|
121
|
</el-col>
|
|
|
122
|
+ <el-col :xl="24">
|
|
|
123
|
+ <el-form-item label="工单有效性" prop="iseffective">
|
|
|
124
|
+ <el-radio-group v-model="ruleForm.iseffective">
|
|
|
125
|
+ <el-radio label="0">无效</el-radio>
|
|
|
126
|
+ <el-radio label="1">有效</el-radio>
|
|
|
127
|
+ </el-radio-group>
|
|
|
128
|
+ </el-form-item>
|
|
|
129
|
+ </el-col>
|
|
|
130
|
+ <el-col :xl="24">
|
|
|
131
|
+ <el-form-item label="立即处理" prop="dealinstantly">
|
|
|
132
|
+ <el-radio-group v-model="ruleForm.dealinstantly">
|
|
|
133
|
+ <el-radio label="0">否</el-radio>
|
|
|
134
|
+ <el-radio label="1">是</el-radio>
|
|
|
135
|
+ </el-radio-group>
|
|
|
136
|
+ </el-form-item>
|
|
|
137
|
+ </el-col>
|
|
110
|
138
|
<!-- <el-form-item label="附件" prop="files">
|
|
111
|
139
|
<el-upload
|
|
112
|
140
|
ref="upload"
|
|
|
@@ -135,6 +163,7 @@
|
|
135
|
163
|
<script>
|
|
136
|
164
|
import { getProviceCity, getDictionary, getPro } from '@/api/commonAPI'
|
|
137
|
165
|
import { getOrder, addOrder, editOrder } from '@/api/order/orderSearchHY'
|
|
|
166
|
+import { getUserSelects } from '@/api/systemSetup/roleSetting/userManage'
|
|
138
|
167
|
import { validateTel } from '@/utils/validate'
|
|
139
|
168
|
import { delFiles, filterContent } from '@/utils'
|
|
140
|
169
|
|
|
|
@@ -183,7 +212,10 @@ export default {
|
|
183
|
212
|
},
|
|
184
|
213
|
consultation: false, // 是否是咨询
|
|
185
|
214
|
afterSale: false, // 是否是售后
|
|
|
215
|
+ // iseffective: false,
|
|
|
216
|
+ // dealinstantly: false,
|
|
186
|
217
|
complaint: false, // 是否是投诉
|
|
|
218
|
+ businIs: false,
|
|
187
|
219
|
provinceCity: [], // 省市下拉绑定的值
|
|
188
|
220
|
provinceCityDatas: [], // 省市下拉数据
|
|
189
|
221
|
props: { // 自定义省市下拉数据的key值
|
|
|
@@ -193,6 +225,8 @@ export default {
|
|
193
|
225
|
},
|
|
194
|
226
|
sourceOptions: [], // 售后来源下拉数据
|
|
195
|
227
|
typeOptions: [], // 工单类型下拉数据
|
|
|
228
|
+ busineData: [], // 业务办理类型下拉
|
|
|
229
|
+ touserOptions: [], // 接收人下拉数据
|
|
196
|
230
|
faultyTypeData: [], // 故障类型下拉数据
|
|
197
|
231
|
faultyTypeData2: [], // 故障类型2级下拉数据
|
|
198
|
232
|
productiveData: [], // 处理时效下拉数据
|
|
|
@@ -205,6 +239,10 @@ export default {
|
|
205
|
239
|
phone: this.callinNum, // 是 string 客户联系电话
|
|
206
|
240
|
name: '', // 否 string 客户姓名
|
|
207
|
241
|
callintel: this.callinNum, // 来电电话
|
|
|
242
|
+ businesstype: '',
|
|
|
243
|
+ iseffective: '1',
|
|
|
244
|
+ dealinstantly: '0',
|
|
|
245
|
+ touser: '', // 指派给的坐席工号
|
|
208
|
246
|
deptid: '', // 咨询部门id
|
|
209
|
247
|
content: '', // 是 string 故障内容
|
|
210
|
248
|
sourceid: '', // 否 string 售后来源id
|
|
|
@@ -257,22 +295,22 @@ export default {
|
|
257
|
295
|
// 处理部门和内容的名字
|
|
258
|
296
|
deptContent() {
|
|
259
|
297
|
const deptCotentName = {
|
|
260
|
|
- deptname: '咨询',
|
|
|
298
|
+ deptname: '接收',
|
|
261
|
299
|
contentName: '咨询'
|
|
262
|
300
|
}
|
|
263
|
301
|
// 咨询
|
|
264
|
302
|
if (this.consultation) {
|
|
265
|
|
- deptCotentName.deptname = '咨询'
|
|
|
303
|
+ deptCotentName.deptname = '接收'
|
|
266
|
304
|
deptCotentName.contentName = '咨询'
|
|
267
|
305
|
}
|
|
268
|
306
|
// 售后
|
|
269
|
307
|
if (this.afterSale) {
|
|
270
|
|
- deptCotentName.deptname = '咨询'
|
|
|
308
|
+ deptCotentName.deptname = '接收'
|
|
271
|
309
|
deptCotentName.contentName = '故障'
|
|
272
|
310
|
}
|
|
273
|
311
|
// 投诉
|
|
274
|
312
|
if (this.complaint) {
|
|
275
|
|
- deptCotentName.deptname = '投诉'
|
|
|
313
|
+ deptCotentName.deptname = '接收'
|
|
276
|
314
|
deptCotentName.contentName = '投诉'
|
|
277
|
315
|
}
|
|
278
|
316
|
return deptCotentName
|
|
|
@@ -284,7 +322,8 @@ export default {
|
|
284
|
322
|
}
|
|
285
|
323
|
Promise.all([
|
|
286
|
324
|
this.getOrderType(), // 获取工单类型
|
|
287
|
|
- this.getDeptData() // 获取部门
|
|
|
325
|
+ this.getDeptData(), // 获取部门
|
|
|
326
|
+ this.getBusineData() // 获取业务类型
|
|
288
|
327
|
]).then(() => {
|
|
289
|
328
|
if (this.rowid) {
|
|
290
|
329
|
this.ruleForm.ordercode = this.rowid
|
|
|
@@ -383,10 +422,13 @@ export default {
|
|
383
|
422
|
if (response.state.toLowerCase() === 'success') {
|
|
384
|
423
|
const res = response.data.model
|
|
385
|
424
|
this.ruleForm.typeid = res.typeid // 类型
|
|
|
425
|
+ this.ruleForm.iseffective === res.iseffective // 工单有效性
|
|
|
426
|
+ this.ruleForm.dealinstantly === res.dealinstantly // 是否立即处理
|
|
386
|
427
|
this.ruleForm.name = res.name // 姓名
|
|
387
|
428
|
this.ruleForm.phone = res.phone // 电话
|
|
388
|
429
|
this.ruleForm.callintel = res.callintel // 来电电话
|
|
389
|
|
- this.ruleForm.deptid = res.deptid // 咨询部门id
|
|
|
430
|
+ this.ruleForm.deptid = res.deptid // 接收部门id
|
|
|
431
|
+ this.ruleForm.touser = res.touser // 接收人
|
|
390
|
432
|
this.ruleForm.content = res.content // 故障内容
|
|
391
|
433
|
if (res.typeid === '5bf522f45a10b06b7a35a503') { // 咨询
|
|
392
|
434
|
this.consultation = true // 是否是咨询
|
|
|
@@ -418,6 +460,13 @@ export default {
|
|
418
|
460
|
})
|
|
419
|
461
|
} else if (res.typeid === '5c47d83fd2bc5f5d5907f296') { // 投诉
|
|
420
|
462
|
this.complaint = true
|
|
|
463
|
+ } else if (res.typeid === '5d0c9e21156ef38d2086d941') {
|
|
|
464
|
+ this.businIs = true // 是否是业务类型
|
|
|
465
|
+ this.getBusineData().then(() => {
|
|
|
466
|
+ this.businesstype = res.businesstype// 业务办理
|
|
|
467
|
+ // alert(this.businesstype)
|
|
|
468
|
+ this.ruleForm.businesstype = res.businesstype // 客户项目名称
|
|
|
469
|
+ })
|
|
421
|
470
|
}
|
|
422
|
471
|
}
|
|
423
|
472
|
})
|
|
|
@@ -429,6 +478,7 @@ export default {
|
|
429
|
478
|
this.consultation = true // 是否是咨询
|
|
430
|
479
|
this.afterSale = false // 是否是售后
|
|
431
|
480
|
this.complaint = false // 是否是投诉
|
|
|
481
|
+ this.businIs = false // 是否是业务类型
|
|
432
|
482
|
break
|
|
433
|
483
|
case '5bf523015a10b06b7a35a504':// 售后
|
|
434
|
484
|
this.consultation = false
|
|
|
@@ -439,16 +489,22 @@ export default {
|
|
439
|
489
|
this.getFaultyType() // 获取故障类型
|
|
440
|
490
|
this.getProCity() // 获取省市下拉数据
|
|
441
|
491
|
this.getProductive() // 获取处理时效
|
|
|
492
|
+ this.businIs = false // 是否是业务类型
|
|
|
493
|
+ break
|
|
|
494
|
+ case '5d0c9e21156ef38d2086d941':// 售后
|
|
|
495
|
+ this.businIs = true // 是否是业务类型
|
|
442
|
496
|
break
|
|
443
|
497
|
case '5c47d83fd2bc5f5d5907f296':// 投诉
|
|
444
|
498
|
this.consultation = false
|
|
445
|
499
|
this.afterSale = false
|
|
446
|
500
|
this.complaint = true
|
|
|
501
|
+ this.businIs = false // 是否是业务类型
|
|
447
|
502
|
break
|
|
448
|
503
|
default:
|
|
449
|
504
|
this.consultation = false
|
|
450
|
505
|
this.afterSale = false
|
|
451
|
506
|
this.complaint = false
|
|
|
507
|
+ this.businIs = false // 是否是业务类型
|
|
452
|
508
|
break
|
|
453
|
509
|
}
|
|
454
|
510
|
},
|
|
|
@@ -485,6 +541,25 @@ export default {
|
|
485
|
541
|
resolve()
|
|
486
|
542
|
})
|
|
487
|
543
|
},
|
|
|
544
|
+ // 获取接收人
|
|
|
545
|
+ getUserDatas(code) {
|
|
|
546
|
+ return new Promise(resolve => {
|
|
|
547
|
+ getUserSelects(code).then(response => {
|
|
|
548
|
+ if (response.state.toLowerCase() === 'success') {
|
|
|
549
|
+ this.touserOptions = response.data
|
|
|
550
|
+ }
|
|
|
551
|
+ })
|
|
|
552
|
+ })
|
|
|
553
|
+ },
|
|
|
554
|
+ // 部门改变
|
|
|
555
|
+ deptChange(vId) {
|
|
|
556
|
+ this.ruleForm.touser = ''
|
|
|
557
|
+ if (vId) {
|
|
|
558
|
+ this.getUserDatas(vId)
|
|
|
559
|
+ } else {
|
|
|
560
|
+ this.touserOptions = []
|
|
|
561
|
+ }
|
|
|
562
|
+ },
|
|
488
|
563
|
// 获取故障类型一级数据
|
|
489
|
564
|
getFaultyType() {
|
|
490
|
565
|
return new Promise(resolve => {
|
|
|
@@ -527,6 +602,17 @@ export default {
|
|
527
|
602
|
resolve()
|
|
528
|
603
|
})
|
|
529
|
604
|
},
|
|
|
605
|
+ // 获取业务办理类型
|
|
|
606
|
+ getBusineData() {
|
|
|
607
|
+ return new Promise(resolve => {
|
|
|
608
|
+ getDictionary('YWBL').then(response => {
|
|
|
609
|
+ if (response.state.toLowerCase() === 'success') {
|
|
|
610
|
+ this.busineData = response.data
|
|
|
611
|
+ }
|
|
|
612
|
+ })
|
|
|
613
|
+ resolve()
|
|
|
614
|
+ })
|
|
|
615
|
+ },
|
|
530
|
616
|
// 获取处理时效
|
|
531
|
617
|
getProductive() {
|
|
532
|
618
|
return new Promise(resolve => {
|