市长热线演示版

selectcustomer.aspx 9.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="selectcustomer.aspx.cs" Inherits="HySoft.BaseCallCenter.Web.telmanage.selectcustomer" %>
  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 = 1;
  24. var counts = 1;
  25. $(function () {
  26. InitList();
  27. });
  28. function List() {
  29. count += 1;
  30. counts = count;
  31. InitList();
  32. }
  33. function InitList() {
  34. var sql = GetSql();
  35. try {
  36. gridlist = $("#divDataList").ligerGrid({
  37. checkbox: false,
  38. height: '90%',
  39. columns: [
  40. { display: '操作', isSort: false, width: 50, render: function (rowdata, rowindex, value) {
  41. var h = "";
  42. if (!rowdata._editing) {
  43. h += "<a href='javascript:ShowInfo(" + rowdata._f_customerid + ")'>详细</a> ";
  44. }
  45. return h;
  46. }
  47. },
  48. { display: 'Id', name: '_f_customerid', hide: 'Id', width: '1%' },
  49. { display: '客户编号', name: '_f_customercode', align: 'left', width: '11%' },
  50. { display: '客户名称', name: '_f_customername', width: '15%' },
  51. //{ display: '负责人', name: '_f_chargename', width: '9%' },
  52. { display: '联系电话', name: '_f_telephone', width: '9%' },
  53. { display: '所属省份', name: '_f_province', width: '9%' },
  54. { display: '所属县市', name: '_f_city', width: '9%' }
  55. //{ display: '产品系列', name: '_f_productline', width: '10%' },
  56. //{ display: '客户等级', name: '_f_customerclass', width: '9%' },
  57. //{ display: '客户属性', name: '_f_customernature', width: '9%' },
  58. //{ display: '售后人员', name: '_f_aftersalename', width: '9%' }
  59. ],
  60. url: '../customermanage/ajax/customer.ashx?action=getcustomerlist' + sql, pageSize: 10, rownumbers: true,
  61. onDblClickRow: function (data, rowindex, rowobj) {
  62. singleClick = data._f_customerid;
  63. if (count > 1) {
  64. count -= 1;
  65. return;
  66. } else {
  67. try {
  68. parent.SetCustomerInfo(data._f_customerid, data._f_customername, data._f_customercode, data._f_servicedeptid, data._f_regionid, data._f_cityid,
  69. data._f_servicedept, data._f_province, data._f_city, data._f_chargename, data._f_telephone, data._f_mobile, data._f_chargetelephone);
  70. }
  71. catch (e) {
  72. alert(e.Message);
  73. }
  74. }
  75. CloseThis();
  76. },
  77. onSelectRow: function (data, rowindex, rowobj) {
  78. singleClick = data._f_customerid;
  79. if (count > 1) {
  80. count -= 1;
  81. return;
  82. } else {
  83. try {
  84. parent.SetCustomerInfo(data._f_customerid, data._f_customername, data._f_customercode, data._f_servicedeptid, data._f_regionid, data._f_cityid,
  85. data._f_servicedept, data._f_province, data._f_city, data._f_chargename, data._f_telephone, data._f_mobile, data._f_chargetelephone);
  86. }
  87. catch (e) {
  88. alert(e.Message);
  89. }
  90. }
  91. }
  92. });
  93. }
  94. catch (e) {
  95. alert(789);
  96. alert(e.Message);
  97. }
  98. gridlist.changePage('first');
  99. $("#pageloading").hide();
  100. }
  101. function ShowInfo(cid) {
  102. if (count > 1) {
  103. count -= 1;
  104. return;
  105. } else {
  106. count = counts;
  107. if (cid == "" || cid == undefined) {
  108. alert("客户不存在!");
  109. } else {
  110. var vheight = $("#form1").height();
  111. var vwidth = $("#form1").width() * 0.9;
  112. $.ligerDialog.open({ url: '/customermanage/customermodify.aspx?actionFlag=edit&customerId=' + cid, title: '修改客户信息', height: vheight, width: vwidth, isResize: true, overflow: scroll
  113. });
  114. }
  115. }
  116. }
  117. function formatDateTime(value) {
  118. if (value != null) {
  119. var date = new Date(parseInt(value.replace("/Date(", "").replace(")/", ""), 10));
  120. var result = date.getFullYear() + "-" + (date.getMonth() + 1 < 10 ? "0"
  121. + (date.getMonth() + 1) : date.getMonth() + 1) + "-"
  122. + (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " "
  123. + (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":"
  124. + (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":"
  125. + (date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds());
  126. return result;
  127. }
  128. return value;
  129. }
  130. function GetSql() {
  131. var sql = "";
  132. if (document.getElementById("txtKey").value != "") {
  133. sql += "&key=" + escape(document.getElementById("txtKey").value);
  134. } else {
  135. if (document.getElementById("HdName").value != "") {
  136. sql += "&key=" + escape(document.getElementById("HdName").value);
  137. document.getElementById("txtKey").value = document.getElementById("HdName").value;
  138. }
  139. }
  140. return sql;
  141. }
  142. function CloseThis() {
  143. if (singleClick == null || singleClick == undefined || singleClick == "") {
  144. alert("请选择客户!");
  145. } else {
  146. var dialog = frameElement.dialog;
  147. dialog.close();
  148. }
  149. }
  150. function FastAdd() {
  151. $.ligerDialog.confirm('快速添加新用户?', function (yes) {
  152. if (yes == true) {
  153. var cname = encodeURIComponent($("#txtKey").val());
  154. if (cname != "") {
  155. $.post("../customermanage/ajax/customer.ashx?action=fastadd&cn=" + cname, function (data, states) {
  156. if (states == "success") {
  157. if (data == "True") {
  158. $.ligerDialog.success('添加成功');
  159. } else if (data == "False") {
  160. $.ligerDialog.error('添加失败');
  161. }
  162. }
  163. })
  164. }
  165. else { $.ligerDialog.warn('客户名不能为空'); }
  166. }
  167. });
  168. }
  169. document.onkeydown = function (event) {
  170. var e = event || window.event || arguments.callee.caller.arguments[0];
  171. if (e && e.keyCode == 13) {
  172. List();
  173. }
  174. };
  175. </script>
  176. </head>
  177. <body>
  178. <form id="form1" runat="server">
  179. <div class="tools_box">
  180. <div class="tools_bar">
  181. <asp:HiddenField ID="HdName" runat="server" />
  182. <a class="tools_btn" href="#" onclick="CloseThis();"><span><b class="modify">选择</b></span></a>
  183. <div class="search_box">
  184. 关键字:<asp:TextBox ID="txtKey" runat="server" CssClass="txtInput"></asp:TextBox>&nbsp;&nbsp;
  185. <input id="btnSearch" type="button" value="搜 索" class="btnSearch" onclick="List();" />&nbsp;&nbsp;
  186. <input id="btnAddCustomer" type="button" title="快速添加新用户" value="添加" class="btnSearch" onclick="FastAdd();" />
  187. </div>
  188. </div>
  189. </div>
  190. <div id="divDataList">
  191. </div>
  192. </form>
  193. </body>
  194. </html>