Commit d4d2901c846a158ff321854f4d31f1d5d7424a18
提交
Showing
8 changed files
with
46 additions
and
21 deletions
login/login.html
| @@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
| 17 | <div class="login-main"> | 17 | <div class="login-main"> |
| 18 | <div class="login-name">中兴智能工时系统</div> | 18 | <div class="login-name">中兴智能工时系统</div> |
| 19 | <div class="login-hint">轻松工作每一天</div> | 19 | <div class="login-hint">轻松工作每一天</div> |
| 20 | - <input type="text" autocomplete=”off” class="login-username" id="login-username" placeholder="邮箱或者账户名"> | 20 | + <input type="text" autocomplete=”off” class="login-username" id="login-username" placeholder="邮箱或者用户名"> |
| 21 | <input type="password" autocomplete=”off” class="login-password" id="login-password" placeholder="密码"> | 21 | <input type="password" autocomplete=”off” class="login-password" id="login-password" placeholder="密码"> |
| 22 | <div class="login-errorifo" id="login-errorifo"></div> | 22 | <div class="login-errorifo" id="login-errorifo"></div> |
| 23 | <div class="login-btn" id="login-btn">登录</div> | 23 | <div class="login-btn" id="login-btn">登录</div> |
resource/js/unit.js
| @@ -566,5 +566,22 @@ var commonClass = { | @@ -566,5 +566,22 @@ var commonClass = { | ||
| 566 | } | 566 | } |
| 567 | } | 567 | } |
| 568 | } | 568 | } |
| 569 | +/** | ||
| 570 | + * jquery 解绑绑定函数.<br/> | ||
| 571 | + * wangfs 2018-01-11.<br/> | ||
| 572 | + */ | ||
| 573 | +var documentBindFunc ={ | ||
| 574 | + /** | ||
| 575 | + * @param event 事件名称如:click | ||
| 576 | + * @param element 元素 如:id,class 元素等 | ||
| 577 | + * @param func 函数 | ||
| 578 | + * 例子:documentBindFunc.on('click','#berthmanage-addBtn',function () {}); | ||
| 579 | + */ | ||
| 580 | + on: function (event, element, func) { | ||
| 581 | + $(document).off(event, element); | ||
| 582 | + $(document).on(event, element, func); | ||
| 583 | + } | ||
| 584 | + | ||
| 585 | +}; | ||
| 569 | 586 | ||
| 570 | $("#loginShowName").text(fn.getUserName()); | 587 | $("#loginShowName").text(fn.getUserName()); |
topages/hourscount/hourscount.js
| @@ -100,7 +100,7 @@ var fun= { | @@ -100,7 +100,7 @@ var fun= { | ||
| 100 | }, | 100 | }, |
| 101 | //查询announce | 101 | //查询announce |
| 102 | queryBtn:function(){ | 102 | queryBtn:function(){ |
| 103 | - $(document).on('click','#queryBtn',function(){ | 103 | + documentBindFunc.on('click','#queryBtn',function(){ |
| 104 | fun.queryAsraDailyAllForList(); | 104 | fun.queryAsraDailyAllForList(); |
| 105 | }); | 105 | }); |
| 106 | }, | 106 | }, |
topages/staffmanage/staffmanage.js
| @@ -88,7 +88,7 @@ var fun = { | @@ -88,7 +88,7 @@ var fun = { | ||
| 88 | return req; | 88 | return req; |
| 89 | }, | 89 | }, |
| 90 | queryBtn:function () { | 90 | queryBtn:function () { |
| 91 | - $("#queryBtn").on('click',function () { | 91 | + documentBindFunc.on('click','#queryBtn',function () { |
| 92 | fun.createTableData(); | 92 | fun.createTableData(); |
| 93 | }) | 93 | }) |
| 94 | } | 94 | } |
topages/workfill/workfill.css
| @@ -61,6 +61,10 @@ | @@ -61,6 +61,10 @@ | ||
| 61 | .workfill-list-btn{ | 61 | .workfill-list-btn{ |
| 62 | padding: 3px 20px; | 62 | padding: 3px 20px; |
| 63 | border-radius: 15px; | 63 | border-radius: 15px; |
| 64 | + border: 0; | ||
| 65 | +} | ||
| 66 | +.workfill-list-btn:focus{ | ||
| 67 | + outline: none; | ||
| 64 | } | 68 | } |
| 65 | .workfill-list-wrap li:nth-of-type(1) .workfill-list-btn{ | 69 | .workfill-list-wrap li:nth-of-type(1) .workfill-list-btn{ |
| 66 | background-color: #fedee5; | 70 | background-color: #fedee5; |
topages/workfill/workfill.html
| @@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
| 13 | <li class="workfill-list-li boxshadow"> | 13 | <li class="workfill-list-li boxshadow"> |
| 14 | <div class="workfill-list-weekday-wrap clearfix"> | 14 | <div class="workfill-list-weekday-wrap clearfix"> |
| 15 | <span class="float-left workfill-list-weekday" id="weekday1" data-id="" data-date="">周一</span> | 15 | <span class="float-left workfill-list-weekday" id="weekday1" data-id="" data-date="">周一</span> |
| 16 | - <span class="float-right workfill-list-btn cursor-pointer" id="btn-commit1">提交</span> | 16 | + <button class="float-right workfill-list-btn cursor-pointer" id="btn-commit1">提交</button> |
| 17 | </div> | 17 | </div> |
| 18 | <div class="workfill-list-projectnamewrap"> | 18 | <div class="workfill-list-projectnamewrap"> |
| 19 | <div class="pos-abs workfill-projectCon"> | 19 | <div class="pos-abs workfill-projectCon"> |
| @@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
| 31 | <li class="workfill-list-li boxshadow"> | 31 | <li class="workfill-list-li boxshadow"> |
| 32 | <div class="workfill-list-weekday-wrap clearfix"> | 32 | <div class="workfill-list-weekday-wrap clearfix"> |
| 33 | <span class="float-left workfill-list-weekday" id="weekday2" data-id="" data-date="">周二</span> | 33 | <span class="float-left workfill-list-weekday" id="weekday2" data-id="" data-date="">周二</span> |
| 34 | - <span class="float-right workfill-list-btn cursor-pointer" id="btn-commit2">提交</span> | 34 | + <button class="float-right workfill-list-btn cursor-pointer" id="btn-commit2">提交</button> |
| 35 | </div> | 35 | </div> |
| 36 | <div class="workfill-list-projectnamewrap"> | 36 | <div class="workfill-list-projectnamewrap"> |
| 37 | <div class="pos-abs workfill-projectCon"> | 37 | <div class="pos-abs workfill-projectCon"> |
| @@ -48,7 +48,7 @@ | @@ -48,7 +48,7 @@ | ||
| 48 | <li class="workfill-list-li boxshadow"> | 48 | <li class="workfill-list-li boxshadow"> |
| 49 | <div class="workfill-list-weekday-wrap clearfix"> | 49 | <div class="workfill-list-weekday-wrap clearfix"> |
| 50 | <span class="float-left workfill-list-weekday" id="weekday3" data-id="" data-date="">周三</span> | 50 | <span class="float-left workfill-list-weekday" id="weekday3" data-id="" data-date="">周三</span> |
| 51 | - <span class="float-right workfill-list-btn cursor-pointer" id="btn-commit3">提交</span> | 51 | + <button class="float-right workfill-list-btn cursor-pointer" id="btn-commit3">提交</button> |
| 52 | </div> | 52 | </div> |
| 53 | <div class="workfill-list-projectnamewrap"> | 53 | <div class="workfill-list-projectnamewrap"> |
| 54 | <div class="pos-abs workfill-projectCon"> | 54 | <div class="pos-abs workfill-projectCon"> |
| @@ -65,7 +65,7 @@ | @@ -65,7 +65,7 @@ | ||
| 65 | <li class="workfill-list-li boxshadow"> | 65 | <li class="workfill-list-li boxshadow"> |
| 66 | <div class="workfill-list-weekday-wrap clearfix"> | 66 | <div class="workfill-list-weekday-wrap clearfix"> |
| 67 | <span class="float-left workfill-list-weekday" id="weekday4" data-id="" data-date="">周四</span> | 67 | <span class="float-left workfill-list-weekday" id="weekday4" data-id="" data-date="">周四</span> |
| 68 | - <span class="float-right workfill-list-btn cursor-pointer" id="btn-commit4">提交</span> | 68 | + <button class="float-right workfill-list-btn cursor-pointer" id="btn-commit4">提交</button> |
| 69 | </div> | 69 | </div> |
| 70 | <div class="workfill-list-projectnamewrap"> | 70 | <div class="workfill-list-projectnamewrap"> |
| 71 | <div class="pos-abs workfill-projectCon"> | 71 | <div class="pos-abs workfill-projectCon"> |
| @@ -82,7 +82,7 @@ | @@ -82,7 +82,7 @@ | ||
| 82 | <li class="workfill-list-li boxshadow"> | 82 | <li class="workfill-list-li boxshadow"> |
| 83 | <div class="workfill-list-weekday-wrap clearfix"> | 83 | <div class="workfill-list-weekday-wrap clearfix"> |
| 84 | <span class="float-left workfill-list-weekday" id="weekday5" data-id="" data-date="">周五</span> | 84 | <span class="float-left workfill-list-weekday" id="weekday5" data-id="" data-date="">周五</span> |
| 85 | - <span class="float-right workfill-list-btn cursor-pointer" id="btn-commit5">提交</span> | 85 | + <button class="float-right workfill-list-btn cursor-pointer" id="btn-commit5">提交</button> |
| 86 | </div> | 86 | </div> |
| 87 | <div class="workfill-list-projectnamewrap"> | 87 | <div class="workfill-list-projectnamewrap"> |
| 88 | <div class="pos-abs workfill-projectCon"> | 88 | <div class="pos-abs workfill-projectCon"> |
| @@ -99,7 +99,7 @@ | @@ -99,7 +99,7 @@ | ||
| 99 | <li class="workfill-list-li boxshadow"> | 99 | <li class="workfill-list-li boxshadow"> |
| 100 | <div class="workfill-list-weekday-wrap clearfix"> | 100 | <div class="workfill-list-weekday-wrap clearfix"> |
| 101 | <span class="float-left workfill-list-weekday" id="weekday6" data-id="" data-date="">周六</span> | 101 | <span class="float-left workfill-list-weekday" id="weekday6" data-id="" data-date="">周六</span> |
| 102 | - <span class="float-right workfill-list-btn cursor-pointer" id="btn-commit6">提交</span> | 102 | + <button class="float-right workfill-list-btn cursor-pointer" id="btn-commit6">提交</button> |
| 103 | </div> | 103 | </div> |
| 104 | <div class="workfill-list-projectnamewrap"> | 104 | <div class="workfill-list-projectnamewrap"> |
| 105 | <div class="pos-abs workfill-projectCon"> | 105 | <div class="pos-abs workfill-projectCon"> |
| @@ -116,7 +116,7 @@ | @@ -116,7 +116,7 @@ | ||
| 116 | <li class="workfill-list-li boxshadow"> | 116 | <li class="workfill-list-li boxshadow"> |
| 117 | <div class="workfill-list-weekday-wrap clearfix"> | 117 | <div class="workfill-list-weekday-wrap clearfix"> |
| 118 | <span class="float-left workfill-list-weekday" id="weekday7" data-id="" data-date="">周日</span> | 118 | <span class="float-left workfill-list-weekday" id="weekday7" data-id="" data-date="">周日</span> |
| 119 | - <span class="float-right workfill-list-btn cursor-pointer" id="btn-commit7">提交</span> | 119 | + <button class="float-right workfill-list-btn cursor-pointer" id="btn-commit7">提交</button> |
| 120 | </div> | 120 | </div> |
| 121 | <div class="workfill-list-projectnamewrap"> | 121 | <div class="workfill-list-projectnamewrap"> |
| 122 | <div class="pos-abs workfill-projectCon"> | 122 | <div class="pos-abs workfill-projectCon"> |
topages/workfill/workfill.js
| @@ -49,7 +49,7 @@ var fun = { | @@ -49,7 +49,7 @@ var fun = { | ||
| 49 | }, | 49 | }, |
| 50 | //退出 | 50 | //退出 |
| 51 | logout:function(){ | 51 | logout:function(){ |
| 52 | - $(document).on('click','#logoutId',function(){ | 52 | + documentBindFunc.on('click','#logoutId',function(){ |
| 53 | fn.loginOut(); | 53 | fn.loginOut(); |
| 54 | }); | 54 | }); |
| 55 | }, | 55 | }, |
| @@ -146,7 +146,7 @@ var fun = { | @@ -146,7 +146,7 @@ var fun = { | ||
| 146 | $("#work-projectName"+row.weeksNum).selectpicker('val',row.projectId); | 146 | $("#work-projectName"+row.weeksNum).selectpicker('val',row.projectId); |
| 147 | $("#work-projectName"+row.weeksNum).selectpicker('refresh'); | 147 | $("#work-projectName"+row.weeksNum).selectpicker('refresh'); |
| 148 | 148 | ||
| 149 | - $("#btn-commit"+row.weeksNum).text('编辑'); | 149 | + $("#btn-commit"+row.weeksNum).html('编辑'); |
| 150 | $("#btn-commit"+row.weeksNum).parent().parent().find(".workfill-list-container").attr("contenteditable","false"); | 150 | $("#btn-commit"+row.weeksNum).parent().parent().find(".workfill-list-container").attr("contenteditable","false"); |
| 151 | $("#btn-commit"+row.weeksNum).parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').addClass('display-none'); | 151 | $("#btn-commit"+row.weeksNum).parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').addClass('display-none'); |
| 152 | var projectName=$("#btn-commit"+row.weeksNum).parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text(); | 152 | var projectName=$("#btn-commit"+row.weeksNum).parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text(); |
| @@ -169,6 +169,7 @@ var fun = { | @@ -169,6 +169,7 @@ var fun = { | ||
| 169 | $('.ITD-alertmodel-contentmsg').text(''); | 169 | $('.ITD-alertmodel-contentmsg').text(''); |
| 170 | $('#ITD-tipsmodel').modal('hide'); | 170 | $('#ITD-tipsmodel').modal('hide'); |
| 171 | },3000); | 171 | },3000); |
| 172 | + _this.removeAttr("disabled"); | ||
| 172 | return false; | 173 | return false; |
| 173 | }else{ | 174 | }else{ |
| 174 | var req= { | 175 | var req= { |
| @@ -188,12 +189,13 @@ var fun = { | @@ -188,12 +189,13 @@ var fun = { | ||
| 188 | if(res.success == true){ | 189 | if(res.success == true){ |
| 189 | var asraId = res.data; | 190 | var asraId = res.data; |
| 190 | $("#weekday"+id).attr("data-id",asraId); | 191 | $("#weekday"+id).attr("data-id",asraId); |
| 191 | - _this.text('编辑'); | 192 | + _this.html('编辑'); |
| 192 | _this.parent().parent().find(".workfill-list-container").attr("contenteditable","false"); | 193 | _this.parent().parent().find(".workfill-list-container").attr("contenteditable","false"); |
| 193 | - _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').toggleClass('display-none'); | 194 | + _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').addClass('display-none'); |
| 194 | var projectName=_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text(); | 195 | var projectName=_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text(); |
| 195 | - _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').toggleClass('display-none'); | 196 | + _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').removeClass('display-none'); |
| 196 | _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); | 197 | _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); |
| 198 | + _this.removeAttr("disabled"); | ||
| 197 | 199 | ||
| 198 | }else{ | 200 | }else{ |
| 199 | $('.ITD-alertmodel-contentmsg').text('提交失败!'); | 201 | $('.ITD-alertmodel-contentmsg').text('提交失败!'); |
| @@ -202,6 +204,7 @@ var fun = { | @@ -202,6 +204,7 @@ var fun = { | ||
| 202 | $('.ITD-alertmodel-contentmsg').text(''); | 204 | $('.ITD-alertmodel-contentmsg').text(''); |
| 203 | $('#ITD-tipsmodel').modal('hide'); | 205 | $('#ITD-tipsmodel').modal('hide'); |
| 204 | },3000); | 206 | },3000); |
| 207 | + _this.removeAttr("disabled"); | ||
| 205 | return false; | 208 | return false; |
| 206 | } | 209 | } |
| 207 | } | 210 | } |
| @@ -215,21 +218,21 @@ var fun = { | @@ -215,21 +218,21 @@ var fun = { | ||
| 215 | }; | 218 | }; |
| 216 | fun.init(); | 219 | fun.init(); |
| 217 | // 上一周点击time-opr-prevbtn | 220 | // 上一周点击time-opr-prevbtn |
| 218 | -$('#time-opr-prevbtn').on('click',function () { | 221 | +documentBindFunc.on('click','#time-opr-prevbtn',function () { |
| 219 | fun.timeoprprevbtn(); | 222 | fun.timeoprprevbtn(); |
| 220 | fun.getAsraDailyListMsg(); | 223 | fun.getAsraDailyListMsg(); |
| 221 | }); | 224 | }); |
| 222 | // 下一周点击time-opr-nextbtn | 225 | // 下一周点击time-opr-nextbtn |
| 223 | -$('#time-opr-nextbtn').on('click',function () { | 226 | +documentBindFunc.on('click','#time-opr-nextbtn',function () { |
| 224 | fun.timeoprnextbtn(); | 227 | fun.timeoprnextbtn(); |
| 225 | fun.getAsraDailyListMsg(); | 228 | fun.getAsraDailyListMsg(); |
| 226 | }); | 229 | }); |
| 227 | 230 | ||
| 228 | //提交事件 | 231 | //提交事件 |
| 229 | -$(document).on('click','.workfill-list-btn',function () { | 232 | +documentBindFunc.on('click','.workfill-list-btn',function () { |
| 230 | var _this=$(this); | 233 | var _this=$(this); |
| 231 | if(_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')){ | 234 | if(_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')){ |
| 232 | - _this.text('提交'); | 235 | + _this.html('提交'); |
| 233 | _this.parent().parent().find(".workfill-list-container").attr("contenteditable","true"); | 236 | _this.parent().parent().find(".workfill-list-container").attr("contenteditable","true"); |
| 234 | _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').toggleClass('display-none'); | 237 | _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').toggleClass('display-none'); |
| 235 | var projectName=_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text(); | 238 | var projectName=_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text(); |
| @@ -237,6 +240,7 @@ $(document).on('click','.workfill-list-btn',function () { | @@ -237,6 +240,7 @@ $(document).on('click','.workfill-list-btn',function () { | ||
| 237 | _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); | 240 | _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); |
| 238 | 241 | ||
| 239 | }else { | 242 | }else { |
| 243 | + _this.attr("disabled","disabled"); | ||
| 240 | var commitId = _this.attr("id"); | 244 | var commitId = _this.attr("id"); |
| 241 | var id = commitId.substring(10,11); | 245 | var id = commitId.substring(10,11); |
| 242 | fun.dailyReportCommit(id,_this); | 246 | fun.dailyReportCommit(id,_this); |
topages/workquery/workquery.js
| @@ -14,7 +14,7 @@ var fun={ | @@ -14,7 +14,7 @@ var fun={ | ||
| 14 | }, | 14 | }, |
| 15 | dateInit:function () { | 15 | dateInit:function () { |
| 16 | //时间初始化 | 16 | //时间初始化 |
| 17 | - $('#workquery-daterange-btnsta').val(moment().subtract('days', 6).format('YYYY-MM-DD')); | 17 | + $('#workquery-daterange-btnsta').val(moment().subtract('days', 0).format('YYYY-MM-DD')); |
| 18 | $('#workquery-daterange-btnend').val(moment().subtract('days', 0).format('YYYY-MM-DD')); | 18 | $('#workquery-daterange-btnend').val(moment().subtract('days', 0).format('YYYY-MM-DD')); |
| 19 | //开始日期 | 19 | //开始日期 |
| 20 | $("#workquery-daterange-btnsta").datetimepicker({ | 20 | $("#workquery-daterange-btnsta").datetimepicker({ |
| @@ -146,7 +146,7 @@ var fun={ | @@ -146,7 +146,7 @@ var fun={ | ||
| 146 | }, | 146 | }, |
| 147 | //查询announce | 147 | //查询announce |
| 148 | queryBtn:function(){ | 148 | queryBtn:function(){ |
| 149 | - $(document).on('click','#queryBtn',function(){ | 149 | + documentBindFunc.on('click','#queryBtn',function(){ |
| 150 | fun.queryAsraDailyAllForList(); | 150 | fun.queryAsraDailyAllForList(); |
| 151 | }); | 151 | }); |
| 152 | }, | 152 | }, |