商丘12345 前端

banli_zilei.html 13KB

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;"></tbody>
  40. </table>
  41. </div>
  42. <!--重新办理-->
  43. <div style="width: 100%;padding: 10px;">
  44. <table class="table" border="" cellspacing="0" cellpadding="0" style="border: 1px solid #e7eaec;">
  45. <theard>
  46. <tr>
  47. <td class="text-center" style="min-width: 100px;">序号</td>
  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. </tr>
  55. </theard>
  56. <tbody class="HGXX" style="border-top: none; padding: 8px;"></tbody>
  57. <!--<div class="FJ"></div>-->
  58. </table>
  59. </div>
  60. <div class="Common">
  61. <table>
  62. <tr>
  63. <th class="Importent">办理人:</th>
  64. <td> <input id="dealman" type="text" style="height: 32px;"></td>
  65. </tr>
  66. <tr>
  67. <th class="Importent">附件:</th>
  68. <td>
  69. <div class="fileBox">
  70. </div>
  71. <span class="fjnr"></span>
  72. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
  73. <input class="input" type="button" value="上传" id="scwj" />
  74. <!--<input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />-->
  75. <input type="hidden" id="file" />
  76. </td>
  77. </tr>
  78. <tr>
  79. <th class="Importent">办理内容:</th>
  80. <td><textarea data-adaptheight id="result" name="" rows="" cols=""></textarea></td>
  81. <input type="hidden" id="ID" />
  82. </tr>
  83. </table>
  84. <div class="btn_box">
  85. <button class="btns Submit">保存并办理</button>
  86. </div>
  87. </div>
  88. <script src="../css/laydate/laydate.js"></script>
  89. <script src="../js/adjustHeight.js"></script>
  90. <script>
  91. var wid = helper.request.queryString("wid");
  92. var State;
  93. var a = $("#ID").val()
  94. Detail();
  95. $(document).ready(function () {
  96. HGXX();
  97. BLNR();
  98. // Hove();
  99. // LOAD();
  100. //上传附件
  101. $("#scwj").click(function () {
  102. $("#upFile").trigger("click");
  103. })
  104. $("#upFile").change(function () {
  105. upload();
  106. })
  107. $("#scfj").click(function () {
  108. $(".fjnr").text("");
  109. $("#scfj").hide();
  110. })
  111. // $('.BC').click(function() {
  112. // if($("#dealman").val()==""){
  113. // layer.msg("办理人不能为空");
  114. // }else if($("#result").val()==""){
  115. // layer.msg("办理内容不能为空");
  116. // }else{
  117. // State = 0;
  118. // JA();
  119. // }
  120. //
  121. // })
  122. $('.Submit').click(function () {
  123. if ($("#dealman").val() == "") {
  124. layer.msg("办理人不能为空");
  125. } else if ($("#result").val() == "") {
  126. layer.msg("办理内容不能为空");
  127. } else {
  128. State = 1;
  129. JA();
  130. }
  131. })
  132. });
  133. //交办
  134. function JA() {
  135. $.post(huayi.config.callcenter_url + 'WorkOrder/DealWorkOrder', {
  136. workorderid: wid,
  137. dealman: $("#dealman").val(), //办理人
  138. result: $('#result').val(), //办理内容
  139. state: State,
  140. feedbackid: a,
  141. files: $("#file").val(),
  142. token: $.cookie("token")
  143. }, function (result) {
  144. result = JSON.parse(result);
  145. if (result.state.toLowerCase() == "success") {
  146. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  147. parent.layer.close(index); //再执行关闭
  148. parent.load();
  149. parent.layer.msg("办理成功");
  150. $('.fileBox').html('');
  151. }
  152. })
  153. }
  154. // 工单详情
  155. function HGXX() {
  156. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetSecondDealInfo', {
  157. workorderid: wid,
  158. token: $.cookie("token")
  159. }, function (result) {
  160. // result = JSON.stringify(result)
  161. // alert(result)
  162. console.log(result);
  163. if (result.state.toLowerCase() == "success") {
  164. var temp;
  165. var Agree;
  166. $.each(result.data.fkinfo, function (i, n) {
  167. // var r = JSON.stringify(n.File);
  168. if (n.F_IsAudit == 1) {
  169. Agree = "同意";
  170. } else if (n.F_IsAudit == 2) {
  171. Agree = "拒绝";
  172. }
  173. temp = '<tr><td class="text-center">' + (i + 1) + '</td><td class="text-center">'
  174. + n.F_CreateTime + '</td><td class="text-center">' + n.F_Result
  175. + '</td><td class="text-center FJ" style="color:#00a1cb;"></td><td class="text-center">'
  176. + n.F_AuditTime + '</td><td class="text-center">' + n.F_AuditReason
  177. + '</td><td class="text-center">' + Agree + '</td></tr>';
  178. var tmp = '';
  179. if (n.File) {
  180. $.each(n.File, function (d, f) {
  181. tmp += '<a style="margin-right:5px;" href="' + f.F_FileUrl + '" download="' + f.F_FileUrl + '">' + f.F_FileName.substring(19) + '</a>';
  182. })
  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.substring(19) + '<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>