Authored by weiqingting

时间控件选择不上

@@ -6,6 +6,8 @@ var e = new common.edit2("#basicForm"); @@ -6,6 +6,8 @@ var e = new common.edit2("#basicForm");
6 var type = $("#basicForm").attr("role"), 6 var type = $("#basicForm").attr("role"),
7 action = $("#basicForm").data("action"); 7 action = $("#basicForm").data("action");
8 var isFirst = true; 8 var isFirst = true;
  9 +var limitDateFromObj;
  10 +var limitDateToObj;
9 11
10 var Bll = { 12 var Bll = {
11 __render:function() { 13 __render:function() {
@@ -15,6 +17,14 @@ var Bll = { @@ -15,6 +17,14 @@ var Bll = {
15 } 17 }
16 $("#basicForm").html(common.util.__template2($("#limitcodeEdit-template").html(), editBean)); 18 $("#basicForm").html(common.util.__template2($("#limitcodeEdit-template").html(), editBean));
17 e.init(); 19 e.init();
  20 + limitDateFromObj = $("#limitDateFrom").fdatepicker({
  21 + format: 'yyyy-mm-dd hh:ii:ss',
  22 + pickTime: true
  23 + }).data("datepicker");
  24 + limitDateToObj = $("#limitDateTo").fdatepicker({
  25 + format: 'yyyy-mm-dd hh:ii:ss',
  26 + pickTime: true
  27 + }).data("datepicker");
18 if(type == "edit") { 28 if(type == "edit") {
19 $('input[name="skn_sku"]').prop('disabled', true); 29 $('input[name="skn_sku"]').prop('disabled', true);
20 $(".noEdit").prop("disabled", true); 30 $(".noEdit").prop("disabled", true);
@@ -97,11 +107,14 @@ $(document).on("change", ".observe", function () { @@ -97,11 +107,14 @@ $(document).on("change", ".observe", function () {
97 }); 107 });
98 if($this.prop("id") == "limitDateFrom" && new Date($this.val()).getTime() ) { 108 if($this.prop("id") == "limitDateFrom" && new Date($this.val()).getTime() ) {
99 if(new Date(editBean.currTime).getTime() > new Date(editBean.limitDateFrom)) { 109 if(new Date(editBean.currTime).getTime() > new Date(editBean.limitDateFrom)) {
  110 + limitDateToObj.setStartDate(editBean.currTime);
100 editBean.useCurrTime = true; 111 editBean.useCurrTime = true;
101 } else { 112 } else {
  113 + limitDateToObj.setStartDate(editBean.limitDateFrom);
102 editBean.useCurrTime = false; 114 editBean.useCurrTime = false;
103 } 115 }
104 - Bll.__render(); 116 + console.log(editBean.limitDateFrom);
  117 +
105 } 118 }
106 //console.log(editBean); 119 //console.log(editBean);
107 }); 120 });
@@ -54,10 +54,10 @@ @@ -54,10 +54,10 @@
54 <label class="col-sm-2 control-label">使用期限<span class="red">*</span></label> 54 <label class="col-sm-2 control-label">使用期限<span class="red">*</span></label>
55 <div class="col-sm-6"> 55 <div class="col-sm-6">
56 <div class="col-sm-6"> 56 <div class="col-sm-6">
57 - <input type="text" class="form-control observe" data-field="limitDateFrom" jsaction="time:end:limitDateTo" id="limitDateFrom" placeholder="开始时间" value="[[limitDateFrom]]" readonly required> 57 + <input type="text" class="form-control observe" data-field="limitDateFrom" id="limitDateFrom" placeholder="开始时间" value="[[limitDateFrom]]" readonly required>
58 </div> 58 </div>
59 <div class="col-sm-6"> 59 <div class="col-sm-6">
60 - <input type="text" class="form-control observe" data-field="limitDateTo" jsaction="time:start:[[useCurrTime?'limitDateCurr':'limitDateFrom']]" id="limitDateTo" placeholder="结束时间" value="[[limitDateTo]]" readonly required> 60 + <input type="text" class="form-control observe" data-field="limitDateTo" id="limitDateTo" placeholder="结束时间" value="[[limitDateTo]]" readonly required>
61 </div> 61 </div>
62 </div> 62 </div>
63 <input type="hidden" jsaction="time" id="limitDateCurr" value="[[currTime]]" readonly> 63 <input type="hidden" jsaction="time" id="limitDateCurr" value="[[currTime]]" readonly>