Browse Source

呼叫转移时间设置

zhangshuangnan 8 years ago
parent
commit
bd0d2775cb

+ 125 - 0
CallCenterWeb.UI/TelCall/js/transferTimeSetting.js

@@ -0,0 +1,125 @@
1
+var token = $.cookie("token");
2
+			$(document).ready(function(){
3
+				  $.ajax({
4
+			    		type:"get",
5
+			    		url:huayi.config.callcenter_url + 'UserAccount/GetCallForwarding',
6
+			    		async:true,
7
+			    		dataType:'json',
8
+			    		data:{
9
+			    		        token: token,	
10
+			    		},
11
+			    		success:function(res){
12
+			    			if(res.state.toLowerCase()=='success'){
13
+			    				$('.tables').html('');
14
+			    				$(res.data).each(function(i,n){
15
+			    					$('<tr>'+
16
+										'<th><a href="javaScript:;" class="removes" onclick="del(this)"><i class="fa fa-remove"></i></a>时间段'+ parseInt(i+1) +':</th>'+
17
+										'<td>'+
18
+											'<div class="timeBox">'+
19
+												'<i class="fa fa-clock-o tub"></i>'+
20
+												'<input type="text" class="test-item" id="usestrTime2" value="'+ n.starttime+'" />'+
21
+											'</div> &nbsp;'+
22
+											'<span>至</span> &nbsp;'+
23
+											'<div class="timeBox">'+
24
+												'<i class="fa fa-clock-o tub"></i>'+
25
+											    '<input type="text" class="test-item" id="usestrTime22" value="'+ n.endtime +'" name="starttime1" />'+
26
+											'</div>'+
27
+										'</td>'+
28
+									'</tr>').appendTo('.tables');
29
+			    				})
30
+			    				layerdate()
31
+			    			}
32
+			    		}
33
+			    	});
34
+			    //时间赋值 layerdate
35
+			   function layerdate(){
36
+			   		lay('.test-item').each(function(){
37
+									    laydate.render({
38
+									      elem: this
39
+									      ,trigger: 'click'
40
+									      ,type: 'time'
41
+									     });
42
+									  });
43
+			   }
44
+		    	$('#addto').click(function(){
45
+		    		var trs=$('.tables tr').length,lths=parseInt(trs+1);
46
+		    		console.log(trs);
47
+		    		for(var i=trs;i<lths;i++){
48
+		    			$('<tr>'+
49
+							'<th><a href="javaScript:;" class="removes" onclick="del(this)"><i class="fa fa-remove"></i></a>时间段'+ parseInt(i+1) +':</th>'+
50
+							'<td>'+
51
+								'<div class="timeBox">'+
52
+									'<i class="fa fa-clock-o tub"></i>'+
53
+									'<input type="text" class="test-item" id="usestrTime2" />'+
54
+								'</div> &nbsp;'+
55
+								'<span>至</span> &nbsp;'+
56
+								'<div class="timeBox">'+
57
+									'<i class="fa fa-clock-o tub"></i>'+
58
+								    '<input type="text" class="test-item" id="usestrTime22"  />'+
59
+								'</div>'+
60
+							'</td>'+
61
+						'</tr>').appendTo('.tables');
62
+		    		}
63
+		    		layerdate()
64
+		    	})
65
+				$('#del').click(function(){
66
+				 	$('.removes').show();
67
+				 })
68
+			
69
+				 $('#save').click(function(){
70
+				 	save()
71
+				 })
72
+				 
73
+				
74
+				  
75
+			})
76
+				 //删除
77
+				 function del(a){
78
+				 	$(a).parent().parent('tr').remove();
79
+				 	save();
80
+				 }
81
+				 //拼字符串
82
+				 function str(){
83
+				 	var arr='';
84
+				 	$('.tables tr').each(function(i,n){
85
+				 		var htmlStr='';
86
+//				 		console.log($(n).find('input'))
87
+				 		$($(n).find('input')).each(function(k,m){
88
+				 			if(htmlStr){
89
+				 				htmlStr +=','
90
+				 				htmlStr +=m.value;
91
+				 			}else{
92
+				 				htmlStr +=m.value;
93
+				 			}
94
+				 		})
95
+						if(arr){
96
+								arr +='|'
97
+				 				arr +=htmlStr;
98
+						}else{
99
+							arr +=htmlStr;
100
+						}
101
+				 	})
102
+				    return arr
103
+				 }
104
+		
105
+				//保存提交
106
+				 function save(){
107
+				 	  $.ajax({
108
+			    		type:"get",
109
+			    		url:huayi.config.callcenter_url +'UserAccount/EditCallForwarding',
110
+			    		async:true,
111
+			    		dataType:'json',
112
+			    		data:{
113
+			    		        token: token,
114
+			    		        timestr:str()
115
+			    		},
116
+			    		success:function(res){
117
+			    			if(res.state.toLowerCase()=='success'){
118
+			    			  layer.msg(res.message)
119
+			    			}
120
+			    			
121
+			    		}
122
+			    	})
123
+				 }
124
+				 
125
+		

+ 125 - 0
CallCenterWeb.UI/TelCall/transferTimeSetting.html

@@ -0,0 +1,125 @@
1
+<!DOCTYPE html>
2
+<html>
3
+	<head>
4
+		<meta charset="UTF-8">
5
+		<script src="../Script/Common/huayi.load.js"></script>
6
+		<script src="../Script/Common/huayi.http.js"></script>
7
+		<script src="../Script/Common/huayi.config.js"></script>
8
+		<script src="../js/laydate/laydate.js"></script>
9
+		<link rel="stylesheet" href="../css/init.css" />
10
+		  <link rel="stylesheet" type="text/css" href="../js/layui/css/layui.css" />
11
+		<title></title>
12
+		<style>
13
+			.bjCon table th {
14
+				padding: 5px 8px 5px 0;
15
+				text-align: right;
16
+				width: 30%;
17
+			}
18
+			
19
+			.bjCon table td {
20
+				padding: 6px 0 5px 10px;
21
+				text-align: left;
22
+				color: #717171;
23
+				line-height: 200%;
24
+			}
25
+			.bjCon table td .timeBox{
26
+				
27
+				display: inline-block;
28
+				position: relative;
29
+			}
30
+			
31
+			.bjCon table td input {
32
+				border: 1px solid #e5e5e5;
33
+				width: 240px;
34
+				outline: 0;
35
+				margin-right: 5px;
36
+				padding-left: 35px;
37
+			}
38
+			.tub {
39
+				position: absolute;
40
+			    left: 6px;
41
+			    top: 7px;
42
+			    font-size: 18px;
43
+			    color: #ccc;
44
+			}
45
+			.removes{
46
+				vertical-align: middle;
47
+				margin-right: 10px;
48
+				display: none;
49
+			}
50
+		</style>
51
+	</head>
52
+	<body class="gray-bg">
53
+		<div class="container-fluid wrapper-content animated fadeInRight">
54
+			<div class="daoHang clearfix">
55
+	            <div class="dhLeft">
56
+	                <sapn>
57
+	                    <i class="syIcon"></i>位置:
58
+	                    <a id="ReIndex" href="javaScript:;">首页</a>&gt;
59
+	                    <a href="javaScript:;">话务管理</a>&gt;
60
+	                    <a href="javaScript:;" style="color: #000;">呼叫转移时间设置</a>
61
+	                </sapn>
62
+	            </div>
63
+        </div>
64
+			<div class="timeBox">
65
+				 <div class="anniu layui-btn-group" style="margin: 20px 0;">
66
+                <button class="btns layui-btn" id="addto"><i class="fa fa-plus" style="margin-right: 5px;"></i>添加</button>
67
+                <button class="btns layui-btn" id="del"><i class="fa fa-remove" style="margin-right: 5px;"></i>删除</button>
68
+                <button class="btns layui-btn" id="save"><i class="fa fa-save" style="margin-right: 5px;"></i>保存</button>
69
+            </div>
70
+				<div class="bjCon ">
71
+						<table style="width: 100%;" class="tables">
72
+							<tr>
73
+								<th>时间段1:</th>
74
+								<td>
75
+									<div class="timeBox">
76
+										<i class="fa fa-clock-o tub"></i>
77
+										<input type="text" class="test-item" id="usestrTime1" readonly="readonly" name="starttime1" />
78
+									</div>
79
+									<span>至</span>
80
+									<div class="timeBox">
81
+										<i class="fa fa-clock-o tub"></i>
82
+									    <input type="text" class="test-item" id="usestrTime11" readonly="readonly" name="starttime1" />
83
+									</div>
84
+									
85
+								</td>
86
+							</tr>
87
+							<tr>
88
+								<th>时间段2:</th>
89
+								<td>
90
+									<div class="timeBox">
91
+										<i class="fa fa-clock-o tub"></i>
92
+										<input type="text" class="test-item" id="usestrTime2" readonly="readonly" name="starttime1" />
93
+									</div>
94
+									<span>至</span>
95
+									<div class="timeBox">
96
+										<i class="fa fa-clock-o tub"></i>
97
+									    <input type="text" class="test-item" id="usestrTime22" readonly="readonly" name="starttime1" />
98
+									</div>
99
+									
100
+								</td>
101
+							</tr>
102
+							<tr>
103
+								<th>时间段3:</th>
104
+								<td>
105
+									<div class="timeBox">
106
+										<i class="fa fa-clock-o tub"></i>
107
+										<input type="text" class="test-item" id="usestrTime3" readonly="readonly" name="starttime1" />
108
+									</div>
109
+									<span>至</span>
110
+									<div class="timeBox">
111
+										<i class="fa fa-clock-o tub"></i>
112
+									    <input type="text" class="test-item" id="usestrTime33" readonly="readonly" name="starttime1" />
113
+									</div>
114
+									
115
+								</td>
116
+							</tr>
117
+						</table>
118
+					</div>
119
+					
120
+			</div>
121
+					
122
+		</div>
123
+		<script src="js/transferTimeSetting.js"></script>
124
+	</body>
125
+</html>