Няма описание

indexcopy.blade.php 9.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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="5%">成本价</th>
  49. <th width="5%">建议零售价</th>
  50. <th width="5%">分销商价格</th>
  51. <th width="5%">上架状态</th>
  52. <th width="8%">上架时间</th>
  53. <th width="5%">可用库存</th>
  54. <th width="5%">总库存</th>
  55. <th width="5%">预占用库存</th>
  56. </tr>
  57. </thead>
  58. <tbody>
  59. @if($result)
  60. @foreach($result as $a)
  61. <tr class="text-c">
  62. {{--<td><input name="" type="checkbox" value=""></td>--}}
  63. <td class="text-c">{{$a['goodsCategoryName']}}</td>
  64. <td class="text-c">{{$a['name']}}</td>
  65. <td class="text-c">{{$a['propsName']}}</td>
  66. <td class="text-c">{{$a['code']}}</td>
  67. <td class="text-c">{{$a['realPrice']}}</td>
  68. {{--<td class="text-c">{{$a['price']}}</td>--}}
  69. <td class ="change_logistics_id">
  70. <p id="price_1{{$a['id']}}">{{$a['price']}}</p>
  71. <input id="price_2{{$a['id']}}" style="display: none" type='text' name='price' value="{{$a['price']}}" onblur="change_price({{$a['id']}})" />
  72. <span class="sort_icon" hidden onClick='change_price_click("{{$a['id']}}","{{$a['price']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  73. </td>
  74. {{--<td class="text-c">{{$a['outPrice']}}</td>--}}
  75. <td class ="change_logistics_id">
  76. <p id="outPrice_1{{$a['id']}}">{{$a['outPrice']}}</p>
  77. <input id="outPrice_2{{$a['id']}}" style="display: none" type='text' name='outPrice' value="{{$a['outPrice']}}" onblur="change_outPrice({{$a['id']}})" />
  78. <span class="sort_icon" hidden onClick='change_outPrice_click("{{$a['id']}}","{{$a['outPrice']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  79. </td>
  80. <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>
  81. <td class="text-c">{{$a['createTime']}}</td>
  82. <td class="text-c">{{$a['real_quantity']}}</td>
  83. <td class="text-c">{{$a['total_quantity']}}</td>
  84. <td class="text-c">{{$a['pre_quantity']}}</td>
  85. </tr>
  86. @endforeach
  87. @endif
  88. </tbody>
  89. </table>
  90. </div>
  91. <div id="page" class="page_div"></div>
  92. </div>
  93. <!--_footer 作为公共模版分离出去-->
  94. <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
  95. <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
  96. <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
  97. <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
  98. <script type="text/javascript" src="/admin/lib/page/paging.js"></script>
  99. <!--/_footer 作为公共模版分离出去-->
  100. <!--/_footer 作为公共模版分离出去-->
  101. <script type="text/javascript">
  102. $(function(){
  103. setTimeout("$('#info').hide()",3000);
  104. });
  105. function user_search() {
  106. var name = $('#name').val();
  107. var cate_name = $('#cate_name').val();
  108. var status = $('#status').val();
  109. var quantity = $('#quantity').val();
  110. var outPrice = $('#outPrice').val();
  111. location.href = 'index_copy?page=' + num + '&name=' + name + '&cate_name=' + cate_name + '&status=' + status + '&quantity=' + quantity + '&outPrice=' + outPrice;
  112. }
  113. function goods_export() {
  114. var name = $('#name').val();
  115. var cate_name = $('#cate_name').val();
  116. var status = $('#status').val();
  117. var quantity = $('#quantity').val();
  118. var outPrice = $('#outPrice').val();
  119. location.href = 'index_copy_export?name=' + name + '&cate_name=' + cate_name + '&status=' + status + '&quantity=' + quantity + '&outPrice=' + outPrice;
  120. }
  121. $("#page").paging({
  122. pageNo:{{$page}},
  123. totalPage: {{$pages}},
  124. totalSize: {{$count}},
  125. callback: function(num) {
  126. var name = $('#name').val();
  127. var cate_name = $('#cate_name').val();
  128. var status = $('#status').val();
  129. var quantity = $('#quantity').val();
  130. var outPrice = $('#outPrice').val();
  131. location.href = 'index_copy?page=' + num + '&name=' + name + '&cate_name=' + cate_name + '&status=' + status + '&quantity=' + quantity + '&outPrice=' + outPrice;
  132. }
  133. })
  134. function change_outPrice_click(id, outPrice){
  135. $("#outPrice_1"+id).hide();
  136. $("#outPrice_2"+id).show();
  137. $("#outPrice_2"+id).focus();
  138. }
  139. function change_outPrice(id){
  140. var outPrice = $("#outPrice_2"+id).val();
  141. $.ajax({
  142. url: '/admin/goods/editGoodsSku?id='+id+'&outPrice='+outPrice,
  143. type: 'get',
  144. dateType: 'json',
  145. success:function(msg){
  146. $("#outPrice_1"+id).html(outPrice);
  147. $("#outPrice_1"+id).show();
  148. $("#outPrice_2"+id).hide();
  149. }
  150. });
  151. }
  152. function change_price_click(id, price){
  153. $("#price_1"+id).hide();
  154. $("#price_2"+id).show();
  155. $("#price_2"+id).focus();
  156. }
  157. function change_price(id){
  158. var price = $("#price_2"+id).val();
  159. $.ajax({
  160. url: '/admin/goods/editGoodsSku?id='+id+'&price='+price,
  161. type: 'get',
  162. dateType: 'json',
  163. success:function(msg){
  164. $("#price_1"+id).html(price);
  165. $("#price_1"+id).show();
  166. $("#price_2"+id).hide();
  167. }
  168. });
  169. }
  170. $(".change_logistics_id").mouseover(
  171. function(){
  172. $(this).children("span").show();
  173. $(this).children("span").addClass('f-18 c-success');
  174. $(this).mouseout(
  175. function(){
  176. $(this).children("span").hide();
  177. }
  178. );
  179. }
  180. );
  181. </script>
  182. </body>
  183. @endsection