Authored by zhaoqing

VIP返币

@@ -45,6 +45,12 @@ module.exports = function (app) { @@ -45,6 +45,12 @@ module.exports = function (app) {
45 //批量修改商品VIP状态 45 //批量修改商品VIP状态
46 app.post("/vip/batchChangeStatus", "vip_batchChangeStatus"); 46 app.post("/vip/batchChangeStatus", "vip_batchChangeStatus");
47 47
  48 + //修改商品VIP反币状态
  49 + app.post("/vip/changeReturnCoinStatus", "vip_changeReturnCoinStatus");
  50 +
  51 + //批量修改商品VIP反币状态
  52 + app.post("/vip/batchChangeReturnCoinStatus", "vip_batchChangeReturnCoinStatus");
  53 +
48 //获取商品VIP列表 54 //获取商品VIP列表
49 app.post("/vip/queryProductVipList", "vip_queryProductVipList"); 55 app.post("/vip/queryProductVipList", "vip_queryProductVipList");
50 56
@@ -15,6 +15,7 @@ module.exports = { @@ -15,6 +15,7 @@ module.exports = {
15 shopId: {type: Number}, 15 shopId: {type: Number},
16 brandId: {type: Number}, 16 brandId: {type: Number},
17 vipDiscountType: {type: Number}, 17 vipDiscountType: {type: Number},
  18 + vipReturnCoinStatus: {type: Number},
18 page: {type: Number} 19 page: {type: Number}
19 } 20 }
20 }, 21 },
@@ -41,6 +42,22 @@ module.exports = { @@ -41,6 +42,22 @@ module.exports = {
41 { name: 'shopsIds', type: 'String'}, 42 { name: 'shopsIds', type: 'String'},
42 { name: 'vipStatus', type: 'Number'} 43 { name: 'vipStatus', type: 'Number'}
43 ] 44 ]
  45 + },
  46 + changeReturnCoinStatus: {
  47 + title: "修改商品VIP状态",
  48 + url: '/vip/changeReturnCoinStatus',
  49 + params: {
  50 + productSkn: {type: Number},
  51 + vipReturnCoinStatus: {type: Number}
  52 + }
  53 + },
  54 + batchChangeReturnCoinStatus: {
  55 + title: "修改商品VIP状态",
  56 + url: '/vip/batchChangeReturnCoinStatus',
  57 + params: {
  58 + sknList: {type: String},
  59 + vipReturnCoinStatus: {type: Number}
  60 + }
44 } 61 }
45 } 62 }
46 }; 63 };
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 <div class="panel-body"> 6 <div class="panel-body">
7 <table class="table table-bordered"> 7 <table class="table table-bordered">
8 <tr> 8 <tr>
9 - <td rowspan="2">商品VIP设置</td> 9 + <td rowspan="2" style="width:250px">商品VIP设置</td>
10 <td>上传EXCEL:</td> 10 <td>上传EXCEL:</td>
11 <td style="position: relative;"> 11 <td style="position: relative;">
12 <input id="importProductBatch" name="file" data-type="" type="file" style="border:1px solid red; cursor: pointer; height: 37px; top: 8px;"> 12 <input id="importProductBatch" name="file" data-type="" type="file" style="border:1px solid red; cursor: pointer; height: 37px; top: 8px;">
@@ -26,6 +26,28 @@ @@ -26,6 +26,28 @@
26 </table> 26 </table>
27 </div> 27 </div>
28 <div class="panel-body"> 28 <div class="panel-body">
  29 + <table class="table table-bordered">
  30 + <tr>
  31 + <td rowspan="2" style="width:250px">商品VIP返币设置</td>
  32 + <td>上传EXCEL:</td>
  33 + <td style="position: relative;">
  34 + <input id="importReturnCoinBatch" name="file" data-type="" type="file" style="border:1px solid red; cursor: pointer; height: 37px; top: 8px;">
  35 + <a class="btn btn-default" href="/vip/index">返回</a>
  36 + </td>
  37 + </tr>
  38 + <tr>
  39 + <td>说明:</td>
  40 + <td colspan="2">
  41 + 1、上传文件必须是 .xlsx 文件<br>
  42 + 2、第一行标题栏:SKN、商品VIP返币状态<br>
  43 + <span style="color: red;">3、商品VIP返币状态:1表示开启,0表示关闭;</span><br>
  44 + 4、请上传自己权限内的商品SKN,一次上传数量不可超过1W条<br/>
  45 + 5、<a href="/ajax/link/vipProduct">下载样例</a>
  46 + </td>
  47 + </tr>
  48 + </table>
  49 + </div>
  50 + <div class="panel-body">
29 <div class="col-md-12"> 51 <div class="col-md-12">
30 <div id="message"></div> 52 <div id="message"></div>
31 </div> 53 </div>
@@ -47,6 +47,14 @@ @@ -47,6 +47,14 @@
47 </select> 47 </select>
48 </div> 48 </div>
49 49
  50 + <div class="panel-col2" style="width: 100px;">
  51 + <select id="vipReturnCoinStatus" class="form-control">
  52 + <option value="-1">返币状态</option>
  53 + <option value="1">开启</option>
  54 + <option value="0">关闭</option>
  55 + </select>
  56 + </div>
  57 +
50 <div class="panel-col"> 58 <div class="panel-col">
51 <a id="searchFilter" href="javascript:;" class="btn btn-info">筛选</a> 59 <a id="searchFilter" href="javascript:;" class="btn btn-info">筛选</a>
52 </div> 60 </div>
@@ -58,8 +66,10 @@ @@ -58,8 +66,10 @@
58 </div> 66 </div>
59 <div style="margin-left:10px;margin-bottom: 10px"> 67 <div style="margin-left:10px;margin-bottom: 10px">
60 <label><input name="all" id="all" type="checkbox" onclick="DoCheck()" value=""/>选中当前页</label> 68 <label><input name="all" id="all" type="checkbox" onclick="DoCheck()" value=""/>选中当前页</label>
61 - <a onclick="batchChangeStatus(1)" href="javascript:;" class="btn btn-info">开启</a>  
62 - <a onclick="batchChangeStatus(2)" href="javascript:;" class="btn btn-danger">关闭</a> 69 + <a onclick="batchChangeStatus(1)" href="javascript:;" class="btn btn-info">开启VIP价</a>
  70 + <a onclick="batchChangeStatus(2)" href="javascript:;" class="btn btn-danger">关闭VIP价</a>
  71 + <a onclick="batchChangeReturnCoinStatus(1)" href="javascript:;" class="btn btn-info">开启VIP返币</a>
  72 + <a onclick="batchChangeReturnCoinStatus(0)" href="javascript:;" class="btn btn-danger">关闭VIP返币</a>
63 <div style="float:right;margin-right:10px;margin-top:20px;"> 73 <div style="float:right;margin-right:10px;margin-top:20px;">
64 <label style="color:#FF0000">*只有正价商品才能开启VIP价格 VIP折扣固定为白金:88折 金卡:9折 银卡:95折</label> 74 <label style="color:#FF0000">*只有正价商品才能开启VIP价格 VIP折扣固定为白金:88折 金卡:9折 银卡:95折</label>
65 </div> 75 </div>
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 2
3 var $ = require('jquery'), common = require('../../common/common'); 3 var $ = require('jquery'), common = require('../../common/common');
4 var importConfig = { "bizType" : "vipBatch" }; 4 var importConfig = { "bizType" : "vipBatch" };
  5 +var importConfig1 = { "bizType" : "vipReturnCoinBatch" };
5 $('input[type="file"]').after('<div class="file-name btn btn-default">请选择文件</div>'); 6 $('input[type="file"]').after('<div class="file-name btn btn-default">请选择文件</div>');
6 7
7 var loadModal = null; 8 var loadModal = null;
@@ -37,3 +38,5 @@ function batchImport(el, type) { @@ -37,3 +38,5 @@ function batchImport(el, type) {
37 38
38 common.edit.ajaxfileupload('#importProductBatch', batchImport('#sort-file', importConfig.bizType)); 39 common.edit.ajaxfileupload('#importProductBatch', batchImport('#sort-file', importConfig.bizType));
39 40
  41 +common.edit.ajaxfileupload('#importReturnCoinBatch', batchImport('#sort-file', importConfig1.bizType));
  42 +
@@ -17,7 +17,8 @@ var g = new common.grid({ @@ -17,7 +17,8 @@ var g = new common.grid({
17 productSkn: common.util.__input('productSkn'), 17 productSkn: common.util.__input('productSkn'),
18 shopId: common.util.__input('shopId'), 18 shopId: common.util.__input('shopId'),
19 brandId: common.util.__input('brandId'), 19 brandId: common.util.__input('brandId'),
20 - vipDiscountType: common.util.__input('vipDiscountType') 20 + vipDiscountType: common.util.__input('vipDiscountType'),
  21 + vipReturnCoinStatus: common.util.__input('vipReturnCoinStatus')
21 }; 22 };
22 }, 23 },
23 columns: [ 24 columns: [
@@ -57,13 +58,29 @@ var g = new common.grid({ @@ -57,13 +58,29 @@ var g = new common.grid({
57 return HtmArr.join(''); 58 return HtmArr.join('');
58 } 59 }
59 }, { 60 }, {
  61 + display: "VIP返币状态",
  62 + render: function (item) {
  63 + var HtmArr = [];
  64 + if(item.vipReturnCoinStatus == 0){
  65 + HtmArr.push('<label>关闭</label>');
  66 + }else{
  67 + HtmArr.push('<label>开启</label>');
  68 + }
  69 + return HtmArr.join('');
  70 + }
  71 + }, {
60 display: '操作', 72 display: '操作',
61 render: function (item) { 73 render: function (item) {
62 var HtmArr = []; 74 var HtmArr = [];
63 if(item.vipDiscountType == 3){ 75 if(item.vipDiscountType == 3){
64 - HtmArr.push('<a onclick="changeStatus('+item.productSKN+',1)" href="javascript:;" class="btn btn-info">开启</a>'); 76 + HtmArr.push('<a onclick="changeStatus('+item.productSKN+',1)" href="javascript:;" class="btn btn-info">开启VIP价</a>');
  77 + }else{
  78 + HtmArr.push('<a onclick="changeStatus('+item.productSKN+',2)" href="javascript:;" class="btn btn-danger">关闭VIP价</a>');
  79 + }
  80 + if(item.vipReturnCoinStatus == 0){
  81 + HtmArr.push('<a onclick="changeReturnCoinStatus('+item.productSKN+',1)" href="javascript:;" class="btn btn-info">开启VIP返币</a>');
65 }else{ 82 }else{
66 - HtmArr.push('<a onclick="changeStatus('+item.productSKN+',2)" href="javascript:;" class="btn btn-danger">关闭</a>'); 83 + HtmArr.push('<a onclick="changeReturnCoinStatus('+item.productSKN+',0)" href="javascript:;" class="btn btn-danger">关闭VIP返币</a>');
67 } 84 }
68 return HtmArr.join(''); 85 return HtmArr.join('');
69 } 86 }
@@ -101,6 +118,37 @@ function batchChangeStatus(status) { @@ -101,6 +118,37 @@ function batchChangeStatus(status) {
101 } 118 }
102 119
103 /** 120 /**
  121 + * 批量修改商品VIP返币状态
  122 + * @param status
  123 + */
  124 +function batchChangeReturnCoinStatus(status) {
  125 + console.log(status);
  126 + var chk_value =[];
  127 + $('input[name="choose"]:checked').each(function(){
  128 + chk_value.push($(this).val());
  129 + });
  130 + if(chk_value.length==0) {
  131 + alert("你还没有选择任何SKN!");
  132 + return;
  133 + }
  134 + var params= {
  135 + sknList: chk_value.toString(),
  136 + vipReturnCoinStatus: status
  137 + };
  138 + common.dialog.confirm("警告",
  139 + "确认批量修改商品VIP返币状态?",
  140 + function () {
  141 + common.util.__ajax({
  142 + url: '/vip/batchChangeReturnCoinStatus',
  143 + data: params
  144 + }, function(res) {
  145 + g.reload();
  146 + $("[name='all']").removeAttr("checked");
  147 + });
  148 + });
  149 +}
  150 +
  151 +/**
104 * 搜索商品VIP 152 * 搜索商品VIP
105 */ 153 */
106 $("#searchFilter").click(function() { 154 $("#searchFilter").click(function() {
@@ -132,6 +180,31 @@ function changeStatus(productSkn,status) { @@ -132,6 +180,31 @@ function changeStatus(productSkn,status) {
132 }; 180 };
133 181
134 /** 182 /**
  183 + * 单个修改商品VIP返币状态
  184 + * @param productSkn
  185 + * @param status
  186 + */
  187 +function changeReturnCoinStatus(productSkn,status) {
  188 + console.log(status);
  189 + var param = {
  190 + productSkn: productSkn,
  191 + vipReturnCoinStatus: status
  192 + };
  193 + console.log(param);
  194 + common.dialog.confirm("警告",
  195 + "确认修改商品VIP返币状态?",
  196 + function () {
  197 + common.util.__ajax({
  198 + url: '/vip/changeReturnCoinStatus',
  199 + data: param
  200 + }, function(res) {
  201 + g.reload();
  202 + $("[name='all']").removeAttr("checked");
  203 + });
  204 + });
  205 +};
  206 +
  207 +/**
135 * 全选、反选 208 * 全选、反选
136 * @constructor 209 * @constructor
137 */ 210 */
@@ -168,3 +241,5 @@ function changeTab(tab) { @@ -168,3 +241,5 @@ function changeTab(tab) {
168 } 241 }
169 window.changeTab = changeTab; 242 window.changeTab = changeTab;
170 window.batchChangeStatus = batchChangeStatus; 243 window.batchChangeStatus = batchChangeStatus;
  244 +window.changeReturnCoinStatus = changeReturnCoinStatus;
  245 +window.batchChangeReturnCoinStatus = batchChangeReturnCoinStatus;