Authored by dongjunjie

grid+优惠券查询校验

@@ -16,10 +16,7 @@ @@ -16,10 +16,7 @@
16 <input type="text" class="form-control number" id="filter-orderCode" placeholder="订单号"> 16 <input type="text" class="form-control number" id="filter-orderCode" placeholder="订单号">
17 </div> 17 </div>
18 <div class="panel-col"> 18 <div class="panel-col">
19 - <input type="text" class="form-control" id="filter-couponName" placeholder="优惠券名称">  
20 - </div>  
21 - <div class="panel-col">  
22 - <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a> 19 + <a id="filter-btn" href="javascript:;" class="btn btn-info">查询</a>
23 </div> 20 </div>
24 </div> 21 </div>
25 </div> 22 </div>
@@ -262,15 +262,19 @@ grid.prototype = { @@ -262,15 +262,19 @@ grid.prototype = {
262 total: data.totalPage, 262 total: data.totalPage,
263 page: data.page 263 page: data.page
264 }); 264 });
  265 + if(data.list){
265 g.__bodyClomun(data.list, p.second); 266 g.__bodyClomun(data.list, p.second);
  267 + }else{
  268 + g.__bodyClomun([], p.second);
  269 + }
266 g.total = data.total?data.total:0; 270 g.total = data.total?data.total:0;
267 }, 271 },
268 complete: function(res) { 272 complete: function(res) {
269 - console.log("complete~~"); 273 + console.log("gridComplete~~");
270 //p.complete && p.complete(); 274 //p.complete && p.complete();
271 }, 275 },
272 error: function(res) { 276 error: function(res) {
273 - console.log("error~~", res); 277 + console.log("gridError~~", res);
274 clearTimeout(timeid); 278 clearTimeout(timeid);
275 if (res.status == 429) { 279 if (res.status == 429) {
276 timeid = setTimeout(function() { 280 timeid = setTimeout(function() {
@@ -299,8 +303,6 @@ grid.prototype = { @@ -299,8 +303,6 @@ grid.prototype = {
299 return (p.page - 1) * parseInt(p.rp); 303 return (p.page - 1) * parseInt(p.rp);
300 } 304 }
301 305
302 -  
303 -  
304 if (rows.length > 0) { 306 if (rows.length > 0) {
305 for (var row in rows) { 307 for (var row in rows) {
306 var item = rows[row], 308 var item = rows[row],
@@ -11,10 +11,9 @@ var g = new common.grid({ @@ -11,10 +11,9 @@ var g = new common.grid({
11 async:false, 11 async:false,
12 parms:function(){ 12 parms:function(){
13 return { 13 return {
14 - couponName: common.util.__input("filter-couponName"),  
15 couponCode: common.util.__input("filter-couponCode"), 14 couponCode: common.util.__input("filter-couponCode"),
16 - orderCode: common.util.__input("filter-orderCode"),  
17 - uid: common.util.__input("filter-uid") 15 + uid: common.util.__input("filter-uid"),
  16 + orderCode: common.util.__input("filter-orderCode")
18 }; 17 };
19 }, 18 },
20 columns:[ 19 columns:[
@@ -53,6 +52,7 @@ var g = new common.grid({ @@ -53,6 +52,7 @@ var g = new common.grid({
53 }} 52 }}
54 ] 53 ]
55 }); 54 });
  55 +g.init([]);
56 /** 56 /**
57 * 通用对象 57 * 通用对象
58 * @type {{toast: Bll.toast}} 58 * @type {{toast: Bll.toast}}
@@ -84,7 +84,15 @@ var Bll = { @@ -84,7 +84,15 @@ var Bll = {
84 }; 84 };
85 85
86 $(document).on("click", "#filter-btn", function() { 86 $(document).on("click", "#filter-btn", function() {
  87 + var couponCode = common.util.__input("filter-couponCode");
  88 + var uid = common.util.__input("filter-uid");
  89 + var orderCode = common.util.__input("filter-orderCode");
  90 +
  91 + if(uid=="" && couponCode=="" && orderCode==""){
  92 + common.util.__tip("优惠券ID,单券号,订单号,不能全为空!");
  93 + }else{
87 g.init("/couponLogs/queryUserCouponLogsList"); 94 g.init("/couponLogs/queryUserCouponLogsList");
  95 + }
88 }); 96 });
89 97
90 //延长有效期 98 //延长有效期