市长热线演示版

indexmanage.aspx 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="indexmanage.aspx.cs" Inherits="HySoft.BaseCallCenter.Web.qualitymanage.indexmanage" %>
  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/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
  9. <script src="../scripts/ui/js/core/base.js" type="text/javascript"></script>
  10. <script src="../scripts/ui/js/ligerui.min.js" type="text/javascript"></script>
  11. <link href="../scripts/ui/skins/Tab/css/tab.css" rel="stylesheet" type="text/css" />
  12. <link href="../scripts/ui/skins/Tab/css/grid.css" rel="stylesheet" type="text/css" />
  13. <script src="../scripts/ui/js/plugins/ligerGrid.js" type="text/javascript"></script>
  14. <script src="../scripts/ui/js/plugins/ligerLayout.js" type="text/javascript"></script>
  15. <script src="../scripts/ui/js/plugins/ligerTree.js" type="text/javascript"></script>
  16. <script src="../scripts/ui/js/plugins/ligerMenu.js" type="text/javascript"></script>
  17. <link href="../scripts/ui/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
  18. <script src="../scripts/My97DatePicker/lang/zh-cn.js" type="text/javascript"></script>
  19. <link href="../images/style.css" rel="stylesheet" type="text/css" />
  20. <script type="text/javascript">
  21. var selectcategoryid = "";
  22. var categorylist;
  23. var indexlist;
  24. var selectindex = -1;
  25. function ReLoadCategoryList() {
  26. categorylist.reload();
  27. }
  28. function LoadCategoryList() {
  29. categorylist = $("#divCategoryList").ligerGrid({
  30. checkbox: false,
  31. height: '97%',
  32. width: 330,
  33. columns: [
  34. { display: '分类名称', width: '200', name: '_f_categoryname', id: '_f_categoryid', align: 'left' },
  35. { display: '分值', width: '60', name: '_f_expand1' }
  36. ],
  37. tree: { columnId: '_f_categoryid', idField: '_f_categoryid',
  38. parentIDField: '_f_parentid'
  39. },
  40. toolbar: {
  41. items: [
  42. { text: '增加', click: itemclick1, icon: 'add' },
  43. { line: true },
  44. { text: '修改', click: itemclick1, icon: 'modify' },
  45. { line: true },
  46. { text: '删除', click: itemclick1, icon: 'delete' }
  47. ]
  48. },
  49. url: 'ajax/indexcategory.ashx?action=getlist', pageSize: 100, pageSizeOptions: [10, 20, 50, 100], rownumbers: true, isChecked: f_isChecked,
  50. onCheckRow: function (checked, rowdata, rowindex) {
  51. // for (var rowid in this.records)
  52. // this.unselect(rowid);
  53. // this.select(rowindex);
  54. },
  55. onAfterShowData: function (data) {
  56. try {
  57. if (selectindex != -1) {
  58. this.select(selectindex);
  59. }
  60. }
  61. catch (e) {
  62. alert(e.Message);
  63. }
  64. },
  65. onSelectRow: function (data, rowindex, rowobj) {
  66. selectcategoryid = data._f_categoryid;
  67. selectindex = rowindex;
  68. LoadIndexList();
  69. },
  70. onDblClickRow: function (data, rowindex, rowobj) {
  71. var id = "";
  72. var name = "";
  73. try {
  74. id = data._f_categoryid;
  75. name = data._f_categoryname;
  76. }
  77. catch (e) {
  78. }
  79. if (id != "") {
  80. $.ligerDialog.open({ url: 'indexcategoryedit.aspx?otype=modify&id=' + id, title: '修改分类【<font color="red">' + name + '</font>】', height: 250, width: 380, isResize: true
  81. });
  82. }
  83. else {
  84. $.ligerDialog.error('没有选择要修改的分类,请选择');
  85. }
  86. }
  87. });
  88. $("#pageloading").hide();
  89. }
  90. function f_isChecked(rowdata) {
  91. if (selectcategoryid != "") {
  92. if (rowdata._f_categoryid == selectcategoryid) {
  93. return true;
  94. }
  95. }
  96. return false;
  97. }
  98. function LoadIndexList() {
  99. var key = escape(document.getElementById("txtKeywords").value);
  100. indexlist = $("#divindexlist").ligerGrid({
  101. height: '97%',
  102. columns: [
  103. { display: '指标分类', width: '120', name: '_f_categoryname' },
  104. { display: '指标标题', align: 'left', width: '350', name: '_f_title' },
  105. { display: '分值', width: '70', name: '_f_score' }
  106. ],
  107. toolbar: {
  108. items: [
  109. { text: '增加', click: itemclick2, icon: 'add' },
  110. { line: true },
  111. { text: '修改', click: itemclick2, icon: 'modify' },
  112. { line: true },
  113. { text: '删除', click: itemclick2, icon: 'delete' },
  114. { line: true },
  115. { text: '所有指标', click: itemclick2, icon: 'attibutes' }
  116. ]
  117. },
  118. url: 'ajax/indexbase.ashx?action=getlist&categoryid=' + selectcategoryid + '&selecttype=&key=' + key, pageSize: 50, pageSizeOptions: [10, 20, 50], rownumbers: true,
  119. onSelectRow: function (data, rowindex, rowobj) {
  120. },
  121. onDblClickRow: function (data, rowindex, rowobj) {
  122. var vheight = $("#form1").height() - 30;
  123. var vwidth = $("#form1").width() * 0.9;
  124. if (vwidth > 700) {
  125. vwidth = 700;
  126. }
  127. var id = "";
  128. var vtitle = "修改指标";
  129. try {
  130. id = data._f_indexid;
  131. vtitle = "【<font color='red'>" + data._f_title + "</font>】修改指标";
  132. }
  133. catch (e) {
  134. }
  135. if (id != "") {
  136. $.ligerDialog.open({ url: 'indexedit.aspx?otype=modify&id=' + id, title: vtitle, height: 380, width: 500, isResize: true
  137. });
  138. }
  139. else {
  140. $.ligerDialog.error('没有选择要修改的指标,请选择');
  141. }
  142. }
  143. });
  144. $("#pageloading").hide();
  145. }
  146. function itemclick1(item) {
  147. switch (item.icon) {
  148. case "add":
  149. var row = categorylist.getSelectedRow();
  150. if (row) {
  151. $.ligerDialog.open({ url: 'indexcategoryedit.aspx?otype=new&categoryid=' + row._f_categoryid, title: '添加【<font color="red">' + row._f_categoryname + '</font>】子分类', height: 250, width: 400, isResize: false
  152. });
  153. }
  154. else {
  155. $.ligerDialog.open({ url: 'indexcategoryedit.aspx?otype=new&categoryid=0', title: '添加根分类', height: 250, width: 400, isResize: true
  156. });
  157. }
  158. break;
  159. case "modify":
  160. var id = "";
  161. var name = "";
  162. try {
  163. var rowobj = categorylist.getSelectedRow();
  164. id = rowobj._f_categoryid;
  165. name = rowobj._f_categoryname;
  166. }
  167. catch (e) {
  168. }
  169. if (id != "") {
  170. $.ligerDialog.open({ url: 'indexcategoryedit.aspx?otype=modify&id=' + id, title: '修改分类【<font color="red">' + name + '</font>】', height: 250, width: 380, isResize: true
  171. });
  172. }
  173. else {
  174. $.ligerDialog.error('没有选择要修改的分类,请选择');
  175. }
  176. break;
  177. case "delete":
  178. var id = "";
  179. var rowobj;
  180. try {
  181. rowobj = categorylist.getSelectedRow();
  182. id = rowobj._f_categoryid;
  183. }
  184. catch (e) {
  185. }
  186. if (id != "") {
  187. $.ligerDialog.confirm('确定要删除【<font color="red">' + rowobj._f_categoryname + '</font>】吗?', function (yes) {
  188. if (yes) {
  189. $.post("ajax/indexcategory.ashx?action=delete&id=" + id, function (data) {
  190. if (data == "success") {
  191. $.ligerDialog.success('删除成功');
  192. ReLoadCategoryList();
  193. }
  194. else if (data == "error") {
  195. $.ligerDialog.error('删除失败');
  196. }
  197. else {
  198. $.ligerDialog.error('删除失败,此分类下有【<font color="red">' + data + '</font>】个关联指标,无法删除');
  199. }
  200. });
  201. }
  202. });
  203. }
  204. else {
  205. $.ligerDialog.error('没有选择要删除的分类,请选择');
  206. }
  207. break;
  208. }
  209. }
  210. function itemclick2(item) {
  211. switch (item.icon) {
  212. case "add":
  213. var vheight = $("#form1").height() - 30;
  214. var vwidth = $("#form1").width() * 0.9;
  215. if (vwidth > 700) {
  216. vwidth = 700;
  217. }
  218. var id = "";
  219. var vtitle = "添加指标";
  220. var rowobj;
  221. try {
  222. rowobj = categorylist.getSelectedRow();
  223. id = rowobj._f_categoryid;
  224. vtitle = "【<font color='red'>" + rowobj._f_categoryname + "</font>】分类下添加指标";
  225. }
  226. catch (e) {
  227. }
  228. $.ligerDialog.open({ url: 'indexedit.aspx?otype=new&categoryid=' + id + '&selecttype=', title: vtitle, height: 380, width: 500, isResize: true
  229. });
  230. break;
  231. case "modify":
  232. var vheight = $("#form1").height() - 30;
  233. var vwidth = $("#form1").width() * 0.9;
  234. if (vwidth > 700) {
  235. vwidth = 700;
  236. }
  237. var id = "";
  238. var vtitle = "修改指标";
  239. var rowobj;
  240. try {
  241. rowobj = indexlist.getSelectedRow();
  242. id = rowobj._f_indexid;
  243. vtitle = "【<font color='red'>" + rowobj._f_title + "</font>】修改指标";
  244. }
  245. catch (e) {
  246. }
  247. if (id != "") {
  248. $.ligerDialog.open({ url: 'indexedit.aspx?otype=modify&id=' + id, title: vtitle, height: 380, width: 500, isResize: true
  249. });
  250. }
  251. else {
  252. $.ligerDialog.error('没有选择要修改的指标,请选择');
  253. }
  254. break;
  255. case "delete":
  256. var id = "";
  257. var rowobj;
  258. try {
  259. rowobj = indexlist.getSelectedRow();
  260. id = rowobj._f_indexid;
  261. }
  262. catch (e) {
  263. }
  264. if (id != "") {
  265. $.ligerDialog.confirm('确定要删除【<font color="red">' + rowobj._f_title + '</font>】指标吗?', function (yes) {
  266. if (yes) {
  267. $.post("ajax/indexbase.ashx?action=delete&id=" + id + "&categoryid=" + rowobj._f_categoryid, function (data) {
  268. if (data == "success") {
  269. $.ligerDialog.success('删除成功');
  270. ReLoadCategoryList();
  271. LoadIndexList();
  272. }
  273. else {
  274. $.ligerDialog.error('删除失败');
  275. }
  276. });
  277. }
  278. });
  279. }
  280. else {
  281. $.ligerDialog.error('没有选择要删除的指标,请选择');
  282. }
  283. break;
  284. case "attibutes":
  285. selectcategoryid = "";
  286. LoadIndexList();
  287. break;
  288. }
  289. }
  290. $(function () {
  291. //var vheight = $("#form1").height();
  292. //document.getElementById("tableMessage").style.height = vheight - 80;
  293. LoadCategoryList();
  294. LoadIndexList();
  295. });
  296. document.onkeydown = function (event) {
  297. var e = event || window.event || arguments.callee.caller.arguments[0];
  298. if (e && e.keyCode == 13) {
  299. LoadIndexList();
  300. }
  301. };
  302. </script>
  303. </head>
  304. <body>
  305. <form id="form1" runat="server">
  306. <div class="tools_box">
  307. <asp:HiddenField ID="hdF_FunctionId" runat="server" />
  308. <asp:HiddenField ID="hdF_ModuleId" runat="server" />
  309. <div class="tools_bar">
  310. <div class="search_box">
  311. 关键字:<asp:TextBox ID="txtKeywords" runat="server" CssClass="txtInput"></asp:TextBox>&nbsp;&nbsp;
  312. <input id="btnSearch" type="button" value="搜 索" class="btnSearch" onclick="LoadIndexList();" />
  313. </div>
  314. </div>
  315. </div>
  316. <table id="tableMessage" cellpadding="3" cellspacing="3" border="0" style="width: 100%;">
  317. <tr>
  318. <td valign="top" style="width: 330px; padding: 0px 2px 5px 2px;">
  319. <div class="tools_box" style="height: 30px;">
  320. <div class="tools_bar">
  321. <div style="float: left; padding-top: 6px; padding-left: 1px; font-weight: bold;
  322. color: red;">
  323. <img src="../images/icon_site.gif" />&nbsp;指标分类</div>
  324. </div>
  325. </div>
  326. <div id="divCategoryList">
  327. </div>
  328. </td>
  329. <td valign="top" style="padding: 0px 2px 5px 2px;">
  330. <div class="tools_box" style="height: 30px;">
  331. <div class="tools_bar">
  332. <div style="float: left; padding-top: 6px; padding-left: 1px; font-weight: bold;
  333. color: red;">
  334. <img src="../images/icon_attach.png" />&nbsp;指标列表</div>
  335. </div>
  336. </div>
  337. <div id="divindexlist">
  338. </div>
  339. </td>
  340. </tr>
  341. </table>
  342. </form>
  343. </body>
  344. </html>