b7ba8a3997c7654824f373165578d23dffd1dfe2.svn-base 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>值班安排详细</title>
  7. <%@include file="../../../include1.jsp" %>
  8. <style type="text/css">
  9. .cententCenter{
  10. text-align: center;
  11. }
  12. .table{
  13. /* margin-top: 15px; */
  14. width:90%;
  15. margin: 15px auto;
  16. border-collapse: collapse;
  17. border:1pt solid #cbcbcb;
  18. padding: 5px;
  19. }
  20. .td_head{
  21. border: 1pt solid #cbcbcb;
  22. height:36px;
  23. line-height: 36px;
  24. font-weight: bold;
  25. }
  26. .td_border1{
  27. border-right:1pt solid #cbcbcb;
  28. border-left:1pt solid #cbcbcb;
  29. border-bottom:1pt solid #cbcbcb;
  30. height:36px;
  31. line-height: 36px;
  32. text-align: center
  33. }
  34. .td_break{
  35. word-wrap:break-word;
  36. word-break:break-all;
  37. width:20%;
  38. }
  39. </style>
  40. <script type="text/javascript">
  41. var fd_objectid="<%=request.getParameter("fd_id")%>";
  42. //返回主页面
  43. function goBack() {
  44. //获取iframe中的元素值
  45. var iframe =parent.document.getElementsByName("frmright")[0];
  46. iframe.src = "/nwyj/page/business/em/warningDuty/DutyRecords.jsp";
  47. }
  48. $(function(){
  49. $("#titleShow").text("查看值班详细");
  50. $("#goback").hover(function(){
  51. $(this).attr("src","/nwyj/images/temp/back_hover.png");
  52. },function(){
  53. $(this).attr("src","/nwyj/images/temp/back.png");
  54. });
  55. $("#goback").bind("click",goBack);
  56. if(fd_objectid.length>0){
  57. var params = {classid : "311",objectID : fd_objectid};
  58. $.ajax({
  59. url : $.pathname() + '/ws/crud/CRUDService/getDataById/',
  60. type : 'post',
  61. data : params,
  62. dataType : 'json',
  63. success : function(data){
  64. for(col in data){
  65. $("div#"+col).html(data[col]);
  66. }
  67. var recordId = data.FD_OBJECTID_311;
  68. var planId = data.DUTY_PLAN_ID_311;
  69. var dutyNum = getDutyNum(planId);
  70. //查询加载值班详情
  71. queryDutyDetail(recordId,dutyNum);
  72. },
  73. error : function(e){
  74. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  75. }
  76. });
  77. }
  78. });
  79. /**
  80. 根据值班记录id查询值班详细
  81. ***/
  82. function queryDutyDetail(recordId,dutyNum){
  83. var url = $.pathname() + "/ws/wduty/WarningDutyService/loadDutyDetailByRecordsId/";
  84. var params = {
  85. recordsId:recordId
  86. };
  87. $("body").eq(0).showLoading();
  88. $.ajax({
  89. url : url,
  90. type : 'post',
  91. data : params,
  92. dataType : 'json',
  93. success : function(data){
  94. createDutyDetailTable(data,dutyNum);
  95. $("body").eq(0).hideLoading();
  96. },
  97. error : function(e){
  98. $("body").eq(0).hideLoading();
  99. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  100. }
  101. });
  102. }
  103. /****
  104. 加载表格,显示值班详细
  105. ***/
  106. function createDutyDetailTable(data,dutyNum){
  107. var table = $("#table_con");
  108. var th = $("<thead></thead>");
  109. var tbody = $("<tbody></tbody>");
  110. table.append(th).append(tbody);
  111. //表头
  112. th.append($("<tr><td class='cententCenter td_head'>值班日期</td><td class='cententCenter td_head'>值班时间</td><td class='cententCenter td_head'>带班领导</td><td class='cententCenter td_head'>处长</td><td class='cententCenter td_head'>主管</td></tr>"));
  113. if(!data|| data=="null" || data.length==0){
  114. var tr = $("<tr></tr>");
  115. tbody.append(tr);
  116. td = $("<td class='cententCenter td_border1 td_break' colspan='5'>没有值班安排数据</td>");
  117. tr.append(td)
  118. return ;
  119. }
  120. var str =JSON.stringify(data);
  121. var num = 0;
  122. for (var i = 0; i < data.length; i++) {
  123. var DUTY_DATE = data[i].DUTY_DATE;
  124. var DBLD = data[i].DBLD;
  125. var DUTY_TIME = data[i].DUTY_TIME;
  126. var CZ = data[i].CZ.stringWrap();
  127. var ZG = data[i].ZG.stringWrap();
  128. var tr = $("<tr></tr>");
  129. tbody.append(tr);
  130. var td1 = "";
  131. var td2 = "";
  132. var td3 = "";
  133. var td4 = "";
  134. var td5 = "";
  135. var reg = new RegExp("\""+DUTY_DATE+"\"","g");
  136. var arr = str.match(reg);
  137. if(num==0){
  138. td1 = $("<td class='cententCenter td_border1 td_break' rowspan='"+arr.length+"'>"+DUTY_DATE+"</td>");
  139. td2 = $("<td class='cententCenter td_border1 td_break' >"+DUTY_TIME+"</td>");
  140. td3 = $("<td class='cententCenter td_border1 td_break' rowspan='"+arr.length+"' >"+DBLD+"</td>");
  141. td4 = $("<td class='cententCenter td_border1 td_break' >"+CZ+"</td>");
  142. td5 = $("<td class='cententCenter td_border1 td_break' >"+ZG+"</td>");
  143. tr.append(td1).append(td2).append(td3).append(td4).append(td5);
  144. num++;
  145. }else{
  146. td2 = $("<td class='cententCenter td_border1 td_break' >"+DUTY_TIME+"</td>");
  147. td4 = $("<td class='cententCenter td_border1 td_break' >"+CZ+"</td>");
  148. td5 = $("<td class='cententCenter td_border1 td_break' >"+ZG+"</td>");
  149. tr.append(td2).append(td4).append(td5);
  150. num++;
  151. }
  152. if(arr.length==num){
  153. num=0;
  154. }
  155. }
  156. setHight();
  157. }
  158. /*****
  159. 通过任务id获取班次
  160. ****/
  161. function getDutyNum(planId){
  162. var num = 0;
  163. var params = {classid : "310",objectID : planId};
  164. $.ajax({
  165. url : $.pathname() + '/ws/crud/CRUDService/getDataById/',
  166. type : 'post',
  167. data : params,
  168. dataType : 'json',
  169. async:false,
  170. success : function(data){
  171. num = data.DUTY_NUM_310;
  172. },
  173. error : function(e){
  174. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  175. }
  176. });
  177. return num;
  178. }
  179. /**
  180. * 字符串将@符号转化为换行符
  181. */
  182. String.prototype.stringWrap = function(){
  183. return this.replace(/@/g, "</br>");
  184. };
  185. </script>
  186. </head>
  187. <body class="bd" align="center" >
  188. <div id="formContent" class="d_ground">
  189. <div class="title" align="center"><a href="javascript:;"><img id='goback' class="back" title="返回" align="left" alt="返回" src="/nwyj/images/temp/back.png" ></img></a><font class="title_font" id="titleShow"></font></div>
  190. <form id="myFormId" >
  191. <input name="classid" value="311" type="hidden"/>
  192. <input id="FD_OBJECTID311" name="FD_OBJECTID311" type="hidden"/>
  193. <fieldset class="fieldset">
  194. <legend class="legend">基本信息:</legend>
  195. <table class="add_table_style view_table" >
  196. <tr>
  197. <td width="15%" align="right" >记录名称:</td>
  198. <td width="40%"><div name="DUTY_RECORD_NAME_311" id="DUTY_RECORD_NAME_311" style="width:90%"></div></td>
  199. <td width="15%" align="right" >任务名称:</td>
  200. <td width="30%"><div name="DUTY_PLAN_ID_311_SHOW" id="DUTY_PLAN_ID_311_SHOW" style="width:90%"></div></td>
  201. </tr>
  202. <tr>
  203. <td width="15%" align="right" >状态:</td>
  204. <td width="85%" colspan="3"><div name="RELEASE_STATE_311_SHOW" id="RELEASE_STATE_311_SHOW" style="width:90%"></div></td>
  205. </tr>
  206. <tr>
  207. <td align="right" >单位:</td>
  208. <td ><div name="INPUT_PER_UNIT_ID_311_SHOW" id="INPUT_PER_UNIT_ID_311_SHOW" /></td>
  209. <td align="right" >部门:</td>
  210. <td><div name="INPUT_PER_DEPT_NAME_311" id="INPUT_PER_DEPT_NAME_311" /></td>
  211. </tr>
  212. <tr>
  213. <td align="right" >填写人员:</td>
  214. <td ><div name="INPUT_PER_NAME_311" id="INPUT_PER_NAME_311" /></td>
  215. <td align="right" >更新时间:</td>
  216. <td><div name="UPDATEDATE_311" id="UPDATEDATE_311" /></td>
  217. </tr>
  218. </table>
  219. </fieldset>
  220. <div >
  221. <table id='table_con' class='table'>
  222. </table>
  223. </div>
  224. </form>
  225. </div>
  226. </body>
  227. </html>