Просмотр исходного кода

修改反馈单位 来电单位bug

zhangshuangnan лет назад: 7
Родитель
Сommit
973cbc7f91

+ 74 - 20
CallCenterWeb.UI/WorkOrder/AddWorkOrder.html

@@ -11,6 +11,7 @@
11 11
 		<link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
12 12
 		<link href="../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
13 13
 		<link rel="stylesheet" href="../css/WorkOrder/jquery.editable-select.css" />
14
+		<link rel="stylesheet" href="../js/comboSelect/combo.select.css" />
14 15
 		<link href="../css/init.css" rel="stylesheet" />
15 16
 		<title>手工制单</title>
16 17
 		<style>
@@ -171,22 +172,26 @@
171 172
 
172 173
 							<th>来电单位:</th>
173 174
 							<td style="position: relative;">
174
-								<!--<select name="" id="testInput1"  class="">
175
-								
176
-							</select>-->
177
-								<input id="testInput1" type="text" style="width:100%;" />
175
+								<select name="" id="testInput1"  class="">
176
+									<!--<option value="" selected>请选择来电单位</option>-->
177
+								</select>
178
+								<!--<input id="testInput1" type="text" style="width:100%;" />
178 179
 								<ul class="testInput-list">
179 180
 									<li></li>
180
-								</ul>
181
+								</ul>-->
182
+								
181 183
 							</td>
182 184
 						</tr>
183 185
 						<tr>
184 186
 							<th>反馈单位:</th>
185 187
 							<td style="position: relative;">
186
-								<input id="testInput2" type="text" style="width:100%;" style="display: none;" />
188
+								<select name="" id="testInput2"  class="">
189
+									<!--<option value="" selected>请选择来电单位</option>-->
190
+								</select>
191
+								<!--<input id="testInput2" type="text" style="width:100%;" style="display: none;" />
187 192
 								<ul class="testInput-list">
188 193
 									<li></li>
189
-								</ul>
194
+								</ul>-->
190 195
 							</td>
191 196
 
192 197
 							<th>工单来源:</th>
@@ -281,10 +286,14 @@
281 286
 								</select>
282 287
 							</td>-->
283 288
 							<td style="position: relative;">
284
-								<input id="testInput3" type="text" style="width:100%;" style="display: none;" />
289
+								<!--<input id="testInput3" type="text" style="width:100%;" style="display: none;" />
285 290
 								<ul class="testInput-list">
286 291
 									<li></li>
287
-								</ul>
292
+								</ul>-->
293
+								
294
+								<select id="testInput3">
295
+									<!--<option value="">请选择来电单位</option>-->
296
+								</select>
288 297
 							</td>
289 298
 						</tr>
290 299
 						<tr>
@@ -295,10 +304,13 @@
295 304
 								</select>
296 305
 							</td>-->
297 306
 							<td style="position: relative;">
298
-								<input id="testInput4" type="text" style="width:100%;" style="display: none;" />
307
+								<!--<input id="testInput4" type="text" style="width:100%;" style="display: none;" />
299 308
 								<ul class="testInput-list">
300 309
 									<li></li>
301
-								</ul>
310
+								</ul>-->
311
+								<select id="testInput4">
312
+									<!--<option value="">请选择来电单位</option>-->
313
+								</select>
302 314
 							</td>
303 315
 						</tr>
304 316
 						<tr>
@@ -324,14 +336,12 @@
324 336
 		<script src="../js/bootstrap-select/js/bootstrap-select.js"></script>
325 337
 		<script src="../js/WorkOrder/AddWorkOrder.js"></script>
326 338
 		<script src="../js/WorkOrder/jquery.editable-select.js"></script>
339
+			<script src="../js/comboSelect/jquery.combo.select.js"></script>
327 340
 		<script src="../js/kindeditor/kindeditor.js"></script>
328 341
 		<script src="../js/kindeditor/lang/zh_CN.js"></script>
329 342
 		<script>
330 343
 			//自己写的方法(未能实现鼠标下移选中)
331
-			Select($("#testInput1"));
332
-			Select($("#testInput2"));
333
-			Select($("#testInput3"));
334
-			Select($("#testInput4"));
344
+			
335 345
 
336 346
 			function Select(obj) {
337 347
 				obj.click(function(event) {
@@ -385,13 +395,57 @@
385 395
 
386 396
 			}
387 397
 			//请求单位
398
+			
399
+			
388 400
 			$(document).ready(function() {
389
-				$(document).click(function(e) {
390
-					if(!$(e.target).is($('.testInput-list>li')) && !$(e.target).is($('#testInput1')) && !$(e.target).is($('#testInput2')) && !$(e.target).is($('#testInput3')) && !$(e.target).is($('#testInput4'))) {
391
-						$('.testInput-list').hide();
392
-					}
393
-				})
401
+				$('#testInput1').comboSelect();
402
+				$('#testInput2').comboSelect();
403
+				$('#testInput3').comboSelect();
404
+				$('#testInput4').comboSelect();
405
+//				$(document).click(function(e) {
406
+//					if(!$(e.target).is($('.testInput-list>li')) && !$(e.target).is($('#testInput1')) && !$(e.target).is($('#testInput2')) && !$(e.target).is($('#testInput3')) && !$(e.target).is($('#testInput4'))) {
407
+//						$('.testInput-list').hide();
408
+//					}
409
+//				})
410
+			BindLDdep($("#testInput1"),$("#testInput2"),$("#testInput3"),$("#testInput4"));
394 411
 			})
412
+		
413
+				function BindLDdep(obj1,obj2,obj3,obj4,) {
414
+//					$('.testInput-list').empty();
415
+					$.ajax({
416
+						type: "get",
417
+						url: huayi.config.callcenter_url + "Customer/BindLDdep",
418
+						dataType: 'json',
419
+						async: true,
420
+						data: {
421
+//							keypara: str,
422
+							token: $.cookie("token")
423
+						},
424
+						success: function(data) {
425
+							var Count = data.data.dep;
426
+							var html = '';
427
+							$(Count).each(function(i, n) {
428
+								html = "<option value='" + n + "'>" + n + "</option>";
429
+								$(html).appendTo(obj1);
430
+								$(html).appendTo(obj2);
431
+								$(html).appendTo(obj3);
432
+								$(html).appendTo(obj4);
433
+//								$("<option value='" + n + "'>" + n + "</option>").appendTo(obj1)
434
+							});
435
+							obj1.comboSelect();
436
+							obj2.comboSelect();
437
+							obj3.comboSelect();
438
+							obj4.comboSelect();
439
+//							$('.testInput-list>li').click(function() {
440
+//								$('.testInput-list').show();
441
+//								obj.val($(this).html());
442
+//								$('.testInput-list').hide();
443
+//							})
444
+
445
+						}
446
+					});
447
+				};
448
+		
395 449
 		</script>
396 450
 	</body>
397 451
 

+ 16 - 8
CallCenterWeb.UI/WorkOrder/WorkOrderDispose.html

@@ -10,6 +10,7 @@
10 10
 		<link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
11 11
 		<link href="../css/WorkOrder/Search.css" rel="stylesheet">
12 12
 		<link href="../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
13
+		<link rel="stylesheet" href="../js/comboSelect/combo.select.css" />
13 14
 		<link href="../css/init.css" rel="stylesheet" />
14 15
 		<style>
15 16
 			/*table td {
@@ -150,8 +151,11 @@
150 151
 							</div>
151 152
 
152 153
 							<div class="form-group">
153
-								<select class="form-control selectpicker" id="comeCall_dep" data-live-search="true">
154
+								<!--<select class="form-control selectpicker" id="comeCall_dep" data-live-search="true">
154 155
 									<option value="">请选择来电单位</option>
156
+								</select>-->
157
+								<select class="" id="comeCall_dep">
158
+									<option value="" selected>请选择来电单位</option>
155 159
 								</select>
156 160
 							</div>
157 161
 
@@ -161,8 +165,11 @@
161 165
 								</select>
162 166
 							</div>
163 167
 							<div class="form-group">
164
-								<select class="form-control selectpicker" id="comeCall_deps" data-live-search="true">
168
+								<!--<select class="form-control selectpicker" id="comeCall_deps" data-live-search="true">
165 169
 									<option value="">请选择反馈单位</option>
170
+								</select>-->
171
+								<select class="" id="comeCall_deps">
172
+									<option value="" selected>请选择反馈单位</option>
166 173
 								</select>
167 174
 							</div>
168 175
 						</div>
@@ -512,6 +519,7 @@
512 519
 		<script src="../js/zTree/jquery.ztree.core.js"></script>
513 520
 		<script src="../js/laydate/laydate.js"></script>
514 521
 		<script src="../js/bootstrap-select/js/bootstrap-select.js"></script>
522
+		<script src="../js/comboSelect/jquery.combo.select.js"></script>
515 523
 		<script src="../js/kindeditor/kindeditor.js"></script>
516 524
 		<script src="../js/kindeditor/lang/zh_CN.js"></script>
517 525
 		<script src="../js/WorkOrder/WorkOrder.js"></script>
@@ -602,8 +610,8 @@
602 610
 							typeclass: $('#typeclassId').val(), //工单类型
603 611
 							starttime: $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[0], //开始时间
604 612
 							endtime: $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[1], //结束时间
605
-							lddep: $('#comeCall_dep').val(), //来电单位
606
-							fkdep: $('#comeCall_deps').val(), //来电单位
613
+							lddep: $('#comeCall_dep_input').val(), //来电单位
614
+							fkdep: $('#comeCall_deps_input').val(), //来电单位
607 615
 							userid: $('#userid').val() //坐席
608 616
 
609 617
 						};
@@ -658,8 +666,8 @@
658 666
 							typeclass: $('#typeclassId').val(), //工单类型
659 667
 							starttime: $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[0], //开始时间
660 668
 							endtime: $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[1], //结束时间
661
-							lddep: $('#comeCall_dep').val(), //来电单位
662
-							fkdep: $('#comeCall_deps').val(), //来电单位
669
+							lddep: $('#comeCall_dep_input').val(), //来电单位
670
+							fkdep: $('#comeCall_deps_input').val(), //来电单位
663 671
 							userid: $('#userid').val() //坐席
664 672
 
665 673
 						};
@@ -692,9 +700,9 @@
692 700
 					url += "&type=" + $("#orderSource").val();//工单来源
693 701
 					url += "&starttime=" + ($("#greetingTimes").val() && $("#greetingTimes").val().split(' ~ ')[0]);//开始时间
694 702
 					url += "&endtime=" + ($("#greetingTimes").val() && $("#greetingTimes").val().split(' ~ ')[1]);//结束时间
695
-					url += "&lddep=" + $("#comeCall_dep").val();//来电单位
703
+					url += "&lddep=" + $("#comeCall_dep_input").val();//来电单位
696 704
 					url += "&userid=" + $("#userid").val();//坐席
697
-					url += "&fkdep=" + $("#comeCall_deps").val();//反馈单位
705
+					url += "&fkdep=" + $("#comeCall_deps_input").val();//反馈单位
698 706
 				} else if(stype == '2') {
699 707
 					url += "&name=" + $("#ss_khxm").val() + "&tel=" + $("#ss_khdh").val() + "&key=" + $("#ss_gdnr").val();
700 708
 					url += "&type=" + $("#ss_gdlx").val() + "&orderid=" + $("#ss_gdbh").val();

+ 16 - 9
CallCenterWeb.UI/WorkOrder/WorkOrderExpedite.html

@@ -10,6 +10,7 @@
10 10
 		<link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
11 11
 		<link href="../css/WorkOrder/Search.css" rel="stylesheet">
12 12
 		<link href="../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
13
+		<link rel="stylesheet" href="../js/comboSelect/combo.select.css" />
13 14
 		<link href="../css/init.css" rel="stylesheet" />
14 15
 		<style>
15 16
 			/*table td {
@@ -130,8 +131,11 @@
130 131
 							</div>
131 132
 
132 133
 							<div class="form-group">
133
-								<select class="form-control selectpicker" id="comeCall_dep" data-live-search="true">
134
+								<!--<select class="form-control selectpicker" id="comeCall_dep" data-live-search="true">
134 135
 									<option value="">请选择来电单位</option>
136
+								</select>-->
137
+								<select class="" id="comeCall_dep">
138
+									<option value="" selected>请选择来电单位</option>
135 139
 								</select>
136 140
 							</div>
137 141
 
@@ -141,8 +145,11 @@
141 145
 								</select>
142 146
 							</div>
143 147
 							<div class="form-group">
144
-								<select class="form-control selectpicker" id="comeCall_deps" data-live-search="true">
148
+								<!--<select class="form-control selectpicker" id="comeCall_deps" data-live-search="true">
145 149
 									<option value="">请选择反馈单位</option>
150
+								</select>-->
151
+								<select class="" id="comeCall_deps">
152
+									<option value="" selected>请选择反馈单位</option>
146 153
 								</select>
147 154
 							</div>
148 155
 						</div>
@@ -430,7 +437,7 @@
430 437
 		<script src="../js/WorkOrder/WorkOrder.js"></script>
431 438
 		<script src="../js/laydate/laydate.js"></script>
432 439
 		<script src="../js/bootstrap-select/js/bootstrap-select.js"></script>
433
-
440
+	<script src="../js/comboSelect/jquery.combo.select.js"></script>
434 441
 		<script>
435 442
 			var selid;
436 443
 			var zpid;
@@ -503,8 +510,8 @@
503 510
 							typeclass: $('#typeclassId').val(), //工单类型
504 511
 							starttime: $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[0], //开始时间
505 512
 							endtime: $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[1], //结束时间
506
-							lddep: $('#comeCall_dep').val(), //来电单位
507
-							fkdep: $('#comeCall_deps').val(), //来电单位
513
+							lddep: $('#comeCall_dep_input').val(), //来电单位
514
+							fkdep: $('#comeCall_deps_input').val(), //来电单位
508 515
 							userid: $('#userid').val() //坐席
509 516
 						};
510 517
 						//                  if (stype == '1') {
@@ -558,8 +565,8 @@
558 565
 							typeclass: $('#typeclassId').val(), //工单类型
559 566
 							starttime: $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[0], //开始时间
560 567
 							endtime: $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[1], //结束时间
561
-							lddep: $('#comeCall_dep').val(), //来电单位
562
-							fkdep: $('#comeCall_deps').val(), //来电单位
568
+							lddep: $('#comeCall_dep_input').val(), //来电单位
569
+							fkdep: $('#comeCall_deps_input').val(), //来电单位
563 570
 							userid: $('#userid').val() //坐席
564 571
 						};
565 572
 						//                  if (stype == '1') {
@@ -592,9 +599,9 @@
592 599
 					url += "&type=" + $("#orderSource").val(); //工单来源
593 600
 					url += "&starttime=" + ($("#greetingTimes").val() && $("#greetingTimes").val().split(' ~ ')[0]); //开始时间
594 601
 					url += "&endtime=" + ($("#greetingTimes").val() && $("#greetingTimes").val().split(' ~ ')[1]); //结束时间
595
-					url += "&lddep=" + $("#comeCall_dep").val(); //来电单位
602
+					url += "&lddep=" + $("#comeCall_dep_input").val(); //来电单位
596 603
 					url += "&userid=" + $("#userid").val(); //坐席
597
-					url += "&fkdep=" + $("#comeCall_deps").val(); //反馈单位
604
+					url += "&fkdep=" + $("#comeCall_deps_input").val(); //反馈单位
598 605
 				} else if(stype == '2') {
599 606
 					url += "&name=" + $("#ss_khxm").val() + "&tel=" + $("#ss_khdh").val() + "&key=" + $("#ss_gdnr").val() + "&state=" + $("#ss_gdzt").val();
600 607
 					url += "&type=" + $("#ss_gdlx").val() + "&orderid=" + $("#ss_gdbh").val() + "&code=" + $("#ss_zxgh").val();

+ 17 - 9
CallCenterWeb.UI/WorkOrder/WorkOrderParty.html

@@ -10,6 +10,7 @@
10 10
 		<link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
11 11
 		<link href="../css/WorkOrder/Search.css" rel="stylesheet">
12 12
 		<link href="../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
13
+		<link rel="stylesheet" href="../js/comboSelect/combo.select.css" />
13 14
 		<link href="../css/init.css" rel="stylesheet" />
14 15
 		<style>
15 16
 			/*table td {
@@ -134,9 +135,13 @@
134 135
 							</div>
135 136
 
136 137
 							<div class="form-group">
137
-								<select class="form-control selectpicker" id="comeCall_dep" data-live-search="true">
138
+								<!--<select class="form-control selectpicker" id="comeCall_dep" data-live-search="true">
138 139
 									<option value="">请选择来电单位</option>
140
+								</select>-->
141
+								<select class="" id="comeCall_dep">
142
+									<option value="" selected>请选择来电单位</option>
139 143
 								</select>
144
+								
140 145
 							</div>
141 146
 
142 147
 							<div class="form-group">
@@ -145,8 +150,11 @@
145 150
 								</select>
146 151
 							</div>
147 152
 							<div class="form-group">
148
-								<select class="form-control selectpicker" id="comeCall_deps" data-live-search="true">
153
+								<!--<select class="form-control selectpicker" id="comeCall_deps" data-live-search="true">
149 154
 									<option value="">请选择反馈单位</option>
155
+								</select>-->
156
+								<select class="" id="comeCall_deps">
157
+									<option value="" selected>请选择反馈单位</option>
150 158
 								</select>
151 159
 							</div>
152 160
 						</div>
@@ -433,8 +441,8 @@
433 441
 		<script src="../js/kindeditor/lang/zh_CN.js"></script>
434 442
 		<script src="../js/WorkOrder/WorkOrder.js"></script>
435 443
 		<script src="../js/laydate/laydate.js"></script>
436
-
437 444
 		<script src="../js/bootstrap-select/js/bootstrap-select.js"></script>
445
+		<script src="../js/comboSelect/jquery.combo.select.js"></script>
438 446
 		<script>
439 447
 			var selid;
440 448
 			var zpid;
@@ -508,8 +516,8 @@
508 516
 							typeclass: $('#typeclassId').val(), //工单类型
509 517
 							starttime: $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[0], //开始时间
510 518
 							endtime: $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[1], //结束时间
511
-							lddep: $('#comeCall_dep').val(), //来电单位
512
-							fkdep: $('#comeCall_deps').val(), //来电单位
519
+							lddep: $('#comeCall_dep_input').val(), //来电单位
520
+							fkdep: $('#comeCall_deps_input').val(), //来电单位
513 521
 							userid: $('#userid').val() //坐席
514 522
 						};
515 523
 						//                  if (stype == '1') {
@@ -564,8 +572,8 @@
564 572
 							typeclass: $('#typeclassId').val(), //工单类型
565 573
 							starttime: $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[0], //开始时间
566 574
 							endtime: $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[1], //结束时间
567
-							lddep: $('#comeCall_dep').val(), //来电单位
568
-							fkdep: $('#comeCall_deps').val(), //来电单位
575
+							lddep: $('#comeCall_dep_input').val(), //来电单位
576
+							fkdep: $('#comeCall_deps_input').val(), //来电单位
569 577
 							userid: $('#userid').val() //坐席
570 578
 
571 579
 						};
@@ -598,9 +606,9 @@
598 606
 					url += "&type=" + $("#orderSource").val();//工单来源
599 607
 					url += "&starttime=" + ($("#greetingTimes").val() && $("#greetingTimes").val().split(' ~ ')[0]);//开始时间
600 608
 					url += "&endtime=" + ($("#greetingTimes").val() && $("#greetingTimes").val().split(' ~ ')[1]);//结束时间
601
-					url += "&lddep=" + $("#comeCall_dep").val();//来电单位
609
+					url += "&lddep=" + $("#comeCall_dep_input").val();//来电单位
602 610
 					url += "&userid=" + $("#userid").val();//坐席
603
-					url += "&fkdep=" + $("#comeCall_deps").val();//反馈单位
611
+					url += "&fkdep=" + $("#comeCall_deps_input").val();//反馈单位
604 612
 				} else if(stype == '2') {
605 613
 					url += "&name=" + $("#ss_khxm").val() + "&tel=" + $("#ss_khdh").val() + "&key=" + $("#ss_gdnr").val() + "&state=" + $("#ss_gdzt").val();
606 614
 					url += "&type=" + $("#ss_gdlx").val() + "&orderid=" + $("#ss_gdbh").val() + "&code=" + $("#ss_zxgh").val();

+ 10 - 2
CallCenterWeb.UI/WorkOrder/WorkOrderSearch.html

@@ -10,6 +10,7 @@
10 10
 		<link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
11 11
 		<link href="../css/WorkOrder/Search.css" rel="stylesheet">
12 12
 		<link href="../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
13
+		<link rel="stylesheet" href="../js/comboSelect/combo.select.css" />
13 14
 		<link href="../css/init.css" rel="stylesheet" />
14 15
 		<style>
15 16
 			/*table td {
@@ -135,8 +136,11 @@
135 136
 							</div>
136 137
 
137 138
 							<div class="form-group">
138
-								<select class="form-control selectpicker" id="comeCall_dep" data-live-search="true">
139
+								<!--<select class="form-control selectpicker" id="comeCall_dep" data-live-search="true">
139 140
 									<option value="">请选择来电单位</option>
141
+								</select>-->
142
+								<select class="" id="comeCall_dep">
143
+									<option value="" selected>请选择来电单位</option>
140 144
 								</select>
141 145
 							</div>
142 146
 
@@ -146,8 +150,11 @@
146 150
 								</select>
147 151
 							</div>
148 152
 							<div class="form-group">
149
-								<select class="form-control selectpicker" id="comeCall_deps" data-live-search="true">
153
+								<!--<select class="form-control selectpicker" id="comeCall_deps" data-live-search="true">
150 154
 									<option value="">请选择反馈单位</option>
155
+								</select>-->
156
+								<select class="" id="comeCall_deps">
157
+									<option value="" selected>请选择反馈单位</option>
151 158
 								</select>
152 159
 							</div>
153 160
 						</div>
@@ -441,6 +448,7 @@
441 448
 		<script src="../js/WorkOrder/WorkOrder.js"></script>
442 449
 		<script src="../js/laydate/laydate.js"></script>
443 450
 		<script src="../js/bootstrap-select/js/bootstrap-select.js"></script>
451
+		<script src="../js/comboSelect/jquery.combo.select.js"></script>
444 452
 		<script>
445 453
 			var selid;
446 454
 			var stype = 1;

+ 64 - 18
CallCenterWeb.UI/WorkOrder/Xga.html

@@ -12,6 +12,7 @@
12 12
 		<link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
13 13
 		<link href="../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
14 14
 		<link rel="stylesheet" href="../css/WorkOrder/jquery.editable-select.css" />
15
+			<link rel="stylesheet" href="../js/comboSelect/combo.select.css" />
15 16
 		<link href="../css/init.css" rel="stylesheet" />
16 17
 		<title>手工制单</title>
17 18
 		<style>
@@ -161,19 +162,21 @@
161 162
 								<!--<select name="" id="testInput1"  class="">
162 163
 								
163 164
 							</select>-->
164
-								<input id="testInput1" type="text" style="width:100%;" />
165
+								<!--<input id="testInput1" type="text" style="width:100%;" />
165 166
 								<ul class="testInput-list">
166 167
 									<li></li>
167
-								</ul>
168
+								</ul>-->
169
+								<select name="" id="testInput1"></select>
168 170
 							</td>
169 171
 						</tr>
170 172
 						<tr>
171 173
 							<th>反馈单位:</th>
172 174
 							<td style="position: relative;">
173
-								<input id="testInput2" type="text" style="width:100%;" style="display: none;" />
175
+								<!--<input id="testInput2" type="text" style="width:100%;" style="display: none;" />
174 176
 								<ul class="testInput-list">
175 177
 									<li></li>
176
-								</ul>
178
+								</ul>-->
179
+								<select name="" id="testInput2"></select>
177 180
 							</td>
178 181
 
179 182
 							<th>工单来源:</th>
@@ -269,10 +272,11 @@
269 272
 								</select>
270 273
 							</td>-->
271 274
 							<td style="position: relative;">
272
-								<input id="testInput3" type="text" style="width:100%;" style="display: none;" />
275
+								<!--<input id="testInput3" type="text" style="width:100%;" style="display: none;" />
273 276
 								<ul class="testInput-list">
274 277
 									<li></li>
275
-								</ul>
278
+								</ul>-->
279
+								<select name="" id="testInput3"></select>
276 280
 							</td>
277 281
 						</tr>
278 282
 						<tr>
@@ -283,10 +287,11 @@
283 287
 								</select>
284 288
 							</td>-->
285 289
 							<td style="position: relative;">
286
-								<input id="testInput4" type="text" style="width:100%;" style="display: none;" />
290
+								<!--<input id="testInput4" type="text" style="width:100%;" style="display: none;" />
287 291
 								<ul class="testInput-list">
288 292
 									<li></li>
289
-								</ul>
293
+								</ul>-->
294
+								<select name="" id="testInput4"></select>
290 295
 							</td>
291 296
 						</tr>
292 297
 						<tr>
@@ -312,14 +317,10 @@
312 317
 		<script src="../js/kindeditor/kindeditor.js"></script>
313 318
 		<script src="../js/kindeditor/lang/zh_CN.js"></script>
314 319
 		<script src="../js/bootstrap-select/js/bootstrap-select.js"></script>
320
+		<script src="../js/comboSelect/jquery.combo.select.js"></script>
315 321
 		<script src="../js/WorkOrder/xgWork.js"></script>
316 322
 		<script src="../js/WorkOrder/jquery.editable-select.js"></script>
317 323
 		<script>
318
-			Select($("#testInput1"));
319
-			Select($("#testInput2"));
320
-			Select($("#testInput3"));
321
-			Select($("#testInput4"));
322
-
323 324
 			function Select(obj) {
324 325
 				obj.click(function(event) {
325 326
 					event.preventDefault();
@@ -376,12 +377,57 @@
376 377
 			//请求单位
377 378
 
378 379
 			$(document).ready(function() {
379
-				$(document).click(function(e) {
380
-					if(!$(e.target).is($('.testInput-list>li')) && !$(e.target).is($('#testInput1')) && !$(e.target).is($('#testInput2')) && !$(e.target).is($('#testInput3')) && !$(e.target).is($('#testInput4'))) {
381
-						$('.testInput-list').hide();
382
-					}
383
-				})
380
+				$('#testInput1').comboSelect();
381
+				$('#testInput2').comboSelect();
382
+				$('#testInput3').comboSelect();
383
+				$('#testInput4').comboSelect();
384
+//				$(document).click(function(e) {
385
+//					if(!$(e.target).is($('.testInput-list>li')) && !$(e.target).is($('#testInput1')) && !$(e.target).is($('#testInput2')) && !$(e.target).is($('#testInput3')) && !$(e.target).is($('#testInput4'))) {
386
+//						$('.testInput-list').hide();
387
+//					}
388
+//				})
389
+				BindLDdep($("#testInput1"),$("#testInput2"),$("#testInput3"),$("#testInput4"));
384 390
 			})
391
+			
392
+			
393
+				function BindLDdep(obj1,obj2,obj3,obj4,) {
394
+//					$('.testInput-list').empty();
395
+					$.ajax({
396
+						type: "get",
397
+						url: huayi.config.callcenter_url + "Customer/BindLDdep",
398
+						dataType: 'json',
399
+						async: false,
400
+						data: {
401
+//							keypara: str,
402
+							token: $.cookie("token")
403
+						},
404
+						success: function(data) {
405
+							var Count = data.data.dep;
406
+							var html = '';
407
+							$(Count).each(function(i, n) {
408
+								html = "<option value='" + n + "'>" + n + "</option>";
409
+								$(html).appendTo(obj1);
410
+								$(html).appendTo(obj2);
411
+								$(html).appendTo(obj3);
412
+								$(html).appendTo(obj4);
413
+//								$("<option value='" + n + "'>" + n + "</option>").appendTo(obj1)
414
+							});
415
+							obj1.comboSelect();
416
+							obj2.comboSelect();
417
+							obj3.comboSelect();
418
+							obj4.comboSelect();
419
+//							$('.testInput-list>li').click(function() {
420
+//								$('.testInput-list').show();
421
+//								obj.val($(this).html());
422
+//								$('.testInput-list').hide();
423
+//							})
424
+
425
+						}
426
+					});
427
+				};
428
+		
429
+			
430
+			
385 431
 		</script>
386 432
 	</body>
387 433
 

+ 44 - 156
CallCenterWeb.UI/callScreen/call.js

@@ -20,6 +20,9 @@ laydate({
20 20
 	event: 'focus'
21 21
 });
22 22
 
23
+
24
+
25
+
23 26
 //权限展示
24 27
 $.getJSON(huayi.config.callcenter_url + 'CallInScreen/GetCurrUserDep', {
25 28
 	"token": $.cookie("token")
@@ -28,6 +31,7 @@ $.getJSON(huayi.config.callcenter_url + 'CallInScreen/GetCurrUserDep', {
28 31
 		console.log(result);
29 32
 		if(result.data.groname == "客服组") {
30 33
 			$(".KF").show();
34
+			$(".SC").show();
31 35
 		} else {
32 36
 			$(".SC").show();
33 37
 			$("#SCorderlist").show();
@@ -114,26 +118,8 @@ $.getJSON(huayi.config.callcenter_url + 'Customer/GetCustomerByTel', {
114 118
 })
115 119
 
116 120
 var timestamp = Date.parse(new Date());
117
-//呼叫中心传入城管平台参数   ///不知道干吗用
118
-//	$.ajax({
119
-//		type: "get",
120
-//		url: 'http://61.54.5.100:8086/callcenter/PutTel?',
121
-//		async: true,
122
-//		dataType: 'json',
123
-//		data: {
124
-//			id: UserCode,
125
-//			tel: $(".hidTel").val(),
126
-//			time: timestamp
127
-//		},
128
-//		success: function(data) {}
129
-//	});
130
-
131
-//	$('.maxOpen').trigger("click");
132 121
 $('.head-pic .lahei .la-before').show();
133
-//触发来电类型第一个 点击;
134
-//  $("#dicValueList li:first-child").find("label").trigger('click');
135 122
 $('.head-pic .lahei .la-after').hide();
136
-//	$(".Bacha").hide();
137 123
 
138 124
 function clearInter() {
139 125
 	clearInterval(timer);
@@ -158,54 +144,6 @@ function calling() {
158 144
 function toDub(i) {
159 145
 	return i < 10 ? "0" + i : "" + i;
160 146
 }
161
-//最大化 最小化效果
162
-//最小化
163
-//  $('.minClosed').click(function () {
164
-//      $('.ldtp-con').removeClass('fadeInDown');
165
-//      $('.ldtp-con').addClass('fadeOutUp');
166
-//      $('.ldtp-con').css("display", "none");
167
-//      $('.maxOpen').show();
168
-//      $('.maxOpen').addClass('fadeInDown');
169
-//  });
170
-
171
-//最大化
172
-//  $('.maxOpen').click(function () {
173
-//      //触发来电类型第一个 点击;测试用
174
-//      //$("#dicValueList li:first-child").find("label").trigger('click');
175
-//      $('.ldtp-con').removeClass('fadeOutUp');
176
-//      $('.ldtp-con').addClass('fadeInDown');
177
-//      $('.ldtp-con').css("display", "block");
178
-//      $('.maxOpen').hide();
179
-//      $('.maxOpen').removeClass('fadeInDown');
180
-//      $('.maxOpen').addClass('fadeInDown');
181
-//      $('.first').removeClass('first');
182
-//      $('.ldtp-con').addClass('first');
183
-//
184
-//  })
185
-
186
-//关闭弹框
187
-//  $(".Bacha").click(function () {
188
-//      //清除来电类型样式
189
-//      //debugger;
190
-//      $('#dicValueList li').find("label").removeClass('checkedDept');
191
-//      $('.ldtp-con').removeClass('fadeInDown');
192
-//      $('.ldtp-con').addClass('fadeOutUp');
193
-//      $('.ldtp-con').css("display", "none");
194
-//      Clean();
195
-//      top.obj.Type = "SayFree";
196
-//      top.Send();
197
-//  })
198
-//顶部小头像
199
-//  var little_pic = $('.head-pic .hp-box img').attr("src");
200
-//  $('.maxOpen li .photo img').attr("src", little_pic);
201
-//点击左侧菜单来电弹屏显示
202
-//  $('.tantan').click(function () {
203
-//      $('.maxOpen').trigger("click");
204
-//      $('.head-pic .lahei .la-before').show();
205
-//      $('.head-pic .lahei .la-after').hide();
206
-//
207
-//  })
208
-
209 147
 //点击挂断
210 148
 $('.head-pic .td-call .take').click(function() {
211 149
 	//      top.obj.Type = "DropCall";
@@ -314,7 +252,7 @@ $(".addts").click(function() {
314 252
 	var marketName = $("#marketName").val();
315 253
 	var marketTel = $("#marketTel").val();
316 254
 	var lddep_market = $("#lddep").val();
317
-	var fkdep_market = $("#testInput1_").val();
255
+	var fkdep_market = $("#testInput_markfkdep_input").val();
318 256
 	var fkcont_market = $("#fkcont_market").val();
319 257
 	var callid = $(".hidCallID").val();
320 258
 	if(!marketName) {
@@ -360,7 +298,7 @@ $(".addts").click(function() {
360 298
 				$("#marketName").val('');
361 299
 				$("#marketTel").val('');
362 300
 				$("#lddep_market").val('');
363
-				$("#testInput1_").val('');
301
+				$("#testInput_markfkdep_input").val('');
364 302
 				$("#fkcont_market").val('');
365 303
 				layer.msg("创建工单成功");
366 304
 				$('.addts').attr("disabled", false);
@@ -381,7 +319,7 @@ $(".add_").click(function() {
381 319
 	//来电单位
382 320
 	var lddep = $('#lddep').val();
383 321
 	//反馈单位 
384
-	var fkdep = $("#testInput_").val();
322
+	var fkdep = $("#testInput_cusfkdep_input").val();
385 323
 	///工单来源id 
386 324
 	var gdly = $("#DicValueList").val();
387 325
 	//工单类型id  
@@ -487,7 +425,7 @@ $(".add_").click(function() {
487 425
 				//来电单位
488 426
 				$('#lddep').val('');
489 427
 				//反馈单位 
490
-				$("#testInput_").val('');
428
+				$("#testInput_cusfkdep_input").val('');
491 429
 				///工单来源id 
492 430
 				$("#DicValueList").val('');
493 431
 				//工单类型id  
@@ -609,17 +547,10 @@ $(".addjl").click(function() {
609 547
 	if(type == '3') {
610 548
 		$(".addgd").show();
611 549
 		$(".tbold").hide();
612
-		Select($("#testInput_"));
550
+//		Select($("#testInput_"));
613 551
 	} else if(type == '1') {
614 552
 		$(".zxbg").show();
615 553
 		$(".tbold").hide();
616
-		//			obj.blur(function() { //
617
-		//				$('.testInput-list').hide();
618
-		//			});
619
-
620
-		//请求单位
621
-		//
622
-
623 554
 	}
624 555
 })
625 556
 
@@ -664,70 +595,7 @@ $('input:radio[name="banli"]').change(function() {
664 595
 		$(".Nows_box").hide();
665 596
 	}
666 597
 })
667
-//  QY($("#sourcearea"));
668
-//  LB($("#type"));
669
-//  ZT($("#keys"));
670
-
671
-//  //通知公告
672
-//function QY(obj) {
673
-//  obj.empty();
674
-//  obj.append('<option selected="selected" value="">请选择</option>');
675
-//  $.getJSON(huayi.config.callcenter_url + "Area/GetAreaListById", {
676
-//      "token": $.cookie("token"),
677
-//  }, function (data) {
678
-//      if (data.state.toLowerCase() == "success") {
679
-//          var content = data.data;
680
-//          $(content).each(function (i, n) {
681
-//              $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(obj);
682
-//          })
683
-//      }
684
-//  })
685
-//}
686
-////来源
687
-//function LY(obj) {
688
-//  obj.empty();
689
-//  $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
690
-//      "token": $.cookie("token"),
691
-//      id: 1
692
-//  }, function (data) {
693
-//      if (data.state.toLowerCase() == "success") {
694
-//          var content = data.data;
695
-//          $(content).each(function (i, n) {
696
-//              $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
697
-//          })
698
-//      }
699
-//  })
700
-//}
701
-////类别
702
-//function LB(obj) {
703
-//  obj.empty();
704
-//  $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
705
-//      "token": $.cookie("token"),
706
-//      id: 2
707
-//  }, function (data) {
708
-//      if (data.state.toLowerCase() == "success") {
709
-//          var content = data.data;
710
-//          $(content).each(function (i, n) {
711
-//              $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
712
-//          })
713
-//      }
714
-//  })
715
-//}
716
-////主题
717
-//function ZT(obj) {
718
-//  obj.empty();
719
-//  $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
720
-//      "token": $.cookie("token"),
721
-//      id: 3
722
-//  }, function (data) {
723
-//      if (data.state.toLowerCase() == "success") {
724
-//          var content = data.data;
725
-//          $(content).each(function (i, n) {
726
-//              $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
727
-//          })
728
-//      }
729
-//  })
730
-//}
598
+
731 599
 //获取历史记录
732 600
 loadOld()
733 601
 //获取历史记录
@@ -948,17 +816,6 @@ function GetDealState(val) {
948 816
 
949 817
 function GetStateName(val) {
950 818
 	var str = '';
951
-	//switch (val + '') {
952
-	//    case '0':
953
-	//        str = "待指派";
954
-	//        break;
955
-	//    case '1':
956
-	//        str = "处理中";
957
-	//        break;
958
-	//    case '2':
959
-	//        str = "已完结";
960
-	//        break;
961
-	//}
962 819
 	switch(val + '') {
963 820
 		case '0':
964 821
 			str = "待处理";
@@ -1213,8 +1070,11 @@ function Clean() {
1213 1070
 	$('#result').val('');
1214 1071
 
1215 1072
 }
1216
-Select($("#testInput_"));
1217
-Select($("#testInput1_"));
1073
+//Select($("#testInput_"));
1074
+$('#testInput_cusfkdep').comboSelect();
1075
+$('#testInput_markfkdep').comboSelect();
1076
+newBindLDdep($('#testInput_cusfkdep'),$('#testInput_markfkdep'))
1077
+//Select($("#testInput1_"));
1218 1078
 Select($("#testInput2"));
1219 1079
 Selects($("#testInput1"));
1220 1080
 
@@ -1336,4 +1196,32 @@ $(document).ready(function() {
1336 1196
 			$('.testInput-list').hide();
1337 1197
 		}
1338 1198
 	})
1339
-})
1199
+})
1200
+//弹屏右侧 新增工单 反馈单位  重写  2018-07-18  zhangshaungnan 新增
1201
+function newBindLDdep(obj1,obj2) {
1202
+//					$('.testInput-list').empty();
1203
+					$.ajax({
1204
+						type: "get",
1205
+						url: huayi.config.callcenter_url + "Customer/BindLDdep",
1206
+						dataType: 'json',
1207
+						async: false,
1208
+						data: {
1209
+//							keypara: str,
1210
+							token: $.cookie("token")
1211
+						},
1212
+						success: function(data) {
1213
+							var Count = data.data.dep;
1214
+							var html = '';
1215
+							$(Count).each(function(i, n) {
1216
+								html = "<option value='" + n + "'>" + n + "</option>";
1217
+								$(html).appendTo(obj1);
1218
+								$(html).appendTo(obj2);
1219
+							});
1220
+							obj1.comboSelect();
1221
+							obj2.comboSelect();
1222
+						}
1223
+					});
1224
+				};
1225
+		
1226
+			
1227
+

+ 12 - 10
CallCenterWeb.UI/callScreen/callScreen.html

@@ -10,6 +10,7 @@
10 10
 		<link href="./../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
11 11
 		<link rel="stylesheet" href="./../js/zTree/zTreeStyle.css" />
12 12
 		<link rel="stylesheet" href="./css/call.css" />
13
+		<link rel="stylesheet" href="../js/comboSelect/combo.select.css" />
13 14
 		<style>
14 15
 			body,
15 16
 			html,
@@ -340,7 +341,7 @@
340 341
 				color: #e43926;
341 342
 			}
342 343
 			
343
-			.ld-sercon button.bton[disabled]{
344
+			.ld-sercon button.bton[disabled] {
344 345
 				background-color: #999;
345 346
 			}
346 347
 		</style>
@@ -586,12 +587,11 @@
586 587
 
587 588
           							  </ul>
588 589
         							</div>-->
589
-        							<!--<select class="form-control selectpicker" id="fkdep_market" data-live-search="true">
590
-										<option value="">请选择反馈单位</option>
591
-									</select>-->
592
-									<input type="text" id="testInput1_" class="ld-sercon form-control " />
590
+        							<select  id="testInput_markfkdep">
591
+									</select>
592
+									<!--<input type="text" id="testInput1_" class="ld-sercon form-control " />
593 593
 								<ul class="testInput-list">
594
-									<li></li>
594
+									<li></li>-->
595 595
                                 </span>
596 596
 									</div>
597 597
 									<div class="form-group clearfix">
@@ -605,9 +605,9 @@
605 605
                                 <span>解答内容:</span>
606 606
                                 <textarea rows="5"></textarea>
607 607
                             </div>-->
608
-                            		<div class="form-group text-center">
608
+									<div class="form-group text-center">
609 609
 										<button class="bton btn addts">创建</button>
610
-									</div>	
610
+									</div>
611 611
 								</form>
612 612
 							</div>
613 613
 							<div class="Pre-second second-con zxbg " style="display: none;">
@@ -647,10 +647,11 @@
647 647
         							<!--<select class="form-control selectpicker" id="fkdep" data-live-search="true">
648 648
 										<option value="">请选择反馈单位</option>
649 649
 									</select>-->
650
-									<input type="text" id="testInput_" class="ld-sercon form-control " style="width: 100%;" />
650
+									<!--<input type="text" id="testInput_" class="ld-sercon form-control " style="width: 100%;" />
651 651
 								<ul class="testInput-list" style="width: 98%;">
652 652
 									<li></li>
653
-								</ul>
653
+								</ul>-->
654
+								<select name="" id="testInput_cusfkdep"></select>
654 655
 									
655 656
                                 </span>
656 657
 									</div>
@@ -756,6 +757,7 @@
756 757
 		<script src="../js/kindeditor/lang/zh_CN.js"></script>
757 758
 		<script src="./../js/jquery.select.js"></script>
758 759
 		<script src="select.js"></script>
760
+		<script src="../js/comboSelect/jquery.combo.select.js"></script>
759 761
 		<script src="./../js/main.js?v=1.5"></script>
760 762
 		<script src="call.js"></script>
761 763
 	</body>

+ 13 - 16
CallCenterWeb.UI/js/WorkOrder/AddWorkOrder.js

@@ -35,8 +35,8 @@ if(id) {
35 35
 		$("#name").val(unescape(decodeURI(name)));
36 36
 	}
37 37
 	if(unescape(decodeURI(depName)) != 'null' && unescape(decodeURI(depName)) != 'undefined') {
38
-		$("#testInput1").val(unescape(decodeURI(depName)));
39
-		$("#testInput3").val(unescape(decodeURI(depName)));
38
+		$("#testInput1_input").val(unescape(decodeURI(depName)));
39
+		$("#testInput3_input").val(unescape(decodeURI(depName)));
40 40
 	}
41 41
 
42 42
 }
@@ -48,11 +48,8 @@ $(document).ready(function() {
48 48
 	//工单状态
49 49
 	getOrderState();
50 50
 	//来电单位   
51
-	getAccount('#comeCall_dep');
52
-	//          getAccount('#comeCall_dep_market');
53
-	getAccount('#feedbackDep');
54
-	//          getAccount('#feedbackDep_market');
55
-
51
+//	getAccount('#comeCall_dep');
52
+//	getAccount('#feedbackDep');
56 53
 	//编辑器配置 客服部
57 54
 	KindEditor.ready(function(K) {
58 55
 		window.changeEditor = K.create('#feedBackCon'); //修改弹出框编辑器
@@ -208,14 +205,14 @@ function saveCustomer() {
208 205
 		});
209 206
 		return;
210 207
 	}
211
-	if($.trim($('#testInput1').val()) == '') {
208
+	if($.trim($('#testInput1_input').val()) == '') {
212 209
 		layer.confirm('请选择来电单位!', {
213 210
 			icon: 2,
214 211
 			btn: ['确定']
215 212
 		});
216 213
 		return;
217 214
 	}
218
-	if($.trim($('#testInput2').val()) == '') {
215
+	if($.trim($('#testInput2_input').val()) == '') {
219 216
 		layer.confirm('请选择反馈单位!', {
220 217
 			icon: 2,
221 218
 			btn: ['确定']
@@ -256,8 +253,8 @@ function saveCustomer() {
256 253
 			token: $.cookie("token"),
257 254
 			callCustomer: $('#name').val(), //姓名
258 255
 			tel: $('#tel').val(), //号码
259
-			lddep: $('#testInput1').val(), //来电单位
260
-			fkdep: $('#testInput2').val(), //反馈单位
256
+			lddep: $('#testInput1_input').val(), //来电单位
257
+			fkdep: $('#testInput2_input').val(), //反馈单位
261 258
 			gdly: $('#DicValueList').val(), //工单来源
262 259
 			gdlx: $('#typeclassId').val(), //工单类型id
263 260
 			gdzt: $('#State').val(), //工单状态id  
@@ -296,7 +293,7 @@ function saveMarket() {
296 293
 		});
297 294
 		return;
298 295
 	}
299
-	if($.trim($('#testInput3').val()) == '') {
296
+	if($.trim($('#testInput3_input').val()) == '') {
300 297
 		layer.confirm('请选择来电单位!', {
301 298
 			icon: 2,
302 299
 			btn: ['确定']
@@ -337,8 +334,8 @@ function clear() {
337 334
 	if(ns == 1) {
338 335
 		$('#name').val('');
339 336
 		$('#tel').val(''); //号码
340
-		$('#testInput1').val(''); //来电单位
341
-		$('#testInput2').val(''); //反馈单位
337
+		$('#testInput1_input').val(''); //来电单位
338
+		$('#testInput2_input').val(''); //反馈单位
342 339
 		$('#orderSource').val(''); //工单来源
343 340
 		$('#typeclassId').val(''); //工单类型id
344 341
 		$('#State').val(''); //工单状态id   
@@ -352,8 +349,8 @@ function clear() {
352 349
 	} else {
353 350
 		$('#name_market').val('');
354 351
 		$('#tel_market').val(''); //号码
355
-		$('#testInput3').val(''); //来电单位
356
-		$('#testInput4').val(''); //反馈单位
352
+		$('#testInput3_input').val(''); //来电单位
353
+		$('#testInput4_input').val(''); //反馈单位
357 354
 		$('#remark_market').val(''); //备注内容
358 355
 		marketEditor.html('');
359 356
 	}

+ 13 - 9
CallCenterWeb.UI/js/WorkOrder/WorkOrder.js

@@ -97,9 +97,11 @@
97 97
 		//										min: 0,
98 98
 		theme: '#1ab394',
99 99
 	});
100
-	getAccount()
101
-	//反馈单位
102
-	getAccounts()
100
+	getAccount();
101
+		$('#comeCall_dep').comboSelect();
102
+		$('#comeCall_deps').comboSelect();
103
+//	//反馈单位
104
+//	getAccounts()
103 105
 
104 106
 	function getAccount() {
105 107
 		$.ajax({
@@ -114,9 +116,11 @@
114 116
 				var Count = data.data.dep;
115 117
 				$(Count).each(function(i, n) {
116 118
 					$("<option value='" + n + "'>" + n + "</option>").appendTo($("#comeCall_dep"));
119
+					$("<option value='" + n + "'>" + n + "</option>").appendTo($("#comeCall_deps"));
117 120
 				})
118
-				$('#comeCall_dep').selectpicker('refresh');
119
-      			  $('#comeCall_dep').selectpicker('render');
121
+//				$('#comeCall_dep').selectpicker('refresh');
122
+      			$('#comeCall_dep').comboSelect();
123
+      			$('#comeCall_deps').comboSelect();
120 124
 
121 125
 			}
122 126
 		});
@@ -136,8 +140,8 @@
136 140
 				$(Count).each(function(i, n) {
137 141
 					$("<option value='" + n + "'>" + n + "</option>").appendTo($("#comeCall_deps"));
138 142
 				})
139
-				$('#comeCall_deps').selectpicker('refresh');
140
-				 $('#comeCall_deps').selectpicker('render');
143
+//				$('#comeCall_deps').selectpicker('refresh');
144
+					$('#comeCall_deps').comboSelect();
141 145
 			}
142 146
 		});
143 147
 	}
@@ -608,8 +612,8 @@ function remove(str, row) {
608 612
 	var typeclass = $('#typeclassId').val(); //工单类型
609 613
 	var starttime = $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[0]; //开始时间
610 614
 	var endtime = $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[1]; //结束时间
611
-	var lddep = $('#comeCall_dep').val(); //来电单位
612
-	var fkdep = $('#comeCall_deps').val(); //来电单位
615
+	var lddep = $('#comeCall_dep_input').val(); //来电单位
616
+	var fkdep = $('#comeCall_deps_input').val(); //来电单位
613 617
 	var userid = $('#userid').val(); //坐席
614 618
 	layer.confirm('确定删除当前记录?', {
615 619
 		btn: ['是', '否'] //按钮

+ 15 - 15
CallCenterWeb.UI/js/WorkOrder/xgWork.js

@@ -33,9 +33,9 @@ GDLY();
33 33
 	//工单类型
34 34
 	getOrderType();
35 35
 	//来电单位   
36
-	getAccount('#comeCall_dep');
36
+//	getAccount('#comeCall_dep');
37 37
 	//          getAccount('#comeCall_dep_market');
38
-	getAccount('#feedbackDep');
38
+//	getAccount('#feedbackDep');
39 39
 	//          getAccount('#feedbackDep_market');
40 40
 	//保存
41 41
 	$('.customerSubmit').click(function() {
@@ -128,10 +128,10 @@ $.ajax({
128 128
 			$("#tel_market").val(data.CustomerTel);
129 129
 			$("#tel").val(data.CustomerTel);
130 130
 			//
131
-			$("#testInput1").val(data.Address);
132
-			$("#testInput2").val(data.Source);
133
-			$("#testInput3").val(data.Address);
134
-			$("#testInput4").val(data.Source);
131
+			$("#testInput1_input").val(data.Address);
132
+			$("#testInput2_input").val(data.Source);
133
+			$("#testInput3_input").val(data.Address);
134
+			$("#testInput4_input").val(data.Source);
135 135
 			$("#typeclass").val(data.GDLXName);
136 136
 //			$("#feedBackCon").text(decodeURIComponent(data.Detail));
137 137
 			changeEditor.html(decodeURIComponent(data.Detail));			
@@ -234,8 +234,8 @@ function saveCustomer() {
234 234
 			token: $.cookie("token"),
235 235
 			orderid: id,
236 236
 			customer: $('#name').val(), //姓名
237
-			lddep: $('#testInput1').val(), //来电单位
238
-			fkdep: $('#testInput2').val(), //反馈单位
237
+			lddep: $('#testInput1_input').val(), //来电单位
238
+			fkdep: $('#testInput2_input').val(), //反馈单位
239 239
 			type: $('#DicValueList').val(), //工单来源
240 240
 			typeclass: $('#typeclassId').val(), //工单类型id
241 241
 			gdzt: $('#State').val(), //工单状态id   
@@ -274,7 +274,7 @@ function saveMarket() {
274 274
 		});
275 275
 		return;
276 276
 	}
277
-	if($('#testInput3').val() == '') {
277
+	if($('#testInput3_input').val() == '') {
278 278
 		layer.confirm('请选择来电单位!', {
279 279
 			icon: 2,
280 280
 			btn: ['确定']
@@ -291,8 +291,8 @@ function saveMarket() {
291 291
 			token: $.cookie("token"),
292 292
 			orderid: $("#CallID").val(),
293 293
 			customer: $('#name_market').val(), //姓名
294
-			lddep: $('#testInput3').val(), //来电单位
295
-			fkdep: $('#testInput4').val(), //反馈单位
294
+			lddep: $('#testInput3_input').val(), //来电单位
295
+			fkdep: $('#testInput4_input').val(), //反馈单位
296 296
 			detail:$('#remark_market').val(), //备注   
297 297
 		},
298 298
 		success: function(data) {
@@ -313,8 +313,8 @@ function clear() {
313 313
 	if(ns == 1) {
314 314
 		$('#name').val('');
315 315
 		$('#tel').val(''); //号码
316
-		$('#testInput1').val(''); //来电单位
317
-		$('#testInput2').val(''); //反馈单位
316
+		$('#testInput1_input').val(''); //来电单位
317
+		$('#testInput2_input').val(''); //反馈单位
318 318
 		$('#orderSource').val(''); //工单来源
319 319
 		$('#typeclassId').val(''); //工单类型id
320 320
 		$('#State').val(''); //工单状态id   
@@ -326,8 +326,8 @@ function clear() {
326 326
 	} else {
327 327
 		$('#name_market').val('');
328 328
 		$('#tel_market').val(''); //号码
329
-		$('#testInput3').val(''); //来电单位
330
-		$('#testInput4').val(''); //反馈单位
329
+		$('#testInput3_input').val(''); //来电单位
330
+		$('#testInput4_input').val(''); //反馈单位
331 331
 		changeMarket.html('') //反馈内容
332 332
 //		$('#remark_market').val(''); //备注内容
333 333
 	}

+ 189 - 0
CallCenterWeb.UI/js/comboSelect/combo.select.css

@@ -0,0 +1,189 @@
1
+/**
2
+ * Variables
3
+ */
4
+/**
5
+ * Wrapper
6
+ */
7
+.combo-select {
8
+ 	position: relative;
9
+    max-width: 400px;
10
+    /* margin-bottom: 15px; */
11
+    font: 100% Helvetica, Arial, Sans-serif;
12
+    border: 1px #e5e6e7 solid;
13
+    border-radius: 1px;
14
+  }
15
+  .combo-select .combo-input {
16
+    margin-bottom: 0; }
17
+
18
+/**
19
+ * Input field
20
+ */
21
+.combo-input {
22
+  -webkit-appearance: none;
23
+  -moz-appearance: none;
24
+  appearance: none;
25
+  margin: 0;
26
+  text-overflow: ellipsis;
27
+  white-space: nowrap;
28
+  border: none;
29
+  width: 100%;
30
+  box-sizing: border-box;
31
+  padding: 8px;
32
+  /*padding-right: 60px;*/
33
+  border-radius: 1px; 
34
+  }
35
+  .combo-input:focus {
36
+    outline: none; }
37
+
38
+/**
39
+ * Arrow
40
+ */
41
+.combo-arrow {
42
+  position: absolute;
43
+  right: 0;
44
+  top: 0;
45
+  height: 100%;
46
+  cursor: pointer;
47
+  text-align: center;
48
+  font-size: 14px;
49
+  width: 40px;
50
+  font-size: 12px;
51
+  color: #999999; }
52
+  .combo-arrow:before {
53
+    content: " ";
54
+    border-left: 5px solid transparent;
55
+    border-right: 5px solid transparent;
56
+    border-top: 5px solid #cccccc;
57
+    display: block;
58
+    width: 0;
59
+    height: 0;
60
+    top: 0;
61
+    right: 15px;
62
+    bottom: 0;
63
+    position: absolute;
64
+    margin: auto 0; }
65
+
66
+/**
67
+ * When opened
68
+ */
69
+.combo-open .combo-arrow {
70
+  border-color: #51A7E8; }
71
+  .combo-open .combo-arrow:before {
72
+    border-top: none;
73
+    border-bottom: 5px solid #cccccc; }
74
+
75
+/**
76
+ * When focused
77
+ */
78
+.combo-focus {
79
+  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
80
+  border-color: #51A7E8; }
81
+  .combo-focus input {
82
+    border-color: #51A7E8; 
83
+    }
84
+  .ld-sercon input.combo-input {
85
+    border-color: #51A7E8; 
86
+    width: 100%;
87
+    }
88
+
89
+/**
90
+ * Hide native select
91
+ */
92
+.combo-select select {
93
+  position: absolute;
94
+  z-index: 1;
95
+  left: 0;
96
+  top: 0;
97
+  width: 100%;
98
+  height: 100%;
99
+  -webkit-appearance: none;
100
+  opacity: 0; }
101
+
102
+@media only screen and (min-width: 960px) {
103
+  .combo-select select {
104
+    left: -1px;
105
+    top: -1px;
106
+    width: 0;
107
+    height: 0;
108
+    margin: 0; } }
109
+/**
110
+ * Selected option
111
+ */
112
+.option-selected {
113
+  background-color: #eee; }
114
+
115
+/**
116
+ * Hovered option
117
+ */
118
+.option-hover {
119
+  background-color: #006eab;
120
+  color: #fff; }
121
+
122
+/**
123
+ * Option item
124
+ */
125
+.option-item {
126
+  cursor: pointer;
127
+  /*border-bottom: 1px #e3e3e3 solid;*/ 
128
+  }
129
+  .option-item:hover {
130
+    background-color: #006eab;
131
+    color: #fff; }
132
+  .option-item:last-child {
133
+    border-bottom: none; }
134
+
135
+/**
136
+ * Disabled and optgroups
137
+ */
138
+.option-group {
139
+  cursor: text;
140
+  font-weight: 600;
141
+  background: #e1e1e1;
142
+  border: 1px #ccc solid;
143
+  border-width: 1px 0; }
144
+
145
+/**
146
+ * Disabled
147
+ */
148
+.option-disabled {
149
+  opacity: 0.5; }
150
+
151
+/**
152
+ * Dropdown
153
+ */
154
+.combo-dropdown {
155
+	  position: absolute;
156
+	  z-index: 1;
157
+	  top: 100%;
158
+	  left: 0;
159
+	  min-width: 100%;
160
+	  max-width: 300px;
161
+	  max-height: 300px;
162
+	  margin: 0;
163
+	  padding: 0;
164
+	  display: none;
165
+	  overflow-y: auto;
166
+	  background: #fff;
167
+	  border: 1px solid #e5e6e7;
168
+	  border-radius: 0;
169
+	  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
170
+	  box-sizing: border-box;
171
+  }
172
+  .combo-dropdown li {
173
+	    list-style: none;
174
+	    padding: 8px 1em;
175
+	    margin: 0;
176
+	    float: initial;
177
+    }
178
+
179
+/**
180
+ * On Active
181
+ */
182
+.combo-open .combo-dropdown {
183
+  display: block; }
184
+
185
+/**
186
+ * Search marker
187
+ */
188
+.combo-marker {
189
+  text-decoration: underline; }

+ 795 - 0
CallCenterWeb.UI/js/comboSelect/jquery.combo.select.js

@@ -0,0 +1,795 @@
1
+/*jshint asi:true, expr:true */
2
+/**
3
+ * Plugin Name: Combo Select
4
+ * Author : Vinay@Pebbleroad
5
+ * Date: 23/11/2014
6
+ * Description: 
7
+ * Converts a select box into a searchable and keyboard friendly interface. Fallbacks to native select on mobile and tablets
8
+ */
9
+
10
+// Expose plugin as an AMD module if AMD loader is present:
11
+(function (factory) {
12
+	'use strict';
13
+	if (typeof define === 'function' && define.amd) {
14
+		// AMD. Register as an anonymous module.
15
+		define(['jquery'], factory);
16
+	} else if (typeof exports === 'object' && typeof require === 'function') {
17
+		// Browserify
18
+		factory(require('jquery'));
19
+	} else {
20
+		// Browser globals
21
+		factory(jQuery);
22
+	}
23
+}(function ( $, undefined ) {
24
+
25
+	var pluginName = "comboSelect",
26
+		dataKey = 'comboselect';
27
+	var defaults = {			
28
+		comboClass         : 'combo-select',
29
+		comboArrowClass    : 'combo-arrow',
30
+		comboDropDownClass : 'combo-dropdown',
31
+		inputClass         : 'combo-input text-input',
32
+		disabledClass      : 'option-disabled',
33
+		hoverClass         : 'option-hover',
34
+		selectedClass      : 'option-selected',
35
+		markerClass        : 'combo-marker',
36
+		themeClass         : '',
37
+		maxHeight          : 200,
38
+		extendStyle        : true,
39
+		focusInput         : true
40
+	};
41
+	/**
42
+	 * Utility functions
43
+	 */
44
+
45
+	var keys = {
46
+		ESC: 27,
47
+		TAB: 9,
48
+		RETURN: 13,
49
+		LEFT: 37,
50
+		UP: 38,
51
+		RIGHT: 39,
52
+		DOWN: 40,
53
+		ENTER: 13,
54
+		SHIFT: 16
55
+	},	
56
+	isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
57
+
58
+	/**
59
+	 * Constructor
60
+	 * @param {[Node]} element [Select element]
61
+	 * @param {[Object]} options [Option object]
62
+	 */
63
+	function Plugin ( element, options ) {
64
+			
65
+		/* Name of the plugin */
66
+
67
+		this._name = pluginName;
68
+
69
+		/* Reverse lookup */
70
+
71
+		this.el = element
72
+
73
+		/* Element */
74
+
75
+		this.$el = $(element)
76
+
77
+		/* If multiple select: stop */
78
+		
79
+		if(this.$el.prop('multiple')) return;
80
+
81
+		/* Settings */
82
+
83
+		this.settings = $.extend( {}, defaults, options, this.$el.data() );
84
+
85
+		/* Defaults */
86
+
87
+		this._defaults = defaults;
88
+
89
+		/* Options */
90
+
91
+		this.$options = this.$el.find('option, optgroup')
92
+
93
+		/* Initialize */
94
+
95
+		this.init();
96
+
97
+		/* Instances */
98
+
99
+		$.fn[ pluginName ].instances.push(this);
100
+
101
+	}
102
+
103
+	$.extend(Plugin.prototype, {
104
+		init: function () {
105
+
106
+			/* Construct the comboselect */
107
+
108
+			this._construct();
109
+
110
+
111
+			/* Add event bindings */          
112
+
113
+			this._events();
114
+
115
+
116
+		},
117
+		_construct: function(){
118
+
119
+			var self = this
120
+
121
+			/**
122
+			 * Add negative TabIndex to `select`
123
+			 * Preserves previous tabindex
124
+			 */
125
+			
126
+			this.$el.data('plugin_'+ dataKey + '_tabindex', this.$el.prop('tabindex'))
127
+
128
+			/* Add a tab index for desktop browsers */
129
+
130
+			!isMobile && this.$el.prop("tabIndex", -1)
131
+
132
+			/**
133
+			 * Wrap the Select
134
+			 */
135
+
136
+			this.$container = this.$el.wrapAll('<div class="' + this.settings.comboClass + ' '+ this.settings.themeClass + '" />').parent();
137
+			
138
+			/**
139
+			 * Check if select has a width attribute
140
+			 */
141
+			if(this.settings.extendStyle && this.$el.attr('style')){
142
+
143
+				this.$container.attr('style', this.$el.attr("style"))
144
+			}
145
+			
146
+
147
+			/**
148
+			 * Append dropdown arrow
149
+			 */
150
+
151
+			this.$arrow = $('<div class="'+ this.settings.comboArrowClass+ '" />').appendTo(this.$container)
152
+
153
+
154
+			/**
155
+			 * Append dropdown
156
+			 */
157
+
158
+			this.$dropdown = $('<ul class="'+this.settings.comboDropDownClass+'" />').appendTo(this.$container)
159
+
160
+
161
+			/**
162
+			 * Create dropdown options
163
+			 */
164
+
165
+			var o = '', k = 0, p = '';
166
+
167
+			this.selectedIndex = this.$el.prop('selectedIndex')
168
+
169
+			this.$options.each(function(i, e){
170
+
171
+				if(e.nodeName.toLowerCase() == 'optgroup'){
172
+
173
+					return o+='<li class="option-group">'+this.label+'</li>'
174
+				}
175
+
176
+				if(!e.value) p = e.innerHTML
177
+
178
+				o+='<li class="'+(this.disabled? self.settings.disabledClass : "option-item") + ' ' +(k == self.selectedIndex? self.settings.selectedClass : '')+ '" data-index="'+(k)+'" data-value="'+this.value+'">'+ (this.innerHTML) + '</li>'
179
+
180
+				k++;
181
+			})
182
+
183
+			this.$dropdown.html(o)
184
+
185
+			/**
186
+			 * Items
187
+			 */
188
+
189
+			this.$items = this.$dropdown.children();
190
+
191
+
192
+			/**
193
+			 * Append Input
194
+			 */
195
+
196
+			this.$input = $('<input placeholder="请选择" type="text"' + (isMobile? 'tabindex="-1"': '') + ' value="'+p+'" class="'+ this.settings.inputClass + '" id="'+ this.$el.attr("id")+'_input">').appendTo(this.$container)
197
+
198
+			/* Update input text */  
199
+
200
+			this._updateInput()
201
+
202
+		},
203
+
204
+		_events: function(){
205
+
206
+			/* Input: focus */
207
+
208
+			this.$container.on('focus.input', 'input', $.proxy(this._focus, this))
209
+
210
+			/**
211
+			 * Input: mouseup
212
+			 * For input select() event to function correctly
213
+			 */
214
+			this.$container.on('mouseup.input', 'input', function(e){
215
+				e.preventDefault()
216
+			})
217
+
218
+			/* Input: blur */
219
+
220
+			this.$container.on('blur.input', 'input', $.proxy(this._blur, this))
221
+
222
+			/* Select: change */
223
+
224
+			this.$el.on('change.select', $.proxy(this._change, this))
225
+
226
+			/* Select: focus */
227
+
228
+			this.$el.on('focus.select', $.proxy(this._focus, this))
229
+
230
+			/* Select: blur */
231
+
232
+			this.$el.on('blur.select', $.proxy(this._blurSelect, this))
233
+
234
+			/* Dropdown Arrow: click */
235
+
236
+			this.$container.on('click.arrow', '.'+this.settings.comboArrowClass , $.proxy(this._toggle, this))
237
+
238
+			/* Dropdown: close */
239
+
240
+			this.$container.on('comboselect:close', $.proxy(this._close, this))
241
+
242
+			/* Dropdown: open */
243
+
244
+			this.$container.on('comboselect:open', $.proxy(this._open, this))
245
+
246
+
247
+			/* HTML Click */
248
+
249
+			$('html').off('click.comboselect').on('click.comboselect', function(){
250
+				
251
+				$.each($.fn[ pluginName ].instances, function(i, plugin){
252
+
253
+					plugin.$container.trigger('comboselect:close')
254
+
255
+				})
256
+			});
257
+
258
+			/* Stop `event:click` bubbling */
259
+
260
+			this.$container.on('click.comboselect', function(e){
261
+				e.stopPropagation();
262
+			})
263
+
264
+
265
+			/* Input: keydown */
266
+
267
+			this.$container.on('keydown', 'input', $.proxy(this._keydown, this))
268
+
269
+			/* Input: keyup */
270
+			
271
+			this.$container.on('keyup', 'input', $.proxy(this._keyup, this))
272
+
273
+			/* Dropdown item: click */
274
+
275
+			this.$container.on('click.item', '.option-item', $.proxy(this._select, this))
276
+
277
+		},
278
+
279
+		_keydown: function(event){
280
+
281
+			
282
+
283
+			switch(event.which){
284
+
285
+				case keys.UP:
286
+					this._move('up', event)
287
+					break;
288
+
289
+				case keys.DOWN:
290
+					this._move('down', event)
291
+					break;
292
+				
293
+				case keys.TAB:
294
+					this._enter(event)
295
+					break;
296
+
297
+				case keys.RIGHT:
298
+					this._autofill(event);
299
+					break;
300
+
301
+				case keys.ENTER:
302
+					this._enter(event);
303
+					break;
304
+
305
+				default:							
306
+					break;
307
+
308
+
309
+			}
310
+
311
+		},
312
+		
313
+
314
+		_keyup: function(event){
315
+			
316
+			switch(event.which){
317
+				case keys.ESC:													
318
+					this.$container.trigger('comboselect:close')
319
+					break;
320
+
321
+				case keys.ENTER:
322
+				case keys.UP:
323
+				case keys.DOWN:
324
+				case keys.LEFT:
325
+				case keys.RIGHT:
326
+				case keys.TAB:
327
+				case keys.SHIFT:							
328
+					break;
329
+				
330
+				default:							
331
+					this._filter(event.target.value)
332
+					break;
333
+			}
334
+		},
335
+		
336
+		_enter: function(event){
337
+
338
+			var item = this._getHovered()
339
+
340
+			item.length && this._select(item);
341
+
342
+			/* Check if it enter key */
343
+			if(event && event.which == keys.ENTER){
344
+
345
+				if(!item.length) {
346
+					
347
+					/* Check if its illegal value */
348
+
349
+					this._blur();
350
+
351
+					return true;
352
+				}
353
+
354
+				event.preventDefault();
355
+			}
356
+			
357
+
358
+		},
359
+		_move: function(dir){
360
+
361
+			var items = this._getVisible(),
362
+				current = this._getHovered(),
363
+				index = current.prevAll('.option-item').filter(':visible').length,
364
+				total = items.length
365
+
366
+			
367
+			switch(dir){
368
+				case 'up':
369
+					index--;
370
+					(index < 0) && (index = (total - 1));
371
+					break;
372
+
373
+				case 'down':							
374
+					index++;
375
+					(index >= total) && (index = 0);							
376
+					break;
377
+			}
378
+
379
+			
380
+			items
381
+				.removeClass(this.settings.hoverClass)
382
+				.eq(index)
383
+				.addClass(this.settings.hoverClass)
384
+
385
+
386
+			if(!this.opened) this.$container.trigger('comboselect:open');
387
+
388
+			this._fixScroll()
389
+		},
390
+
391
+		_select: function(event){
392
+
393
+			var item = event.currentTarget? $(event.currentTarget) : $(event);
394
+
395
+			if(!item.length) return;
396
+
397
+			/**
398
+			 * 1. get Index
399
+			 */
400
+			
401
+			var index = item.data('index');
402
+
403
+			this._selectByIndex(index);
404
+
405
+			this.$container.trigger('comboselect:close')					
406
+
407
+		},
408
+
409
+		_selectByIndex: function(index){
410
+
411
+			/**
412
+			 * Set selected index and trigger change
413
+			 * @type {[type]}
414
+			 */
415
+			if(typeof index == 'undefined'){
416
+				
417
+				index = 0
418
+
419
+			}
420
+			
421
+			if(this.$el.prop('selectedIndex') != index){
422
+
423
+				this.$el.prop('selectedIndex', index).trigger('change');
424
+			}
425
+
426
+		},
427
+
428
+		_autofill: function(){
429
+
430
+			var item = this._getHovered();
431
+
432
+			if(item.length){
433
+
434
+				var index = item.data('index')
435
+
436
+				this._selectByIndex(index)
437
+
438
+			}
439
+
440
+		},
441
+		
442
+
443
+		_filter: function(search){
444
+
445
+			var self = this,
446
+				items = this._getAll();
447
+				needle = $.trim(search).toLowerCase(),
448
+				reEscape = new RegExp('(\\' + ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\'].join('|\\') + ')', 'g'),
449
+				pattern = '(' + search.replace(reEscape, '\\$1') + ')';
450
+
451
+
452
+			/**
453
+			 * Unwrap all markers
454
+			 */
455
+			
456
+			$('.'+self.settings.markerClass, items).contents().unwrap();
457
+
458
+			/* Search */
459
+			
460
+			if(needle){
461
+
462
+				/* Hide Disabled and optgroups */
463
+
464
+				this.$items.filter('.option-group, .option-disabled').hide();
465
+				var thatThis=this;
466
+				
467
+				items							
468
+					.hide()
469
+					.filter(function(){
470
+
471
+						var $this = $(this),
472
+							text = $.trim($this.text()).toLowerCase();
473
+//						console.log($(this));
474
+						/* Found */
475
+						if(text.toString().indexOf(needle) != -1){
476
+																
477
+							/**
478
+							 * Wrap the selection
479
+							 */									
480
+							
481
+							$this
482
+								.html(function(index, oldhtml){
483
+								return oldhtml.replace(new RegExp(pattern, 'gi'), '<span class="'+self.settings.markerClass+'">$1</span>')
484
+							})									
485
+
486
+							return true
487
+						}
488
+					})
489
+					.show()
490
+			}else{
491
+
492
+								
493
+				this.$items.show();
494
+			}
495
+
496
+			/* Open the comboselect */
497
+
498
+			this.$container.trigger('comboselect:open')
499
+			
500
+
501
+		},
502
+
503
+		_highlight: function(){
504
+
505
+			/* 
506
+			1. Check if there is a selected item 
507
+			2. Add hover class to it
508
+			3. If not add hover class to first item
509
+			*/
510
+		
511
+			var visible = this._getVisible().removeClass(this.settings.hoverClass),
512
+				$selected = visible.filter('.'+this.settings.selectedClass)
513
+
514
+			if($selected.length){
515
+				
516
+				$selected.addClass(this.settings.hoverClass);
517
+
518
+			}else{
519
+
520
+				visible
521
+					.removeClass(this.settings.hoverClass)
522
+					.first()
523
+					.addClass(this.settings.hoverClass)
524
+			}
525
+
526
+		},
527
+
528
+		_updateInput: function(){
529
+
530
+			var selected = this.$el.prop('selectedIndex')
531
+//			console.log(this)
532
+			if(this.$el.val()){
533
+				
534
+				text = this.$el.find('option').eq(selected).text()
535
+
536
+				this.$input.val(text)
537
+
538
+			}else{
539
+				
540
+				this.$input.val('')
541
+//				this.$input.val(this.$el.find('option').eq(selected).text())
542
+
543
+			}
544
+
545
+			return this._getAll()
546
+				.removeClass(this.settings.selectedClass)
547
+				.filter(function(){
548
+
549
+					return $(this).data('index') == selected
550
+				})
551
+				.addClass(this.settings.selectedClass)
552
+		
553
+		},
554
+		_blurSelect: function(){
555
+
556
+			this.$container.removeClass('combo-focus');
557
+
558
+		},
559
+		_focus: function(event){
560
+			
561
+			/* Toggle focus class */
562
+
563
+			this.$container.toggleClass('combo-focus', !this.opened);
564
+
565
+			/* If mobile: stop */
566
+			
567
+			if(isMobile) return;
568
+
569
+			/* Open combo */
570
+
571
+			if(!this.opened) this.$container.trigger('comboselect:open');
572
+			
573
+			/* Select the input */
574
+			
575
+			this.settings.focusInput && event && event.currentTarget && event.currentTarget.nodeName == 'INPUT' && event.currentTarget.select()
576
+		},
577
+
578
+		_blur: function(){
579
+
580
+			/**
581
+			 * 1. Get hovered item
582
+			 * 2. If not check if input value == select option
583
+			 * 3. If none
584
+			 */
585
+			
586
+			var val = $.trim(this.$input.val().toLowerCase()),
587
+				isNumber = !isNaN(val);
588
+			
589
+			var index = this.$options.filter(function(){
590
+				
591
+				if(isNumber){
592
+					return parseInt($.trim(this.innerHTML).toLowerCase()) == val
593
+				}
594
+
595
+				return $.trim(this.innerHTML).toLowerCase() == val
596
+
597
+			}).prop('index')
598
+		
599
+			/* Select by Index */
600
+						
601
+			this._selectByIndex(index)
602
+			
603
+		},
604
+
605
+		_change: function(){
606
+
607
+
608
+			this._updateInput();
609
+
610
+		},
611
+
612
+		_getAll: function(){
613
+
614
+			return this.$items.filter('.option-item')
615
+
616
+		},
617
+		_getVisible: function(){
618
+
619
+			return this.$items.filter('.option-item').filter(':visible')
620
+
621
+		},
622
+
623
+		_getHovered: function(){
624
+
625
+			return this._getVisible().filter('.' + this.settings.hoverClass);
626
+
627
+		},
628
+
629
+		_open: function(){
630
+
631
+			var self = this
632
+
633
+			this.$container.addClass('combo-open')			
634
+
635
+			this.opened = true
636
+			
637
+			/* Focus input field */			
638
+
639
+			this.settings.focusInput && setTimeout(function(){ !self.$input.is(':focus') && self.$input.focus(); });
640
+
641
+			/* Highligh the items */
642
+
643
+			this._highlight()
644
+
645
+			/* Fix scroll */
646
+
647
+			this._fixScroll()
648
+
649
+			/* Close all others */
650
+
651
+
652
+			$.each($.fn[ pluginName ].instances, function(i, plugin){
653
+
654
+				if(plugin != self && plugin.opened) plugin.$container.trigger('comboselect:close')
655
+			})
656
+
657
+		},
658
+
659
+		_toggle: function(){
660
+
661
+			this.opened? this._close.call(this) : this._open.call(this)
662
+		},
663
+
664
+		_close: function(){				
665
+
666
+			this.$container.removeClass('combo-open combo-focus')
667
+
668
+			this.$container.trigger('comboselect:closed')
669
+
670
+			this.opened = false
671
+
672
+			/* Show all items */
673
+
674
+			this.$items.show();
675
+
676
+		},
677
+		_fixScroll: function(){
678
+	
679
+			/**
680
+			 * If dropdown is hidden
681
+			 */
682
+			if(this.$dropdown.is(':hidden')) return;
683
+
684
+			
685
+			/**
686
+			 * Else					 
687
+			 */
688
+			var item = this._getHovered();
689
+
690
+			if(!item.length) return;					
691
+
692
+			/**
693
+			 * Scroll
694
+			 */
695
+			
696
+			var offsetTop,
697
+				upperBound,
698
+				lowerBound,
699
+				heightDelta = item.outerHeight()
700
+
701
+			offsetTop = item[0].offsetTop;
702
+			
703
+			upperBound = this.$dropdown.scrollTop();
704
+
705
+			lowerBound = upperBound + this.settings.maxHeight - heightDelta;
706
+			
707
+			if (offsetTop < upperBound) {
708
+					
709
+				this.$dropdown.scrollTop(offsetTop);
710
+
711
+			} else if (offsetTop > lowerBound) {
712
+					
713
+				this.$dropdown.scrollTop(offsetTop - this.settings.maxHeight + heightDelta);
714
+			}
715
+
716
+		},
717
+		/**
718
+		 * Destroy API
719
+		 */
720
+		
721
+		dispose: function(){
722
+
723
+			/* Remove combo arrow, input, dropdown */
724
+
725
+			this.$arrow.remove()
726
+
727
+			this.$input.remove()
728
+
729
+			this.$dropdown.remove()
730
+
731
+			/* Remove tabindex property */
732
+			this.$el
733
+				.removeAttr("tabindex")
734
+
735
+			/* Check if there is a tabindex set before */
736
+
737
+			if(!!this.$el.data('plugin_'+ dataKey + '_tabindex')){
738
+				this.$el.prop('tabindex', this.$el.data('plugin_'+ dataKey + '_tabindex'))
739
+			}
740
+
741
+			/* Unwrap */
742
+
743
+			this.$el.unwrap()
744
+
745
+			/* Remove data */
746
+
747
+			this.$el.removeData('plugin_'+dataKey)
748
+
749
+			/* Remove tabindex data */
750
+
751
+			this.$el.removeData('plugin_'+dataKey + '_tabindex')
752
+
753
+			/* Remove change event on select */
754
+
755
+			this.$el.off('change.select focus.select blur.select');
756
+
757
+		}	
758
+	});
759
+
760
+
761
+
762
+	// A really lightweight plugin wrapper around the constructor,
763
+	// preventing against multiple instantiations
764
+	$.fn[ pluginName ] = function ( options, args ) {
765
+
766
+		this.each(function() {
767
+
768
+			var $e = $(this),
769
+				instance = $e.data('plugin_'+dataKey)
770
+
771
+			if (typeof options === 'string') {
772
+				
773
+				if (instance && typeof instance[options] === 'function') {
774
+						instance[options](args);
775
+				}
776
+
777
+			}else{
778
+
779
+				if (instance && instance.dispose) {
780
+						instance.dispose();
781
+				}
782
+
783
+				$.data( this, "plugin_" + dataKey, new Plugin( this, options ) );
784
+
785
+			}
786
+
787
+		});
788
+
789
+		// chain jQuery functions
790
+		return this;
791
+	};
792
+
793
+	$.fn[ pluginName ].instances = [];
794
+
795
+}));