list.jsp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@taglib prefix="p" uri="http://www.test.com/jsp/permission" %>
  3. <!doctype html>
  4. <html>
  5. <head>
  6. <%@ include file="../../common/head.jsp"%>
  7. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  9. <link href="../res/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
  10. <script src="../res/js/plugins/bootstrap-table/bootstrap-table.js"></script>
  11. <script src="../res/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
  12. <script src="../res/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
  13. <style type="text/css">
  14. #myform {
  15. overflow:hidden;
  16. }
  17. .prodBtn {
  18. float:right;
  19. padding:20px 10px 0px;
  20. }
  21. </style>
  22. <script>
  23. function test(value,row,index){
  24. // return '<a href="#">' + row['id'] + '</a>';
  25. return '<a href="#">编辑 </a>|<a href="#">删除</a>';
  26. }
  27. function format_type(value,row,index){
  28. if(value == 0){
  29. return '平台管理员';
  30. }else if(value==1){
  31. return '机场管理员';
  32. }else if(value==2){
  33. return '航空公司管理员';
  34. }
  35. }
  36. $(function(){
  37. $('#btnSearch').click(function () {
  38. $('#tab_user').bootstrapTable('refresh');
  39. });
  40. $('#clearHref').click(function () {
  41. $('#myform')[0].reset();
  42. });
  43. });
  44. function queryParams(params){
  45. var page = params.offset / params.limit + 1;
  46. var dataObj = new Object();
  47. //alert($("#search").val());
  48. dataObj.name=$("#name").val();
  49. dataObj.productState=$("#productState").val();
  50. dataObj.hotline=$("#hotline").val();
  51. dataObj.isHome=$("#isHome").val();
  52. dataObj.gcId=$("#gcId").val();
  53. dataObj.gcParentId=$("#gcParentId").val();
  54. dataObj.gcThreeId=$("#gcThreeId").val();
  55. dataObj.gcFourId=$("#gcFourId").val();
  56. dataObj.xmCode=$("#xmCode").val();
  57. /* dataObj.xmCode=$("#id1").val();
  58. dataObj.xmCode=$("#id2").val();
  59. dataObj.xmCode=$("#id3").val();
  60. dataObj.xmCode=$("#id4").val(); */
  61. return { page:page,
  62. pageSize:params.limit,
  63. search:JSON.stringify(dataObj),
  64. sort:params.sort,
  65. order:params.order,
  66. };
  67. }
  68. function format_type(value,row,index){
  69. if(value==1){
  70. return '地产';
  71. }else if(value==2){
  72. return '产品';
  73. }
  74. }
  75. function format_state(value,row,index){
  76. if(value==1){
  77. return '上架中';
  78. }else if(value==2){
  79. return '已下架';
  80. }
  81. }
  82. function format_home(value,row,index){
  83. if(value==1){
  84. return '是';
  85. }else if(value==0){
  86. return '否';
  87. }
  88. }
  89. function up(){
  90. var data = getSelectedRow("tab_user");
  91. if(null == data){
  92. layer.msg("未选中行");
  93. return;
  94. }
  95. if(data.productState == '1'){
  96. layer.msg("产品已上架");
  97. return;
  98. }
  99. $.confirm("确定上架当前选中的产品吗? ", function(){
  100. $.post('updown.cs?id=' + data.id+'&state=1',
  101. function(result){
  102. window.location.reload();
  103. }
  104. );
  105. });
  106. }
  107. function down(){
  108. var data = getSelectedRow("tab_user");
  109. if(null == data){
  110. layer.msg("未选中行");
  111. return;
  112. }
  113. if(data.productState == '2'){
  114. layer.msg("产品已下架");
  115. return;
  116. }
  117. $.confirm("确定下架当前选中的产品吗? ", function(){
  118. $.post('updown.cs?id=' + data.id+'&state=2',
  119. function(result){
  120. window.location.reload();
  121. }
  122. );
  123. });
  124. }
  125. /* 遠程推送 */
  126. function remote(){
  127. var data = getSelectedRow("tab_user");
  128. if(null == data){
  129. layer.msg("未选中行");
  130. return;
  131. }
  132. $.confirm("确定推送当前选中的产品吗? ", function(){
  133. $.post('remote.cs?id=' + data.id,
  134. function(result){
  135. if(result.code==500){
  136. layer.msg("当前商品不符合推送需求!");
  137. window.location.reload();
  138. }else{
  139. layer.msg("推送商品成功!");
  140. window.location.reload();
  141. }
  142. }
  143. );
  144. });
  145. }
  146. </script>
  147. </head>
  148. <body class="gray-bg">
  149. <div class="wrapper wrapper-content animated fadeInUp">
  150. <!-- <div class="ibox " style=""> -->
  151. <!-- <div class="ibox-content"> -->
  152. <div class="row row-lg">
  153. <div class="col-sm-12">
  154. <div class="ibox-content m-b-sm border-bottom">
  155. <div class="ibox-title">
  156. <h5>查询条件</h5>
  157. </div>
  158. <form class="form-inline" id="myform">
  159. <table style="border-collapse:separate; border-spacing:0px 10px;" class="col-sm-12">
  160. <tr>
  161. <td>
  162. <div class="form-group col-sm-3"><label>&nbsp;产品名称:</label><input id="name" name="name" class="form-control" style="width:48%" type="text" value=""></div>
  163. <div class="form-group col-sm-3"><label>&nbsp;产品状态:</label>
  164. <select id="productState" name="productState" class="form-control" style="width:48%">
  165. <option value="">请选择</option>
  166. <option value="1">上架中</option>
  167. <option value="2">已下架</option>
  168. </select>
  169. </div>
  170. <div class="form-group col-sm-3"><label>&nbsp;联系电话:</label><input id="hotline" name="hotline" class="form-control" style="width:48%" type="text" value=""></div>
  171. <div class="form-group col-sm-3"><label>&nbsp;是否推荐:</label>
  172. <select id="isHome" name="isHome" class="form-control" style="width:48%">
  173. <option value="">请选择</option>
  174. <option value="1">是</option>
  175. <option value="0">否</option>
  176. </select>
  177. </div>
  178. </td>
  179. </tr>
  180. <tr>
  181. <td colspan="4">
  182. <!-- <div class="form-group col-sm-3">
  183. <label>&nbsp;上级分类:</label><input id="name" name="name" class="form-control" style="width:48%" type="text" value="">
  184. </div>
  185. <div class="form-group col-sm-3">
  186. <label>&nbsp;二级分类:</label>
  187. <input id="name" name="name" class="form-control" type="text" style="width:48%" value="">
  188. </div>
  189. <div class="form-group col-sm-3">
  190. <label>&nbsp;三级分类:</label><input id="name" name="name" class="form-control" type="text" style="width:48%" value="">
  191. </div>
  192. <div class="form-group col-sm-3">
  193. <label>&nbsp;四级分类:</label>
  194. <input id="name" name="name" class="form-control" type="text" style="width:48%" value="">
  195. </div> -->
  196. <div class="form-group col-sm-3">
  197. <label >&nbsp;上级分类:</label><select <c:if test="${role.ONE_CATEGORY_Id != null && role.ONE_CATEGORY_Id != '' && role.ONE_CATEGORY_Id!= '0'}">disabled="disabled"</c:if> class="form-control" style="width:48%" id="gcId" name="gcId" onchange="menuChange(this)" validate="{required:true}" validateMessage="{required:'请选择分类'}">
  198. <option value="">请选择</option>
  199. <c:forEach items="${firstCategory }" var="superMenu">
  200. <option value="${superMenu.id }" <c:if test="${role.ONE_CATEGORY_ID == superMenu.id }">selected</c:if>>${superMenu.gcName}</option>
  201. </c:forEach>
  202. </select>
  203. <c:if test="${role.ONE_CATEGORY_Id != null && role.ONE_CATEGORY_Id != '' && role.ONE_CATEGORY_Id!= '0'}"><input type="hidden" value="${role.ONE_CATEGORY_ID }" name="id1"></c:if>
  204. </div>
  205. <script type="text/javascript">
  206. function menuChange(obj){
  207. var ss = $(obj).children('option:selected').val();
  208. $("#tlb").css("display","none");
  209. $('#tlb select').find("option:selected").prop('selected',false);
  210. $("#thlb").css("display","none");
  211. $('#thlb select').find("option:selected").prop('selected',false);
  212. $("#folb").css("display","none");
  213. $('#folb select').find("option:selected").prop('selected',false);
  214. $('#dcfllb select').find("option:selected").prop('selected',false);
  215. $('#dcfllb').css("display","none");
  216. $("#gcParentId").empty();
  217. $("#gcThreeId").empty();
  218. $("#gcFourId").empty();
  219. $.ajax({
  220. type: "get",
  221. url: "<%=basePath%>mgmProductCategoryCtl/nextCategory.cs",
  222. data: {id:ss},
  223. dataType: "json",
  224. success: function(data){
  225. if(data.mlist.length > 0){
  226. $("#tlb").css("display","block");
  227. $("#gcParentId").empty();
  228. $("#gcParentId").append("<option value='0'>请选择</option>");
  229. data.mlist.forEach(function(val,index,arr){
  230. $("#gcParentId").append("<option value='"+val.id+"'>"+ val.gcName+"</option>");
  231. });
  232. }
  233. if(data.type == "1"){
  234. $('#dcfllb').css("display","block");
  235. }
  236. }
  237. });
  238. }
  239. function twoMenuChange(obj){
  240. var ss = $(obj).children('option:selected').val();
  241. $("#thlb").css("display","none");
  242. $('#thlb select').find("option:selected").prop('selected',false);
  243. $("#folb").css("display","none");
  244. $('#folb select').find("option:selected").prop('selected',false);
  245. $("#gcThreeId").empty();
  246. $("#gcFourId").empty();
  247. $.ajax({
  248. type: "get",
  249. url: "<%=basePath%>mgmProductCategoryCtl/nextCategory.cs",
  250. data: {id:ss},
  251. dataType: "json",
  252. success: function(data){
  253. if(data.mlist.length > 0){
  254. $("#thlb").css("display","block");
  255. $("#gcThreeId").empty();
  256. $("#gcThreeId").append("<option value='0'>请选择</option>");
  257. data.mlist.forEach(function(val,index,arr){
  258. $("#gcThreeId").append("<option value='"+val.id+"'>"+ val.gcName+"</option>");
  259. });
  260. }
  261. }
  262. });
  263. }
  264. function threeMenuChange(obj){
  265. var ss = $(obj).children('option:selected').val();
  266. $("#folb").css("display","none");
  267. $('#folb select').find("option:selected").prop('selected',false);
  268. $("#gcFourId").empty();
  269. $.ajax({
  270. type: "get",
  271. url: "<%=basePath%>mgmProductCategoryCtl/nextCategory.cs",
  272. data: {id:ss},
  273. dataType: "json",
  274. success: function(data){
  275. if(data.mlist.length > 0){
  276. $("#folb").css("display","block");
  277. $("#gcFourId").empty();
  278. $("#gcFourId").append("<option value='0'>请选择</option>");
  279. data.mlist.forEach(function(val,index,arr){
  280. $("#gcFourId").append("<option value='"+val.id+"'>"+ val.gcName+"</option>");
  281. });
  282. }
  283. }
  284. });
  285. }
  286. </script>
  287. <div id="tlb" class="form-group col-sm-3" <c:if test="${role.TWO_CATEGORY_Id == null }">style="display:none;"</c:if> >
  288. <label >&nbsp;二级分类:</label>
  289. <select <c:if test="${role.TWO_CATEGORY_Id != null && role.TWO_CATEGORY_Id != '' && role.TWO_CATEGORY_Id!= '0'}">disabled="disabled"</c:if> class="form-control" style="width:48%" id="gcParentId" name="gcParentId" onchange="twoMenuChange(this)" validate="{required:true}" validateMessage="{required:'请选择分类'}">
  290. <option value="">请选择</option>
  291. <c:forEach items="${twoCategory }" var="superMenu">
  292. <option value="${superMenu.id }" <c:if test="${role.TWO_CATEGORY_Id == superMenu.id }">selected</c:if> >${superMenu.gcName}</option>
  293. </c:forEach>
  294. </select>
  295. <c:if test="${role.TWO_CATEGORY_Id != null && role.TWO_CATEGORY_Id != '' && role.TWO_CATEGORY_Id!= '0'}">
  296. <input type="hidden" value="${role.TWO_CATEGORY_Id }" name="id2">
  297. </c:if>
  298. </div>
  299. <div id="thlb" class="form-group col-sm-3" <c:if test="${role.THREE_CATEGORY_ID == null }">style="display:none;"</c:if>>
  300. <label >&nbsp;三级分类:</label>
  301. <select <c:if test="${role.THREE_CATEGORY_Id != null && role.THREE_CATEGORY_Id != '' && role.THREE_CATEGORY_Id!= '0'}">disabled="disabled"</c:if> class="form-control" style="width:48%" id="gcThreeId" name="gcThreeId" onchange="threeMenuChange(this)" validate="{required:true}" validateMessage="{required:'请选择分类'}">
  302. <option value="">请选择</option>
  303. <c:forEach items="${threeCategory }" var="superMenu">
  304. <option value="${superMenu.id }" <c:if test="${role.THREE_CATEGORY_ID == superMenu.id }">selected</c:if> >${superMenu.gcName}</option>
  305. </c:forEach>
  306. </select>
  307. <c:if test="${role.THREE_CATEGORY_Id != null && role.THREE_CATEGORY_Id != '' && role.THREE_CATEGORY_Id!= '0'}"><input type="hidden" value="${role.THREE_CATEGORY_ID }" name="id3"></c:if>
  308. </div>
  309. <div id="folb" class="form-group col-sm-3" <c:if test="${role.FOUR_CATEGORY_ID == null }">style="display:none;"</c:if>>
  310. <label >&nbsp;四级分类:</label>
  311. <select style="width:48%" <c:if test="${role.FOUR_CATEGORY_Id != null && role.FOUR_CATEGORY_Id != '' && role.FOUR_CATEGORY_Id!= '0'}">disabled="disabled"</c:if> class="form-control id="gcFourId" name="gcFourId" validate="{required:true}" validateMessage="{required:'请选择分类'}">
  312. <option value="">请选择</option>
  313. <c:forEach items="${fourCategory }" var="superMenu">
  314. <option value="${superMenu.id }" <c:if test="${role.FOUR_CATEGORY_ID == superMenu.id }">selected</c:if> >${superMenu.gcName}</option>
  315. </c:forEach>
  316. </select>
  317. <c:if test="${role.FOUR_CATEGORY_Id != null && role.FOUR_CATEGORY_Id != '' && role.FOUR_CATEGORY_Id!= '0'}"><input type="hidden" value="${role.FOUR_CATEGORY_ID }" name="id4"></c:if>
  318. </div>
  319. <!-- //地产项目分类 -->
  320. <div id="dcfllb" class="form-group col-sm-3" style="display:none;">
  321. <label >&nbsp;项目分类:</label>
  322. <select class="form-control" style="width:48%" id="xmCode" name="xmCode" validate="{required:true}" validateMessage="{required:'请输入地产项目分类'}">
  323. <option value="">请选择</option>
  324. <c:forEach items="${diclist }" var="superMenu">
  325. <option value="${superMenu.code }" >${superMenu.name}</option>
  326. </c:forEach>
  327. </select>
  328. </div>
  329. </td>
  330. </tr>
  331. </table>
  332. <label class="prodBtn"><a href="#" id="clearHref" class="btn btn-primary"><i class="icon-search"></i> 清除搜索条件</a></label>
  333. <label class="prodBtn"><a href="#" id="btnSearch" class="btn btn-primary"><i class="icon-search"></i> 搜索</a></label>&nbsp;&nbsp;
  334. </form>
  335. </div>
  336. <cs:toolbar title="产品" tableId="tab_user" width="100%" height="100%" menuCode="${menuCode }">
  337. <p:permission menuCode="${menuCode }" action="16">
  338. <button class="btn btn-sm btn-info" type="button" onclick="up()"><i class="fa fa-info"></i>&nbsp;上架</button>
  339. </p:permission>
  340. <p:permission menuCode="${menuCode }" action="32">
  341. <button class="btn btn-sm btn-info" type="button" onclick="down()"><i class="fa fa-info"></i>&nbsp;下架</button>
  342. </p:permission>
  343. <p:permission menuCode="${menuCode }" action="32">
  344. <button class="btn btn-sm btn-success" type="button" onclick="remote()"><i class="fa fa-info"></i>&nbsp;推送</button>
  345. </p:permission>
  346. </cs:toolbar>
  347. <table id="tab_user"
  348. data-toggle="table"
  349. data-url="list2.cs"
  350. data-method="get"
  351. data-click-to-select="true"
  352. data-pagination="true"
  353. data-data-type="json"
  354. data-show-refresh="true"
  355. data-show-columns="true"
  356. data-show-toggle="true"
  357. data-single-select="true"
  358. data-search-on-enter-key="true"
  359. data-toolbar="#def_toolbar"
  360. data-side-pagination="server"
  361. data-query-params="queryParams"
  362. data-mobile-responsive="true"
  363. >
  364. <thead>
  365. <tr>
  366. <th data-checkbox="true" data-click-to-select="true"></th>
  367. <th data-field="ID" data-visible="false">id</th>
  368. <th data-field="productName">产品名称</th>
  369. <th data-field="gc">项目分类</th>
  370. <th data-field="productRemark">产品标识</th>
  371. <th data-field="productType" data-formatter="format_type">产品类型</th>
  372. <th data-field="commissionRate">佣金比率</th>
  373. <th data-field="hotline">联系电话</th>
  374. <th data-field="productState" data-formatter="format_state">产品状态</th>
  375. <th data-field="productPrice">产品价格</th>
  376. <th data-field="weight">权重</th>
  377. <th data-field="isHome" data-formatter="format_home">是否推荐</th>
  378. <th data-field="unit">单位</th>
  379. <th data-field="createDate" data-formatter="format_time">创建时间</th>
  380. </tr>
  381. </thead>
  382. </table>
  383. </div>
  384. </div>
  385. <!-- </div> -->
  386. <!-- </div> -->
  387. </div>
  388. </body>
  389. </html>