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

97 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=doEditRule">
<input type="hidden" id="rule_id" name="rule_id" value="<{$rule_info.rule_id}>">
<input type="hidden" name="branch_id" value="<{$rule_info.branch_id}>">
<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" value=$rule_info.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}>" <{if $rule_info.rule_type == $item.type}>checked="checked"<{/if}>><{$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>
</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+'&rule_id='+$('rule_id').value,
method:'post',
update:'rule_content',
}).send();
})
});
$ES('.rule_type').each(function(item){
if(item.checked){
item.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;
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>