Authored by liuyue

网销

... ... @@ -271,7 +271,8 @@ toast.load = function() {
_o = __self.options;
return __self._through({
addClass: 'load'
addClass: 'load',
template: ''
});
};
toast.tip = function(content, time) {
... ...
... ... @@ -2,15 +2,34 @@
var $ = require('jquery'),
common = require('../common/common');
common.edit.ajaxfileupload(".batch-file", {
params: {
type: $(this).data('type'),
__type: "batch-import"
},
onStart: function() {
$('input[type="file"]').after('<div class="file-name btn btn-default">请选择文件</div>');
},
onComplete: function(response) {
function batchExport(el, type) {
var loadModal = null;
return {
params: {
type: type,
__type: "batch-import"
},
onStart: function() {
loadModal = common.dialog.load();
$(el).parents('td').find('.file-name').text($(el).val().replace("C:\\fakepath\\", ""));
},
onComplete: function(response) {
console.log(response);
if (loadModal) {
loadModal.close();
}
if (response.code == 200) {
common.util.__tip(response.message, 'success');
} else {
common.util.__tip(response.message, 'warning');
}
}
}
});
\ No newline at end of file
}
common.edit.ajaxfileupload('#sort-file', batchExport('#sort-file', 'searchSort'));
common.edit.ajaxfileupload('#brand-file', batchExport('#brand-file', 'brandProperty'));
\ No newline at end of file
... ...
... ... @@ -27,9 +27,44 @@ var ENUM = {
attribute: {
1: '普通',
2: '赠品'
},
tab: {
'0': 0,
'1': 0,
'2': 0,
'3': 0,
'all': 0
}
};
var t = new common.tab({
el: "#basicTab",
click: function() {
g.reload(1);
},
columns: [{
name: "0",
value: '-1,3',
display: "上架前"
}, {
name: "1",
value: '4,1,0,5,6',
display: "上架后"
}, {
name: "2",
value: '1',
display: "搜索/标签"
}, {
name: "3",
value: '1',
display: "上架后信息缺失"
}, {
name: "all",
value: '',
display: "全部商品"
}]
}).init();
var g = new common.grid({
el: "#basicTable",
parms: function() {
... ... @@ -50,7 +85,8 @@ var g = new common.grid({
smallSortId: common.util.__input("smallSortId"),
isOutLets: common.util.__input("isOutLets"),
productStatus: common.util.__input("productStatus"),
size: common.util.__input("size")
size: common.util.__input("size"),
productStatusStr: t.value
};
},
columns: [{
... ... @@ -112,14 +148,27 @@ var g = new common.grid({
display: '上架状态',
name: 'status', // -1待上架,2待审核,3驳回,4通过,1已上架,0已下架,5再上架待审核,6再上架驳回,7再上架通过。
render: function(item) {
return ENUM.status[item.status];
var html = '';
html += ENUM.status[item.status];
if (item.shelveTime) {
html += '<br>上架时间:' + item.shelveTime;
}
return html;
}
}, {
display: '操作',
render: function(item) {
return '<a href="/goods/netsale/edit/' + item.productSkn + '" class="btn btn-info btn-xs edit-btn">编辑</a>' +
'<a href="javascript:;" class="btn btn-info btn-xs edit-btn">上架</a>' +
'<a href="javascript:;" class="btn btn-info btn-xs info-btn">查看</a>';
var HtmArr = [];
if (item.status == 1) {
HtmArr.push('<a href="/goods/netsale/edit/' + item.productSkn + '" class="btn btn-info btn-xs edit-btn">编辑</a>');
HtmArr.push('<a href="javascript:;" class="btn btn-danger btn-xs offshelve-btn">下架</a>');
} else if (item.status != 2 && item.status != 5) {
HtmArr.push('<a href="/goods/netsale/edit/' + item.productSkn + '" class="btn btn-info btn-xs edit-btn">编辑</a>');
HtmArr.push('<a href="javascript:;" class="btn btn-success btn-xs onshelve-btn">上架</a>');
}
HtmArr.push('<a href="javascript:;" class="btn btn-info btn-xs info-btn">查看</a>');
return HtmArr.join('');
}
}]
});
... ... @@ -184,4 +233,9 @@ $('#onshelve').on('click', function() {
//下架
$('#offshelve').on('click', function() {
shelveModal('下架', $('#offshelve-template').html());
});
//导出
$('#export-btn').on('click', function() {
});
\ No newline at end of file
... ...
... ... @@ -109,7 +109,7 @@ exports.res = [
type: 'number'
}, {
name: 'isOutLets',
type: 'number'
type: 'string'
}, {
name: 'productStatus',
type: 'number'
... ... @@ -119,7 +119,10 @@ exports.res = [
}, {
name: 'size',
type: 'number'
}, ]
}, {
name: 'productStatusStr',
type: 'string'
}]
}, {
//网销信息 -> 批量skn处理
route: '/goods/product/updateProductSknTimingInfo',
... ...
... ... @@ -29,7 +29,7 @@
<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>
<td style="position: relative;"><input id="sort-file" name="file" data-type="searchSort" type="file" style="cursor: pointer; height: 37px; top: 8px;"></td>
</tr>
<tr>
<td>说明:</td>
... ... @@ -44,7 +44,7 @@
<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>
<td style="position: relative;"><input id="brand-file" name="file" data-type="brandProperty" type="file" style="cursor: pointer; height: 37px; top: 8px;"></td>
</tr>
<tr>
<td>说明:</td>
... ...
... ... @@ -100,8 +100,8 @@
<div class="panel-col">
<select name="isOutLets" id="isOutLets" tabindex="-1" title="" class="form-control height40">
<option value="-1">是否奥莱</option>
<option value="1">奥莱</option>
<option value="0">菲奥莱</option>
<option value="Y">奥莱</option>
<option value="N">非奥莱</option>
</select>
</div>
<div class="panel-col">
... ... @@ -149,10 +149,15 @@
<a id="import-btn" href="/goods/netsale/batch" class="btn btn-info">批量(排序、款型系列)</a>
</div>
</div>
</div>
<div class="panel">
<div class="dataTables_wrapper no-footer" id="basicTable"></div>
<div class="panel-body nopadding">
<div class="dataTab_wrapper" id="basicTab"></div>
<div class="dataTables_wrapper no-footer" id="basicTable"></div>
</div>
</div>
</div>
<input type="hidden" id="gridurl" value="{{gridurl}}">
... ... @@ -202,4 +207,36 @@
</div>
</div>
</form>
</script>
<script type="text/template" id="template">
{{# baseProductInfo}}
{{# baseProduct}}
<p>SKN{{}} 品牌:{{}}</p>
<p>商品名称:{{}}</p>
{{/ baseProduct}}
{{# baseProductInfo}}
<table class="table table-bordered">
<thead>
<tr>
<th>SKC(商品信息)</th>
<th>SKC上架操作(状态)</th>
<th>SKU</th>
<th>尺码</th>
<th>库存</th>
<th>SKU上架操作</th>
<th>SKU上架状态</th>
</tr>
</thead>
<tbody>
{{# goodsList}}
<tr>
<td>SKC{{productSkc}}<br>颜色:{{goodsName}}</td>
<td></td>
</tr>
{{/ goodsList}}
</tbody>
</table>
</script>
\ No newline at end of file
... ...