Authored by leo

Update: 商品预售,基础商品页面,增加定金预售属性

... ... @@ -63,7 +63,7 @@
<div class="col-sm-2">
<input class="form-control btn-sort-tiaoma" value="[[item.factoryCode]]" placeholder="条码" data-index=[[index]] data-eq=[[__index]]></input>
</div>
<div class="col-sm-2">
<div class="col-sm-1">
<select class="form-control btn-sort-kebu" value="[[item.isSuppled||'Y']]" data-index=[[index]] data-eq=[[__index]]>
<option value="N">不可补货</option>
<option value="Y">可补货</option>
... ... @@ -73,6 +73,9 @@
<input class="form-control btn-sort-upmCode" value="[[item.upmCode]]" placeholder="UPM条码" data-index=[[index]] data-eq=[[__index]]></input>
</div>
<div class="col-sm-2">
<input class="form-control" type="text" value="[[item.balanceTimeStr]]" readonly="readonly" placeholder="支付尾款时间" data-index=[[index]] data-eq=[[__index]]>
</div>
<div class="col-sm-1">
[[if __index==goodsSizeList.length-1]]
<button type="button" class="btn btn-info btn-xs btn-sort-add" data-index=[[index]]>+</button>
[[/if]]
... ... @@ -235,20 +238,6 @@
[[if isAuditing==200]]
<label class="col-sm-1 control-label">是否预售</label>
<div class="col-sm-2">
<label class="radio-inline">
<input type="radio" name="isAdvance" value="Y"></label>
<label class="radio-inline">
<input type="radio" name="isAdvance" value="N"></label>
<input type="hidden" id="isAdvance" value="[[isAdvance||'N']]" for="radio" />
</div>
[[/if]]
</div>
[[if isAuditing==200]]
<div class="form-group">
<label class="col-sm-2 control-label">是否奥莱</label>
<div class="col-sm-2">
<label class="radio-inline">
... ... @@ -257,10 +246,8 @@
<input type="radio" name="isOutLets" value="N"></label>
<input type="hidden" id="isOutLets" value="[[isOutLets||'N']]" for="radio" />
</div>
[[/if]]
</div>
[[/if]]
[[if isAuditing==200]]
<div class="form-group">
... ... @@ -277,6 +264,34 @@
</div>
[[/if]]
[[if isAuditing==200]]
<div class="form-group">
<label class="col-sm-1 control-label">是否预售</label>
<div class="col-sm-2">
<label class="radio-inline">
<input type="radio" name="isAdvance" value="Y"></label>
<label class="radio-inline">
<input type="radio" name="isAdvance" value="N"></label>
<input type="hidden" id="isAdvance" value="[[isAdvance||'N']]" for="radio" />
</div>
<!-- 设置预计到货时间、预付定金 -->
<div id="advanceSettings" style="display:none">
<label class="col-sm-1 control-label" id="expectArrivalTimeStrTxt">预计到货时间 <span class="red">*</span></label>
<div class="col-sm-2">
<input type="text" style="background-color: #fff" id="expectArrivalTimeStr" jsaction="time" value="[[expectArrivalTimeStr]]" class="form-control" readonly="readonly" required placeholder="预计到货时间" />
</div>
<label class="col-sm-1 control-label">预付定金 </label>
<div class="col-sm-2">
<input type="text" id="deposit" style="background-color: #fff" value="[[deposit]]" class="form-control" placeholder="预付定金">
</div>
</div>
<div class="col-sm-4"><span class="red" style="padding-top: 3px; padding-left: 0;">定金预售商品取消预售标时需维护支付尾款时间</span></div>
</div>
[[/if]]
<div class="form-group">
<label class="col-sm-2 control-label">吊牌价 <span class="red">*</span></label>
... ... @@ -294,18 +309,6 @@
<div class="col-sm-2">
<input type="text" style="background-color: #fff" id="expectShelfTimeStr" jsaction="time" value="[[expectShelfTimeStr]]" required class="form-control" readonly="readonly" placeholder="预计上架时间" />
</div>
[[if isAdvance=='Y']]
<label class="col-sm-1 control-label" id="expectArrivalTimeStrTxt">预计到货时间 <span class="red">*</span></label>
<div class="col-sm-2">
<input type="text" style="background-color: #fff" id="expectArrivalTimeStr" jsaction="time" value="[[expectArrivalTimeStr]]" class="form-control" readonly="readonly" required placeholder="预计到货时间" />
</div>
[[else]]
<label class="col-sm-1 control-label" id="expectArrivalTimeStrTxt">预计到货时间</label>
<div class="col-sm-2">
<input type="text" style="background-color: #fff" id="expectArrivalTimeStr" jsaction="time" value="[[expectArrivalTimeStr]]" class="form-control" readonly="readonly" placeholder="预计到货时间" />
</div>
[[/if]]
</div>
</div>
... ...
... ... @@ -11,7 +11,7 @@ var canEditSort = true; // 未上架前可修改2,3级类目
/*类目配置*/
var ENUM={
goodsSizeList:{"sizeId":"","salePrice":$("#salesPriceStr").val(),"factoryCode":"","isSuppled":"Y","upmCode":""}
goodsSizeList:{"sizeId":"","salePrice":$("#salesPriceStr").val(),"factoryCode":"","isSuppled":"Y","upmCode":"","balanceTimeStr":""}
};
if(ViewModel.data){ // 编辑状态下有数据
... ... @@ -21,6 +21,24 @@ if(ViewModel.data){ // 编辑状态下有数据
if(!RESPONSEDATA.expectShelfTimeStr){
RESPONSEDATA.expectShelfTimeStr="2016-04-15 00:00:00";
}
// 处理SKU中的支付尾款时间
var baseGoodList = RESPONSEDATA.baseGoodList;
if(baseGoodList) {
$.each(baseGoodList, function(index, baseGood) {
var goodsSizeList = baseGood.goodsSizeList;
if(goodsSizeList) {
$.each(goodsSizeList, function(index, goodsSize) {
var balanceTimeStr = '0';
if(goodsSize.balanceTime) {
balanceTimeStr = new Date(goodsSize.balanceTime * 1000).toLocaleString();
}
goodsSize.balanceTimeStr = balanceTimeStr;
});
}
});
}
}
/*货品年,规则从2015年开始,到今年之后的10年*/
... ... @@ -118,6 +136,11 @@ if(RESPONSEDATA.isAuditing==200){
.add("#retailPriceStr").add("#salesPriceStr").add("#stock")
.prop("disabled",true);
//.add("#expectShelfTimeStr").add("#expectArrivalTimeStr")
// 展示预计上架时间和设置定金
if(RESPONSEDATA.isAdvance === 'Y') {
$('#advanceSettings').show();
}
}
/*下拉选择*/
... ... @@ -177,7 +200,7 @@ var g=new common.grid({
}
var html=[];
html.push("<div class='form-group' style='padding-bottom: 0'><div class='col-sm-11 red'><input type=text value='"+item.factoryCode+"' data-index="+item.__index+" class='modelCode form-control' placeholder='款型编码' /></div></div>");
html.push("<dov class='rows'><div class='form-group' style='padding-bottom: 0'><div class='col-sm-2'>尺码</div><div class='col-sm-2'>销售价</div><div class='col-sm-2'>条码</div><div class='col-sm-2'>是否补货</div><div class='col-sm-2'>UPM条码</div></div></div>");
html.push("<div class='rows'><div class='form-group' style='padding-bottom: 0'><div class='col-sm-2'>尺码</div><div class='col-sm-2'>销售价</div><div class='col-sm-2'>条码</div><div class='col-sm-1'>是否补货</div><div class='col-sm-2'>UPM条码</div><div class='col-sm-2'>支付尾款时间</div></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}));
... ... @@ -318,11 +341,11 @@ $(document).on("change",":radio[name=isAdvance]",function(){
// });
// });
if($(this).val()=="Y"){
$("#advanceSettings").show();
$("#expectArrivalTimeStr").attr("required","required");
$("#expectArrivalTimeStrTxt").html("预计到货时间<span class='red'>*</span>");
}else{
$("#advanceSettings").hide();
$("#expectArrivalTimeStr").removeAttr("required");
$("#expectArrivalTimeStrTxt").html("预计到货时间");
}
});
$(document).on("change",".salesPriceStr",function(){
... ... @@ -513,6 +536,12 @@ e.on("validate",function(){
}
});
e.on("validate",function(){
if((+$("#deposit").val())>=(+$("#salesPriceStr").val())){
return "预付定金应小于销售价";
}
});
/*非销售属性验证*/
// e.on("validate",function(){
// if(!ag.__edit.validate(true)){
... ...
... ... @@ -297,7 +297,12 @@ var g = new common.grid({
formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
}
html.push("<p>是</p>");
if (item.isDepositAdvance === 'Y') {
html.push("<p>定金预售</p>");
} else {
html.push("<p>普通预售</p>");
}
html.push("<p>预售库存:" + (item.stock||'0') + "</p>");
html.push("<p>预计到货时间:" + formatted + "</p>");
} else {
... ...