...
|
...
|
@@ -14,6 +14,7 @@ if(param){ |
|
|
RESPONSEDATA=res.data;
|
|
|
},true);
|
|
|
}
|
|
|
|
|
|
RESPONSEDATA.ENUMYEAR=(function(){
|
|
|
var _y=[];
|
|
|
for(var i=2005;i<(new Date).getFullYear()+10;i++){
|
...
|
...
|
@@ -46,15 +47,34 @@ var Bll={ |
|
|
}
|
|
|
return id;
|
|
|
},
|
|
|
IsEnter:false,
|
|
|
productNameArr:['','',''],
|
|
|
setProductName:function(){
|
|
|
if(!param){
|
|
|
$("#productName").val(Bll.productNameArr.join(""));
|
|
|
if(!Bll.IsEnter){
|
|
|
$("#productName").val(Bll.productNameArr.join(""));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
//attributeTable
|
|
|
var ag=new common.grid({
|
|
|
el:"#attributeTable",
|
|
|
columns:[
|
|
|
{display:"名称",name:"attributeName"},
|
|
|
{display:"属性",render:function(item){
|
|
|
item.required=item.isMust=="Y"?"required":"";
|
|
|
item.attributeValues=item.attributeValues.split(',').map(function(elem, index, arr){
|
|
|
return {name:elem}
|
|
|
});
|
|
|
// item.attributeValues={name:};
|
|
|
return common.util.__template2($("#template3").html(),item);
|
|
|
}},
|
|
|
{display:"备注",name:"remark"}
|
|
|
]
|
|
|
});
|
|
|
|
|
|
|
|
|
var SORTDATA={
|
...
|
...
|
@@ -74,11 +94,12 @@ var SORTDATA={ |
|
|
common.util.__ajax({
|
|
|
url:'/base/goods/queryAllProductAttr',
|
|
|
data:{
|
|
|
categoryId:454,
|
|
|
categoryId:sorid,
|
|
|
displayPosition:1
|
|
|
}
|
|
|
},function(res){
|
|
|
console.log(res);
|
|
|
ag.init(res.data);
|
|
|
},true);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -110,56 +131,49 @@ var ENUM={ |
|
|
}
|
|
|
|
|
|
/*下拉选择*/
|
|
|
new common.dropDown({el:"#brandId",ajax:"queryBrand"});
|
|
|
|
|
|
new common.dropDown({el:"#shopId",ajax:"sortbybrand",param:function(){
|
|
|
return {brandId:$("#brandId").val()}
|
|
|
}});
|
|
|
|
|
|
new common.dropDown({el:"#supplierId",ajax:"querySupplier"});
|
|
|
|
|
|
var e=new common.edit("#basicInfo");
|
|
|
e.init();
|
|
|
|
|
|
if(RESPONSEDATA.isAuditing!=200){
|
|
|
|
|
|
new common.dropDown({el:"#brandId",ajax:"queryBrand"});
|
|
|
|
|
|
new common.dropDown({el:"#shopId",ajax:"sortbybrand",params:function(){
|
|
|
return {brandId:$("#brandId").val()}
|
|
|
}});
|
|
|
|
|
|
new common.dropDown({el:"#supplierId",ajax:"getjitSup",params:function(){
|
|
|
return {brandId:$("#brandId").val()}
|
|
|
}});
|
|
|
}else{
|
|
|
tabTree.isfeeze=true;
|
|
|
}
|
|
|
|
|
|
//attributeTable
|
|
|
|
|
|
var ag=new common.grid({
|
|
|
el:"#attributeTable",
|
|
|
columns:[
|
|
|
{display:"名称",name:"attributeName"},
|
|
|
{display:"属性",render:function(item){
|
|
|
item.required=item.isMust=="Y"?"required":"";
|
|
|
item.attributeValues=item.attributeValues.split(',').map(function(elem, index, arr){
|
|
|
return {name:elem}
|
|
|
});
|
|
|
// item.attributeValues={name:};
|
|
|
return common.util.__template2($("#template3").html(),item);
|
|
|
}},
|
|
|
{display:"备注",name:"remark"}
|
|
|
]
|
|
|
});
|
|
|
ag.init([{
|
|
|
attributeId: 15,
|
|
|
attributeName: "防风外套属性",
|
|
|
attributeType: 2,
|
|
|
attributeValues: "11,22",
|
|
|
belong: 1,
|
|
|
categoryId: 454,
|
|
|
createTime: 1453951139,
|
|
|
displayPosition: 1,
|
|
|
inputType: "checkbox",
|
|
|
isAllowAlias: "Y",
|
|
|
isColor: "N",
|
|
|
isMust: "Y",
|
|
|
isSearch: "Y",
|
|
|
maxValueLen: 50,
|
|
|
orderBy: 0,
|
|
|
remark: "备注",
|
|
|
saleType: 0,
|
|
|
state: 0
|
|
|
}]);
|
|
|
|
|
|
// ag.init([{
|
|
|
// attributeId: 15,
|
|
|
// attributeName: "防风外套属性",
|
|
|
// attributeType: 2,
|
|
|
// attributeValues: "11,22",
|
|
|
// belong: 1,
|
|
|
// categoryId: 454,
|
|
|
// createTime: 1453951139,
|
|
|
// displayPosition: 1,
|
|
|
// inputType: "checkbox",
|
|
|
// isAllowAlias: "Y",
|
|
|
// isColor: "N",
|
|
|
// isMust: "Y",
|
|
|
// isSearch: "Y",
|
|
|
// maxValueLen: 50,
|
|
|
// orderBy: 0,
|
|
|
// remark: "备注",
|
|
|
// saleType: 0,
|
|
|
// state: 0
|
|
|
// }]);
|
|
|
|
|
|
//baseTable
|
|
|
|
...
|
...
|
@@ -239,6 +253,9 @@ $(document).on("click",".sortadd",function(){ |
|
|
// g.__e.init();
|
|
|
}
|
|
|
});
|
|
|
$(document).on("keydown","#productName",function(){
|
|
|
Bll.IsEnter=true;
|
|
|
});
|
|
|
$(document).on("change","#brandId",function(){
|
|
|
var id=$(this).val();
|
|
|
Bll.productNameArr[0]=$(this).find("option[value='"+id+"']").text();
|
...
|
...
|
@@ -250,6 +267,13 @@ $(document).on("change",":radio[name=gender]",function(){ |
|
|
});
|
|
|
$(document).on("change",":radio[name=isAdvance]",function(){
|
|
|
g.reload();
|
|
|
if($(this).val()=="Y"){
|
|
|
$("#expectArrivalTimeStr").attr("required","required");
|
|
|
$("#expectArrivalTimeStrTxt").html("预计到货时间<span class='red'>*</span>");
|
|
|
}else{
|
|
|
$("#expectArrivalTimeStr").removeAttr("required");
|
|
|
$("#expectArrivalTimeStrTxt").html("预计到货时间");
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$(document).on("click",".sortdelete",function(){
|
...
|
...
|
@@ -319,12 +343,13 @@ $(document).on("change",".w-goods-text",function(){ |
|
|
});
|
|
|
$(document).on("change",":checkbox[name=ageLevel]",function(){
|
|
|
var value=$(this).val();
|
|
|
var c=$(":checkbox[name=ageLevel]");
|
|
|
if($(this).is(":checked")){
|
|
|
if(value==1){
|
|
|
$(":checkbox[name=ageLevel]").eq(1).prop("checked",false);
|
|
|
$(":checkbox[name=ageLevel]").eq(2).prop("checked",false);
|
|
|
c.eq(1).prop("checked",false);
|
|
|
c.eq(2).prop("checked",false);
|
|
|
}else{
|
|
|
$(":checkbox[name=ageLevel]").eq(0).prop("checked",false);
|
|
|
c.eq(0).prop("checked",false);
|
|
|
}
|
|
|
}
|
|
|
var arr=[];
|
...
|
...
|
@@ -348,7 +373,7 @@ e.on("validate",function(){ |
|
|
if(g.__rows.length==0){
|
|
|
return "请添加销售属性";
|
|
|
}
|
|
|
var map={},_count=0;
|
|
|
var map={},map2={},_count=0,_count1=0;
|
|
|
if(g.__rows.length>0){
|
|
|
$.each(g.__rows,function(index,item){
|
|
|
var gname= item.factoryGoodsName;
|
...
|
...
|
@@ -359,12 +384,19 @@ e.on("validate",function(){ |
|
|
return;
|
|
|
}
|
|
|
map[gname+"_"+item1.sizeId]="";
|
|
|
if(map2.hasOwnProperty(item1.barCode)){
|
|
|
_count1++;
|
|
|
}
|
|
|
map2[item1.barCode]="";
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
if(_count>0){
|
|
|
return "同一颜色包含两组相同尺码";
|
|
|
}
|
|
|
if(_count1>0&&common.util.__input("supplierId")){
|
|
|
return "JIT商品条码不能重复";
|
|
|
}
|
|
|
});
|
|
|
e.on("validate",function(){
|
|
|
if((+$("#salesPriceStr").val())>(+$("#retailPriceStr").val())){
|
...
|
...
|
|