Authored by chenchao

1. move import student price 2 list page

2. add student price list page
... ... @@ -109,14 +109,7 @@ module.exports=function(app) {
}
});
/*批量修改学生价格*/
app.get("/supplier/baseproduct/batchUpdateStudentPrice","goods.batchUpdateStudentPrice.Batch",function(){
this.$extend={
moduleName:"基础商品",
pageName:"批量修改学生价",
isPL:true
}
});
/*通过任务ID查看任务是否被执行完 学生价变价*/
app.post("/product/queryBatchImportStudentPriceResult","basegoods_queryBatchUpdateStudentPriceResult");
... ...
... ... @@ -21,4 +21,27 @@ module.exports=function(app) {
/*驳回*/
app.post("/goods/price/reject","price_auditRejectProductPrice");
/*批量修改学生价格*/
app.get("/supplier/baseproduct/batchUpdateStudentPrice","goods.batchUpdateStudentPrice.Batch",function(){
this.$extend={
moduleName:"基础商品",
pageName:"批量修改学生价",
isPL:true
}
});
/*学生价格列表页*/
app.get("/goods/studentPrice/index","goods.studentPrice.Index",function(){
this.$extend={
moduleName:"基础商品",
pageName:"学生价管理",
isPL:true
}
});
/*学生价列表数据*/
app.post("/goods/studentPrice/list","price_queryStudentPriceList");
}
\ No newline at end of file
... ...
... ... @@ -93,6 +93,18 @@ module.exports={
{name: 'cooperateTypeId', type: 'String'},
{name: 'brandId', type: 'Number'}
]
},
queryStudentPriceList:{
title:'学生价管理',
url:'/product/queryStudentPriceList',
params: [
{name: 'product_skn',type: 'Number'},
{name: 'shop_id',type: 'Number'},
{name: 'brand_id',type: 'Number'},
{name: 'studentPriceValScope',type: 'Number'},
{name: 'page', type: 'Number'},
{name: 'size', type: 'Number'}
]
}
}
}
\ No newline at end of file
... ...
<%include '../../../common/views/__ui/header'%>
<%include '../../../common/views/__partail/ListHeader'%>
<div class="contentpanel">
<div class="panel panel-default" id="priceChangeSearch" style="margin-bottom:10px;">
<div class="panel-body">
<div class="row">
<div class="panel-col">
<input id="skn" class="form-control panel-input height40" type="text" placeholder="请输入SKN" onkeyup="this.value=this.value.replace(/\D/gi,'')">
</div>
<input type="hidden" id='authority' value="<%auditAuthority.authority%>" />
<div class="panel-col">
<select name="shop" id="shop" tabindex="-1" title="" class="form-control">
<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>
</div>
<div class="panel-col">
<select name="supplier" id="supplier" tabindex="-1" title="" class="form-control">
<option value="-1">请选择供应商</option>
</select>
</div>
<div class="panel-col">
<select name="cooperationType" id="cooperationType" tabindex="-1" title="" class="form-control">
<option value="3">全部</option>
<option value="2">有学生价</option>
<option value="1">无学生价</option>
</select>
</div>
<div class="panel-col">
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
</div>
<div class="panel-col" style="margin: 0 0 0 -5px;">
<a id="import-btn" href="javascript:;" class="btn btn-primary">批量导入</a>
</div>
</div>
</div>
</div>
<div class="panel panel-primary-head">
<div class="dataTab_wrapper" id="basicTable"></div>
</div>
</div>
<%include '../../../common/views/__ui/footer'%>
\ No newline at end of file
... ...
'use strict';
var $ = require('jquery'),
common = require('../../../common/common');
/***********************变价列表***********************/
new common.dropDown({
el: '#shop',
ajax: 'shopsRest'
});
new common.dropDown({
el: '#supplier',
ajax: 'querySupplier'
});
new common.dropDown({
el: '#brand',
ajax: 'brand',
params:function(){
return {userLimitFlag:true};
}
});
var ENUM = {
vipType: {
1: '正常折扣',
2: '统一折扣',
3: '无折扣',
4: '固定折扣',
5: '自定义折扣'
}
};
loadTab();
// 对float数字进行精度控制,保留小数点后4位
// 暂只支持字符串
var formatFloat = function(num) {
var number = parseFloat(num);
if (isNaN(number))
return "";
return Math.round(number * 10000) / 10000;
}
var g = new common.grid({
el: "#basicTable",
usepagesize:true,
parms: function() {
return {
product_skn: common.util.__input("skn"),
shop_id: common.util.__input("shop"),
brand_id: common.util.__input("brand"),
studentPriceValScope: common.util.__input("studentPriceValScope")
}
},
columns: [
{display: '商品信息', render: function(item) {
var html = '<p>SKN:'+item.product_skn +'</p><p>名称:' + item.product_name + '</p><p>品牌:' + item.brand_name + '</p>' +
'<div>类目:'+'<br>'+ item.max_sort_name;
if(item.middle_sort_name) {html += '&nbsp;>&nbsp;' + item.middle_sort_name;}
if(item.small_sort_name) {html += '&nbsp;>&nbsp;' + item.small_sort_name;}
html += "</div><p>";
html += '<p>性别:'+ENUM.gender[item.gender]+'</p>';
html += '<p>货品年:'+item.goodsYears+'</p>';
html += '<p>货品季:'+ENUM.goodsSeason[item.goodsSeason]+'</p>';
return html;
}},
{display: '供应商/店铺', render: function(item) {
var html = '';
if (item.supplier_name) {
html += item.supplier_name;
if (item.shop_name) {html += '/';}
}
if (item.shop_name) {html += item.shop_name;}
return html;
}},
{display: '当前售价', render: function(item) {
var html = '<p>吊牌价:'+item.retail_price +'</p>';
html += '<p>销售价:'+item.sales_price +'</p>';
if (item.student_price) {html += '<p>学生价:'+item.student_price +'</p>';}
return html;
}},
{display: 'VIP折扣类型', render: function(item) {
return ENUM.vipType[item.vip_discount_type];
}},
{display: '会员价', render: function(item) {
var html = '<p>VIP价:';
if(item.vip_price) html += item.vip_price +'</p>';
else html += '</p>';
html += '<p>白金:'+'<br>';
if(item.vip3_price) html += item.vip3_price +'</p>';
else html += '</p>';
html += '<p>金卡:'+'<br>';
if(item.vip2_price) html += item.vip2_price +'</p>';
else html += '</p>';
html += '<p>银卡:'+'<br>';
if(item.vip1_price) html += item.vip1_price +'</p>';
else html += '</p>';
return html;
}}
]
});
g.init('/goods/studentPrice/list');
//筛选
$(document).on('click', '#filter-btn', function () {
g.reload(1);
loadTab();
});
//回车筛选
$(document).on('keyup', 'body', function (event) {
if (event.keyCode == 13) {
$("#filter-btn").trigger('click');
}
});
//全部
$(document).on('click', '#all-btn', function () {
location.href = '';
});
/***********************批量功能***********************/
//批量导入按钮点击事件
$(document).on('click', '#import-btn', function () {
location.href="/supplier/baseproduct/batchUpdateStudentPrice";
});
\ No newline at end of file
... ...