蔡德晨 5 năm trước cách đây
mục cha
commit
2900741d0e

+ 1 - 0
src/main/java/com/jeeplus/modules/sg/overheadline/service/OverheadLineService.java

@@ -93,6 +93,7 @@ public class OverheadLineService {
            wbsItem1.setProjectId(projectId);
            wbsItem1.setId(id);
            wbsItem1.setItemName(name);
+//           wbsItem1.setType(type);
            //保存项目
            itemService.save(wbsItem1);
        }

+ 2 - 1
src/main/java/com/jeeplus/modules/sg/overheadline/web/OverheadLineController.java

@@ -53,9 +53,10 @@ public class OverheadLineController extends BaseController {
    *数据导入
    */
   @RequestMapping("/import")
-  public String importFile(MultipartFile file, RedirectAttributes redirectAttributes, HttpServletRequest request, Model model){
+  public String importFile(MultipartFile file, RedirectAttributes redirectAttributes, HttpServletRequest request, Model model) throws IOException, InvalidFormatException {
     String projectName = request.getParameter("name");     //项目名称
     String projectId = request.getParameter("projectId");    //工程ID
+    String type = request.getParameter("type");     //工程类型
     String id = getId();
     try {
       //保存数据到数据库

+ 1 - 1
src/main/java/com/jeeplus/modules/sg/project/mapper/ItemMapper.java

@@ -3,7 +3,6 @@ package com.jeeplus.modules.sg.project.mapper;
 import com.jeeplus.core.persistence.BaseMapper;
 import com.jeeplus.core.persistence.annotation.MyBatisMapper;
 import com.jeeplus.modules.sg.project.entity.WbsItem;
-import com.jeeplus.modules.sg.project.entity.WbsProject;
 import com.jeeplus.modules.sg.project.entity.WbsSelection;
 
 import java.util.List;
@@ -12,5 +11,6 @@ import java.util.List;
 @MyBatisMapper
 public interface ItemMapper extends BaseMapper<WbsItem> {
     List<WbsItem> findList(WbsSelection wbsSelection);
+    int insert(WbsItem wbsItem);
 
 }

+ 1 - 1
src/main/java/com/jeeplus/modules/sg/project/mapper/xml/ProjectMapper.xml

@@ -19,7 +19,7 @@
 	<select id="get" resultType="WbsProject" >
 		SELECT 
 			<include refid="infoColumns"/>
-		FROM sg_wbs_project a
+		FROM sg_wbs_project a   left join sys_user b on a.create_by = b.id
 		WHERE a.id = #{id}
 	</select>
 	

+ 1 - 1
src/main/java/com/jeeplus/modules/sg/project/service/ItemService.java

@@ -36,7 +36,7 @@ public class ItemService extends CrudService<ItemMapper, WbsItem> {
         WbsProject wbsProject = projectService.get(projectId);
         int num = wbsProject.getNumber()+1;
         projectService.updateNum(num,projectId);
-        super.save(wbsItem);
+        itemMapper.insert(wbsItem);
     }
 
     @Transactional(readOnly = false)

+ 11 - 11
src/main/webapp/webpage/modules/sg/free/wbslist.jsp

@@ -347,18 +347,18 @@
                 , btn: ['调整','关闭']
                 ,yes: function(index, layero){
                     var body = layer.getChildFrame('body', index);
-                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
-                    var inputForm = body.find('#inputForm');
-                    var top_iframe;
-                    if(target){
-                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
-                    }else{
-                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
-                    }
-                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
-                    iframeWin.contentWindow.doSubmit();
+                   var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                   var inputForm = body.find('#inputForm');
+                   var top_iframe;
+                   if(target){
+                       top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                   }else{
+                       top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                   }
+                   inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                   iframeWin.contentWindow.doSubmit();
 
-                    layer.close(index);//关闭对话框。
+                   layer.close(index);//关闭对话框。
 
                 }
 

+ 8 - 4
src/main/webapp/webpage/modules/sg/project/addItemForm.jsp

@@ -22,13 +22,14 @@
     </style>
 </head>
 <body style="text-align: center;">
-<form class="layui-form" action="${ctx}/jkxl/import" method="post">
-    <input id="newText1"  name="projectId" value=""/>
+<form id="inputForm"class="layui-form" action="${ctx}/jkxl/import" method="post" enctype="multipart/form-data">
+    <input id="newText1" hidden name="projectId" value=""/>
     <div class="layui-form-item">
         <div class="layui-inline" style="margin-left:30px;margin-top: 10px;">
             <input type="button" class="layui-btn-primary layui-btn-sm layui-btn-radius" onclick="uploadwj()" value="选择结算文件" id="btnxz"/>
             <span id="myspan">*结算书文件为博微导出xls/xlsx格式文件</span>
-            <input type="file" style="display: none;" accept=".xls,.xlsx" lay-verify="context" name="file" id="myfile"/>
+            <input type="file" style="display: none;" accept=".xls,.xlsx"  name="file" id="myfile"/>
+            <%--<input type="file" style="display: none;" accept=".xls,.xlsx" id="myfile" name="file"/>--%>
 
         </div>
     </div>
@@ -61,7 +62,7 @@
         <div class="layui-inline">
             <label class="layui-form-label">项目名称</label>
             <div class="layui-input-inline">
-                <input type="name"  class="layui-input" id="inputwrite">
+                <input type="text" name="name"  class="layui-input" id="inputwrite">
             </div>
         </div>
     </div>
@@ -96,6 +97,9 @@
         var newText1 = parent.$('#addtext').val();
         $("#newText1").val(newText1);
     })
+    function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+        $("#inputForm").submit();
+    }
 </script>
 <script>
     $("#btnxz").click(function(){

+ 16 - 3
src/main/webapp/webpage/modules/sg/project/management.jsp

@@ -265,7 +265,7 @@
             });
         };
         renderTable1();
-        table.on('tool(table1)', function(obj){
+        table.on('tool(table1)', function(obj,target){
             var data = obj.data;
             //console.log(obj)
             if(obj.event == 'look'){
@@ -284,8 +284,21 @@
                         content: '${ctxp}/webpage/modules/sg/project/addItemForm.jsp'
                         , btn: ['确定','关闭']
                         ,yes: function(index, layero){
-                            var bodyparent = layer.getChildFrame('body', index);
-                            bodyparent.find('#newProject').click();
+                            // var bodyparent = layer.getChildFrame('body', index);
+                            // bodyparent.find('#newProject').click();
+                            var body = layer.getChildFrame('body', index);
+                            var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                            var inputForm = body.find('#inputForm');
+                            var top_iframe;
+                            if(target){
+                                top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                            }else{
+                                top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                            }
+                            inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                            iframeWin.contentWindow.doSubmit();
+
+                            layer.close(index);//关闭对话框。
 
                         }
                         ,btn2: function(index, layero){