商丘12345 前端

processing_audit.html 9.2KB

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