areaManager_list.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. $(function () {
  2. var status = $("#statu").val();
  3. var apply_type = $("#apply_type").val();
  4. var buttonStatus = $("#buttonStatus").val();
  5. if(status == 2){
  6. // wj 添加简易流程分发
  7. if(apply_type == 2 || apply_type == 3 ){
  8. //$('#jylctg').css({ "display": "inline-block" });
  9. $('#jylcff').css({ "display": "inline-block" });
  10. }
  11. $("#fsgbm").css({ "display": "inline-block" });
  12. //待分发没有退回按钮status
  13. //$("#bh").css({ "display": "inline-block" });
  14. }else if(status == 3){
  15. $("#hgxsctg").css({ "display": "inline-block" });
  16. //$("#hgxscbh").css({ "display": "inline" });
  17. }else if (status == 4){
  18. $("#lhpytj").css({ "display": "inline-block" });
  19. $("#sfzdtz").css({ "display": "inline-block" });
  20. $("#bh").css({ "display": "inline-block" });
  21. }else if (status == 11){
  22. /*if(buttonStatus == 0){
  23. $("#jrqzfsp").css({ "display": "inline" });
  24. $("#bh").css({ "display": "inline" });
  25. }
  26. if(buttonStatus == 1){
  27. $("#jrlhpy").css({ "display": "inline" });
  28. $("#bh").css({ "display": "inline" });
  29. }*/
  30. $("#hgxscbf").css({ "display": "inline-block" });
  31. $("#jrqzfsp").css({ "display": "inline-block" });
  32. $("#jrlhpy").css({ "display": "inline-block" });
  33. $("#bh").css({ "display": "inline-block" });
  34. }else if(status == 6){
  35. $("#zftg").css({ "display": "inline-block" });
  36. $("#btg").css({ "display": "inline-block" });
  37. }else if(status == 14) {
  38. //简易流程会签
  39. // $("#tyqyjylc").css({ "display": "inline-block" });
  40. // $("#jjqyjylc").css({ "display": "inline-block" });
  41. $("#easy_process_approved").css({"display": "inline-block"});
  42. $("#easy_process_deny").css({"display": "inline-block"});
  43. }
  44. // }else if(status == 15){
  45. // //简易流程汇总
  46. // $("#jylctg").css({ "display": "inline-block" });
  47. // $("#fsgbm").css({ "display": "inline-block" });
  48. // $("#bh").css({ "display": "inline-block" });
  49. // }
  50. });
  51. /*
  52. 参数解释:
  53. title 标题
  54. url 请求的url
  55. id 需要操作的数据id
  56. w 弹出层宽度(缺省调默认值)
  57. h 弹出层高度(缺省调默认值)
  58. */
  59. /*审核*/
  60. function area_approval(title, url, w, h) {
  61. var index = layer_show(title, pagePath+url, w, h);
  62. //默认全屏
  63. layer.full(index);
  64. }
  65. /*详情*/
  66. function area_details(title, url, w, h) {
  67. var index = layer_show(title, pagePath+url, w, h);
  68. //默认全屏
  69. layer.full(index);
  70. }
  71. function select_department(title, url, w, h) {
  72. var id = $("#apply_id").val();
  73. layer_show(title, pagePath+url+"&id="+id, w, h);
  74. // layer.full(index);
  75. }
  76. //附件上传
  77. function fileUpload(){
  78. var id = $("#apply_id").val();
  79. var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
  80. var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
  81. var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
  82. var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
  83. if(isIE) {
  84. var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
  85. reIE.test(userAgent);
  86. var fIEVersion = parseFloat(RegExp["$1"]);
  87. if(fIEVersion == 7 || fIEVersion == 8 || fIEVersion == 9 || fIEVersion == 10 || isIE11) {
  88. console.log("这是IE:"+fIEVersion);
  89. $("#fileForm").ajaxSubmit({
  90. success: function (data) {
  91. console.log(data);
  92. },
  93. error: function (error) {
  94. console.log(error);
  95. },
  96. url:pagePath +"/areaManager/fileUpload?id="+id ,
  97. type: "post",
  98. dataType: "json"
  99. });
  100. }
  101. }else{
  102. var form = $('#fileForm')[0];
  103. var data = new FormData(form);
  104. $.ajax({
  105. type: "POST",
  106. enctype: 'multipart/form-data',
  107. url:pagePath +"/areaManager/fileUpload" ,
  108. data: data,
  109. processData: false,
  110. contentType: false,
  111. cache: false,
  112. timeout: 600000,
  113. success: function (data) {
  114. console.log("SUCCESS : ", data);
  115. },
  116. error: function (e) {
  117. console.log("ERROR : ", e);
  118. }
  119. })
  120. }
  121. }
  122. function submit1(type) {
  123. $.ajax({
  124. type: "POST",
  125. dataType: "json",
  126. url: pagePath +"/areaManager/submit?id="+id+"&comment="+comment+"&type="+type+"&apply_type_str="+apply_type_str+"&fileDown.file_id=9999" ,
  127. data: $('#form-content-add').serialize(),
  128. success: function (data) {
  129. if (data.success) {
  130. succeedMessage(data.message);
  131. setTimeClose();
  132. } else {
  133. errorMessage(data.message);
  134. }
  135. },
  136. error: function () {
  137. errorMessage('系统错误!');
  138. }
  139. });
  140. return false;
  141. }
  142. function cancle(){
  143. var index = parent.layer.getFrameIndex(window.name);
  144. parent.layer.close(index);
  145. }
  146. /*撤回*/
  147. function withdraw(applyId){
  148. layer.confirm(
  149. '确认撤回吗?',
  150. function(index){
  151. var url = "/stockLand/withdraw/"+applyId;
  152. //此处请求后台程序,下方是成功后的前台处理……
  153. $.ajax({
  154. type:"POST",
  155. dataType:"json",
  156. url: pagePath+url,
  157. data:{
  158. "timestamp":new Date().getTime()
  159. },
  160. success: function (result) {
  161. if (result.success) {
  162. smileMessage(result.message)
  163. setTime();
  164. } else {
  165. errorMessage(result.message);
  166. }
  167. },
  168. error: function () {
  169. errorMessage('系统错误!');
  170. }
  171. });
  172. }
  173. );
  174. }