Authored by 陶雨

发券管理

@@ -222,6 +222,7 @@ grid.prototype = { @@ -222,6 +222,7 @@ grid.prototype = {
222 var ajaxOptions = { 222 var ajaxOptions = {
223 type: 'POST', 223 type: 'POST',
224 url: p.url, 224 url: p.url,
  225 + async: (typeof p.async == "boolean") ? p.async:true,
225 data: param, 226 data: param,
226 dataType: 'json', 227 dataType: 'json',
227 beforeSend: function() { 228 beforeSend: function() {
@@ -237,6 +238,7 @@ grid.prototype = { @@ -237,6 +238,7 @@ grid.prototype = {
237 page: data.page 238 page: data.page
238 }); 239 });
239 g.__bodyClomun(data.list, p.second); 240 g.__bodyClomun(data.list, p.second);
  241 + g.total = data.total?data.total:0;
240 }, 242 },
241 complete: function(res) { 243 complete: function(res) {
242 console.log("complete~~"); 244 console.log("complete~~");
@@ -6,15 +6,20 @@ @@ -6,15 +6,20 @@
6 var $ = require('jquery'), 6 var $ = require('jquery'),
7 common=require('../common/common'); 7 common=require('../common/common');
8 8
  9 +var couponId = location.href.substring(location.href.lastIndexOf("/") + 1);
  10 +$("#filter-couponId").val(couponId);
  11 +
9 //下拉框 12 //下拉框
10 new common.dropDown({el: '#filter-status'}); 13 new common.dropDown({el: '#filter-status'});
11 14
12 //grid 15 //grid
13 var g = new common.grid({ 16 var g = new common.grid({
14 el: '#content-list', 17 el: '#content-list',
  18 + hash:false,
  19 + async:false,
15 parms:function(){ 20 parms:function(){
16 return { 21 return {
17 - couponType: common.util.__input("filter-status") 22 + couponId: common.util.__input("filter-couponId")
18 }; 23 };
19 }, 24 },
20 columns:[ 25 columns:[
@@ -23,25 +28,23 @@ var g = new common.grid({ @@ -23,25 +28,23 @@ var g = new common.grid({
23 {display: '状态', render: function(item) { 28 {display: '状态', render: function(item) {
24 var status = ""; 29 var status = "";
25 if(item.status == 0) { 30 if(item.status == 0) {
26 - status = "未发放";  
27 - } else if(item.status == 1) {  
28 - status = "已发放";  
29 - }  
30 - return '<p class="audit-time">' + status + '</p>';  
31 - }},  
32 - {display:"发放时间",render:function(item){  
33 - var status = "";  
34 - if(item.status == 0) {  
35 - status = "未发放"; 31 + status = "未使用";
36 } else if(item.status == 1) { 32 } else if(item.status == 1) {
37 - status = "已发放"; 33 + status = "已使用";
38 } 34 }
39 return '<p class="audit-time">' + status + '</p>'; 35 return '<p class="audit-time">' + status + '</p>';
40 }} 36 }}
41 ] 37 ]
42 }); 38 });
43 g.init("/couponLogs/queryUserCouponLogsList"); 39 g.init("/couponLogs/queryUserCouponLogsList");
  40 +$("#count").html(g.total);
44 41
45 $(document).on("click", "#filter-btn", function() { 42 $(document).on("click", "#filter-btn", function() {
46 g.reload(1); 43 g.reload(1);
47 }); 44 });
  45 +
  46 +//导出
  47 +$(document).on('click', '#export-btn', function() {
  48 + var queryConf = JSON.stringify({couponId:couponId});
  49 + window.open("/ajax/down?queryConf=" + queryConf + "&type=couponLogsExport");
  50 +});
  1 +/**
  2 + * Created by ty on 2016/5/24.
  3 + */
  4 +'use strict';
  5 +var $ = require('jquery'),
  6 + common=require('../common/common');
  7 +
  8 +var couponId = location.href.substring(location.href.lastIndexOf("/") + 1);
  9 +$("#filter-couponId").val(couponId);
  10 +
  11 +//下拉框
  12 +new common.dropDown({el: '#filter-status'});
  13 +
  14 +//grid
  15 +var g = new common.grid({
  16 + el: '#content-list',
  17 + hash:false,
  18 + async:false,
  19 + parms:function(){
  20 + return {
  21 + couponId: common.util.__input("filter-couponId"),
  22 + couponCode: common.util.__input("filter-couponCode"),
  23 + orderCode: common.util.__input("filter-orderCode"),
  24 + uid: common.util.__input("filter-uid")
  25 + };
  26 + },
  27 + columns:[
  28 + {display:"单券号", name:"couponCode"},
  29 + {display:"用户ID",name:"uid"},
  30 + {display:"订单号",name:"orderCode"},
  31 + {display: '是否使用', render: function(item) {
  32 + var status = "";
  33 + if(item.status == 0) {
  34 + status = "未使用";
  35 + } else if(item.status == 1) {
  36 + status = "已使用";
  37 + }
  38 + return '<p class="audit-time">' + status + '</p>';
  39 + }}
  40 + ]
  41 +});
  42 +g.init("/couponLogs/queryUserCouponLogsList");
  43 +$("#count").html(g.total);
  44 +
  45 +$(document).on("click", "#filter-btn", function() {
  46 + g.reload(1);
  47 +});
  48 +
  49 +//导出
  50 +$(document).on('click', '#export-btn', function() {
  51 + var queryConf = JSON.stringify({couponId:couponId});
  52 + window.open("/ajax/down?queryConf=" + queryConf + "&type=couponLogsExport");
  53 +});
@@ -3,7 +3,8 @@ @@ -3,7 +3,8 @@
3 //exports.domain = 'http://172.16.6.162:8088/platform'; 3 //exports.domain = 'http://172.16.6.162:8088/platform';
4 //exports.domain = 'http://172.16.6.108:8088/platform';//谭玲 4 //exports.domain = 'http://172.16.6.108:8088/platform';//谭玲
5 //exports.domain = 'http://172.16.6.201:8088/platform';//谭玲 5 //exports.domain = 'http://172.16.6.201:8088/platform';//谭玲
6 -exports.domain = 'http://172.16.6.250:2081/platform'; 6 +//exports.domain = 'http://172.16.6.250:2081/platform';//庞洁
  7 +exports.domain = 'http://172.16.6.189:8088/platform';//李建
7 8
8 //营销管理路由配置 9 //营销管理路由配置
9 exports.res = [ 10 exports.res = [
@@ -667,7 +668,7 @@ exports.res = [ @@ -667,7 +668,7 @@ exports.res = [
667 { 668 {
668 //查询用户券列表 669 //查询用户券列表
669 route: "/couponLogs/queryUserCouponLogsList", 670 route: "/couponLogs/queryUserCouponLogsList",
670 - method: "GET", 671 + method: "POST",
671 url: "/couponLogs/queryUserCouponLogsList", 672 url: "/couponLogs/queryUserCouponLogsList",
672 params: [ 673 params: [
673 {name: "page", type: "number"}, 674 {name: "page", type: "number"},
@@ -676,7 +677,15 @@ exports.res = [ @@ -676,7 +677,15 @@ exports.res = [
676 {name: "couponCode", type: "string"}, 677 {name: "couponCode", type: "string"},
677 {name: "couponName", type: "string"}, 678 {name: "couponName", type: "string"},
678 {name: "couponId", type: "number"}, 679 {name: "couponId", type: "number"},
679 - {name: "orderCode", type: "number"} 680 + {name: "orderCode", type: "number"},
  681 + {name: "uid", type: "number"}
680 ] 682 ]
  683 + },
  684 + {
  685 + //优惠券使用历史页面渲染
  686 + route: "/market/couponSend/useHistory/:param",
  687 + method: "GET",
  688 + view: "pages/market/useHistory",
  689 + src: "/market/useHistory"
681 } 690 }
682 ] 691 ]
@@ -23,20 +23,24 @@ @@ -23,20 +23,24 @@
23 <div class="panel panel-default" style="margin-bottom:10px;"> 23 <div class="panel panel-default" style="margin-bottom:10px;">
24 <div class="panel-body"> 24 <div class="panel-body">
25 <div class="row"> 25 <div class="row">
26 - <div class="panel-col">  
27 - <select id="filter-status" tabindex="-1" class="select2-offscreen brandBtn-group">  
28 - <option value="-1">状态</option>  
29 - <option value="1">已发放</option>  
30 - <option value="0">未发放</option>  
31 - </select>  
32 - </div>  
33 - <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>  
34 - <a id="all-btn" href="" class="btn btn-info">全部</a> 26 + <!--<div class="panel-col">-->
  27 + <!--<select id="filter-status" tabindex="-1" class="select2-offscreen brandBtn-group">-->
  28 + <!--<option value="-1">状态</option>-->
  29 + <!--<option value="1">已使用</option>-->
  30 + <!--<option value="0">未使用</option>-->
  31 + <!--</select>-->
  32 + <input type="hidden" id="filter-couponId" value="">
  33 + <!--</div>-->
  34 + <!--<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>-->
  35 + <a id="export-btn" href="" class="btn btn-info">导出</a>
35 </div> 36 </div>
36 </div> 37 </div>
37 </div> 38 </div>
38 <div class="panel panel-primary-head"> 39 <div class="panel panel-primary-head">
39 <div class="basicTable_wrapper" id="content-list"> 40 <div class="basicTable_wrapper" id="content-list">
40 </div> 41 </div>
  42 + <div>
  43 + <label>总数:<span id="count"></span></label>
  44 + </div>
41 </div> 45 </div>
42 </div> 46 </div>
  1 +<div class="pageheader">
  2 + <div class="media">
  3 + <div class="pageicon pull-left">
  4 + <i class="fa fa-th-list"></i>
  5 + </div>
  6 + <div class="media-body">
  7 + <ul class="breadcrumb">
  8 + <li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
  9 + <li><a href="">营销管理</a></li>
  10 + <li>发券管理</li>
  11 + </ul>
  12 +
  13 + <div>
  14 + <div style="width: 30%;float: left;">
  15 + <h4>使用记录</h4>
  16 + </div>
  17 + </div>
  18 + </div>
  19 + </div>
  20 +</div>
  21 +
  22 +<div class="contentpanel">
  23 + <div class="panel panel-default" style="margin-bottom:10px;">
  24 + <div class="panel-body">
  25 + <div class="row">
  26 + <div class="panel-col">
  27 + <input type="text" class="form-control" id="filter-couponCode" placeholder="单券号">
  28 + <input type="hidden" id="filter-couponId" value="">
  29 + </div>
  30 + <div class="panel-col">
  31 + <input type="text" class="form-control" id="filter-uid" placeholder="用户ID">
  32 + </div>
  33 + <div class="panel-col">
  34 + <input type="text" class="form-control" id="filter-orderCode" placeholder="订单号">
  35 + </div>
  36 + <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
  37 + <a id="export-btn" href="" class="btn btn-info">导出</a>
  38 + </div>
  39 + </div>
  40 + </div>
  41 + <div class="panel panel-primary-head">
  42 + <div class="basicTable_wrapper" id="content-list">
  43 + </div>
  44 + <div>
  45 + <label>总数:<span id="count"></span></label>
  46 + </div>
  47 + </div>
  48 +</div>