|
@@ -71,11 +71,46 @@ $(document).ready(function() {
|
|
|
|
|
|
});
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
onClickRow: function(row, $el){
|
|
|
},
|
|
|
+ onLoadSuccess:function(data){
|
|
|
+ var split = data.rows;
|
|
|
+ for (var i = 0; i < split.length; i++) {
|
|
|
+ $('#'+split[i].uniqueCode).datetimepicker({
|
|
|
+ format: "YYYY-MM-DD"
|
|
|
+ }).on('dp.change',function(i){
|
|
|
+ return function(ev) {
|
|
|
+ var newDateTime = ev.date ? ev.date.format('YYYY-MM-DD') : "";
|
|
|
+ var oldDateTime = ev.oldDate ? ev.oldDate.format('YYYY-MM-DD') : "";
|
|
|
+ if (newDateTime != oldDateTime) {
|
|
|
+ if (""!=oldDateTime){
|
|
|
+ jp.confirm('确认要更新时间吗?', function () {
|
|
|
+ jp.get("${ctx}/sg/managementcenter/materialplan/addtime?uniqueCode=" + split[i].uniqueCode + "&deliverySchedule=" + newDateTime, function (data) {
|
|
|
+ if (data.success) {
|
|
|
+ // jp.success(data.msg);
|
|
|
+ } else {
|
|
|
+ jp.error(data.msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ jp.get("${ctx}/sg/managementcenter/materialplan/addtime?uniqueCode=" + split[i].uniqueCode + "&deliverySchedule=" + newDateTime, function (data) {
|
|
|
+ if (data.success) {
|
|
|
+ // jp.success(data.msg);
|
|
|
+ } else {
|
|
|
+ jp.error(data.msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }(i));
|
|
|
+ }
|
|
|
+ },
|
|
|
onShowSearch: function () {
|
|
|
$("#search-collapse").slideToggle();
|
|
|
},
|
|
@@ -210,11 +245,16 @@ $(document).ready(function() {
|
|
|
]
|
|
|
|
|
|
});
|
|
|
- function getTime(value, row, index) {
|
|
|
- return [
|
|
|
- "<div class='input-group form_datetime deliverySchedule' id="+row.uniqueCode+" onclick=\"listDate( '" + row.uniqueCode +" ')\"> <input type='text' name='deliverySchedule' class='form-control required' value=''/> <span class='input-group-addon'> <span class='glyphicon glyphicon-calendar'></span> </span></div>" ,
|
|
|
- ].join('');
|
|
|
- }
|
|
|
+ // function getTime(value, row, index) {
|
|
|
+ // return [
|
|
|
+ // "<div class='input-group form_datetime' id="+row.uniqueCode+" onclick=\"listDate( '" + row.uniqueCode +" ')\"> <input type='text' name='deliverySchedule' class='form-control required' value=''/> <span class='input-group-addon'> <span class='glyphicon glyphicon-calendar'></span> </span></div>" ,
|
|
|
+ // ].join('');
|
|
|
+ // }
|
|
|
+ function getTime(value, row, index) {
|
|
|
+ return [
|
|
|
+ "<div class='input-group form_datetime' id="+row.uniqueCode+"> <input type='text' name='deliverySchedule' class='form-control required' value="+row.deliverySchedule+"/> <span class='input-group-addon'> <span class='glyphicon glyphicon-calendar'></span> </span></div>" ,
|
|
|
+ ].join('');
|
|
|
+ }
|
|
|
if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
|
|
|
|
|
|
|
|
@@ -273,8 +313,8 @@ $(document).ready(function() {
|
|
|
$("#searchForm .select-item").html("");
|
|
|
$('#materialPlanTable').bootstrapTable('refresh');
|
|
|
});
|
|
|
-
|
|
|
- $('.deliverySchedule').datetimepicker({
|
|
|
+
|
|
|
+ $('.beginDate').datetimepicker({
|
|
|
format: "YYYY-MM-DD"
|
|
|
});
|
|
|
$('#endBeginDate').datetimepicker({
|