...
|
...
|
@@ -7,16 +7,16 @@ var $ = require('jquery'), |
|
|
common = require('../common/common');
|
|
|
|
|
|
var ENUM = {
|
|
|
enum: {
|
|
|
1: '待审核',
|
|
|
2: '驳回',
|
|
|
3: '通过',
|
|
|
all: "全部商品"
|
|
|
},
|
|
|
|
|
|
tips: {
|
|
|
"100": 0,
|
|
|
"300": 0,
|
|
|
"400": 0
|
|
|
"all": 0
|
|
|
},
|
|
|
status: {
|
|
|
'1': "开启",
|
|
|
'0': "关闭",
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -24,14 +24,16 @@ var ENUM = { |
|
|
/*下拉选择*/
|
|
|
common.dropDown({
|
|
|
el: "#brandId",
|
|
|
ajax: "queryBrand"
|
|
|
ajax: "codGetBrandList"
|
|
|
});
|
|
|
|
|
|
new common.dropDown({
|
|
|
el: "#status",
|
|
|
el: "#isPayDelivery",
|
|
|
ajax: ""
|
|
|
});
|
|
|
|
|
|
var currentBtnType;
|
|
|
var currentSelItem;
|
|
|
|
|
|
var t = new common.tab({
|
|
|
el: "#basicTab",
|
...
|
...
|
@@ -39,27 +41,30 @@ var t = new common.tab({ |
|
|
|
|
|
var columnname = $(this).find('a').attr('columnname');
|
|
|
|
|
|
if (columnname == '400') {
|
|
|
if (columnname == 'all') {
|
|
|
g.options.columns[1].hidden = false;
|
|
|
g.options.columns[2].hidden = true;
|
|
|
g.options.columns[3].hidden = true;
|
|
|
g.options.columns[4].hidden = true;
|
|
|
g.options.columns[5].hidden = false;
|
|
|
g.options.columns[6].hidden = true;
|
|
|
|
|
|
} else if(columnname == 100) {
|
|
|
g.options.columns[1].hidden = true;
|
|
|
g.options.columns[2].hidden = false;
|
|
|
g.options.columns[3].hidden = false;
|
|
|
g.options.columns[4].hidden = true;
|
|
|
g.options.columns[5].hidden = false;
|
|
|
g.options.columns[5].hidden = true;
|
|
|
g.options.columns[6].hidden = false;
|
|
|
} else {
|
|
|
g.options.columns[1].hidden = true;
|
|
|
g.options.columns[2].hidden = false;
|
|
|
g.options.columns[3].hidden = false;
|
|
|
g.options.columns[4].hidden = false;
|
|
|
g.options.columns[5].hidden = true;
|
|
|
g.options.columns[6].hidden = true;
|
|
|
}
|
|
|
g.init('/supplier/baseproduct/ajax/index');
|
|
|
g.init('/payDelivery/queryTotalBrandPayDelivery');
|
|
|
},
|
|
|
columns: [{
|
|
|
name: "100",
|
...
|
...
|
@@ -70,7 +75,7 @@ var t = new common.tab({ |
|
|
display: "驳回({2})",
|
|
|
value: ''
|
|
|
}, {
|
|
|
name: "400",
|
|
|
name: "all",
|
|
|
display: "全部",
|
|
|
value: ''
|
|
|
}]
|
...
|
...
|
@@ -81,33 +86,22 @@ var g = new common.grid({ |
|
|
el: '#basicTable',
|
|
|
parms: function() {
|
|
|
return {
|
|
|
|
|
|
//productSkn: common.util.__input("productSkn"),
|
|
|
//productSkc: common.util.__input("productSkc"),
|
|
|
//productSku: common.util.__input("productSku"),
|
|
|
//productName: common.util.__input("productName"),
|
|
|
//shopId: common.util.__input("shopId"),
|
|
|
brandId: common.util.__input("brandId"),
|
|
|
isPayDelivery: common.util.__input("isPayDelivery"),
|
|
|
//gender: common.util.__input("gender"),
|
|
|
//maxSortId: tabTree.selected.length > 0 ? tabTree.selected[0].id : "", // 一级类目
|
|
|
//middleSortId: tabTree.selected.length > 1 ? tabTree.selected[1].id : "", // 二级类目
|
|
|
//smallSortId: tabTree.selected.length > 2 ? tabTree.selected[2].id : "", // 三级类目
|
|
|
//size: common.util.__input("size"),
|
|
|
checkStatus: 100
|
|
|
checkStatus: (t.active && t.active!='all') ? t.active : 400
|
|
|
|
|
|
};
|
|
|
},
|
|
|
columns: [{
|
|
|
display: '品牌',
|
|
|
type: 'brandName'
|
|
|
name: 'brandName'
|
|
|
},
|
|
|
// 审核状态(全部商品是显示) 1
|
|
|
{
|
|
|
display: "状态",
|
|
|
render: function(item) {
|
|
|
var html = [];
|
|
|
html.push("<p>" + ENUM.status[item.status] + "</p>");
|
|
|
html.push("<p>" + ENUM.status[item.isPayDelivery] + "</p>");
|
|
|
|
|
|
//if (item.status == 3 || item.status == 6) {
|
|
|
// html.push("<p style='color:red;'>" + filterNull(item, 'rejectReason') + "</p>");
|
...
|
...
|
@@ -122,7 +116,7 @@ var g = new common.grid({ |
|
|
|
|
|
render: function(item) {
|
|
|
var html = [];
|
|
|
html.push("<p>" + common.util.__filterNull(item, 'founderName') + "</p>");
|
|
|
html.push("<p>" + common.util.__filterNull(item, 'applicant') + "</p>");
|
|
|
|
|
|
return html.join('');
|
|
|
}
|
...
|
...
|
@@ -132,7 +126,7 @@ var g = new common.grid({ |
|
|
|
|
|
render: function(item) {
|
|
|
var html = [];
|
|
|
html.push("<p>" + common.util.__filterNull(item, 'editTime') + "</p>");
|
|
|
html.push("<p>" + common.util.__filterNull(item, 'createTime') + "</p>");
|
|
|
|
|
|
return html.join('');
|
|
|
}
|
...
|
...
|
@@ -142,30 +136,31 @@ var g = new common.grid({ |
|
|
hidden: true,
|
|
|
name: 'status', // 8待上架,2待审核,3驳回,4通过,1已上架,0已下架,5再上架待审核,6再上架驳回,7再上架通过
|
|
|
render: function(item) {
|
|
|
var html = '';
|
|
|
html += ENUM.status[item.status];
|
|
|
if (item.status == 3 || item.status == 6) {
|
|
|
html += '<p style="color:red;">' + common.util.__filterNull(item, 'rejectReason') + '</p>'
|
|
|
}
|
|
|
return html;
|
|
|
return '<p style="color:red;">' + common.util.__filterNull(item, 'rejectReason') + '</p>' ;
|
|
|
|
|
|
}
|
|
|
}, { // 5
|
|
|
display: "操作",
|
|
|
render: function(item) {
|
|
|
var html = [];
|
|
|
if (item.isPayDelivery == 1) { // 待审核
|
|
|
html.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn operation btn-danger btn-xs edit-class-btn" id="btn-item-close" data-type="close">关闭</a>');
|
|
|
} else {
|
|
|
html.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn operation btn-success btn-xs edit-class-btn" id="btn-item-open" data-type="open">开启</a>');
|
|
|
|
|
|
}
|
|
|
|
|
|
//html.push('<a data-index="'+ item.__index+ '" href="JavaScript:;" class="btn btn-info btn-xs edit-class-btn" id="btn-item-info">查看</a>');
|
|
|
html.push('<a href="/goods/audit/info/' + item.productSkn + '" class="btn btn-info btn-xs info-btn">查看</a>');
|
|
|
return html.join('');
|
|
|
}
|
|
|
},{ // 6
|
|
|
display: "操作",
|
|
|
hidden: true,
|
|
|
render: function(item) {
|
|
|
var html = [];
|
|
|
|
|
|
//if (item.status == 3 || item.status == 6) { // 驳回
|
|
|
// html.push('<a data-index="'+ item.__index+ '" href="JavaScript:;" class="btn operation btn-success btn-xs edit-class-btn" id="btn-item-pass">通过</a>');
|
|
|
//}
|
|
|
html.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn operation btn-danger btn-xs edit-class-btn" id="btn-item-reject" data-type="reject">驳回</a>');
|
|
|
html.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn operation btn-success btn-xs edit-class-btn" id="btn-item-pass" data-type="pass">通过</a>');
|
|
|
|
|
|
if (item.status == 2 || item.status == 5) { // 待审核
|
|
|
html.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn operation btn-success btn-xs edit-class-btn" id="btn-item-pass">通过</a>');
|
|
|
html.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn operation btn-danger btn-xs edit-class-btn" id="btn-item-reject">驳回</a>');
|
|
|
}
|
|
|
|
|
|
|
|
|
return html.join('');
|
...
|
...
|
@@ -173,14 +168,14 @@ var g = new common.grid({ |
|
|
},
|
|
|
]
|
|
|
});
|
|
|
g.init('/payDelivery/queryAllBrandPayDelivery');
|
|
|
g.init('/payDelivery/queryTotalBrandPayDelivery');
|
|
|
|
|
|
// tab初始化
|
|
|
var loadTab = function() {
|
|
|
t.active = undefined;
|
|
|
setTimeout(function() {
|
|
|
common.util.__ajax({
|
|
|
url: "/supplier/baseproduct/auditCount",
|
|
|
url: "/payDelivery/queryCountBrandPayDelivery",
|
|
|
data: g.options.parms()
|
|
|
}, function(res) {
|
|
|
var __dt = $.extend({}, ENUM.tips, res.data);
|
...
|
...
|
@@ -196,118 +191,83 @@ $(document).on('click', "#filter-btn", function() { |
|
|
g.reload();
|
|
|
});
|
|
|
|
|
|
var Bll = {
|
|
|
toast: function(content, fn) {
|
|
|
common.dialog.confirm("温馨提示", content, function() {
|
|
|
common.util.__ajax({
|
|
|
url: '/supplier/baseproduct/auditReject',
|
|
|
data: fn()
|
|
|
}, function() {
|
|
|
g.reload();
|
|
|
loadTab();
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$(document).on('click', ".edit-class-btn", function() {
|
|
|
console.log($(this).data('type'));
|
|
|
currentBtnType = $(this).data('type');
|
|
|
|
|
|
//批量驳回
|
|
|
$(document).on("click", "#reject-btn", function() {
|
|
|
var url = '';
|
|
|
var alertContent;
|
|
|
currentSelItem = g.rows[$(this).data("index")];
|
|
|
var data = function() {
|
|
|
|
|
|
var selectedArr = g.selected,
|
|
|
len = selectedArr.length,
|
|
|
sknList = [];
|
|
|
if (len <= 0) {
|
|
|
common.util.__tip('请选择要驳回的商品', 'warning');
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var data = function() {
|
|
|
var reason = $('#reason').val();
|
|
|
if (reason === '' || $.trim(reason) === '') {
|
|
|
return "请填写驳回原因";
|
|
|
if(currentBtnType == 'reject') {
|
|
|
return "请填写驳回原因";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$.each(selectedArr, function(i, value) {
|
|
|
sknList.push(value['productSkn']);
|
|
|
|
|
|
});
|
|
|
|
|
|
console.log(sknList);
|
|
|
|
|
|
return {
|
|
|
productSknList: JSON.stringify(sknList),
|
|
|
targetStatus: 3, // 驳回
|
|
|
rejectReason: reason
|
|
|
};
|
|
|
}
|
|
|
Bll.toast($("#template").html(), data);
|
|
|
});
|
|
|
brandName: currentSelItem.brandName,
|
|
|
brandId: currentSelItem.brandId,
|
|
|
rejectReason: reason,
|
|
|
isPayDelivery: currentBtnType=='open'?1:0,
|
|
|
checkStatus: currentBtnType=='pass'?200:300,
|
|
|
id: currentSelItem.id,
|
|
|
|
|
|
//批量通过
|
|
|
$(document).on("click", "#pass-btn", function() {
|
|
|
|
|
|
var selectedArr = g.selected,
|
|
|
len = selectedArr.length,
|
|
|
sknList = [];
|
|
|
if (len <= 0) {
|
|
|
common.util.__tip('请选择审核通过的商品', 'warning');
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var data = function() {
|
|
|
|
|
|
$.each(selectedArr, function(i, value) {
|
|
|
sknList.push(value['productSkn']);
|
|
|
|
|
|
});
|
|
|
|
|
|
console.log(sknList);
|
|
|
|
|
|
return {
|
|
|
productSknList: JSON.stringify(sknList),
|
|
|
targetStatus: 4, // 通过
|
|
|
rejectReason: ""
|
|
|
};
|
|
|
}
|
|
|
Bll.toast("确定要通过该申请吗?", data);
|
|
|
});
|
|
|
|
|
|
// 单个驳回
|
|
|
$(document).on("click", "#btn-item-reject", function() {
|
|
|
//auditOperation([],3,)
|
|
|
var item = g.rows[$(this).data("index")];
|
|
|
|
|
|
var data = function() {
|
|
|
|
|
|
var reason = $('#reason').val();
|
|
|
if (reason === '' || $.trim(reason) === '') {
|
|
|
return "请填写驳回原因";
|
|
|
switch (currentBtnType) {
|
|
|
case 'open':
|
|
|
{
|
|
|
url = '/payDelivery/addPayDeliveryCheck';
|
|
|
alertContent = '开启货到付款需组长审核,您确定提交此申请吗?';
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
return {
|
|
|
productSknList: JSON.stringify([item.productSkn]),
|
|
|
targetStatus: 3, // 驳回
|
|
|
rejectReason: reason
|
|
|
};
|
|
|
}
|
|
|
Bll.toast($("#template").html(), data);
|
|
|
});
|
|
|
case 'close':
|
|
|
{
|
|
|
url = '/payDelivery/addPayDeliveryCheck';
|
|
|
alertContent = '关闭货到付款需组长审核,您确定提交此申请吗?';
|
|
|
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
// 单个通过
|
|
|
$(document).on("click", "#btn-item-pass", function() {
|
|
|
//auditOperation([],3,)
|
|
|
var item = g.rows[$(this).data("index")];
|
|
|
case 'pass':
|
|
|
{
|
|
|
url = '/payDelivery/reviewPayDeliveryCheck';
|
|
|
alertContent = '您确定要通过申请吗?';
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
var data = function() {
|
|
|
case 'reject':
|
|
|
{
|
|
|
url = '/payDelivery/reviewPayDeliveryCheck';
|
|
|
alertContent = $("#template").html();
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
return {
|
|
|
productSknList: JSON.stringify([item.productSkn]),
|
|
|
targetStatus: 4, //通过
|
|
|
rejectReason: ""
|
|
|
};
|
|
|
default :
|
|
|
{
|
|
|
url = '';
|
|
|
alertContent = '未知弹框~';
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
Bll.toast("确定要通过该申请吗?", data);
|
|
|
|
|
|
common.dialog.confirm("温馨提示", alertContent, function() {
|
|
|
common.util.__ajax({
|
|
|
url: url,
|
|
|
data: data()
|
|
|
}, function() {
|
|
|
g.reload();
|
|
|
loadTab();
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
|
|
|
$('#export-btn').on('click', function() {
|
|
|
window.open("/ajax/down?queryConf=" + JSON.stringify(g.options.parms()) + "&type=brandPayDeliveryExport");
|
|
|
}); |
...
|
...
|
|