1index.jsp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <jsp:include page="../../common/include.jsp" />
  4. <% String basePath = request.getScheme()+ "://" + request.getServerName() + ":" +request.getServerPort() + request.getContextPath(); %>
  5. <link rel="stylesheet" type="text/css" href="<%=basePath %>/My/Calendario/css/calendar.css" />
  6. <link rel="stylesheet" type="text/css" href="<%=basePath %>/My/Calendario/css/custom_2.css" />
  7. <style type="text/css">
  8. .custom-prev:before{
  9. width: 30px;
  10. height: 60px;
  11. cursor: pointer;
  12. margin: 0 1px;
  13. font-size: 20px;
  14. line-height: 60px;
  15. content: '\25c2';
  16. float:left;
  17. left: 5px;
  18. color: #1369d8;
  19. text-align: center;
  20. }
  21. .custom-next:before{
  22. width: 30px;
  23. height: 60px;
  24. cursor: pointer;
  25. margin: 0 1px;
  26. font-size: 20px;
  27. line-height: 60px;
  28. content: '\25c2';
  29. float:right;
  30. right: 5px;
  31. color: #1369d8;
  32. text-align: center;
  33. content: '\25b8';
  34. }
  35. </style>
  36. <script src="<%=basePath %>/My/Calendario/js/modernizr.custom.63321.js"></script>
  37. <script type="text/javascript"><!--
  38. //工作状态
  39. var taskStateObj = null;
  40. var taskState_array = null;
  41. /**用户显示区*/
  42. $(function() {
  43. $('#taskDataGrid').datagrid({
  44. rownumbers:true,
  45. fit:true,
  46. pageSize:10,
  47. pageList : [ 10, 20, 30, 40, 50 ],
  48. fitColumns:false,
  49. border:false,
  50. sortOrder:'desc',
  51. pagination:true,
  52. idField:'id',
  53. url:whzl.basePath + '/taskAction_listTask',
  54. toolbar:'#searchtool',
  55. checkOnSelect:true,
  56. selectOnCheck:false,
  57. nowrap:true,
  58. loadFilter:function(result){
  59. if(result.success){
  60. return result.obj;
  61. }else{
  62. $.messager.alert("提示",result.message);
  63. return ;
  64. }
  65. }
  66. });
  67. //工作任务状态
  68. $.ajax({
  69. type: "post",//使用post方法访问后台
  70. dataType: "json",//返回json格式的数据
  71. url: "aa10Action_listAa10All",//要访问的后台地址
  72. data:{"aa10.letter":"taskState" ,"aa10.name":"工作状态" },
  73. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  74. success: function(msg){//msg为返回的数据,在这里做数据绑定
  75. if(msg.success){
  76. taskStateObj = msg.obj.rows;
  77. var select_arr = [];
  78. var data = taskStateObj;
  79. for(var nItem = 0; nItem < data.length; nItem++ ){
  80. select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
  81. }
  82. taskState_array = select_arr.join("");
  83. $("#taskState").append(taskState_array);
  84. }
  85. }
  86. });
  87. });
  88. /**工作状态*/
  89. var taskStateFormatter = function(value , row , index){
  90. var taskState = "";
  91. for(var nItem = 0; nItem < taskStateObj.length; nItem++ ){
  92. if(taskStateObj[nItem].code == row.state){
  93. taskState = taskStateObj[nItem].value;
  94. break;
  95. }
  96. }
  97. return taskState;
  98. };
  99. var createUserFormatter = function(value , row , index){
  100. if(row.createUser!=null){
  101. return row.createUser.fullName;
  102. }else{
  103. return "";
  104. }
  105. };
  106. var taskUserFormatter = function(value , row , index){
  107. if(row.taskUser!=null){
  108. return row.taskUser.fullName;
  109. }else{
  110. return "";
  111. }
  112. };
  113. /**查询*/
  114. function searchFun(){
  115. $("#taskDataGrid").datagrid("load", {
  116. "task.state":$("#tblQuery").find("select[id='taskState']").val(),
  117. "task.taskName":$("#tblQuery").find("input[id='taskName']").val()
  118. });
  119. }
  120. /**查询*/
  121. function searchState(day){
  122. $("#taskDataGrid").datagrid("load", {
  123. "task.state":"1",
  124. "task.day":day
  125. });
  126. }
  127. /*清除查询条件**/
  128. function ClearQuery() {
  129. $("#tblQuery").find("input").val("");
  130. $("#tblQuery").find("select").val("-1");
  131. }
  132. /**更新*/
  133. var updateFormatter = function(value , row , index){
  134. if(row.state != 3){
  135. return "<img src='<%=basePath%>/images/pencil.png' title='修改' onclick=toUrl('" + row.id + "','" + row.taskName + "','" + row.href + "','" + row.objId + "') style='cursor:pointer' />";
  136. }else{
  137. return "";
  138. }
  139. };
  140. /**跳转至指定地址进行操作*/
  141. var toUrl = function(id,taskName,href,objId){
  142. if (href == "undefined"){
  143. }else{
  144. $('#taskDialog').dialog({
  145. title: taskName,
  146. width: 800,
  147. height: 400,
  148. closed: false,
  149. cache: false,
  150. iconCls : 'icon-update',
  151. href: href,
  152. modal: true,
  153. buttons : [
  154. {
  155. text : '确定',
  156. iconCls : 'icon-ok',
  157. handler : function(){
  158. task_submit(objId);
  159. }
  160. },
  161. {
  162. text : '取消',
  163. iconCls : 'icon-cancel',
  164. handler : function(){
  165. $("#taskDialog").dialog("close");
  166. }
  167. }
  168. ],
  169. onLoad : function(){
  170. task_load(objId);
  171. }
  172. });
  173. }
  174. }
  175. -->
  176. </script>
  177. <div class="easyui-layout" data-options="fit:true,border:false">
  178. <div data-options="region:'west',border:false" style="width: 75%;">
  179. <div id="searchtool" data-options="region:'north' , border:false">
  180. <div class="clear"></div>
  181. <table id="tblQuery" style="width:100%;">
  182. <tr>
  183. <td align="right" style="width: 70px;"><span>工作内容</span></td>
  184. <td style="width: 80px;">
  185. <input id="taskName" name="task.taskName" type="text" style="width: 100px;"/>
  186. </td>
  187. <td align="right" style="width: 70px;"><span>完成状态</span></td>
  188. <td style="width: 80px;">
  189. <select id="taskState" name="task.state" style="width:155px" onchange="searchFun();">
  190. <option value="">全部</option>
  191. </select>
  192. </td>
  193. <td align="left" style="width: 200px;">
  194. <a href="javascript:searchFun();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
  195. <a href="javascript:ClearQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-emptied',plain:true">清空</a>
  196. </td>
  197. </tr>
  198. </table>
  199. <div class="clear"></div>
  200. </div>
  201. <table id="taskDataGrid" title="我的工作" >
  202. <thead frozen="true">
  203. <tr>
  204. <th data-options="field:'taskName',sortable:true,width:300 ">工作内容</th>
  205. </tr>
  206. </thead>
  207. <thead>
  208. <tr>
  209. <th data-options="field:'createUserName',sortable:true,width:150,formatter:createUserFormatter">工作提交人</th>
  210. <th data-options="field:'taskUserName',sortable:true,width:150,formatter:taskUserFormatter">工作办理人</th>
  211. <th data-options="field:'workDate',sortable:true,width:150">办理时间</th>
  212. <th data-options="field:'state',align:'center',width:120,formatter:taskStateFormatter">当前状态</th>
  213. <th data-options="field:'update',align:'center',width:60,formatter:updateFormatter">立即处理</th>
  214. </tr>
  215. </thead>
  216. </table>
  217. </div>
  218. <div data-options="region:'east',border:false" style="width: 25%;height:auto;background-color: #FFF;">
  219. <div class="container">
  220. <div style="width: 250px;margin-left: auto;margin-right: auto;text-align: center;">
  221. <div class="custom-calendar-wrap">
  222. <div id="custom-inner" class="custom-inner">
  223. <div style="width: 250px;height: 60px;overflow: hidden;">
  224. <div style="width: 60px;height: 60px;overflow: hidden;line-height:60px;font-size:30px;text-align:center; float: left;">
  225. <div id="custom-day" style="width: 60px;height: 40px;overflow: hidden;line-height:40px;font-size:30px;text-align:center;color: #ef4f69;"></div>
  226. <div id="custom-week" style="width: 60px;height: 20px;overflow: hidden;line-height:20px;font-size:12px;text-align:center;color: #ccc;"></div>
  227. </div>
  228. <div class="whzlhead">
  229. <div style="width:190px;height: 60px;line-height:60px; font-size:20px; font-weight:bold; text-align: center;color: #1369d8;">
  230. <div id="custom-prev" class="custom-prev"></div>
  231. <div id="custom-next" class="custom-next"></div>
  232. <div style="height: 60px;width: 110px;text-align: center;margin-left: auto;margin-right: auto;">
  233. <div id="custom-year" style="float:left;"></div>
  234. <div id="custom-month"style="float:left;"></div>
  235. </div>
  236. </div>
  237. </div>
  238. </div>
  239. <div id="calendar" class="fc-calendar-container"></div>
  240. </div>
  241. </div>
  242. </div>
  243. </div>
  244. </div>
  245. </div>
  246. <div id="taskDialog"></div>
  247. <script type="text/javascript">
  248. <!--
  249. parent.$.messager.progress('close');
  250. //-->
  251. </script>
  252. <script type="text/javascript" src="<%=basePath %>/My/Calendario/js/jquery.calendario.js"></script>
  253. <script type="text/javascript">
  254. $(function() {
  255. var transEndEventNames = {
  256. 'WebkitTransition' : 'webkitTransitionEnd',
  257. 'MozTransition' : 'transitionend',
  258. 'OTransition' : 'oTransitionEnd',
  259. 'msTransition' : 'MSTransitionEnd',
  260. 'transition' : 'transitionend'
  261. },
  262. transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ],
  263. $wrapper = $( '#custom-inner' ),
  264. $calendar = $( '#calendar' ),
  265. cal,
  266. $day,
  267. $week,
  268. $month,
  269. $year;
  270. $.ajax({
  271. type: "post",//使用post方法访问后台
  272. dataType: "json",//返回json格式的数据
  273. url: "taskAction_listMyTask",//要访问的后台地址
  274. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  275. success: function(msg){//msg为返回的数据,在这里做数据绑定
  276. if(msg.success){
  277. var codropsEvents = {};
  278. for(var i = 0;i<msg.obj.length;i++){
  279. codropsEvents[msg.obj[i].date] = msg.obj[i].cnt;
  280. }
  281. cal = $calendar.calendario( {
  282. onDayClick : function( $el, $contentEl, dateProperties ) {
  283. if( $contentEl.length > 0 ) {
  284. showEvents( $contentEl, dateProperties );
  285. }
  286. },
  287. caldata : codropsEvents,
  288. displayWeekAbbr : true
  289. } ),
  290. $day = $( '#custom-day' ).html( cal.getDay()),
  291. $week = $( '#custom-week' ).html( cal.getWeek()),
  292. $month = $( '#custom-month' ).html( cal.getMonthName() + "月"),
  293. $year = $( '#custom-year' ).html( cal.getYear() + "年");
  294. }
  295. }
  296. });
  297. $( '#custom-next' ).on( 'click', function() {
  298. cal.gotoNextMonth( updateMonthYear );
  299. } );
  300. $( '#custom-prev' ).on( 'click', function() {
  301. cal.gotoPreviousMonth( updateMonthYear );
  302. } );
  303. function updateMonthYear() {
  304. $month.html( cal.getMonthName() + "月");
  305. $year.html( cal.getYear() + "年");
  306. }
  307. function showEvents( $contentEl, dateProperties ) {
  308. searchState(dateProperties.year + "-" + dateProperties.month + "-" + dateProperties.day);
  309. }
  310. });
  311. </script>