Commit 0c917016 authored by 季圣华's avatar 季圣华
Browse files

no commit message

parent 7907b729
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String clientIp = Tools.getCurrentUserIP();
%>
<!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="<%=path%>/images/favicon.ico" type="image/x-icon" />
<script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script>
<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui-1.3.5/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui-1.3.5/themes/icon.css" />
<link type="text/css" rel="stylesheet" href="<%=path%>/css/common.css" />
<script type="text/javascript" src="<%=path%>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path%>/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 = '<%=path %>/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: "<%=path%>/userBusiness/getBasicData.action",
type: "get",
data: {
Type: 'RoleFunctions',
KeyId: keyId
},
success: function(res){
if(res && res.showModel && res.showModel.map && res.showModel.map.userBusinessList && res.showModel.map.userBusinessList[0]){
userBusinessId = res.showModel.map.userBusinessList[0].id;
roleBtnStr = res.showModel.map.userBusinessList[0].btnStr;
var getValue = res.showModel.map.userBusinessList[0].value;
getValue = getValue.substring(1,getValue.length-1);
if(getValue.indexOf("][")){
var arr = getValue.split("][");
arr = arr.toString();
$.ajax({
url: "<%=path%>/functions/findByIds.action",
type: "get",
data: {
FunctionsIDs: arr
},
success: function(rec){
$("#tableData").datagrid('loadData',JSON.parse(rec));
},
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: "<%=path%>/userBusiness/updateBtnStr.action",
type: "get",
data: {
UserBusinessID: userBusinessId,
BtnStr: btnStr
},
success: function (res) {
if (res) {
self.parent.$.colorbox.close();
alert("操作成功!");
}
else {
$.messager.show({
title: '错误提示',
msg: '保存按钮权限信息失败,请稍后重试!'
});
}
},
error: function () {
$.messager.alert('提示', '保存数据异常,请稍后再试!', 'error');
return;
}
});
}
});
}
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
......@@ -46,7 +46,8 @@
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>&nbsp;&nbsp;
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>&nbsp;&nbsp;
<a id="btnSetRole" class='easyui-linkbutton iframe iframe_LargeForm' href='#' title='分配角色'>分配角色</a>&nbsp;&nbsp;
<a id="btnSetDepart" class='easyui-linkbutton iframe iframe_LargeForm' href='#' title='分配仓库'>分配仓库</a>
<a id="btnSetDepart" class='easyui-linkbutton iframe iframe_LargeForm' href='#' title='分配仓库'>分配仓库</a>&nbsp;&nbsp;
<a id="btnSetCustomer" class='easyui-linkbutton iframe iframe_LargeForm' href='#' title='分配客户'>分配客户</a>
</td>
</tr>
</table>
......@@ -92,32 +93,11 @@
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form>
</div>
<!--
<div id="userLoginDlg" class="easyui-dialog" style="width:400px;height:280px;padding:10px 20px"
closed="true" buttons="#logindlg-buttons" modal="true" iconCls="icon-save" collapsible="false" closable="true">
<div class="fitem" style="padding:5px">
<label>登录名称&nbsp;&nbsp;</label>
<input name="loginname" id="loginname" rows="3" cols="3" style="width: 230px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label>登录密码&nbsp;&nbsp;</label>
<input name="loginpwd" id="loginpwd" rows="3" cols="3" style="width: 230px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label>确定密码&nbsp;&nbsp;</label>
<input name="confirmloginpwd" id="confirmloginpwd" rows="3" cols="3" style="width: 230px;height: 20px"/>
</div>
</div>
<div id="logindlg-buttons">
<a href="javascript:void(0)" id="saveloginame" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="canceloginame" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#userLoginDlg').dialog('close')">取消</a>
</div>
-->
<div id="dlg-buttons">
<a href="javascript:void(0)" id="resetPwd" class="easyui-linkbutton" iconCls="icon-redo">重置密码</a>
<a href="javascript:void(0)" id="saveusername" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelusername" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#userDlg').dialog('close')">取消</a>
</div>
<script type="text/javascript">
//初始化界面
$(function()
......@@ -410,6 +390,35 @@
userID = 0;
url = '<%=path %>/user/create.action';
}
//重置用户密码
$("#resetPwd").off("click").on("click",function() {
$.messager.confirm('重置用户密码', '确定重置该用户的密码为123456吗?', function (r) {
if (r) {
$.ajax({
type: "post",
url: "<%=path %>/user/resetPwd.action",
dataType: "json",
data: ({
userID: userID
}),
success: function (res) {
if (res) {
var flag = res - 0;
if (flag) {
$.messager.alert('提示', '重置密码成功', 'info');
}
}
},
//此处添加错误处理
error: function () {
$.messager.alert('提示', '重置密码失败,请稍后再试!', 'error');
return;
}
});
}
});
});
//保存用户信息
$("#saveusername").unbind().bind({
......@@ -604,6 +613,16 @@
}
this.href = "<%=path %>/pages/user/userDepot.jsp?id=" + currentRow.id;
});
//分配客户
$('#btnSetCustomer').click(function () {
var currentRow = $("#tableData").datagrid("getSelected");
if (currentRow == null) {
alert("请选择一条数据再操作!");
return false;
}
this.href = "<%=path %>/pages/user/userCustomer.jsp?id=" + currentRow.id;
});
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
......@@ -15,6 +15,7 @@
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
<link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css" />
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
......@@ -32,21 +33,17 @@
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
<table id="searchTable">
<tr>
<td>发货仓库:</td>
<td>
<select name="searchProjectId" id="searchProjectId" style="width:80px;"></select>
</td>
<td>单据编号:</td>
<td>
<input type="text" name="searchNumber" id="searchNumber" style="width:60px;"/>
<input type="text" name="searchNumber" id="searchNumber" style="width:100px;"/>
</td>
<td>单据日期:</td>
<td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td>
<td>-</td>
<td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td>
<td>&nbsp;</td>
<td>
......@@ -62,48 +59,36 @@
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div>
<div id="depotHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
<div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotHeadFM" method="post" novalidate>
<table>
<tr>
<td>发货仓库:</td>
<td style="padding:5px">
<select name="ProjectId" id="ProjectId" style="width:120px;"></select>
</td>
<td>单据日期:</td>
<td style="padding:5px">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:120px;"/>
</td>
<td>经手人:</td>
<td style="padding:5px">
<select name="HandsPersonId" id="HandsPersonId" style="width:120px;"></select>
</td>
<td style="width:50px;"></td>
<td style="padding:5px;width:120px;"></td>
</tr>
<tr>
<td>收货仓库:</td>
<td style="padding:5px">
<select name="AllocationProjectId" id="AllocationProjectId" style="width:120px;"></select>
</td>
<td>单据编号:</td>
<td style="padding:5px"><input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 120px;"/>
</td>
<td>单据备注:</td>
<td style="padding:5px">
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 120px;"/>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>商品列表:</td>
<td colspan="7">
<!-- 商品列表table -->
<table id="materialData" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
<tr>
<td style="width:60px;">单据日期:</td>
<td style="padding:5px;width:170px;">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
</td>
<td style="width:70px;">单据编号:</td>
<td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width:140px;"/>
</td>
<td style="width:80px;"></td>
<td style="padding:5px;width:170px;"></td>
<td style="width:70px;"></td>
<td style="padding:5px"></td>
<td style="width:100px;"></td>
</tr>
<tr>
<td colspan="9">
<!-- 商品列表table -->
<table id="materialData" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
<tr>
<td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea>
</td>
</tr>
</table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form>
......@@ -112,50 +97,37 @@
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
</div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table>
<tr>
<td>发货仓库:</td>
<td style="padding:5px;width:120px;">
<span id="ProjectIdShow"></span>
</td>
<td>单据日期:</td>
<td style="padding:5px;width:120px;">
<span id="OperTimeShow"></span>
</td>
<td>经手人:</td>
<td style="padding:5px">
<span id="HandsPersonIdShow"></span>
</td>
<td style="width:50px;"></td>
<td style="padding:5px;width:120px;">
</td>
</tr>
<tr>
<td>收货仓库:</td>
<td style="padding:5px;width:120px;">
<span id="AllocationProjectIdShow"></span>
</td>
<td>单据编号:</td>
<td style="padding:5px">
<span id="NumberShow"></span>
</td>
<td>单据备注:</td>
<td style="padding:5px">
<span id="RemarkShow"></span>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>商品列表:</td>
<td colspan="7">
<!-- 商品列表table -->
<table id="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
</table>
<table>
<tr>
<td style="width:60px;">单据日期:</td>
<td style="padding:5px;width:130px;">
<span id="OperTimeShow"></span>
</td>
<td style="width:70px;">单据编号:</td>
<td style="padding:5px;width:130px;">
<span id="NumberShow"></span>
</td>
<td style="width:80px;"></td>
<td style="padding:5px;width:140px;"></td>
<td style="width:70px;"></td>
<td style="padding:5px;width:140px;"></td>
<td style="width:100px;"></td>
</tr>
<tr>
<td colspan="9" style="width: 1130px;">
<!-- 商品列表table -->
<table id="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
<tr>
<td style="width:60px;">单据备注:</td>
<td colspan="8" style="height:35px;">
<span id="RemarkShow" style="width: 1070px; height:35px;"></span>
</td>
</tr>
</table>
</div>
</body>
</html>
\ No newline at end of file
......@@ -15,6 +15,7 @@
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
<link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css" />
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
......
......@@ -15,6 +15,7 @@
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
<link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css" />
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
......
......@@ -34,6 +34,7 @@
<td>
<select name="searchType" id="searchType" style="width:70px;">
<option value="">全部</option>
<option value="业务员">业务员</option>
<option value="仓管员">仓管员</option>
<option value="财务员">财务员</option>
</select>
......@@ -63,6 +64,7 @@
<td style="padding:5px">
<select name="Type" id="Type" style="width:230px;">
<option value="">请选择</option>
<option value="业务员">业务员</option>
<option value="仓管员">仓管员</option>
<option value="财务员">财务员</option>
</select>
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment