Files
OMS/app/o2o/view/admin/autostore/createRule.html
2026-01-04 19:08:31 +08:00

101 lines
3.7 KiB
HTML
Raw Permalink 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 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>
.gridlist tbody td.area_btns{padding-top:5px;}
</style>
<div class="tableform">
<h3>新建规则<span style="color:red;"><{$store_info.name}></span></h3>
<form method="POST" id='area_form' action="index.php?app=o2o&ctl=admin_autostore&act=doAddRule">
<div class="division">
<table border="0" cellpadding="0" cellspacing="0" class="girdlist">
<tr >
<th ><span style='color:red'>*</span>规则名称:</th>
<td>
<{input type="text" name="rule_name" id="rule_name" vtype="required"}><span id='chkrule_name' style='color:red'></span>
</td>
</tr>
<tr >
<th ><span style='color:red'>*</span>规则类型:</th>
<td>
<{foreach from=$rule_types item=item}>
<input type="radio" name="rule_type" class="rule_type" value="<{$item.type}>"><{$item.name}>
<{/foreach}>
</td>
</tr>
</table>
</div>
<div id="rule_content">
</div>
<div class="table-action">
<{button type="button" label="保存" id="create_rule_save" }>
&nbsp; <{button label="关闭" id="create_rule_cancle" class="btn btn-secondary" onclick="javascript:void(window.close());"}>
</div>
<input type="hidden" name="branch_id" value="<{$branch_id}>">
</form>
</div>
<script>
$ES('.rule_type').each(function(item){
item.addEvent('click',function(e){
new Request.HTML({
url:"index.php?app=o2o&ctl=admin_autostore&act=getTmplByType",
data:'type='+this.value,
method:'post',
update:'rule_content',
}).send();
})
});
$ES('.rule_type')[0].checked = true;
$ES('.rule_type')[0].fireEvent('click');
$('create_rule_save').addEvent('click',function(e){
var _this=this;
var form=this.getParent('form');
form.store('target',{
onRequest:function(){
_this.disabled=true;
},
onComplete:function(jsontext){
try{
var json = JSON.decode(jsontext);
if (typeof(json.error)!='undefined'){
_this.disabled=false;
}else{
_this.disabled=true;
//规则已设置标识
rule_org_obj = window.opener.document.getElementById('rule_org_id_<{$org_id}>');
if(rule_org_obj)
{
rule_org_obj.innerHTML = '已启用';
}
if(opener.finderGroup['<{$env.get.finder_id}>']) opener.finderGroup['<{$env.get.finder_id}>'].refresh.delay(100,opener.finderGroup['<{$env.get.finder_id}>']);
setTimeout('window.close()',200);
}
}catch(e){}
}
});
form.fireEvent('submit',e);
});
</script>