xs 5 éve
szülő
commit
ffc1fd6e88

+ 27 - 29
src/main/webapp/webpage/modules/sg/projecttem/addItem.js

@@ -1,44 +1,42 @@
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<script type="text/javascript">
+    <script type="text/javascript">
     layui.use(['form', 'layedit', 'laydate'], function(){
-    var form = layui.form;
-    form.render();
-    var newText1 = parent.$('#addtext').val();
-    $("#newText1").val(newText1);
-})
-    function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+        var form = layui.form;
+        form.render();
+        var newText1 = parent.$('#addtext').val();
+        $("#newText1").val(newText1);
+    })
+function doSubmit(obj){
     if ($("#myfile").val()==null||$("#myfile").val()==""){
-    layer.msg("请选择文件",{icon: 3});
-    throw SyntaxError;
-}
+        layer.msg("请选择文件",{icon: 3});
+        throw SyntaxError;
+    }
     if ($("#inputwrite").val()==null||$("#inputwrite").val()==""){
-    layer.msg("请输入项目名称",{icon:3});
-    throw SyntaxError;
-}
+        layer.msg("请输入项目名称",{icon:3});
+        throw SyntaxError;
+    }
     //获取项目名称
     var project_name=$("#inputwrite").val();
     //获取工程id
     var project_id=$("#newText1").val();
     $.ajax({
-    url: "${ctx}/project/tem/verfiy",
-    type: "post",
-    data: {"projectName":project_name,"projectId":project_id},
-    success:function (result) {
-    if (result.code == 1){
-    layer.msg(result.msg,{icon:5});
-}else {
-    $("#inputForm").submit();
+        url: "${ctx}/project/tem/verfiy",
+        type: "post",
+        data: {"projectName":project_name,"projectId":project_id},
+        success:function (result) {
+            if (result.code == 1){
+                layer.msg(result.msg,{icon:5});
+            }else {
+                $("#inputForm").submit();
+            }
+        }
+    });
 }
-}
-});
-}
-
-    $("#btnxz").click(function(){
+$("#btnxz").click(function(){
     $("#myfile").trigger("click");
 })
-
-    $("#myfile").bind("change",function(){
+$("#myfile").bind("change",function(){
     var solr_file= $("#myfile").val();
     $("#myspan").html('&nbsp;'+solr_file);
-});
+})
 </script>

+ 5 - 5
src/main/webapp/webpage/modules/sg/projecttem/addItem.jsp

@@ -1,12 +1,11 @@
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 <%@ include file="/webpage/include/taglib.jsp"%>
-<link rel="stylesheet" href="${ctxp}/static/plugin/assets/layui/css/layui.css">
-<link rel="stylesheet" href="${ctxp}/static/plugin/assets/common.css"/>
-<script type="text/javascript" src="${ctxp}/static/plugin/assets/jquery-3.2.1.min.js"></script>
-<script src="${ctxp}/static/plugin/assets/layui/layui.js"></script>
 <html>
 <head>
     <title>添加工程</title>
+    <link rel="stylesheet" href="${ctxp}/static/plugin/assets/layui/css/layui.css">
+    <link rel="stylesheet" href="${ctxp}/static/plugin/assets/common.css"/>
+    <script type="text/javascript" src="${ctxp}/static/plugin/assets/jquery-3.2.1.min.js"></script>
     <style>
         .layui-input{ height: 28px;margin-top: 6px;}
     </style>
@@ -56,6 +55,7 @@
         </div>
     </div>
 </form>
-<%@include file="addItem.js"%>
 </body>
+<script src="${ctxp}/static/plugin/assets/layui/layui.js"></script>
+<%@include file="addItem.js"%>
 </html>