Brak opisu

indexcopy.blade.php 11KB

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="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']}}{{$a['is_weigh'] == 1 ? '【按半斤称重】' : ''}}</td>
  66. <td class="text-c">{{$a['code']}}</td>
  67. {{--<td class="text-c">{{$a['referenceCost']}}</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 = 'index_copy?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 = 'index_copy_export?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 = 'index_copy?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. function change_outPrice(id){
  145. var outPrice = $("#outPrice_2"+id).val();
  146. $.ajax({
  147. url: '/admin/goods/editGoodsSku?id='+id+'&outPrice='+outPrice,
  148. type: 'get',
  149. dateType: 'json',
  150. success:function(msg){
  151. $("#outPrice_1"+id).html(outPrice);
  152. $("#outPrice_1"+id).show();
  153. $("#outPrice_2"+id).hide();
  154. }
  155. });
  156. }
  157. function change_price_click(id){
  158. $("#price_1"+id).hide();
  159. $("#price_2"+id).show();
  160. $("#price_2"+id).focus();
  161. }
  162. function change_price(id){
  163. var price = $("#price_2"+id).val();
  164. $.ajax({
  165. url: '/admin/goods/editGoodsSku?id='+id+'&price='+price,
  166. type: 'get',
  167. dateType: 'json',
  168. success:function(msg){
  169. if(msg != 0){
  170. console.log(msg);
  171. }
  172. $("#price_1"+id).html(price);
  173. $("#price_1"+id).show();
  174. $("#price_2"+id).hide();
  175. }
  176. });
  177. }
  178. function change_referenceCost_click(id){
  179. $("#referenceCost_1"+id).hide();
  180. $("#referenceCost_2"+id).show();
  181. $("#referenceCost_2"+id).focus();
  182. }
  183. function change_referenceCost(id){
  184. var referenceCost = $("#referenceCost_2"+id).val();
  185. $.ajax({
  186. url: '/admin/goods/editGoodsSku?id='+id+'&referenceCost='+referenceCost,
  187. type: 'get',
  188. dateType: 'json',
  189. success:function(msg){
  190. if(msg != 0){
  191. console.log(msg);
  192. }
  193. $("#referenceCost_1"+id).html(referenceCost);
  194. $("#referenceCost_1"+id).show();
  195. $("#referenceCost_2"+id).hide();
  196. }
  197. });
  198. }
  199. $(".change_logistics_id").mouseover(
  200. function(){
  201. $(this).children("span").show();
  202. $(this).children("span").addClass('f-18 c-success');
  203. $(this).mouseout(
  204. function(){
  205. $(this).children("span").hide();
  206. }
  207. );
  208. }
  209. );
  210. </script>
  211. </body>
  212. @endsection