Commit c3e72356b6e9c291c8e9078de7bcec4695cd15da
1 parent
4b130959
工时填报
Showing
3 changed files
with
55 additions
and
9 deletions
resource/js/unit.js
@@ -44,10 +44,14 @@ dataUrl.util = { | @@ -44,10 +44,14 @@ dataUrl.util = { | ||
44 | queryAsraOpPage: function () { | 44 | queryAsraOpPage: function () { |
45 | return parkcloudbaseUrl + 'asraOp/queryAsraOpPage'; | 45 | return parkcloudbaseUrl + 'asraOp/queryAsraOpPage'; |
46 | }, | 46 | }, |
47 | - //日报系统-工时填报 | 47 | + //日报系统-工时填报查询 |
48 | queryAsraDailyList: function () { | 48 | queryAsraDailyList: function () { |
49 | return parkcloudbaseUrl + 'asraDaily/queryAsraDailyList'; | 49 | return parkcloudbaseUrl + 'asraDaily/queryAsraDailyList'; |
50 | }, | 50 | }, |
51 | + //日报系统-工时填报 | ||
52 | + saveOrUpdateAsraDaily: function () { | ||
53 | + return parkcloudbaseUrl + 'asraDaily/saveOrUpdateAsraDaily'; | ||
54 | + }, | ||
51 | //查询项目列表 | 55 | //查询项目列表 |
52 | queryAsraProjectForList:function(){ | 56 | queryAsraProjectForList:function(){ |
53 | return parkcloudbaseUrl + 'asraProject/queryAsraProjectForList'; | 57 | return parkcloudbaseUrl + 'asraProject/queryAsraProjectForList'; |
topages/workfill/workfill.html
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | <ul class="workfill-list-wrap clearfix"> | 12 | <ul class="workfill-list-wrap clearfix"> |
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">周一</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 | <span class="float-right workfill-list-btn cursor-pointer" id="btn-commit1">提交</span> |
17 | </div> | 17 | </div> |
18 | <div class="workfill-list-projectnamewrap"> | 18 | <div class="workfill-list-projectnamewrap"> |
@@ -30,7 +30,7 @@ | @@ -30,7 +30,7 @@ | ||
30 | 30 | ||
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">周二</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 | <span class="float-right workfill-list-btn cursor-pointer" id="btn-commit2">提交</span> |
35 | </div> | 35 | </div> |
36 | <div class="workfill-list-projectnamewrap"> | 36 | <div class="workfill-list-projectnamewrap"> |
@@ -47,7 +47,7 @@ | @@ -47,7 +47,7 @@ | ||
47 | </li> | 47 | </li> |
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">周三</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 | <span class="float-right workfill-list-btn cursor-pointer" id="btn-commit3">提交</span> |
52 | </div> | 52 | </div> |
53 | <div class="workfill-list-projectnamewrap"> | 53 | <div class="workfill-list-projectnamewrap"> |
@@ -64,7 +64,7 @@ | @@ -64,7 +64,7 @@ | ||
64 | </li> | 64 | </li> |
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">周四</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 | <span class="float-right workfill-list-btn cursor-pointer" id="btn-commit4">提交</span> |
69 | </div> | 69 | </div> |
70 | <div class="workfill-list-projectnamewrap"> | 70 | <div class="workfill-list-projectnamewrap"> |
@@ -81,7 +81,7 @@ | @@ -81,7 +81,7 @@ | ||
81 | </li> | 81 | </li> |
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">周五</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 | <span class="float-right workfill-list-btn cursor-pointer" id="btn-commit5">提交</span> |
86 | </div> | 86 | </div> |
87 | <div class="workfill-list-projectnamewrap"> | 87 | <div class="workfill-list-projectnamewrap"> |
@@ -98,7 +98,7 @@ | @@ -98,7 +98,7 @@ | ||
98 | </li> | 98 | </li> |
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">周六</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 | <span class="float-right workfill-list-btn cursor-pointer" id="btn-commit6">提交</span> |
103 | </div> | 103 | </div> |
104 | <div class="workfill-list-projectnamewrap"> | 104 | <div class="workfill-list-projectnamewrap"> |
@@ -115,7 +115,7 @@ | @@ -115,7 +115,7 @@ | ||
115 | </li> | 115 | </li> |
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">周日</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 | <span class="float-right workfill-list-btn cursor-pointer" id="btn-commit7">提交</span> |
120 | </div> | 120 | </div> |
121 | <div class="workfill-list-projectnamewrap"> | 121 | <div class="workfill-list-projectnamewrap"> |
topages/workfill/workfill.js
@@ -120,6 +120,10 @@ var fun = { | @@ -120,6 +120,10 @@ var fun = { | ||
120 | $("#btn-commit"+i).parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); | 120 | $("#btn-commit"+i).parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); |
121 | 121 | ||
122 | }else if(clicknum == 0){ | 122 | }else if(clicknum == 0){ |
123 | + //日期回填 | ||
124 | + var date = moment().subtract('days', weekOfday-i).format('YYYY-MM-DD 01:00:00'); | ||
125 | + $("#weekday"+i).attr("data-date",date); | ||
126 | + //展示变更 | ||
123 | $("#btn-commit"+i).attr("style","display:block;"); | 127 | $("#btn-commit"+i).attr("style","display:block;"); |
124 | $("#btn-commit"+i).parent().parent().find(".workfill-list-container").attr("contenteditable","true"); | 128 | $("#btn-commit"+i).parent().parent().find(".workfill-list-container").attr("contenteditable","true"); |
125 | if($("#btn-commit"+i).parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')) { | 129 | if($("#btn-commit"+i).parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')) { |
@@ -128,10 +132,10 @@ var fun = { | @@ -128,10 +132,10 @@ var fun = { | ||
128 | $("#btn-commit"+i).parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').addClass('display-none'); | 132 | $("#btn-commit"+i).parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').addClass('display-none'); |
129 | $("#btn-commit"+i).parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); | 133 | $("#btn-commit"+i).parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); |
130 | } | 134 | } |
131 | - | ||
132 | } | 135 | } |
133 | } | 136 | } |
134 | $.each(data,function(index,row){ | 137 | $.each(data,function(index,row){ |
138 | + $("#weekday"+row.weeksNum).attr("data-id",row.id); | ||
135 | $("#daily-report"+row.weeksNum).html(row.dailyContent); | 139 | $("#daily-report"+row.weeksNum).html(row.dailyContent); |
136 | $("#work-projectName"+row.weeksNum).selectpicker('val',row.projectId); | 140 | $("#work-projectName"+row.weeksNum).selectpicker('val',row.projectId); |
137 | $("#work-projectName"+row.weeksNum).selectpicker('refresh'); | 141 | $("#work-projectName"+row.weeksNum).selectpicker('refresh'); |
@@ -145,6 +149,41 @@ var fun = { | @@ -145,6 +149,41 @@ var fun = { | ||
145 | }); | 149 | }); |
146 | }); | 150 | }); |
147 | }, | 151 | }, |
152 | + //工时信息提交 | ||
153 | + dailyReportCommit:function (id) { | ||
154 | + console.log(id); | ||
155 | + var arsaId = $("#weekday"+id).attr("data-id"); | ||
156 | + var projectId = $("#work-projectName"+id).find("option:selected").val(); | ||
157 | + var dailyDate = $("#weekday"+id).attr("data-date"); | ||
158 | + var dailyContent = $("#daily-report"+id).text(); | ||
159 | + | ||
160 | + var req= { | ||
161 | + id:arsaId, | ||
162 | + projectId:projectId, | ||
163 | + dailyDate:dailyDate, | ||
164 | + dailyContent:dailyContent, | ||
165 | + sysCode:sysComm.sysCode | ||
166 | + }; | ||
167 | + var editAreaBlok= { | ||
168 | + method: "post", | ||
169 | + url: dataUrl.util.saveOrUpdateAsraDaily(), | ||
170 | + data: JSON.stringify(req), | ||
171 | + contentType: 'application/json; charset=utf-8', | ||
172 | + dataType:'json', | ||
173 | + success: function(res){ | ||
174 | + if(res.success == true){ | ||
175 | + console.log(aaa); | ||
176 | + }else{ | ||
177 | + $("#areamanage_areaaddmodel-errormsg").text("新增失败,请新重试保存!"); | ||
178 | + $("#areamanage_areaaddmodel-errormsg").show(); | ||
179 | + return false; | ||
180 | + | ||
181 | + } | ||
182 | + } | ||
183 | + }; | ||
184 | + sysAjax(editAreaBlok); | ||
185 | + | ||
186 | + } | ||
148 | }; | 187 | }; |
149 | fun.init(); | 188 | fun.init(); |
150 | // 上一周点击time-opr-prevbtn | 189 | // 上一周点击time-opr-prevbtn |
@@ -165,6 +204,9 @@ $(document).on('click','.workfill-list-btn',function () { | @@ -165,6 +204,9 @@ $(document).on('click','.workfill-list-btn',function () { | ||
165 | _this.text('提交'); | 204 | _this.text('提交'); |
166 | _this.parent().parent().find(".workfill-list-container").attr("contenteditable","true"); | 205 | _this.parent().parent().find(".workfill-list-container").attr("contenteditable","true"); |
167 | }else { | 206 | }else { |
207 | + var commitId = _this.attr("id"); | ||
208 | + var id = commitId.substring(10,11); | ||
209 | + fun.dailyReportCommit(id); | ||
168 | _this.text('编辑'); | 210 | _this.text('编辑'); |
169 | _this.parent().parent().find(".workfill-list-container").attr("contenteditable","false"); | 211 | _this.parent().parent().find(".workfill-list-container").attr("contenteditable","false"); |
170 | } | 212 | } |