鹤壁电销版 自用

selectcustomer.aspx 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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_chargetelephone', 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_productlineid, data._f_customernatureid, data._f_customerclassid, data._f_industryid, data._f_relationshipclassid,
  70. data._f_aftersalenameid, data._f_servicedept, data._f_province, data._f_city, data._f_productline, data._f_customernature, data._f_customerclass,
  71. data._f_customerindustry, data._f_relationshipclass, data._f_aftersalename, formatDateTime(data._f_qualityguaranteeendtime), data._f_systemtype, data._f_chargename);
  72. }
  73. catch (e) {
  74. alert(e.Message);
  75. }
  76. }
  77. CloseThis();
  78. },
  79. onSelectRow: function (data, rowindex, rowobj) {
  80. singleClick = data._f_customerid;
  81. if (count > 1) {
  82. count -= 1;
  83. return;
  84. } else {
  85. try {
  86. parent.SetCustomerInfo(data._f_customerid, data._f_customername, data._f_customercode, data._f_servicedeptid, data._f_regionid, data._f_cityid,
  87. data._f_productlineid, data._f_customernatureid, data._f_customerclassid, data._f_industryid, data._f_relationshipclassid,
  88. data._f_aftersalenameid, data._f_servicedept, data._f_province, data._f_city, data._f_productline, data._f_customernature, data._f_customerclass,
  89. data._f_customerindustry, data._f_relationshipclass, data._f_aftersalename, formatDateTime(data._f_qualityguaranteeendtime), data._f_systemtype, data._f_chargename);
  90. }
  91. catch (e) {
  92. alert(e.Message);
  93. }
  94. }
  95. }
  96. });
  97. }
  98. catch (e) {
  99. alert(789);
  100. alert(e.Message);
  101. }
  102. gridlist.changePage('first');
  103. $("#pageloading").hide();
  104. }
  105. function ShowInfo(cid) {
  106. if (count > 1) {
  107. count -= 1;
  108. return;
  109. } else {
  110. count = counts;
  111. if (cid == "" || cid == undefined) {
  112. alert("客户不存在!");
  113. } else {
  114. var vheight = $("#form1").height();
  115. var vwidth = $("#form1").width() * 0.9;
  116. $.ligerDialog.open({ url: '/customermanage/customermodify.aspx?actionFlag=edit&customerId=' + cid, title: '修改客户信息', height: vheight, width: vwidth, isResize: true, overflow: scroll
  117. });
  118. }
  119. }
  120. }
  121. function formatDateTime(value) {
  122. if (value != null) {
  123. var date = new Date(parseInt(value.replace("/Date(", "").replace(")/", ""), 10));
  124. var result = date.getFullYear() + "-" + (date.getMonth() + 1 < 10 ? "0"
  125. + (date.getMonth() + 1) : date.getMonth() + 1) + "-"
  126. + (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " "
  127. + (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":"
  128. + (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":"
  129. + (date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds());
  130. return result;
  131. }
  132. return value;
  133. }
  134. function GetSql() {
  135. var sql = "";
  136. if (document.getElementById("txtKey").value != "") {
  137. sql += "&key=" + escape(document.getElementById("txtKey").value);
  138. } else {
  139. if (document.getElementById("HdName").value != "") {
  140. sql += "&key=" + escape(document.getElementById("HdName").value);
  141. document.getElementById("txtKey").value = document.getElementById("HdName").value;
  142. }
  143. }
  144. return sql;
  145. }
  146. function CloseThis() {
  147. if (singleClick == null || singleClick == undefined || singleClick == "") {
  148. alert("请选择客户!");
  149. } else {
  150. var dialog = frameElement.dialog;
  151. dialog.close();
  152. }
  153. }
  154. function FastAdd() {
  155. $.ligerDialog.confirm('快速添加新用户?', function (yes) {
  156. if (yes == true) {
  157. var cname = encodeURIComponent($("#txtKey").val());
  158. if (cname != "") {
  159. $.post("../customermanage/ajax/customer.ashx?action=fastadd&cn=" + cname, function (data, states) {
  160. if (states == "success") {
  161. if (data == "True") {
  162. $.ligerDialog.success('添加成功');
  163. } else if (data == "False") {
  164. $.ligerDialog.error('添加失败');
  165. }
  166. }
  167. })
  168. }
  169. else { $.ligerDialog.warn('客户名不能为空'); }
  170. }
  171. });
  172. }
  173. document.onkeydown = function (event) {
  174. var e = event || window.event || arguments.callee.caller.arguments[0];
  175. if (e && e.keyCode == 13) {
  176. List();
  177. }
  178. };
  179. </script>
  180. </head>
  181. <body>
  182. <form id="form1" runat="server">
  183. <div class="tools_box">
  184. <div class="tools_bar">
  185. <asp:HiddenField ID="HdName" runat="server" />
  186. <a class="tools_btn" href="#" onclick="CloseThis();"><span><b class="modify">选择</b></span></a>
  187. <div class="search_box">
  188. 关键字:<asp:TextBox ID="txtKey" runat="server" CssClass="txtInput"></asp:TextBox>&nbsp;&nbsp;
  189. <input id="btnSearch" type="button" value="搜 索" class="btnSearch" onclick="List();" />&nbsp;&nbsp;
  190. <input id="btnAddCustomer" type="button" title="快速添加新用户" value="添加" class="btnSearch" onclick="FastAdd();" />
  191. </div>
  192. </div>
  193. </div>
  194. <div id="divDataList">
  195. </div>
  196. </form>
  197. </body>
  198. </html>