index.blade.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. @extends('layouts.app')
  2. @section('title')库存管理-补货列表@endsection
  3. @section('content')
  4. <div id="list" class="d-none item-logistic-index">
  5. <div class="container-fluid">
  6. <div class="m-2 form-inline" id="btn">
  7. <select class="form-control form-control-sm tooltipTarget" name="owner_id" id="owner_id"
  8. style="width: 150px;position: relative" title="选择指定货主" v-model="owner_id">
  9. <option value="">货主</option>
  10. <option v-for="owner in owners" :value="owner.name">@{{ owner.value }}</option>
  11. </select>
  12. <input placeholder="定位货主" id="ownerName" autocomplete="off" @input="定位货主($event)"
  13. class="form-control form-control-sm tooltipTarget" style="width: 100px" title="输入关键字定位货主">
  14. <button class="btn btn-sm btn-outline-info ml-3" @click="search()" >查询</button>
  15. <button type="button"
  16. @click="orderItemExport(true)"
  17. class="btn btn-outline-dark btn-sm ml-2"
  18. title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">导出Excel
  19. </button>
  20. </div>
  21. <table class="table table-striped table-bordered table-hover card-body td-min-width-80" id="table">
  22. <tr v-if="item.amount > 0 " v-for="(item,i) in details" @click="selectTr===i+1?selectTr=0:selectTr=i+1"
  23. :class="selectTr===i+1?'focusing' : ''">
  24. <td>@{{ item.customerid }}</td>
  25. <td>@{{ item.sku }}</td>
  26. <td>@{{ item.alternate_sku1 }}</td>
  27. <td>
  28. <ul style="list-style: none" v-if="item.eaLocation.length>0">
  29. <li v-for="(v,k) in item.eaLocation" v-if="k<3 || item.moreEaLocation">@{{ v }}</li>
  30. <a v-if="item.eaLocation.length >= 3" href="javascript:;"
  31. @click="item.moreEaLocation = !(item.moreEaLocation)">展示更多</a>
  32. </ul>
  33. <div v-else>拣货库位不存在</div>
  34. </td>
  35. <td>@{{ item.amount }}</td>
  36. <td>
  37. <ul style="list-style: none">
  38. <li v-for="(v,k) in item.rsLocation" v-if="k<3 || item.moreRaLocation">@{{ v.location }}
  39. <span class="font-weight-bold text-dark">&nbsp;&nbsp;&nbsp;:@{{ v.qty }}</span>
  40. <span class="font-weight-bold text-dark">&nbsp;&nbsp;&nbsp;:@{{ v.lot }}</span>
  41. </li>
  42. <a v-if="item.rsLocation.length >= 3" href="#javascript:;"
  43. @click="item.moreRaLocation = !(item.moreRaLocation)">展示更多</a>
  44. </ul>
  45. </td>
  46. </tr>
  47. </table>
  48. </div>
  49. </div>
  50. @endsection
  51. @section('lastScript')
  52. <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
  53. <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>{{--新版2--}}
  54. <script>
  55. let vue = new Vue({
  56. el: "#list",
  57. data: {
  58. selectTr: 0,
  59. owner_id: '',
  60. owners: [
  61. @foreach($owners as $owner)
  62. {
  63. name: '{{$owner->code}}', value: '{{$owner->name}}'
  64. },
  65. @endforeach
  66. ],
  67. details: []
  68. },
  69. created() {
  70. },
  71. mounted() {
  72. $('#list').removeClass('d-none');
  73. $(".up").slideUp();
  74. let column = [
  75. {name: 'owner_name', value: '货主'},
  76. {name: 'sku', value: '商品名称'},
  77. {name: 'barcode', value: '商品条码'},
  78. {name: 'ea_location', value: '拣货库位'},
  79. {name: 'amount', value: '缺货数'},
  80. {name: 'rs_location', value: '存储库位'},
  81. ];
  82. new Header({
  83. el: "table",
  84. name: "item",
  85. column: column,
  86. data: this.details,
  87. restorationColumn: 'addtime',
  88. fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 1,
  89. }).init();
  90. $('#table tr:eq(0) th:eq(0)').remove();
  91. },
  92. methods: {
  93. orderItemExport(sign) {
  94. if (this.owner_id === '') {
  95. tempTip.show('请选择货主!');
  96. return;
  97. }
  98. let url = '{{url('inventory/stockOut/export')}}';
  99. let token = '{{ csrf_token() }}';
  100. if (sign) {
  101. excelExport(true, checkData, url, this.total, token, {customer: this.owner_id});
  102. }
  103. },
  104. 定位货主(e) {
  105. this.owners.some(owner => {
  106. if (owner.value.indexOf(e.target.value) !== -1) {
  107. this.owner_id = owner.name;
  108. return true;
  109. }
  110. });
  111. if (e.target.value === '' || e.target.value === null || e.target.value === undefined) {
  112. this.owner_id = '';
  113. }
  114. },
  115. search() {
  116. let url = "{{ url('inventory/stockOut/getReplenishmentInfoByCustomer') }}"
  117. axios.post(url, {
  118. customer: this.owner_id
  119. }).then(res => {
  120. if (res.data.success){
  121. this.details = res.data.data
  122. }else {
  123. window.tempTip.show(res.data.data);
  124. window.tempTip.setDuration(2000);
  125. }
  126. }).catch(function (err){
  127. window.tempTip.show('网络异常'+err);
  128. window.tempTip.setDuration(2000);
  129. });
  130. }
  131. },
  132. filters: {},
  133. });
  134. </script>
  135. @endsection