...
|
...
|
@@ -5,18 +5,24 @@ var editBean = require('./partials/limitcode-edit-bean'); |
|
|
var e = new common.edit2("#basicForm");
|
|
|
var type = $("#basicForm").attr("role"),
|
|
|
action = $("#basicForm").data("action");
|
|
|
var isFirst = true;
|
|
|
|
|
|
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();
|
|
|
if(type == "edit") {
|
|
|
$('input[name="skn_sku"]').prop('disabled', true);
|
|
|
$(".noEdit").prop("disabled", true);
|
|
|
$('input[name="userTypeLimit"]').prop('disabled', true);
|
|
|
if(editBean.limitDateFrom <= new Date()) {
|
|
|
if((new Date(editBean.limitDateFrom).getTime() <= new Date().getTime()) && isFirst) {
|
|
|
$("#limitDateFrom").prop("disabled", true);
|
|
|
}
|
|
|
isFirst = false;
|
|
|
}
|
|
|
},
|
|
|
__checkSkn:function(callback) {
|
...
|
...
|
@@ -89,6 +95,14 @@ $(document).on("change", ".observe", function () { |
|
|
editBean = common.util.__buildobj(name, '.', editBean, function (obj, name) {
|
|
|
obj[name] = $this.val();
|
|
|
});
|
|
|
if($this.prop("id") == "limitDateFrom" && new Date($this.val()).getTime() ) {
|
|
|
if(new Date(editBean.currTime).getTime() > new Date(editBean.limitDateFrom)) {
|
|
|
editBean.useCurrTime = true;
|
|
|
} else {
|
|
|
editBean.useCurrTime = false;
|
|
|
}
|
|
|
Bll.__render();
|
|
|
}
|
|
|
//console.log(editBean);
|
|
|
});
|
|
|
|
...
|
...
|
|