diff --git a/login/login.html b/login/login.html index 979ced2..1feb8c8 100644 --- a/login/login.html +++ b/login/login.html @@ -17,7 +17,7 @@
中兴智能工时系统
轻松工作每一天
- +
登录
diff --git a/resource/js/unit.js b/resource/js/unit.js index 8ae1ac4..b2e3bf2 100644 --- a/resource/js/unit.js +++ b/resource/js/unit.js @@ -566,5 +566,22 @@ var commonClass = { } } } +/** + * jquery 解绑绑定函数.
+ * wangfs 2018-01-11.
+ */ +var documentBindFunc ={ + /** + * @param event 事件名称如:click + * @param element 元素 如:id,class 元素等 + * @param func 函数 + * 例子:documentBindFunc.on('click','#berthmanage-addBtn',function () {}); + */ + on: function (event, element, func) { + $(document).off(event, element); + $(document).on(event, element, func); + } + +}; $("#loginShowName").text(fn.getUserName()); diff --git a/topages/hourscount/hourscount.js b/topages/hourscount/hourscount.js index 7e60eca..261f6b5 100644 --- a/topages/hourscount/hourscount.js +++ b/topages/hourscount/hourscount.js @@ -100,7 +100,7 @@ var fun= { }, //查询announce queryBtn:function(){ - $(document).on('click','#queryBtn',function(){ + documentBindFunc.on('click','#queryBtn',function(){ fun.queryAsraDailyAllForList(); }); }, diff --git a/topages/staffmanage/staffmanage.js b/topages/staffmanage/staffmanage.js index 7fbe4e8..bdeb359 100644 --- a/topages/staffmanage/staffmanage.js +++ b/topages/staffmanage/staffmanage.js @@ -88,7 +88,7 @@ var fun = { return req; }, queryBtn:function () { - $("#queryBtn").on('click',function () { + documentBindFunc.on('click','#queryBtn',function () { fun.createTableData(); }) } diff --git a/topages/workfill/workfill.css b/topages/workfill/workfill.css index f9a56b2..343533c 100644 --- a/topages/workfill/workfill.css +++ b/topages/workfill/workfill.css @@ -61,6 +61,10 @@ .workfill-list-btn{ padding: 3px 20px; border-radius: 15px; + border: 0; +} +.workfill-list-btn:focus{ + outline: none; } .workfill-list-wrap li:nth-of-type(1) .workfill-list-btn{ background-color: #fedee5; diff --git a/topages/workfill/workfill.html b/topages/workfill/workfill.html index 6107b07..c0c786c 100644 --- a/topages/workfill/workfill.html +++ b/topages/workfill/workfill.html @@ -13,7 +13,7 @@
  • 周一 - 提交 +
    @@ -31,7 +31,7 @@
  • 周二 - 提交 +
    @@ -48,7 +48,7 @@
  • 周三 - 提交 +
    @@ -65,7 +65,7 @@
  • 周四 - 提交 +
    @@ -82,7 +82,7 @@
  • 周五 - 提交 +
    @@ -99,7 +99,7 @@
  • 周六 - 提交 +
    @@ -116,7 +116,7 @@
  • 周日 - 提交 +
    diff --git a/topages/workfill/workfill.js b/topages/workfill/workfill.js index b7264f3..1c7b011 100644 --- a/topages/workfill/workfill.js +++ b/topages/workfill/workfill.js @@ -49,7 +49,7 @@ var fun = { }, //退出 logout:function(){ - $(document).on('click','#logoutId',function(){ + documentBindFunc.on('click','#logoutId',function(){ fn.loginOut(); }); }, @@ -146,7 +146,7 @@ var fun = { $("#work-projectName"+row.weeksNum).selectpicker('val',row.projectId); $("#work-projectName"+row.weeksNum).selectpicker('refresh'); - $("#btn-commit"+row.weeksNum).text('编辑'); + $("#btn-commit"+row.weeksNum).html('编辑'); $("#btn-commit"+row.weeksNum).parent().parent().find(".workfill-list-container").attr("contenteditable","false"); $("#btn-commit"+row.weeksNum).parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').addClass('display-none'); 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 = { $('.ITD-alertmodel-contentmsg').text(''); $('#ITD-tipsmodel').modal('hide'); },3000); + _this.removeAttr("disabled"); return false; }else{ var req= { @@ -188,12 +189,13 @@ var fun = { if(res.success == true){ var asraId = res.data; $("#weekday"+id).attr("data-id",asraId); - _this.text('编辑'); + _this.html('编辑'); _this.parent().parent().find(".workfill-list-container").attr("contenteditable","false"); - _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').toggleClass('display-none'); + _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').addClass('display-none'); var projectName=_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text(); - _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').toggleClass('display-none'); + _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').removeClass('display-none'); _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); + _this.removeAttr("disabled"); }else{ $('.ITD-alertmodel-contentmsg').text('提交失败!'); @@ -202,6 +204,7 @@ var fun = { $('.ITD-alertmodel-contentmsg').text(''); $('#ITD-tipsmodel').modal('hide'); },3000); + _this.removeAttr("disabled"); return false; } } @@ -215,21 +218,21 @@ var fun = { }; fun.init(); // 上一周点击time-opr-prevbtn -$('#time-opr-prevbtn').on('click',function () { +documentBindFunc.on('click','#time-opr-prevbtn',function () { fun.timeoprprevbtn(); fun.getAsraDailyListMsg(); }); // 下一周点击time-opr-nextbtn -$('#time-opr-nextbtn').on('click',function () { +documentBindFunc.on('click','#time-opr-nextbtn',function () { fun.timeoprnextbtn(); fun.getAsraDailyListMsg(); }); //提交事件 -$(document).on('click','.workfill-list-btn',function () { +documentBindFunc.on('click','.workfill-list-btn',function () { var _this=$(this); if(_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')){ - _this.text('提交'); + _this.html('提交'); _this.parent().parent().find(".workfill-list-container").attr("contenteditable","true"); _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').toggleClass('display-none'); 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 () { _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); }else { + _this.attr("disabled","disabled"); var commitId = _this.attr("id"); var id = commitId.substring(10,11); fun.dailyReportCommit(id,_this); diff --git a/topages/workquery/workquery.js b/topages/workquery/workquery.js index b0fda9c..5ff99eb 100644 --- a/topages/workquery/workquery.js +++ b/topages/workquery/workquery.js @@ -14,7 +14,7 @@ var fun={ }, dateInit:function () { //时间初始化 - $('#workquery-daterange-btnsta').val(moment().subtract('days', 6).format('YYYY-MM-DD')); + $('#workquery-daterange-btnsta').val(moment().subtract('days', 0).format('YYYY-MM-DD')); $('#workquery-daterange-btnend').val(moment().subtract('days', 0).format('YYYY-MM-DD')); //开始日期 $("#workquery-daterange-btnsta").datetimepicker({ @@ -146,7 +146,7 @@ var fun={ }, //查询announce queryBtn:function(){ - $(document).on('click','#queryBtn',function(){ + documentBindFunc.on('click','#queryBtn',function(){ fun.queryAsraDailyAllForList(); }); },