Files
OMS/app/logistics/view/admin/regionSelect.html
2026-01-04 19:08:31 +08:00

121 lines
3.3 KiB
HTML

<!--
Copyright 2012-2026 ShopeX (https://www.shopex.cn)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<{capture name="header"}>
<style>
.region{
font-weight:bold;font-size:14px;padding-right:6px;
}
.shop-name{
color:red;font-weight:bold;
}
.area-name{
font-weight:bold;font-size:14px;
}
.node{
padding:8px;width:300px;
}
li {
padding:4px;
}
</style>
<{/capture}>
<p></p>
<div class="division">
<input type='hidden' id='sequence'/>
<table width="100%" border="0" style="border: 1px solid #cccccc; ">
<{foreach from=$area item=area}>
<tr style="border: 1px solid #cccccc; "><td style="border: 1px solid #cccccc; "><span class="region"><{$area.local_name}></span></th><td style="border: 1px solid #cccccc; " align=center><input type="checkbox" onclick="showAll(this,<{$area.area_id}>)">全选</td><td style="border: 1px solid #cccccc; ">
<div style="padding-bottom:4px;width:450px;">
<ul>
<span id='area_region<{$area.area_id}>'><{foreach from=$area.area_items item=area_items}><li style="width:80px;float:left;"> <span class='node'><input class="item<{$area.area_id}>" type="checkbox" name="region" value='<{$area_items.region_id}>' <{if $area_items.flag=='1'}>disabled<{/if}> onclick="javascript:if(this.checked){this.getNext('span').addClass('shop-name');}else{this.getNext('span').removeClass('shop-name');}">
<span class='node-name'><{$area_items.local_name}></span></span>
<{/foreach}></span>
</ul></div></td></tr>
<{/foreach}>
</table>
<div class="table-action">
<{button id="dlg_ok" class="btn btn-primary" label=$___eccommon="确定"|t:'eccommon'}>
<{button id="dlg_cancel-{$sid}" class="btn btn-secondary" label=$___eccommon="取消"|t:'eccommon' onclick="window.close();"}>
</div>
</div>
<script>
void function(){
if(!window.modedialogInstance)return;
var modedialog=window.modedialogInstance.options.params;
var _inputText=modedialog.iptText;
var _inputHidden=modedialog.iptHidden;
var _inputHiddenValue=_inputHidden.value.split(',');
$('dlg_ok').addEvent('click',function(){
var nodes=$$('.node').filter(function(n){
return n.getElement('input[type=checkbox]').checked;
});
var iddates=[];
var namedates=[];
nodes.each(function(node){
var v = node.getElement('input[type=checkbox]').getValue();
var text = node.getElement('.node-name').get('text');
iddates.push(v);
namedates.push(text);
});
_inputText.set('value',namedates.join(','));
_inputHidden.set('value',iddates.join(','));
window.close();
});
}();
function showAll(area,area_id){
if(area.checked==true){
$$('.item'+area_id).each(function(i,index){
if(!i.get('disabled')){
i.set('checked',true);
i.getNext('span').addClass('shop-name');
}
});
}else{
$$('.item'+area_id).each(function(i,index){
i.set('checked',false);
i.getNext('span').removeClass('shop-name');
});
}
}
</script>