商丘12345 前端

Supervision_.html 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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. #message {
  24. display: none;
  25. }
  26. </style>
  27. </head>
  28. <body>
  29. <div class="Common">
  30. <table>
  31. <tr>
  32. <th class="Importent title">督查意见:</th>
  33. <td><textarea data-adaptheight id='overseeopinion' textarea name="" rows="4" cols=""></textarea></td>
  34. </tr>
  35. <tr>
  36. <th>附件上传:</th>
  37. <td colspan="7">
  38. <!--<span class="fjnr"></span>-->
  39. <div class="fileBox">
  40. <!--<span class="files">文件1<i class="fa fa-remove"></i></span>-->
  41. </div>
  42. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
  43. <input class="input" type="button" value="上传" id="scwj" />
  44. <!--<input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />-->
  45. <input type="hidden" id="file" />
  46. <span style="color:#FF0000; border: none;">
  47. (文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
  48. </span>
  49. </td>
  50. </tr>
  51. </table>
  52. <div id="message" style="margin: 20px 0 0 130px;text-align: left;">
  53. 是否发送短信
  54. <input type="radio" name="message" id="" value="0" />否
  55. <input type="radio" name="message" id="" value="1" />是
  56. </div>
  57. <div class="btn_box">
  58. <button class="btns DB">保存</button>
  59. <button class="btns JC">保存</button>
  60. </div>
  61. </div>
  62. <script src="../js/adjustHeight.js"></script>
  63. <script src="../Script/Common/huayi.common.js"></script>
  64. <script>
  65. var wid = helper.request.queryString("wid");
  66. var type = helper.request.queryString("type");
  67. var state = helper.request.queryString("state");
  68. var depId = helper.request.queryString("depId");
  69. $(document).ready(function() {
  70. if(wid) {
  71. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetWorkOrder', {
  72. workorderid: wid,
  73. "token": $.cookie("token")
  74. }, function(result) {
  75. if(result.state.toLowerCase() == "success") {
  76. var content = result.data;
  77. if(content.data[0].F_DeptIdIsSms == 1) {
  78. $('#message input[value="1"]').attr('checked', true)
  79. } else {
  80. $('#message input[value="0"]').attr('checked', true)
  81. }
  82. }
  83. })
  84. }
  85. if(type == 1) {
  86. if(state == 1) {
  87. $(".title").text("督办意见");
  88. $(".JC").hide();
  89. $('#message').show();
  90. } else {
  91. $(".title").text("不督办意见");
  92. $(".JC").hide();
  93. $('#message').hide()
  94. }
  95. } else {
  96. $(".title").text("监察意见")
  97. $(".DB").hide();
  98. }
  99. $(".DB").click(function() {
  100. if($("#overseeopinion").val() == '') {
  101. layer.msg("意见不能为空");
  102. } else {
  103. type = 1;
  104. JA();
  105. if($('#message input[type="radio"]:checked').val() == 1) {
  106. sendMessage();
  107. }
  108. }
  109. })
  110. $(".JC").click(function() {
  111. if($("#overseeopinion").val() == '') {
  112. layer.msg("意见不能为空");
  113. } else {
  114. type = 2;
  115. JA();
  116. }
  117. })
  118. //上传附件
  119. $("#scwj").click(function() {
  120. $("#upFile").trigger("click");
  121. })
  122. $("#upFile").change(function() {
  123. upload('upFile','.fileBox',['png','jpg','mp3','mp4','pdf','doc','docx','xls','xlsx'],'#file');
  124. })
  125. // $("#scfj").click(function() {
  126. // $(".fjnr").text("");
  127. // $("#scfj").hide();
  128. // })
  129. })
  130. //发送短信
  131. function sendMessage() {
  132. $.post(huayi.config.callcenter_url + 'WorkOrder/SendSms', {
  133. workordercode: wid,
  134. deptid: depId, //主办单位
  135. type: 1,
  136. token: $.cookie("token")
  137. }, function(result) {
  138. result = JSON.parse(result);
  139. if(result.state.toLowerCase() == 'success') {
  140. layer.msg('发送短信成功')
  141. }
  142. })
  143. }
  144. //督察
  145. function JA() {
  146. $.post(huayi.config.callcenter_url + 'WorkOrder/RemindWorkOrder', {
  147. workorderid: wid,
  148. overseeopinion: $("#overseeopinion").val(),
  149. type: type,
  150. state: state,
  151. files: $("#file").val(),
  152. "token": $.cookie("token")
  153. }, function(result) {
  154. result = JSON.parse(result);
  155. if(result.state.toLowerCase() == "success") {
  156. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  157. parent.layer.close(index); //再执行关闭
  158. parent.$('#orderlist').bootstrapTable('refresh');
  159. parent.layer.msg("操作成功");
  160. $('.fileBox').html('');
  161. }
  162. })
  163. }
  164. // //上传文件
  165. // function upload() {
  166. // var Files = document.getElementById("upFile").files;
  167. // if(Files.length > 0) {
  168. // var formData = new FormData();
  169. // for(var i = 0; i < Files.length; i++) {
  170. // formData.append('file' + i, Files[i]);
  171. // }
  172. // formData.append("token", $.cookie("token"));
  173. // var typeName = Files[0].name.split('.')[1];
  174. // if(typeName == "png" || typeName == 'jpg' || typeName == 'mp4' || typeName == 'mp3' || typeName == 'pdf' || typeName == 'doc' || typeName == 'docx' || typeName == 'xls' || typeName == 'xlsx') {
  175. // $.ajax({
  176. // url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  177. // type: "POST",
  178. // data: formData,
  179. // /**
  180. // *必须false才会自动加上正确的Content-Type
  181. // */
  182. // contentType: false,
  183. // /**
  184. // * 必须false才会避开jQuery对 formdata 的默认处理
  185. // * XMLHttpRequest会对 formdata 进行正确的处理
  186. // */
  187. // processData: false,
  188. // success: function(result) {
  189. // document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  190. // $("#upFile").change(function() {
  191. // upload();
  192. // });
  193. // var r = $.parseJSON(result);
  194. // if(r.state.toLowerCase() == "success") {
  195. // $(".fjnr").text(r.data[0].F_FileName);
  196. // var a = r.data;
  197. // // var str = '';
  198. // // var Str;
  199. //
  200. // $(a).each(function(i, n) {
  201. // var strs = '<span class="files" fiel-num="' + n.F_FileId + '">' + n.F_FileName.substring(19) + '<i class="fa fa-remove del_file"></i></span>'
  202. // $(strs).appendTo($('.fileBox')).find('.del_file').click(function(event) {
  203. // event.stopPropagation();
  204. // $(this).parent().remove();
  205. // file_num();
  206. // })
  207. // })
  208. // file_num();
  209. // }
  210. // }
  211. // });
  212. // } else {
  213. // layer.msg("格式不正确");
  214. // }
  215. // } else {
  216. // layer.confirm('请上传文件!', {
  217. // btn: ['确定']
  218. // });
  219. // }
  220. // }
  221. //
  222. // //上传文件隐藏域值
  223. // function file_num() {
  224. // var str = '';
  225. // var Str;
  226. // $('.fileBox .files').each(function(j, m) {
  227. // var aa = $(m).attr("fiel-num")
  228. // console.log(aa);
  229. // str += aa + ",";
  230. // Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  231. // })
  232. // $("#file").val(Str);
  233. // }
  234. </script>
  235. </body>
  236. </html>