Commit 31fcb9f51d732a1892ec19a2dd6af09bac7d4134
1 parent
7f0bfeef
工时填报
Showing
4 changed files
with
98 additions
and
21 deletions
topages/hourscount/hourscount.html
| @@ -12,9 +12,9 @@ | @@ -12,9 +12,9 @@ | ||
| 12 | <div class="timeopr-text float-left">选择项目</div> | 12 | <div class="timeopr-text float-left">选择项目</div> |
| 13 | <div class="float-left hourscount-timeopr-div margin-right-40"> | 13 | <div class="float-left hourscount-timeopr-div margin-right-40"> |
| 14 | <select id="hourscount-projectName" class="selectpicker" data-width="100%" data-size="5" data-live-search="true"> | 14 | <select id="hourscount-projectName" class="selectpicker" data-width="100%" data-size="5" data-live-search="true"> |
| 15 | - <option value="1">企业云</option> | ||
| 16 | - <option value="2">任你停</option> | ||
| 17 | - <option value="3">政府云</option> | 15 | + <!--<option value="1">企业云</option>--> |
| 16 | + <!--<option value="2">任你停</option>--> | ||
| 17 | + <!--<option value="3">政府云</option>--> | ||
| 18 | </select> | 18 | </select> |
| 19 | </div> | 19 | </div> |
| 20 | <div class="hourscount-searchbtn pos-abs cursor-pointer" id="queryBtn"></div> | 20 | <div class="hourscount-searchbtn pos-abs cursor-pointer" id="queryBtn"></div> |
| @@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
| 23 | 23 | ||
| 24 | <!--------------------------------------------内容--> | 24 | <!--------------------------------------------内容--> |
| 25 | <ul class="workquery-list-wrap" id="workquery-list-wrap"> | 25 | <ul class="workquery-list-wrap" id="workquery-list-wrap"> |
| 26 | - <li> | 26 | + <!--<li> |
| 27 | <ul class="workquery-list-title clearfix boxshadow"> | 27 | <ul class="workquery-list-title clearfix boxshadow"> |
| 28 | <li>项目1</li> | 28 | <li>项目1</li> |
| 29 | <li class="commited-icon">填报人员 <span>10</span> 人</li> | 29 | <li class="commited-icon">填报人员 <span>10</span> 人</li> |
| @@ -71,7 +71,7 @@ | @@ -71,7 +71,7 @@ | ||
| 71 | <li class="commited-icon">填报人员 <span>10</span> 人</li> | 71 | <li class="commited-icon">填报人员 <span>10</span> 人</li> |
| 72 | <li class="time-text">工时 : <span>10</span> 人</li> | 72 | <li class="time-text">工时 : <span>10</span> 人</li> |
| 73 | </ul> | 73 | </ul> |
| 74 | - </li> | 74 | + </li>--> |
| 75 | 75 | ||
| 76 | </ul> | 76 | </ul> |
| 77 | 77 |
topages/hourscount/hourscount.js
| @@ -5,6 +5,9 @@ var fun= { | @@ -5,6 +5,9 @@ var fun= { | ||
| 5 | init: function () { | 5 | init: function () { |
| 6 | $('#hourscount-projectName').selectpicker('render'); | 6 | $('#hourscount-projectName').selectpicker('render'); |
| 7 | fun.dateInit(); | 7 | fun.dateInit(); |
| 8 | + fun.queryBtn(); | ||
| 9 | + // | ||
| 10 | + fun.queryAsraDailyAllForList(); | ||
| 8 | }, | 11 | }, |
| 9 | dateInit: function () { | 12 | dateInit: function () { |
| 10 | //时间初始化 | 13 | //时间初始化 |
| @@ -43,6 +46,77 @@ var fun= { | @@ -43,6 +46,77 @@ var fun= { | ||
| 43 | }).on("click", function () { | 46 | }).on("click", function () { |
| 44 | $("#hourscount-daterange-btnend").datetimepicker("setStartDate", $("#hourscount-daterange-btnsta").val()) | 47 | $("#hourscount-daterange-btnend").datetimepicker("setStartDate", $("#hourscount-daterange-btnsta").val()) |
| 45 | }); | 48 | }); |
| 49 | + //项目查询 | ||
| 50 | + fn.getAsraProject("",function(data){ | ||
| 51 | + var html=""; | ||
| 52 | + $.each(data,function(index,row){ | ||
| 53 | + html+='<option value="'+row.id+'">'+row.projecName+'</option>'; | ||
| 54 | + }); | ||
| 55 | + if(html != null && html != ""){ | ||
| 56 | + $("#hourscount-projectName").empty(); | ||
| 57 | + $("#hourscount-projectName").append(html); | ||
| 58 | + $("#hourscount-projectName").selectpicker('refresh'); | ||
| 59 | + | ||
| 60 | + } | ||
| 61 | + }); | ||
| 62 | + }, | ||
| 63 | + //工时统计查询 | ||
| 64 | + queryAsraDailyAllForList:function(){ | ||
| 65 | + debugger; | ||
| 66 | + var noDataShow = '<div class="nodata-icon" ></div>'; | ||
| 67 | + var req = fun.getParams(); | ||
| 68 | + var opt = { | ||
| 69 | + data: JSON.stringify(req), | ||
| 70 | + method: "POST", | ||
| 71 | + async: false, | ||
| 72 | + url: dataUrl.util.queryAsraDailyAllForList(), | ||
| 73 | + success: function (res) { | ||
| 74 | + if(res != null && res.code =='8888' ){ | ||
| 75 | + var data = res.data.list; | ||
| 76 | + if(data == null || data.length == 0 ){ | ||
| 77 | + $('#workquery-list-wrap').empty(); | ||
| 78 | + $('#workquery-list-wrap').append(noDataShow); | ||
| 79 | + }else{ | ||
| 80 | + var html = '<li>'; | ||
| 81 | + $.each(data,function(index,rows){ | ||
| 82 | + html+=' <ul class="workquery-list-title clearfix boxshadow">'; | ||
| 83 | + html+='<li>'+rows.projectName+'</li>'; | ||
| 84 | + html+='<li class="commited-icon">填报人员 <span>'+rows.commitPersonNum+'</span> 人</li>'; | ||
| 85 | + html+='<li class="time-text">工时 : <span>'+rows.commitPersonNum*8+'</span> 时</li>'; | ||
| 86 | + html+='</ul>'; | ||
| 87 | + }); | ||
| 88 | + html+='</li>'; | ||
| 89 | + $('#workquery-list-wrap').empty(); | ||
| 90 | + $('#workquery-list-wrap').append(html); | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + }else{ | ||
| 94 | + $('#workquery-list-wrap').empty(); | ||
| 95 | + $('#workquery-list-wrap').append(noDataShow); | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + } | ||
| 99 | + } | ||
| 100 | + sysAjax(opt); | ||
| 101 | + }, | ||
| 102 | + //查询announce | ||
| 103 | + queryBtn:function(){ | ||
| 104 | + $(document).on('click','#queryBtn',function(){ | ||
| 105 | + fun.queryAsraDailyAllForList(); | ||
| 106 | + }); | ||
| 107 | + }, | ||
| 108 | + //获取参数 | ||
| 109 | + getParams:function() { | ||
| 110 | + var req = {}; | ||
| 111 | + var beginTime = $('#hourscount-daterange-btnsta').val(); //开始时间 | ||
| 112 | + var endTime = $('#hourscount-daterange-btnend').val(); //结束时间 | ||
| 113 | + var projectId = $('#hourscount-projectName').val();//项目id | ||
| 114 | + req.beginTime = beginTime; | ||
| 115 | + req.endTime = endTime; | ||
| 116 | + req.projectId = projectId; | ||
| 117 | + return req; | ||
| 118 | + | ||
| 119 | + | ||
| 46 | }, | 120 | }, |
| 47 | } | 121 | } |
| 48 | fun.init(); | 122 | fun.init(); |
| 49 | \ No newline at end of file | 123 | \ No newline at end of file |
topages/workfill/workfill.js
| @@ -154,7 +154,7 @@ var fun = { | @@ -154,7 +154,7 @@ var fun = { | ||
| 154 | }); | 154 | }); |
| 155 | }, | 155 | }, |
| 156 | //工时信息提交 | 156 | //工时信息提交 |
| 157 | - dailyReportCommit:function (id) { | 157 | + dailyReportCommit:function (id,_this) { |
| 158 | console.log(id); | 158 | console.log(id); |
| 159 | var arsaId = $("#weekday"+id).attr("data-id"); | 159 | var arsaId = $("#weekday"+id).attr("data-id"); |
| 160 | var projectId = $("#work-projectName"+id).find("option:selected").val(); | 160 | var projectId = $("#work-projectName"+id).find("option:selected").val(); |
| @@ -177,17 +177,20 @@ var fun = { | @@ -177,17 +177,20 @@ var fun = { | ||
| 177 | dataType:'json', | 177 | dataType:'json', |
| 178 | success: function(res){ | 178 | success: function(res){ |
| 179 | if(res.success == true){ | 179 | if(res.success == true){ |
| 180 | - // console.log("aaa"); | 180 | + _this.text('编辑'); |
| 181 | + _this.parent().parent().find(".workfill-list-container").attr("contenteditable","false"); | ||
| 182 | + _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').toggleClass('display-none'); | ||
| 183 | + var projectName=_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text(); | ||
| 184 | + _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').toggleClass('display-none'); | ||
| 185 | + _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); | ||
| 186 | + | ||
| 181 | }else{ | 187 | }else{ |
| 182 | - $("#areamanage_areaaddmodel-errormsg").text("保存失败,请新重试保存!"); | ||
| 183 | - $("#areamanage_areaaddmodel-errormsg").show(); | 188 | + alert("失败"); |
| 184 | return false; | 189 | return false; |
| 185 | - | ||
| 186 | } | 190 | } |
| 187 | } | 191 | } |
| 188 | }; | 192 | }; |
| 189 | sysAjax(editAreaBlok); | 193 | sysAjax(editAreaBlok); |
| 190 | - | ||
| 191 | } | 194 | } |
| 192 | }; | 195 | }; |
| 193 | fun.init(); | 196 | fun.init(); |
| @@ -208,17 +211,17 @@ $(document).on('click','.workfill-list-btn',function () { | @@ -208,17 +211,17 @@ $(document).on('click','.workfill-list-btn',function () { | ||
| 208 | if(_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')){ | 211 | if(_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')){ |
| 209 | _this.text('提交'); | 212 | _this.text('提交'); |
| 210 | _this.parent().parent().find(".workfill-list-container").attr("contenteditable","true"); | 213 | _this.parent().parent().find(".workfill-list-container").attr("contenteditable","true"); |
| 214 | + _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').toggleClass('display-none'); | ||
| 215 | + var projectName=_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text(); | ||
| 216 | + _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').toggleClass('display-none'); | ||
| 217 | + _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); | ||
| 218 | + | ||
| 211 | }else { | 219 | }else { |
| 212 | var commitId = _this.attr("id"); | 220 | var commitId = _this.attr("id"); |
| 213 | var id = commitId.substring(10,11); | 221 | var id = commitId.substring(10,11); |
| 214 | - fun.dailyReportCommit(id); | ||
| 215 | - _this.text('编辑'); | ||
| 216 | - _this.parent().parent().find(".workfill-list-container").attr("contenteditable","false"); | 222 | + fun.dailyReportCommit(id,_this); |
| 223 | + | ||
| 217 | } | 224 | } |
| 218 | - _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').toggleClass('display-none'); | ||
| 219 | - var projectName=_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text(); | ||
| 220 | - _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').toggleClass('display-none'); | ||
| 221 | - _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); | ||
| 222 | 225 | ||
| 223 | 226 | ||
| 224 | }); | 227 | }); |
topages/workquery/workquery.js
| @@ -141,9 +141,9 @@ var fun={ | @@ -141,9 +141,9 @@ var fun={ | ||
| 141 | }, | 141 | }, |
| 142 | //查询announce | 142 | //查询announce |
| 143 | queryBtn:function(){ | 143 | queryBtn:function(){ |
| 144 | - $(document).on('click','#queryBtn',function(){ | ||
| 145 | - fun.queryAsraDailyAllForList(); | ||
| 146 | - }); | 144 | + $(document).on('click','#queryBtn',function(){ |
| 145 | + fun.queryAsraDailyAllForList(); | ||
| 146 | + }); | ||
| 147 | }, | 147 | }, |
| 148 | //获取参数 | 148 | //获取参数 |
| 149 | getParams:function() { | 149 | getParams:function() { |