...
|
...
|
@@ -11,12 +11,120 @@ var ENUM = { |
|
|
},
|
|
|
status: {
|
|
|
0: '未设置',
|
|
|
1: '<font color="#428bca">待审核</font>',
|
|
|
2: '<font color="#5cb85c">通过</font>',
|
|
|
3: '<font color="#d9534f">驳回</font>'
|
|
|
1: '<b style="color:#428bca">待审核</b>',
|
|
|
2: '<b style="color:#5cb85c">通过</b>',
|
|
|
3: '<b style="color:#ff0000">驳回</b>'
|
|
|
},
|
|
|
auditor: {
|
|
|
2965: 'Tracy',
|
|
|
10235: 'David Wong'
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var gridParams = function() {
|
|
|
var select = tabTree.getAddress();
|
|
|
return {
|
|
|
auditStatus: $("#yohoCoinNav .active").data('status'),
|
|
|
product_skn: common.util.__input("skn"),
|
|
|
shop_id: common.util.__input("shop"),
|
|
|
brand_id: common.util.__input("brand"),
|
|
|
supplier_id: common.util.__input("supplier"),
|
|
|
gender: common.util.__input("gender"),
|
|
|
maxSortId: select[0] ? select[0].id : "",
|
|
|
middleSortId: select[1] ? select[1].id : "",
|
|
|
smallSortId: select[2] ? select[2].id : "",
|
|
|
sortId: select[3] ? select[3].id : ""
|
|
|
};
|
|
|
}
|
|
|
|
|
|
var COLUMNS = {
|
|
|
c1: [ //待审核列表
|
|
|
{display: '', type: 'checkbox'},
|
|
|
{display: 'SKN', name: 'productSkn'},
|
|
|
{display: '商品信息', name: 'info', render: function(item) {
|
|
|
var html = ""
|
|
|
html += "<p>名称:" + item.productName + "</p>" + "<p>品牌:" + item.brandName + "</p>" + "<div>类目:";
|
|
|
if(item.maxSortName) {html += item.maxSortName;}
|
|
|
if(item.middleSortName) {html += " > " + item.middleSortName;}
|
|
|
if(item.smallSortName) {html += " > " + item.smallSortName;}
|
|
|
html += "</div>";
|
|
|
return html;
|
|
|
}},
|
|
|
{display: '供应商 / 店铺', name: 'supplier_name', render: function(item) {
|
|
|
var html = '';
|
|
|
if (item.supplierName) {html += item.supplierName;}
|
|
|
if (item.shopName) {html += ' / ' + item.shopName;}
|
|
|
return html;
|
|
|
}},
|
|
|
{display: '性别', name: 'gender', render: function(item) {
|
|
|
return ENUM.gender[item.gender];
|
|
|
}},
|
|
|
{display: '吊牌价', name: 'retailPrice'},
|
|
|
{display: '销售价', name: 'salesPrice'},
|
|
|
{display: '执行返币数', name: 'returnCoin', render: function(item) {
|
|
|
return item.productPrice.returnCoin;
|
|
|
}},
|
|
|
{display: '待审核返币数', name: 'returnCoin', render: function(item) {
|
|
|
return item.productPrice.needAuditCoin;
|
|
|
}},
|
|
|
{display: '状态', name: 'status', render: function(item) {
|
|
|
return ENUM.status[item.productPrice.coinStatus];
|
|
|
}},
|
|
|
{display: '操作信息', name: 'operateInfo', render: function(item) {
|
|
|
var html = '';
|
|
|
if (item.productPrice.founder) {html += '<p>' + item.productPrice.founder + '</p>';}
|
|
|
if (item.productPrice.updateTime) {html += '<p>' + item.productPrice.updateTime + '</p>';}
|
|
|
return html;
|
|
|
}},
|
|
|
{display: '操作', render: function(item) {
|
|
|
return '<a href="javascript:;" class="btn btn-success btn-xs btn-checkOk" data-skn="' + item.productSkn + '">审核通过</a>' +
|
|
|
'<a href="javascript:;" class="btn btn-danger btn-xs btn-checkNo" data-skn="' + item.productSkn + '">驳回</a>';
|
|
|
}}
|
|
|
],
|
|
|
c2: [ //通过,驳回,全部列表展示
|
|
|
{display: 'SKN', name: 'productSkn'},
|
|
|
{display: '商品信息', name: 'info', render: function(item) {
|
|
|
var html = ""
|
|
|
html += "<p>名称:" + item.productName + "</p>" + "<p>品牌:" + item.brandName + "</p>" + "<div>类目:";
|
|
|
if(item.maxSortName) {html += item.maxSortName;}
|
|
|
if(item.middleSortName) {html += " > " + item.middleSortName;}
|
|
|
if(item.smallSortName) {html += " > " + item.smallSortName;}
|
|
|
html += "</div>";
|
|
|
return html;
|
|
|
}},
|
|
|
{display: '供应商 / 店铺', name: 'supplier_name', render: function(item) {
|
|
|
var html = '';
|
|
|
if (item.supplierName) {html += item.supplierName;}
|
|
|
if (item.shopName) {html += ' / ' + item.shopName;}
|
|
|
return html;
|
|
|
}},
|
|
|
{display: '性别', name: 'gender', render: function(item) {
|
|
|
return ENUM.gender[item.gender];
|
|
|
}},
|
|
|
{display: '吊牌价', name: 'retailPrice'},
|
|
|
{display: '销售价', name: 'salesPrice'},
|
|
|
{display: '返币数', name: 'returnCoin', render: function(item) {
|
|
|
return item.productPrice.needAuditCoin;
|
|
|
}},
|
|
|
{display: '状态', name: 'status', render: function(item) {
|
|
|
var html = ENUM.status[item.productPrice.coinStatus] + "<br>";
|
|
|
if(item.productPrice.coinStatus == 3){
|
|
|
html += '<a class="noCheckReason" href="javascript:" data-text="'+ item.productPrice.comment +'" style="color: #ec971f;text-decoration: underline">驳回理由</a>';
|
|
|
}
|
|
|
return html;
|
|
|
}},
|
|
|
{display: '审批人', name: 'auditor', render: function(item) {
|
|
|
return ENUM.auditor[item.productPrice.auditorName];
|
|
|
}},
|
|
|
{display: '操作信息', name: 'operateInfo', render: function(item) {
|
|
|
var html = '';
|
|
|
if (item.productPrice.founder) {html += '<p>' + item.productPrice.founder + '</p>';}
|
|
|
if (item.productPrice.updateTime) {html += '<p>' + item.productPrice.updateTime + '</p>';}
|
|
|
return html;
|
|
|
}}
|
|
|
]
|
|
|
}
|
|
|
|
|
|
new common.dropDown({
|
|
|
el: '#shop',
|
|
|
ajax: 'shopsRest'
|
...
|
...
|
@@ -34,78 +142,134 @@ new common.dropDown({ |
|
|
var tabTree = new common.tabTree("#sortTree", {status: 1, sortLevel: 1});
|
|
|
tabTree.init();
|
|
|
|
|
|
var g = new common.grid({
|
|
|
var g1 = new common.grid({
|
|
|
el: "#yohoCoinAudit_table",
|
|
|
parms: function() {
|
|
|
var select = tabTree.getAddress();
|
|
|
return {
|
|
|
auditStatus: $("#yohoCoinNav .active").data('status'),
|
|
|
product_skn: common.util.__input("skn"),
|
|
|
shop_id: common.util.__input("shop"),
|
|
|
brand_id: common.util.__input("brand"),
|
|
|
supplier_id: common.util.__input("supplier"),
|
|
|
gender: common.util.__input("gender"),
|
|
|
maxSortId: select[0] ? select[0].id : "",
|
|
|
middleSortId: select[1] ? select[1].id : "",
|
|
|
smallSortId: select[2] ? select[2].id : "",
|
|
|
sortId: select[3] ? select[3].id : ""
|
|
|
};
|
|
|
},
|
|
|
columns: [
|
|
|
{display: '', type: 'checkbox'},
|
|
|
{display: 'SKN', name: 'productSkn'},
|
|
|
{display: '商品信息', name: 'info', render: function(item) {
|
|
|
var html = ""
|
|
|
html += "<p>名称:" + item.productName + "</p>" + "<p>品牌:" + item.brandName + "</p>" + "<div>类目:";
|
|
|
if(item.maxSortName) {html += item.maxSortName;}
|
|
|
if(item.middleSortName) {html += " > " + item.middleSortName;}
|
|
|
if(item.smallSortName) {html += " > " + item.smallSortName;}
|
|
|
html += "</div>";
|
|
|
return html;
|
|
|
}},
|
|
|
{display: '供应商 / 店铺', name: 'supplier_name', render: function(item) {
|
|
|
var html = '';
|
|
|
if (item.supplierName) {html += item.supplierName;}
|
|
|
if (item.shopName) {html += ' / ' + item.shopName;}
|
|
|
return html;
|
|
|
}},
|
|
|
{display: '性别', name: 'gender', render: function(item) {
|
|
|
return ENUM.gender[item.gender];
|
|
|
}},
|
|
|
{display: '吊牌价', name: 'retailPrice'},
|
|
|
{display: '销售价', name: 'salesPrice'},
|
|
|
{display: '返币数', name: 'returnCoin', render: function(item) {
|
|
|
return item.productPrice.returnCoin;
|
|
|
}},
|
|
|
{display: '状态', name: 'status', render: function(item) {
|
|
|
return ENUM.status[item.productPrice.coinStatus];
|
|
|
}},
|
|
|
{display: '操作信息', name: 'operateInfo', render: function(item) {
|
|
|
var html = '';
|
|
|
if (item.productPrice.founder) {html += '<p>' + item.productPrice.founder + '</p>';}
|
|
|
if (item.productPrice.updateTime) {html += '<p>' + item.productPrice.updateTime + '</p>';}
|
|
|
return html;
|
|
|
}},
|
|
|
{display: '操作', render: function(item) {
|
|
|
if(item.productPrice.coinStatus == 1){
|
|
|
return '<a href="javascript:;" class="btn btn-success btn-xs btn-checkOk" data-skn="' + item.productSkn + '">审核通过</a>' +
|
|
|
'<a href="javascript:;" class="btn btn-danger btn-xs btn-checkNo" data-skn="' + item.productSkn + '">驳回</a>';
|
|
|
}else{
|
|
|
return '无操作';
|
|
|
}
|
|
|
}}
|
|
|
]
|
|
|
parms: gridParams,
|
|
|
columns: COLUMNS.c1
|
|
|
}),
|
|
|
g2 = new common.grid({
|
|
|
el: "#yohoCoinAudit_table",
|
|
|
parms: gridParams,
|
|
|
columns: COLUMNS.c2
|
|
|
}),
|
|
|
g = null;
|
|
|
|
|
|
//审批通过
|
|
|
function ajaxCheckOk(productSkn){
|
|
|
common.util.__ajax({
|
|
|
url:'/good/yohoCoin/pass',
|
|
|
data: {
|
|
|
"productSkn": productSkn
|
|
|
}
|
|
|
},function(rs){
|
|
|
g.reload();
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//批量审核通过
|
|
|
function ajaxCheckOkBatch(productSkns){
|
|
|
common.util.__ajax({
|
|
|
url:'/good/yohoCoin/passBatch',
|
|
|
data: {
|
|
|
"productSkns": productSkns
|
|
|
}
|
|
|
},function(rs){
|
|
|
g.reload();
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//驳回
|
|
|
function ajaxCheckNo(productSkn, comment){
|
|
|
common.util.__ajax({
|
|
|
url:'/good/yohoCoin/reject',
|
|
|
data: {
|
|
|
"productSkn": productSkn,
|
|
|
"comment": comment
|
|
|
}
|
|
|
},function(rs){
|
|
|
g.reload();
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//批量驳回
|
|
|
function ajaxCheckNoBatch(productSkns, comment){
|
|
|
common.util.__ajax({
|
|
|
url:'/good/yohoCoin/rejectBatch',
|
|
|
data: {
|
|
|
"productSkns": productSkns,
|
|
|
"comment": comment
|
|
|
}
|
|
|
},function(rs){
|
|
|
g.reload();
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//找到以选中的商品的SKN
|
|
|
function findCheckedSknList(){
|
|
|
var sknList = new Array();
|
|
|
var checkedItems = $("#yohoCoinAudit_table").find(".wqt_checkbox:checked");
|
|
|
$.each(checkedItems, function(index,value){
|
|
|
var skn = $(value).parent().next().text();
|
|
|
sknList.push(skn);
|
|
|
});
|
|
|
console.log(sknList)
|
|
|
return sknList;
|
|
|
}
|
|
|
|
|
|
//批量审批通过
|
|
|
$(document).on('click', '#all-checkOk', function() {
|
|
|
var checkOkList = findCheckedSknList();
|
|
|
if(checkOkList.length > 0){
|
|
|
common.dialog.confirm(
|
|
|
"批量审核通过确认",
|
|
|
"你确认<strong style='color:#5cb85c'> 批量审核通过 </strong>么?",
|
|
|
function(){
|
|
|
ajaxCheckOkBatch(checkOkList);
|
|
|
},
|
|
|
function(){}
|
|
|
);
|
|
|
}else{
|
|
|
common.util.__tip("没有选择任何商品!");
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//批量驳回
|
|
|
$(document).on('click', '#all-checkNo', function() {
|
|
|
var checkNoList = findCheckedSknList();
|
|
|
if(checkNoList.length > 0){
|
|
|
common.dialog.confirm(
|
|
|
"批量审核驳回确认",
|
|
|
"你确认<strong style='color:#d9534f'> 批量审核驳回 </strong>么?如果确认,<strong style='color: #f0ad4e'>请填写驳回理由!</strong> \
|
|
|
<textarea id='checkComment' class='form-control' rows='3' style='margin: 10px 0'></textarea> \
|
|
|
<div class='checkTip' style='display: none; color: #ff0000; font-weight: bold'><span>提示:请填写驳回理由!</span></div>",
|
|
|
function(){
|
|
|
var comment = $("#checkComment").val();
|
|
|
if(comment){
|
|
|
ajaxCheckNoBatch(checkNoList, comment);
|
|
|
}else{
|
|
|
$("#checkComment").focus();
|
|
|
$(".checkTip").show();
|
|
|
return false;
|
|
|
}
|
|
|
},
|
|
|
function(){}
|
|
|
);
|
|
|
}else{
|
|
|
common.util.__tip("没有选择任何商品!");
|
|
|
}
|
|
|
});
|
|
|
g.init($("#gridurl").val());
|
|
|
|
|
|
//选择分类
|
|
|
$(document).on('click', '#yohoCoinNav li', function() {
|
|
|
$(this).addClass("active").siblings().removeClass("active");
|
|
|
g.reload();
|
|
|
if($(this).data("status") == "1"){
|
|
|
$("#checkOperation").show();
|
|
|
g1.init($("#gridurl").val());
|
|
|
g = g1;
|
|
|
}else{
|
|
|
$("#checkOperation").hide();
|
|
|
g2.init($("#gridurl").val());
|
|
|
g = g2;
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
@@ -116,14 +280,7 @@ $(document).on('click', '.btn-checkOk', function() { |
|
|
"审核通过确认",
|
|
|
"你确认<strong style='color:#5cb85c'> 审核通过 </strong>么?",
|
|
|
function(){
|
|
|
common.util.__ajax({
|
|
|
url:'/good/yohoCoin/pass',
|
|
|
data: {
|
|
|
"productSkn": productSkn
|
|
|
}
|
|
|
},function(rs){
|
|
|
g.reload();
|
|
|
});
|
|
|
ajaxCheckOk(productSkn);
|
|
|
},
|
|
|
function(){}
|
|
|
);
|
...
|
...
|
@@ -140,15 +297,7 @@ $(document).on('click', '.btn-checkNo', function() { |
|
|
function(){
|
|
|
var comment = $("#checkComment").val();
|
|
|
if(comment){
|
|
|
common.util.__ajax({
|
|
|
url:'/good/yohoCoin/reject',
|
|
|
data: {
|
|
|
"productSkn": productSkn,
|
|
|
"comment": comment
|
|
|
}
|
|
|
},function(rs){
|
|
|
g.reload();
|
|
|
});
|
|
|
ajaxCheckNo(productSkn, comment);
|
|
|
}else{
|
|
|
$("#checkComment").focus();
|
|
|
$(".checkTip").show();
|
...
|
...
|
@@ -159,6 +308,12 @@ $(document).on('click', '.btn-checkNo', function() { |
|
|
);
|
|
|
});
|
|
|
|
|
|
//查看驳回理由
|
|
|
$(document).on('click', '.noCheckReason', function() {
|
|
|
var reason = $(this).data("text");
|
|
|
common.dialog.confirm("查看驳回理由", reason, function(){}, function(){});
|
|
|
});
|
|
|
|
|
|
//筛选
|
|
|
$(document).on('click', '#filter-btn', function() {
|
|
|
g.reload(1);
|
...
|
...
|
@@ -166,6 +321,9 @@ $(document).on('click', '#filter-btn', function() { |
|
|
|
|
|
//全部
|
|
|
$(document).on('click', '#all-btn', function() {
|
|
|
location.href = '';
|
|
|
$("#yohoCoinNav li").eq(3).click();
|
|
|
});
|
|
|
|
|
|
//禁页面默认在待审核列表
|
|
|
$("#yohoCoinNav li").eq(0).click();
|
|
|
|
...
|
...
|
|