对页面的按钮进行权限控制
This commit is contained in:
@@ -222,6 +222,31 @@
|
||||
return btnEnableList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断datagrid是否显示操作列
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isShowOpFun() {
|
||||
var btnStr = getBtnStr();
|
||||
var isShowOp = false;
|
||||
if(btnStr && btnStr.indexOf(1)>-1){
|
||||
isShowOp = true; //显示
|
||||
}
|
||||
return isShowOp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 工具栏显示与否
|
||||
*/
|
||||
function toolbarStatus() {
|
||||
var btnStr = getBtnStr();
|
||||
if(btnStr && btnStr.indexOf(1)>-1) {
|
||||
$(".datagrid-toolbar").show();
|
||||
} else {
|
||||
$(".datagrid-toolbar").remove();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* js获取当前时间, 格式“yyyy-MM-dd HH:MM:SS”
|
||||
*/
|
||||
|
||||
@@ -43,7 +43,7 @@ function initSelectInfo(lei) {
|
||||
//按钮权限列表
|
||||
else if (lei == 3) {
|
||||
var btnStr = userBusinessList[0].btnStr;
|
||||
if (btnStr != null) {
|
||||
if (btnStr != null && btnStr !="") {
|
||||
var btnObj = JSON.parse(btnStr);
|
||||
for (var j = 0; j < btnObj.length; j++) {
|
||||
btnStrList.push(btnObj[j]);
|
||||
|
||||
@@ -233,8 +233,10 @@
|
||||
var str = '';
|
||||
var orgId = rec.organId ? rec.organId : 0;
|
||||
str += '<img title="查看" src="/js/easyui/themes/icons/list.png" style="cursor: pointer;" onclick="showAccountHead(\'' + index + '\');"/> ';
|
||||
str += '<img title="编辑" src="/js/easyui/themes/icons/pencil.png" style="cursor: pointer;" onclick="editAccountHead(\'' + index + '\');"/> ';
|
||||
str += '<img title="删除" src="/js/easyui/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteAccountHead('+ rec.id +',' + orgId +',' + rec.totalprice + ');"/>';
|
||||
if(isShowOpFun()) {
|
||||
str += '<img title="编辑" src="/js/easyui/themes/icons/pencil.png" style="cursor: pointer;" onclick="editAccountHead(\'' + index + '\');"/> ';
|
||||
str += '<img title="删除" src="/js/easyui/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteAccountHead(' + rec.id + ',' + orgId + ',' + rec.totalprice + ');"/>';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
@@ -273,6 +275,7 @@
|
||||
}
|
||||
});
|
||||
dgResize();
|
||||
toolbarStatus();
|
||||
}
|
||||
|
||||
//初始化表格数据-明细列表-编辑状态
|
||||
|
||||
@@ -61,7 +61,9 @@
|
||||
formatter:function(value,rec,index) {
|
||||
var str = '';
|
||||
str += '<img title="编辑" src="/js/easyui/themes/icons/pencil.png" style="cursor: pointer;" onclick="editSupplier(\'' + index + '\');"/> ';
|
||||
str += '<img title="删除" src="/js/easyui/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteSupplier(\'' + rec.id + '\');"/>';
|
||||
if(isShowOpFun()) {
|
||||
str += '<img title="删除" src="/js/easyui/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteSupplier(\'' + rec.id + '\');"/>';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
@@ -137,6 +139,7 @@
|
||||
}
|
||||
});
|
||||
dgResize();
|
||||
toolbarStatus();
|
||||
showSupplierDetails(1,initPageSize);
|
||||
}
|
||||
|
||||
@@ -582,6 +585,9 @@
|
||||
oldSupplier = res.supplier;
|
||||
$('#supplierDlg').dialog('open').dialog('setTitle','<img src="/js/easyui/themes/icons/pencil.png"/> 编辑'+listType +"信息");
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
if(!isShowOpFun()){
|
||||
$("#saveSupplier").hide();
|
||||
}
|
||||
$('#supplierFM').form('load',row);
|
||||
supplierID = sId;
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
|
||||
@@ -448,14 +448,16 @@
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ field: 'id',width:35,align:"center",checkbox:true},
|
||||
{ title: '操作',field: 'op',align:"center",width:opWidth,
|
||||
{ title: '操作',field: 'op',align:"center", width:opWidth,
|
||||
formatter:function(value,rec,index) {
|
||||
var str = '';
|
||||
var orgId = rec.organId? rec.organId:0;
|
||||
str += '<img title="查看" src="/js/easyui/themes/icons/list.png" style="cursor: pointer;" onclick="showDepotHead(\'' + index + '\');"/> ';
|
||||
str += '<img title="编辑" src="/js/easyui/themes/icons/pencil.png" style="cursor: pointer;" onclick="editDepotHead(\'' + index + '\');"/> ';
|
||||
str += '<img title="删除" src="/js/easyui/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteDepotHead('+ rec.id +',' + orgId +',' + rec.totalPrice+',' + rec.status + ');"/>';
|
||||
if(isShowSkip) {
|
||||
if(isShowOpFun()){
|
||||
str += '<img title="编辑" src="/js/easyui/themes/icons/pencil.png" style="cursor: pointer;" onclick="editDepotHead(\'' + index + '\');"/> ';
|
||||
str += '<img title="删除" src="/js/easyui/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteDepotHead('+ rec.id +',' + orgId +',' + rec.totalPrice+',' + rec.status + ');"/>';
|
||||
}
|
||||
if(isShowSkip) {
|
||||
str += ' <img title="' + opTitle + '" src="/js/easyui/themes/icons/redo.png" style="cursor: pointer;" onclick="skipDepotHead(\'' + index + '\');"/>';
|
||||
}
|
||||
return str;
|
||||
@@ -507,6 +509,7 @@
|
||||
}
|
||||
});
|
||||
dgResize();
|
||||
toolbarStatus();
|
||||
}
|
||||
//查找库存的方法
|
||||
function findStockNumById(depotId, meId, monthTime, body, input, ratio, type){
|
||||
|
||||
Reference in New Issue
Block a user