...
|
...
|
@@ -12,9 +12,6 @@ var limitDateToObj; |
|
|
var Bll = {
|
|
|
__render:function() {
|
|
|
editBean.currTime = common.util.__dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss");
|
|
|
if(new Date(editBean.currTime).getTime() > new Date(editBean.limitDateFrom)) {
|
|
|
editBean.useCurrTime = true;
|
|
|
}
|
|
|
$("#basicForm").html(common.util.__template2($("#limitcodeEdit-template").html(), editBean));
|
|
|
e.init();
|
|
|
limitDateFromObj = $("#limitDateFrom").fdatepicker({
|
...
|
...
|
@@ -25,6 +22,14 @@ var Bll = { |
|
|
format: 'yyyy-mm-dd hh:ii:ss',
|
|
|
pickTime: true
|
|
|
}).data("datepicker");
|
|
|
limitDateFromObj.setEndDate(editBean.limitDateTo);
|
|
|
if(editBean.limitDateFrom) {
|
|
|
limitDateToObj.setStartDate(editBean.currTime);
|
|
|
} else if(new Date(editBean.currTime).getTime() < new Date(editBean.limitDateFrom)){
|
|
|
limitDateToObj.setStartDate(editBean.limitDateFrom);
|
|
|
} else {
|
|
|
limitDateToObj.setStartDate(editBean.currTime);
|
|
|
}
|
|
|
if(type == "edit") {
|
|
|
$('input[name="skn_sku"]').prop('disabled', true);
|
|
|
$(".noEdit").prop("disabled", true);
|
...
|
...
|
@@ -108,12 +113,10 @@ $(document).on("change", ".observe", function () { |
|
|
if($this.prop("id") == "limitDateFrom" && new Date($this.val()).getTime() ) {
|
|
|
if(new Date(editBean.currTime).getTime() > new Date(editBean.limitDateFrom)) {
|
|
|
limitDateToObj.setStartDate(editBean.currTime);
|
|
|
editBean.useCurrTime = true;
|
|
|
} else {
|
|
|
limitDateToObj.setStartDate(editBean.limitDateFrom);
|
|
|
editBean.useCurrTime = false;
|
|
|
}
|
|
|
console.log(editBean.limitDateFrom);
|
|
|
//console.log(editBean.limitDateFrom);
|
|
|
|
|
|
}
|
|
|
//console.log(editBean);
|
...
|
...
|
@@ -165,6 +168,14 @@ $(document).on("blur", "#limitSkn", function() { |
|
|
$(document).on("click","#save_brand", function() {
|
|
|
// 限购码状态0:待审核 1:审核通过 2:驳回 3:过期 4:作废
|
|
|
if(e.validate() && (type == "add" ? (!editBean.limitSkn || !Bll.__checkSkn()) : true)) {
|
|
|
if(editBean.limitCodeType == "U") {
|
|
|
for (var i in editBean.skusInfo) {
|
|
|
if(!editBean.skusInfo[i].skuTimes) {
|
|
|
common.util.__tip("SKU数量不能为0");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
editBean.reqDepartment = editBean.reqDepartment.join("/");
|
|
|
editBean.creatorId = $("#auth_id").val();
|
|
|
editBean.creatorName = $("#auth_name").val();
|
...
|
...
|
|