| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=GBK">
- <title>联系人列表</title>
- <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
- <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
- <script type="text/javascript">
- var grid = null;
- var checkValue = new Array(); //定义一个数组
- var i = 0;
- $(function() {
- initGridList();
- if('${checkValue}' != "" && typeof ('${checkValue}') != "undefined"){
- checkValue = '${checkValue}'.split(",");
- }
- });
-
- function initGridList(params) {
- var checkbox = false;
- if ("${checkbox}" == 'false' || "${checkbox}" == '') {
- checkbox = false;
- } else {
- checkbox = true;
- }
- var columns = [
- {
- display : '姓名',
- name : 'cp_truename',
- width : 80
- }, {
- display : '职位',
- name : 'cp_position',
- width : 80/* ,
- render : function(row){
- if(null !=row.cp_position){
- var cp_position = "";
- $.ajax({
- url:'erpSaleInvoiceAciton.do?task=toDict',
- async: false,
- type: 'post',
- data: {"dvalue":row.cp_position,"type":"erp_crm_contacter|cp_position"},
- cache: false,
- error: function(obj){
- },
- success: function(obj){
- if(obj!=""){
- cp_position = obj;
- }
- }
- });
- return cp_position;
- }
- } */
- }, {
- display : '客户名称',
- name : 'cp_customer_name',
- width : 200
- }, {
- display : 'Email',
- name : 'cp_email',
- width : 120
- }, {
- display : '办公电话',
- name : 'cp_office_tel',
- width : 100
- } , {
- display : '手机',
- name : 'cp_mobile',
- width : 100
- } , {
- display : '客户来源',
- name : 'cp_source',
- width : 80/* ,
- render : function(row){
- if(null !=row.cp_source){
- var cp_source = "";
- $.ajax({
- url:'erpSaleInvoiceAciton.do?task=toDict',
- async: false,
- type: 'post',
- data: {"dvalue":row.cp_source,"type":"erp_crm_contacter|cp_source"},
- cache: false,
- error: function(obj){
- },
- success: function(obj){
- if(obj!=""){
- cp_source = obj;
- }
- }
- });
- return cp_source;
- }
- } */
- } , {
- display : '部门',
- name : 'cp_department',
- width : 80
- } , {
- display : '负责人',
- name : 'assigned_user_name',
- width : 60
- } ];
- if ("${requestScope.lookup }" == "") {
- columns
- .push({
- display : '操作',
- isAllowHide : false,
- render : function(row) {
- var html = '<a href=\"#\" onclick=\"addTab(\'editContancter\'+getCurrentTabId(), \'修改联系人\', \'${pageContext.request.contextPath }/contacterAction.do?task=toEdit&universalid='
- + row.universalid
- + '&tabid='
- + getCurrentTabId() + '\',true,true);\">编辑</a> ';
- html += '<a href=\"#\" onclick=\"addTab(\'viewContancter\'+getCurrentTabId(), \'联系人信息\', \'${pageContext.request.contextPath }/contacterAction.do?task=view&universalid='
- + row.universalid + '\',true,true);\">查看</a> ';
- html += '<a href=\"#\" onclick=\"deleteRow('
- + row.universalid + ')\">删除</a> ';
- return html;
- }
- });
- }
- grid = $("#maingrid4")
- .ligerGrid(
- {
- columns : columns,
- pageSize : 20,
- url : 'contacterAction.do?task=list&lookup=${lookup}&is_author=${is_author}&time='
- + new Date().getTime() + params,
- //where : f_getWhere(),
- //data: $.extend(true,{},CustomersData),
- //onSuccess: ,
- pageParmName : 'p', //页索引参数名,(提交给服务器)
- pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
- width : '99.9%',
- height : '99%',
- checkbox : checkbox,
- isChecked: f_isChecked,
- onCheckRow: function(checked, rowdata, rowindex) {
- for (var rowid in this.records){
- this.unselect(rowid);
- }
- if(checked){
- this.select(rowindex);
- }else{
- this.unselect(rowindex);
- }
- }
- });
- $("#pageloading").hide();
- $(".l-grid-hd-cell-btn-checkbox").css("display", "none"); //隱藏checkAll
- }
-
-
- //默认选中
- function f_isChecked(rowdata){
- if(checkValue != "" && typeof (checkValue) != "undefined"){
- if(checkValue[i]==rowdata.universalid){
- i++;
- return true;
- }
- return false;
- }
- }
-
- //查询
- function searchByKword() {
- var cp_truename = document.getElementById("cp_truename");//联系人
- var s = "";
- if (cp_truename.value != "" && typeof (cp_truename.value) != "undefined") {
- s += "&cp_truename=" + encodeURI(encodeURI(cp_truename.value));
- }
- var cp_customer_name = document.getElementById("cp_customer_name");//客户名称
- if (cp_customer_name.value != "" && typeof (cp_customer_name.value) != "undefined") {
- s += "&cp_customer_name=" + encodeURI(encodeURI(cp_customer_name.value));
- }
- grid.set("newPage","1");
- $(function() {
- initGridList(s);
- });
- }
- function f_select() {
- var rows = grid.getCheckedRows();
- return rows;
- }
-
- function deleteRow(obj) {
- $.ligerDialog.confirm('确定要删除?', function(yes) {
- if (yes) {
- $.ajax({
- type : "POST",
- url : "contacterAction.do?task=del",
- data : {
- "universalid" : obj
- },
- timeout : 10000,
- cache : false,
- dataType : "json",
- success : function(data) {
- var success = data.success;
- if (success) {
- $.ligerDialog.success(success);
- searchByKword();
- // initCourseGrid();
- } else {
- showAjaxError(null, data.error);
- }
- },
- error : showAjaxError
- });
- }
- });
- }
- </script>
- </head>
- <body>
- <%@ include file="/include/message.jsp"%>
- <div class="container">
- <c:if test="${requestScope.lookup == null or requestScope.looup == '' }">
- <div id="title" class="form-button">
- <input type="button" class="l-button" value="新增联系人" onclick="addTab('新增联系人'+getCurrentTabId(), '新增联系人', '${pageContext.request.contextPath }/contacterAction.do?task=toAdd&tabid=' + getCurrentTabId(),true,true);"/>
- <!-- <input type="button" class="l-button" value="导出联系人" onclick="window.parent.f_addTab('exprotRfid', '导出联系人', '${pageContext.request.contextPath }/contacterAction.do?task=exportExcel&tabid=' + getCurrentTabId());" /> -->
- </div>
- <div class="default_search" style="margin: 0; height:30px;"></div>
- </c:if>
- <div class="default_search" style="margin: 0;">
- <ul class="list_search">
- <li class="title">姓名:</li>
- <li class="text"><input type="text" name="cp_truename" id="cp_truename">
- </li>
- </ul>
- <ul class="list_search">
- <li class="title">客户名称:</li>
- <li class="text"><input type="text" name="cp_customer_name" id="cp_customer_name">
- </li>
- </ul>
- <ul>
- <li class="search-button"><input type="button" class='l-button'
- name="search" onclick="searchByKword()" value="查询" /></li>
- </ul>
- </div>
- <div style="clear:both;"></div>
- <div id="searchbar">
- <div style="overflow: hidden; clear: both;">
- <div id="maingrid4" style="margin: 0; padding: 0"></div>
- </div>
- </div>
- </div>
- </body>
- </html>
|