UU跑腿标准版

customerlist.aspx 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="customerlist.aspx.cs" Inherits="HySoft.BaseCallCenter.Web.customermanage.customerlist" %>
  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/json2.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. <script src="../scripts/CustomersData.js" type="text/javascript"></script>
  18. <link href="../scripts/ui/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
  19. <link href="../images/style.css" rel="stylesheet" type="text/css" />
  20. <script src="../scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
  21. <script type="text/javascript">
  22. var singleClick;
  23. var count = 0;
  24. var counts = 0;
  25. $(function () {
  26. InitList();
  27. });
  28. function InitList() {
  29. count += 1;
  30. counts = count;
  31. var sql = GetSql();
  32. try {
  33. gridlist = $("#divDataList").ligerGrid({
  34. checkbox: true,
  35. height: '95%',
  36. columns: [
  37. { display: 'Id', name: '_f_customerid', hide: 'Id', width: 1 },
  38. { display: '客户编号', frozen: true, name: '_f_customercode', align: 'left', width: 110 },
  39. { display: '客户名称', frozen: true, name: '_f_customername', width: 180 },
  40. { display: '负责人', frozen: true, name: '_f_chargename', width: 80 },
  41. { display: '联系电话',align:'left', frozen: true, name: '_f_chargetelephone', width: 130, render: function (rowdata, rowindex, value) {
  42. if (value == "") {
  43. return "&nbsp;";
  44. }
  45. else {
  46. return "<img src=\"../images/phone3.png\" style=\"cursor:hand; width:24px;\" title=\"拨打" + value + "\" onclick=\"CallOut('" + encodeURI(value) + "');\" />" + value;
  47. }
  48. }
  49. },
  50. { display: '客户归属部门', name: '_f_servicedept', width: 100 },
  51. { display: '所属省份', name: '_f_province', width: 80 },
  52. { display: '所属县市', name: '_f_city', width: 80 },
  53. { display: '产品系列', name: '_f_productline', width: 110 },
  54. { display: '客户等级', name: '_f_customerclass', width: 80 },
  55. { display: '客户属性', name: '_f_customernature', width: 80 },
  56. { display: '售后人员', name: '_f_aftersalename', width: 80 }
  57. ],
  58. url: 'ajax/customer.ashx?action=getcustomerlist' + sql, pageSize: 20, pageSizeOptions: [10, 20, 50], rownumbers: true,
  59. onSelectRow: function (data, rowindex, rowobj) {
  60. singleClick = data._f_customerid;
  61. },
  62. onDblClickRow: function (data, rowindex, rowobj) {
  63. Edit('edit');
  64. }
  65. });
  66. }
  67. catch (e) {
  68. alert(e.Message);
  69. }
  70. gridlist.changePage('first');
  71. $("#pageloading").hide();
  72. }
  73. function GetSql() {
  74. var sql = "";
  75. if (document.getElementById("txtKey").value != "") {
  76. sql += "&key=" + escape(document.getElementById("txtKey").value);
  77. }
  78. if (document.getElementById("txtCustomerNature").value != "") {
  79. sql += "&customernature=" + encodeURIComponent(document.getElementById("txtCustomerNature").value);
  80. }
  81. if (document.getElementById("txtCustomerClass").value != "") {
  82. sql += "&customerclass=" + encodeURIComponent(document.getElementById("txtCustomerClass").value);
  83. }
  84. return sql;
  85. }
  86. function Delete() {
  87. try {
  88. //获取选择的行
  89. var rows = gridlist.getSelectedRows();
  90. if (rows.length > 0) {
  91. $.ligerDialog.confirm('确定要批量删除选择的记录吗?', function (yes) {
  92. if (yes) {
  93. try {
  94. var arr = new Array();
  95. var i = 0;
  96. for (var i = 0; i < rows.length; i++) {
  97. arr[i] = rows[i]._f_customerid;
  98. }
  99. $.post("ajax/customer.ashx?action=delete&arrid=" + arr.toString(), function (data) {
  100. if (data == "success") {
  101. $.ligerDialog.success('删除成功');
  102. InitList();
  103. }
  104. else {
  105. $.ligerDialog.error('删除失败');
  106. }
  107. });
  108. }
  109. catch (e) {
  110. alert(e.Message);
  111. }
  112. }
  113. else {
  114. }
  115. });
  116. }
  117. else {
  118. $.ligerDialog.error('没有选择要删除的客户');
  119. }
  120. }
  121. catch (e) {
  122. $.ligerDialog.error(e.Message);
  123. }
  124. }
  125. function AddCustomer() {
  126. var vheight = $("#form1").height();
  127. var vwidth = $("#form1").width() * 0.9;
  128. if (vwidth > 700) {
  129. vwidth = 700;
  130. }
  131. $.ligerDialog.open({ url: 'customermodify.aspx?actionFlag=add', title: '添加客户信息', height: vheight, width: vwidth, isResize: true
  132. });
  133. }
  134. function DoInCustomer() {
  135. var vheight = $("#form1").height();
  136. var vwidth = $("#form1").width() * 0.9;
  137. if (vwidth > 700) {
  138. vwidth = 700;
  139. }
  140. $.ligerDialog.open({ url: 'customermodify.aspx?actionFlag=add', title: '导入客户信息', height: vheight, width: vwidth, isResize: true
  141. });
  142. }
  143. function Export() {
  144. $.ligerDialog.confirm('手动同步时间可能较长,确认同步?', function (yes) {
  145. if (yes) {
  146. $.ligerDialog.open({
  147. url: 'customerSYNC.aspx',
  148. title: '同步客户信息',
  149. height: 200,
  150. width: 400,
  151. isResize: true
  152. });
  153. }
  154. });
  155. }
  156. function Edit(params) {
  157. if (count > 1) {
  158. count -= 1;
  159. return;
  160. } else {
  161. count = counts;
  162. if (singleClick == "" || singleClick == undefined) {
  163. alert("请选择修改行!");
  164. } else {
  165. var vheight = $("#form1").height();
  166. var vwidth = $("#form1").width() * 0.9;
  167. if (vwidth > 700) {
  168. vwidth = 700;
  169. }
  170. $.ligerDialog.open({ url: 'customermodify.aspx?actionFlag=' + params + '&customerId=' + singleClick, title: '修改客户信息', height: vheight, width: vwidth, isResize: true, overflow:scroll
  171. });
  172. }
  173. }
  174. }
  175. document.onkeydown = function (event) {
  176. var e = event || window.event || arguments.callee.caller.arguments[0];
  177. if (e && e.keyCode == 13) {
  178. InitList();
  179. }
  180. };
  181. </script>
  182. </head>
  183. <body>
  184. <form id="form1" runat="server">
  185. <div class="tools_box">
  186. <div class="tools_bar">
  187. <a class="tools_btn" href="#" onclick="AddCustomer();">
  188. <span><b class="add">添加</b></span>
  189. </a>
  190. <a class="tools_btn" href="#" onclick="Edit('edit');">
  191. <span><b class="modify">修改</b></span>
  192. </a>
  193. <a class="tools_btn" href="#" onclick="Delete();"><span>
  194. <b class="delete">删除</b></span> </a>
  195. <a class="tools_btn" href="#" onclick="DoInCustomer();"><span>
  196. <b class="export">导入客户</b></span> </a>
  197. <%--<a class="tools_btn" href="#" onclick="Export();"><span>
  198. <b class="export">同步客户</b></span> </a>--%>
  199. <div class="search_box">
  200. 客户名称:<asp:TextBox ID="txtKey" runat="server" CssClass="txtInput" Width="80px"></asp:TextBox>&nbsp;&nbsp;
  201. 客户属性:<asp:DropDownList ID="txtCustomerNature" runat="server">
  202. </asp:DropDownList>
  203. <%--<asp:TextBox ID="txtCustomerNature" runat="server" CssClass="txtInput" Width="50px"></asp:TextBox>--%>&nbsp;&nbsp;
  204. 客户等级:<asp:DropDownList ID="txtCustomerClass" runat="server">
  205. </asp:DropDownList>
  206. <%--<asp:TextBox ID="txtCustomerClass" runat="server" CssClass="txtInput" Width="50px"></asp:TextBox>--%>&nbsp;&nbsp;
  207. <input id="btnSearch" type="button" value="搜 索" class="btnSearch" onclick="InitList();" />
  208. </div>
  209. </div>
  210. </div>
  211. <div id="divDataList">
  212. </div>
  213. </form>
  214. </body>
  215. </html>