Authored by 王钱钧

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

... ... @@ -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:"";
... ...
... ... @@ -15,7 +15,7 @@ common.util.__ajax({url: '/base/goods/getData', data:{productSkn:param[2]}},func
data.data.ageLevel=data.data.ageLevel.replace("1","成人").replace("2","大童").replace("3","小童");
data.data.gender={"1":"男","2":"女","3":"通用"}[""+data.data.gender];
data.data.grade={"0":"否","1":"是"}[""+data.data.grade];
data.data.isPromotionalGifts={"0":"否","1":"是"}[""+data.data.isPromotionalGifts];
data.data.isPromotionalGifts={"N":"否","Y":"是"}[""+data.data.isPromotionalGifts];
data.data.isLimited={"N":"否","Y":"是"}[""+data.data.isLimited];
data.data.isLimitbuy={"N":"否","Y":"是"}[""+data.data.isLimitbuy];
... ...
... ... @@ -66,7 +66,7 @@ var YNEnum = {
/*下拉选择*/
new common.dropDown({el:"#shopId",ajax:"queryShop"});
new common.dropDown({el:"#brandId",ajax:"queryBrand"});
new common.dropDown({el:"#founder",ajax:"querySupplier"});
// new common.dropDown({el:"#founder",ajax:"querySupplier"});
var tabTree=new common.tabTree("#sort");
tabTree.init();
... ... @@ -166,13 +166,13 @@ var g = new common.grid({
//判断是否是预售商品
if (item.isAdvance === "Y") {
var t = new Date(item.createTime * 1000);
var formatted = t.format("yyyy.mm.dd hh:MM:ss");
var formatted = t.format("yyyy.MM.dd hh:mm:ss");
html.push("<p>是</p>");
html.push("<p>预售库存:"+item.productName+"</p>");
html.push("<p>预计到货时间:"+formatted+"</p>");
} else {
var t = new Date(item.createTime * 1000);
var formatted = t.format("yyyy.mm.dd hh:MM:ss");
var formatted = t.format("yyyy.MM.dd hh:mm:ss");
html.push("<p>否</p>");
html.push("<p>预计上架时间:"+formatted+"</p>");
}
... ...
... ... @@ -106,7 +106,7 @@ var Bll = {
var d = new common.dialog({
title: title,
width: 1200,
width: '60%',
content: common.util.__template2($("#wqt-template1").html(), item),
button: [{
value: "提交",
... ... @@ -259,13 +259,17 @@ $(document).on("click", ".cover-color .btn-metro", function() {
if ($(this).hasClass("info")) {
$(this).removeClass("info");
} else {
$(this).addClass("info");
$(this).addClass("info").siblings().removeClass("info");
}
var groups = $(this).parent(".cover-color");
item.isDefault = groups.find("a").eq(0).hasClass("info") ? "Y" : "N";
item.genderCover = groups.find("a").eq(1).hasClass("info") ? "1" : "0";
item.genderCover = groups.find("a").eq(2).hasClass("info") ? "2" : "0";
console.log(item);
if (groups.find("a").eq(1).hasClass("info")) {
item.genderCover = 1;
} else if (item.genderCover = groups.find("a").eq(2).hasClass("info")) {
item.genderCover = 2;
} else {
item.genderCover = 0;
}
});
$(document).on("click", ".goods-color a", function() {
var index = $(this).data("index");
... ... @@ -303,7 +307,6 @@ GOLABDATA.on("fenmian", function() {
});
});
map.goodsImagesBoList = JSON.stringify(map.goodsImagesBoList);
console.log(typeof JSON.stringify(map));
return {
"goodsImagesReq": JSON.stringify(map)
}
... ...
... ... @@ -27,7 +27,7 @@ a:focus {
min-height: 60px;
position: fixed;
width: 100%;
z-index: 1000;
z-index: 99999;
}
.headerwrapper:after {
... ...
... ... @@ -4,7 +4,7 @@
top:20px;
right:20px;
width:301px;
z-index:9999;
z-index:999999;
}
.gritter-item-wrapper {
... ...
... ... @@ -77,7 +77,7 @@
</select>
</div>
<div class="col-sm-2">
<input class="form-control btn-sort-xiaoshou" value="[[item.salePrice]]" placeholder="默认销售价" data-index=[[index]] data-eq=[[__index]] required></input>
<input class="form-control btn-sort-xiaoshou" value="[[item.salePrice]]" placeholder="默认销售价" data-index=[[index]] data-eq=[[__index]] required match="digits" type="text"></input>
</div>
<div class="col-sm-2">
<input class="form-control btn-sort-tiaoma" value="[[item.barCode]]" placeholder="条码" data-index=[[index]] data-eq=[[__index]]></input>
... ... @@ -88,6 +88,11 @@
<option value="Y">可补货</option>
</select>
</div>
[[if ISXIANGO]]
<div class="col-sm-2">
<input type="text" class="form-control btn-sort-kucun" value="[[item.presaleStorageNum]]" placeholder="预售库存" data-index=[[index]] data-eq=[[__index]]></input>
</div>
[[/if]]
<div class="col-sm-2">
[[if __index==goodsSizeList.length-1]]
<button type="button" class="btn btn-info btn-xs btn-sort-add" data-index=[[index]]>+</button>
... ... @@ -96,6 +101,7 @@
<button type="button" class="btn btn-info btn-xs btn-sort-remove" data-index=[[index]] data-eq=[[__index]]>-</button>
[[/if]]
</div>
</div>
[[/each]]
</script>
... ... @@ -306,7 +312,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">吊牌价<span class="red">*</span></label>
<div class="col-sm-2">
<input type="number" id="retailPriceStr" class="form-control" required value="[[retailPriceStr]]" match="digits" placeholder="吊牌价" />
<input type="number" id="retailPriceStr" class="form-control" required value="[[retailPriceStr]]" match="numbers" placeholder="吊牌价" />
</div>
<label class="col-sm-1 control-label">销售价<span class="red">*</span></label>
<div class="col-sm-2">
... ...
... ... @@ -37,7 +37,7 @@
</div>
<div class="panel-col">
<select id="founder" class="form-control">
<option value="-1">创建人</option>
<option value="-1">供应商</option>
</select>
</div>
<div class="panel-col">
... ...
... ... @@ -75,8 +75,8 @@
</div>
<div class="form-group">
<div class="col-sm-2">预计上架时间:[[expectShelfTime]]</div>
<div class="col-sm-2">预计到货时间:[[expectArrivalTime]]</div>
<div class="col-sm-2">预计上架时间:[[expectArrivalTimeStr]]</div>
<div class="col-sm-2">预计到货时间:[[expectArrivalTimeStr]]</div>
</div>
</div>
... ...
... ... @@ -92,7 +92,7 @@
<option value="-1">请选择三级类目</option>
</select>
</div> -->
<div class="panel-col">
<div class="panel-col2">
<div id="sortTree"></div>
</div>
<div class="panel-col">
... ...
... ... @@ -12,7 +12,7 @@
<span class="red">提示:与商品相关的逛信息自动抓取到下列各模块中,若要在商品详情中展示,请将其编辑在【小编推荐】中。
</span>
</p>
<div class="guang-wrap"></div>
</div>
<div class="panel-footer">
<button class="btn btn-primary" id="btn-recommand">保存</button>
... ...