按钮添加延时(供应商创建修改,品牌创建修改,店铺创建修改,店铺装修)
Showing
7 changed files
with
58 additions
and
57 deletions
@@ -237,7 +237,7 @@ | @@ -237,7 +237,7 @@ | ||
237 | <div class="row"> | 237 | <div class="row"> |
238 | <div class="col-sm-8 col-sm-offset-2"> | 238 | <div class="col-sm-8 col-sm-offset-2"> |
239 | <a href="javascript:;" onclick="history.go(-1);" class="btn btn-default">取消</a> | 239 | <a href="javascript:;" onclick="history.go(-1);" class="btn btn-default">取消</a> |
240 | - <button id="save_brand" type="submit" data-loading-text="保存中..." class="btn btn-primary">保存</button> | 240 | + <button id="save_brand" type="submit" data-loading-text="保存中..." class="btn delay-btn btn-primary">保存</button> |
241 | </div> | 241 | </div> |
242 | </div> | 242 | </div> |
243 | </div> | 243 | </div> |
@@ -34,13 +34,13 @@ | @@ -34,13 +34,13 @@ | ||
34 | <input type="button" class="btn btn-default " value="返回" onclick="history.go(-1)"> | 34 | <input type="button" class="btn btn-default " value="返回" onclick="history.go(-1)"> |
35 | </div> | 35 | </div> |
36 | <div class="moduleSubmite" style="display: none; text-align: right; margin-top: -10px"> | 36 | <div class="moduleSubmite" style="display: none; text-align: right; margin-top: -10px"> |
37 | - <input id="saveModule" type="button" class="btn btn-success" value="暂存"> | ||
38 | - <input id="submitModule" type="button" class="btn btn-primary" value="提交审核"> | 37 | + <input id="saveModule" type="button" class="btn btn-success delay-btn" value="暂存"> |
38 | + <input id="submitModule" type="button" class="btn btn-primary delay-btn" value="提交审核"> | ||
39 | <input type="button" class="btn btn-default " value="返回" onclick="history.go(-1)"> | 39 | <input type="button" class="btn btn-default " value="返回" onclick="history.go(-1)"> |
40 | </div> | 40 | </div> |
41 | <div class="moduleCheck" style="display: none; text-align: right; margin-top: -10px"> | 41 | <div class="moduleCheck" style="display: none; text-align: right; margin-top: -10px"> |
42 | - <input id="checkOk" type="button" class="btn btn-primary" value="审核通过"> | ||
43 | - <input id="checkNo" type="button" class="btn btn-danger" value="驳回"> | 42 | + <input id="checkOk" type="button" class="btn btn-primary delay-btn" value="审核通过"> |
43 | + <input id="checkNo" type="button" class="btn btn-danger delay-btn" value="驳回"> | ||
44 | <input type="button" class="btn btn-default " value="返回" onclick="history.go(-1)"> | 44 | <input type="button" class="btn btn-default " value="返回" onclick="history.go(-1)"> |
45 | </div> | 45 | </div> |
46 | </div> | 46 | </div> |
@@ -127,8 +127,8 @@ | @@ -127,8 +127,8 @@ | ||
127 | </div> | 127 | </div> |
128 | 128 | ||
129 | <div style="text-align: center"> | 129 | <div style="text-align: center"> |
130 | - <button type="button" data-oncheck='1' class="check btn btn-success">提交审核</button> | ||
131 | - <button type="button" data-oncheck='2' class="check btn btn-info btn-cun">暂存</button> | 130 | + <button type="button" data-oncheck='1' class="check delay-btn btn btn-success">提交审核</button> |
131 | + <button type="button" data-oncheck='2' class="check delay-btn btn btn-info btn-cun">暂存</button> | ||
132 | <button onclick="history.go(-1);" type="button" class="btn btn-danger">取消</button> | 132 | <button onclick="history.go(-1);" type="button" class="btn btn-danger">取消</button> |
133 | </div> | 133 | </div> |
134 | </div> | 134 | </div> |
@@ -225,15 +225,15 @@ | @@ -225,15 +225,15 @@ | ||
225 | <a href="javascript:;" class="btn btn-default" | 225 | <a href="javascript:;" class="btn btn-default" |
226 | onclick="javascript:history.go(-1);">取消</a> | 226 | onclick="javascript:history.go(-1);">取消</a> |
227 | <%if add%> | 227 | <%if add%> |
228 | - <button type="submit" class="btn btn-info" data-loading-text="暂存中..." id="btnTemporary">暂存</button> | 228 | + <button type="submit" class="btn delay-btn btn-info" data-loading-text="暂存中..." id="btnTemporary">暂存</button> |
229 | <%/if%> | 229 | <%/if%> |
230 | 230 | ||
231 | <%if update%> | 231 | <%if update%> |
232 | - <button type="submit" class="btn btn-success mr5" data-loading-text="提交审核中..." id="btnReview">提交审核</button> | 232 | + <button type="submit" class="btn delay-btn btn-success mr5" data-loading-text="提交审核中..." id="btnReview">提交审核</button> |
233 | <%/if%> | 233 | <%/if%> |
234 | 234 | ||
235 | <%if updatecheck%> | 235 | <%if updatecheck%> |
236 | - <button type="submit" class="btn btn-success mr5" data-loading-text="提交审核中..." id="updatecheck">提交审核</button> | 236 | + <button type="submit" class="btn delay-btn btn-success mr5" data-loading-text="提交审核中..." id="updatecheck">提交审核</button> |
237 | <%/if%> | 237 | <%/if%> |
238 | </div> | 238 | </div> |
239 | </div> | 239 | </div> |
@@ -103,15 +103,13 @@ $('.dropdown-menu').on('mouseenter', function() { | @@ -103,15 +103,13 @@ $('.dropdown-menu').on('mouseenter', function() { | ||
103 | $(this).hide(); | 103 | $(this).hide(); |
104 | }); | 104 | }); |
105 | 105 | ||
106 | -// $(document).on("click",".btn",function(){ | ||
107 | -// var $this=$(this); | ||
108 | -// if(!$this.is(":file")){ | ||
109 | -// $this.prop("disabled",true); | ||
110 | -// setTimeout(function(){ | ||
111 | -// $this.prop("disabled",false) | ||
112 | -// },2000); | ||
113 | -// } | ||
114 | -// }); | 106 | +$(document).on("click",".delay-btn",function(){ |
107 | + var $this=$(this); | ||
108 | + $this.prop("disabled",true); | ||
109 | + setTimeout(function(){ | ||
110 | + $this.prop("disabled",false) | ||
111 | + },2000); | ||
112 | +}); | ||
115 | 113 | ||
116 | $(document).on("keyup change","input[type='number']",function(){ | 114 | $(document).on("keyup change","input[type='number']",function(){ |
117 | $(this).val($(this).val().replace(/[^0-9]/g, '')); | 115 | $(this).val($(this).val().replace(/[^0-9]/g, '')); |
1 | -var $=require('jquery'); | ||
2 | -var edit=require('../../common/edit'); | ||
3 | - | ||
4 | - var e=new edit("#basicForm",{ | ||
5 | - bucket:"brandLogo" | ||
6 | - }); | ||
7 | - //brandTonality | ||
8 | - e.on("validate",function(){ | ||
9 | - var num=$.trim($("#brandTonality").val()); | ||
10 | - if(num){ | ||
11 | - if(+num>100||+num<1){ | ||
12 | - return "调性指数(范围:1-100)"; | ||
13 | - } | 1 | +var $ = require('jquery'); |
2 | +var edit = require('../../common/edit'); | ||
3 | + | ||
4 | +var e = new edit("#basicForm", { | ||
5 | + bucket: "brandLogo" | ||
6 | +}); | ||
7 | +//brandTonality | ||
8 | +e.on("validate", function () { | ||
9 | + var num = $.trim($("#brandTonality").val()); | ||
10 | + if (num) { | ||
11 | + if (+num > 100 || +num < 1) { | ||
12 | + return "调性指数(范围:1-100)"; | ||
14 | } | 13 | } |
15 | - return true; | ||
16 | - }); | ||
17 | - e.init(); | ||
18 | - $("#save_brand").click(function(){ | ||
19 | - e.submit($("#basicForm").attr("action"),function(option){ | ||
20 | - option.success=function(res){ | ||
21 | - if(res.code=="200"){ | ||
22 | - e.$tip("提交成功", function() { | ||
23 | - location.href="/erpproduct/brands/index" | ||
24 | - }, 'growl-success'); | ||
25 | - }else{ | ||
26 | - e.$tip(res.message); | ||
27 | - } | ||
28 | - return false; | ||
29 | - }, | ||
30 | - option.error=function(res){ | 14 | + } |
15 | + return true; | ||
16 | +}); | ||
17 | +e.init(); | ||
18 | + | ||
19 | +$(document).on('click','#save_brand',function () { | ||
20 | + e.submit($("#basicForm").attr("action"), function (option) { | ||
21 | + option.success = function (res) { | ||
22 | + if (res.code == "200") { | ||
23 | + e.$tip("提交成功", function () { | ||
24 | + location.href = "/erpproduct/brands/index" | ||
25 | + }, 'growl-success'); | ||
26 | + } else { | ||
27 | + e.$tip(res.message); | ||
28 | + } | ||
29 | + return false; | ||
30 | + }, | ||
31 | + option.error = function (res) { | ||
31 | e.$tip(res.message); | 32 | e.$tip(res.message); |
32 | } | 33 | } |
33 | - console.log(option.data); | ||
34 | - }); | ||
35 | - return false; | ||
36 | - }) | 34 | + console.log(option.data); |
35 | + }); | ||
36 | + return false; | ||
37 | +}); | ||
37 | 38 |
@@ -44,18 +44,19 @@ var submit = function (callback, config) { | @@ -44,18 +44,19 @@ var submit = function (callback, config) { | ||
44 | } | 44 | } |
45 | callback && callback(option.data); | 45 | callback && callback(option.data); |
46 | }); | 46 | }); |
47 | -} | 47 | +}; |
48 | 48 | ||
49 | //添加暂存,提交审核 | 49 | //添加暂存,提交审核 |
50 | -$("#btnTemporary").click(function () { | 50 | +$(document).on('click','#btnTemporary',function () { |
51 | submit(function (data) { | 51 | submit(function (data) { |
52 | data.operations = 1; | 52 | data.operations = 1; |
53 | data.status = 100; | 53 | data.status = 100; |
54 | }, {msg: "暂存成功"}); | 54 | }, {msg: "暂存成功"}); |
55 | return false; | 55 | return false; |
56 | }); | 56 | }); |
57 | -$("#btnReview").click(function () { | ||
58 | - //到审核表 | 57 | + |
58 | +//到审核表 | ||
59 | +$(document).on('click','#btnReview',function () { | ||
59 | submit(function (data) { | 60 | submit(function (data) { |
60 | data.operations ? data.operations : data.operations = 1; | 61 | data.operations ? data.operations : data.operations = 1; |
61 | if (+data.status == 300) { | 62 | if (+data.status == 300) { |
@@ -65,8 +66,9 @@ $("#btnReview").click(function () { | @@ -65,8 +66,9 @@ $("#btnReview").click(function () { | ||
65 | }, {msg: "提交成功"}); | 66 | }, {msg: "提交成功"}); |
66 | return false; | 67 | return false; |
67 | }); | 68 | }); |
69 | + | ||
68 | //供应商列表 | 70 | //供应商列表 |
69 | -$("#updatecheck").click(function () { | 71 | +$(document).on('click','#updatecheck',function () { |
70 | submit(function (data) { | 72 | submit(function (data) { |
71 | data.operations = 2; | 73 | data.operations = 2; |
72 | data.status = 200; | 74 | data.status = 200; |
-
Please register or login to post a comment