Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
149f78d7
Commit
149f78d7
authored
Feb 22, 2019
by
乾坤平台
Committed by
季圣华
Feb 22, 2019
Browse files
!29 修改几个弹窗样式
Merge pull request !29 from 乾坤平台/master
parents
bc49df9d
f08a5c08
Changes
8
Hide whitespace changes
Inline
Side-by-side
erp_web/pages/manage/roleApp.html
View file @
149f78d7
<!DOCTYPE html>
<html>
<head>
<title>
角色对应应用
</title>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<script
type=
"text/javascript"
src=
"/js/jquery-1.8.0.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/common.css"
/>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/jquery.easyui.min.js"
></script>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
<body>
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
<div>
<ul
id=
"tt"
></ul>
</div>
<script
type=
"text/javascript"
>
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(角色id)
var
type
=
"
RoleAPP
"
;
var
url
;
//定义链接地址
function
GetNode
(
ctype
)
{
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
cnodes
=
''
;
var
pnodes
=
''
;
var
prevNode
=
''
;
//保存上一步所选父节点
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
{
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
prevNode
=
pnode
.
id
;
//保存当前节点
}
}
}
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
if
(
ctype
==
'
child
'
)
{
return
cnodes
;
}
else
{
return
pnodes
}
;
};
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
url
:
'
/app/findRoleAPP?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
checkbox
:
true
});
$
(
"
#btnOK
"
).
click
(
function
()
{
var
id
=
checkRoleAPP
();
if
(
!
id
)
{
url
=
'
/userBusiness/add
'
;
}
else
{
url
=
'
/userBusiness/update?id=
'
+
id
;
}
if
(
confirm
(
"
您确定要保存吗?
"
))
{
$
.
ajax
({
url
:
url
,
type
:
"
post
"
,
data
:
{
info
:
JSON
.
stringify
({
type
:
type
,
keyid
:
url_id
,
value
:
GetNode
(
'
child
'
)
})
},
dataType
:
"
json
"
,
async
:
false
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
self
.
parent
.
$
.
colorbox
.
close
();
alert
(
"
操作成功!
"
);
}
else
{
alert
(
"
操作失败!
"
);
}
}
});
}
}
);
});
//检查记录是否存在
function
checkRoleAPP
()
{
//表示是否存在 0 = 不存在,存在就返回id
var
flag
=
0
;
//开始ajax名称检验,是否存在
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
dataType
:
"
json
"
,
async
:
false
,
data
:
({
type
:
type
,
keyId
:
url_id
}),
success
:
function
(
res
)
{
if
(
res
.
data
&&
res
.
data
.
id
)
{
flag
=
res
.
data
.
id
;
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
检查角色对应应用是否存在异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
return
flag
;
}
</script>
</body>
<!DOCTYPE html>
<html>
<head>
<title>
角色对应应用
</title>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<script
type=
"text/javascript"
src=
"/js/jquery-1.8.0.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/common.css"
/>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/jquery.easyui.min.js"
></script>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
<body>
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
<div>
<ul
id=
"tt"
></ul>
</div>
<script
type=
"text/javascript"
>
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(角色id)
var
type
=
"
RoleAPP
"
;
var
url
;
//定义链接地址
function
GetNode
(
ctype
)
{
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
cnodes
=
''
;
var
pnodes
=
''
;
var
prevNode
=
''
;
//保存上一步所选父节点
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
{
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
prevNode
=
pnode
.
id
;
//保存当前节点
}
}
}
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
if
(
ctype
==
'
child
'
)
{
return
cnodes
;
}
else
{
return
pnodes
}
;
};
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
url
:
'
/app/findRoleAPP?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
checkbox
:
true
});
$
(
"
#btnOK
"
).
click
(
function
()
{
var
id
=
checkRoleAPP
();
if
(
!
id
)
{
url
=
'
/userBusiness/add
'
;
}
else
{
url
=
'
/userBusiness/update?id=
'
+
id
;
}
$
.
messager
.
confirm
(
"
提示
"
,
"
您确定要保存吗?
"
,
function
(
data
){
$
.
ajax
({
url
:
url
,
type
:
"
post
"
,
data
:
{
info
:
JSON
.
stringify
({
type
:
type
,
keyid
:
url_id
,
value
:
GetNode
(
'
child
'
)
})
},
dataType
:
"
json
"
,
async
:
false
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
self
.
parent
.
$
.
colorbox
.
close
();
$
.
messager
.
alert
(
'
提示
'
,
"
操作成功!
"
,
"
info
"
);
}
else
{
$
.
messager
.
alert
(
'
提示
'
,
"
操作失败!
"
,
"
error
"
);
}
}
});
});
}
);
});
//检查记录是否存在
function
checkRoleAPP
()
{
//表示是否存在 0 = 不存在,存在就返回id
var
flag
=
0
;
//开始ajax名称检验,是否存在
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
dataType
:
"
json
"
,
async
:
false
,
data
:
({
type
:
type
,
keyId
:
url_id
}),
success
:
function
(
res
)
{
if
(
res
.
data
&&
res
.
data
.
id
)
{
flag
=
res
.
data
.
id
;
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
检查角色对应应用是否存在异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
return
flag
;
}
</script>
</body>
</html>
\ No newline at end of file
erp_web/pages/manage/roleFunctions.html
View file @
149f78d7
<!DOCTYPE html>
<html>
<head>
<title>
角色对应应用
</title>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<script
type=
"text/javascript"
src=
"/js/jquery-1.8.0.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/common.css"
/>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/jquery.easyui.min.js"
></script>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
<body>
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
<div>
<ul
id=
"tt"
></ul>
</div>
<script
type=
"text/javascript"
>
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(角色id)
var
type
=
"
RoleFunctions
"
;
var
url
;
//定义链接地址
function
GetNode
(
ctype
)
{
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
cnodes
=
''
;
var
pnodes
=
''
;
var
prevNode
=
''
;
//保存上一步所选父节点
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
{
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
prevNode
=
pnode
.
id
;
//保存当前节点
}
}
}
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
if
(
ctype
==
'
child
'
)
{
return
cnodes
;
}
else
{
return
pnodes
}
;
};
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
url
:
'
/functions/findRoleFunctions?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
checkbox
:
true
});
$
(
"
#btnOK
"
).
click
(
function
()
{
var
id
=
checkRoleFunctions
();
if
(
!
id
)
{
url
=
'
/userBusiness/add
'
;
}
else
{
url
=
'
/userBusiness/update?id=
'
+
id
;
}
if
(
confirm
(
"
您确定要保存吗?
"
))
{
$
.
ajax
({
url
:
url
,
type
:
"
post
"
,
data
:
{
info
:
JSON
.
stringify
({
type
:
type
,
keyid
:
url_id
,
value
:
GetNode
(
'
child
'
)
})
},
dataType
:
"
json
"
,
async
:
false
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
self
.
parent
.
$
.
colorbox
.
close
();
alert
(
"
操作成功!
"
);
}
else
{
alert
(
"
操作失败!
"
);
}
}
});
}
}
);
});
//检查记录是否存在
function
checkRoleFunctions
()
{
//表示是否存在 0 = 不存在,存在就返回id
var
flag
=
0
;
//开始ajax名称检验,是否存在
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
dataType
:
"
json
"
,
async
:
false
,
data
:
({
type
:
type
,
keyId
:
url_id
}),
success
:
function
(
res
)
{
if
(
res
.
data
&&
res
.
data
.
id
)
{
flag
=
res
.
data
.
id
;
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
检查角色对应功能是否存在异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
return
flag
;
}
</script>
</body>
<!DOCTYPE html>
<html>
<head>
<title>
角色对应应用
</title>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<script
type=
"text/javascript"
src=
"/js/jquery-1.8.0.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/common.css"
/>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/jquery.easyui.min.js"
></script>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
<body>
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
<div>
<ul
id=
"tt"
></ul>
</div>
<script
type=
"text/javascript"
>
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(角色id)
var
type
=
"
RoleFunctions
"
;
var
url
;
//定义链接地址
function
GetNode
(
ctype
)
{
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
cnodes
=
''
;
var
pnodes
=
''
;
var
prevNode
=
''
;
//保存上一步所选父节点
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
{
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
prevNode
=
pnode
.
id
;
//保存当前节点
}
}
}
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
if
(
ctype
==
'
child
'
)
{
return
cnodes
;
}
else
{
return
pnodes
}
;
};
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
url
:
'
/functions/findRoleFunctions?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
checkbox
:
true
});
$
(
"
#btnOK
"
).
click
(
function
()
{
var
id
=
checkRoleFunctions
();
if
(
!
id
)
{
url
=
'
/userBusiness/add
'
;
}
else
{
url
=
'
/userBusiness/update?id=
'
+
id
;
}
$
.
messager
.
confirm
(
"
提示
"
,
"
您确定要保存吗?
"
,
function
(
data
){
$
.
ajax
({
url
:
url
,
type
:
"
post
"
,
data
:
{
info
:
JSON
.
stringify
({
type
:
type
,
keyid
:
url_id
,
value
:
GetNode
(
'
child
'
)
})
},
dataType
:
"
json
"
,
async
:
false
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
self
.
parent
.
$
.
colorbox
.
close
();
$
.
messager
.
alert
(
'
提示
'
,
"
操作成功!
"
,
"
info
"
);
}
else
{
$
.
messager
.
alert
(
'
提示
'
,
"
操作失败!
"
,
"
error
"
);
}
}
});
});
}
);
});
//检查记录是否存在
function
checkRoleFunctions
()
{
//表示是否存在 0 = 不存在,存在就返回id
var
flag
=
0
;
//开始ajax名称检验,是否存在
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
dataType
:
"
json
"
,
async
:
false
,
data
:
({
type
:
type
,
keyId
:
url_id
}),
success
:
function
(
res
)
{
if
(
res
.
data
&&
res
.
data
.
id
)
{
flag
=
res
.
data
.
id
;
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
检查角色对应功能是否存在异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
return
flag
;
}
</script>
</body>
</html>
\ No newline at end of file
erp_web/pages/manage/rolePushBtn.html
View file @
149f78d7
<!DOCTYPE html>
<html>
<head>
<title>
角色分配按钮
</title>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<script
type=
"text/javascript"
src=
"/js/jquery-1.8.0.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/common.css"
/>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/jquery.easyui.min.js"
></script>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
<body>
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
<div
id=
"pushList"
>
<!-- 数据显示table -->
<div
id=
"tablePanel"
class=
"easyui-panel"
style=
"padding:1px; top:300px;"
title=
"功能列表-选择按钮权限"
iconCls=
"icon-list"
closable=
"false"
>
<table
id=
"tableData"
style=
"top:300px;border-bottom-color:#FFFFFF"
></table>
</div>
</div>
<script
type=
"text/javascript"
>
var
keyId
=
getUrlParam
(
'
id
'
);
//获取传值id(角色id)
var
pushBtnJSON
;
var
userBusinessId
=
0
;
//关系id
var
roleBtnStr
=
""
;
//角色按钮权限
//初始化界面
$
(
function
()
{
initJSON
();
initTableData
();
ininPager
();
showDetails
(
1
,
initPageSize
);
bindEvent
();
});
//初始化JSON
function
initJSON
()
{
var
url
=
'
/js/pages/manage/pushBtn.json
'
;
$
.
ajax
({
url
:
url
,
type
:
"
get
"
,
async
:
false
,
success
:
function
(
res
)
{
if
(
res
)
{
pushBtnJSON
=
res
;
}
},
error
:
function
()
{
}
});
}
//初始化表格数据
function
initTableData
()
{
$
(
'
#tableData
'
).
datagrid
({
height
:
360
,
rownumbers
:
true
,
//动画效果
animate
:
false
,
//交替出现背景
striped
:
true
,
columns
:
[[
{
field
:
'
Id
'
,
align
:
"
center
"
,
hidden
:
true
},
{
title
:
'
名称
'
,
field
:
'
Name
'
,
width
:
100
},
{
title
:
'
按钮列表
'
,
field
:
'
PushBtnList
'
,
width
:
400
,
formatter
:
function
(
value
,
rec
)
{
var
btnStr
=
rec
.
PushBtn
;
if
(
btnStr
!=
undefined
)
{
var
arr
=
btnStr
.
split
(
"
,
"
);
if
(
arr
.
length
)
{
var
str
=
""
;
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
var
j
=
0
;
j
<
pushBtnJSON
.
length
;
j
++
)
{
if
(
pushBtnJSON
[
j
].
id
===
arr
[
i
]
-
0
)
{
str
+=
"
<input type='checkbox' value='
"
+
pushBtnJSON
[
j
].
id
+
"
' />
"
+
pushBtnJSON
[
j
].
text
;
}
}
}
return
str
;
}
}
else
{
return
""
;
}
}
}
]],
onLoadError
:
function
()
{
$
.
messager
.
alert
(
'
页面加载提示
'
,
'
页面加载异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
//分页信息处理
function
ininPager
()
{
try
{
var
opts
=
$
(
"
#tableData
"
).
datagrid
(
'
options
'
);
var
pager
=
$
(
"
#tableData
"
).
datagrid
(
'
getPager
'
);
pager
.
pagination
({
onSelectPage
:
function
(
pageNum
,
pageSize
)
{
opts
.
pageNumber
=
pageNum
;
opts
.
pageSize
=
pageSize
;
pager
.
pagination
(
'
refresh
'
,
{
pageNumber
:
pageNum
,
pageSize
:
pageSize
});
showDetails
(
pageNum
,
pageSize
);
}
});
}
catch
(
e
)
{
$
.
messager
.
alert
(
'
异常处理提示
'
,
"
分页信息异常 :
"
+
e
.
name
+
"
:
"
+
e
.
message
,
'
error
'
);
}
}
function
showDetails
(
pageNo
,
pageSize
)
{
$
.
ajax
({
url
:
"
/userBusiness/getBasicData
"
,
type
:
"
get
"
,
data
:
{
Type
:
'
RoleFunctions
'
,
KeyId
:
keyId
},
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
var
ubList
=
res
.
data
.
userBusinessList
;
userBusinessId
=
ubList
[
0
].
id
;
roleBtnStr
=
ubList
[
0
].
btnstr
;
var
getValue
=
ubList
[
0
].
value
;
getValue
=
getValue
.
substring
(
1
,
getValue
.
length
-
1
);
if
(
getValue
.
indexOf
(
"
][
"
))
{
var
arr
=
getValue
.
split
(
"
][
"
);
arr
=
arr
.
toString
();
$
.
ajax
({
url
:
"
/functions/findByIds
"
,
type
:
"
get
"
,
data
:
{
functionsIds
:
arr
},
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
$
(
"
#tableData
"
).
datagrid
(
'
loadData
'
,
res
.
data
);
}
},
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
查询数据异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
}
},
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
查询数据异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
function
bindEvent
()
{
setTimeout
(
function
()
{
var
bindBody
=
$
(
"
#pushList .datagrid-view2 .datagrid-body
"
);
//加载按钮信息到缓存中
if
(
roleBtnStr
)
{
var
roleBtnStrArr
=
JSON
.
parse
(
roleBtnStr
);
bindBody
.
find
(
"
.datagrid-row
"
).
each
(
function
()
{
for
(
var
i
=
0
;
i
<
roleBtnStrArr
.
length
;
i
++
)
{
if
(
roleBtnStrArr
[
i
]
&&
roleBtnStrArr
[
i
].
funId
)
{
var
thisId
=
$
(
this
).
find
(
"
[field='Id']
"
).
text
()
-
0
;
if
(
roleBtnStrArr
[
i
].
funId
==
thisId
)
{
$
(
this
).
find
(
"
[field='Id']
"
).
attr
(
"
data-btn
"
,
roleBtnStrArr
[
i
].
btnStr
);
//加载勾选状态
$
(
this
).
find
(
"
[field='PushBtnList']
"
).
find
(
"
input
"
).
each
(
function
()
{
var
thisValue
=
$
(
this
).
val
();
//勾选的值
if
(
roleBtnStrArr
[
i
].
btnStr
.
indexOf
(
thisValue
)
>
-
1
)
{
$
(
this
).
prop
(
"
checked
"
,
"
checked
"
);
}
});
}
}
}
});
}
//按钮勾选事件
bindBody
.
find
(
"
[field='PushBtnList']
"
).
find
(
"
input
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
var
checkStr
=
""
;
$
(
this
).
closest
(
"
.datagrid-cell
"
).
find
(
"
input
"
).
each
(
function
()
{
var
thisValue
=
$
(
this
).
val
();
//勾选的值
var
isChecked
=
$
(
this
).
prop
(
"
checked
"
);
if
(
isChecked
)
{
checkStr
=
checkStr
+
thisValue
+
"
,
"
;
}
});
if
(
checkStr
)
{
checkStr
=
checkStr
.
substring
(
0
,
checkStr
.
length
-
1
);
}
$
(
this
).
closest
(
"
.datagrid-row
"
).
find
(
"
[field='Id']
"
).
attr
(
"
data-btn
"
,
checkStr
);
});
},
500
);
$
(
"
#btnOK
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
if
(
confirm
(
"
您确定要保存吗?
"
))
{
var
bindList
=
$
(
"
#pushList .datagrid-view2 .datagrid-body .datagrid-row
"
);
var
bindArr
=
[];
var
btnStr
=
""
;
bindList
.
each
(
function
()
{
var
funId
=
$
(
this
).
find
(
"
[field='Id']
"
).
text
();
var
btnStr
=
$
(
this
).
find
(
"
[field='Id']
"
).
attr
(
"
data-btn
"
);
if
(
btnStr
!==
undefined
&&
btnStr
!==
""
)
{
var
bindJSON
=
{};
bindJSON
.
funId
=
funId
;
bindJSON
.
btnStr
=
btnStr
;
bindArr
.
push
(
bindJSON
);
}
});
if
(
bindArr
.
length
)
{
btnStr
=
JSON
.
stringify
(
bindArr
);
}
$
.
ajax
({
url
:
"
/userBusiness/updateBtnStr
"
,
type
:
"
post
"
,
data
:
{
userBusinessId
:
userBusinessId
,
btnStr
:
btnStr
},
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
self
.
parent
.
$
.
colorbox
.
close
();
alert
(
"
操作成功!
"
);
}
else
{
$
.
messager
.
show
({
title
:
'
错误提示
'
,
msg
:
'
保存按钮权限信息失败,请稍后重试!
'
});
}
},
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
保存数据异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
});
}
</script>
</body>
<!DOCTYPE html>
<html>
<head>
<title>
角色分配按钮
</title>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<script
type=
"text/javascript"
src=
"/js/jquery-1.8.0.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/common.css"
/>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/jquery.easyui.min.js"
></script>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
<body>
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
<div
id=
"pushList"
>
<!-- 数据显示table -->
<div
id=
"tablePanel"
class=
"easyui-panel"
style=
"padding:1px; top:300px;"
title=
"功能列表-选择按钮权限"
iconCls=
"icon-list"
closable=
"false"
>
<table
id=
"tableData"
style=
"top:300px;border-bottom-color:#FFFFFF"
></table>
</div>
</div>
<script
type=
"text/javascript"
>
var
keyId
=
getUrlParam
(
'
id
'
);
//获取传值id(角色id)
var
pushBtnJSON
;
var
userBusinessId
=
0
;
//关系id
var
roleBtnStr
=
""
;
//角色按钮权限
//初始化界面
$
(
function
()
{
initJSON
();
initTableData
();
ininPager
();
showDetails
(
1
,
initPageSize
);
bindEvent
();
});
//初始化JSON
function
initJSON
()
{
var
url
=
'
/js/pages/manage/pushBtn.json
'
;
$
.
ajax
({
url
:
url
,
type
:
"
get
"
,
async
:
false
,
success
:
function
(
res
)
{
if
(
res
)
{
pushBtnJSON
=
res
;
}
},
error
:
function
()
{
}
});
}
//初始化表格数据
function
initTableData
()
{
$
(
'
#tableData
'
).
datagrid
({
height
:
360
,
rownumbers
:
true
,
//动画效果
animate
:
false
,
//交替出现背景
striped
:
true
,
columns
:
[[
{
field
:
'
Id
'
,
align
:
"
center
"
,
hidden
:
true
},
{
title
:
'
名称
'
,
field
:
'
Name
'
,
width
:
100
},
{
title
:
'
按钮列表
'
,
field
:
'
PushBtnList
'
,
width
:
400
,
formatter
:
function
(
value
,
rec
)
{
var
btnStr
=
rec
.
PushBtn
;
if
(
btnStr
!=
undefined
)
{
var
arr
=
btnStr
.
split
(
"
,
"
);
if
(
arr
.
length
)
{
var
str
=
""
;
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
var
j
=
0
;
j
<
pushBtnJSON
.
length
;
j
++
)
{
if
(
pushBtnJSON
[
j
].
id
===
arr
[
i
]
-
0
)
{
str
+=
"
<input type='checkbox' value='
"
+
pushBtnJSON
[
j
].
id
+
"
' />
"
+
pushBtnJSON
[
j
].
text
;
}
}
}
return
str
;
}
}
else
{
return
""
;
}
}
}
]],
onLoadError
:
function
()
{
$
.
messager
.
alert
(
'
页面加载提示
'
,
'
页面加载异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
//分页信息处理
function
ininPager
()
{
try
{
var
opts
=
$
(
"
#tableData
"
).
datagrid
(
'
options
'
);
var
pager
=
$
(
"
#tableData
"
).
datagrid
(
'
getPager
'
);
pager
.
pagination
({
onSelectPage
:
function
(
pageNum
,
pageSize
)
{
opts
.
pageNumber
=
pageNum
;
opts
.
pageSize
=
pageSize
;
pager
.
pagination
(
'
refresh
'
,
{
pageNumber
:
pageNum
,
pageSize
:
pageSize
});
showDetails
(
pageNum
,
pageSize
);
}
});
}
catch
(
e
)
{
$
.
messager
.
alert
(
'
异常处理提示
'
,
"
分页信息异常 :
"
+
e
.
name
+
"
:
"
+
e
.
message
,
'
error
'
);
}
}
function
showDetails
(
pageNo
,
pageSize
)
{
$
.
ajax
({
url
:
"
/userBusiness/getBasicData
"
,
type
:
"
get
"
,
data
:
{
Type
:
'
RoleFunctions
'
,
KeyId
:
keyId
},
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
var
ubList
=
res
.
data
.
userBusinessList
;
userBusinessId
=
ubList
[
0
].
id
;
roleBtnStr
=
ubList
[
0
].
btnstr
;
var
getValue
=
ubList
[
0
].
value
;
getValue
=
getValue
.
substring
(
1
,
getValue
.
length
-
1
);
if
(
getValue
.
indexOf
(
"
][
"
))
{
var
arr
=
getValue
.
split
(
"
][
"
);
arr
=
arr
.
toString
();
$
.
ajax
({
url
:
"
/functions/findByIds
"
,
type
:
"
get
"
,
data
:
{
functionsIds
:
arr
},
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
$
(
"
#tableData
"
).
datagrid
(
'
loadData
'
,
res
.
data
);
}
},
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
查询数据异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
}
},
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
查询数据异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
function
bindEvent
()
{
setTimeout
(
function
()
{
var
bindBody
=
$
(
"
#pushList .datagrid-view2 .datagrid-body
"
);
//加载按钮信息到缓存中
if
(
roleBtnStr
)
{
var
roleBtnStrArr
=
JSON
.
parse
(
roleBtnStr
);
bindBody
.
find
(
"
.datagrid-row
"
).
each
(
function
()
{
for
(
var
i
=
0
;
i
<
roleBtnStrArr
.
length
;
i
++
)
{
if
(
roleBtnStrArr
[
i
]
&&
roleBtnStrArr
[
i
].
funId
)
{
var
thisId
=
$
(
this
).
find
(
"
[field='Id']
"
).
text
()
-
0
;
if
(
roleBtnStrArr
[
i
].
funId
==
thisId
)
{
$
(
this
).
find
(
"
[field='Id']
"
).
attr
(
"
data-btn
"
,
roleBtnStrArr
[
i
].
btnStr
);
//加载勾选状态
$
(
this
).
find
(
"
[field='PushBtnList']
"
).
find
(
"
input
"
).
each
(
function
()
{
var
thisValue
=
$
(
this
).
val
();
//勾选的值
if
(
roleBtnStrArr
[
i
].
btnStr
.
indexOf
(
thisValue
)
>
-
1
)
{
$
(
this
).
prop
(
"
checked
"
,
"
checked
"
);
}
});
}
}
}
});
}
//按钮勾选事件
bindBody
.
find
(
"
[field='PushBtnList']
"
).
find
(
"
input
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
var
checkStr
=
""
;
$
(
this
).
closest
(
"
.datagrid-cell
"
).
find
(
"
input
"
).
each
(
function
()
{
var
thisValue
=
$
(
this
).
val
();
//勾选的值
var
isChecked
=
$
(
this
).
prop
(
"
checked
"
);
if
(
isChecked
)
{
checkStr
=
checkStr
+
thisValue
+
"
,
"
;
}
});
if
(
checkStr
)
{
checkStr
=
checkStr
.
substring
(
0
,
checkStr
.
length
-
1
);
}
$
(
this
).
closest
(
"
.datagrid-row
"
).
find
(
"
[field='Id']
"
).
attr
(
"
data-btn
"
,
checkStr
);
});
},
500
);
$
(
"
#btnOK
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
$
.
messager
.
confirm
(
"
提示
"
,
"
您确定要保存吗?
"
,
function
(
data
){
var
bindList
=
$
(
"
#pushList .datagrid-view2 .datagrid-body .datagrid-row
"
);
var
bindArr
=
[];
var
btnStr
=
""
;
bindList
.
each
(
function
()
{
var
funId
=
$
(
this
).
find
(
"
[field='Id']
"
).
text
();
var
btnStr
=
$
(
this
).
find
(
"
[field='Id']
"
).
attr
(
"
data-btn
"
);
if
(
btnStr
!==
undefined
&&
btnStr
!==
""
)
{
var
bindJSON
=
{};
bindJSON
.
funId
=
funId
;
bindJSON
.
btnStr
=
btnStr
;
bindArr
.
push
(
bindJSON
);
}
});
if
(
bindArr
.
length
)
{
btnStr
=
JSON
.
stringify
(
bindArr
);
}
$
.
ajax
({
url
:
"
/userBusiness/updateBtnStr
"
,
type
:
"
post
"
,
data
:
{
userBusinessId
:
userBusinessId
,
btnStr
:
btnStr
},
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
self
.
parent
.
$
.
colorbox
.
close
();
$
.
messager
.
alert
(
'
提示
'
,
"
操作成功!
"
,
"
info
"
);
}
else
{
$
.
messager
.
show
({
title
:
'
错误提示
'
,
msg
:
'
保存按钮权限信息失败,请稍后重试!
'
});
}
},
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
保存数据异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
);
});
}
</script>
</body>
</html>
\ No newline at end of file
erp_web/pages/user/userCustomer.html
View file @
149f78d7
<!DOCTYPE html>
<html>
<head>
<title>
用户对应客户
</title>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<script
type=
"text/javascript"
src=
"/js/jquery-1.8.0.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/common.css"
/>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/jquery.easyui.min.js"
></script>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
<body>
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
<div>
<ul
id=
"tt"
></ul>
</div>
<script
type=
"text/javascript"
>
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(用户id)
var
type
=
"
UserCustomer
"
;
var
url
;
//定义链接地址
function
GetNode
(
ctype
)
{
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
cnodes
=
''
;
var
pnodes
=
''
;
var
prevNode
=
''
;
//保存上一步所选父节点
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
{
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
prevNode
=
pnode
.
id
;
//保存当前节点
}
}
}
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
if
(
ctype
==
'
child
'
)
{
return
cnodes
;
}
else
{
return
pnodes
}
;
};
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
url
:
'
/supplier/findUserCustomer?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
checkbox
:
true
});
$
(
"
#btnOK
"
).
click
(
function
()
{
var
id
=
checkUserDepot
();
if
(
!
id
)
{
url
=
'
/userBusiness/add
'
;
}
else
{
url
=
'
/userBusiness/update?id=
'
+
id
;
}
if
(
confirm
(
"
您确定要保存吗?
"
))
{
$
.
ajax
({
url
:
url
,
type
:
"
post
"
,
data
:
{
info
:
JSON
.
stringify
({
type
:
type
,
keyid
:
url_id
,
value
:
GetNode
(
'
child
'
)
})
},
dataType
:
"
json
"
,
async
:
false
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
self
.
parent
.
$
.
colorbox
.
close
();
alert
(
"
操作成功!
"
);
}
else
{
alert
(
"
操作失败!
"
);
}
}
});
}
}
);
});
//检查记录是否存在
function
checkUserDepot
()
{
//表示是否存在 0 = 不存在,存在就返回id
var
flag
=
0
;
//开始ajax名称检验,是否存在
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
dataType
:
"
json
"
,
async
:
false
,
data
:
({
type
:
type
,
keyId
:
url_id
}),
success
:
function
(
res
)
{
if
(
res
.
data
&&
res
.
data
.
id
)
{
flag
=
res
.
data
.
id
;
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
检查用户对应功能是否存在异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
return
flag
;
}
</script>
</body>
<!DOCTYPE html>
<html>
<head>
<title>
用户对应客户
</title>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<script
type=
"text/javascript"
src=
"/js/jquery-1.8.0.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/common.css"
/>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/jquery.easyui.min.js"
></script>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
<body>
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
<div>
<ul
id=
"tt"
></ul>
</div>
<script
type=
"text/javascript"
>
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(用户id)
var
type
=
"
UserCustomer
"
;
var
url
;
//定义链接地址
function
GetNode
(
ctype
)
{
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
cnodes
=
''
;
var
pnodes
=
''
;
var
prevNode
=
''
;
//保存上一步所选父节点
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
{
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
prevNode
=
pnode
.
id
;
//保存当前节点
}
}
}
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
if
(
ctype
==
'
child
'
)
{
return
cnodes
;
}
else
{
return
pnodes
}
;
};
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
url
:
'
/supplier/findUserCustomer?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
checkbox
:
true
});
$
(
"
#btnOK
"
).
click
(
function
()
{
var
id
=
checkUserDepot
();
if
(
!
id
)
{
url
=
'
/userBusiness/add
'
;
}
else
{
url
=
'
/userBusiness/update?id=
'
+
id
;
}
$
.
messager
.
confirm
(
"
提示
"
,
"
您确定要保存吗?
"
,
function
(
data
){
$
.
ajax
({
url
:
url
,
type
:
"
post
"
,
data
:
{
info
:
JSON
.
stringify
({
type
:
type
,
keyid
:
url_id
,
value
:
GetNode
(
'
child
'
)
})
},
dataType
:
"
json
"
,
async
:
false
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
self
.
parent
.
$
.
colorbox
.
close
();
$
.
messager
.
alert
(
'
提示
'
,
"
操作成功!
"
,
"
info
"
);
}
else
{
$
.
messager
.
alert
(
'
提示
'
,
"
操作失败!
"
,
"
error
"
);
}
}
});
});
}
);
});
//检查记录是否存在
function
checkUserDepot
()
{
//表示是否存在 0 = 不存在,存在就返回id
var
flag
=
0
;
//开始ajax名称检验,是否存在
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
dataType
:
"
json
"
,
async
:
false
,
data
:
({
type
:
type
,
keyId
:
url_id
}),
success
:
function
(
res
)
{
if
(
res
.
data
&&
res
.
data
.
id
)
{
flag
=
res
.
data
.
id
;
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
检查用户对应功能是否存在异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
return
flag
;
}
</script>
</body>
</html>
\ No newline at end of file
erp_web/pages/user/userDepot.html
View file @
149f78d7
<!DOCTYPE html>
<html>
<head>
<title>
用户对应部门
</title>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<script
type=
"text/javascript"
src=
"/js/jquery-1.8.0.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/common.css"
/>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/jquery.easyui.min.js"
></script>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
<body>
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
<div>
<ul
id=
"tt"
></ul>
</div>
<script
type=
"text/javascript"
>
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(用户id)
var
type
=
"
UserDepot
"
;
var
url
;
//定义链接地址
function
GetNode
(
ctype
)
{
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
cnodes
=
''
;
var
pnodes
=
''
;
var
prevNode
=
''
;
//保存上一步所选父节点
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
{
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
prevNode
=
pnode
.
id
;
//保存当前节点
}
}
}
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
if
(
ctype
==
'
child
'
)
{
return
cnodes
;
}
else
{
return
pnodes
}
;
};
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
url
:
'
/depot/findUserDepot?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
checkbox
:
true
});
$
(
"
#btnOK
"
).
click
(
function
()
{
var
id
=
checkUserDepot
();
if
(
!
id
)
{
url
=
'
/userBusiness/add
'
;
}
else
{
url
=
'
/userBusiness/update?id=
'
+
id
;
}
if
(
confirm
(
"
您确定要保存吗?
"
))
{
$
.
ajax
({
url
:
url
,
type
:
"
post
"
,
data
:
{
info
:
JSON
.
stringify
({
type
:
type
,
keyid
:
url_id
,
value
:
GetNode
(
'
child
'
)
})
},
dataType
:
"
json
"
,
async
:
false
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
self
.
parent
.
$
.
colorbox
.
close
();
alert
(
"
操作成功!
"
);
}
else
{
alert
(
"
操作失败!
"
);
}
}
});
}
}
);
});
//检查记录是否存在
function
checkUserDepot
()
{
//表示是否存在 0 = 不存在,存在就返回id
var
flag
=
0
;
//开始ajax名称检验,是否存在
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
dataType
:
"
json
"
,
async
:
false
,
data
:
({
type
:
type
,
keyId
:
url_id
}),
success
:
function
(
res
)
{
if
(
res
.
data
&&
res
.
data
.
id
)
{
flag
=
res
.
data
.
id
;
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
检查用户对应功能是否存在异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
return
flag
;
}
</script>
</body>
<!DOCTYPE html>
<html>
<head>
<title>
用户对应部门
</title>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<script
type=
"text/javascript"
src=
"/js/jquery-1.8.0.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/common.css"
/>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/jquery.easyui.min.js"
></script>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
<body>
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
<div>
<ul
id=
"tt"
></ul>
</div>
<script
type=
"text/javascript"
>
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(用户id)
var
type
=
"
UserDepot
"
;
var
url
;
//定义链接地址
function
GetNode
(
ctype
)
{
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
cnodes
=
''
;
var
pnodes
=
''
;
var
prevNode
=
''
;
//保存上一步所选父节点
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
{
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
prevNode
=
pnode
.
id
;
//保存当前节点
}
}
}
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
if
(
ctype
==
'
child
'
)
{
return
cnodes
;
}
else
{
return
pnodes
}
;
};
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
url
:
'
/depot/findUserDepot?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
checkbox
:
true
});
$
(
"
#btnOK
"
).
click
(
function
()
{
var
id
=
checkUserDepot
();
if
(
!
id
)
{
url
=
'
/userBusiness/add
'
;
}
else
{
url
=
'
/userBusiness/update?id=
'
+
id
;
}
$
.
messager
.
confirm
(
"
提示
"
,
"
您确定要保存吗?
"
,
function
(
data
){
$
.
ajax
({
url
:
url
,
type
:
"
post
"
,
data
:
{
info
:
JSON
.
stringify
({
type
:
type
,
keyid
:
url_id
,
value
:
GetNode
(
'
child
'
)
})
},
dataType
:
"
json
"
,
async
:
false
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
self
.
parent
.
$
.
colorbox
.
close
();
$
.
messager
.
alert
(
'
提示
'
,
"
操作成功!
"
,
"
info
"
);
}
else
{
$
.
messager
.
alert
(
'
提示
'
,
"
操作失败!
"
,
"
error
"
);
}
}
});
});
}
);
});
//检查记录是否存在
function
checkUserDepot
()
{
//表示是否存在 0 = 不存在,存在就返回id
var
flag
=
0
;
//开始ajax名称检验,是否存在
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
dataType
:
"
json
"
,
async
:
false
,
data
:
({
type
:
type
,
keyId
:
url_id
}),
success
:
function
(
res
)
{
if
(
res
.
data
&&
res
.
data
.
id
)
{
flag
=
res
.
data
.
id
;
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
检查用户对应功能是否存在异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
return
flag
;
}
</script>
</body>
</html>
\ No newline at end of file
erp_web/pages/user/userRole.html
View file @
149f78d7
<!DOCTYPE html>
<html>
<head>
<title>
用户对应角色
</title>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<script
type=
"text/javascript"
src=
"/js/jquery-1.8.0.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/common.css"
/>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/jquery.easyui.min.js"
></script>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
<body>
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
<div>
<ul
id=
"tt"
></ul>
</div>
<script
type=
"text/javascript"
>
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(用户id)
var
type
=
"
UserRole
"
;
var
url
;
//定义链接地址
function
GetNode
(
ctype
)
{
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
cnodes
=
''
;
var
pnodes
=
''
;
var
prevNode
=
''
;
//保存上一步所选父节点
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
{
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
prevNode
=
pnode
.
id
;
//保存当前节点
}
}
}
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
if
(
ctype
==
'
child
'
)
{
return
cnodes
;
}
else
{
return
pnodes
}
;
};
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
url
:
'
/role/findUserRole?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
checkbox
:
true
});
$
(
"
#btnOK
"
).
click
(
function
()
{
var
id
=
checkUserRole
();
if
(
!
id
)
{
url
=
'
/userBusiness/add
'
;
}
else
{
url
=
'
/userBusiness/update?id=
'
+
id
;
}
if
(
confirm
(
"
您确定要保存吗?
"
))
{
$
.
ajax
({
url
:
url
,
type
:
"
post
"
,
data
:
{
info
:
JSON
.
stringify
({
type
:
type
,
keyid
:
url_id
,
value
:
GetNode
(
'
child
'
)
})
},
dataType
:
"
json
"
,
async
:
false
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
self
.
parent
.
$
.
colorbox
.
close
();
alert
(
"
操作成功!
"
);
}
else
{
alert
(
"
操作失败!
"
);
}
}
});
}
}
);
});
//检查记录是否存在
function
checkUserRole
()
{
//表示是否存在 0 = 不存在,存在就返回id
var
flag
=
0
;
//开始ajax名称检验,是否存在
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
dataType
:
"
json
"
,
async
:
false
,
data
:
({
type
:
type
,
keyId
:
url_id
}),
success
:
function
(
res
)
{
if
(
res
.
data
&&
res
.
data
.
id
)
{
flag
=
res
.
data
.
id
;
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
检查用户对应功能是否存在异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
return
flag
;
}
</script>
</body>
<!DOCTYPE html>
<html>
<head>
<title>
用户对应角色
</title>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<script
type=
"text/javascript"
src=
"/js/jquery-1.8.0.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/common.css"
/>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/jquery.easyui.min.js"
></script>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
<body>
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
<div>
<ul
id=
"tt"
></ul>
</div>
<script
type=
"text/javascript"
>
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(用户id)
var
type
=
"
UserRole
"
;
var
url
;
//定义链接地址
function
GetNode
(
ctype
)
{
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
cnodes
=
''
;
var
pnodes
=
''
;
var
prevNode
=
''
;
//保存上一步所选父节点
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
{
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
prevNode
=
pnode
.
id
;
//保存当前节点
}
}
}
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
if
(
ctype
==
'
child
'
)
{
return
cnodes
;
}
else
{
return
pnodes
}
;
};
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
url
:
'
/role/findUserRole?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
checkbox
:
true
});
$
(
"
#btnOK
"
).
click
(
function
()
{
var
id
=
checkUserRole
();
if
(
!
id
)
{
url
=
'
/userBusiness/add
'
;
}
else
{
url
=
'
/userBusiness/update?id=
'
+
id
;
}
$
.
messager
.
confirm
(
"
提示
"
,
"
您确定要保存吗?
"
,
function
(
data
){
$
.
ajax
({
url
:
url
,
type
:
"
post
"
,
data
:
{
info
:
JSON
.
stringify
({
type
:
type
,
keyid
:
url_id
,
value
:
GetNode
(
'
child
'
)
})
},
dataType
:
"
json
"
,
async
:
false
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
self
.
parent
.
$
.
colorbox
.
close
();
$
.
messager
.
alert
(
'
提示
'
,
"
操作成功!
"
,
"
info
"
);
}
else
{
$
.
messager
.
alert
(
'
提示
'
,
"
操作失败!
"
,
"
error
"
);
}
}
});
});
}
);
});
//检查记录是否存在
function
checkUserRole
()
{
//表示是否存在 0 = 不存在,存在就返回id
var
flag
=
0
;
//开始ajax名称检验,是否存在
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
dataType
:
"
json
"
,
async
:
false
,
data
:
({
type
:
type
,
keyId
:
url_id
}),
success
:
function
(
res
)
{
if
(
res
.
data
&&
res
.
data
.
id
)
{
flag
=
res
.
data
.
id
;
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
检查用户对应功能是否存在异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
return
flag
;
}
</script>
</body>
</html>
\ No newline at end of file
src/main/resources/application.properties
View file @
149f78d7
...
...
@@ -2,7 +2,7 @@ server.port=8080
spring.datasource.url
=
jdbc:mysql://127.0.0.1:3306/jsh_erp?useUnicode=true&characterEncoding=utf8&useCursorFetch=true&defaultFetchSize=500&allowMultiQueries=true&rewriteBatchedStatements=true&useSSL=false
spring.datasource.driverClassName
=
com.mysql.jdbc.Driver
spring.datasource.username
=
root
spring.datasource.password
=
1234
spring.datasource.password
=
1234
56
#generatorConfig专用属性
project
=
src/main/java
resource
=
src/main/resources
...
...
src/main/resources/logback-spring.xml
View file @
149f78d7
...
...
@@ -9,7 +9,7 @@
<contextName>
logback
</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
<property
name=
"log.path"
value=
"logs/jshERP"
/>
<property
name=
"log.path"
value=
"
../
logs/jshERP"
/>
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment