商丘12345 前端

BackDatil.html 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. </head>
  11. <body>
  12. <div class="Common">
  13. <table>
  14. <tr>
  15. <th class="Importent">退回原因:</th>
  16. <td colspan="7"><textarea data-adaptheight id="result" name="" rows="4" cols=""></textarea></td>
  17. </tr>
  18. </table>
  19. <div class="btn_box">
  20. <button class="btns BC">保存</button>
  21. </div>
  22. </div>
  23. <script src="../js/adjustHeight.js"></script>
  24. <script>
  25. var wid = helper.request.queryString("wid");
  26. var tab = helper.request.queryString("tab");
  27. //alert(wid)
  28. $(document).ready(function() {
  29. $('.BC').click(function() {
  30. if(!$("#result").val()) {
  31. layer.msg("原因不能为空");
  32. } else if(tab) {
  33. editTh();
  34. } else {
  35. JA();
  36. }
  37. })
  38. });
  39. if(tab) {
  40. XQ();
  41. }
  42. //回退
  43. function editTh() {
  44. $.post(huayi.config.callcenter_url + 'WorkOrder/EditSuperInfoByAdmin', {
  45. id: wid,
  46. superopinion: $("#result").val(), //回访内容
  47. token: $.cookie("token")
  48. }, function(result) {
  49. result = JSON.parse(result);
  50. if(result.state.toLowerCase() == "success") {
  51. parent.parent.layer.closeAll();
  52. parent.parent.$('#orderlist').bootstrapTable('refresh');
  53. parent.parent.layer.msg("操作成功!");
  54. // var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  55. // console.log(index);
  56. // parent.layer.close(index); //再执行关闭
  57. // parent.load();
  58. // parent.layer.msg("操作成功");
  59. }
  60. })
  61. }
  62. //回退
  63. function JA() {
  64. $.post(huayi.config.callcenter_url + 'WorkOrder/ReturnWorkOrder', {
  65. workorderid: wid,
  66. backreason: $("#result").val(), //回访内容
  67. token: $.cookie("token")
  68. }, function(result) {
  69. result = JSON.parse(result);
  70. if(result.state.toLowerCase() == "success") {
  71. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  72. console.log(index);
  73. parent.layer.close(index); //再执行关闭
  74. parent.$('#orderlist').bootstrapTable('refresh');
  75. parent.layer.msg("操作成功");
  76. }
  77. })
  78. }
  79. function XQ() {
  80. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetInfoByAdmin', {
  81. id: wid,
  82. type: 5,
  83. token: $.cookie("token")
  84. }, function(result) {
  85. if(result.state.toLowerCase() == "success") {
  86. var type = result.data[0].F_Type;
  87. var Ltype = "";
  88. if(type == 1) {
  89. Ltype = "领导批示";
  90. } else if(type == 2) {
  91. Ltype = "市长指示";
  92. } else if(type == 3) {
  93. Ltype = "回退";
  94. }
  95. $("#result").val(result.data[0].F_SuperOpinion);
  96. console.log(result);
  97. }
  98. })
  99. }
  100. </script>
  101. </body>
  102. </html>