Authored by mali

Merge branch 'dev_VIP及变价优化' into gray

... ... @@ -168,7 +168,7 @@
<td width="120px"><b>说明:</b></td>
<td>
1、上传文件必须是<span style="color:red;">.xlsx</span>文件<br>
2、Excel表头为:<span style="color: #67D267;">SKN、吊牌价、销售价、VIP折扣类型、VIP价、白金价、金卡价、银卡价</span><br>
2、Excel表头为:<span style="color: #67D267;">SKN、吊牌价、销售价</span><br>
3、第一行为表头内容,第二行开始为正式内容<br>
4、每个文件控制在2500行以内<br>
5、<a href="/ajax/link/batchUpdatePrice" style="margin: 0; text-decoration: underline">下载样例.xlsx</a>
... ... @@ -247,11 +247,6 @@
<table class="table table-striped table-bordered" style="margin: 0;border: 0">
<tr>
<th style="border-top: 0; border-left: 0">SKN</th>
<th style="border-top: 0">VIP折扣类型</th>
<th style="border-top: 0">VIP</th>
<th style="border-top: 0">白金</th>
<th style="border-top: 0">金卡</th>
<th style="border-top: 0">银卡</th>
<th style="border-top: 0">学生价</th>
<th style="border-top: 0">建议销售价</th>
<th style="border-top: 0">销售价</th>
... ... @@ -266,28 +261,6 @@
<input class="plan-id form-control" type="hidden" value="{planId}" >
</td>
<td style="border-bottom: 0">
<select class="discount-select form-control" style="width: 110px">
<option value="1">正常折扣</option>
<option value="2">统一折扣</option>
<option value="3">无折扣</option>
<option value="4">固定折扣</option>
<option value="5">自定义折扣</option>
</select>
</td>
<td style="border-bottom: 0">
<input class="vip-price form-control" type="text" value="{vip_price}" onkeyup="this.value=this.value.replace(/[^\d\.]|^\./gi,'')">
</td>
<td style="border-bottom: 0">
<input class="vip3-price form-control" type="text" value="{vip3_price}" onkeyup="this.value=this.value.replace(/[^\d\.]|^\./gi,'')" disabled>
</td>
<td style="border-bottom: 0">
<input class="vip2-price form-control" type="text" value="{vip2_price}" onkeyup="this.value=this.value.replace(/[^\d\.]|^\./gi,'')" disabled>
</td>
<td style="border-bottom: 0">
<input class="vip1-price form-control" type="text" value="{vip1_price}" onkeyup="this.value=this.value.replace(/[^\d\.]|^\./gi,'')" disabled>
</td>
<td style="border-bottom: 0">
<div class="form-inline" style="margin-bottom: 5px">
<div class="form-group">
<!-- <input type="radio"style="margin-left: 35%" disabled>关闭<br> -->
... ... @@ -365,8 +338,8 @@
</tr>
</thead>
<tbody>
[[if list.length > 0]]
[[each list as item index]]
[[if logList.length > 0]]
[[each logList as item index]]
<tr>
<td>[[item.retailPrice]]</td>
<td>[[item.salesPrice]]</td>
... ... @@ -396,6 +369,54 @@
</tbody>
</table>
</div>
<h2 style="color: #999; font-family: 'Microsoft YaHei'; font-size: 14px;">—— 变价计划表 ——</h2>
<div class="historyList">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>吊牌价</th>
<th>销售价</th>
<th>价格生效-<font color="green">开始时间</font></th>
<th>价格生效-<font color="red">结束时间</font></th>
<th>状态</th>
<th>变价申请时间</th>
<th>变价人</th>
<th>操作</th>
</tr>
</thead>
<tbody>
[[if planList.length > 0]]
[[each planList as item index]]
<tr>
<td>[[item.retailPrice]]</td>
<td>[[item.salesPrice]]</td>
<td>[[item.effectiveTime]]</td>
<td>[[item.changePriceEndTime]]</td>
<td>
[[if item.checkState == '101' ]] 待一审 [[/if]]
[[if item.checkState == '102' ]] 待二审 [[/if]]
[[if item.checkState == '103' ]] 待三审 [[/if]]
[[if item.checkState == '200' ]] 待生效 [[/if]]
[[if item.checkState == '201' ]] 生效 [[/if]]
[[if item.checkState == '202' ]] 已失效 [[/if]]
[[if item.checkState == '300' ]] 驳回 [[/if]]
</td>
<td>[[item.createTime]]</td>
<td>[[item.founderName]]</td>
<td>
[[if item.flag && item.flag == 1]]
<a data-planid="[[item.planId]]" data-skn="[[productSkn]]" href="javascript:;" class="btn btn-danger btn-xs deleteHistory">删除</a>
[[/if]]
</td>
</tr>
[[/each]]
[[else]]
<tr><td colspan="9">没有变价计划!</td></tr>
[[/if]]
</tbody>
</table>
</div>
</script>
<script type="text/template" id="template3">
... ...
... ... @@ -674,29 +674,29 @@ $(document).on('click', '.modify-btn', function() {
var $wrap = parentTr.next('.product-detail'),
$price = $wrap.find('.sale-price'),
$select = $wrap.find('.discount-select'),
$vipPrice = $wrap.find('.vip-price'),
$vip3Price = $wrap.find('.vip3-price'),
$vip2Price = $wrap.find('.vip2-price'),
$vip1Price = $wrap.find('.vip1-price'),
// $select = $wrap.find('.discount-select'),
// $vipPrice = $wrap.find('.vip-price'),
// $vip3Price = $wrap.find('.vip3-price'),
// $vip2Price = $wrap.find('.vip2-price'),
// $vip1Price = $wrap.find('.vip1-price'),
$student_price = $wrap.find('.student_price'),
$startDate = $wrap.find('.startDate'),
$endDate = $wrap.find('.endDate'),
$submitBtn = $wrap.find('.sure-modify'),
$planId = $wrap.find('.plan-id'),
$expectGrossProfitRate = $wrap.find('.expect_gross_profit_rate');
$select.val(data.vip_discount_type);
// $select.val(data.vip_discount_type);
vipPrice($wrap);
$select.on('change', function() {
vipPrice($wrap);
});
$vipPrice.on('blur', function() {
vipPrice($wrap);
});
$price.on('blur', function() {
vipPrice($wrap);
});
// vipPrice($wrap);
// $select.on('change', function() {
// vipPrice($wrap);
// });
// $vipPrice.on('blur', function() {
// vipPrice($wrap);
// });
// $price.on('blur', function() {
// vipPrice($wrap);
// });
$submitBtn.on('click', function() {
$submitBtn.attr('disabled', true);
if($price.val() != 0){
... ... @@ -705,11 +705,11 @@ $(document).on('click', '.modify-btn', function() {
data: {
product_skn: skn,
sales_price: $price.val(),
vip_discount_type: $select.val(),
vip_price: $vipPrice.val(),
vip1_price: $vip1Price.val(),
vip2_price: $vip2Price.val(),
vip3_price: $vip3Price.val(),
// vip_discount_type: $select.val(),
// vip_price: $vipPrice.val(),
// vip1_price: $vip1Price.val(),
// vip2_price: $vip2Price.val(),
// vip3_price: $vip3Price.val(),
student_price: $student_price.val(),
cgpriceStartTime:$startDate.val(),
cgpriceEndTime:$endDate.val(),
... ... @@ -1179,86 +1179,86 @@ var p = new common.grid({
}
return newPriceHtml + '<div style="color: #999;">' + item.oldProductPriceBo.sales_price + '</div>';
}},
{display: 'VIP折扣类型', render: function(item) {
return '<p>'+ENUM.vipType[item.newProductPriceBo.vip_discount_type] + '</p>'+
'<div style="color: #999;">' + ENUM.vipType[item.oldProductPriceBo.vip_discount_type] + '</div>';
}},
{display: 'VIP价', render: function(item) {
var newPrice = item.newProductPriceBo,
newPriceHtml = '';
if (newPrice.vip_price) {
if (newPrice.vip_price < (newPrice.retail_price / 2)) {
newPriceHtml = '<p style="color: red">' + newPrice.vip_price + '</p>';
}else{
newPriceHtml = '<p>'+newPrice.vip_price+'</p>';
}
} else {
newPriceHtml = '<p>-</p>'
}
if(item.oldProductPriceBo.vip_price){
newPriceHtml += '<div style="color: #999;">' + item.oldProductPriceBo.vip_price + '</div>';
}else{
newPriceHtml += '<div>-</div>';
}
return newPriceHtml;
}},
{display: '白金价', render: function(item) {
var newPrice = item.newProductPriceBo,
newPriceHtml = '';
if (newPrice.vip3_price){
if (newPrice.vip3_price < (newPrice.retail_price / 2)) {
newPriceHtml = '<p style="color: red">' + newPrice.vip3_price + '</p>';
}else{
newPriceHtml = '<p>'+newPrice.vip3_price+'</p>';
}
}else{
newPriceHtml = '<p>-</p>'
}
if(item.oldProductPriceBo.vip3_price){
newPriceHtml += '<div style="color: #999;">' + item.oldProductPriceBo.vip3_price + '</div>';
}else{
newPriceHtml += '<div>-</div>';
}
return newPriceHtml;
}},
{display: '金卡价', render: function(item) {
var newPrice = item.newProductPriceBo,
newPriceHtml = '';
if (newPrice.vip2_price){
if (newPrice.vip2_price < (newPrice.retail_price / 2)) {
newPriceHtml = '<p style="color: red">' + newPrice.vip2_price + '</p>';
}else {
newPriceHtml = '<p>'+newPrice.vip2_price+'</p>';
}
}else{
newPriceHtml = '<p>-</p>'
}
if(item.oldProductPriceBo.vip2_price){
newPriceHtml += '<div style="color: #999;">' + item.oldProductPriceBo.vip2_price + '</div>';
}else{
newPriceHtml += '<div>-</div>';
}
return newPriceHtml;
}},
{display: '银卡价', render: function(item) {
var newPrice = item.newProductPriceBo,
newPriceHtml = '';
if (newPrice.vip1_price){
if (newPrice.vip1_price < (newPrice.retail_price / 2)) {
newPriceHtml = '<p style="color: red">' + newPrice.vip1_price + '</p>';
}else{
newPriceHtml = '<p>'+newPrice.vip1_price+'</p>';
}
}else{
newPriceHtml = '<p>-</p>'
}
if(item.oldProductPriceBo.vip1_price){
newPriceHtml += '<div style="color: #999;">' + item.oldProductPriceBo.vip1_price + '</div>';
}else{
newPriceHtml += '<div>-</div>';
}
return newPriceHtml;
}},
// {display: 'VIP折扣类型', render: function(item) {
// return '<p>'+ENUM.vipType[item.newProductPriceBo.vip_discount_type] + '</p>'+
// '<div style="color: #999;">' + ENUM.vipType[item.oldProductPriceBo.vip_discount_type] + '</div>';
// }},
// {display: 'VIP价', render: function(item) {
// var newPrice = item.newProductPriceBo,
// newPriceHtml = '';
// if (newPrice.vip_price) {
// if (newPrice.vip_price < (newPrice.retail_price / 2)) {
// newPriceHtml = '<p style="color: red">' + newPrice.vip_price + '</p>';
// }else{
// newPriceHtml = '<p>'+newPrice.vip_price+'</p>';
// }
// } else {
// newPriceHtml = '<p>-</p>'
// }
// if(item.oldProductPriceBo.vip_price){
// newPriceHtml += '<div style="color: #999;">' + item.oldProductPriceBo.vip_price + '</div>';
// }else{
// newPriceHtml += '<div>-</div>';
// }
// return newPriceHtml;
// }},
// {display: '白金价', render: function(item) {
// var newPrice = item.newProductPriceBo,
// newPriceHtml = '';
// if (newPrice.vip3_price){
// if (newPrice.vip3_price < (newPrice.retail_price / 2)) {
// newPriceHtml = '<p style="color: red">' + newPrice.vip3_price + '</p>';
// }else{
// newPriceHtml = '<p>'+newPrice.vip3_price+'</p>';
// }
// }else{
// newPriceHtml = '<p>-</p>'
// }
// if(item.oldProductPriceBo.vip3_price){
// newPriceHtml += '<div style="color: #999;">' + item.oldProductPriceBo.vip3_price + '</div>';
// }else{
// newPriceHtml += '<div>-</div>';
// }
// return newPriceHtml;
// }},
// {display: '金卡价', render: function(item) {
// var newPrice = item.newProductPriceBo,
// newPriceHtml = '';
// if (newPrice.vip2_price){
// if (newPrice.vip2_price < (newPrice.retail_price / 2)) {
// newPriceHtml = '<p style="color: red">' + newPrice.vip2_price + '</p>';
// }else {
// newPriceHtml = '<p>'+newPrice.vip2_price+'</p>';
// }
// }else{
// newPriceHtml = '<p>-</p>'
// }
// if(item.oldProductPriceBo.vip2_price){
// newPriceHtml += '<div style="color: #999;">' + item.oldProductPriceBo.vip2_price + '</div>';
// }else{
// newPriceHtml += '<div>-</div>';
// }
// return newPriceHtml;
// }},
// {display: '银卡价', render: function(item) {
// var newPrice = item.newProductPriceBo,
// newPriceHtml = '';
// if (newPrice.vip1_price){
// if (newPrice.vip1_price < (newPrice.retail_price / 2)) {
// newPriceHtml = '<p style="color: red">' + newPrice.vip1_price + '</p>';
// }else{
// newPriceHtml = '<p>'+newPrice.vip1_price+'</p>';
// }
// }else{
// newPriceHtml = '<p>-</p>'
// }
// if(item.oldProductPriceBo.vip1_price){
// newPriceHtml += '<div style="color: #999;">' + item.oldProductPriceBo.vip1_price + '</div>';
// }else{
// newPriceHtml += '<div>-</div>';
// }
// return newPriceHtml;
// }},
{display: '操作', render: function(item) {
return '<a class="btn btn-danger btn-xs deleteImport" data-idx="' + item.__index + '" href="javascript:;">删除</a>';
}}
... ...