Files
OMS/app/omeauto/view/autobranch/setBind.html
2025-12-28 23:13:25 +08:00

144 lines
7.5 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.
-->
<{capture name="header"}>
<{css app='omeauto' src="style.css"}>
<{/capture}>
<style>
#content_tbl .role_content ul {width:600px; overflow: hidden; margin-bottom: 0px; font-size: 12px;}
#content_tbl .role_content ul li {float:left}
#content_tbl .role_content ul li .main { width:300px;}
#content_tbl .role_content ul li .default { width:200px;}
#content_tbl .role_content ul li .weight { width:100px;}
#content_tbl .role_content ul li span {cursor: pointer;float:left}
#content_tbl .role_content ul li input {cursor: pointer;}
#content_tbl .title {height: 20px; margin-bottom: 0px; font-size: 12px; font-weight: 700;}
#content_tbl .role_content {margin-top: 6px; height : auto ; padding: 8px;}
#content_tbl .title span {height: 20px; margin-bottom: 5px; margin-left: 20px; color: #999999;}
#content_li ul li .main{width:300px; overflow: hidden; float: left; margin-bottom: 10px; font-size: 12px; line-height: 20px;}
#content_li ul li .default{width:200px; overflow: hidden; float: left; margin-bottom: 10px; font-size: 12px; line-height: 20px;}
#content_li ul li .weight{width:100px; overflow: hidden; float: left; margin-bottom: 10px; font-size: 12px; line-height: 20px;}
.current-set {color: red; font-weight: 700; cursor: pointer;}
.current-disabled , .current-disabled span {color: #DDDDDD; font-weight: 700; cursor:auto;}
</style>
<form action="index.php?app=omeauto&ctl=autobranchset&act=save" method="post">
<div class="tableform">
<div class="division">
<table width="100%" cellspacing="0" cellpadding="0" id="content_tbl">
<tbody>
<tr>
<th>获取仓库:</th>
<td colspan="3" class="role_content">
<div class="title"><span>(权重:数值越大表示优先级越高)</span></div>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td>
<input type="checkbox" name="classify[]" value="router" <{if $classify.router}>checked<{/if}>/>
就近优先
</td>
<td>权重:<{input type="text" size='2' name="router[weight]" value=$classify.router.weight}></td>
</tr>
<tr>
<td>
<input type="checkbox" name="classify[]" value="cost" <{if $classify.cost}>checked<{/if}>/>
成本优先
</td>
<td>权重:<{input type="text" size='2' name="cost[weight]" value=$classify.cost.weight}></td>
</tr>
</table>
</td>
</tr>
<tr>
<th>设置仓库:</th>
<td colspan="3">
<div class="title">为此规则选择仓库<span>(设置后将会作为审单时发货。权重:数值越大表示优先级越高)</span></div>
<div class="role_content" id='content_li'>
<{foreach from=$branchList item=item}>
<ul >
<li class='main' style="width:200px;margin-bottom: 10px; font-size: 12px; line-height: 20px;">
<label for="bindBranch_<{$item.branch_id}>">&nbsp;&nbsp;<span title="<{$item.name}>"><input type="checkbox" name="bind_conf[]" value="<{$item.branch_id}>" id="bindBranch_<{$item.branch_id}>" <{if $item.checked=='1'}>checked<{/if}>/><{$item.name}></span></label></li>
<li class='default' style="width:120px;margin-bottom: 10px; font-size: 12px; line-height: 20px;"><span class="title">是否默认:</span><input type="radio" name="is_default[]" value='<{$item.branch_id}>' <{if $order_type.bid==$item.branch_id}>checked<{/if}>></li>
<li class='weight' style="width:100px;margin-bottom: 10px; font-size: 12px; line-height: 20px;">
<span class="title">权重:</span><input type="text" name="weight[<{$item.branch_id}>]" size='2' value="<{$item.auto_weight|default:0}>"></li>
</ul>
<{/foreach}>
</div>
</td>
</tr>
</tbody>
</table>
<input type="hidden" name="tid" value='<{$order_type.tid}>'>
</div>
</div>
<div class="table-action">
<{button class="btn-primary" label="保存" type="button" id="saveCurrent"}>
<{button class="btn-primary" label="取消" type="button" id="cancelBtn"}>
</div>
</form>
<script>
(function(){
$('saveCurrent').getParents('form').removeEvents('submit').addEvent('submit', function(e) {
e.stop();
new Request ({
url:this.action,
onRequest:function(e){
//提交按钮:disabled
$('saveCurrent').set('disabled', 'true');
$('saveCurrent').getElements('span')[1].set('text','正在保存');
},
onComplete:function(result){
if (result != 'SUCC'){
MessageBox.error(result);
//提交按钮:enabled
$('saveCurrent').set('disabled', '');
$('saveCurrent').getElements('span')[1].set('text','保存');
}else{
//提交按钮:disabled
finderGroup["<{$env.get.finder_id}>"].refresh.delay(400,finderGroup["<{$env.get.finder_id}>"]);
$('cancelBtn').getParent('.dialog').retrieve('instance').close();
//setTimeout("window.close()",500);
}
}
})[this.method](this);
});
//保存按钮
$('saveCurrent').addEvent('click', function() {
//检查对应订单类型
var aHasOrder = false;
$$('#content_li input[type=checkbox]').each(function(item){
if (item.checked) {
aHasOrder = true;
}
});
$('saveCurrent').getParents('form').fireEvent('submit', {
stop: function(){
}
});
});
//关闭按钮
$('cancelBtn').addEvent('click', function(){
$('cancelBtn').getParent('.dialog').retrieve('instance').close();
});
//选择订单标红
$$('#content_li input[type=checkbox]').addEvent('click',function(item){
this.blur();
this.getParent()[this.checked?'addClass':'removeClass']('current-set');
});
$$('#content_li input[type=checkbox]').each(function(item){
if (item.get('disabled')) {
item.getParent()['addClass']('current-disabled');
} else {
item.blur();
item.getParent()[item.checked?'addClass':'removeClass']('current-set');
}
});
})();
</script>