123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>值班安排详细</title>
- <%@include file="../../../include1.jsp" %>
- <style type="text/css">
- .cententCenter{
- text-align: center;
- }
- .table{
- /* margin-top: 15px; */
- width:90%;
- margin: 15px auto;
- border-collapse: collapse;
- border:1pt solid #cbcbcb;
- padding: 5px;
- }
- .td_head{
- border: 1pt solid #cbcbcb;
- height:36px;
- line-height: 36px;
- font-weight: bold;
- }
- .td_border1{
- border-right:1pt solid #cbcbcb;
- border-left:1pt solid #cbcbcb;
- border-bottom:1pt solid #cbcbcb;
- height:36px;
- line-height: 36px;
- text-align: center
- }
- .td_break{
- word-wrap:break-word;
- word-break:break-all;
- width:20%;
- }
- </style>
- <script type="text/javascript">
- var fd_objectid="<%=request.getParameter("fd_id")%>";
-
- //返回主页面
- function goBack() {
- //获取iframe中的元素值
- var iframe =parent.document.getElementsByName("frmright")[0];
- iframe.src = "/nwyj/page/business/em/warningDuty/DutyRecords.jsp";
- }
- $(function(){
- $("#titleShow").text("查看值班详细");
-
- $("#goback").hover(function(){
- $(this).attr("src","/nwyj/images/temp/back_hover.png");
- },function(){
- $(this).attr("src","/nwyj/images/temp/back.png");
- });
- $("#goback").bind("click",goBack);
- if(fd_objectid.length>0){
- var params = {classid : "311",objectID : fd_objectid};
- $.ajax({
- url : $.pathname() + '/ws/crud/CRUDService/getDataById/',
- type : 'post',
- data : params,
- dataType : 'json',
- success : function(data){
- for(col in data){
- $("div#"+col).html(data[col]);
- }
- var recordId = data.FD_OBJECTID_311;
- var planId = data.DUTY_PLAN_ID_311;
- var dutyNum = getDutyNum(planId);
- //查询加载值班详情
- queryDutyDetail(recordId,dutyNum);
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
-
- });
- /**
- 根据值班记录id查询值班详细
- ***/
- function queryDutyDetail(recordId,dutyNum){
- var url = $.pathname() + "/ws/wduty/WarningDutyService/loadDutyDetailByRecordsId/";
- var params = {
- recordsId:recordId
- };
- $("body").eq(0).showLoading();
- $.ajax({
- url : url,
- type : 'post',
- data : params,
- dataType : 'json',
- success : function(data){
- createDutyDetailTable(data,dutyNum);
- $("body").eq(0).hideLoading();
- },
- error : function(e){
- $("body").eq(0).hideLoading();
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- /****
- 加载表格,显示值班详细
- ***/
- function createDutyDetailTable(data,dutyNum){
- var table = $("#table_con");
- var th = $("<thead></thead>");
- var tbody = $("<tbody></tbody>");
- table.append(th).append(tbody);
- //表头
- 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>"));
- if(!data|| data=="null" || data.length==0){
- var tr = $("<tr></tr>");
- tbody.append(tr);
- td = $("<td class='cententCenter td_border1 td_break' colspan='5'>没有值班安排数据</td>");
- tr.append(td)
- return ;
- }
- var str =JSON.stringify(data);
- var num = 0;
- for (var i = 0; i < data.length; i++) {
- var DUTY_DATE = data[i].DUTY_DATE;
- var DBLD = data[i].DBLD;
- var DUTY_TIME = data[i].DUTY_TIME;
- var CZ = data[i].CZ.stringWrap();
- var ZG = data[i].ZG.stringWrap();
- var tr = $("<tr></tr>");
- tbody.append(tr);
- var td1 = "";
- var td2 = "";
- var td3 = "";
- var td4 = "";
- var td5 = "";
- var reg = new RegExp("\""+DUTY_DATE+"\"","g");
- var arr = str.match(reg);
- if(num==0){
- td1 = $("<td class='cententCenter td_border1 td_break' rowspan='"+arr.length+"'>"+DUTY_DATE+"</td>");
- td2 = $("<td class='cententCenter td_border1 td_break' >"+DUTY_TIME+"</td>");
- td3 = $("<td class='cententCenter td_border1 td_break' rowspan='"+arr.length+"' >"+DBLD+"</td>");
- td4 = $("<td class='cententCenter td_border1 td_break' >"+CZ+"</td>");
- td5 = $("<td class='cententCenter td_border1 td_break' >"+ZG+"</td>");
- tr.append(td1).append(td2).append(td3).append(td4).append(td5);
- num++;
- }else{
- td2 = $("<td class='cententCenter td_border1 td_break' >"+DUTY_TIME+"</td>");
- td4 = $("<td class='cententCenter td_border1 td_break' >"+CZ+"</td>");
- td5 = $("<td class='cententCenter td_border1 td_break' >"+ZG+"</td>");
- tr.append(td2).append(td4).append(td5);
- num++;
- }
- if(arr.length==num){
- num=0;
- }
- }
- setHight();
- }
- /*****
- 通过任务id获取班次
- ****/
- function getDutyNum(planId){
- var num = 0;
- var params = {classid : "310",objectID : planId};
- $.ajax({
- url : $.pathname() + '/ws/crud/CRUDService/getDataById/',
- type : 'post',
- data : params,
- dataType : 'json',
- async:false,
- success : function(data){
- num = data.DUTY_NUM_310;
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- return num;
- }
- /**
- * 字符串将@符号转化为换行符
- */
- String.prototype.stringWrap = function(){
- return this.replace(/@/g, "</br>");
- };
- </script>
- </head>
- <body class="bd" align="center" >
- <div id="formContent" class="d_ground">
- <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>
- <form id="myFormId" >
- <input name="classid" value="311" type="hidden"/>
- <input id="FD_OBJECTID311" name="FD_OBJECTID311" type="hidden"/>
- <fieldset class="fieldset">
- <legend class="legend">基本信息:</legend>
- <table class="add_table_style view_table" >
- <tr>
- <td width="15%" align="right" >记录名称:</td>
- <td width="40%"><div name="DUTY_RECORD_NAME_311" id="DUTY_RECORD_NAME_311" style="width:90%"></div></td>
- <td width="15%" align="right" >任务名称:</td>
- <td width="30%"><div name="DUTY_PLAN_ID_311_SHOW" id="DUTY_PLAN_ID_311_SHOW" style="width:90%"></div></td>
- </tr>
- <tr>
- <td width="15%" align="right" >状态:</td>
- <td width="85%" colspan="3"><div name="RELEASE_STATE_311_SHOW" id="RELEASE_STATE_311_SHOW" style="width:90%"></div></td>
- </tr>
- <tr>
- <td align="right" >单位:</td>
- <td ><div name="INPUT_PER_UNIT_ID_311_SHOW" id="INPUT_PER_UNIT_ID_311_SHOW" /></td>
- <td align="right" >部门:</td>
- <td><div name="INPUT_PER_DEPT_NAME_311" id="INPUT_PER_DEPT_NAME_311" /></td>
- </tr>
- <tr>
- <td align="right" >填写人员:</td>
- <td ><div name="INPUT_PER_NAME_311" id="INPUT_PER_NAME_311" /></td>
- <td align="right" >更新时间:</td>
- <td><div name="UPDATEDATE_311" id="UPDATEDATE_311" /></td>
- </tr>
- </table>
- </fieldset>
- <div >
- <table id='table_con' class='table'>
-
- </table>
- </div>
- </form>
- </div>
- </body>
- </html>
|