商丘12345 前端

banli_zilei.html 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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. <!--办理内容-->
  30. <div style="width: 100%;padding: 10px;">
  31. <table class="table" border="" cellspacing="0" cellpadding="0" style="border: 1px solid #e7eaec;">
  32. <theard>
  33. <tr>
  34. <td class="text-center" style="min-width: 100px;">派单时间</td>
  35. <td class="text-center" style="min-width: 100px;">办理期限</td>
  36. <td class="text-center" style="min-width: 100px;">内容</td>
  37. </tr>
  38. </theard>
  39. <tbody class="BLNR" style="border-top: none; padding: 8px;">
  40. </tbody>
  41. </table>
  42. </div>
  43. <!--重新办理-->
  44. <div style="width: 100%;padding: 10px;">
  45. <table class="table" border="" cellspacing="0" cellpadding="0" style="border: 1px solid #e7eaec;">
  46. <theard>
  47. <tr>
  48. <td class="text-center" style="min-width: 100px;">序号</td>
  49. <td class="text-center" style="min-width: 100px;">办理时间</td>
  50. <td class="text-center" style="min-width: 100px;">内容</td>
  51. <td class="text-center" style="min-width: 100px;">附件</td>
  52. <td class="text-center" style="min-width: 100px;">审批时间</td>
  53. <td class="text-center" style="min-width: 100px;">审批内容</td>
  54. <td class="text-center" style="min-width: 100px;">审批意见</td>
  55. </tr>
  56. </theard>
  57. <tbody class="HGXX" style="border-top: none; padding: 8px;">
  58. </tbody>
  59. <!--<div class="FJ"></div>-->
  60. </table>
  61. </div>
  62. <div class="Common">
  63. <table>
  64. <tr>
  65. <th class="Importent">办理人:</th>
  66. <td> <input id="dealman" type="text" style="height: 32px;"></td>
  67. </tr>
  68. <tr>
  69. <th class="Importent">附件:</th>
  70. <td>
  71. <div class="fileBox">
  72. </div>
  73. <span class="fjnr"></span>
  74. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
  75. <input class="input" type="button" value="上传" id="scwj" />
  76. <!--<input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />-->
  77. <input type="hidden" id="file" />
  78. </td>
  79. </tr>
  80. <tr>
  81. <th class="Importent">办理内容:</th>
  82. <td><textarea data-adaptheight id="result" name="" rows="" cols=""></textarea></td>
  83. <input type="hidden" id="ID"/>
  84. </tr>
  85. </table>
  86. <div class="btn_box">
  87. <button class="btns Submit">保存并办理</button>
  88. </div>
  89. </div>
  90. <script src="../css/laydate/laydate.js"></script>
  91. <script src="../js/adjustHeight.js" ></script>
  92. <script>
  93. var wid = helper.request.queryString("wid");
  94. var State;
  95. var a=$("#ID").val()
  96. Detail();
  97. $(document).ready(function() {
  98. HGXX();
  99. BLNR();
  100. // Hove();
  101. // LOAD();
  102. //上传附件
  103. $("#scwj").click(function() {
  104. $("#upFile").trigger("click");
  105. })
  106. $("#upFile").change(function() {
  107. upload();
  108. })
  109. $("#scfj").click(function() {
  110. $(".fjnr").text("");
  111. $("#scfj").hide();
  112. })
  113. // $('.BC').click(function() {
  114. // if($("#dealman").val()==""){
  115. // layer.msg("办理人不能为空");
  116. // }else if($("#result").val()==""){
  117. // layer.msg("办理内容不能为空");
  118. // }else{
  119. // State = 0;
  120. // JA();
  121. // }
  122. //
  123. // })
  124. $('.Submit').click(function() {
  125. if($("#dealman").val()==""){
  126. layer.msg("办理人不能为空");
  127. }else if($("#result").val()==""){
  128. layer.msg("办理内容不能为空");
  129. }else{
  130. State = 1;
  131. JA();
  132. }
  133. })
  134. });
  135. //交办
  136. function JA() {
  137. $.post(huayi.config.callcenter_url + 'WorkOrder/DealWorkOrder', {
  138. workorderid: wid,
  139. dealman: $("#dealman").val(), //办理人
  140. result: $('#result').val(), //办理内容
  141. state: State,
  142. feedbackid:a,
  143. files:$("#file").val(),
  144. token: $.cookie("token")
  145. }, function(result) {
  146. result = JSON.parse(result);
  147. if(result.state.toLowerCase() == "success") {
  148. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  149. parent.layer.close(index); //再执行关闭
  150. parent.load();
  151. parent.layer.msg("办理成功");
  152. $('.fileBox').html('');
  153. }
  154. })
  155. }
  156. // 工单详情
  157. function HGXX() {
  158. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetSecondDealInfo', {
  159. workorderid: wid,
  160. token: $.cookie("token")
  161. }, function(result) {
  162. // result = JSON.stringify(result)
  163. // alert(result)
  164. console.log(result);
  165. if(result.state.toLowerCase() == "success") {
  166. var temp;
  167. var Agree;
  168. $.each(result.data.fkinfo,function(i, n) {
  169. // var r = JSON.stringify(n.File);
  170. if(n.F_IsAudit == 1) {
  171. Agree = "同意";
  172. } else if(n.F_IsAudit == 2) {
  173. Agree = "拒绝";
  174. }
  175. temp = '<tr><td class="text-center">'+(i + 1)+'</td><td class="text-center">'
  176. +n.F_CreateTime+'</td><td class="text-center">'+n.F_Result
  177. +'</td><td class="text-center FJ" style="color:#00a1cb;"></td><td class="text-center">'
  178. +n.F_AuditTime+'</td><td class="text-center">'+n.F_AuditReason
  179. +'</td><td class="text-center">'+Agree+'</td></tr>';
  180. var tmp='';
  181. $.each(n.File,function(d, f) {
  182. tmp +='<a style="margin-right:5px;" href="' + f.F_FileUrl + '" download="' + f.F_FileUrl + '">'+f.F_FileName.substring(19)+'</a>';
  183. })
  184. $(temp).appendTo($('.HGXX')).find('.FJ').append(tmp);
  185. });
  186. //
  187. // alert(i);
  188. }
  189. })
  190. }
  191. // <a class="tiaozhuan" style="margin-right:5px;" href="' + (n.File == null ? '' : n.File[0].F_FileUrl) + '" download="' + (n.File == null ? '' : n.File[0].F_FileUrl) + '" >附件</a>
  192. // function Hove(){
  193. // $(document).on("mouseover mouseout",'.tiaozhuan',function(event){
  194. // if(event.type == "mouseover"){
  195. // //鼠标悬浮
  196. // var miao=$(this).attr("href");
  197. // if (miao=="") {
  198. // $(this).removeAttr("href");
  199. // $(this).removeAttr("download");
  200. // $(this).html("");
  201. //
  202. // } else{
  203. // $(this).attr("href");
  204. // $(this).attr("download");
  205. // }
  206. // }else if(event.type == "mouseout"){
  207. // //鼠标离开
  208. // }
  209. // })
  210. //
  211. //
  212. // }
  213. // $(window).load(function(){
  214. // alert("DDD");
  215. // alert($(".tiaozhuan").attr("href"));
  216. // var miao1=$(".tiaozhuan").attr("href");
  217. // if (miao1=="") {
  218. // alert("aaa");
  219. //// $(this).html("");
  220. // } else{
  221. // alert("bbb");
  222. // $(this).html("");
  223. // }
  224. // });
  225. // 派单内容给
  226. function BLNR() {
  227. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetSecondDealInfo', {
  228. workorderid: wid,
  229. token: $.cookie("token")
  230. }, function(result) {
  231. // result = JSON.stringify(result)
  232. // console.log(result);
  233. if(result.state.toLowerCase() == "success") {
  234. var temp2;
  235. $.each(result.data.pdinfo,function(i, n) {
  236. temp2 = temp2 + '<tr><td class="text-center">'+n.F_CreateTime+'</td><td class="text-center">'+n.F_LimitTime+'</td><td class="text-center">'+n.F_AssignedOpinion+'</td></tr>';
  237. });
  238. $('.BLNR').append(temp2);
  239. }
  240. })
  241. }
  242. //草稿详情
  243. function Detail() {
  244. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetDraftInfo', {
  245. workorderid: wid,
  246. type: 2,
  247. token: $.cookie("token")
  248. }, function(result) {
  249. if(result.state.toLowerCase() == "success") {
  250. if(result.data.length>0){
  251. $("#dealman").val(result.data[0].F_DealUser);
  252. $('#result').val(result.data[0].F_Result);
  253. a=result.data[0].F_Id;
  254. };
  255. }
  256. })
  257. }
  258. //清除
  259. function Clean(){
  260. $("#startTime").val(''),
  261. $('#assignedopinion').val('')
  262. }
  263. //上传文件
  264. function upload() {
  265. var Files = document.getElementById("upFile").files;
  266. if(Files.length > 0) {
  267. var formData = new FormData();
  268. for(var i = 0; i < Files.length; i++) {
  269. formData.append('file' + i, Files[i]);
  270. }
  271. formData.append("token", $.cookie("token"));
  272. $.ajax({
  273. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  274. type: "POST",
  275. data: formData,
  276. /**
  277. *必须false才会自动加上正确的Content-Type
  278. */
  279. contentType: false,
  280. /**
  281. * 必须false才会避开jQuery对 formdata 的默认处理
  282. * XMLHttpRequest会对 formdata 进行正确的处理
  283. */
  284. processData: false,
  285. success: function(result) {
  286. document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  287. $("#upFile").change(function() {
  288. upload();
  289. });
  290. var r = $.parseJSON(result);
  291. if(r.state.toLowerCase() == "success") {
  292. $(".fjnr").text(r.data[0].F_FileName);
  293. var a = r.data;
  294. $(a).each(function(i, n) {
  295. var strs='<span class="files" fiel-num="'+ n.F_FileId +'">'+ n.F_FileName +'<i class="fa fa-remove del_file"></i></span>'
  296. $(strs).appendTo($('.fileBox')).find('.del_file').click(function(event){
  297. event.stopPropagation();
  298. $(this).parent().remove();
  299. file_num()
  300. })
  301. })
  302. file_num();
  303. }
  304. }
  305. });
  306. } else {
  307. layer.confirm('请上传文件!', {
  308. btn: ['确定']
  309. });
  310. }
  311. }
  312. //上传文件隐藏域值
  313. function file_num(){
  314. var str = '';
  315. var Str;
  316. $('.fileBox .files').each(function(j,m){
  317. var aa=$(m).attr("fiel-num")
  318. console.log(aa);
  319. str += aa + ",";
  320. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  321. })
  322. $("#file").val(Str);
  323. }
  324. </script>
  325. </body>
  326. </html>