zoukankan      html  css  js  c++  java
  • 大作业开发进度6

    新增

    • 修改问卷(审核未通过后)

    页面代码

    
    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>需求征集</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery,所以必须放在前边) -->
    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/zTreeStyle/zTreeStyle.css" type="text/css">
    <script src="${pageContext.request.contextPath}/js/jquery.ztree.all.min.js"></script>
        <script>
            $(function () {
                var xkflTree = null;
    
                //基础研究点击后需求技术所属领域不可选
                var YJLX = document.getElementsByName("YJLX");
                $('input[name="YJLX"]').click(function(){
                    if (YJLX[0].checked == true)  {
                        //需求技术需求领域和需求技术应用行业不可点击,需要将值设为null
                        $('input[name="XQJSSSLY"]').attr('disabled','');
                        $('input[name="XQJSSSLY"]').attr('checked',false);
                        //需求技术应用行业不可点击
                        $('#div_click_xqjsyyhy').addClass("notclick");
                        //将值设为null,不然sql报错
                        $('#xqjsyyhy').attr('value',null);
                        //学科分类可点击
                        $('#div_click_xkfl').removeClass("notclick");
                    }else {
                        //需求技术需求领域和需求技术应用行业可点击
                        $('input[name="XQJSSSLY"]').removeAttr("disabled");
                        $('#div_click_xqjsyyhy').removeClass("notclick");
                        //学科分类不可点击
                        $('#div_click_xkfl').addClass("notclick");
                        $('#xkfl').attr('value',null);
                    }
                });
    
    
    
                //页面加载时(回显)
                if ('${wj.YJLX}'=="基础研究"){
                    //需求技术需求领域和需求技术应用行业不可点击,需要将值设为null
                    $('input[name="XQJSSSLY"]').attr('disabled','');
                    $('input[name="XQJSSSLY"]').attr('checked',false);
                    //需求技术应用行业不可点击
                    $('#div_click_xqjsyyhy').addClass("notclick");
                    //将值设为null,不然sql报错
                    $('#xqjsyyhy').attr('value',null);
                    //学科分类可点击
                    $('#div_click_xkfl').removeClass("notclick");
                }else {
                    //需求技术需求领域和需求技术应用行业可点击
                    $('input[name="XQJSSSLY"]').removeAttr("disabled");
                    $('#div_click_xqjsyyhy').removeClass("notclick");
                    //学科分类不可点击
                    $('#div_click_xkfl').addClass("notclick");
                    $('#xkfl').attr('value',null);
                }
    
    
    
    
                //其他技术点击时出现输入框
                var xqjsssly_qtjs = document.getElementById("xqjsssly_qtjs");
                $("#xqjsssly_qtjs").click(function () {
                    if (xqjsssly_qtjs.checked ==true){
                        $("#qtjsms").removeAttr("hidden");
                    }else {
                        $("#qtjsms").attr("hidden","");
                    }
                });
    
                //zTree初始化
                //学科分类的ztree************************
                var setting = {
                    data: {
                        simpleData: {
                            enable: true
                        }
                    },
                    callback: {
                        onClick:function zTreeOnClick(event, treeId, treeNode){
                            $("#xkfl").attr("value",treeNode.name);
                            hideMenu();
                        }
                    },
                    view:{
                        fontCss:{font:{'background-color':'black', 'color':'white'}}
                    }
    
                };
    
                $.ajax({
                    //请求方式
                    type : "POST",
                    //请求的媒体类型
                    dataType: "json",
                    //请求地址
                    url : "${pageContext.request.contextPath}/XkflTreeDataServlet",
                    //请求成功
                    success : function(result) {
                        var zNodes = [];
                        for (var i = 0; i < result.length; i++) {
                            //将id、pid从字符串类型转换成int,组装新的json对象并加入到数组中
                            var tempNode = {};
                            tempNode["id"] = parseInt(result[i]['id']);
                            tempNode["pId"] = parseInt(result[i]['pid']);
                            tempNode["name"] = result[i]['name'];
                            zNodes.push(tempNode);
                        }
                        var s = JSON.stringify(zNodes);
                        var epc=eval("("+s+")");
                        xkflTree = $.fn.zTree.init($("#dept_tree"), setting,epc);
                        //学科分类信息回显
                        var xkflIdStr = '${xkfl}';
                        var node = xkflTree.getNodeByParam("id",xkflIdStr);
                        $("#xkfl").attr("value",node.name);
                        xkflTree.selectNode(node);
                    },
                    //请求失败,包含具体的错误信息
                    error : function(e){
                        console.log(e.status);
                        console.log(e.responseText);
                    }
                });
    
                //*******************************
    
    
                //第二个tree初始化
                //需求技术应用行业tree*****************************
                var setting2 = {
                    data: {
                        simpleData: {
                            enable: true,
                            idKey: "id",
                            pIdKey: "pid",
                            rootPId: "0"
                        }
                    },
                    callback: {
                        onClick:function zTreeOnClick(event, treeId, treeNode){
                            $("#xqjsyyhy").attr("value",treeNode.name);
                            hideMenu();
                        }
                    },
                    view:{
                        fontCss:{font:{'background-color':'black', 'color':'white'}}
                    }
    
                };
                $.ajax({
                    //请求方式
                    type : "POST",
                    //请求的媒体类型
                    dataType: "json",
                    //请求地址
                    url : "${pageContext.request.contextPath}/XqjsyyhyTreeDataServlet",
                    //请求成功
                    success : function(result) {
                        var s = JSON.stringify(result);
                        var epc=eval("("+s+")");
                        var xkjsyyhyTree = $.fn.zTree.init($("#dept_tree1"), setting2,epc);
                        //回显
                        var nodeId = '${xqjsyyhy}';
                        var node = xkjsyyhyTree.getNodeByParam("id",nodeId);
                        $("#xqjsyyhy").attr("value",node.name);
                        xkjsyyhyTree.selectNode(node);
                    },
                    //请求失败,包含具体的错误信息
                    error : function(e){
                        console.log(e.status);
                        console.log(e.responseText);
                    }
                });
                //******************************
    
    
    
    
    
                //机构简介字数监听
                $("#jgjj").keyup(function () {
                    var val = $("#jgjj").val();
                    $("#lable_jgjj").text(val.length);
                });
    
    
                //重大科技需求概述字数监听
                $("#ZYWT").keyup(function () {
                    var val = $("#ZYWT").val();
                    $("#label_zywt").text(val.length);
                });
                //重大科技需求概述字数监听
                $("#JSGJ").keyup(function () {
                    var val = $("#JSGJ").val();
                    $("#label_jsgj").text(val.length);
                });
    
                //重大科技需求概述字数监听
                $("#YQMB").keyup(function () {
                    var val = $("#YQMB").val();
                    $("#label_yqmb").text(val.length);
                });
    
                //关键字监听
                $("#GJZ1").keyup(function () {
                    var val = $("#GJZ1").val();
                    if (val != ""){
                        $("#GJZ2").removeAttr("readonly");
                        $("#GJZ2").attr("value","");
                    }else {
                        $("#GJZ2").attr("readonly","");
                    }
                });
    
                $("#GJZ2").keyup(function () {
                    var val = $("#GJZ2").val();
                    if (val != ""){
                        $("#GJZ3").removeAttr("readonly");
                        $("#GJZ3").attr("value","");
                    }else {
                        $("#GJZ3").attr("readonly","");
                    }
                });
    
                $("#GJZ3").keyup(function () {
                    var val = $("#GJZ3").val();
                    if (val != ""){
                        $("#GJZ4").removeAttr("readonly");
                        $("#GJZ4").attr("value","");
                    }else {
                        $("#GJZ4").attr("readonly","");
                    }
                });
    
                $("#GJZ4").keyup(function () {
                    var val = $("#GJZ4").val();
                    if (val != ""){
                        $("#GJZ5").removeAttr("readonly");
                        $("#GJZ5").attr("value","");
                    }else {
                        $("#GJZ5").attr("readonly","");
                    }
                });
    
                $("#jsxqhzms_hzyf").change(function () {
                    if ($("#jsxqhzms_hzyf").is(':checked')){
                        $("#HZYXDW").removeAttr("readonly");
                    }else {
                        $("#HZYXDW").attr("readonly","");
                    }
                });
    
            });
    
            function checkForm() {
                //机构属性校验必选
                var jgsx = document.getElementsByName("JGSX");
                var num_jgsx = 0;
                for (var i=0;i<jgsx.length;i++){
                    if (jgsx[i].checked == true){
                        num_jgsx += 1;
                    }
                }
                if (num_jgsx == 0){
                    alert("必须选择一个机构属性!");
                    return false;
                }
    
                //科技活动类型校验必选
                var kjhdlx = document.getElementsByName("YJLX");
                var num_kjhdlx = 0;
                for (var i=0;i<kjhdlx.length;i++){
                    if (kjhdlx[i].checked == true){
                        num_kjhdlx += 1;
                    }
                }
                if (num_kjhdlx == 0){
                    alert("必须选择一个科技活动类型!");
                    return false;
                }
    
    
                //技术需求合作模式校验必选
                var jsxqhzms = document.getElementsByName("JSXQHZMS");
                var num_jsxqhzms = 0;
                for (var i=0;i<jsxqhzms.length;i++){
                    if (jsxqhzms[i].checked == true){
                        num_jsxqhzms += 1;
                    }
                }
                if (num_jsxqhzms == 0){
                    alert("必须选择一个技术需求合作模式!");
                    return false;
                }
    
    
                //机构简介字数
                var num_jgjj = $("#jgjj").val();
                if (num_jgjj.length > 500){
                    alert("机构简介字数最多为500!");
                    return false;
                }
    
    
                //重大科技需求概述字数
                var num_zywt = $("#ZYWT").val();
                if (num_zywt.length > 500){
                    alert("主要问题字数最多为500!");
                    return false;
                }
    
                //重大科技需求概述字数
                var num_jsgj = $("#JSGJ").val();
                if (num_jsgj.length > 500){
                    alert("技术关键字数最多为500!");
                    return false;
                }
    
                //重大科技需求概述字数
                var num_yqmb = $("#YQMB").val();
                if (num_yqmb.length > 500){
                    alert("预期目标字数最多为500!");
                    return false;
                }
    
                //重大科技需求概述字数
                var num_zywt = $("#ZYWT").val();
                if (num_zywt.length > 500){
                    alert("主要问题字数最多为500!");
                    return false;
                }
    
                //需求截止年限需大于起始年限
                if ($("#qsxqnx").val() > $("#jzxqnx").val()){
                    alert("需求截止年限需大于起始年限!");
                    return false;
                }
    
    
                return  true;
    
            }
    
            function subProp() {
    
                var tijiao = confirm("需求信息审核后不能修改! 确定提交吗?");
                if (tijiao){
                    $("#tableForm").submit();
                }
    
            }
        </script>
    
        <style>
            .notclick{
                pointer-events: none;
            }
        </style>
    </head>
    <body>
    
        <form class="form-horizontal" style="margin-top: 25px;" onsubmit="return checkForm()"
          action="${pageContext.request.contextPath}/dcwjxxResubmit" method="post" id="tableForm">
    
            <input type="text" value="${wj.WJID}" hidden name="WJID">
            <input type="text" value="${wj.SFSH}" hidden name="SFSH">
    
            <%--    机构名称--%>
            <div class="form-group">
                <label class="col-sm-2 control-label">
                    <span style="color: red">*</span>
                    机构全称
                </label>
                <div class="col-sm-2">
                    <input type="text" class="form-control" id="jgmc" name="JGMC"
                           readonly required value="${wj.JGMC}">
                </div>
    
    
                <%--归口管理部门--%>
                <label class="col-sm-2 control-label">
                    归口管理部门
                </label>
                <div class="col-sm-2">
                    <input type="text" class="form-control"  value="${wj.GKGLBM}"
                           id="GKGLBM" name="GKGLBM" >
                </div>
    
            </div>
    
            <%--    通讯地址--%>
            <div class="form-group">
                <label class="col-sm-2 control-label">
                    <span style="color: red">*</span>
                    通讯地址
                </label>
                <div class="col-sm-2">
                    <input type="text" class="form-control"
                           id="txdz" name="TXDZ" required value="${wj.TXDZ}">
                </div>
    
    <%--            所在地域--%>
                <label class="col-sm-2 control-label">
                    <span style="color: red">*</span>
                    所在地域
                </label>
                <div class="col-sm-2">
                    <select id="SZDY" name="SZDY"  class="form-control">
                        <option value="石家庄市" ${wj.SZDY=="石家庄市"?"checked":""}>石家庄市</option>
                        <option value="唐山市" ${wj.SZDY=="唐山市"?"checked":""}>唐山市</option>
                        <option value="秦皇岛市" ${wj.SZDY=="秦皇岛市"?"checked":""}>秦皇岛市</option>
                        <option value="邯郸市" ${wj.SZDY=="邯郸市"?"checked":""}>邯郸市</option>
                        <option value="邢台市" ${wj.SZDY=="邢台市"?"checked":""}>邢台市</option>
                        <option value="保定市" ${wj.SZDY=="保定市"?"checked":""}>保定市</option>
                        <option value="张家口市" ${wj.SZDY=="张家口市"?"checked":""}>张家口市</option>
                    </select>
                </div>
    
    
            </div>
    
            <%--    单位网址--%>
            <div class="form-group">
                <label class="col-sm-2 control-label">网  址</label>
                <div class="col-sm-2">
                    <input type="text" class="form-control"  value="${wj.DWWZ}"
                           id="dwwz" name="DWWZ">
                </div>
    
                <%--    电子信箱--%>
                <label class="col-sm-2 control-label">
                    <span style="color: red">*</span>
                    电子信箱
                </label>
                <div class="col-sm-2">
                    <input type="text" class="form-control"  value="${wj.DZYX}"
                           id="dzxx" name="DZYX" required >
                </div>
            </div>
    
    
    
            <%--    法人代表--%>
            <div class="form-group">
                <label class="col-sm-2 control-label">
                    <span style="color: red">*</span>
                    法人代表
                </label>
                <div class="col-sm-2">
                    <input type="text" class="form-control"  value="${wj.FRDB}"
                           id="frdb" name="FRDB" required>
                </div>
    
                <%--    邮政编码--%>
                <label class="col-sm-2 control-label">邮政编码</label>
                <div class="col-sm-2">
                    <input type="text" class="form-control" id="yzbm" name="YZBM"   value="${wj.YZBM}">
                </div>
            </div>
    
    
    
    
            <%--    联系人--%>
            <div class="form-group">
                <label class="col-sm-2 control-label">
                    <span style="color: red">*</span>
                    联系人
                </label>
                <div class="col-sm-2">
                    <input type="text" class="form-control" id="lxr" name="LXR" required  value="${wj.LXR}">
                </div>
            </div>
    
            <%--    固定电话--%>
            <div class="form-group">
                <label class="col-sm-2 control-label">
                    固定电话
                </label>
                <div class="col-sm-2">
                    <input type="text" class="form-control" id="gddh" name="GDDH" value="${wj.GDDH}">
                </div>
                <%--    手机--%>
                <label class="col-sm-2 control-label">
                    <span style="color: red">*</span>
                    手机
                </label>
                <div class="col-sm-2">
                    <input type="text" class="form-control" id="sj" name="YDDH" required value="${wj.YDDH}">
                </div>
            </div>
    
            <%--    传真--%>
            <div class="form-group">
                <label class="col-sm-2 control-label">传真</label>
                <div class="col-sm-2">
                    <input type="text" class="form-control" id="cz" name="CZ"  value="${wj.CZ}">
                </div>
            </div>
    
    <%--            分割线--%>
            <hr size="5px" />
    
            <%--    机构属性--%>
            <div class="form-group">
                <label class="col-sm-2 control-label">
                    <span style="color: red">*</span>
                    机构属性
                </label>
                <div class="col-sm-10">
    
                    <label class="radio-inline">
                        <input type="radio" name="JGSX" ${wj.JGSX=="企业"?"checked":""}
                               id="jgsx_qy" value="企业"> 企业
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="JGSX"  ${wj.JGSX=="高等院校"?"checked":""}
                               id="jgsx_gdyx" value="高等院校"> 高等院校
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="JGSX"  ${wj.JGSX=="研究机构"?"checked":""}
                               id="jgsx_yjjg" value="研究机构"> 研究机构
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="JGSX"  ${wj.JGSX=="其他"?"checked":""}
                               id="jgsx_qt" value="其他"> 其他
                    </label>
    
                </div>
            </div>
    
    
            <%--    机构简介--%>
            <div class="form-group">
                <label class="col-sm-2 control-label">
                    <span style="color: red">*</span>
                    机构简介
                </label>
                <div class="col-sm-4">
                    <textarea class="form-control" rows="5" name="JGJJ" id="jgjj" required>${wj.JGJJ}</textarea>
                </div>
                <div class="col-sm-2">
                    <label class="control-label">字数不得超过五百.</label>
                    <br>
                    <label class="control-label">
                        <span id="lable_jgjj">0</span>/500字
                    </label>
                </div>
            </div>
    
            <%--            分割线--%>
            <hr size="5px" />
    
            <%--    技术需求名称--%>
            <div class="form-group">
                <label class="col-sm-2 control-label">
                    <span style="color: red">*</span>
                    技术需求名称
                </label>
                <div class="col-sm-2">
                    <input type="text" class="form-control" value="${wj.JSXQMC}"
                           id="jsxqmc" name="JSXQMC" required>
                </div>
            </div>
    
            <%--    需求年限--%>
            <div class="form-group">
                <label class="col-sm-2 control-label">
                    <span style="color: red">*</span>
                    需求年限
                </label>
                <div class="col-sm-2">
                    <div class="col-sm-12 input-group">
                        <input type="number" class="form-control" value="${wj.QSXQNF}"
                               id="qsxqnx" name="QSXQNF" required>
                        <span class="input-group-addon">年</span>
                    </div>
                </div>
                <div class="col-sm-1">
                    ----------------
                </div>
                <div class="col-sm-2">
                    <div class="col-sm-12 input-group">
                        <input type="number" class="form-control" value="${wj.JZXQNF}"
                               id="jzxqnx" name="JZXQNF" required>
                        <span class="input-group-addon">年</span>
                    </div>
                </div>
    
            </div>
    
    
                <hr/>
                <div class="form-group">
                    <label class="col-sm-2 control-label">
                        <span style="color: red">*</span>
                        技术需求概述
                    </label>
                </div>
    
                <div class="form-group">
                    <label class="col-sm-2 control-label">
                        <span style="color: red">*</span>
                        主要问题
                    </label>
                    <div class="col-sm-4">
                        <textarea class="form-control" rows="5" name="ZYWT" id="ZYWT" required>${wj.ZYWT}</textarea>
                    </div>
                    <%--关键字--%>
                    <div class="col-sm-2" >
                        <label class="control-label">字数不得超过五百.</label>
                        <br>
                        <label class="control-label">
                            <span id="label_zywt">0</span>/500字
                        </label>
                    </div>
                </div>
    
                <div class="form-group">
                    <label class="col-sm-2 control-label">
                        <span style="color: red">*</span>
                        技术关键
                    </label>
                    <div class="col-sm-4">
                        <textarea class="form-control" rows="5" name="JSGJ" id="JSGJ" required>${wj.JSGJ}</textarea>
                    </div>
                    <%--关键字--%>
                    <div class="col-sm-2" >
                        <label class="control-label">字数不得超过五百.</label>
                        <br>
                        <label class="control-label">
                            <span id="label_jsgj">0</span>/500字
                        </label>
                    </div>
                </div>
    
                <div class="form-group">
                    <label class="col-sm-2 control-label">
                        <span style="color: red">*</span>
                        预期目标
                    </label>
                    <div class="col-sm-4">
                        <textarea class="form-control" rows="5" name="YQMB" id="YQMB" required>${wj.YQMB}</textarea>
                    </div>
                    <%--关键字--%>
                    <div class="col-sm-2" >
                        <label class="control-label">字数不得超过五百.</label>
                        <br>
                        <label class="control-label">
                            <span id="label_yqmb">0</span>/500字
                        </label>
                    </div>
                </div>
    
    <%--            关键字--%>
    
                <div class="form-group">
                    <label class="col-sm-2 control-label">
                        <span style="color: red">*</span>
                        关键字
                    </label>
    
                    <div class="col-sm-1">
                        <input type="text" class="form-control" id="GJZ1" name="GJZ1" value="${wj.GJZ1}">
                    </div>
    
                    <div class="col-sm-1">
                        <input type="text" class="form-control" id="GJZ2" name="GJZ2" value="${wj.GJZ2}" readonly>
                    </div>
    
                    <div class="col-sm-1">
                        <input type="text" class="form-control" id="GJZ3" name="GJZ3" value="${wj.GJZ3}" readonly>
                    </div>
    
                    <div class="col-sm-1">
                        <input type="text" class="form-control" id="GJZ4" name="GJZ4" value="${wj.GJZ4}" readonly>
                    </div>
    
                    <div class="col-sm-1">
                        <input type="text" class="form-control" id="GJZ5" name="GJZ5" value="${wj.GJZ5}" readonly>
                    </div>
    
                </div>
    
                <hr/>
    
    
    
                <%--    项目资金需求及来源--%>
                <div class="form-group">
    
                    <label class="col-sm-2 control-label">拟投入资金总额</label>
                    <div class="col-sm-2">
                        <div class="col-sm-12 input-group">
                            <input type="text" class="form-control" value="${wj.TRZJZE}"
                                   id="TRZJZE" name="TRZJZE" >
                            <span class="input-group-addon">万元</span>
                        </div>
                    </div>
    
                </div>
    
    
    
                <%--    技术需求合作模式--%>
                <div class="form-group">
                    <label class="col-sm-2 control-label">
                        <span style="color: red">*</span>
                        技术需求解决方式
                    </label>
                    <div class="col-sm-4">
    
                        <label class="radio-inline">
                            <input type="radio" name="JSXQHZMS" ${wj.JSXQHZMS=="独立研发"?"checked":""}
                                   id="jsxqhzms_dlyf" value="独立研发"> 独立研发
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="JSXQHZMS" ${wj.JSXQHZMS=="委托研发"?"checked":""}
                                   id="jsxqhzms_wtyf" value="委托研发"> 委托研发
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="JSXQHZMS" ${wj.JSXQHZMS=="合作研发"?"checked":""}
                                   id="jsxqhzms_hzyf" value="合作研发"> 合作研发
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="JSXQHZMS" ${wj.JSXQHZMS=="其他"?"checked":""}
                                   id="jsxqhzms_qt" value="其他"> 其他
                        </label>
    
                    </div>
    
                    <label class="col-sm-2 control-label">
                        合作意向单位
                    </label>
                    <div class="col-sm-2">
                        <input type="text" name="HZYXDW" value="${wj.HZYXDW}"
                               id="HZYXDW" class="form-control" readonly>
                    </div>
                </div>
    
    
    
                <%--    科技活动类型--%>
                <div class="form-group">
                    <label class="col-sm-2 control-label">
                        <span style="color: red">*</span>
                        科技活动类型
                    </label>
                    <div class="col-sm-10">
    
                        <label class="radio-inline">
                            <input type="radio" name="YJLX"  ${wj.YJLX=="基础研究"?"checked":""}
                                   id="kjhdlx_jcyj" value="基础研究"> 基础研究
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="YJLX"  ${wj.YJLX=="应用研究"?"checked":""}
                                   id="kjhdlx_yyyj" value="应用研究"> 应用研究
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="YJLX"  ${wj.YJLX=="试验发展"?"checked":""}
                                   id="kjhdlx_syfz" value="试验发展"> 试验发展
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="YJLX"  ${wj.YJLX=="研究与试验发展成果应用"?"checked":""}
                                   id="kjhdlx_yjysyfzcgyy" value="研究与试验发展成果应用"> 研究与试验发展成果应用
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="YJLX"  ${wj.YJLX=="技术推广与科技服务"?"checked":""}
                                   id="kjhdlx_jstgykjfw" value="技术推广与科技服务"> 技术推广与科技服务
                        </label>
    
                    </div>
                </div>
    
    
                <%--    学科分类--%>
                <div class="form-group">
                    <label class="col-sm-2 control-label">
                        <span style="color: red">*</span>
                        学科分类
                    </label>
                    <div class="col-sm-4">
    <%--                    <input type="text" class="form-control" id="xkfl" name="XKFL" required readonly>--%>
    
                            <div class="col-sm-12" style="text-align:left;">
                                <div style=" border-collapse: separate;display: table;"  id="dept_div">
                                    <input type="text"  id="xkfl"  placeholder="请选择学科分类" name="XKFL"  readonly="readonly"
                                           style=" border-bottom-right-radius: 0px;border-top-right-radius: 0px;"
                                           class="form-control" data-bv-field="contacts_id" />
                                    <i style="display: none;" class="form-control-feedback" data-bv-icon-for="contacts_id"></i>
                                    <div onclick="showMenu('dept_div',1); return false;" style="cursor:pointer;" id="div_click_xkfl"
                                         class="input-group-addon notclick">
                                        <!--  <span class="glyphicon-user glyphicon"></span> -->选择
                                    </div>
                                </div>
                            </div>
                    </div>
                </div>
    
                <%--    需求技术所属领域--%>
                <div class="form-group">
                    <label class="col-sm-2 control-label">
                        <span style="color: red">*</span>
                        需求技术所属领域
                    </label>
                    <div class="col-sm-10">
                        <label class="checkbox-inline">
                            <input type="checkbox" name="XQJSSSLY" ${fn:contains(wj.XQJSSSLY,"电子信息技术")?"checked":""}
                                   value="电子信息技术"> 电子信息技术
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" name="XQJSSSLY" ${fn:contains(wj.XQJSSSLY,"光机电一体化")?"checked":""}
                                   value="光机电一体化"> 光机电一体化
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" name="XQJSSSLY" ${fn:contains(wj.XQJSSSLY,"软件")?"checked":""}
                                   value="软件"> 软件
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" name="XQJSSSLY" ${fn:contains(wj.XQJSSSLY,"生物制药技术")?"checked":""}
                                   value="生物制药技术"> 生物制药技术
                        </label>
    
                    </div>
                </div>
    
                <div class="form-group">
                    <label class="col-sm-2 control-label"> </label>
                    <div class="col-sm-10">
                        <label class="checkbox-inline">
                            <input type="checkbox" name="XQJSSSLY" ${fn:contains(wj.XQJSSSLY,"新材料及应用技术")?"checked":""}
                                   value="新材料及应用技术"> 新材料及应用技术
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" name="XQJSSSLY" ${fn:contains(wj.XQJSSSLY,"先进制造技术")?"checked":""}
                                   value="先进制造技术"> 先进制造技术
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" name="XQJSSSLY" ${fn:contains(wj.XQJSSSLY,"现代农业技术")?"checked":""}
                                   value="现代农业技术"> 现代农业技术
                        </label>
    
                    </div>
                </div>
    
                <div class="form-group">
                    <label class="col-sm-2 control-label"> </label>
                    <div class="col-sm-10">
    
                        <label class="checkbox-inline">
                            <input type="checkbox" name="XQJSSSLY" ${fn:contains(wj.XQJSSSLY,"新能源与高效节能技术")?"checked":""}
                                   value="新能源与高效节能技术"> 新能源与高效节能技术
                        </label>
    
                        <label class="checkbox-inline">
                            <input type="checkbox" name="XQJSSSLY" ${fn:contains(wj.XQJSSSLY,"资源与环境保护新技术")?"checked":""}
                                   value="资源与环境保护新技术"> 资源与环境保护新技术
                        </label>
    
                        <label class="checkbox-inline">
                            <input type="checkbox" name="XQJSSSLY" ${fn:contains(wj.XQJSSSLY,"其他技术")?"checked":""}
                                   value="其他技术" id="xqjsssly_qtjs"> 其他技术
                            <input type="text" name="QTJSMS" value="${wj.QTJSMS}"
                                   id="qtjsms" hidden="hidden">
                        </label>
                    </div>
                </div>
    
                <%--    需求技术应用行业--%>
                <div class="form-group">
                    <label class="col-sm-2 control-label">
                        <span style="color: red">*</span>
                        需求技术应用行业
                    </label>
                    <div class="col-sm-4">
    <%--                    <input type="text" class="form-control" id="xqjsyyhy" name="XQJSYYHY" required>--%>
                            <div class="col-sm-12" style="text-align:left;">
                                <div style=" border-collapse: separate;display: table;"  id="div_XQJSYYHY">
                                    <input type="text"  id="xqjsyyhy"  placeholder="请选择需求技术应用行业" name="XQJSYYHY"  readonly="readonly"
                                           style=" border-bottom-right-radius: 0px;border-top-right-radius: 0px;"
                                           class="form-control" data-bv-field="contacts_id" />
                                    <i style="display: none;" class="form-control-feedback" data-bv-icon-for="contacts_id"></i>
                                    <div onclick="showMenu('div_XQJSYYHY',2); return false;" id="div_click_xqjsyyhy"
                                         style="cursor:pointer;" class="input-group-addon notclick">
                                        <!--  <span class="glyphicon-user glyphicon"></span> -->选择
                                    </div>
                                </div>
                            </div>
    
                    </div>
    
                </div>
    
    
    
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="button" class="btn btn-default" onclick="subProp()">保存并提交</button>
                        &nbsp;&nbsp;&nbsp;
                        <button type="reset" class="btn btn-default">重置</button>
                    </div>
                </div>
    
        </form>
    
    
        <!-- 一般讲该段代码放在form标签的外层,这样就会显示在最上方-->
        <div id="menuContent" class="menuContent"
             style="background: #fff; display: none;
             position: absolute; border: 1px solid #ddd;
             border-radius: 5px;overflow: auto;
             z-index: 999;
                height: 200px;">
            <ul id="dept_tree" class="ztree" hidden
                style="margin-top: 0;  296px;">
            </ul>
    
            <ul id="dept_tree1" class="ztree" hidden
                style="margin-top: 0;  296px;">
            </ul>
        </div>
    
    <script>
        //隐藏zTree外围div容器
        function hideMenu() {
            $("#dept_tree").attr("hidden","");
            $("#dept_tree1").attr("hidden","");
            $("#menuContent").fadeOut("fast");
            $("body").unbind("mousedown", onBodyDown);
        }
    
        //点击“选择”后显示zTree树
        function showMenu(id,index) {
            CurInput = 1; //标记第一个文本框
            var cityObj = $("#"+id);
            var cityOffset = $("#"+id).offset();
            var w=$("#"+id).css('width');
            var sw=w.substr(0,w.length-2)-12+'px';
            $("#dept_tree").width(sw);
            $("#dept_tree1").width(sw);
            if (index == 1){
                $("#dept_tree").removeAttr("hidden");
            }else if (index == 2){
                $("#dept_tree1").removeAttr("hidden");
            }
    
            //定位zTree外围div容器位置
            //alert(cityOffset.left+":"+cityOffset.top);
            $("#menuContent").css({
                // left: cityOffset.left-mod_left + "px",
                // top: cityOffset.top-mod_top-24 + "px"
                left:cityOffset.left + "px",
                top: cityOffset.top+30 + "px"
            }).slideDown("fast");
            //绑定页面的鼠标按下事件
            $("body").bind("mousedown", onBodyDown);
        }
        //判断当前事件来源
        function onBodyDown(event) {
            if (! (event.target.id == "menuBtn" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length > 0)) {
                hideMenu();
            }
        }
    </script>
    
    
    </body>
    </html>
    
    
    • servlet代码
    
    package web;
    
    import dao.DCWJXXDao;
    import domain.DCWJXX;
    import domain.User;
    import org.apache.commons.beanutils.BeanUtils;
    
    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.IOException;
    import java.lang.reflect.InvocationTargetException;
    import java.sql.SQLException;
    import java.text.SimpleDateFormat;
    import java.util.Arrays;
    import java.util.Date;
    
    @WebServlet("/dcwjxxResubmit")
    public class dcwjxxResubmit extends HttpServlet {
        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            doGet(request, response);
        }
    
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            request.setCharacterEncoding("utf-8");
            response.setContentType("text/html;charset=utf-8");
            DCWJXX dcwjxx = new DCWJXX();
            DCWJXXDao dcwjxxDao = new DCWJXXDao();
            User user = (User) request.getSession().getAttribute("user");
            String[] xqjssslies = request.getParameterValues("XQJSSSLY");
            String sfsh = request.getParameter("SFSH");
            int SFSH = 0;
            if (sfsh.equals("2")){
                SFSH = 0;
            }else if (sfsh.equals("4")){
                SFSH = 1;
            }
            try {
                BeanUtils.populate(dcwjxx,request.getParameterMap());
                BeanUtils.setProperty(dcwjxx,"SFSH",SFSH);
                BeanUtils.setProperty(dcwjxx,"XQJSSSLY",Arrays.toString(xqjssslies));
                BeanUtils.setProperty(dcwjxx,"TBR",user.getUsername());
                BeanUtils.setProperty(dcwjxx,"SUBMITDATE",
                        new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
                System.out.println(dcwjxx.toString());
                dcwjxxDao.reSubmitDcwjxx(dcwjxx);
            } catch (IllegalAccessException e) {
                e.printStackTrace();
    
            } catch (InvocationTargetException e) {
                e.printStackTrace();
    
            } catch (SQLException e) {
                e.printStackTrace();
                response.getWriter().write("<script>alert('提交失败!');window.location.href='"+request.getContextPath()+"/templete/table.jsp'</script>");
    
            }
            //sql正常
            response.getWriter().write("<script>alert('提交成功!');window.location.href='"+request.getContextPath()+"/templete/table.jsp'</script>");
    
        }
    }
    
    
    
    • dao代码
    
    
    //修改调查信息重新提交
        public void reSubmitDcwjxx(DCWJXX dcwjxx) throws SQLException {
            QueryRunner qr = new QueryRunner(MyDataSoureUtils.getDataSource());
            String sql = "update t_dcwjxx set SFSH = ?,JGMC = ?,GKGLBM=?,TXDZ=?,SZDY=?,DWWZ=?,DZYX=?,FRDB=?," +
                    "YZBM=?,LXR=?,GDDH=?,YDDH=?,CZ=?,JGSX=?,JGJJ=?,JSXQMC=?,QSXQNF=?,JZXQNF=?,ZYWT=?," +
                    "JSGJ=?,YQMB=?,GJZ1=?,GJZ2=?,GJZ3=?,GJZ4=?,GJZ5=?,TRZJZE=?,JSXQHZMS=?,HZYXDW=?,YJLX=?," +
                    "XKFL=?,XQJSSSLY=?,QTJSMS=?,XQJSYYHY=?,TBR=?,REASON=?,SUBMITDATE=? where WJID = ?";
            qr.update(sql,dcwjxx.getSFSH(),dcwjxx.getJGMC(),dcwjxx.getGKGLBM(),dcwjxx.getTXDZ(),dcwjxx.getSZDY(),
                    dcwjxx.getDWWZ(),dcwjxx.getDZYX(),dcwjxx.getFRDB(),dcwjxx.getYZBM(),dcwjxx.getLXR(),
                    dcwjxx.getGDDH(),dcwjxx.getYDDH(),dcwjxx.getCZ(),dcwjxx.getJGSX(),dcwjxx.getJGJJ(),
                    dcwjxx.getJSXQMC(),dcwjxx.getQSXQNF(),dcwjxx.getJZXQNF(),dcwjxx.getZYWT(),dcwjxx.getJSGJ(),dcwjxx.getYQMB(),
                    dcwjxx.getGJZ1(),dcwjxx.getGJZ2(),dcwjxx.getGJZ3(),dcwjxx.getGJZ4(),dcwjxx.getGJZ5(),
                    dcwjxx.getTRZJZE(),dcwjxx.getJSXQHZMS(),dcwjxx.getHZYXDW(),dcwjxx.getYJLX(),
                    dcwjxx.getXKFL(),dcwjxx.getXQJSSSLY(),dcwjxx.getQTJSMS(),dcwjxx.getXQJSYYHY(),
                    dcwjxx.getTBR(),dcwjxx.getREASON(),dcwjxx.getSUBMITDATE(),dcwjxx.getWJID());
        }
    
  • 相关阅读:
    MSSQL 事务说明
    创业课堂之团队
    如何开发HTML编辑器
    IE和Firefox对Documnet,iframe的处理
    jQuery控制iFrame
    如何更高效的制作可通用的HTML页面
    天下武功,无坚不破,唯快不破
    Flash本地通讯
    播放本地MP3 (二)
    播放本地MP3 (一)
  • 原文地址:https://www.cnblogs.com/wuren-best/p/13875729.html
Copyright © 2011-2022 走看看