basicInfoList.jsp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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. <%-- 3000 品牌信息 3004 客户类型 设置默认宽度 --%>
  56. <c:if test="${menu_code == 3000 || menu_code == 3004}}">
  57. <c:set var="width" value="300"/>
  58. <c:if test="${fn:contains(item.column_name, 'remark')}">
  59. <c:set var="width" value="500"/>
  60. </c:if>
  61. </c:if>
  62. <%-- 3002 产品信息 设置默认宽度 --%>
  63. <c:if test="${menu_code == 3002}">
  64. <c:set var="width" value="150"/>
  65. </c:if>
  66. <%-- 3006 退货原因 3007 线路达标设定 设置默认宽度 --%>
  67. <c:if test="${menu_code == 3006 || menu_code == 3007}">
  68. <c:set var="width" value="500"/>
  69. </c:if>
  70. <%-- 3009 考勤 设置默认宽度 --%>
  71. <c:if test="${menu_code == 3009}">
  72. <c:set var="width" value="500"/>
  73. </c:if>
  74. { display: '${item.column_desc}', name: '${item.column_name}', width: ${width} }
  75. <c:if test="${idxStatus.index < fn:length(conditioncolumn) -1}">,</c:if>
  76. </c:if>
  77. </c:forEach>
  78. <c:if test="${menuaccess.columnedit == 1 || menuaccess.columndel == 1}">
  79. , {display: '操作', name: '', width: 140,
  80. render:function(row){
  81. var html = <c:if test="${pictype == '1'}">div1 +</c:if> "";
  82. <c:if test="${menuaccess.columnedit == 1}">
  83. html += '<a href=\"#\" onclick=\"editbasicInformation(\''+ row.id + '\',\'${menu_code}\')\">修改</a>';
  84. </c:if>
  85. <c:if test="${menuaccess.columndel == 1}">
  86. html += '&nbsp;&nbsp;<a href=\"#\" onclick=\"delbasicInformation(\''+ row.id + '\',\'${menu_code}\')\">删除</a>';
  87. </c:if>
  88. <c:if test="${menu_code == 10000}">
  89. html += '&nbsp;&nbsp;<a href=\"#\" onclick=\"distributeUser(\''+ row.id + '\',\'${menu_code}\',\'' + row.storename + '\')\">分配人员</a>';
  90. </c:if>
  91. return html;
  92. }
  93. }
  94. </c:if>
  95. ],
  96. checkbox:checkbox,
  97. deleteRow: true,
  98. pageParmName: 'p', //页索引参数名,(提交给服务器)
  99. pagesizeParmName: 'pSize', //页记录数参数名,(提交给服务器)
  100. url: 'UtilsAction.do?task=queryList&menu_code=${menu_code}&time=' + new Date().getTime(),
  101. method: 'post',
  102. parms: getParamsVal(0),
  103. width: '99.9%',
  104. height: '99%',
  105. <c:if test="${pictype == '1'}"><%-- pictype 值为1 表示有图片列 设置列高度为 80 默认为 22 --%>
  106. rowHeight: '80',
  107. fixedCellHeight: true,
  108. </c:if>
  109. single :true,
  110. enabledSort:false, <%-- 是否允许排序 --%>
  111. allowHideColumn: false, rownumbers: true, colDraggable: true, rowDraggable: true,
  112. onCheckRow: function(checked, rowdata, rowindex) {
  113. <%-- 里面的代码为单选 for (var rowid in this.records){ this.unselect(rowid); } if(checked){this.select(rowindex); }else{ this.unselect(rowindex); } --%>
  114. }
  115. });
  116. $("#pageloading").hide();
  117. }
  118. function getdivdisplay(v,v_this,v_type){
  119. if("0" == v){
  120. document.getElementById("container-layout").style.display="none";
  121. document.getElementById("searchbar").style.marginTop="-38px";
  122. document.getElementById(v_this).style.display="none";
  123. document.getElementById(v_type).style.display="";
  124. } else {
  125. document.getElementById("container-layout").style.display="";
  126. document.getElementById("searchbar").style.marginTop="0px";
  127. document.getElementById(v_this).style.display="";
  128. document.getElementById(v_type).style.display="none";
  129. }
  130. }
  131. </script>
  132. </head>
  133. <body onload="pubOnCilck()">
  134. <%-- columnParams 参数拼接 --%>
  135. <c:forEach var="item" items="${querycondition}" varStatus="idxStatus1">
  136. <c:if test="${item.column_name == 'createdatebegincreatedateend'}">
  137. <c:set var="columnname" value="createdatebegin,createdateend"/>
  138. <c:set var="connflag" value="4,4"/>
  139. </c:if>
  140. <c:if test="${item.column_name != 'createdatebegincreatedateend'}">
  141. <c:set var="columnname" value="${columnname},${item.column_name}"/>
  142. <c:set var="connflag" value="${connflag},${item.connflag}"/>
  143. </c:if>
  144. </c:forEach>
  145. <form id="report" action="${pageContext.request.contextPath }/UtilsAction.do" method="post" target="_blank">
  146. <input type="hidden" id="task" name="task" value="queryListExport"> <%-- 查询条件字段名称 --%>
  147. <input type="hidden" id="menu_code" name="menu_code" value="${menu_code }"> <%-- 查询条件字段名称 --%>
  148. <input type="hidden" id="columnname" name="columnname" value="${columnname }"> <%-- 查询条件字段名称 --%>
  149. <input type="hidden" id="connflag" name="connflag" value="${connflag }"> <%-- 查询条件字段连接符号 --%>
  150. <input type="hidden" id="export_type" name="export_type" value=""> <%-- 导出类型 --%>
  151. <input type="hidden" id="columnvalue" name="columnvalue" value=""> <%-- 输入的值 --%>
  152. <input type="hidden" id="pictype" name="pictype" value="${pictype }"> <%-- 输入的值 --%>
  153. <input type="hidden" id="menu_name" name="menu_name" value=""> <%-- 导出的菜单名称 --%>
  154. </form>
  155. <div class="container-layout">
  156. <div id="container-layout" style="margin-top: -38px;">
  157. <%-- 查询条件拼接拼接 --%>
  158. <c:set var="countPRI" value="0"/> <%-- 判断第一列第一个是不是 起始时间控件 0 不是 1 是 --%>
  159. <div id="default_search" class="default_search">
  160. <c:forEach var="item" items="${querycondition}" varStatus="idxStatus1">
  161. <c:if test="${item.column_name == 'createdatebegincreatedateend'}">
  162. <c:set var="countPRI" value="1"/> <%-- 判断第一列第一个是不是 起始时间控件 0 不是 1 是 --%>
  163. <ul class="list_search" style="width: 370px;">
  164. <li class="title" style="width: 70px;">${item.column_desc}:</li>
  165. <li class="text" style="width: 135px;">
  166. <input type="text" id="createdatebegin" name="createdatebegin" style="width: 130px;" />
  167. </li>
  168. <li class="title" style="width: 15px;">至&nbsp;&nbsp;</li>
  169. <li class="text" style="width: 135px;">
  170. <input type="text" id="createdateend" name="createdateend" style="width: 130px;" />
  171. </li>
  172. </ul>
  173. <script type="text/javascript">
  174. $("#createdatebegin").ligerDateEditor({ labelWidth : 128, labelAlign : 'right', showTime : false });<%-- 初始化开始时间控件 --%>
  175. $("#createdateend").ligerDateEditor({ labelWidth : 128, labelAlign : 'right' }); <%-- 初始化结束时间控件 --%>
  176. </script>
  177. </c:if>
  178. <c:if test="${item.column_name != 'createdatebegincreatedateend'}">
  179. <c:set var="width" value="215"/><%-- 设置列默认宽度 --%>
  180. <c:if test="${(idxStatus1.index== 4 || idxStatus1.index== 8 || idxStatus1.index== 12) && (countPRI == 1)}">
  181. <c:if test="${5 != (fn:length(querycondition))}"><%-- 当list的size不等于5的时候 --%>
  182. <c:set var="width" value="370"/> <%-- 当第一个查询条件为 起始条件时 第一列的宽度加大 --%>
  183. </c:if>
  184. </c:if>
  185. <ul class="list_search" style="width: ${width }px;">
  186. <li class="title" style="width: 70px;">${item.column_desc}:</li>
  187. <li class="text" style="width: 135px;">
  188. <c:if test="${item.treetype == 3}"> <%-- 3 为input框 --%>
  189. <input type="text" id="${item.column_name}" name="${item.column_name}" style="width: 130px;" />
  190. </c:if>
  191. <c:if test="${item.treetype == 4}"> <%-- 4 为下拉框 --%>
  192. <select name="${item.column_name}" id="${item.column_name}" style="width: 136px;" >
  193. <option value="" selected="selected">全部</option>
  194. <c:forEach items="${item.list }" var="flow" varStatus="status">
  195. <option value="${flow.key }">${flow.value }</option>
  196. </c:forEach>
  197. </select>
  198. </c:if>
  199. <c:if test="${item.treetype == 5}"> <%-- 5 为区域树 --%>
  200. <jsp:include page="/yw/sales/utils/tree.jsp" flush="true">
  201. <jsp:param name="treetype" value="areatree"/>
  202. <jsp:param name="column_name" value="${item.column_name}"/>
  203. <jsp:param name="multiplecheckboxredio" value="true"/>
  204. </jsp:include>
  205. </c:if>
  206. <c:if test="${item.treetype == 6}"> <%-- 6 为部门树 --%>
  207. <input type="text" id="${item.column_name}_text" name="${item.column_name}_text" style="width: 130px;" />
  208. <input type="hidden" id="${item.column_name}" name="${item.column_name}" style="width: 130px;" />
  209. <script type="text/javascript">
  210. loadTypeTree("${item.column_name}_text",{type:"user",tab:"1,2",backId:"${item.column_name}",backName:"${item.column_name}_text"});
  211. </script>
  212. </c:if>
  213. <c:if test="${item.treetype == 7}"> <%-- 7 为产品类别树 --%>
  214. <jsp:include page="/yw/sales/utils/tree.jsp" flush="true">
  215. <jsp:param name="treetype" value="productclasstree"/>
  216. <jsp:param name="column_name" value="${item.column_name}"/>
  217. <jsp:param name="multiplecheckboxredio" value="true"/>
  218. </jsp:include>
  219. </c:if>
  220. </li>
  221. </ul>
  222. </c:if>
  223. <c:if test="${idxStatus1.index == (fn:length(querycondition) -1)}">
  224. <c:if test="${'3000' == menu_code || '3004' == menu_code || '3006' == menu_code || '3007' == menu_code || '7000' == menu_code || '3009' == menu_code}">
  225. <ul style="width: 77%">
  226. <li class="search-button" style="text-align: left; width: 50%">
  227. <%-- <a id="v0" href="javascript:getdivdisplay(0,'v0','v1')" style="display: none">隐藏</a> --%>
  228. <input type="button" class='l-button' name="search" onclick="pubOnCilck()" value="查询"/>
  229. <c:if test="${menuaccess.columnadd == 1}">
  230. <input type="button" class="l-button" name="search" onclick="createbasicInformation('${menu_code}')" value="新增"/>
  231. </c:if>
  232. </li>
  233. <li style="text-align: right;">
  234. <jsp:include page="/yw/sales/utils/exportbutton.jsp"></jsp:include>
  235. </li>
  236. </ul>
  237. </c:if>
  238. </c:if>
  239. </c:forEach>
  240. </div>
  241. <c:if test="${'3000' != menu_code && '3004' != menu_code && '3006' != menu_code && '3007' != menu_code && '7000' != menu_code && '3009' != menu_code}">
  242. <div id="default_search" class="default_search">
  243. <ul style="width: 100%">
  244. <li class="search-button" style="text-align: left; width: 50%">
  245. <input type="button" class='l-button' name="search" onclick="pubOnCilck()" value="查询"/>
  246. <c:if test="${menuaccess.columnadd == 1}">
  247. <input type="button" class="l-button" name="search" onclick="createbasicInformation('${menu_code}')" value="新增"/>
  248. </c:if>
  249. </li>
  250. <li class="" style="text-align: right;">
  251. <jsp:include page="/yw/sales/utils/exportbutton.jsp"></jsp:include>&nbsp;&nbsp;
  252. <%-- <a id="v0" href="javascript:getdivdisplay(0,'v0','v1')" style="text-align: right; ">隐藏</a> --%>
  253. </li>
  254. </ul>
  255. </div>
  256. </c:if>
  257. </div>
  258. <div id="searchbar">
  259. <%-- <a id="v1" href="javascript:getdivdisplay(1,'v0','v1')" style="display: none">显示</a> --%>
  260. <div style="clear: both;margin-right: 2px;margin-bottom:0px;margin-left:0px;margin-top:0px; padding: 0">
  261. <div id="maingrid4" style="margin:0; padding:0"></div>
  262. </div>
  263. </div>
  264. </div>
  265. <%@ include file="/include/message.jsp"%>
  266. </body>
  267. <script type="text/javascript">
  268. // 如果有时间段选择,验证开始时间不能大于结束时间
  269. function getthinktime(){
  270. <c:if test="${countPRI==1}">
  271. var createdatebegin = $("#createdatebegin").val();
  272. var createdateend = $("#createdateend").val();
  273. if(createdatebegin != "" && createdateend != ""){
  274. var startTmp = createdatebegin.split("-");
  275. var endTmp = createdateend.split("-");
  276. var sd = new Date(startTmp[0],startTmp[1],startTmp[2]);
  277. var ed = new Date(endTmp[0],endTmp[1],endTmp[2]);
  278. if(sd.getTime()>ed.getTime()){
  279. alert("开始日期不能大于结束日期");
  280. return false;
  281. }
  282. }
  283. </c:if>
  284. return true;
  285. }
  286. </script>
  287. </html>