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.

189 lines
5.5 KiB

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<%@include file="/wdk/theme/je/module/public/common.jsp"%>
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
<%
String menu_code = request.getParameter("menucode");
WDK.writeButton(out, su, menu_code);
%>
<title>新增角色</title>
<style>
.necessary {
color: red;
}
</style>
</head>
<body class="easyui-layout win" data-options="fit:true">
<div data-options="region:'north',border:false,collapsed:false" class="page-title" style="overflow:hidden">
<div class="page-toolbar">
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-save'" id="btn_submit">保存</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-close'" id="cancel">取消</a>
<span style="display: inline-block;"></span>
</div>
</div>
<div data-options="region:'center',border:false,collapsed:false">
<div class="edit-container-win1">
<form id="ss_form">
<div class="row">
<div class="formgroup col-12">
<label class="required">编码</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" id="role_code" name="role_code" value="" data-options="required:true,validType:['length[1,50]'],tipPosition:'bottom'"/>
</div>
</div>
</div>
<div class="row">
<div class="formgroup col-12">
<label class="required">名称</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" id="role_name" name="role_name" value="" data-options="required:true,validType:['length[1,50]'],tipPosition:'bottom'"/>
</div>
</div>
</div>
<div class="row">
<div class="formgroup col-12">
<label class="required">显示顺序</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" id="display_order" name="display_order" value="" data-options="required:true,validType:['isInteger','length[0,4]'],tipPosition:'bottom'"/>
</div>
</div>
</div>
<div class="row" style="height:50px;">
<div class="formgroup col-12">
<label>描述</label>
<div>
<textarea class="easyui-validatebox" id="remark" name="remark" data-options="validType:['length[0,100]'],tipPosition:'bottom'"></textarea>
</div>
</div>
</div>
<input type="hidden" name="app_uuid" id="app_uuid">
<input type="hidden" name="manage_unit_uuid" id="manage_unit_uuid">
</form>
</div>
</div>
</body>
<script>
var param = $.getURLParam('param');
var jparam = $.str2json($.urlparam_decode(param));
var _actionflag = jparam.queryParams.actionflag; //操作类型 add-新增 update-修改,读取原信息 view-查看
var _app_uuid = jparam.queryParams.app_uuid;
var _selected_id = jparam.queryParams.selected_id;
var wid = $.getURLParam("wid");
var _account_id = $.getSessionUser().account_id;
$(function() {
$("[name='app_uuid']").val(_app_uuid);
if(_actionflag === 'view') {
$("#btn_submit").remove();
$("#cancel").linkbutton({
iconCls: 'fa fa-check',
text: '确定'
});
$("form").find("[name]").each(function() {
$(this).prop("readonly", true);
});
}
if(_actionflag === 'update' || _actionflag === 'view'){
$.wait_open();
var _data = new Object();
_data.op_acc = _account_id;
_data.role_uuid = _selected_id;
var dataParam = {
_SRVNAME: 'service.usr.role'
,_SRVMETHOD: 'queryRoleInfoById'
,_DATA: $.json2str(_data)
};
//通过界面直接调用服务
$.cuajax({
url:'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime(),
method:"post",
timeout:WDK_Timeout,
data:dataParam,
success:function(result) {
$.wait_close();
//返回值字符串转json
var jres = $.str2json(result);
if(jres.code=="1"){ //查询成功
$.setFieldValue(jres.result, "form");
}else{
alert(jres.desc);
}
},
error:function(result){
$.wait_close();
alert('网络错误!result='+result);
}
});
}
//提交
$("#btn_submit").on("click", function(e){
e.preventDefault();
var isValid = $('#ss_form').form('validate');
if (!isValid){
return;
}
$.wait_open();
var jfield = $.getFieldValue();
var _method = "create";
if(_actionflag === 'update'){
_method = "change";
jfield.role_uuid = _selected_id;
}
jfield.role_type_scode = '04';
var _data = {
op_account_uuid:_account_id
,roleinfo:jfield
};
var dataParam = {
_SRVNAME:'service.usr.role'
,_SRVMETHOD:_method
,_DATA:$.json2str(_data)
};
//通过界面直接调用服务
$.cuajax({
url:'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime(),
method:"post",
timeout:WDK_Timeout,
data:dataParam,
success:function(result) {
$.wait_close();
//返回值字符串转json
var jres = $.str2json(result);
if(jres.code=="1"){ //操作成功
closewin(jres.code);
}else{
alert(jres.desc);
}
},
error:function(result){
$.wait_close();
alert('网络错误!result='+result);
}
});
});
$('#cancel').on("click", function(e){
closewin();
});
// 关闭模态框
function closewin(){
$.closeWin(wid);
}
});
</script>
</html>