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

114 lines
3.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="division" id='support-shops'>
<span style="padding-bottom:8px;"><font style="font-size:14px;font-weight:bold">物流公司优先规则设置</font>&nbsp;&nbsp; <a href="https://top.shopex.cn/ecos/tpl/tghelp.zip" target="_blank">帮助手册</a><br><br></span>
<div style="padding-left:18px;"><h4>注意:必须先在<a href="index.php?app=ome&ctl=admin_branch&act=index">"仓库管理"</a>内建立仓库与物流公司的关系</h4></div>
<form method='post' action='index.php?app=logistics&ctl=admin_branch_rule&act=saveBranchRule'>
<div class="tableform">
<h4><{t}>第一步:选择仓库<{/t}>(只支持发货仓库)</h4>
<div class="division">
<table width="100%" border="0">
<tr>
<td>
<div style='width:600px;'>
<{foreach from=$branch_list item=item }>
<div class='span-auto'>
<input type='radio' name='branch_id' value='<{$item.branch_id}>' class='branch_id'><{$item.name}>
</div>
<{/foreach}></div></td>
</tr>
</table>
</div>
<h4><{t}>第二步:选择规则类型(注:切换规则类型将删除上次设置的规则)<{/t}></h4>
<div class="division">
<table width="100%" border="0">
<tr>
<td><{help}>系统将自动开启上一次设置的规则<{/help}><input type="radio" class='set_rule' name="set_rule" value="custom"> 自定义规则
<{help}>父级仓库规则一旦发生改动,子级仓库规则同步改动<{/help}>
<input type="radio" class='set_rule' name="set_rule" value="other">复用其他仓库规则</td>
</tr>
</table>
<div class="table-action">
<{button label="确定" type="button" id='btn-primary'}>
</div>
</div>
</form>
<style>
.span-auto{
width:120px;
padding:5px;
}
</style>
<script>
$('btn-primary').addEvent('click',function(e){
var _form = this.form;
if (_form.getElements("input[name='branch_id']:checked").length <=0)
{
MessageBox.error('请选择仓库');return false;
}
_form.fireEvent('submit',e);
});
$$('.branch_id').addEvent('click',function(e){
var branch_id = this.value;
new Request({url:'index.php?app=logistics&ctl=admin_rule&act=getBranchRule&branch_id='+branch_id,
onRequest:function(){
},
onComplete:function(rs){
if(rs){
rs = JSON.decode(rs);
if(rs.type=='custom'){
$$('.set_rule').each(function(i,index){
if(i.value=='custom'){
i.set('checked','checked');
}
});
}
if(rs.type=='other'){
$$('.set_rule').each(function(i,index){
if(i.value=='other'){
i.set('checked','checked');
}
});
}
}else{
$$('.set_rule')[0].set('checked','checked');
}
}}).send();
});
$$('.set_rule')[0].set('checked','checked');
$$('.set_rule').addEvent('click',function(e){
var _form = this.form;
var branch_id = $E("input[name='branch_id']:checked").value;
var rule = this.value;
new Request({url:'index.php?app=logistics&ctl=admin_rule&act=getBranchRule&branch_id='+branch_id,
onRequest:function(){
},
onComplete:function(rs){
if(rs){
rs = JSON.decode(rs);
if(rule!=rs.type){
confirm('切换规则,将会自动将之前的规则将会删除,确定吗?');
}
}
}}).send();
});
</script>