Commit 0bc75c537d73e9bdf1027d8f649fb40d20846e94
1 parent
9fd9f139
防止重复提交
Showing
3 changed files
with
18 additions
and
10 deletions
topages/workfill/workfill.css
topages/workfill/workfill.html
... | ... | @@ -13,7 +13,7 @@ |
13 | 13 | <li class="workfill-list-li boxshadow"> |
14 | 14 | <div class="workfill-list-weekday-wrap clearfix"> |
15 | 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 | 17 | </div> |
18 | 18 | <div class="workfill-list-projectnamewrap"> |
19 | 19 | <div class="pos-abs workfill-projectCon"> |
... | ... | @@ -31,7 +31,7 @@ |
31 | 31 | <li class="workfill-list-li boxshadow"> |
32 | 32 | <div class="workfill-list-weekday-wrap clearfix"> |
33 | 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 | 35 | </div> |
36 | 36 | <div class="workfill-list-projectnamewrap"> |
37 | 37 | <div class="pos-abs workfill-projectCon"> |
... | ... | @@ -48,7 +48,7 @@ |
48 | 48 | <li class="workfill-list-li boxshadow"> |
49 | 49 | <div class="workfill-list-weekday-wrap clearfix"> |
50 | 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 | 52 | </div> |
53 | 53 | <div class="workfill-list-projectnamewrap"> |
54 | 54 | <div class="pos-abs workfill-projectCon"> |
... | ... | @@ -65,7 +65,7 @@ |
65 | 65 | <li class="workfill-list-li boxshadow"> |
66 | 66 | <div class="workfill-list-weekday-wrap clearfix"> |
67 | 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 | 69 | </div> |
70 | 70 | <div class="workfill-list-projectnamewrap"> |
71 | 71 | <div class="pos-abs workfill-projectCon"> |
... | ... | @@ -82,7 +82,7 @@ |
82 | 82 | <li class="workfill-list-li boxshadow"> |
83 | 83 | <div class="workfill-list-weekday-wrap clearfix"> |
84 | 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 | 86 | </div> |
87 | 87 | <div class="workfill-list-projectnamewrap"> |
88 | 88 | <div class="pos-abs workfill-projectCon"> |
... | ... | @@ -99,7 +99,7 @@ |
99 | 99 | <li class="workfill-list-li boxshadow"> |
100 | 100 | <div class="workfill-list-weekday-wrap clearfix"> |
101 | 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 | 103 | </div> |
104 | 104 | <div class="workfill-list-projectnamewrap"> |
105 | 105 | <div class="pos-abs workfill-projectCon"> |
... | ... | @@ -116,7 +116,7 @@ |
116 | 116 | <li class="workfill-list-li boxshadow"> |
117 | 117 | <div class="workfill-list-weekday-wrap clearfix"> |
118 | 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 | 120 | </div> |
121 | 121 | <div class="workfill-list-projectnamewrap"> |
122 | 122 | <div class="pos-abs workfill-projectCon"> | ... | ... |
topages/workfill/workfill.js
... | ... | @@ -146,7 +146,7 @@ var fun = { |
146 | 146 | $("#work-projectName"+row.weeksNum).selectpicker('val',row.projectId); |
147 | 147 | $("#work-projectName"+row.weeksNum).selectpicker('refresh'); |
148 | 148 | |
149 | - $("#btn-commit"+row.weeksNum).text('编辑'); | |
149 | + $("#btn-commit"+row.weeksNum).html('编辑'); | |
150 | 150 | $("#btn-commit"+row.weeksNum).parent().parent().find(".workfill-list-container").attr("contenteditable","false"); |
151 | 151 | $("#btn-commit"+row.weeksNum).parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').addClass('display-none'); |
152 | 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 | 169 | $('.ITD-alertmodel-contentmsg').text(''); |
170 | 170 | $('#ITD-tipsmodel').modal('hide'); |
171 | 171 | },3000); |
172 | + _this.removeAttr("disabled"); | |
172 | 173 | return false; |
173 | 174 | }else{ |
174 | 175 | var req= { |
... | ... | @@ -188,12 +189,13 @@ var fun = { |
188 | 189 | if(res.success == true){ |
189 | 190 | var asraId = res.data; |
190 | 191 | $("#weekday"+id).attr("data-id",asraId); |
191 | - _this.text('编辑'); | |
192 | + _this.html('编辑'); | |
192 | 193 | _this.parent().parent().find(".workfill-list-container").attr("contenteditable","false"); |
193 | 194 | _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').addClass('display-none'); |
194 | 195 | var projectName=_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text(); |
195 | 196 | _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').removeClass('display-none'); |
196 | 197 | _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); |
198 | + _this.removeAttr("disabled"); | |
197 | 199 | |
198 | 200 | }else{ |
199 | 201 | $('.ITD-alertmodel-contentmsg').text('提交失败!'); |
... | ... | @@ -202,6 +204,7 @@ var fun = { |
202 | 204 | $('.ITD-alertmodel-contentmsg').text(''); |
203 | 205 | $('#ITD-tipsmodel').modal('hide'); |
204 | 206 | },3000); |
207 | + _this.removeAttr("disabled"); | |
205 | 208 | return false; |
206 | 209 | } |
207 | 210 | } |
... | ... | @@ -229,7 +232,7 @@ documentBindFunc.on('click','#time-opr-nextbtn',function () { |
229 | 232 | documentBindFunc.on('click','.workfill-list-btn',function () { |
230 | 233 | var _this=$(this); |
231 | 234 | if(_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')){ |
232 | - _this.text('提交'); | |
235 | + _this.html('提交'); | |
233 | 236 | _this.parent().parent().find(".workfill-list-container").attr("contenteditable","true"); |
234 | 237 | _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').toggleClass('display-none'); |
235 | 238 | var projectName=_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text(); |
... | ... | @@ -237,6 +240,7 @@ documentBindFunc.on('click','.workfill-list-btn',function () { |
237 | 240 | _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); |
238 | 241 | |
239 | 242 | }else { |
243 | + _this.attr("disabled","disabled"); | |
240 | 244 | var commitId = _this.attr("id"); |
241 | 245 | var id = commitId.substring(10,11); |
242 | 246 | fun.dailyReportCommit(id,_this); | ... | ... |