Authored by weiqingting

时间控件选择不上

... ... @@ -6,6 +6,8 @@ var e = new common.edit2("#basicForm");
var type = $("#basicForm").attr("role"),
action = $("#basicForm").data("action");
var isFirst = true;
var limitDateFromObj;
var limitDateToObj;
var Bll = {
__render:function() {
... ... @@ -15,6 +17,14 @@ var Bll = {
}
$("#basicForm").html(common.util.__template2($("#limitcodeEdit-template").html(), editBean));
e.init();
limitDateFromObj = $("#limitDateFrom").fdatepicker({
format: 'yyyy-mm-dd hh:ii:ss',
pickTime: true
}).data("datepicker");
limitDateToObj = $("#limitDateTo").fdatepicker({
format: 'yyyy-mm-dd hh:ii:ss',
pickTime: true
}).data("datepicker");
if(type == "edit") {
$('input[name="skn_sku"]').prop('disabled', true);
$(".noEdit").prop("disabled", true);
... ... @@ -97,11 +107,14 @@ $(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;
}
Bll.__render();
console.log(editBean.limitDateFrom);
}
//console.log(editBean);
});
... ...
... ... @@ -54,10 +54,10 @@
<label class="col-sm-2 control-label">使用期限<span class="red">*</span></label>
<div class="col-sm-6">
<div class="col-sm-6">
<input type="text" class="form-control observe" data-field="limitDateFrom" jsaction="time:end:limitDateTo" id="limitDateFrom" placeholder="开始时间" value="[[limitDateFrom]]" readonly required>
<input type="text" class="form-control observe" data-field="limitDateFrom" id="limitDateFrom" placeholder="开始时间" value="[[limitDateFrom]]" readonly required>
</div>
<div class="col-sm-6">
<input type="text" class="form-control observe" data-field="limitDateTo" jsaction="time:start:[[useCurrTime?'limitDateCurr':'limitDateFrom']]" id="limitDateTo" placeholder="结束时间" value="[[limitDateTo]]" readonly required>
<input type="text" class="form-control observe" data-field="limitDateTo" id="limitDateTo" placeholder="结束时间" value="[[limitDateTo]]" readonly required>
</div>
</div>
<input type="hidden" jsaction="time" id="limitDateCurr" value="[[currTime]]" readonly>
... ...