desktop.jsp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  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"
  323. src="<%=basePath %>resource/ux/PreviewPlugin.js"></script>
  324. <script type="text/javascript" src="<%=basePath %>resource/i18n/i18n.js"></script>
  325. <script type="text/javascript">
  326. var hasReminded ='<%=session.getAttribute("hasReminded")%>';
  327. var WHeight=window.innerHeight;
  328. Ext.Loader.setConfig({
  329. enabled: true
  330. });//开启动态加载
  331. Ext.application({
  332. name: 'erp',//为应用程序起一个名字,相当于命名空间
  333. appFolder: basePath+'app',//app文件夹所在路径
  334. controllers: [//声明所用到的控制层
  335. 'common.DeskTop'
  336. ],
  337. launch: function() {
  338. Ext.create('erp.view.common.DeskTop.ViewPort');
  339. }
  340. });
  341. var em_id ='<%=session.getAttribute("em_id")%>';
  342. function openTable(id, caller, title, link, key, detailKey, condition,relateMaster,limit){
  343. var main = parent.Ext.getCmp("content-panel");
  344. var item=main.items.items[0];
  345. var panel = Ext.getCmp('' + id);
  346. var url = parseUrl(link);
  347. if(id){
  348. if(caller){
  349. panel = Ext.getCmp(caller + id);
  350. if(url.indexOf('?')>0) {
  351. url = link + '&whoami=' + caller;
  352. }
  353. else url = link + '?whoami=' + caller;
  354. url = url + '&formCondition=' + key + '=' + id + '&gridCondition=' + detailKey + '=' + id;
  355. }
  356. } else {
  357. if(condition != null){
  358. url += '&urlcondition=' + parseUrl(condition);
  359. }
  360. }
  361. if(!limit){
  362. if(url.indexOf('?') > 0)
  363. url += '&_noc=1';
  364. else
  365. url += '?_noc=1';
  366. }
  367. if(relateMaster && relateMaster!='null'){
  368. url+='&newMaster='+relateMaster;
  369. }
  370. if( relateMaster && relateMaster!='null' ){
  371. var currentMaster = parent.window.sob;
  372. if ( currentMaster/* && currentMaster != relateMaster */) {// 无论账套是否一致都创建临时会话
  373. if (parent.Ext) {
  374. Ext.Ajax.request({
  375. url: basePath + 'common/changeMaster.action',
  376. params: {
  377. to: relateMaster
  378. },
  379. callback: function(opt, s, r) {
  380. if (s) {
  381. url+='&_center=1';
  382. var win = parent.Ext.create('Ext.Window', {
  383. width: '100%',
  384. height: '100%',
  385. draggable: false,
  386. closable: false,
  387. modal: true,
  388. title: '创建到账套' + relateMaster + '的临时会话',
  389. id:'modalwindow',
  390. historyMaster:currentMaster,
  391. relateMaster:currentMaster,
  392. html : '<iframe src="' + url + '" height="100%" width="100%" frameborder="0" style="border-width: 0px;padding: 0px;" scrolling="auto"></iframe>',
  393. buttonAlign: 'center',
  394. buttons: [{
  395. text: $I18N.common.button.erpCloseButton,
  396. cls: 'x-btn-blue',
  397. id: 'close',
  398. handler: function(b) {
  399. Ext.Ajax.request({
  400. url: basePath + 'common/changeMaster.action',
  401. params: {
  402. to: currentMaster
  403. },
  404. callback: function(opt, s, r) {
  405. if (s) {
  406. b.up('window').close();
  407. } else {
  408. alert('切换到原账套失败!');
  409. }
  410. }
  411. });
  412. }
  413. }]
  414. });
  415. win.show();
  416. } else {
  417. alert('无法创建到账套' + relateMaster + '的临时会话!');
  418. }
  419. }
  420. });
  421. }
  422. return;
  423. }
  424. }
  425. if(!panel){
  426. panel = {
  427. title : title.substring(0, title.toString().length > 5 ? 5 : title.toString().length),
  428. tag : 'iframe',
  429. tabConfig:{tooltip: title},
  430. border : false,
  431. layout : 'fit',
  432. iconCls : 'x-tree-icon-tab-tab',
  433. html : '<iframe id="iframe" src="' + basePath + url + '" height="100%" width="100%" frameborder="0" scrolling="auto"></iframe>',
  434. closable : true,
  435. listeners : {
  436. close : function(){
  437. main.setActiveTab(main.getActiveTab().id);
  438. }
  439. }
  440. };
  441. openTab(panel, panel.id);
  442. }else{
  443. main.setActiveTab(panel);
  444. }
  445. }
  446. function parseUrl(url) {
  447. var id = url.substring(url.lastIndexOf('?')+1);
  448. if (id == null) {
  449. id = url.substring(0,url.lastIndexOf('.'));
  450. }
  451. if(contains(url, 'session:em_uu', true)){
  452. url = url.replace(/session:em_uu/,em_uu);
  453. }
  454. if(contains(url, 'session:em_code', true)){
  455. url = url.replace(/session:em_code/, "'" + em_code + "'");
  456. }
  457. if(contains(url, 'sysdate', true)){
  458. url = url.replace(/sysdate/, "to_date('" + Ext.Date.toString(new Date()) + "','yyyy-mm-dd')");
  459. }
  460. if(contains(url, 'session:em_name', true)){
  461. url = url.replace(/session:em_name/,"'"+em_name+"'" );
  462. }
  463. if(contains(url, 'session:em_id', true)){
  464. url = url.replace(/session:em_id/,"'"+em_id+"'" );
  465. }
  466. return url;
  467. }
  468. function openTab(panel, id){
  469. var o = (typeof panel == "string" ? panel : id || panel.id);
  470. var main = parent.Ext.getCmp("content-panel");
  471. var tab = main.getComponent(o);
  472. if (tab) {
  473. main.setActiveTab(tab);
  474. } else if(typeof panel!="string"){
  475. panel.id = o;
  476. var p = main.add(panel);
  477. main.setActiveTab(p);
  478. }
  479. }
  480. function showWin(numId,mainId,insId,title,id){
  481. var url='common/charts/mobileCharts.action?numId='+numId+'&mainId='+mainId+'&insId='+insId+'&title='+title;
  482. if (Ext.getCmp('chwin')) {
  483. Ext.getCmp('chwin').setTitle(title);
  484. Ext.getCmp('chwin').insId=insId;
  485. Ext.getCmp('chwin').body.update('<iframe id="iframech" src="'+basePath+url+'" height="100%" width="100%" frameborder="0" scrolling="auto" ></iframe>');
  486. }
  487. else {var chwin = new Ext.window.Window({
  488. id : 'chwin',
  489. title: title,
  490. height: "100%",
  491. width: "80%",
  492. insId:insId,
  493. //maximizable : true,
  494. resizable:false,
  495. modal:true,
  496. buttonAlign : 'center',
  497. layout : 'anchor',
  498. items: [{
  499. tag : 'iframe',
  500. frame : true,
  501. anchor : '100% 100%',
  502. layout : 'fit',
  503. html : '<iframe id="iframech" src="'+basePath+url+'" height="100%" width="100%" frameborder="0" scrolling="auto" ></iframe>'
  504. }],
  505. buttons : [{
  506. text : '上一条',
  507. cls: 'x-btn-gray',
  508. handler : function(btn){
  509. prev(btn,id,btn.ownerCt.ownerCt.insId);
  510. }
  511. },{
  512. text : '下一条',
  513. cls: 'x-btn-gray',
  514. handler : function(btn){
  515. next(btn,id,btn.ownerCt.ownerCt.insId);
  516. }
  517. },{
  518. text : '关 闭',
  519. iconCls: 'x-button-icon-close',
  520. cls: 'x-btn-gray',
  521. handler : function(){
  522. Ext.getCmp('chwin').close();
  523. }
  524. }]
  525. });
  526. chwin.show();}}
  527. function prev(btn,tabId,insId,index){
  528. //递归查找下一条,并取到数据
  529. var grid=Ext.getCmp(tabId);
  530. var record =index?grid.store.getAt(index):grid.store.findRecord('ID_', insId, 0, false, false, true);
  531. var fIndex=index||record.index;
  532. if(fIndex-1 >=0){
  533. var d = grid.store.getAt(fIndex - 1);
  534. if(d){
  535. if(d.data['ID_']==insId){
  536. prev(btn,tabId,insId,d.index);//过滤因合计数据重复显示的记录
  537. }
  538. else {showWin(d.data['NUM_ID_'],d.data['INSTANCE_ID_'],d.data['ID_'],d.data['TITLE_'],tabId);}
  539. }}
  540. else alert('暂无上一条数据');//btn.setDisabled(true);
  541. }
  542. function next(btn,tabId,insId,index){
  543. //递归查找下一条,并取到数据
  544. var grid=Ext.getCmp(tabId);
  545. var record =index?grid.store.getAt(index):grid.store.findRecord('ID_', insId, 0, false, false, true);
  546. var fIndex=index||record.index;
  547. if(fIndex+1 < grid.store.data.items.length){
  548. var d = grid.store.getAt(fIndex + 1);
  549. if(d){
  550. if(d.data['ID_']==insId){
  551. next(btn,tabId,insId,d.index);
  552. }
  553. else {showWin(d.data['NUM_ID_'],d.data['INSTANCE_ID_'],d.data['ID_'],d.data['TITLE_'],tabId);}
  554. }}
  555. else alert('暂无下一条数据');//btn.setDisabled(true);
  556. }
  557. function getRemind(){
  558. if(hasReminded=='null'){
  559. Ext.Ajax.request({
  560. url : basePath + 'oa/note/getRemindItem.action',
  561. method : 'post',
  562. callback : function(opt, s, res){
  563. var r = new Ext.decode(res.responseText);
  564. if(r.exceptionInfo){
  565. showError(r.exceptionInfo);return;
  566. } else if(r.success && r.data){
  567. var remindtype=r.data.no_remindtype;
  568. var title=r.data.no_title;
  569. var content=r.data.no_content;
  570. var isrepeat=r.data.no_isrepeat;
  571. var approver=r.data.no_approver;
  572. var apptime=r.data.no_apptime;
  573. apptime=apptime.substr(0,10);
  574. if(isrepeat==-1){
  575. Ext.create('erp.view.core.window.MajorItemWarn',{title:title,itemContent:content,approver:approver,apptime:apptime,titlevalue:title});
  576. }else{
  577. if(r.data!="readed"){
  578. Ext.create('erp.view.core.window.MajorItemWarn',{title:title,itemContent:content,approver:approver,apptime:apptime,titlevalue:title});
  579. }
  580. }
  581. }
  582. }
  583. });
  584. }
  585. }
  586. </script>
  587. </head>
  588. <body onload="getRemind()">
  589. </body>
  590. </html>