Files
OMS/app/logisticsmanager/view/admin/warehouse/regionSelect1.html
2026-01-04 19:08:31 +08:00

97 lines
2.8 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.
-->
<style>
#con_m_list li {width:90px; overflow: hidden; float: left; margin-bottom: 10px; font-size: 12px; line-height: 20px;}
.current-set {color: red; font-weight: 700;}
</style>
<input type='hidden' id='sequence'/>
<div id='region-treelist-<{$sid}>-loading'></div>
<div id='region-treelist-<{$sid}>' class='x-tree-list'></div>
<div id="region-treelist" class="x-tree-list" style="padding-left:10px;width:600px;">
<{input type="checkbox" name="checkAll" id="checkAll"}>全选
<ul id='con_m_list'>
<{foreach from=$regionlist item=region}>
<li>
<span class="node">
<span class="node-handle" pid="0" nid="<{$region.region_id}>" hasc="0"> </span>
<span class="node-line"> </span>
<input type="checkbox" name="region" value="<{$region.region_id}>" pid="0" <{if in_array($region.region_id , $region_ids,true) }>checked<{/if}>>
<span class=""> </span>
<span class="node-names "><{$region.local_name}></span>
</span>
</li>
<{/foreach}>
</ul>
</div>
<div class="table-action">
<{button id="dlg_ok" class="btn btn-primary" label=$___eccommon="确定"|t:'eccommon'}>
<{button id="dlg_cancel" class="btn btn-secondary" label=$___eccommon="取消"|t:'eccommon'}>
</div>
<script>
var sequence=$('sequence');
var sequence_dialog=sequence.getParent('div');
$('dlg_ok').addEvent('click',function(){
var nodes=sequence_dialog.getElements('.node').filter(function(n){
return n.getElement('input[type=checkbox]').checked;
});
var IDdatas=[];
var Namedatas=[];
nodes.each(function(node){
var v = node.getElement('input[type=checkbox]').getValue();
IDdatas.push(v);
var text = node.getElement('.node-names').get('text');
Namedatas.push(text);
});
$('p_region_id').set('value',IDdatas.join(','));
$('p_region_name').set('value',Namedatas.join(','));
$('dlg_ok').getParent('.dialog').retrieve('instance').close();
});
$('dlg_cancel').addEvent('click',function(e){
$('dlg_cancel').getParent('.dialog').retrieve('instance').close();
});
$('checkAll').addEvent('click',function(e){
if (this.checked==true)
{
sequence_dialog.getElements('input[name=region]').each(function(i,index){
i.set('checked',true);
});
}else{
sequence_dialog.getElements('input[name=region]').each(function(i,index){
i.set('checked',false);
});
}
});
</script>