12345市长热线标准版-前端

jiaoban.html 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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="../js/zTree/zTreeStyle.css" />
  9. <link rel="stylesheet" href="../css/init.css" />
  10. <title>交办</title>
  11. <style>
  12. .inpBox {
  13. border: 1px solid #a9a9a9;
  14. height: 27px;
  15. width: 220px;
  16. display: inline-block;
  17. position: relative;
  18. vertical-align: middle;
  19. }
  20. .addTree {
  21. background: #fff;
  22. position: absolute;
  23. width: 100%;
  24. border: 1px solid darkgrey;
  25. right: 0;
  26. top: 26px;
  27. display: none;
  28. }
  29. .xl {
  30. display: inline-block;
  31. background: url(../../img/dropDown.png) no-repeat;
  32. height: 100%;
  33. background-position: center center;
  34. width: 20px;
  35. position: absolute;
  36. right: 0;
  37. top: 0px;
  38. /* background-color: #f7bc8b; */
  39. cursor: pointer;
  40. }
  41. .ztree li span {
  42. border: none;
  43. padding: 0;
  44. }
  45. .inps {
  46. width: 217px;
  47. height: 24px;
  48. outline: none;
  49. border: 0;
  50. border-image-width: 0;
  51. padding: 0;
  52. padding-left: 3px;
  53. }
  54. .xl {
  55. display: inline-block;
  56. background: url(../img/dropDown.png) no-repeat;
  57. height: 100%;
  58. background-position: center center;
  59. width: 20px;
  60. position: absolute;
  61. right: 0;
  62. top: 0px;
  63. /* background-color: #f7bc8b; */
  64. cursor: pointer;
  65. }
  66. </style>
  67. </head>
  68. <body>
  69. <div class="Common" style="height: 100%;">
  70. <table>
  71. <tr>
  72. <th class="Importent">办理时限:</th>
  73. <td> <input type="text" id="startTime" class="laydate-icon" style="height: 32px;"></td>
  74. </tr>
  75. <tr>
  76. <th class="Importent">交办单位:</th>
  77. <td>
  78. <div class="inpBox">
  79. <input type="text" class="inps" />
  80. <i class="xl xl_one"></i>
  81. <div class="addTree xlAdd">
  82. <ul id="addTreeDemo" class="ztree">
  83. </ul>
  84. </div>
  85. </div>
  86. </td>
  87. </tr>
  88. <tr>
  89. <th class="Importent">交办意见:</th>
  90. <td><textarea id="assignedopinion" name="" rows="" cols=""></textarea></td>
  91. <input type="hidden" id="ID" />
  92. <input type="hidden" id="PID" />
  93. <input type="hidden" id="Dpment" />
  94. </tr>
  95. </table>
  96. <div class="btn_box">
  97. <button class="btns BC">保存</button>
  98. <button class="btns Submit">保存并交办</button>
  99. </div>
  100. </div>
  101. <script src="../css/laydate/laydate.js"></script>
  102. <script src="../js/zTree/jquery.ztree.core.js"></script>
  103. <script>
  104. var wid = helper.request.queryString("wid");
  105. var State;
  106. var a = $("#ID").val()
  107. $(".inps").val($("#Dpment").val());
  108. Detail();
  109. $(document).ready(function() {
  110. $(".inps").val($("#Dpment").val());
  111. console.log(a);
  112. laydate.skin('blue');
  113. laydate({
  114. elem: '#startTime',
  115. event: 'focus'
  116. });
  117. $('.BC').click(function() {
  118. if($("#assignedopinion").val() == "") {
  119. layer.msg("交办意见不能为空");
  120. } else {
  121. State = 0;
  122. JA();
  123. }
  124. })
  125. $('.Submit').click(function() {
  126. if($("#assignedopinion").val() == "") {
  127. layer.msg("交办意见不能为空");
  128. } else {
  129. State = 1;
  130. JA();
  131. }
  132. });
  133. tree();
  134. function tree() {
  135. $.get(huayi.config.callcenter_url + 'Department/GetDeptList', {
  136. "token": $.cookie("token"),
  137. // "pid": pid
  138. }, function(result) {
  139. result = $.parseJSON(result);
  140. $.fn.zTree.init($("#addTreeDemo"), setting1, result.data); //实例化树形图
  141. });
  142. }
  143. var setting1 = {
  144. data: {
  145. key: {
  146. name: "F_DeptName"
  147. },
  148. simpleData: {
  149. enable: true,
  150. idKey: "F_DeptId",
  151. pIdKey: "F_PartentId",
  152. rootPId: 0
  153. }
  154. },
  155. callback: {
  156. onClick: zTreeOnClick
  157. }
  158. };
  159. function zTreeOnClick(event, treeId, treeNode) {
  160. if(treeNode.level == 2) {
  161. $('.inps').val(treeNode.F_DeptName);
  162. $("#PID").val(treeNode.F_DeptId);
  163. $("#Dpment").val(treeNode.F_DeptName);
  164. }
  165. };
  166. //交办
  167. function JA() {
  168. $.post(huayi.config.callcenter_url + 'WorkOrder/AssignWorkOrder', {
  169. workorderid: wid,
  170. maindeptid: $("#PID").val(), //单位
  171. limittime: $("#startTime").val(), //办理时限
  172. assignedopinion: $('#assignedopinion').val(), //交办意见
  173. state: State,
  174. assignid: a,
  175. token: $.cookie("token")
  176. }, function(result) {
  177. result = JSON.parse(result);
  178. if(result.state.toLowerCase() == "success") {
  179. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  180. console.log(index);
  181. parent.layer.close(index); //再执行关闭
  182. parent.load();
  183. parent.layer.msg("交办成功");
  184. }
  185. })
  186. }
  187. //所属分类下拉
  188. $('.inps').focus(function() {
  189. $('.xlAdd').css('display', 'block')
  190. })
  191. $('.xl').click(function() {
  192. if($('.xlAdd').css('display') == 'block') {
  193. $('.xlAdd').css('display', 'none')
  194. } else {
  195. $('.xlAdd').css('display', 'block')
  196. }
  197. })
  198. $('.addTree').mouseleave(function() {
  199. $(this).css('display', 'none')
  200. })
  201. //清除
  202. function Clean() {
  203. $("#startTime").val(''),
  204. $('#assignedopinion').val('')
  205. }
  206. });
  207. //草稿详情
  208. function Detail() {
  209. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetDraftInfo', {
  210. workorderid: wid,
  211. type: 1,
  212. token: $.cookie("token")
  213. }, function(result) {
  214. if(result.state.toLowerCase() == "success") {
  215. if(result.data.length > 0) {
  216. $("#startTime").val(result.data[0].F_LimitTime);
  217. $('#assignedopinion').val(result.data[0].F_AssignedOpinion);
  218. a = result.data[0].F_Id;
  219. }
  220. }
  221. })
  222. }
  223. </script>
  224. </body>
  225. </html>