changeInventory.blade.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. @extends('layouts.app')
  2. @section('title')动库报表-库存管理@endsection
  3. @section('content')
  4. <div id="list" class="d-none card container-fluid" style="min-width: 1500px">
  5. <div id="form_div"></div>
  6. <span class="dropdown">
  7. <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
  8. data-toggle="dropdown" title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">
  9. 导出Excel
  10. </button>
  11. <span class="dropdown-menu">
  12. <a class="dropdown-item" @click="processExport(true)" href="javascript:">导出所有页</a>
  13. </span>
  14. </span>
  15. <table class="table table-sm table-striped table-bordered table-hover text-nowrap card-body mt-2 td-min-width-80" id="table">
  16. <tr v-for="(oracleActTransactingLog,i) in oracleActTransactingLogs" @click="selectedColor(oracleActTransactingLog.id,$event)">
  17. <td><span>@{{ i+1 }}</span></td>
  18. <td class="text-primary"><span>@{{ oracleActTransactingLog.货主 }}</span></td>
  19. <td class="text-muted"><span>@{{ oracleActTransactingLog.库位 }}</span></td>
  20. <td class="text-muted"><span>@{{ oracleActTransactingLog.产品编码 }}</span></td>
  21. <td class="text-muted"><span>@{{ oracleActTransactingLog.产品条码 }}</span></td>
  22. <td :title="oracleActTransactingLog.商品名称" class="tooltipTarget" style="max-width: 200px;overflow:hidden"><span>@{{ oracleActTransactingLog.商品名称 }}</span></td>
  23. <td class="text-muted"><span>@{{ oracleActTransactingLog.属性仓 }}</span></td>
  24. <td class="text-muted"><span>@{{ oracleActTransactingLog.质量状态 }}</span></td>
  25. <td class="text-muted"><span>@{{ oracleActTransactingLog.失效日期 }}</span></td>
  26. <td class="text-muted"><span>@{{ oracleActTransactingLog.批号 }}</span></td>
  27. <td v-if="!isTotalStock"><span>@{{ oracleActTransactingLog.移出数量 }}</span></td>
  28. <td v-if="!isTotalStock"><span>@{{ oracleActTransactingLog.移入数量 }}</span></td>
  29. <td><span v-if="oracleActTransactingLog.在库数量">@{{ oracleActTransactingLog.在库数量 }}</span><span v-else>0</span></td>
  30. <td><span v-if="oracleActTransactingLog.占用数量">@{{ oracleActTransactingLog.占用数量 }}</span><span v-else>0</span></td>
  31. </tr>
  32. </table>
  33. <div>
  34. <button type="button" @click="pageUp()" :readonly="page>1?false:true" class="btn btn-sm " :class="page>1?'btn-outline-info':''">上一页</button>
  35. <button type="button" @click="pageDown()" :readonly="page<maxPage?false:true" class="btn btn-sm m-3" :class="page<maxPage?'btn-outline-info':''">下一页</button>
  36. <div v-if="isPage">
  37. <input @keyup.enter="pageSkip($event)" class="form-control-sm ml-3 tooltipTarget" :placeholder="'当前页数:'+page+'/'+maxPage" title="去往指定页">
  38. <span class="text-muted m-1">共 @{{ sum }} 条</span>
  39. </div>
  40. </div>
  41. </div>
  42. @endsection
  43. @section('lastScript')
  44. <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
  45. <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
  46. <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>{{--新版2--}}
  47. <script>
  48. let vue=new Vue({
  49. el:"#list",
  50. data:{
  51. oracleActTransactingLogs:{!! $oracleActTransactingLogs !!},
  52. page:Number('{{$page}}'),
  53. owners:[
  54. @foreach($owners as $owner)
  55. {name:'{{$owner->code}}',value:'{{$owner->name}}'},
  56. @endforeach
  57. ],
  58. maxPage:1,
  59. sum:0,
  60. isPage:true,
  61. date:[{name:'1',value:'近一天'},{name:'3',value:'近三天'},{name:'7',value:'近一周'},{name:'30',value:'近一月'},],
  62. isTotalStock : "{{ $isTotalStock }}",
  63. selectTr:''
  64. },
  65. mounted:function () {
  66. $(".tooltipTarget").tooltip({'trigger':'hover'});
  67. $("#list").removeClass('d-none');
  68. if (this.oracleActTransactingLogs.length>0){
  69. this.maxPage=Math.ceil(this.oracleActTransactingLogs[0].sum/50);
  70. this.sum=this.oracleActTransactingLogs[0].sum;
  71. }
  72. let data=[
  73. [
  74. {name:['date_start','range'],type:'dateTime_select',tip:['选择创建日期的起始时间','查询内容的日期范围'],placeholder:['','查询内容的日期范围'],data: this.date
  75. ,killings:[['range'],['date_start']]},
  76. {name:'TOLocation',type:'input',tip:'可支持多库位,糊模查找需要在左边打上%符号',placeholder: '库位'},
  77. {name:'LotAtt05',type:'input',tip:'可支持多属性仓,糊模查找需要在左边打上%符号',placeholder: '属性仓'},
  78. {name:'LotAtt02_start',type:'dateTime',tip:'选择显示失效日期的起始时间'},
  79. {name:'customerid',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的客户'],
  80. placeholder:['货主','定位或多选货主'],data:this.owners},
  81. ],
  82. [
  83. {name:'date_end',type:'dateTime',tip:'选择创建日期的结束时间',killings:['range']},
  84. {name:'SKU',type:'input',tip:'可支持多产品编码,糊模查找需要在左边打上%符号',placeholder: '产品编码'},
  85. {name:'ALTERNATE_SKU1',type:'input',tip:'可支持多产品条码,糊模查找需要在左边打上%符号',placeholder: '产品条码'},
  86. {name:'LotAtt02_end',type:'dateTime',tip:'选择显示失效日期的结束时间'},
  87. {name:'commodity_name',type:'input',tip:'商品名称模糊搜索,请配合其余条件一起使用,加%为全量模糊',placeholder: '商品名称'},
  88. ],
  89. ];
  90. this.form = new query({
  91. el:'#form_div',
  92. condition:data
  93. });
  94. this.form.init();
  95. let thisUrl=document.URL;
  96. let parameter=thisUrl.split('?',2);
  97. if (parameter.length > 1){
  98. let _this=this;
  99. let list=['ALTERNATE_SKU1','LotAtt05','LotAtt02_start','descr_c','LotAtt02_end'];
  100. let param=parameter[1].split('&');
  101. param.every(function (data) {
  102. let arr=data.split('=');
  103. if (arr.length > 1){
  104. if (list.includes(arr[0]) && arr[1]){
  105. _this.isPage = false;
  106. return false;
  107. }
  108. }
  109. return true;
  110. });
  111. }
  112. let column = [
  113. {name:'index',value: '序号', neglect: true},
  114. {name:'货主',value: '货主', class:'text-primary'},
  115. {name:'库位',value: '库位', class:'text-muted'},
  116. {name:'产品编码',value: '产品编码', class:'text-muted'},
  117. {name:'产品条码',value: '产品条码', class:'text-muted'},
  118. {name:'商品名称',value: '商品名称'},
  119. {name:'属性仓',value: '属性仓', class:'text-muted'},
  120. {name:'质量状态',value: '质量状态', class:'text-muted'},
  121. {name:'失效日期',value: '失效日期', class:'text-muted'},
  122. {name:'批号',value: '批号', class:'text-muted'},
  123. @if(!$isTotalStock)
  124. {name:'移出数量',value: '移出数量', neglect: true},
  125. {name:'移入数量',value: '移入数量', neglect: true},
  126. @endif
  127. {name:'在库数量',value: '在库数量', neglect: true},
  128. {name:'占用数量',value: '占用数量', neglect: true},
  129. ];
  130. new Header({
  131. el: "table",
  132. name: "changeInventory",
  133. column: column,
  134. data: this.oracleActTransactingLogs,
  135. restorationColumn: 'rn',
  136. isRestorationColumnAsc:true,
  137. fixedTop:($('#form_div').height())+2,
  138. isCheckAllBox:false,
  139. }).init();
  140. },
  141. methods:{
  142. selectedColor(id,e){
  143. $('#headerParent tr[class=focusing]').removeClass('focusing')
  144. if (id==this.selectTr){
  145. this.selectTr='';
  146. return;
  147. }
  148. this.selectTr=id;
  149. $(e.target).parent('tr').addClass('focusing')
  150. },
  151. pageUp(){
  152. if (this.page<=1)return;
  153. this.href(this.page-1);
  154. },
  155. pageDown(){
  156. if (this.page>=this.maxPage)return;
  157. this.href(this.page+1);
  158. },
  159. pageSkip(e){
  160. if (Number(e.target.value)<=0 || Number(e.target.value)>this.maxPage){
  161. tempTip.setDuration(2000);
  162. tempTip.show('页数不存在! ');
  163. return
  164. }
  165. this.href(e.target.value);
  166. },
  167. href(page){
  168. let url = document.URL;
  169. if (url.indexOf('page='+this.page) != -1){
  170. url = url.replace("page="+this.page,"page="+page);
  171. }else{
  172. if (url.indexOf('?') == -1) url += "?page="+page;
  173. else url += "&page="+page;
  174. }
  175. window.location.href=url;
  176. },
  177. processExport(checkAllSign){
  178. let url = '{{url('inventory/statement/allInventory/export')}}';
  179. if (!this.isTotalStock)
  180. url = '{{url('inventory/statement/changeInventory/export')}}';
  181. let token='{{ csrf_token() }}';
  182. let data= JSON.stringify( checkData );
  183. excelExport(checkAllSign,data,url,this.sum,token);
  184. },
  185. },
  186. filters:{
  187. json(value) {
  188. return JSON.stringify(value);
  189. }
  190. },
  191. });
  192. </script>
  193. @endsection