...
|
...
|
@@ -3,16 +3,17 @@ var $ = require('jquery'), |
|
|
common=require('../common/common');
|
|
|
|
|
|
var ENUM={
|
|
|
status:{0:'待审核',1:'审核通过',2:'驳回',3:'过期',4:'作废'},//全部
|
|
|
tips:{"0":0,"1":0,"2":0,"3":0,"4":0,"all":0}
|
|
|
status:{toAuditNum:'待审核',failAuditNum:'驳回',passAuditNum:'通过',all:'全部'},//全部
|
|
|
tips:{"toAuditNum":0,"failAuditNum":0,"passAuditNum":0,"all":""}
|
|
|
}
|
|
|
|
|
|
// 审核状态枚举
|
|
|
var AuditEnum = {
|
|
|
status:{
|
|
|
100:"未审核",
|
|
|
200:"审核通过",
|
|
|
300:"审核不通过"
|
|
|
toAuditNum:100,
|
|
|
passAuditNum:200,
|
|
|
failAuditNum:300,
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -22,7 +23,6 @@ var AgeLevelEnum = { |
|
|
1:"成人",
|
|
|
2:"大童",
|
|
|
3:"小童",
|
|
|
"":"未知年龄"
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -35,6 +35,16 @@ var GenderEnum = { |
|
|
}
|
|
|
}
|
|
|
|
|
|
// 性别
|
|
|
//1可补货,2不可补货 3部分可补货
|
|
|
var ReplenishEnum = {
|
|
|
enum: {
|
|
|
1: "可补货",
|
|
|
2: "不可补货",
|
|
|
3: "部分可补货"
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 商品类型
|
|
|
var GoodsTypeEnum = {
|
|
|
type: {
|
...
|
...
|
@@ -67,12 +77,10 @@ var t = new common.tab({ |
|
|
g.reload(1);
|
|
|
},
|
|
|
columns:[
|
|
|
{name:"0",display:"待审核({0})"},
|
|
|
{name:"1",display:"审核通过({1})"},
|
|
|
{name:"2",display:"驳回({2})"},
|
|
|
{name:"3",display:"过期({3})"},
|
|
|
{name:"4",display:"作废({4})"},
|
|
|
{name:"all",display:"全部({all})"}
|
|
|
{name:"toAuditNum",display:"待审核({toAuditNum})"},
|
|
|
{name:"failAuditNum",display:"驳回({failAuditNum})"},
|
|
|
{name:"passAuditNum",display:"通过({passAuditNum})"},
|
|
|
{name:"all",display:"全部{all}"}
|
|
|
]
|
|
|
}).init(ENUM.tips);
|
|
|
|
...
|
...
|
@@ -80,16 +88,25 @@ var t = new common.tab({ |
|
|
var g = new common.grid({
|
|
|
el: '#basicTable',
|
|
|
parms:function(){
|
|
|
console.log(t.active);
|
|
|
return {
|
|
|
productSkn:common.util.__input("productSkn"),
|
|
|
productName: common.util.__input("productName"),
|
|
|
shopId: common.util.__input("shopId"),
|
|
|
brandId:common.util.__input("brandId"),
|
|
|
name:common.util.__input("filter-name"),
|
|
|
reqDepartment:common.util.__input("filter-dep"),
|
|
|
status: t.active,
|
|
|
isJit: common.util.__input("isJit"),
|
|
|
isOutLets: common.util.__input("isOutLets"),
|
|
|
isAdvance: common.util.__input("isAdvance"),
|
|
|
isAuditing: AuditEnum.status[t.active],
|
|
|
sortId: tabTree.selected.length>0?tabTree.selected[tabTree.selected.length-1].id:""
|
|
|
};
|
|
|
},
|
|
|
columns:[
|
|
|
{
|
|
|
display: '',
|
|
|
type: 'checkbox'
|
|
|
},
|
|
|
{display:"SKN",render:function(item){
|
|
|
var html=[];
|
|
|
html.push('<a data-index="'+ item.__index+ '" href="/base/goods/info/'+ item.productSkn +'" class="btn btn-info btn-xs edit-class-btn">'+item.productSkn+'</a>');
|
...
|
...
|
@@ -101,6 +118,18 @@ var g = new common.grid({ |
|
|
|
|
|
var catgory = item.maxSortName;
|
|
|
|
|
|
if(item.middleSortName) {
|
|
|
catgory += "/"+item.middleSortName;
|
|
|
}
|
|
|
|
|
|
if (item.smallSortName) {
|
|
|
catgory += "/"+item.smallSortName;
|
|
|
}
|
|
|
|
|
|
if (item.sortName) {
|
|
|
catgory += "/"+item.sortName;
|
|
|
}
|
|
|
|
|
|
html.push("<p>名称:"+item.productName+"</p>");
|
|
|
html.push("<p>品牌:"+item.brandName+"</p>");
|
|
|
html.push("<p>品类:"+catgory+"</p>");
|
...
|
...
|
@@ -115,7 +144,7 @@ var g = new common.grid({ |
|
|
|
|
|
//待审核和驳回列表中只显示吊牌价和销售价,通过的列表中显示四种
|
|
|
if (item.isAuditing === 200) {
|
|
|
html.push("<p>是否VIP:"+YNEnum.enum(item.isVip)+"</p>");
|
|
|
html.push("<p>是否VIP:"+YNEnum.enum[item.isVip]+"</p>");
|
|
|
html.push("<p>yoho币:"+item.yohoCoin+"</p>");
|
|
|
}
|
|
|
|
...
|
...
|
@@ -169,7 +198,7 @@ var g = new common.grid({ |
|
|
var grade = (item.grade == 1) ? "重点款" : "非重点款";
|
|
|
var limited = (item.isLimited == "Y")? "限量款" : "非限量款";
|
|
|
var limitedPurchase = (item.isLimitbuy == "Y")? "限购" : "非限购";
|
|
|
var replenishment = "暂无此字段";
|
|
|
var replenishment = ReplenishEnum.enum[item.isSupplied];
|
|
|
var gender = GenderEnum.gender[item.gender];
|
|
|
|
|
|
html.push("<p>"+grade+"</p>");
|
...
|
...
|
@@ -191,6 +220,12 @@ var g = new common.grid({ |
|
|
|
|
|
{display:"操作",render:function(item){
|
|
|
var html=[];
|
|
|
|
|
|
if (item.isAuditing) { // 200 审核通过
|
|
|
|
|
|
} else {
|
|
|
|
|
|
}
|
|
|
html.push('<a data-index="'+ item.__index+ '" href="JavaScript:;" class="btn btn-info btn-xs edit-class-btn">修改</a>');
|
|
|
html.push('<a data-index="'+ item.__index+ '" href="JavaScript:;" class="btn btn-info btn-xs edit-class-btn">通过</a>');
|
|
|
html.push('<a data-index="'+ item.__index+ '" href="JavaScript:;" class="btn btn-info btn-xs edit-class-btn">驳回</a>');
|
...
|
...
|
@@ -205,14 +240,16 @@ g.init('/base/goods/ajax/index'); |
|
|
$(document).on('click', "#filter-btn", function () {
|
|
|
|
|
|
g.reload();
|
|
|
loadTab();
|
|
|
});
|
|
|
|
|
|
|
|
|
var Bll={
|
|
|
// 通过
|
|
|
var BllPass={
|
|
|
toast:function(content,fn){
|
|
|
common.dialog.confirm("温馨提示",content,function(){
|
|
|
common.util.__ajax({
|
|
|
url:'/supplier/index/status',
|
|
|
url:'/base/goods/pass',
|
|
|
data:fn()
|
|
|
},function(){
|
|
|
g.reload();
|
...
|
...
|
@@ -220,28 +257,127 @@ var Bll={ |
|
|
});
|
|
|
}
|
|
|
}
|
|
|
//通过
|
|
|
|
|
|
// 驳回
|
|
|
var BllReject={
|
|
|
toast:function(content,fn){
|
|
|
common.dialog.confirm("温馨提示",content,function(){
|
|
|
common.util.__ajax({
|
|
|
url:'/base/goods/reject',
|
|
|
data:fn()
|
|
|
},function(){
|
|
|
g.reload();
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// tab初始化
|
|
|
var loadTab = function () {
|
|
|
t.active = undefined;
|
|
|
setTimeout(function () {
|
|
|
common.util.__ajax({
|
|
|
url:"/base/goods/ajax/auditCount",
|
|
|
data:g.options.parms()
|
|
|
}, function (res) {
|
|
|
var __dt=$.extend({},ENUM.tips,res.data);
|
|
|
t.init(__dt);
|
|
|
}, true);
|
|
|
}, 400);
|
|
|
}
|
|
|
|
|
|
loadTab();
|
|
|
|
|
|
//单个通过
|
|
|
$(document).on("click",".apply-success",function(){
|
|
|
var item=g.rows[$(this).data("index")];
|
|
|
var data=function(){
|
|
|
return {
|
|
|
id:item.id
|
|
|
productSknList:JSON.stringify([item.productSku]),
|
|
|
};
|
|
|
}
|
|
|
Bll.toast("你确定审核通过吗?",data);
|
|
|
BllPass.toast("你确定审核通过吗?",data);
|
|
|
});
|
|
|
//驳回
|
|
|
|
|
|
//单个驳回
|
|
|
$(document).on("click",".apply-back",function(){
|
|
|
var item=g.rows[$(this).data("index")];
|
|
|
var data=function(){
|
|
|
|
|
|
var reason = $('#reason').val();
|
|
|
if (reason === '' || $.trim(reason) === '') {
|
|
|
return "请填写驳回原因";
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
id:item.id
|
|
|
productSknList:JSON.stringify([item.productSku]),
|
|
|
rejectReason:reason
|
|
|
};
|
|
|
}
|
|
|
Bll.toast($("#template").html(),data);
|
|
|
BllReject.toast($("#template").html(),data);
|
|
|
});
|
|
|
|
|
|
|
|
|
//批量驳回
|
|
|
$(document).on("click","#reject-btn",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 "请填写驳回原因";
|
|
|
}
|
|
|
|
|
|
$.each(selectedArr, function(i, value) {
|
|
|
sknList.push(value['productSkn']);
|
|
|
|
|
|
});
|
|
|
|
|
|
console.log(sknList);
|
|
|
|
|
|
return {
|
|
|
productSknList:JSON.stringify(sknList),
|
|
|
targetStatus:3, // 驳回
|
|
|
rejectReason: reason
|
|
|
};
|
|
|
}
|
|
|
BllReject.toast($("#template").html(),data);
|
|
|
});
|
|
|
|
|
|
//批量通过
|
|
|
$(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),
|
|
|
};
|
|
|
}
|
|
|
BllPass.toast("确定要通过该申请吗?",data);
|
|
|
});
|
|
|
|
|
|
// 时间转化
|
|
|
Date.prototype.format = function(format) {
|
|
|
var date = {
|
...
|
...
|
|