123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>湖北智慧水运</title>
-
- <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
- <meta http-equiv="description" content="this is my page">
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
-
- <link href="../css/base.min.css" rel="stylesheet">
- <link rel="stylesheet" type="text/css" href="../css/mui.min.css">
- <meta http-equiv="description" content="this is my page">
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <script type="text/javascript" src="../js/zepto.min.js"></script>
-
- <script type="text/javascript">
-
- //获取url参数
- function getQueryString(name) {
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
- var r = window.location.search.substr(1).match(reg);
- if (r != null) return unescape(r[2]); return null;
- }
-
- $(function(){
- $("#baocun").click(function(){
- if($("#info").val() == ""){
- layer.open({
- content: '日程内容不能为空',
- style: 'background-color:rgba(0,0,0,0.5);color:white; border:none;font-size:20px;text-align:center',
- shade:false,
- time: 1.5
- });
- return;
- }
- if($("#time2").val() == ""){
- layer.open({
- content: '时间不能为空',
- style: 'background-color:rgba(0,0,0,0.5);color:white; border:none;font-size:20px;text-align:center',
- shade:false,
- time: 1.5
- });
- return;
- }
- $.ajax({
- type : 'post',
- url : '../../jhrccontroller/savejhrc.do',
- data:{
- year:year,
- month:month,
- day:day,
- flag:"8",
- id:$("#savaId").val(),
- info:$("#info").val(),
- remindtime:$("#time2").val()+":00",
- uid:"402881e44e86c26d014e86c9ae8c0008"
- },
- dataType : 'json',
- success : function(data) {
- if(data[0].resultCode == '0'){
- window.location.reload();
- }
- }
-
- });
- });
-
- var pdata = getQueryString("data");
- pdata = pdata.substring(0,11);
- var da = pdata.split("-");
- var year = da[0];
- var month = parseInt(da[1]);
- var day = parseInt(da[2]);
-
-
- $.ajax({
- type : 'post',
- url : '../../jhrccontroller/viewjhrc.do',
- data:{
- year:year,
- month:month,
- day:day,
- flag:"8",
- uid:"402881e44e86c26d014e86c9ae8c0008"
- },
- dataType : 'json',
- success : function(data) {
- console.log(data);
- if(data[0].resultCode == '0'){
- for (var i = 0; i < data[0].grrcList.length; i++) {
- var str = "<li class='mui-table-view-cell' id='mui"+data[0].grrcList[i].id+"'>";
- str= str+data[0].grrcList[i].scheduleinfo;
- var month="";
- if(data[0].month < 10){
- month = "0"+data[0].month;
- }else{
- month = data[0].month;
- }
- var day = "";
- if(data[0].day < 10){
- day = "0"+data[0].day;
- }else{
- day = data[0].day;
- }
- var time="";
- var time1= "";
- if(data[0].grrcList[i].remindtime!=null){
- var h = data[0].grrcList[i].remindtime.hour;
- var m = data[0].grrcList[i].remindtime.minute;
- if(h<10){
- h=" 0"+h;
- }
- if(m<10){
- m="0"+m
- }
- time= h+":"+m+":00";
- time1=data[0].grrcList[i].remindtime.hour+":"+data[0].grrcList[i].remindtime.minute;
- }
-
- var da = data[0].year+"-"+month+"-"+day+" "+time;
- str=str+"<p>"+da+"</p>";
- str=str+"<span style='float: right;'>";
- str=str+"<span class='mui-icon mui-icon-compose upjihua' id='"+data[0].grrcList[i].id+"' info='"+data[0].grrcList[i].scheduleinfo+"' da='"+time1+"' onclick='edit(this);'></span>";
- str=str+"<span class='mui-icon mui-icon-trash' onclick='del(\""+data[0].grrcList[i].id+"\");'></span>";
- str=str+"</span>";
- str=str+"</li>";
- $("#infoul").append(str);
- }
- }
- }
- });
- $(".upjihua").on("click",function(){
- $("#jid").val("1");
- $("#title").html("修改计划");
- $("#div-alert").show(200);
- $("#div-alert1").show(200);
- });
- $("#queren").on("click",function(){
- var jid = $("#jid").val();
- if(jid!=""){
- alert("修改")
- }else{
- alert("保存")
- }
- $("#div-alert").hide();
- $("#div-alert1").hide();
- });
-
- $("#quxiao").on("click",function(){
- $("#div-alert").hide();
- $("#div-alert1").hide();
- });
- });
- function addjihua(id){
- $("#time2").val("--:--");//清空时间
- $("#info").val("");//清空信息描述
- $("#jid").val("");
- $("#title").html("添加计划");
- $("#div-alert").show(200);
- $("#div-alert1").show(200);
- $("#savaId").val(id);
- }
- function del(id){
- layer.open({
- content: '确定删除日程吗?',
- btn: ['取消', '确定'],
- shadeClose: false,
- yes: function(){
- layer.closeAll();
- }, no: function(){
- $.ajax({
- type : 'post',
- url : '../../jhrccontroller/deletejhrc.do',
- data:{
- year:"2015",
- month:"7",
- day:"1",
- flag:"8",
- id:id,
- uid:"402881e44e86c26d014e86c9ae8c0008"
- },
- dataType : 'json',
- success : function(data) {
- if(data[0].resultCode == '0'){
- $("#mui"+id).remove();
- }
- }
- });
- layer.closeAll();
- }
- });
- }
- //编辑
- function edit(ok){
-
- var time = $(ok).attr("da").split(":");
- var h = time[0];
- var m = time[1];
-
- if(h < 10){
- h = "0"+h
- }
- if(m < 10){
- m = "0"+m;
- }
-
- $("#savaId").val($(ok).attr("id"));//存储处理id
- $("#time2").val(h+":"+m);//回写时间
- $("#info").val($(ok).attr("info"));//回写信息
- $("#jid").val("");
- $("#title").html("编辑计划");
- $("#div-alert").show(200);
- $("#div-alert1").show(200);
- }
- </script>
- <style type="text/css">
- .header {
- width:100%;
- height:45px;
- line-height:45px;
- padding:0;
- color:#eee;
- font-size:22px;
- text-align:center;
- color:white;
- background: #2196f3;
- }
- .nav{position: fixed;}
- .header-logo{float: none;}
- body,button,input,div{margin: 0px;padding: 0px}
- </style>
- </head>
-
- <body>
- <header class="header">
- <ul class="nav nav-list pull-left">
- <li><a href="javascript:void(0);" id="goback" onclick="history.back()"><span class="icon icon-arrow-back icback"></span>
- </a></li>
- </ul>
- <a class="header-logo" href="#">当天计划</a>
- </header>
- <div class="mui-content" style="background: white;margin-top: 45px;">
- <ul class="mui-table-view" id = "infoul">
- </ul>
- </div>
- <div style="text-align: center;padding-top: 10px;"> <button class="mui-btn mui-btn-positive" type="button" style="width: 90%;background: #2196f3;border: 0px;" onclick="addjihua('');" id="addjihua">添加计划</button></div>
- <div id="div-alert" style="position: absolute;display:none;top: 20%;left: 10%;z-index: 100;height:270px;border:4px solid #2196f3;border-radius:10px;width: 82%;background:white;">
- <form id="jhform">
- <input type="hidden" name="jid" id="jid" value=""/>
- <div id="title" style="width:100%;height:30px;text-align: center;background:#2196f3;line-height: 30px;color: white;margin-bottom: 20px;font-size:20px;" >添加计划</div>
- <label style="">时间: </label><input id="time2" name="time2" type="time" style="width: 72%" /><br>
- <label style="">内容: </label><input id="info" name="content" type="text" style="width: 72%" />
- </form>
- <div style="width: 100%;text-align: center;">
- <input type="hidden" id = "savaId" />
- <button class="mui-btn mui-btn-positive" type="button" style="width: 40%;background: #2196f3;border: 0px;" id="baocun">保存 </button>
- <button class="mui-btn mui-btn-positive" type="button" style="width: 40%;background: #2196f3;border: 0px;" id="quxiao">取消</button>
- </div>
- </div>
- <div id="div-alert1" style="position:absolute;width:100%;height: 100%;display:none;z-index: 50;top:0px;background: black; opacity:0.2; "></div>
- </body>
- </html>
|