Showing
2 changed files
with
465 additions
and
444 deletions
1 | -define(function(){ | 1 | +define(['i18n!accountset/nls/resource', 'cls', 'base/index', 'index/index'], function (resource, Class, base, index){ |
2 | - return { | 2 | + |
3 | - init : function(){ | 3 | + return Class({ |
4 | - var plId = $.cookie("rs-platform-id"); | 4 | + resource: resource, |
5 | - var pannel = getSelectedPanel();//初始化面板 | 5 | + plId:function getPlId(){ |
6 | - var page = pannel.children(".crm-accountset").show().layout({fit:true});//定义面板内div | 6 | + var plId = $.cookie("rs-platform-id"); |
7 | - var datagrid = initDatagrid();//初始化数据表格 | 7 | + //不是系统管理平台,不能使用新增功能 |
8 | - //初始化表格 | 8 | + if(plId != 1){ |
9 | - function initDatagrid(){ | 9 | + var buttons = page.find(".rs-toolbar").find(".button");// 按钮组 |
10 | - return page.layout("panel","center").children(".crm-accountset-table").datagrid({ | 10 | + buttons.eq(1).linkbutton('disable'); |
11 | - url:"./query/0996fdd2-ad85-4d1b-acc6-04b412496428.json", | 11 | + buttons.eq(1).unbind("click"); |
12 | - toolbar:$('<div class="clearfix"></div>').rs_toolbar({ | 12 | + } |
13 | - title:resource.accountset.title.name, | 13 | + }, |
14 | - authz:getAuthzUtils('accountSet'), | 14 | + variable: function () { |
15 | - buttons: | 15 | + var panel = index.getSelectedPanel(); |
16 | - [{ | 16 | + this.page = panel.children('.crm-accountset').layout({fit: true}); |
17 | - text: resource.btn.select, | 17 | + this.north = this.page.layout("panel", "north"); |
18 | - iconCls:'btn-select select-condition', | 18 | + this.center = this.page.layout("panel", "center"); |
19 | - handler: function(){ | 19 | + this.grid = $('<div></div>').appendTo(this.center); |
20 | - showCondObject('0996fdd2-ad85-4d1b-acc6-04b412496428', datagridReload); | 20 | + this.queryId = '0996fdd2-ad85-4d1b-acc6-04b412496428'; |
21 | - } | 21 | + }, |
22 | - },{ | 22 | + initialize: function () { |
23 | - code:'edit', | 23 | + initDatagrid(this); |
24 | - text: resource.btn.add, | 24 | + function initDatagrid(inst){ |
25 | - iconCls:'btn-add', | 25 | + inst.grid.datagrid({ |
26 | - handler: addWindow | 26 | + url:'./query/' + inst.queryId + '.json', |
27 | - },{ | 27 | + toolbar:$('<div class="clearfix"></div>').rs_toolbar({ |
28 | - code:'edit', | 28 | + title:resource.title.name, |
29 | - text: resource.btn.edit, | 29 | + authz:base.getAuthz('accountSet'), |
30 | - iconCls:'btn-edit', | 30 | + buttons: [{ |
31 | - handler: editWindow | 31 | + text: base.resource.btn.select, |
32 | - },{ | 32 | + iconCls:'btn-select select-condition', |
33 | - code:'edit', | 33 | + handler: function(){ |
34 | - text: resource.btn.remove, | 34 | + base.showCondObject(inst.queryId, function(){ |
35 | - iconCls:'btn-remove', | 35 | + datagridReload.call(inst); |
36 | - handler: deleteData | 36 | + }); |
37 | - }], | 37 | + } |
38 | - tools:[ | 38 | + },{ |
39 | -// { | 39 | + code:'edit', |
40 | -// text:resource.btn.print, | 40 | + text: base.resource.btn.add, |
41 | -// iconCls:'btn-print', | 41 | + iconCls:'btn-add', |
42 | -// handler:panelRefreshUtils | 42 | + handler:function(){ |
43 | -// }, | 43 | + addWindow.call(this,inst) |
44 | - { | 44 | + } |
45 | - text:resource.btn.refresh, | 45 | + },{ |
46 | - iconCls:'btn-refresh', | 46 | + code:'edit', |
47 | - handler:panelRefreshUtils | 47 | + text: base.resource.btn.edit, |
48 | - } | 48 | + iconCls:'btn-edit', |
49 | -// ,{ | 49 | + handler: function(){ |
50 | -// text:resource.btn.more, | 50 | + editWindow.call(this,inst) |
51 | -// iconCls:'btn-more', | 51 | + } |
52 | -// handler:panelRefreshUtils | 52 | + },{ |
53 | -// } | 53 | + code:'edit', |
54 | - ] | 54 | + text: base.resource.btn.remove, |
55 | - }), | 55 | + iconCls:'btn-remove', |
56 | - fitColumns:true,//使列自动展开/收缩到合适的DataGrid宽度 | 56 | + handler: function(){ |
57 | - columns:[[ | 57 | + deleteData.call(this,inst) |
58 | - {field:'ck',checkbox:true }, | 58 | + } |
59 | - {field:'ACT_CODE',title:resource.accountset.grid.actcode, width:100, align:"center"}, | 59 | + }], |
60 | - {field:'ACT_NAME',title:resource.accountset.grid.actname, width:100, align:"center"}, | 60 | + tools:[ |
61 | - {field:'ACT_DESC',title:resource.accountset.grid.actdesc, width:200, align:"center"}, | 61 | + { |
62 | - {field:'PLNAME',title:resource.accountset.grid.plname, width:200, align:"center"}, | 62 | + text:base.resource.btn.refresh, |
63 | - {field:'ACT_TYPE',title:resource.accountset.grid.acttype, width:200, align:"center"}, | 63 | + iconCls:'btn-refresh', |
64 | - {field:'ENABLE',title:resource.accountset.grid.enable, width:60, align:"center"} | 64 | + handler:function(){ |
65 | - ]] | 65 | + datagridReload.call(inst) |
66 | - }); | 66 | + } |
67 | - } | 67 | + } |
68 | - //不是系统管理平台,不能使用新增功能 | 68 | + ] |
69 | - if(plId != 1){ | 69 | + }), |
70 | - var buttons = page.find(".rs-toolbar").find(".button");// 按钮组 | 70 | + fitColumns:true,//使列自动展开/收缩到合适的DataGrid宽度 |
71 | - buttons.eq(1).linkbutton('disable'); | 71 | + columns:[[ |
72 | - buttons.eq(1).unbind("click"); | 72 | + {field:'ck',checkbox:true }, |
73 | - } | 73 | + {field:'ACT_CODE',title:resource.grid.actcode, width:100, align:"center"}, |
74 | - | 74 | + {field:'ACT_NAME',title:resource.grid.actname, width:100, align:"center"}, |
75 | - //行转换 | 75 | + {field:'ACT_DESC',title:resource.grid.actdesc, width:200, align:"center"}, |
76 | - function getSelectedRow(){ | 76 | + {field:'PLNAME',title:resource.grid.plname, width:200, align:"center"}, |
77 | - var row = datagrid.datagrid('getSelected'); | 77 | + {field:'ACT_TYPE',title:resource.grid.acttype, width:200, align:"center"}, |
78 | - return row?{ | 78 | + {field:'ENABLE',title:resource.grid.enable, width:60, align:"center"} |
79 | - actId:row.ACT_ID, | 79 | + ]] |
80 | - actCode:row.ACT_CODE, | 80 | + }); |
81 | - actType:row.ACT_TYPE, | 81 | + } |
82 | - actName:row.ACT_NAME, | 82 | + }, |
83 | - actDesc:row.ACT_DESC, | 83 | + handler: function () { |
84 | - plName:row.PLNAME, | 84 | + |
85 | - enable:row.ENABLE | ||
86 | - }:null; | ||
87 | - } | ||
88 | - function datagridReload(params){ | ||
89 | - if(params){ | ||
90 | - datagrid.datagrid("reload",params); | ||
91 | - }else{ | ||
92 | - datagrid.datagrid("reload",getCondObjectValue('0996fdd2-ad85-4d1b-acc6-04b412496428')); | ||
93 | - } | ||
94 | - } | ||
95 | - | ||
96 | - //添加到账套详情页面 | ||
97 | - function addWindow(){ | ||
98 | - //添加账套详情页面 | ||
99 | - showTabUtils({text:resource.accountset.title.detail,url:"./accountSetDetail/accountSetDetailAdd"}, true, function(){ | ||
100 | - datagrid.datagrid("reload"); | ||
101 | - }); | ||
102 | - } | ||
103 | - //编辑页面弹出绑定按钮 | ||
104 | - function editWindow(){ | ||
105 | - var row = getSelectedRow(); | ||
106 | - if(row == null){ | ||
107 | - $.messager.alert(resource.msg_title, resource.msgEditTip); | ||
108 | - }else{ | ||
109 | - showTabUtils({text:resource.accountset.title.detail,url:"./accountSetDetail/accountSetDetailEdit?actId="+row.actId+"&actCode="+row.actCode}, true, function(){ | ||
110 | - datagrid.datagrid("reload"); | ||
111 | - }); | ||
112 | - } | ||
113 | - } | ||
114 | - //删除 | ||
115 | - function deleteData(){ | ||
116 | - var accountSet = getSelectedRow(); | ||
117 | - if(accountSet == null){ | ||
118 | - $.messager.alert(resource.msg_title, resource.msgRemoveTip); | ||
119 | - }else{ | ||
120 | - if(accountSet.actType==resource.accountset.title.sonAccount){ | ||
121 | - $.messager.confirm(resource.msg_title, resource.confirmDelete, function(r){ | ||
122 | - if(r){ | ||
123 | - accountSet.enable = ""; | ||
124 | - $.JSON("./accountSet/delete.json", accountSet, function(result){ | ||
125 | - if(responseUtils(result)){ | ||
126 | - datagrid.datagrid("reload"); | ||
127 | - } | ||
128 | - }); | ||
129 | - } | ||
130 | - }); | ||
131 | - }else{ | ||
132 | - $.messager.alert(resource.msg_title, resource.accountset.title.overActCntdelt); | ||
133 | - } | ||
134 | - } | ||
135 | - } | ||
136 | - | ||
137 | } | 85 | } |
86 | + }); | ||
87 | + | ||
88 | + //行转换 | ||
89 | + function getSelectedRow(){ | ||
90 | + var row = this.grid.datagrid('getSelected'); | ||
91 | + return row?{ | ||
92 | + actId:row.ACT_ID, | ||
93 | + actCode:row.ACT_CODE, | ||
94 | + actType:row.ACT_TYPE, | ||
95 | + actName:row.ACT_NAME, | ||
96 | + actDesc:row.ACT_DESC, | ||
97 | + plName:row.PLNAME, | ||
98 | + enable:row.ENABLE | ||
99 | + }:null; | ||
138 | } | 100 | } |
101 | + function datagridReload(params){ | ||
102 | + if(params){ | ||
103 | + this.grid.datagrid("reload",params); | ||
104 | + }else{ | ||
105 | + this.grid.datagrid("reload",base.getCondObjectValue(this.queryId)); | ||
106 | + } | ||
107 | + } | ||
108 | + //添加到账套详情页面 | ||
109 | + function addWindow(inst){ | ||
110 | + //添加账套详情页面 | ||
111 | + index.showPanel({text:resource.title.detail,url:"./accountSetDetail/accountSetDetailAdd"}, true, function(){ | ||
112 | + this.grid.datagrid("reload"); | ||
113 | + }); | ||
114 | + } | ||
115 | + //编辑页面弹出绑定按钮 | ||
116 | + function editWindow(inst){ | ||
117 | + var row = getSelectedRow.call(this); | ||
118 | + if(row == null){ | ||
119 | + $.messager.alert(resource.msg_title, resource.msgEditTip); | ||
120 | + }else{ | ||
121 | + index.showPanel({text:resource.title.detail,url:"./accountSetDetail/accountSetDetailEdit?actId="+row.actId+"&actCode="+row.actCode}, true, function(){ | ||
122 | + this.grid.datagrid("reload"); | ||
123 | + }); | ||
124 | + } | ||
125 | + } | ||
126 | + //删除 | ||
127 | + function deleteData(inst){ | ||
128 | + var accountSet = getSelectedRow.call(this); | ||
129 | + if(accountSet == null){ | ||
130 | + $.messager.alert(resource.msg_title, resource.msgRemoveTip); | ||
131 | + }else{ | ||
132 | + if(accountSet.actType==resource.accountset.title.sonAccount){ | ||
133 | + $.messager.confirm(resource.msg_title, resource.confirmDelete, function(r){ | ||
134 | + if(r){ | ||
135 | + accountSet.enable = ""; | ||
136 | + $.JSON("./accountSet/delete.json", accountSet, function(result){ | ||
137 | + if(responseUtils(result)){ | ||
138 | + this.grid.datagrid("reload"); | ||
139 | + } | ||
140 | + }); | ||
141 | + } | ||
142 | + }); | ||
143 | + }else{ | ||
144 | + $.messager.alert(resource.msg_title, resource.accountset.title.overActCntdelt); | ||
145 | + } | ||
146 | + } | ||
147 | + } | ||
148 | + | ||
139 | }); | 149 | }); |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | -define(function(){ | 1 | +define(['i18n!accountset/nls/resource', 'cls', 'base/index', 'index/index'], function (resource, Class, base, index){ |
2 | - return { | 2 | + return Class({ |
3 | - init : function(actId, actCode,usId){ | 3 | + resource: resource, |
4 | + variable: function () { //全局变量 | ||
5 | + var panel = index.getSelectedPanel(); | ||
6 | + this.page = panel.children('.crm-accountset-detail').layout({fit: true}); | ||
7 | + this.north = this.page.layout("panel", "north"); | ||
8 | + this.center = this.page.layout("panel", "center"); | ||
9 | + this.grid = $('<div></div>').appendTo(this.center); | ||
10 | + this.queryId = 'f1fd6213-c928-4e72-87f2-f8bfe8589b19'; | ||
11 | + this.tabs=this.center.children("div").tabs({closable : false, fit:true}); | ||
12 | + this.netDetail = this.page.find(".netDetail"); | ||
13 | + | ||
14 | + }, | ||
15 | + initialize: function () {//界面布局 | ||
16 | + initNetDataGrid(this); | ||
17 | + }, | ||
18 | + handler: function(actId, actCode,usId){ //事件绑定 | ||
4 | var brandCount = 0; //品牌searchbox渲染次数,第一次渲染的时候,需要刷新 | 19 | var brandCount = 0; //品牌searchbox渲染次数,第一次渲染的时候,需要刷新 |
5 | - var panel=getSelectedPanel(); | 20 | + |
6 | - var query="f1fd6213-c928-4e72-87f2-f8bfe8589b19"; | ||
7 | - var layout=panel.children('.crm-accountset-detail').layout({ fit:true }); | ||
8 | - //声明整个登录账户选项卡容器 | ||
9 | - var page=panel.children('.crm-accountset-detail'); | ||
10 | - var north=page.layout("panel","north"); | ||
11 | - var center=page.layout("panel","center"); | ||
12 | var wxgzh = ""; | 21 | var wxgzh = ""; |
13 | var index = 0; | 22 | var index = 0; |
14 | var div = "<div class='easyui-tabs l-btn-left l-btn-icon-left'></div>"; | 23 | var div = "<div class='easyui-tabs l-btn-left l-btn-icon-left'></div>"; |
... | @@ -17,37 +26,37 @@ define(function(){ | ... | @@ -17,37 +26,37 @@ define(function(){ |
17 | fit:true | 26 | fit:true |
18 | }); | 27 | }); |
19 | tabs.tabs({ | 28 | tabs.tabs({ |
20 | - //toolPosition:'left', | 29 | + //toolPosition:'left', |
21 | tools:[{ | 30 | tools:[{ |
22 | iconCls:'icon-add', | 31 | iconCls:'icon-add', |
23 | - text: resource.btn.add, | 32 | + text: resource.btn.add, |
24 | handler:addNetTab | 33 | handler:addNetTab |
25 | },{ | 34 | },{ |
26 | iconCls:'icon-re', | 35 | iconCls:'icon-re', |
27 | - text: resource.btn.remove, | 36 | + text: resource.btn.remove, |
28 | handler:removeNetTab | 37 | handler:removeNetTab |
29 | }] | 38 | }] |
30 | }) | 39 | }) |
31 | - tabs.tabs('update', { | 40 | + tabs.tabs('update', { |
32 | tab: tabs.tabs("getTab",0), | 41 | tab: tabs.tabs("getTab",0), |
33 | options: { | 42 | options: { |
34 | title: resource.accountset.grid.sites, | 43 | title: resource.accountset.grid.sites, |
35 | content:netDataGrid | 44 | content:netDataGrid |
36 | } | 45 | } |
37 | }); | 46 | }); |
38 | - var accsetDetail=north.find(".accountSet"); | 47 | + var accsetDetail=north.find(".accountSet"); |
39 | - var accsetDetailform = accsetDetail.find(".accountSetForm"); | 48 | + var accsetDetailform = accsetDetail.find(".accountSetForm"); |
40 | - var netDetail = page.find(".netDetail"); | 49 | + |
41 | - | 50 | + |
42 | - //经营主体和短信通道联动 | 51 | + //经营主体和短信通道联动 |
43 | - var netDataGrid = initNetDataGrid(); | 52 | + var netDataGrid = initNetDataGrid(); |
44 | - accsetDetailform.find(".platFormDialog").searchbox({ | 53 | + accsetDetailform.find(".platFormDialog").searchbox({ |
45 | - searcher:searchPlat, | 54 | + searcher:searchPlat, |
46 | - prompt:resource.accountset.select, | 55 | + prompt:resource.accountset.select, |
47 | - onChange:platFormChange | 56 | + onChange:platFormChange |
48 | - }); | 57 | + }); |
49 | - if(0 != actId){ | 58 | + if(0 != actId){ |
50 | - $.post('./accountSetDetail/queryById.json',{"actId":actId},function(result){ | 59 | + $.post('./accountSetDetail/queryById.json',{"actId":actId},function(result){ |
51 | if(responseUtils(result)){ | 60 | if(responseUtils(result)){ |
52 | accsetDetailform.form("load", result.value); | 61 | accsetDetailform.form("load", result.value); |
53 | actCode = result.value.actCode; | 62 | actCode = result.value.actCode; |
... | @@ -59,19 +68,19 @@ define(function(){ | ... | @@ -59,19 +68,19 @@ define(function(){ |
59 | initMsgChannelCombobox(); | 68 | initMsgChannelCombobox(); |
60 | } | 69 | } |
61 | }); | 70 | }); |
62 | - if('C001' == actCode){ | 71 | + if('C001' == actCode){ |
63 | - accsetDetailform.find("div.msg").hide(); | 72 | + accsetDetailform.find("div.msg").hide(); |
64 | - accsetDetailform.find("div.margin").hide(); | 73 | + accsetDetailform.find("div.margin").hide(); |
65 | - accsetDetailform.find("div.brand").hide(); | 74 | + accsetDetailform.find("div.brand").hide(); |
66 | - accsetDetailform.find("div.outer").hide(); | 75 | + accsetDetailform.find("div.outer").hide(); |
67 | - accsetDetailform.find("div.desc").hide(); | 76 | + accsetDetailform.find("div.desc").hide(); |
68 | - tabs.hide(); | 77 | + tabs.hide(); |
69 | - accsetDetailform.find(".actCode").attr("readonly", true); | 78 | + accsetDetailform.find(".actCode").attr("readonly", true); |
70 | - accsetDetailform.find(".platFormDialog").searchbox("disable",true); | 79 | + accsetDetailform.find(".platFormDialog").searchbox("disable",true); |
71 | - accsetDetailform.find(".enable").combobox({ disabled: true }); | 80 | + accsetDetailform.find(".enable").combobox({ disabled: true }); |
72 | - }else{ | 81 | + }else{ |
73 | - accsetDetailform.find(".actCode").attr("readonly",true); | 82 | + accsetDetailform.find(".actCode").attr("readonly",true); |
74 | - $.post('./accountSet/querySiteGroup.json',{"actId":actId},function(result){ | 83 | + $.post('./accountSet/querySiteGroup.json',{"actId":actId},function(result){ |
75 | if(responseUtils(result)){ | 84 | if(responseUtils(result)){ |
76 | var siteGroup = result.list; | 85 | var siteGroup = result.list; |
77 | if(siteGroup.length == 0){ | 86 | if(siteGroup.length == 0){ |
... | @@ -86,148 +95,148 @@ define(function(){ | ... | @@ -86,148 +95,148 @@ define(function(){ |
86 | if(i==0){ | 95 | if(i==0){ |
87 | tab = tabs.tabs("getTab",i); | 96 | tab = tabs.tabs("getTab",i); |
88 | tab.append("<input name='grpId' style='display:none' value='"+gridId+"' />"); | 97 | tab.append("<input name='grpId' style='display:none' value='"+gridId+"' />"); |
89 | - //netDataGrid.datagrid({url:"./query/f1fd6213-c928-4e72-87f2-f8bfe8589b19.json?c475cd0d-87b1-4ab8-adc2-9097cd7d4cb5="+siteGroup[i].grpId}); | 98 | + //netDataGrid.datagrid({url:"./query/f1fd6213-c928-4e72-87f2-f8bfe8589b19.json?c475cd0d-87b1-4ab8-adc2-9097cd7d4cb5="+siteGroup[i].grpId}); |
90 | netDataGrid.datagrid({url:"./query/f1fd6213-c928-4e72-87f2-f8bfe8589b19.json?8d7bca20-08d8-48e3-94eb-a913e61f55ee="+siteGroup[i].grpId}); | 99 | netDataGrid.datagrid({url:"./query/f1fd6213-c928-4e72-87f2-f8bfe8589b19.json?8d7bca20-08d8-48e3-94eb-a913e61f55ee="+siteGroup[i].grpId}); |
91 | }else{ | 100 | }else{ |
92 | addtab(gridId); | 101 | addtab(gridId); |
93 | tab = tabs.tabs("getTab",i); | 102 | tab = tabs.tabs("getTab",i); |
94 | } | 103 | } |
95 | tab.find(".content").find(".netForm").find(".wxghzName").searchbox({ | 104 | tab.find(".content").find(".netForm").find(".wxghzName").searchbox({ |
96 | - searcher:searchWxgzh, | 105 | + searcher:searchWxgzh, |
97 | - prompt:resource.accountset.select | 106 | + prompt:resource.accountset.select |
98 | - }); | 107 | + }); |
99 | readonlyUtils(tab.find(".content").find(".netForm").find(".wxghzName"),function(){ | 108 | readonlyUtils(tab.find(".content").find(".netForm").find(".wxghzName"),function(){ |
100 | tab.find(".content").find(".netForm").find(".wxghz").val(""); | 109 | tab.find(".content").find(".netForm").find(".wxghz").val(""); |
101 | tab.find(".content").find(".netForm").find(".gzhType").val(""); | 110 | tab.find(".content").find(".netForm").find(".gzhType").val(""); |
102 | - }); | 111 | + }); |
103 | - | 112 | + |
104 | tab.find(".content").find(".netForm").find(".wxghzName").searchbox("setValue",siteGroup[i].nickName); | 113 | tab.find(".content").find(".netForm").find(".wxghzName").searchbox("setValue",siteGroup[i].nickName); |
105 | tab.find(".content").find(".netForm").find(".wxghz").val(siteGroup[i].gzhId); | 114 | tab.find(".content").find(".netForm").find(".wxghz").val(siteGroup[i].gzhId); |
106 | tab.find(".content").find(".netForm").find(".gzhType").val(gzhTypeLocale(siteGroup[i].gzhType)); | 115 | tab.find(".content").find(".netForm").find(".gzhType").val(gzhTypeLocale(siteGroup[i].gzhType)); |
107 | } | 116 | } |
108 | } | 117 | } |
109 | }); | 118 | }); |
110 | - } | 119 | + } |
111 | - | 120 | + |
112 | }else{ | 121 | }else{ |
113 | accsetDetailform.find(".actCode").val(actCode); | 122 | accsetDetailform.find(".actCode").val(actCode); |
114 | accsetDetailform.find(".accSetType").val(resource.accountset.title.soAct); | 123 | accsetDetailform.find(".accSetType").val(resource.accountset.title.soAct); |
115 | readonlyUtils(netDetail.find(".netForm").find(".wxghzName"),function(){ | 124 | readonlyUtils(netDetail.find(".netForm").find(".wxghzName"),function(){ |
116 | netDetail.find(".netForm").find(".wxghz").val(""); | 125 | netDetail.find(".netForm").find(".wxghz").val(""); |
117 | netDetail.find(".netForm").find(".gzhType").val(""); | 126 | netDetail.find(".netForm").find(".gzhType").val(""); |
118 | - }); | 127 | + }); |
119 | netDetail.find(".netForm").find(".wxghzName").searchbox({ | 128 | netDetail.find(".netForm").find(".wxghzName").searchbox({ |
120 | - searcher:searchWxgzh, | 129 | + searcher:searchWxgzh, |
121 | - prompt:resource.accountset.select | 130 | + prompt:resource.accountset.select |
122 | - }); | 131 | + }); |
123 | // initMsgChannelCombobox(); | 132 | // initMsgChannelCombobox(); |
124 | } | 133 | } |
125 | - | 134 | + |
126 | - function searchWxgzh(){ | 135 | + function searchWxgzh(){ |
127 | - showCondObject({id:'2582a029-3902-4934-a206-d638f96d4b08',showGrid:true,refresh:true},function(row){ | 136 | + showCondObject({id:'2582a029-3902-4934-a206-d638f96d4b08',showGrid:true,refresh:true},function(row){ |
128 | - var tabAll = tabs.tabs("tabs"); | 137 | + var tabAll = tabs.tabs("tabs"); |
129 | - for (var i = 0; i < tabAll.length; i++) { | 138 | + for (var i = 0; i < tabAll.length; i++) { |
130 | - var tab = tabs.tabs("getTab",i); | 139 | + var tab = tabs.tabs("getTab",i); |
131 | - if(row.GZH_ID == tab.find(".content").find(".netForm").find(".wxghz").val()){ | 140 | + if(row.GZH_ID == tab.find(".content").find(".netForm").find(".wxghz").val()){ |
132 | - if(row.NICK_NAME == tab.find(".content").find(".netForm").find(".wxghzName").val()) { | 141 | + if(row.NICK_NAME == tab.find(".content").find(".netForm").find(".wxghzName").val()) { |
133 | - return $.messager.alert(resource.msg_title, row.NICK_NAME + resource.accountset.title.plBeSelected); | 142 | + return $.messager.alert(resource.msg_title, row.NICK_NAME + resource.accountset.title.plBeSelected); |
134 | - } | 143 | + } |
135 | - } | 144 | + } |
136 | } | 145 | } |
137 | 146 | ||
138 | - tabs.tabs('getSelected').find(".content").find(".netForm").find(".wxghzName").searchbox("setValue",row.NICK_NAME); | 147 | + tabs.tabs('getSelected').find(".content").find(".netForm").find(".wxghzName").searchbox("setValue",row.NICK_NAME); |
139 | - tabs.tabs('getSelected').find(".content").find(".netForm").find(".wxghz").val(row.GZH_ID); | 148 | + tabs.tabs('getSelected').find(".content").find(".netForm").find(".wxghz").val(row.GZH_ID); |
140 | - tabs.tabs('getSelected').find(".content").find(".netForm").find(".gzhType").val(gzhTypeLocale(row.GZH_TYPE)); | 149 | + tabs.tabs('getSelected').find(".content").find(".netForm").find(".gzhType").val(gzhTypeLocale(row.GZH_TYPE)); |
141 | }); | 150 | }); |
142 | - } | 151 | + } |
143 | - | 152 | + |
144 | - /** | 153 | + /** |
145 | - * 新增tab,除了第一个tab提前定义好,后面的都是通过此方法新增 | 154 | + * 新增tab,除了第一个tab提前定义好,后面的都是通过此方法新增 |
146 | - */ | 155 | + */ |
147 | - function addtab(grpId){ | 156 | + function addtab(grpId){ |
148 | - index++; | 157 | + index++; |
149 | - tabs.tabs('add',{ | 158 | + tabs.tabs('add',{ |
150 | title: resource.accountset.grid.sites+index, | 159 | title: resource.accountset.grid.sites+index, |
151 | closable: false | 160 | closable: false |
152 | }); | 161 | }); |
153 | - var tabPanel =tabs.tabs('getSelected'); | 162 | + var tabPanel =tabs.tabs('getSelected'); |
154 | - var addTable = $('<table class="data'+index+'"></table>'); | 163 | + var addTable = $('<table class="data'+index+'"></table>'); |
155 | - tabPanel.html(addTable); | 164 | + tabPanel.html(addTable); |
156 | - tabPanel.append("<input name='grpId' style='display:none' value='"+grpId+"' />"); | 165 | + tabPanel.append("<input name='grpId' style='display:none' value='"+grpId+"' />"); |
157 | - addTable.datagrid({ | 166 | + addTable.datagrid({ |
158 | - singleSelect : false, | 167 | + singleSelect : false, |
159 | toolbar:$('<div class="clearfix"></div>').rs_toolbar({ | 168 | toolbar:$('<div class="clearfix"></div>').rs_toolbar({ |
160 | content:addbtml(), | 169 | content:addbtml(), |
161 | title:resource.accountset.title.suitSite, | 170 | title:resource.accountset.title.suitSite, |
162 | authz:getAuthzUtils('accountSet'), | 171 | authz:getAuthzUtils('accountSet'), |
163 | buttons:[{ | 172 | buttons:[{ |
164 | - code:'edit', | 173 | + code:'edit', |
165 | - text: resource.btn.add, | 174 | + text: resource.btn.add, |
166 | - iconCls:'btn-add', | 175 | + iconCls:'btn-add', |
167 | - handler: addNet | 176 | + handler: addNet |
168 | - },{ | 177 | + },{ |
169 | - code:'edit', | 178 | + code:'edit', |
170 | - text: resource.btn.remove, | 179 | + text: resource.btn.remove, |
171 | - iconCls:'btn-remove', | 180 | + iconCls:'btn-remove', |
172 | - handler:removeNet | 181 | + handler:removeNet |
173 | - }] | 182 | + }] |
174 | }), | 183 | }), |
175 | - columns:[[ | 184 | + columns:[[ |
176 | - {field:'ck',checkbox:true }, | 185 | + {field:'ck',checkbox:true }, |
177 | - {field:'SICODE',title:resource.accountset.grid.sicode, width:100, align:"center"}, | 186 | + {field:'SICODE',title:resource.accountset.grid.sicode, width:100, align:"center"}, |
178 | - {field:'SINAME',title:resource.accountset.grid.siname, width:100, align:"center"}, | 187 | + {field:'SINAME',title:resource.accountset.grid.siname, width:100, align:"center"}, |
179 | - {field:'BENAME',title:resource.accountset.grid.bename, width:100, align:"center"}, | 188 | + {field:'BENAME',title:resource.accountset.grid.bename, width:100, align:"center"}, |
180 | - {field:'BEBNAME',title:resource.accountset.grid.bebname, width:100, align:"center"} | 189 | + {field:'BEBNAME',title:resource.accountset.grid.bebname, width:100, align:"center"} |
181 | - ]] | 190 | + ]] |
182 | - }); | 191 | + }); |
183 | - addTable.datagrid({url:"./query/f1fd6213-c928-4e72-87f2-f8bfe8589b19.json?8d7bca20-08d8-48e3-94eb-a913e61f55ee="+grpId}); | 192 | + addTable.datagrid({url:"./query/f1fd6213-c928-4e72-87f2-f8bfe8589b19.json?8d7bca20-08d8-48e3-94eb-a913e61f55ee="+grpId}); |
184 | - } | 193 | + } |
185 | - accsetDetail.rs_toolbar({ | 194 | + accsetDetail.rs_toolbar({ |
186 | - content:accsetDetailform, | 195 | + content:accsetDetailform, |
187 | buttons:[{ | 196 | buttons:[{ |
188 | text:resource.btn.save, | 197 | text:resource.btn.save, |
189 | iconCls:'btn-add', | 198 | iconCls:'btn-add', |
190 | handler:saveAccsetDetail | 199 | handler:saveAccsetDetail |
191 | }], | 200 | }], |
192 | tools:[{ | 201 | tools:[{ |
193 | - text:resource.btn.refresh, | 202 | + text:resource.btn.refresh, |
194 | - iconCls:'btn-refresh', | 203 | + iconCls:'btn-refresh', |
195 | - handler:panelRefreshUtils | 204 | + handler:panelRefreshUtils |
196 | - } | 205 | + } |
197 | ] | 206 | ] |
198 | }); | 207 | }); |
199 | - | 208 | + |
200 | - //主管平台和短信通道联动 | 209 | + //主管平台和短信通道联动 |
201 | - var platformChangeFlag = false; | 210 | + var platformChangeFlag = false; |
202 | - function platFormChange(newValue, oldValue){ | 211 | + function platFormChange(newValue, oldValue){ |
203 | - platformChangeFlag = true; | 212 | + platformChangeFlag = true; |
204 | - } | 213 | + } |
205 | - | 214 | + |
206 | - function searchPlat(){ | 215 | + function searchPlat(){ |
207 | - showCondObject({id:'0089f254-a93b-4f98-b8f7-0312ce06de45',showGrid:true,refresh:true},function(row){ | 216 | + showCondObject({id:'0089f254-a93b-4f98-b8f7-0312ce06de45',showGrid:true,refresh:true},function(row){ |
208 | - accsetDetailform.find(".platFormDialog").searchbox('setValue',row.PLNAME); | 217 | + accsetDetailform.find(".platFormDialog").searchbox('setValue',row.PLNAME); |
209 | - accsetDetailform.find(".ptfId").val(row.PLID); | 218 | + accsetDetailform.find(".ptfId").val(row.PLID); |
210 | - if(platformChangeFlag){ | 219 | + if(platformChangeFlag){ |
211 | - initMsgChannelComboboxAfterPlatform(row.PLID) | 220 | + initMsgChannelComboboxAfterPlatform(row.PLID) |
212 | - platformChangeFlag = false; | 221 | + platformChangeFlag = false; |
213 | - } | 222 | + } |
214 | - }); | 223 | + }); |
215 | - } | 224 | + } |
216 | - | 225 | + |
217 | - readonlyUtils(accsetDetailform.find(".platFormDialog"),function(){ | 226 | + readonlyUtils(accsetDetailform.find(".platFormDialog"),function(){ |
218 | - accsetDetailform.find(".ptfId").val(""); | 227 | + accsetDetailform.find(".ptfId").val(""); |
219 | - }); | 228 | + }); |
220 | - | 229 | + |
221 | - accsetDetailform.find(".applyBrandDialog").searchbox({ | 230 | + accsetDetailform.find(".applyBrandDialog").searchbox({ |
222 | - searcher:searchBrand, | 231 | + searcher:searchBrand, |
223 | - prompt:resource.accountset.noLimit | 232 | + prompt:resource.accountset.noLimit |
224 | - }); | 233 | + }); |
225 | - | 234 | + |
226 | - function initMsgChannelCombobox(){ | 235 | + function initMsgChannelCombobox(){ |
227 | - var plid = accsetDetailform.find("input[name='ptfId']").val(); | 236 | + var plid = accsetDetailform.find("input[name='ptfId']").val(); |
228 | - var param={ | 237 | + var param={ |
229 | - plId:plid, | 238 | + plId:plid, |
230 | - type:1 | 239 | + type:1 |
231 | }; | 240 | }; |
232 | $.post('./msgChannel/selectAll/beIdOrPlId.json',param,function(result){ | 241 | $.post('./msgChannel/selectAll/beIdOrPlId.json',param,function(result){ |
233 | if(responseUtils(result)){ | 242 | if(responseUtils(result)){ |
... | @@ -237,13 +246,13 @@ define(function(){ | ... | @@ -237,13 +246,13 @@ define(function(){ |
237 | } | 246 | } |
238 | }); | 247 | }); |
239 | } | 248 | } |
240 | - | 249 | + |
241 | - function initMsgChannelComboboxAfterPlatform(plid){ | 250 | + function initMsgChannelComboboxAfterPlatform(plid){ |
242 | - var param={ | 251 | + var param={ |
243 | - plId:plid, | 252 | + plId:plid, |
244 | - type:1 | 253 | + type:1 |
245 | }; | 254 | }; |
246 | - $.post('./msgChannel/selectAll/beIdOrPlId.json',param,function(result){ | 255 | + $.post('./msgChannel/selectAll/beIdOrPlId.json',param,function(result){ |
247 | if(responseUtils(result)){ | 256 | if(responseUtils(result)){ |
248 | accsetDetailform.find(".msgChannel").combobox("loadData", result.list); | 257 | accsetDetailform.find(".msgChannel").combobox("loadData", result.list); |
249 | var data =accsetDetailform.find(".msgChannel").combobox('getData'); | 258 | var data =accsetDetailform.find(".msgChannel").combobox('getData'); |
... | @@ -251,14 +260,14 @@ define(function(){ | ... | @@ -251,14 +260,14 @@ define(function(){ |
251 | } | 260 | } |
252 | }); | 261 | }); |
253 | } | 262 | } |
254 | - | 263 | + |
255 | - function searchBrand(){ | 264 | + function searchBrand(){ |
256 | - brandCount++; | 265 | + brandCount++; |
257 | - var refreshFlag = false; | 266 | + var refreshFlag = false; |
258 | - if(brandCount == 1){ | 267 | + if(brandCount == 1){ |
259 | - var refreshFlag = true; | 268 | + var refreshFlag = true; |
260 | - } | 269 | + } |
261 | - showCondObject({id:"22726b54-5748-4926-82ed-abe076caecfa", showGrid:true, singleSelect:false,condHidden:['b350631c-dc97-4be5-93e5-0d771365a4c7'],refresh:refreshFlag,onBeforeLoad:function(params){ | 270 | + showCondObject({id:"22726b54-5748-4926-82ed-abe076caecfa", showGrid:true, singleSelect:false,condHidden:['b350631c-dc97-4be5-93e5-0d771365a4c7'],refresh:refreshFlag,onBeforeLoad:function(params){ |
262 | return params["b350631c-dc97-4be5-93e5-0d771365a4c7"]= 1; | 271 | return params["b350631c-dc97-4be5-93e5-0d771365a4c7"]= 1; |
263 | }}, function(rows){ | 272 | }}, function(rows){ |
264 | var brandIdArray = ""; | 273 | var brandIdArray = ""; |
... | @@ -276,20 +285,20 @@ define(function(){ | ... | @@ -276,20 +285,20 @@ define(function(){ |
276 | accsetDetailform.find(".brId").val(brandIdArray); | 285 | accsetDetailform.find(".brId").val(brandIdArray); |
277 | accsetDetailform.find(".applyBrandDialog").searchbox("setValue",brandArray); | 286 | accsetDetailform.find(".applyBrandDialog").searchbox("setValue",brandArray); |
278 | }); | 287 | }); |
279 | - } | 288 | + } |
280 | - | 289 | + |
281 | - readonlyUtils(accsetDetailform.find(".applyBrandDialog"),function(){ | 290 | + readonlyUtils(accsetDetailform.find(".applyBrandDialog"),function(){ |
282 | - accsetDetailform.find(".brId").val(""); | 291 | + accsetDetailform.find(".brId").val(""); |
283 | - }); | 292 | + }); |
284 | - | 293 | + |
285 | - function prepareAccount(){ | 294 | + function prepareAccount(){ |
286 | - if("" == accsetDetailform.find("input[name='msgChannel']").val() || null == accsetDetailform.find("input[name='msgChannel']").val()){ | 295 | + if("" == accsetDetailform.find("input[name='msgChannel']").val() || null == accsetDetailform.find("input[name='msgChannel']").val()){ |
287 | $.messager.alert(resource.msg_title, resource.accountset.validateMsgChannel,'warning', function(){accsetDetailform.form("validate");}); | 296 | $.messager.alert(resource.msg_title, resource.accountset.validateMsgChannel,'warning', function(){accsetDetailform.form("validate");}); |
288 | return; | 297 | return; |
289 | } | 298 | } |
290 | - if(!accsetDetailform.form("validate")){ | 299 | + if(!accsetDetailform.form("validate")){ |
291 | - return; | 300 | + return; |
292 | - } | 301 | + } |
293 | if("" == accsetDetailform.find("input[name='actCode']").val() || null == accsetDetailform.find("input[name='actCode']").val()){ | 302 | if("" == accsetDetailform.find("input[name='actCode']").val() || null == accsetDetailform.find("input[name='actCode']").val()){ |
294 | $.messager.alert(resource.msg_title, resource.accountset.validateCode); | 303 | $.messager.alert(resource.msg_title, resource.accountset.validateCode); |
295 | return; | 304 | return; |
... | @@ -302,7 +311,7 @@ define(function(){ | ... | @@ -302,7 +311,7 @@ define(function(){ |
302 | $.messager.alert(resource.msg_title, resource.accountset.validatePlatForm); | 311 | $.messager.alert(resource.msg_title, resource.accountset.validatePlatForm); |
303 | return; | 312 | return; |
304 | } | 313 | } |
305 | - | 314 | + |
306 | if('C001' != accsetDetailform.find("input[name='actCode']").val()){ | 315 | if('C001' != accsetDetailform.find("input[name='actCode']").val()){ |
307 | if("" == accsetDetailform.find("input[name='msgChannel']").val() || null == accsetDetailform.find("input[name='msgChannel']").val()){ | 316 | if("" == accsetDetailform.find("input[name='msgChannel']").val() || null == accsetDetailform.find("input[name='msgChannel']").val()){ |
308 | $.messager.alert(resource.msg_title, resource.accountset.validateMsgChannel); | 317 | $.messager.alert(resource.msg_title, resource.accountset.validateMsgChannel); |
... | @@ -318,7 +327,7 @@ define(function(){ | ... | @@ -318,7 +327,7 @@ define(function(){ |
318 | enable:accsetDetailform.find("input[name='enable']").val(), | 327 | enable:accsetDetailform.find("input[name='enable']").val(), |
319 | actDesc:accsetDetailform.find("input[name='actDesc']").val(), | 328 | actDesc:accsetDetailform.find("input[name='actDesc']").val(), |
320 | }; | 329 | }; |
321 | - | 330 | + |
322 | var siteGroup = []; | 331 | var siteGroup = []; |
323 | var tabAll = tabs.tabs("tabs"); | 332 | var tabAll = tabs.tabs("tabs"); |
324 | for (var i = 0; i < tabAll.length; i++) { | 333 | for (var i = 0; i < tabAll.length; i++) { |
... | @@ -326,9 +335,9 @@ define(function(){ | ... | @@ -326,9 +335,9 @@ define(function(){ |
326 | var datagrid = tab.find(".datagrid-f"); | 335 | var datagrid = tab.find(".datagrid-f"); |
327 | var rows = datagrid.datagrid("getData").rows; | 336 | var rows = datagrid.datagrid("getData").rows; |
328 | if(rows.length==0){ | 337 | if(rows.length==0){ |
329 | - $.messager.alert(resource.msg_title,"请选择"+tab.panel('options').title+"!"); | 338 | + $.messager.alert(resource.msg_title,"请选择"+tab.panel('options').title+"!"); |
330 | - return; | 339 | + return; |
331 | - } | 340 | + } |
332 | var site=""; | 341 | var site=""; |
333 | for (var j = 0; j < rows.length; j++) { | 342 | for (var j = 0; j < rows.length; j++) { |
334 | if(j==rows.length-1){ | 343 | if(j==rows.length-1){ |
... | @@ -357,20 +366,20 @@ define(function(){ | ... | @@ -357,20 +366,20 @@ define(function(){ |
357 | }; | 366 | }; |
358 | } | 367 | } |
359 | return param; | 368 | return param; |
360 | - } | 369 | + } |
361 | function saveAccsetDetail(){ | 370 | function saveAccsetDetail(){ |
362 | var param = prepareAccount(); | 371 | var param = prepareAccount(); |
363 | if(param == null){ | 372 | if(param == null){ |
364 | return; | 373 | return; |
365 | } | 374 | } |
366 | $.messager.confirm(resource.msg_title,resource.users.saveTitle, function(r){ | 375 | $.messager.confirm(resource.msg_title,resource.users.saveTitle, function(r){ |
367 | - if (r){ | 376 | + if (r){ |
368 | $.JSON('./accountSet/add.json', param, function(result){ | 377 | $.JSON('./accountSet/add.json', param, function(result){ |
369 | if(responseUtils(result)){ | 378 | if(responseUtils(result)){ |
370 | closeSelectedPanel(); | 379 | closeSelectedPanel(); |
371 | } | 380 | } |
372 | }); | 381 | }); |
373 | - } | 382 | + } |
374 | }) | 383 | }) |
375 | } | 384 | } |
376 | 385 | ||
... | @@ -380,57 +389,57 @@ define(function(){ | ... | @@ -380,57 +389,57 @@ define(function(){ |
380 | return; | 389 | return; |
381 | } | 390 | } |
382 | $.messager.confirm(resource.msg_title,resource.users.saveTitle, function(r){ | 391 | $.messager.confirm(resource.msg_title,resource.users.saveTitle, function(r){ |
383 | - if (r){ | 392 | + if (r){ |
384 | $.JSON('./accountSet/add.json', param, function(result){ | 393 | $.JSON('./accountSet/add.json', param, function(result){ |
385 | if(responseUtils(result)){ | 394 | if(responseUtils(result)){ |
386 | var actId = result.value.actId; | 395 | var actId = result.value.actId; |
387 | var actCode = result.value.actCode; | 396 | var actCode = result.value.actCode; |
388 | - showTabUtils({text:resource.accountset.title.detail,url:"./accountSetDetail/accountSetDetailEdit?actId="+result.value.actId+"&actCode="+result.value.actCode}, true, function(){ | 397 | + base.showPanel({text:resource.accountset.title.detail,url:"./accountSetDetail/accountSetDetailEdit?actId="+result.value.actId+"&actCode="+result.value.actCode}, true, function(){ |
389 | panelRefreshUtils(); | 398 | panelRefreshUtils(); |
390 | }); | 399 | }); |
391 | } | 400 | } |
392 | }); | 401 | }); |
393 | - } | 402 | + } |
394 | }) | 403 | }) |
395 | } | 404 | } |
396 | - | 405 | + |
397 | - //网点新建datagrid | 406 | + //网点新建datagrid |
398 | - function addNet(){ | 407 | + function addNet(){ |
399 | - showCondObject({id:"37236df9-2c96-11e6-abf4-3c970e1c88a0", showGrid:true,refresh:true, singleSelect:false, | 408 | + showCondObject({id:"37236df9-2c96-11e6-abf4-3c970e1c88a0", showGrid:true,refresh:true, singleSelect:false, |
400 | - onBeforeLoad:function(params){ | 409 | + onBeforeLoad:function(params){ |
401 | - var params; | 410 | + var params; |
402 | - var brandId = accsetDetailform.find(".brId").val(); | 411 | + var brandId = accsetDetailform.find(".brId").val(); |
403 | - if(!isNull(brandId)){ | 412 | + if(!isNull(brandId)){ |
404 | - params["b8f7769a-2c97-11e6-abf4-3c970e1c88a0"]=","+brandId+","; | 413 | + params["b8f7769a-2c97-11e6-abf4-3c970e1c88a0"]=","+brandId+","; |
405 | - } | 414 | + } |
406 | - params["b8f709ba-2c97-11e6-abf4-3c970e1c88a0"]= 1; | 415 | + params["b8f709ba-2c97-11e6-abf4-3c970e1c88a0"]= 1; |
407 | params["b8f7bb2f-2c97-11e6-abf4-3c970e1c88a0"]= 1; // 可用 | 416 | params["b8f7bb2f-2c97-11e6-abf4-3c970e1c88a0"]= 1; // 可用 |
408 | return params; | 417 | return params; |
409 | } | 418 | } |
410 | - }, function(rows){ | 419 | + }, function(rows){ |
411 | - if(rows.length == 0){ | 420 | + if(rows.length == 0){ |
412 | - return; | 421 | + return; |
413 | - } | 422 | + } |
414 | - if(0 != actId){ | 423 | + if(0 != actId){ |
415 | - addSiteOnGroup(rows); | 424 | + addSiteOnGroup(rows); |
416 | - }else{ | 425 | + }else{ |
417 | - var datagrid = tabs.tabs('getSelected').find(".datagrid-f"); | 426 | + var datagrid = tabs.tabs('getSelected').find(".datagrid-f"); |
418 | - var data = tabs.tabs('getSelected').find(".datagrid-f").datagrid("getData"); | 427 | + var data = tabs.tabs('getSelected').find(".datagrid-f").datagrid("getData"); |
419 | - for (var i = 0; i < rows.length; i++) { | 428 | + for (var i = 0; i < rows.length; i++) { |
420 | - var flg = true; | 429 | + var flg = true; |
421 | - for (var j = 0; j < data.rows.length; j++) { | 430 | + for (var j = 0; j < data.rows.length; j++) { |
422 | if(rows[i].SIID == data.rows[j].SIID){ | 431 | if(rows[i].SIID == data.rows[j].SIID){ |
423 | flg=false; | 432 | flg=false; |
424 | } | 433 | } |
425 | } | 434 | } |
426 | - if(flg){ | 435 | + if(flg){ |
427 | - datagrid.datagrid("appendRow",rows[i]); | 436 | + datagrid.datagrid("appendRow",rows[i]); |
428 | - } | 437 | + } |
429 | } | 438 | } |
430 | - } | 439 | + } |
431 | }); | 440 | }); |
432 | - } | 441 | + } |
433 | - | 442 | + |
434 | function addSiteOnGroup(rows) { | 443 | function addSiteOnGroup(rows) { |
435 | var datagrid = tabs.tabs('getSelected').find(".datagrid-f"); | 444 | var datagrid = tabs.tabs('getSelected').find(".datagrid-f"); |
436 | var param = { | 445 | var param = { |
... | @@ -475,17 +484,17 @@ define(function(){ | ... | @@ -475,17 +484,17 @@ define(function(){ |
475 | if(tab.find("input[name='grpId']").val()=="0"){ | 484 | if(tab.find("input[name='grpId']").val()=="0"){ |
476 | tab.find("input[name='grpId']").val(result.value.siteGroupList[0].grpId); | 485 | tab.find("input[name='grpId']").val(result.value.siteGroupList[0].grpId); |
477 | } | 486 | } |
478 | - var data = tabs.tabs('getSelected').find(".datagrid-f").datagrid("getData"); | 487 | + var data = tabs.tabs('getSelected').find(".datagrid-f").datagrid("getData"); |
479 | - for (var i = 0; i < rows.length; i++) { | 488 | + for (var i = 0; i < rows.length; i++) { |
480 | - var flg = true; | 489 | + var flg = true; |
481 | - for (var j = 0; j < data.rows.length; j++) { | 490 | + for (var j = 0; j < data.rows.length; j++) { |
482 | if(rows[i].SIID == data.rows[j].SIID){ | 491 | if(rows[i].SIID == data.rows[j].SIID){ |
483 | flg=false; | 492 | flg=false; |
484 | } | 493 | } |
485 | } | 494 | } |
486 | - if(flg){ | 495 | + if(flg){ |
487 | - datagrid.datagrid("appendRow",rows[i]); | 496 | + datagrid.datagrid("appendRow",rows[i]); |
488 | - } | 497 | + } |
489 | } | 498 | } |
490 | } | 499 | } |
491 | }); | 500 | }); |
... | @@ -493,7 +502,7 @@ define(function(){ | ... | @@ -493,7 +502,7 @@ define(function(){ |
493 | }) | 502 | }) |
494 | } | 503 | } |
495 | 504 | ||
496 | - // 网点移除datagrid | 505 | + // 网点移除datagrid |
497 | function removeNet() { | 506 | function removeNet() { |
498 | var datagrid = tabs.tabs('getSelected').find(".datagrid-f"); | 507 | var datagrid = tabs.tabs('getSelected').find(".datagrid-f"); |
499 | if (datagrid.datagrid('getSelected') == null) { | 508 | if (datagrid.datagrid('getSelected') == null) { |
... | @@ -546,14 +555,14 @@ define(function(){ | ... | @@ -546,14 +555,14 @@ define(function(){ |
546 | var rows = datagrid.datagrid("getData").rows; | 555 | var rows = datagrid.datagrid("getData").rows; |
547 | if(rows.length==0){ | 556 | if(rows.length==0){ |
548 | $.messager.alert(resource.msg_title,tab.panel('options').title+"下已无网点"); | 557 | $.messager.alert(resource.msg_title,tab.panel('options').title+"下已无网点"); |
549 | - } | 558 | + } |
550 | } | 559 | } |
551 | }); | 560 | }); |
552 | } | 561 | } |
553 | }) | 562 | }) |
554 | } | 563 | } |
555 | - | 564 | + |
556 | - // 网点移除datagrid | 565 | + // 网点移除datagrid |
557 | function removeGroup() { | 566 | function removeGroup() { |
558 | var datagrid = tabs.tabs('getSelected').find(".datagrid-f"); | 567 | var datagrid = tabs.tabs('getSelected').find(".datagrid-f"); |
559 | var param = { | 568 | var param = { |
... | @@ -589,13 +598,13 @@ define(function(){ | ... | @@ -589,13 +598,13 @@ define(function(){ |
589 | } | 598 | } |
590 | }) | 599 | }) |
591 | } | 600 | } |
592 | - | 601 | + |
593 | // function aaatest(data){ | 602 | // function aaatest(data){ |
594 | // data.total = 2; | 603 | // data.total = 2; |
595 | // alert(data.total); | 604 | // alert(data.total); |
596 | // pager = tabs.find(".netwooks").datagrid("getPager"); | 605 | // pager = tabs.find(".netwooks").datagrid("getPager"); |
597 | -// var options = tabs.find(".netwooks").datagrid('getPager').data("pagination").options; | 606 | +// var options = tabs.find(".netwooks").datagrid('getPager').data("pagination").options; |
598 | -// var total = options.total; | 607 | +// var total = options.total; |
599 | // tabs.find(".netwooks").datagrid('getPager').data("pagination").options.total = 2; | 608 | // tabs.find(".netwooks").datagrid('getPager').data("pagination").options.total = 2; |
600 | // } | 609 | // } |
601 | // function bbbtest(param){ | 610 | // function bbbtest(param){ |
... | @@ -603,69 +612,29 @@ define(function(){ | ... | @@ -603,69 +612,29 @@ define(function(){ |
603 | // } | 612 | // } |
604 | // function ccctest(data){ | 613 | // function ccctest(data){ |
605 | // var cc ={}; | 614 | // var cc ={}; |
606 | -// | 615 | +// |
607 | // alert(3); | 616 | // alert(3); |
608 | // cc.total = 2; | 617 | // cc.total = 2; |
609 | // cc.rows = data.list; | 618 | // cc.rows = data.list; |
610 | // return cc; | 619 | // return cc; |
611 | // } | 620 | // } |
612 | - // 初始化网点组datagrid | 621 | + // 初始化网点组datagrid |
613 | - function initNetDataGrid(){ | ||
614 | - return tabs.find(".netwooks").datagrid({ | ||
615 | - singleSelect : false, | ||
616 | -// onLoadSuccess : aaatest, | ||
617 | -// onBeforeLoad : bbbtest, | ||
618 | -// loadFilter: ccctest, | ||
619 | 622 | ||
620 | - //url:"./query/e0e0f773-34a1-450c-8868-60433a245eb8.json", | 623 | + |
621 | - toolbar:$('<div class="clearfix"></div>').rs_toolbar({ | 624 | + //新增一个tab |
622 | - content:netDetail, | 625 | + function addNetTab(){ |
623 | - title:resource.accountset.title.suitSite, | 626 | + if(actId == 0){ |
624 | - authz:getAuthzUtils('accountSet'), | ||
625 | - buttons:[ | ||
626 | - { | ||
627 | - text:resource.btn.select, | ||
628 | - iconCls:"btn-select select-condition", | ||
629 | - handler: function(){ | ||
630 | - showCondObject(query,datagridReload); | ||
631 | - } | ||
632 | - }, | ||
633 | - { | ||
634 | - code:'edit', | ||
635 | - text: resource.btn.add, | ||
636 | - iconCls:'btn-add', | ||
637 | - handler: addNet | ||
638 | - },{ | ||
639 | - code:'edit', | ||
640 | - text: resource.btn.remove, | ||
641 | - iconCls:'btn-remove', | ||
642 | - handler:removeNet | ||
643 | - }] | ||
644 | - }), | ||
645 | - columns:[[ | ||
646 | - {field:'ck',checkbox:true }, | ||
647 | - {field:'SICODE',title:resource.accountset.grid.sicode, width:100, align:"center"}, | ||
648 | - {field:'SINAME',title:resource.accountset.grid.siname, width:100, align:"center"}, | ||
649 | - {field:'BENAME',title:resource.accountset.grid.bename, width:100, align:"center"}, | ||
650 | - {field:'BEBNAME',title:resource.accountset.grid.bebname, width:100, align:"center"} | ||
651 | - ]] | ||
652 | - }); | ||
653 | - } | ||
654 | - | ||
655 | - //新增一个tab | ||
656 | - function addNetTab(){ | ||
657 | - if(actId == 0){ | ||
658 | $.messager.confirm(resource.msg_title, resource.users.mustSubmitAccountBeforeSecondGroup, function(r) { | 627 | $.messager.confirm(resource.msg_title, resource.users.mustSubmitAccountBeforeSecondGroup, function(r) { |
659 | if (r) { | 628 | if (r) { |
660 | saveTabBeforeSecondGroup(); | 629 | saveTabBeforeSecondGroup(); |
661 | } | 630 | } |
662 | }) | 631 | }) |
663 | return; | 632 | return; |
664 | - } | 633 | + } |
665 | - var data = tabs.tabs('getSelected').find(".datagrid-f").datagrid("getData"); | 634 | + var data = tabs.tabs('getSelected').find(".datagrid-f").datagrid("getData"); |
666 | - if(data.rows.length==0){ | 635 | + if(data.rows.length==0){ |
667 | - return $.messager.alert(resource.msg_title,resource.accountset.title.editCurtSite); | 636 | + return $.messager.alert(resource.msg_title,resource.accountset.title.editCurtSite); |
668 | - } | 637 | + } |
669 | // var tab = tabs.tabs("getTab",0).find(".datagrid").clone(); //好像没用,先删除 | 638 | // var tab = tabs.tabs("getTab",0).find(".datagrid").clone(); //好像没用,先删除 |
670 | index++; | 639 | index++; |
671 | tabs.tabs('add',{ | 640 | tabs.tabs('add',{ |
... | @@ -673,56 +642,56 @@ define(function(){ | ... | @@ -673,56 +642,56 @@ define(function(){ |
673 | closable: false | 642 | closable: false |
674 | }); | 643 | }); |
675 | var currentTabPanel =tabs.tabs('getSelected'); | 644 | var currentTabPanel =tabs.tabs('getSelected'); |
676 | - var dynamicTable = $('<table class="data'+index+'"></table>'); | 645 | + var dynamicTable = $('<table class="data'+index+'"></table>'); |
677 | - currentTabPanel.html(dynamicTable); | 646 | + currentTabPanel.html(dynamicTable); |
678 | - currentTabPanel.append("<input name='grpId' style='display:none' value='0' />"); | 647 | + currentTabPanel.append("<input name='grpId' style='display:none' value='0' />"); |
679 | - dynamicTable.datagrid({ | 648 | + dynamicTable.datagrid({ |
680 | - singleSelect : false, | 649 | + singleSelect : false, |
681 | toolbar:$('<div class="clearfix"></div>').rs_toolbar({ | 650 | toolbar:$('<div class="clearfix"></div>').rs_toolbar({ |
682 | content:addbtml(), | 651 | content:addbtml(), |
683 | title:resource.accountset.title.suitSite, | 652 | title:resource.accountset.title.suitSite, |
684 | authz:getAuthzUtils('accountSet'), | 653 | authz:getAuthzUtils('accountSet'), |
685 | buttons:[{ | 654 | buttons:[{ |
686 | - code:'edit', | 655 | + code:'edit', |
687 | - text: resource.btn.add, | 656 | + text: resource.btn.add, |
688 | - iconCls:'btn-add', | 657 | + iconCls:'btn-add', |
689 | - handler: addNet | 658 | + handler: addNet |
690 | - },{ | 659 | + },{ |
691 | - code:'edit', | 660 | + code:'edit', |
692 | - text: resource.btn.remove, | 661 | + text: resource.btn.remove, |
693 | - iconCls:'btn-remove', | 662 | + iconCls:'btn-remove', |
694 | - handler:removeNet | 663 | + handler:removeNet |
695 | - }] | 664 | + }] |
696 | }), | 665 | }), |
697 | - columns:[[ | 666 | + columns:[[ |
698 | - {field:'ck',checkbox:true }, | 667 | + {field:'ck',checkbox:true }, |
699 | - {field:'SICODE',title:resource.accountset.grid.sicode, width:100, align:"center"}, | 668 | + {field:'SICODE',title:resource.accountset.grid.sicode, width:100, align:"center"}, |
700 | - {field:'SINAME',title:resource.accountset.grid.siname, width:100, align:"center"}, | 669 | + {field:'SINAME',title:resource.accountset.grid.siname, width:100, align:"center"}, |
701 | - {field:'BENAME',title:resource.accountset.grid.bename, width:100, align:"center"}, | 670 | + {field:'BENAME',title:resource.accountset.grid.bename, width:100, align:"center"}, |
702 | - {field:'BEBNAME',title:resource.accountset.grid.bebname, width:100, align:"center"} | 671 | + {field:'BEBNAME',title:resource.accountset.grid.bebname, width:100, align:"center"} |
703 | - ]] | 672 | + ]] |
704 | - }); | 673 | + }); |
705 | readonlyUtils(currentTabPanel.find(".content").find(".netForm").find(".wxghzName"),function(){ | 674 | readonlyUtils(currentTabPanel.find(".content").find(".netForm").find(".wxghzName"),function(){ |
706 | currentTabPanel.find(".content").find(".netForm").find(".wxghz").val(""); | 675 | currentTabPanel.find(".content").find(".netForm").find(".wxghz").val(""); |
707 | currentTabPanel.find(".content").find(".netForm").find(".gzhType").val(""); | 676 | currentTabPanel.find(".content").find(".netForm").find(".gzhType").val(""); |
708 | - }); | 677 | + }); |
709 | currentTabPanel.find(".content").find(".netForm").find(".wxghzName").searchbox({ | 678 | currentTabPanel.find(".content").find(".netForm").find(".wxghzName").searchbox({ |
710 | - searcher:searchWxgzh, | 679 | + searcher:searchWxgzh, |
711 | - prompt:resource.accountset.select | 680 | + prompt:resource.accountset.select |
712 | - }); | 681 | + }); |
713 | } | 682 | } |
714 | - | 683 | + |
715 | function removeNetTab(){ | 684 | function removeNetTab(){ |
716 | var tab = tabs.tabs('getSelected'); | 685 | var tab = tabs.tabs('getSelected'); |
717 | if (tab){ | 686 | if (tab){ |
718 | var index = tabs.tabs('getTabIndex', tab); | 687 | var index = tabs.tabs('getTabIndex', tab); |
719 | if(index!=0){ | 688 | if(index!=0){ |
720 | - removeGroup(); | 689 | + removeGroup(); |
721 | // tabs.tabs('close', index); | 690 | // tabs.tabs('close', index); |
722 | } | 691 | } |
723 | } | 692 | } |
724 | } | 693 | } |
725 | - | 694 | + |
726 | function gzhTypeLocale(gzhType){ | 695 | function gzhTypeLocale(gzhType){ |
727 | if(typeof(gzhType) == "undefined"){ | 696 | if(typeof(gzhType) == "undefined"){ |
728 | return ""; | 697 | return ""; |
... | @@ -739,22 +708,64 @@ define(function(){ | ... | @@ -739,22 +708,64 @@ define(function(){ |
739 | return resource.accountset.title.unknown; | 708 | return resource.accountset.title.unknown; |
740 | } | 709 | } |
741 | } | 710 | } |
742 | - | 711 | + |
743 | function addbtml(){ | 712 | function addbtml(){ |
744 | var html='<div class="netDetail public base-box clearfix absolute" style="background: #ebebeb;"> <form class="netForm clearfix"><div class="base-content">' | 713 | var html='<div class="netDetail public base-box clearfix absolute" style="background: #ebebeb;"> <form class="netForm clearfix"><div class="base-content">' |
745 | - +'<div class="base-label clearfix">顾客移动平台</div> <div class="split">:</div><div class="input fl"><input type="text" name="wxghzName" class="wxghzName easyui-searchbox"/><input type="hidden" class="wxghz" name="wxghz"/></div>' | 714 | + +'<div class="base-label clearfix">顾客移动平台</div> <div class="split">:</div><div class="input fl"><input type="text" name="wxghzName" class="wxghzName easyui-searchbox"/><input type="hidden" class="wxghz" name="wxghz"/></div>' |
746 | - +'</div> <div class="base-content clearfix"> <div class="base-label"><span>类型</span></div><div class="split">:</div> <div class="input fl"><input type="text" class="easyui-validatebox gzhType disable-label" disabled="disabled"/></div> </div> </form> </div>'; | 715 | + +'</div> <div class="base-content clearfix"> <div class="base-label"><span>类型</span></div><div class="split">:</div> <div class="input fl"><input type="text" class="easyui-validatebox gzhType disable-label" disabled="disabled"/></div> </div> </form> </div>'; |
747 | return html; | 716 | return html; |
748 | } | 717 | } |
749 | - | 718 | + |
750 | - function tabClose(){ | 719 | + |
751 | - alert("todo zhangweijiang"); | ||
752 | - } | ||
753 | - | ||
754 | function datagridReload(params){ | 720 | function datagridReload(params){ |
755 | - var param =getCondObjectValue(query); | 721 | + if(params){ |
756 | - tabs.find(".netwooks").datagrid("reload",param); | 722 | + this.tabs.find(".netwooks").datagrid("reload",params); |
723 | + }else{ | ||
724 | + this.tabs.find(".netwooks").datagrid("reload",base.getCondObjectValue(this.queryId)); | ||
725 | + } | ||
757 | } | 726 | } |
758 | } | 727 | } |
728 | + }) | ||
729 | + function initNetDataGrid(inst){ | ||
730 | + return inst.tabs.find(".netwooks").datagrid({ | ||
731 | + singleSelect : false, | ||
732 | +// onLoadSuccess : aaatest, | ||
733 | +// onBeforeLoad : bbbtest, | ||
734 | +// loadFilter: ccctest, | ||
735 | + | ||
736 | + //url:"./query/e0e0f773-34a1-450c-8868-60433a245eb8.json", | ||
737 | + toolbar:$('<div class="clearfix"></div>').rs_toolbar({ | ||
738 | + content:inst.netDetail, | ||
739 | + title:resource.title.suitSite, | ||
740 | + authz:base.getAuthz('accountSet'), | ||
741 | + buttons:[ | ||
742 | + { | ||
743 | + text:base.resource.btn.select, | ||
744 | + iconCls:"btn-select select-condition", | ||
745 | + handler: function() { | ||
746 | + base.showCondObject(inst.queryId, function () { | ||
747 | + datagridReload.call(inst); | ||
748 | + }); | ||
749 | + } | ||
750 | + },{ | ||
751 | + code:'edit', | ||
752 | + text: base.resource.btn.add, | ||
753 | + iconCls:'btn-add', | ||
754 | + handler: addNet | ||
755 | + },{ | ||
756 | + code:'edit', | ||
757 | + text: base.resource.btn.remove, | ||
758 | + iconCls:'btn-remove', | ||
759 | + handler:removeNet | ||
760 | + }] | ||
761 | + }), | ||
762 | + columns:[[ | ||
763 | + {field:'ck',checkbox:true }, | ||
764 | + {field:'SICODE',title:resource.grid.sicode, width:100, align:"center"}, | ||
765 | + {field:'SINAME',title:resource.grid.siname, width:100, align:"center"}, | ||
766 | + {field:'BENAME',title:resource.grid.bename, width:100, align:"center"}, | ||
767 | + {field:'BEBNAME',title:resource.grid.bebname, width:100, align:"center"} | ||
768 | + ]] | ||
769 | + }); | ||
759 | } | 770 | } |
760 | }); | 771 | }); |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment