No Description

goodsindex.blade.php 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. @extends('admin/master')
  2. @section('content')
  3. <body>
  4. @if(session('info'))
  5. <div class="Huialert Huialert-info" onclick="$(this).remove()" id="info">
  6. {{session('info')}}
  7. </div>
  8. @endif
  9. <div class="page-container">
  10. <div>
  11. <input class="input-text" style="width:5%;text-align:center" type="text" value="商品名称"/>
  12. <input id="name" type="text" class="input-text" style="width:8%;text-align:center" name="name" value="{{$name?$name:''}}">
  13. <input class="input-text" style="width:5%;text-align:center" type="text" value="商品分类"/>
  14. <select class="select-box" style="width:7%;text-align:center" name="cate_name" id='cate_name'>
  15. <option value="0" @if($cate_name=='') selected @endif>选择分类</option>
  16. @foreach($cates as $v)
  17. <option value="{{$v}}" @if($cate_name==$v) selected @endif>{{$v}}</option>
  18. @endforeach
  19. </select>
  20. <input class="input-text" style="width:5%;text-align:center" type="text" value="商品状态"/>
  21. <select class="select-box" style="width:7%;text-align:center" name="status" id='status'>
  22. <option value="-1" @if($status=='-1') selected @endif>选择状态</option>
  23. <option value="0" @if($status=='0') selected @endif>已上架</option>
  24. <option value="1" @if($status=='1') selected @endif>已下架</option>
  25. </select>
  26. <input class="input-text" style="width:7%;text-align:center" type="text" value="商品可用库存"/>
  27. <select class="select-box" style="width:7%;text-align:center" name="quantity" id='quantity'>
  28. <option value="-1" @if($quantity=='-1') selected @endif>选择库存</option>
  29. <option value="1" @if($quantity=='1') selected @endif>商品可用库存大于0</option>
  30. </select>
  31. <input class="input-text" style="width:6%;text-align:center" type="text" value="分销商价格"/>
  32. <select class="select-box" style="width:7%;text-align:center" name="outPrice" id='outPrice'>
  33. <option value="-1" @if($outPrice=='-1') selected @endif>选择价格</option>
  34. <option value="1" @if($outPrice=='1') selected @endif>分销商价格大于0</option>
  35. </select>
  36. <a class="btn btn-primary radius" onclick="user_search()" href="javascript:;">搜索</a>
  37. <a class="btn btn-primary radius" onclick="goods_export()" href="javascript:;">导出商品</a>
  38. </div>
  39. <div class="mt-20">
  40. <table class="table table-border table-bordered table-bg table-hover table-sort">
  41. <thead>
  42. <tr class="text-c">
  43. {{--<th width="25"><input type="checkbox" name="" value=""></th>--}}
  44. <th width="5%">商品分类</th>
  45. <th width="5%">商品名称</th>
  46. <th width="8%">商品规格</th>
  47. <th width="5%">规格编码</th>
  48. <th width="8%">建议零售价</th>
  49. <th width="5%">分销商价格</th>
  50. <th width="5%">上架状态</th>
  51. <th width="8%">上架时间</th>
  52. <th width="5%">可用库存</th>
  53. <th width="5%">总库存</th>
  54. <th width="5%">预占用库存</th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. @if($result)
  59. @foreach($result as $a)
  60. <tr class="text-c">
  61. {{--<td><input name="" type="checkbox" value=""></td>--}}
  62. <td class="text-c">{{$a['goodsCategoryName']}}</td>
  63. <td class="text-c">{{$a['name']}}</td>
  64. <td class="text-c">{{$a['propsName']}}{{$a['is_weigh'] == 1 ? '【按半斤称重】' : ''}}</td>
  65. <td class="text-c">{{$a['code']}}</td>
  66. <td class="text-c">{{$a['price']}}</td>
  67. <td class="text-c">{{$a['outPrice']}}</td>
  68. {{--<td class ="change_logistics_id">--}}
  69. {{--<p id="referenceCost_1{{$a['id']}}">{{$a['referenceCost']}}</p>--}}
  70. {{--<input id="referenceCost_2{{$a['id']}}" style="display: none" type='text' name='referenceCost' value="{{$a['referenceCost']}}" onblur="change_referenceCost({{$a['id']}})" />--}}
  71. {{--<span class="sort_icon" hidden onClick='change_referenceCost_click("{{$a['id']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>--}}
  72. {{--</td>--}}
  73. {{--<td class="text-c">{{$a['price']}}</td>--}}
  74. {{--<td class ="change_logistics_id">--}}
  75. {{--<p id="price_1{{$a['id']}}">{{$a['price']}}</p>--}}
  76. {{--<input id="price_2{{$a['id']}}" style="display: none" type='text' name='price' value="{{$a['price']}}" onblur="change_price({{$a['id']}})" />--}}
  77. {{--<span class="sort_icon" hidden onClick='change_price_click("{{$a['id']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>--}}
  78. {{--</td>--}}
  79. {{--<td class="text-c">{{$a['outPrice']}}</td>--}}
  80. {{--<td class ="change_logistics_id">--}}
  81. {{--<p id="outPrice_1{{$a['id']}}">{{$a['outPrice']}}</p>--}}
  82. {{--<input id="outPrice_2{{$a['id']}}" style="display: none" type='text' name='outPrice' value="{{$a['outPrice']}}" onblur="change_outPrice({{$a['id']}})" />--}}
  83. {{--<span class="sort_icon" hidden onClick='change_outPrice_click("{{$a['id']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>--}}
  84. {{--</td>--}}
  85. <td class="text-c">@if($a['is_del']==1) <span class="btn btn-danger radius">已下架</span> @else <span class="btn btn-success radius">已上架</span> @endif</td>
  86. <td class="text-c">{{$a['createTime']}}</td>
  87. <td class="text-c">{{$a['real_quantity']}}</td>
  88. <td class="text-c">{{$a['total_quantity']}}</td>
  89. <td class="text-c">{{$a['pre_quantity']}}</td>
  90. </tr>
  91. @endforeach
  92. @endif
  93. </tbody>
  94. </table>
  95. </div>
  96. <div id="page" class="page_div"></div>
  97. </div>
  98. <!--_footer 作为公共模版分离出去-->
  99. <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
  100. <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
  101. <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
  102. <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
  103. <script type="text/javascript" src="/admin/lib/page/paging.js"></script>
  104. <!--/_footer 作为公共模版分离出去-->
  105. <!--/_footer 作为公共模版分离出去-->
  106. <script type="text/javascript">
  107. $(function(){
  108. setTimeout("$('#info').hide()",3000);
  109. });
  110. function user_search() {
  111. var name = $('#name').val();
  112. var cate_name = $('#cate_name').val();
  113. var status = $('#status').val();
  114. var quantity = $('#quantity').val();
  115. var outPrice = $('#outPrice').val();
  116. location.href = 'goodsindex?page=' + num + '&name=' + name + '&cate_name=' + cate_name + '&status=' + status + '&quantity=' + quantity + '&outPrice=' + outPrice;
  117. }
  118. function goods_export() {
  119. var name = $('#name').val();
  120. var cate_name = $('#cate_name').val();
  121. var status = $('#status').val();
  122. var quantity = $('#quantity').val();
  123. var outPrice = $('#outPrice').val();
  124. location.href = 'goodsindexexport?name=' + name + '&cate_name=' + cate_name + '&status=' + status + '&quantity=' + quantity + '&outPrice=' + outPrice;
  125. }
  126. $("#page").paging({
  127. pageNo:{{$page}},
  128. totalPage: {{$pages}},
  129. totalSize: {{$count}},
  130. callback: function(num) {
  131. var name = $('#name').val();
  132. var cate_name = $('#cate_name').val();
  133. var status = $('#status').val();
  134. var quantity = $('#quantity').val();
  135. var outPrice = $('#outPrice').val();
  136. location.href = 'goodsindex?page=' + num + '&name=' + name + '&cate_name=' + cate_name + '&status=' + status + '&quantity=' + quantity + '&outPrice=' + outPrice;
  137. }
  138. })
  139. // function change_outPrice_click(id){
  140. // $("#outPrice_1"+id).hide();
  141. // $("#outPrice_2"+id).show();
  142. // $("#outPrice_2"+id).focus();
  143. // }
  144. //
  145. // function change_outPrice(id){
  146. // var outPrice = $("#outPrice_2"+id).val();
  147. // $.ajax({
  148. // url: '/admin/goods/editGoodsSku?id='+id+'&outPrice='+outPrice,
  149. // type: 'get',
  150. // dateType: 'json',
  151. // success:function(msg){
  152. // $("#outPrice_1"+id).html(outPrice);
  153. // $("#outPrice_1"+id).show();
  154. // $("#outPrice_2"+id).hide();
  155. // }
  156. // });
  157. // }
  158. //
  159. // function change_price_click(id){
  160. // $("#price_1"+id).hide();
  161. // $("#price_2"+id).show();
  162. // $("#price_2"+id).focus();
  163. // }
  164. //
  165. // function change_price(id){
  166. // var price = $("#price_2"+id).val();
  167. // $.ajax({
  168. // url: '/admin/goods/editGoodsSku?id='+id+'&price='+price,
  169. // type: 'get',
  170. // dateType: 'json',
  171. // success:function(msg){
  172. // if(msg != 0){
  173. // console.log(msg);
  174. // }
  175. // $("#price_1"+id).html(price);
  176. // $("#price_1"+id).show();
  177. // $("#price_2"+id).hide();
  178. // }
  179. // });
  180. // }
  181. //
  182. // function change_referenceCost_click(id){
  183. // $("#referenceCost_1"+id).hide();
  184. // $("#referenceCost_2"+id).show();
  185. // $("#referenceCost_2"+id).focus();
  186. // }
  187. //
  188. // function change_referenceCost(id){
  189. // var referenceCost = $("#referenceCost_2"+id).val();
  190. // $.ajax({
  191. // url: '/admin/goods/editGoodsSku?id='+id+'&referenceCost='+referenceCost,
  192. // type: 'get',
  193. // dateType: 'json',
  194. // success:function(msg){
  195. // if(msg != 0){
  196. // console.log(msg);
  197. // }
  198. // $("#referenceCost_1"+id).html(referenceCost);
  199. // $("#referenceCost_1"+id).show();
  200. // $("#referenceCost_2"+id).hide();
  201. // }
  202. // });
  203. // }
  204. //
  205. // $(".change_logistics_id").mouseover(
  206. // function(){
  207. // $(this).children("span").show();
  208. // $(this).children("span").addClass('f-18 c-success');
  209. // $(this).mouseout(
  210. // function(){
  211. // $(this).children("span").hide();
  212. // }
  213. // );
  214. // }
  215. // );
  216. </script>
  217. </body>
  218. @endsection