productlist.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. <script type="text/html" id="act">
  40. <button type="button" class="layui-btn layui-btn-normal layui-btn-sm select" lay-event='select'>选择</button>
  41. </script>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  48. {/block}
  49. {block name='script'}
  50. <script>
  51. var parentinputname = '{$Request.param.fodder}';
  52. layList.form.render();
  53. //加载列表
  54. layList.tableList('List',"{:Url('store.store_product/product_ist',['type'=>1])}",function (){
  55. return [
  56. {field: 'id', title: 'ID', sort: true,event:'id',width:'8%'},
  57. {field: 'image', title: '产品图片',templet:'#image',width:'12%'},
  58. {field: 'store_name', title: '产品名称',templet:'#store_name',width:'40%'},
  59. {field: 'right', title: '操作',align:'center',toolbar:'#act'}
  60. ]
  61. });
  62. //点击事件绑定
  63. layList.tool(function (event,data) {
  64. switch (event) {
  65. case 'select':
  66. parent.$f.changeField('product',data.image);
  67. parent.$f.changeField('product_id',data.id);
  68. parent.$f.changeField('title',data.store_name);
  69. parent.$f.changeField('store_name',data.store_name);
  70. parent.$f.changeField('info',data.store_info);
  71. parent.$f.changeField('unit_name',data.unit_name);
  72. parent.$f.changeField('temp_id',data.temp_id.toString());
  73. parent.$f.changeField('image',data.image);
  74. parent.$f.changeField('images',eval('('+data.slider_image+')'));
  75. parent.$f.changeField('price',data.price);
  76. parent.$f.changeField('ot_price',data.ot_price);
  77. parent.$f.changeField('cost',data.cost);
  78. parent.$f.changeField('stock',data.stock);
  79. parent.$f.changeField('sales',data.sales);
  80. parent.$f.changeField('sort',data.sort);
  81. parent.$f.changeField('num',1);
  82. parent.$f.changeField('give_integral',data.give_integral);
  83. parent.$f.changeField('description',data.description);
  84. parent.$f.closeModal(parentinputname);
  85. break;
  86. }
  87. })
  88. //查询
  89. layList.search('search',function(where){
  90. layList.reload(where);
  91. });
  92. </script>
  93. {/block}