mirror of
https://gitee.com/ShopeX/OMS
synced 2026-03-31 05:25:32 +08:00
131 lines
6.1 KiB
HTML
131 lines
6.1 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.
|
|
-->
|
|
|
|
<{capture name="header"}>
|
|
<{css app='omeauto' src="style.css"}>
|
|
<{/capture}>
|
|
<style>
|
|
#content div a {color: blue; font-size: 14px; }
|
|
#content div span {float: right;}
|
|
#content ul li {height:25px; background: #EEEEEE; margin: 1px; padding-left: 10px; padding-top: 8px;}
|
|
#content ul li span {float:right; margin-right: 10px;}
|
|
#content ul li span a {color:blue; text-decoration: underline;}
|
|
#content ul li div {width:450px; overflow: hidden; height: 16px; float:left;}
|
|
</style>
|
|
<div class="tableform">
|
|
<div class="division">
|
|
<form action="" method="post" id="orderTypeFrm">
|
|
<table width="100%" cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr>
|
|
<th width="60"><label for="dom_el_bc">规则名称:</label> </th>
|
|
<td ><{input type="text&&required" name="name" id='t_name' value=$info.name}> (请使用通俗易懂的名称,如 批发订单、小额订单【100以下】、华东区订单)</td>
|
|
</tr>
|
|
<tr>
|
|
<th width="60"><label for="dom_el_bc">简单说明:</label> </th>
|
|
<td><{input type="textarea" cols="100" rows="4" name="memo" id='t_memo' value=$info.memo}><br/>(对此订单类型的简单描述)</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2"><hr/></td>
|
|
</tr>
|
|
<tr>
|
|
<th width="60"><label for="dom_el_bc">归类规则:</label> </th>
|
|
<td id="content">
|
|
<div><a href="javascript:void(0);" onclick="new Dialog('index.php?ctl=order_type&act=addrole&app=omeauto',{width:720,height:420,title:'规则设定'}); ">增加规则</a> <span></span></div>
|
|
<ul id="roleList">
|
|
<{ foreach from=$info.config item=role key=uid}>
|
|
<li id="m_item_<{$uid}>"><div title="<{$role.attr.caption}>"><{$role.attr.caption}> </div><span><a ref='<{$role.json}>' class="edit" href="javascript:void(0);">编辑</a> <a class="del" href="javascript:void(0);">删除</a></span></li>
|
|
<{ /foreach }>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2" height='5'>
|
|
<hr/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th width="60"><label for="dom_el_bc">权重:</label> </th>
|
|
<td><{input type="number&&required" size="5" name="weight" id='weight' value=$info.weight}></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2" align="center">
|
|
<{button class="btn-primary" label="确定" type="button" id="msaveBtn"}>
|
|
<{button class="btn-primary" label="取消" type="button" id="mcancelBtn"}>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
(function() {
|
|
//关闭按钮
|
|
$('mcancelBtn').addEvent('click', function(){
|
|
$('mcancelBtn').getParent('.dialog').retrieve('instance').close();
|
|
});
|
|
//规则事件
|
|
$$('#roleList .del').addEvent("click",function(){
|
|
if (confirm("你确定要删除当前指定规则吗?")) {
|
|
this.getParent().getParent().destroy();
|
|
}
|
|
});
|
|
$$('#roleList .edit').addEvent("click",function(){
|
|
var role = this.get('ref');
|
|
var uid = this.getParent().getParent().id;
|
|
new Dialog('index.php?ctl=order_type&act=addrole&app=omeauto&role=' + role + '&uid=' + uid,{width:720,height:420,title:'规则设定'});
|
|
});
|
|
//保存按钮
|
|
$('msaveBtn').addEvent('click', function(){
|
|
|
|
var roles = '';
|
|
$$('#roleList li').each(function(item) {
|
|
if (roles == '') {
|
|
roles = item.getElement('.edit').get('ref');
|
|
} else {
|
|
roles = roles + "|||" + item.getElement('.edit').get('ref') ;
|
|
}
|
|
});
|
|
new Request ({
|
|
url:'index.php?app=taoexlib&ctl=admin_sms_rule&act=save&tid=<{$info.tid}>',
|
|
method:'post',
|
|
data:{'name':$('t_name').value,'memo':$('t_memo').value,'weight':$('weight').value, 'roles':roles,'group_type':'sms'},
|
|
onRequest: function () {
|
|
$('msaveBtn').set('disabled', 'true');
|
|
$('mcancelBtn').set('disabled', 'true');
|
|
},
|
|
onSuccess: function(result) {
|
|
if (result =='SUCC') {
|
|
finderGroup["<{$env.get.finder_id}>"].refresh.delay(400,finderGroup["<{$env.get.finder_id}>"]);
|
|
$('msaveBtn').getParent('.dialog').retrieve('instance').close();
|
|
} else {
|
|
$('msaveBtn').set('disabled', '');
|
|
$('mcancelBtn').set('disabled', '');
|
|
//提示信息
|
|
alert(result);
|
|
}
|
|
}
|
|
}).send();
|
|
});
|
|
})();
|
|
uniqueID = (function () {
|
|
var id = 0;
|
|
return function () {
|
|
return id++;
|
|
};
|
|
})();
|
|
</script> |