Explorar el Código

修改Ivr语音

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

+ 32 - 5
CallCenterWeb.UI/TelCall/WelcomeWords.html

@@ -7,6 +7,9 @@
7 7
 		<meta name="viewport" content="width=device-width, initial-scale=1.0">
8 8
 		<script src="../Script/Common/huayi.load.js"></script>
9 9
 		<script src="../Script/Common/huayi.config.js"></script>
10
+		<script src="../js/bootstrap-select/js/bootstrap-select.js"></script>
11
+		<script src="../js/bootstrap-select/js/i18n/defaults-zh_CN.js"></script>
12
+		<link href="../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
10 13
 		<link href="../css/Table/table1.css" rel="stylesheet" />
11 14
 		<link href="../css/init.css" rel="stylesheet" />
12 15
 		<script src="../js/laydate/laydate.js"></script>
@@ -25,7 +28,18 @@
25 28
 			#settime,#settimes{
26 29
 				width: 228px;
27 30
 			}
28
-
31
+			.bootstrap-select .dropdown-toggle,.open .dropdown-toggle.btn-default{
32
+				    background: #fff!important;
33
+			}
34
+			.btn-default{
35
+				border-color: #e5e6e7;
36
+			}
37
+			.bootstrap-select.btn-group .dropdown-toggle .filter-option{
38
+				color: #555;
39
+			}
40
+			.bootstrap-select.btn-group .dropdown-menu li{
41
+				width: 100%;
42
+			}
29 43
 		</style>
30 44
 	</head>
31 45
 
@@ -52,10 +66,8 @@
52 66
 						<input type="text" class="form-control" id="KeyWords" placeholder="请输入关键字">
53 67
 					</div>
54 68
 						<div class="form-group time-box">
55
-						<select class="form-control" id="itemid">
56
-							<option value="">请选择项目id</option>
57
-							<option value="0">未启动</option>
58
-							<option value="1">启动中</option>
69
+						<select class="form-control selectpicker" id="itemid" data-live-search="true">
70
+							<option value="">请选择项目</option>
59 71
 						</select>
60 72
 					</div>
61 73
 					<div class="form-group time-box">
@@ -170,6 +182,7 @@
170 182
 					$(".t-shade").removeClass("cx");
171 183
 					$('audio')[0].pause();
172 184
 				});
185
+				GetProject($('#itemid'));//获取项目
173 186
 			})
174 187
 			function initTable() {
175 188
 				//先销毁表格
@@ -335,6 +348,20 @@
335 348
 						$('<a href="' + $(val).attr('item') + '" class="sc_btn LY "download="' + $(val).attr('item') + '">下载录音</a>').appendTo(".LY_box");
336 349
 				}
337 350
 			}
351
+		
352
+			function GetProject(obj) {
353
+			    obj.empty();
354
+			    obj.append('<option selected="selected" value="">请选择项目</option>');
355
+			    $.getJSON(huayi.config.callcenter_url + "IVRWelcome/GetItems", function (data) {
356
+			        if (data.state.toLowerCase() == "success") {
357
+			            var content = data.data.ds;
358
+			            $(content).each(function (i, n) {
359
+			                $("<option value='" + n.projectname + "'>" + n.projectname + "</option>").appendTo(obj);
360
+			            })
361
+			            obj.selectpicker('refresh');
362
+			        }
363
+			    })
364
+			}
338 365
 		</script>
339 366
 	</body>
340 367
 </html>    

+ 62 - 25
CallCenterWeb.UI/TelCall/addWelcomeWords.html

@@ -3,10 +3,13 @@
3 3
 
4 4
 	<head>
5 5
 		<meta charset="UTF-8">
6
-		<title>黑名单管理</title>
6
+		<title>欢迎词添加</title>
7 7
 		<meta name="viewport" content="width=device-width, initial-scale=1.0">
8 8
 		<script src="../Script/Common/huayi.load.js"></script>
9 9
 		<script src="../Script/Common/huayi.config.js"></script>
10
+		<script src="../js/bootstrap-select/js/bootstrap-select.js"></script>
11
+		<script src="../js/bootstrap-select/js/i18n/defaults-zh_CN.js"></script>
12
+		<link href="../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
10 13
 		<script src="../js/laydate/laydate.js"></script>
11 14
 		<style>
12 15
 			.greetings{
@@ -50,6 +53,18 @@
50 53
 		    	    background: rgb(26, 179, 148);
51 54
 		    	    color: #fff;
52 55
 		    }
56
+		    .bootstrap-select .dropdown-toggle,.open .dropdown-toggle.btn-default{
57
+				    background: #fff!important;
58
+			}
59
+			.btn-default{
60
+				border-color: #e5e6e7;
61
+			}
62
+			.bootstrap-select.btn-group .dropdown-toggle .filter-option{
63
+				color: #555;
64
+			}
65
+			.bootstrap-select.btn-group .dropdown-menu li{
66
+				width: 100%;
67
+			}
53 68
 		</style>
54 69
 	</head>
55 70
 
@@ -57,20 +72,19 @@
57 72
 		<div class="container greetings">
58 73
 			<ul class="row clearfix form-horizontal">
59 74
 				<li class="form-group">
60
-					<label for="greetingTimes" class="col-md-2"><b class="text_require">*</b>项目Id</label>
75
+					<label for="greetingTimes" class="col-md-2"><b class="text_require">*</b>项&nbsp;&nbsp;目</label>
61 76
 					<div class="col-md-10 time-box">
62
-					<select id="itemid" class="form-control" >
63
-							<option value="0">项目1</option>
64
-							<option value="1">项目2</option>
65
-					</select>
77
+					<select class="form-control selectpicker" id="itemid" data-live-search="true">
78
+							<option value="">请选择项目</option>
79
+						</select>
66 80
 					</div>
67 81
 				</li>
68
-				<li class="form-group">
82
+				<!--<li class="form-group">
69 83
 					<label for="greetingRemark" class="col-md-2"><b class="text_require">*</b>项目名称</label>
70 84
 					<div class="col-md-10">
71 85
 						<input type="text" class="form-control" id="item" placeholder="请输入项目名称"  />
72 86
 					</div>
73
-				</li>
87
+				</li>-->
74 88
 				<li class="form-group">
75 89
 					<label for="greetingTimes" class="col-md-2"><b class="text_require">*</b>生效时限</label>
76 90
 					<div class="col-md-10 time-box">
@@ -128,26 +142,25 @@
128 142
                         upload();
129 143
                     });
130 144
                     if(ids){
131
-                    	getDetail(ids)
145
+                    	GetProject($('#itemid')).then(function(){
146
+                    		getDetail(ids)
147
+                    	})
148
+                    	
149
+                    }else{
150
+                    	GetProject($('#itemid'))
132 151
                     }
133 152
                     
134 153
 			})
135 154
 			//新增或者编辑
136 155
 			function addedit() {
137 156
 				if(!$("#itemid").val()) {
138
-					layer.confirm('请选择项目Id', {
139
-						icon: 2,
140
-						btn: ['确定'] //按钮
141
-					});
142
-					return;
143
-				}
144
-				if(!$("#item").val()) {
145
-					layer.confirm('请输入项目名称', {
157
+					layer.confirm('请选择项目', {
146 158
 						icon: 2,
147 159
 						btn: ['确定'] //按钮
148 160
 					});
149 161
 					return;
150 162
 				}
163
+				
151 164
 				if(!$("#greetingTimes").val()) {
152 165
 					layer.confirm('请选择时间', {
153 166
 						icon: 2,
@@ -166,7 +179,7 @@
166 179
 				$.post(huayi.config.callcenter_url + "IVRWelcome/AddIVRWords", {
167 180
 					id: ids,
168 181
 					itemid: $("#itemid").val(),//项目ID
169
-					item: $("#item").val(),//项目
182
+					item: $("#itemid").val(),//项目
170 183
 					loadpath: $("#loadpath").val(),//本地路径
171 184
 					filename: $("#filename").val(),//文件名称
172 185
 					path: $("#path").val(),//语音路径
@@ -185,7 +198,8 @@
185 198
 					}
186 199
 				})
187 200
 			}
188
-			function btn_subImport(){
201
+		
202
+		function btn_subImport(){
189 203
 				 $("#upFile").trigger('click')
190 204
 			}
191 205
 			function upload(){
@@ -205,6 +219,9 @@
205 219
 	                 * XMLHttpRequest会对 formdata 进行正确的处理
206 220
 	                 */
207 221
 	                processData: false,
222
+//	                beforeSend:function(){
223
+//	                	$('.fileName').text('正在导入文件,请稍后......')
224
+//	                },
208 225
 	                success: function (result) {
209 226
 	                    document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
210 227
 	                    $("#upFile").change(function () {
@@ -217,9 +234,13 @@
217 234
 	                        $('#filename').val(r.data.filename);
218 235
 	                        $('.fileName').text(r.data.filename);
219 236
 	                        $('#path').val(r.data.wavpath);
220
-	                        
237
+	                    }else{
238
+	                    	 layer.msg(r.message);
221 239
 	                    }
222
-	                }
240
+	                },
241
+//	                error:function(){
242
+//	                	$('.fileName').text('导入失败,请重新导入......')
243
+//	                }
223 244
 	            });
224 245
 			}
225 246
 		
@@ -236,8 +257,9 @@
236 257
 						},
237 258
 						success:function(data){
238 259
 							if(data.state.toLowerCase()=='success'){
239
-								$('#item').val(data.data.F_Item);
240
-								$('#itemid').val(data.data.F_ItemID);
260
+//								$('#item').val(data.data.F_Item);
261
+								$('#itemid').val(data.data.F_Item);
262
+								  $('#itemid').selectpicker('refresh');
241 263
 								$('#greetingTimes').val(data.data.F_StartDate+" ~ "+data.data.F_EndDate);
242 264
 								$('#isstate').val(data.data.F_IsState);
243 265
 								$('#filename').val(data.data.F_WavFileName);//文件名称
@@ -249,8 +271,23 @@
249 271
 						}
250 272
 					});
251 273
 			}
252
-		
253
-		
274
+		//获取项目下拉
275
+		function GetProject(obj) {
276
+			var dtd = $.Deferred(); //在函数内部,新建一个Deferred对象
277
+			    obj.empty();
278
+			    obj.append('<option selected="selected" value="">请选择项目</option>');
279
+			    $.getJSON(huayi.config.callcenter_url + "IVRWelcome/GetItems", function (data) {
280
+			        if (data.state.toLowerCase() == "success") {
281
+			            var content = data.data.ds;
282
+			            $(content).each(function (i, n) {
283
+			                $("<option value='" + n.projectname + "'>" + n.projectname + "</option>").appendTo(obj);
284
+			            })
285
+			            obj.selectpicker('refresh');
286
+			            dtd.resolve(); // 改变Deferred对象的执行状态
287
+			        }
288
+			    })
289
+			    	return dtd.promise(); // 返回promise对象
290
+			}
254 291
 		
255 292
 		</script>
256 293