Authored by weiqingting

按钮置灰代码

... ... @@ -530,13 +530,13 @@ e.on("validate",function(){
$(document).on("click","#btnReview",function(){
$("#btnReview").prop("disabled",true);
var $this=$(this);
if(e.validate()){
common.dialog.confirm("温馨提示","<p>你确定提交吗?</p>",function(){
setTimeout(function(){
$("#btnReview").prop("disabled",false);
},3000);
common.util.__disButton.call($this);
e.submit($("#basicForm").attr("action"),function(option){
var select=tabTree.getAddress();
... ...
... ... @@ -426,7 +426,9 @@ $(document).on('click', "#filter-btn", function () {
// 通过
var BllPass = {
toast: function (content, fn) {
var $this=$(this);
common.dialog.confirm("温馨提示", content, function () {
common.util.__disButton.call($this);
common.util.__ajax({
url: '/base/goods/pass',
data: fn()
... ... @@ -441,7 +443,10 @@ var BllPass = {
// 驳回
var BllReject = {
toast: function (content, fn) {
var $this=$(this);
common.dialog.confirm("温馨提示", content, function () {
common.util.__disButton.call($this);
common.util.__ajax({
url: '/base/goods/reject',
data: fn()
... ... @@ -478,7 +483,7 @@ $(document).on("click", ".apply-success", function () {
productSknList: JSON.stringify([item.productSkn]),
};
}
BllPass.toast("你确定审核通过吗?", data);
BllPass.toast.call(this,"你确定审核通过吗?", data);
});
//单个驳回
... ... @@ -496,7 +501,7 @@ $(document).on("click", ".apply-back", function () {
rejectReason: reason
};
}
BllReject.toast($("#template").html(), data);
BllReject.toast.call(this,$("#template").html(), data);
});
... ... @@ -530,7 +535,7 @@ $(document).on("click", "#reject-btn", function () {
rejectReason: reason
};
}
BllReject.toast($("#template").html(), data);
BllReject.toast.call(this,$("#template").html(), data);
});
//批量通过
... ... @@ -555,7 +560,7 @@ $(document).on("click", "#pass-btn", function () {
productSknList: JSON.stringify(sknList),
};
}
BllPass.toast("确定要通过该申请吗?", data);
BllPass.toast.call(this,"确定要通过该申请吗?", data);
});
... ...
... ... @@ -152,6 +152,7 @@ var util = {
var KEYWORDS = 'for,if,else,each,as';
var SPECHAR = /\W/g;
var NUMBER = /^\d[^,]*|,\d[^,]*/g;
var SPLIT2_RE = /^$|,+/;
var REGEXKEYWORDS = new RegExp("\\b" + [KEYWORDS.replace(/,/g, '\\b|\\b')].join('|'), 'g');
var getVar = function(code) {
... ... @@ -258,6 +259,13 @@ var util = {
}
return true;
},
__disButton:function(){
var $this=this;
$this.attr("disabled","disabled");
setTimeout(function(){
$this.removeAttr("disabled");
},3000);
}
}
module.exports = util;
\ No newline at end of file
... ...
... ... @@ -109,4 +109,5 @@ $(document).on("click",".btn",function(){
setTimeout(function(){
$this.prop("disabled",false)
},2000);
})
\ No newline at end of file
});
... ...