desktop.jsp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. <%@ page language="java" contentType="text/html; charset=utf-8"
  2. pageEncoding="utf-8"%>
  3. <%
  4. String path = request.getContextPath();
  5. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  6. %>
  7. <!DOCTYPE html>
  8. <html>
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  11. <link rel="stylesheet" type="text/css"
  12. href="<%=basePath %>resource/ext/resources/css/ext-all-gray.css" />
  13. <link rel="stylesheet" href="<%=basePath %>resource/css/main.css"
  14. type="text/css"></link>
  15. <style type="text/css">
  16. .lock {
  17. background: url('../../resource/images/16/lock.png') center center no-repeat;
  18. }
  19. .lockopen {
  20. background: url('../../resource/images/16/lock_open.png') center center no-repeat no-repeat;
  21. }
  22. font {
  23. font-size: 14px;
  24. }
  25. ul li a {
  26. font-size: 13.5px;
  27. text-decoration: none;
  28. }
  29. .x-panel-body-default {
  30. background: #f1f2f5;
  31. border-left: none !important;
  32. border-top: none !important;
  33. border-bottom: none !important;
  34. }
  35. .bench {
  36. background: url('<%=basePath %>resource/images/background_1.jpg');
  37. }
  38. .mydiv {
  39. height: 100%;
  40. background: #f1f1f1;
  41. }
  42. .home-div {
  43. height: 100%;
  44. background: url('<%=basePath %>resource/images/background_2.jpg');
  45. }
  46. .home-img {
  47. cursor: pointer;
  48. }
  49. .home-img:hover {
  50. background: url('<%=basePath %>resource/images/background_2.jpg');
  51. }
  52. .home-img span {
  53. font-size: 1;
  54. color: red;
  55. }
  56. .news,.notify {
  57. height: 100%;
  58. background: url('<%=basePath %>resource/images/background_1.jpg');
  59. }
  60. #bench_news,#bench_notify {
  61. width: 100%;
  62. }
  63. .schedule {
  64. background: url('<%=basePath %>resource/images/background_1.jpg');
  65. }
  66. .news ul {
  67. list-style: none;
  68. }
  69. .div-more a {
  70. color: #CD9B9B;
  71. }
  72. .subscription {
  73. height: 100%;
  74. background: url('<%=basePath %>resource/images/background_1.jpg');
  75. }
  76. .div-link {
  77. padding-left: 10px;
  78. margin-top: 3px;
  79. }
  80. a:hover {
  81. color: #8B8B00;
  82. }
  83. .btn-title {
  84. font-size: 13px;
  85. color: blue;
  86. margin-bottom: 0px;
  87. }
  88. .btn-title:hover {
  89. color: red;
  90. }
  91. .news-img {
  92. cursor: pointer;
  93. margin-left: 5px;
  94. }
  95. .news-img:hover {
  96. background: transparent;
  97. background-color: #D6BEF9;
  98. height: 38px;
  99. width: 38px;
  100. }
  101. .div-left {
  102. display: inline;
  103. float: left;
  104. color: green
  105. }
  106. .div-right {
  107. display: inline;
  108. float: right;
  109. font-family: sans-serif;
  110. }
  111. .div-right a {
  112. color: blue;
  113. text-decoration: none;
  114. font-size: 13px;
  115. }
  116. .div-right a:hover {
  117. color: red;
  118. cursor: pointer;
  119. font-weight: bold;
  120. }
  121. .div-left font {
  122. float: left;
  123. color: green;
  124. font-size: 13px;
  125. display: inline;
  126. }
  127. .x-panel-header-text {
  128. font-size: 13px;
  129. color: #09a471;
  130. font-weight: normal;
  131. }
  132. .x-panel-header-text-default-framed {
  133. font-size: 13px;
  134. color: #09a471;
  135. font-weight: normal;
  136. }
  137. #bench .x-panel-header .x-box-inner .x-box-item {
  138. display: inline;
  139. height: 18px;
  140. }
  141. .number {
  142. height: 24px;
  143. width: 24px;
  144. background: url('<%=basePath %>resource/images/number/number.png');
  145. margin-top: -30px;
  146. }
  147. .custom-grid .x-grid-row .x-grid-row-alt {
  148. height: 20px;
  149. }
  150. .custom-grid .x-grid-row .x-grid-cell {
  151. height: 20px;
  152. line-height: 20px;
  153. vertical-align: top;
  154. }
  155. .custom-grid .x-grid-row .x-grid-cell-inner {
  156. height: 20px;
  157. line-height: 20px;
  158. vertical-align: top;
  159. }
  160. .custom-grid .x-grid-row .x-grid-cell:hover {
  161. height: 26px;
  162. line-height: 26px;
  163. }
  164. .custom-grid a {
  165. text-decoration: none;
  166. }
  167. .custom-grid a:hover {
  168. font-weight: 800;
  169. }
  170. .custom-grid .x-action-col-icon {
  171. margin: 0px 5px 0px 5px;
  172. cursor: pointer;
  173. }
  174. .task-grid .x-grid-row .x-grid-row-alt {
  175. background-color: red !important;
  176. }
  177. .x-grid-cell-topic b {
  178. display: block;
  179. }
  180. .x-grid-cell-topic .x-grid-cell-inner {
  181. white-space: normal;
  182. height: auto !important;
  183. background-color:#FAFAFA;
  184. border-color: #ededed;
  185. border-style: solid;
  186. border-width: 1px 0;
  187. border-top-color: #F5F5F5;
  188. border-bottom: none;
  189. line-height: 26 px;
  190. white-space: nowrap
  191. }
  192. .x-grid-cell-topic1 .x-grid-cell-inner {
  193. white-space: normal;
  194. height: auto !important;
  195. background-color:#FAFAFA;
  196. border-color: #ededed;
  197. border-style: solid;
  198. border-width: 1px 0;
  199. border-top-color: #F5F5F5;
  200. border-bottom: none;
  201. line-height: 26 px;
  202. white-space: nowrap
  203. }
  204. .x-grid-cell-topic a {
  205. text-decoration: none;
  206. }
  207. .x-grid-cell-topic a:hover {
  208. text-decoration: underline;
  209. }
  210. .x-grid-cell-topic .x-grid-cell-innerf {
  211. padding: 5px;
  212. }
  213. .list-default>li {
  214. padding: 2px 5px;
  215. overflow: hidden;
  216. text-overflow: ellipsis;
  217. white-space: nowrap;
  218. }
  219. .custom-framed{
  220. padding:0px 0px 5px 0px;
  221. }
  222. .more-tool .x-tool-more {
  223. width: 47px;
  224. height: 16px;
  225. background-image: url('<%=basePath %>resource/images/mainpage/more.gif');
  226. }
  227. .x-grid-header-simple{
  228. border:none!important
  229. }
  230. .set-tool .x-tool-set {
  231. width: 16px;
  232. height: 16px;
  233. margin-right:5px;
  234. background-image: url('<%=basePath %>resource/images/mainpage/setting.png');
  235. }
  236. #app-header {
  237. color: #596F8F;
  238. font-size: 22px;
  239. font-weight: 200;
  240. padding: 8px 15px;
  241. text-shadow: 0 1px 0 #fff;
  242. }
  243. #app-msg {
  244. background: #D1DDEF;
  245. border: 1px solid #ACC3E4;
  246. padding: 3px 15px;
  247. font-weight: bold;
  248. font-size: 13px;
  249. position: absolute;
  250. right: 0;
  251. top: 0;
  252. }
  253. .x-panel-ghost {
  254. z-index: 1;
  255. }
  256. .x-border-layout-ct {
  257. background: #DFE8F6;
  258. }
  259. .x-portal-body {
  260. padding: 0 0 0 8px;
  261. overflow-y:auto;
  262. overflow-x:hidden !important;
  263. }
  264. .x-portal .x-portal-column {
  265. padding: 8px 8px 0 0;
  266. }
  267. .x-portal .x-panel-dd-spacer {
  268. border: 2px dashed #99bbe8;
  269. background: #f6f6f6;
  270. border-radius: 4px;
  271. -moz-border-radius: 4px;
  272. margin-bottom: 10px;
  273. }
  274. .x-portlet {
  275. margin-bottom:10px;
  276. padding: 1px;
  277. border-width: 1px;
  278. border-style: solid;
  279. }
  280. .x-portlet .x-panel-body {
  281. background: #fff;
  282. }
  283. .portlet-content {
  284. padding: 10px;
  285. font-size: 11px;
  286. }
  287. #app-options .portlet-content {
  288. padding: 5px;
  289. font-size: 12px;
  290. }
  291. .settings {
  292. background-image:url(../shared/icons/fam/folder_wrench.png);
  293. }
  294. .nav {
  295. background-image:url(../shared/icons/fam/folder_go.png);
  296. }
  297. .info {
  298. background-image:url(../shared/icons/fam/information.png);
  299. }
  300. .x-grid-cell-topic b {
  301. display: block;
  302. }
  303. .x-grid-cell-topic .x-grid-cell-inner {
  304. white-space: normal;
  305. }
  306. .x-grid-row .x-grid-cell a {
  307. // color: #385F95;
  308. text-decoration: none;
  309. }
  310. .x-grid-row .x-grid-cell a:hover {
  311. text-decoration: none;
  312. }
  313. .x-grid-cell-topic .x-grid-cell-innerf {
  314. padding: 5px;
  315. }
  316. .x-grid-row .x-grid-cell{
  317. background-color:#FAFAFA!important;
  318. }
  319. </style>
  320. <script type="text/javascript"
  321. src="<%=basePath %>resource/ext/ext-all.js"></script>
  322. <script type="text/javascript" src="<%=basePath %>resource/ux/PreviewPlugin.js"></script>
  323. <script type="text/javascript" src="<%=basePath %>resource/i18n/i18n.js"></script>
  324. <script type="text/javascript">
  325. var hasReminded ='<%=session.getAttribute("hasReminded")%>';
  326. var WHeight=window.innerHeight;
  327. Ext.Loader.setConfig({
  328. enabled: true
  329. });//开启动态加载
  330. Ext.application({
  331. name: 'erp',//为应用程序起一个名字,相当于命名空间
  332. appFolder: basePath+'app',//app文件夹所在路径
  333. controllers: [//声明所用到的控制层
  334. 'common.DeskTop'
  335. ],
  336. launch: function() {
  337. Ext.create('erp.view.common.DeskTop.ViewPort');
  338. }
  339. });
  340. var em_id ='<%=session.getAttribute("em_id")%>';
  341. function openTable(id, caller, title, link, key, detailKey, condition,relateMaster,limit){
  342. var main = parent.Ext.getCmp("content-panel");
  343. var item=main.items.items[0];
  344. var panel = Ext.getCmp('' + id);
  345. var url = parseUrl(link);
  346. if(id){
  347. if(caller){
  348. panel = Ext.getCmp(caller + id);
  349. if(url.indexOf('?')>0) {
  350. url = link + '&whoami=' + caller;
  351. }
  352. else url = link + '?whoami=' + caller;
  353. url = url + '&formCondition=' + key + '=' + id + '&gridCondition=' + detailKey + '=' + id;
  354. }
  355. } else {
  356. if(condition != null){
  357. url += '&urlcondition=' + parseUrl(condition);
  358. }
  359. }
  360. if(!limit){
  361. if(url.indexOf('?') > 0)
  362. url += '&_noc=1';
  363. else
  364. url += '?_noc=1';
  365. }
  366. if(relateMaster && relateMaster!='null'){
  367. url+='&newMaster='+relateMaster;
  368. }
  369. if( relateMaster && relateMaster!='null' ){
  370. var currentMaster = parent.window.sob;
  371. if ( currentMaster/* && currentMaster != relateMaster */) {// 无论账套是否一致都创建临时会话
  372. if (parent.Ext) {
  373. Ext.Ajax.request({
  374. url: basePath + 'common/changeMaster.action',
  375. params: {
  376. to: relateMaster
  377. },
  378. callback: function(opt, s, r) {
  379. if (s) {
  380. url+='&_center=1';
  381. var win = parent.Ext.create('Ext.Window', {
  382. width: '100%',
  383. height: '100%',
  384. draggable: false,
  385. closable: false,
  386. modal: true,
  387. title: '创建到账套' + relateMaster + '的临时会话',
  388. id:'modalwindow',
  389. historyMaster:currentMaster,
  390. relateMaster:currentMaster,
  391. html : '<iframe src="' + url + '" height="100%" width="100%" frameborder="0" style="border-width: 0px;padding: 0px;" scrolling="auto"></iframe>',
  392. buttonAlign: 'center',
  393. buttons: [{
  394. text: $I18N.common.button.erpCloseButton,
  395. cls: 'x-btn-blue',
  396. id: 'close',
  397. handler: function(b) {
  398. Ext.Ajax.request({
  399. url: basePath + 'common/changeMaster.action',
  400. params: {
  401. to: currentMaster
  402. },
  403. callback: function(opt, s, r) {
  404. if (s) {
  405. b.up('window').close();
  406. } else {
  407. alert('切换到原账套失败!');
  408. }
  409. }
  410. });
  411. }
  412. }]
  413. });
  414. win.show();
  415. } else {
  416. alert('无法创建到账套' + relateMaster + '的临时会话!');
  417. }
  418. }
  419. });
  420. }
  421. return;
  422. }
  423. }
  424. if(!panel){
  425. panel = {
  426. title : title.substring(0, title.toString().length > 5 ? 5 : title.toString().length),
  427. tag : 'iframe',
  428. tabConfig:{tooltip: title},
  429. border : false,
  430. layout : 'fit',
  431. iconCls : 'x-tree-icon-tab-tab',
  432. html : '<iframe id="iframe" src="' + basePath + url + '" height="100%" width="100%" frameborder="0" scrolling="auto"></iframe>',
  433. closable : true,
  434. listeners : {
  435. close : function(){
  436. main.setActiveTab(main.getActiveTab().id);
  437. }
  438. }
  439. };
  440. openTab(panel, panel.id);
  441. }else{
  442. main.setActiveTab(panel);
  443. }
  444. }
  445. function parseUrl(url) {
  446. var id = url.substring(url.lastIndexOf('?')+1);
  447. if (id == null) {
  448. id = url.substring(0,url.lastIndexOf('.'));
  449. }
  450. if(contains(url, 'session:em_uu', true)){
  451. url = url.replace(/session:em_uu/,em_uu);
  452. }
  453. if(contains(url, 'session:em_code', true)){
  454. url = url.replace(/session:em_code/, "'" + em_code + "'");
  455. }
  456. if(contains(url, 'sysdate', true)){
  457. url = url.replace(/sysdate/, "to_date('" + Ext.Date.toString(new Date()) + "','yyyy-mm-dd')");
  458. }
  459. if(contains(url, 'session:em_name', true)){
  460. url = url.replace(/session:em_name/,"'"+em_name+"'" );
  461. }
  462. if(contains(url, 'session:em_id', true)){
  463. url = url.replace(/session:em_id/,"'"+em_id+"'" );
  464. }
  465. return url;
  466. }
  467. function openTab(panel, id){
  468. var o = (typeof panel == "string" ? panel : id || panel.id);
  469. var main = parent.Ext.getCmp("content-panel");
  470. var tab = main.getComponent(o);
  471. if (tab) {
  472. main.setActiveTab(tab);
  473. } else if(typeof panel!="string"){
  474. panel.id = o;
  475. var p = main.add(panel);
  476. main.setActiveTab(p);
  477. }
  478. }
  479. function showWin(numId,mainId,insId,title,id){
  480. var url='common/charts/mobileCharts.action?numId='+numId+'&mainId='+mainId+'&insId='+insId+'&title='+title;
  481. if (Ext.getCmp('chwin')) {
  482. Ext.getCmp('chwin').setTitle(title);
  483. Ext.getCmp('chwin').insId=insId;
  484. Ext.getCmp('chwin').body.update('<iframe id="iframech" src="'+basePath+url+'" height="100%" width="100%" frameborder="0" scrolling="auto" ></iframe>');
  485. }
  486. else {var chwin = new Ext.window.Window({
  487. id : 'chwin',
  488. title: title,
  489. height: "100%",
  490. width: "80%",
  491. insId:insId,
  492. //maximizable : true,
  493. resizable:false,
  494. modal:true,
  495. buttonAlign : 'center',
  496. layout : 'anchor',
  497. items: [{
  498. tag : 'iframe',
  499. frame : true,
  500. anchor : '100% 100%',
  501. layout : 'fit',
  502. html : '<iframe id="iframech" src="'+basePath+url+'" height="100%" width="100%" frameborder="0" scrolling="auto" ></iframe>'
  503. }],
  504. buttons : [{
  505. text : '上一条',
  506. cls: 'x-btn-gray',
  507. handler : function(btn){
  508. prev(btn,id,btn.ownerCt.ownerCt.insId);
  509. }
  510. },{
  511. text : '下一条',
  512. cls: 'x-btn-gray',
  513. handler : function(btn){
  514. next(btn,id,btn.ownerCt.ownerCt.insId);
  515. }
  516. },{
  517. text : '关 闭',
  518. iconCls: 'x-button-icon-close',
  519. cls: 'x-btn-gray',
  520. handler : function(){
  521. Ext.getCmp('chwin').close();
  522. var panelObj = Ext.getCmp("detailPanel");
  523. panelObj.getStore().load();
  524. }
  525. }]
  526. });
  527. chwin.on('close',function(btn){
  528. var panelObj = Ext.getCmp("detailPanel");
  529. if(panelObj){
  530. panelObj.getStore().load();
  531. }
  532. });
  533. chwin.show();}}
  534. function prev(btn,tabId,insId,index){
  535. //递归查找下一条,并取到数据
  536. var grid=Ext.getCmp(tabId);
  537. var record =index?grid.store.getAt(index):grid.store.findRecord('ID_', insId, 0, false, false, true);
  538. var fIndex=index||record.index;
  539. if(fIndex-1 >=0){
  540. var d = grid.store.getAt(fIndex - 1);
  541. if(d){
  542. if(d.data['ID_']==insId){
  543. prev(btn,tabId,insId,d.index);//过滤因合计数据重复显示的记录
  544. }
  545. else {showWin(d.data['NUM_ID_'],d.data['INSTANCE_ID_'],d.data['ID_'],d.data['TITLE_'],tabId);}
  546. }}
  547. else alert('暂无上一条数据');//btn.setDisabled(true);
  548. }
  549. function next(btn,tabId,insId,index){
  550. //递归查找下一条,并取到数据
  551. var grid=Ext.getCmp(tabId);
  552. var record =index?grid.store.getAt(index):grid.store.findRecord('ID_', insId, 0, false, false, true);
  553. var fIndex=index||record.index;
  554. if(fIndex+1 < grid.store.data.items.length){
  555. var d = grid.store.getAt(fIndex + 1);
  556. if(d){
  557. if(d.data['ID_']==insId){
  558. next(btn,tabId,insId,d.index);
  559. }
  560. else {showWin(d.data['NUM_ID_'],d.data['INSTANCE_ID_'],d.data['ID_'],d.data['TITLE_'],tabId);}
  561. }}
  562. else alert('暂无下一条数据');//btn.setDisabled(true);
  563. }
  564. //
  565. function getRemind(){
  566. if(hasReminded=='null'){
  567. Ext.Ajax.request({
  568. url : basePath + 'oa/note/getRemindItem.action',
  569. method : 'post',
  570. callback : function(opt, s, res){
  571. var r = new Ext.decode(res.responseText);
  572. if(r.exceptionInfo){
  573. showError(r.exceptionInfo);return;
  574. } else if(r.success && r.data){
  575. var remindtype=r.data.no_remindtype;
  576. var title=r.data.no_title;
  577. var content=r.data.no_content;
  578. var isrepeat=r.data.no_isrepeat;
  579. var approver=r.data.no_approver;
  580. var apptime=r.data.no_apptime;
  581. apptime=apptime.substr(0,10);
  582. if(isrepeat==-1){
  583. Ext.create('erp.view.core.window.MajorItemWarn',{title:title,itemContent:content,approver:approver,apptime:apptime,titlevalue:title});
  584. }else{
  585. if(r.data!="readed"){
  586. Ext.create('erp.view.core.window.MajorItemWarn',{title:title,itemContent:content,approver:approver,apptime:apptime,titlevalue:title});
  587. }
  588. }
  589. }
  590. }
  591. });
  592. }
  593. }
  594. </script>
  595. </head>
  596. <body >
  597. </body>
  598. </html>