市长热线演示版

worktimesset.aspx 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="worktimesset.aspx.cs" Inherits="HySoft.BaseCallCenter.Web.telmanage.worktimesset" %>
  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/CustomersData.js" type="text/javascript"></script>
  14. <link href="../scripts/ui/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
  15. <link href="../images/style.css" rel="stylesheet" type="text/css" />
  16. <script type="text/javascript">
  17. function itemclick(item) {
  18. alert(item.text);
  19. }
  20. var singleClick;
  21. var gridlist;
  22. $(function () {
  23. LoadList();
  24. });
  25. function LoadList() {
  26. gridlist = $("#divDataList").ligerGrid({
  27. height: '100%',
  28. checkbox: true,
  29. columns: [
  30. { display: '工作开始时间', name: '_f_workstarttimes', minWidth: 60, type: 'date', format: 'hh:mm:ss' },
  31. { display: '工作结束时间', name: '_f_workendtimes', minWidth: 60, type: 'date', format: 'hh:mm:ss' },
  32. { display: '时间段名称', name: '_f_timename', minWidth: 60 },
  33. { display: '时间段备注', name: '_f_remark'}],
  34. url: 'ajax/workcalendarset.ashx?action=getTimeList&keyword=' + encodeURIComponent(document.getElementById("txtKeywords").value), pageSize: 10, rownumbers: true,
  35. onSelectRow: function (data, rowindex, rowobj) {
  36. singleClick = formatDateTime(data._f_workstarttimes);
  37. },
  38. onDblClickRow: function (data, rowindex, rowobj) {
  39. Edit('edit');
  40. },
  41. isChecked: function (rowdata) {
  42. if (findCheckedCustomer(formatDateTime(rowdata._f_workstarttimes)) == -1)
  43. return false;
  44. return true;
  45. },
  46. onCheckRow: function (checked, data) {
  47. if (checked) addCheckedCustomer(formatDateTime(data._f_workstarttimes));
  48. else removeCheckedCustomer(formatDateTime(data._f_workstarttimes));
  49. },
  50. onCheckAllRow: function (checked) {
  51. for (var rowid in this.records) {
  52. if (checked)
  53. addCheckedCustomer(formatDateTime(this.records[rowid]['_f_workstarttimes']));
  54. else
  55. removeCheckedCustomer(formatDateTime(this.records[rowid]['_f_workstarttimes']));
  56. }
  57. }
  58. });
  59. gridlist.changePage('first');
  60. $("#pageloading").hide();
  61. }
  62. function formatDateTime(value, rowData, rowIndex) {
  63. if (value != null) {
  64. var date = new Date(parseInt(value.replace("/Date(", "").replace(")/", ""), 10));
  65. var result = date.getFullYear() + "-" + (date.getMonth() + 1 < 10 ? "0"
  66. + (date.getMonth() + 1) : date.getMonth() + 1) + "-"
  67. + (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " "
  68. + (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":"
  69. + (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":"
  70. + (date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds());
  71. return result;
  72. }
  73. return value;
  74. }
  75. function deleteRow() {
  76. g.deleteSelectedRow();
  77. }
  78. var checkedCustomer = [];
  79. function findCheckedCustomer(_f_mobilenum) {
  80. for (var i = 0; i < checkedCustomer.length; i++) {
  81. if (checkedCustomer[i] == _f_mobilenum) return i;
  82. }
  83. return -1;
  84. }
  85. function addCheckedCustomer(_f_mobilenum) {
  86. if (findCheckedCustomer(_f_mobilenum) == -1)
  87. checkedCustomer.push(_f_mobilenum);
  88. }
  89. function removeCheckedCustomer(_f_mobilenum) {
  90. var i = findCheckedCustomer(_f_mobilenum);
  91. if (i == -1) return;
  92. checkedCustomer.splice(i, 1);
  93. }
  94. function Add(param) {
  95. $.ligerDialog.open({ url: 'worktimessetaddandedit.aspx?actionFlag=' + param, title: '添加上班时段', height: 350, width: 530, isResize: true
  96. });
  97. }
  98. function Edit(params) {
  99. if (singleClick == "" || singleClick == undefined) {
  100. $.ligerDialog.warn('请选择修改行!');
  101. } else {
  102. $.ligerDialog.open({ url: 'worktimessetaddandedit.aspx?actionFlag=' + params + '&singleFlage=' + singleClick, title: '修改上班时段', height: 350, width: 530, isResize: true
  103. });
  104. }
  105. }
  106. function DeleteList() {
  107. if (checkedCustomer.length <= 0) {
  108. $.ligerDialog.warn('请选择删除行!');
  109. } else {
  110. $.ligerDialog.confirm('确定要删除吗?', function (yes) {
  111. if (yes) {
  112. gridlist = $("#divDataList").ligerGrid({
  113. url: 'ajax/workcalendarset.ashx?action=deletelist&arrid=' + checkedCustomer.join(','), pageSize: 10, rownumbers: true
  114. });
  115. }
  116. LoadList();
  117. });
  118. }
  119. }
  120. document.onkeydown = function (event) {
  121. var e = event || window.event || arguments.callee.caller.arguments[0];
  122. if (e && e.keyCode == 13) {
  123. LoadList();
  124. }
  125. };
  126. </script>
  127. </head>
  128. <body style="margin: 0px; padding: 0px; overflow: hidden;">
  129. <form id="form1" runat="server">
  130. <div class="l-loading" style="display: block" id="pageloading">
  131. </div>
  132. <div class="tools_box">
  133. <div class="tools_bar">
  134. <a class="tools_btn" href="#" onclick="Add('add');"><span><b class="add">添加</b></span>
  135. </a><a class="tools_btn" href="#" onclick="Edit('edit');"><span><b class="modify">修改</b></span>
  136. </a><a class="tools_btn" href="#" onclick="DeleteList();"><span><b class="delete">批量删除</b></span>
  137. </a>
  138. <div class="search_box">
  139. 关键字:<asp:TextBox ID="txtKeywords" runat="server" CssClass="txtInput"></asp:TextBox>&nbsp;&nbsp;
  140. <input id="btnSearch" type="button" value="搜 索" class="btnSearch" onclick="LoadList();" />
  141. </div>
  142. </div>
  143. </div>
  144. <div id="divDataList">
  145. </div>
  146. </form>
  147. </body>
  148. </html>