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>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<title>
角色对应应用
</title>
<title>
角色对应应用
</title>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<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>
<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/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.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"
/>
<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/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/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
</head>
<body>
<body>
<!-- 数据显示table -->
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
</div>
<div>
<div>
<ul
id=
"tt"
></ul>
<ul
id=
"tt"
></ul>
</div>
</div>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(角色id)
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(角色id)
var
type
=
"
RoleAPP
"
;
var
type
=
"
RoleAPP
"
;
var
url
;
//定义链接地址
var
url
;
//定义链接地址
function
GetNode
(
ctype
)
{
function
GetNode
(
ctype
)
{
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
cnodes
=
''
;
var
cnodes
=
''
;
var
pnodes
=
''
;
var
pnodes
=
''
;
var
prevNode
=
''
;
//保存上一步所选父节点
var
prevNode
=
''
;
//保存上一步所选父节点
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
{
{
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
prevNode
=
pnode
.
id
;
//保存当前节点
prevNode
=
pnode
.
id
;
//保存当前节点
}
}
}
}
}
}
//cnodes = cnodes.substring(0, cnodes.length - 1);
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
if
(
ctype
==
'
child
'
)
{
if
(
ctype
==
'
child
'
)
{
return
cnodes
;
return
cnodes
;
}
}
else
{
else
{
return
pnodes
return
pnodes
}
}
;
;
};
};
$
(
function
()
{
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
$
(
'
#tt
'
).
tree
({
url
:
'
/app/findRoleAPP?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
url
:
'
/app/findRoleAPP?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
animate
:
true
,
checkbox
:
true
checkbox
:
true
});
});
$
(
"
#btnOK
"
).
click
(
$
(
"
#btnOK
"
).
click
(
function
()
{
function
()
{
var
id
=
checkRoleAPP
();
var
id
=
checkRoleAPP
();
if
(
!
id
)
{
if
(
!
id
)
{
url
=
'
/userBusiness/add
'
;
url
=
'
/userBusiness/add
'
;
}
}
else
{
else
{
url
=
'
/userBusiness/update?id=
'
+
id
;
url
=
'
/userBusiness/update?id=
'
+
id
;
}
}
$
.
messager
.
confirm
(
"
提示
"
,
"
您确定要保存吗?
"
,
function
(
data
){
if
(
confirm
(
"
您确定要保存吗?
"
))
{
$
.
ajax
({
url
:
url
,
$
.
ajax
({
type
:
"
post
"
,
url
:
url
,
data
:
{
type
:
"
post
"
,
info
:
JSON
.
stringify
({
data
:
{
type
:
type
,
info
:
JSON
.
stringify
({
keyid
:
url_id
,
type
:
type
,
value
:
GetNode
(
'
child
'
)
keyid
:
url_id
,
})
value
:
GetNode
(
'
child
'
)
},
})
dataType
:
"
json
"
,
},
async
:
false
,
dataType
:
"
json
"
,
success
:
function
(
res
)
{
async
:
false
,
if
(
res
&&
res
.
code
===
200
)
{
success
:
function
(
res
)
{
self
.
parent
.
$
.
colorbox
.
close
();
if
(
res
&&
res
.
code
===
200
)
{
$
.
messager
.
alert
(
'
提示
'
,
"
操作成功!
"
,
"
info
"
);
self
.
parent
.
$
.
colorbox
.
close
();
}
alert
(
"
操作成功!
"
);
else
{
}
$
.
messager
.
alert
(
'
提示
'
,
"
操作失败!
"
,
"
error
"
);
else
{
}
alert
(
"
操作失败!
"
);
}
}
});
}
});
});
}
}
);
}
);
});
});
//检查记录是否存在
function
checkRoleAPP
()
{
//检查记录是否存在
//表示是否存在 0 = 不存在,存在就返回id
function
checkRoleAPP
()
{
var
flag
=
0
;
//表示是否存在 0 = 不存在,存在就返回id
//开始ajax名称检验,是否存在
var
flag
=
0
;
$
.
ajax
({
//开始ajax名称检验,是否存在
type
:
"
get
"
,
$
.
ajax
({
url
:
"
/userBusiness/checkIsValueExist
"
,
type
:
"
get
"
,
dataType
:
"
json
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
async
:
false
,
dataType
:
"
json
"
,
data
:
({
async
:
false
,
type
:
type
,
data
:
({
keyId
:
url_id
type
:
type
,
}),
keyId
:
url_id
success
:
function
(
res
)
{
}),
if
(
res
.
data
&&
res
.
data
.
id
)
{
success
:
function
(
res
)
{
flag
=
res
.
data
.
id
;
if
(
res
.
data
&&
res
.
data
.
id
)
{
}
flag
=
res
.
data
.
id
;
},
}
//此处添加错误处理
},
error
:
function
()
{
//此处添加错误处理
$
.
messager
.
alert
(
'
提示
'
,
'
检查角色对应应用是否存在异常,请稍后再试!
'
,
'
error
'
);
error
:
function
()
{
return
;
$
.
messager
.
alert
(
'
提示
'
,
'
检查角色对应应用是否存在异常,请稍后再试!
'
,
'
error
'
);
}
return
;
});
}
return
flag
;
});
}
return
flag
;
}
</script>
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
erp_web/pages/manage/roleFunctions.html
View file @
149f78d7
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<title>
角色对应应用
</title>
<title>
角色对应应用
</title>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<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>
<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/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.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"
/>
<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/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/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
</head>
<body>
<body>
<!-- 数据显示table -->
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
</div>
<div>
<div>
<ul
id=
"tt"
></ul>
<ul
id=
"tt"
></ul>
</div>
</div>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(角色id)
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(角色id)
var
type
=
"
RoleFunctions
"
;
var
type
=
"
RoleFunctions
"
;
var
url
;
//定义链接地址
var
url
;
//定义链接地址
function
GetNode
(
ctype
)
{
function
GetNode
(
ctype
)
{
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
cnodes
=
''
;
var
cnodes
=
''
;
var
pnodes
=
''
;
var
pnodes
=
''
;
var
prevNode
=
''
;
//保存上一步所选父节点
var
prevNode
=
''
;
//保存上一步所选父节点
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
{
{
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
prevNode
=
pnode
.
id
;
//保存当前节点
prevNode
=
pnode
.
id
;
//保存当前节点
}
}
}
}
}
}
//cnodes = cnodes.substring(0, cnodes.length - 1);
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
if
(
ctype
==
'
child
'
)
{
if
(
ctype
==
'
child
'
)
{
return
cnodes
;
return
cnodes
;
}
}
else
{
else
{
return
pnodes
return
pnodes
}
}
;
;
};
};
$
(
function
()
{
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
$
(
'
#tt
'
).
tree
({
url
:
'
/functions/findRoleFunctions?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
url
:
'
/functions/findRoleFunctions?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
animate
:
true
,
checkbox
:
true
checkbox
:
true
});
});
$
(
"
#btnOK
"
).
click
(
$
(
"
#btnOK
"
).
click
(
function
()
{
function
()
{
var
id
=
checkRoleFunctions
();
var
id
=
checkRoleFunctions
();
if
(
!
id
)
{
if
(
!
id
)
{
url
=
'
/userBusiness/add
'
;
url
=
'
/userBusiness/add
'
;
}
}
else
{
else
{
url
=
'
/userBusiness/update?id=
'
+
id
;
url
=
'
/userBusiness/update?id=
'
+
id
;
}
}
$
.
messager
.
confirm
(
"
提示
"
,
"
您确定要保存吗?
"
,
function
(
data
){
if
(
confirm
(
"
您确定要保存吗?
"
))
{
$
.
ajax
({
url
:
url
,
$
.
ajax
({
type
:
"
post
"
,
url
:
url
,
data
:
{
type
:
"
post
"
,
info
:
JSON
.
stringify
({
data
:
{
type
:
type
,
info
:
JSON
.
stringify
({
keyid
:
url_id
,
type
:
type
,
value
:
GetNode
(
'
child
'
)
keyid
:
url_id
,
})
value
:
GetNode
(
'
child
'
)
},
})
dataType
:
"
json
"
,
},
async
:
false
,
dataType
:
"
json
"
,
success
:
function
(
res
)
{
async
:
false
,
if
(
res
&&
res
.
code
===
200
)
{
success
:
function
(
res
)
{
self
.
parent
.
$
.
colorbox
.
close
();
if
(
res
&&
res
.
code
===
200
)
{
$
.
messager
.
alert
(
'
提示
'
,
"
操作成功!
"
,
"
info
"
);
self
.
parent
.
$
.
colorbox
.
close
();
}
alert
(
"
操作成功!
"
);
else
{
}
$
.
messager
.
alert
(
'
提示
'
,
"
操作失败!
"
,
"
error
"
);
else
{
}
alert
(
"
操作失败!
"
);
}
}
});
}
});
});
}
}
}
);
);
});
});
//检查记录是否存在
//检查记录是否存在
function
checkRoleFunctions
()
{
function
checkRoleFunctions
()
{
//表示是否存在 0 = 不存在,存在就返回id
//表示是否存在 0 = 不存在,存在就返回id
var
flag
=
0
;
var
flag
=
0
;
//开始ajax名称检验,是否存在
//开始ajax名称检验,是否存在
$
.
ajax
({
$
.
ajax
({
type
:
"
get
"
,
type
:
"
get
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
dataType
:
"
json
"
,
dataType
:
"
json
"
,
async
:
false
,
async
:
false
,
data
:
({
data
:
({
type
:
type
,
type
:
type
,
keyId
:
url_id
keyId
:
url_id
}),
}),
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
data
&&
res
.
data
.
id
)
{
if
(
res
.
data
&&
res
.
data
.
id
)
{
flag
=
res
.
data
.
id
;
flag
=
res
.
data
.
id
;
}
}
},
},
//此处添加错误处理
//此处添加错误处理
error
:
function
()
{
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
检查角色对应功能是否存在异常,请稍后再试!
'
,
'
error
'
);
$
.
messager
.
alert
(
'
提示
'
,
'
检查角色对应功能是否存在异常,请稍后再试!
'
,
'
error
'
);
return
;
return
;
}
}
});
});
return
flag
;
return
flag
;
}
}
</script>
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
erp_web/pages/manage/rolePushBtn.html
View file @
149f78d7
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<title>
角色分配按钮
</title>
<title>
角色分配按钮
</title>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<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>
<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/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.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"
/>
<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/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/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
</head>
<body>
<body>
<!-- 数据显示table -->
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
</div>
<div
id=
"pushList"
>
<div
id=
"pushList"
>
<!-- 数据显示table -->
<!-- 数据显示table -->
<div
id=
"tablePanel"
class=
"easyui-panel"
style=
"padding:1px; top:300px;"
title=
"功能列表-选择按钮权限"
iconCls=
"icon-list"
<div
id=
"tablePanel"
class=
"easyui-panel"
style=
"padding:1px; top:300px;"
title=
"功能列表-选择按钮权限"
iconCls=
"icon-list"
closable=
"false"
>
closable=
"false"
>
<table
id=
"tableData"
style=
"top:300px;border-bottom-color:#FFFFFF"
></table>
<table
id=
"tableData"
style=
"top:300px;border-bottom-color:#FFFFFF"
></table>
</div>
</div>
</div>
</div>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
keyId
=
getUrlParam
(
'
id
'
);
//获取传值id(角色id)
var
keyId
=
getUrlParam
(
'
id
'
);
//获取传值id(角色id)
var
pushBtnJSON
;
var
pushBtnJSON
;
var
userBusinessId
=
0
;
//关系id
var
userBusinessId
=
0
;
//关系id
var
roleBtnStr
=
""
;
//角色按钮权限
var
roleBtnStr
=
""
;
//角色按钮权限
//初始化界面
//初始化界面
$
(
function
()
{
$
(
function
()
{
initJSON
();
initJSON
();
initTableData
();
initTableData
();
ininPager
();
ininPager
();
showDetails
(
1
,
initPageSize
);
showDetails
(
1
,
initPageSize
);
bindEvent
();
bindEvent
();
});
});
//初始化JSON
//初始化JSON
function
initJSON
()
{
function
initJSON
()
{
var
url
=
'
/js/pages/manage/pushBtn.json
'
;
var
url
=
'
/js/pages/manage/pushBtn.json
'
;
$
.
ajax
({
$
.
ajax
({
url
:
url
,
url
:
url
,
type
:
"
get
"
,
type
:
"
get
"
,
async
:
false
,
async
:
false
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
)
{
if
(
res
)
{
pushBtnJSON
=
res
;
pushBtnJSON
=
res
;
}
}
},
},
error
:
function
()
{
error
:
function
()
{
}
}
});
});
}
}
//初始化表格数据
//初始化表格数据
function
initTableData
()
{
function
initTableData
()
{
$
(
'
#tableData
'
).
datagrid
({
$
(
'
#tableData
'
).
datagrid
({
height
:
360
,
height
:
360
,
rownumbers
:
true
,
rownumbers
:
true
,
//动画效果
//动画效果
animate
:
false
,
animate
:
false
,
//交替出现背景
//交替出现背景
striped
:
true
,
striped
:
true
,
columns
:
[[
columns
:
[[
{
field
:
'
Id
'
,
align
:
"
center
"
,
hidden
:
true
},
{
field
:
'
Id
'
,
align
:
"
center
"
,
hidden
:
true
},
{
title
:
'
名称
'
,
field
:
'
Name
'
,
width
:
100
},
{
title
:
'
名称
'
,
field
:
'
Name
'
,
width
:
100
},
{
{
title
:
'
按钮列表
'
,
field
:
'
PushBtnList
'
,
width
:
400
,
formatter
:
function
(
value
,
rec
)
{
title
:
'
按钮列表
'
,
field
:
'
PushBtnList
'
,
width
:
400
,
formatter
:
function
(
value
,
rec
)
{
var
btnStr
=
rec
.
PushBtn
;
var
btnStr
=
rec
.
PushBtn
;
if
(
btnStr
!=
undefined
)
{
if
(
btnStr
!=
undefined
)
{
var
arr
=
btnStr
.
split
(
"
,
"
);
var
arr
=
btnStr
.
split
(
"
,
"
);
if
(
arr
.
length
)
{
if
(
arr
.
length
)
{
var
str
=
""
;
var
str
=
""
;
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
var
j
=
0
;
j
<
pushBtnJSON
.
length
;
j
++
)
{
for
(
var
j
=
0
;
j
<
pushBtnJSON
.
length
;
j
++
)
{
if
(
pushBtnJSON
[
j
].
id
===
arr
[
i
]
-
0
)
{
if
(
pushBtnJSON
[
j
].
id
===
arr
[
i
]
-
0
)
{
str
+=
"
<input type='checkbox' value='
"
+
pushBtnJSON
[
j
].
id
+
"
' />
"
+
pushBtnJSON
[
j
].
text
;
str
+=
"
<input type='checkbox' value='
"
+
pushBtnJSON
[
j
].
id
+
"
' />
"
+
pushBtnJSON
[
j
].
text
;
}
}
}
}
}
}
return
str
;
return
str
;
}
}
}
}
else
{
else
{
return
""
;
return
""
;
}
}
}
}
}
}
]],
]],
onLoadError
:
function
()
{
onLoadError
:
function
()
{
$
.
messager
.
alert
(
'
页面加载提示
'
,
'
页面加载异常,请稍后再试!
'
,
'
error
'
);
$
.
messager
.
alert
(
'
页面加载提示
'
,
'
页面加载异常,请稍后再试!
'
,
'
error
'
);
return
;
return
;
}
}
});
});
}
}
//分页信息处理
//分页信息处理
function
ininPager
()
{
function
ininPager
()
{
try
{
try
{
var
opts
=
$
(
"
#tableData
"
).
datagrid
(
'
options
'
);
var
opts
=
$
(
"
#tableData
"
).
datagrid
(
'
options
'
);
var
pager
=
$
(
"
#tableData
"
).
datagrid
(
'
getPager
'
);
var
pager
=
$
(
"
#tableData
"
).
datagrid
(
'
getPager
'
);
pager
.
pagination
({
pager
.
pagination
({
onSelectPage
:
function
(
pageNum
,
pageSize
)
{
onSelectPage
:
function
(
pageNum
,
pageSize
)
{
opts
.
pageNumber
=
pageNum
;
opts
.
pageNumber
=
pageNum
;
opts
.
pageSize
=
pageSize
;
opts
.
pageSize
=
pageSize
;
pager
.
pagination
(
'
refresh
'
,
{
pager
.
pagination
(
'
refresh
'
,
{
pageNumber
:
pageNum
,
pageNumber
:
pageNum
,
pageSize
:
pageSize
pageSize
:
pageSize
});
});
showDetails
(
pageNum
,
pageSize
);
showDetails
(
pageNum
,
pageSize
);
}
}
});
});
}
}
catch
(
e
)
{
catch
(
e
)
{
$
.
messager
.
alert
(
'
异常处理提示
'
,
"
分页信息异常 :
"
+
e
.
name
+
"
:
"
+
e
.
message
,
'
error
'
);
$
.
messager
.
alert
(
'
异常处理提示
'
,
"
分页信息异常 :
"
+
e
.
name
+
"
:
"
+
e
.
message
,
'
error
'
);
}
}
}
}
function
showDetails
(
pageNo
,
pageSize
)
{
function
showDetails
(
pageNo
,
pageSize
)
{
$
.
ajax
({
$
.
ajax
({
url
:
"
/userBusiness/getBasicData
"
,
url
:
"
/userBusiness/getBasicData
"
,
type
:
"
get
"
,
type
:
"
get
"
,
data
:
{
data
:
{
Type
:
'
RoleFunctions
'
,
Type
:
'
RoleFunctions
'
,
KeyId
:
keyId
KeyId
:
keyId
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
if
(
res
&&
res
.
code
===
200
)
{
var
ubList
=
res
.
data
.
userBusinessList
;
var
ubList
=
res
.
data
.
userBusinessList
;
userBusinessId
=
ubList
[
0
].
id
;
userBusinessId
=
ubList
[
0
].
id
;
roleBtnStr
=
ubList
[
0
].
btnstr
;
roleBtnStr
=
ubList
[
0
].
btnstr
;
var
getValue
=
ubList
[
0
].
value
;
var
getValue
=
ubList
[
0
].
value
;
getValue
=
getValue
.
substring
(
1
,
getValue
.
length
-
1
);
getValue
=
getValue
.
substring
(
1
,
getValue
.
length
-
1
);
if
(
getValue
.
indexOf
(
"
][
"
))
{
if
(
getValue
.
indexOf
(
"
][
"
))
{
var
arr
=
getValue
.
split
(
"
][
"
);
var
arr
=
getValue
.
split
(
"
][
"
);
arr
=
arr
.
toString
();
arr
=
arr
.
toString
();
$
.
ajax
({
$
.
ajax
({
url
:
"
/functions/findByIds
"
,
url
:
"
/functions/findByIds
"
,
type
:
"
get
"
,
type
:
"
get
"
,
data
:
{
data
:
{
functionsIds
:
arr
functionsIds
:
arr
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
if
(
res
&&
res
.
code
===
200
)
{
$
(
"
#tableData
"
).
datagrid
(
'
loadData
'
,
res
.
data
);
$
(
"
#tableData
"
).
datagrid
(
'
loadData
'
,
res
.
data
);
}
}
},
},
error
:
function
()
{
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
查询数据异常,请稍后再试!
'
,
'
error
'
);
$
.
messager
.
alert
(
'
提示
'
,
'
查询数据异常,请稍后再试!
'
,
'
error
'
);
return
;
return
;
}
}
});
});
}
}
}
}
},
},
error
:
function
()
{
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
查询数据异常,请稍后再试!
'
,
'
error
'
);
$
.
messager
.
alert
(
'
提示
'
,
'
查询数据异常,请稍后再试!
'
,
'
error
'
);
return
;
return
;
}
}
});
});
}
}
function
bindEvent
()
{
function
bindEvent
()
{
setTimeout
(
function
()
{
setTimeout
(
function
()
{
var
bindBody
=
$
(
"
#pushList .datagrid-view2 .datagrid-body
"
);
var
bindBody
=
$
(
"
#pushList .datagrid-view2 .datagrid-body
"
);
//加载按钮信息到缓存中
//加载按钮信息到缓存中
if
(
roleBtnStr
)
{
if
(
roleBtnStr
)
{
var
roleBtnStrArr
=
JSON
.
parse
(
roleBtnStr
);
var
roleBtnStrArr
=
JSON
.
parse
(
roleBtnStr
);
bindBody
.
find
(
"
.datagrid-row
"
).
each
(
function
()
{
bindBody
.
find
(
"
.datagrid-row
"
).
each
(
function
()
{
for
(
var
i
=
0
;
i
<
roleBtnStrArr
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
roleBtnStrArr
.
length
;
i
++
)
{
if
(
roleBtnStrArr
[
i
]
&&
roleBtnStrArr
[
i
].
funId
)
{
if
(
roleBtnStrArr
[
i
]
&&
roleBtnStrArr
[
i
].
funId
)
{
var
thisId
=
$
(
this
).
find
(
"
[field='Id']
"
).
text
()
-
0
;
var
thisId
=
$
(
this
).
find
(
"
[field='Id']
"
).
text
()
-
0
;
if
(
roleBtnStrArr
[
i
].
funId
==
thisId
)
{
if
(
roleBtnStrArr
[
i
].
funId
==
thisId
)
{
$
(
this
).
find
(
"
[field='Id']
"
).
attr
(
"
data-btn
"
,
roleBtnStrArr
[
i
].
btnStr
);
$
(
this
).
find
(
"
[field='Id']
"
).
attr
(
"
data-btn
"
,
roleBtnStrArr
[
i
].
btnStr
);
//加载勾选状态
//加载勾选状态
$
(
this
).
find
(
"
[field='PushBtnList']
"
).
find
(
"
input
"
).
each
(
function
()
{
$
(
this
).
find
(
"
[field='PushBtnList']
"
).
find
(
"
input
"
).
each
(
function
()
{
var
thisValue
=
$
(
this
).
val
();
//勾选的值
var
thisValue
=
$
(
this
).
val
();
//勾选的值
if
(
roleBtnStrArr
[
i
].
btnStr
.
indexOf
(
thisValue
)
>
-
1
)
{
if
(
roleBtnStrArr
[
i
].
btnStr
.
indexOf
(
thisValue
)
>
-
1
)
{
$
(
this
).
prop
(
"
checked
"
,
"
checked
"
);
$
(
this
).
prop
(
"
checked
"
,
"
checked
"
);
}
}
});
});
}
}
}
}
}
}
});
});
}
}
//按钮勾选事件
//按钮勾选事件
bindBody
.
find
(
"
[field='PushBtnList']
"
).
find
(
"
input
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
bindBody
.
find
(
"
[field='PushBtnList']
"
).
find
(
"
input
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
var
checkStr
=
""
;
var
checkStr
=
""
;
$
(
this
).
closest
(
"
.datagrid-cell
"
).
find
(
"
input
"
).
each
(
function
()
{
$
(
this
).
closest
(
"
.datagrid-cell
"
).
find
(
"
input
"
).
each
(
function
()
{
var
thisValue
=
$
(
this
).
val
();
//勾选的值
var
thisValue
=
$
(
this
).
val
();
//勾选的值
var
isChecked
=
$
(
this
).
prop
(
"
checked
"
);
var
isChecked
=
$
(
this
).
prop
(
"
checked
"
);
if
(
isChecked
)
{
if
(
isChecked
)
{
checkStr
=
checkStr
+
thisValue
+
"
,
"
;
checkStr
=
checkStr
+
thisValue
+
"
,
"
;
}
}
});
});
if
(
checkStr
)
{
if
(
checkStr
)
{
checkStr
=
checkStr
.
substring
(
0
,
checkStr
.
length
-
1
);
checkStr
=
checkStr
.
substring
(
0
,
checkStr
.
length
-
1
);
}
}
$
(
this
).
closest
(
"
.datagrid-row
"
).
find
(
"
[field='Id']
"
).
attr
(
"
data-btn
"
,
checkStr
);
$
(
this
).
closest
(
"
.datagrid-row
"
).
find
(
"
[field='Id']
"
).
attr
(
"
data-btn
"
,
checkStr
);
});
});
},
500
);
},
500
);
$
(
"
#btnOK
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
$
(
"
#btnOK
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
if
(
confirm
(
"
您确定要保存吗?
"
))
{
$
.
messager
.
confirm
(
"
提示
"
,
"
您确定要保存吗?
"
,
function
(
data
){
var
bindList
=
$
(
"
#pushList .datagrid-view2 .datagrid-body .datagrid-row
"
);
var
bindList
=
$
(
"
#pushList .datagrid-view2 .datagrid-body .datagrid-row
"
);
var
bindArr
=
[];
var
bindArr
=
[];
var
btnStr
=
""
;
var
btnStr
=
""
;
bindList
.
each
(
function
()
{
bindList
.
each
(
function
()
{
var
funId
=
$
(
this
).
find
(
"
[field='Id']
"
).
text
();
var
funId
=
$
(
this
).
find
(
"
[field='Id']
"
).
text
();
var
btnStr
=
$
(
this
).
find
(
"
[field='Id']
"
).
attr
(
"
data-btn
"
);
var
btnStr
=
$
(
this
).
find
(
"
[field='Id']
"
).
attr
(
"
data-btn
"
);
if
(
btnStr
!==
undefined
&&
btnStr
!==
""
)
{
if
(
btnStr
!==
undefined
&&
btnStr
!==
""
)
{
var
bindJSON
=
{};
var
bindJSON
=
{};
bindJSON
.
funId
=
funId
;
bindJSON
.
funId
=
funId
;
bindJSON
.
btnStr
=
btnStr
;
bindJSON
.
btnStr
=
btnStr
;
bindArr
.
push
(
bindJSON
);
bindArr
.
push
(
bindJSON
);
}
}
});
});
if
(
bindArr
.
length
)
{
if
(
bindArr
.
length
)
{
btnStr
=
JSON
.
stringify
(
bindArr
);
btnStr
=
JSON
.
stringify
(
bindArr
);
}
}
$
.
ajax
({
$
.
ajax
({
url
:
"
/userBusiness/updateBtnStr
"
,
url
:
"
/userBusiness/updateBtnStr
"
,
type
:
"
post
"
,
type
:
"
post
"
,
data
:
{
data
:
{
userBusinessId
:
userBusinessId
,
userBusinessId
:
userBusinessId
,
btnStr
:
btnStr
btnStr
:
btnStr
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
if
(
res
&&
res
.
code
===
200
)
{
self
.
parent
.
$
.
colorbox
.
close
();
self
.
parent
.
$
.
colorbox
.
close
();
alert
(
"
操作成功!
"
);
$
.
messager
.
alert
(
'
提示
'
,
"
操作成功!
"
,
"
info
"
);
}
}
else
{
else
{
$
.
messager
.
show
({
$
.
messager
.
show
({
title
:
'
错误提示
'
,
title
:
'
错误提示
'
,
msg
:
'
保存按钮权限信息失败,请稍后重试!
'
msg
:
'
保存按钮权限信息失败,请稍后重试!
'
});
});
}
}
},
},
error
:
function
()
{
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
保存数据异常,请稍后再试!
'
,
'
error
'
);
$
.
messager
.
alert
(
'
提示
'
,
'
保存数据异常,请稍后再试!
'
,
'
error
'
);
return
;
return
;
}
}
});
});
}
}
);
});
});
}
}
</script>
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
erp_web/pages/user/userCustomer.html
View file @
149f78d7
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<title>
用户对应客户
</title>
<title>
用户对应客户
</title>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<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>
<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/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.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"
/>
<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/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/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
</head>
<body>
<body>
<!-- 数据显示table -->
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
</div>
<div>
<div>
<ul
id=
"tt"
></ul>
<ul
id=
"tt"
></ul>
</div>
</div>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(用户id)
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(用户id)
var
type
=
"
UserCustomer
"
;
var
type
=
"
UserCustomer
"
;
var
url
;
//定义链接地址
var
url
;
//定义链接地址
function
GetNode
(
ctype
)
{
function
GetNode
(
ctype
)
{
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
cnodes
=
''
;
var
cnodes
=
''
;
var
pnodes
=
''
;
var
pnodes
=
''
;
var
prevNode
=
''
;
//保存上一步所选父节点
var
prevNode
=
''
;
//保存上一步所选父节点
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
{
{
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
prevNode
=
pnode
.
id
;
//保存当前节点
prevNode
=
pnode
.
id
;
//保存当前节点
}
}
}
}
}
}
//cnodes = cnodes.substring(0, cnodes.length - 1);
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
if
(
ctype
==
'
child
'
)
{
if
(
ctype
==
'
child
'
)
{
return
cnodes
;
return
cnodes
;
}
}
else
{
else
{
return
pnodes
return
pnodes
}
}
;
;
};
};
$
(
function
()
{
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
$
(
'
#tt
'
).
tree
({
url
:
'
/supplier/findUserCustomer?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
url
:
'
/supplier/findUserCustomer?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
animate
:
true
,
checkbox
:
true
checkbox
:
true
});
});
$
(
"
#btnOK
"
).
click
(
$
(
"
#btnOK
"
).
click
(
function
()
{
function
()
{
var
id
=
checkUserDepot
();
var
id
=
checkUserDepot
();
if
(
!
id
)
{
if
(
!
id
)
{
url
=
'
/userBusiness/add
'
;
url
=
'
/userBusiness/add
'
;
}
}
else
{
else
{
url
=
'
/userBusiness/update?id=
'
+
id
;
url
=
'
/userBusiness/update?id=
'
+
id
;
}
}
$
.
messager
.
confirm
(
"
提示
"
,
"
您确定要保存吗?
"
,
function
(
data
){
if
(
confirm
(
"
您确定要保存吗?
"
))
{
$
.
ajax
({
url
:
url
,
$
.
ajax
({
type
:
"
post
"
,
url
:
url
,
data
:
{
type
:
"
post
"
,
info
:
JSON
.
stringify
({
data
:
{
type
:
type
,
info
:
JSON
.
stringify
({
keyid
:
url_id
,
type
:
type
,
value
:
GetNode
(
'
child
'
)
keyid
:
url_id
,
})
value
:
GetNode
(
'
child
'
)
},
})
dataType
:
"
json
"
,
},
async
:
false
,
dataType
:
"
json
"
,
success
:
function
(
res
)
{
async
:
false
,
if
(
res
&&
res
.
code
===
200
)
{
success
:
function
(
res
)
{
self
.
parent
.
$
.
colorbox
.
close
();
if
(
res
&&
res
.
code
===
200
)
{
$
.
messager
.
alert
(
'
提示
'
,
"
操作成功!
"
,
"
info
"
);
self
.
parent
.
$
.
colorbox
.
close
();
}
alert
(
"
操作成功!
"
);
else
{
}
$
.
messager
.
alert
(
'
提示
'
,
"
操作失败!
"
,
"
error
"
);
else
{
}
alert
(
"
操作失败!
"
);
}
}
});
}
});
});
}
}
}
);
);
});
});
//检查记录是否存在
//检查记录是否存在
function
checkUserDepot
()
{
function
checkUserDepot
()
{
//表示是否存在 0 = 不存在,存在就返回id
//表示是否存在 0 = 不存在,存在就返回id
var
flag
=
0
;
var
flag
=
0
;
//开始ajax名称检验,是否存在
//开始ajax名称检验,是否存在
$
.
ajax
({
$
.
ajax
({
type
:
"
get
"
,
type
:
"
get
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
dataType
:
"
json
"
,
dataType
:
"
json
"
,
async
:
false
,
async
:
false
,
data
:
({
data
:
({
type
:
type
,
type
:
type
,
keyId
:
url_id
keyId
:
url_id
}),
}),
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
data
&&
res
.
data
.
id
)
{
if
(
res
.
data
&&
res
.
data
.
id
)
{
flag
=
res
.
data
.
id
;
flag
=
res
.
data
.
id
;
}
}
},
},
//此处添加错误处理
//此处添加错误处理
error
:
function
()
{
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
检查用户对应功能是否存在异常,请稍后再试!
'
,
'
error
'
);
$
.
messager
.
alert
(
'
提示
'
,
'
检查用户对应功能是否存在异常,请稍后再试!
'
,
'
error
'
);
return
;
return
;
}
}
});
});
return
flag
;
return
flag
;
}
}
</script>
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
erp_web/pages/user/userDepot.html
View file @
149f78d7
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<title>
用户对应部门
</title>
<title>
用户对应部门
</title>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<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>
<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/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.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"
/>
<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/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/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
</head>
<body>
<body>
<!-- 数据显示table -->
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
</div>
<div>
<div>
<ul
id=
"tt"
></ul>
<ul
id=
"tt"
></ul>
</div>
</div>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(用户id)
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(用户id)
var
type
=
"
UserDepot
"
;
var
type
=
"
UserDepot
"
;
var
url
;
//定义链接地址
var
url
;
//定义链接地址
function
GetNode
(
ctype
)
{
function
GetNode
(
ctype
)
{
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
cnodes
=
''
;
var
cnodes
=
''
;
var
pnodes
=
''
;
var
pnodes
=
''
;
var
prevNode
=
''
;
//保存上一步所选父节点
var
prevNode
=
''
;
//保存上一步所选父节点
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
{
{
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
prevNode
=
pnode
.
id
;
//保存当前节点
prevNode
=
pnode
.
id
;
//保存当前节点
}
}
}
}
}
}
//cnodes = cnodes.substring(0, cnodes.length - 1);
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
if
(
ctype
==
'
child
'
)
{
if
(
ctype
==
'
child
'
)
{
return
cnodes
;
return
cnodes
;
}
}
else
{
else
{
return
pnodes
return
pnodes
}
}
;
;
};
};
$
(
function
()
{
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
$
(
'
#tt
'
).
tree
({
url
:
'
/depot/findUserDepot?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
url
:
'
/depot/findUserDepot?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
animate
:
true
,
checkbox
:
true
checkbox
:
true
});
});
$
(
"
#btnOK
"
).
click
(
$
(
"
#btnOK
"
).
click
(
function
()
{
function
()
{
var
id
=
checkUserDepot
();
var
id
=
checkUserDepot
();
if
(
!
id
)
{
if
(
!
id
)
{
url
=
'
/userBusiness/add
'
;
url
=
'
/userBusiness/add
'
;
}
}
else
{
else
{
url
=
'
/userBusiness/update?id=
'
+
id
;
url
=
'
/userBusiness/update?id=
'
+
id
;
}
}
$
.
messager
.
confirm
(
"
提示
"
,
"
您确定要保存吗?
"
,
function
(
data
){
if
(
confirm
(
"
您确定要保存吗?
"
))
{
$
.
ajax
({
url
:
url
,
$
.
ajax
({
type
:
"
post
"
,
url
:
url
,
data
:
{
type
:
"
post
"
,
info
:
JSON
.
stringify
({
data
:
{
type
:
type
,
info
:
JSON
.
stringify
({
keyid
:
url_id
,
type
:
type
,
value
:
GetNode
(
'
child
'
)
keyid
:
url_id
,
})
value
:
GetNode
(
'
child
'
)
},
})
dataType
:
"
json
"
,
},
async
:
false
,
dataType
:
"
json
"
,
success
:
function
(
res
)
{
async
:
false
,
if
(
res
&&
res
.
code
===
200
)
{
success
:
function
(
res
)
{
self
.
parent
.
$
.
colorbox
.
close
();
if
(
res
&&
res
.
code
===
200
)
{
$
.
messager
.
alert
(
'
提示
'
,
"
操作成功!
"
,
"
info
"
);
self
.
parent
.
$
.
colorbox
.
close
();
}
alert
(
"
操作成功!
"
);
else
{
}
$
.
messager
.
alert
(
'
提示
'
,
"
操作失败!
"
,
"
error
"
);
else
{
}
alert
(
"
操作失败!
"
);
}
}
});
}
});
});
}
}
);
}
);
});
});
//检查记录是否存在
function
checkUserDepot
()
{
//检查记录是否存在
//表示是否存在 0 = 不存在,存在就返回id
function
checkUserDepot
()
{
var
flag
=
0
;
//表示是否存在 0 = 不存在,存在就返回id
//开始ajax名称检验,是否存在
var
flag
=
0
;
$
.
ajax
({
//开始ajax名称检验,是否存在
type
:
"
get
"
,
$
.
ajax
({
url
:
"
/userBusiness/checkIsValueExist
"
,
type
:
"
get
"
,
dataType
:
"
json
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
async
:
false
,
dataType
:
"
json
"
,
data
:
({
async
:
false
,
type
:
type
,
data
:
({
keyId
:
url_id
type
:
type
,
}),
keyId
:
url_id
success
:
function
(
res
)
{
}),
if
(
res
.
data
&&
res
.
data
.
id
)
{
success
:
function
(
res
)
{
flag
=
res
.
data
.
id
;
if
(
res
.
data
&&
res
.
data
.
id
)
{
}
flag
=
res
.
data
.
id
;
},
}
//此处添加错误处理
},
error
:
function
()
{
//此处添加错误处理
$
.
messager
.
alert
(
'
提示
'
,
'
检查用户对应功能是否存在异常,请稍后再试!
'
,
'
error
'
);
error
:
function
()
{
return
;
$
.
messager
.
alert
(
'
提示
'
,
'
检查用户对应功能是否存在异常,请稍后再试!
'
,
'
error
'
);
}
return
;
});
}
return
flag
;
});
}
return
flag
;
</script>
}
</body>
</script>
</body>
</html>
</html>
\ No newline at end of file
erp_web/pages/user/userRole.html
View file @
149f78d7
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<title>
用户对应角色
</title>
<title>
用户对应角色
</title>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<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>
<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/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.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"
/>
<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/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/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
</head>
<body>
<body>
<!-- 数据显示table -->
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
</div>
<div>
<div>
<ul
id=
"tt"
></ul>
<ul
id=
"tt"
></ul>
</div>
</div>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(用户id)
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(用户id)
var
type
=
"
UserRole
"
;
var
type
=
"
UserRole
"
;
var
url
;
//定义链接地址
var
url
;
//定义链接地址
function
GetNode
(
ctype
)
{
function
GetNode
(
ctype
)
{
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
cnodes
=
''
;
var
cnodes
=
''
;
var
pnodes
=
''
;
var
pnodes
=
''
;
var
prevNode
=
''
;
//保存上一步所选父节点
var
prevNode
=
''
;
//保存上一步所选父节点
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
{
{
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
prevNode
=
pnode
.
id
;
//保存当前节点
prevNode
=
pnode
.
id
;
//保存当前节点
}
}
}
}
}
}
//cnodes = cnodes.substring(0, cnodes.length - 1);
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
if
(
ctype
==
'
child
'
)
{
if
(
ctype
==
'
child
'
)
{
return
cnodes
;
return
cnodes
;
}
}
else
{
else
{
return
pnodes
return
pnodes
}
}
;
;
};
};
$
(
function
()
{
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
$
(
'
#tt
'
).
tree
({
url
:
'
/role/findUserRole?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
url
:
'
/role/findUserRole?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
animate
:
true
,
checkbox
:
true
checkbox
:
true
});
});
$
(
"
#btnOK
"
).
click
(
$
(
"
#btnOK
"
).
click
(
function
()
{
function
()
{
var
id
=
checkUserRole
();
var
id
=
checkUserRole
();
if
(
!
id
)
{
if
(
!
id
)
{
url
=
'
/userBusiness/add
'
;
url
=
'
/userBusiness/add
'
;
}
}
else
{
else
{
url
=
'
/userBusiness/update?id=
'
+
id
;
url
=
'
/userBusiness/update?id=
'
+
id
;
}
}
$
.
messager
.
confirm
(
"
提示
"
,
"
您确定要保存吗?
"
,
function
(
data
){
if
(
confirm
(
"
您确定要保存吗?
"
))
{
$
.
ajax
({
url
:
url
,
$
.
ajax
({
type
:
"
post
"
,
url
:
url
,
data
:
{
type
:
"
post
"
,
info
:
JSON
.
stringify
({
data
:
{
type
:
type
,
info
:
JSON
.
stringify
({
keyid
:
url_id
,
type
:
type
,
value
:
GetNode
(
'
child
'
)
keyid
:
url_id
,
})
value
:
GetNode
(
'
child
'
)
},
})
dataType
:
"
json
"
,
},
async
:
false
,
dataType
:
"
json
"
,
success
:
function
(
res
)
{
async
:
false
,
if
(
res
&&
res
.
code
===
200
)
{
success
:
function
(
res
)
{
self
.
parent
.
$
.
colorbox
.
close
();
if
(
res
&&
res
.
code
===
200
)
{
$
.
messager
.
alert
(
'
提示
'
,
"
操作成功!
"
,
"
info
"
);
self
.
parent
.
$
.
colorbox
.
close
();
}
alert
(
"
操作成功!
"
);
else
{
}
$
.
messager
.
alert
(
'
提示
'
,
"
操作失败!
"
,
"
error
"
);
else
{
}
alert
(
"
操作失败!
"
);
}
}
});
}
});
});
}
}
);
}
);
});
});
//检查记录是否存在
function
checkUserRole
()
{
//检查记录是否存在
//表示是否存在 0 = 不存在,存在就返回id
function
checkUserRole
()
{
var
flag
=
0
;
//表示是否存在 0 = 不存在,存在就返回id
//开始ajax名称检验,是否存在
var
flag
=
0
;
$
.
ajax
({
//开始ajax名称检验,是否存在
type
:
"
get
"
,
$
.
ajax
({
url
:
"
/userBusiness/checkIsValueExist
"
,
type
:
"
get
"
,
dataType
:
"
json
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
async
:
false
,
dataType
:
"
json
"
,
data
:
({
async
:
false
,
type
:
type
,
data
:
({
keyId
:
url_id
type
:
type
,
}),
keyId
:
url_id
success
:
function
(
res
)
{
}),
if
(
res
.
data
&&
res
.
data
.
id
)
{
success
:
function
(
res
)
{
flag
=
res
.
data
.
id
;
if
(
res
.
data
&&
res
.
data
.
id
)
{
}
flag
=
res
.
data
.
id
;
},
}
//此处添加错误处理
},
error
:
function
()
{
//此处添加错误处理
$
.
messager
.
alert
(
'
提示
'
,
'
检查用户对应功能是否存在异常,请稍后再试!
'
,
'
error
'
);
error
:
function
()
{
return
;
$
.
messager
.
alert
(
'
提示
'
,
'
检查用户对应功能是否存在异常,请稍后再试!
'
,
'
error
'
);
}
return
;
});
}
return
flag
;
});
}
return
flag
;
</script>
}
</body>
</script>
</body>
</html>
</html>
\ No newline at end of file
src/main/resources/application.properties
View file @
149f78d7
...
@@ -2,7 +2,7 @@ server.port=8080
...
@@ -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.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.driverClassName
=
com.mysql.jdbc.Driver
spring.datasource.username
=
root
spring.datasource.username
=
root
spring.datasource.password
=
1234
spring.datasource.password
=
1234
56
#generatorConfig专用属性
#generatorConfig专用属性
project
=
src/main/java
project
=
src/main/java
resource
=
src/main/resources
resource
=
src/main/resources
...
...
src/main/resources/logback-spring.xml
View file @
149f78d7
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<contextName>
logback
</contextName>
<contextName>
logback
</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
<!-- 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