Authored by ping

Merge branch 'develop' of git.dev.yoho.cn:platform/yohobuy-portal-fe into develop

... ... @@ -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);
... ... @@ -140,3 +149,11 @@ $(document).on("click","#btnReview",function(){
});
return false;
});
/*
* 分类id怎么传
*
*
*
*
**/
\ No newline at end of file
... ...
... ... @@ -69,13 +69,7 @@ tabTree.prototype= {
p = this.options;
g.dom["cityboxbtn"].click(function(event) {
g.dom["cityboxbtn"].addClass("select");
g.dom["citybox"].show().css("top", g.inputHeight + "px");
if ($("iframe", g.element).length > 0) {
$("iframe", g.element).css({
top: g.inputHeight + "px",
height: g.dom["citybox"].height()
})
}
g.dom["citybox"].show().css("top", (g.inputHeight-10) + "px");
g.dom["chooseArea"].children("p").each(function() {
if ($(this).hasClass("disable") && $(this).hasClass("cur")) {
g.active_count = 0;
... ... @@ -284,11 +278,6 @@ tabTree.prototype= {
p = this.options;
g.dom["cityboxbtn"].removeClass("select");
g.dom["citybox"].hide();
if ($("iframe", g.element).length > 0) {
$("iframe", g.element).css({
height: 0 + "px"
})
}
},
select: function(rp) {
var g = this,
... ... @@ -346,7 +335,7 @@ tabTree.prototype= {
var g = this,
p = this.options;
g.dom["cityboxbtn"].addClass("select");
g.dom["citybox"].show().css("top", g.inputHeight + "px");
g.dom["citybox"].show().css("top", (g.inputHeight-10) + "px");
if (g.selected.length - parseInt(rp) >= 0) {
g.active_count = parseInt(rp);
g.getData(g._getParam(g.active_count))
... ...
... ... @@ -21,7 +21,8 @@ var util={
return false;
}
},
error:function(){
error:function(err){
console.log("ajax.ERROR",err);
return false;
}
});
... ...
... ... @@ -424,6 +424,14 @@ $('#sure-change').on('click', function() {
arr.push(value.newProductPriceBo);
});
// var count=Math.ceil(arr.length/200);
// for(var i=0;i<count;i++){
// item=arr.slice(i*200,(i+1)*200);
// }
// while(item=arr.slice(2,4)){
// }
data = JSON.stringify(arr);
console.log(data);
common.util.__ajax({
... ... @@ -437,6 +445,7 @@ $('#sure-change').on('click', function() {
path = res.data;
successList.length = 0;
});
});
$('#download-btn').on('click', function() {
... ...
... ... @@ -389,9 +389,8 @@ ul {
.citySelect {
position: relative;
z-index: 99;
height: 38px;
line-height: 38px;
border-radius: 3px;
height: 30px;
line-height: 30px
}
.citySelect b {
... ... @@ -415,9 +414,10 @@ ul {
position: relative;
float: left;
border: 1px solid #ccc;
height: 27px;
line-height: 27px;
padding: 0 38px 0 5px;
height: 37px;
line-height: 37px;
border-radius:3px;
padding: 0 38px 0 10px;
color: #333;
z-index: 99;
white-space: nowrap
... ...
... ... @@ -46,7 +46,8 @@ exports.res = [
method:'GET',
view:'pages/basegoods/edit',
data:{
data:{}
data:{},
action:"/base/goods/ajax/add"
},
src:'/basegoods/edit'
},
... ...
... ... @@ -255,10 +255,10 @@
<input class="form-control btn-sort-xiaoshou" value="[[item.salePrice]]" placeholder="默认销售价" data-index=[[index]] data-eq=[[__index]] required></input>
</div>
<div class="col-sm-2">
<input class="form-control btn-sort-tiaoma" value="[[item.factoryCode]]" placeholder="条码" data-index=[[index]] data-eq=[[__index]]></input>
<input class="form-control btn-sort-tiaoma" value="[[item.barCode]]" placeholder="条码" data-index=[[index]] data-eq=[[__index]]></input>
</div>
<div class="col-sm-2">
<select class="form-control btn-sort-kebu" value="[[item.buhuo]]" data-index=[[index]] data-eq=[[__index]]>
<select class="form-control btn-sort-kebu" value="[[item.isSuppled]]" data-index=[[index]] data-eq=[[__index]]>
<option value="-1">能否补货</option>
<option value="1">可补货</option>
<option value="2">不可补货</option>
... ...