select.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. {extend name="public/container"}
  2. {block name="content"}
  3. <style type="text/css">
  4. .form-add{position: fixed;left: 0;bottom: 0;width:100%;}
  5. .form-add .sub-btn{border-radius: 0;width: 100%;padding: 6px 0;font-size: 14px;outline: none;border: none;color: #fff;background-color: #2d8cf0;}
  6. </style>
  7. <div class="layui-fluid">
  8. <div class="layui-row layui-col-space15" id="app">
  9. <div class="layui-col-md12">
  10. <div class="layui-card">
  11. <div class="layui-card-header">搜索条件</div>
  12. <div class="layui-card-body">
  13. <form class="layui-form layui-form-pane" action="">
  14. <div class="layui-inline">
  15. <label class="layui-form-label">产品名称</label>
  16. <div class="layui-input-block">
  17. <input type="text" name="store_name" class="layui-input" placeholder="请输入产品名称,关键字,编号">
  18. </div>
  19. </div>
  20. <div class="layui-inline">
  21. <div class="layui-input-inline">
  22. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
  23. <i class="layui-icon layui-icon-search"></i>搜索</button>
  24. </div>
  25. </div>
  26. </form>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="layui-col-md12">
  31. <div class="layui-card">
  32. <div class="layui-card-body">
  33. <table class="layui-hide" id="List" lay-filter="List"></table>
  34. <!--图片-->
  35. <script type="text/html" id="image">
  36. <img style="cursor: pointer" lay-event="open_image" src="{{d.image}}">
  37. </script>
  38. <!--操作-->
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. <div class="form-add">
  44. <button type="submit" class="sub-btn">提交</button>
  45. </div>
  46. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  47. {/block}
  48. {block name='script'}
  49. <script>
  50. var parentinputname = '{$Request.param.fodder}';
  51. layList.form.render();
  52. //加载列表
  53. layList.tableList('List',"{:Url('store.store_product/product_ist',['type'=>1])}",function (){
  54. return [
  55. {type: 'checkbox'},
  56. {field: 'id', title: 'ID', sort: true,event:'id'},
  57. {field: 'image', title: '产品图片',templet:'#image'},
  58. {field: 'store_name', title: '产品名称',templet:'#store_name'},
  59. ]
  60. });
  61. //点击事件绑定
  62. $(".sub-btn").on("click",function(){
  63. var ids=layList.getCheckData().getIds('id');
  64. var pics=layList.getCheckData().getIds('image');
  65. parent.$f.changeField('image',pics);
  66. parent.$f.changeField('product_id',ids);
  67. parent.$f.closeModal(parentinputname);
  68. });
  69. //查询
  70. layList.search('search',function(where){
  71. layList.reload(where);
  72. });
  73. </script>
  74. {/block}