|
|
'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 += ' > ' + item.middle_sort_name;}
|
|
|
if(item.small_sort_name) {html += ' > ' + 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 |
...
|
...
|
|