listPrintConf.jsp 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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/ligerui.all.js" type="text/javascript"></script>
  10. <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  11. <script type="text/javascript" src="/shares/js/constant.js"></script>
  12. <script type="text/javascript" src="/shares/js/common.js"></script>
  13. <script type="text/javascript">
  14. var grid = null;
  15. var checkValue = new Array(); //定义一个数组
  16. var i = 0;
  17. $(function() {
  18. if('${checkValue}' != "" && typeof ('${checkValue}') != "undefined"){
  19. checkValue = '${checkValue}'.split(",");
  20. }
  21. initPrintConfGrid();
  22. });
  23. function initPrintConfGrid(params){
  24. var checkbox = false;
  25. if ("${checkbox}" == 'false' || "${checkbox}" == '') {
  26. checkbox = false;
  27. } else {
  28. checkbox = true;
  29. }
  30. var columns =[
  31. {
  32. display : '打印类型',
  33. name : 'type',
  34. width : 100,
  35. render : function(row){
  36. if(null !=row.type){
  37. var type = "";
  38. $.ajax({
  39. url:'erpSaleInvoiceAciton.do?task=toDict',
  40. async: false,
  41. type: 'post',
  42. data: {"dvalue":row.type,"type":"erp_print_conf|type"},
  43. cache: false,
  44. error: function(obj){
  45. },
  46. success: function(obj){
  47. if(obj!=""){
  48. type = obj;
  49. }
  50. }
  51. });
  52. return type;
  53. }
  54. }
  55. },
  56. {
  57. display : '指向',
  58. name : 'portrait',
  59. width : 80,
  60. render : function(row){
  61. if(row.portrait=='0'){
  62. return "横向";
  63. }else if(row.portrait=='1'){
  64. return "纵向";
  65. }
  66. }
  67. },
  68. {
  69. display : '左边距',
  70. name : 'leftmargin',
  71. width : 80
  72. },
  73. {
  74. display : '右边距',
  75. name : 'rightmargin',
  76. width : 80
  77. },
  78. {
  79. display : '上边距',
  80. name : 'topmargin',
  81. width : 80
  82. },
  83. {
  84. display : '下边距',
  85. name : 'bottommargin',
  86. width : 80
  87. },
  88. {
  89. display : '创建人',
  90. name : 'create_user_name',
  91. width : 100
  92. },
  93. {
  94. display : '创建时间',
  95. name : 'create_date',
  96. width : 120
  97. }];
  98. if ("${requestScope.lookup }" == "") {
  99. columns
  100. .push({
  101. display : '操作',
  102. isAllowHide : false,
  103. width : 150,
  104. render : function(row) {
  105. var html = '<a href=\"#\" onclick=\"viewPrintConfEntry('
  106. + row.universalid
  107. + ')\">查看</a>&nbsp;';
  108. if('${loginId}'==row.create_user_id){
  109. html += '<a href=\"#\" onclick=\"editPrintConfEntry('
  110. + row.universalid
  111. + ')\">编辑</a>&nbsp;';
  112. html += '<a href=\"#\" onclick=\"delPrintConfEntry('
  113. + row.universalid
  114. + ')\">删除</a>&nbsp;';
  115. }
  116. return html;
  117. }
  118. });
  119. }
  120. grid = $("#maingrid4")
  121. .ligerGrid(
  122. {
  123. columns : columns,
  124. pageSize : 20,
  125. url : 'erpPrintConfAction.do?task=list&lookup=${lookup}&confType=${confType}&time='
  126. + new Date().getTime() + params,
  127. pageParmName : 'p', //页索引参数名,(提交给服务器)
  128. pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
  129. width : '99.6%',
  130. height : '99%',
  131. checkbox : checkbox,
  132. isChecked: f_isChecked,
  133. onCheckRow: function(checked, rowdata, rowindex) {
  134. for (var rowid in this.records){
  135. this.unselect(rowid);
  136. }
  137. if(checked){
  138. this.select(rowindex);
  139. }else{
  140. this.unselect(rowindex);
  141. }
  142. },
  143. onError : function() {
  144. alert("数据加载失败,请刷新页面!");
  145. }
  146. });
  147. $("#pageloading").hide();
  148. $(".l-grid-hd-cell-btn-checkbox").css("display", "none"); //隱藏checkAll
  149. }
  150. //查看打印配置
  151. function viewPrintConfEntry(universalid){
  152. addTab('viewPrintConf' + getCurrentTabId(), '查看打印配置', '${pageContext.request.contextPath }/erpPrintConfAction.do?task=view&universalid='
  153. + universalid + '&tabid=' + getCurrentTabId(),true,true);
  154. }
  155. //编辑打印配置
  156. function editPrintConfEntry(universalid){
  157. addTab('editPrintConf' + getCurrentTabId(), '编辑打印配置', '${pageContext.request.contextPath }/erpPrintConfAction.do?task=toEdit&universalid='
  158. + universalid + '&tabid=' + getCurrentTabId(),true,true);
  159. }
  160. //删除打印配置
  161. function delPrintConfEntry(universalid){
  162. if (window.confirm("确定要删除吗?")){
  163. addTab('delPrintConf' + getCurrentTabId(), '删除打印配置', '${pageContext.request.contextPath }/erpPrintConfAction.do?task=delete&universalid='
  164. + universalid + '&tabid=' + getCurrentTabId(),true,true);
  165. }
  166. }
  167. function f_select() {
  168. var rows = grid.getCheckedRows();
  169. return rows;
  170. }
  171. //默认选中
  172. function f_isChecked(rowdata){
  173. if(checkValue != "" && typeof (checkValue) != "undefined"){
  174. if(checkValue[i]==rowdata.request_id){
  175. i++;
  176. return true;
  177. }
  178. return false;
  179. }
  180. }
  181. //查询
  182. function searchByKword() {
  183. var params="";
  184. if(null != grid){
  185. grid.set("newPage","1");
  186. }
  187. var type = $("#printConf\\.type").val();//类型
  188. if (type != "" && typeof (type) != "undefined"){
  189. params += "&type=" + encodeURI(encodeURI(type));
  190. }
  191. initPrintConfGrid(params);
  192. }
  193. </script>
  194. </head>
  195. <body>
  196. <%@ include file="/include/button.jsp"%>
  197. <%@ include file="/include/message.jsp"%>
  198. <div class="container">
  199. <c:if test="${!empty requestScope.loginId && requestScope.lookup == null || requestScope.looup == ''}">
  200. <div id="title" class="form-button">
  201. <input style="width:100px;" type="button" class="l-button" value="新增打印配置" onclick="addTab('addPrintConf'+getCurrentTabId(), '新增打印配置', '${pageContext.request.contextPath }/erpPrintConfAction.do?task=toAdd&tabid=' + getCurrentTabId(),true,true);"/>
  202. </div>
  203. <div class="default_search" style="margin: 0; height:30px;"></div>
  204. <div class="default_search" style="margin: 0; padding: 0; width: 99.7%;">
  205. <ul class="list_search">
  206. <li class="title" style="width: 90px;">配置类型:</li>
  207. <li class="text" style="width: 100px;">
  208. <select id="printConf.type" name="printConf.type" style="width:80px;">
  209. <option value="" selected="selected">--请选择--</option>
  210. <c:forEach items="${requestScope.type}" var="type">
  211. <option value="${type.dvalue }"
  212. <c:if test="${type.dvalue eq printConf.type }">selected="selected"</c:if>
  213. >${type.dname }</option>
  214. </c:forEach>
  215. </select>
  216. </li>
  217. </ul>
  218. <ul>
  219. <li class="search-button">
  220. <input type="button" class='l-button' name="search" onclick="searchByKword()" value="查询" />
  221. </li>
  222. </ul>
  223. </div>
  224. </c:if>
  225. <div style="clear: both;">
  226. <div id="maingrid4" style="margin: 0; padding: 0"></div>
  227. </div>
  228. <div style="display: none;"></div>
  229. </div>
  230. </body>
  231. </html>