商丘12345 前端

LDPS.html 5.2KB

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