You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

80 lines
3.1 KiB

<script type="text/javascript">
//防止回车提交表单
$(function() {
document.onkeydown = function(e){
var ev = document.all ? window.event : e;
if (ev.keyCode==13) {
$("#mark").val("1"); // 标识不能提交表单
}
}
});
function dr_form_check() {
if ($("#dr_name").val() == '') {
dr_form_tips('name', false, '{dr_lang("名称不能为空")}');
return false;
} else {
dr_form_tips('name', true, '&nbsp;');
}
if ($("#mark").val() == 0) {
return true;
} else {
return false;
}
}
</script>
<div class="table-list" style="width:530px;max-height:400px;overflow-x:hidden;overflow-y:auto">
<form action="" method="post" id="myform" name="myform" onsubmit="return dr_form_check()">
<input name="mark" id="mark" type="hidden" value="0">
<table width="100%" class="table_form">
<tr>
<th width="100"><font color="red">*</font>&nbsp;{fc_lang('名称')}: </th>
<td><input class="input-text" type="text" name="data[name]" id="dr_name" value="{$data['name']}" size="20" /><div class="onShow" id="dr_name_tips">{fc_lang('给它一个描述名称')}</div></td>
</tr>
<tr>
<th>&nbsp;{fc_lang('审核流程')}: </th>
<td><font color="gray" style="float: left">{fc_lang('最多添加8个审核流程,即最多审核8次')}</font><a class="add" title="{fc_lang('添加')}" href="javascript:;" onClick="add_verify()" style="background-repeat:no-repeat;padding-left:20px;width:auto"></a></td>
</tr>
<tr>
<th colspan="2" style="border-bottom:none">
<div id="verify_body" style="width:530px; overflow:hidden">
{if !empty($data['verify'])}
{loop $data['verify'] $k $t}
<table width="100%" class="menu-sort">
<tbody>
<tr>
<td width="140">{fc_lang('选择角色组')}({$k}):</td>
<td width="133" align="left">
<select name="data[role][{$k}][]" style="width:150px;height:60px" multiple="multiple">
{loop $role $r}
{if $r.id>1}
<option value="{$r.id}" {if @in_array($r.id, $t)} selected="selected"{/if}>{$r.name}</option>
{/if}
{/loop}
</select></td>
<td align="left"><a class="del" title="{fc_lang('删除')}" href="javascript:;" onClick="remove_verify(this)"></a></td>
</tr>
</tbody>
</table>
{/loop}
{/if}
</div>
</th>
</tr>
</table>
</form>
</div>
<script type="text/javascript">
function add_verify() {
var c=$("#verify_body tr").size();
if (c > 8) {
dr_tips('{fc_lang('最多支持8级审核')}', 3);
return;
}
c++;
var data = '<table width="100%" class="menu-sort ui-sortable"><tbody><tr><td width="140" align="right">{fc_lang('选择角色组')}('+c+'):</td><td width="133" align="left"><select name="data[role]['+c+'][]" style="width:150px;height:60px" multiple="multiple">{$select}</select></td><td align="left"><a class="del" title="{fc_lang('删除')}" href="javascript:;" onClick="remove_verify(this)"></a></td></tr></tbody></table>';
$('#verify_body').append(data);
}
function remove_verify(_this) {
$(_this).parent().parent().parent().remove();
}
</script>