...
|
...
|
@@ -24,17 +24,46 @@ RESPONSEDATA.ENUMYEAR=(function(){ |
|
|
})()
|
|
|
console.log(RESPONSEDATA);
|
|
|
|
|
|
|
|
|
|
|
|
/*审核*/
|
|
|
|
|
|
$("#basicInfo").html(common.util.__template2($("#template2").html(),RESPONSEDATA));
|
|
|
|
|
|
/*商品名称*/
|
|
|
var Bll={
|
|
|
validateSort:function(){
|
|
|
var select=tabTree.getAddress();
|
|
|
if(select[2]&&select[2].id){
|
|
|
return select[2].id;
|
|
|
}
|
|
|
return false;
|
|
|
},
|
|
|
productNameArr:['','',''],
|
|
|
setProductName:function(){
|
|
|
$("#productName").val(Bll.productNameArr.join("-"));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var SORTDATA={
|
|
|
datas:[
|
|
|
{id:RESPONSEDATA.maxSortId,sortName:RESPONSEDATA.maxSortName},
|
|
|
{id:RESPONSEDATA.middleSortId,sortName:RESPONSEDATA.middleSortName},
|
|
|
{id:RESPONSEDATA.smallSortId,sortName:RESPONSEDATA.smallSortName}
|
|
|
]
|
|
|
],
|
|
|
complete:function(data){
|
|
|
if(data.length>2){
|
|
|
Bll.productNameArr[2]=data[data.length-1].sortName;
|
|
|
Bll.setProductName();
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var tabTree=new common.tabTree("#tree",SORTDATA);
|
|
|
tabTree.init();
|
|
|
|
...
|
...
|
@@ -53,17 +82,9 @@ var ENUM={ |
|
|
*isSuppled 能否补货,'N','Y'
|
|
|
*barCode 条形码
|
|
|
*/
|
|
|
goodsSizeList:{"sizeId":"","salePrice":"","barCode":"","isSuppled":"N"}
|
|
|
}
|
|
|
var Bll={
|
|
|
validateSort:function(){
|
|
|
var select=tabTree.getAddress();
|
|
|
if(select[2]&&select[2].id){
|
|
|
return select[2].id;
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
goodsSizeList:{"sizeId":"","salePrice":"","barCode":"","isSuppled":"N","presaleStorageNum":""}
|
|
|
}
|
|
|
|
|
|
/*下拉选择*/
|
|
|
new common.dropDown({el:"#brandId",ajax:"queryBrand"});
|
|
|
|
...
|
...
|
@@ -102,7 +123,10 @@ var g=new common.grid({ |
|
|
html.push("<div class='form-group'><div class='col-sm-11 red'><input type=text value='"+item.factoryCode+"' data-index="+item.__index+" class='factoryCode form-control' placeholder='款型编码' required/></div></div>");
|
|
|
html.push('<div class="rows" id="rows__'+item.__index+'">');
|
|
|
item.goodsSizeList=item.goodsSizeList||[$.extend({},ENUM.goodsSizeList)];
|
|
|
html.push(common.util.__template2($("#template").html(),{index:item.__index,goodsSizeList:item.goodsSizeList}));
|
|
|
|
|
|
var ISXIANGO=common.util.__input("isLimitbuy")=="Y"?true:false;
|
|
|
console.log(item.goodsSizeList);
|
|
|
html.push(common.util.__template2($("#template").html(),{index:item.__index,ISXIANGO:ISXIANGO,goodsSizeList:item.goodsSizeList}));
|
|
|
html.push('</div>');
|
|
|
return html.join('');
|
|
|
}
|
...
|
...
|
@@ -155,8 +179,18 @@ $(document).on("click",".sortadd",function(){ |
|
|
}
|
|
|
});
|
|
|
$(document).on("change","#brandId",function(){
|
|
|
//$("#productName").val($(this).text().replace());
|
|
|
var id=$(this).val();
|
|
|
Bll.productNameArr[0]=$(this).find("option[value='"+id+"']").text();
|
|
|
Bll.setProductName();
|
|
|
});
|
|
|
$(document).on("change",":radio[name=gender]",function(){
|
|
|
Bll.productNameArr[1]=["男","女","通用"][+$(this).val()-1];
|
|
|
Bll.setProductName();
|
|
|
});
|
|
|
$(document).on("change",":radio[name=isLimitbuy]",function(){
|
|
|
g.reload();
|
|
|
});
|
|
|
|
|
|
$(document).on("click",".sortdelete",function(){
|
|
|
var index=$(this).data("index");
|
|
|
[].splice.call(g.__rows,index,1);
|
...
|
...
|
@@ -204,6 +238,12 @@ $(document).on("change",".btn-sort-kebu",function(){ |
|
|
var item=g.__rows[_index].goodsSizeList[_eq];
|
|
|
item.isSuppled=$(this).val();
|
|
|
});
|
|
|
$(document).on("change",".btn-sort-kucun",function(){
|
|
|
var _index=$(this).data("index");
|
|
|
var _eq=$(this).data("eq");
|
|
|
var item=g.__rows[_index].goodsSizeList[_eq];
|
|
|
item.presaleStorageNum=$(this).val();
|
|
|
});
|
|
|
$(document).on("change",".w-goods-text",function(){
|
|
|
var item=g.__rows[$(this).data("index")];
|
|
|
item.factoryGoodsName=$(this).val();
|
...
|
...
|
@@ -251,6 +291,8 @@ $(document).on("click","#btnReview",function(){ |
|
|
e.submit($("#basicForm").attr("action"),function(option){
|
|
|
var select=tabTree.getAddress();
|
|
|
|
|
|
option.data.supplierId=common.util.__input("supplierId")?$("#supplierId").val():"0";
|
|
|
|
|
|
option.data.productSkn=param?param[2]:"";
|
|
|
option.data.maxSortId=select[0]?select[0].id:"";
|
|
|
option.data.middleSortId=select[1]?select[1].id:"";
|
...
|
...
|
|