Bez popisu

jiaobanX.html 5.8KB

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 data-adaptheight id="assignedopinion" name="" rows="4" 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 src="../js/adjustHeight.js"></script>
  104. <script>
  105. var wid = helper.request.queryString("wid");
  106. var State;
  107. var a = $("#ID").val()
  108. $(".inps").val($("#Dpment").val());
  109. Detail();
  110. $(document).ready(function() {
  111. $(".inps").val($("#Dpment").val());
  112. //console.log(a);
  113. laydate.skin('blue');
  114. laydate({
  115. elem: '#startTime',
  116. event: 'focus'
  117. });
  118. $('.BC').click(function() {
  119. if($("#assignedopinion").val() == "") {
  120. layer.msg("交办意见不能为空");
  121. } else {
  122. State = 0;
  123. JA();
  124. }
  125. })
  126. $('.Submit').click(function() {
  127. if($("#assignedopinion").val() == "") {
  128. layer.msg("交办意见不能为空");
  129. } else {
  130. State = 1;
  131. JA();
  132. }
  133. });
  134. tree();
  135. function tree() {
  136. $.get(huayi.config.callcenter_url + 'Department/GetDeptList', {
  137. "token": $.cookie("token"),
  138. // "pid": pid
  139. }, function(result) {
  140. result = $.parseJSON(result);
  141. $.fn.zTree.init($("#addTreeDemo"), setting1, result.data); //实例化树形图
  142. });
  143. }
  144. var setting1 = {
  145. data: {
  146. key: {
  147. name: "F_DeptName"
  148. },
  149. simpleData: {
  150. enable: true,
  151. idKey: "F_DeptId",
  152. pIdKey: "F_PartentId",
  153. rootPId: 0
  154. }
  155. },
  156. callback: {
  157. onClick: zTreeOnClick
  158. }
  159. };
  160. function zTreeOnClick(event, treeId, treeNode) {
  161. if(treeNode.level >= 2) {
  162. $('.inps').val(treeNode.F_DeptName);
  163. $("#PID").val(treeNode.F_DeptId);
  164. $("#Dpment").val(treeNode.F_DeptName);
  165. }
  166. };
  167. //交办
  168. function JA() {
  169. $.post(huayi.config.callcenter_url + 'WorkOrder/AssignWorkOrder', {
  170. workorderid: wid,
  171. maindeptid: $("#PID").val(), //单位
  172. limittime: $("#startTime").val(), //办理时限
  173. assignedopinion: $('#assignedopinion').val(), //交办意见
  174. state: State,
  175. assignid: a,
  176. token: $.cookie("token")
  177. }, function(result) {
  178. result = JSON.parse(result);
  179. if(result.state.toLowerCase() == "success") {
  180. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  181. console.log(index);
  182. parent.layer.close(index); //再执行关闭
  183. parent.load();
  184. parent.layer.msg("交办成功");
  185. }
  186. })
  187. }
  188. //所属分类下拉
  189. $('.inps').focus(function() {
  190. $('.xlAdd').css('display', 'block')
  191. })
  192. $('.xl').click(function() {
  193. if($('.xlAdd').css('display') == 'block') {
  194. $('.xlAdd').css('display', 'none')
  195. } else {
  196. $('.xlAdd').css('display', 'block')
  197. }
  198. })
  199. $('.addTree').mouseleave(function() {
  200. $(this).css('display', 'none')
  201. })
  202. //清除
  203. function Clean() {
  204. $("#startTime").val(''),
  205. $('#assignedopinion').val('')
  206. }
  207. });
  208. //草稿详情
  209. function Detail() {
  210. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetDraftInfo', {
  211. workorderid: wid,
  212. type: 1,
  213. token: $.cookie("token")
  214. }, function(result) {
  215. if(result.state.toLowerCase() == "success") {
  216. if(result.data.length > 0) {
  217. $("#startTime").val(result.data[0].F_LimitTime);
  218. $('#assignedopinion').val(result.data[0].F_AssignedOpinion);
  219. a = result.data[0].F_Id;
  220. }
  221. }
  222. })
  223. }
  224. </script>
  225. </body>
  226. </html>