index.jsp 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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: 40px;
  11. cursor: pointer;
  12. margin: 0 1px;
  13. font-size: 20px;
  14. line-height: 40px;
  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: 40px;
  24. cursor: pointer;
  25. margin: 0 1px;
  26. font-size: 20px;
  27. line-height: 40px;
  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 ClearQuery() {
  122. $("#tblQuery").find("input").val("");
  123. $("#tblQuery").find("select").val("-1");
  124. }
  125. /**更新*/
  126. var updateFormatter = function(value , row , index){
  127. if(row.state != 3){
  128. return "<img src='<%=basePath%>/js/easyui/themes/itemicon/update.png' title='修改' onclick=toUrl('" + row.id + "','" + row.taskName + "','" + row.href + "','" + row.objId + "') style='cursor:pointer' />";
  129. }else{
  130. return "";
  131. }
  132. };
  133. /**跳转至指定地址进行操作*/
  134. var toUrl = function(id,taskName,href,objId){
  135. if (href == "undefined"){
  136. }else{
  137. $('#taskDialog').dialog({
  138. title: taskName,
  139. width: 920,
  140. height: 400,
  141. closed: false,
  142. cache: false,
  143. iconCls : 'icon-update',
  144. href: href,
  145. modal: true,
  146. buttons : [
  147. {
  148. text : '确定',
  149. iconCls : 'icon-ok',
  150. handler : function(){
  151. task_submit(objId);
  152. //$("#taskDialog").dialog("close");
  153. }
  154. },
  155. {
  156. text : '取消',
  157. iconCls : 'icon-cancel',
  158. handler : function(){
  159. $("#taskDialog").dialog("close");
  160. }
  161. }
  162. ],
  163. onLoad : function(){
  164. task_load(objId);
  165. },
  166. onClose:function(){
  167. updateTask();
  168. }
  169. });
  170. }
  171. }
  172. -->
  173. </script>
  174. <div class="easyui-layout" data-options="fit:true,border:false">
  175. <div data-options="region:'center',border:false">
  176. <div id="searchtool" data-options="region:'north',border:false">
  177. <div class="clear"></div>
  178. <table id="tblQuery" style="width:100%;">
  179. <tr>
  180. <td align="right" style="width: 70px;"><span>工作内容</span></td>
  181. <td style="width: 80px;">
  182. <input id="taskName" name="task.taskName" type="text" style="width: 100px;"/>
  183. </td>
  184. <td align="right" style="width: 70px;"><span>完成状态</span></td>
  185. <td style="width: 80px;">
  186. <select id="taskState" name="task.state" style="width:155px" onchange="searchFun();">
  187. <option value="">全部</option>
  188. </select>
  189. </td>
  190. <td align="left" style="width: 200px;">
  191. <a href="javascript:searchFun();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
  192. <a href="javascript:ClearQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-emptied',plain:true">清空</a>
  193. </td>
  194. </tr>
  195. </table>
  196. <div class="clear"></div>
  197. </div>
  198. <table id="taskDataGrid">
  199. <thead frozen="true">
  200. <tr>
  201. <th data-options="field:'taskName',sortable:true,width:400 ">工作内容</th>
  202. </tr>
  203. </thead>
  204. <thead>
  205. <tr>
  206. <th data-options="field:'workDate',sortable:true,width:150">办理时间</th>
  207. <th data-options="field:'state',align:'center',width:120,formatter:taskStateFormatter">当前状态</th>
  208. <th data-options="field:'update',align:'center',width:60,formatter:updateFormatter">立即处理</th>
  209. </tr>
  210. </thead>
  211. </table>
  212. </div>
  213. <div data-options="region:'east',border:false,minWidth:340,maxWidth:340" style="height:auto;background-color:#F5F5F5;">
  214. <iframe src="mainAction_tip" width="100%" height="99%" scrolling="no" frameborder="0"></iframe>
  215. </div>
  216. </div>
  217. <div id="taskDialog"></div>
  218. <script type="text/javascript">
  219. <!--
  220. parent.$.messager.progress('close');
  221. //-->
  222. </script>