Authored by kuangjiahua

直通车优化

... ... @@ -84,4 +84,6 @@ module.exports=function(app) {
app.post("/categorySource/queryCategorySourceList","salecategory_queryCategorySourceList");
app.post("/categorySource/insertCategorySourceLink","salecategory_insertCategorySourceLink");
app.post("/categorySource/deleteCategorySourceLink","salecategory_deleteCategorySourceLink");
app.post("/categorySource/batchInsertCategorySourceLink","salecategory_batchInsertCategorySourceLink");
app.post("/categorySource/batchDeleteCategorySourceLink","salecategory_batchDeleteCategorySourceLink");
}
\ No newline at end of file
... ...
... ... @@ -177,6 +177,22 @@ module.exports={
{name: 'sourceId', type: 'number'},
{name: 'categoryId', type: 'number'}
]
},
batchInsertCategorySourceLink:{
title: "批量关联资源位直通车和销售类目",
url: '/categorySource/batchInsertCategorySourceLink',
params: [
{name: 'sourceIdList', type: 'string'},
{name: 'categoryId', type: 'number'}
]
},
batchDeleteCategorySourceLink:{
title: "批量取消资源位直通车和销售类目关联关系",
url: '/categorySource/batchDeleteCategorySourceLink',
params: [
{name: 'sourceIdList', type: 'string'},
{name: 'categoryId', type: 'number'}
]
}
}
}
\ No newline at end of file
... ...
... ... @@ -9,8 +9,6 @@
<strong>状态:</strong>
<label class="current"><input type="radio" name="state" value="0">全部</label>
<label><input type="radio" name="state" value="1">已选</label>
<a class="btn btn-success" href="javascript:;" id="batchChoose-btn" style="position: absolute; top: 2px; right: 100px" hidden>选中</a>
<a class="btn btn-success" href="javascript:;" id="batchUnChoose-btn" style="position: absolute; top: 2px; right: 100px" hidden>取消选中</a>
<button type="button" class="btn btn-primary" onclick="location.href='/sale/category/index'" style="position: absolute; top: 2px; right: 20px"> 返回 </button>
</div>
</div>
... ... @@ -23,7 +21,9 @@
</div>
<div class="panel-col">
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="all-btn" href="" class="btn btn-info">全部</a>
<a id="all-btn" href="javascript:;" class="btn btn-info">全部</a>
<a id="batchChoose-btn" href="javascript:;" class="btn btn-success" >选中</a>
<a id="batchUnChoose-btn" href="javascript:;" class="btn btn-success" hidden>取消选中</a>
</div>
</div>
</div>
... ...
... ... @@ -20,13 +20,16 @@ var EMUN = {
//筛选
$(document).on('click', '#filter-btn', function () {
g.reload(1);
});
//全部
$(document).on('click', '#all-btn', function () {
location.href = '';
var state = $('.state-select').find('.current').find('input').val();
if(state == 1){
sc.reload(1);
}else{
g.reload(1);
}
});
var pageChooseSourceIds = [];
var g = new common.grid({
el: "#basicTable",
... ... @@ -121,13 +124,24 @@ var g = new common.grid({
});
g.init('/categorySource/queryCategorySourceList');
//全部
$(document).on('click', '#all-btn', function () {
var state = $('.state-select').find('.current').find('input').val();
$('#sourceName').val('');
if(state == 1){
sc.reload(1);
}else{
g.reload(1);
}
});
var pageUnChooseSourceIds = [];
var sc = new common.grid({
el: "#basicTable",
parms: function() {
return {
state: 1,
categoryId: getCategoryId()
sourceName: common.util.__input("sourceName"),
categoryId: getCategoryId()
}
},
columns: [
... ... @@ -205,18 +219,16 @@ var sc = new common.grid({
$('input[name="state"]').on('change', function() {
$(this).parent().addClass('current').siblings().removeClass('current');
var state = $('.state-select').find('.current').find('input').val();
$('#sourceName').val('');
if(state == 0){
batchChooseSourceIds = [];
batchChooseSourceNames = [];
$("#productSearchLabelSearch").show();
$("#batchChoose-btn").show();
$("#batchUnChoose-btn").hide();
g.init('/categorySource/queryCategorySourceList');
}else if(state == 1){
$('#sourceName').setValue='';
batchUnChooseSourceIds = [];
batchUnChooseSourceNames = [];
$("#productSearchLabelSearch").hide();
$("#batchChoose-btn").hide();
$("#batchUnChoose-btn").show();
sc.init('/categorySource/queryCategorySourceList');
... ... @@ -224,7 +236,7 @@ $('input[name="state"]').on('change', function() {
});
$(document).on('click', '.batchChoose-btn', function(){
$(document).on('click', '#batchChoose-btn', function(){
if(batchChooseSourceIds.length === 0){
common.util.__tip("未勾选任何直通车!", 'warning');
return false;
... ... @@ -254,7 +266,7 @@ $(document).on('click', '.batchChoose-btn', function(){
//批量取消选中
$(document).on('click', '.batchUnChoose-btn', function() {
$(document).on('click', '#batchUnChoose-btn', function() {
if(batchUnChooseSourceIds.length === 0) {
common.util.__tip("未勾选任何直通车!", 'warning');
return false;
... ...