Copy of basicInfoList.jsp 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
  2. <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  3. <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <%
  6. String path = request.getContextPath();
  7. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  8. %>
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  12. <title>公共列表页面</title>
  13. <script type="text/javascript">
  14. var pictype = "0";
  15. var basePath = "<%=basePath %>";
  16. <c:set var="pictype" value="0"/>
  17. <c:forEach var="item1" items="${conditioncolumn}" varStatus="idxStatus1">
  18. <c:if test="${item1.column_name == 'accessory_path'}"><%--判断是否有图片展现 pictype 为0 没有 1 有 --%>
  19. <c:set var="pictype" value="1"/>
  20. pictype = "1";
  21. </c:if>
  22. </c:forEach>
  23. </script>
  24. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  25. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  26. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  27. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
  28. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
  29. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
  30. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
  31. <script src="/shares/js/yw/sales/publicutils.js" type="text/javascript"></script>
  32. <script src="/shares/js/yw/sales/ligerui.all.js" type="text/javascript"></script>
  33. <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  34. <script type="text/javascript" src="/shares/js/util.js"></script>
  35. <script type="text/javascript" src="/shares/js/constant.js"></script>
  36. <script type="text/javascript" src="/shares/js/common.js"></script>
  37. <script type="text/javascript" src="/shares/js/file.js"></script>
  38. <script type="text/javascript" src="/shares/js/yw/oa/folderTree.js"></script>
  39. <script type="text/javascript">
  40. function pubOnCilck(){
  41. if(!getthinktime()){
  42. return;
  43. }
  44. var checkbox = false;
  45. grid = $("#maingrid4").ligerGrid({
  46. columns: [
  47. <c:forEach var="item" items="${conditioncolumn}" varStatus="idxStatus">
  48. <c:if test="${item.column_name != 'id'}"><%-- 字段为id 的时候不展现 数据库字段配置的时候 必须把 id放到第一列 --%>
  49. <c:set var="conditioncolumnname" value="${conditioncolumnname},${item.column_name}"/>
  50. <c:set var="conditioncolumndesc" value="${conditioncolumndesc},${item.column_desc}"/>
  51. <c:set var="width" value="130"/>
  52. <c:if test="${fn:contains(item.column_name, 'remark')}">
  53. <c:set var="width" value="300"/>
  54. </c:if>
  55. { display: '${item.column_desc}', name: '${item.column_name}', width: ${width} }
  56. <c:if test="${idxStatus.index < fn:length(conditioncolumn) -1}">,</c:if>
  57. </c:if>
  58. </c:forEach>
  59. <c:if test="${menuaccess.columnedit == 1 || menuaccess.columndel == 1}">
  60. , {display: '操作', name: '', width: 120,
  61. render:function(row){
  62. var html = "";
  63. <c:if test="${menuaccess.columnedit == 1}">
  64. html += '<a href=\"#\" onclick=\"editbasicInformation(\''+ row.id + '\',\'${menu_code}\')\">修改</a>';
  65. </c:if>
  66. <c:if test="${menuaccess.columndel == 1}">
  67. html += '&nbsp;&nbsp;<a href=\"#\" onclick=\"delbasicInformation(\''+ row.id + '\',\'${menu_code}\')\">删除</a>';
  68. </c:if>
  69. return html;
  70. }
  71. }
  72. </c:if>
  73. ],
  74. checkbox:checkbox,
  75. deleteRow: true,
  76. pageParmName: 'p', //页索引参数名,(提交给服务器)
  77. pagesizeParmName: 'pSize', //页记录数参数名,(提交给服务器)
  78. url: 'UtilsAction.do?task=queryList&menu_code=${menu_code}&time=' + new Date().getTime(),
  79. method: 'post',
  80. parms: getParamsVal(0),
  81. width: '99.9%',
  82. height: '99%',
  83. <c:if test="${pictype == '1'}"><%-- pictype 值为1 表示有图片列 设置列高度为 80 默认为 22 --%>
  84. rowHeight: '80',
  85. fixedCellHeight: true,
  86. </c:if>
  87. single :true,
  88. allowHideColumn: false, rownumbers: true, colDraggable: true, rowDraggable: true,
  89. onCheckRow: function(checked, rowdata, rowindex) {
  90. <%-- 里面的代码为单选 for (var rowid in this.records){ this.unselect(rowid); } if(checked){this.select(rowindex); }else{ this.unselect(rowindex); } --%>
  91. }
  92. });
  93. $("#pageloading").hide();
  94. }
  95. function getdivdisplay(v,v_this,v_type){
  96. if("0" == v){
  97. document.getElementById("container-layout").style.display="none";
  98. document.getElementById("searchbar").style.marginTop="-38px";
  99. document.getElementById(v_this).style.display="none";
  100. document.getElementById(v_type).style.display="";
  101. } else {
  102. document.getElementById("container-layout").style.display="";
  103. document.getElementById("searchbar").style.marginTop="0px";
  104. document.getElementById(v_this).style.display="";
  105. document.getElementById(v_type).style.display="none";
  106. }
  107. }
  108. </script>
  109. </head>
  110. <body onload="pubOnCilck()">
  111. <%-- columnParams 参数拼接 --%>
  112. <c:forEach var="item" items="${querycondition}" varStatus="idxStatus1">
  113. <c:if test="${item.column_name == 'createdatebegincreatedateend'}">
  114. <c:set var="columnname" value="createdatebegin,createdateend"/>
  115. <c:set var="connflag" value="4,4"/>
  116. </c:if>
  117. <c:if test="${item.column_name != 'createdatebegincreatedateend'}">
  118. <c:set var="columnname" value="${columnname},${item.column_name}"/>
  119. <c:set var="connflag" value="${connflag},${item.connflag}"/>
  120. </c:if>
  121. </c:forEach>
  122. <form id="report" action="${pageContext.request.contextPath }/UtilsAction.do" method="post" target="_blank">
  123. <input type="hidden" id="task" name="task" value="queryListExport"> <%-- 查询条件字段名称 --%>
  124. <input type="hidden" id="menu_code" name="menu_code" value="${menu_code }"> <%-- 查询条件字段名称 --%>
  125. <input type="hidden" id="columnname" name="columnname" value="${columnname }"> <%-- 查询条件字段名称 --%>
  126. <input type="hidden" id="connflag" name="connflag" value="${connflag }"> <%-- 查询条件字段连接符号 --%>
  127. <input type="hidden" id="export_type" name="export_type" value=""> <%-- 导出类型 --%>
  128. <input type="hidden" id="columnvalue" name="columnvalue" value=""> <%-- 输入的值 --%>
  129. <input type="hidden" id="pictype" name="pictype" value="${pictype }"> <%-- 输入的值 --%>
  130. <input type="hidden" id="menu_name" name="menu_name" value=""> <%-- 导出的菜单名称 --%>
  131. </form>
  132. <div class="container-layout">
  133. <div id="container-layout" style="margin-top: -38px;">
  134. <%-- 查询条件拼接拼接 --%>
  135. <c:set var="countPRI" value="0"/> <%-- 判断第一列第一个是不是 起始时间控件 0 不是 1 是 --%>
  136. <c:forEach var="item" items="${querycondition}" varStatus="idxStatus1">
  137. <c:if test="${idxStatus1.index== 0 || idxStatus1.index== 4 || idxStatus1.index== 8 || idxStatus1.index== 12}">
  138. <c:if test="${idxStatus1.index== 0}">
  139. <div id="default_search" class="default_search">
  140. </c:if>
  141. <c:if test="${idxStatus1.index== 4 || idxStatus1.index== 8 || idxStatus1.index== 12}">
  142. <div id="default_search" class="default_search">
  143. </c:if>
  144. </c:if>
  145. <c:if test="${item.column_name == 'createdatebegincreatedateend'}">
  146. <c:set var="countPRI" value="1"/> <%-- 判断第一列第一个是不是 起始时间控件 0 不是 1 是 --%>
  147. <ul class="list_search" style="width: 370px;">
  148. <li class="title" style="width: 70px;">${item.column_desc}:</li>
  149. <li class="text" style="width: 135px;">
  150. <input type="text" id="createdatebegin" name="createdatebegin" style="width: 130px;" />
  151. <li class="title" style="width: 15px;">至&nbsp;&nbsp;
  152. </li>
  153. <li class="text" style="width: 135px;">
  154. <input type="text" id="createdateend" name="createdateend" style="width: 130px;" />
  155. </li>
  156. </ul>
  157. <script type="text/javascript">
  158. $("#createdatebegin").ligerDateEditor({ labelWidth : 128, labelAlign : 'right', showTime : false });<%-- 初始化开始时间控件 --%>
  159. $("#createdateend").ligerDateEditor({ labelWidth : 128, labelAlign : 'right' }); <%-- 初始化结束时间控件 --%>
  160. </script>
  161. </c:if>
  162. <c:if test="${item.column_name != 'createdatebegincreatedateend'}">
  163. <c:set var="width" value="225"/><%-- 设置列默认宽度 --%>
  164. <c:if test="${(idxStatus1.index== 4 || idxStatus1.index== 8 || idxStatus1.index== 12) && (countPRI == 1)}">
  165. <c:set var="width" value="370"/> <%-- 当第一个查询条件为 起始条件时 第一列的宽度加大 --%>
  166. </c:if>
  167. <ul class="list_search" style="width: ${width }px;">
  168. <li class="title" style="width: 70px;">${item.column_desc}:</li>
  169. <li class="text" style="width: 135px;">
  170. <c:if test="${item.treetype == 3}"> <%-- 3 为input框 --%>
  171. <input type="text" id="${item.column_name}" name="${item.column_name}" style="width: 130px;" />
  172. </c:if>
  173. <c:if test="${item.treetype == 4}"> <%-- 4 为下拉框 --%>
  174. <select name="${item.column_name}" id="${item.column_name}" style="width: 130px;" >
  175. <option value="" selected="selected">全部</option>
  176. <c:forEach items="${item.list }" var="flow" varStatus="status">
  177. <option value="${flow.key }">${flow.value }</option>
  178. </c:forEach>
  179. </select>
  180. </c:if>
  181. <c:if test="${item.treetype == 5}"> <%-- 5 为区域树 --%>
  182. <input type="text" id="${item.column_name}_text" name="${item.column_name}_text" style="width: 130px;" onclick="onClickTree('areatree','${item.column_name}','${item.column_name}_text')"/>
  183. <input type="hidden" id="${item.column_name}" name="${item.column_name}" style="width: 130px;" />
  184. </c:if>
  185. <c:if test="${item.treetype == 6}"> <%-- 6 为部门树 --%>
  186. <input type="text" id="${item.column_name}_text" name="${item.column_name}_text" style="width: 130px;" />
  187. <input type="hidden" id="${item.column_name}" name="${item.column_name}" style="width: 130px;" />
  188. <script type="text/javascript">
  189. loadTypeTree("${item.column_name}_text",{type:"user",tab:"1,2",backId:"${item.column_name}",backName:"${item.column_name}_text"});
  190. </script>
  191. </c:if>
  192. <c:if test="${item.treetype == 7}"> <%-- 7 为产品类别树 --%>
  193. <input type="text" id="${item.column_name}_text" name="${item.column_name}_text" style="width: 130px;" onclick="onClickTree('productclasstree','${item.column_name}','${item.column_name}_text')"/>
  194. <input type="hidden" id="${item.column_name}" name="${item.column_name}" style="width: 130px;" />
  195. </c:if>
  196. </li>
  197. </ul>
  198. </c:if>
  199. <c:if test="${idxStatus1.index == (fn:length(querycondition) -1)}">
  200. <ul>
  201. <li class="search-button">
  202. <input type="button" class='l-button' name="search" onclick="pubOnCilck()" value="查询"/>
  203. </ul>
  204. <c:if test="${idxStatus1.index!= 3 && idxStatus1.index!= 7 && idxStatus1.index!= 11 && idxStatus1.index!= 15}">
  205. </div>
  206. </c:if>
  207. </c:if>
  208. <c:if test="${idxStatus1.index== 3 || idxStatus1.index== 7 || idxStatus1.index== 11 || idxStatus1.index== 15}">
  209. </div>
  210. </c:if>
  211. </c:forEach>
  212. <div id="default_search" class="default_search">
  213. <ul style="width: 100%">
  214. <li class="search-button" style="text-align: left; width: 50%">
  215. <c:if test="${menuaccess.columnadd == 1}">
  216. <input type="button" class="l-button" style="display: " name="search" onclick="createbasicInformation('${menu_code}')" value="新增"/>
  217. </c:if>
  218. </li>
  219. <li class="" style="text-align: right;">
  220. <jsp:include page="/yw/sales/utils/exportbutton.jsp"></jsp:include>
  221. <a id="v0" href="javascript:getdivdisplay(0,'v0','v1')" style="text-align: right; ">隐藏</a>
  222. </li>
  223. </ul>
  224. </div>
  225. </div>
  226. <div id="searchbar" style="width: 100%;text-align: right;">
  227. <a id="v1" href="javascript:getdivdisplay(1,'v0','v1')" style="display: none">显示</a>
  228. <div style="clear: both;margin-right: 2px;margin-bottom:0px;margin-left:0px;margin-top:0px; padding: 0">
  229. <div id="maingrid4" style="margin:0; padding:0"></div>
  230. </div>
  231. </div>
  232. </div>
  233. <%@ include file="/include/message.jsp"%>
  234. </body>
  235. <script type="text/javascript">
  236. // 如果有时间段选择,验证开始时间不能大于结束时间
  237. function getthinktime(){
  238. <c:if test="${countPRI==1}">
  239. var createdatebegin = $("#createdatebegin").val();
  240. var createdateend = $("#createdateend").val();
  241. if(createdatebegin != "" && createdateend != ""){
  242. var startTmp = createdatebegin.split("-");
  243. var endTmp = createdateend.split("-");
  244. var sd = new Date(startTmp[0],startTmp[1],startTmp[2]);
  245. var ed = new Date(endTmp[0],endTmp[1],endTmp[2]);
  246. if(sd.getTime()>ed.getTime()){
  247. alert("开始日期不能大于结束日期");
  248. return false;
  249. }
  250. }
  251. </c:if>
  252. return true;
  253. }
  254. </script>
  255. </html>