No Description

LDPS.html 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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. <span style="color:#FF0000; border: none;">
  55. (文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
  56. </span>
  57. </td>
  58. </tr>
  59. </table>
  60. <div class="btn_box">
  61. <button class="btns">保存</button>
  62. </div>
  63. </div>
  64. <script src="../css/laydate/laydate.js"></script>
  65. <script src="../js/adjustHeight.js"></script>
  66. <script>
  67. var wid = helper.request.queryString("wid");
  68. var type = helper.request.queryString("type");
  69. console.log(type)
  70. $(document).ready(function() {
  71. if(type==1||type==2){
  72. $(".HT").show();
  73. }
  74. XQ();
  75. //上传附件
  76. $("#scwj").click(function() {
  77. $("#upFile").trigger("click");
  78. })
  79. $("#upFile").change(function() {
  80. upload();
  81. })
  82. $("#scfj").click(function() {
  83. $(".fjnr").text("");
  84. $("#scfj").hide();
  85. })
  86. $(".btns").click(function(){
  87. JA();
  88. })
  89. })
  90. //批示
  91. function JA() {
  92. $.post(huayi.config.callcenter_url + 'WorkOrder/EditSuperInfoByAdmin', {
  93. id: wid,
  94. type:$("#Types").val(),//(1领导批示 2市长指示)
  95. superuser:$("#superuser").val(),//批示人&
  96. superopinion:$('#superopinion').val(),//批示内容&
  97. files:$("#file").val(),//附件id(多个用英文逗号,隔开
  98. "token": $.cookie("token")
  99. }, function(result) {
  100. result = JSON.parse(result);
  101. if(result.state.toLowerCase() == "success") {
  102. parent.parent.layer.closeAll();
  103. parent.parent.$('#orderlist').bootstrapTable('refresh');
  104. parent.parent.layer.msg("操作成功!");
  105. }
  106. })
  107. }
  108. function upload() {
  109. var Files = document.getElementById("upFile").files;
  110. if(Files.length > 0) {
  111. var formData = new FormData();
  112. for(var i = 0; i < Files.length; i++) {
  113. formData.append('file' + i, Files[i]);
  114. }
  115. formData.append("token", $.cookie("token"));
  116. var typeName=Files[0].name.split('.')[1];
  117. if (typeName=="png"||typeName=='jpg'||typeName=='mp4'||typeName=='mp3'||typeName=='pdf'||typeName=='doc'||typeName=='docx'||typeName=='xls'||typeName=='xlsx') {
  118. $.ajax({
  119. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  120. type: "POST",
  121. data: formData,
  122. /**
  123. *必须false才会自动加上正确的Content-Type
  124. */
  125. contentType: false,
  126. /**
  127. * 必须false才会避开jQuery对 formdata 的默认处理
  128. * XMLHttpRequest会对 formdata 进行正确的处理
  129. */
  130. processData: false,
  131. success: function(result) {
  132. document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  133. $("#upFile").change(function() {
  134. upload();
  135. });
  136. var r = $.parseJSON(result);
  137. if(r.state.toLowerCase() == "success") {
  138. $(".fjnr").text(r.data[0].F_FileName);
  139. var a = r.data;
  140. var str = '';
  141. var Str;
  142. $(a).each(function(i, n) {
  143. console.log(n.F_FileId);
  144. str += n.F_FileId + ",";
  145. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  146. console.log(Str);
  147. })
  148. $("#file").val(Str);
  149. $("#scfj").show();
  150. }
  151. }
  152. });
  153. }else{
  154. layer.msg("格式不正确");
  155. }
  156. } else {
  157. layer.confirm('请上传文件!', {
  158. btn: ['确定']
  159. });
  160. }
  161. }
  162. function XQ(){
  163. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetInfoByAdmin', {
  164. id: wid,
  165. type:5,
  166. token: $.cookie("token")
  167. }, function(result) {
  168. if(result.state.toLowerCase() == "success") {
  169. var type=result.data[0].F_Type;
  170. var Ltype="";
  171. if(type==1){
  172. Ltype="领导批示";
  173. }else if(type==2){
  174. Ltype="市长指示";
  175. } else if(type==3){
  176. Ltype="回退";
  177. }
  178. $("#Type").val(Ltype);
  179. $("#Types").val(type);
  180. $("#superuser").val(result.data[0].F_BatchReason);
  181. $('#superopinion').val(result.data[0].F_SuperOpinion);
  182. // $("#reason").val(result.data[0].F_RefuseReason)
  183. console.log(result);
  184. }
  185. })
  186. }
  187. </script>
  188. </body>
  189. </html>