entity_AttendanceImportFileInfo.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. function upload_attendanceimportfileinfo() {
  2. //开始上传具体的文件
  3. $.ajaxFileUpload({
  4. //处理文件上传操作的服务器端地址(可以传参数,已亲测可用)
  5. url: '../servlet/upload/',
  6. data:{},
  7. secureuri:false, //是否启用安全提交,默认为false
  8. fileElementId:'file', //文件选择框的id属性
  9. dataType:'text', //服务器返回的格式,可以是json或xml等
  10. success:function( data, status){ //服务器响应成功时的处理函数
  11. $('#result').html("数据导入成功!");
  12. },
  13. error:function(data, status, e){ //服务器响应失败时的处理函数
  14. console.log(e);
  15. console.log(data);
  16. $('#result').html('上传失败,请重试!!');
  17. }
  18. });
  19. }
  20. function download_attendanceimportfileinfo( id ) {
  21. if( id == null || id == undefined || id == "" ){
  22. alert("请输入ID");
  23. return false;
  24. }
  25. window.open( '../servlet/download/'+id+'/stream' );
  26. }
  27. function data_get_attendanceimportfileinfo( id ) {
  28. var query_url = '../jaxrs/attendanceimportfileinfo/' + id;
  29. //如果未输入ID,那么就查询所有的应用信息
  30. if( id == null || id == undefined || id == "" ){
  31. query_url = '../jaxrs/attendanceimportfileinfo/list/all';
  32. }
  33. $.ajax({
  34. type : 'get',
  35. dataType : 'json',
  36. contentType : 'application/json; charset=utf-8',
  37. url : query_url,
  38. xhrFields : {
  39. 'withCredentials' : true
  40. },
  41. crossDomain : true
  42. }).done(function(json) {
  43. $('#result').html( JSON.stringify( json, null, 4) );
  44. }).fail(function(json) {
  45. failure(json);
  46. });
  47. }
  48. function data_delete_attendanceimportfileinfo( id ) {
  49. if( id == null || id == undefined || id == "" ){
  50. alert("请输入ID");
  51. return false;
  52. }
  53. $.ajax({
  54. type : 'delete',
  55. dataType : 'json',
  56. contentType : 'application/json; charset=utf-8',
  57. url : '../jaxrs/attendanceimportfileinfo/' + id ,
  58. xhrFields : {
  59. 'withCredentials' : true
  60. },
  61. crossDomain : true
  62. }).done(function(json) {
  63. $('#result').html(JSON.stringify(json.data, null, 4));
  64. });
  65. }