Sin descripción

Leader.html 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="../Script/Common/huayi.load.js"></script>
  6. <script src="../Script/Common/huayi.config.js"></script>
  7. <link href="../css/layer/need/layer.css" />
  8. <link rel="stylesheet" href="../css/init.css" />
  9. <title>领导批示</title>
  10. <style>
  11. .input {
  12. background-color: #FFF;
  13. background-image: none;
  14. border: 1px solid #ccc;
  15. border-radius: 1px;
  16. color: inherit;
  17. padding: 6px 12px
  18. }
  19. .fjnr {
  20. padding: 0!important;
  21. border: none!important;
  22. }
  23. </style>
  24. </head>
  25. <body>
  26. <div class="Common">
  27. <table>
  28. <tr>
  29. <th class="Importent">批示人:</th>
  30. <td> <input type="text" id="superuser"/></td>
  31. </tr>
  32. <tr>
  33. <th class="Importent">批示内容:</th>
  34. <td colspan="2"><textarea data-adaptheight id="superopinion" name="" rows="6" cols=""></textarea></td>
  35. </tr>
  36. <tr>
  37. <th>附件上传:</th>
  38. <td colspan="7">
  39. <!--<span class="fjnr"></span>-->
  40. <div class="fileBox"></div>
  41. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
  42. <input class="input" type="button" value="上传" id="scwj" />
  43. <!--<input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />-->
  44. <input type="hidden" id="file" />
  45. <span style="color:#FF0000; border: none;">
  46. (文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
  47. </span>
  48. </td>
  49. </tr>
  50. </table>
  51. <div class="btn_box">
  52. <button class="btns">保存</button>
  53. </div>
  54. </div>
  55. <script src="../css/laydate/laydate.js"></script>
  56. <script src="../js/adjustHeight.js"></script>
  57. <script src="../Script/Common/huayi.common.js"></script>
  58. <script>
  59. var wid = helper.request.queryString("wid");
  60. $(document).ready(function() {
  61. //上传附件
  62. $("#scwj").click(function() {
  63. $("#upFile").trigger("click");
  64. })
  65. $("#upFile").change(function() {
  66. upload('upFile','.fileBox',['png','jpg','mp3','mp4','pdf','doc','docx','xls','xlsx'],"#file");
  67. })
  68. // $("#scfj").click(function() {
  69. // $(".fjnr").text("");
  70. // $("#scfj").hide();
  71. // })
  72. $(".btns").click(function(){
  73. JA();
  74. })
  75. })
  76. //批示
  77. function JA() {
  78. $.post(huayi.config.callcenter_url + 'WorkOrder/SuperWorkOrder', {
  79. workorderid: wid,
  80. type:1,//(1领导批示 2市长指示)
  81. superuser:$("#superuser").val(),//批示人&
  82. superopinion:$('#superopinion').val(),//批示内容&
  83. files:$("#file").val(),//附件id(多个用英文逗号,隔开
  84. "token": $.cookie("token")
  85. }, function(result) {
  86. result = JSON.parse(result);
  87. if(result.state.toLowerCase() == "success") {
  88. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  89. parent.layer.close(index); //再执行关闭
  90. parent.$('#orderlist').bootstrapTable('refresh');
  91. parent.layer.msg("操作成功");
  92. $('.fileBox').html('');
  93. }
  94. })
  95. }
  96. // function upload() {
  97. // var Files = document.getElementById("upFile").files;
  98. // if(Files.length > 0) {
  99. // var formData = new FormData();
  100. // for(var i = 0; i < Files.length; i++) {
  101. // formData.append('file' + i, Files[i]);
  102. // }
  103. // formData.append("token", $.cookie("token"));
  104. // var typeName=Files[0].name.split('.')[1];
  105. // if (typeName=="png"||typeName=='jpg'||typeName=='mp4'||typeName=='mp3'||typeName=='pdf'||typeName=='doc'||typeName=='docx'||typeName=='xls'||typeName=='xlsx') {
  106. // $.ajax({
  107. // url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  108. // type: "POST",
  109. // data: formData,
  110. // /**
  111. // *必须false才会自动加上正确的Content-Type
  112. // */
  113. // contentType: false,
  114. // /**
  115. // * 必须false才会避开jQuery对 formdata 的默认处理
  116. // * XMLHttpRequest会对 formdata 进行正确的处理
  117. // */
  118. // processData: false,
  119. // success: function(result) {
  120. // document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  121. // $("#upFile").change(function() {
  122. // upload();
  123. // });
  124. // var r = $.parseJSON(result);
  125. // if(r.state.toLowerCase() == "success") {
  126. // var a = r.data;
  127. // $(a).each(function(i, n) {
  128. // var strs='<span class="files" fiel-num="'+ n.F_FileId +'">'+ n.F_FileName.substring(19) +'<i class="fa fa-remove del_file"></i></span>'
  129. // $(strs).appendTo($('.fileBox')).find('.del_file').click(function(event){
  130. // event.stopPropagation();
  131. // $(this).parent().remove();
  132. // file_num();
  133. // });
  134. // })
  135. // file_num();
  136. // }
  137. // }
  138. // });
  139. // }else{
  140. // layer.msg("格式不正确");
  141. // }
  142. // } else {
  143. // layer.confirm('请上传文件!', {
  144. // btn: ['确定']
  145. // });
  146. // }
  147. // }
  148. //
  149. //
  150. // //上传文件隐藏域值
  151. // function file_num(){
  152. // var str = '';
  153. // var Str;
  154. // $('.fileBox .files').each(function(j,m){
  155. // var aa=$(m).attr("fiel-num")
  156. // console.log(aa);
  157. // str += aa + ",";
  158. // Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  159. // })
  160. // $("#file").val(Str);
  161. // }
  162. </script>
  163. </body>
  164. </html>