Authored by 马力

sort add tax rate

... ... @@ -17,7 +17,8 @@ module.exports={
{name: 'orderBy', type: 'Number'},
{name: 'status', type: 'Number'},
{name: 'gender', type: 'Number'},
{name: 'sortIco', type: 'String'}
{name: 'sortIco', type: 'String'},
{name: 'taxRate', type: 'number'}
]
},
getProductSort:{
... ... @@ -40,7 +41,8 @@ module.exports={
{name: 'orderBy', type: 'Number'},
{name: 'status', type: 'Number'},
{name: 'gender', type: 'Number'},
{name: 'sortIco', type: 'String'}
{name: 'sortIco', type: 'String'},
{name: 'taxRate', type: 'number'}
]
},
publishProductSort:{
... ...
... ... @@ -99,6 +99,16 @@
<input id="status" type="hidden" value="[[status||'0']]" for="radio">
</div>
</div>
<div class="form-group" display="sortLevel && sortLevel != 1 && sortLevel != 2" id="taxRate_div">
<label class="col-md-2 control-label">发票税率</label>
<div class="col-md-5">
<input id="taxRate" class="form-control" value="[[taxRate]]" type="text" onkeyup="this.value=this.value.replace(/[^\d\.]|^\./gi,'')" placeholder="发票税率(0和1之间的两位以内小数)">
</div>
</div>
<input id="id" class="form-control" type="hidden" value="[[id]]">
</script>
<%include '../../common/views/__ui/footer'%>
\ No newline at end of file
... ...
... ... @@ -34,7 +34,15 @@ var NUMN={
sortName: RESPONSEDATA.threeSortName,
code: "",
id: RESPONSEDATA.threeSortId
}]
}],
complete : function (selectData, bool) { // 判断是不是选择了三级或者四级品类
if (selectData.length >= 2 && selectData[0].id && selectData[1].id) {
$("#taxRate_div").show();
} else {
$("#taxRate_div").hide();
$("#taxRate").val('');
}
}
}
var sort=new common.tabTree("#sortTree",NUMN);
sort.init();
... ... @@ -59,6 +67,14 @@ e.on("validate",function(){
}
});
e.on("validate",function(){
var taxRateValue = $("#taxRate").val();
var reg = new RegExp("^[0]+(\.[0-9]{1,2})?$", "g");
if(taxRateValue && '' != taxRateValue && (taxRateValue > 1 || taxRateValue < 0 || !reg.test(taxRateValue))){
return "发票税率输入0~1之间的两位以内小数";
}
});
e.init();
$(document).on("click",".btn-success",function(){
... ...