UU跑腿标准版

deptlist.aspx 7.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="deptlist.aspx.cs" Inherits="HySoft.BaseCallCenter.Web.sysmanage.deptlist" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head id="Head1" runat="server">
  5. <title>部门管理</title>
  6. <link href="../scripts/ui/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  7. <script src="../scripts/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  8. <script src="../scripts/ui/js/core/base.js" type="text/javascript"></script>
  9. <script src="../scripts/ui/js/ligerui.min.js" type="text/javascript"></script>
  10. <link href="../scripts/ui/skins/Tab/css/tab.css" rel="stylesheet" type="text/css" />
  11. <link href="../scripts/ui/skins/Tab/css/grid.css" rel="stylesheet" type="text/css" />
  12. <script src="../scripts/ui/js/plugins/ligerGrid.js" type="text/javascript"></script>
  13. <script src="../scripts/ui/js/plugins/ligerLayout.js" type="text/javascript"></script>
  14. <script src="../scripts/ui/js/plugins/ligerTree.js" type="text/javascript"></script>
  15. <script src="../scripts/ui/js/plugins/ligerMenu.js" type="text/javascript"></script>
  16. <link href="../scripts/ui/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
  17. <link href="../images/style.css" rel="stylesheet" type="text/css" />
  18. <script type="text/javascript">
  19. var menu;
  20. var menucategory;
  21. var actionNode;
  22. var actionRow;
  23. var categorytree = null;
  24. var gridlist = null;
  25. function itemclick(item, i) {
  26. switch (i) {
  27. case 0:
  28. AddCategory();
  29. break;
  30. case 1:
  31. ModifyCategory();
  32. break;
  33. case 2:
  34. DeleteCategory();
  35. break;
  36. default:
  37. break;
  38. }
  39. }
  40. $(function () {
  41. // $("#layout1").ligerLayout({
  42. // leftWidth: 500
  43. // });
  44. InitMenu();
  45. InitCategory();
  46. });
  47. function InitMenu() {
  48. menu = $.ligerMenu({ top: 100, left: 100, width: 120, items:
  49. [
  50. { text: '增加', click: itemclick, icon: 'add' },
  51. { text: '修改', click: itemclick, icon: 'modify' },
  52. { line: true },
  53. { text: '删除', click: itemclick, icon: 'delete' }
  54. ]
  55. });
  56. menucategory = $.ligerMenu({ top: 100, left: 100, width: 120, items:
  57. [
  58. { text: '增加', click: itemclick, icon: 'add' },
  59. { text: '修改', click: itemclick, icon: 'modify' },
  60. { line: true },
  61. { text: '删除', click: itemclick, icon: 'delete' }
  62. ]
  63. });
  64. }
  65. var categoryform;
  66. function InitCategory() {
  67. try {
  68. categorytree = $("#treecategory").ligerTree({
  69. checkbox: false,
  70. nodeWidth: 135,
  71. url: 'ajax/deptcategory.ashx?action=gettreelist',
  72. isExpand: 2,
  73. onContextmenu: function (node, e) {
  74. actionNode = node;
  75. categorytree.selectNode(actionNode.data.id);
  76. menucategory.show({ top: e.pageY, left: e.pageX });
  77. return false;
  78. },
  79. onClick: function (node, e) {
  80. // InitList();
  81. }
  82. });
  83. }
  84. catch (e) {
  85. alert(e.Message);
  86. }
  87. }
  88. //---------小型添加
  89. function AddCategory() {
  90. //获取选择的分类
  91. var node = categorytree.getSelected();
  92. if (node) {
  93. categoryform = $.ligerDialog.open({ url: 'DeptlistAddandEdit.aspx?action=Add&categoryid=' + node.data.id, title: '添加[<font color="red">' + node.data.text + '</font>]部门', height: 250, width: 400, isResize: false
  94. });
  95. }
  96. else {
  97. categoryform = $.ligerDialog.open({ url: 'DeptlistAddandEdit.aspx?action=Add&categoryid=0', title: '添加部门', height: 250, width: 400, isResize: true
  98. });
  99. }
  100. }
  101. function ModifyCategory() {
  102. //获取选择的分类
  103. var node = categorytree.getSelected();
  104. if (node) {
  105. $.ligerDialog.open({ url: 'DeptlistAddandEdit.aspx?action=Modify&id=' + node.data.id, title: '修改[<font color="red">' + node.data.text + '</font>]部门', height: 250, width: 400, isResize: true
  106. });
  107. }
  108. else {
  109. $.ligerDialog.error('没有选择要修改的部门');
  110. }
  111. }
  112. function DeleteCategory() {
  113. //获取选择的分类
  114. var node = categorytree.getSelected();
  115. if (node) {
  116. $.ligerDialog.confirm('确定要删除【<font color="red">' + node.data.text + '</font>】吗?', function (yes) {
  117. if (yes) {
  118. //
  119. $.post("ajax/deptcategory.ashx?action=delete&id=" + node.data.id, function (data) {
  120. if (data == "success") {
  121. $.ligerDialog.success('删除成功');
  122. InitCategory();
  123. }
  124. else {
  125. $.ligerDialog.error('删除失败');
  126. }
  127. });
  128. }
  129. else {
  130. }
  131. });
  132. }
  133. else {
  134. $.ligerDialog.error('没有选择要删除的分类');
  135. }
  136. }
  137. function CloseCategory() {
  138. categoryform.close();
  139. InitCategory();
  140. }
  141. </script>
  142. </head>
  143. <body>
  144. <form id="form1" runat="server">
  145. <div class="tools_box">
  146. <div class="tools_bar">
  147. <a class="tools_btn" href="#" onclick="AddCategory();"><span><b class="add">添加</b></span>
  148. </a><a class="tools_btn" href="#" onclick="ModifyCategory();"><span><b class="modify">修改</b></span>
  149. </a><a class="tools_btn" href="#" onclick="DeleteCategory();"><span>
  150. <b class="delete">删除</b></span> </a>
  151. </div>
  152. <div class="search_box">
  153. <%--<asp:TextBox ID='aa' runat="server" Text=""></asp:TextBox>--%></div>
  154. </div>
  155. <div id="layout1" >
  156. <table cellpadding="0" cellspacing="0" border="0" height="100%">
  157. <tr height="100%">
  158. <td>
  159. <ul id="treecategory">
  160. <li><span>玉</span>
  161. <ul>
  162. <li><span>南阳玉</span> </li>
  163. <li><span>和田玉</span></li>
  164. </ul>
  165. </li>
  166. </ul>
  167. </td>
  168. </tr>
  169. </table>
  170. </div>
  171. </form>
  172. </body>
  173. </html>