Authored by dongjunjie

grid+优惠券查询校验

... ... @@ -16,10 +16,7 @@
<input type="text" class="form-control number" id="filter-orderCode" placeholder="订单号">
</div>
<div class="panel-col">
<input type="text" class="form-control" id="filter-couponName" placeholder="优惠券名称">
</div>
<div class="panel-col">
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="filter-btn" href="javascript:;" class="btn btn-info">查询</a>
</div>
</div>
</div>
... ...
... ... @@ -262,15 +262,19 @@ grid.prototype = {
total: data.totalPage,
page: data.page
});
g.__bodyClomun(data.list, p.second);
if(data.list){
g.__bodyClomun(data.list, p.second);
}else{
g.__bodyClomun([], p.second);
}
g.total = data.total?data.total:0;
},
complete: function(res) {
console.log("complete~~");
console.log("gridComplete~~");
//p.complete && p.complete();
},
error: function(res) {
console.log("error~~", res);
console.log("gridError~~", res);
clearTimeout(timeid);
if (res.status == 429) {
timeid = setTimeout(function() {
... ... @@ -299,8 +303,6 @@ grid.prototype = {
return (p.page - 1) * parseInt(p.rp);
}
if (rows.length > 0) {
for (var row in rows) {
var item = rows[row],
... ...
... ... @@ -11,10 +11,9 @@ var g = new common.grid({
async:false,
parms:function(){
return {
couponName: common.util.__input("filter-couponName"),
couponCode: common.util.__input("filter-couponCode"),
orderCode: common.util.__input("filter-orderCode"),
uid: common.util.__input("filter-uid")
uid: common.util.__input("filter-uid"),
orderCode: common.util.__input("filter-orderCode")
};
},
columns:[
... ... @@ -53,6 +52,7 @@ var g = new common.grid({
}}
]
});
g.init([]);
/**
* 通用对象
* @type {{toast: Bll.toast}}
... ... @@ -84,7 +84,15 @@ var Bll = {
};
$(document).on("click", "#filter-btn", function() {
g.init("/couponLogs/queryUserCouponLogsList");
var couponCode = common.util.__input("filter-couponCode");
var uid = common.util.__input("filter-uid");
var orderCode = common.util.__input("filter-orderCode");
if(uid=="" && couponCode=="" && orderCode==""){
common.util.__tip("优惠券ID,单券号,订单号,不能全为空!");
}else{
g.init("/couponLogs/queryUserCouponLogsList");
}
});
//延长有效期
... ...