Parcourir la Source

修改来电弹屏,客户信息增加来电弹屏

fanlongfei il y a 7 ans
Parent
commit
82bbfce72f

+ 10 - 0
CallCenterWeb.UI/Script/Common/huayi.http.js

@@ -356,6 +356,16 @@ helper.filter = {
356 356
 		}
357 357
 		return content;
358 358
 	},
359
+	//电话号码截取前三位和后四位
360
+	cutTel: function(val){
361
+		var str = '';
362
+		if(val){
363
+			var val1 = val.substring(0, 3);
364
+			var val2 = val.substr(-4);
365
+			str = val1 + '****' + val2;
366
+		}
367
+		return str;
368
+	}
359 369
 
360 370
 };
361 371
 

+ 127 - 109
CallCenterWeb.UI/callScreen/call.js

@@ -12,16 +12,16 @@ var timestamp = Date.parse(new Date());
12 12
 var timer, n = 0;
13 13
 
14 14
 //测试数据
15
-//var phoneNumber = "15235457489";
16
-//var CallID = "148";
15
+var phoneNumber = "15235457489";
16
+var CallID = "148";
17 17
 
18 18
 $(function() {
19 19
 	//初始化一些数据
20 20
 	$(".hidCallID").val(CallID);
21 21
 
22
-	$(".tel").text(phoneNumber); //左侧来电号码
23
-	$("#head_form_tel").val(phoneNumber); //左侧电话
24
-	$("#order_tel").val(phoneNumber); //右侧工单电话
22
+	$(".tel").text(helper.filter.cutTel(phoneNumber)); //左侧来电号码
23
+	// $("#head_form_tel").val(phoneNumber); //左侧电话
24
+	// $("#order_tel").val(phoneNumber); //右侧工单电话
25 25
 
26 26
 	$(".ldtime").text(top.getNowFormatDate()); //左侧来电时间
27 27
 	$(".thsc").text("00:00"); //通话时间
@@ -56,34 +56,35 @@ $(function() {
56 56
 	if(phoneNumber) {
57 57
 		getPhoneLocation(); //获取来电归属地
58 58
 		// 区域 项目 期号三级联动
59
-		helper.getDropList.getProLocations($('#head_form_rengin'), $('#head_form_pro'), $('#head_form_floor'));
60
-		helper.getDropList.getProLocations($('#order_rengin'), $('#order_pro'), $('#order_floor'));
61
-
62
-		$('#head_form_rengin').on('change', function() {
63
-			//清空房间号
64
-			if($('#head_form_room_select')) {
65
-				$('#head_form_room_select').empty();
66
-				$('#head_form_room_input').show().siblings('.bootstrap-select').hide();
67
-			}
68
-		});
69
-		$('#head_form_pro').on('change', function() {
70
-			//清空房间号
71
-			if($('#head_form_room_select')) {
72
-				$('#head_form_room_select').empty();
73
-				$('#head_form_room_input').show().siblings('.bootstrap-select').hide();
74
-			}
75
-		});
59
+		// helper.getDropList.getProLocations($('#head_form_rengin'), $('#head_form_pro'), $('#head_form_floor'));
60
+		// helper.getDropList.getProLocations($('#order_rengin'), $('#order_pro'), $('#order_floor'));
61
+// 		$('#head_form_rengin').on('change', function() {
62
+// 			//清空房间号
63
+// 			if($('#head_form_room_select')) {
64
+// 				$('#head_form_room_select').empty();
65
+// 				$('#head_form_room_input').show().siblings('.bootstrap-select').hide();
66
+// 			}
67
+// 		});
68
+// 		$('#head_form_pro').on('change', function() {
69
+// 			//清空房间号
70
+// 			if($('#head_form_room_select')) {
71
+// 				$('#head_form_room_select').empty();
72
+// 				$('#head_form_room_input').show().siblings('.bootstrap-select').hide();
73
+// 			}
74
+// 		});
76 75
 
77 76
 		//监听期号的改变 获取房间号 下拉或输入框
78
-		$('#head_form_floor').on('change', getRoomNumber);
79
-
80
-		getCustomerLists(1); //获取来电客户信息
77
+		// $('#head_form_floor').on('change', getRoomNumber);
78
+		getCustomer(); //获取来电客户信息
81 79
 	}
80
+	//根据关键词搜索公司 
81
+	$('#companySearch').on('click', getSearchCustomer);
82 82
 
83 83
 	//保存来电客户信息
84 84
 	$('#head_form_btn_save').on('click', headFormSave);
85
+	
85 86
 	//清空来电客户信息
86
-	$('#head_form_btn_reset').on('click', headFormReset);
87
+	// $('#head_form_btn_reset').on('click', headFormReset);
87 88
 
88 89
 	//点击IVR
89 90
 	$('#head_black_ivr').click(function() {
@@ -251,22 +252,80 @@ function getPhoneLocation() {
251 252
 	});
252 253
 }
253 254
 
255
+//根据关键词搜索公司 
256
+function getSearchCustomer() {
257
+	$.ajax({
258
+		url: huayi.config.callcenter_url + 'CustomerNew/GetListByKey',
259
+		type: 'get',
260
+		data: {
261
+			keywords: $('#head_form_search').val(),// 关键词
262
+			token: $.cookie("token")
263
+		},
264
+		dataType: "json",
265
+		async: true,
266
+		success: function(data) {
267
+			if(data.state.toLowerCase() === 'success') {
268
+				var customerBase = data.data;
269
+				if(customerBase){
270
+					$('#head_form_cmpname').val(customerBase.F_CompanyName);//公司名称
271
+					$('#head_form_cmpaddress').val(customerBase.F_CompanyAddress);//公司地址
272
+					$('#head_form_legname').val(customerBase.F_LegalName);//法人姓名
273
+					$('#head_form_legtel').val(helper.filter.cutTel(customerBase.F_LegalTel));//法人电话
274
+					$('#head_form_subtrade').val(customerBase.F_SubTrade);//所属行业
275
+					//获取对应的联系人信息
276
+					getCustomerLists(1, customerBase.F_CustomerId);
277
+				}
278
+			}
279
+		},
280
+	});
281
+}
282
+
254 283
 /**
255 284
  * 根据电话获取 客户信息
285
+ * */
286
+ function getCustomer(){
287
+	$.ajax({
288
+		url: huayi.config.callcenter_url + 'CustomerNew/GetCustomerByTel',
289
+		type: 'get',
290
+		data: {
291
+			tel: phoneNumber, //否	string	来电电话 例如:13663801989
292
+			token: $.cookie("token")
293
+		},
294
+		dataType: "json",
295
+		async: true,
296
+		success: function(data) {
297
+			if(data.state.toLowerCase() === 'success') {
298
+				var customerBase = data.data.CustomerBase;
299
+				if(customerBase){
300
+					$('#head_form_customer_id').val(customerBase.F_CustomerId); //客户id
301
+					$('#head_form_cmpname').val(customerBase.F_CompanyName);//公司名称
302
+					$('#head_form_cmpaddress').val(customerBase.F_CompanyAddress);//公司地址
303
+					$('#head_form_legname').val(customerBase.F_LegalName);//法人姓名
304
+					$('#head_form_legtel').val(helper.filter.cutTel(customerBase.F_LegalTel));//法人电话
305
+					$('#head_form_subtrade').val(customerBase.F_SubTrade);//所属行业
306
+					//获取对应的联系人信息
307
+					getCustomerLists(1, customerBase.F_CustomerId);
308
+				}
309
+			}
310
+		},
311
+	}); 
312
+ }
313
+ 
314
+/**
315
+ * 根据电话获取 客户联系人列表
256 316
  * paramPage: 页数请求的是第几页
317
+ * cid: 客户的id
257 318
  * */
258
-function getCustomerLists(paramPage) {
319
+function getCustomerLists(paramPage, cid) {
259 320
 	$('#head_customer_info').html('');
260 321
 	$.ajax({
261
-		url: huayi.config.callcenter_url + 'Customer/GetCustomerListByTel',
322
+		url: huayi.config.callcenter_url + 'CustomerNew/GetConList',
262 323
 		type: 'get',
263 324
 		data: {
264
-			page: paramPage, //第几页
325
+			cusid: cid, //客户id
326
+			pageindex: paramPage, //第几页
265 327
 			pagesize: 2,
266 328
 			tel: phoneNumber, //否	string	来电电话 例如:13663801989
267
-			//areaid: ,	//否	int	区域id
268
-			//categoryid	,//否	int	所购项目id
269
-			//buldingid	,//否	int	期号
270 329
 			token: $.cookie("token")
271 330
 		},
272 331
 		dataType: "json",
@@ -282,39 +341,38 @@ function getCustomerLists(paramPage) {
282 341
 						'<div class="head_customer_info_item_l pull-left">' +
283 342
 						'<p class="clearfix">' +
284 343
 						'<span>姓名</span>' +
285
-						'<span>' + tableDatas[i].F_CustomerName + '</span>' +
286
-						'<span class="pull-right">' + tableDatas[i].F_Mobile + '</span>' +
344
+						'<span>' + tableDatas[i].F_Name + '</span>' +
287 345
 						'</p>' +
288 346
 						'<p>' +
289
-						'<span>项目</span>' +
290
-						//tableDatas[i].areaname 区域
291
-						'<span>' + tableDatas[i].regionname + ' ' + tableDatas[i].buldingname + '</span>' +
347
+						'<span>电话</span>' +
348
+						'<span>' + helper.filter.cutTel(tableDatas[i].F_Telephone) + '</span>' +
292 349
 						'</p>' +
293 350
 						'<p>' +
294
-						'<span>房间</span>' +
295
-						'<span>' + tableDatas[i].F_BusinessLicenseID + '</span>' +
351
+						'<span>是否主要联系人</span>' +
352
+						'<span>' + (tableDatas[i].F_IsMain === true ? '是' : '否') + '</span>' +
296 353
 						'</p>' +
297 354
 						'</div>' +
298
-						'<div class="head_customer_info_item_r pull-left" id="customerBtn_' + i + '">选择' +
355
+						'<div class="head_customer_info_item_r pull-left" id="customerBtn_' + i + '">'+
356
+						// '选择' +
299 357
 						'</div>' +
300 358
 						'</div>'
301 359
 					$('#head_customer_info').append(itmeHtml);
302
-					$('#customerBtn_' + i).on('click', function() {
303
-						if($(this).parent().hasClass('head_customer_info_item_active')) {
304
-							//点击取消
305
-							$(this).parent().removeClass('head_customer_info_item_active');
306
-							$(this).text('选择');
307
-							//清空 head_form
308
-							headFormClean();
309
-						} else {
310
-							//点击选择
311
-							$(this).parent().addClass('head_customer_info_item_active').siblings().removeClass('head_customer_info_item_active');
312
-							$(this).text('取消');
313
-							$(this).parent().siblings().find('.head_customer_info_item_r').text('选择');
314
-							//给 head_form 赋值
315
-							setHeadForm(tableDatas, $(this).attr('id').split('customerBtn_')[1]);
316
-						}
317
-					});
360
+// 					$('#customerBtn_' + i).on('click', function() {
361
+// 						if($(this).parent().hasClass('head_customer_info_item_active')) {
362
+// 							//点击取消
363
+// 							$(this).parent().removeClass('head_customer_info_item_active');
364
+// 							$(this).text('选择');
365
+// 							//清空 head_form
366
+// 							headFormClean();
367
+// 						} else {
368
+// 							//点击选择
369
+// 							$(this).parent().addClass('head_customer_info_item_active').siblings().removeClass('head_customer_info_item_active');
370
+// 							$(this).text('取消');
371
+// 							$(this).parent().siblings().find('.head_customer_info_item_r').text('选择');
372
+// 							//给 head_form 赋值
373
+// 							setHeadForm(tableDatas, $(this).attr('id').split('customerBtn_')[1]);
374
+// 						}
375
+// 					});
318 376
 				}
319 377
 				if(tableDatasLength > 0) {
320 378
 					$.jqPaginator('#pagination', {
@@ -333,7 +391,7 @@ function getCustomerLists(paramPage) {
333 391
 							}
334 392
 						}
335 393
 					});
336
-					$('#customerBtn_0').trigger('click');
394
+					// $('#customerBtn_0').trigger('click');
337 395
 				} else {
338 396
 					$('.head_customer_info_title').hide();
339 397
 				}
@@ -401,7 +459,6 @@ function headFormClean() {
401 459
 
402 460
 //保存来电客户信息
403 461
 function headFormSave() {
404
-	var roomNum;
405 462
 	if(!$.trim($('#head_form_name').val())) {
406 463
 		layer.confirm('请输入姓名!', {
407 464
 			icon: 2,
@@ -409,61 +466,22 @@ function headFormSave() {
409 466
 		});
410 467
 		return;
411 468
 	}
412
-	if(!regexs.phone.test($.trim($('#head_form_tel').val()))) {
413
-		layer.confirm('请输入正确的电话!', {
414
-			icon: 2,
415
-			btn: ['确定']
416
-		});
417
-		return;
418
-	}
419
-	
420
-	if($('#head_form_pro').val() === '0') {
421
-		layer.confirm('请选择项目!', {
422
-			icon: 2,
423
-			btn: ['确定']
424
-		});
425
-		return;
426
-	}
469
+// 	if(!regexs.phone.test($.trim($('#head_form_tel').val()))) {
470
+// 		layer.confirm('请输入正确的电话!', {
471
+// 			icon: 2,
472
+// 			btn: ['确定']
473
+// 		});
474
+// 		return;
475
+// 	}
427 476
 	
428
-	if($('#head_form_room_input').is(':visible')) {
429
-		roomNum = $('#head_form_room_input').val();
430
-	} else {
431
-		roomNum = $('#head_form_room_select').val();
432
-	}
433
-	$.post(huayi.config.callcenter_url + 'Customer/AddCustomer', {
434
-		F_CustomerId: $('#head_form_customer_id').val(), //是	string	id
435
-		F_CustomerName: $('#head_form_name').val(), //	是	string	姓名/联系人
436
-		F_Mobile: $('#head_form_tel').val(), //否	string	手机号码
437
-		F_Layer: $('#head_form_rengin').val(), //否	string 区域id
438
-		F_CategoryId: $('#head_form_pro').val(), //否	string	所购项目id
439
-		F_CustomerType: $('#head_form_floor').val(), //否	string	期号id
440
-		F_CustomerNature: $('#head_form_buildingnum').val(),    //楼号
441
-		F_CustomerClass: $('#head_form_unitnum').val(),    //单元号
442
-		F_BusinessLicenseID: roomNum, //否	string	所购楼层信息 (房间号)
477
+	$.post(huayi.config.callcenter_url + 'CustomerNew/AddContact', {
478
+		F_CustomerId: $('#head_form_customer_id').val(),// int客户id
479
+		F_Name: $('#head_form_name').val(),//string 联系人姓名
480
+		F_Telephone: phoneNumber,// string电话
443 481
 		token: $.cookie("token")
444 482
 	}, function(result) {
445 483
 		result = $.parseJSON(result);
446
-		if(result.state.toLowerCase() == "success") {
447
-			$('#head_form_customer_id').val(result.data.F_CustomerId); //客户id
448
-			//进入历史工单 新增工单页面
449
-			//$('.ld-service').find('li.KF').trigger('click');
450
-			//赋值
451
-			$('#order_name').val($('#head_form_name').val()); //客户姓名
452
-			$('#order_tel').val($('#head_form_tel').val()); //电话
453
-			$('#order_rengin').selectpicker('val', $('#head_form_rengin').val()).trigger('change'); //区域
454
-			$('#order_pro').selectpicker('val', $('#head_form_pro').val()).trigger('change'); //项目
455
-			$('#order_floor').selectpicker('val', $('#head_form_floor').val()).trigger('change'); //期号
456
-			$('#order_buildingnum').val($('#head_form_buildingnum').val());    //楼号
457
-			$('#order_unitnum').val($('#head_form_unitnum').val());   //单元号
458
-			
459
-			if($("#head_form_room_select").is(":hidden")) {
460
-				$('#order_room').val($('#head_form_room_input').val()); //房间号
461
-			} else {
462
-				$('#order_room').val($('#head_form_room_select').val()); //房间号
463
-			}
464
-			//获取业主信息
465
-			getOwnerInformation();
466
-
484
+		if(result.state.toLowerCase() === "success") {
467 485
 			layer.msg("保存成功");
468 486
 		}
469 487
 	})

+ 40 - 9
CallCenterWeb.UI/callScreen/callScreen.html

@@ -84,18 +84,49 @@
84 84
 						<div class="head_form form-horizontal">
85 85
 							<div class="form-group">
86 86
 								<input type="hidden" id="head_form_customer_id" value="" />
87
+								<label for="head_form_search" class="col-sm-4 control-label">搜索</label>
88
+								<div class="col-sm-8">
89
+									<input type="text" class="form-control" id="head_form_search" placeholder="请输入公司名称">
90
+									<span id="companySearch" class="glyphicon glyphicon-search company_search" aria-hidden="true"></span>
91
+								</div>
92
+							</div>
93
+							<div class="form-group">
87 94
 								<label for="head_form_name" class="col-sm-4 control-label">姓名</label>
88 95
 								<div class="col-sm-8">
89 96
 									<input type="text" class="form-control" id="head_form_name" placeholder="请输入姓名">
90 97
 								</div>
91 98
 							</div>
92 99
 							<div class="form-group">
93
-								<label for="head_form_tel" class="col-sm-4 control-label">电话</label>
100
+								<label for="head_form_cmpname" class="col-sm-4 control-label">公司名称</label>
101
+								<div class="col-sm-8">
102
+									<input readonly type="text" class="form-control" id="head_form_cmpname" placeholder="">
103
+								</div>
104
+							</div>
105
+							<div class="form-group">
106
+								<label for="head_form_cmpaddress" class="col-sm-4 control-label">公司地址</label>
107
+								<div class="col-sm-8">
108
+									<input readonly type="text" class="form-control" id="head_form_cmpaddress" placeholder="">
109
+								</div>
110
+							</div>
111
+							<div class="form-group">
112
+								<label for="head_form_legname" class="col-sm-4 control-label">法人姓名</label>
113
+								<div class="col-sm-8">
114
+									<input readonly type="text" class="form-control" id="head_form_legname" placeholder="">
115
+								</div>
116
+							</div>
117
+							<div class="form-group">
118
+								<label for="head_form_legtel" class="col-sm-4 control-label">法人电话</label>
94 119
 								<div class="col-sm-8">
95
-									<input type="text" class="form-control" id="head_form_tel" placeholder="请输入电话">
120
+									<input readonly type="text" class="form-control" id="head_form_legtel" placeholder="">
96 121
 								</div>
97 122
 							</div>
98 123
 							<div class="form-group">
124
+								<label for="head_form_subtrade" class="col-sm-4 control-label">所属行业</label>
125
+								<div class="col-sm-8">
126
+									<input readonly type="text" class="form-control" id="head_form_subtrade" placeholder="">
127
+								</div>
128
+							</div>
129
+							<!-- <div class="form-group">
99 130
 								<label for="head_form_rengin" class="col-sm-4 control-label">区域</label>
100 131
 								<div class="col-sm-8">
101 132
 									<select class="form-control selectpicker" id="head_form_rengin" data-live-search="true">
@@ -140,7 +171,7 @@
140 171
 
141 172
 									</select>
142 173
 								</div>
143
-							</div>
174
+							</div> -->
144 175
 							<div class="form-group">
145 176
 								<label for="" class="col-sm-4 control-label">来电时间</label>
146 177
 								<div class="col-sm-8">
@@ -148,18 +179,18 @@
148 179
 								</div>
149 180
 							</div>
150 181
 							<div class="form-group text-center head_form_btn_save">
151
-								<span id="head_form_btn_reset">清空</span>
152
-								<span id="head_form_btn_save">保存</span>
182
+								<!-- <span id="head_form_btn_reset">清空</span> -->
183
+								<span id="head_form_btn_save">保存联系人</span>
153 184
 							</div>
154 185
 						</div>
155 186
 
156 187
 						<div class="head_customer_info clearfix">
157 188
 							<div class="head_customer_info_title clearfix">
158
-								<span class="info_title pull-left">相关客户信息</span>
189
+								<span class="info_title pull-left">相关联系人信息</span>
159 190
 								<ul class="pagination pull-right" id="pagination"></ul>
160 191
 							</div>
161 192
 							<div class="head_customer_info_lists" id="head_customer_info">
162
-								<!--<div class="head_customer_info_item clearfix">
193
+								<!-- <div class="head_customer_info_item clearfix">
163 194
 									<div class="head_customer_info_item_l pull-left">
164 195
 										<p class="clearfix">
165 196
 											<span>姓名</span>
@@ -199,8 +230,8 @@
199 230
 									<div class="head_customer_info_item_r pull-left">
200 231
 										<span>添加</span>
201 232
 									</div>
202
-								</div>
203
-							-->
233
+								</div> -->
234
+							
204 235
 							</div>
205 236
 							<div class="pull-right" id="page_number"></div>
206 237
 						</div>

+ 23 - 11
CallCenterWeb.UI/callScreen/css/call.css

@@ -21,7 +21,7 @@ a {
21 21
 }
22 22
 
23 23
 .form-control:-ms-input-placeholder {
24
-	color: #999!important;
24
+	color: #999 !important;
25 25
 }
26 26
 
27 27
 .ldtp-con {
@@ -259,7 +259,7 @@ a {
259 259
 }
260 260
 
261 261
 .head_form .form-group .form-control:focus {
262
-	border-color: transparent!important;
262
+	border-color: transparent !important;
263 263
 }
264 264
 
265 265
 .head_form .btn-default {
@@ -277,18 +277,18 @@ a {
277 277
 }
278 278
 
279 279
 .head_form .bootstrap-select .dropdown-toggle:focus {
280
-	outline: none!important;
280
+	outline: none !important;
281 281
 	outline-offset: 0;
282 282
 }
283 283
 
284 284
 .head_form .dropdown-menu .bs-searchbox .form-control {
285
-	background-color: #fff!important;
286
-	border-color: #ccc!important;
285
+	background-color: #fff !important;
286
+	border-color: #ccc !important;
287 287
 	color: #555;
288 288
 }
289 289
 
290 290
 .head_form .dropdown-menu .bs-searchbox .form-control:focus {
291
-	border-color: #1ab394!important;
291
+	border-color: #1ab394 !important;
292 292
 }
293 293
 
294 294
 .head_form .bootstrap-select.btn-group .dropdown-menu li a {
@@ -297,7 +297,7 @@ a {
297 297
 }
298 298
 
299 299
 .head_form .dropdown-menu>.active>a {
300
-	color: #fff!important;
300
+	color: #fff !important;
301 301
 }
302 302
 
303 303
 .ldtime {
@@ -707,7 +707,7 @@ a {
707 707
 }
708 708
 
709 709
 .hides {
710
-	display: none!important;
710
+	display: none !important;
711 711
 }
712 712
 
713 713
 .hei-list .bacha:hover {
@@ -715,7 +715,7 @@ a {
715 715
 }
716 716
 
717 717
 .ke-container {
718
-	width: 70%!important;
718
+	width: 70% !important;
719 719
 }
720 720
 
721 721
 body,
@@ -1155,7 +1155,7 @@ html,
1155 1155
 }
1156 1156
 
1157 1157
 .baseInfo .form-control[readonly]:focus {
1158
-	border-color: #e5e6e7!important;
1158
+	border-color: #e5e6e7 !important;
1159 1159
 }
1160 1160
 
1161 1161
 .audit_wait {
@@ -1170,7 +1170,16 @@ html,
1170 1170
 	color: #5ccb91;
1171 1171
 }
1172 1172
 
1173
+.company_search {
1174
+	position: absolute;
1175
+	right: 8px;
1176
+	top: 8px;
1177
+	cursor: pointer;
1178
+}
1179
+
1180
+
1173 1181
 @media (max-width: 1680px) {
1182
+
1174 1183
 	.head_time,
1175 1184
 	.head_black,
1176 1185
 	.head_tel,
@@ -1183,6 +1192,7 @@ html,
1183 1192
 	.head_customer_info_item_l {
1184 1193
 		height: 110px;
1185 1194
 	}
1195
+
1186 1196
 	.head_customer_info_item_r {
1187 1197
 		height: 110px;
1188 1198
 		line-height: 110px;
@@ -1193,6 +1203,7 @@ html,
1193 1203
 	.head_customer_info_item_l {
1194 1204
 		height: 128px;
1195 1205
 	}
1206
+
1196 1207
 	.head_customer_info_item_r {
1197 1208
 		height: 128px;
1198 1209
 		line-height: 128px;
@@ -1203,6 +1214,7 @@ html,
1203 1214
 	.head_customer_info_item_l {
1204 1215
 		height: 128px;
1205 1216
 	}
1217
+
1206 1218
 	.head_customer_info_item_r {
1207 1219
 		height: 128px;
1208 1220
 		line-height: normal;
@@ -1214,4 +1226,4 @@ html,
1214 1226
 	.order_form .form-inline .form-control {
1215 1227
 		width: 50%;
1216 1228
 	}
1217
-}
1229
+}

BIN
CallCenterWeb.UI/commonTpl/CustomerList_Excel.xls


+ 7 - 8
CallCenterWeb.UI/commonTpl/addOrEditCusInfo.html

@@ -10,7 +10,6 @@
10 10
 		<script src="../Script/Common/huayi.load.js"></script>
11 11
 		<script src="../Script/Common/huayi.config.js"></script>
12 12
 		<link rel="stylesheet" href="../css/customer.css" />
13
-
14 13
 	</head>
15 14
 
16 15
 	<body>
@@ -18,12 +17,12 @@
18 17
 			<div class="tab_contents" id="tab_user_contents">
19 18
 				<ul class="project_items form-horizontal showtabs">
20 19
 					<h3 class="col-md-12 project_items_title">基本信息</h3>
21
-					<li class="form-group">
20
+	<!-- 				<li class="form-group">
22 21
 						<label for="customer_key" class="col-md-2"><b class="text_require">*</b>关键词</label>
23 22
 						<div class="col-md-9">
24 23
 							<input id="customer_key" class="form-control" type="text" autocomplete="off" placeholder="请输入关键词" />
25 24
 						</div>
26
-					</li>
25
+					</li> -->
27 26
 					<li class="form-group">
28 27
 						<label for="customer_code" class="col-md-2"><b class="text_require">*</b>客户编号</label>
29 28
 						<div class="col-md-9">
@@ -79,20 +78,20 @@
79 78
 						</div>
80 79
 					</li>
81 80
 					<li class="form-group">
82
-						<label for="customer_layer" class="col-md-2">客户信誉等</label>
81
+						<label for="customer_layer" class="col-md-2">客户信誉等</label>
83 82
 						<div class="col-md-9">
84 83
 							<input id="customer_layer" class="form-control" type="text" autocomplete="off" placeholder="请输入客户信誉等级" />
85 84
 						</div>
86 85
 					</li>
87
-					
88
-					<li class="form-group">
86
+					<li class="form-group drop_down">
89 87
 						<label for="customer_bedept" class="col-md-2">客户归属部门</label>
90 88
 						<div class="col-md-9">
91
-							<input id="customer_bedept" class="form-control" type="text" autocomplete="off" placeholder="请输入客户归属部门" />
89
+							<input type="text" class="form-control input-sm" id="customer_bedept" data-id="0" placeholder="请选择客户归属部门" autocomplete="off" />
90
+							<span class="caret"></span>
91
+							<div id="customerTreeView" class="hidden"></div>
92 92
 						</div>
93 93
 					</li>
94 94
 					
95
-					
96 95
 					<li class="form-group">
97 96
 						<label for="customer_berelatedAcc" class="col-md-2">客户归属涉税会计</label>
98 97
 						<div class="col-md-9">

+ 4 - 30
CallCenterWeb.UI/commonTpl/importCustomers.html

@@ -1,4 +1,4 @@
1
-<!DOCTYPE html>
1
+<!DOCTYPE html>
2 2
 <html>
3 3
 
4 4
 	<head>
@@ -113,8 +113,6 @@
113 113
 		<script>
114 114
 			var percents = 0; //长传文件进度值
115 115
 			$(document).ready(function() {
116
-				//获取 区域 项目 期号下拉
117
-//				helper.getDropList.getProLocations($('#head_form_rengin'), $('#head_form_pro'), $('#head_form_floor'));
118 116
 				//上传EXCEL文件
119 117
 				$("#upFileExcel").click(function() {
120 118
 					$("#upFile").trigger("click");
@@ -130,33 +128,12 @@
130 128
 			});
131 129
 			//下载模板
132 130
 			function ExcelMod() {
133
-			    window.location.href = huayi.config.callcenter_url + "ExcelMod/CustomerList_Excel.xls";
131
+			    window.location.href = "CustomerList_Excel.xls";
134 132
 			}
135 133
 
136 134
 			//上传Excel文件 模拟实时进度
137 135
 			function uploads() {
138 136
 				var txtName = $('.excelName').text();
139
-//				if($('#head_form_rengin').val() === "0" || $('#head_form_rengin').val() === undefined) {
140
-//					layer.confirm('请选择区域', {
141
-//						icon: 2,
142
-//						btn: ['确定']
143
-//					});
144
-//					return;
145
-//				}
146
-//				if($('#head_form_pro').val() === "0" || $('#head_form_pro').val() === undefined) {
147
-//					layer.confirm('请选择项目', {
148
-//						icon: 2,
149
-//						btn: ['确定']
150
-//					});
151
-//					return;
152
-//				}
153
-//				if($('#head_form_floor').val() === "0" || $('#head_form_floor').val() === undefined) {
154
-//					layer.confirm('请选择期号', {
155
-//						icon: 2,
156
-//						btn: ['确定']
157
-//					});
158
-//					return;
159
-//				}
160 137
 				if(txtName == '') {
161 138
 					layer.confirm('你还没有上传文件', {
162 139
 						icon: 2,
@@ -173,12 +150,9 @@
173 150
 					var formData = new FormData();
174 151
 					var Files = document.getElementById("upFile").files;
175 152
 					formData.append("upFile", Files[0]); //是	HttpPostedFile	Excel文件
176
-//					formData.append("areaid", $('#head_form_rengin').val()); //是	int	区域id (下拉)
177
-//					formData.append("regionid", $('#head_form_pro').val()); //是	int	项目id (下拉)
178
-//					formData.append("buldingid", $('#head_form_floor').val()); //是	int	期号 (下拉)
179 153
 					formData.append("token", $.cookie("token"));
180 154
 					$.ajax({
181
-						url: huayi.config.callcenter_url + "Customer/ImportExcel",
155
+						url: huayi.config.callcenter_url + "CustomerNew/ImportExcel",
182 156
 						type: "POST",
183 157
 						data: formData,
184 158
 						/**
@@ -215,7 +189,7 @@
215 189
 							if(r.state.toLowerCase() == "success") {
216 190
 								var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
217 191
 								parent.layer.close(index); //再执行关闭
218
-								parent.getTableDataList();
192
+								parent.$('#cusList').bootstrapTable('refresh');
219 193
 								parent.layer.alert(r.message, {
220 194
 									icon: 1,
221 195
 									btn: ['确定']

+ 11 - 0
CallCenterWeb.UI/css/customer.css

@@ -288,3 +288,14 @@ img.upload-img {
288 288
   border-left: 1px solid #E5E6E7;
289 289
   padding-left: 10px;
290 290
 }
291
+
292
+#customerTreeView{
293
+	position: absolute;
294
+	left: 15px;
295
+	width: 97%;
296
+	top: 32px;
297
+	background-color: #fff;
298
+	z-index: 4;
299
+	max-height: 256px;
300
+	overflow-y: auto;
301
+}

+ 1 - 0
CallCenterWeb.UI/keHuManager/customerInfo.html

@@ -90,6 +90,7 @@
90 90
 				<div class="pull-right tool_bars">
91 91
 					<button class="btns" id="sc_btns">搜索</button>
92 92
 					<button class="btns" id="btn_add">添加</button>
93
+					<input type="button" class="btns" onclick="btn_export()" value="导入" />
93 94
 					<button class="btns" onclick="btn_deletes()">批量删除</button>
94 95
 				</div>
95 96
 			</div>

+ 105 - 29
CallCenterWeb.UI/keHuManager/js/addOrEditCusInfo.js

@@ -3,18 +3,16 @@
3 3
  * */
4 4
 var indexNum = 0;
5 5
 $(function() {
6
-	//获取所属行业//获取税务类别//获取客户信誉等级
7
-	// 	$.when(helper.getDropList.getlistDropByDic($('#customer_subtrade'), 'KHSSHY'),
8
-	// 			helper.getDropList.getlistDropByDic($('#customer_taxCategory'), 'SWLB'),
9
-	// 			helper.getDropList.getlistDropByDic($('#customer_layer'), 'KHLayer'))
10
-	// 		.done(function() {
11
-	var edit_id = helper.request.queryString("edit_id");
12
-	if (edit_id) {
13
-		getCustomer(edit_id);
14
-	}
15
-	//绑定验证(所有 input.form-control)
16
-	$('#tab_user_contents').find("input[class='form-control']").on('blur keyup', valideInput);
17
-	// });
6
+	//获取所属部门 
7
+	getDepts('customerTreeView', 'customer_bedept')
8
+	.then(function(){
9
+		var edit_id = helper.request.queryString("edit_id");
10
+		if (edit_id) {
11
+			getCustomer(edit_id);
12
+		}
13
+		//绑定验证(所有 input.form-control)
14
+		$('#tab_user_contents').find("input[class='form-control']").on('blur keyup', valideInput);
15
+	});
18 16
 
19 17
 });
20 18
 
@@ -123,7 +121,7 @@ function getCustomer(ids) {
123 121
 						'<button class="form-control btn btn-default" style="width:60px;margin-left:15px" onclick="btn_delete($(this))">删除</button>' +
124 122
 						'</div>';
125 123
 					$('#contactList').prepend(tplstr);
126
-					$('F_IsMain_' + i).find('input[type="radio"][value="' + cusLists[i].F_Remark +'"]').prop('checked', true);
124
+					$('#F_IsMain_' + i).find('input[type="radio"][value="' + cusLists[i].F_IsMain +'"]').prop('checked', true);
127 125
 					
128 126
 				}
129 127
 				indexNum = cusLists.length;
@@ -134,8 +132,7 @@ function getCustomer(ids) {
134 132
 
135 133
 //保存
136 134
 function saveCustomer() {
137
-	if (!$.trim($('#customer_key').val()) ||
138
-		!$.trim($('#customer_code').val()) ||
135
+	if (!$.trim($('#customer_code').val()) ||
139 136
 		!$.trim($('#customer_companyname').val())
140 137
 	) {
141 138
 		layer.msg('带红色星号的是必填项,请填写或选择后再保存!');
@@ -170,22 +167,22 @@ function saveCustomer() {
170 167
 			});
171 168
 			return;
172 169
 		}
173
-		if (!regexs.phone.test($.trim(F_Duties))) {
174
-			layer.confirm('您添加的联系人电话号码格式不正确!', {
170
+		if (F_Duties && !regexs.chOrenOrnum.test($.trim(F_Duties))) {
171
+			layer.confirm('您添加的联系人职务格式不正确!', {
175 172
 				icon: 2,
176 173
 				btn: ['确定']
177 174
 			});
178 175
 			return;
179 176
 		}
180
-		if (!regexs.phone.test($.trim(F_Telephone))) {
181
-			layer.confirm('您添加的联系人电话号码格式不正确!', {
177
+		if (F_QQ && !regexs.QQreg.test($.trim(F_QQ))) {
178
+			layer.confirm('您添加的联系人QQ格式不正确!', {
182 179
 				icon: 2,
183 180
 				btn: ['确定']
184 181
 			});
185 182
 			return;
186 183
 		}
187
-		if (!regexs.phone.test($.trim(F_Telephone))) {
188
-			layer.confirm('您添加的联系人电话号码格式不正确!', {
184
+		if (F_MSN && !regexs.chOrenOrnum.test($.trim(F_MSN))) {
185
+			layer.confirm('您添加的联系人MSN格式不正确!', {
189 186
 				icon: 2,
190 187
 				btn: ['确定']
191 188
 			});
@@ -211,7 +208,7 @@ function saveCustomer() {
211 208
 		},
212 209
 		data: {
213 210
 			F_CustomerId: edit_id, //	否	string	id
214
-			F_KeyWords: $('#customer_key').val(), //string 关键词	
211
+			// F_KeyWords: $('#customer_key').val(), //string 关键词	
215 212
 			F_CustomerCode: $('#customer_code').val(), //string 客户编号
216 213
 			F_CompanyName: $('#customer_companyname').val(), //string 公司名称
217 214
 			F_CompanyAddress: $('#customer_comaddress').val(), //string 公司地址
@@ -222,7 +219,7 @@ function saveCustomer() {
222 219
 			F_TaxPointDes: $('#customer_taxPointDes').val(), //string 税点描述
223 220
 			F_InvoiceRange: $('#customer_invoiceRange').val(), //string 开票范围
224 221
 			F_Layer: $('#customer_layer').val(), // int 客户信誉等级
225
-			F_BeDept: $('#customer_bedept').val(), // int 客户归属部门
222
+			F_BeDept: $('#customer_bedept').attr('data-id'), // int 客户归属部门
226 223
 			F_BeRelatedAcc: $('#customer_berelatedAcc').val(), //string 客户归属涉税会计
227 224
 			F_BeAuditAcc: $('#customer_beauditAcc').val(), //string 客户归属审核会计
228 225
 			F_BeMakeAcc: $('#customer_bemakeAcc').val(), //string 客户归属做账会计
@@ -374,14 +371,96 @@ function getFields() {
374 371
 }
375 372
 
376 373
 
374
+/**
375
+ * 获取客户归属部门
376
+ * el1, 树形结构元素id名 customerTreeView
377
+ * el2, 搜索框元素id名 customer_bedept
378
+ * */
379
+function getDepts(el1, el2) {
380
+	var dtd = $.Deferred(); //在函数内部,新建一个Deferred对象
381
+	//初始化 样式
382
+	$('#' + el2).on('focus click', function() {
383
+		$('#' + el1).removeClass('hidden').addClass('show');
384
+	});
385
+	$('#' + el2).on('keyup', function() {
386
+		if($(this).val() == '') {
387
+			$('#' + el1).treeview('uncheckAll', {
388
+				silent: true
389
+			});
390
+			$(this).attr('data-id', '0');
391
+		}
392
+	});
393
+	$('#' + el2 + ' .caret').on('click', function() {
394
+		$('#' + el1).removeClass('hidden').addClass('show');
395
+	});
396
+	$('#' + el1).mouseleave(function() {
397
+		$(this).removeClass('show').addClass('hidden');
398
+	});
399
+	
400
+	$.getJSON(huayi.config.callcenter_url + 'Department/GetDeptList', {
401
+		token: $.cookie("token")
402
+	}, function(result) {
403
+		if(result.state.toLowerCase() == "success") {
404
+			var defaultDatas = helper.methods.buildTree(result.data);
405
+			var sortChildrenArr = helper.methods.objToArray(defaultDatas[0].children);
406
+			sortChildrenArr.sort(helper.methods.compare('sort'));
407
+			var sortChildrenObj = helper.methods.arrayToObj(sortChildrenArr);
408
+			defaultDatas[0].children = sortChildrenObj;
409
+			if(defaultDatas) {
410
+				var $sTree = $('#' + el1).treeview({
411
+					color: "#1ab394",
412
+					selectedBackColor: '#1ab394',
413
+					expandIcon: 'glyphicon glyphicon-chevron-right',
414
+					collapseIcon: 'glyphicon glyphicon-chevron-down',
415
+					nodeIcon: 'fa fa-folder-o',
416
+					//selectedIcon: "glyphicon glyphicon-stop",
417
+					//icon: "glyphicon glyphicon-stop",
418
+					//emptyIcon: 'glyphicon',
419
+					//showCheckbox: true,
420
+					selectable: true,
421
+					state: {
422
+						selected: true
423
+					},
424
+					data: defaultDatas,
425
+					onNodeSelected: function(event, node) {
426
+						$sTree.treeview('clearSearch');
427
+						$('#' + el2).val(node.text);
428
+						$('#' + el2).attr('data-id', node.id);
429
+						$('#' + el1).removeClass('show').addClass('hidden');
430
+					},
431
+					onNodeUnselected: function(event, node) {
432
+						$('#' + el2).attr('data-id', 0);
433
+						$('#' + el2).attr('placeholder', '请选择客户归属部门');
434
+					}
435
+				});
436
+//				$('#' + el1).treeview('collapseAll', {
437
+//					silent: true
438
+//				});
439
+				$('#' + el1).treeview('expandAll', { levels: 2, silent: true });
440
+				var findSNodes = function() {
441
+					return $sTree.treeview('search', [$('#' + el2).val(), {
442
+						ignoreCase: false,
443
+						exactMatch: false
444
+					}]);
445
+				};
446
+				$('#' + el2).on('keyup focus', function(e) {
447
+					var selectableNodes = findSNodes();
448
+					//var m = $('#' + el1).treeview('getParent', selectableNodes);
449
+					//$('#' + el1).treeview('selectNode', [ m, { silent: true } ]);
450
+				});
451
+			}
452
+			dtd.resolve(); // 改变Deferred对象的执行状态
453
+		}
454
+	})
455
+	return dtd.promise(); // 返回promise对象
456
+}
457
+
458
+
377 459
 //验证(所有 input.form-control)的方法
378 460
 function valideInput() {
379 461
 	var _that = $(this);
380 462
 	//console.log($(this).attr('id'));
381 463
 	switch ($(this).attr('id')) {
382
-		case 'customer_key': //验证关键词
383
-			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', false);
384
-			break;
385 464
 		case 'customer_code': //验证客户编号
386 465
 			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', false);
387 466
 			break;
@@ -406,9 +485,6 @@ function valideInput() {
406 485
 		case 'customer_layer': //验证 客户信誉等级
407 486
 			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
408 487
 			break;
409
-		case 'customer_bedept': //验证 客户归属部门
410
-			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
411
-			break;
412 488
 		case 'customer_berelatedAcc': //客户归属涉税会计
413 489
 			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
414 490
 			break;

+ 2 - 2
CallCenterWeb.UI/keHuManager/js/cusDetails.js

@@ -23,7 +23,7 @@ function getCustomer(ids) {
23 23
 				$('#customer_companyname').text(cusBase.F_CompanyName); //string 公司名称
24 24
 				$('#customer_comaddress').text(cusBase.F_CompanyAddress); //string 公司地址
25 25
 				$('#customer_legalName').text(cusBase.F_LegalName); //string 法人姓名
26
-				$('#customer_lehalTel').text(cusBase.F_LegalTel); //string 法人电话
26
+				$('#customer_lehalTel').text(helper.filter.cutTel(cusBase.F_LegalTel)); //string 法人电话
27 27
 				$('#customer_subtrade').text(cusBase.F_SubTrade); // int 所属行业
28 28
 				$('#customer_taxCategory').text(cusBase.F_TaxCategory); // int 税务类别
29 29
 				$('#customer_taxPointDes').text(cusBase.F_TaxPointDes); //string 税点描述
@@ -49,7 +49,7 @@ function getCustomer(ids) {
49 49
 										'</li>'+
50 50
 										'<li class="col-md-3 col-sm-4">' +
51 51
 											'<label>电话:</label>' +
52
-											'<span>'+ cusLists[i].F_Telephone +'</span>' +
52
+											'<span>'+ helper.filter.cutTel(cusLists[i].F_Telephone) +'</span>' +
53 53
 										'</li>'+
54 54
 										'<li class="col-md-3 col-sm-4">' +
55 55
 											'<label>邮箱:</label>' +

+ 12 - 0
CallCenterWeb.UI/keHuManager/js/customerInfo.js

@@ -141,6 +141,18 @@ function btn_addCus(editId) {
141 141
 	});
142 142
 }
143 143
 
144
+//导入客户信息
145
+function btn_export() {
146
+	layer.open({
147
+		maxmin: true, //开启最大化最小化按钮
148
+		type: 2,
149
+		content: "../commonTpl/importCustomers.html", //iframe的url,no代表不显示滚动条
150
+		title: '导入客户信息',
151
+		area: ['50%', '55%'], //宽高
152
+	});
153
+}
154
+
155
+
144 156
 //批量删除
145 157
 function btn_deletes() {
146 158
 	var ids = $.map($('#cusList').bootstrapTable('getSelections'),