新余市12345政府服务热线_Web

LDPS.html 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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 >批示类型:</th>
  34. <td>
  35. <input type="text" id="Type" readonly="readonly"/>
  36. <input type="hidden" id="Types"/>
  37. </td>
  38. </tr>
  39. <tr>
  40. <th class="Importent">批示内容:</th>
  41. <td colspan="2"><textarea data-adaptheight id="superopinion" name="" rows="6" cols=""></textarea></td>
  42. </tr>
  43. <tr>
  44. <th>附件上传:</th>
  45. <td colspan="7">
  46. <span class="fjnr"></span>
  47. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
  48. <input class="input" type="button" value="上传" id="scwj" />
  49. <input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
  50. <input type="hidden" id="file" />
  51. </td>
  52. </tr>
  53. </table>
  54. <div class="btn_box">
  55. <button class="btns">保存</button>
  56. </div>
  57. </div>
  58. <script src="../css/laydate/laydate.js"></script>
  59. <script src="../js/adjustHeight.js"></script>
  60. <script>
  61. var wid = helper.request.queryString("wid");
  62. $(document).ready(function() {
  63. XQ();
  64. //上传附件
  65. $("#scwj").click(function() {
  66. $("#upFile").trigger("click");
  67. })
  68. $("#upFile").change(function() {
  69. upload();
  70. })
  71. $("#scfj").click(function() {
  72. $(".fjnr").text("");
  73. $("#scfj").hide();
  74. })
  75. $(".btns").click(function(){
  76. JA();
  77. })
  78. })
  79. //批示
  80. function JA() {
  81. $.post(huayi.config.callcenter_url + 'WorkOrder/EditSuperInfoByAdmin', {
  82. id: wid,
  83. type:$("#Types").val(),//(1领导批示 2市长指示)
  84. superuser:$("#superuser").val(),//批示人&
  85. superopinion:$('#superopinion').val(),//批示内容&
  86. files:$("#file").val(),//附件id(多个用英文逗号,隔开
  87. "token": $.cookie("token")
  88. }, function(result) {
  89. result = JSON.parse(result);
  90. if(result.state.toLowerCase() == "success") {
  91. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  92. parent.layer.close(index); //再执行关闭
  93. parent.layer.msg("操作成功");
  94. }
  95. })
  96. }
  97. function upload() {
  98. var Files = document.getElementById("upFile").files;
  99. if(Files.length > 0) {
  100. var formData = new FormData();
  101. for(var i = 0; i < Files.length; i++) {
  102. formData.append('file' + i, Files[i]);
  103. }
  104. formData.append("token", $.cookie("token"));
  105. $.ajax({
  106. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  107. type: "POST",
  108. data: formData,
  109. /**
  110. *必须false才会自动加上正确的Content-Type
  111. */
  112. contentType: false,
  113. /**
  114. * 必须false才会避开jQuery对 formdata 的默认处理
  115. * XMLHttpRequest会对 formdata 进行正确的处理
  116. */
  117. processData: false,
  118. success: function(result) {
  119. document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  120. $("#upFile").change(function() {
  121. upload();
  122. });
  123. var r = $.parseJSON(result);
  124. if(r.state.toLowerCase() == "success") {
  125. $(".fjnr").text(r.data[0].F_FileName);
  126. var a = r.data;
  127. var str = '';
  128. var Str;
  129. $(a).each(function(i, n) {
  130. console.log(n.F_FileId);
  131. str += n.F_FileId + ",";
  132. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  133. console.log(Str);
  134. })
  135. $("#file").val(Str);
  136. $("#scfj").show();
  137. }
  138. }
  139. });
  140. } else {
  141. layer.confirm('请上传文件!', {
  142. btn: ['确定']
  143. });
  144. }
  145. }
  146. function XQ(){
  147. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetInfoByAdmin', {
  148. id: wid,
  149. type:5,
  150. token: $.cookie("token")
  151. }, function(result) {
  152. if(result.state.toLowerCase() == "success") {
  153. var type=result.data[0].F_Type;
  154. var Ltype="";
  155. if(type==1){
  156. Ltype="领导批示";
  157. }else if(type==2){
  158. Ltype="市长指示";
  159. } else if(type==3){
  160. Ltype="回退";
  161. }
  162. $("#Type").val(Ltype);
  163. $("#Types").val(type);
  164. $("#superuser").val(result.data[0].F_BatchReason);
  165. $('#superopinion').val(result.data[0].F_SuperOpinion);
  166. // $("#reason").val(result.data[0].F_RefuseReason)
  167. console.log(result);
  168. }
  169. })
  170. }
  171. </script>
  172. </body>
  173. </html>