Anthony

bizEntity 模块化

define(function(){
define(['i18n!bizEntity/nls/resource', 'cls', 'base/index', 'index/index'], function (resource, Class, base, indexlayout){
return {
resource:resource,
init:function(pltId){
var body=$(document.body);
var pannel = getSelectedPanel();//初始化面板
var pannel = indexlayout.getSelectedPanel();//初始化面板
var page = pannel.children(".bizEntity-index-page").layout({
fit:true
});//定义面板内div
......@@ -14,44 +15,46 @@ define(function(){
return $('<div></div>').appendTo(center).datagrid({
url:'./query/'+condId+'.json',
toolbar:$('<div class="clearfix"></div>').rs_toolbar({
title: resource.bizentity.title,
authz:getAuthzUtils('bizEntity'),
title: resource.title,
authz:base.getAuthz('bizEntity'),
buttons:[{
text:resource.btn.select,
text:base.resource.btn.select,
iconCls:'btn-select select-condition',
code:'view',
handler: function(){
showCondObject(condId,datagridReload);
base.showCondObject(condId,datagridReload);
}
},{
text:resource.btn.add,
text:base.resource.btn.add,
iconCls:'btn-add',
code:'edit',
handler: addBizEntity
},{
text:resource.btn.edit,
text:base.resource.btn.edit,
iconCls:'btn-edit',
code:'edit',
handler: editBizEntity
},{
text:resource.btn.remove,
text:base.resource.btn.remove,
iconCls:'btn-remove',
code:'edit',
handler: removeBizEntity
}],
tools:[{
text:resource.btn.refresh,
text:base.resource.btn.refresh,
iconCls:'btn-refresh',
handler:panelRefreshUtils
handler:function(){
indexlayout.getSelectedPanel().panel("refresh");
}
}]
}),
columns:[[
{field:'ck',checkbox:true },
{field:'BECODE',title:resource.bizentity.grid.code, width:150},
{field:'BENAME',title:resource.bizentity.grid.name, width:200},
{field:'ORGTYPE',title:resource.bizentity.grid.type, width:120},
{field:'BEDESC',title:resource.bizentity.grid.desc, width:300,formatter:formatText},
{field:'VALID',title:resource.bizentity.grid.valid, width:100}
{field:'BECODE',title:resource.grid.code, width:150},
{field:'BENAME',title:resource.grid.name, width:200},
{field:'ORGTYPE',title:resource.grid.type, width:120},
{field:'BEDESC',title:resource.grid.desc, width:300,formatter:formatText},
{field:'VALID',title:resource.grid.valid, width:100}
]],
onLoadSuccess:function(data){
if(Number(pltId)!=1){
......@@ -70,27 +73,29 @@ define(function(){
}
//新建经营主体
function addBizEntity(){
showTabUtils({text:resource.bizentity.detailTitle,url:'./bizEntity/details'},true,function(){grid.datagrid("reload");});
indexlayout.showPanel({text:resource.detailTitle,url:'./bizEntity/details'},true,function(){grid.datagrid("reload");});
}
//编辑的经营主体
function editBizEntity(){
var row=grid.datagrid('getSelected');
if(row){
showTabUtils({text:resource.bizentity.detailTitle,url:'./bizEntity/details',id:row.BEID},true,function(){grid.datagrid("reload");});
indexlayout.showPanel({text:resource.detailTitle,url:'./bizEntity/details',id:row.BEID},true,function(){grid.datagrid("reload");});
}else{
$.messager.alert(resource.msg_title,resource.msgEditTip);
$.messager.alert(base.resource.msg_title,base.resource.msgEditTip);
}
}
//删除主体
function removeBizEntity(){
var row=grid.datagrid('getSelected');
if(row==null){
$.messager.alert(resource.msg_title, resource.msgRemoveTip);
$.messager.alert(base.resource.msg_title, resource.msgRemoveTip);
}else{
$.messager.confirm(resource.msg_title, resource.confirmDelete, function(r){
$.messager.confirm(base.resource.msg_title, resource.confirmDelete, function(r){
if(r){
$.post("./bizEntity/delete.json",{id:row.BEID},function(result){
if(responseUtils(result)){
console.log(result);
if($.response(result)){
console.log(result);
grid.datagrid("reload");
}
});
......@@ -103,7 +108,7 @@ define(function(){
if(params){
grid.datagrid("reload",params);
}else{
grid.datagrid("reload",getCondObjectValue(condId));
grid.datagrid("reload",base.getCondObjectValue(condId));
}
}
}
......
define({
root:{
title:'经营主体',
detailTitle:'经营主体详情',
channelTitle:'主体经营渠道',
closeAct:'结算账套',
paymentmethod:'收款方式',
saveTitle:'确定保存?',
orgTypeDialogTitle:'选择新建的组织类型',
msgRemoveTip:'请选择要删除的数据!',
confirmDelete:'你确定要删除这条信息吗?',
grid:{
code:'编号',
name:'名称',
desc:'描述 ',
type:'组织类型',
valid:'可用',
bebcode:'编号',
bebname:'名称',
bename:'主体名称',
bebdesc:'描述',
ptvalid:'可用',
beiname:'开票单位名称',
beitaxnum:'税务登记号',
beitaxrate:'税率',
ptphone:'电话',
ptaddr:'地址',
cuname:'币种单位',
bizinvoicelist:'开票信息',
bizaccountlist:'常用账户',
bizpaywaypist:'收款方式',
beasource:'收支渠道/银行',
beaname:'账户名',
beaaccount:'BEAACCOUNT',
bearate:'交易费率',
pwid:'收款方式ID',
pwname:'收款方式名称',
curate:'汇率',
bepproceeds:'收款渠道/银行',
beppayee:'收款人',
bepaccount:'收款账号',
bepincome:'计销售收入',
beppoint:'消费积分',
piid:'调用支付接口'
},
channel:{
title:'经营渠道',
grid:{
name:'名称',
desc:'描述 ',
brand:'经营品牌',
valid:'可用'
},
check:{
valid:'只有系统管理平台才能编辑渠道信息!'
}
},
bizChannelgridtitle:'经营渠道',
bizChannelgrid:{
beName:'上级经营主体'
},
check:{
setOfBook:'每个经营主体必须创建至少一个结算账套',
channel:'每个经营主体必须创建至少一个经营渠道',
bookName:'该结算账套的名称已与当前主体的其它已有结算账套重复',
beiName:'一个结算账套内开票名称禁止重复',
numberLetterValid:'编号只能输入数字、字母或其组合',
ptphone:'请输入正确的号码,格式如:0519-83360776或83360776,3~4位区号加7~8位号码,区号可以省略!',
decimalValid:'只能输入1位整数并且小数位最多4位小数,例如:1.1234',
integer:'税率范围0-100%',
channelValid:'当前选择的经营渠道与列表中的经营渠道有重复,请重新选择!',
editVaild:'只有系统管理平台才能编辑经营主体信息!',
defaultBookEdit:'默认结算账套不能修改!',
defaultBookDelete:'默认结算账套不能删除!',
proMsgSaveTitle:'您当前未设置结算账套,新增时系统会默认帮您生成一个默认的结算账套,确定继续吗?',
orgtypeValid:'请先选择销售类型!',
actCntdelet:'该账户已经被已有收款方式使用,不能删除!'
}
},
"en-US": true,
"en-US-paris": true
});
\ No newline at end of file