xs 5 years ago
parent
commit
cd47bb4d74

+ 1 - 1
src/main/webapp/webpage/modules/sg/managementcenter/materialplan/materialplanList.js

@@ -212,7 +212,7 @@ $(document).ready(function() {
 		});
 		function getTime(value, row, index) {
 			return [
-				"<div class='input-group form_datetime deliverySchedule' onclick=\"listDate( '" + row.uniqueCode +" ')\"> <input type='text' id="+row.uniqueCode+" name='deliverySchedule' class='form-control required'  value=''/> <span class='input-group-addon'> <span class='glyphicon glyphicon-calendar'></span> </span></div>" ,
+				"<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('');
 		}
 

+ 17 - 18
src/main/webapp/webpage/modules/sg/managementcenter/materialplan/materialplanList.jsp

@@ -68,29 +68,28 @@
 	<!-- 表格 -->
 	<table id="materialPlanTable" style="table-layout:fixed"  data-toolbar="#toolbar"></table>
 		<script>
-
-
-			function listDate(res) {
-			    var flag = flag;
-                $('.deliverySchedule').datetimepicker({
+            function listDate(res) {
+                $('#'+res).datetimepicker({
                     format: "YYYY-MM-DD"
-                }).on('dp.change', function (ev) {
+                }).on('dp.change', 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) {
-                        $(this).data("DateTimePicker").hide();
-                        flag = true;
-                    }
-                    if (flag){
-                        jp.get("${ctx}/sg/managementcenter/materialplan/addtime?uniqueCode=" + res+"&deliverySchedule="+newDateTime, function(data){
-                            if(data.success){
-                                // jp.success(data.msg);
-                            }else{
-                                // jp.error(data.msg);
-                            }
+                        // $(this).data("DateTimePicker").hide();
+                        jp.confirm('确认要更新时间吗?', function(){
+                            jp.get("${ctx}/sg/managementcenter/materialplan/addtime?uniqueCode=" + res+"&deliverySchedule="+newDateTime, function(data){
+                                if(data.success){
+                                    // jp.success(data.msg);
+                                }else{
+                                    jp.error(data.msg);
+                                }
+                            })
                         })
-					}
-                })
+                       flag = true;
+                    }
+                    $('.deliverySchedule').datetimepicker('remove');
+
+                });
             }
 		</script>