		//上传文件
		function upload(upfiledom, filebox, typeArr, fileHandle) {
			var Files = document.getElementById(upfiledom).files;
			console.log(Files);
			if(Files.length > 0) {
				var formData = new FormData();
				for(var i = 0; i < Files.length; i++) {
					formData.append('file' + i, Files[i],filterName(Files[i].name));
				}
				formData.append("token", $.cookie("token"));
				var typeName = Files[0].name.split('.')[Files[0].name.split('.').length - 1];
				console.log(typeName)
				if(typeArr.indexOf(typeName) > -1) {
					$.ajax({
						url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
						type: "POST",
						data: formData,
						/**
						 *必须false才会自动加上正确的Content-Type
						 */
						contentType: false,
						/**
						 * 必须false才会避开jQuery对 formdata 的默认处理
						 * XMLHttpRequest会对 formdata 进行正确的处理
						 */
						processData: false,
						success: function(result) {
							document.getElementById(upfiledom).outerHTML = document.getElementById(upfiledom)
								.outerHTML;
							$('#' + upfiledom).change(function() {
								upload(upfiledom, filebox, typeArr, fileHandle);
							});
							var r = $.parseJSON(result);
							if(r.state.toLowerCase() == "success") {

								var a = r.data;
								$(a).each(function(i, n) {
									var strs = '<span class="files" fiel-num="' + n.F_FileId +
										'">' + n.F_FileName.substring(19) +
										'<i class="fa fa-remove del_file"></i></span>'
									$(strs).appendTo($(filebox)).find('.del_file').click(
										function(event) {
											event.stopPropagation();
											$(this).parent().remove();
											file_num(filebox, fileHandle)
										})
								})
								file_num(filebox, fileHandle);
							}
						}
					});
				} else {
					layer.msg("格式不正确");
				}

			} else {
				layer.confirm('请上传文件！', {
					btn: ['确定']
				});
			}
		}
		//上传文件隐藏域值
		function file_num(filebox, fileHandle) {
//			console.log(filebox, fileHandle)
			var str = "";
			var Str;
			$(filebox + ' .files').each(function(j, m) {
				var aa = $(m).attr("fiel-num");
				str += aa + ",";
				Str =
					str.substring(str.length - 1) == "," ?
					str.substring(0, str.length - 1) :
					str;
			});
			$(fileHandle).val(Str);
		}
		//文件名过滤特殊字符
		function filterName(s) {
			var pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\]<>/?~！@#￥……&*（）&mdash;—|{}【】%‘；：”“'。，、？]")
			var rs = "";
			for(var i = 0; i < s.length; i++) {
				rs = rs + s.substr(i, 1).replace(pattern, '');
			}
			return rs;
		}