商丘市柘城县——前端

processing_audit.html 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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. .HGXX td {
  24. padding: 8px;
  25. }
  26. </style>
  27. </head>
  28. <body>
  29. <div class="Common" style="padding: 10px;">
  30. <table class="table" border="" cellspacing="0" cellpadding="0" style="border: 1px solid #e7eaec; text-align: center;">
  31. <theard>
  32. <tr>
  33. <td class="text-center" style="min-width: 100px; text-align: center;">办理人</td>
  34. <td class="text-center" style="min-width: 100px; text-align: center;">办理时间</td>
  35. <td class="text-center" style="min-width: 100px; text-align: center;">内容</td>
  36. <td class="text-center" style="min-width: 100px; text-align: center;">附件</td>
  37. </tr>
  38. </theard>
  39. <tbody class="BLNR" style="border-top: none; padding: 8px;"></tbody>
  40. <!--<div class="FJ">
  41. </div>-->
  42. </table>
  43. <table>
  44. <tr>
  45. <th class="Importent" style="text-align: left;"> 审核意见:</th>
  46. </tr>
  47. <tr>
  48. <td style="padding: 0px;"><textarea data-adaptheight id="reason" name="" rows="" cols="" style="text-indent: 2em;"></textarea></td>
  49. </tr>
  50. </table>
  51. <div class="btn_box">
  52. <input type="hidden" id="ID" />
  53. <button class="btns BC">同意</button>
  54. <button class="btns Submit">拒绝</button>
  55. </div>
  56. </div>
  57. <script src="../css/laydate/laydate.js"></script>
  58. <script src="../js/adjustHeight.js"></script>
  59. <script>
  60. var wid = helper.request.queryString("wid");
  61. $(document).ready(function () {
  62. Detail();
  63. BLNR();
  64. Hove();
  65. //上传附件
  66. $("#scwj").click(function () {
  67. $("#upFile").trigger("click");
  68. })
  69. $("#upFile").change(function () {
  70. upload();
  71. })
  72. $("#scfj").click(function () {
  73. $(".fjnr").text("");
  74. $("#scfj").hide();
  75. })
  76. $('.BC').click(function () {
  77. if ($("#reason").val() == "") {
  78. layer.msg("请填写审核意见");
  79. } else {
  80. JA(1);
  81. }
  82. })
  83. $('.Submit').click(function () {
  84. if ($("#reason").val() == "") {
  85. layer.msg("请填写审核意见");
  86. } else {
  87. JA(2);
  88. }
  89. })
  90. });
  91. //审批意见
  92. function JA(State) {
  93. $.post(huayi.config.callcenter_url + 'WorkOrder/AuditSplitWorkOrder', {
  94. workorderid: wid,
  95. reason: $('#reason').val(), //办理内容
  96. state: State,
  97. backid: ccc,
  98. token: $.cookie("token")
  99. }, function (result) {
  100. result = JSON.parse(result);
  101. if (result.state.toLowerCase() == "success") {
  102. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  103. parent.layer.close(index); //再执行关闭
  104. parent.load();
  105. parent.layer.msg("处理成功");
  106. }
  107. })
  108. }
  109. // 工单详情
  110. // function HGXX() {
  111. // $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetSecondDealInfo', {
  112. // workorderid: wid,
  113. // token: $.cookie("token")
  114. // }, function(result) {
  115. // // result = JSON.stringify(result)
  116. // if(result.state.toLowerCase() == "success") {
  117. // var temp;
  118. // $.each(result.data.pdinfo,function(i, n) {
  119. // var i=0;
  120. // i++;
  121. // temp = temp + '<td class="text-center">'+i+'</td><td class="text-center">'+n.F_CreateTime+'</td><td class="text-center">'+n.F_AssignedOpinion+'</td><td class="text-center">'+n.F_LimitTime+'</td><td class="text-center">'+n.F_OtherDeptIds+'</td>';
  122. //// ccc=n.F_Id;
  123. //
  124. // });
  125. //
  126. // $('.HGXX').append(temp);
  127. // }
  128. // })
  129. // }
  130. //办理内容
  131. function BLNR() {
  132. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetNewSecondDealInfo', {
  133. workorderid: wid,
  134. token: $.cookie("token")
  135. }, function (result) {
  136. if (result.state.toLowerCase() == "success") {
  137. var temp1;
  138. $.each(result.data, function (i, n) {
  139. temp1 = temp1 + '<td class="text-center">' + n.F_DealUser + '</td><td class="text-center">' + n.F_CreateTime + '</td><td class="text-center">' + n.F_Result + '</td><td class="text-center FJ" style="color:#00a1cb;"></td>';
  140. ccc = n.F_Id;
  141. });
  142. $('.BLNR').append(temp1);
  143. $(result.data[0].File).each(function (i, n) {
  144. HTML = '<a style="margin-right:5px;" href="' + n.F_FileUrl + '" download="' + n.F_FileName.substring(19) + '">' + n.F_FileName.substring(19) + '</a>'
  145. $(HTML).appendTo($('.FJ'));
  146. })
  147. }
  148. })
  149. }
  150. // <a class="tiaozhuan" style="margin-left: -5px; width:100%; display:block; text-align: center;" href="' + (n.File == null ? '' : n.File[0].F_FileUrl) + '" download="' + (n.File == null ? '' : n.File[0].F_FileUrl) + '" >附件</a>
  151. // 判断附件
  152. function Hove() {
  153. $(document).on("mouseover mouseout", '.tiaozhuan', function (event) {
  154. if (event.type == "mouseover") {
  155. //鼠标悬浮
  156. var miao = $(this).attr("href");
  157. if (miao == "") {
  158. $(this).removeAttr("href");
  159. $(this).removeAttr("download");
  160. $(this).html("")
  161. } else {
  162. $(this).attr("href");
  163. $(this).attr("download");
  164. }
  165. } else if (event.type == "mouseout") {
  166. //鼠标离开
  167. }
  168. })
  169. }
  170. //草稿详情
  171. function Detail() {
  172. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetDraftInfo', {
  173. workorderid: wid,
  174. type: 2,
  175. token: $.cookie("token")
  176. }, function (result) {
  177. if (result.state.toLowerCase() == "success") {
  178. if (result.data.length > 0) {
  179. $("#dealman").val(result.data[0].F_DealUser);
  180. $('#result').val(result.data[0].F_Result);
  181. $("#ID").val(result.data[0].F_Id);
  182. };
  183. }
  184. })
  185. }
  186. //清除
  187. function Clean() {
  188. $("#startTime").val(''),
  189. $('#assignedopinion').val('')
  190. }
  191. //上传文件
  192. function upload() {
  193. var Files = document.getElementById("upFile").files;
  194. if (Files.length > 0) {
  195. var formData = new FormData();
  196. for (var i = 0; i < Files.length; i++) {
  197. formData.append('file' + i, Files[i]);
  198. }
  199. formData.append("token", $.cookie("token"));
  200. $.ajax({
  201. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  202. type: "POST",
  203. data: formData,
  204. /**
  205. *必须false才会自动加上正确的Content-Type
  206. */
  207. contentType: false,
  208. /**
  209. * 必须false才会避开jQuery对 formdata 的默认处理
  210. * XMLHttpRequest会对 formdata 进行正确的处理
  211. */
  212. processData: false,
  213. success: function (result) {
  214. document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  215. $("#upFile").change(function () {
  216. upload();
  217. });
  218. var r = $.parseJSON(result);
  219. if (r.state.toLowerCase() == "success") {
  220. $(".fjnr").text(r.data[0].F_FileName);
  221. var a = r.data;
  222. $(a).each(function (i, n) {
  223. var strs = '<span class="files" fiel-num="' + n.F_FileId + '">' + n.F_FileName.substring(19) + '<i class="fa fa-remove del_file"></i></span>'
  224. $(strs).appendTo($('.fileBox')).find('.del_file').click(function (event) {
  225. event.stopPropagation();
  226. $(this).parent().remove();
  227. file_num()
  228. })
  229. })
  230. file_num();
  231. }
  232. }
  233. });
  234. } else {
  235. layer.confirm('请上传文件!', {
  236. btn: ['确定']
  237. });
  238. }
  239. }
  240. function file_num() {
  241. var str = '';
  242. $('.fileBox .files').each(function (j, m) {
  243. str += $(m).attr("fiel-num") + ",";
  244. })
  245. $("#file").val(str ? str.substring(0, str.length - 1):'');
  246. }
  247. </script>
  248. </body>
  249. </html>