|
|
@@ -4,92 +4,17 @@
|
|
|
@section('content')
|
|
|
@component('inventory.statement.menu')@endcomponent
|
|
|
<div id="list" class="d-none card container-fluid" style="min-width: 1500px">
|
|
|
- <form method="GET" action="{{url('inventory/statement/changeInventory')}}" id="form">
|
|
|
- <table class="table table-sm table-bordered text-nowrap mb-0">
|
|
|
- <tr v-if="isBeingFilterConditions">
|
|
|
- <td colspan="10">
|
|
|
- <div class="col" style="padding:0">
|
|
|
- <a href="{{url('inventory/statement/changeInventory')}}"><span class="btn btn-warning text-dark">清除过滤条件</span></a>
|
|
|
- </div></td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td >
|
|
|
- <select name="paginate" v-model="filterData.paginate" class="tooltipTarget form-control form-control-sm" style="vertical-align: middle;max-width: 100px" @change="submit">
|
|
|
- <option value="50">50行</option>
|
|
|
- <option value="100">100行</option>
|
|
|
- <option value="200">200行</option>
|
|
|
- <option value="500">500行</option>
|
|
|
- <option value="1000">1000行</option>
|
|
|
- </select></td>
|
|
|
- <td >
|
|
|
- <div class="form-inline">
|
|
|
- <input type="date" name="date_start" style="max-width: 150px" class="form-control form-control-sm tooltipTarget" title="选择显示指定日期的起始时间"
|
|
|
- v-model="filterData.date_start" :class="filterData.created_at_start?'bg-warning':''">
|
|
|
- <select v-model="filterData.range" name="range" @change="submit" title="查询内容的日期范围" class="form-control form-control-sm tooltipTarget m-2">
|
|
|
- <option value="">日期范围</option>
|
|
|
- <option value="1">近一天</option>
|
|
|
- <option value="3">近三天</option>
|
|
|
- <option value="7" selected>近七天</option>
|
|
|
- <option value="30">近三十天</option>
|
|
|
- </select></div>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <input name="TOLocation" style="max-width: 200px" v-model="filterData.TOLocation" class="form-control form-control-sm tooltipTarget" placeholder="库位" :class="filterData.TOLocation?'bg-warning':''">
|
|
|
- </td>
|
|
|
- <td >
|
|
|
- <input name="LotAtt05" style="max-width: 200px" v-model="filterData.LotAtt05" class="form-control form-control-sm tooltipTarget" placeholder="属性仓" :class="filterData.LotAtt05?'bg-warning':''">
|
|
|
- </td>
|
|
|
- <td >
|
|
|
- <input style="max-width: 150px" type="date" class="form-control form-control-sm tooltipTarget" name="LotAtt02_start" title="选择显示失效日期的起始时间"
|
|
|
- v-model="filterData.LotAtt02_start" :class="filterData.LotAtt02_start?'bg-warning':''" >
|
|
|
- </td>
|
|
|
- <td colspan="5"></td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td >
|
|
|
- <div class="form-inline">
|
|
|
- <input type="text" class="form-control form-control-sm tooltipTarget" placeholder="客户"
|
|
|
- style="width:70px" @input="owner_seek"
|
|
|
- title="输入关键词快速定位下拉列表,回车确定">
|
|
|
- <select name="descr_c" v-model="filterData.descr_c" @change="submit" style="max-width: 100px" class="form-control form-control-sm tooltipTarget" title="选择要显示的客户" :class="filterData.descr_c?'bg-warning':''">
|
|
|
- <option > </option>
|
|
|
- <option v-for="owner in owners" :value="owner.descr_c" >@{{owner.descr_c}}</option>
|
|
|
- </select></div>
|
|
|
- </td>
|
|
|
- <td >
|
|
|
- <input style="max-width: 150px" type="date" class="form-control form-control-sm tooltipTarget" name="date_end" title="选择显示指定日期的结束时间"
|
|
|
- v-model="filterData.date_end" :class="filterData.created_at_end?'bg-warning':''" >
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <input style="max-width: 200px" name="SKU" v-model="filterData.SKU" class="form-control form-control-sm tooltipTarget" placeholder="产品编码" :class="filterData.SKU?'bg-warning':''">
|
|
|
- </td>
|
|
|
- <td >
|
|
|
- <input style="max-width: 200px" name="ALTERNATE_SKU1" v-model="filterData.ALTERNATE_SKU1" class="form-control form-control-sm tooltipTarget" placeholder="产品条码" :class="filterData.ALTERNATE_SKU1?'bg-warning':''">
|
|
|
- </td>
|
|
|
- <td >
|
|
|
- <input style="max-width: 150px" type="date" class="form-control form-control-sm tooltipTarget" name="LotAtt02_end" title="选择显示失效日期的结束时间"
|
|
|
- v-model="filterData.LotAtt02_end" :class="filterData.LotAtt02_end?'bg-warning':''" >
|
|
|
- </td>
|
|
|
- <td colspan="5">
|
|
|
- <input type="submit" class="btn btn-sm btn-outline-dark pull-left" value="按条件搜索">
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td colspan="9">
|
|
|
- <span class="dropdown">
|
|
|
- <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget" :class="[checkData.length>0?'btn-dark text-light':'']"
|
|
|
- data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
|
|
|
- 导出Excel
|
|
|
- </button>
|
|
|
- <div class="dropdown-menu">
|
|
|
- <a class="dropdown-item" @click="processExport(1)" href="javascript:">导出勾选内容</a>
|
|
|
- <a class="dropdown-item" @click="processExport(2)" href="javascript:">导出所有页</a>
|
|
|
- </div>
|
|
|
- </span>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
- </form>
|
|
|
+ <div id="form_div"></div>
|
|
|
+ <span class="dropdown">
|
|
|
+ <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget" :class="[checkData.length>0?'btn-dark text-light':'']"
|
|
|
+ data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
|
|
|
+ 导出Excel
|
|
|
+ </button>
|
|
|
+ <div class="dropdown-menu">
|
|
|
+ <a class="dropdown-item" @click="processExport(false)" href="javascript:">导出勾选内容</a>
|
|
|
+ <a class="dropdown-item" @click="processExport(true)" href="javascript:">导出所有页</a>
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
<table class="table table-sm table-striped table-bordered table-hover text-nowrap card-body mt-2">
|
|
|
<tr>
|
|
|
<th>
|
|
|
@@ -132,20 +57,6 @@
|
|
|
<td><span v-if="oracleActTransactingLog.占用数量">@{{ oracleActTransactingLog.占用数量 }}</span><span v-else>0</span></td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
- <form method="post" hidden action="{{url('inventory/statement/changeInventory/export')}}" id="checkDataForm">
|
|
|
- @csrf
|
|
|
- <input name="checkData" :value="checkData | json">
|
|
|
- <input name="export" :value="filterData.export">
|
|
|
- <input name="date_start" :value="filterData.date_start">
|
|
|
- <input name="date_end" :value="filterData.date_end">
|
|
|
- <input name="SKU" :value="filterData.SKU">
|
|
|
- <input name="TOLocation" :value="filterData.TOLocation">
|
|
|
- <input name="LotAtt05" :value="filterData.LotAtt05">
|
|
|
- <input name="LotAtt02_start" :value="filterData.LotAtt02_start">
|
|
|
- <input name="LotAtt02_end" :value="filterData.LotAtt02_end">
|
|
|
- <input name="descr_c" :value="filterData.descr_c">
|
|
|
- <input name="ALTERNATE_SKU1" :value="filterData.ALTERNATE_SKU1">
|
|
|
- </form>
|
|
|
<div >
|
|
|
<button type="button" @click="pageUp()" :readonly="page>1?false:true" class="btn btn-sm " :class="page>1?'btn-outline-info':''">上一页</button>
|
|
|
<button type="button" @click="pageDown()" :readonly="page<maxPage?false:true" class="btn btn-sm m-3" :class="page<maxPage?'btn-outline-info':''">下一页</button>
|
|
|
@@ -156,43 +67,52 @@
|
|
|
@endsection
|
|
|
|
|
|
@section('lastScript')
|
|
|
+ <script type="text/javascript" src="{{asset('js/queryForm/export.js')}}"></script>
|
|
|
+ <script type="text/javascript" src="{{asset('js/queryForm/queryForm200803a.js')}}"></script>
|
|
|
<script>
|
|
|
new Vue({
|
|
|
el:"#list",
|
|
|
data:{
|
|
|
oracleActTransactingLogs:{!! $oracleActTransactingLogs !!},
|
|
|
page:Number('{{$page}}'),
|
|
|
- filterData:{date_start:'',date_end:'',SKU:'',paginate:"50",TOLocation:'',range:'1',
|
|
|
- LotAtt05:'',LotAtt02_start:'',LotAtt02_end:'',descr_c:'',ALTERNATE_SKU1:'',export:''},
|
|
|
owners:[
|
|
|
@foreach($owners as $owner)
|
|
|
- {!! $owner !!},
|
|
|
+ {name:'{{$owner->descr_c}}',value:'{{$owner->descr_c}}'},
|
|
|
@endforeach
|
|
|
],
|
|
|
checkData:[],
|
|
|
maxPage:1,
|
|
|
- sum:0
|
|
|
+ sum:0,
|
|
|
+ date:[{name:'1',value:'近一天'},{name:'3',value:'近三天'},{name:'7',value:'近一周'},{name:'30',value:'近一月'},],
|
|
|
},
|
|
|
mounted:function () {
|
|
|
$(".tooltipTarget").tooltip({'trigger':'hover'});
|
|
|
- this.initInputs();
|
|
|
$("#list").removeClass('d-none');
|
|
|
if (this.oracleActTransactingLogs.length>0){
|
|
|
this.maxPage=Math.ceil(this.oracleActTransactingLogs[0].sum/50);
|
|
|
this.sum=this.oracleActTransactingLogs[0].sum;
|
|
|
}
|
|
|
- },
|
|
|
- computed:{
|
|
|
- isBeingFilterConditions:function(){
|
|
|
-
|
|
|
- for(let key in this.filterData){
|
|
|
- if(this.filterData[key] && key!='paginate'){
|
|
|
- return true
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- },
|
|
|
-
|
|
|
+ let data=[
|
|
|
+ [
|
|
|
+ {name:['date_start','range'],type:'dataTime_select',tip:['选择创建日期的起始时间','查询内容的日期范围'],placeholder:['','查询内容的日期范围'],data: this.date},
|
|
|
+ {name:'TOLocation',type:'input',tip:'库位:糊模查找需要在左边打上%符号',placeholder: '库位'},
|
|
|
+ {name:'LotAtt05',type:'input',tip:'属性仓:糊模查找需要在左边打上%符号',placeholder: '属性仓'},
|
|
|
+ {name:'LotAtt02_start',type:'dataTime',tip:'选择显示失效日期的起始时间'},
|
|
|
+ {name:'descr_c',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的客户'],
|
|
|
+ placeholder:['货主','定位或多选货主'],data:this.owners},
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ {name:'date_end',type:'dataTime',tip:'选择创建日期的结束时间'},
|
|
|
+ {name:'SKU',type:'input',tip:'产品编码:糊模查找需要在左边打上%符号',placeholder: '产品编码'},
|
|
|
+ {name:'ALTERNATE_SKU1',type:'input',tip:'产品条码:糊模查找需要在左边打上%符号',placeholder: '产品条码'},
|
|
|
+ {name:'LotAtt02_end',type:'dataTime',tip:'选择显示失效日期的结束时间'},
|
|
|
+ ],
|
|
|
+ ];
|
|
|
+ this.form = new query({
|
|
|
+ el:'#form_div',
|
|
|
+ condition:data
|
|
|
+ });
|
|
|
+ this.form.init();
|
|
|
},
|
|
|
watch:{
|
|
|
checkData:{
|
|
|
@@ -207,59 +127,32 @@
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
- initInputs:function(){
|
|
|
- let data=this;
|
|
|
- let uriParts =decodeURI(location.href).split("?");
|
|
|
- if(uriParts.length>1){
|
|
|
- let params = uriParts[1].split('&');
|
|
|
- params.forEach(function(paramPair){
|
|
|
- let pair=paramPair.split('=');
|
|
|
- let key = pair[0], val = pair[1];
|
|
|
- $('input[name="'+key+'"]').val(val);
|
|
|
- $('select[name="'+key+'"]').val(val);
|
|
|
- decodeURI(data.filterData[key]=val);
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
pageUp(){
|
|
|
if (this.page<=1)return;
|
|
|
- this.page=this.page-1;
|
|
|
- this.href();
|
|
|
+ this.href(this.page-1);
|
|
|
},
|
|
|
pageDown(){
|
|
|
if (this.page>=this.maxPage)return;
|
|
|
- this.page=this.page+1;
|
|
|
- this.href();
|
|
|
+ this.href(this.page+1);
|
|
|
},
|
|
|
pageSkip(e){
|
|
|
- if (Number(e.target.value)<=0 || Number(e.target.value)>this.maxPage){
|
|
|
- tempTip.setDuration(2000);
|
|
|
- tempTip.show('页数不存在! ');
|
|
|
- return
|
|
|
- }
|
|
|
- this.page=e.target.value;
|
|
|
- this.href();
|
|
|
+ if (Number(e.target.value)<=0 || Number(e.target.value)>this.maxPage){
|
|
|
+ tempTip.setDuration(2000);
|
|
|
+ tempTip.show('页数不存在! ');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.href(e.target.value);
|
|
|
},
|
|
|
- href(){
|
|
|
- let url="{{url('inventory/statement/changeInventory?page=')}}"+this.page;
|
|
|
- if (this.filterData.date_start)url+="&&date_start="+this.filterData.date_start;
|
|
|
- if (this.filterData.date_end)url+="&&date_end="+this.filterData.date_end;
|
|
|
- if (this.filterData.SKU)url+="&&SKU="+this.filterData.SKU;
|
|
|
- if (this.filterData.paginate)url+="&&paginate="+this.filterData.paginate;
|
|
|
- if (this.filterData.TOLocation)url+="&&TOLocation="+this.filterData.TOLocation;
|
|
|
- if (this.filterData.LotAtt05)url+="&&LotAtt05="+this.filterData.LotAtt05;
|
|
|
- if (this.filterData.LotAtt02_start)url+="&&LotAtt02_start="+this.filterData.LotAtt02_start;
|
|
|
- if (this.filterData.LotAtt02_end)url+="&&LotAtt02_end="+this.filterData.LotAtt02_end;
|
|
|
- if (this.filterData.ALTERNATE_SKU1)url+="&&ALTERNATE_SKU1="+this.filterData.ALTERNATE_SKU1;
|
|
|
- if (this.filterData.descr_c)url+="&&descr_c="+this.filterData.descr_c;
|
|
|
- if (this.filterData.range)url+="&&range="+this.filterData.range;
|
|
|
+ href(page){
|
|
|
+ let url = document.URL;
|
|
|
+ if (url.indexOf('page='+this.page) != -1){
|
|
|
+ url = url.replace("page="+this.page,"page="+page);
|
|
|
+ }else{
|
|
|
+ if (url.indexOf('?') == -1) url += "?page="+page;
|
|
|
+ else url += "&page="+page;
|
|
|
+ }
|
|
|
window.location.href=url;
|
|
|
},
|
|
|
- //提交表单
|
|
|
- submit:function(){
|
|
|
- let form = $("#form");
|
|
|
- form.submit();
|
|
|
- },
|
|
|
//全选事件
|
|
|
checkAll(e){
|
|
|
if (e.target.checked){
|
|
|
@@ -272,28 +165,11 @@
|
|
|
this.checkData = [];
|
|
|
}
|
|
|
},
|
|
|
- //寻找客户
|
|
|
- owner_seek:function (e) {
|
|
|
- let _this=this;
|
|
|
- let $val=e.target.value;
|
|
|
- if($val==='')_this.filterData.descr_c='';
|
|
|
- else
|
|
|
- _this.owners.forEach(function (owner) {
|
|
|
- if (owner.descr_c.includes($val)){
|
|
|
- _this.filterData.descr_c=owner.descr_c;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- processExport:function(value){
|
|
|
- if (value==1&&this.checkData.length <= 0) {
|
|
|
- tempTip.setDuration(2000);
|
|
|
- tempTip.showSuccess('没有勾选任何记录');
|
|
|
- return
|
|
|
- }
|
|
|
- this.filterData.export=value;
|
|
|
- setTimeout(function () {
|
|
|
- $("#checkDataForm").submit();
|
|
|
- },1);
|
|
|
+ processExport(checkAllSign){
|
|
|
+ let url = '{{url('inventory/statement/changeInventory/export')}}';
|
|
|
+ let token='{{ csrf_token() }}';
|
|
|
+ let data= JSON.stringify( this.checkData );
|
|
|
+ excelExport(checkAllSign,data,url,this.sum,token);
|
|
|
},
|
|
|
},
|
|
|
filters:{
|