Commit d3b1cd66239744cf2e46a24e2adac914e12b70d3

Authored by 王富生
2 parents 4624f12a 31fcb9f5

Merge branch 'test' of http://192.168.1.195:9998/web_developers/workreport into test

topages/hourscount/hourscount.html
... ... @@ -12,9 +12,9 @@
12 12 <div class="timeopr-text float-left">选择项目</div>
13 13 <div class="float-left hourscount-timeopr-div margin-right-40">
14 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 18 </select>
19 19 </div>
20 20 <div class="hourscount-searchbtn pos-abs cursor-pointer" id="queryBtn"></div>
... ... @@ -23,7 +23,7 @@
23 23  
24 24 <!--------------------------------------------内容-->
25 25 <ul class="workquery-list-wrap" id="workquery-list-wrap">
26   - <li>
  26 + <!--<li>
27 27 <ul class="workquery-list-title clearfix boxshadow">
28 28 <li>项目1</li>
29 29 <li class="commited-icon">填报人员&nbsp;&nbsp;<span>10</span>&nbsp;&nbsp;人</li>
... ... @@ -71,7 +71,7 @@
71 71 <li class="commited-icon">填报人员&nbsp;&nbsp;<span>10</span>&nbsp;&nbsp;人</li>
72 72 <li class="time-text">工时 : &nbsp;&nbsp;<span>10</span>&nbsp;&nbsp;人</li>
73 73 </ul>
74   - </li>
  74 + </li>-->
75 75  
76 76 </ul>
77 77  
... ...
topages/hourscount/hourscount.js
... ... @@ -5,6 +5,9 @@ var fun= {
5 5 init: function () {
6 6 $('#hourscount-projectName').selectpicker('render');
7 7 fun.dateInit();
  8 + fun.queryBtn();
  9 + //
  10 + fun.queryAsraDailyAllForList();
8 11 },
9 12 dateInit: function () {
10 13 //时间初始化
... ... @@ -43,6 +46,77 @@ var fun= {
43 46 }).on("click", function () {
44 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">填报人员&nbsp;&nbsp;<span>'+rows.commitPersonNum+'</span>&nbsp;&nbsp;人</li>';
  85 + html+='<li class="time-text">工时 : &nbsp;&nbsp;<span>'+rows.commitPersonNum*8+'</span>&nbsp;&nbsp;时</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 122 fun.init();
49 123 \ No newline at end of file
... ...
topages/staffmanage/staffmanage.js
... ... @@ -7,6 +7,7 @@ var fun = {
7 7 debugger;
8 8 console.log(1)
9 9 fun.createTableData();
  10 + fun.queryBtn();
10 11 },
11 12 //生成表格数据
12 13 createTableData: function () {
... ... @@ -25,20 +26,33 @@ var fun = {
25 26 // uniqueId:'id',
26 27 columns: [
27 28 {
28   - field: 'id',
29   - title: '<span class="type-icon"></span>类型',
  29 + field: 'loginCode',
  30 + title: '<span class="type-icon"></span>账号',
30 31 width: '15%',
31 32 align: "left",
32 33 formatter: fun.formattfer
33 34 },
34 35 {
35 36 field: 'opName',
36   - title: '<span class="state-icon"></span>状态',
  37 + title: '<span class="state-icon"></span>员工名称',
  38 + width: '15%',
  39 + align: "left",
  40 + formatter: fun.formattfer
  41 + },
  42 + {
  43 + field: 'roleId',
  44 + title: '<span class="state-icon"></span>员工名称',
  45 + width: '15%',
  46 + align: "left",
  47 + formatter: fun.roleNameFormattfer
  48 + },
  49 + {
  50 + field: 'cityName',
  51 + title: '<span class="type-icon"></span>城市',
37 52 width: '15%',
38 53 align: "left",
39 54 formatter: fun.formattfer
40 55 }
41   -
42 56 ]
43 57 });
44 58  
... ... @@ -51,10 +65,22 @@ var fun = {
51 65 return value;
52 66 }
53 67 },
  68 + roleNameFormattfer: function (value, row, index) {
  69 + if (value == null) {
  70 + return "-";
  71 +
  72 + } else {
  73 + if(value == 1){
  74 + return "领导";
  75 + }else if (value == 2){
  76 + return "员工";
  77 + }
  78 + }
  79 + },
54 80 /*获取查询参数*/
55 81 getQueryParam: function () {
56 82 /**员工名字*/
57   - var opName = "";
  83 + var opName = $("#perName").val();
58 84  
59 85 var req = {
60 86 opName: opName
... ... @@ -62,6 +88,11 @@ var fun = {
62 88  
63 89 return req;
64 90 },
  91 + queryBtn:function () {
  92 + $("#queryBtn").on('click',function () {
  93 + fun.createTableData();
  94 + })
  95 + }
65 96  
66 97 };
67 98  
... ...
topages/workfill/workfill.js
... ... @@ -123,8 +123,12 @@ var fun = {
123 123 //日期回填
124 124 var date = moment().subtract('days', weekOfday-i).format('YYYY-MM-DD 01:00:00');
125 125 $("#weekday"+i).attr("data-date",date);
  126 + if(weekOfday-i < 0){
  127 + $("#btn-commit"+i).attr("style","display:none;");
  128 + }else {
  129 + $("#btn-commit"+i).attr("style","display:block;");
  130 + }
126 131 //展示变更
127   - $("#btn-commit"+i).attr("style","display:block;");
128 132 $("#btn-commit"+i).parent().parent().find(".workfill-list-container").attr("contenteditable","true");
129 133 if($("#btn-commit"+i).parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')) {
130 134 $("#btn-commit"+i).parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').removeClass('display-none');
... ... @@ -150,13 +154,14 @@ var fun = {
150 154 });
151 155 },
152 156 //工时信息提交
153   - dailyReportCommit:function (id) {
  157 + dailyReportCommit:function (id,_this) {
154 158 console.log(id);
155 159 var arsaId = $("#weekday"+id).attr("data-id");
156 160 var projectId = $("#work-projectName"+id).find("option:selected").val();
157 161 var dailyDate = $("#weekday"+id).attr("data-date");
158 162 var dailyContent = $("#daily-report"+id).text();
159 163  
  164 +
160 165 var req= {
161 166 id:arsaId,
162 167 projectId:projectId,
... ... @@ -172,17 +177,20 @@ var fun = {
172 177 dataType:'json',
173 178 success: function(res){
174 179 if(res.success == true){
175   - 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 +
176 187 }else{
177   - $("#areamanage_areaaddmodel-errormsg").text("新增失败,请新重试保存!");
178   - $("#areamanage_areaaddmodel-errormsg").show();
  188 + alert("失败");
179 189 return false;
180   -
181 190 }
182 191 }
183 192 };
184 193 sysAjax(editAreaBlok);
185   -
186 194 }
187 195 };
188 196 fun.init();
... ... @@ -203,17 +211,17 @@ $(document).on(&#39;click&#39;,&#39;.workfill-list-btn&#39;,function () {
203 211 if(_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')){
204 212 _this.text('提交');
205 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 +
206 219 }else {
207 220 var commitId = _this.attr("id");
208 221 var id = commitId.substring(10,11);
209   - fun.dailyReportCommit(id);
210   - _this.text('编辑');
211   - _this.parent().parent().find(".workfill-list-container").attr("contenteditable","false");
  222 + fun.dailyReportCommit(id,_this);
  223 +
212 224 }
213   - _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').toggleClass('display-none');
214   - var projectName=_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text();
215   - _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').toggleClass('display-none');
216   - _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName);
217 225  
218 226  
219 227 });
... ...
topages/workquery/workquery.js
... ... @@ -148,9 +148,9 @@ var fun={
148 148 },
149 149 //查询announce
150 150 queryBtn:function(){
151   - $(document).on('click','#queryBtn',function(){
152   - fun.queryAsraDailyAllForList();
153   - });
  151 + $(document).on('click','#queryBtn',function(){
  152 + fun.queryAsraDailyAllForList();
  153 + });
154 154 },
155 155 //获取参数
156 156 getParams:function() {
... ...