diff --git a/topages/hourscount/hourscount.html b/topages/hourscount/hourscount.html index 6fa3fd2..11ed49c 100644 --- a/topages/hourscount/hourscount.html +++ b/topages/hourscount/hourscount.html @@ -12,9 +12,9 @@
选择项目
@@ -23,7 +23,7 @@ diff --git a/topages/hourscount/hourscount.js b/topages/hourscount/hourscount.js index 05966dd..c6eb6e7 100644 --- a/topages/hourscount/hourscount.js +++ b/topages/hourscount/hourscount.js @@ -5,6 +5,9 @@ var fun= { init: function () { $('#hourscount-projectName').selectpicker('render'); fun.dateInit(); + fun.queryBtn(); + // + fun.queryAsraDailyAllForList(); }, dateInit: function () { //时间初始化 @@ -43,6 +46,77 @@ var fun= { }).on("click", function () { $("#hourscount-daterange-btnend").datetimepicker("setStartDate", $("#hourscount-daterange-btnsta").val()) }); + //项目查询 + fn.getAsraProject("",function(data){ + var html=""; + $.each(data,function(index,row){ + html+=''; + }); + if(html != null && html != ""){ + $("#hourscount-projectName").empty(); + $("#hourscount-projectName").append(html); + $("#hourscount-projectName").selectpicker('refresh'); + + } + }); + }, + //工时统计查询 + queryAsraDailyAllForList:function(){ + debugger; + var noDataShow = '
'; + var req = fun.getParams(); + var opt = { + data: JSON.stringify(req), + method: "POST", + async: false, + url: dataUrl.util.queryAsraDailyAllForList(), + success: function (res) { + if(res != null && res.code =='8888' ){ + var data = res.data.list; + if(data == null || data.length == 0 ){ + $('#workquery-list-wrap').empty(); + $('#workquery-list-wrap').append(noDataShow); + }else{ + var html = '
  • '; + $.each(data,function(index,rows){ + html+=' '; + }); + html+='
  • '; + $('#workquery-list-wrap').empty(); + $('#workquery-list-wrap').append(html); + } + + }else{ + $('#workquery-list-wrap').empty(); + $('#workquery-list-wrap').append(noDataShow); + } + + } + } + sysAjax(opt); + }, + //查询announce + queryBtn:function(){ + $(document).on('click','#queryBtn',function(){ + fun.queryAsraDailyAllForList(); + }); + }, + //获取参数 + getParams:function() { + var req = {}; + var beginTime = $('#hourscount-daterange-btnsta').val(); //开始时间 + var endTime = $('#hourscount-daterange-btnend').val(); //结束时间 + var projectId = $('#hourscount-projectName').val();//项目id + req.beginTime = beginTime; + req.endTime = endTime; + req.projectId = projectId; + return req; + + }, } fun.init(); \ No newline at end of file diff --git a/topages/staffmanage/staffmanage.js b/topages/staffmanage/staffmanage.js index 46fe020..05b67eb 100644 --- a/topages/staffmanage/staffmanage.js +++ b/topages/staffmanage/staffmanage.js @@ -7,6 +7,7 @@ var fun = { debugger; console.log(1) fun.createTableData(); + fun.queryBtn(); }, //生成表格数据 createTableData: function () { @@ -25,20 +26,33 @@ var fun = { // uniqueId:'id', columns: [ { - field: 'id', - title: '类型', + field: 'loginCode', + title: '账号', width: '15%', align: "left", formatter: fun.formattfer }, { field: 'opName', - title: '状态', + title: '员工名称', + width: '15%', + align: "left", + formatter: fun.formattfer + }, + { + field: 'roleId', + title: '员工名称', + width: '15%', + align: "left", + formatter: fun.roleNameFormattfer + }, + { + field: 'cityName', + title: '城市', width: '15%', align: "left", formatter: fun.formattfer } - ] }); @@ -51,10 +65,22 @@ var fun = { return value; } }, + roleNameFormattfer: function (value, row, index) { + if (value == null) { + return "-"; + + } else { + if(value == 1){ + return "领导"; + }else if (value == 2){ + return "员工"; + } + } + }, /*获取查询参数*/ getQueryParam: function () { /**员工名字*/ - var opName = ""; + var opName = $("#perName").val(); var req = { opName: opName @@ -62,6 +88,11 @@ var fun = { return req; }, + queryBtn:function () { + $("#queryBtn").on('click',function () { + fun.createTableData(); + }) + } }; diff --git a/topages/workfill/workfill.js b/topages/workfill/workfill.js index 4f40047..36725cc 100644 --- a/topages/workfill/workfill.js +++ b/topages/workfill/workfill.js @@ -123,8 +123,12 @@ var fun = { //日期回填 var date = moment().subtract('days', weekOfday-i).format('YYYY-MM-DD 01:00:00'); $("#weekday"+i).attr("data-date",date); + if(weekOfday-i < 0){ + $("#btn-commit"+i).attr("style","display:none;"); + }else { + $("#btn-commit"+i).attr("style","display:block;"); + } //展示变更 - $("#btn-commit"+i).attr("style","display:block;"); $("#btn-commit"+i).parent().parent().find(".workfill-list-container").attr("contenteditable","true"); if($("#btn-commit"+i).parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')) { $("#btn-commit"+i).parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').removeClass('display-none'); @@ -150,13 +154,14 @@ var fun = { }); }, //工时信息提交 - dailyReportCommit:function (id) { + dailyReportCommit:function (id,_this) { console.log(id); var arsaId = $("#weekday"+id).attr("data-id"); var projectId = $("#work-projectName"+id).find("option:selected").val(); var dailyDate = $("#weekday"+id).attr("data-date"); var dailyContent = $("#daily-report"+id).text(); + var req= { id:arsaId, projectId:projectId, @@ -172,17 +177,20 @@ var fun = { dataType:'json', success: function(res){ if(res.success == true){ - console.log(aaa); + _this.text('编辑'); + _this.parent().parent().find(".workfill-list-container").attr("contenteditable","false"); + _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(); + _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').toggleClass('display-none'); + _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); + }else{ - $("#areamanage_areaaddmodel-errormsg").text("新增失败,请新重试保存!"); - $("#areamanage_areaaddmodel-errormsg").show(); + alert("失败"); return false; - } } }; sysAjax(editAreaBlok); - } }; fun.init(); @@ -203,17 +211,17 @@ $(document).on('click','.workfill-list-btn',function () { if(_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')){ _this.text('提交'); _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(); + _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').toggleClass('display-none'); + _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); + }else { var commitId = _this.attr("id"); var id = commitId.substring(10,11); - fun.dailyReportCommit(id); - _this.text('编辑'); - _this.parent().parent().find(".workfill-list-container").attr("contenteditable","false"); + fun.dailyReportCommit(id,_this); + } - _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(); - _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').toggleClass('display-none'); - _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); }); diff --git a/topages/workquery/workquery.js b/topages/workquery/workquery.js index 47ed009..8b76b76 100644 --- a/topages/workquery/workquery.js +++ b/topages/workquery/workquery.js @@ -148,9 +148,9 @@ var fun={ }, //查询announce queryBtn:function(){ - $(document).on('click','#queryBtn',function(){ - fun.queryAsraDailyAllForList(); - }); + $(document).on('click','#queryBtn',function(){ + fun.queryAsraDailyAllForList(); + }); }, //获取参数 getParams:function() {