d123 8 anni fa
parent
commit
99eec03347
1 ha cambiato i file con 87 aggiunte e 4 eliminazioni
  1. 87 4
      WebUI/CallCenterWeb.UI/CommonHtml/banli.html

+ 87 - 4
WebUI/CallCenterWeb.UI/CommonHtml/banli.html

8
 		<link href="../css/layer/need/layer.css" />
8
 		<link href="../css/layer/need/layer.css" />
9
 		<link rel="stylesheet" href="../css/init.css" />
9
 		<link rel="stylesheet" href="../css/init.css" />
10
 		<title>办理工单</title>
10
 		<title>办理工单</title>
11
+		<style>
12
+			.input {
13
+				background-color: #FFF;
14
+				background-image: none;
15
+				border: 1px solid #ccc;
16
+				border-radius: 1px;
17
+				color: inherit;
18
+				padding: 6px 12px
19
+			}
20
+			
21
+			.fjnr {
22
+				padding: 0!important;
23
+				border: none!important;
24
+			}
25
+		</style>
11
 	</head>
26
 	</head>
12
 
27
 
13
 	<body>
28
 	<body>
17
 					<th class="Importent">办理人:</th>
32
 					<th class="Importent">办理人:</th>
18
 					<td> <input  id="dealman" type="text"  style="height: 32px;"></td>
33
 					<td> <input  id="dealman" type="text"  style="height: 32px;"></td>
19
 				</tr>
34
 				</tr>
20
-				<!--<tr>
35
+				<tr>
21
 					<th class="Importent">附件:</th>
36
 					<th class="Importent">附件:</th>
22
-					<td> <input type="text" name="" id="" value="" /></td>
23
-				</tr>-->
37
+					<td> 
38
+						<span class="fjnr"></span>
39
+								<input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
40
+								<input class="input" type="button" value="上传" id="scwj" />
41
+								<input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
42
+								<input type="hidden" id="file" />
43
+					</td>
44
+				</tr>
24
 				<tr>
45
 				<tr>
25
 					<th class="Importent">办理内容:</th>
46
 					<th class="Importent">办理内容:</th>
26
 					<td><textarea id="result" name="" rows="" cols=""></textarea></td>
47
 					<td><textarea id="result" name="" rows="" cols=""></textarea></td>
41
 					Detail();	
62
 					Detail();	
42
 			$(document).ready(function() {
63
 			$(document).ready(function() {
43
 				
64
 				
44
-			
65
+			//上传附件
66
+				$("#scwj").click(function() {
67
+					$("#upFile").trigger("click");
68
+				})
69
+				$("#upFile").change(function() {
70
+					upload();
71
+				})
72
+				$("#scfj").click(function() {
73
+					$(".fjnr").text("");
74
+					$("#scfj").hide();
75
+				})
45
 				$('.BC').click(function() {
76
 				$('.BC').click(function() {
46
 					if($("#dealman").val()==""){
77
 					if($("#dealman").val()==""){
47
 						layer.msg("办理人不能为空");
78
 						layer.msg("办理人不能为空");
72
 					result: $('#result').val(), //办理内容
103
 					result: $('#result').val(), //办理内容
73
 					state: State,
104
 					state: State,
74
 					feedbackid:a,
105
 					feedbackid:a,
106
+					files:$("#file").val(),
75
 					token: $.cookie("token")
107
 					token: $.cookie("token")
76
 				}, function(result) {
108
 				}, function(result) {
77
 					result = JSON.parse(result);
109
 					result = JSON.parse(result);
107
 				$("#startTime").val(''), 
139
 				$("#startTime").val(''), 
108
 				$('#assignedopinion').val('')
140
 				$('#assignedopinion').val('')
109
 			}
141
 			}
142
+			//上传文件
143
+			function upload() {
144
+				var Files = document.getElementById("upFile").files;
145
+				if(Files.length > 0) {
146
+					var formData = new FormData();
147
+					for(var i = 0; i < Files.length; i++) {
148
+						formData.append('file' + i, Files[i]);
149
+					}
150
+					formData.append("token", $.cookie("token"));
151
+					$.ajax({
152
+						url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
153
+						type: "POST",
154
+						data: formData,
155
+						/**
156
+						 *必须false才会自动加上正确的Content-Type
157
+						 */
158
+						contentType: false,
159
+						/**
160
+						 * 必须false才会避开jQuery对 formdata 的默认处理
161
+						 * XMLHttpRequest会对 formdata 进行正确的处理
162
+						 */
163
+						processData: false,
164
+						success: function(result) {
165
+							document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
166
+							$("#upFile").change(function() {
167
+								upload();
168
+							});
169
+							var r = $.parseJSON(result);
170
+							if(r.state.toLowerCase() == "success") {
171
+								$(".fjnr").text(r.data[0].F_FileName);
172
+								var a = r.data;
173
+								var str = '';
174
+								var Str;
175
+
176
+								$(a).each(function(i, n) {
177
+									console.log(n.F_FileId);
178
+									str += n.F_FileId + ",";
179
+									Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
180
+									console.log(Str);
181
+								})
182
+								$("#file").val(Str);
183
+								$("#scfj").show();
184
+							}
185
+						}
186
+					});
187
+				} else {
188
+					layer.confirm('请上传文件!', {
189
+						btn: ['确定']
190
+					});
191
+				}
192
+			}
110
 		</script>
193
 		</script>
111
 	</body>
194
 	</body>
112
 
195