Authored by dongjunjie

代销变价新增学生价

module.exports={
namespace:"price",
apis:{
queryProductPriceList:{
title:'代销变价',
url:'/product/queryProductPriceList',
params: [
{name: 'product_skn',type: 'Number'},
{name: 'shop_id',type: 'Number'},
{name: 'brand_id',type: 'Number'},
{name: 'supplier_id',type: 'Number'},
{name: 'is_jit',type: 'String'},
{name: 'is_auditing',type: 'Number'},
{name: 'stock',type: 'Number'},
{name: 'gender',type: 'Number'},
{name: 'max_sort_id',type: 'Number'},
{name: 'middle_sort_id', type: 'Number'},
{name: 'small_sort_id', type: 'Number'},
{name: 'page', type: 'Number'},
{name: 'size', type: 'Number'}
]
},
getProductPrice:{
title:'获得单个变价详情',
url: '/product/getProductPrice',
params: [
{name: 'param', type: 'Number'}
]
},
updatePrice:{
title:'单个变价接口',
url: '/product/getProductPrice',
params: [
{name: 'product_skn', type: 'number'},
{name: 'sales_price', type: 'number'},
{name: 'vip_discount_type', type: 'number'},
{name: 'return_coin', type: 'number'},
{name: 'vip_price', type: 'number'},
{name: 'vip1_price', type: 'number'},
{name: 'vip2_price', type: 'number'},
{name: 'vip3_price', type: 'number'}
]
},
queryProductPriceListBySkn:{
title:'变价记录',
url: '/product/queryProductPriceListBySkn',
namespace:"price",
apis:{
queryProductPriceList:{
title:'代销变价',
url:'/product/queryProductPriceList',
params: [
{name: 'param', type: 'Number'}
{name: 'product_skn',type: 'Number'},
{name: 'shop_id',type: 'Number'},
{name: 'brand_id',type: 'Number'},
{name: 'supplier_id',type: 'Number'},
{name: 'is_jit',type: 'String'},
{name: 'is_auditing',type: 'Number'},
{name: 'stock',type: 'Number'},
{name: 'gender',type: 'Number'},
{name: 'max_sort_id',type: 'Number'},
{name: 'middle_sort_id', type: 'Number'},
{name: 'small_sort_id', type: 'Number'},
{name: 'page', type: 'Number'},
{name: 'size', type: 'Number'}
]
},
deletePricePlan:{
title:'删除变价记录',
url: '/product/deletePricePlan',
getProductPrice:{
title:'获得单个变价详情',
url: '/product/getProductPrice',
params: [
{name: 'param', type: 'Number'}
]
},
batchUpdateProductPrice:{
title:'批量变价接口',
url: '/product/batchUpdateProductPrice',
params: [
{name: 'batchList', type: 'String'},
{name: 'cgpriceStartTime', type: 'String'},
{name: 'cgpriceEndTime', type: 'String'}
]
},
updateProductPrice:{
title:'单个变价接口',
title:'单个变价接口',
url: '/product/updateProductPrice',
params: [
params: [
{name: 'product_skn', type: 'number'},
{name: 'sales_price', type: 'number'},
{name: 'vip_discount_type', type: 'number'},
... ... @@ -76,29 +39,53 @@ module.exports={
{name: 'vip1_price', type: 'number'},
{name: 'vip2_price', type: 'number'},
{name: 'vip3_price', type: 'number'},
{name: 'student_price', type: 'number'},
{name: 'cgpriceStartTime', type: 'String'},
{name: 'cgpriceEndTime', type: 'String'}
]
},
queryProductPriceListBySkn:{
title:'变价记录',
url: '/product/queryProductPriceListBySkn',
params: [
{name: 'param', type: 'Number'}
]
},
deletePricePlan:{
title:'删除变价记录',
url: '/product/deletePricePlan',
params: [
{name: 'param', type: 'Number'}
]
},
batchUpdateProductPrice:{
title:'批量变价接口',
url: '/product/batchUpdateProductPrice',
params: [
{name: 'batchList', type: 'String'},
{name: 'cgpriceStartTime', type: 'String'},
{name: 'cgpriceEndTime', type: 'String'}
]
},
queryBrandCooperationList:{
title:'品牌合作模式设置列表数据',
url: '/brandCooperation/queryBrandCooperationList',
params: [
{name: 'cooperateTypeId', type: 'Number'},
{name: 'brandId', type: 'number'},
{name: 'setFlag', type: 'Number'},
{name: 'page', type: 'Number'},
{name: 'size', type: 'Number'}
]
},
saveBrandCooperation:{
title:'修改合作模式',
url: '/brandCooperation/saveBrandCooperation',
params: [
{name: 'id', type: 'Number'},
{name: 'cooperateTypeId', type: 'String'},
{name: 'brandId', type: 'Number'}
]
}
}
]
},
queryBrandCooperationList:{
title:'品牌合作模式设置列表数据',
url: '/brandCooperation/queryBrandCooperationList',
params: [
{name: 'cooperateTypeId', type: 'Number'},
{name: 'brandId', type: 'number'},
{name: 'setFlag', type: 'Number'},
{name: 'page', type: 'Number'},
{name: 'size', type: 'Number'}
]
},
saveBrandCooperation:{
title:'修改合作模式',
url: '/brandCooperation/saveBrandCooperation',
params: [
{name: 'id', type: 'Number'},
{name: 'cooperateTypeId', type: 'String'},
{name: 'brandId', type: 'Number'}
]
}
}
}
\ No newline at end of file
... ...
... ... @@ -11,20 +11,20 @@
<div class="panel-col">
<select name="shop" id="shop" tabindex="-1" title="" class="form-control">
<option value="-1">请选择店铺</option>
</select>
<option value="-1">请选择店铺</option>
</select>
</div>
<div class="panel-col">
<select name="brand" id="brand" tabindex="-1" title="" class="form-control">
<option value="-1">请选择品牌</option>
</select>
<option value="-1">请选择品牌</option>
</select>
</div>
<div class="panel-col">
<select name="supplier" id="supplier" tabindex="-1" title="" class="form-control">
<option value="-1">请选择供应商</option>
</select>
<option value="-1">请选择供应商</option>
</select>
</div>
<div class="panel-col">
... ... @@ -32,7 +32,7 @@
<option value="-1">是否JIT商品</option>
<option value="Y"></option>
<option value="N"></option>
</select>
</select>
</div>
<div class="panel-col">
... ... @@ -40,7 +40,7 @@
<option value="-1">上架状态</option>
<option value="200">上架</option>
<option value="0">下架</option>
</select>
</select>
</div>
<div class="panel-col">
... ... @@ -48,7 +48,7 @@
<option value="-1">库存情况</option>
<option value="1">有库存</option>
<option value="0">无库存</option>
</select>
</select>
</div>
<div class="panel-col">
... ... @@ -57,7 +57,7 @@
<option value="1"></option>
<option value="2"></option>
<option value="3">通用</option>
</select>
</select>
</div>
<div class="panel-col2">
... ... @@ -95,7 +95,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、吊牌价、销售价、学生价、VIP折扣类型、VIP价、白金价、金卡价、银卡价</span><br>
3、第一行为表头内容,第二行开始为正式内容<br>
4、每个文件控制在2500行以内<br>
5、<a href="/ajax/link/batchUpdatePrice" style="margin: 0; text-decoration: underline">下载样例.xlsx</a>
... ... @@ -145,10 +145,8 @@
<tr>
<th style="border-top: 0; border-left: 0">销售价</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>
<th style="border-top: 0">进货价</th>
<th style="border-top: 0">进货折扣</th>
... ... @@ -169,16 +167,33 @@
</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}" disabled>
</td>
<td style="border-bottom: 0">
<input class="vip2-price form-control" type="text" value="{vip2_price}" disabled>
<div class="form-inline" style="margin-bottom: 5px">
<div class="form-group">
<label style="width: 60px; text-align: right">VIP价:</label>
<input class="vip-price form-control" type="text" value="{vip_price}" onkeyup="this.value=this.value.replace(/\D/gi,'')">
</div>
</div>
<div class="form-inline" style="margin-bottom: 5px">
<div class="form-group">
<label style="width: 60px; text-align: right">白金价:</label>
<input class="vip3-price form-control" type="text" value="{vip3_price}" disabled>
</div>
</div>
<div class="form-inline" style="margin-bottom: 5px">
<div class="form-group">
<label style="width: 60px; text-align: right">金卡价:</label>
<input class="vip2-price form-control" type="text" value="{vip2_price}" disabled>
</div>
</div>
<div class="form-inline">
<div class="form-group">
<label style="width: 60px; text-align: right">银卡价:</label>
<input class="vip1-price form-control" type="text" value="{vip1_price}" disabled>
</div>
</div>
</td>
<td style="border-bottom: 0">
<input class="vip1-price form-control" type="text" value="{vip1_price}" disabled>
<input class="student_price form-control" type="text" value="{student_price}" onkeyup="this.value=this.value.replace(/\D/gi,'')">
</td>
<td class="form-inline" style="border-bottom: 0">
<input id="start_{product_skn}" jsaction="date:end:end_{product_skn}" class="startDate form-control" type="text" value="{cgpriceStartTime}" placeholder="开始日期" style='background-color:#fff'>
... ... @@ -207,16 +222,16 @@
</tr>
</thead>
<tbody>
<tr>
<td>[[productSkn]]</td>
<td>[[goodsName]]</td>
<td>[[brandName]]</td>
<td>
[[maxSortName]]
[[if midleSortName]]&nbsp;>&nbsp;[[midleSortName]][[/if]]
[[if smallSortName]]&nbsp;>&nbsp;[[smallSortName]][[/if]]
</td>
</tr>
<tr>
<td>[[productSkn]]</td>
<td>[[goodsName]]</td>
<td>[[brandName]]</td>
<td>
[[maxSortName]]
[[if midleSortName]]&nbsp;>&nbsp;[[midleSortName]][[/if]]
[[if smallSortName]]&nbsp;>&nbsp;[[smallSortName]][[/if]]
</td>
</tr>
</tbody>
</table>
</div>
... ... @@ -227,6 +242,7 @@
<tr>
<th>吊牌价</th>
<th>销售价</th>
<th>学生价</th>
<th>价格生效-<font color="green">开始时间</font></th>
<th>价格生效-<font color="red">结束时间</font></th>
<th>变价时间</th>
... ... @@ -235,25 +251,26 @@
</tr>
</thead>
<tbody>
[[if list.length > 0]]
[[each list as item index]]
<tr>
<td>[[item.retailPrice]]</td>
<td>[[item.salesPrice]]</td>
<td>[[item.effectiveTime]]</td>
<td>[[item.changePriceEndTime]]</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="7">没有变价记录!</td></tr>
[[/if]]
[[if list.length > 0]]
[[each list as item index]]
<tr>
<td>[[item.retailPrice]]</td>
<td>[[item.salesPrice]]</td>
<td>[[item.studentPrice]]</td>
<td>[[item.effectiveTime]]</td>
<td>[[item.changePriceEndTime]]</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="7">没有变价记录!</td></tr>
[[/if]]
</tbody>
</table>
</div>
... ...
... ... @@ -96,6 +96,7 @@ var g = new common.grid({
}},
{display: '吊牌价', name: 'retail_price'},
{display: '销售价', name: 'sales_price'},
{display: '学生价', name: 'student_price'},
{display: 'VIP折扣类型', render: function(item) {
return ENUM.vipType[item.vip_discount_type];
}},
... ... @@ -173,6 +174,7 @@ $(document).on('click', '.modify-btn', function() {
$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');
... ... @@ -200,6 +202,7 @@ $(document).on('click', '.modify-btn', function() {
vip1_price: $vip1Price.val(),
vip2_price: $vip2Price.val(),
vip3_price: $vip3Price.val(),
student_price: $student_price.val(),
cgpriceStartTime:$startDate.val(),
cgpriceEndTime:$endDate.val()
}
... ... @@ -319,6 +322,25 @@ var p = new common.grid({
}
return newPriceHtml + '<div style="color: #999;">' + item.oldProductPriceBo.sales_price + '</div>';
}},
{display: '学生价', render: function(item) {
var newPrice = item.newProductPriceBo,
newPriceHtml = '';
if (newPrice.student_price) {
if (newPrice.student_price < (newPrice.retail_price / 2)) {
newPriceHtml = '<p style="color: red">' + newPrice.student_price + '</p>';
}else{
newPriceHtml = '<p>'+newPrice.student_price+'</p>';
}
} else {
newPriceHtml = '<p>-</p>'
}
if(item.oldProductPriceBo.student_price){
newPriceHtml += '<div style="color: #999;">' + item.oldProductPriceBo.student_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>';
... ...