...
|
...
|
@@ -7,7 +7,17 @@ var tabTree=new common.tabTree("#tree"); |
|
|
tabTree.init();
|
|
|
|
|
|
var ENUM={
|
|
|
goodsSizeList:{"factoryCode":"","sizeId":"","salePrice":""}
|
|
|
/*
|
|
|
*marketPrice 市场价
|
|
|
*salePrice 销售价
|
|
|
*factoryCode 厂家编号
|
|
|
*storageNum 库存量
|
|
|
*sizeId 尺码
|
|
|
*sizeName 尺码名称
|
|
|
*isSuppled 能否补货,'N','Y'
|
|
|
*barCode 条形码
|
|
|
*/
|
|
|
goodsSizeList:{"sizeId":"","salePrice":"","barCode":"","isSuppled":""}
|
|
|
}
|
|
|
//baseTable
|
|
|
var g=new common.grid({
|
...
|
...
|
@@ -29,7 +39,7 @@ var g=new common.grid({ |
|
|
var html=[];
|
|
|
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||[{"factoryCode":"","sizeId":"","salePrice":""}];
|
|
|
item.goodsSizeList=item.goodsSizeList||[$.extend({},ENUM.goodsSizeList)];
|
|
|
html.push(common.util.__template2($("#template").html(),{index:item.__index,goodsSizeList:item.goodsSizeList}));
|
|
|
html.push('</div>');
|
|
|
return html.join('');
|
...
|
...
|
@@ -59,7 +69,7 @@ $(document).on("click",".sortadd",function(){ |
|
|
"goodsColorImage": "",
|
|
|
goodsName: $(this).text(),
|
|
|
colorId: (+$(this).data("id")),
|
|
|
goodsSizeList: [{"factoryCode":"","sizeId":"","salePrice":""}]
|
|
|
goodsSizeList: [$.extend({},ENUM.goodsSizeList)]
|
|
|
});
|
|
|
g.reload();
|
|
|
g.__e.init();
|
...
|
...
|
@@ -77,7 +87,7 @@ $(document).on("change",".factoryCode",function(){ |
|
|
});
|
|
|
$(document).on("click",".btn-sort-add",function(){
|
|
|
var item=g.__rows[$(this).data("index")];
|
|
|
item.goodsSizeList.push({"factoryCode":"","sizeId":"","salePrice":""});
|
|
|
item.goodsSizeList.push($.extend({},ENUM.goodsSizeList));
|
|
|
g.reload();
|
|
|
g.__e.init();
|
|
|
});
|
...
|
...
|
@@ -105,14 +115,13 @@ $(document).on("change",".btn-sort-tiaoma",function(){ |
|
|
var _index=$(this).data("index");
|
|
|
var _eq=$(this).data("eq");
|
|
|
var item=g.__rows[_index].goodsSizeList[_eq];
|
|
|
item.factoryCode=$(this).val();
|
|
|
|
|
|
item.barCode=$(this).val();
|
|
|
});
|
|
|
$(document).on("change",".btn-sort-kebu",function(){
|
|
|
var _index=$(this).data("index");
|
|
|
var _eq=$(this).data("eq");
|
|
|
var item=g.__rows[_index].goodsSizeList[_eq];
|
|
|
item.buhuo=$(this).val();
|
|
|
item.isSuppled=$(this).val();
|
|
|
});
|
|
|
var e=new common.edit("#basicInfo");
|
|
|
e.on("validate",function(){
|
...
|
...
|
@@ -128,7 +137,7 @@ $(document).on("click","#btnReview",function(){ |
|
|
res = res.data;
|
|
|
if(res.code == "200") {
|
|
|
e.$tip("提交成功", function() {
|
|
|
location.href="/activity/drawline/index"
|
|
|
location.href="/supplier/baseproduct/index"
|
|
|
}, 'growl-success');
|
|
|
}else{
|
|
|
e.$tip(res.message);
|
...
|
...
|
@@ -139,4 +148,12 @@ $(document).on("click","#btnReview",function(){ |
|
|
}
|
|
|
});
|
|
|
return false;
|
|
|
}); |
|
|
\ No newline at end of file |
|
|
});
|
|
|
|
|
|
/*
|
|
|
* 分类id怎么传
|
|
|
*
|
|
|
*
|
|
|
*
|
|
|
*
|
|
|
**/ |
|
|
\ No newline at end of file |
...
|
...
|
|