Authored by liuyue

网销

... ... @@ -227,6 +227,14 @@ toast._through = function() {
var api = new toast(arguments[0]);
return api;
};
toast.open = function(options, callback) {
return this._through({
title: options.title,
addClass: options.addClass,
width: options.width,
content: options.content
});
}
toast.alert = function(content, callback) {
var __self = this,
_o = __self.options;
... ... @@ -263,8 +271,7 @@ toast.load = function() {
_o = __self.options;
return __self._through({
addClass: 'load',
template: ''
addClass: 'load'
});
};
toast.tip = function(content, time) {
... ...
... ... @@ -24,7 +24,7 @@ require('../util/jquery.simplePagination');
var grid = function(options) {
var defaults = {
hash: true,
size: 10,
//size: 10,
innerHtml: "<div class='grid'><table class='table table-striped table-bordered responsive dataTable no-footer' role='grid' aria-describedby='basicTable_info'>" + "<thead></thead><tbody></tbody></table></div>" + "<nav><ul class='pagination'></ul></nav>",
tabUrl: false
}
... ... @@ -105,6 +105,7 @@ grid.prototype = {
});
if (!p.page && !urlParam.page) p.page = 1;
if (!p.size && !urlParam.size) p.size = 10;
if (param.page !== p.page) {
param.page = p.page;
... ... @@ -112,7 +113,10 @@ grid.prototype = {
param.page = urlParam.page;
}
param.size = p.size;
if (param.size == p.size) {
param.size = urlParam.size;
}
var urlHash = '';
$.each(param, function(key, value) {
... ... @@ -123,6 +127,7 @@ grid.prototype = {
if (p.hash) {
location.hash = urlHash;
}
return param;
},
__pagination: function(pagination) {
... ...
'use strict';
var $ = require('jquery'),
common = require('../common/common');
common.edit.ajaxfileupload(".batch-file", {
params: {
type: $(this).data('type'),
__type: "batch-import"
},
onStart: function() {
},
onComplete: function(response) {
}
});
\ No newline at end of file
... ...
... ... @@ -2,18 +2,37 @@
var $ = require('jquery'),
common = require('../common/common');
var ENUM = {
gender: {
1: '男',
2: '女',
3: '通用'
},
ageLevel: {
1: '成人',
2: '大童',
3: '小童'
},
status: {
'-1': '待上架',
'2': '待审核',
'3': '驳回',
'4': '通过',
'1': '已上架',
'0': '已下架',
'5': '再上架待审核',
'6': '再上架驳回',
'7': '再上架通过'
},
attribute: {
1: '普通',
2: '赠品'
}
}
};
var g = new common.grid({
el: "#basicTable",
parms: function() {
return {
productSkn: common.util.__input("productSkn"),
productSkc: common.util.__input("productSkc"),
... ... @@ -31,7 +50,7 @@ var g = new common.grid({
smallSortId: common.util.__input("smallSortId"),
isOutLets: common.util.__input("isOutLets"),
productStatus: common.util.__input("productStatus"),
isScreen: common.util.__input("isScreen")
size: common.util.__input("size")
};
},
columns: [{
... ... @@ -68,27 +87,33 @@ var g = new common.grid({
display: '年龄层/性别',
name: 'vip_discount_type',
render: function(item) {
return ENUM.gender[item.gender];
return ENUM.ageLevel[item.ageLevel] + '/' + ENUM.gender[item.gender];
}
}, {
display: '商品类别',
name: 'vip_price'
name: 'attribute', //商品属性(1普通、2赠品等) 商品类别
render: function(item) {
return ENUM.attribute[item.attribute];
}
}, {
display: '操作信息',
render: function(item) {
var html = '';
if (item.founder_name) {
html += '<p>' + item.founder_name + '</p>';
if (item.founderName) {
html += '<p>' + item.founderName + '</p>';
}
if (item.updateTime) {
html += '<p>' + item.updateTime + '</p>';
if (item.editTime) {
html += '<p>' + item.editTime + '</p>';
}
return html;
}
}, {
display: '上架状态',
name: 'vip2_price'
name: 'status', // -1待上架,2待审核,3驳回,4通过,1已上架,0已下架,5再上架待审核,6再上架驳回,7再上架通过。
render: function(item) {
return ENUM.status[item.status];
}
}, {
display: '操作',
render: function(item) {
... ... @@ -98,9 +123,65 @@ var g = new common.grid({
}
}]
});
g.init($("#gridurl").val());
//筛选
$("#filter-btn").click(function() {
g.reload(1);
});
/*
* 上架下架弹框
* params: title(弹框标题), html(弹框内容html)
*/
function shelveModal(title, html) {
var selectedArr = g.selected,
len = selectedArr.length,
productSknList = [],
shelveModal = null;
if (len <= 0) {
common.util.__tip('请选择要' + title + '的商品', 'warning');
return;
}
$.each(selectedArr, function(i, value) {
productSknList.push(value['productSkn']);
});
shelveModal = common.dialog.open({
title: '上架',
content: html
});
var e = new common.edit('.shelve-form');
e.init();
$('.shelve-form').on('click', '.btn', function() {
var type = $(this).data('type');
$(this).closest('.form-group').find('input').attr('required', true)
.end().siblings('.form-group').find('input').attr('required', false);
e.submit('/goods/product/updateProductSknTimingInfo', function(option) {
option.data.productSknList = JSON.stringify(productSknList);
option.data.type = type;
option.success = function(res) {
if (res.data.code == 200) {
e.$tip(res.data.message, function() {
shelveModal.close();
}, 'growl-success');
} else {
e.$tip(res.data.message);
}
}
});
});
}
//上架
$('#onshelve').on('click', function() {
shelveModal('上架', $('#onshelve-template').html());
});
//下架
$('#offshelve').on('click', function() {
shelveModal('下架', $('#offshelve-template').html());
});
\ No newline at end of file
... ...
exports.domain = require('../config/common.js').domain;
//exports.domain = 'http://172.16.6.227:8083/yohobuy-platform-web'; //变价
//exports.domain = require('../config/common.js').domain;
exports.domain = 'http://172.16.6.227:8083/yohobuy-platform-web'; //变价
//exports.domain = 'http://172.16.6.162:8088/platform'; //品牌合作
//商品管理路由配置
... ... @@ -121,6 +121,44 @@ exports.res = [
type: 'number'
}, ]
}, {
//网销信息 -> 批量skn处理
route: '/goods/product/updateProductSknTimingInfo',
method: 'POST',
url: '/product/updateProductSknTimingInfo',
params: [{
name: 'productSknList',
type: 'string'
}, {
name: 'type',
type: 'number'
}, {
name: 'outSaleTime',
type: 'number'
}, {
name: 'shelveTime',
type: 'string'
}, {
name: 'onNewTime',
type: 'string'
}, {
name: 'advanceBeginTime',
type: 'string'
}, {
name: 'advanceEndTime',
type: 'string'
}]
}, {
//网销信息 -> 批量页面渲染
route: '/goods/netsale/batch',
method: 'GET',
view: 'pages/goods/netsale-batch',
src: '/goods/netsale-batch',
data: {
secondTitle: '网销信息',
pageTitle: '批量设置',
domain: exports.domain,
}
}, {
//网销信息 -> 编辑页页面渲染
route: '/goods/netsale/edit/:param',
method: 'GET',
... ...
<div class="pageheader">
<div class="media">
<div class="pageicon pull-left">
<i class="fa fa-th-list"></i>
</div>
<div class="media-body">
<ul class="breadcrumb">
<li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
<li><a href="">商品管理</a></li>
<li>
{{# secondTitle}}{{.}}{{/ secondTitle}}
{{^ secondTitle}}{{pageTitle}}{{/ secondTitle}}
</li>
</ul>
<div>
<div style="width: 30%;float: left;">
<h4>{{pageTitle}}</h4>
</div>
</div>
</div>
</div>
</div>
<div class="contentpanel">
<div class="panel panel-default" style="margin-bottom:10px;">
<div class="panel-body">
<table class="table table-bordered">
<tr>
<td rowspan="2">排序</td>
<td>上传EXCEL:</td>
<td><input class="batch-file" data-type="searchSort" type="file" style="opacity: 1; width: auto; height: auto; position: static;"></td>
</tr>
<tr>
<td>说明:</td>
<td colspan="2">
1、上传文件必须是<span style="color:red;">.xlsx</span>文件<br>
2、Excel表头为:<span style="color: #67D267;">SKN、模块ID(品牌设置:1;奥莱设置:2;搜索设置:3)、排序值</span><br>
3、第一行为表头内容,第二行开始为正式内容<br>
4、每个文件控制在2500行以内<br>
5、<a href="{{domain}}/common/searchSort.xlsx">下载样例</a>
</td>
</tr>
<tr>
<td rowspan="2">品牌款型系列</td>
<td>上传EXCEL:</td>
<td><input class="batch-file" data-type="brandProperty" type="file" style="opacity: 1; width: auto; height: auto; position: static;"></td>
</tr>
<tr>
<td>说明:</td>
<td colspan="2">
1、上传文件必须是<span style="color:red;">.xlsx</span>文件<br>
2、Excel表头为:<span style="color: #67D267;">SKN、品牌款型系列名称、类型</span><br>
3、第一行为表头内容,第二行开始为正式内容<br>
4、每个文件控制在500行以内<br>
5、<a href="{{domain}}/common/brandModelSeries.xlsx">下载样例</a>
</td>
</tr>
</table>
</div>
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -27,43 +27,43 @@
<div class="panel-body">
<div class="row">
<div class="panel-col">
<input id="productSkn" class="form-control panel-input height40" type="text" placeholder="请输入SKN" onkeyup="this.value=this.value.replace(/\D/gi,'')">
<input id="productSkn" class="form-control panel-input" type="text" placeholder="请输入SKN" onkeyup="this.value=this.value.replace(/\D/gi,'')">
</div>
<div class="panel-col">
<input id="skc" class="form-control panel-input height40" type="text" placeholder="请输入SKC" onkeyup="this.value=this.value.replace(/\D/gi,'')">
<input id="productSkc" class="form-control panel-input" type="text" placeholder="请输入SKC" onkeyup="this.value=this.value.replace(/\D/gi,'')">
</div>
<div class="panel-col">
<input id="sku" class="form-control panel-input height40" type="text" placeholder="请输入SKU" onkeyup="this.value=this.value.replace(/\D/gi,'')">
<input id="productSku" class="form-control panel-input" type="text" placeholder="请输入SKU" onkeyup="this.value=this.value.replace(/\D/gi,'')">
</div>
<div class="panel-col">
<input id="productName" class="form-control panel-input height40" type="text" placeholder="商品名称">
<div class="panel-col2">
<input id="productName" class="form-control panel-input" type="text" placeholder="商品名称">
</div>
<div class="panel-col2">
<select name="shop" id="shop" tabindex="-1" title="" class="form-control height40">
<select name="shopId" id="shopId" 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 height40">
<select name="brandId" id="brandId" tabindex="-1" title="" class="form-control">
<option value="-1">请选择品牌</option>
</select>
</div>
<div class="panel-col">
<select name="stock" id="stock" tabindex="-1" title="" class="form-control height40">
<select name="stock" id="stock" tabindex="-1" title="" class="form-control">
<option value="-1">库存情况</option>
<option value="1">有库存</option>
<option value="0">无库存</option>
</select>
</div>
<div class="panel-col">
<select name="shoot" id="shoot" tabindex="-1" title="" class="form-control height40">
<select name="isScreen" id="isScreen" tabindex="-1" title="" class="form-control height40">
<option value="-1">拍摄状态</option>
<option value="1">已拍摄</option>
<option value="0">未拍摄</option>
</select>
</div>
<div class="panel-col">
<select name="clstatus" id="clstatus" tabindex="-1" title="" class="form-control height40">
<select name="isMeasure" id="isMeasure" tabindex="-1" title="" class="form-control height40">
<option value="-1">测量状态</option>
<option value="1">已测量</option>
<option value="0">未测量</option>
... ... @@ -78,34 +78,34 @@
</select>
</div>
<div class="panel-col">
<select name="cate1" id="cate1" tabindex="-1" title="" class="form-control height40">
<select name="maxSortId" id="maxSortId" tabindex="-1" title="" class="form-control height40">
<option value="-1">请选择一级类目</option>
</select>
</div>
<div class="panel-col">
<select name="cate2" id="cate2" tabindex="-1" title="" class="form-control height40">
<select name="middleSortId" id="middleSortId" tabindex="-1" title="" class="form-control height40">
<option value="-1">请选择二级类目</option>
</select>
</div>
<div class="panel-col">
<select name="cate3" id="cate3" tabindex="-1" title="" class="form-control height40">
<select name="smallSortId" id="smallSortId" tabindex="-1" title="" class="form-control height40">
<option value="-1">请选择三级类目</option>
</select>
</div>
<div class="panel-col">
<!-- <div class="panel-col">
<select name="cate4" id="cate4" tabindex="-1" title="" class="form-control height40">
<option value="-1">请选择四级类目</option>
</select>
</div>
</div> -->
<div class="panel-col">
<select name="aolai" id="aolai" tabindex="-1" title="" class="form-control height40">
<select name="isOutLets" id="isOutLets" tabindex="-1" title="" class="form-control height40">
<option value="-1">是否奥莱</option>
<option value="1">奥莱</option>
<option value="0">菲奥莱</option>
</select>
</div>
<div class="panel-col">
<select name="status" id="status" tabindex="-1" title="" class="form-control height40">
<select name="productStatus" id="productStatus" tabindex="-1" title="" class="form-control height40">
<option value="-1">状态</option>
<option value="1">待上架</option>
<option value="0">待审核</option>
... ... @@ -120,14 +120,14 @@
</div>
<div class="panel-col">
<select name="jit" id="jit" tabindex="-1" title="" class="form-control height40">
<select name="isJit" id="isJit" tabindex="-1" title="" class="form-control">
<option value="-1">是否JIT商品</option>
<option value="Y"></option>
<option value="N"></option>
</select>
</div>
<div class="panel-col">
<select name="size" id="size" tabindex="-1" title="" class="form-control height40">
<select name="size" id="size" tabindex="-1" title="" class="form-control">
<option value="10">单页显示条数</option>
<option value="10">10条</option>
<option value="20">20条</option>
... ... @@ -136,17 +136,17 @@
<option value="100">100条</option>
</select>
</div>
<div class="panel-col height40">
<div class="panel-col">
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="all-btn" href="javascript:;" class="btn btn-info">全部</a>
<a id="all-btn" href="" class="btn btn-info">全部</a>
</div>
</div>
<div class="row" style="margin: 0 0 0 -5px;">
<a id="" href="javascript:;" class="btn btn-default">上架</a>
<a id="" href="javascript:;" class="btn btn-default">下架</a>
<a id="" href="javascript:;" class="btn btn-default">导出</a>
<a id="import-btn" href="javascript:;" class="btn btn-info">批量(排序、款型系列)</a>
<a id="onshelve" href="javascript:;" class="btn btn-default">上架</a>
<a id="offshelve" href="javascript:;" class="btn btn-default">下架</a>
<a id="export-btn" href="javascript:;" class="btn btn-default">导出</a>
<a id="import-btn" href="/goods/netsale/batch" class="btn btn-info">批量(排序、款型系列)</a>
</div>
</div>
</div>
... ... @@ -155,4 +155,51 @@
</div>
</div>
<input type="hidden" id="gridurl" value="{{gridurl}}">
\ No newline at end of file
<input type="hidden" id="gridurl" value="{{gridurl}}">
<script type="text/template" id="onshelve-template">
<form class="shelve-form form-horizontal form-bordered">
<div class="panel panel-default">
<div class="panel-body nopadding">
<div class="form-group">
<a class="btn btn-info" data-type="2" href="javascript:;">上架上新</a>
<a class="btn btn-info" data-type="1" href="javascript:;">上架不上新</a>
</div>
<div class="form-group">
<div class="col-sm-3 height40">预计上架时间:</div>
<div class="col-sm-6"><input id="shelveTime" class="form-control" jsaction="time" type="text" placeholder="预上架时间" readonly></div>
<div class="col-sm-1"><a class="btn btn-info" data-type="3" href="javascript:;">确定</a></div>
</div>
<div class="form-group">
<div class="col-sm-3 height40">预计上架上新时间:</div>
<div class="col-sm-6"><input id="onNewTime" class="form-control" jsaction="time" type="text" placeholder="预计上架上新时间" readonly></div>
<div class="col-sm-1"><a class="btn btn-info" data-type="4" href="javascript:;">确定</a></div>
</div>
<div class="form-group">
<div class="col-sm-2 height40">预售时间:</div>
<div class="col-sm-4"><input id="advanceBeginTime" class="form-control" jsaction="time:end:advanceEndTime" type="text" placeholder="预售开始时间" readonly></div>
<div class="col-sm-4"><input id="advanceEndTime" class="form-control" jsaction="time:start:advanceBeginTime" type="text" placeholder="预售结束时间" readonly></div>
<div class="col-sm-1"><a class="btn btn-info" data-type="5" href="javascript:;">确定</a></div>
</div>
</div>
</div>
</form>
</script>
<script type="text/template" id="offshelve-template">
<form class="shelve-form form-horizontal form-bordered">
<div class="panel panel-default">
<div class="panel-body nopadding">
<div class="form-group">
<a class="btn btn-info" data-type="7" href="javascript:;">立即下架</a>
</div>
<div class="form-group">
<div class="col-sm-3 height40">预计下架时间:</div>
<div class="col-sm-4">售罄<input id="outSaleTime" class="form-control" type="text" style="display:inline-block;width:60px;" value="0">天下架</div>
<div class="col-sm-1"><a class="btn btn-info" data-type="6" href="javascript:;">确定</a></div>
</div>
</div>
</div>
</form>
</script>
\ No newline at end of file
... ...