Files
OMS/app/omeanalysts/view/logistics/search.html
2025-12-28 23:13:25 +08:00

84 lines
2.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--
Copyright © ShopeX http://www.shopex.cn. All rights reserved.
See LICENSE file for license details.
-->
<div class="title_right" id="dataAction">
<form action="<{$form_action}>" method="post" id="filter_form">
<{if $timeFilter != 'false'}>
<div class="date_date_cx">
<{input type="date" vtype="date" name="time_from" style="width:76px; font-family:arial;" value=$time_from}>
<span></span>
<{input type="date" vtype="date" name="time_to" style="width:76px; font-family:arial;" value=$time_to}>
<{button class="filterBtn btn-thirdly" label="查询"}>
</div>
<{/if}>
<div class="date_date_cx">
<select name="branch_id" id="ext_select_type">
<option value="" selected="selected">所有仓库</option>
<{foreach from=$branch_list key=key item=item}>
<option value="<{$item.branch_id}>" <{if $branch_id == $item.branch_id}>selected="selected"<{/if}>><{$item.name}></option>
<{/foreach}>
</select>
</div>
</form>
</div>
<script>
(function(){
var dataAction= $('dataAction'),
from=dataAction.getElement('input[name=time_from]'),
to=dataAction.getElement('input[name=time_to]');
function setChartData(flag,e){
if(from && to){
if(!check_data(from,to))return;
}
$('filter_form').fireEvent('submit',{stop:$empty});
}
if($('ext_select_type')) $('ext_select_type').addEvent('change',function(e){setChartData(true);});
dataAction.getElement('.filterBtn').addEvent('click',function(e){setChartData(true);});
function check_data(from,to){
var data=[],
_return=[from,to].every(function(el){
if(!/^(19|20)[0-9]{2}-([1-9]|0[1-9]|1[012])-([1-9]|0[1-9]|[12][0-9]|3[01])+$/.test(el.value)){
new MessageBox('<{t}>请录入日期格式yyyy-mm-dd<{/t}>',{type:'error',autohide:true});
el.focus();
return false;
}
data.push(Date.parse(el.value.replace(/-/gi,"/")));
return true;
});
if(!_return)return null;
if(data[1]<data[0]){
return MessageBox.error('<{t}>选择开始时间必须早于结束时间<{/t}>');
}
return _return;
}
var dataBtn=dataAction.getElements('.dataBtn');
dataBtn.each(function(el,i){
if(el.get('time_from')==from.value && el.get('time_to')==to.value)
el.addClass('btn-fourthly-cur');
el.addEvent('click',function(e){
from.value=this.get('time_from');
to.value=this.get('time_to');
/* ['time_from','time_to'].each(function(v){
* dataAction.getElements('input[name='+v+']').value=this.get(v);
* },this); */
dataAction.getElement('.filterBtn').fireEvent('click');
});
});
})();
</script>