Bladeren bron

申诉添加

liuyifan 5 jaren geleden
bovenliggende
commit
d9450e20e4

+ 180 - 11
WebUI/CallCenterWeb.UI/CommonHtml/addAppealOrder.html

@@ -135,6 +135,18 @@
135 135
 			.remark{
136 136
 				width: 75%;
137 137
 			}
138
+			.appeal-input{
139
+				width: 75%;
140
+				height: 34px;
141
+			}
142
+			#scwj{
143
+				    background-color: #FFF;
144
+			    background-image: none;
145
+			    border: 1px solid #ccc;
146
+			    border-radius: 1px;
147
+			    color: inherit;
148
+			    padding: 6px 12px!important;
149
+			}
138 150
 		</style>
139 151
 	</head>
140 152
 	<body>
@@ -153,7 +165,7 @@
153 165
                             </div>
154 166
 						</li>
155 167
 						<li class="form-group">
156
-							<label for="customer_layer" class="col-md-2" style="float: left;">通报原因:</label>
168
+							<label for="customer_layer" class="col-md-2 appeal-reason-title" style="float: left;">申诉原因:</label>
157 169
 							<div class="col-md-9" style="width: 75%; float: left; padding: 0;">
158 170
                                 <select name="" class="form-control orderType">
159 171
                                 	<option value="0">请选择通报原因</option>
@@ -164,10 +176,30 @@
164 176
 							<label for="customer_layer" class="col-md-2" style="float: left;">其他原因:</label>
165 177
 							<textarea name="" rows="" cols="" class="other_reasons"></textarea>
166 178
 						</li>
179
+						<li class="form-group">
180
+							<label for="customer_layer" class="col-md-2" style="float: left;">申诉依据:</label>
181
+							<input class="appeal-input" id="addBasis" />
182
+						</li>
183
+						<li class="form-group">
184
+							<label for="customer_layer" class="col-md-2" style="float: left;">申诉要求:</label>
185
+							<input class="appeal-input" id="addRequirement" />
186
+						</li>
167 187
 						<li class="form-group drop_down">
168 188
 							<label class="col-md-2" style="float: left;">申诉详情:</label>
169 189
 							<textarea name="" rows="" cols="" class="remark"></textarea>
170 190
 						</li>
191
+						<li>
192
+							<label for="customer_layer" class="col-md-2" style="float: left;">证明材料:</label>
193
+							<div class="fileBox">
194
+							</div>
195
+							<input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
196
+							<input class="input" type="button" value="上传" id="scwj" />
197
+							<input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
198
+							<input type="hidden" id="file" />
199
+							<span style="color:#FF0000; border: none;">
200
+								(文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
201
+							</span>
202
+						</li>
171 203
 					</ul>
172 204
 					<div class="form-group clearfix" style="text-align: center;">
173 205
 						<div class="col-md-offset-5 col-md-10">
@@ -181,7 +213,9 @@
181 213
 			<script type="text/javascript">
182 214
 				$(function(){
183 215
 					var id = helper.request.queryString("ids");
184
-					var wid = helper.request.queryString("wid")
216
+					var wid = helper.request.queryString("wid");
217
+					var assessment_list = helper.request.queryString("assessment_list");
218
+					var fid = helper.request.queryString("fid");
185 219
 					 	tree();
186 220
 					    //所属分类下拉
187 221
 					    $('.inps').focus(function () {
@@ -202,7 +236,15 @@
202 236
 					        $('.inps').val("");
203 237
 					        $("#PID").val("");
204 238
 					        $("#Dpment").val("");
205
-					    })
239
+						})
240
+						//上传附件
241
+						$("#scwj").click(function() {
242
+							$("#upFile").trigger("click");
243
+						})
244
+						$("#upFile").change(function() {
245
+							upload();
246
+						})
247
+
206 248
 					//获取部门
207 249
 					function tree() {
208 250
 			            $.get(huayi.config.callcenter_url + 'Department/GetDeptList', {
@@ -258,6 +300,39 @@
258 300
 							$('.reasons').css('display','none')
259 301
 						}
260 302
 					})
303
+
304
+					/*
305
+						获取通报详情
306
+						assessment_list = 8 为通报页面
307
+					*/
308
+					if(assessment_list === "8") {
309
+						$(".appeal-reason-title").text("通报原因:");
310
+						$(".orderType").attr("disabled","disabled");
311
+						$.get(huayi.config.callcenter_url + 'NoticeCriticism/GetNotice', {
312
+							nid: fid,
313
+							"token": $.cookie("token")
314
+						}, function(result) {
315
+							result = $.parseJSON(result);
316
+							if(result.state.toLowerCase() == "success") {
317
+								var con = result.data;
318
+								if(con.dModel.F_NoticeID==77){
319
+									$('.reasons').css('display','block')
320
+								}else{
321
+									$('.reasons').css('display','none')
322
+								}
323
+								$('.inps').val(con.NoticeDeptName);//部门名称
324
+								$("#PID").val(con.dModel.F_DeptIds);//部门id
325
+								$('.orderType').val(con.dModel.F_NoticeID);//通报原因
326
+								$('.other_reasons').val(con.dModel.F_Content);//其他原因
327
+							}
328
+						})
329
+					}
330
+
331
+
332
+					/* 
333
+						保存
334
+						判断 添加、修改
335
+					*/
261 336
 					$('#save_btns').click(function() {
262 337
 						if($('#PID').val() == '') {
263 338
 							layer.confirm('请选择 部门!', {
@@ -284,7 +359,12 @@
284 359
 								content: $('.other_reasons').val(),//其他原因
285 360
 								noticeinfo: noticeinfo,//通报内容
286 361
 								remark: $(".remark").val(),//申诉详情
287
-								"token": $.cookie("token")
362
+								basis: $("#addBasis").val(), //申诉依据
363
+								requirement: $("#addRequirement").val(), //申诉要求
364
+								files: $('#file').val(), //证明材料附件
365
+								type: assessment_list, //申诉信息分类
366
+								typeid: fid, //申诉信息id
367
+								"token": $.cookie("token"),
288 368
 							}, function(result) {
289 369
 								result = $.parseJSON(result);
290 370
 								if(result.state.toLowerCase() == "success") {
@@ -294,7 +374,7 @@
294 374
 									parent.$('#table1').bootstrapTable('refresh');
295 375
 								}
296 376
 							})
297
-						} else if (wid){
377
+						} else {
298 378
 							$.post(huayi.config.callcenter_url + 'Appeal/AddAppeal', {
299 379
 								deptids: $('#PID').val(),
300 380
 								noticeid: customertype,
@@ -302,7 +382,12 @@
302 382
 								noticeinfo: noticeinfo,//通报内容
303 383
 								workorderid: wid, //工单编号
304 384
 								remark: $(".remark").val(),//申诉详情
305
-								"token": $.cookie("token")
385
+								basis: $("#addBasis").val(), //申诉依据
386
+								requirement: $("#addRequirement").val(), //申诉要求
387
+								files:$('#file').val(), //证明材料附件
388
+								type: assessment_list, //申诉信息分类
389
+								typeid: fid, //申诉信息id
390
+								"token": $.cookie("token"),
306 391
 							}, function(result) {
307 392
 								result = $.parseJSON(result);
308 393
 								if(result.state.toLowerCase() == "success") {
@@ -324,19 +409,103 @@
324 409
 							result = $.parseJSON(result);
325 410
 							if(result.state.toLowerCase() == "success") {
326 411
 								var con = result.data;
327
-								if(con.dModel.F_NoticeID==77){
412
+								console.log("con",con)
413
+								if(con.dt[0].F_NoticeID==77){
328 414
 									$('.reasons').css('display','block')
329 415
 								}else{
330 416
 									$('.reasons').css('display','none')
331 417
 								}
332 418
 								$('.inps').val(con.NoticeDeptName);//部门名称
333
-								$("#PID").val(con.dModel.F_DeptIds);//部门id
334
-								$('.orderType').val(con.dModel.F_NoticeID);//通报原因
335
-								$('.other_reasons').val(con.dModel.F_Content);//其他原因
336
-								$('.remark').val(con.dModel.F_Remark);//其他原因
419
+								$("#PID").val(con.dt[0].F_DeptIds);//部门id
420
+								$('.orderType').val(con.dt[0].F_NoticeID);//通报原因
421
+								$('.other_reasons').val(con.dt[0].F_Content);//其他原因
422
+								$('.remark').val(con.dt[0].F_Remark);//其他原因
423
+								$("#addBasis").val(con.dt[0].F_Basis);//申诉依据
424
+								$("#addRequirement").val(con.dt[0].F_Requirement);//申诉要求
425
+								assessment_list = con.dt[0].F_Type; //申诉信息分类
426
+								fid = con.dt[0].F_TypeID; //申诉信息id;
427
+								$(con.dt[0].File).each(function(k,q){
428
+									var strs='<span class="files" fiel-num="'+ q.F_FileId +'">'+ q.F_FileName.substring(19) +'<i class="fa fa-remove del_file"></i></span>'
429
+									$(strs).appendTo($('.fileBox')).find('.del_file').click(function(event){
430
+										event.stopPropagation();
431
+										$(this).parent().remove();
432
+											file_num()
433
+											console.log($('.fileBox').find('.del_file'))
434
+									})
435
+									file_num()
436
+								})
337 437
 							}
338 438
 						})
339 439
 					}
440
+
441
+					//上传文件
442
+					function upload() {
443
+						var Files = document.getElementById("upFile").files;
444
+						if(Files.length > 0) {
445
+							var formData = new FormData();
446
+							for(var i = 0; i < Files.length; i++) {
447
+								formData.append('file' + i, Files[i]);;
448
+							}
449
+							console.log(formData)
450
+							formData.append("token", $.cookie("token"));
451
+							var typeName=Files[0].name.split('.')[1];
452
+							if (typeName=="png"||typeName=='jpg'||typeName=='mp4'||typeName=='mp3'||typeName=='pdf'||typeName=='doc'||typeName=='docx'||typeName=='xls'||typeName=='xlsx') {
453
+								$.ajax({
454
+									url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
455
+									type: "POST",
456
+									data: formData,
457
+									/**
458
+									 *必须false才会自动加上正确的Content-Type
459
+										*/
460
+									contentType: false,
461
+									/**
462
+									 * 必须false才会避开jQuery对 formdata 的默认处理
463
+									 * XMLHttpRequest会对 formdata 进行正确的处理
464
+									 */
465
+									processData: false,
466
+									success: function(result) {
467
+										document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
468
+										$("#upFile").change(function() {
469
+											upload();
470
+										});
471
+										var r = $.parseJSON(result);
472
+										if(r.state.toLowerCase() == "success") {
473
+											//								$(".fjnr").text(r.data[0].F_FileName);
474
+											var a = r.data;
475
+											$(a).each(function(i, n) {
476
+												var strs = '<span class="files" fiel-num="' + n.F_FileId + '">' + n.F_FileName.substring(19) + '<i class="fa fa-remove del_file"></i></span>'
477
+												$(strs).appendTo($('.fileBox')).find('.del_file').click(function(event) {
478
+													event.stopPropagation();
479
+													$(this).parent().remove();
480
+													file_num()
481
+												})
482
+											})
483
+											file_num()
484
+										}
485
+									}
486
+								});
487
+							}else{
488
+								layer.msg("格式不正确");
489
+							}
490
+						} else {
491
+							layer.confirm('请上传文件!', {
492
+								btn: ['确定']
493
+							});
494
+						}
495
+					}
496
+					//上传文件隐藏域值
497
+					function file_num() {
498
+						var str = '';
499
+						var Str;
500
+						$('.fileBox .files').each(function(j, m) {
501
+							var aa = $(m).attr("fiel-num")
502
+							console.log(aa);
503
+							str += aa + ",";
504
+							Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
505
+						})
506
+						$("#file").val(Str);
507
+					}
508
+
340 509
 				})
341 510
 			</script>
342 511
 		<!--<script src="../js/bootstrap-select/js/bootstrap-select.js"></script>-->

+ 2 - 2
WebUI/CallCenterWeb.UI/CommonHtml/dealWithAppeal.html

@@ -21,10 +21,10 @@
21 21
 				<div class="tab_contents" id="tab_user_contents">
22 22
 					<ul class="project_items form-horizontal showtabs">
23 23
 						<li class="form-group">
24
-							<label for="customer_layer" class="col-md-2" style="float: left;">处理申诉:</label>
24
+							<label for="customer_layer" class="col-md-2" style="float: left;">审核申诉:</label>
25 25
 							<div class="col-md-9" style="width: 75%; float: left; padding: 0;">
26 26
                                 <select name="" class="form-control" id="dealWithappeal">
27
-									<option value="0">请选择是否处理申诉</option>
27
+									<option value="0">是否审核申诉</option>
28 28
                                 	<option value="1">是</option>
29 29
                                 	<option value="2">否</option>
30 30
                                 </select>

+ 9 - 5
WebUI/CallCenterWeb.UI/js/notification/appealOrder.js

@@ -68,7 +68,7 @@ $(function(){
68 68
             type: 2,
69 69
             title: '添加申诉信息',
70 70
             maxmin: true, //开启最大化最小化按钮
71
-            area: ['40%', '50%'],
71
+            area: ['40%', '60%'],
72 72
             content: '../CommonHtml/addAppealOrder.html'
73 73
         });
74 74
     })
@@ -89,7 +89,7 @@ $(function(){
89 89
                 type: 2,
90 90
                 title: '修改申诉信息',
91 91
                 maxmin: true, //开启最大化最小化按钮
92
-                area: ['40%', '50%'],
92
+                area: ['40%', '60%'],
93 93
                 content: '../CommonHtml/addAppealOrder.html?ids=' + did
94 94
             });
95 95
         }
@@ -169,15 +169,19 @@ function formatterAppealState(val, row) {
169 169
 
170 170
 //操作
171 171
 function formatterOperation(val, row) {
172
-    return '<a href="javascript:;" class="btn-deal-with" authorize="yes" id="HY_dealWith_' + row.F_Id + '" onclick="btn_dealWith(\'' + row.F_Id + '\')" title="处理">处理</a>';
172
+    if (row.F_State === 0) {
173
+        return '<a href="javascript:;" class="btn-deal-with" authorize="yes" id="HY_dealWith_' + row.F_Id + '" onclick="btn_dealWith(\'' + row.F_Id + '\')" title="审核">审核</a>';
174
+    } else {
175
+        return "-";
176
+    }
173 177
 }
174 178
 
175
-//处理申诉
179
+//审核申诉
176 180
 function btn_dealWith(ids) {
177 181
     did = ids.toString();
178 182
     layer.open({
179 183
         type: 2,
180
-        title: '处理申诉信息',
184
+        title: '申诉信息',
181 185
         maxmin: true, //开启最大化最小化按钮
182 186
         area: ['40%', '30%'],
183 187
         content: '../CommonHtml/dealWithAppeal.html?ids=' + did