listContacter.jsp 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  6. <title>联系人列表</title>
  7. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  8. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  9. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  10. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
  11. <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  12. <script type="text/javascript" src="/shares/js/constant.js"></script>
  13. <script type="text/javascript" src="/shares/js/common.js"></script>
  14. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
  15. <script type="text/javascript">
  16. var grid = null;
  17. var checkValue = new Array(); //定义一个数组
  18. var i = 0;
  19. $(function() {
  20. initGridList();
  21. if('${checkValue}' != "" && typeof ('${checkValue}') != "undefined"){
  22. checkValue = '${checkValue}'.split(",");
  23. }
  24. });
  25. function initGridList(params) {
  26. var checkbox = false;
  27. if ("${checkbox}" == 'false' || "${checkbox}" == '') {
  28. checkbox = false;
  29. } else {
  30. checkbox = true;
  31. }
  32. var columns = [
  33. {
  34. display : '姓名',
  35. name : 'cp_truename',
  36. width : 80
  37. }, {
  38. display : '职位',
  39. name : 'cp_position',
  40. width : 80/* ,
  41. render : function(row){
  42. if(null !=row.cp_position){
  43. var cp_position = "";
  44. $.ajax({
  45. url:'erpSaleInvoiceAciton.do?task=toDict',
  46. async: false,
  47. type: 'post',
  48. data: {"dvalue":row.cp_position,"type":"erp_crm_contacter|cp_position"},
  49. cache: false,
  50. error: function(obj){
  51. },
  52. success: function(obj){
  53. if(obj!=""){
  54. cp_position = obj;
  55. }
  56. }
  57. });
  58. return cp_position;
  59. }
  60. } */
  61. }, {
  62. display : '客户名称',
  63. name : 'cp_customer_name',
  64. width : 200
  65. }, {
  66. display : 'Email',
  67. name : 'cp_email',
  68. width : 120
  69. }, {
  70. display : '办公电话',
  71. name : 'cp_office_tel',
  72. width : 100
  73. } , {
  74. display : '手机',
  75. name : 'cp_mobile',
  76. width : 100
  77. } , {
  78. display : '客户来源',
  79. name : 'cp_source',
  80. width : 80/* ,
  81. render : function(row){
  82. if(null !=row.cp_source){
  83. var cp_source = "";
  84. $.ajax({
  85. url:'erpSaleInvoiceAciton.do?task=toDict',
  86. async: false,
  87. type: 'post',
  88. data: {"dvalue":row.cp_source,"type":"erp_crm_contacter|cp_source"},
  89. cache: false,
  90. error: function(obj){
  91. },
  92. success: function(obj){
  93. if(obj!=""){
  94. cp_source = obj;
  95. }
  96. }
  97. });
  98. return cp_source;
  99. }
  100. } */
  101. } , {
  102. display : '部门',
  103. name : 'cp_department',
  104. width : 80
  105. } , {
  106. display : '负责人',
  107. name : 'assigned_user_name',
  108. width : 60
  109. } ];
  110. if ("${requestScope.lookup }" == "") {
  111. columns
  112. .push({
  113. display : '操作',
  114. isAllowHide : false,
  115. render : function(row) {
  116. var html = '<a href=\"#\" onclick=\"addTab(\'editContancter\'+getCurrentTabId(), \'修改联系人\', \'${pageContext.request.contextPath }/contacterAction.do?task=toEdit&universalid='
  117. + row.universalid
  118. + '&tabid='
  119. + getCurrentTabId() + '\',true,true);\">编辑</a>&nbsp;';
  120. html += '<a href=\"#\" onclick=\"addTab(\'viewContancter\'+getCurrentTabId(), \'联系人信息\', \'${pageContext.request.contextPath }/contacterAction.do?task=view&universalid='
  121. + row.universalid + '\',true,true);\">查看</a>&nbsp;';
  122. html += '<a href=\"#\" onclick=\"deleteRow('
  123. + row.universalid + ')\">删除</a>&nbsp;';
  124. return html;
  125. }
  126. });
  127. }
  128. grid = $("#maingrid4")
  129. .ligerGrid(
  130. {
  131. columns : columns,
  132. pageSize : 20,
  133. url : 'contacterAction.do?task=list&lookup=${lookup}&is_author=${is_author}&time='
  134. + new Date().getTime() + params,
  135. //where : f_getWhere(),
  136. //data: $.extend(true,{},CustomersData),
  137. //onSuccess: ,
  138. pageParmName : 'p', //页索引参数名,(提交给服务器)
  139. pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
  140. width : '99.9%',
  141. height : '99%',
  142. checkbox : checkbox,
  143. isChecked: f_isChecked,
  144. onCheckRow: function(checked, rowdata, rowindex) {
  145. for (var rowid in this.records){
  146. this.unselect(rowid);
  147. }
  148. if(checked){
  149. this.select(rowindex);
  150. }else{
  151. this.unselect(rowindex);
  152. }
  153. }
  154. });
  155. $("#pageloading").hide();
  156. $(".l-grid-hd-cell-btn-checkbox").css("display", "none"); //隱藏checkAll
  157. }
  158. //默认选中
  159. function f_isChecked(rowdata){
  160. if(checkValue != "" && typeof (checkValue) != "undefined"){
  161. if(checkValue[i]==rowdata.universalid){
  162. i++;
  163. return true;
  164. }
  165. return false;
  166. }
  167. }
  168. //查询
  169. function searchByKword() {
  170. var cp_truename = document.getElementById("cp_truename");//联系人
  171. var s = "";
  172. if (cp_truename.value != "" && typeof (cp_truename.value) != "undefined") {
  173. s += "&cp_truename=" + encodeURI(encodeURI(cp_truename.value));
  174. }
  175. var cp_customer_name = document.getElementById("cp_customer_name");//客户名称
  176. if (cp_customer_name.value != "" && typeof (cp_customer_name.value) != "undefined") {
  177. s += "&cp_customer_name=" + encodeURI(encodeURI(cp_customer_name.value));
  178. }
  179. grid.set("newPage","1");
  180. $(function() {
  181. initGridList(s);
  182. });
  183. }
  184. function f_select() {
  185. var rows = grid.getCheckedRows();
  186. return rows;
  187. }
  188. function deleteRow(obj) {
  189. $.ligerDialog.confirm('确定要删除?', function(yes) {
  190. if (yes) {
  191. $.ajax({
  192. type : "POST",
  193. url : "contacterAction.do?task=del",
  194. data : {
  195. "universalid" : obj
  196. },
  197. timeout : 10000,
  198. cache : false,
  199. dataType : "json",
  200. success : function(data) {
  201. var success = data.success;
  202. if (success) {
  203. $.ligerDialog.success(success);
  204. searchByKword();
  205. // initCourseGrid();
  206. } else {
  207. showAjaxError(null, data.error);
  208. }
  209. },
  210. error : showAjaxError
  211. });
  212. }
  213. });
  214. }
  215. </script>
  216. </head>
  217. <body>
  218. <%@ include file="/include/message.jsp"%>
  219. <div class="container">
  220. <c:if test="${requestScope.lookup == null or requestScope.looup == '' }">
  221. <div id="title" class="form-button">
  222. <input type="button" class="l-button" value="新增联系人" onclick="addTab('新增联系人'+getCurrentTabId(), '新增联系人', '${pageContext.request.contextPath }/contacterAction.do?task=toAdd&tabid=' + getCurrentTabId(),true,true);"/>
  223. <!-- <input type="button" class="l-button" value="导出联系人" onclick="window.parent.f_addTab('exprotRfid', '导出联系人', '${pageContext.request.contextPath }/contacterAction.do?task=exportExcel&tabid=' + getCurrentTabId());" /> -->
  224. </div>
  225. <div class="default_search" style="margin: 0; height:30px;"></div>
  226. </c:if>
  227. <div class="default_search" style="margin: 0;">
  228. <ul class="list_search">
  229. <li class="title">姓名:</li>
  230. <li class="text"><input type="text" name="cp_truename" id="cp_truename">
  231. </li>
  232. </ul>
  233. <ul class="list_search">
  234. <li class="title">客户名称:</li>
  235. <li class="text"><input type="text" name="cp_customer_name" id="cp_customer_name">
  236. </li>
  237. </ul>
  238. <ul>
  239. <li class="search-button"><input type="button" class='l-button'
  240. name="search" onclick="searchByKword()" value="查询" /></li>
  241. </ul>
  242. </div>
  243. <div style="clear:both;"></div>
  244. <div id="searchbar">
  245. <div style="overflow: hidden; clear: both;">
  246. <div id="maingrid4" style="margin: 0; padding: 0"></div>
  247. </div>
  248. </div>
  249. </div>
  250. </body>
  251. </html>