Explorar el Código

客户档案管理

zhangshuangnan %!s(int64=8) %!d(string=hace) años
padre
commit
df3c56ac85

+ 20 - 169
CallCenterWeb.UI/keHuManager/ContactPersonManger.html

@@ -6,7 +6,6 @@
6 6
 		<script src="../Script/Common/huayi.load.js"></script>
7 7
     	<script src="../Script/Common/huayi.config.js"></script>
8 8
 		<link rel="stylesheet" href="../css/laydate/need/laydate.css" />
9
-		<link rel="stylesheet" href="../css/plugins/jsTree/style.min.css" />
10 9
 		<link href="../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
11 10
 		<link rel="stylesheet" href="../css/init.css" />
12 11
 		<title>客户管理</title>
@@ -89,10 +88,17 @@
89 88
 			.kong{
90 89
 				display: none;
91 90
 			}
92
-			.btn-default {
91
+			.bootstrap-select > .dropdown-toggle.bs-placeholder {
93 92
 			    background-color: #ffffff!important;
94 93
 			    border-color: #e5e6e7!important;
95
-			    color: #FFF;
94
+			}
95
+			.filter-option{
96
+				color: #676b6d;
97
+			}
98
+			.bootstrap-select > .dropdown-toggle.btn-default{
99
+				   background-color: #ffffff!important;
100
+			    border-color: #e5e6e7!important;
101
+			    color: #555;
96 102
 			}
97 103
 		</style>
98 104
 	</head>
@@ -121,8 +127,10 @@
121 127
 								</select>
122 128
 							</div>
123 129
 							 <div class="form-group">
124
-							 	<input type="text" class="province form-control" placeholder="请输入省份"/>
125
-							 </div>
130
+								<select class="form-control selectpicker" id="province" data-live-search="true">
131
+									<option value="">请选择省份</option>
132
+								</select>
133
+							</div>
126 134
 							 <div class="form-group">
127 135
 							 	<input type="text" class="form-control contact_name" placeholder="请输入联系人"/>
128 136
 							 </div>
@@ -138,6 +146,9 @@
138 146
 					<button class="btns add ">添加</button>
139 147
 					<button class="btns change">修改</button>
140 148
 					<button class="btns del">删除</button>
149
+					
150
+					<input id="btndr" type="button" class="btns" style="margin:0;" value="导入" />
151
+                        <input type="file" name="upFile" id="upFile" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" style="display: none;">
141 152
 				</div>
142 153
 				</div>
143 154
 				
@@ -148,179 +159,19 @@
148 159
 						<tr>
149 160
 							<th data-field="state" data-checkbox="true" data-align="center"></th>
150 161
 							<th data-align="center" data-formatter="setCode">编号</th>
151
-							<th data-field="F_CustomerCode" data-align="center">客户编号</th>
152
-							<th data-field="F_CustomerName" data-align="center">客户名称</th>
153
-							<th data-field="F_Mobile" data-align="center">联系电话1</th>
154
-							<th data-field="F_Telephone" data-align="center">联系电话2</th>
155
-							<th data-field="F_ChargeTelephone" data-align="center">联系电话3</th>
162
+							<th data-field="F_Province" data-align="center">省份</th>
163
+							<th data-field="F_CustomerIndustry" data-align="center">客户名称</th>
164
+							<th data-field="F_CustomerName" data-align="center">联系人</th>
165
+							<th data-field="F_Telephone" data-align="center">电话</th>
156 166
 						</tr>
157 167
 					</thead>
158 168
 
159 169
 				</table>
160 170
 			</div>
161
-
162
-		</div>
163
-
164
-		
165
-	<!--修改弹出内容-->
166
-		<div class="model changeModel">
167
-			<div class="box">
168
-				<div class="btop clearfix">
169
-					<p class="btl">修改客户信息</p>
170
-					<p class="btr changeBtr" title="关闭">X</p>
171
-				</div>
172
-				<div class="boxCon">
173
-					<table>
174
-						<tbody>
175
-							<tr>
176
-								<th>客户名称: </th>
177
-								<td colspan="3"><input type="text" class="change_name"  /><span class="addJsz_kong" style="color: red;">*</span></td>
178
-							</tr>
179
-							<tr>
180
-								<th>客户编号: </th>
181
-								<td colspan="3"><input type="text" class="change_code"  /><span class="kong addJsz_kong" style="color: red;">*角色值不允许为空</span></td>
182
-							</tr>
183
-							<tr>
184
-								<th>联系电话1: </th>
185
-								<td colspan="3"><input type="text" class="change_ph1"  /><span class="addJsz_kong" style="color: red;">*</span></td>
186
-							</tr>
187
-							<tr>
188
-								<th>联系电话2: </th>
189
-								<td colspan="3"><input type="text" class="change_ph2"  /><span class="kong addJsz_kong" style="color: red;">*角色值不允许为空</span></td>
190
-							</tr>
191
-							<tr>
192
-								<th>联系电话3: </th>
193
-								<td colspan="3"><input type="text" class="change_ph3"  /><span class="kong addJsz_kong" style="color: red;">*角色值不允许为空</span></td>
194
-							</tr>
195
-						</tbody>
196
-					</table>
197
-					<div style="text-align: center;"><button class="btns changeCun">保存</button></div>
198
-				</div>
199
-			</div>
200
-		</div>
201
-		<!--删除弹出内容-->
202
-		<div class="model delModel">
203
-			<div class="box">
204
-				<div class="btop clearfix">
205
-					<p class="btl"><span>删除参数信息</span></p>
206
-					<p class="btr delBtr" title="关闭">X</p>
207
-				</div>
208
-				<div class="boxCon" style="height: 135px;">
209
-					<p style="font-size: 16px;text-align: center;">您确定要删除选择的记录吗?</p>
210
-					<p style="margin-top: 30px;"><button class="btns sure">确定</button>
211
-						<button class="btns return">取消</button></p>
212
-				</div>
213
-			</div>
214 171
 		</div>
215 172
 
216 173
 		<script src="../css/laydate/laydate.js"></script>
217 174
 		<script src="./js/keHuManger.js"></script>
218
-		<script src="../js/plugins/jsTree/jstree.min.js"></script>
219
-		
220
-		<!--<input type="text" id="demo_q" />
221
-		<div class="aaa">-->
222
-			
223
-		</div>
224 175
 		<script src="../js/bootstrap-select/js/bootstrap-select.js"></script>
225
-		<script>
226
-			var data=[
227
-								{
228
-									"id": 1,
229
-									"text": "Child node 1"
230
-								}, {
231
-									"id": 2,
232
-									"text": "Child node 2"
233
-								}, {
234
-									"id": 3,
235
-									"text": "Child node 3"
236
-								}, {
237
-									"id": 4,
238
-									"text": "Child node 4"
239
-								}, {
240
-									"id": 5,
241
-									"text": "Child node 5"
242
-								}
243
-							
244
-						
245
-					]
246
-		$(function(){
247
-			var to=false;
248
-			$('#demo_q').keyup(function(){
249
-				if(to){
250
-					clearTimeout(to);
251
-				}
252
-				to=setTimeout(function(){
253
-					var v=$('#demo_q').val();
254
-					$('.aaa').jstree(true).search(v)
255
-				},250)
256
-			});
257
-			
258
-				$('.aaa').jstree({
259
-			  "core" : {
260
-			    "animation" : 0,
261
-			    "check_callback" : true,
262
-			    "themes" : { "stripes" : true },
263
-//			    'data' : {
264
-//			      'url' : function (node) {
265
-//			        return node.id === '#' ?
266
-//			          'ajax_demo_roots.json' : 'ajax_demo_children.json';
267
-//			      },
268
-//			      'data' : function (node) {
269
-//			        return { 'id' : node.id };
270
-//			      }
271
-//			    }
272
-			    'data' : data
273
-			  },
274
-			  "types" : {
275
-			    "#" : {
276
-			      "max_children" : 1,
277
-			      "max_depth" : 4,
278
-			      "valid_children" : ["root"]
279
-			    },
280
-			    "root" : {
281
-			      "icon" : "/static/3.3.5/assets/images/tree_icon.png",
282
-			      "valid_children" : ["default"]
283
-			    },
284
-			    "default" : {
285
-			      "valid_children" : ["default","file"]
286
-			    },
287
-			    "file" : {
288
-			      "icon" : "glyphicon glyphicon-file",
289
-			      "valid_children" : []
290
-			    }
291
-			  },
292
-			  "plugins" : [
293
-			    "contextmenu", "dnd", "search",
294
-			    "state", "types", "wholerow"
295
-			  ]
296
-			});
297
-		
298
-			
299
-		})
300
-		
301
-		
302
-		
303
-		
304
-		getAccount()
305
-		function getAccount() {
306
-			$.ajax({
307
-				type: "get",
308
-				url: huayi.config.callcenter_url + "Customer/BindLDdep",
309
-				dataType: 'json',
310
-				async: true,
311
-				data: {
312
-					token: $.cookie("token")
313
-				},
314
-				success: function(data) {
315
-					var Count = data.data;
316
-					for(var i = 0; i < Count.length; i++) {
317
-						$("<option value='" + Count[i].id + "'>" + Count[i].usercode + "(" + Count[i].title + ")</option>").appendTo($("#customer_name"));
318
-					}
319
-					$('#customer_name').selectpicker('refresh');
320
-				}
321
-			});
322
-		}
323
-		
324
-		</script>
325 176
 	</body>
326 177
 </html>

+ 153 - 126
CallCenterWeb.UI/keHuManager/addCustomerFile.html

@@ -4,6 +4,7 @@
4 4
 		<meta charset="UTF-8">
5 5
 		<script src="../Script/Common/huayi.load.js"></script>
6 6
     	<script src="../Script/Common/huayi.config.js"></script>
7
+    	<link href="../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
7 8
     	<link rel="stylesheet" href="../css/init.css" />
8 9
 		<title></title>
9 10
 		<style>
@@ -13,79 +14,6 @@
13 14
 				clear: both;
14 15
 			}
15 16
 			
16
-			.toolBar {
17
-				padding: 15px 0;
18
-				border-bottom: 1px solid #ccc;
19
-				margin-bottom: 25px;
20
-				padding-right: 45px;
21
-			}
22
-			
23
-			.toolBar input {
24
-				width: 128px;
25
-				padding: 2px 2PX 2PX 10PX;
26
-				height: 28px;
27
-				border: 1px solid #ebebeb;
28
-				color: #1ab394;
29
-				outline: none;
30
-				vertical-align: middle;
31
-			}
32
-			.model {
33
-				position: fixed;
34
-				top: 0;
35
-				right: 0;
36
-				bottom: 0;
37
-				left: 0;
38
-				height: 100%;
39
-				width: 100%;
40
-				background: rgba(0, 0, 0, 0.48);
41
-				z-index: 100;
42
-				display: none;
43
-			}
44
-			.delModel .box{
45
-				width: 22%;
46
-			}
47
-			
48
-			.box {
49
-				width: 30%;
50
-				margin: 0 auto;
51
-				margin-top: 5%;
52
-			}
53
-			
54
-			.box .btop {
55
-				height: 35px;
56
-				background: #1ab394;
57
-				color: #fff;
58
-				line-height: 35px;
59
-				padding: 0 15px;
60
-				/*margin-bottom: 15px;*/
61
-			}
62
-			
63
-			.box .btop p.btl {
64
-				float: left;
65
-				margin: 0;
66
-			}
67
-			
68
-			.box .btop p.btr {
69
-				float: right;
70
-				cursor: pointer;
71
-				margin: 0;
72
-				font-size: 20px;
73
-			}
74
-			
75
-			.box>input {
76
-				display: block;
77
-				height: 34px;
78
-				padding: 6px 12px;
79
-				font-size: 14px;
80
-				line-height: 1.42857143;
81
-				color: #555;
82
-				background-color: #fff;
83
-				background-image: none;
84
-				border: 1px solid #ccc;
85
-				border-radius: 4px;
86
-				margin: 35px auto;
87
-			}
88
-			
89 17
 			.boxCon {
90 18
 				width: 100%;
91 19
 				background: #fff;
@@ -113,34 +41,66 @@
113 41
 			.kong{
114 42
 				display: none;
115 43
 			}
44
+				.bootstrap-select > .dropdown-toggle.bs-placeholder {
45
+			    background-color: #ffffff!important;
46
+			    border-color: #e5e6e7!important;
47
+			}
48
+			.filter-option{
49
+				color: #676b6d;
50
+			}
51
+			.form-inline{
52
+				display: inline-block;
53
+			}
54
+			.bootstrap-select > .dropdown-toggle.btn-default{
55
+				   background-color: #ffffff!important;
56
+			    border-color: #e5e6e7!important;
57
+			    color: #555;
58
+			}
116 59
 			
117 60
 		</style>
118 61
 	</head>
119 62
 	<body>
120 63
 		<div class="container-fluid">
121
-			
122 64
 			<div class="boxCon">
123 65
 					<table>
124 66
 						<tbody>
125 67
 							<tr>
126 68
 								<th>客户名称: </th>
127
-								<td colspan="3"><input type="text" class="add_name"  /><span class="addJsz_kong" style="color: red;">*</span></td>
128
-							</tr>
129
-							<tr>
130
-								<th>客户编号: </th>
131
-								<td colspan="3"><input type="text" class="add_code"  /><span class="kong addJsz_kong" style="color: red;">*角色值不允许为空</span></td>
69
+								<td>
70
+									<div class="form-inline">
71
+										 <div class="form-group">
72
+											<select class="form-control selectpicker" id="customer_name" data-live-search="true">
73
+												<option value="">请选择客户名称</option>
74
+											</select>
75
+										</div>
76
+									</div>
77
+									<span class="addJsz_kong" style="color: red;">*</span>
78
+								</td>
132 79
 							</tr>
133 80
 							<tr>
134
-								<th>联系电话1: </th>
135
-								<td colspan="3"><input type="text" class="add_ph1"  /><span class="addJsz_kong" style="color: red;">*</span></td>
81
+								<th>省份: </th>
82
+								<td>
83
+									<div class="form-inline">
84
+										 <div class="form-group">
85
+											<select class="form-control selectpicker" id="province" data-live-search="true">
86
+												<option value="">请选择省份</option>
87
+											</select>
88
+										</div>
89
+									</div>
90
+									<span class="addJsz_kong" style="color: red;">*</span>
136 91
 							</tr>
137 92
 							<tr>
138
-								<th>联系电话2: </th>
139
-								<td colspan="3"><input type="text" class="add_ph2"  /><span class="kong addJsz_kong" style="color: red;">*角色值不允许为空</span></td>
93
+								<th>联系人: </th>
94
+								<td><input type="text" class="name"  />
95
+								<!--<span class="addJsz_kong" style="color: red;">*</span>-->
96
+								</td>
140 97
 							</tr>
141 98
 							<tr>
142
-								<th>联系电话3: </th>
143
-								<td colspan="3"><input type="text" class="add_ph3"  /><span class="kong addJsz_kong" style="color: red;">*角色值不允许为空</span></td>
99
+								<th>电话: </th>
100
+								<td >
101
+									<input type="text" class="mobile"  />
102
+									<!--<span class="kong addJsz_kong" style="color: red;">*角色值不允许为空</span>-->
103
+								</td>
144 104
 							</tr>
145 105
 						</tbody>
146 106
 					</table>
@@ -148,73 +108,140 @@
148 108
 				</div>
149 109
 			
150 110
 		</div>
151
-		
111
+		<script src="../js/bootstrap-select/js/bootstrap-select.js"></script>
152 112
 	<script>
153 113
 	var token = $.cookie("token");
114
+	var id=helper.request.queryString("ids");
115
+	
116
+	$(document).ready(function(){
117
+		
118
+			var regBox = {
119
+	    //regEmail: /^([A-Za-z0-9_\.-]+)@([\dA-Za-z_\.-]+)\.([A-Za-z_\.-]{2,6})$/,  //邮箱
120
+	    //regEmail: /@/,    //邮箱
121
+	    //regName: /^[a-z0-9_-]{3,16}$/,    //用户名
122
+	    //regMobile: /^1(3|4|5|7|8)\d{9}$/    //手机
123
+	    //regTel: /^0[\d]{2,3}-[\d]{7,8}$/,
124
+	    //regData: /^[0-9]*$/ //数字
125
+	    regMobOrTel: /^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/
126
+	}
127
+	//判断
128
+	function Isnullorempty(selstr) {
129
+	    if (selstr == null || selstr == "" || selstr == undefined || selstr == "null" || selstr == "undefined" || parseFloat(selstr) <= 0) {
130
+	        return true;
131
+	    } else {
132
+	        return false;
133
+	    }
134
+	}
135
+		//保存按钮
154 136
 	$('.addCun').click(function() {
155
-			var khmc = $(".add_name").val();
156
-			var khbh = $(".add_code").val();
157
-			var tel1 = $(".add_ph1").val();
158
-			var tel2 = $(".add_ph2").val();
159
-			var tel3 = $(".add_ph3").val();
160
-			if(Isnullorempty(khmc)) {
161
-				layer.confirm('请输入客户名称!', {
137
+			var tel = $(".mobile").val();
138
+			if($('#customer_name').val()=='') {
139
+				layer.confirm('请选择客户名称!', {
162 140
 					btn: ['确定']
163 141
 				});
164 142
 				return;
165 143
 			}
166
-			if(Isnullorempty(tel1)) {
167
-				layer.confirm('请输入联系电话1', {
144
+			if($('#province').val()=='') {
145
+				layer.confirm('请选择省份!', {
168 146
 					btn: ['确定']
169 147
 				});
170 148
 				return;
171 149
 			}
172
-			var tflag = regBox.regMobOrTel.test(tel1);
173
-			if(!tflag) {
174
-				layer.confirm('请输入正确的联系电话1', {
175
-					btn: ['确定']
176
-				});
177
-				return;
178
-			}
179
-			if(!Isnullorempty(tel2)) {
180
-				var t2flag = regBox.regMobOrTel.test(tel2);
181
-				if(!t2flag) {
182
-					layer.confirm('请输入正确的联系电话2', {
183
-						btn: ['确定']
184
-					});
185
-					return;
186
-				}
187
-			}
188
-			if(!Isnullorempty(tel3)) {
189
-				var t3flag = regBox.regMobOrTel.test(tel3);
190
-				if(!t3flag) {
191
-					layer.confirm('请输入正确的联系电话3', {
150
+			if(!Isnullorempty(tel)) {
151
+				var flag = regBox.regMobOrTel.test(tel);
152
+				if(!flag) {
153
+					layer.confirm('请输入正确的联系电话', {
192 154
 						btn: ['确定']
193 155
 					});
194 156
 					return;
195 157
 				}
196 158
 			}
197 159
 			$.post(huayi.config.callcenter_url + 'Customer/AddCustomer', {
198
-				name: khmc,
199
-				code: khbh,
200
-				mobile: tel1,
201
-				telphone: tel2,
202
-				chargetelephone: tel3,
160
+				cid: id,
161
+				customerindustry: $('#customer_name').val(),
162
+				province: $('#province').val(),
163
+				mobile: $('.mobile').val(),
164
+				name: $('.name').val(),
203 165
 				"token": $.cookie("token")
204 166
 			}, function(result) {
205 167
 				result = $.parseJSON(result);
206 168
 				if(result.state.toLowerCase() == "success") {
207 169
 					$("#activess").val(result.data);
208 170
    					var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
209
-								parent.layer.close(index); //再执行关闭
210
-	                            parent.layer.msg("添加成功!");
211
-				                parent.table.bootstrapTable('refresh'); 
171
+							parent.layer.close(index); //再执行关闭
172
+                            parent.layer.msg("添加成功!");
173
+			                parent.table.bootstrapTable('refresh'); 
212 174
 				}
213 175
 			}) 
214
-//			$('.addModel').css('display', 'none');
176
+			
215 177
 		})
216
-
217
-	
178
+    if(id){
179
+    	$.get(huayi.config.callcenter_url + 'Customer/GetCustomer', {
180
+				cid: id,
181
+				"token": $.cookie("token")
182
+			}, function(result) {
183
+				result = $.parseJSON(result);
184
+				if(result.state.toLowerCase() == "success") {
185
+					var con=result.data;
186
+					$("#customer_name").val(con.F_CustomerIndustry);
187
+					$('#customer_name').trigger("change");
188
+//					$("#customer_name").find('option[text='+ con.F_CustomerIndustry +']').attr("selected",true);
189
+					$("#province").val(con.F_Province);
190
+					$('#province').trigger("change");
191
+					$(".mobile").val(con.F_Telephone);
192
+					$(".name").val(con.F_CustomerName);
193
+				}
194
+			})
195
+      	
196
+      }
197
+//  else{
198
+//    	getAccount();
199
+//    	getProvince()
200
+//    }
201
+//  
202
+   	
203
+	})
204
+		 //客户名称
205
+		getAccount()
206
+		function getAccount() {
207
+			$.ajax({
208
+				type: "get",
209
+				url: huayi.config.callcenter_url + "Customer/BindLDdep",
210
+				dataType: 'json',
211
+				async: true,
212
+				data: {
213
+					token: $.cookie("token")
214
+				},
215
+				success: function(data) {
216
+					var Count = data.data.dep;
217
+					$(Count).each(function(i,n){
218
+						$("<option value='" + n + "'>" + n + "</option>").appendTo($("#customer_name"));
219
+					})
220
+					$('#customer_name').selectpicker('refresh');
221
+				}
222
+			});
223
+		}
224
+		//省份
225
+		getProvince()
226
+		function getProvince() {
227
+			$.ajax({
228
+				type: "get",
229
+				url: 'province.json',
230
+				dataType: 'json',
231
+				async: true,
232
+				data: {
233
+//					token: $.cookie("token")
234
+				},
235
+				success: function(data) {
236
+					var Count = data.provinces;
237
+					$(Count).each(function(i,n){
238
+						$("<option value='" + n.provinceName + "'>" + n.provinceName + "</option>").appendTo($("#province"));
239
+					})
240
+					$('#province').selectpicker('refresh');
241
+				}
242
+			});
243
+		}
244
+    
218 245
 </script>
219 246
 	</body>
220 247
 </html>

+ 147 - 124
CallCenterWeb.UI/keHuManager/js/keHuManger.js

@@ -6,10 +6,53 @@
6 6
 		event: 'focus',
7 7
 		format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
8 8
 	});
9
+	
10
+	//客户名称
11
+		getAccount()
12
+		function getAccount() {
13
+			$.ajax({
14
+				type: "get",
15
+				url: huayi.config.callcenter_url + "Customer/BindLDdep",
16
+				dataType: 'json',
17
+				async: true,
18
+				data: {
19
+					token: $.cookie("token")
20
+				},
21
+				success: function(data) {
22
+					var Count = data.data.dep;
23
+					$(Count).each(function(i,n){
24
+						$("<option value='" + n + "'>" + n + "</option>").appendTo($("#customer_name"));
25
+					})
26
+					$('#customer_name').selectpicker('refresh');
27
+				}
28
+			});
29
+		}
30
+		//省份
31
+		getProvince()
32
+		function getProvince() {
33
+			$.ajax({
34
+				type: "get",
35
+				url: 'province.json',
36
+				dataType: 'json',
37
+				async: true,
38
+				data: {
39
+//					token: $.cookie("token")
40
+				},
41
+				success: function(data) {
42
+					var Count = data.provinces;
43
+					$(Count).each(function(i,n){
44
+						$("<option value='" + n.provinceName + "'>" + n.provinceName + "</option>").appendTo($("#province"));
45
+					})
46
+					$('#province').selectpicker('refresh');
47
+				}
48
+			});
49
+		}
50
+	
51
+	
9 52
 	$('.search').click(function() {
10 53
 		initTable(token);
11 54
 	})
12
-	//==================添加功能开始================================
55
+	//添加
13 56
 	$('.add').click(function() {
14 57
 		 layer.open({
15 58
                 type: 2,
@@ -20,8 +63,8 @@
20 63
 //              content: 'addZhiShiKuManger.html?addId=' + id + '&addPid='+ pid +'&addName='+ name +''
21 64
             });
22 65
 	})
23
-	//******************添加功能结束********************************
24
-	//==================修改功能开始================================
66
+	
67
+	//修改
25 68
 	var did;
26 69
 	$('.change').click(function() {
27 70
 		var ids = $.map(table.bootstrapTable('getSelections'), function(row) {
@@ -34,93 +77,20 @@
34 77
 		    });
35 78
 		    return;
36 79
 		} else {
37
-			$('.changeModel').css('display', 'block');
38
-			$.get(huayi.config.callcenter_url + 'Customer/GetCustomer', {
39
-				cid: did,
40
-				"token": $.cookie("token")
41
-			}, function(result) {
42
-				result = $.parseJSON(result);
43
-				if(result.state.toLowerCase() == "success") {
44
-					var con=result.data;
45
-					$(".change_name").val(con.F_CustomerName);
46
-					$(".change_code").val(con.F_CustomerCode);
47
-					$(".change_ph1").val(con.F_Mobile);
48
-					$(".change_ph2").val(con.F_Telephone);
49
-					$(".change_ph3").val(con.F_ChargeTelephone);
50
-				}
51
-			})
52
-		}
53
-	})
54
-
55
-	//关闭按钮
56
-	$('.changeBtr').click(function() {
57
-		$('.changeModel').css('display', 'none');
58
-	})
59
-	//保存按钮
60
-	$('.changeCun').click(function() {
61
-		var khmc = $(".change_name").val();
62
-		var khbh = $(".change_code").val();
63
-		var tel1 = $(".change_ph1").val();
64
-		var tel2 = $(".change_ph2").val();
65
-		var tel3 = $(".change_ph3").val();
66
-		if (Isnullorempty(khmc)) {
67
-		    layer.confirm('请输入客户名称!', {
68
-		        btn: ['确定']
69
-		    });
70
-		    return;
71
-		}
72
-		if (Isnullorempty(tel1)) {
73
-		    layer.confirm('请输入联系电话1', {
74
-		        btn: ['确定']
75
-		    });
76
-		    return;
77
-		}
78
-		var tflag = regBox.regMobOrTel.test(tel1);
79
-		if (!tflag) {
80
-		    layer.confirm('请输入正确的联系电话1', {
81
-		        btn: ['确定']
82
-		    });
83
-		    return;
84
-		}
85
-		if (!Isnullorempty(tel2)) {
86
-		    var t2flag = regBox.regMobOrTel.test(tel2);
87
-		    if (!t2flag) {
88
-		        layer.confirm('请输入正确的联系电话2', {
89
-		            btn: ['确定']
90
-		        });
91
-		        return;
92
-		    }
93
-		}
94
-		if (!Isnullorempty(tel3)) {
95
-		    var t3flag = regBox.regMobOrTel.test(tel3);
96
-		    if (!t3flag) {
97
-		        layer.confirm('请输入正确的联系电话3', {
98
-		            btn: ['确定']
99
-		        });
100
-		        return;
101
-		    }
80
+		 layer.open({
81
+                type: 2,
82
+                title: '修改客户信息',
83
+                maxmin: true, //开启最大化最小化按钮
84
+                area: ['50%', '50%'],
85
+//              content: 'addCustomerFile.html'
86
+                content: 'addCustomerFile.html?ids=' + did
87
+            });
88
+	
89
+			
102 90
 		}
103
-		$.post(huayi.config.callcenter_url + 'Customer/AddCustomer', {
104
-			cid: did,
105
-			name: khmc,
106
-			code: khbh,
107
-			mobile: tel1,
108
-			telphone: tel2,
109
-			chargetelephone: tel3,
110
-			"token": $.cookie("token")
111
-		}, function(result) {
112
-			result = $.parseJSON(result);
113
-			if(result.state.toLowerCase() == "success") {
114
-				layer.msg("修改成功");
115
-				table.bootstrapTable('refresh');
116
-			}
117
-		})
118
-		$('.changeModel').css('display', 'none');
119 91
 	})
120
-	//******************修改功能结束********************************
121 92
 
122
-	//==================删除功能开始================================
123
-	//删除按钮
93
+	//删除
124 94
 	var delid;
125 95
 	$('.del').click(function() {
126 96
 		var ids = $.map(table.bootstrapTable('getSelections'), function(row) {
@@ -133,44 +103,36 @@
133 103
 			});
134 104
 			return;
135 105
 		} else {
136
-			$('.delModel').css('display', 'block');
106
+				var laye = layer.confirm('您确定要删除吗?', {
107
+					btn: ['确定', '取消'] //可以无限个按钮
108
+				}, function() {
109
+					//按钮【按钮一】的回调
110
+					$.ajax({
111
+						type: "post",
112
+						url: huayi.config.callcenter_url + "Customer/DelCustomer",
113
+						async: true,
114
+						dataType: "json",
115
+						data: {
116
+							token: token,
117
+							ids: delid
118
+						},
119
+						success: function(data) {
120
+							if(data.state.toLowerCase() == 'success') {
121
+								layer.msg("删除成功!");
122
+								table.bootstrapTable('refresh');
123
+							}
124
+						}
125
+					});
126
+				}, function(index) {
127
+					//按钮【按钮二】的回调
128
+					layer.close(laye)
129
+				});
130
+			
137 131
 		}
138 132
 
139 133
 	})
140
-	//关闭按钮
141
-	$('.delBtr').click(function() {
142
-		$('.delModel').css('display', 'none');
143
-	})
144
-	//取消按钮
145
-	$('.return').click(function() {
146
-		$('.delModel').css('display', 'none');
147
-	})
148
-	//确认按钮
149
-	$('.sure').click(function() {
150
-		$('.delModel').css('display', 'none');
151
-		del(delid);
152
-	})
153
-
154
-	function del(delid) {
155
-		$.ajax({
156
-			type: "post",
157
-			url: huayi.config.callcenter_url + "Customer/DelCustomer",
158
-			async: true,
159
-			dataType: "json",
160
-			data: {
161
-				token: token,
162
-				ids: delid
163
-			},
164
-			success: function(data) {
165
-				if(data.state.toLowerCase() == 'success') {
166
-					layer.msg("删除成功!");
167
-					table.bootstrapTable('refresh');
168
-				}
169
-			}
170
-		});
171
-	}
172
-	//*****************删除功能结束****************************
173
-	initTable(token);
134
+//列表
135
+initTable(token);
174 136
 	function initTable(token) {
175 137
 		//先销毁表格
176 138
 		table.bootstrapTable('destroy');
@@ -198,7 +160,7 @@
198 160
 					token: token,
199 161
 					Cusname: $('#customer_name').val(), //客户名称
200 162
 					name: $('.contact_name').val(), //联系人
201
-					province: $('.province').val(), //省份
163
+					province: $('#province').val(), //省份
202 164
 					tel: $('.phone').val(), //电话
203 165
 //					logindate: $('.loginTime').val() //登录时间
204 166
 				};
@@ -234,4 +196,65 @@
234 196
 	    } else {
235 197
 	        return false;
236 198
 	    }
237
-	}
199
+	}
200
+	
201
+//上传文件
202
+
203
+ $("#btndr").click(function () {
204
+                $("#upFile").trigger("click");
205
+            })
206
+$("#upFile").change(function () {
207
+    upload();
208
+})
209
+            
210
+
211
+    //上传文件
212
+        function upload() {
213
+            if (document.getElementById("upFile").files.length > 0) {
214
+                var formData = new FormData();
215
+                formData.append("upFile", document.getElementById("upFile").files[0]);
216
+                formData.append("token", $.cookie("token"));
217
+                $.ajax({
218
+                    url: huayi.config.callcenter_url + "Customer/ExportExcel",
219
+                    type: "POST",
220
+                    data: formData,
221
+                    /**
222
+                     *必须false才会自动加上正确的Content-Type
223
+                     */
224
+                    contentType: false,
225
+                    /**
226
+                     * 必须false才会避开jQuery对 formdata 的默认处理
227
+                     * XMLHttpRequest会对 formdata 进行正确的处理
228
+                     */
229
+                    processData: false,
230
+                    success: function (result) {
231
+                        document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
232
+                        $("#upFile").change(function () {
233
+                            upload();
234
+                        });
235
+                        var r = $.parseJSON(result);
236
+                        if (r.state.toLowerCase() == "success") {
237
+//                          $(".yhtx").attr("src", huayi.config.callcenter_url.substr(0, huayi.config.callcenter_url.length - 1) + r.data);
238
+//                          var tel = $("#tels").val();
239
+//                          if (tel) {
240
+//                              if (tel.substr(huayi.config.callcenter_url.length - 1, 1) == ',') {
241
+//                                  $("#tels").val(tel + r.data);
242
+//                              }
243
+//                              else {
244
+//                                  $("#tels").val(tel + ',' + r.data);
245
+//                              }
246
+//                          }
247
+//                          else {
248
+//                              $("#tels").val(r.data);
249
+//                          }
250
+                            layer.msg("导入成功");
251
+                        }
252
+                    }
253
+                });
254
+            } else {
255
+                layer.confirm('请上传文件!', {
256
+                    btn: ['确定']
257
+                });
258
+            }
259
+        }
260
+

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 2178 - 0
CallCenterWeb.UI/keHuManager/province.json