123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- function getNowFormatDate() {
-
- var date = allGetServerTime();
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- var strDate = date.getDate();
- var hour=date.getHours();
- var currentdate = year + "."+ month + "."+ strDate;
- return "("+currentdate+")";
- }
- $(function() {
-
- $("#tim").html(getNowFormatDate);
- var DrillUrl = '/nwyj/ws/duty/DutyRecordsService/countDuty';
- //目前传后台id固定,为了测试数据效果
- var params = '1';
- $.ajax({
- url : DrillUrl,
- data : params,
- dataType : "json",
- type : "post",
- success : function(data) {
- //dept=JSON.stringify(data);
- var lengths = data.length;
-
- for(var i=0;i<lengths;i++){
- var td1 = "<td class='tdyell'>" + data[i].dept + "</td>";
- var td2 = "<td class='tdyell2'>" + data[i].leader_name+ "</td>";
- var td3 = "<td class='tdyell2'>" + data[i].leader_tel + "</td>";
- var td4 = "<td class='tdyell2'>" + data[i].name + "</td>";
- var td5 = "<td class='tdyell2'>" + data[i].telephone + "</td>";
- var td6 = "<td class='tdyell2'>" + data[i].duty_way + "</td>";
- $(".tr1").append(td1);
- $(".tr2").append(td2);
- $(".tr3").append(td3);
- $(".tr4").append(td4);
- $(".tr5").append(td5);
- $(".tr6").append(td6);
- }
- },
- error : function() {
- top.Dialog.alert("获取数据失败!");
- }
- });
- });
- function searchHandler(){
- if($("#timed").val()==''){
- return;
- }
- $(".tr1").empty();
- $(".tr2").empty();
- $(".tr3").empty();
- $(".tr4").empty();
- $(".tr5").empty();
- $(".tr6").empty();
- $(".tr1").append("<td class='td0' id='td0'>值班部门</td>");
- $(".tr2").append("<td class='td1' id='td1'>值班领导</td>");
- $(".tr3").append("<td class='td1' id='td1'>领导电话</td>");
- $(".tr4").append("<td class='td1' id='td1'>值班成员</td>");
- $(".tr5").append("<td class='td1' id='td1'>联系电话</td>");
- $(".tr6").append("<td class='td1' id='td1'>值班方式</td>");
- var queryTime=$("#timed").val();
- var arr=queryTime.split('-');
- var timm="("+arr[0]+"."+arr[1]+"."+arr[2]+")";
- $("#tim").html("");
- $("#tim").html(timm);
- var DrillUrl = '/nwyj/ws/crud/CRUDService/queryQui';
- var starttimed=queryTime+" 00:00";
- var endtimed=queryTime+" 23:59";
- var params = {
- listId : "335",
- condition : "IS_DEL='0' and RELEASE='1' and OPER_TIME between '"+starttimed+"' and '"+endtimed+"'"
- };
- $.ajax({
- url : DrillUrl,
- data : params,
- dataType : "json",
- type : "post",
- success : function(data) {
- var lengths=data.rows.length;
- for(var i=0;i<lengths;i++){
- var td1 = "<td class='tdyell'>" + data.rows[i].DEPT_NAMES_335_SHOW + "</td>";
- var queryDept=data.rows[i].FD_OBJECTID_335;
- var params = {
- listId : "336",
- condition : "IS_DEL='0' and duty_id = " +queryDept
- };
- $.ajax({
- url : DrillUrl,
- data : params,
- dataType : "json",
- type : "post",
- success : function(data) {
- var lengths=data.rows.length;
- for(var i=0;i<lengths;i++){
-
- var td2 = "<td class='tdyell2'>" + data.rows[i].LEADER_NAME_336+ "</td>";
- var td3 = "<td class='tdyell2'>" + data.rows[i].LEADER_TEL_336 + "</td>";
- var td4 = "<td class='tdyell2'>" + data.rows[i].NAME_336 + "</td>";
- var td5 = "<td class='tdyell2'>" + data.rows[i].TELEPHONE_336 + "</td>";
- var td6 = "<td class='tdyell2'>" + data.rows[i].DUTY_WAY_336_SHOW + "</td>";
- $(".tr1").append(td1);
- $(".tr2").append(td2);
- $(".tr3").append(td3);
- $(".tr4").append(td4);
- $(".tr5").append(td5);
- $(".tr6").append(td6);
- }
- },
- error : function() {
- top.Dialog.alert("获取数据失败!");
- }
- });
- }
- },
- error : function() {
- top.Dialog.alert("获取数据失败!");
- }
- });
-
- }
|