Header.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  1. Ext.define('erp.view.common.main.Header', {
  2. extend: 'Ext.panel.Panel',
  3. alias: 'widget.erpHeader',
  4. initComponent: function() {
  5. var me = this;
  6. Ext.applyIf(this, {
  7. region: 'north',
  8. bodyStyle: "background-image: url('" + basePath + "resource/images/header_gray.png')",
  9. layout: 'hbox',
  10. layoutConfig: {
  11. padding: '5',
  12. align: 'middle'
  13. },
  14. defaults: {margins:'3 5 0 0'},
  15. items: [{
  16. xtype: 'image',
  17. width: 85,
  18. height: 30,
  19. margins: '0 5 0 0',
  20. src : basePath + 'resource/images/uas.png',
  21. listeners:{
  22. 'beforerender':function(img,opts){
  23. var el = img.el,src=basePath + 'resource/images/uas.png';
  24. Ext.Ajax.request({
  25. url: basePath + 'ma/logo/hasLogo.action?_noc=1',
  26. async:false,
  27. success:function(fp, o,rep){
  28. if(fp.responseText=='true') src=basePath+'ma/logo/get.action?_noc=1&Nmaster='+(Ext.isObject(opts)?sob:opts)
  29. if(el) el.dom.src=src;
  30. else img.src=src;
  31. }
  32. });
  33. }
  34. }
  35. },{
  36. xtype: 'tbtext',
  37. align: 'stretch',
  38. text: '<font size="4" color="black">'+$I18N.common.main.sysTitle+'</font>'
  39. },{
  40. xtype: 'tbtext',
  41. flex: 10,
  42. text: ''
  43. },{
  44. xtype: 'button',
  45. align: 'end',
  46. text: '工作台',
  47. height: 24,
  48. cls: 'main-btn-underline',
  49. overCls: 'main-btn-underline-over',
  50. menu: [/*{
  51. iconCls: 'main-msg',
  52. text: '我的工作台',
  53. handler: function(){
  54. Ext.getCmp("content-panel").setActiveTab(0);
  55. }
  56. },*/{
  57. iconCls: 'main-msg',
  58. text: '工作台设置',
  59. handler: function(){
  60. Ext.getCmp("content-panel").setActiveTab(0);
  61. if(!Ext.getCmp('win')){
  62. Ext.create('erp.view.core.window.DeskTopSet');
  63. }
  64. }
  65. },{
  66. iconCls: 'main-msg',
  67. text: '系统设置',
  68. handler: function(){
  69. }
  70. },{
  71. iconCls: 'main-msg',
  72. text: '通讯录',
  73. id: 'addrbook'
  74. },{
  75. iconCls: 'main-email',
  76. text: '企业邮箱',
  77. handler: function(){
  78. if(en_email!=null){
  79. window.open(en_email);
  80. }
  81. }
  82. },{
  83. iconCls: 'main-schedule',
  84. text: '工作日历',
  85. handler: function(){
  86. window.open(basePath + 'jsps/plm/calendar/NewMyCalendar.jsp');
  87. }
  88. },{
  89. iconCls: 'main-msg',
  90. text: '即时沟通',
  91. handler: function(){
  92. openTable('即时沟通','jsps/oa/info/pagingSent.jsp');
  93. }
  94. }]
  95. },{
  96. xtype: 'tbtext',
  97. align: 'end',
  98. text: '|'
  99. },{
  100. xtype: 'button',
  101. text: '选项',
  102. height: 24,
  103. align: 'stretch',
  104. pack: 'end',
  105. cls: 'main-btn-underline',
  106. overCls: 'main-btn-underline-over',
  107. menu: [{
  108. iconCls: 'menuitem-lock',
  109. text: '锁定屏幕',
  110. id: 'lock'
  111. },{
  112. iconCls: 'main-msg',
  113. text: '操作指南'
  114. },{
  115. xtype: 'menuseparator'
  116. },{
  117. text: '语言',
  118. iconCls: 'main-msg',
  119. cls: 'main-btn-underline',
  120. overCls: 'main-btn-underline-over',
  121. menu: [{
  122. iconCls: 'main-todo',
  123. text: '简体'
  124. },{
  125. text: '繁體'
  126. },{
  127. text: 'English'
  128. },{
  129. text: '其它'
  130. }]
  131. },{
  132. iconCls: 'main-msg',
  133. text: '系统设置',
  134. menu: [{
  135. iconCls: 'main-msg',
  136. text: '我的信息'
  137. },{
  138. iconCls: 'main-msg',
  139. text: '我的权限'
  140. },{
  141. iconCls: 'main-msg',
  142. text: '修改密码',
  143. id: 'set-pwd'
  144. },{
  145. iconCls:'main-msg',
  146. text:'弹出消息',
  147. checked: true,
  148. xtype: 'menucheckitem',
  149. overflow: 'visible',
  150. labelAlign:'left',
  151. id:'set-msg',
  152. listeners:{
  153. afterrender:function(com){
  154. Ext.Ajax.request({
  155. method:'post',
  156. url:basePath+'common/getMsgSet.action?_noc=1',
  157. callback : function(options,success,response){
  158. var res = new Ext.decode(response.responseText);
  159. if(res.exceptionInfo != null){
  160. showError(res.exceptionInfo);return;
  161. }else if(res.success){
  162. com.setChecked(res.IsRemaind);
  163. }
  164. }
  165. });
  166. },
  167. click:function(item,e){
  168. var msg=item.checked?'确认启用消息提醒吗?':'确认取消消息提醒吗?';
  169. var remind=item.checked?1:0;
  170. Ext.MessageBox.show({
  171. title:'消息设置?',
  172. msg: msg,
  173. buttons: Ext.Msg.YESNO,
  174. icon: Ext.Msg.WARNING,
  175. fn: function(btn){
  176. if(btn == 'yes'){
  177. Ext.Ajax.request({
  178. url:basePath+'common/setMsgRemaind.action?_noc=1',
  179. params: {
  180. remind:remind
  181. },
  182. method : 'post',
  183. callback : function(options,success,response){
  184. var local=Ext.decode(response.responseText);
  185. if(local.success) {
  186. Ext.Msg.alert('提示','设置成功!');
  187. }else {
  188. showError(local.exceptionInfo);
  189. }
  190. }
  191. });
  192. } else if(btn == 'no'){
  193. //不保存
  194. e.record.reject();
  195. } else {
  196. return;
  197. }
  198. }
  199. });
  200. }
  201. }
  202. },{
  203. iconCls: 'main-msg',
  204. text: '工作台',
  205. menu: [{
  206. iconCls: 'main-msg',
  207. text: '我的工作台',
  208. handler: function(){
  209. Ext.getCmp("content-panel").setActiveTab(0);
  210. }
  211. },{
  212. iconCls: 'main-msg',
  213. text: '工作台设置'
  214. },{
  215. iconCls: 'main-msg',
  216. text: '快捷栏设置'
  217. }]
  218. }]
  219. },{
  220. iconCls: 'main-msg',
  221. text: '开发者工具',
  222. menu: [{
  223. xtype: 'menucheckitem',
  224. text: '显示栈轨迹',
  225. listeners: {
  226. afterrender: function(item) {
  227. Ext.Ajax.request({
  228. url: basePath + 'common/usersetting/develop.action',
  229. method: 'GET',
  230. callback: function(opt, s, res) {
  231. var r = Ext.decode(res.responseText);
  232. item.setChecked(r.debug);
  233. }
  234. });
  235. },
  236. click: function(item) {
  237. Ext.Ajax.request({
  238. url: basePath + 'common/usersetting/develop.action',
  239. method: 'POST',
  240. params: {
  241. debug: item.checked
  242. },
  243. callback: function(opt, s) {
  244. if (s) {
  245. Ext.Msg.alert('提示', '系统错误提示内容将' + (item.checked ? '' : '不再') + '显示栈轨迹!');
  246. }
  247. }
  248. });
  249. }
  250. }
  251. }]
  252. },{
  253. iconCls: 'main-msg',
  254. text: '关于优软',
  255. handler: function(){
  256. window.open('http://www.usoftchina.com');
  257. }
  258. }]
  259. },{
  260. xtype: 'tbtext',
  261. align: 'end',
  262. text: '|'
  263. },{
  264. xtype: 'button',
  265. text: '任务',
  266. height: 24,
  267. align: 'stretch',
  268. pack: 'end',
  269. cls: 'main-btn-underline',
  270. overCls: 'main-btn-underline-over',
  271. menu: [{
  272. iconCls: 'main-task',
  273. text: '发起任务',
  274. handler: function(b){
  275. var win = b.taskwin;
  276. if(!win) {
  277. b.taskwin = win = Ext.create('erp.view.core.window.Task');
  278. }
  279. win.show();
  280. }
  281. },{
  282. iconCls: 'main-task',
  283. text: '我的待办任务',
  284. handler:function(){
  285. openTable("我的待办任务",'jsps/common/datalist.jsp?whoami=ResourceAssignment!Bill&_noc=1&urlcondition=ra_emid=' + em_uu + ' AND ra_taskpercentdone<100 ','Task');
  286. }
  287. },{
  288. iconCls: 'main-task',
  289. text: '我的超时任务',
  290. handler:function(){
  291. openTable("我的超时任务",'jsps/common/datalist.jsp?whoami=ResourceAssignment!Bill&_noc=1&urlcondition=ra_emid=' + em_uu + ' AND ra_taskpercentdone<100 AND ra_enddate<sysdate','Task');
  292. }
  293. },{
  294. iconCls: 'main-task',
  295. text: '我的已处理任务',
  296. handler:function(){
  297. openTable("我的已处理任务",'jsps/common/datalist.jsp?whoami=ResourceAssignment!Bill&_noc=1&urlcondition=ra_emid=' + em_uu + ' AND ra_taskpercentdone=100','Task');
  298. }
  299. },{
  300. xtype : 'menuseparator'
  301. },{
  302. iconCls: 'main-task',
  303. text: '我发起的待办任务',
  304. handler:function(){
  305. openTable("我发起的待办任务",'jsps/common/datalist.jsp?whoami=ProjectTask!Bill&_noc=1&urlcondition=recorder=\'' + em_name + '\' AND handstatuscode=\'DOING\'','ProjectTask');
  306. }
  307. },{
  308. iconCls: 'main-task',
  309. text: '我发起的超时任务',
  310. handler:function(){
  311. openTable("我发起的超时任务",'jsps/common/datalist.jsp?whoami=ProjectTask!Bill&_noc=1&urlcondition=recorder=\'' + em_name + '\' AND handstatuscode=\'DOING\' AND enddate<sysdate','ProjectTask');
  312. }
  313. },{
  314. iconCls: 'main-task',
  315. text: '我发起的已完成任务',
  316. handler:function(){
  317. openTable("我发起的已完成任务",'jsps/common/datalist.jsp?whoami=ProjectTask!Bill&_noc=1&urlcondition=recorder=\'' + em_name + '\' AND handstatuscode=\'FINISHED\'','ProjectTask');
  318. }
  319. }]
  320. },{
  321. xtype: 'tbtext',
  322. align: 'end',
  323. text: '|'
  324. },{
  325. xtype: 'button',
  326. text: '流程',
  327. height: 24,
  328. align: 'stretch',
  329. pack: 'end',
  330. cls: 'main-btn-underline',
  331. overCls: 'main-btn-underline-over',
  332. menu: [{
  333. iconCls: 'main-msg',
  334. text: '发起流程',
  335. handler: function(){
  336. openTable("发起流程","jsps/common/LaunchProcess.jsp?canAdd=1&_noc=1","LaunchProcess");
  337. }
  338. },{
  339. iconCls: 'main-msg',
  340. text: '流程催办',
  341. handler: function(){
  342. openTable("流程催办","jsps/common/batchDeal.jsp?whoami=Process!Remind&_noc=1","Process!Remind");
  343. }
  344. },{
  345. iconCls: 'main-msg',
  346. text: '我的待办流程',
  347. handler:function(){
  348. openTable("我的待办流程",'jsps/common/datalist.jsp?whoami=JProcess&_noc=1&urlcondition=jp_nodedealman=\'' + em_code + '\' AND jp_status=\'待审批'+'\' ','MyProcess');
  349. }
  350. },{
  351. iconCls: 'main-msg',
  352. text: '我的超时流程',
  353. handler:function(){
  354. openTable("我的超时流程",'jsps/common/datalist.jsp?whoami=JProcess&_noc=1&urlcondition=jp_nodedealman=\'' + em_code + '\' AND jp_status=\'待审批'+'\' ','MyProcess');
  355. }
  356. },{
  357. iconCls: 'main-msg',
  358. text: '我的待办转移流程',
  359. handler:function(){
  360. openTable("我的待办转移流程",'jsps/common/datalist.jsp?whoami=TransferProcess&_noc=1&urlcondition=jt_acceptercode=\'' + em_code + '\' and jp_flag = 1 and jp_status=\'待审批\' ', 'MyProcess');
  361. }
  362. },{
  363. iconCls:'main-msg',
  364. text:'我的已处理流程',
  365. handler:function(){
  366. openTable("我的已处理流程",'jsps/common/datalist.jsp?whoami=JProcess&_noc=1&_do=1&urlcondition=jp_nodedealman=\'' + em_code + '\' and jp_status<>\'待审批\' ', 'MyProcess');
  367. }
  368. },{
  369. iconCls:'main-msg',
  370. text:'我发起的待办流程',
  371. handler:function(){
  372. openTable("我发起的待办流程",'jsps/common/datalist.jsp?whoami=JProcess!Header&_do=1&_noc=1&urlcondition=jp_launcherid=\'' + em_code + '\' AND jp_status=\'待审批'+'\' ','MyProcess');
  373. }
  374. },{
  375. iconCls:'main-msg',
  376. text:'我发起的超时流程',
  377. handler:function(){
  378. openTable("我发起的超时流程",'jsps/common/datalist.jsp?whoami=JProcess!Header&_do=1&_noc=1&urlcondition=jp_launcherid=\'' + em_code + '\' AND jp_status=\'待审批'+'\' ','MyProcess');
  379. }
  380. },{
  381. iconCls:'main-msg',
  382. text:'我发起已结束流程',
  383. handler:function(){
  384. openTable("我发起已结束流程",'jsps/common/datalist.jsp?whoami=JProcess!Header&_noc=1&_do=1&&urlcondition=(jp_launcherid=\'' + em_code + '\' AND jp_status=\'已审批'+'\') or (jp_launcherid=\'' + em_code + '\' AND jp_status=\'已结束'+'\') ','MyProcess');
  385. }
  386. }]
  387. },{
  388. xtype: 'tbtext',
  389. align: 'end',
  390. text: '|',
  391. hidden: isSaas,
  392. margins: isSaas ? '0' : '3 5 0 0'
  393. },{
  394. xtype: 'button',
  395. align: 'end',
  396. height: 24,
  397. text: $I18N.common.main.changeMaster,
  398. cls: 'main-btn-underline',
  399. overCls: 'main-btn-underline-over',
  400. menu: me.getMasterMenu(),
  401. hidden: isSaas,
  402. margins: isSaas ? '0' : '3 5 0 0'
  403. },{
  404. xtype: 'tbtext',
  405. align: 'end',
  406. text: '|'
  407. },{
  408. xtype: 'button',
  409. align: 'end',
  410. height: 24,
  411. text: $I18N.common.main.relogin,
  412. cls: 'main-btn-underline',
  413. overCls: 'main-btn-underline-over',
  414. handler: function(){
  415. main_relogin();
  416. }
  417. },{
  418. xtype: 'tbtext',
  419. align: 'end',
  420. text: '|'
  421. },{
  422. xtype: 'button',
  423. height: 24,
  424. align: 'end',
  425. text: $I18N.common.main.logout,
  426. cls: 'main-btn-underline',
  427. overCls: 'main-btn-underline-over',
  428. handler: function(){
  429. logout();
  430. }
  431. }],
  432. height: 35
  433. });
  434. this.callParent(arguments);
  435. },
  436. prefix: 'uu-',
  437. addUU: function(p, f, u) {
  438. if(!Ext.isEmpty(f.value)) {
  439. var me = this, enval = escape(f.value);
  440. var tx = '<font size=2 color=blue>' + f.value + '</font>';
  441. var bt = this.down('button[uumsg=' + enval + ']');
  442. if(!bt) {
  443. this.insert(3, {
  444. text: tx,
  445. name: this.prefix + u.uu_field,
  446. xtype: 'button',
  447. height: 24,
  448. isuu: true,
  449. uumsg: enval,
  450. relative: {
  451. panel: p,
  452. field: f,
  453. uu: u
  454. },
  455. cls: 'x-btn-bw',
  456. iconCls: 'x-btn-uu-medium',
  457. margins: '3 5 0 0',
  458. handler: function(btn) {
  459. var u = btn.relative.uu;
  460. if(u) {
  461. me.openUUClient(u, unescape(btn.uumsg));
  462. }
  463. }
  464. });
  465. }
  466. }
  467. },
  468. clearUU: function() {
  469. var me = this,
  470. uu = me.query('button[isuu=true]');
  471. Ext.each(uu, function(u){
  472. me.remove(u);
  473. });
  474. },
  475. removeUU: function(p) {
  476. var me = this,
  477. uu = me.query('button[isuu=true]');
  478. Ext.each(uu, function(u){
  479. var pl = u.relative.panel;
  480. if(pl.id == p.id)
  481. me.remove(u);
  482. });
  483. },
  484. refreshUU: function(panel, form, uu) {
  485. var me = this;
  486. this.clearUU();
  487. Ext.each(uu, function(u){
  488. var f = form.down('#' + u.uu_field);
  489. if(f) {
  490. if(!(u.uu_ftype == 1 && f.value == em_code) && !(u.uu_ftype == 2 && f.value == em_name)) {//排除自己
  491. me.addUU(panel, f, u);
  492. }
  493. }
  494. });
  495. },
  496. openUUClient: function(u, val) {
  497. var ef = 'em_name', tab = 'Employee', uuf = 'em_uu';
  498. switch(u.uu_ftype) {
  499. case 0:
  500. ef = 'em_id';break;
  501. case 1:
  502. ef = 'em_code';break;
  503. case 2:
  504. ef = 'em_name';break;
  505. case 3:
  506. ef = 'em_uu';break;
  507. case 4:
  508. ef = 've_id';tab = "Vendor";uuf = "ve_uu";break;
  509. case 5:
  510. ef = 've_code';tab = "Vendor";uuf = "ve_uu";break;
  511. case 6:
  512. ef = 've_name';tab = "Vendor";uuf = "ve_uu";break;
  513. case 7:
  514. ef = 've_uu';tab = "Vendor";uuf = "ve_uu";break;
  515. case 8:
  516. ef = 'cu_id';tab = "Customer";uuf = "cu_uu";break;
  517. case 9:
  518. ef = 'cu_code';tab = "Customer";uuf = "cu_uu";break;
  519. case 10:
  520. ef = 'cu_name';tab = "Customer";uuf = "cu_uu";break;
  521. case 11:
  522. ef = 'cu_uu';tab = "Customer";uuf = "cu_uu";break;
  523. }
  524. if(ef == uuf) {
  525. window.location = 'uas:' + val + '@58.61.153.82';
  526. } else {
  527. Ext.Ajax.request({
  528. url : basePath + 'common/getFieldData.action',
  529. params: {
  530. caller: tab,
  531. field: uuf,
  532. condition: ef + '=\'' + val + '\''
  533. },
  534. method : 'post',
  535. callback : function(options,success,response){
  536. var rs = new Ext.decode(response.responseText);
  537. if(rs.exceptionInfo){
  538. showError(rs.exceptionInfo);
  539. } else if(rs.success){
  540. var uu = rs.data;
  541. if(Ext.isEmpty(uu)){
  542. showError(val + ' 的关联UU号为空!');
  543. } else {
  544. window.location = 'uas:' + uu + '@58.61.153.82';
  545. }
  546. }
  547. }
  548. });
  549. }
  550. },
  551. getMasterMenu : function() {
  552. var me = this;
  553. var menu = Ext.create('Ext.menu.Menu', {
  554. listeners: {
  555. buffer: 100,
  556. beforeshow: function(m) {
  557. me.getMasters(m);
  558. },
  559. afterrender: function( menu ) {
  560. menu.tip = new Ext.ToolTip({
  561. target: menu.getEl().getAttribute("id"),
  562. delegate: ".x-menu-item",
  563. trackMouse: true,
  564. renderTo: document.body,
  565. text: "text",
  566. title: "",
  567. width: 160,
  568. height: 50,
  569. listeners: {
  570. beforeshow: function updateTip( tip ) {
  571. var menuItem = menu.down('#' + tip.triggerElement.id );
  572. if( !menuItem.initialConfig.qtip ) return false;
  573. tip.body.dom.innerHTML = menuItem.initialConfig.qtip;
  574. }
  575. }
  576. });
  577. }
  578. }
  579. });
  580. return menu;
  581. },
  582. getMasters : function(m) {
  583. var me = this;
  584. if (m.items.items.length == 0 && !m.loaded) {
  585. // 取账套配置,以及账套权限配置
  586. Ext.Ajax.request({
  587. url: basePath + 'common/getAbleMasters.action',
  588. method: 'GET',
  589. callback: function(opt, s, r) {
  590. if (s) {
  591. var rs = Ext.decode(r.responseText),
  592. defaultSob=rs.defaultSob,
  593. c = rs.currentMaster,
  594. g = rs.group,
  595. _t = rs._type,
  596. _m = rs._master,
  597. _ma = new Array(),
  598. items = new Array();
  599. if(_m != null) {
  600. _ma = _m.split(',');
  601. }
  602. for(var i in rs.masters) {
  603. var s = rs.masters[i];
  604. if("true" === g && "admin" !== _t) {
  605. if(!Ext.Array.contains(_ma, s.ma_name)) {
  606. if(s.ma_type == 2) {
  607. if(!s.ma_soncode)
  608. continue;
  609. var h = s.ma_soncode.split(','), _b = false;
  610. for (j in h ) {
  611. if(Ext.Array.contains(_ma, h[j])) {
  612. _b = true;break;
  613. }
  614. };
  615. if(!_b) continue;
  616. } else
  617. continue;
  618. }
  619. }
  620. if(s.ma_name==defaultSob){
  621. s.ma_function=s.ma_function+"*";
  622. }
  623. var o = {text: s.ma_function, master: s, qtip: s.ma_name,
  624. listeners: {
  625. click: function(b) {
  626. me.changeMaster(b);
  627. }
  628. }};
  629. if (s.ma_name == c) {
  630. o.iconCls = 'main-todo';
  631. o.disabled = true;
  632. }
  633. items.push(o);
  634. }
  635. m.add(items);
  636. m.show();
  637. m.loaded = true;
  638. }
  639. }
  640. });
  641. }
  642. },
  643. changeMaster : function(b) {
  644. var me = this, tab = me.ownerCt.down('tabpanel'), bt = me.ownerCt.down('erpBottom'),tree=me.ownerCt.down('erpTreePanel');
  645. warnMsg('确定切换到' + b.text + '?', function(t){
  646. if(t == 'yes' || t == 'ok') {
  647. Ext.Ajax.request({
  648. url: basePath + 'common/changeMaster.action',
  649. params: {
  650. to: b.qtip
  651. },
  652. callback: function(opt, s, r) {
  653. var rs = Ext.decode(r.responseText);
  654. if(rs.success) {
  655. var img=me.down("image");
  656. img.fireEvent('beforerender',img,b.qtip);
  657. if (tab) {
  658. var p = tab.plugins[0];
  659. if (p) {
  660. p.doClose(true);
  661. }
  662. bt.update({sob: b.text});
  663. window.sob = b.qtip;
  664. var m = b.ownerCt, items = m.items.items;
  665. Ext.each(items, function(){
  666. if(this.id == b.id) {
  667. this.setIconCls('main-todo');
  668. this.setDisabled(true);
  669. } else {
  670. this.setIconCls(' ');
  671. this.setDisabled(false);
  672. }
  673. });
  674. var home = tab.down('#HomePage');
  675. if (home) {
  676. home.getEl().down('iframe').dom.contentWindow.location.reload();
  677. }
  678. me.ownerCt.down('erpNavigationTreePanel').getTreeRootNode(0);
  679. if(rs.typeChange) tree.getTreeRootNode(0);
  680. } else {
  681. window.location.reload();
  682. }
  683. } else {
  684. alert('切换失败,请检查您在(' + b.qtip + ')的账号和密码.');
  685. }
  686. }
  687. });
  688. }
  689. });
  690. }
  691. });