Anthony

crm账套 模块化

......@@ -86,8 +86,8 @@ define(['i18n!accountset/nls/resource', 'cls', 'base/index', 'index/index'], fun
});
//行转换
function getSelectedRow(){
var row = this.grid.datagrid('getSelected');
function getSelectedRow(inst){
var row = inst.grid.datagrid('getSelected');
return row?{
actId:row.ACT_ID,
actCode:row.ACT_CODE,
......@@ -109,39 +109,39 @@ define(['i18n!accountset/nls/resource', 'cls', 'base/index', 'index/index'], fun
function addWindow(inst){
//添加账套详情页面
index.showPanel({text:resource.title.detail,url:"./accountSetDetail/accountSetDetailAdd"}, true, function(){
this.grid.datagrid("reload");
inst.grid.datagrid("reload");
});
}
//编辑页面弹出绑定按钮
function editWindow(inst){
var row = getSelectedRow.call(this);
var row = getSelectedRow.call(this,inst);
if(row == null){
$.messager.alert(resource.msg_title, resource.msgEditTip);
}else{
index.showPanel({text:resource.title.detail,url:"./accountSetDetail/accountSetDetailEdit?actId="+row.actId+"&actCode="+row.actCode}, true, function(){
this.grid.datagrid("reload");
inst.grid.datagrid("reload");
});
}
}
//删除
function deleteData(inst){
var accountSet = getSelectedRow.call(this);
var accountSet = getSelectedRow.call(this,inst);
if(accountSet == null){
$.messager.alert(resource.msg_title, resource.msgRemoveTip);
}else{
if(accountSet.actType==resource.accountset.title.sonAccount){
if(accountSet.actType==resource.title.sonAccount){
$.messager.confirm(resource.msg_title, resource.confirmDelete, function(r){
if(r){
accountSet.enable = "";
$.JSON("./accountSet/delete.json", accountSet, function(result){
if(responseUtils(result)){
this.grid.datagrid("reload");
if($.response(result)){
inst.grid.datagrid("reload");
}
});
}
});
}else{
$.messager.alert(resource.msg_title, resource.accountset.title.overActCntdelt);
$.messager.alert(resource.msg_title, resource.title.overActCntdelt);
}
}
}
......
......@@ -13,6 +13,12 @@ define({
deleteRank:'系统默认等级不能删除!',
select:'请选择',
noLimit:'不限',
mustSubmitAccountBeforeSecondGroup:'新增第二个网点组之前,需要保存账套信息,是否保存?',
saveTitle:'确定保存?',
confirmDelete:'你确定要删除这条信息吗?',
onAddCannot:"确认新增当前选择数据?",
onDeleteCannot:"数据删除后无法恢复,确认删除当前选择数据?",
onDeleteGroupCannot:"网点组删除后,其下的网点同时删除,且无法恢复,请确认删除当前网点组?",
title:{
name:'CRM账套',
detail:'CRM账套详情',
......