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

125 lines
4.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.
-->
<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>