瀏覽代碼

erp加上时间修改

xs 5 年之前
父節點
當前提交
4967255928

+ 13 - 1
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil2.java

@@ -426,6 +426,7 @@ public class ExportUtil2 {
         XSSFRow row = (XSSFRow) sheet.createRow(5);
         XSSFCell cell = row.getCell(0);
         CellStyle cellStyle = getCellStyle(workbook);//设备材料清册
+        CellStyle cellStyle1 = getCellStyleAlign(workbook);
         MaterialEquipment materialEquipment = null;
         if (null!=sheet){
             List<MaterialEquipment> materialEquipments = ExportUtil1.getMaterialEquipment(erpCredits);
@@ -439,7 +440,7 @@ public class ExportUtil2 {
                     cell = row.getCell(0);
                 }
                 cell.setCellValue(i+1);//项目定义编号
-                cell.setCellStyle(cellStyle);//添加边框
+                cell.setCellStyle(cellStyle1);//添加边框
                 //第二行
                 if (row.getCell(1)==null){
                     cell = row.createCell(1);
@@ -866,6 +867,17 @@ public class ExportUtil2 {
         style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
         return style;
     }
+    //设置边框
+    public static CellStyle getCellStyleAlign(Workbook workbook){
+        CellStyle style = workbook.createCellStyle();
+        style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 居中
+        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
+        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
+        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
+        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        return style;
+    }
+
     public static List<String> getListSchOther(List<String> list,ScheduleOther scheduleOther){
         list.add(scheduleOther.getRequisitionSite());
         list.add(scheduleOther.getCompensationAcquisition());

二進制
src/main/resources/freemarker/excelmodel/竣工决算模板.xlsx


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

@@ -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({

+ 0 - 25
src/main/webapp/webpage/modules/sg/managementcenter/materialplan/materialplanList.jsp

@@ -70,31 +70,6 @@
 		    </div>
 	<!-- 表格 -->
 	<table id="materialPlanTable" style="table-layout:fixed"  data-toolbar="#toolbar"></table>
-		<script>
-            function listDate(res) {
-                $('#'+res).datetimepicker({
-                    format: "YYYY-MM-DD"
-                }).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();
-                        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);
-                                }
-                            })
-                        })
-                    }
-                    $('.deliverySchedule').datetimepicker('remove');
-
-                });
-            }
-		</script>
-
     <!-- context menu -->
     <ul id="context-menu" class="dropdown-menu">
     	<%--<shiro:hasPermission name="test:one:dialog:leave1:view">--%>